:root {
  color-scheme: light;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  --canvas: #f2f5fa;
  --surface: #fff;
  --ink: #172842;
  --muted: #536682;
  --line: #dce5f0;
  --nav: #13223a;
  --accent: #2357bc;
  --teal: #117765;
  --amber: #9b5007;
  --red: #a2274a;
  --shadow: 0 2px 4px #14284a07;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #779efb; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem,3vw,2.4rem); letter-spacing: -.045em; line-height: 1.13; }
h2 { font-size: 1.12rem; letter-spacing: -.015em; }
h3 { font-size: .95rem; }
small, .muted { color: var(--muted); }
.loading { display: grid; place-items: center; min-height: 80vh; color: var(--muted); }
.shell { display: grid; grid-template-columns: 234px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; background: var(--nav); color: #f6f8ff; overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 7px; text-decoration: none; color: inherit; }
.brand-symbol { display: grid; place-items: center; flex: 0 0 37px; width: 37px; height: 36px; border-radius: 9px; background: #3071e6; color: white; font-weight: 800; letter-spacing: -.06em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { letter-spacing: .13em; font-size: .95rem; }
.brand-text small { color: #aabbd3; font-size: .76rem; margin-top: 4px; }
.sidebar nav { display: grid; gap: 5px; margin: 32px 0 18px; }
.sidebar nav a, .nav-signout { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 8px 10px; color: #c2d2ea; background: transparent; border: 1px solid transparent; border-radius: 8px; text-align: left; text-decoration: none; font-size: .91rem; }
.sidebar nav a[aria-current="page"] { background: #244674; color: white; border-color: #3a639d; }
.sidebar nav a:hover, .nav-signout:hover { background: #203652; color: #fff; }
.icon { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-bottom { margin-top: auto; display: grid; gap: 10px; }
.user { border-top: 1px solid #30425e; padding: 13px 9px 0; overflow-wrap: anywhere; }
.user strong, .user small { display: block; }
.user small { color: #aabbd3; }
.work { padding: 28px 34px 48px; max-width: 1680px; width: 100%; margin: 0 auto; }
.topbar { min-height: 34px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); margin-bottom: 23px; }
.topbar span { font-size: .86rem; color: var(--muted); }
.topbar .icon { margin-right: 5px; vertical-align: middle; }
.heading, .section-head, .toolbar, .dialog-head, .dialog-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.heading { margin-bottom: 23px; align-items: end; }
.heading p { margin-top: 7px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; font-weight: 650; color: var(--ink); background: #fff; padding: 7px 12px; font-size: .875rem; text-decoration: none; white-space: nowrap; }
.button:hover { background: #f1f5fa; }
.button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.button.primary:hover { background: #17469f; }
.button.subtle { min-height: 31px; padding: 4px 8px; color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 17px; }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.card { padding: 15px; min-height: 115px; border-top: 3px solid var(--card-accent,#3b6bcc); }
.card[data-tone="teal"] { --card-accent: #20937c; }
.card[data-tone="amber"] { --card-accent: #d48734; }
.card[data-tone="red"] { --card-accent: #bd5173; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 5px; color: var(--muted); font-size: .875rem; font-weight: 650; }
.card-top .icon { color: var(--card-accent,#3b6bcc); }
.card strong { display: block; margin-top: 4px; font-size: 1.86rem; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.card small { display: block; font-size: .83rem; margin-top: 4px; }
.split { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 15px; margin-bottom: 17px; }
.section-head { padding: 15px 16px 12px; }
.section-head small { display: block; margin-top: 3px; font-size: .85rem; }
.money { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 3px 16px 16px; gap: 8px; }
.money div { padding: 9px 10px; min-width: 0; border-radius: 7px; background: #edf3fc; }
.money span, .money strong { display: block; overflow-wrap: anywhere; }
.money span { color: var(--muted); font-size: .85rem; font-weight: 650; }
.money strong { color: #214883; font-size: clamp(.95rem,1.65vw,1.22rem); font-variant-numeric: tabular-nums; }
.coverage { padding: 0 16px 15px; }
.coverage strong { font-size: 1.38rem; }
.coverage progress { margin: 5px 0; }
.coverage small { display: block; font-size: .83rem; }
.stack { display: grid; gap: 15px; }
.toolbar { padding: 12px 15px; align-items: stretch; justify-content: flex-start; flex-wrap: wrap; }
.toolbar label { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.toolbar input { width: min(260px,100%); }
input, select, textarea { border: 1px solid #bdcce0; background: #fff; color: var(--ink); border-radius: 7px; min-height: 40px; padding: 7px 10px; width: 100%; }
textarea { resize: vertical; min-height: 85px; }
input[readonly], select:disabled { background: #eef2f8; }
input[type="checkbox"] { width: auto; min-height: auto; accent-color: var(--accent); }
.scroll-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
thead th { text-align: left; background: #e9f0f9; color: #3e577c; font-weight: 700; white-space: nowrap; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
tbody tr:nth-child(even) { background: #f8fafd; }
tbody tr:hover { background: #f1f6ff; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.identifier { font-weight: 700; color: #24497f; white-space: nowrap; }
.badge { display: inline-block; border-radius: 20px; padding: 3px 9px; background: #e8eef7; color: #324c6d; font-size: .81rem; font-weight: 650; }
.badge.teal { background: #dff5ed; color: #12624e; }
.badge.blue { background: #e2edff; color: #194f9d; }
.badge.amber { background: #fff0da; color: #814509; }
.badge.red { background: #fbe8ee; color: #96294c; }
.data-bar { display: flex; align-items: center; gap: 7px; min-width: 85px; justify-content: flex-end; }
.data-bar progress { width: 65px; }
progress { width: 100%; display: block; height: 8px; appearance: none; border: 0; color: #4380d9; border-radius: 6px; background: #e4ebf6; }
progress::-webkit-progress-bar { background: #e4ebf6; border-radius: 6px; }
progress::-webkit-progress-value { background: currentColor; border-radius: 6px; }
progress::-moz-progress-bar { background: currentColor; border-radius: 6px; }
progress.teal { color: #269881; }
progress.amber { color: #d48832; }
progress.red { color: #c35c7b; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.table-foot { padding: 9px 15px; font-size: .83rem; color: var(--muted); border-top: 1px solid var(--line); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at 20% 0,#dbe8ff,transparent 65%),var(--canvas); }
.auth-card { width: min(100%,444px); padding: 25px; }
.auth-card .brand { width: max-content; padding: 0; color: var(--ink); margin-bottom: 23px; }
.auth-card .brand-text small { color: var(--muted); }
.auth-card h1 { font-size: 1.85rem; }
.auth-card > p { margin: 7px 0 18px; color: var(--muted); }
.auth-card .button.primary { width: 100%; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.fields.single { grid-template-columns: 1fr; }
.field { display: grid; gap: 4px; align-content: start; font-size: .9rem; font-weight: 650; }
.field.wide { grid-column: 1/-1; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.form-error { color: #96294c; font-size: .9rem; font-weight: 650; margin: 10px 0; }
.form-error:empty { margin: 0; }
form > .button { margin-top: 15px; }
dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 13px; width: min(640px,calc(100% - 26px)); padding: 0; box-shadow: 0 20px 80px #0d1c3b55; }
dialog::backdrop { background: #101d34a5; }
.dialog-head { padding: 15px 18px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 16px 18px; }
.dialog-foot { justify-content: end; padding-top: 11px; }
.notice { padding: 11px 15px; background: #fff3df; border: 1px solid #ebc992; color: #75450b; border-radius: 8px; font-size: .875rem; }
.audit-details { max-width: 400px; overflow-wrap: anywhere; }
.audit-details dl { display: grid; grid-template-columns: 1fr 2fr; gap: 4px 8px; margin: 6px 0; }
.audit-details dd { margin: 0; }
#toast:not(:empty) { position: fixed; z-index: 2; bottom: 16px; right: 16px; padding: 11px 15px; border-radius: 8px; color: white; background: #1b3455; max-width: min(380px,calc(100vw - 32px)); }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 188px minmax(0,1fr); }
  .work { padding-inline: 19px; }
  .sidebar { padding-inline: 10px; }
  .kpis { gap: 8px; }
  .card { padding: 10px; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px; }
  .sidebar nav { display: flex; gap: 3px; margin: 10px 0 0; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; }
  .side-bottom { display: none; }
  .work { padding: 14px 12px 32px; }
  .topbar { margin-bottom: 15px; }
  .heading { align-items: start; flex-wrap: wrap; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (min-width: 761px) { .mobile-only { display: none; } }
@media (max-width: 420px) { .fields { grid-template-columns: 1fr; } .toolbar input { width: 100%; } .toolbar label { width: 100%; } }
.dialog-body .notice { margin-bottom: 12px; }
