/* ============================================================
   Awareness Assessment Portal — design system
   Voice: precision instrument for compliance operations.
   UI face: Inter (variable) · Data face: JetBrains Mono
   ============================================================ */

@font-face {
  font-family: "Inter var";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono var";
  src: url("/static/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Workspace */
  --page: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --ink: #0e1626;
  --ink-2: #485061;
  --muted: #8a92a3;
  --hairline: #e5e8ee;
  --hairline-2: #eef0f4;

  /* Brand (sampled from the Aptia logo): navy primaries, green accents */
  --primary: #003648;
  --primary-strong: #00506b;
  --primary-deep: #002a38;
  --primary-soft: #e8f1f5;
  --accent: #00d277;
  --accent-strong: #007a48;
  --accent-deep: #00563d;
  --accent-soft: #e0f9ec;
  --signal: linear-gradient(90deg, #003648 0%, #00795c 45%, #00d277 100%);

  /* Sidebar (instrument panel) */
  --panel: #06202b;
  --panel-2: #0a2c3a;
  --panel-ink: #a9c3cd;
  --panel-ink-dim: #5f7d88;
  --panel-line: rgba(169, 195, 205, 0.13);

  /* Status */
  --good: #0ca30c;
  --good-text: #006300;
  --good-soft: #e7f5e7;
  --warning: #fab219;
  --warning-text: #7d5a00;
  --warning-soft: #fdf3da;
  --critical: #d03b3b;
  --critical-soft: #fbe9e9;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(6, 32, 43, 0.05), 0 2px 8px rgba(6, 32, 43, 0.04);
  --shadow-md: 0 2px 4px rgba(6, 32, 43, 0.05), 0 12px 32px -8px rgba(6, 32, 43, 0.12);
  --font: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono var", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-feature-settings: "cv11", "ss01";
  background: var(--page);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.022em; margin: 0 0 4px; }
h2 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.012em; margin: 0 0 12px; }
h3 { font-size: 12px; font-weight: 650; margin: 6px 0 4px; color: var(--ink-2);
     text-transform: uppercase; letter-spacing: 0.08em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* The signal strip — the brand thread on every page */
.signal-strip { height: 3px; background: var(--signal); }

/* Mono data voice */
.mono, td.num, .tile .value, .timer, code.link, .q-key {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

/* Eyebrow micro-labels */
.eyebrow {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
}

/* ============ Admin shell ============ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 30%);
  color: var(--panel-ink);
  display: flex; flex-direction: column;
  padding: 0 12px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar::before { content: ""; display: block; height: 3px; margin: 0 -12px;
  background: var(--signal); }
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 10px 16px; margin-bottom: 10px;
  border-bottom: 1px solid var(--panel-line);
}
.sidebar .brand .mark {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px;
  background: linear-gradient(135deg, #00d277, #007a48);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 210, 119, 0.35);
}
.sidebar .brand .mark svg { width: 17px; height: 17px; stroke: #fff; }
.brand-mark-img { width: 34px; height: auto; flex-shrink: 0; }
.auth-logo { height: 92px; width: auto; margin: 0 auto 14px; display: block; }
.assess-mark-img { height: 26px; width: auto; }
.sidebar .brand .name { color: #fff; font-weight: 650; font-size: 13.5px;
  line-height: 1.25; letter-spacing: -0.01em; }
.sidebar .brand .name small {
  display: block; font-family: var(--mono); font-weight: 500; font-size: 9.5px;
  color: var(--panel-ink-dim); text-transform: uppercase; letter-spacing: 0.12em;
  margin-top: 3px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.sidebar nav .nav-label {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: var(--panel-ink-dim);
  text-transform: uppercase; letter-spacing: 0.14em; padding: 14px 10px 6px;
}
.sidebar nav a {
  color: var(--panel-ink); padding: 8px 10px; border-radius: 8px; font-size: 13.5px;
  font-weight: 500; display: flex; align-items: center; gap: 10px;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar nav a svg { width: 16px; height: 16px; stroke: currentColor; opacity: 0.75;
  flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff;
  text-decoration: none; }
.sidebar nav a { position: relative; }
.sidebar nav a.active { background: rgba(0, 210, 119, 0.10); color: #fff;
  font-weight: 600; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -12px;
  top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); }
.sidebar nav a.active svg { opacity: 1; stroke: var(--accent); }
.sidebar .foot {
  margin-top: 14px; padding: 12px 10px 0; border-top: 1px solid var(--panel-line);
  font-family: var(--mono); font-size: 10px; color: var(--panel-ink-dim);
}
.sidebar .foot .sysrow { display: flex; justify-content: space-between;
  letter-spacing: 0.06em; margin-bottom: 10px; text-transform: uppercase; }
.sidebar .foot button {
  background: none; border: 1px solid var(--panel-line); color: var(--panel-ink);
  width: 100%; padding: 7px; border-radius: 7px; cursor: pointer;
  font-family: var(--font); font-size: 12.5px; font-weight: 550;
  transition: background 0.12s ease;
}
.sidebar .foot button:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.main { flex: 1; min-width: 0; max-width: none;
  padding: 0 clamp(18px, 2.2vw, 46px) 64px; }

/* Context bar */
.context-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; margin: 14px 0 22px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 12px; box-shadow: var(--shadow-sm);
}
.context-bar .crumbs { font-family: var(--mono); font-size: 10.5px; font-weight: 550;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--muted); }
.context-bar .env { display: flex; align-items: center; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550; letter-spacing: 0;
  padding: 4px 11px; border-radius: 99px;
  border: 1px solid var(--hairline); background: var(--surface-2);
  color: var(--ink-2); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.chip.live .dot { background: var(--good); }
.chip.demo { border-color: var(--warning); background: var(--warning-soft);
  color: var(--warning-text); }
.chip.demo .dot { background: var(--warning); }
.chip-select {
  width: auto; font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-2);
  padding: 4px 26px 4px 10px; border-radius: 99px; border: 1px solid var(--hairline);
  background-color: var(--surface);
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ============ Cards & grids ============ */
.card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px 22px;
}
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
/* Chart gallery: 1 / 2 / 4 across — never an orphaned 3+1 row */
.grid.charts { grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .grid.charts { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1880px) {
  .grid.charts { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1020px) { .grid.cols-2 { grid-template-columns: 1fr; } }

/* ============ Stat tiles ============ */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 12px; margin-bottom: 18px; }
.tile {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px 16px 12px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tile::after { content: ""; position: absolute; right: -20px; bottom: -24px;
  width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 119, 0.09), transparent 68%); }
.tile.bad::after {
  background: radial-gradient(circle, rgba(208, 59, 59, 0.08), transparent 68%); }
.tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--hairline-2); }
.tile.good::before { background: var(--good); }
.tile.bad::before { background: var(--critical); }
.tile .value { font-size: 24px; font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.15; }
.tile .label { font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em;
  margin-top: 4px; }
.tile.good .value { color: var(--good-text); }
.tile.bad .value { color: var(--critical); }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.11em; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
table.data td { padding: 10px; border-bottom: 1px solid var(--hairline-2);
  vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.1s ease; }
table.data tbody tr:hover td { background: rgba(0, 54, 72, 0.035); }
td.num, th.num { text-align: right; font-size: 13px; }

/* ============ Badges — status beacon language ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap;
  letter-spacing: 0.01em; text-transform: capitalize;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0; }
.badge.passed { background: var(--good-soft); color: var(--good-text); }
.badge.passed::before { background: var(--good); }
.badge.failed { background: var(--critical-soft); color: var(--critical); }
.badge.failed::before { background: var(--critical); }
.badge.in_progress { background: var(--warning-soft); color: var(--warning-text); }
.badge.in_progress::before { background: var(--warning); }
.badge.not_started { background: #eef0f4; color: var(--ink-2); }
.badge.not_started::before { background: var(--muted); }
.badge.active { background: var(--good-soft); color: var(--good-text); }
.badge.active::before { background: var(--good);
  animation: beacon 2.4s ease-out infinite; }
.badge.draft { background: #eef0f4; color: var(--ink-2); }
.badge.draft::before { background: var(--muted); }
.badge.closed { background: var(--critical-soft); color: var(--critical); }
.badge.closed::before { background: var(--critical); }
@keyframes beacon {
  0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.45); }
  70% { box-shadow: 0 0 0 5px rgba(12, 163, 12, 0); }
  100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .badge.active::before { animation: none; }
  * { transition: none !important; }
}

/* ============ Buttons & forms ============ */
/* Hierarchy: primary (navy, one per view) · secondary (outlined) ·
   ghost (quiet in-table actions) · danger variants */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(180deg, #0b4c62 0%, var(--primary) 100%);
  color: #fff; border: 1px solid var(--primary-deep);
  padding: 9px 17px; border-radius: 10px; font-size: 13.5px;
  font-weight: 600; cursor: pointer; font-family: var(--font);
  letter-spacing: -0.005em;
  box-shadow: 0 2px 6px rgba(0, 54, 72, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: filter 0.12s ease, transform 0.1s ease, box-shadow 0.12s ease;
}
.btn:hover { filter: brightness(1.12); text-decoration: none;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 54, 72, 0.30),
  inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(0); filter: brightness(0.98);
  box-shadow: 0 1px 3px rgba(0, 54, 72, 0.25); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.secondary { background: var(--surface); color: var(--primary);
  border: 1px solid #d9dfe4; box-shadow: 0 1px 2px rgba(6, 32, 43, 0.06); }
.btn.secondary:hover { background: var(--primary-soft);
  border-color: #b9c9d1; filter: none; }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent;
  box-shadow: none; font-weight: 550; }
.btn.ghost:hover { background: var(--primary-soft); color: var(--primary); }
.btn.ghost.danger { background: transparent; color: var(--critical);
  border-color: transparent; box-shadow: none; }
.btn.ghost.danger:hover { background: var(--critical-soft); color: var(--critical); }
.btn.danger { background: linear-gradient(180deg, #dd4f4f, var(--critical));
  border-color: #b02f2f; color: #fff;
  box-shadow: 0 2px 6px rgba(208, 59, 59, 0.28), inset 0 1px 0 rgba(255,255,255,0.15); }
.btn.danger:hover { filter: brightness(1.08); }
.btn.small { padding: 4px 11px; font-size: 12px; border-radius: 8px;
  box-shadow: none; }
.btn.small:hover { transform: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

form.stack { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600;
  margin-bottom: 5px; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); font-size: 13.5px; font-family: var(--font);
  background: var(--surface); color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(0, 210, 119, 0.22);
}
input:disabled { background: var(--surface-2); color: var(--muted); }
textarea { min-height: 70px; resize: vertical; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ============ Role switcher & user chip ============ */
.role-switch { position: relative; }
.rs-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: var(--surface); border: 1px solid #d9dfe4; border-radius: 10px;
  padding: 6px 12px; font-family: var(--font); font-size: 12.5px;
  font-weight: 600; color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(6, 32, 43, 0.06);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.rs-btn:hover { border-color: #b9c9d1; background: var(--surface-2); }
.rs-btn svg { width: 13px; height: 13px; stroke: currentColor; }
.rs-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 230px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 12px; box-shadow: var(--shadow-md); padding: 8px;
}
.rs-label { font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--muted);
  padding: 6px 10px 8px; }
.rs-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 550; color: var(--ink);
  padding: 8px 10px; border-radius: 8px;
}
.rs-item:hover { background: var(--primary-soft); }
.rs-item.current { font-weight: 650; background: var(--accent-soft); }
.rs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rs-dot-superadmin { background: var(--accent); }
.rs-dot-content { background: #f0a12b; }
.rs-dot-leadership { background: #5b7f96; }
.rs-check { margin-left: auto; color: var(--accent-strong); font-weight: 700; }
.userchip { display: inline-flex; align-items: center; gap: 9px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #0b4c62, var(--primary));
  color: #fff; font-size: 13px; font-weight: 650;
  display: inline-flex; align-items: center; justify-content: center;
}
.uc-text { display: flex; flex-direction: column; line-height: 1.2; }
.uc-text strong { font-size: 12.5px; font-weight: 620; letter-spacing: -0.01em; }
.uc-text small { font-size: 10.5px; color: var(--muted); }

/* ============ Topic gallery ============ */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px; }
.topic-card {
  position: relative; display: block; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease,
              transform 0.08s ease;
}
.topic-card:hover { border-color: var(--accent);
  box-shadow: var(--shadow-md); transform: translateY(-1px); }
a.tc-link { display: block; padding: 18px 20px; color: var(--ink); }
a.tc-link:hover { text-decoration: none; }
.tc-name { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em;
  margin-bottom: 6px; padding-right: 30px; }
.tc-count { font-family: var(--mono); font-size: 10.5px; font-weight: 550;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tc-delete { position: absolute; top: 10px; right: 10px; }
.tc-delete-btn {
  width: 28px; height: 28px; border: none; border-radius: 7px;
  background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.tc-delete-btn svg { width: 15px; height: 15px; }
.tc-delete-btn:hover { background: var(--critical-soft); color: var(--critical); }
.topic-card-new { padding: 18px 20px; }
.topic-card-new { border-style: dashed; background: var(--surface-2); }
.topic-card-new .tc-count { text-transform: none; font-family: var(--font);
  font-size: 12.5px; letter-spacing: 0; }

/* ============ Choice cards & pickers ============ */
.choice {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--hairline); border-radius: 10px; padding: 11px 14px;
  background: var(--surface); transition: border-color 0.12s ease,
  background 0.12s ease; font-size: 13.5px; line-height: 1.45;
}
.choice:hover { border-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent);
  background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.choice input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.mode-switch { display: flex; flex-direction: column; gap: 9px; }

hr.rule { border: none; border-top: 1px solid var(--hairline-2);
  margin: 18px 0 14px; }

.q-picker { max-height: 380px; overflow-y: auto;
  border: 1px solid var(--hairline); border-radius: 10px; }
.topic-group { padding: 4px 14px 10px; }
.topic-group + .topic-group { border-top: 1px solid var(--hairline-2); }
.topic-head {
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--surface); padding: 9px 0 6px;
}
.topic-head strong { font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--ink-2); }
.q-row { padding: 5px 0 5px 24px; align-items: flex-start; }
.q-row input { margin-top: 3px; }

/* ============ Flash messages ============ */
.flash { display: flex; align-items: baseline; gap: 8px; padding: 11px 16px;
  border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13.5px;
  font-weight: 500; border: 1px solid transparent; }
.flash::before { font-weight: 700; }
.flash.success { background: var(--good-soft); color: var(--good-text);
  border-color: #cbe8cb; }
.flash.success::before { content: "✓"; }
.flash.error { background: var(--critical-soft); color: var(--critical);
  border-color: #f0cccc; }
.flash.error::before { content: "✕"; }
.flash.info { background: var(--primary-soft); color: var(--primary);
  border-color: #c9dde6; }
.flash.info::before { content: "ℹ"; font-family: var(--mono); }

/* ============ Charts ============ */
.chart-card { min-height: 300px; display: flex; flex-direction: column; }
.chart-card h2 { font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2);
  margin-bottom: 16px; }
.chart-box { position: relative; flex: 1; min-height: 240px; }

/* ============ Participant (assessment) pages ============ */
.assess-page { background: var(--page); min-height: 100vh; }
.assess-wrap { max-width: 740px; margin: 0 auto; padding: 34px 20px 90px; }
.assess-head { margin-bottom: 24px; }
.assess-head .org-row { display: flex; align-items: center; gap: 9px;
  margin-bottom: 12px; }
.assess-head .org-row .mark { width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, #00d277, #007a48);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 210, 119, 0.3); }
.assess-head .org-row .mark svg { width: 14px; height: 14px; stroke: #fff; }
.assess-head h1 { font-size: 23px; }
.quiz-stats { display: flex; align-items: center; gap: 26px; padding: 12px 20px;
  flex-wrap: wrap; }
.qs-item { display: flex; flex-direction: column; }
.qs-value { font-family: var(--mono); font-size: 19px; font-weight: 700;
  letter-spacing: -0.02em; }
.qs-label { font-family: var(--mono); font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.qs-save { margin-left: auto; font-size: 12px; }
.progress-track { background: var(--hairline); border-radius: 99px; height: 6px;
  overflow: hidden; margin: 18px 0 7px; }
.progress-fill { background: var(--signal); height: 100%; border-radius: 99px;
  transition: width 0.3s ease; }
.progress-label { font-family: var(--mono); font-size: 10.5px; font-weight: 550;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  text-align: right; }
.q-card { display: none; }
.q-card.current { display: block; animation: rise 0.25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); }
                  to { opacity: 1; transform: none; } }
.q-card .q-cat { font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--accent-strong);
  margin-bottom: 10px; }
.q-card .q-text { font-size: 16.5px; font-weight: 620; line-height: 1.5;
  letter-spacing: -0.011em; margin-bottom: 18px; }
.option { display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--hairline); border-radius: 10px; padding: 12px 14px;
  margin-bottom: 9px; cursor: pointer; background: var(--surface);
  transition: border-color 0.12s ease, background 0.12s ease,
              box-shadow 0.12s ease; }
.option:hover { border-color: var(--accent); background: var(--accent-soft); }
.option.selected { border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.q-key { flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--hairline); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2); margin-top: 1px; }
.option:hover .q-key, .option.selected .q-key { border-color: var(--primary);
  background: var(--primary); color: #fff; }
.option:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 20px; }
.timer { font-size: 15px; font-weight: 700; color: var(--ink-2);
  letter-spacing: 0.02em; }
.timer.low { color: var(--critical); }

/* ============ Result page ============ */
.score-ring { width: 150px; height: 150px; margin: 0 auto 14px; position: relative; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .pct { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-family: var(--mono); font-size: 31px;
  font-weight: 700; letter-spacing: -0.02em; }
.verdict { text-align: center; font-size: 17.5px; font-weight: 700;
  letter-spacing: -0.015em; margin-bottom: 4px; }
.verdict.pass { color: var(--good-text); }
.verdict.fail { color: var(--critical); }
.review-item { border: 1px solid var(--hairline); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px; background: var(--surface); }
.review-item .mark { font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; }
.review-item .mark.ok { color: var(--good-text); }
.review-item .mark.ko { color: var(--critical); }
.review-item .explain { font-size: 13px; color: var(--ink-2); margin-top: 10px;
  padding: 9px 12px; background: var(--surface-2); border-radius: 7px;
  border-left: 2px solid var(--accent); }

/* ============ Auth pages ============ */
.auth-page { min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 1px 1px, #dfe3ea 1px, transparent 0) 0 0 / 26px 26px,
    var(--page); }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 20px; }
.auth-card { width: 100%; max-width: 396px; }
.auth-card .brand { text-align: center; margin-bottom: 22px; }
.auth-card .brand .mark { width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #00d277, #007a48); margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 210, 119, 0.3); }
.auth-card .brand .mark svg { width: 22px; height: 22px; stroke: #fff; }
.auth-card .brand h1 { font-size: 18px; }
.auth-card .brand .org { font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted);
  margin-top: 4px; }
.auth-card .card { box-shadow: var(--shadow-md); }

/* ============ Org chart ============ */
.org-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dept-grid { display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.dept-card {
  display: flex; flex-direction: column; gap: 5px; text-align: left;
  cursor: pointer; font-family: var(--font);
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 12px; padding: 13px 15px; box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease,
              transform 0.1s ease;
}
.dept-card:hover { border-color: #b9c9d1; box-shadow: var(--shadow-md);
  transform: translateY(-1px); }
.dept-card.current { border-color: var(--accent-strong);
  background: var(--accent-soft); }
.dc-name { font-size: 13px; font-weight: 650; letter-spacing: -0.01em; }
.dc-count { font-size: 11.5px; color: var(--muted); }
.dc-pct { font-size: 10px; color: var(--ink-2); }
.mini-track { display: inline-block; width: 100%; max-width: 130px; height: 5px;
  border-radius: 99px; background: var(--hairline-2); overflow: hidden;
  vertical-align: middle; }
.mini-fill { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #00a05e, var(--accent)); }

.on-item .on-item { margin-left: 17px; }
.org-children { border-left: 2px solid var(--hairline-2); margin-left: 11px;
  padding-left: 4px; }
.on-node {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 9px; transition: background 0.1s ease;
}
.on-node:hover { background: var(--surface-2); }
.on-toggle {
  width: 22px; height: 22px; flex-shrink: 0; border: none; background: none;
  cursor: pointer; color: var(--muted); border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s ease, transform 0.12s ease;
}
.on-toggle:hover { background: var(--primary-soft); color: var(--primary); }
.on-toggle svg { width: 13px; height: 13px;
  transition: transform 0.15s ease; }
.on-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.on-toggle.leaf { cursor: default; }
.on-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--hairline); }
.avatar.sm { width: 26px; height: 26px; font-size: 11.5px; }
.on-who { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.on-who strong { font-size: 13.5px; font-weight: 620; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 7px; }
.on-who small { font-size: 11.5px; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.on-right { margin-left: auto; display: flex; align-items: center; gap: 12px;
  flex-shrink: 0; }
.on-team { display: inline-flex; align-items: center; gap: 7px; }
.on-team .mini-track { width: 84px; }
.on-team .mono { font-size: 11px; color: var(--ink-2); }

/* ============ Utility ============ */
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.muted { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
pre.mail { white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--hairline-2);
  border-radius: var(--radius-sm); padding: 16px; }
code, code.link { font-family: var(--mono); font-size: 12px; }
code.link { background: var(--accent-soft); color: var(--accent-deep);
  padding: 2px 7px; border-radius: 6px; word-break: break-all; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 0 18px 48px; }
}

/* Wide monitors: let the workspace breathe into the full width */
@media (min-width: 1500px) {
  .grid { gap: 20px; }
  .tiles { gap: 14px; }
  .chart-card { min-height: 330px; }
  .card { padding: 22px 26px; }
  .q-picker { max-height: 460px; }
}

/* Disclosure widgets (who-receives previews) */
details.who { margin: 6px 0 10px; }
details.who summary { cursor: pointer; font-size: 12.5px; font-weight: 550;
  color: var(--accent-strong); }
details.who summary:hover { text-decoration: underline; }

/* Completion breakdown card */
.breakdown-head { display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.breakdown-pick { display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--muted); }
.breakdown-pick select { width: auto; min-width: 170px; }

/* Metric tables: pin numeric columns to a fixed width so the figures sit in a
   tight, consistently aligned block instead of drifting across a wide table. */
table.metrics th.num, table.metrics td.num { width: 118px; }

/* Short explainer under a chart (e.g. how to read the p-chart) */
.chart-note { margin: 10px 2px 0; font-size: 12px; line-height: 1.55;
  color: var(--muted); }
