:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #667085;
  --line: #d8dee9;
  --accent: #0f766e;
  --accent-2: #2563eb;
  --warn: #b45309;
  --danger: #b91c1c;
  --good: #047857;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  background: #101828;
  color: #eef4ff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 82px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 800;
  padding: 7px;
}

.brand-mark img {
  width: 100%;
  height: auto;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand span:last-child {
  margin-top: 2px;
  color: #b7c4d8;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  width: 100%;
  border: 0;
  color: #dbe7ff;
  background: transparent;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 86px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-right,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-right {
  position: relative;
  min-width: 0;
}

.filter-menu {
  position: relative;
}

.filter-menu summary {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-menu-panel {
  position: fixed;
  top: 74px;
  right: 76px;
  width: min(560px, calc(100vw - 376px));
  max-height: calc(100vh - 94px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  z-index: 40;
}

.filter-menu-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-menu-title span {
  color: var(--muted);
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.content {
  padding: 24px 28px 36px;
  display: grid;
  gap: 18px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

.empty-state,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.empty-state {
  max-width: 720px;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
}

.login-panel {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  display: grid;
  gap: 14px;
}

.login-card img {
  width: 140px;
  height: auto;
}

.login-card label,
.settings-form label,
.upload-form {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="url"],
input[type="number"],
input[type="datetime-local"],
input[type="file"] {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 10px;
  color: var(--ink);
}

.primary-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  padding: 0 14px;
}

.secondary-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  padding: 0 12px;
}

#login-error {
  color: var(--danger);
  min-height: 18px;
}

.upload-form,
.settings-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.check-line {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--ink) !important;
}

.result-box {
  margin-top: 10px;
  min-height: 42px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  white-space: pre-wrap;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  min-width: 0;
}

.metrics-grid.compact {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin: 16px 0;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}

.metric span,
.list-row span,
.timeline-item span,
.graph-node span,
.detail p {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 26px;
  letter-spacing: 0;
  line-height: 1.15;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.metrics-grid.compact .metric strong {
  font-size: 18px;
  line-height: 1.25;
}

.metric.good strong,
.badge.good {
  color: var(--good);
}

.metric.warn strong,
.badge.warn {
  color: var(--warn);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.split.wide-left {
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.4fr);
}

.card h2,
.card h3 {
  margin-bottom: 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.card h3 {
  margin-top: 18px;
  font-size: 15px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  margin: 2px 3px 2px 0;
}

.avatar {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: #e5edf5;
  box-shadow: 0 0 0 1px var(--line);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-sm {
  width: 42px;
  height: 42px;
}

.avatar-md {
  width: 56px;
  height: 56px;
}

.avatar-xl {
  width: 84px;
  height: 84px;
}

.person-cell,
.detail-person,
.kanban-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.person-cell > div,
.detail-person > div,
.kanban-card-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.person-cell strong,
.kanban-card-head strong {
  overflow-wrap: anywhere;
}

.person-cell span,
.kanban-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.person-link {
  text-align: left;
}

.list {
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.list-row {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.list-row-main {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.list-row.active,
.list-row:hover {
  border-color: var(--line);
  background: #f8fafc;
}

.profile-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-links-compact {
  margin-left: 52px;
}

.profile-links-detail {
  margin: 2px 0 12px;
}

.profile-link {
  width: 30px;
  min-width: 30px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.profile-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chips {
  margin-top: 14px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.filter-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-grid input,
.filter-grid select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 6px 8px;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-panel-topbar {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.filter-panel-topbar .filter-grid {
  grid-template-columns: repeat(2, minmax(170px, 1fr));
}

.entity-head,
.action-buttons,
.quick-actions,
.kanban-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.entity-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.entity-head h2 {
  margin: 0;
}

.action-buttons {
  justify-content: flex-end;
}

.quick-actions {
  margin: 12px 0 4px;
}

.icon-action {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-weight: 900;
}

.icon-action:hover,
.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.46);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.modal-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

textarea {
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px 10px;
  color: var(--ink);
  resize: vertical;
}

select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 10px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(292px, 1fr);
  gap: 14px;
  overflow: auto;
  padding: 2px 2px 10px;
}

.kanban-column {
  min-height: 360px;
  --kanban-bg: #eef6ff;
  --kanban-accent: #5b8def;
  --kanban-card-bg: #ffffff;
  background: var(--kanban-bg);
  border: 1px solid rgba(21, 32, 51, 0.08);
  border-radius: 8px;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.kanban-sourcing {
  --kanban-bg: #e9fbf3;
  --kanban-accent: #10b981;
}

.kanban-screening {
  --kanban-bg: #eaf6ff;
  --kanban-accent: #38bdf8;
}

.kanban-client-review {
  --kanban-bg: #f2efff;
  --kanban-accent: #8b5cf6;
}

.kanban-interview {
  --kanban-bg: #fff1e8;
  --kanban-accent: #fb923c;
}

.kanban-offer {
  --kanban-bg: #fff8db;
  --kanban-accent: #eab308;
}

.kanban-hire {
  --kanban-bg: #ecfdf5;
  --kanban-accent: #059669;
}

.kanban-reject {
  --kanban-bg: #fff1f2;
  --kanban-accent: #f43f5e;
}

.kanban-hold,
.kanban-default {
  --kanban-bg: #f4f7fb;
  --kanban-accent: #64748b;
}

.kanban-vacancy,
.kanban-client {
  --kanban-bg: #eef2ff;
  --kanban-accent: #6366f1;
}

.kanban-recruiter {
  --kanban-bg: #fdf2f8;
  --kanban-accent: #ec4899;
}

.kanban-source {
  --kanban-bg: #ecfeff;
  --kanban-accent: #06b6d4;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}

.kanban-column header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.kanban-column header strong {
  overflow-wrap: anywhere;
}

.kanban-column header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.kanban-column header > span {
  min-width: 30px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--kanban-accent);
  font-size: 12px;
  font-weight: 900;
}

.kanban-card {
  background: var(--kanban-card-bg);
  border: 1px solid rgba(21, 32, 51, 0.08);
  border-left: 4px solid var(--kanban-accent);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.kanban-card[draggable="false"] {
  cursor: default;
}

.kanban-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.kanban-candidate-link {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.kanban-candidate-link > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.kanban-candidate-link strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.kanban-candidate-link em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.kanban-candidate-link:hover strong {
  color: var(--accent);
}

.kanban-card-tools {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 28px);
  gap: 6px;
  max-width: 100%;
}

.kanban-card-tools .icon-action {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: #f8fafc;
  font-size: 14px;
  line-height: 1;
  overflow: hidden;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
}

.kanban-next-action {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
  background: color-mix(in srgb, var(--kanban-accent) 9%, #ffffff);
}

.kanban-next-action span {
  color: var(--kanban-accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.kanban-next-action strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.kanban-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  gap: 6px;
}

.kanban-card-actions select {
  min-width: 0;
  width: 100%;
}

.kanban-card-actions .icon-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  overflow: hidden;
}

.kanban-card-actions .badge {
  min-width: 0;
  justify-content: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.kanban-card span {
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 3px solid var(--accent);
  padding: 8px 0 8px 12px;
}

.timeline-item p {
  color: var(--muted);
  margin-top: 4px;
}

.graph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.graph-node {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.graph-node.center {
  border-color: var(--accent);
  background: #ecfdf5;
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .filter-menu-panel {
    top: 112px;
    right: 28px;
    left: 28px;
    width: calc(100vw - 56px);
    max-height: calc(100vh - 132px);
  }

  .filter-panel-topbar .filter-grid {
    grid-template-columns: 1fr;
  }

  .metrics-grid,
  .metrics-grid.compact,
  .split,
  .split.wide-left {
    grid-template-columns: 1fr;
  }
}
