/* ============================================================
   Isilumko Performance Dashboard — design system
   Brand: crimson #8e182b · charcoal · glass panels · iOS feel
   ============================================================ */

:root {
  /* type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;

  /* light theme */
  --bg: #f1eff0;
  --bg-glow-1: rgba(142, 24, 43, 0.09);
  --bg-glow-2: rgba(50, 55, 60, 0.08);
  --surface: rgba(255, 255, 255, 0.66);
  --surface-solid: #fbfbfa;
  --surface-2: rgba(255, 255, 255, 0.45);
  --surface-border: rgba(255, 255, 255, 0.72);
  --surface-shadow: 0 8px 32px rgba(35, 20, 24, 0.10), 0 1px 2px rgba(35, 20, 24, 0.06);
  --ink: #1a1b1e;
  --ink-2: #43444a;
  --muted: #66676f;
  --hairline: rgba(26, 27, 30, 0.10);
  --accent: #8e182b;
  --accent-strong: #7a1425;
  --accent-soft: rgba(142, 24, 43, 0.10);
  --accent-ink: #8e182b;          /* accent used as text — must hit 4.5:1 */
  --on-accent: #ffffff;
  --good-ink: #1d6b22;
  --bad-ink: #b3261e;
  --warn-ink: #8a5a00;
  --focus-ring: 0 0 0 3px rgba(142, 24, 43, 0.30);

  /* charts */
  --grid: #e5e3e0;
  --axis: #c8c6c2;
  --s1: #c23b50; --s2: #2a78d6; --s3: #eda100;
  --s4: #1baf7a; --s5: #4a3aa7; --s6: #eb6834;
  --f1: #d98a97; --f2: #cc6d7e; --f3: #bb4f64;
  --f4: #a5364d; --f5: #8e182b; --f6: #6f0f20;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* z-scale */
  --z-nav: 40;
  --z-backdrop: 60;
  --z-modal: 70;
  --z-toast: 80;
  --z-tooltip: 90;
}

[data-theme="dark"] {
  --bg: #0e0f11;
  --bg-glow-1: rgba(142, 24, 43, 0.20);
  --bg-glow-2: rgba(64, 82, 110, 0.14);
  --surface: rgba(26, 27, 31, 0.64);
  --surface-solid: #191a1c;
  --surface-2: rgba(38, 39, 44, 0.50);
  --surface-border: rgba(255, 255, 255, 0.09);
  --surface-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
  --ink: #f3f3f5;
  --ink-2: #c9cad0;
  --muted: #999aa2;
  --hairline: rgba(255, 255, 255, 0.10);
  --accent: #a92238;
  --accent-strong: #c02c44;
  --accent-soft: rgba(217, 91, 110, 0.14);
  --accent-ink: #e88296;
  --on-accent: #ffffff;
  --good-ink: #58c05e;
  --bad-ink: #f2827b;
  --warn-ink: #e0a939;
  --focus-ring: 0 0 0 3px rgba(232, 130, 150, 0.35);

  --grid: #2b2c30;
  --axis: #3c3d42;
  --s1: #d95b6e; --s2: #3987e5; --s3: #c98500;
  --s4: #199e70; --s5: #9085e9; --s6: #d95926;
  --f1: #f6c2cb; --f2: #eaa0ae; --f3: #da7f92;
  --f4: #c65e77; --f5: #ae405e; --f6: #942e47;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(56rem 40rem at 110% -12%, var(--bg-glow-1), transparent 62%),
    radial-gradient(48rem 36rem at -14% 108%, var(--bg-glow-2), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms var(--ease), color 240ms var(--ease);
}
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 0.95rem; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
::placeholder { color: var(--muted); opacity: 1; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-s); }

/* ---------- glass panel ---------- */
.glass {
  background: var(--surface);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-l);
  box-shadow: var(--surface-shadow);
}

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  padding: 40px 36px 32px;
  text-align: center;
}
.brand-mark {
  width: 56px; height: 56px;
  border-radius: 16px;
  overflow: hidden;
  display: inline-block; line-height: 0;
  box-shadow: 0 6px 18px rgba(142, 24, 43, 0.35);
  margin-bottom: 16px;
  user-select: none;
  flex: none;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { font-size: 1.35rem; }
.login-sub { color: var(--muted); font-size: 0.88rem; margin: 4px 0 26px; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-error {
  color: var(--bad-ink);
  font-size: 0.85rem;
  min-height: 1.3em;
  text-align: center;
  margin-top: 2px;
}
.login-foot { margin-top: 22px; color: var(--muted); font-size: 0.78rem; }

/* ---------- app shell ---------- */
.shell { max-width: 1280px; margin: 0 auto; padding: 16px 20px 64px; }

.topnav {
  position: sticky; top: 12px; z-index: var(--z-nav);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  margin-bottom: 22px;
}
.topnav .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1rem; letter-spacing: -0.01em;
  margin-right: 6px; white-space: nowrap;
}
.topnav .brand .brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  margin: 0;
}
.brand small { display: block; font-weight: 500; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.01em; }

.dept-switch {
  width: auto; flex: none;
  font-weight: 650; font-size: 0.85rem;
  padding: 7px 30px 7px 12px;
  background-color: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-ink);
}

.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 550; color: var(--ink-2);
  white-space: nowrap;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.tab:hover { background: var(--accent-soft); color: var(--ink); }
.tab[aria-current="page"] { background: var(--accent); color: var(--on-accent); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600; color: var(--muted);
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good-ink);
  animation: pulse 2.4s ease-in-out infinite;
}
.live-dot.off::before { background: var(--muted); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.user-chip { text-align: right; line-height: 1.2; }
.user-chip .name { font-size: 0.85rem; font-weight: 600; }
.user-chip .role { font-size: 0.7rem; color: var(--muted); text-transform: capitalize; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer;
  border-radius: 12px; padding: 9px 18px;
  font-size: 0.9rem; font-weight: 600;
  background: var(--accent); color: var(--on-accent);
  transition: background 160ms var(--ease), transform 120ms var(--ease), box-shadow 160ms var(--ease);
}
.btn:hover { background: var(--accent-strong); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.secondary {
  background: transparent; color: var(--ink);
  border-color: var(--hairline);
}
.btn.secondary:hover { background: var(--accent-soft); }
.btn.ghost { background: transparent; color: var(--ink-2); padding: 8px 10px; border-radius: 10px; }
.btn.ghost:hover { background: var(--accent-soft); color: var(--ink); }
.btn.danger { background: #b3261e; }
.btn.danger:hover { background: #99201a; }
.btn.small { padding: 5px 12px; font-size: 0.8rem; border-radius: 9px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 0;
  display: inline-grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ink-2);
  transition: background 160ms var(--ease);
}
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; }
.rt-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  margin-top: 4px; max-height: 180px; overflow-y: auto;
  background: var(--surface-solid); border: 1px solid var(--hairline);
  border-radius: 10px; box-shadow: var(--surface-shadow);
}
.rt-suggest-item { padding: 8px 12px; font-size: 0.85rem; cursor: pointer; }
.rt-suggest-item:hover { background: var(--accent-soft); color: var(--ink); }
.field > label { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--accent-ink); }
.check-field {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 600; color: var(--ink-2);
  padding: 9px 12px;
  border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}
.check-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
  outline: none;
}
select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2388888f' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}
textarea { resize: vertical; min-height: 64px; }

.form-grid {
  display: grid; gap: 14px 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.form-grid .span-2 { grid-column: 1 / -1; }

/* ---------- layout blocks ---------- */
.view { animation: view-in 280ms var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 4px 2px 18px; }
.page-head .sub { color: var(--muted); font-size: 0.85rem; margin-top: 3px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.panel { padding: 20px 22px; margin-bottom: 18px; }
.panel > h2 { margin-bottom: 4px; }
.panel .panel-sub { color: var(--muted); font-size: 0.82rem; margin-bottom: 14px; }

.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------- KPI tiles ---------- */
.kpis {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}
.kpi {
  padding: 16px 18px 14px;
  border-radius: var(--radius-m);
}
.kpi .kpi-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.kpi .kpi-value {
  font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  margin: 2px 0 1px;
}
.kpi .kpi-target { font-size: 0.75rem; color: var(--muted); }
.kpi .kpi-meter {
  height: 5px; border-radius: 999px; background: var(--hairline);
  margin-top: 10px; overflow: hidden;
}
.kpi .kpi-meter > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--accent);
  transition: width 500ms var(--ease);
}
.kpi .kpi-meter > i.done { background: var(--good-ink); }
.kpi .kpi-pct { font-size: 0.72rem; font-weight: 600; margin-top: 5px; color: var(--muted); }
.kpi .kpi-pct.done { color: var(--good-ink); }

/* ---------- conversion strip ---------- */
.conv-strip {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: var(--radius-m);
  margin-bottom: 18px;
}
.conv-chip { display: grid; justify-items: center; gap: 1px; padding: 2px 14px; }
.conv-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.conv-label { font-size: 0.74rem; font-weight: 600; color: var(--ink-2); }
.conv-arrow { color: var(--muted); font-size: 1.1rem; }

/* ---------- charts ---------- */
.chart-block h3 { margin-bottom: 2px; }
.chart-sub { font-size: 0.78rem; color: var(--muted); margin-bottom: 12px; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font); }
.chart-empty {
  display: grid; place-items: center; min-height: 150px;
  color: var(--muted); font-size: 0.85rem; text-align: center;
  border: 1.5px dashed var(--hairline); border-radius: var(--radius-m);
  padding: 18px;
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.legend .li { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--ink-2); }
.legend .li i { width: 10px; height: 10px; border-radius: 3.5px; flex: none; }
.legend .li b { color: var(--ink); font-weight: 650; }
.legend .li .pct { color: var(--muted); }

.chart-tooltip {
  position: fixed; z-index: var(--z-tooltip);
  pointer-events: none;
  background: var(--surface-solid);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: var(--surface-shadow);
  padding: 7px 11px;
  font-size: 0.78rem; line-height: 1.45;
  max-width: 240px;
}
.chart-tooltip b { display: block; }
.chart-tooltip .tt-muted { color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-m); border: 1px solid var(--hairline); }
table.data {
  width: 100%; border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 720px;
}
/* fluid tables fit the page width; .table-wrap still scrolls on small screens */
table.data.fluid { min-width: 0; }
table.data.compact th { padding: 8px 9px; }
table.data.compact td { padding: 8px 9px; }
.cell-sub {
  display: block;
  font-size: 0.73rem;
  color: var(--muted);
  margin-top: 1px;
  line-height: 1.35;
}
table.data th {
  text-align: left; font-size: 0.72rem; font-weight: 650;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  background: var(--surface-solid);
}
table.data td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background 120ms var(--ease); }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data input[type="number"] { padding: 5px 8px; border-radius: 8px; max-width: 116px; text-align: right; }
table.role-tracker-table tr.role-group-start td { border-top: 2px solid var(--hairline); }
table.role-tracker-table tr.role-group-start:first-child td { border-top: none; }
table.role-tracker-table input[type="date"] { padding: 5px 8px; border-radius: 8px; }
/* Highlight the whole role group together on hover, not just whichever
   single sub-row the mouse happens to be over (see wireRoleTracker). */
table.role-tracker-table tbody tr:hover { background: transparent; }
table.role-tracker-table tbody tr.role-row-hover > td { background: var(--accent-soft); }
.rt-field { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; text-align: center; }
.rt-field-has-value { flex-direction: column; align-items: center; gap: 4px; }
.rt-field-edit { flex-direction: column; align-items: flex-start; gap: 6px; }
.rt-field-edit .rt-input { width: 100%; }
.rt-field-actions { display: flex; gap: 6px; }
.rt-edit, .rt-save, .rt-comment-save {
  border-color: var(--accent) !important; color: var(--accent-ink) !important;
}
.rt-edit:hover, .rt-save:hover, .rt-comment-save:hover { background: var(--accent-soft) !important; }

.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-head-row .actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

table.role-tracker-table th.rt-sortable { cursor: pointer; user-select: none; }
table.role-tracker-table th.rt-sortable:hover { color: var(--ink); }
.rt-toolbar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rt-view-toggle { display: flex; gap: 6px; align-items: center; }
.rt-view-toggle .rt-view-all { margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--hairline); border-radius: 0; opacity: 0.6; }
.rt-view-toggle .rt-view-all:hover { opacity: 1; }
.rt-view-toggle .rt-view-all.active { opacity: 1; text-decoration: underline; color: var(--ink); }
.rt-week-nav { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.rt-week-nav .btn { padding: 5px 10px; }
.rt-export-btn { box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent); }

.rt-lock-badge { font-size: 0.78rem; opacity: 0.7; cursor: default; }
.rt-sort-reset {
  background: transparent; border: 1px solid var(--hairline); border-radius: 6px;
  font-size: 0.78rem; line-height: 1; padding: 2px 5px;
  color: var(--ink-2); cursor: pointer; vertical-align: middle;
}
.rt-sort-reset:hover { color: var(--ink); border-color: var(--ink-2); }
.rt-comment-toggle {
  background: transparent; border: 1px solid var(--hairline); border-radius: 10px;
  font-size: 1.05rem; line-height: 1; padding: 6px 9px; cursor: pointer;
  opacity: 0.55; transition: opacity 120ms var(--ease), background 120ms var(--ease);
}
.rt-comment-toggle:hover { opacity: 1; background: var(--accent-soft); }
.rt-comment-toggle.has-comment { opacity: 1; background: var(--accent-soft); border-color: var(--accent); }
.rt-comment-open { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.rt-comment-input { width: 100%; min-height: 64px; resize: vertical; }

.banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border: 1px solid var(--warn-ink); border-radius: 14px;
  background: color-mix(in srgb, var(--warn-ink) 12%, transparent);
  margin-bottom: 18px;
}

/* Month-end export checklist — persistent floating widget, admin only */
.checklist-widget { position: fixed; right: 20px; bottom: 20px; z-index: var(--z-nav); }
.checklist-toggle {
  display: flex; align-items: center; gap: 6px; padding: 10px 16px;
  border-radius: 999px; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--ink); font-weight: 650; font-size: 0.85rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); cursor: pointer;
}
.checklist-toggle.complete { border-color: var(--good-ink); color: var(--good-ink); }
.checklist-panel {
  position: absolute; right: 0; bottom: calc(100% + 10px); width: 340px;
  padding: 16px; border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}
.checklist-panel h4 { margin: 0 0 4px; }
.checklist-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 4%, transparent);
  font-size: 0.85rem;
}
.checklist-list li.done { opacity: 0.65; }
.checklist-list li label { display: flex; align-items: center; gap: 8px; }
.checklist-list-wide li { font-size: 0.92rem; padding: 10px 14px; }
.checklist-widget-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 8px; }
.reset-scope-list { margin: 10px 0 18px; padding-left: 20px; color: var(--ink-2); font-size: 0.92rem; line-height: 1.8; }
.banner-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.banner-body { flex: 1; }
.banner-body b { display: block; margin-bottom: 2px; }
.banner-body p { margin: 0; color: var(--ink-2); font-size: 0.88rem; line-height: 1.5; }

.stage-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 650; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent-ink);
}
.stage-pill.hired { background: rgba(29, 107, 34, 0.14); color: var(--good-ink); }
.stage-pill.dead { background: rgba(179, 38, 30, 0.12); color: var(--bad-ink); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 150px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group span { font-size: 0.72rem; font-weight: 650; color: var(--muted); }
.filter-group input, .filter-group select { min-width: 140px; }

.row-actions { display: flex; gap: 4px; }
.row-actions .icon-btn { width: 28px; height: 28px; border-radius: 8px; }

/* ---------- misc ---------- */
.pill-note {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  padding: 3px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.rating { font-weight: 700; }
.rating.exceeding { color: var(--good-ink); }
.rating.on-track { color: var(--good-ink); }
.rating.behind { color: var(--warn-ink); }
.rating.at-risk { color: var(--bad-ink); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .big { font-size: 2rem; margin-bottom: 8px; }
.empty-state h3 { color: var(--ink); margin-bottom: 4px; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: var(--z-toast);
  display: grid; gap: 8px; justify-items: center;
}
.toast {
  background: var(--surface-solid); color: var(--ink);
  border: 1px solid var(--hairline);
  box-shadow: var(--surface-shadow);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.85rem; font-weight: 550;
  display: flex; gap: 8px; align-items: center;
  animation: toast-in 300ms var(--ease);
}
.toast.err { color: var(--bad-ink); }
.toast.ok::before { content: "✓"; color: var(--good-ink); font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: var(--z-backdrop);
  background: rgba(10, 8, 9, 0.42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
  animation: fade-in 200ms var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  z-index: var(--z-modal);
  width: min(440px, 100%);
  padding: 26px 26px 22px;
  animation: view-in 260ms var(--ease);
}
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--ink-2); font-size: 0.9rem; margin-bottom: 16px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- report (screen preview) ---------- */
.report-doc {
  background: #ffffff; color: #17181a;
  border-radius: var(--radius-m);
  padding: 44px 48px;
  box-shadow: var(--surface-shadow);
  max-width: 860px; margin: 0 auto;
}
.report-doc h1 { font-size: 1.6rem; color: #6f0f20; }
.report-doc h2 { font-size: 1.1rem; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #8e182b; }
.report-doc h3 { font-size: 0.95rem; margin: 16px 0 6px; }
.report-doc .rep-meta { color: #66676f; font-size: 0.85rem; margin: 4px 0 10px; }
.report-doc table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 8px 0 14px; }
.report-doc th { text-align: left; font-size: 0.72rem; color: #66676f; padding: 6px 8px; border-bottom: 1.5px solid #d7d5d2; }
.report-doc td { padding: 6px 8px; border-bottom: 1px solid #e8e6e3; }
.report-doc td.num, .report-doc th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-doc .commentary { font-size: 0.88rem; line-height: 1.65; max-width: 72ch; }
.report-doc .recruiter-section { page-break-before: always; break-before: page; padding-top: 8px; }
.report-doc .rep-rating { font-weight: 700; }

/* Role Tracker PDF export: wider spacing, and a darker rule between role
   groups so each role's block reads as one unit on the printed page. */
.rt-report-table { table-layout: fixed; }
.rt-report-table th, .rt-report-table td { padding: 10px 12px; }
.rt-report-table td { vertical-align: top; overflow-wrap: break-word; }
.rt-report-table tr.rt-report-group-start td { border-top: 2px solid #6f0f20; }
.rt-report-table tr.rt-report-group-start:first-child td { border-top: none; }
.rt-report-table col.rt-col-role, .rt-report-table col.rt-col-client { width: 12%; }
.rt-report-table col.rt-col-candidate, .rt-report-table col.rt-col-recruiter { width: 11%; }
.rt-report-table col.rt-col-date, .rt-report-table col.rt-col-received, .rt-report-table col.rt-col-deadline { width: 8%; }
.rt-report-table col.rt-col-value, .rt-report-table col.rt-col-stage { width: 9%; }
.rt-report-table col.rt-col-comment { width: 12%; }

/* ---------- print: only the report ---------- */
@media print {
  body { background: #fff !important; }
  .topnav, .page-head .actions, .toasts, .chart-tooltip, .no-print { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .report-doc { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .view { animation: none; }
}

/* Role Tracker PDF export: hide everything except the Role Tracker
   section itself, pulled to the top of the printed page. */
.rt-pdf-doc-offscreen { position: absolute; left: -99999px; top: 0; }
@media print {
  body.rt-print-only * { visibility: hidden !important; }
  body.rt-print-only .rt-print-target,
  body.rt-print-only .rt-print-target * { visibility: visible !important; }
  body.rt-print-only .rt-print-target {
    position: absolute; left: 0; top: 0; width: 100%;
    box-shadow: none; border: none; background: #fff !important;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .shell { padding: 10px 12px 48px; }
  .topnav { flex-wrap: wrap; top: 6px; }
  .user-chip { display: none; }
  .panel { padding: 16px; }
  .report-doc { padding: 24px 20px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
