:root {
    --primary: #1d63d5;
    --primary-strong: #123c86;
    --primary-deep: #0d2e68;
    --primary-light: #4d9cff;
    --primary-pale: #dcecff;
    --primary-faint: #f0f6ff;
    --accent: #0b84d8;
    --accent-pale: #def3ff;
    --surface-page: #f4f8fd;
    --surface: #ffffff;
    --border: #d8e4f2;
    --border-strong: #bfd2e8;
    --text: #17324d;
    --text-muted: #577087;
    --text-dim: #8295a8;
    --success: #147a55;
    --success-pale: #ddf7ec;
    --warning: #b86a09;
    --warning-pale: #fff1d6;
    --danger: #be3447;
    --danger-pale: #ffe6ea;
    --info: #126b9a;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(29, 99, 213, .08);
    --shadow-md: 0 8px 24px rgba(20, 73, 137, .12);
    --shadow-lg: 0 18px 45px rgba(13, 46, 104, .2);
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    background: var(--surface-page);
    color: var(--text);
    font: 400 14px/1.5 Roboto, Arial, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(77, 156, 255, .38); outline-offset: 2px; }
code { padding: 2px 6px; border-radius: 6px; background: var(--primary-faint); color: var(--primary-strong); }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow-y: auto;
    color: #fff;
    background-color: var(--primary-strong);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,.09) 1px, transparent 1.2px),
        linear-gradient(165deg, rgba(77,156,255,.22), transparent 40%);
    background-size: 22px 22px, auto;
    box-shadow: 8px 0 28px rgba(13,46,104,.14);
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,255,255,.32); border-radius: 13px; background: rgba(255,255,255,.14); }
.brand-mark .material-symbols-rounded { font-size: 25px; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: 16px; }
.brand-copy small { margin-top: 4px; color: rgba(255,255,255,.68); font-size: 12px; }
.sidebar-nav { display: grid; gap: 5px; padding: 20px 14px; }
.nav-label { margin: 12px 10px 5px; color: rgba(255,255,255,.52); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm); color: rgba(255,255,255,.78); font-weight: 500; transition: 180ms cubic-bezier(.4,0,.2,1); }
.nav-item .material-symbols-rounded { width: 24px; font-size: 21px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.09); }
.nav-item.is-active { color: #fff; background: linear-gradient(90deg, rgba(77,156,255,.42), rgba(255,255,255,.1)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.13); }
.nav-item.is-active::before { content: ""; position: absolute; left: -2px; width: 4px; height: 22px; border-radius: 999px; background: #79c5ff; }
.sidebar-note { display: flex; gap: 10px; margin: auto 14px 18px; padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-md); background: rgba(5,31,75,.3); }
.sidebar-note .material-symbols-rounded { color: #8ed2ff; }
.sidebar-note div { display: grid; gap: 3px; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { color: rgba(255,255,255,.62); font-size: 11px; line-height: 1.4; }

.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 25; display: flex; height: 65px; align-items: center; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); box-shadow: var(--shadow-sm); }
.topbar::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: linear-gradient(90deg, var(--primary-strong), var(--primary-light), var(--accent)); }
.topbar-context { display: grid; line-height: 1.15; }
.context-label { margin-bottom: 3px; color: var(--text-dim); font-size: 11px; }
.topbar-context strong { font-size: 14px; }
.topbar-status { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text-muted); font-size: 12px; font-weight: 500; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 4px var(--danger-pale); background: var(--danger); }
.status-dot.is-online { box-shadow: 0 0 0 4px var(--success-pale); background: var(--success); }
.icon-button { display: inline-grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: #fff; cursor: pointer; }
.menu-button { display: none; }

.content-wrap { width: min(100%, 1600px); min-height: calc(100vh - 125px); margin: 0 auto; padding: 28px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(25px, 3vw, 31px); line-height: 1.15; letter-spacing: -.025em; }
h2 { margin-bottom: 5px; font-size: 18px; }
h3 { font-size: 15px; }
.page-description { max-width: 760px; margin-bottom: 0; color: var(--text-muted); font-size: 14px; }
.heading-meta { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: var(--text-dim); font-size: 12px; }
.heading-meta .material-symbols-rounded { font-size: 17px; }

.alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 15px 17px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.alert .material-symbols-rounded { margin-top: 1px; }
.alert strong { display: block; margin-bottom: 2px; }
.alert p { margin: 0; color: var(--text-muted); }
.alert-info { border-color: #b9def4; background: var(--accent-pale); color: var(--info); }
.alert-warning { border-color: #f0d39d; background: var(--warning-pale); color: var(--warning); }
.alert-danger { border-color: #f1bdc5; background: var(--danger-pale); color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; min-height: 148px; padding: 19px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.stat-card::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--primary); }
.stat-card.is-accent::after { background: var(--accent); }
.stat-card.is-warning::after { background: var(--warning); }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.stat-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-faint); }
.stat-icon .material-symbols-rounded { font-size: 21px; }
.stat-label { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.stat-value { margin-bottom: 5px; font-size: 25px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.stat-detail { color: var(--text-dim); font-size: 11px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 20px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-header p { margin: 0; color: var(--text-muted); font-size: 12px; }
.panel-body { padding: 20px; }
.panel-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.panel-link .material-symbols-rounded { font-size: 17px; }
.quick-list { display: grid; gap: 10px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--primary-faint); color: var(--text); }
.quick-item:hover { border-color: var(--primary-light); background: var(--primary-pale); }
.quick-item > .material-symbols-rounded { color: var(--primary); }
.quick-item div { display: grid; flex: 1; }
.quick-item strong { font-size: 13px; }
.quick-item small { color: var(--text-muted); }
.quick-item .arrow { color: var(--text-dim); font-size: 18px; }
.coverage-list { display: grid; gap: 16px; }
.coverage-item { display: grid; gap: 7px; }
.coverage-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.coverage-top span { color: var(--text-muted); }
.progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--primary-faint); }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary-strong), var(--primary-light)); }
.progress.is-warning span { background: var(--warning); }

.filter-panel { margin-bottom: 18px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)) auto; gap: 12px; align-items: end; }
.field { display: grid; gap: 6px; }
.field label { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.field input, .field select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); background: #fff; }
.field input:hover, .field select:hover { border-color: var(--primary-light); }
.field input:focus, .field select:focus { border-color: var(--primary); outline: 3px solid rgba(77,156,255,.18); }
.filter-actions { display: flex; gap: 8px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: 180ms cubic-bezier(.4,0,.2,1); }
.button:active { transform: scale(.98); }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { background: var(--primary-strong); }
.button-secondary { border-color: var(--border-strong); color: var(--text); background: #fff; }
.button-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-faint); }
.button .material-symbols-rounded { font-size: 18px; }

.report-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.mini-stat { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; }
.mini-stat span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 11px; }
.mini-stat strong { font-size: 18px; }

.table-panel { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.table-toolbar p { margin: 0; color: var(--text-muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 800px; border-collapse: collapse; }
th { position: sticky; top: 0; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); background: var(--primary-faint); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-align: left; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #eaf0f7; vertical-align: middle; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
.number { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mono { font-family: "Roboto Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 3px 9px; border-radius: 999px; color: var(--primary-strong); background: var(--primary-pale); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-success { color: var(--success); background: var(--success-pale); }
.badge-warning { color: var(--warning); background: var(--warning-pale); }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state .material-symbols-rounded { display: block; margin-bottom: 10px; color: var(--primary-light); font-size: 42px; }
.empty-state h3 { margin-bottom: 5px; }
.empty-state p { max-width: 480px; margin: 0 auto; color: var(--text-muted); }
.footer { padding: 0 28px 24px; color: var(--text-dim); font-size: 11px; text-align: center; }

@media (max-width: 1180px) {
    .stat-grid, .report-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .filter-grid { grid-template-columns: repeat(2, minmax(145px,1fr)); }
    .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-105%); transition: transform 240ms cubic-bezier(.4,0,.2,1); box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(13,46,104,.42); }
    .sidebar-backdrop:not([hidden]) { display: block; }
    .app-main { margin-left: 0; }
    .menu-button { display: inline-grid; }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .topbar { padding: 0 16px; }
    .topbar-context .context-label, .topbar-status span:last-child { display: none; }
    .content-wrap { padding: 18px 16px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .stat-grid, .report-summary, .filter-grid { grid-template-columns: 1fr; }
    .filter-actions { flex-direction: column; }
    .button { width: 100%; }
    .panel-header, .table-toolbar { align-items: flex-start; flex-direction: column; }
    .stat-card { min-height: 132px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
