/* EHS Workspace — premium SaaS design system. Navy accent, Inter, hand-written. */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #e3e8f0;
  --line-2: #cfd7e4;
  --ink: #0b1526;
  --ink-2: #46536b;
  --ink-3: #5b687c;

  /* navy accent */
  --primary: #12325b;
  --primary-hover: #0d2647;
  --primary-2: #1d4b82;
  --primary-tint: #eaf0f8;
  --primary-tint-2: #dbe6f4;
  --primary-ink: #08192d;
  --gold: #b8892f;

  --ok: #0f7a56; --ok-tint: #e7f5ef;
  --warn: #96620b; --warn-tint: #fbf1e1;
  --bad: #b0211b; --bad-tint: #fceceb;
  --info: #1a5490; --info-tint: #e9f1fa;

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --shadow-1: 0 1px 2px rgba(11, 21, 38, .05);
  --shadow-2: 0 2px 6px rgba(11, 21, 38, .05), 0 8px 24px rgba(11, 21, 38, .06);
  --shadow-3: 0 24px 60px rgba(8, 25, 45, .18);
  --sidebar: 208px;
  --sans: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.005em;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.ico { flex: none; vertical-align: -3px; }
.ta-r { text-align: right; }
.req { color: var(--bad); font-style: normal; }
.sub { color: var(--ink-2); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

/* ── shell ─────────────────────────────────────────────────────────────────── */
.app .shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 18px; }
.brand { display: flex; align-items: center; gap: 8px; }
.wordmark { display: inline-flex; flex-direction: column; gap: 3px; }
.wm-text { font-weight: 800; font-size: 21px; letter-spacing: -.045em; line-height: 1; }
.wm-bar { display: flex; gap: 2px; height: 3px; }
.wm-bar i { display: block; height: 3px; border-radius: 2px; }
.wm-bar i:nth-child(1) { width: 9px; background: #12325b; }
.wm-bar i:nth-child(2) { width: 6px; background: #1d4b82; }
.wm-bar i:nth-child(3) { width: 4px; background: #2f6499; }
.wm-bar i:nth-child(4) { width: 2px; background: #5b88b5; }
.wm-lg .wm-text { font-size: 30px; }
.wm-lg .wm-bar { height: 4px; }
.wm-lg .wm-bar i { height: 4px; }

.nav { padding: 6px 10px 12px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--ink-2);
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active { background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.nav-item.is-active .ico { stroke-width: 2; }
.nav-item .ico { color: currentColor; opacity: .9; }
.nav-item span { font-size: 13.5px; }
.nav-item.is-active span { font-weight: 600; }
.nav-soon {
  margin-left: auto; font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 999px; font-weight: 600;
}
.nav-dot { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; background: #d9a63f; opacity: .85; }`r`n.nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 4px 10px; font-weight: 600; }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }

.sidebar-foot { padding: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.upsell {
  display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(135deg, #12325b, #1d4b82);
  color: #fff; border-radius: var(--r-md); padding: 10px 12px;
}
.upsell-title { font-weight: 650; font-size: 12.5px; }
.upsell-sub { font-size: 11px; opacity: .82; }
.account { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: var(--r-sm); }
.account:hover { background: var(--surface-2); }
.account-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.account-meta b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta small { font-size: 11px; color: var(--ink-3); }
.account .ico { margin-left: auto; color: var(--ink-3); }

.avatar {
  width: var(--s, 30px); height: var(--s, 30px); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: calc(var(--s, 30px) * .38); font-weight: 650; color: #fff;
  background: #6b63d6; flex: none; letter-spacing: 0;
}
.av-0 { background: #12325b; } .av-1 { background: #24506f; } .av-2 { background: #8a6a2f; }
.av-3 { background: #3a5a7a; } .av-4 { background: #2f7d6a; } .av-5 { background: #5b6472; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .more { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); font-size: 11px; }

/* ── topbar ────────────────────────────────────────────────────────────────── */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  position: sticky; top: 0; z-index: 20;
}
.search {
  display: flex; align-items: center; gap: 8px; width: 380px; max-width: 46vw;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 12px; height: 34px; color: var(--ink-3);
}
.search input { border: 0; background: transparent; outline: 0; flex: 1; font-size: 13px; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search kbd {
  font-family: inherit; font-size: 11px; border: 1px solid var(--line); background: #fff;
  border-radius: 5px; padding: 0 5px; color: var(--ink-3);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.bell { position: relative; }
.dot { position: absolute; top: 8px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px #fff; }
.avatar-link { margin-left: 6px; display: inline-flex; }

/* ── content ───────────────────────────────────────────────────────────────── */
.content { padding: 26px 34px 64px; max-width: 1180px; width: 100%; margin: 0 auto; }
.content.wide { max-width: 1440px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-head h1 { font-size: 24px; font-weight: 680; letter-spacing: -.02em; }
.page-head .sub { margin-top: 4px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.tabs a, .tabs span {
  padding: 9px 11px 10px; font-size: 13.5px; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.is-active, .tabs span.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tabs .tabs-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ── buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 13px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; border: 1px solid transparent;
  background: var(--primary); color: #fff; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-1); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #971b12; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── cards, stats, banners ─────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
  padding: 18px; margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card-head .sub { margin-top: 3px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.card-grid { display: grid; gap: 16px; }
.card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .card-grid.three, .card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .card-grid.two, .card-grid.three, .card-grid.four { grid-template-columns: 1fr; } }

.stat {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; box-shadow: var(--shadow-1);
}
a.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.stat-value { font-size: 26px; font-weight: 680; letter-spacing: -.03em; }
.stat-label { font-size: 12.5px; color: var(--ink-2); }
.stat-sub { font-size: 11.5px; color: var(--ink-3); }
.stat.accent { background: var(--primary-tint); border-color: var(--primary-tint-2); }
.stat.accent .stat-value { color: var(--primary); }

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--r-md); padding: 13px 15px; margin-bottom: 16px;
  background: var(--primary-tint); border: 1px solid var(--primary-tint-2);
}
.banner .ico { color: var(--primary); margin-top: 1px; }
.banner h3 { font-size: 13.5px; font-weight: 650; }
.banner p { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.banner .banner-action { margin-left: auto; flex: none; align-self: center; }
.banner.warn { background: var(--warn-tint); border-color: #f3e0c2; }
.banner.warn .ico { color: var(--warn); }
.banner.neutral { background: var(--surface-2); border-color: var(--line); }
.banner.neutral .ico { color: var(--ink-2); }

/* ── tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabs a, .tabs span { font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3);
  text-transform: none; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td .row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table td .row-title { font-weight: 600; }
.table td .row-sub { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-empty { padding: 34px 18px; text-align: center; color: var(--ink-2); font-size: 13px; }
.rowgroup td { background: var(--surface-2); font-size: 12px; color: var(--ink-2); font-weight: 600; }

/* ── badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-tint); color: var(--ok); border-color: #c6e9d8; }
.badge.warn { background: var(--warn-tint); color: var(--warn); border-color: #f0ddbb; }
.badge.bad { background: var(--bad-tint); color: var(--bad); border-color: #f6d2ce; }
.badge.info { background: var(--info-tint); color: var(--info); border-color: #cfe0f8; }
.badge.accent { background: var(--primary-tint); color: var(--primary); border-color: var(--primary-tint-2); }
.badge.dark { background: #23232c; color: #fff; border-color: #23232c; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--primary-tint); color: var(--primary); }
.pill.dark { background: #23232c; color: #fff; }
.pill.new { background: var(--ok-tint); color: var(--ok); }

/* ── forms ─────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .12s, box-shadow .12s;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint);
}
.field-hint { font-size: 11.5px; color: var(--ink-3); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.check { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 7px; cursor: pointer; }
.check:hover { border-color: var(--line-2); background: var(--surface-2); }
.check input { margin-top: 2px; }
.check input[type=checkbox], .check input[type=radio], .field .check input, .field label.check input {
  width: 16px; height: 16px; min-width: 16px; flex: none; margin: 2px 0 0; accent-color: var(--primary);
  border-radius: 4px; padding: 0; }
.check b { font-size: 13px; font-weight: 600; display: block; text-align: left; }
.check span { flex: 1; min-width: 0; text-align: left; }
.check small { color: var(--ink-2); font-size: 12px; }

/* ── misc layout ───────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.input-search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 0 10px; height: 36px; min-width: 240px; color: var(--ink-3);
}
.input-search input { border: 0; outline: 0; background: transparent; font-size: 13px; width: 100%; color: var(--ink); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.is-active { background: var(--primary-tint); border-color: var(--primary-tint-2); color: var(--primary); font-weight: 600; }
.chip b { font-weight: 650; }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 46px 20px; text-align: center; color: var(--ink-2);
}
.empty .ico { color: var(--ink-3); }
.empty h3 { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.empty p { font-size: 13px; max-width: 460px; }
.empty .btn { margin-top: 8px; }
.muted { color: var(--ink-3); }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 980px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── 3D viz panels ─────────────────────────────────────────────────────────── */
.viz {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background: radial-gradient(120% 120% at 20% 0%, #2a2660 0%, #171633 55%, #101024 100%);
  border: 1px solid #262347; min-height: 260px;
}
.viz canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; }
.viz .viz-label {
  position: absolute; left: 14px; top: 12px; z-index: 2; color: #e9e7ff;
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; opacity: .78;
}
.viz .viz-legend {
  position: absolute; left: 14px; bottom: 12px; z-index: 2; display: flex; gap: 14px;
  color: #c9c6ee; font-size: 11.5px;
}
.viz .viz-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.viz .viz-metric {
  position: absolute; right: 14px; bottom: 12px; z-index: 2; color: #fff; text-align: right;
}
.viz .viz-metric b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.viz .viz-metric span { font-size: 11px; color: #b7b3e0; }

/* ── login ─────────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.auth-form-side { display: flex; flex-direction: column; padding: 34px 40px; }
.auth-brand { margin-bottom: 42px; }
.auth-center { margin: auto 0; width: 100%; max-width: 372px; align-self: center; }
.auth-center h1 { font-size: 25px; font-weight: 700; letter-spacing: -.025em; }
.auth-center .sub { margin: 6px 0 22px; }
.auth-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-2); background: #fff; }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--ink-2); text-align: center; }
.auth-links { margin-top: auto; padding-top: 30px; font-size: 12px; color: var(--ink-3); display: flex; gap: 16px; }
.auth-viz-side { position: relative; background: radial-gradient(130% 110% at 70% 10%, #1b3a63 0%, #102641 55%, #07172a 100%); overflow: hidden; }
.auth-viz-side::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 60% at 50% 45%, rgba(10,10,25,0) 30%, rgba(10,10,25,.55) 100%), linear-gradient(to top, rgba(10,10,22,.92) 0%, rgba(10,10,22,.35) 32%, rgba(10,10,22,0) 55%); }
.auth-viz-side canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-copy { position: absolute; left: 44px; right: 44px; bottom: 44px; color: #fff; z-index: 2; }
.auth-copy h2 { color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.45); }
.auth-copy .eyebrow { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #9db6d8; font-weight: 650; }
.auth-copy h2 { font-size: 32px; line-height: 1.12; letter-spacing: -.03em; font-weight: 700; margin-top: 10px; }
.auth-copy p { color: #b8c9de; font-size: 13.5px; margin-top: 12px; max-width: 420px; }
.auth-badge {
  position: absolute; top: 26px; left: 44px; z-index: 2; color: #d3e2f3; font-size: 11.5px;
  border: 1px solid rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); backdrop-filter: blur(6px);
}
.error-note { background: var(--bad-tint); color: var(--bad); border: 1px solid #f6d2ce; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px; }
.hint-note { background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--ink-2); padding: 10px 12px; border-radius: 8px; font-size: 12px; margin-top: 14px; }
.hint-note code { background: #fff; border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

/* ── admin ─────────────────────────────────────────────────────────────────── */
.admin .sidebar { background: #1a1927; border-right-color: #262438; }
.admin .nav-item { color: #b9b6cf; }
.admin .nav-item:hover { background: #232135; color: #fff; }
.admin .nav-item.is-active { background: #2c2a45; color: #fff; }
.admin .nav-label { color: #6f6c8c; }
.admin .nav-sep { background: #2a2839; }
.admin .sidebar-foot { border-top-color: #2a2839; }
.admin .account:hover { background: #232135; }
.admin .account-meta b { color: #fff; }
.admin .account-meta small { color: #8f8cae; }
.admin .wm-text { color: #fff; }
.admin-tag { font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: #b9b4ee; border: 1px solid #3a3760; padding: 2px 6px; border-radius: 5px; font-weight: 700; }
.admin .topbar { background: #fff; }
.admin-crumbs { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.crumb-sep { color: var(--ink-3); }
.build-tag { font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.logout-row { margin: 0; }
.logout-row .btn { width: 100%; justify-content: flex-start; color: #b9b6cf; }
.logout-row .btn:hover { color: #fff; background: #232135; }
.to-tenant { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #8f8cae; padding: 2px 6px; }
.to-tenant:hover { color: #fff; }

.perm-group { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px; }
.perm-group > header { background: var(--surface-2); padding: 9px 13px; font-size: 12px; font-weight: 650; color: var(--ink-2); display: flex; justify-content: space-between; }
.perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
@media (max-width: 1000px) { .perm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.perm-cell { display: flex; gap: 8px; align-items: center; padding: 8px 13px; border-top: 1px solid var(--line); font-size: 12.5px; }
.perm-cell code { font-size: 11.5px; color: var(--ink-3); }

/* ── toasts & modal (vanilla) ──────────────────────────────────────────────── */
.toast-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: #23232c; color: #fff; padding: 10px 14px; border-radius: 9px;
  font-size: 13px; box-shadow: var(--shadow-3); animation: toast-in .18s ease-out;
}
.toast.ok { background: #0d7a4b; }
.toast.bad { background: #b42318; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.modal { border: 0; border-radius: var(--r-lg); padding: 0; box-shadow: var(--shadow-3); max-width: 520px; width: calc(100vw - 40px); }
dialog.modal::backdrop { background: rgba(20,20,30,.45); }
.modal-head { padding: 18px 20px 0; }
.modal-head h2 { font-size: 16px; font-weight: 650; }
.modal-body { padding: 14px 20px 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 18px; }

/* ── module "not in pilot" pages ───────────────────────────────────────────── */
.module-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: stretch; }
.module-hero .module-copy { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-1); }
.module-copy h2 { font-size: 18px; font-weight: 680; letter-spacing: -.015em; margin-top: 10px; }
.module-copy p { color: var(--ink-2); margin-top: 8px; font-size: 13.5px; }
.module-copy ul { margin: 14px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.module-copy li { margin-bottom: 5px; }
.later-panel { background: var(--warn-tint); border: 1px solid #f3e0c2; border-radius: var(--r-md); padding: 18px; }
.later-panel h3 { font-size: 13.5px; font-weight: 650; color: var(--warn); }
.later-panel p { font-size: 12.5px; color: #6f4c07; margin-top: 6px; }

/* ── inspection editor ─────────────────────────────────────────────────────── */
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 12px; }
.q-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.q-label { font-size: 14px; font-weight: 600; }
.q-req { color: var(--bad); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.q-body { margin-top: 12px; }
.q-tools { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.q-tool { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.q-tool:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.is-on { background: var(--ok-tint); color: var(--ok); font-weight: 650; }
.seg button.is-off { background: var(--bad-tint); color: var(--bad); font-weight: 650; }
.answer-note { background: var(--surface-2); border-left: 3px solid var(--primary-tint-2); padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); border-radius: 0 6px 6px 0; margin-top: 10px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 0; }

/* ── timeline / audit ──────────────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-when { color: var(--ink-3); font-size: 12px; }
.feed-item b { font-weight: 600; }

/* ── print & small screens ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar); z-index: 40; transform: translateX(-102%); transition: transform .18s; box-shadow: var(--shadow-3); }
  .sidebar.is-open { transform: none; }
  .content { padding: 20px 16px 60px; }
  .auth { grid-template-columns: 1fr; }
  .auth-viz-side { display: none; }
  .search { width: 100%; max-width: none; }
  .grid-2, .grid-3, .form-row, .form-row.three, .module-hero { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* -- content library --------------------------------------------------------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lib-card {
  display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-1);
}
.lib-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.lib-art {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, var(--primary-tint), #f6f5ff);
  border: 1px solid var(--primary-tint-2); color: var(--primary);
  display: grid; place-items: center;
}
.lib-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.lib-body h3 { font-size: 13.5px; font-weight: 650; line-height: 1.3; margin-top: 8px; }
.lib-body p { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tpl-thumb { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: linear-gradient(145deg, hsl(calc(206 + (var(--h) * 0.055)) 42% 42%), hsl(calc(212 + (var(--h) * 0.045)) 48% 28%)); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(14px); }

.focus { background: #fff; }
.focus-bar { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 10; }
.focus-brand .wm-text { font-size: 17px; }
.focus-content { max-width: 900px; margin: 0 auto; padding: 26px 24px 80px; }

/* ── premium layer ─────────────────────────────────────────────────────────── */
body { font-size: 15px; line-height: 1.55; letter-spacing: -.006em; font-feature-settings: 'cv11' 1, 'ss01' 1; }
h1, h2, h3, h4 { letter-spacing: -.022em; font-weight: 650; }
.page-head h1 { font-size: 26px; font-weight: 670; letter-spacing: -.03em; }
.sub { color: var(--ink-2); font-size: 13px; }
.mono, .stat-value, .kpi-value, td.num { font-variant-numeric: tabular-nums; }

/* sidebar: quiet surface, navy active pill */
.sidebar { background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%); border-right: 1px solid var(--line); }
.nav-item { color: var(--ink-2); border-radius: 10px; padding: 8px 11px; font-weight: 500; transition: background .14s, color .14s; }
.nav-item:hover { background: var(--primary-tint); color: var(--primary); }
.nav-item.is-active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(18, 50, 91, .25); }
.nav-item.is-active .ico { color: #fff; }
.nav-sep { background: var(--line); }
.upsell { background: linear-gradient(135deg, #12325b, #1d4b82); border-radius: 14px; box-shadow: var(--shadow-2); }
.upsell-title { font-weight: 650; letter-spacing: -.01em; }
.account { border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .14s, box-shadow .14s; }
.account:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }

/* topbar */
.topbar { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.search { border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; transition: border-color .14s, box-shadow .14s, background .14s; }
.search:focus-within { background: #fff; border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(18, 50, 91, .1); }
.search kbd { border: 1px solid var(--line-2); background: #fff; color: var(--ink-3); }

/* buttons */
.btn { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; border: 1px solid var(--primary); border-radius: 9px; font-weight: 560; letter-spacing: -.006em; padding: 9px 14px; box-shadow: 0 1px 2px rgba(8, 25, 45, .18), inset 0 1px 0 rgba(255, 255, 255, .12); transition: filter .14s, transform .04s, box-shadow .14s; }
.btn:hover { filter: brightness(1.06); box-shadow: 0 3px 10px rgba(8, 25, 45, .22), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--primary); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
.btn.secondary:hover { border-color: var(--primary-2); background: var(--primary-tint); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn[disabled] { opacity: .45; box-shadow: none; filter: none; }
.icon-btn { border-radius: 9px; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--primary); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card:hover { border-color: var(--line-2); }
.card-head h2 { font-size: 15px; font-weight: 640; }
.stat { border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(180deg, #fff, #fbfcfe); transition: border-color .14s, box-shadow .14s, transform .14s; }
.stat:hover { border-color: var(--primary-tint-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.stat.accent { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; }
.stat.accent .stat-label, .stat.accent .stat-value, .stat.accent .stat-sub { color: #fff; }
.stat-value { font-weight: 660; letter-spacing: -.02em; }

/* inputs */
input, select, textarea { font-family: var(--sans); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary-2) !important; box-shadow: 0 0 0 3px rgba(18, 50, 91, .1); }
.field label, .form-row label { font-weight: 560; color: var(--ink-2); font-size: 12.5px; }

/* tables */
.table thead th { background: var(--surface-2); color: var(--ink-3); font-weight: 620; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f8fafd; }
.table td { border-bottom: 1px solid var(--line); }

/* chips, badges, tabs */
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; font-weight: 520; color: var(--ink-2); padding: 6px 12px; }
.chip:hover { border-color: var(--primary-2); color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.badge { border-radius: 999px; font-weight: 580; letter-spacing: .01em; }
.badge.accent { background: var(--primary-tint); color: var(--primary); }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.tabs { border-bottom: 1px solid var(--line); }
.tabs a { font-weight: 540; color: var(--ink-2); padding: 10px 2px; border-bottom: 2px solid transparent; }
.tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* banner */
.banner { border: 1px solid var(--primary-tint-2); background: linear-gradient(180deg, #f7faff, #f3f7fd); border-radius: var(--r-lg); }
.banner.neutral { background: linear-gradient(180deg, #f8fafd, #f4f7fb); border-color: var(--line); }
.banner.warn { background: linear-gradient(180deg, #fffaf1, #fff6e8); border-color: #f2e2c4; }

/* login / auth */
.auth-card, .login-card { border-radius: var(--r-xl); box-shadow: var(--shadow-3); }
.auth h1, .login h1 { letter-spacing: -.035em; }

/* admin: deep navy rail */
.admin .sidebar, .admin-sidebar { background: linear-gradient(180deg, #0b1b30, #0e2440); }
.admin .nav-item { color: #b9c7da; }
.admin .nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin .nav-item.is-active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }

/* modal */
.modal { border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-3); }
.modal-head h2 { letter-spacing: -.02em; }

/* section accent used by the conductor */
.sec-bar { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

.lib-art { background: linear-gradient(145deg, var(--primary-tint), #f4f8fd); color: var(--primary); border: 1px solid var(--primary-tint-2); border-radius: 12px; }
.lib-card { transition: border-color .14s, box-shadow .14s, transform .14s; }
.lib-card:hover { border-color: var(--primary-tint-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }

:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible, .nav-item:focus-visible { outline: 2px solid #7fa6d4; outline-offset: 2px; }

/* ── responsive: tablet + phone ──────────────────────────────────────────── */
.main, .content, .grid-2 > *, .card { min-width: 0; }
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

@media (max-width: 1080px) {
  .card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 60; transform: translateX(-102%);
    transition: transform .2s ease; box-shadow: 0 0 0 100vmax rgba(6, 16, 30, 0); }
  .sidebar.is-open { transform: none; box-shadow: 24px 0 60px rgba(6, 16, 30, .28); }
  .topbar { padding: 0 14px; }
  .content { padding: 20px 16px 48px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-actions { width: 100%; }
  .lib-grid { grid-template-columns: 1fr; }
  .card-grid.two, .card-grid.four { grid-template-columns: 1fr; }
  .stat { padding: 14px; }
  .b-top { flex-wrap: wrap; row-gap: 8px; }
  .b-center { order: -1; width: 100%; justify-content: center; display: flex; }
  .b-center .seg { margin: 0 auto; }
  .b-body { grid-template-columns: 1fr; }
  .builder { margin: -18px -16px -60px; }
  .b-doc { padding: 16px 12px 60px; }
  .q { grid-template-columns: 20px 1fr; }
  .q-resp { grid-column: 2; justify-content: flex-start; }
  .inspection-layout { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .btn { padding: 10px 14px; }
  .page-head h1 { font-size: 22px; }
  .table thead th { white-space: nowrap; }
  .tabs { overflow-x: auto; }
  .tabs a { white-space: nowrap; }
}

/* audit fixes */
.row-title { display: inline-block; padding: 3px 0; }
@media (max-width: 960px) {
  a.row, .focus-back, .row-title { min-height: 28px; padding-top: 4px; padding-bottom: 4px; }
  .icon-btn { min-width: 32px; min-height: 32px; }
  .toolbar { flex-wrap: wrap; }
  .spread { flex-wrap: wrap; gap: 8px; }
  .builder, .b-body, .b-doc, .b-top { max-width: 100%; }
  .b-top { overflow-x: auto; }
  .pp { width: min(680px, 94vw); max-width: 94vw; }
}
@media (max-width: 560px) {
  .stat-row, .stat-grid, .kpi-row { grid-template-columns: 1fr; }
  .table { font-size: 12.5px; }
  .table td, .table th { padding: 8px 9px; }
}

.logicform { max-width: calc(100vw - 48px); flex-wrap: wrap; }
.logic:not([open]) .logicform { display: none; }
.pp-pen { display: inline-grid; place-items: center; min-width: 26px; min-height: 26px; }
.q-tool { min-height: 28px; }

@media (max-width: 960px) {
  p a, dd a, .row-sub a, .muted a { display: inline-block; min-height: 24px; padding: 3px 0; }
}

.q-picker:not([open]) .pp { display: none; }
.q-picker:not([open]) > summary { display: inline-flex; }

.only-mobile { display: none; }
@media (max-width: 960px) {
  .only-mobile { display: inline-flex; }
  .topbar { gap: 8px; }
  .search { flex: 1; }
  .table-wrap .table { min-width: 680px; }
}

@media (max-width: 960px) {
  .topbar { padding: 0 10px; }
  .topbar-actions { gap: 2px; flex: none; }
  .topbar-actions .icon-btn { min-width: 30px; min-height: 30px; }
  .search { min-width: 0; }
  .search kbd { display: none; }
}

@media (max-width: 960px) {
  .sidebar.is-open { box-shadow: 0 0 0 100vmax rgba(5, 15, 28, .42); }
}

/* account quick-access menu */
.account-wrap { position: relative; }
button.account { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer; text-align: left; transition: border-color .14s, box-shadow .14s; }
button.account:hover { border-color: var(--primary-tint-2); box-shadow: var(--shadow-1); }
button.account .account-meta { flex: 1; min-width: 0; }
button.account .account-meta b { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.account .account-meta small { display: block; font-size: 11px; color: var(--ink-3); }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); width: 262px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(8, 25, 45, .22);
  padding: 6px; z-index: 90; max-height: min(74vh, 560px); overflow-y: auto; }
.account-menu[hidden] { display: none; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0;
  border-radius: 8px; background: none; font-size: 13px; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.account-menu a:hover, .account-menu button:hover { background: var(--primary-tint); color: var(--primary); }
.account-menu .am-head { font-weight: 650; font-size: 13.5px; color: var(--ink); }
.account-menu .am-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.account-menu .am-user { padding: 8px 10px 4px; font-weight: 600; font-size: 13px; }
.account-menu .am-new { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary); background: var(--primary-tint); padding: 2px 6px; border-radius: 999px; }
.account-menu .am-rocket { margin-left: auto; color: var(--primary); display: grid; place-items: center; }

button.avatar-link { background: none; border: 0; padding: 0; cursor: pointer; }

/* schedules: calendar + filtered list + day detail */
.sched-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.sched-rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
.cal-card { padding: 12px; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cal-head b { flex: 1; font-size: 14px; letter-spacing: -.01em; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 40px; border-radius: 8px; border: 1px solid transparent; font-size: 12.5px; color: var(--ink); transition: background .12s, border-color .12s; }
.cal-day:hover { background: var(--primary-tint); }
.cal-day.is-out { color: var(--ink-3); opacity: .55; }
.cal-day.is-today { border-color: var(--primary); font-weight: 650; }
.cal-day.is-selected { background: var(--primary); color: #fff; font-weight: 650; }
.cal-day.has-items .cal-num { font-weight: 650; }
.cal-dots { display: flex; gap: 2px; align-items: center; }
.cal-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); display: block; }
.cal-day.is-selected .cal-dots i { background: #fff; }
.cal-dots b { font-size: 8.5px; color: var(--primary); }
.cal-day.is-selected .cal-dots b { color: #fff; }
.sched-filters { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.filt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filt { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--ink-3); font-weight: 600; flex: 1 1 130px; }
.filt select { border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; background: #fff; color: var(--ink); }
.sched-filters .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.sched-filters .seg button { border: 0; background: #fff; padding: 7px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.sched-filters .seg button.is-on { background: var(--primary); color: #fff; font-weight: 600; }
.list-card { overflow: hidden; }
.sched-list { display: flex; flex-direction: column; max-height: 380px; overflow-y: auto; padding: 6px; }
.sched-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; transition: background .12s; }
.sched-row:hover { background: var(--primary-tint); }
.sched-row-main { min-width: 0; flex: 1; }
.sched-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.sched-row-side { display: flex; align-items: center; gap: 6px; flex: none; }
.day-card { padding: 16px 18px; }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.day-dow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.day-head h2 { font-size: 20px; letter-spacing: -.02em; margin-top: 2px; }
.occ-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.occ { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg,#fff,#fbfcfe); }
.occ-time { flex: none; width: 74px; text-align: center; padding-top: 2px; }
.occ-time b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.occ-time span { font-size: 11px; color: var(--ink-3); }
.occ-main { flex: 1; min-width: 0; }
.occ-title { font-size: 14px; font-weight: 640; color: var(--ink); }
.occ-title:hover { color: var(--primary); }
.occ-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-2); margin-top: 5px; }
.occ-meta .ico { vertical-align: -2px; color: var(--ink-3); }
.occ-actions { display: flex; gap: 8px; margin-top: 10px; }
.empty-day { text-align: center; padding: 26px 16px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.up-card { margin-top: 14px; }
.up-list { display: flex; flex-direction: column; }
.up-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); }
.up-row:first-child { border-top: 0; }
.up-date { width: 44px; text-align: center; flex: none; }
.up-date b { display: block; font-size: 15px; }
.up-date small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.up-main { flex: 1; min-width: 0; }
.up-main b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-main small { font-size: 11.5px; color: var(--ink-3); }
.up-chev { color: var(--ink-3); }
@media (max-width: 1080px) {
  .sched-layout { grid-template-columns: 1fr; }
  .sched-rail { position: static; }
}

.sched-rail .filt { flex: 1 1 calc(50% - 4px); }

/* schedules: rebalanced three-zone layout */
.sched-layout { display: grid; grid-template-columns: minmax(340px, 384px) minmax(0, 1fr) 312px; gap: 16px; align-items: start; }
.sched-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sched-aside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
.cal-day { height: 42px; font-size: 13px; border-radius: 9px; }
.cal-grid { gap: 3px; }
.cal-head b { font-size: 15px; }
.cal-card { padding: 14px; }
.week-card { padding: 14px 16px; }
.week-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.week-head h2 { font-size: 15.5px; letter-spacing: -.02em; }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .12s, background .12s; }
.week-day:hover { border-color: var(--primary-tint-2); background: var(--primary-tint); }
.week-day.is-today { border-color: var(--primary); }
.week-day.is-selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.wd-dow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.week-day.is-selected .wd-dow { color: #cfdcf0; }
.wd-num { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wd-count { font-size: 10.5px; color: var(--ink-3); display: flex; gap: 3px; align-items: center; }
.week-day.is-selected .wd-count { color: #fff; }
.list-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 14px 8px; }
.list-head h2 { font-size: 13.5px; }
.list-head .sub { font-size: 11.5px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px; }
.mini-stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: linear-gradient(180deg, #fff, #fbfcfe); }
.mini-stat b { display: block; font-size: 21px; font-weight: 670; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.next-inline { display: flex; gap: 7px; align-items: center; margin: 12px 14px 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.up-card { margin-top: 0; }
.sched-aside .up-card .up-list { max-height: 430px; overflow-y: auto; }
.sched-rail .list-card .sched-list { max-height: 330px; }
@media (max-width: 1280px) {
  .sched-layout { grid-template-columns: minmax(320px, 360px) minmax(0, 1fr); }
  .sched-aside { grid-column: 1 / -1; flex-direction: row; position: static; }
  .sched-aside > .card { flex: 1; min-width: 0; }
}
@media (max-width: 1080px) {
  .sched-layout { grid-template-columns: 1fr; }
  .sched-rail, .sched-aside { position: static; }
  .sched-aside { flex-direction: column; }
}

/* schedules: duty + recurrence mix, week-chip polish */
.wd-count { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wd-count i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); display: inline-block; }
.week-day.is-selected .wd-count { color: #fff; }
.week-day.is-selected .wd-count i { background: #fff; }
.duty-card { padding: 16px 18px; }
.duty-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.duty-list { display: flex; flex-direction: column; gap: 6px; }
.duty-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--line); }
.duty-row:first-child { border-top: 0; }
.duty-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-list { display: flex; flex-direction: column; gap: 9px; }
.mix-row { display: grid; grid-template-columns: 64px 1fr 24px; align-items: center; gap: 8px; font-size: 12.5px; }
.mix-label { color: var(--ink-2); }
.mix-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.mix-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 999px; }
.mix-row b { text-align: right; font-variant-numeric: tabular-nums; }
.mix-total { font-size: 11.5px; margin-top: 2px; }
@media (max-width: 1080px) { .duty-cols { grid-template-columns: 1fr; } }

/* schedules: final balance */
.sched-layout { grid-template-columns: minmax(330px, 356px) minmax(0, 1fr) 286px; gap: 14px; }
.sched-aside .mix-card .card-head { padding-bottom: 8px; }
.sched-aside .mix-list { padding: 0 14px; }
.sched-aside .mix-total { padding: 0 14px 12px; }
.duty-card .duty-list { display: flex; flex-direction: column; gap: 4px; }
.duty-row { padding: 8px 0; }
.week-strip { gap: 6px; }
.week-day { padding: 9px 4px; }
@media (max-width: 1320px) {
  .sched-layout { grid-template-columns: minmax(320px, 344px) minmax(0, 1fr); }
  .sched-aside { grid-column: 1 / -1; flex-direction: row; position: static; }
  .sched-aside > .card { flex: 1; min-width: 0; }
}
@media (max-width: 1080px) {
  .sched-layout { grid-template-columns: 1fr; }
  .sched-aside { flex-direction: column; }
}

.filters-details summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.filters-details summary::-webkit-details-marker { display: none; }
.filters-details summary::before { content: ''; width: 0; height: 0; border-left: 4px solid currentColor;
  border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; transform: rotate(90deg); transition: transform .15s; }
.filters-details[open] summary::before { transform: rotate(0); }
.filt-count { font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.filters-details .filt-row { margin-top: 8px; }

/* schedules: two-column calm layout */
.sched-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr); gap: 18px; align-items: start; }
.sched-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sched-side { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; }
.cal-card { padding: 18px 20px 20px; }
.cal-head { margin-bottom: 14px; }
.cal-head b { font-size: 19px; letter-spacing: -.02em; }
.cal-head .btn.sm { padding: 6px 11px; }
.cal-dow span { font-size: 11px; }
.cal-grid { gap: 5px; }
.cal-day { height: 62px; font-size: 13px; border-radius: 10px; gap: 5px; }
.cal-num { font-size: 15px; font-weight: 550; font-variant-numeric: tabular-nums; }
.cal-day.has-items .cal-num { font-weight: 700; }
.cal-day.is-selected .cal-num, .cal-day.is-today .cal-num { font-weight: 700; }
.cal-dots i { width: 5px; height: 5px; }
.cal-dots b { font-size: 9.5px; }
.filter-card { padding: 14px 16px; }
.sched-filters .seg button { padding: 8px 13px; font-size: 13px; }
.list-card .sched-list { max-height: 420px; padding: 6px 8px 10px; }
.sched-row { padding: 11px 10px; }
.sched-title { font-size: 13.5px; }
.sched-meta { font-size: 12px; }
.sched-side .day-card { padding: 18px 20px; }
.day-head h2 { font-size: 21px; }
.day-head .day-dow { font-size: 11.5px; }
.occ { padding: 14px; }
.occ-meta { font-size: 12px; gap: 12px 16px; }
@media (max-width: 1180px) {
  .sched-layout { grid-template-columns: 1fr; }
  .sched-side { position: static; }
  .sched-side .day-card { order: -1; }
}
@media (max-width: 620px) {
  .cal-day { height: 50px; }
  .cal-num { font-size: 13.5px; }
}

/* semantic answers + anchor offset */
.q-card { scroll-margin-top: 76px; }
.q-body .q-opt.t-pos { border-color: #b7dcca; background: #f2faf6; color: #0f7a56; }
.q-body .q-opt.t-pos:hover { border-color: #0f7a56; background: #e6f6ee; }
.q-body .q-opt.t-pos.is-on { background: #0f7a56; border-color: #0f7a56; color: #fff; font-weight: 650; }
.q-body .q-opt.t-neg { border-color: #efc4c0; background: #fdf5f4; color: #b0211b; }
.q-body .q-opt.t-neg:hover { border-color: #b0211b; background: #fceceb; }
.q-body .q-opt.t-neg.is-on { background: #b0211b; border-color: #b0211b; color: #fff; font-weight: 650; }
.q-body .q-opt.t-warn { border-color: #f0dcb8; background: #fffaf1; color: #96620b; }
.q-body .q-opt.t-warn.is-on { background: #96620b; border-color: #96620b; color: #fff; font-weight: 650; }
.q-body .q-opt.t-neutral { border-color: var(--line-2); background: #fff; color: var(--ink-2); }
.q-body .q-opt.t-neutral.is-on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 650; }

/* inspection report */
.report-content { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; }
.rep-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, #f4f6fa 70%, rgba(244,246,250,0)); padding: 8px 0 12px; }
.rep-top-actions { display: flex; gap: 8px; align-items: center; }
.report-layout { position: relative; }
.report-layout > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.report-layout > summary::-webkit-details-marker { display: none; }
.lay-pop { position: absolute; top: calc(100% + 8px); left: 0; width: 300px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(8,25,45,.25); padding: 12px; z-index: 40; }
.lay-head { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; padding: 2px 4px 8px; }
.lay-rows { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.lay-row { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; font-size: 13px; cursor: pointer; position: relative; }
.lay-row:hover { background: var(--primary-tint); }
.lay-row input.sr { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 34px; height: 20px; border-radius: 999px; background: #cbd5e1; position: relative; flex: none; transition: background .15s; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.sw.on { background: var(--primary); }
.sw.on::after { transform: translateX(14px); }
.lay-sep { height: 1px; background: var(--line); margin: 8px 2px; }
.lay-title { font-weight: 600; }
.lay-title b { flex: 1; font-weight: 600; }
.lay-edit { color: var(--primary); display: grid; place-items: center; }
.lay-chev { margin-left: auto; border: 0; background: none; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.lay-row:has(input.sr:not(:checked)) .sw { background: #cbd5e1; }
.lay-row:has(input.sr:checked) .sw { background: var(--primary); }
.lay-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.pdf-menu { position: relative; }
.pdf-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pdf-menu > summary::-webkit-details-marker { display: none; }
.pdf-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 180px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; z-index: 40; display: flex; flex-direction: column; }
.pdf-pop a, .pdf-pop button { text-align: left; padding: 9px 10px; border-radius: 8px; font-size: 13px; background: none; border: 0; cursor: pointer; color: var(--ink); }
.pdf-pop a:hover, .pdf-pop button:hover { background: var(--primary-tint); color: var(--primary); }
.rep-doc { display: flex; flex-direction: column; gap: 14px; }
.rep-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.rep-card h2 { font-size: 15px; letter-spacing: -.01em; margin-bottom: 10px; }
.rep-overview { text-align: left; }
.rep-logo { width: 92px; height: 92px; border-radius: 20px; background: linear-gradient(135deg, #12325b, #1d4b82); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; }
.rep-overview h1 { font-size: 23px; letter-spacing: -.02em; }
.rep-meta { color: var(--ink-3); font-size: 13px; margin: 4px 0 14px; }
.rep-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.rep-stats > div { padding: 12px 10px 2px; border-right: 1px solid var(--line); }
.rep-stats > div:last-child { border-right: 0; }
.rep-stats span { display: block; font-size: 11.5px; color: var(--ink-3); }
.rep-stats b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.rep-titlepage .rep-field { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.rep-titlepage .rep-field:first-of-type { border-top: 0; }
.rep-titlepage .rep-field span { color: var(--ink-3); }
.rep-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.rep-sec:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.rep-sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rep-sec-head h3 { font-size: 13.5px; }
.rep-sec-score { font-size: 12px; color: var(--ink-3); }
.rep-q { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.rep-q.is-neg { border-color: #efc4c0; background: #fffafa; }
.rep-q-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rep-q-text { font-size: 13px; }
.req { color: #b0211b; }
.rep-note { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; }
.rep-media, .rep-instr { font-size: 12px; color: var(--ink-3); margin: 8px 0 0; display: flex; gap: 6px; align-items: center; }
.rep-q-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.act-link { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--primary); font-weight: 550; }
.act-link::-webkit-details-marker { display: none; }
.act-pop[open] .act-form { display: flex; }
.act-form { display: none; flex-direction: column; gap: 8px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.act-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.act-form input, .act-form select, .act-form textarea { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 9px; font-size: 13px; font-family: inherit; }
.act-done { font-size: 12px; color: #0f7a56; display: inline-flex; gap: 5px; align-items: center; }
.rep-list-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.rep-list-row:first-of-type { border-top: 0; }
.rep-list-row span { flex: 1; }
.rep-list-row em { font-style: normal; color: var(--ink-3); font-size: 12px; }
@media print {
  .focus-bar, .rep-top { display: none; }
  .report-content { max-width: none; padding: 0; }
  .rep-card { break-inside: avoid; border-color: #d6dbe3; }
  .act-pop, .rep-q-foot { display: none; }
  body.focus.report { background: #fff; }
}

/* activation meter */
.active-meter { margin: 4px 0 10px; }
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter i { flex: 1; height: 6px; border-radius: 999px; background: #e2e8f0; display: block; }
.meter i.on { background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.cell-actions form { display: inline-flex; }

/* training */
.learn-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.learn-card h3 { font-size: 15.5px; letter-spacing: -.01em; margin-top: 4px; }
.learn-card .sub { font-size: 12.5px; color: var(--ink-2); }
.learn-meta { display: flex; flex-wrap: wrap; gap: 10px 14px; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.learn-meta span { display: inline-flex; align-items: center; gap: 5px; }
.learn-meta .ico { color: var(--ink-3); }
.learn-bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.learn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 999px; }
.learn-objectives { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.learn-objectives li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.learn-objectives .ico { color: #0f7a56; flex: none; margin-top: 2px; }
.lesson-row { padding: 11px 0; border-top: 1px solid var(--line); gap: 12px; }
.lesson-row:first-child { border-top: 0; }
.lesson-row b { font-size: 13.5px; }
.lesson-num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--ink-2); flex: none; }
.lesson-num.done { background: #e6f4ec; color: #0f7a56; }
.lesson-card { max-width: 820px; margin: 0 auto; }
.slide-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; }
.slide h2 { font-size: 23px; letter-spacing: -.02em; margin: 8px 0 10px; }
.slide p { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.slide-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.quiz { display: flex; flex-direction: column; gap: 14px; }
.quiz-q { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; }
.quiz-q legend { font-size: 13.5px; font-weight: 600; padding: 0 4px; }
.quiz-opt { display: flex; gap: 9px; align-items: flex-start; padding: 7px 4px; font-size: 13px; cursor: pointer; border-radius: 8px; }
.quiz-opt:hover { background: var(--primary-tint); }
.quiz-opt input { margin-top: 3px; accent-color: var(--primary); }

/* LMS */
.lms-hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 22px; align-items: center;
  background: linear-gradient(120deg, #0f2a4a 0%, #12325b 45%, #1d4b82 100%); color: #fff; border-radius: 18px;
  padding: 24px 26px; box-shadow: 0 18px 40px rgba(12, 32, 60, .25); }
.lms-hello { font-size: 12.5px; color: #bcd0ea; letter-spacing: .02em; }
.lms-hero h1 { font-size: 26px; letter-spacing: -.03em; margin: 4px 0 6px; }
.lms-hero .sub { color: #d5e2f3; font-size: 13.5px; max-width: 560px; }
.lms-hero-stats { display: flex; gap: 18px; align-items: center; }
.lms-stat { min-width: 84px; text-align: center; }
.lms-stat b { display: block; font-size: 21px; letter-spacing: -.02em; }
.lms-stat span { font-size: 11px; color: #bcd0ea; display: block; margin-top: 3px; }
.lms-lvl { height: 6px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; margin-top: 7px; display: block; }
.lms-lvl i { display: block; height: 100%; background: #7fd1a8; border-radius: 999px; }
.ring { position: relative; display: inline-grid; place-items: center; color: var(--primary); flex: none; }
.ring svg { display: block; }
.ring b { position: absolute; font-size: 12px; font-weight: 650; }
.lms-hero .ring { color: #7fd1a8; }
.lms-hero .ring b { color: #fff; font-size: 11px; }
.lms-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; }
.lms-tile .ico { color: var(--primary); margin-bottom: 4px; }
.lms-tile b { font-size: 22px; letter-spacing: -.02em; }
.lms-tile span { font-size: 12px; color: var(--ink-3); }
.lms-course-card { display: flex; flex-direction: column; gap: 4px; }
.lms-course-card h3 { letter-spacing: -.02em; }
.lms-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.lms-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lms-progress { display: block; flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.lms-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); border-radius: 999px; }
.lms-path-card { display: block; color: inherit; }
.lms-path-card:hover { border-color: var(--primary-tint-2); }
.lms-lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.lms-lb-row:first-child { border-top: 0; }
.lms-lb-row.big { padding: 13px 0; }
.lms-lb-row.is-me { background: var(--primary-tint); border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.lms-rank { width: 20px; text-align: center; font-weight: 700; color: var(--ink-3); }
.lms-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.lms-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; border: 1px dashed var(--line-2);
  font-size: 12px; color: var(--ink-3); }
.lms-badge b { font-size: 15px; }
.lms-badge.is-on { border-style: solid; border-color: #bfe3cd; background: #f2faf6; color: #0f7a56; }
.lms-player { max-width: 900px; margin: 0 auto; }
.lms-player-top { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.lms-stepper { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lms-step { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
  background: var(--surface-2); color: var(--ink-3); }
.lms-step.done { background: #e6f4ec; color: #0f7a56; }
.lms-step.active { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px var(--primary-tint); }
.lms-stepper-sep { width: 8px; height: 2px; background: var(--line); display: block; }
.lms-lesson-title { font-size: 26px; letter-spacing: -.03em; margin: 4px 0 2px; }
.lms-slide { min-height: 220px; }
.lms-slide-bar { flex: 1; height: 5px; background: var(--surface-2); border-radius: 999px; margin: 0 18px; overflow: hidden; max-width: 260px; }
.lms-slide-bar i { display: block; height: 100%; background: var(--primary); }
.lms-qnum { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); font-size: 12px; margin-right: 6px; }
.lms-result { text-align: center; margin-bottom: 16px; }
.lms-score { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lms-score .ring { color: inherit; }
.lms-result.is-pass .ring { color: #0f7a56; }
.lms-result.is-fail .ring { color: #b0211b; }
.lms-score h1 { font-size: 24px; letter-spacing: -.03em; margin-top: 8px; }
.lms-review { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.lms-review.ok { border-color: #cfe9d9; background: #f7fcf9; }
.lms-review.bad { border-color: #efd0cd; background: #fdf8f7; }
.lms-review-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lms-review-opts span { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.lms-review-opts span.is-answer { background: #e6f4ec; color: #0f7a56; }
.lms-review-opts span.is-picked:not(.is-answer) { background: #fdeceb; color: #b0211b; }
.lesson-row.is-next { background: var(--primary-tint); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.lesson-num.active { background: var(--primary); color: #fff; }
.lms-timeline { display: flex; flex-direction: column; }
.lms-tl-step { display: flex; gap: 14px; padding: 14px 4px; border-top: 1px solid var(--line); align-items: flex-start; }
.lms-tl-step:first-child { border-top: 0; }
.lms-tl-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--ink-3); flex: none; }
.lms-tl-step.done .lms-tl-dot { background: #e6f4ec; color: #0f7a56; }
.cert-wrap { display: flex; flex-direction: column; align-items: center; }
.certificate { width: min(760px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 38px 42px; text-align: center;
  background-image: radial-gradient(circle at top left, #f4f8fd, transparent 55%), radial-gradient(circle at bottom right, #f7fbf8, transparent 45%);
  box-shadow: 0 24px 60px rgba(12, 32, 60, .16); }
.cert-brand { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.cert-kicker { font-size: 12.5px; color: var(--ink-3); margin-top: 20px; letter-spacing: .08em; text-transform: uppercase; }
.certificate h1 { font-size: 34px; letter-spacing: -.03em; margin: 12px 0 6px; }
.certificate h2 { font-size: 22px; letter-spacing: -.02em; margin: 6px 0 8px; color: var(--primary); }
.certificate p { color: var(--ink-2); font-size: 13px; }
.cert-meta { color: var(--ink-3) !important; font-size: 12px !important; }
.cert-foot { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; font-size: 11px; color: var(--ink-3); }
@media print {
  .focus-bar, .topbar, .sidebar, .page-head { display: none !important; }
  .certificate { box-shadow: none; border-color: #cfd6e2; }
  body { background: #fff; }
}
@media (max-width: 900px) {
  .lms-hero { grid-template-columns: 1fr; }
  .lms-hero-stats { justify-content: space-between; }
}

/* -- form chips & responsive form rows --------------------------------------- */
/* Chip labels must never wrap mid-label inside the checkbox pill. */
.chip { white-space: nowrap; max-width: 100%; }
.chip input[type=checkbox], .chip input[type=radio] {
  width: 16px; height: 16px; min-width: 16px; margin: 0; flex: none;
  accent-color: var(--primary); cursor: pointer;
}
.chip:has(input:checked) {
  background: var(--primary-tint); border-color: var(--primary-tint-2);
  color: var(--primary); font-weight: 600;
}
.chip:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Keep long inputs inside the card instead of forcing horizontal scroll. */
.form-row > .field { min-width: 0; }
.field input, .field select, .field textarea { min-width: 0; }

/* Three-column rows step down before they get cramped. */
@media (max-width: 1100px) and (min-width: 761px) {
  .form-row.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
