:root {
  --navy: #10233f;
  --navy-2: #173754;
  --teal: #176b87;
  --teal-2: #1d829f;
  --ink: #16263a;
  --muted: #66758a;
  --line: #dfe7ee;
  --surface: #ffffff;
  --canvas: #f4f7f9;
  --success: #138a66;
  --warning: #b66d09;
  --danger: #b4233f;
  --shadow: 0 8px 28px rgba(16, 35, 63, .08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(29, 130, 159, .45);
  outline-offset: 3px;
}
.app-layout { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; background: linear-gradient(180deg, var(--navy), #0c1b30); color: #fff; padding: 22px 17px; display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 37px; height: 37px; border-radius: 10px; background: linear-gradient(145deg, #3cb9c7, var(--teal)); display: grid; place-items: center; font-size: 20px; font-weight: 800; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.brand strong { display: block; font-size: 17px; letter-spacing: .2px; }
.brand small, .user-chip small { display: block; color: #aab8c8; font-size: 10px; margin-top: 2px; letter-spacing: .4px; }
.nav-groups { margin: 30px 0; flex: 1; }
.nav-group { margin-bottom: 22px; }
.nav-group h2 { margin: 0 9px 8px; color: #8fa0b4; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.nav-group a { display: flex; gap: 9px; align-items: center; padding: 9px 10px; border-radius: 8px; color: #cbd6e1; text-decoration: none; font-size: 13px; margin-bottom: 2px; }
.nav-group a:hover, .nav-group a.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: #61748c; }
.nav-group a.active .nav-dot { background: #48c4cc; box-shadow: 0 0 0 4px rgba(72,196,204,.13); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.11); padding-top: 14px; display: grid; gap: 9px; }
.sidebar-footer > a, .link-button { border: 0; padding: 4px 7px; color: #b9c7d4; background: none; text-decoration: none; font-size: 12px; text-align: left; cursor: pointer; }
.sidebar-footer > a:hover, .link-button:hover { color: #fff; }
.user-chip { display: flex; gap: 9px; align-items: center; padding: 10px 7px 4px; overflow: hidden; }
.user-chip strong { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.avatar { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; background: #294761; border-radius: 50%; font-weight: 700; }
.main-content { margin-left: 270px; min-height: 100vh; padding: 30px 34px 60px; }
.page-header { display: flex; justify-content: space-between; gap: 25px; align-items: flex-start; margin: 0 0 23px; }
.breadcrumbs, .eyebrow { color: var(--teal); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.1px; }
.page-header h1 { margin: 6px 0 6px; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.7px; }
.page-header p { color: var(--muted); margin: 0; max-width: 760px; line-height: 1.5; }
.snapshot-chip { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); white-space: nowrap; }
.snapshot-chip small, .snapshot-chip strong { display: block; font-size: 10px; }
.snapshot-chip small { color: var(--muted); margin-bottom: 2px; }
.status-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px rgba(19,138,102,.13); }
.coverage-note, .warning-note { padding: 11px 14px; background: #fff7e6; color: #744800; border: 1px solid #f2d5a0; border-radius: 10px; margin: -6px 0 17px; font-size: 12px; }
.filter-panel, .surface, .visual-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filter-panel { padding: 15px 17px; }
.filter-primary { display: flex; align-items: flex-end; gap: 11px; flex-wrap: wrap; }
label { color: #405168; font-size: 11px; font-weight: 700; }
input, select { display: block; width: 100%; margin-top: 5px; border: 1px solid #cdd8e2; background: #fff; color: var(--ink); border-radius: 8px; min-height: 38px; padding: 7px 10px; outline: none; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23,107,135,.12); }
select[multiple] { min-height: 90px; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
.compare-toggle { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 5px; white-space: nowrap; }
.compare-toggle input { width: 17px; min-height: auto; margin: 0; }
.button { border: 1px solid transparent; min-height: 38px; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 750; font-size: 11px; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--teal); }
.button.primary:hover { background: var(--teal-2); }
.button.secondary { background: var(--navy); color: #fff; }
.button.ghost { background: #fff; border-color: #cfdae4; color: #405168; }
.button.full { width: 100%; }
.button.small { min-height: 30px; padding: 5px 9px; }
.filter-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.filter-more summary { cursor: pointer; color: var(--teal); font-size: 11px; font-weight: 750; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.filter-chip { border: 1px solid #bcd4dc; background: #eef7f8; color: #24576a; border-radius: 999px; padding: 5px 9px; font-size: 9px; cursor: pointer; }
.filter-chip::after { content: " ×"; font-weight: 900; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 13px; padding-top: 13px; }
.report-toolbar { margin: 17px 0; display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.segmented { display: flex; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 3px; }
.segmented button { border: 0; background: none; padding: 6px 10px; border-radius: 6px; font-size: 10px; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--navy); color: #fff; }
.toolbar-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.customizer { background: #eef5f7; border: 1px solid #d5e5e9; border-radius: 12px; padding: 17px; margin-bottom: 17px; grid-template-columns: 1fr 1fr; gap: 24px; }
.customizer:not([hidden]) { display: grid; }
.customizer h3 { margin: 0 0 4px; font-size: 13px; }
.customizer p { margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.check-grid label { display: flex; align-items: center; gap: 5px; font-weight: 550; }
.check-grid input { width: auto; min-height: auto; margin: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 13px; margin: 0 0 17px; }
.kpi-card { padding: 16px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.kpi-card .label { color: var(--muted); text-transform: uppercase; font-size: 9px; font-weight: 800; letter-spacing: .7px; }
.kpi-card .value { margin: 7px 0 5px; font-size: 23px; font-weight: 780; letter-spacing: -.5px; }
.kpi-card .comparison { color: var(--teal); font-size: 10px; font-weight: 700; }
.visual-card { padding: 18px; }
.visual-card-header, .section-header { display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.visual-card-header h2, .section-header h2 { margin: 0; font-size: 15px; }
.visual-card-header p, .section-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.chart { width: 100%; height: 390px; margin: 8px 0 12px; }
.table-scroll { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 9px 10px; background: #eef3f6; color: #45566d; text-align: left; white-space: nowrap; position: sticky; top: 0; }
td { padding: 9px 10px; border-bottom: 1px solid #e8edf1; white-space: nowrap; }
tbody tr:hover { background: #f7fafb; }
td small, .list-row small, .admin-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.inline-error { background: #fff0f3; color: var(--danger); border: 1px solid #f2bdc8; padding: 11px; border-radius: 9px; margin-bottom: 13px; }
.loading-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(244,247,249,.82); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; font-size: 12px; font-weight: 700; }
.loading-overlay[hidden] { display: none; }
.loader { width: 32px; height: 32px; border: 3px solid #cad8e1; border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.flash-stack { position: fixed; z-index: 200; top: 18px; right: 22px; display: grid; gap: 8px; }
.flash { padding: 11px 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--teal); box-shadow: var(--shadow); border-radius: 8px; font-size: 11px; }
.flash.error { border-left-color: var(--danger); }
.surface { padding: 18px; margin-bottom: 17px; }
.content-grid { display: grid; gap: 17px; }
.content-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-header { margin-bottom: 15px; }
.stack-form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form { display: flex; gap: 9px; align-items: flex-end; margin: 0 0 17px; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 150px; margin: 0; }
.mapping-form input { min-width: 130px; }
.list { display: grid; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid #e8edf1; padding: 11px 2px; }
.list-row:last-child { border-bottom: 0; }
.badge { padding: 4px 8px; background: #eef1f4; color: #5e6b79; border-radius: 999px; font-size: 9px; text-transform: uppercase; font-weight: 800; }
.badge.success { background: #e3f6ef; color: var(--success); }
.compact-empty, .empty-state { color: var(--muted); text-align: center; padding: 34px 15px; }
.empty-state { margin: 15vh auto; max-width: 520px; }
.empty-state h1 { color: var(--ink); }
.empty-icon { font-size: 33px; }
.admin-tabs { display: flex; gap: 8px; margin: -7px 0 18px; }
.admin-tabs a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; font-size: 10px; text-decoration: none; }
.admin-table td form { margin: 0; }
.compact-form { display: contents; }
.compact-form select { width: 92px; min-height: 31px; margin: 0 0 4px; padding: 4px; }
.switch { display: flex; align-items: center; gap: 4px; }
.switch input { width: auto; min-height: auto; margin: 0; }
.permission-card { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; padding: 0 13px 13px; }
.permission-card summary { display: flex; justify-content: space-between; padding: 12px 0; cursor: pointer; font-size: 11px; font-weight: 750; }
.permission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 13px; }
.permission-grid fieldset { border: 1px solid var(--line); border-radius: 8px; }
.permission-grid label { display: flex; gap: 5px; align-items: flex-start; font-weight: 500; margin: 5px 0; }
.permission-grid input { width: auto; min-height: auto; margin: 1px 0 0; }
dialog { width: min(500px, calc(100vw - 30px)); border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(16,35,63,.25); padding: 0; }
dialog::backdrop { background: rgba(10,25,44,.55); }
.dialog-form { padding: 23px; position: relative; }
.dialog-form h2 { margin: 5px 0; }
.dialog-form p { color: var(--muted); line-height: 1.5; font-size: 11px; }
.dialog-close { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 24px; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.auth-layout { min-height: 100vh; background: #edf2f6; }
.auth-shell { width: min(1040px, calc(100% - 32px)); min-height: 610px; margin: 6vh auto; display: grid; grid-template-columns: 1.2fr .8fr; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 25px 70px rgba(16,35,63,.16); }
.auth-panel { color: #fff; padding: 42px; background: radial-gradient(circle at 80% 10%, rgba(47,184,197,.28), transparent 32%), linear-gradient(150deg, var(--navy), #0a1b31); }
.auth-brand { margin-bottom: 100px; }
.auth-copy h1 { font-size: 42px; line-height: 1.06; max-width: 500px; margin: 12px 0 18px; letter-spacing: -1.5px; }
.auth-copy > p { color: #b9c7d6; line-height: 1.6; max-width: 500px; }
.auth-feature { margin-top: 18px; color: #d8e2ea; font-size: 12px; }
.auth-feature span { color: #48c4cc; margin-right: 8px; }
.sign-in-card { padding: 70px 45px; align-self: center; }
.sign-in-card h2 { margin: 7px 0 9px; font-size: 26px; }
.muted, .fine-print { color: var(--muted); line-height: 1.6; font-size: 12px; }
.fine-print { font-size: 10px; margin-top: 18px; }
@media (max-width: 1100px) {
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  .nav-groups { display: flex; gap: 12px; overflow-x: auto; margin: 18px 0 10px; padding-bottom: 6px; }
  .nav-group { min-width: 210px; margin-bottom: 0; }
  .main-content { margin-left: 0; padding: 22px 16px 45px; }
  .sidebar-footer { display: flex; align-items: center; flex-wrap: wrap; }
  .user-chip { margin-left: auto; }
  .page-header, .report-toolbar { flex-direction: column; align-items: stretch; }
  .filter-grid, .content-grid.two, .permission-grid, .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth-shell { min-height: auto; margin: 4vh auto; }
  .sign-in-card { padding: 42px 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
