/* ==========================================================================
   SYMON — design system

   Dark-first: this runs on a wall-mounted screen in a lit server room, where a
   white page is a lamp. Light mode is available for desk use and printing.

   Status is never communicated by colour alone. Every indicator carries a
   shape and a text label, so it survives colour-blindness, a bad projector,
   and a photograph taken to send to a supplier.
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Surfaces */
    --bg:            #0e1116;
    --bg-raised:     #161b22;
    --bg-inset:      #0b0e13;
    --bg-hover:      #1c232d;
    --border:        #262d38;
    --border-strong: #3a4553;

    /* Text */
    --fg:            #e6edf3;
    --fg-muted:      #9aa7b4;
    --fg-dim:        #6b7785;

    /* Status. Chosen for luminance separation, not just hue. */
    --up:            #2ea55f;
    --up-bg:         #10281a;
    --down:          #e5484d;
    --down-bg:       #2c1214;
    --unreachable:   #e08c1a;
    --unreachable-bg:#2c2009;
    --unknown:       #7d8996;
    --unknown-bg:    #1b2027;
    --paused:        #5b6875;
    --paused-bg:     #171c22;
    --maintenance:   #7a6ff0;
    --maintenance-bg:#1c1a33;

    --accent:        #3b82f6;
    --accent-hover:  #2f6fd8;
    --accent-bg:     #10203a;

    /* Scale */
    --radius:    6px;
    --radius-lg: 10px;
    --gap:       16px;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .25);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
    color-scheme: light;

    --bg:            #f4f6f8;
    --bg-raised:     #ffffff;
    --bg-inset:      #eef1f4;
    --bg-hover:      #e8ecf1;
    --border:        #d8dee5;
    --border-strong: #b9c2cc;

    --fg:            #16202b;
    --fg-muted:      #5a6672;
    --fg-dim:        #7d8894;

    --up:            #12793f;
    --up-bg:         #e4f3ea;
    --down:          #c4282d;
    --down-bg:       #fbe6e7;
    --unreachable:   #9a5f00;
    --unreachable-bg:#fbf0dd;
    --unknown:       #6b7785;
    --unknown-bg:    #eceff2;
    --paused:        #78838f;
    --paused-bg:     #eef1f4;
    --maintenance:   #5445c9;
    --maintenance-bg:#eceafb;

    --accent:        #1f6feb;
    --accent-hover:  #1a5fcc;
    --accent-bg:     #e6effc;

    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 10px rgba(16, 24, 40, .06);
}

/* ---------------------------------------------------------------- reset -- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

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

/* Nothing is reachable by mouse only. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

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

.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 200;
    background: var(--accent); color: #fff; padding: 8px 14px; border-radius: var(--radius);
}
.skip-link:focus { left: 8px; }

/* --------------------------------------------------------------- layout -- */

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

.sidebar {
    width: 216px;
    flex: 0 0 216px;
    background: var(--bg-raised);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.brand-mark {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(140deg, var(--accent), #7a6ff0);
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .5px;
    flex: 0 0 auto;
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: .2px; }
.brand-org  { font-size: 11px; color: var(--fg-dim); }

.nav { padding: 10px 8px; flex: 1; }
.nav-section {
    padding: 14px 10px 6px;
    font-size: 10px; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--fg-dim);
}
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; margin-bottom: 1px;
    border-radius: var(--radius);
    color: var(--fg-muted); font-size: 13.5px; font-weight: 500;
}
.nav-link:hover { background: var(--bg-hover); color: var(--fg); text-decoration: none; }
.nav-link.is-active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.nav-link .icon { flex: 0 0 16px; opacity: .85; }
.nav-badge {
    margin-left: auto;
    background: var(--down); color: #fff;
    font-size: 10.5px; font-weight: 700;
    padding: 1px 6px; border-radius: 9px;
}

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }

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

.topbar {
    display: flex; align-items: center; gap: var(--gap);
    padding: 12px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-raised);
    position: sticky; top: 0; z-index: 20;
}
.topbar h1 { flex: 0 1 auto; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 20px 22px 40px; flex: 1; }
.content > * + * { margin-top: var(--gap); }

/* ------------------------------------------------------------ engine bar --
   The most important strip on the page: an all-green board served by a dead
   poller is indistinguishable from a healthy network without it.            */

.engine {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 14px; border-radius: var(--radius);
    font-size: 12.5px; border: 1px solid transparent;
}
.engine-ok      { background: var(--up-bg);          color: var(--up);          border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.engine-stalled { background: var(--down-bg);        color: var(--down);        border-color: color-mix(in srgb, var(--down) 45%, transparent); }
.engine-never   { background: var(--unreachable-bg); color: var(--unreachable); border-color: color-mix(in srgb, var(--unreachable) 40%, transparent); }
.engine strong { font-weight: 650; }
.engine .pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: currentColor; flex: 0 0 auto;
}
.engine-ok .pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------------------------------------------------------------- cards -- */

.card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.card-head h2 { flex: 0 1 auto; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.card-foot {
    padding: 10px 16px; border-top: 1px solid var(--border);
    background: var(--bg-inset); font-size: 12.5px; color: var(--fg-muted);
}

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ------------------------------------------------------------------ KPI -- */

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }

.kpi {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    display: block; color: inherit;
}
a.kpi:hover { background: var(--bg-hover); text-decoration: none; }
.kpi-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--fg-dim);
    display: flex; align-items: center; gap: 6px;
}
.kpi-value {
    font-size: 27px; font-weight: 660; line-height: 1.15;
    margin-top: 4px; font-variant-numeric: tabular-nums;
}
.kpi-note { font-size: 11.5px; color: var(--fg-muted); margin-top: 1px; }

.kpi-up          { border-left-color: var(--up); }
.kpi-up .kpi-value { color: var(--up); }
.kpi-down        { border-left-color: var(--down); }
.kpi-down .kpi-value { color: var(--down); }
.kpi-unreachable { border-left-color: var(--unreachable); }
.kpi-unreachable .kpi-value { color: var(--unreachable); }
.kpi-unknown     { border-left-color: var(--unknown); }
.kpi-accent      { border-left-color: var(--accent); }
.kpi-accent .kpi-value { color: var(--accent); }

/* --------------------------------------------------------------- status -- */

.status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 9px 2px 7px; border-radius: 20px;
    font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
    white-space: nowrap; border: 1px solid transparent;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

/* The glyph is what makes these readable without colour. */
.status .dot::after { content: ""; }

.status-up          { color: var(--up);          background: var(--up-bg);          border-color: color-mix(in srgb, var(--up) 32%, transparent); }
.status-down        { color: var(--down);        background: var(--down-bg);        border-color: color-mix(in srgb, var(--down) 45%, transparent); }
.status-unreachable { color: var(--unreachable); background: var(--unreachable-bg); border-color: color-mix(in srgb, var(--unreachable) 40%, transparent); }
.status-unknown     { color: var(--unknown);     background: var(--unknown-bg);     border-color: var(--border); }
.status-paused      { color: var(--paused);      background: var(--paused-bg);      border-color: var(--border); }
.status-maintenance { color: var(--maintenance); background: var(--maintenance-bg); border-color: color-mix(in srgb, var(--maintenance) 40%, transparent); }

.status-down .dot { animation: blink 1.6s step-end infinite; }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
    .status-down .dot, .engine-ok .pulse { animation: none; }
}

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

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

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; vertical-align: middle; }
table.data thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border);
    font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--fg-dim); white-space: nowrap;
}
table.data thead th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.data tbody tr { border-bottom: 1px solid var(--border); }
table.data tbody tr:last-child { border-bottom: 0; }
table.data tbody tr:hover { background: var(--bg-hover); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
table.data td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }
table.data .row-down { box-shadow: inset 3px 0 0 var(--down); }
table.data .row-unreachable { box-shadow: inset 3px 0 0 var(--unreachable); }
table.data tr.group-head td {
    background: var(--bg-inset); font-weight: 650; font-size: 12px;
    letter-spacing: .03em; color: var(--fg-muted);
}
table.data.compact th, table.data.compact td { padding: 5px 10px; font-size: 12.5px; }

.empty {
    padding: 40px 20px; text-align: center; color: var(--fg-muted);
}
.empty-title { font-weight: 600; color: var(--fg); margin-bottom: 4px; }

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

.field { margin-bottom: 14px; }
.field label, .label {
    display: block; margin-bottom: 5px;
    font-size: 12.5px; font-weight: 600; color: var(--fg-muted);
}
.field .hint { font-size: 11.5px; color: var(--fg-dim); margin-top: 4px; }
.field .error { font-size: 12px; color: var(--down); margin-top: 4px; font-weight: 500; }

input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="search"], input[type="datetime-local"], input[type="date"], input[type="time"],
select, textarea {
    width: 100%;
    padding: 7px 10px;
    background: var(--bg-inset);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--fg);
    font-family: inherit; font-size: 13.5px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--down); }
textarea { resize: vertical; min-height: 72px; }
select[multiple] { min-height: 108px; padding: 4px; }

.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.check input { margin: 2px 0 0; width: 15px; height: 15px; flex: 0 0 auto; accent-color: var(--accent); }
.check label { margin: 0; font-weight: 500; color: var(--fg); font-size: 13px; }
.check .hint { margin-top: 2px; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset legend {
    padding: 0 0 10px; margin-bottom: 14px; width: 100%;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--fg-muted);
}

.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }

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

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-raised); color: var(--fg);
    font-family: inherit; font-size: 13px; font-weight: 550;
    cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, transparent); }
.btn-danger:hover { background: var(--down-bg); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-icon { padding: 6px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row.end { justify-content: flex-end; }

/* --------------------------------------------------------------- misc ---- */

.tag {
    display: inline-block; padding: 1px 7px; border-radius: 4px;
    background: var(--bg-inset); border: 1px solid var(--border);
    font-size: 11px; color: var(--fg-muted); font-weight: 500;
}
.tag-lan { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-bg); }
.tag-wan { color: var(--maintenance); border-color: color-mix(in srgb, var(--maintenance) 35%, transparent); background: var(--maintenance-bg); }

.muted { color: var(--fg-muted); }
.dim   { color: var(--fg-dim); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.tabular { font-variant-numeric: tabular-nums; }

.alert {
    padding: 11px 14px; border-radius: var(--radius);
    border: 1px solid transparent; font-size: 13px;
    display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: var(--up-bg);          color: var(--up);          border-color: color-mix(in srgb, var(--up) 32%, transparent); }
.alert-error   { background: var(--down-bg);        color: var(--down);        border-color: color-mix(in srgb, var(--down) 42%, transparent); }
.alert-warning { background: var(--unreachable-bg); color: var(--unreachable); border-color: color-mix(in srgb, var(--unreachable) 38%, transparent); }
.alert-info    { background: var(--accent-bg);      color: var(--accent);      border-color: color-mix(in srgb, var(--accent) 32%, transparent); }

.filters {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
}
.filters .field { margin: 0; min-width: 140px; flex: 0 1 auto; }
.filters .grow { flex: 1 1 220px; }

.pager {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-top: 1px solid var(--border);
    font-size: 12.5px; color: var(--fg-muted);
}
.pager .spacer { margin-left: auto; }
.pager a, .pager span.current {
    padding: 3px 9px; border-radius: var(--radius);
    border: 1px solid var(--border); color: var(--fg-muted);
}
.pager span.current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager a:hover { background: var(--bg-hover); text-decoration: none; }

.chart-box { position: relative; height: 240px; }
.chart-box.short { height: 160px; }

/* ---------------------------------------------------------- topology map --
   Live device-dependency tree. Kept visually quiet on purpose: this sits
   alongside a lot of other dashboard content, so the connectors are a single
   recessive hairline colour and the only saturated ink is the status dots --
   exactly the "data is the only thing allowed to be loud" rule.            */

.topo-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
}
.topo-scroll svg { display: block; }

.topo-node-rect { transition: stroke .12s; }
a[data-node-id] { cursor: pointer; }
a[data-node-id]:hover .topo-node-rect,
a[data-node-id]:focus .topo-node-rect {
    stroke: var(--accent);
    outline: none;
}
a[data-node-id]:focus-visible .topo-node-rect { stroke-width: 2; }

/* Mirrors .status-down .dot's blink, so an offline node reads as urgent in
   the diagram the same way it does everywhere else in the app. */
.topo-dot-down { animation: topo-blink 1.6s step-end infinite; }
@keyframes topo-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .topo-dot-down { animation: none; } }

.topo-tooltip {
    position: absolute;
    z-index: 6;
    min-width: 150px;
    max-width: 220px;
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px 10px;
    font-size: 12px;
    pointer-events: none;
}
.topo-tooltip-name { font-weight: 650; font-size: 12.5px; margin-bottom: 2px; }
.topo-tooltip-status { font-weight: 600; font-size: 11.5px; margin-bottom: 3px; }
.topo-tooltip-meta { color: var(--fg-muted); font-size: 11px; line-height: 1.5; }

.topo-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--fg-muted); }
.topo-legend span { display: inline-flex; align-items: center; gap: 5px; }
.topo-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }

/* Availability timeline: one bar per day, worst-case colour. */
.timeline { display: flex; gap: 2px; align-items: flex-end; height: 44px; }
.timeline .bar {
    flex: 1 1 0; min-width: 3px; border-radius: 2px;
    background: var(--up); height: 100%;
}
.timeline .bar.partial     { background: linear-gradient(to top, var(--down) var(--loss), var(--up) var(--loss)); }
.timeline .bar.unreachable { background: linear-gradient(to top, var(--unreachable) var(--loss), var(--up) var(--loss)); }
.timeline .bar.none        { background: var(--bg-inset); border: 1px dashed var(--border); }

.meter { height: 6px; border-radius: 3px; background: var(--bg-inset); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }
.meter .m-up { background: var(--up); }
.meter .m-down { background: var(--down); }
.meter .m-unreachable { background: var(--unreachable); }
.meter .m-other { background: var(--unknown); }

.definition { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13px; }
.definition dt { color: var(--fg-muted); }
.definition dd { margin: 0; font-weight: 500; }

.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.stat { background: var(--bg-inset); border-radius: var(--radius); padding: 10px 12px; }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-dim); font-weight: 700; }
.stat-value { font-size: 19px; font-weight: 620; font-variant-numeric: tabular-nums; margin-top: 2px; }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); }
details.disclosure > summary {
    padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px;
    list-style: none; display: flex; align-items: center; gap: 8px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "▸"; color: var(--fg-dim); }
details.disclosure[open] > summary::before { content: "▾"; }
details.disclosure > div { padding: 0 14px 14px; border-top: 1px solid var(--border); padding-top: 14px; }

.icon { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; fill: none;
        stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 20px; height: 20px; vertical-align: -4px; }

/* --------------------------------------------------------------- login --- */

.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 372px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 46px; height: 46px; font-size: 18px; margin: 0 auto 12px; border-radius: 11px; }
.auth-brand h1 { font-size: 21px; }
.auth-brand p { color: var(--fg-muted); font-size: 13px; margin-top: 4px; }

/* ------------------------------------------------------------- wallboard --
   Built to be read from the far side of a server room.                     */

body.kiosk { background: #05070a; overflow: hidden; }

.wall { padding: 20px 24px; height: 100vh; display: flex; flex-direction: column; gap: 16px; }
.wall-head { display: flex; align-items: center; gap: 20px; }
.wall-head h1 { font-size: 25px; letter-spacing: .3px; }
.wall-clock { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 25px; font-weight: 600; }
.wall-date { font-size: 12.5px; color: var(--fg-dim); text-align: right; }

.wall-kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.wall-kpi {
    background: var(--bg-raised); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 14px 18px; border-left-width: 5px; border-left-style: solid;
}
.wall-kpi .kpi-value { font-size: 44px; }
.wall-kpi .kpi-label { font-size: 12px; }

.wall-body { flex: 1; display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); min-height: 0; }
.wall-body.solo { grid-template-columns: minmax(0, 1fr); }
.wall-panel { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-lg);
              display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.wall-panel > h2 { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13px;
                   text-transform: uppercase; letter-spacing: .07em; color: var(--fg-muted); }
.wall-list { overflow-y: auto; flex: 1; }

.wall-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.wall-item:last-child { border-bottom: 0; }
.wall-item.is-down        { background: color-mix(in srgb, var(--down) 9%, transparent);        box-shadow: inset 5px 0 0 var(--down); }
.wall-item.is-unreachable { background: color-mix(in srgb, var(--unreachable) 9%, transparent); box-shadow: inset 5px 0 0 var(--unreachable); }
.wall-item .name { font-size: 18px; font-weight: 620; }
.wall-item .meta { font-size: 12.5px; color: var(--fg-muted); margin-top: 1px; }
.wall-item .since { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.wall-item .since strong { font-size: 18px; display: block; }
.wall-item .since span { font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .06em; }

.wall-allclear { display: grid; place-content: center; text-align: center; flex: 1; gap: 8px; padding: 40px; }
.wall-allclear .big { font-size: 52px; font-weight: 680; color: var(--up); }
.wall-allclear p { color: var(--fg-muted); font-size: 15px; }

.wall-foot { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--fg-dim); }
.wall-foot .spacer { margin-left: auto; }

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

@media (max-width: 1100px) {
    .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .wall-body { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .shell { flex-direction: column; }
    .sidebar {
        position: static; width: auto; flex: none; height: auto;
        border-right: 0; border-bottom: 1px solid var(--border);
    }
    .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
    .nav-section { display: none; }
    .nav-link { padding: 6px 10px; }
    .sidebar-foot { display: flex; gap: 8px; align-items: center; }
    .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
    .content, .topbar { padding-left: 14px; padding-right: 14px; }
    .topbar { flex-wrap: wrap; }
}

@media print {
    .sidebar, .topbar-actions, .filters, .pager, .btn { display: none !important; }
    body { background: #fff; color: #000; }
    .card { border-color: #ccc; break-inside: avoid; }
}
