/* BNR Pilot M&E – design system.
   One file for every screen: tokens, app shell, components, page pieces. */

/* ---------- tokens ---------- */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e8ef;
  --border-strong: #d3d9e3;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8a94a6;

  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e40af;
  --primary-50: #eff5ff;
  --primary-100: #dbe7fe;

  --sidebar: #0c1f3b;
  --sidebar-2: #15305a;
  --sidebar-text: #c7d2e5;

  --success: #15803d; --success-bg: #ecfdf3; --success-dot: #22c55e;
  --warning: #b45309; --warning-bg: #fffaeb; --warning-dot: #f59e0b;
  --danger: #b42318;  --danger-bg: #fef3f2;  --danger-dot: #ef4444;
  --info: #1d4ed8;    --info-bg: #eff5ff;    --info-dot: #3b82f6;
  --neutral: #475569; --neutral-bg: #f1f5f9; --neutral-dot: #94a3b8;

  /* chart roles (validated palette) */
  --series-1: #2a78d6;
  --series-1-wash: rgba(42, 120, 214, .10);
  --series-2: #1baf7a;
  --series-3: #eb6834;
  --grid: #e9edf3;
  --age-1: #86b6ef; --age-2: #3987e5; --age-3: #1c5cab; --age-4: #0d366b;
  --good: #0ca30c; --critical: #d03b3b;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --ring: 0 0 0 3px rgba(37, 99, 235, .18);
  --sidebar-w: 248px;
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans",
          "Noto Sans Sinhala", "Iskoola Pota", "Noto Sans Tamil", "Latha", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 8px; }
.icon { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.text-2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: linear-gradient(180deg, var(--sidebar) 0%, #0a1a33 100%);
  color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  padding: 18px 14px; z-index: 40;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.brand-name { font-weight: 650; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: #8fa3c4; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f84a8; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--sidebar-text);
  font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(59, 130, 246, .18); color: #fff; box-shadow: inset 2px 0 0 #60a5fa; }
.nav a .count { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.nav a.cta { background: var(--primary); color: #fff; margin: 4px 0 8px; justify-content: center; }
.nav a.cta:hover { background: var(--primary-600); }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 14px; }
.user-card { display: flex; gap: 10px; align-items: center; padding: 4px 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #1e3a64; color: #dbe7fe; display: grid; place-items: center;
  font-weight: 600; font-size: 12.5px; flex: none; }
.user-name { color: #fff; font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.user-role { font-size: 11.5px; color: #8fa3c4; line-height: 1.3; }
.logout-btn { margin-left: auto; background: none; border: 0; color: #8fa3c4; cursor: pointer; padding: 6px; border-radius: 8px; }
.logout-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
a.logout-btn { display: inline-flex; }
.pw-change { max-width: 520px; }
.pw-change input { width: 100%; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(244, 246, 250, .85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent; padding: 14px 28px; display: flex; align-items: center; gap: 14px; }
.topbar.scrolled { border-bottom-color: var(--border); }
.menu-btn { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 7px; cursor: pointer; color: var(--text); }
.page-title { min-width: 0; }
.page-title .crumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.page-title .crumb a { color: var(--text-2); }
.page-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { padding: 4px 28px 40px; width: 100%; max-width: 1320px; }
.content.narrow { max-width: 1080px; }
.scrim { display: none; }

@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 35; }
  .menu-btn { display: inline-grid; place-items: center; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .page-title { flex: 1; }
  .page-actions { margin-left: 0; width: 100%; }
  .page-actions:empty { display: none; }
  .content { padding: 4px 16px 32px; }
  h1 { font-size: 19px; }
}

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.stack > * + * { margin-top: 16px; }
.icon-chip { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.icon-chip.green { background: var(--success-bg); color: var(--success); }
.icon-chip.amber { background: var(--warning-bg); color: var(--warning); }
.icon-chip.red { background: var(--danger-bg); color: var(--danger); }
.icon-chip.slate { background: var(--neutral-bg); color: var(--neutral); }
.icon-chip.violet { background: #f3f0ff; color: #6d28d9; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.layout-aside > aside { position: sticky; top: 84px; }
@media (max-width: 1100px) { .layout-aside { grid-template-columns: 1fr; } .layout-aside > aside { position: static; } }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } .card-body { padding: 16px; } .card-head { padding: 14px 16px; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
.btn-primary:hover { background: var(--primary-600); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(15, 23, 42, .05); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- form controls ---------- */
label, .label { display: block; font-size: 13px; font-weight: 550; color: var(--text); margin-bottom: 6px; }
.req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; color: var(--text); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; padding: 10px 12px; min-height: 72px; resize: vertical; }
select { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input:hover, select:hover, textarea:hover { border-color: #b8c1cf; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.field { min-width: 0; }
.field .help { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.field .error { color: var(--danger); font-size: 12.5px; margin-top: 5px; display: flex; gap: 5px; align-items: flex-start; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #f97066; background: #fffbfa; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 18px; }
.fields.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.input-group { display: flex; gap: 6px; }
.input-group > input { flex: 1; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 36px; }

/* segmented control (radio buttons styled as a pill switch) */
.segmented { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented label { margin: 0; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 8px; font-weight: 550; font-size: 13.5px; color: var(--text-2); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }
.segmented a { display: inline-flex; padding: 6px 12px; border-radius: 8px; font-weight: 550; font-size: 13px; color: var(--text-2); text-decoration: none; }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* radio cards (big choices) */
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.choice-card { position: relative; margin: 0; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card .box { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); transition: border-color .12s, background .12s, box-shadow .12s; height: 100%; }
.choice-card .box strong { display: block; font-size: 14.5px; }
.choice-card .box small { color: var(--text-2); font-weight: 400; font-size: 13px; }
.choice-card:hover .box { border-color: #9db7f5; }
.choice-card input:checked + .box { border-color: var(--primary); background: var(--primary-50); box-shadow: var(--ring); }
.choice-card input:focus-visible + .box { box-shadow: var(--ring); }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 550;
  white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--neutral-dot); }
.pill.received { background: var(--warning-bg); color: var(--warning); } .pill.received::before { background: var(--warning-dot); }
.pill.complete { background: var(--info-bg); color: var(--info); } .pill.complete::before { background: var(--info-dot); }
.pill.approved { background: #f3f0ff; color: #5b21b6; } .pill.approved::before { background: #8b5cf6; }
.pill.issued { background: var(--success-bg); color: var(--success); } .pill.issued::before { background: var(--success-dot); }
.pill.rejected { background: var(--danger-bg); color: var(--danger); } .pill.rejected::before { background: var(--danger-dot); }
.pill.plain::before { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--neutral-bg); color: var(--text-2);
  font-size: 12.5px; font-weight: 500; white-space: nowrap; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid; margin-bottom: 16px; font-size: 14px; }
.alert .icon { margin-top: 1px; }
.alert.success { background: var(--success-bg); border-color: #abefc6; color: #085d3a; }
.alert.warning { background: var(--warning-bg); border-color: #fedf89; color: #93370d; }
.alert.danger { background: var(--danger-bg); border-color: #fecdca; color: #912018; }
.alert.info { background: var(--info-bg); border-color: #c7d7fe; color: #1e3a8a; }
.alert a { font-weight: 600; color: inherit; text-decoration: underline; }
.alert .grow { flex: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; text-align: left;
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: #f8faff; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table .primary-cell { font-weight: 600; color: var(--text); }
.table .secondary { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--text-2); }
.table th[data-sort]::after { content: " ↕"; opacity: .45; }

/* medium screens: drop secondary columns into the first cell */
.show-md { display: none; }
@media (max-width: 1180px) and (min-width: 721px) { .hide-md { display: none; } .show-md { display: inline; } }

/* stacked rows on phones */
@media (max-width: 720px) {
  .table.stack-sm thead { display: none; }
  .table.stack-sm tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table.stack-sm td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .table.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; }
  .table.stack-sm td.primary-cell { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
  .table.stack-sm td.primary-cell::before { display: none; }
}

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .icon-chip { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 12px; }
.empty h3 { margin-bottom: 4px; font-size: 15px; color: var(--text); }
/* 403 page: why access is denied and where to go instead. */
.denied { max-width: 640px; margin: 24px auto; }
.denied .empty p { margin: 6px auto 0; max-width: 480px; }
.denied-hint { text-align: left; margin: 16px auto 0; max-width: 480px; }
.denied-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------- toolbar & filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 16px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 10px; color: var(--text-2); font-weight: 550; font-size: 13.5px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .n { background: var(--neutral-bg); color: var(--text-2); font-size: 11.5px; padding: 1px 7px; border-radius: 10px; }
.tabs a.on .n { background: var(--primary-100); color: var(--primary-700); }
.filter-panel { padding: 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filter-grid label { font-size: 12px; color: var(--text-2); }
.filter-grid input, .filter-grid select { height: 36px; font-size: 13.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* ---------- stepper (application progress) ---------- */
.stepper { display: flex; align-items: flex-start; gap: 0; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; min-width: 0; }
.step::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); z-index: 0; }
.step:first-child::before { display: none; }
.step .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong);
  color: var(--muted); position: relative; z-index: 1; font-weight: 600; font-size: 13px; }
.step .name { font-size: 12.5px; font-weight: 600; margin-top: 6px; color: var(--text-2); }
.step .when { font-size: 12px; color: var(--muted); }
.step.done::before, .step.current::before { background: var(--primary); }
.step.done .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.current .dot { border-color: var(--primary); color: var(--primary); box-shadow: var(--ring); }
.step.current .name { color: var(--primary-700); }
.step.rejected .dot { background: var(--danger-dot); border-color: var(--danger-dot); color: #fff; }
.step.rejected .name { color: var(--danger); }
.step.rejected::before { background: var(--danger-dot); }
.stepper.vertical { flex-direction: column; gap: 0; }
.stepper.vertical .step { flex-direction: row; align-items: flex-start; text-align: left; gap: 12px; padding-bottom: 18px; width: 100%; }
.stepper.vertical .step::before { top: -18px; bottom: auto; left: 15px; right: auto; width: 2px; height: 18px; }
.stepper.vertical .step .name { margin-top: 5px; }
.stepper.vertical .step:last-child { padding-bottom: 0; }

/* ---------- definition list ---------- */
.dl { display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.dl > dt, .dl > dd { padding: 11px 0; border-bottom: 1px solid var(--border); margin: 0; }
.dl > dt { color: var(--text-2); font-size: 13.5px; }
.dl > dd { font-weight: 500; }
.dl > dt:last-of-type, .dl > dd:last-of-type { border-bottom: 0; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; } .dl > dt { border: 0; padding-bottom: 0; } }

/* ---------- timeline (history) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .meta { color: var(--muted); font-size: 12.5px; }
.timeline .change { font-size: 13.5px; margin-top: 4px; }
.timeline .change b { font-weight: 600; }
.timeline .arrow { color: var(--muted); margin: 0 4px; }
.timeline .reason { margin-top: 6px; display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; color: var(--text-2); }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpis-5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kpi .label { font-size: 13px; color: var(--text-2); font-weight: 500; margin: 0; line-height: 1.3; }
.kpi .value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
a.kpi-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.kpi-link:hover, a.kpi-link:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50), var(--shadow-sm); }
.kpi-go { margin-left: auto; color: var(--muted); display: inline-flex; }
a.kpi-link:hover .kpi-go { color: var(--primary); }
.trend-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 7px; }
.trend-legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.trend-legend small { color: var(--muted); font-size: 12px; }
.tile-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--primary-50); font-size: 13.5px; }
.tile-banner .what { color: var(--text-2); }
.tile-banner .what strong { color: var(--text); }
.tile-banner .chip { background: var(--surface); }
.tile-banner .actions { margin-left: auto; display: flex; gap: 6px; }
.kpi.hero { grid-column: span 2; background: linear-gradient(135deg, #0f2a52 0%, #1d4ed8 140%); border: 0; color: #fff; position: relative; overflow: hidden; }
.kpi.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.kpi.hero .label, .kpi.hero .sub { color: #c7d7fe; }
.kpi.hero .value { font-size: 40px; color: #fff; }
.kpi.hero .value small { color: #c7d7fe; }
.kpi.hero .icon-chip { background: rgba(255, 255, 255, .12); color: #fff; }
.target { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 10px 4px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.target i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; color: #fff; }
.target.good { background: rgba(255, 255, 255, .95); color: #085d3a; } .target.good i { background: var(--good); }
.target.bad { background: rgba(255, 255, 255, .95); color: #912018; } .target.bad i { background: var(--critical); }
.meter { height: 6px; border-radius: 4px; background: var(--primary-100); margin-top: 10px; overflow: hidden; }
.meter > div { height: 100%; background: var(--series-1); border-radius: 4px; }
/* Volume tiles: flows counted in the period, then the pending snapshot, set apart so they are not read alike. */
.kpi-groups { display: grid; grid-template-columns: minmax(0, 4fr) minmax(180px, 1fr); gap: 14px; margin-bottom: 16px; align-items: stretch; }
.kpi-group { display: flex; flex-direction: column; min-width: 0; }
.kpi-group > .kpis { margin-bottom: 0; flex: 1; }
.kpi-group > .kpis > .kpi { height: 100%; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis-1 { grid-template-columns: minmax(0, 1fr); }
.kpi-group-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 8px 2px; font-size: 12px; color: var(--muted); line-height: 1.3; }
.kpi-group-head strong { color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px; }
.kpi-group-head svg { color: var(--muted); flex: none; }
.kpi-group-snapshot { padding-left: 14px; border-left: 1px dashed var(--border-strong); }
.kpi-group-snapshot .kpi-group-head strong { color: var(--warning); }
.kpi.kpi-snapshot { background: var(--warning-bg); border-color: #f5dfa8; }
/* A second, separate figure inside a tile (e.g. rejection rate over a different set of cases). */
.kpi-part { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border-strong); }
.kpi-part-label { margin: 0; font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.kpi-part-value { margin: 2px 0 0; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.kpi-part-value b { font-weight: inherit; }
.kpi-part-value small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.kpi-part-value span { font-size: 12px; font-weight: 400; color: var(--muted); }
.kpi-note { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); font-size: 12px; color: var(--text-2); line-height: 1.35; }
.kpi-note svg { flex: none; margin-top: 1px; color: var(--warning); }
@media (max-width: 1100px) {
  .kpi-groups { grid-template-columns: minmax(0, 1fr); }
  .kpi-group-snapshot { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
  .kpis-1 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); max-width: 50%; }
}
@media (max-width: 720px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpi-group .kpis-1 { max-width: none; grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px; } .kpi .value { font-size: 23px; } .kpi.hero .value { font-size: 32px; }
}

/* ---------- charts ---------- */
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 12px; align-items: center; font-size: 13px; padding: 3px 6px; margin: 0 -6px; border-radius: 8px; }
.hbar:hover { background: var(--surface-2); }
.hbar-label { overflow-wrap: anywhere; color: var(--text); line-height: 1.3; }
.hbar-track { display: flex; align-items: center; gap: 8px; }
.hbar-fill { height: 12px; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar-value { white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 550; }
.hbar-value .muted { font-weight: 400; }
.ages { display: flex; align-items: flex-end; gap: 20px; height: 160px; padding: 0 12px; border-bottom: 1px solid var(--grid); }
.age { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.age .col { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; min-height: 2px; }
.age .v { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.age-labels { display: flex; gap: 20px; padding: 8px 12px 0; font-size: 12px; color: var(--muted); }
.age-labels span { flex: 1; text-align: center; }
.chart-svg { width: 100%; height: 270px; display: block; }
.chart-svg text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.tip { position: fixed; pointer-events: none; background: #0f172a; color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12.5px; z-index: 100;
  display: none; white-space: nowrap; box-shadow: var(--shadow-lg); }
details.more > summary { cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center; color: var(--primary); font-weight: 550; font-size: 13px; }
details.more > summary::-webkit-details-marker { display: none; }

/* ---------- day strip (daily return) ---------- */
.days { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.day { border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px; text-align: center; background: var(--surface); position: relative; }
.day .dname { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.day .dnum { font-size: 16px; font-weight: 650; margin: 2px 0 6px; }
.day .mark { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.day .apps { font-size: 11.5px; color: var(--text-2); margin-top: 6px; }
.day.reported .mark { background: var(--good); } .day.no_new .mark { background: #64748b; }
.day.missing { border-color: #fecdca; background: #fffbfa; } .day.missing .mark { background: var(--critical); }
.day.due .mark { background: #f59e0b; color: #1f2937; }
.day.not_started { opacity: .55; } .day.not_started .mark { background: #cbd5e1; color: #475569; }
.day .late { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.day a.fix { display: block; font-size: 11.5px; margin-top: 4px; font-weight: 600; }
@media (max-width: 900px) { .days { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* reporting grid */
.rgrid td, .rgrid th { text-align: center; padding: 8px 4px; }
.rgrid td:first-child, .rgrid th:first-child { text-align: left; padding-left: 16px; white-space: nowrap; }
.rgrid th { font-size: 11.5px; }
.cell { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; }
.cell.reported { background: var(--good); } .cell.no_new { background: #64748b; }
.cell.missing { background: var(--critical); } .cell.due { background: #f59e0b; color: #1f2937; }
.cell.not_started { background: #e2e8f0; color: #64748b; }
.cell.late { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #f59e0b; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; align-items: center; color: var(--text-2); }
.legend span { display: inline-flex; gap: 7px; align-items: center; }

/* ---------- sticky action bar ---------- */
.actionbar { position: sticky; bottom: 0; z-index: 20; margin: 20px -28px -40px; padding: 14px 28px; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px); border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actionbar .hint { color: var(--muted); font-size: 13px; margin-left: auto; }
@media (max-width: 960px) { .actionbar { margin: 20px -16px -32px; padding: 12px 16px; } .actionbar .hint { display: none; } }

/* ---------- form sections ---------- */
.section { scroll-margin-top: 90px; }
.section-head { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.section-head h2 { font-size: 15px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.section-head .tag { margin-left: auto; }
.milestones { display: grid; gap: 0; }
.milestone { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 18px; }
.milestone::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--border); }
.milestone:last-child { padding-bottom: 0; } .milestone:last-child::before { display: none; }
.milestone .mdot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--border-strong); color: var(--muted); }
.milestone.set .mdot { background: var(--primary); border-color: var(--primary); color: #fff; }
.milestone.set::before { background: var(--primary-100); }
.milestone h3 { margin: 7px 0 8px; }
.today-btn { height: 40px; }
.partner-row { display: grid; grid-template-columns: 1.5fr 1.2fr 1.2fr auto; gap: 10px; align-items: end; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 12px; margin-bottom: 10px; background: var(--surface-2); }
@media (max-width: 720px) { .partner-row { grid-template-columns: 1fr; } }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13.5px; text-decoration: none; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a .ok { margin-left: auto; color: var(--success); }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-art { background: radial-gradient(circle at 20% 20%, #1e4fa8 0%, transparent 55%), radial-gradient(circle at 80% 90%, #1d4ed8 0%, transparent 50%), #0c1f3b;
  color: #fff; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art .brand { padding: 0; }
.auth-art h1 { font-size: 34px; line-height: 1.15; margin-top: auto; max-width: 460px; font-weight: 700; letter-spacing: -.02em; }
.auth-art p.lead { color: #b7c6e2; font-size: 15.5px; max-width: 440px; margin-top: 14px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 auto; display: grid; gap: 12px; color: #dbe5f6; }
.auth-points li { display: flex; gap: 10px; align-items: center; }
.auth-points .icon-chip { background: rgba(255, 255, 255, .1); color: #93c5fd; width: 30px; height: 30px; }
.auth-art .foot { color: #7f93b7; font-size: 12.5px; margin-top: 32px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; font-weight: 650; }
.auth-card .lead { color: var(--text-2); margin: 6px 0 26px; }
.auth-card .field + .field { margin-top: 16px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { padding: 28px 24px; } .auth-art h1 { font-size: 24px; margin-top: 28px; } .auth-points { display: none; } .auth-art .foot { display: none; } }

/* ---------- guided tours ---------- */
.guide-btn { position: relative; }
.guide-btn.tour-new::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 2px var(--bg); animation: tour-ping 2s ease-out infinite; }
@keyframes tour-ping { 0% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 2px rgba(37, 99, 235, .5); } 70%, 100% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 10px rgba(37, 99, 235, 0); } }

.tour-layer { position: fixed; inset: 0; z-index: 1000; }
.tour-layer[hidden] { display: none; }
.tour-block { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 5px rgba(37, 99, 235, .55), 0 0 0 9999px rgba(12, 20, 38, .58);
  transition: left .28s ease, top .28s ease, width .28s ease, height .28s ease; }
.tour-spot.none { box-shadow: 0 0 0 9999px rgba(12, 20, 38, .58); }
.tour-pop { position: fixed; width: min(360px, calc(100vw - 24px)); background: var(--surface); border-radius: 16px; padding: 18px 18px 14px;
  box-shadow: 0 24px 60px rgba(12, 20, 38, .35), 0 2px 6px rgba(12, 20, 38, .12); outline: none;
  transition: left .28s ease, top .28s ease; animation: tour-in .22s ease; }
.tour-pop.centered { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 24px)); padding: 26px 24px 16px; animation: none; }
.tour-pop[data-side="sheet"]:not(.centered) { left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; transition: none; }
@keyframes tour-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tour-tag { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.tour-x { border: 0; background: transparent; color: var(--muted); padding: 5px; margin: -5px -6px -5px 0; border-radius: 8px; cursor: pointer; display: inline-grid; }
.tour-x:hover { background: var(--neutral-bg); color: var(--text); }
.tour-pop h3 { font-size: 17px; font-weight: 650; margin: 0 0 6px; color: var(--text); }
.tour-pop.centered h3 { font-size: 20px; }
.tour-body { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.tour-body p { margin: 0 0 8px; }
.tour-body p:last-child { margin-bottom: 0; }
.tour-body ul { margin: 6px 0 0; padding-left: 18px; }
.tour-body li { margin: 3px 0; }
.tour-body kbd { font-family: inherit; font-size: 11.5px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); }
.tour-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.tour-dots { display: flex; gap: 5px; flex: none; }
.tour-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--border-strong); transition: width .2s ease, background .2s ease; }
.tour-dots i.done { background: var(--primary-100); }
.tour-dots i.on { width: 18px; background: var(--primary); }
.tour-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tour-btns { margin-left: auto; display: flex; gap: 6px; }
.tour-btns .btn[hidden] { display: none; }
@media (max-width: 420px) { .tour-dots { display: none; } }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-pop { transition: none; animation: none; } .guide-btn.tour-new::after { animation: none; } }

/* ---------- help page ---------- */
.help-hero { display: flex; gap: 18px; align-items: center; padding: 22px 24px; border-radius: var(--radius); margin-bottom: 18px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #2f6fe0 0%, #163a78 55%, #0c1f3b 100%); }
.help-hero h2 { font-size: 20px; margin: 0 0 4px; color: #fff; }
.help-hero p { margin: 0; color: #c7d6f3; font-size: 14px; }
.help-hero .btn { margin-left: auto; flex-shrink: 0; }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 22px; }
.guide { display: flex; flex-direction: column; gap: 8px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.guide:hover { border-color: var(--primary-100); box-shadow: 0 8px 24px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.guide h3 { font-size: 15px; margin: 4px 0 0; }
.guide p { margin: 0; color: var(--text-2); font-size: 13.5px; flex: 1; }
.guide .go { display: flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; font-size: 13.5px; margin-top: 4px; }
.guide .meta { font-size: 12px; color: var(--muted); }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 600; font-size: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon:last-child { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.faq details[open] summary .icon:last-child { transform: rotate(180deg); }
.faq .answer { padding: 0 18px 16px 44px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.faq .answer p { margin: 0 0 8px; }
.faq .answer ul { margin: 0; padding-left: 18px; }
@media (max-width: 640px) { .help-hero { flex-direction: column; align-items: flex-start; } .help-hero .btn { margin-left: 0; } }
kbd.k { font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--surface-2); color: var(--text); }
.missed-returns .day-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.missed-returns .day-links .chip { background: var(--surface); color: var(--danger); border: 1px solid rgba(180, 35, 24, .25); text-decoration: none; }
.missed-returns .day-links .chip:hover { background: var(--danger-bg); border-color: var(--danger); }

/* ---------- new-application wizard ---------- */
.wizard { max-width: 880px; margin: 0 auto; scroll-margin-top: 90px; }
.wz-steps { display: none; }
.wz-on .wz-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; list-style: none; margin: 0 0 18px; padding: 0; counter-reset: wz; }
.wz-steps li { position: relative; min-width: 0; }
.wz-steps li + li::before { content: ""; position: absolute; top: 17px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 2px; background: var(--border-strong); border-radius: 2px; }
.wz-steps li.done::before, .wz-steps li.current::before { background: var(--primary); }
.wz-steps button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0 4px; cursor: pointer; font: inherit; color: var(--text-2); text-align: center; }
.wz-steps button:disabled { cursor: default; }
.wz-steps .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border-strong);
  font-weight: 650; font-size: 14px; color: var(--muted); position: relative; z-index: 1; transition: background .2s ease, border-color .2s ease, box-shadow .2s ease; }
.wz-steps .n .icon { display: none; }
.wz-steps .t { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.wz-steps .t small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.wz-steps li.current .n { border-color: var(--primary); color: var(--primary); box-shadow: var(--ring); }
.wz-steps li.current .t { color: var(--primary-700); }
.wz-steps li.done .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.wz-steps li.done .n span { display: none; }
.wz-steps li.done .n .icon { display: block; }
.wz-steps li.done button:hover .t { color: var(--primary-700); }
.wz-steps button:focus-visible { outline: none; }
.wz-steps button:focus-visible .n { box-shadow: var(--ring); }
.wizard > .wz-step, .wizard > .alert { margin-bottom: 16px; }
.wz-on .wz-step[hidden] { display: none; }
.wz-on .wz-step { animation: wz-in .22s ease; }
@keyframes wz-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wz-bar [hidden] { display: none; }
.wz-bar .hint { margin-left: auto; margin-right: 4px; }
.wz-bar .btn-ghost + .hint:empty, .wz-bar > .btn-ghost { margin-right: auto; }
@media (max-width: 1240px) { .wz-bar .hint { display: none; } }
.wizard:not(.wz-on) .wz-bar [data-wz] { display: none; }
.reject-box { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.sum-group { padding: 4px 0 14px; }
.sum-group + .sum-group { border-top: 1px solid var(--border); padding-top: 14px; }
.sum-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sum-head h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; }
.sum-group dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px; }
.sum-group dt { font-size: 12.5px; color: var(--text-2); }
.sum-group dd { margin: 2px 0 0; font-weight: 550; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .wz-steps .t small { display: none; }
  .wz-steps .t { font-size: 12px; }
  .wz-steps li:not(.current) .t { color: var(--muted); }
  .wz-bar .hint { display: none; }
  .wz-bar { gap: 8px; }
  .wz-bar .btn-ghost { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) { .wz-on .wz-step { animation: none; } }
.ref-status { margin-top: 6px; display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.ref-status:empty { display: none; }
.ref-status .ok { color: var(--success); font-weight: 550; }

/* ---------- reports ---------- */
.day-picker { display: flex; gap: 6px; align-items: center; }
.day-picker input { width: auto; height: 36px; }
.return-state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; }
.return-state .cell { width: 22px; height: 22px; font-size: 11px; }
.chip.amber { background: var(--warning-bg); color: var(--warning); }
.chip.red { background: var(--danger-bg); color: var(--danger); }
.exc-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 14px; }
.exc-filters .period { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.exc-filters .exc-office { margin-left: auto; min-width: 240px; }
.issue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.issue-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.issue-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.issue-card .n { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.issue-card .n small { font-size: 12px; font-weight: 500; color: var(--muted); }
.issue-card .t { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.issue-card.warn .n { color: var(--warning); }
.issue-card.ok .n { color: var(--muted); }
.issue-card.on { border-color: var(--primary); box-shadow: var(--ring); }
.missed-list { list-style: none; margin: 0; padding: 0; }
.missed-list li { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.missed-list li:last-child { border-bottom: 0; }
.day-chips, .issue-chips { display: flex; flex-wrap: wrap; gap: 6px; }
strong.over { color: var(--danger); }
@media (max-width: 640px) { .exc-filters .exc-office { margin-left: 0; width: 100%; } .day-picker input { width: 150px; } }

/* ---------- dashboard: drill-down path, insights, unit comparison ---------- */
.drill-path { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: -2px 0 16px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.drill-path ol { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; list-style: none; margin: 0; padding: 0; }
.drill-path li { display: flex; align-items: center; gap: 6px; }
.drill-path li + li::before { content: "›"; color: var(--muted); font-size: 18px; line-height: 1; }
.drill-path a, .drill-path li > span { display: flex; flex-direction: column; padding: 4px 10px; border-radius: 9px; text-decoration: none;
  font-weight: 600; font-size: 13.5px; color: var(--text); line-height: 1.25; }
.drill-path small { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.drill-path a:hover { background: var(--primary-50); color: var(--primary-700); }
.drill-path .here { background: var(--primary-50); color: var(--primary-700); }
.drill-path .next > span { color: var(--text-2); font-weight: 500; border: 1px dashed var(--border-strong); }
.drill-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }

.insights { list-style: none; margin: 0; padding: 0 6px 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.insight { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 12px; align-items: start; padding: 12px; margin: 0 6px;
  border-bottom: 1px solid var(--border); }
.insight:nth-last-child(-n+2) { border-bottom: 0; }
.ins-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--neutral-bg); color: var(--neutral); }
.insight.good .ins-icon { background: var(--success-bg); color: var(--success); }
.insight.warn .ins-icon { background: var(--warning-bg); color: var(--warning); }
.insight.bad .ins-icon { background: var(--danger-bg); color: var(--danger); }
.insight.info .ins-icon { background: var(--info-bg); color: var(--info); }
.ins-body strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; }
.ins-body p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.ins-link { grid-column: 2; justify-self: start; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600;
  color: var(--primary); text-decoration: none; margin-top: 2px; }
.ins-link:hover { text-decoration: underline; }
@media (max-width: 720px) { .insight:nth-last-child(2) { border-bottom: 1px solid var(--border); } }

.unit-chart { border-bottom: 1px solid var(--border); }
.uc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.uc-legend .uc-over-key { color: var(--danger); }
.uc-legend { display: inline-flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; }
.uc-target-key { display: inline-block; width: 0; height: 12px; border-left: 2px dashed var(--text); margin-right: 4px; vertical-align: -2px; }
.uc-few-key { display: inline-block; width: 14px; height: 8px; border-radius: 2px; background: var(--series-1); opacity: .35; margin-right: 4px; }
.uc-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) 96px 84px; gap: 12px; align-items: center; padding: 5px 6px;
  border-radius: 8px; color: inherit; text-decoration: none; }
.uc-row:hover { background: var(--surface-2); }
.uc-row:hover .uc-label { color: var(--primary-700); text-decoration: underline; }
.uc-label { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-track { position: relative; height: 22px; display: flex; align-items: center; }
.uc-bar { height: 12px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.uc-row.few .uc-bar { opacity: .35; }
.uc-target { position: absolute; top: -2px; bottom: -2px; border-left: 2px dashed var(--text); opacity: .55; }
.uc-value { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.uc-value small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.uc-over { font-size: 11px; color: var(--danger); margin-left: 2px; }
.uc-pending { font-size: 12.5px; color: var(--text-2); text-align: right; white-space: nowrap; }
@media (max-width: 640px) { .uc-row { grid-template-columns: minmax(0, 1fr) auto auto; } .uc-track { grid-column: 1 / -1; grid-row: 2; } }
.filter-chip { text-decoration: none; background: var(--primary-50); color: var(--primary-700); }
.drill-actions .btn { white-space: nowrap; flex-direction: row; }

/* ---------- performance analysis ---------- */
:root { --stage-documents: #2a78d6; --stage-decision: #eb6834; --stage-certificate: #1baf7a; }
.an-controls { margin-bottom: 16px; }
.an-bar { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; padding: 12px 14px; }
.an-group { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.an-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.an-group select { width: auto; min-width: 180px; height: 36px; }
.an-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) { .an-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.an-label-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lab { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 9px; border-radius: 8px; font-weight: 700; font-size: 16px; }
.lab small { font-size: 11.5px; font-weight: 600; }
.lab.good, .lab-chip.good { background: var(--success-bg); color: var(--success); }
.lab.watch, .lab-chip.watch { background: var(--warning-bg); color: var(--warning); }
.lab.support, .lab-chip.support { background: var(--danger-bg); color: var(--danger); }
.lab.few, .lab-chip.few { background: var(--neutral-bg); color: var(--neutral); }
.lab-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.findings { list-style: none; margin: 0; padding: 4px 18px 10px; counter-reset: f; }
.finding { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.finding:last-child { border-bottom: 0; }
.fd-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  background: var(--info-bg); color: var(--info); }
.finding.good .fd-n { background: var(--success-bg); color: var(--success); }
.finding.warn .fd-n { background: var(--warning-bg); color: var(--warning); }
.finding.bad .fd-n { background: var(--danger-bg); color: var(--danger); }
.finding strong { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.finding p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.finding .fd-look { display: flex; gap: 6px; align-items: center; color: var(--primary-700); font-weight: 500; font-size: 13px; }
.an-table td, .an-table th { padding-left: 8px; padding-right: 8px; }
.an-table td.hot { background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.an-table tr.is-few td { color: var(--muted); }
.an-table tr.is-few td.primary-cell { color: var(--text-2); }
.an-grid { margin-bottom: 0; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-bottom: 10px; }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.st-key.documents, .st-seg.documents { background: var(--stage-documents); }
.st-key.decision, .st-seg.decision { background: var(--stage-decision); }
.st-key.certificate, .st-seg.certificate { background: var(--stage-certificate); }
.st-target-key { width: 0; height: 12px; border-left: 2px dashed var(--text); display: inline-block; opacity: .6; }
.st-rows { display: flex; flex-direction: column; gap: 2px; }
.st-row { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding: 4px 6px;
  border-radius: 8px; color: inherit; text-decoration: none; }
a.st-row[href]:hover { background: var(--surface-2); }
a.st-row[href]:hover .st-name { color: var(--primary-700); text-decoration: underline; }
.st-row.total { font-weight: 700; border-bottom: 1px solid var(--border); border-radius: 0; padding-bottom: 8px; margin-bottom: 4px; }
.st-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-track { position: relative; height: 16px; display: flex; gap: 2px; align-items: center; }
.st-seg { height: 12px; min-width: 2px; }
.st-seg:first-of-type { border-radius: 0; }
.st-seg:last-child { border-radius: 0 4px 4px 0; }
.st-seg.hot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger-dot); position: relative; z-index: 1; }
.st-target { position: absolute; top: -2px; bottom: -2px; border-left: 2px dashed var(--text); opacity: .5; z-index: 2; }
.st-total { font-size: 13px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.pm { width: 100%; height: auto; display: block; }
.pm-zone { fill: var(--danger-bg); }
.pm-grid { stroke: var(--grid); stroke-width: 1; }
.pm-ref { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .45; }
.pm-tick, .pm-axis, .pm-note { font-size: 11.5px; fill: var(--text-2); }
.pm-quad { font-size: 11.5px; font-weight: 600; fill: var(--danger); }
.pm-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; cursor: default; }
.pm-dot.prio { fill: var(--danger-dot); }
.pm-label { font-size: 11.5px; font-weight: 600; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.table.heat td.hc { text-align: center; font-weight: 600; min-width: 64px; }
.table.heat th.num { text-align: center; white-space: normal; min-width: 80px; vertical-align: bottom; }
.an-how { margin-top: 16px; }
.an-how summary { cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; gap: 8px; align-items: center; list-style: none; }
.an-how summary::-webkit-details-marker { display: none; }
.an-how ul { margin: 0; padding-left: 18px; }
.an-how li { margin: 6px 0; }
.an-table th:nth-child(2), .an-table td:nth-child(2) { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.an-table thead th:nth-child(2) { background: var(--surface-2); z-index: 2; }
.an-table tfoot td:nth-child(2) { background: var(--surface-2); }
.an-table tbody tr:hover td:nth-child(2) { background: var(--surface-2); }
.st-hot-key { width: 14px; height: 10px; border-radius: 2px; display: inline-block; box-shadow: 0 0 0 2px var(--danger-dot); }
.pm-list { margin: 8px 0 0; font-size: 13px; line-height: 1.7; } .pm-list a { font-weight: 600; }
.hc-n { display: block; font-size: 10.5px; font-weight: 500; opacity: .75; }

/* ---------- micro-charts (templatetags/charts.py) ---------- */
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 1.5; }
.spark-target { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; opacity: .45; }
.kpi.hero .spark-line { stroke: #fff; } .kpi.hero .spark-dot { fill: #fff; stroke: var(--primary-700); } .kpi.hero .spark-target { stroke: #fff; opacity: .6; }
.kpi-spark { margin-top: 10px; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.delta.up { background: var(--success-bg); color: var(--success); }
.delta.down { background: var(--danger-bg); color: var(--danger); }
.delta.same { background: var(--neutral-bg); color: var(--neutral); }
.kpi.hero .delta.up { background: rgba(255,255,255,.16); color: #bbf7d0; } .kpi.hero .delta.down { background: rgba(255,255,255,.16); color: #fecaca; }
.mc-track { position: relative; display: block; height: 8px; border-radius: 4px; background: var(--neutral-bg); flex: 1; min-width: 60px; }
.mc-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--series-1); }
.mc-fill.ok { background: var(--good); } .mc-fill.bad { background: var(--critical); } .mc-fill.warn { background: var(--warning-dot); }
.mc-tick { position: absolute; top: -4px; bottom: -4px; border-left: 2px dashed var(--text); opacity: .55; }
.mc-val { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 34px; text-align: right; }
.mc-bullet, .mc-share { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mc-compare { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.mc-row { display: grid; grid-template-columns: minmax(70px, 40%) minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; }
.mc-row .mc-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.mc-row .mc-fill { background: #9cbfe9; } .mc-row.hi .mc-fill { background: var(--series-1); } .mc-row.hi .mc-lab { color: var(--text); font-weight: 600; }
.mc-stages { margin-top: 8px; }
.mc-strack { position: relative; display: flex; gap: 2px; height: 18px; align-items: stretch; }
.mc-seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; min-width: 3px; }
.mc-seg:last-of-type { border-radius: 0 4px 4px 0; }
.mc-seg.documents { background: var(--stage-documents); } .mc-seg.decision { background: var(--stage-decision); } .mc-seg.certificate { background: var(--stage-certificate); color: #063d2a; }
.mc-seg.hot { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--danger-dot); position: relative; z-index: 1; }
.mc-strack .mc-tick { top: -3px; bottom: -3px; z-index: 2; }
.mc-hist { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 4px; }
.mc-bin { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.mc-bar { width: 100%; max-width: 54px; border-radius: 4px 4px 0 0; background: var(--series-1); min-height: 2px; }
.mc-bar.ok { background: var(--good); } .mc-bar.warn { background: var(--warning-dot); } .mc-bar.bad { background: var(--critical); }
.mc-n { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.mc-bl { font-size: 11.5px; color: var(--text-2); margin-top: 6px; white-space: nowrap; }
.journey .mc-strack { height: 34px; }
.journey .mc-seg { font-size: 13px; }
.journey-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.journey-legend span { display: inline-flex; align-items: center; gap: 7px; }
.journey-legend strong { color: var(--text); font-size: 14px; }
.journey-legend small { color: var(--muted); }
.age-cell { white-space: nowrap; }
.age-bar { display: inline-block; vertical-align: middle; width: 60px; height: 6px; border-radius: 3px; background: var(--neutral-bg); margin-right: 8px; position: relative; overflow: hidden; }
.age-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 3px; }
.age-bar span.warn { background: var(--warning-dot); } .age-bar span.bad { background: var(--critical); }
.ins-body .mc-bullet, .ins-body .mc-share, .ins-body .mc-compare, .ins-body .mc-stages { margin: 8px 0 6px; max-width: 360px; }
.kpi .value .delta { vertical-align: middle; margin-left: 6px; }
.assess-bar { display: flex; gap: 2px; height: 26px; margin-top: 10px; border-radius: 6px; overflow: hidden; }
.as-seg { display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; min-width: 18px; }
.as-seg.good { background: var(--good); color: #fff; } .as-seg.watch { background: var(--warning-dot); color: #3d2a00; }
.as-seg.support { background: var(--critical); color: #fff; } .as-seg.few { background: var(--neutral-dot); color: #fff; }
.assess-key { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 11.5px; color: var(--text-2); }
.assess-key i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.assess-key i.good { background: var(--good); } .assess-key i.watch { background: var(--warning-dot); } .assess-key i.support { background: var(--critical); } .assess-key i.few { background: var(--neutral-dot); }
.an-visuals { margin-bottom: 16px; }
.an-trend .spark { width: 100%; height: auto; }
.an-trend-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.fd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); column-gap: 24px; }
.fd-grid .finding { border-bottom: 1px solid var(--border); }
.finding .mc-bullet, .finding .mc-share, .finding .mc-compare, .finding .mc-stages { max-width: 380px; margin: 8px 0 4px; }
.cell-bar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cb-track { position: relative; width: 56px; height: 6px; border-radius: 3px; background: var(--neutral-bg); }
.cb-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--series-1); }
.cb-fill.ok { background: var(--good); } .cb-fill.bad { background: var(--critical); }
.cb-tick { position: absolute; top: -3px; bottom: -3px; border-left: 1.5px dashed var(--text); opacity: .5; }
.tl { width: 100%; height: auto; display: block; }
.tl-grid { stroke: var(--grid); stroke-width: 1; }
.tl-tick { font-size: 11px; fill: var(--text-2); }
.tl-target { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .45; }
.tl-line { fill: none; stroke: var(--series-1); stroke-width: 2.2; stroke-linejoin: round; }
.tl-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.tl-dot:hover { r: 6; }
.cb-v { display: inline-block; min-width: 36px; text-align: right; }

/* ---------- audit log viewer (/audit-log/) ---------- */
.al-body { background: var(--bg); min-height: 100vh; }
.al-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; background: var(--sidebar); color: #fff; }
.al-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.al-brand small { display: block; color: var(--sidebar-text); font-size: 12px; }
.al-who { display: flex; align-items: center; gap: 10px; } .al-who .muted { color: var(--sidebar-text); display: inline-flex; gap: 6px; align-items: center; }
.al-who .btn-ghost { color: #fff; }
.al-main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; }
.al-login { max-width: 420px; margin: 60px auto; } .al-login h2 { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.al-login .btn-block { width: 100%; margin-top: 8px; }
.al-filters { padding: 16px; margin-bottom: 14px; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; }
.al-grid .field { margin: 0; } .al-grid input, .al-grid select { width: 100%; }
.al-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.al-stats { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; margin: 0 2px 10px; font-size: 13px; color: var(--text-2); }
.al-stats .warn strong { color: var(--warning); } .al-stats .bad strong { color: var(--danger); }
.al-table td { vertical-align: top; font-size: 13px; }
.al-table .secondary { display: block; color: var(--muted); font-size: 12px; }
.al-time a { font-variant-numeric: tabular-nums; }
.al-req a { word-break: break-all; }
.al-method { font-size: 11px; font-weight: 650; color: var(--text-2); letter-spacing: .03em; }
.al-ip { font-variant-numeric: tabular-nums; white-space: nowrap; }
.al-status { display: inline-block; min-width: 38px; text-align: center; padding: 2px 6px; border-radius: 6px; font-weight: 650; font-size: 12px; background: var(--neutral-bg); color: var(--neutral); }
.al-status.s2 { background: var(--success-bg); color: var(--success); } .al-status.s3 { background: var(--info-bg); color: var(--info); }
.al-status.s4 { background: var(--warning-bg); color: var(--warning); } .al-status.s5 { background: var(--danger-bg); color: var(--danger); }
.al-notes .chip { margin: 0 4px 4px 0; } .chip.bad { background: var(--danger-bg); color: var(--danger); } .chip.warn { background: var(--warning-bg); color: var(--warning); }
.al-facts { display: grid; gap: 6px; margin: 0 0 12px; } .al-facts div { display: flex; gap: 10px; } .al-facts dt { width: 120px; flex: none; color: var(--muted); } .al-facts dd { margin: 0; word-break: break-all; }
.al-h { font-size: 14px; margin: 18px 0 8px; }
.al-pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow: auto; max-height: 560px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.al-errors { margin: 0 0 10px 18px; }
@media (max-width: 720px) { .al-table th:nth-child(5), .al-table td:nth-child(5) { display: none; } .al-facts div { flex-direction: column; gap: 0; } }
