/* ISRAR Cloud — dashboard styles
   Palette is taken from the ISRAR mark: navy, steel grey, white, with one signal green
   reserved for "data is arriving". Colour is information here, never decoration. */

:root {
    --navy-900: #0C1A38;
    --navy-800: #122448;
    --navy: #16306B;
    --navy-600: #22458F;
    --navy-500: #3560B4;
    --steel-100: #EEF1F6;
    --steel-200: #DFE4ED;
    --steel-300: #C6CEDC;
    --steel-500: #8A95AB;

    --ink: #101A2E;
    --ink-muted: #5B6880;
    --ink-faint: #8A95AB;

    --canvas: #EFF2F7;
    --surface: #FFFFFF;
    --surface-sunk: #F6F8FB;
    --line: #E1E7F0;
    --line-strong: #CFD7E5;

    --live: #0F9D63;
    --live-soft: #E6F5EE;
    --warn: #B57608;
    --warn-soft: #FCF3E2;
    --alarm: #C0392F;
    --alarm-soft: #FBEDEB;
    --info: #1D6FA5;
    --info-soft: #E8F2F9;

    --r-card: 12px;
    --r-ctl: 8px;
    --shadow-1: 0 1px 2px rgba(16, 30, 64, .07);
    --shadow-2: 0 10px 30px -18px rgba(16, 30, 64, .45), 0 1px 2px rgba(16, 30, 64, .06);
    --shadow-pop: 0 24px 60px -24px rgba(9, 20, 46, .45);

    --rail: 252px;
    --topbar: 64px;

    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", "SF Mono", "Segoe UI Mono", Consolas, "Roboto Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

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

button { font: inherit; }

:focus-visible {
    outline: 2px solid var(--navy-500);
    outline-offset: 2px;
    border-radius: 4px;
}

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- sign in */

.signin {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--surface);
}

.signin-brand {
    position: relative;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #E8EDF7;
    background:
        radial-gradient(120% 90% at 85% 10%, rgba(53, 96, 180, .55) 0%, rgba(18, 36, 72, 0) 60%),
        linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 100%);
    overflow: hidden;
}

.signin-brand::after {
    /* a faint instrument grid, the only texture in the product */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(90% 70% at 30% 40%, #000 30%, transparent 100%);
    pointer-events: none;
}

.signin-brand > * { position: relative; z-index: 1; }

.signin-plate {
    background: #fff;
    border-radius: 14px;
    padding: 14px 18px;
    display: inline-flex;
    align-items: center;
    width: max-content;
    box-shadow: var(--shadow-2);
}

.signin-plate img { height: 46px; display: block; }

.signin-brand h1 {
    font-size: 34px;
    line-height: 1.2;
    max-width: 14ch;
    color: #fff;
    font-weight: 600;
}

.signin-brand p { max-width: 46ch; color: #AFBDD6; font-size: 14.5px; }

.signin-facts { display: flex; gap: 28px; color: #93A4C4; font-size: 12.5px; }
.signin-facts b { display: block; color: #fff; font-size: 19px; font-weight: 600; }

.signin-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.signin-card { width: 100%; max-width: 360px; }
.signin-card h2 { font-size: 22px; margin-bottom: 4px; }
.signin-card > p { color: var(--ink-muted); margin: 0 0 26px; }
.signin-card .field { margin-bottom: 16px; }
.signin-card .btn { width: 100%; justify-content: center; height: 42px; }

@media (max-width: 900px) {
    .signin { grid-template-columns: 1fr; }
    .signin-brand { padding: 28px; gap: 22px; }
    .signin-brand h1 { font-size: 26px; }
    .signin-facts { display: none; }
}

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

.shell {
    display: grid;
    grid-template-columns: var(--rail) 1fr;
    min-height: 100vh;
}

.rail {
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
    color: #C3CDE2;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.rail-brand {
    padding: 18px 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.rail-plate {
    background: #fff;
    border-radius: 10px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
}

.rail-plate img { height: 30px; display: block; }

.rail-brand .t { color: #fff; font-weight: 600; font-size: 14.5px; letter-spacing: .01em; }
.rail-brand .s { color: #8FA2C4; font-size: 11.5px; }

.rail-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }

.rail-group {
    color: #7387AB;
    font-size: 11.5px;
    padding: 14px 10px 6px;
    letter-spacing: .02em;
}

.rail-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: var(--r-ctl);
    color: #C3CDE2;
    font-size: 13.5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .14s ease, color .14s ease;
}

.rail-link svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.rail-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }

.rail-link.on {
    background: rgba(53, 96, 180, .28);
    border-color: rgba(120, 160, 230, .35);
    color: #fff;
}

.rail-link.on svg { opacity: 1; }
.rail-link .count {
    margin-left: auto;
    font-size: 11.5px;
    background: rgba(255, 255, 255, .12);
    padding: 1px 7px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.rail-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }

.endpoint-card {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    padding: 11px 12px;
}

.endpoint-card .lbl { color: #8FA2C4; font-size: 11.5px; margin-bottom: 6px; }
.endpoint-card .val {
    font-family: var(--mono);
    font-size: 11.5px;
    color: #DCE5F5;
    word-break: break-all;
    line-height: 1.45;
}

.endpoint-card button {
    margin-top: 9px;
    width: 100%;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #E4EBF8;
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    cursor: pointer;
}

.endpoint-card button:hover { background: rgba(255, 255, 255, .16); }

/* ---------------------------------------------------------------- topbar */

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

.topbar {
    height: var(--topbar);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar h1 { font-size: 17px; }
.topbar .sub { color: var(--ink-muted); font-size: 12.5px; }
.topbar .spacer { flex: 1; }

.rail-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-ctl);
    padding: 7px;
    cursor: pointer;
    color: var(--ink);
}

.pulse-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 12.5px;
    color: var(--ink-muted);
    box-shadow: var(--shadow-1);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--steel-300);
    flex: none;
}

.pulse-pill.live .pulse-dot { background: var(--live); box-shadow: 0 0 0 0 rgba(15, 157, 99, .5); animation: pulse 2.4s infinite; }
.pulse-pill.live { color: var(--ink); }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(15, 157, 99, .45); }
    70% { box-shadow: 0 0 0 7px rgba(15, 157, 99, 0); }
    100% { box-shadow: 0 0 0 0 rgba(15, 157, 99, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .pulse-pill.live .pulse-dot { animation: none; }
    * { scroll-behavior: auto !important; }
}

.who {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px 5px 5px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
}

.who:hover { border-color: var(--line-strong); }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
}

.menu {
    position: absolute;
    top: 56px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-pop);
    min-width: 200px;
    padding: 6px;
    z-index: 60;
}

.menu .head { padding: 9px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .head b { display: block; }
.menu button {
    display: flex;
    gap: 9px;
    align-items: center;
    width: 100%;
    background: none;
    border: 0;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--ink);
    font-size: 13.5px;
}

.menu button:hover { background: var(--surface-sunk); }
.menu button svg { width: 15px; height: 15px; color: var(--ink-muted); }

/* ---------------------------------------------------------------- page */

.page { padding: 24px; width: 100%; }
.page > section + section { margin-top: 20px; }

.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--r-card);
    border: 1px solid var(--warn);
    background: var(--warn-soft);
    color: #6B4805;
    margin-bottom: 20px;
}

.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice b { display: block; }
.notice .btn { margin-left: auto; flex: none; }

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

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

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.card-head h3 { font-size: 14.5px; }
.card-head .sub { color: var(--ink-muted); font-size: 12.5px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    padding: 16px 18px;
    box-shadow: var(--shadow-1);
    position: relative;
    overflow: hidden;
}

.kpi .k { color: var(--ink-muted); font-size: 12.5px; }
.kpi .v { font-size: 27px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .d { color: var(--ink-faint); font-size: 12px; margin-top: 2px; }
.kpi .ico {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--surface-sunk);
    color: var(--navy-600);
}

.kpi .ico svg { width: 16px; height: 16px; }
.kpi.live-accent .ico { background: var(--live-soft); color: var(--live); }
.kpi.warn-accent .ico { background: var(--warn-soft); color: var(--warn); }

/* the ingest panel — the one place the product raises its voice */

.ingest {
    background: linear-gradient(150deg, var(--navy-800) 0%, var(--navy-900) 100%);
    border-radius: var(--r-card);
    color: #D6DEEE;
    padding: 20px 22px;
    box-shadow: var(--shadow-2);
    position: relative;
    overflow: hidden;
}

.ingest-top { display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap; }
.ingest-top .lbl { color: #8FA2C4; font-size: 12.5px; }
.ingest-top .big { color: #fff; font-size: 34px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ingest-top .side { text-align: right; margin-left: auto; }
.ingest-bars { margin-top: 18px; }
.ingest-legend { display: flex; justify-content: space-between; color: #7B8EB2; font-size: 11.5px; margin-top: 7px; }

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 13px;
    border-radius: var(--r-ctl);
    border: 1px solid var(--navy);
    background: var(--navy);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.btn:hover { background: var(--navy-600); border-color: var(--navy-600); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-sunk); border-color: var(--steel-300); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-muted); }
.btn.quiet:hover { background: var(--surface-sunk); color: var(--ink); }
.btn.danger { background: var(--alarm); border-color: var(--alarm); }
.btn.danger:hover { background: #A5312A; border-color: #A5312A; }
.btn.danger.ghost { background: var(--surface); color: var(--alarm); border-color: #E7C4C0; }
.btn.danger.ghost:hover { background: var(--alarm-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 28px; }

/* ---------------------------------------------------------------- inputs */

.field label { display: block; font-size: 12.5px; color: var(--ink-muted); margin-bottom: 5px; }

.in {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-ctl);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color .14s ease, box-shadow .14s ease;
}

textarea.in { height: auto; padding: 9px 11px; resize: vertical; min-height: 70px; }
select.in { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6880' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px; }

.in:focus { outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(53, 96, 180, .15); }
.in::placeholder { color: var(--ink-faint); }
.in.error { border-color: var(--alarm); }

.search {
    position: relative;
    display: flex;
    align-items: center;
}

.search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--ink-faint); }
.search .in { padding-left: 32px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch .track {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--steel-300);
    position: relative;
    transition: background .16s ease;
    flex: none;
}

.switch .track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow-1);
    transition: transform .16s ease;
}

.switch input:checked + .track { background: var(--live); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--navy-500); outline-offset: 2px; }

.segmented {
    display: inline-flex;
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    padding: 3px;
    gap: 2px;
}

.segmented button {
    border: 0;
    background: none;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--ink-muted);
    cursor: pointer;
}

.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 500; }

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

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

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table.tbl th {
    text-align: left;
    font-weight: 500;
    color: var(--ink-muted);
    font-size: 12.5px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-sunk);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

table.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl tbody tr.clickable:hover { background: var(--surface-sunk); }
table.tbl td.val { font-variant-numeric: tabular-nums; font-weight: 500; }
table.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.value-flash { animation: flash .9s ease; }
@keyframes flash { from { background: rgba(15, 157, 99, .18); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .value-flash { animation: none; } }

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { background: var(--live-soft); color: #0B7A4C; border-color: #BFE5D4; }
.badge.off { background: var(--surface-sunk); color: var(--ink-muted); border-color: var(--line-strong); }
.badge.warn { background: var(--warn-soft); color: #8A5A05; border-color: #EBD4A8; }
.badge.alarm { background: var(--alarm-soft); color: #9B2F26; border-color: #EFC6C1; }
.badge.info { background: var(--info-soft); color: #175C88; border-color: #C3DDEE; }
.badge.plain { background: var(--surface-sunk); color: var(--ink-muted); border-color: var(--line); font-family: var(--mono); font-size: 11.5px; }

/* ---------------------------------------------------------------- token */

.token-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    padding: 9px 10px 9px 13px;
}

.token-box code { font-family: var(--mono); font-size: 12.5px; word-break: break-all; flex: 1; color: var(--ink); }
.token-box.masked code { letter-spacing: .06em; color: var(--ink-muted); }

.steps { counter-reset: step; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li .n {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    margin-top: 1px;
}

.steps li b { display: block; }
.steps li p { margin: 2px 0 0; color: var(--ink-muted); font-size: 13px; }

/* ---------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 18px; }

.tabs button {
    border: 0;
    background: none;
    padding: 12px 12px 11px;
    font-size: 13.5px;
    color: var(--ink-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 500; }

/* ---------------------------------------------------------------- charts */

.chart { width: 100%; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--ink-faint); font-size: 10.5px; }
.chart .series-line { fill: none; stroke: var(--navy-500); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-band { fill: rgba(53, 96, 180, .10); }
.chart .hover-line { stroke: var(--steel-300); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { fill: var(--navy-500); stroke: #fff; stroke-width: 2; }

.chart-tip {
    position: absolute;
    pointer-events: none;
    background: var(--navy-900);
    color: #fff;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 12px;
    box-shadow: var(--shadow-pop);
    transform: translate(-50%, -120%);
    white-space: nowrap;
    z-index: 30;
}

.chart-tip .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip .t { color: #9FB0CE; font-size: 11px; }
.chart-host { position: relative; }

.spark { display: block; }
.spark path { fill: none; stroke: var(--navy-500); stroke-width: 1.6; }

/* ---------------------------------------------------------------- states */

.empty {
    text-align: center;
    padding: 46px 24px;
    color: var(--ink-muted);
}

.empty .ico {
    width: 46px;
    height: 46px;
    margin: 0 auto 14px;
    border-radius: 12px;
    background: var(--surface-sunk);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    color: var(--navy-500);
}

.empty .ico svg { width: 21px; height: 21px; }
.empty b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 4px; }
.empty p { margin: 0 auto 16px; max-width: 46ch; font-size: 13px; }

.state-error { border-left: 3px solid var(--alarm); }
.state-error .ico { background: var(--alarm-soft); border-color: #EFC6C1; color: var(--alarm); }

.skel { background: linear-gradient(90deg, #EDF0F5 25%, #F6F8FB 37%, #EDF0F5 63%); background-size: 400% 100%; animation: sweep 1.3s ease infinite; border-radius: 6px; }
@keyframes sweep { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.skel-row { height: 13px; margin: 14px 16px; }

/* ---------------------------------------------------------------- toasts */

.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.toast {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--navy-500);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--shadow-pop);
    min-width: 270px;
    max-width: 380px;
    animation: rise .18s ease;
}

@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.ok { border-left-color: var(--live); }
.toast.err { border-left-color: var(--alarm); }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--live); }
.toast.err svg { color: var(--alarm); }
.toast b { display: block; font-size: 13.5px; }
.toast p { margin: 1px 0 0; color: var(--ink-muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- modal */

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(12, 26, 56, .45);
    backdrop-filter: blur(2px);
    display: grid;
    place-items: center;
    z-index: 150;
    padding: 20px;
    animation: fade .14s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow-pop);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: pop .16s ease;
}

.modal.wide { max-width: 640px; }
@keyframes pop { from { transform: translateY(10px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head { padding: 18px 20px 0; }
.modal-head h3 { font-size: 16.5px; }
.modal-head p { margin: 5px 0 0; color: var(--ink-muted); font-size: 13px; }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; background: var(--surface-sunk); border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- tooltip */

[data-tip] { position: relative; }

[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy-900);
    color: #fff;
    font-size: 11.5px;
    padding: 5px 8px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 80;
    pointer-events: none;
}

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

@media (max-width: 1180px) {
    .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .rail {
        position: fixed;
        z-index: 120;
        width: var(--rail);
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-pop);
    }
    .rail.open { transform: none; }
    .rail-toggle { display: inline-flex; }
    .page { padding: 16px; }
    .grid.halves { grid-template-columns: minmax(0, 1fr); }
    .topbar { padding: 0 16px; gap: 10px; }
    .topbar .sub { display: none; }
}

@media (max-width: 620px) {
    .grid.kpis { grid-template-columns: minmax(0, 1fr); }
    .toasts { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: none; }
    .who .name { display: none; }
}
