.inline-form { display: inline; }
.section-copy { padding: 0 20px; color: var(--muted); }
.section-actions { display: flex; gap: 10px; padding: 20px; flex-wrap: wrap; }
.compact-filter { align-items: end; padding: 14px 20px; }
.time-series { position: relative; height: 250px; padding: 18px 72px 24px; background: linear-gradient(to bottom, #fafcfc, #fff); }
.time-series svg { width: 100%; height: 100%; overflow: visible; }
.time-series polyline { fill: none; stroke: var(--accent); stroke-width: 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.time-series .chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 5 7; }
.axis-label { position: absolute; left: 15px; color: var(--muted); font: .72rem ui-monospace, monospace; }
.axis-label.top { top: 18px; }
.axis-label.bottom { bottom: 22px; }

:root { color-scheme: light; }
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c141a;
    --panel: #152029;
    --ink: #edf3f6;
    --muted: #9babb6;
    --line: #2b3a45;
    --accent: #58c9ac;
    --accent-soft: #173c33;
    --danger: #ff8490;
    --danger-soft: #43262c;
    --sidebar: #081117;
    --shadow: 0 10px 32px rgba(0, 0, 0, .24);
}
html[data-theme="dark"],
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] th { background: #111b23; }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .button { background: #192630; border-color: #3a4b57; color: var(--ink); }
html[data-theme="dark"] .button.primary { background: var(--accent); border-color: var(--accent); color: #07120f; }
html[data-theme="dark"] .button.danger { background: var(--danger); border-color: var(--danger); color: #1b080b; }
html[data-theme="dark"] .badge { background: #26343f; color: #c3cdd3; }
html[data-theme="dark"] .badge.good { background: var(--accent-soft); color: var(--accent); }
html[data-theme="dark"] .badge.bad { background: var(--danger-soft); color: var(--danger); }
html[data-theme="dark"] .time-series { background: linear-gradient(to bottom, #111b23, var(--panel)); }
html[data-theme="dark"] .auth-page { background: radial-gradient(circle at 25% 15%, #173a33, transparent 38%), var(--bg); }
html[data-theme="dark"] .auth-card { background: var(--panel); border-color: var(--line); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.shell { transition: grid-template-columns 180ms ease; }
.sidebar {
    width: 240px;
    overflow: hidden;
    transition: width 180ms ease, padding 180ms ease;
}
.brand-mark { flex: 0 0 38px; }
.brand-name, .nav-label, .sidebar-action-label { white-space: nowrap; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-icon, .action-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sidebar-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9eacb7;
    font: inherit;
    font-size: .88rem;
    text-align: left;
    cursor: pointer;
}
.sidebar-action:hover, .sidebar-action:focus-visible { color: white; background: #1f303c; }
.sidebar-action:focus-visible { outline: 2px solid #58c9ac; outline-offset: 2px; }
.theme-toggle { margin-top: auto; }
.theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: block; }
.sidebar-user { margin-top: 8px; padding: 8px 0 0; }
.sidebar-user-copy { padding: 7px 12px 4px; }
.sidebar-user form { margin: 0; }
.sidebar-toggle {
    position: fixed;
    z-index: 30;
    top: 23px;
    left: 222px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: left 180ms ease, transform 180ms ease;
}
.sidebar-toggle:hover { color: var(--accent); transform: scale(1.04); }
.sidebar-toggle:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.sidebar-toggle-icon { font-size: 1.55rem; line-height: 1; transform: translateY(-1px); }

body.sidebar-collapsed .shell { grid-template-columns: 72px minmax(0, 1fr); }
body.sidebar-collapsed .sidebar {
    width: 72px;
    padding-right: 10px;
    padding-left: 10px;
}
body.sidebar-collapsed .brand { justify-content: center; }
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-action-label,
body.sidebar-collapsed .sidebar-user-copy { display: none; }
body.sidebar-collapsed .sidebar nav a,
body.sidebar-collapsed .sidebar-action { justify-content: center; padding-right: 10px; padding-left: 10px; }
body.sidebar-collapsed .sidebar-toggle { left: 54px; }

@media (max-width: 900px) {
    .sidebar { width: 100%; }
    .sidebar-toggle {
        top: 14px;
        right: 16px;
        left: auto;
    }
    body.sidebar-collapsed .shell { grid-template-columns: 1fr; }
    body.sidebar-collapsed .sidebar { display: none; }
    body.sidebar-collapsed .sidebar-toggle { right: 16px; left: auto; }
    body.sidebar-collapsed main { padding: 66px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .shell, .sidebar, .sidebar-toggle { transition: none; }
}
