/* Sync Talent Recruit - calm enterprise design system. No gradients, no AI glow. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e2e5ea;
  --border-strong: #cbd1db;
  --text: #1a1d24;
  --text-muted: #5b6472;
  --text-faint: #8b93a1;
  --accent: #2f5fd6;
  --accent-hover: #2650b8;
  --accent-soft: #eaf0fe;
  --strong: #1b8a5a;
  --strong-soft: #e6f5ed;
  --review: #b5760a;
  --review-soft: #fdf3e3;
  --weak: #8b93a1;
  --weak-soft: #eef0f3;
  --danger: #c53434;
  --danger-soft: #fbeaea;
  --warn: #b5760a;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 32, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 24, 32, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1c1f27;
    --border: #2a2e38;
    --border-strong: #3a3f4b;
    --text: #e7e9ee;
    --text-muted: #9aa2b1;
    --text-faint: #6b7280;
    --accent: #6d93f2;
    --accent-hover: #86a6f5;
    --accent-soft: #1c2740;
    --strong: #4fbf8a;
    --strong-soft: #12291f;
    --review: #d9a441;
    --review-soft: #2e2410;
    --weak: #6b7280;
    --weak-soft: #20232b;
    --danger: #e5695f;
    --danger-soft: #2e1616;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a21; --surface-2: #1c1f27; --border: #2a2e38;
  --border-strong: #3a3f4b; --text: #e7e9ee; --text-muted: #9aa2b1; --text-faint: #6b7280;
  --accent: #6d93f2; --accent-hover: #86a6f5; --accent-soft: #1c2740;
  --strong: #4fbf8a; --strong-soft: #12291f; --review: #d9a441; --review-soft: #2e2410;
  --weak: #6b7280; --weak-soft: #20232b; --danger: #e5695f; --danger-soft: #2e1616;
}
:root[data-theme="light"] {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #fafbfc; --border: #e2e5ea;
  --border-strong: #cbd1db; --text: #1a1d24; --text-muted: #5b6472; --text-faint: #8b93a1;
  --accent: #2f5fd6; --accent-hover: #2650b8; --accent-soft: #eaf0fe;
  --strong: #1b8a5a; --strong-soft: #e6f5ed; --review: #b5760a; --review-soft: #fdf3e3;
  --weak: #8b93a1; --weak-soft: #eef0f3; --danger: #c53434; --danger-soft: #fbeaea;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  padding: 18px 20px 14px; font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand span { color: var(--text-muted); font-weight: 500; }
.sidebar-nav { padding: 10px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius); color: var(--text-muted);
  font-weight: 500; margin-bottom: 2px;
}
.sidebar-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.sidebar-nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); font-size: 12.5px; }
.sidebar-footer .user-row { display: flex; align-items: center; justify-content: space-between; }
.sidebar-footer button {
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 12px;
}
.sidebar-footer button:hover { color: var(--text); }
.badge {
  background: var(--accent); color: #fff; border-radius: 10px; font-size: 10.5px;
  padding: 1px 6px; font-weight: 600; min-width: 16px; text-align: center;
}
.badge.muted { background: var(--border-strong); color: var(--text-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.topbar h1 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.topbar-meta { color: var(--text-muted); font-size: 12.5px; }
.content { padding: 20px 24px 60px; max-width: 1320px; width: 100%; margin: 0 auto; }

.mobile-menu-btn { display: none; background: none; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 6px 9px; cursor: pointer; color: var(--text); margin-right: 8px; }
.sidebar-scrim { display: none; }

@media (max-width: 760px) {
  .app-shell { position: relative; overflow-x: hidden; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 40; width: 240px;
    transform: translateX(-100%); transition: transform 0.18s ease; box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.open {
    display: block; position: fixed; inset: 0; background: rgba(15,17,21,0.35); z-index: 39;
  }
  .mobile-menu-btn { display: inline-flex; align-items: center; }
  .topbar { padding: 12px 14px; }
  .content { padding: 14px 14px 40px; }
  .topbar h1 { font-size: 14.5px; }
}

/* ---------- cards, panels ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; margin-bottom: 14px;
}
.card-title {
  font-size: 12.5px; font-weight: 650; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.03em; margin: 0 0 10px;
}
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (min-width: 621px) and (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }

.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.stat-tile .n { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat-tile .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 650; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.clickable { cursor: pointer; }
.table-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.table-empty .action { margin-top: 10px; }

/* ---------- chips / bands / confidence ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.6;
}
.chip-skill { background: var(--weak-soft); color: var(--text-muted); }
.chip-missing { background: var(--danger-soft); color: var(--danger); }
.band { padding: 3px 9px; border-radius: 5px; font-size: 11.5px; font-weight: 650; }
.band-strong { background: var(--strong-soft); color: var(--strong); }
.band-review { background: var(--review-soft); color: var(--review); }
.band-weak { background: var(--weak-soft); color: var(--text-muted); }
.stage-tag { padding: 3px 9px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.stage-tag.rejected { background: var(--danger-soft); color: var(--danger); }
.stage-tag.joined, .stage-tag.offered { background: var(--strong-soft); color: var(--strong); }

.ai-proposed {
  border-bottom: 1px dashed var(--accent); cursor: help;
}
.confidence-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; }
.confidence-dot.low { background: var(--warn); }
.confidence-dot.high { background: var(--strong); }
.freshness { font-size: 11px; color: var(--text-faint); }
.freshness.stale { color: var(--warn); }

/* ---------- forms ---------- */
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
input[type=text], input[type=number], input[type=password], input[type=email],
input[type=date], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; font-family: var(--mono); font-size: 12.5px; }
.hint { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 12.5px; cursor: pointer; line-height: 1.4;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 4px 9px; font-size: 11.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { padding: 6px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; min-width: 130px; }
.toggle-chip {
  padding: 5px 11px; border-radius: 100px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-muted);
}
.toggle-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- modal / drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,17,21,0.4); display: none;
  align-items: flex-start; justify-content: center; z-index: 50; padding: 40px 20px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; border: 1px solid var(--border);
}
.modal-lg { max-width: 860px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 18px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
.modal-header h3 { margin: 0; font-size: 14.5px; }
.modal-body { padding: 18px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border);
  position: sticky; bottom: 0; background: var(--surface);
}
.close-x { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 18px; padding: 2px 6px; }

/* ---------- match row / expand ---------- */
.match-row-detail {
  padding: 12px 16px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: 12.5px;
}
.dim-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.dim-label { width: 110px; flex-shrink: 0; color: var(--text-muted); font-size: 11.5px; }
.dim-track { flex: 1; height: 6px; background: var(--weak-soft); border-radius: 4px; overflow: hidden; }
.dim-fill { height: 100%; background: var(--accent); }
.dim-fill.unknown { background: repeating-linear-gradient(45deg, var(--border-strong), var(--border-strong) 3px, transparent 3px, transparent 6px); }
.dim-val { width: 36px; text-align: right; color: var(--text-faint); font-size: 11px; }
.explain-box { background: var(--accent-soft); border-radius: var(--radius); padding: 10px 12px; margin-top: 8px; font-size: 12.5px; color: var(--text); }

/* ---------- states ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--text); font-size: 14.5px; margin: 8px 0 4px; }
.banner {
  padding: 9px 14px; border-radius: var(--radius); font-size: 12.5px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.banner-warn { background: var(--review-soft); color: var(--review); }
.banner-danger { background: var(--danger-soft); color: var(--danger); }
.banner-info { background: var(--accent-soft); color: var(--accent); }
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text); color: var(--bg); padding: 9px 14px; border-radius: var(--radius);
  font-size: 12.5px; box-shadow: var(--shadow-md); max-width: 320px;
}
.toast.error { background: var(--danger); color: #fff; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: var(--radius); height: 14px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 11.5px; }
.mono { font-family: var(--mono); }
.section-title { font-size: 13px; font-weight: 650; margin: 18px 0 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; }
.mb-0 { margin-bottom: 0; }
