:root {
    --navy: #101b35;
    --blue: #315efb;
    --ink: #172033;
    --muted: #63708a;
    --line: #dfe6ef;
    --canvas: #f6f8fb;
    --surface: #ffffff;
    --surface-muted: #f2f5f8;
    --success: #168b68;
    --warning: #bd7b16;
    --focus: rgba(49, 94, 251, .28);
    --shadow: 0 2px 8px rgba(23, 32, 51, .045);
    --radius: 8px;
    --radius-small: 6px;
}

html[data-theme="dark"] {
    --navy: #111b30;
    --blue: #8ca8ff;
    --ink: #ecf1f8;
    --muted: #aebbd0;
    --line: #36445c;
    --canvas: #171f2c;
    --surface: #202a39;
    --surface-muted: #293648;
    --success: #69cfa9;
    --warning: #f0b55a;
    --focus: rgba(140, 168, 255, .32);
    --shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
.usage-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 18px; }
.usage-filters label { display: block; color: var(--muted); font-size: .78rem; font-weight: 650; }
.usage-deployment-filter { flex: 1; min-width: 220px; }
.metric-grid.usage-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.usage-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.usage-chart { padding: 16px; }
.usage-chart svg { display: block; width: 100%; height: auto; }
.usage-grid-line { stroke: var(--line); stroke-width: 1; }
.usage-axis { fill: var(--muted); font-size: 12px; }
.usage-line { fill: none; stroke-width: 2.5; }
.usage-requests,.usage-input_tokens { stroke: var(--blue); }
.usage-output_tokens { stroke: var(--success); }
.usage-point { fill: var(--surface); stroke-width: 2; }
.usage-point:focus { outline: none; stroke: var(--warning); stroke-width: 4; }
.usage-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .8rem; }
.usage-swatch { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--blue); }
.usage-swatch.usage-output_tokens { background: var(--success); }
.usage-chart-data { margin-top: 12px; font-size: .8rem; }
.usage-chart-data summary { cursor: pointer; color: var(--blue); }
.usage-chart-data .table { margin-top: 12px; }
.usage-breakdown { padding: 18px; max-height: 390px; overflow-y: auto; }
.usage-deployment { display: block; padding: 10px 0; color: var(--ink); }
.usage-deployment:hover { text-decoration: none; }
.usage-deployment-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.usage-deployment small { color: var(--muted); }
.usage-bar-track { display: block; margin: 7px 0 4px; height: 9px; border-radius: 5px; background: var(--surface-muted); }
.usage-bar { display: block; height: 100%; border-radius: 5px; background: var(--blue); }
@media (max-width: 1100px) { .metric-grid.usage-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .usage-charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .metric-grid.usage-metrics { grid-template-columns: minmax(0, 1fr); } .usage-deployment-filter { min-width: 100%; } }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .92rem; line-height: 1.45; }
a { color: var(--blue); } a:hover { color: var(--blue); }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { background: var(--navy); color: #d9e2ff; display: flex; flex: none; flex-direction: column; padding: 24px 12px; width: 236px; position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
.brand { color: #fff; display: block; font-size: 1.15rem; font-weight: 750; letter-spacing: -.02em; padding: 0 12px 25px; text-decoration: none; }
.brand:hover { color: #fff; text-decoration: none; } .brand i { color: #82a1ff; margin-right: 7px; }
.sidebar-label { color: #96a6cb; font-size: .64rem; font-weight: 750; letter-spacing: .1em; padding: 0 12px 8px; }
.sidebar .nav-link { align-items: center; border-radius: var(--radius-small); color: #c3cee4; display: flex; font-weight: 550; gap: 11px; margin: 2px 0; padding: 9px 12px; }
.sidebar .nav-link i { text-align: center; width: 16px; }
.sidebar .nav-link:hover,.sidebar .nav-link.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.sidebar .nav-link.active { box-shadow: inset 3px 0 0 var(--blue); }
.nav-section { border-top: 1px solid rgba(255,255,255,.1); margin-top: 8px; padding-top: 8px; }
.nav-section-toggle { align-items: center; border-radius: var(--radius-small); color: #c3cee4; cursor: pointer; display: flex; font-size: .83rem; font-weight: 650; gap: 10px; list-style: none; padding: 11px 12px; }
.nav-section-toggle::-webkit-details-marker { display: none; }
.nav-section-toggle:hover,.nav-section.has-active > .nav-section-toggle { background: rgba(255,255,255,.08); color: #fff; }
.nav-section-toggle > i:first-child { flex: none; text-align: center; width: 16px; }
.nav-section-chevron { font-size: .65rem; margin-left: auto; }
.nav-section[open] > .nav-section-toggle .nav-section-chevron { transform: rotate(90deg); }
.nav-section-links { border-left: 1px solid rgba(255,255,255,.15); margin: 4px 0 8px 19px; padding-left: 5px; }
.nav-section-links .nav-link { font-size: .82rem; gap: 8px; padding: 9px 8px; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,.12); color: #9fafd0; font-size: .78rem; margin-top: auto; padding: 16px 12px 0; }
.sidebar-footer a { color: #c8d3ec; } .sidebar-version { margin-top: 13px; }
.theme-toggle { align-items: center; background: transparent; border: 0; color: #d9e2ff; cursor: pointer; display: flex; font: inherit; gap: 8px; padding: 6px 0; text-align: left; width: 100%; }
.theme-toggle:hover { color: #fff; }

.app-main { max-width: 1600px; padding: 34px 44px 48px; width: calc(100% - 236px); }
.page-header { margin-bottom: 24px; } .eyebrow { color: var(--blue); font-size: .67rem; font-weight: 800; letter-spacing: .1em; margin-bottom: 4px; }
.page-header h1 { font-size: 1.8rem; font-weight: 730; letter-spacing: -.035em; line-height: 1.2; margin: 0 0 6px; }
.page-header p { color: var(--muted); font-size: .94rem; margin: 0; }

.metric-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 17px 19px; }
.metric-card.success { border-top: 3px solid var(--success); } .metric-card.warning { border-top: 3px solid var(--warning); }
.metric-card:not(.success):not(.warning) { border-top: 3px solid var(--blue); }
.metric-card span { color: var(--muted); display: block; font-size: .76rem; font-weight: 650; }
.metric-card strong { display: block; font-size: 1.85rem; letter-spacing: -.045em; line-height: 1; margin: 9px 0 11px; }
.metric-card a { font-size: .8rem; font-weight: 650; }

.content-grid,.detail-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { align-items: center; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 13px 18px; }
.card-header strong { display: block; font-size: .94rem; } .card-header small { color: var(--muted); display: block; margin-top: 2px; }
.card-body,.table { background: var(--surface); color: var(--ink); } .table { margin-bottom: 0; }
.table th { border-top: 0; color: var(--muted); font-size: .67rem; font-weight: 750; letter-spacing: .065em; padding: 11px 18px; text-transform: uppercase; }
.table td { border-color: var(--line); padding: 12px 18px; vertical-align: middle; } .table td a { color: var(--blue); }
.table-hover tbody tr:hover { background: var(--surface-muted); color: var(--ink); } .empty-state { color: var(--muted); padding: 30px !important; text-align: center !important; }

.quick-actions a { align-items: center; border-bottom: 1px solid var(--line); color: var(--ink); display: flex; gap: 12px; padding: 14px 18px; text-decoration: none; }
.quick-actions a:last-child { border: 0; } .quick-actions a:hover { background: var(--surface-muted); }
.quick-actions i { color: var(--blue); font-size: 1rem; } .quick-actions span { font-weight: 650; }
.quick-actions small { color: var(--muted); display: block; font-size: .76rem; font-weight: 400; margin-top: 2px; }

.page-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: -4px 0 15px; }
.form-panel { background: var(--surface); padding: 19px; } .form-panel label,.form-group label { color: var(--muted); font-size: .74rem; font-weight: 700; }
.form-actions { margin-top: 16px; }
.form-control,.custom-select { background: var(--surface); border-color: var(--line); border-radius: var(--radius-small); color: var(--ink); min-height: calc(1.5em + .75rem + 2px); }
.form-control:focus,.custom-select:focus { background: var(--surface); border-color: var(--blue); box-shadow: 0 0 0 .18rem var(--focus); color: var(--ink); }
.form-control::placeholder { color: var(--muted); opacity: .82; } .form-text,.text-muted { color: var(--muted) !important; }
.btn { border-radius: var(--radius-small); box-shadow: none !important; font-weight: 650; padding: .42rem .76rem; }
.btn-primary { background: var(--blue); border-color: var(--blue); } .btn-primary:hover,.btn-primary:focus { background: var(--blue); border-color: var(--blue); filter: brightness(.91); }
.btn-outline-primary { border-color: var(--blue); color: var(--blue); } .btn-outline-primary:hover,.btn-outline-primary:focus { background: var(--blue); border-color: var(--blue); }

.module-grid { display: grid; gap: 11px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.module-toggle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); padding: 13px; }
.module-toggle strong,.module-toggle small { display: block; } .module-toggle small { color: var(--muted); font-size: .78rem; margin: 5px 0 9px; min-height: 36px; }
.module-toggle label { display: block; font-size: .82rem; margin: 5px 0; }
.details { font-size: .84rem; margin: 0; } .details dt { color: var(--muted); font-weight: 650; margin-top: 12px; } .details dd { margin: 3px 0; overflow-wrap: anywhere; }
.status { border-radius: var(--radius-small); font-size: .72rem; font-weight: 700; padding: 4px 8px; }
.status.ok { background: #e6f6f0; color: #137353; } .status.muted { background: var(--surface-muted); color: var(--muted); }
.switch { font-size: .82rem; white-space: nowrap; } .switch input { margin-right: 5px; }
code { background: var(--surface-muted); border-radius: 3px; color: var(--ink); font-size: .8em; padding: 2px 4px; }
.alert { border-radius: var(--radius-small); } .alert-success { background: #eaf8f1; border-color: #b7e2ca; color: #216d47; }
.alert-danger { background: #fff0f0; border-color: #efbcbc; color: #9f3737; } .alert-info { background: #edf5ff; border-color: #b9d6f6; color: #285f98; }

html[data-theme="dark"] .status.ok { background: #1a493c; color: #9be3c9; }
html[data-theme="dark"] .alert-success { background: #183e34; border-color: #2b6855; color: #c2efd9; }
html[data-theme="dark"] .alert-danger { background: #4a2d35; border-color: #754450; color: #ffd2d9; }
html[data-theme="dark"] .alert-info { background: #243d58; border-color: #456889; color: #d0e7ff; }
html[data-theme="dark"] .table-hover tbody tr:hover > td,html[data-theme="dark"] .table-hover tbody tr:hover > th { background: var(--surface-muted) !important; color: var(--ink); }
*:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (max-width: 900px) {
    .sidebar { padding: 20px 8px; }
    .app-main { padding: 28px 22px 40px; } .metric-grid,.content-grid,.detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .app-shell { flex-direction: column; }
    .sidebar { position: static; height: auto; width: 100%; padding: 16px 12px; }
    .brand { padding-bottom: 14px; }
    .sidebar-footer { margin-top: 16px; }
    .app-main { padding: 22px 15px 32px; width: 100%; } .page-header h1 { font-size: 1.5rem; }
    .module-grid { grid-template-columns: 1fr; } .table th,.table td { padding-left: 11px; padding-right: 11px; } .page-actions { justify-content: flex-start; }
}
