/*
 * Console — design system for the broadcast dashboard.
 *
 * Layered over Bootstrap 5 (CDN). Bootstrap keeps the grid and a handful of
 * utilities; everything with a visual opinion is defined here so the surface
 * reads as one system rather than as a themed default.
 */

/* ---------------------------------------------------------------- tokens */

:root {
    /* Cool neutral ramp. The sidebar sits at the dark end as a second layer. */
    --n-950: #0a1020;
    --n-900: #111a2b;
    --n-850: #17223a;
    --n-800: #1e2b45;
    --n-700: #334155;
    --n-600: #475569;
    --n-500: #64748b;
    --n-400: #94a3b8;
    --n-300: #cbd5e1;
    --n-200: #e2e8f0;
    --n-150: #eaeff5;
    --n-100: #f1f5f9;
    --n-50: #f8fafc;

    --c-bg: #f5f7fa;
    --c-surface: #ffffff;
    --c-line: var(--n-200);
    --c-line-strong: var(--n-300);

    --c-text: #0f172a;
    --c-text-secondary: #51607a;
    --c-text-muted: #67748c;
    --c-text-invert: #ffffff;

    /* One accent. Primary actions, current selection, focus — never decoration. */
    --c-accent: #2c5bf2;
    --c-accent-strong: #1e42c4;
    --c-accent-soft: #eef2ff;
    --c-accent-line: #c7d2fe;

    /* Live/connected carries real meaning in this product, so it gets a hue. */
    --c-live: #0e9f6e;
    --c-live-text: #047857;
    --c-live-soft: #e7f7f0;

    --c-warn: #b45309;
    --c-warn-soft: #fef4e7;
    --c-danger: #dc2626;
    --c-danger-strong: #b91c1c;
    --c-danger-soft: #fef2f2;

    /* Offset + blur, never a flat halo. */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --shadow-md: 0 2px 4px rgba(15, 23, 42, .04), 0 8px 16px -4px rgba(15, 23, 42, .08);
    --shadow-lg: 0 4px 8px rgba(15, 23, 42, .04), 0 16px 32px -8px rgba(15, 23, 42, .12);

    --r-sm: 6px;
    --r: 8px;
    --r-lg: 12px;

    --t-xs: .75rem;
    --t-sm: .8125rem;
    --t-base: .875rem;
    --t-md: 1rem;
    --t-lg: 1.125rem;
    --t-xl: 1.375rem;
    --t-2xl: 1.75rem;

    --font: 'Inter Variable', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

    --sidebar-w: 248px;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------------ base */

body {
    font-family: var(--font);
    font-size: var(--t-base);
    line-height: 1.55;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -.014em;
    color: var(--c-text);
    text-wrap: balance;
}

a {
    color: var(--c-accent);
    text-decoration: none;
    transition: color .15s var(--ease);
}

a:hover { color: var(--c-accent-strong); text-decoration: underline; }

/* Numbers line up in tables and metrics. */
.tnum, table, .metric-value { font-variant-numeric: tabular-nums; }

:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
    border-radius: 3px;
}

::selection { background: var(--c-accent-soft); color: var(--c-accent-strong); }

/* ----------------------------------------------------------- app shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--n-950);
    color: var(--n-300);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 18px;
    color: #fff;
    font-weight: 600;
    font-size: var(--t-md);
    letter-spacing: -.02em;
}

.sidebar-brand:hover { color: #fff; text-decoration: none; }

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--c-accent);
    display: grid;
    place-items: center;
    color: #fff;
    flex: 0 0 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 10px -2px rgba(44, 91, 242, .5);
}

.sidebar-section {
    padding: 14px 20px 6px;
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--n-500);
}

.sidebar-nav { padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--n-300);
    font-weight: 500;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar-link.is-active { background: var(--c-accent); color: #fff; }
.sidebar-link i { font-size: 1rem; opacity: .9; }

.sidebar-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-user { font-size: var(--t-sm); color: var(--n-400); }
.sidebar-user strong { display: block; color: #fff; font-weight: 500; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-line);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-title { font-size: var(--t-lg); font-weight: 600; margin: 0; letter-spacing: -.02em; }
.topbar-sub { font-size: var(--t-sm); color: var(--c-text-muted); margin: 2px 0 0; }

.content { padding: 28px; flex: 1 1 auto; }
.content-narrow { max-width: 880px; }

/* -------------------------------------------------------------- panels */

.panel {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-title { font-size: var(--t-md); font-weight: 600; margin: 0; }
.panel-hint { font-size: var(--t-sm); color: var(--c-text-muted); margin: 2px 0 0; }
.panel-body { padding: 20px; }
.panel-body-flush { padding: 0; }

/* ------------------------------------------------------------- buttons */

.btn {
    --btn-bg: var(--c-surface);
    --btn-fg: var(--c-text);
    --btn-bd: var(--c-line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font);
    font-size: var(--t-base);
    font-weight: 500;
    line-height: 1.2;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-fg);
    cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
    box-shadow: var(--shadow-sm);
}

.btn:hover { background: var(--n-50); color: var(--btn-fg); border-color: var(--n-400); }
.btn:active { transform: translateY(.5px); box-shadow: none; }

.btn:disabled, .btn.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-primary { --btn-bg: var(--c-accent); --btn-fg: #fff; --btn-bd: var(--c-accent); }
.btn-primary:hover { background: var(--c-accent-strong); border-color: var(--c-accent-strong); color: #fff; }

.btn-danger { --btn-bg: var(--c-danger); --btn-fg: #fff; --btn-bd: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger-strong); border-color: var(--c-danger-strong); color: #fff; }

.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; box-shadow: none; color: var(--c-text-secondary); }
.btn-ghost:hover { background: var(--n-100); border-color: transparent; color: var(--c-text); }

.btn-sm { padding: 5px 10px; font-size: var(--t-sm); }
.btn-lg { padding: 11px 20px; font-size: var(--t-md); }
.btn i { font-size: 1em; }

.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --------------------------------------------------------------- forms */

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.label {
    display: block;
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: 6px;
}

.input, .select, .textarea {
    display: block;
    width: 100%;
    font-family: var(--font);
    font-size: var(--t-base);
    line-height: 1.5;
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-sm);
    padding: 9px 12px;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, .03);
}

.input::placeholder, .textarea::placeholder { color: #7b879b; }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(44, 91, 242, .16);
}

.input:disabled, .textarea:disabled {
    background: var(--n-100);
    color: var(--c-text-muted);
    cursor: not-allowed;
}

.input.is-invalid, .textarea.is-invalid { border-color: var(--c-danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .15); }

.help { font-size: var(--t-sm); color: var(--c-text-muted); margin-top: 6px; }

.error {
    font-size: var(--t-sm);
    color: var(--c-danger-strong);
    margin-top: 6px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.check { display: flex; align-items: flex-start; gap: 10px; }
.check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--c-accent);
    flex: 0 0 16px;
}
.check-label { font-size: var(--t-base); font-weight: 500; }
.check-help { font-size: var(--t-sm); color: var(--c-text-muted); }

/* -------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--t-base);
}

table.data th {
    text-align: left;
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    padding: 10px 20px;
    background: var(--n-50);
    border-bottom: 1px solid var(--c-line);
    white-space: nowrap;
}

table.data td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--c-line);
    vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s var(--ease); }
table.data tbody tr:hover { background: var(--n-50); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 500; color: var(--c-text); }
.cell-sub { font-size: var(--t-sm); color: var(--c-text-muted); }

/* -------------------------------------------------------------- badges */

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--t-xs);
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-live { background: var(--c-live-soft); color: var(--c-live-text); border-color: #b6e6d2; }
.badge-idle { background: var(--n-100); color: var(--c-text-secondary); border-color: var(--c-line); }
.badge-off { background: var(--c-warn-soft); color: var(--c-warn); border-color: #f6ddb8; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }

/* The one authored motion: a connected project visibly breathes. */
.dot-live { animation: pulse 2.4s var(--ease) infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(14, 159, 110, .5); }
    50% { opacity: .75; box-shadow: 0 0 0 4px rgba(14, 159, 110, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .dot-live { animation: none; }
    * { transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------- stats */

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.metric {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: var(--t-sm);
    color: var(--c-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.metric-value { font-size: var(--t-2xl); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.metric-foot { font-size: var(--t-sm); color: var(--c-text-muted); margin-top: 4px; }

/* Real hourly data, drawn as bars — not a decorative sparkline. */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 0 4px; }

.chart-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    height: 100%;
    position: relative;
    min-width: 0;
}

.chart-bar { border-radius: 2px 2px 0 0; transition: opacity .15s var(--ease); min-height: 0; }
.chart-bar-sent { background: var(--c-accent); }
.chart-bar-recv { background: var(--c-accent-line); }
.chart-col:hover .chart-bar { opacity: .75; }

.chart-axis {
    display: flex;
    gap: 3px;
    padding: 6px 4px 0;
    font-size: 10px;
    color: var(--c-text-muted);
    font-variant-numeric: tabular-nums;
}

.chart-axis span { flex: 1 1 0; text-align: center; min-width: 0; }

.legend { display: flex; gap: 16px; font-size: var(--t-sm); color: var(--c-text-secondary); }
.legend-key { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ------------------------------------------------------------- filters */

.filterbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.filterbar-field { min-width: 180px; }
.filterbar-field .label { margin-bottom: 4px; }
.filterbar .btn { margin-bottom: 1px; }

.segmented {
    display: inline-flex;
    background: var(--n-100);
    border: 1px solid var(--c-line);
    border-radius: var(--r-sm);
    padding: 2px;
    gap: 2px;
}

.segment {
    padding: 6px 12px;
    border-radius: 5px;
    font-size: var(--t-sm);
    font-weight: 500;
    color: var(--c-text-secondary);
    white-space: nowrap;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.segment:hover { background: var(--c-surface); color: var(--c-text); text-decoration: none; }

.segment.is-active {
    background: var(--c-surface);
    color: var(--c-accent-strong);
    box-shadow: var(--shadow-sm);
}

.segment.is-active:hover { color: var(--c-accent-strong); }

/* ------------------------------------------------------------ log tags */

.tag {
    display: inline-block;
    font-size: var(--t-xs);
    font-weight: 500;
    padding: 3px 8px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    white-space: nowrap;
}

.tag-connection { background: var(--c-live-soft); color: var(--c-live-text); border-color: #b6e6d2; }
.tag-disconnection { background: var(--n-100); color: var(--c-text-secondary); border-color: var(--c-line); }
.tag-subscribe { background: var(--c-accent-soft); color: var(--c-accent-strong); border-color: var(--c-accent-line); }
.tag-unsubscribe { background: var(--n-100); color: var(--c-text-secondary); border-color: var(--c-line); }
.tag-event { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.tag-client_event { background: var(--c-accent-soft); color: var(--c-accent-strong); border-color: var(--c-accent-line); }
.tag-error { background: var(--c-danger-soft); color: var(--c-danger-strong); border-color: #f7cfcf; }

/* Bootstrap's pagination, brought into this system. */
.pagination { margin: 0; gap: 4px; }

.pagination .page-link {
    border-radius: var(--r-sm);
    border: 1px solid var(--c-line);
    color: var(--c-text-secondary);
    font-size: var(--t-sm);
    padding: 6px 11px;
}

.pagination .page-link:hover { background: var(--n-50); color: var(--c-text); }

.pagination .page-item.active .page-link {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}

.pagination .page-item.disabled .page-link { color: var(--n-400); background: var(--c-surface); }

/* ------------------------------------------------------- code + copy */

.code {
    position: relative;
    background: var(--n-950);
    border-radius: var(--r);
    padding: 14px 46px 14px 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    line-height: 1.65;
    color: #dbe4f3;
    white-space: pre;
    tab-size: 2;
}

.code .tok-key { color: #93b4ff; }
.code .tok-str { color: #8ee0b4; }
.code .tok-comment { color: #8496b0; font-style: italic; }

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #dbe4f3;
    border-radius: var(--r-sm);
    padding: 4px 9px;
    font-size: var(--t-xs);
    font-family: var(--font);
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.copy-btn:hover { background: rgba(255, 255, 255, .18); }
.copy-btn.is-copied { background: var(--c-live); border-color: var(--c-live); color: #fff; }

.cred {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--n-50);
    border: 1px solid var(--c-line);
    border-radius: var(--r);
    padding: 11px 12px 11px 14px;
}

.cred-value {
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    color: var(--c-text);
    word-break: break-all;
    min-width: 0;
}

.cred-label {
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    margin-bottom: 6px;
}

.copy-inline {
    flex: 0 0 auto;
    background: var(--c-surface);
    border: 1px solid var(--c-line-strong);
    border-radius: var(--r-sm);
    color: var(--c-text-secondary);
    padding: 5px 9px;
    font-size: var(--t-xs);
    font-family: var(--font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}

.copy-inline:hover { background: var(--n-100); color: var(--c-text); }
.copy-inline.is-copied { background: var(--c-live); border-color: var(--c-live); color: #fff; }

/* --------------------------------------------------------------- steps */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }

.step {
    position: relative;
    counter-increment: step;
    padding: 0 0 26px 40px;
}

.step:last-child { padding-bottom: 0; }

.step::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--c-accent-soft);
    color: var(--c-accent-strong);
    border: 1px solid var(--c-accent-line);
    display: grid;
    place-items: center;
    font-size: var(--t-xs);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Connector line between steps. */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 13px;
    top: 30px;
    bottom: 8px;
    width: 1px;
    background: var(--c-line);
}

.step-title { font-weight: 600; margin: 3px 0 8px; }
.step-body { color: var(--c-text-secondary); }
.step-body p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- alerts */

.notice {
    display: flex;
    gap: 11px;
    padding: 12px 14px;
    border-radius: var(--r);
    border: 1px solid var(--c-line);
    background: var(--c-surface);
    font-size: var(--t-base);
    align-items: flex-start;
}

.notice i { font-size: 1rem; line-height: 1.4; flex: 0 0 auto; }
.notice-success { background: var(--c-live-soft); border-color: #b6e6d2; color: var(--c-live-text); }
.notice-warn { background: var(--c-warn-soft); border-color: #f6ddb8; color: var(--c-warn); }
.notice-danger { background: var(--c-danger-soft); border-color: #f7cfcf; color: var(--c-danger-strong); }
.notice-info { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent-strong); }
.notice strong { font-weight: 600; }

/* ---------------------------------------------------------- empty state */

.empty { text-align: center; padding: 56px 24px; }

.empty-mark {
    width: 48px;
    height: 48px;
    border-radius: var(--r-lg);
    background: var(--c-accent-soft);
    color: var(--c-accent);
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    font-size: 1.4rem;
}

.empty-title { font-size: var(--t-lg); font-weight: 600; margin-bottom: 6px; }
.empty-text { color: var(--c-text-secondary); max-width: 46ch; margin: 0 auto 20px; }

/* ----------------------------------------------------------- auth pages */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(60rem 40rem at 50% -10%, #e8eeff 0%, rgba(232, 238, 255, 0) 60%),
        var(--c-bg);
}

.auth-card { width: 100%; max-width: 400px; }

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
    font-weight: 600;
    font-size: var(--t-lg);
    color: var(--c-text);
    letter-spacing: -.02em;
}

.auth-title { font-size: var(--t-xl); margin-bottom: 4px; }
.auth-sub { color: var(--c-text-muted); margin-bottom: 22px; font-size: var(--t-base); }
.auth-foot { text-align: center; margin-top: 18px; font-size: var(--t-sm); color: var(--c-text-muted); }

/* -------------------------------------------------------------- helpers */

.stack { display: flex; flex-direction: column; }
.stack-sm { gap: 10px; }
.stack-md { gap: 16px; }
.stack-lg { gap: 24px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.muted { color: var(--c-text-muted); }
.secondary { color: var(--c-text-secondary); }
.mono { font-family: var(--font-mono); }
.text-sm { font-size: var(--t-sm); }
.text-xs { font-size: var(--t-xs); }

/* ---------------------------------------------------------- responsive */

@media (max-width: 991px) {
    .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .shell { flex-direction: column; }

    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
        position: static;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        padding-bottom: 8px;
    }

    .sidebar-section, .sidebar-foot { display: none; }
    .sidebar-nav { flex-direction: row; padding: 0 12px 8px; width: 100%; overflow-x: auto; }
    .sidebar-link { white-space: nowrap; }
    .sidebar-brand { padding: 14px 16px; }

    .topbar { padding: 0 16px; height: auto; min-height: 60px; padding-block: 12px; }
    .content { padding: 18px 16px; }
    .metrics { grid-template-columns: 1fr; }
    .panel-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
