/* ============================================================
   Epitome Linkages — Recruitment Platform Design System
   ------------------------------------------------------------
   Palette grounded in "signal & evidence": a deep navy command
   layer, a working blue for structure, and a single teal accent
   reserved for match-quality signals (scores, progress, success
   states) so it always means "a number worth reading."
   ============================================================ */

:root {
  /* --- Color tokens --- */
  --color-navy-950: #0b1b2e;
  --color-navy-900: #0f2942;
  --color-navy-800: #16324f;
  --color-blue-600: #1d5c8c;
  --color-blue-500: #2c74ac;
  --color-teal-500: #17a3a0;
  --color-teal-600: #128683;
  --color-teal-100: #e2f6f4;

  --color-success-600: #2e9e5b;
  --color-success-100: #e5f6ec;
  --color-warning-600: #b9791a;
  --color-warning-100: #fbf0dd;
  --color-danger-600: #c14343;
  --color-danger-100: #fbe8e8;

  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-surface-sunken: #eef1f5;
  --color-border: #dde3ea;
  --color-border-strong: #c3ccd6;

  --color-text: #17232f;
  --color-text-muted: #5b6b7c;
  --color-text-faint: #8a97a5;
  --color-text-on-dark: #eaf1f7;
  --color-text-on-dark-muted: #a9bdd0;

  /* --- Type --- */
  --font-display: "Manrope", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  /* --- Layout --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 41, 66, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 41, 66, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 41, 66, 0.14);
  --sidebar-width: 248px;
  --topbar-height: 64px;
}

/* ============================================================ Reset ==== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-navy-900);
  line-height: 1.2;
  margin: 0 0 0.4em;
  font-weight: 700;
}
h1 { font-size: 2.1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--color-text-muted); max-width: 68ch; }
a { color: var(--color-blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding-left: 1.2em; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--color-teal-500); outline-offset: 2px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============================================================ Buttons == */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-navy-900); color: #fff; }
.btn-primary:hover { background: var(--color-navy-800); text-decoration: none; }
.btn-accent { background: var(--color-teal-500); color: #fff; }
.btn-accent:hover { background: var(--color-teal-600); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--color-navy-900); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-surface-sunken); text-decoration: none; }
.btn-danger { background: #fff; color: var(--color-danger-600); border-color: var(--color-danger-100); }
.btn-danger:hover { background: var(--color-danger-100); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-surface-sunken); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ============================================================ Forms ==== */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 0.82rem; font-weight: 600; color: var(--color-navy-900);
  margin-bottom: 6px;
}
.field .hint { font-size: 0.78rem; color: var(--color-text-faint); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; font-family: var(--font-body); font-size: 0.92rem;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--color-text);
}
input:focus, select:focus, textarea:focus { border-color: var(--color-teal-500); }
textarea { resize: vertical; min-height: 90px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 200px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.error-text { color: var(--color-danger-600); font-size: 0.85rem; margin-top: 6px; }

/* ============================================================ Cards ==== */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 22px;
}
.card-flush { padding: 0; overflow: hidden; }
.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-label { font-size: 0.8rem; color: var(--color-text-faint); font-weight: 600; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--color-navy-900); }
.stat-card .stat-delta { font-size: 0.8rem; color: var(--color-text-muted); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ============================================================ Badges == */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 100px; font-size: 0.76rem; font-weight: 700;
}
.badge-excellent, .badge-shortlisted { background: var(--color-success-100); color: var(--color-success-600); }
.badge-strong { background: var(--color-teal-100); color: var(--color-teal-600); }
.badge-good { background: #eaf1fb; color: var(--color-blue-600); }
.badge-partial { background: var(--color-warning-100); color: var(--color-warning-600); }
.badge-low, .badge-rejected { background: var(--color-danger-100); color: var(--color-danger-600); }
.badge-neutral, .badge-submitted { background: var(--color-surface-sunken); color: var(--color-text-muted); }
.badge-verification { background: var(--color-warning-100); color: var(--color-warning-600); }

/* ============================================================ Progress = */
.score-bar { height: 8px; border-radius: 100px; background: var(--color-surface-sunken); overflow: hidden; }
.score-bar > span { display: block; height: 100%; background: var(--color-teal-500); border-radius: 100px; }
.score-ring { position: relative; width: 64px; height: 64px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-ring-track { stroke: var(--color-surface-sunken); }
.score-ring .score-ring-value { stroke: var(--color-teal-500); stroke-linecap: round; }
.score-ring .score-ring-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; color: var(--color-navy-900);
}

/* ============================================================ Tables == */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left; font-size: 0.76rem; font-weight: 700; color: var(--color-text-faint);
  padding: 12px 16px; border-bottom: 1px solid var(--color-border);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable-row { cursor: pointer; transition: background-color 0.1s ease; }
tr.clickable-row:hover { background: var(--color-surface-sunken); }
.table-scroll { overflow-x: auto; }

/* ============================================================ Nav ====== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; background: var(--color-navy-900);
  color: var(--color-text-on-dark); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 22px 0;
}
.sidebar .brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  padding: 0 22px 22px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 12px;
}
.sidebar .brand .brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--color-teal-500);
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.sidebar nav a {
  color: var(--color-text-on-dark-muted); padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 10px;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--color-teal-500); color: #fff; }
.sidebar .sidebar-footer { padding: 12px 22px 0; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar .user-chip { font-size: 0.82rem; color: var(--color-text-on-dark-muted); }
.sidebar .user-chip strong { display: block; color: #fff; font-size: 0.88rem; }

.main-panel { flex: 1; min-width: 0; }
.topbar {
  height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--color-border); background: var(--color-surface);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.page-content { padding: 28px; max-width: 1280px; }

/* Public site nav (landing, login, register) */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
}
.site-header .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; color: var(--color-navy-900); font-size: 1.1rem; }
.site-header .brand .brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--color-navy-900);
  color: var(--color-teal-500); display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.site-header nav { display: flex; gap: 10px; align-items: center; }

/* ============================================================ Tabs ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 20px; }
.tabs button {
  background: none; border: none; padding: 10px 16px; font-size: 0.88rem; font-weight: 600;
  color: var(--color-text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--color-navy-900); border-color: var(--color-teal-500); }

/* ============================================================ Modal === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11, 27, 46, 0.5); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); max-width: 560px; width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--color-text-faint); }

/* ============================================================ Toasts == */
.toast-stack { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--color-navy-900); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 0.88rem; box-shadow: var(--shadow-md); max-width: 340px; animation: toast-in 0.2s ease;
}
.toast.toast-success { background: var(--color-success-600); }
.toast.toast-error { background: var(--color-danger-600); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================ Empty === */
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.empty-state h3 { color: var(--color-navy-900); margin-bottom: 6px; }

/* ============================================================ Utility = */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.divider { height: 1px; background: var(--color-border); margin: 20px 0; border: none; }
.skeleton { background: linear-gradient(90deg, var(--color-surface-sunken) 25%, #f7f9fb 37%, var(--color-surface-sunken) 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -100%; transition: left 0.2s ease; z-index: 50; }
  .sidebar.open { left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-content { padding: 18px; }
}
