/* ==========================================================================
   Mythos OLT - Operator NOC design system
   Source of truth: DESIGN.md
   Loaded after Tailwind and before page-specific styles.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
    color-scheme: dark;

    /* NOC Carbon: kanvas hangat, panel grafit, teks bone. */
    --bg: #090807;
    --bg-soft: #0d0b09;
    --surface: #171412;
    --surface2: #1f1b17;
    --surface3: #2a251f;

    --border: #38322b;
    --border-strong: #574f45;

    --text: #f3ede2;
    --muted: #b0a99e;
    --faint: #8b8479;

    --accent: #5fdc98;
    --accent-strong: #82edb3;
    --amber: #f5bd4f;
    --red: #ff7671;
    --orange: #ffa268;
    --blue: #8fb8ff;

    --ok-soft: rgba(95, 220, 152, .10);
    --warn-soft: rgba(245, 189, 79, .12);
    --bad-soft: rgba(255, 118, 113, .11);
    --info-soft: rgba(143, 184, 255, .11);
    --neutral-soft: rgba(176, 169, 158, .09);
    --row-alt: rgba(255, 255, 255, .022);
    --chart-fill: rgba(95, 220, 152, .16);

    --focus: var(--amber);
    --on-bad: #1f0706;
    --on-blue: #06111f;

    --r-xs: 3px;
    --r-sm: 5px;
    --r-md: 8px;
    --r-lg: 10px;

    --shadow-menu: 0 18px 38px -22px rgba(0, 0, 0, .85);
    --shadow-dialog: 0 28px 60px -28px rgba(0, 0, 0, .9);

    --font-display: Bahnschrift, "DIN Alternate", "Roboto Condensed", "Segoe UI", system-ui, sans-serif;
    --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, ui-monospace, monospace;

    --tap: 36px;
    --ease: cubic-bezier(.2, .7, .3, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-in: cubic-bezier(.4, 0, 1, 1);
    --dur-press: 80ms;
    --dur-ui: 120ms;
    --dur-panel: 160ms;
    --dur-drawer-in: 180ms;
    --dur-drawer-out: 160ms;
    --dur-boot: 420ms;
    --dur-data: 460ms;
}

[data-theme="light"] {
    color-scheme: light;

    /* Kertas kerja hangat, tinta netral, garis lebih tegas. */
    --bg: #f2efe7;
    --bg-soft: #ece8de;
    --surface: #fffdf7;
    --surface2: #f7f3ea;
    --surface3: #eae5da;

    --border: #d9d3c6;
    --border-strong: #b8b0a0;

    --text: #171613;
    --muted: #5c5a54;
    --faint: #6a675f;

    --accent: #0b7a4b;
    --accent-strong: #08603a;
    --amber: #855500;
    --red: #b3261e;
    --orange: #a8460c;
    --blue: #1f5aa8;

    --ok-soft: rgba(11, 122, 75, .08);
    --warn-soft: rgba(133, 85, 0, .09);
    --bad-soft: rgba(179, 38, 30, .08);
    --info-soft: rgba(31, 90, 168, .08);
    --neutral-soft: rgba(92, 90, 84, .07);
    --row-alt: rgba(23, 22, 19, .022);
    --chart-fill: rgba(11, 122, 75, .14);

    --focus: #855500;
    --on-bad: #ffffff;
    --on-blue: #ffffff;

    --shadow-menu: 0 18px 38px -24px rgba(22, 24, 29, .35);
    --shadow-dialog: 0 30px 60px -30px rgba(22, 24, 29, .4);
}

[data-theme="aurora"] {
    color-scheme: dark;

    /* Aurora: malam biru-hitam, kaca gelap, aksen mint. */
    --bg: #04060b;
    --bg-soft: #070b13;
    --surface: #0d131f;
    --surface2: #141c2b;
    --surface3: #1e293c;

    --border: rgba(126, 151, 199, .24);
    --border-strong: rgba(154, 183, 236, .40);

    --text: #eef4ff;
    --muted: #b8c4da;
    --faint: #8e9ab2;

    --accent: #5cf2c4;
    --accent-strong: #8bffdc;
    --amber: #ffc861;
    --red: #ff7d8a;
    --orange: #ffab70;
    --blue: #8bb8ff;

    --ok-soft: rgba(92, 242, 196, .12);
    --warn-soft: rgba(255, 200, 97, .14);
    --bad-soft: rgba(255, 125, 138, .13);
    --info-soft: rgba(139, 184, 255, .13);
    --neutral-soft: rgba(184, 196, 218, .10);
    --row-alt: rgba(255, 255, 255, .025);
    --chart-fill: rgba(92, 242, 196, .16);

    --focus: var(--amber);
    --on-bad: #1f0709;
    --on-blue: #06111f;

    --shadow-menu: 0 18px 38px -22px rgba(0, 0, 0, .92);
    --shadow-dialog: 0 28px 60px -28px rgba(0, 0, 0, .96);
}

[data-theme="senja"] {
    color-scheme: dark;

    /* Anime: malam plum, langit oranye, kaca hangat. */
    --bg: #150b1d;
    --bg-soft: #1b0f26;
    --surface: #1c1126;
    --surface2: #251630;
    --surface3: #33203f;

    --border: rgba(255, 177, 140, .22);
    --border-strong: rgba(255, 201, 166, .40);

    --text: #fff2e6;
    --muted: #e3c4b8;
    --faint: #bfa094;

    --accent: #7ef0b0;
    --accent-strong: #a6ffcd;
    --amber: #ffc266;
    --red: #ff8291;
    --orange: #ffa66b;
    --blue: #9fc4ff;

    --ok-soft: rgba(126, 240, 176, .12);
    --warn-soft: rgba(255, 194, 102, .14);
    --bad-soft: rgba(255, 130, 145, .13);
    --info-soft: rgba(159, 196, 255, .13);
    --neutral-soft: rgba(227, 196, 184, .10);
    --row-alt: rgba(255, 255, 255, .025);
    --chart-fill: rgba(255, 166, 107, .18);

    --focus: var(--amber);
    --on-bad: #24070c;
    --on-blue: #07111f;

    --shadow-menu: 0 18px 38px -22px rgba(0, 0, 0, .92);
    --shadow-dialog: 0 28px 60px -28px rgba(0, 0, 0, .96);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }
[hidden] { display: none !important; }

html {
    min-height: 100%;
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: .875rem;
    line-height: 1.5;
    letter-spacing: normal;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Fallback tema untuk browser tanpa View Transition API. */
html.theme-switching body,
html.theme-switching .topbar,
html.theme-switching .panel,
html.theme-switching .card,
html.theme-switching .readout-rail,
html.theme-switching .status-strip,
html.theme-switching .tool-tabs,
html.theme-switching .tool-tab,
html.theme-switching .menu-panel,
html.theme-switching .toast,
html.theme-switching .btn,
html.theme-switching .field-input,
html.theme-switching .table-wrap thead th,
html.theme-switching .modal-backdrop {
    transition:
        background-color .18s var(--ease),
        color .18s var(--ease);
}

h1, h2, h3, h4, h5, h6,
button, input, select, textarea {
    font-family: inherit;
}

button, select, summary { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; }
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) { cursor: pointer; }
label:has(> input:disabled) { cursor: not-allowed; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

hr { border: 0; border-top: 1px solid var(--border); }

::selection { background: var(--warn-soft); color: var(--text); }

.font-mono,
pre,
code,
kbd,
samp {
    font-family: var(--font-mono) !important;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

:focus { outline: none; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--focus) !important;
    outline-offset: 1px;
}

/* Tap targets on touch devices. */
@media (pointer: coarse), (max-width: 900px) {
    :root { --tap: 44px; }
    .btn,
    .topbar-btn,
    .topbar-link,
    .menu-item,
    .tool-tab,
    .chip,
    .seg-btn,
    .tab-btn,
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea { min-height: var(--tap); }
}

/* --------------------------------------------------------------- scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 2px solid var(--bg);
    border-radius: 6px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ---------------------------------------------------------------- topbar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    text-decoration: none;
    color: var(--text);
}
.topbar-brand:hover { color: var(--text); }

@media (min-width: 1280px) {
    .topbar-brand {
        padding-right: .9rem;
        border-right: 1px solid var(--border);
    }
}

.topbar-logo {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: var(--surface2);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
}
.topbar-logo svg { width: 1.05rem; height: 1.05rem; }

.topbar-title {
    font-family: var(--font-display);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: .01em;
    color: var(--text);
}

.topbar-sub {
    font-family: var(--font-mono);
    font-size: .5625rem;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.topbar-nav { gap: .125rem; }

.topbar-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 2rem;
    padding: .35rem .55rem;
    border-radius: var(--r-sm);
    font-size: .75rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color .12s var(--ease), background-color .12s var(--ease);
}
.topbar-link:hover {
    color: var(--text);
    background: var(--surface2);
}
.topbar-link.active {
    color: var(--text);
    background: transparent;
    box-shadow: inset 0 -2px 0 var(--amber);
}

.topbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: .3rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface2);
    color: var(--text);
    font-size: .75rem;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .12s var(--ease);
}
.topbar-btn:hover {
    background: var(--surface3);
    border-color: var(--border-strong);
}
.topbar-btn.is-active {
    color: var(--text);
    background: var(--surface3);
    border-color: var(--amber);
}

.topbar-updated {
    display: none;
    color: var(--muted);
    font-size: .6875rem;
}
@media (min-width: 1536px) {
    .topbar-updated { display: inline; }
}

.topbar-live {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .45rem;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    background: var(--surface2);
    font-family: var(--font-mono);
    font-size: .6875rem;
    color: var(--text);
}
@media (max-width: 639px) { .topbar-live { display: none; } }

.topbar-muted { color: var(--muted); }

/* ---------------------------------------------------------------- menus */
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .4rem);
    z-index: 70;
    min-width: 12rem;
    padding: .25rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-menu);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    min-height: 2rem;
    padding: .4rem .5rem;
    border-radius: var(--r-sm);
    font-size: .75rem;
    line-height: 1.3;
    color: var(--text);
    text-align: left;
    transition: background-color .12s var(--ease), color .12s var(--ease);
}
.menu-item:hover { background: var(--surface2); color: var(--text); }
.menu-item svg { flex: 0 0 auto; opacity: .7; }
.menu-item:hover svg { opacity: 1; }
.menu-sep { height: 1px; margin: .25rem; background: var(--border); }
.topbar .menu-panel { color: var(--text); }
.topbar .menu-item { color: var(--text); }

/* ------------------------------------------------------------- page heads */
.page-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .25rem 0 1rem;
    border-bottom: 1px solid var(--border);
}
.page-head::after { content: none; }

.page-head-main {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}

.page-head-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: var(--surface2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
}
.page-head-icon svg { width: 1.25rem; height: 1.25rem; }

.page-eyebrow {
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.page-title {
    margin: .1rem 0 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: var(--text);
}
.page-sub {
    max-width: 46rem;
    margin: .2rem 0 0;
    font-size: .75rem;
    line-height: 1.45;
    color: var(--muted);
}
.page-head-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .25rem 0 .65rem;
    border-bottom: 1px solid var(--border);
}
.section-head h2 { font-family: var(--font-display); font-weight: 600; }
.section-icon {
    width: 1.9rem;
    height: 1.9rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.section-icon svg { width: .95rem; height: .95rem; }

/* ---------------------------------------------------------- readout rail */
.readout-rail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top-color: var(--border-strong);
    border-radius: var(--r-md);
}

.readout-cell {
    position: relative;
    min-width: 0;
    padding: .9rem 1rem .95rem;
    border-left: 1px solid var(--border);
}
.readout-cell:first-child { border-left: 0; }

.readout-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}

.readout-mark {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    background: var(--faint);
}

.readout-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .6rem;
    margin-top: .3rem;
}

.readout-value {
    font-family: var(--font-mono);
    font-size: clamp(1.6rem, 2.5vw, 2.05rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -.03em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.readout-spark {
    width: 88px;
    height: 26px;
    flex: 0 0 auto;
    overflow: visible;
    color: var(--faint);
    opacity: .62;
    pointer-events: none;
}
.readout-spark polyline {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.readout-sub {
    margin-top: .25rem;
    font-size: .6875rem;
    line-height: 1.35;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.is-green .readout-mark { background: var(--accent); }
.is-green .readout-spark { color: var(--accent); }
.is-green .readout-value { color: var(--accent); }
.is-amber .readout-mark { background: var(--amber); }
.is-amber .readout-spark { color: var(--amber); }
.is-amber .readout-value { color: var(--amber); }
.is-orange .readout-mark { background: var(--orange); }
.is-orange .readout-spark { color: var(--orange); }
.is-orange .readout-value { color: var(--orange); }
.is-red .readout-mark { background: var(--red); }
.is-red .readout-spark { color: var(--red); }
.is-red .readout-value { color: var(--red); }
.is-blue .readout-mark { background: var(--blue); }
.is-blue .readout-spark { color: var(--blue); }
.is-blue .readout-value { color: var(--blue); }
.is-slate .readout-mark { background: var(--faint); }
.is-slate .readout-spark { color: var(--faint); }
.is-slate .readout-value { color: var(--muted); }
.is-neutral .readout-mark { background: var(--faint); }
.is-neutral .readout-spark { color: var(--faint); }

/* ----------------------------------------------------------- legacy KPI */
.kpi-tile {
    padding: .8rem .95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.kpi-icon {
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.kpi-value {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.kpi-label { margin-top: .45rem; font-size: .75rem; font-weight: 600; }
.kpi-sub { margin-top: .1rem; font-size: .6875rem; color: var(--muted); }

/* ---------------------------------------------------------- status strip */
.status-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem 1.25rem;
    padding: .45rem .85rem;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.status-strip .strip-item {
    display: inline-flex;
    align-items: baseline;
    gap: .4rem;
    font-family: var(--font-mono);
    font-size: .625rem;
    line-height: 1.4;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.status-strip strong {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.status-strip .strip-item.ml-auto { margin-left: auto; }

/* -------------------------------------------------------------- surfaces */
.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: none;
}

.card-hover:hover { border-color: var(--border-strong); }

.panel { position: relative; border-top-color: var(--border-strong); }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .85rem;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
}
.panel-title {
    font-family: var(--font-display);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .01em;
    color: var(--text);
}
.panel-sub {
    font-size: .6875rem;
    line-height: 1.35;
    color: var(--muted);
}
.panel-title + .panel-sub {
    padding-left: .55rem;
    border-left: 1px solid var(--border-strong);
}
.panel-body { position: relative; padding: .85rem; }
.panel-body-tight { padding: .65rem .8rem; }
.panel-foot {
    display: block;
    width: 100%;
    padding: .5rem .85rem;
    border-top: 1px solid var(--border);
    background: var(--surface2);
    font-family: var(--font-mono);
    font-size: .6875rem;
    color: var(--muted);
    text-align: center;
    border-radius: 0 0 calc(var(--r-md) - 1px) calc(var(--r-md) - 1px);
    transition: color .12s var(--ease), background-color .12s var(--ease);
}
.panel-foot:hover { color: var(--text); background: var(--surface3); }

.danger-zone { border-color: var(--red); }
.danger-zone .panel-head { background: var(--bad-soft); }
.danger-zone .panel-title { color: var(--red); }

/* ------------------------------------------------------- admin stat tile */
.stat-tile {
    padding: .75rem .85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.stat-tile .stat-icon {
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-bottom: .4rem;
    color: var(--tone, var(--muted));
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.stat-tile .stat-label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
}
.stat-tile .stat-label::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    background: var(--tone, var(--faint));
}
.stat-tile .stat-value {
    margin-top: .2rem;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    color: var(--tone, var(--text));
    background: var(--surface2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
    font-size: .5625rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

/* ------------------------------------------------------- tags and chips */
.pill,
.badge-working,
.badge-offline,
.badge-los,
.badge-syncmib,
.badge-dying,
.role-admin,
.role-viewer {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .14rem .4rem;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    background: var(--surface2);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.pill-green,
.badge-working { color: var(--accent-strong); background: var(--ok-soft); border-color: var(--accent); }
.pill-red,
.badge-los { color: var(--red); background: var(--bad-soft); border-color: var(--red); }
.pill-amber,
.badge-syncmib { color: var(--amber); background: var(--warn-soft); border-color: var(--amber); }
.pill-orange,
.badge-dying { color: var(--orange); background: var(--warn-soft); border-color: var(--orange); }
.pill-blue { color: var(--blue); background: var(--info-soft); border-color: var(--blue); }
.pill-slate,
.badge-offline { color: var(--muted); background: var(--neutral-soft); border-color: var(--border-strong); }
.role-admin { color: var(--amber); background: var(--warn-soft); border-color: var(--amber); }
.role-viewer { color: var(--blue); background: var(--info-soft); border-color: var(--blue); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .5rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface2);
    color: var(--muted);
    font-size: .6875rem;
    line-height: 1.35;
    transition: color .12s var(--ease), background-color .12s var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface3); border-color: var(--border-strong); }
.chip-active {
    color: var(--text);
    background: var(--surface3);
    border-color: var(--amber);
}

.dot {
    position: relative;
    display: inline-block;
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--faint);
}
.dot-green { background: var(--accent); }
.topbar-live .dot-green::after {
    content: "";
    position: absolute;
    inset: -3px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    animation: livePing .85s ease-out 1;
    pointer-events: none;
}
@keyframes livePing {
    0% { opacity: .65; transform: scale(.55); }
    100% { opacity: 0; transform: scale(1.9); }
}
.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-amber { background: var(--amber); }
.dot-blue { background: var(--blue); }
.dot-slate { background: var(--faint); }

.legend {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .625rem;
    color: var(--muted);
    white-space: nowrap;
}

/* --------------------------------------------------------------- buttons */
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2rem;
    padding: .15rem .35rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
}
.filter-toggle:hover { background: var(--surface2); border-color: var(--border); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 2rem;
    padding: .35rem .65rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--surface2);
    color: var(--text);
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: background-color .12s var(--ease), color .12s var(--ease);
}
.btn:hover { background: var(--surface3); border-color: var(--muted); }
.btn:active { background: var(--surface3); }
.btn:disabled { opacity: .45; }

.btn-primary {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}
.btn-primary:hover {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
    opacity: .88;
}

.btn-danger {
    background: var(--bad-soft);
    border-color: var(--red);
    color: var(--red);
}
.btn-danger:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--on-bad);
}

.btn-blue {
    background: var(--info-soft);
    border-color: var(--blue);
    color: var(--blue);
}
.btn-blue:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: var(--on-blue);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border); }

.btn-xs {
    min-height: 1.5rem;
    padding: .15rem .4rem;
    font-size: .6875rem;
    border-radius: var(--r-xs);
}

.alert-action {
    flex: 0 0 auto;
    padding: .3rem .55rem;
    border: 1px solid var(--red);
    border-radius: var(--r-sm);
    background: var(--red);
    color: var(--on-bad);
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}
.alert-action:hover { opacity: .9; }

/* ----------------------------------------------------------------- forms */
.field-input,
.tool-input,
.admin-input {
    width: 100%;
    min-height: 2.25rem;
    padding: .4rem .6rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface2);
    color: var(--text);
    font-family: var(--font-body);
    font-size: .8125rem;
    line-height: 1.35;
    transition: background-color .12s var(--ease);
}
.field-input:hover,
.tool-input:hover,
.admin-input:hover { border-color: var(--border-strong); }
.field-input:focus,
.tool-input:focus,
.admin-input:focus {
    border-color: var(--focus);
    background: var(--surface);
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}
.field-input::placeholder,
.tool-input::placeholder,
.admin-input::placeholder { color: var(--muted); opacity: .8; }
.field-input:disabled,
.tool-input:disabled,
.admin-input:disabled { opacity: .55; }

select.field-input,
select.tool-input,
select.admin-input {
    appearance: none;
    padding-right: 1.8rem;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 14px) calc(50% - 2px),
        calc(100% - 9px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
select option { background: var(--surface); color: var(--text); }

.tool-label {
    display: block;
    margin-bottom: .2rem;
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
}
.tool-help {
    font-size: .6875rem;
    line-height: 1.4;
    color: var(--muted);
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.5rem;
    height: 1.5rem;
    accent-color: var(--accent);
    cursor: pointer;
}

.text-muted { color: var(--muted) !important; }
.text-blue { color: var(--blue) !important; }
.text-amber { color: var(--amber) !important; }
.select-sm {
    width: auto;
    min-height: 2rem;
    padding: .2rem 1.7rem .2rem .45rem;
    font-size: .6875rem;
}

/* ---------------------------------------------------------------- tables */
.table-wrap,
.table-wrap table,
.admin-table,
.pon-table,
.mini-table,
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th,
.table-wrap thead th,
.admin-table thead th,
.pon-table thead th,
.mini-table thead th {
    padding: .45rem .6rem;
    background: var(--surface2);
    border-bottom: 1px solid var(--border-strong);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .625rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}

.data-table tbody td,
.table-wrap tbody td,
.admin-table tbody td,
.pon-table tbody td,
.mini-table tbody td {
    padding: .45rem .6rem;
    border-top: 1px solid var(--border);
    font-size: .75rem;
    line-height: 1.4;
    vertical-align: middle;
}
.data-table tbody tr:first-child td,
.table-wrap tbody tr:first-child td,
.admin-table tbody tr:first-child td,
.pon-table tbody tr:first-child td,
.mini-table tbody tr:first-child td { border-top: 0; }

.data-table tbody tr,
.table-wrap tbody tr,
.admin-table tbody tr,
.pon-table tbody tr,
.mini-table tbody tr { transition: background-color .12s var(--ease); }

.data-table tbody tr:nth-child(even),
.table-wrap tbody tr:nth-child(even),
.admin-table tbody tr:nth-child(even),
.pon-table tbody tr:nth-child(even),
.mini-table tbody tr:nth-child(even) { background: var(--row-alt); }

.table-wrap tbody tr.is-new-row { opacity: 0; }
.table-wrap tbody tr.row-enter { animation: rowFade 160ms var(--ease-out) both; }
@keyframes rowFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.data-table tbody tr:hover,
.table-wrap tbody tr:hover,
.admin-table tbody tr:hover,
.pon-table tbody tr:hover,
.mini-table tbody tr:hover { background: var(--surface2); }

.data-table .num,
.pon-table .num,
.mini-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.table-compact td,
.table-compact th { padding-top: .25rem !important; padding-bottom: .25rem !important; }

.sortable { transition: color .12s var(--ease); }
.sortable:hover { color: var(--text); }

.table-wrap tbody tr { cursor: pointer; }
.table-wrap tbody tr:hover { background: var(--surface2); }

.admin-table td { vertical-align: middle; }
.admin-table .btn-xs { white-space: nowrap; }

.pon-table .font-mono { font-size: .6875rem; }
.pon-table thead th { position: sticky; top: 0; z-index: 1; }

/* --------------------------------------------------------- charts, feeds */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100% !important; height: 100% !important; }
.chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    font-size: .6875rem;
    color: var(--muted);
    text-align: center;
    pointer-events: none;
}

.olt-head { display: flex; align-items: center; gap: .6rem; }
.olt-icon {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.olt-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .75rem;
}
.olt-row:last-child { border-bottom: 0; }
.olt-row span { color: var(--muted); }
.olt-row strong { color: var(--text); font-variant-numeric: tabular-nums; }

.online-bar {
    height: 6px;
    overflow: hidden;
    background: var(--surface3);
    border-radius: 2px;
}
.online-bar span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .3s var(--ease);
}

.feed-list { max-height: 318px; overflow-y: auto; }
.feed-item {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    padding: .5rem .85rem;
    border-top: 1px solid var(--border);
}
.feed-item:first-child { border-top: 0; }
.feed-item:hover { background: var(--surface2); }
.feed-dot { width: 6px; height: 6px; margin-top: .35rem; flex: 0 0 auto; border-radius: 50%; }
.feed-title {
    overflow: hidden;
    font-size: .75rem;
    line-height: 1.35;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.feed-meta {
    margin-top: .1rem;
    font-family: var(--font-mono);
    font-size: .625rem;
    line-height: 1.35;
    color: var(--muted);
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    opacity: 0;
    transform: translateX(-2px);
    transition: opacity var(--dur-ui) var(--ease-out), transform var(--dur-ui) var(--ease-out);
}
tr:hover .row-actions,
tr:focus-within .row-actions { opacity: 1; transform: none; }
.row-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    min-height: 1.5rem;
    padding: .1rem .3rem;
    border: 1px solid transparent;
    border-radius: var(--r-xs);
    font-family: var(--font-mono);
    font-size: .625rem;
    line-height: 1.4;
}
.row-act:hover { background: var(--surface3); border-color: var(--border); }
@media (pointer: coarse), (hover: none) {
    .row-actions { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- tool page UI */
.tool-tabs {
    position: sticky;
    top: 3.5rem;
    z-index: 30;
    display: flex;
    gap: .125rem;
    overflow-x: auto;
    padding: .25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    scrollbar-width: none;
}
.tool-tabs::-webkit-scrollbar { display: none; }

.tool-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
    min-height: 2.25rem;
    padding: .4rem .65rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
    transition:
        color .12s var(--ease),
        background-color .12s var(--ease);
}
.tool-tab::after {
    content: "";
    position: absolute;
    left: .55rem;
    right: .55rem;
    bottom: .18rem;
    height: 2px;
    background: var(--amber);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--dur-panel) var(--ease);
    pointer-events: none;
}
.tool-tab:hover { color: var(--text); background: var(--surface2); }
.tool-tab.active {
    color: var(--text);
    background: var(--surface3);
    border-color: var(--border);
}
.tool-tab.active::after { transform: scaleX(1); }
.tool-tab-ico { width: .9rem; height: .9rem; flex: 0 0 auto; opacity: .65; }
.tool-tab.active .tool-tab-ico { opacity: 1; }
.tool-tab .badge-dot { width: .35rem; height: .35rem; border-radius: 50%; background: var(--accent); }

.mini-table { font-size: .6875rem; }
.mini-table th { font-size: .5625rem; }
.mini-table td { padding: .35rem .5rem; }

.pre-box {
    max-height: 26rem;
    margin: 0;
    padding: .65rem .75rem;
    overflow: auto;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: .6875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.kv-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .3rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .75rem;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row span { flex: 0 0 auto; color: var(--muted); }
.kv-row strong {
    min-width: 0;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.skeleton,
.skel {
    height: 2.2rem;
    margin-bottom: .45rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.skel:last-child { margin-bottom: 0; }

.job-bar {
    height: 5px;
    overflow: hidden;
    background: var(--surface3);
    border-radius: 2px;
}
.job-bar > span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .3s var(--ease);
}

.job-event {
    display: flex;
    gap: .5rem;
    padding: .12rem 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: .625rem;
    line-height: 1.45;
}
.job-event .t { flex: 0 0 auto; color: var(--faint); }
.job-event.error { color: var(--red); }
.job-event.success { color: var(--accent); }

.chip-list { display: flex; flex-wrap: wrap; gap: .25rem; }
.chip-list .pill { font-family: var(--font-mono); }

.check-cell { width: 2rem; text-align: center; }
.check-cell input { width: .95rem; height: .95rem; accent-color: var(--accent); cursor: pointer; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

details.result-details summary {
    cursor: pointer;
    font-size: .6875rem;
    color: var(--blue);
}

.empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 1.25rem .75rem;
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-sm);
    background: var(--surface2);
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    margin-bottom: .1rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.empty-title { font-size: .75rem; font-weight: 600; color: var(--text); }
.empty-sub { max-width: 26rem; font-size: .6875rem; line-height: 1.45; color: var(--muted); }
.empty-sub strong { color: var(--text); font-weight: 600; }

.raw-details { margin-top: .5rem; padding-top: .4rem; border-top: 1px solid var(--border); }
.raw-details summary {
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: .625rem;
    color: var(--muted);
}
.raw-details summary:hover { color: var(--text); }
.raw-details pre {
    max-height: 20rem;
    margin: .4rem 0 0;
    padding: .55rem .65rem;
    overflow: auto;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: .625rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ------------------------------------------------------- segmented control */
.seg-control {
    display: inline-flex;
    gap: .125rem;
    padding: .2rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.seg-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .55rem;
    border: 1px solid transparent;
    border-radius: var(--r-xs);
    color: var(--muted);
    font-size: .6875rem;
    line-height: 1.3;
    transition: color .12s var(--ease), background-color .12s var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}
.seg-count {
    padding: .05rem .25rem;
    border-radius: var(--r-xs);
    background: var(--surface3);
    font-family: var(--font-mono);
    font-size: .5625rem;
    color: var(--muted);
}
.seg-btn.active .seg-count { color: var(--accent); background: var(--ok-soft); }

/* ------------------------------------------------------------ signal UI */
.rx-track {
    position: relative;
    height: 6px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--red), var(--amber) 45%, var(--accent));
}
.rx-knob {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--text);
    transform: translate(-50%, -50%);
}
.spark { display: block; width: 100%; height: 26px; overflow: visible; }

/* ------------------------------------------------------------- profiles */
.profile-list { display: flex; flex-direction: column; gap: .3rem; }
.profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem .55rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.profile-row:hover { border-color: var(--border-strong); }
.profile-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.profile-name {
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-meta { font-size: .625rem; color: var(--muted); }
.profile-vals { display: flex; gap: .25rem; flex: 0 0 auto; }
.profile-val {
    min-width: 2.75rem;
    padding: .15rem .3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    text-align: center;
}
.profile-val-label {
    font-family: var(--font-mono);
    font-size: .5rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--faint);
}
.profile-empty { padding: .85rem .5rem .55rem; text-align: center; font-size: .6875rem; color: var(--muted); }

/* --------------------------------------------------------------- alerts */
.alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .75rem;
    background: var(--bad-soft);
    border: 1px solid var(--red);
    border-radius: var(--r-md);
    color: var(--text);
}
.alert-banner svg { color: var(--red); flex: 0 0 auto; }
.alert-banner strong { color: var(--red); font-weight: 600; }

.inline-error,
.inline-ok,
.inline-warn {
    padding: .4rem .55rem;
    border: 1px solid;
    border-radius: var(--r-sm);
    font-size: .6875rem;
    line-height: 1.45;
}
.inline-error { color: var(--red); background: var(--bad-soft); border-color: var(--red); }
.inline-ok { color: var(--accent); background: var(--ok-soft); border-color: var(--accent); }
.inline-warn { color: var(--amber); background: var(--warn-soft); border-color: var(--amber); }

/* --------------------------------------------------------------- toasts */
.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: min(24rem, calc(100vw - 2rem));
    padding: .55rem .7rem .55rem .8rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-menu);
    color: var(--text);
    font-size: .75rem;
    line-height: 1.4;
    overflow: hidden;
    animation: toastIn 160ms var(--ease-out) both;
}
.toast.is-leaving { animation: toastOut 140ms var(--ease-in) both; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
@keyframes toastOut {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: translateY(-3px); }
}
.toast::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    background: var(--faint);
}
.toast-success { border-color: var(--accent); }
.toast-success::before { background: var(--accent); }
.toast-error { border-color: var(--red); }
.toast-error::before { background: var(--red); }
.toast-info { border-color: var(--blue); }
.toast-info::before { background: var(--blue); }
.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    opacity: .45;
    transform-origin: left center;
    animation: toastbar linear forwards;
}
@keyframes toastbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 1.5rem;
    min-height: 1.5rem;
    margin-left: auto;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1;
}
.toast-close:hover { background: var(--surface3); color: var(--text); }

/* ---------------------------------------------------------- dialogs etc. */
.modal-backdrop {
    background: rgba(0, 0, 0, .66);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
[data-theme="light"] .modal-backdrop { background: rgba(22, 24, 29, .38); }

.fade-in { animation: fadeIn .18s var(--ease); }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px) scale(.992); }
    to { opacity: 1; transform: none; }
}

.modal-fade-enter { transition: opacity var(--dur-drawer-in) var(--ease-out); }
.modal-fade-enter-start { opacity: 0; }
.modal-fade-enter-end { opacity: 1; }
.modal-fade-leave { transition: opacity var(--dur-drawer-out) var(--ease-in); }
.modal-fade-leave-start { opacity: 1; }
.modal-fade-leave-end { opacity: 0; }

.detail-enter {
    transition:
        opacity var(--dur-drawer-in) var(--ease-out),
        transform var(--dur-drawer-in) var(--ease-out);
}
.detail-enter-start { opacity: 0; transform: translateY(6px) scale(.995); }
.detail-enter-end { opacity: 1; transform: none; }
.detail-leave {
    transition:
        opacity var(--dur-drawer-out) var(--ease-in),
        transform var(--dur-drawer-out) var(--ease-in);
}
.detail-leave-start { opacity: 1; transform: none; }
.detail-leave-end { opacity: 0; transform: translateY(4px) scale(.997); }

.spinner {
    display: inline-block;
    width: .9rem;
    height: .9rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -.12em;
}
@keyframes spin { to { transform: rotate(360deg); } }

.live-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--accent);
}

.tab-btn {
    padding: .35rem .65rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-family: var(--font-display);
    font-size: .75rem;
    font-weight: 600;
    transition: color .12s var(--ease), background-color .12s var(--ease);
}
.tab-btn:hover { color: var(--text); background: var(--surface2); }
.tab-btn.active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}

.scroll-marker { scroll-margin-top: 5.5rem; }
#networkStatus, #ponOutage, #activity, #onuMap, #onuSection { scroll-margin-top: 5.5rem; }

/* ------------------------------------------------------------- responsive */
@media (min-width: 1024px) and (max-width: 1279px) {
    .topbar .topbar-nav { display: none; }
    .topbar .topbar-mobile { display: block; }
}

@media (max-width: 1023px) {
    .topbar .nav-shell {
        height: auto;
        min-height: 3.5rem;
        flex-wrap: wrap;
        row-gap: .4rem;
        padding-top: .4rem;
        padding-bottom: .4rem;
    }
    .topbar .nav-shell > .flex-1 { display: none; }
    .topbar .nav-actions { margin-left: auto; justify-content: flex-end; }
    .tool-tabs { position: static; }
    #networkStatus, #ponOutage, #activity, #onuMap, #onuSection { scroll-margin-top: 6.5rem; }
}

@media (max-width: 900px) {
    .readout-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .readout-cell:nth-child(3) { border-top: 1px solid var(--border); border-left: 0; }
    .readout-cell:nth-child(4) { border-top: 1px solid var(--border); }
    .readout-cell { padding: .7rem .8rem; }
    .readout-value { font-size: 1.6rem; }
    .readout-spark { width: 72px; height: 22px; }
}

@media (max-width: 640px) {
    body { font-size: .8125rem; }
    main { padding: .75rem !important; }

    .panel-body { padding: .75rem; }
    .panel-body-tight { padding: .6rem .7rem; }
    .panel-head { padding: .5rem .7rem; }

    .page-head { align-items: flex-start; padding-bottom: .75rem; }
    .page-head-icon { width: 2.25rem; height: 2.25rem; }
    .page-title { font-size: 1.25rem; }
    .page-sub { font-size: .6875rem; }
    .page-head-actions { width: 100%; }

    .readout-sub { white-space: normal; }
    .status-strip { gap: .3rem .85rem; padding: .4rem .6rem; }
    .status-strip .strip-item.ml-auto { margin-left: 0; }

    .alert-banner { flex-wrap: wrap; row-gap: .5rem; }
    .alert-banner .alert-action { margin-left: auto; }

    .btn { min-height: 2.5rem; }
    .btn-xs { min-height: 2rem; }
    .topbar-title { font-size: .8125rem; }

    .feed-list { max-height: 260px; }

    .table-wrap { -webkit-overflow-scrolling: touch; }
    #onuTable table { min-width: 900px; }
    #onuTable table td,
    #onuTable table th { padding: .45rem .5rem !important; white-space: nowrap; }
    #onuTable tbody td { height: 40px; }

    .tool-tabs { border-radius: var(--r-sm); }
    .mini-table th,
    .mini-table td { padding: .3rem .4rem; }

    .pon-table .pon-extra { display: none; }
    .fixed.inset-0 { padding: 0; }
    .fixed.inset-0 > div.card {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border: 0 !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 420px) {
    .readout-value { font-size: 1.45rem; }
    .readout-cell { padding: .6rem .65rem; }
    .readout-label { font-size: .5625rem; }
    .readout-spark { width: 52px; height: 18px; opacity: .5; }
    .page-head-main { gap: .6rem; }
}

/* ------------------------------------------------------------- micro-motion */
/* Every motion here explains a state change: boot order, data arrival, live link, or focus target. */
.boot-topbar,
.page-enter > * {
    animation: pageRise var(--dur-boot) var(--ease-out) both;
}
.page-enter > *:nth-child(2) { animation-delay: 45ms; }
.page-enter > *:nth-child(3) { animation-delay: 90ms; }
.page-enter > *:nth-child(4) { animation-delay: 135ms; }
.page-enter > *:nth-child(5) { animation-delay: 180ms; }
.page-enter > *:nth-child(n+6) { animation-delay: 225ms; }
@keyframes pageRise {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}

.topbar-logo svg rect,
.logo-badge svg rect {
    transform-box: fill-box;
    transform-origin: center bottom;
    animation: portBoot .55s cubic-bezier(.2, .8, .2, 1) both;
}
.topbar-logo svg rect:nth-of-type(2),
.logo-badge svg rect:nth-of-type(2) { animation-delay: 70ms; }
.topbar-logo svg rect:nth-of-type(3),
.logo-badge svg rect:nth-of-type(3) { animation-delay: 140ms; }
@keyframes portBoot {
    from { opacity: .25; transform: scaleY(.2); }
    to { opacity: 1; transform: none; }
}

.value-tick { animation: valueTick var(--dur-data) var(--ease); }
@keyframes valueTick {
    0% { opacity: .45; filter: brightness(1.55); }
    55% { opacity: 1; filter: brightness(1.08); }
    100% { opacity: 1; filter: none; }
}
.readout-value.value-tick { animation-name: readoutTick; }
@keyframes readoutTick {
    0% { opacity: .3; transform: translateY(-3px); filter: brightness(1.3); }
    55% { opacity: 1; transform: translateY(1px); filter: brightness(1.08); }
    100% { opacity: 1; transform: none; filter: none; }
}

.section-flash { animation: sectionPulse 1.15s var(--ease); }
@keyframes sectionPulse {
    0% { box-shadow: inset 0 0 0 1px var(--amber), 0 0 0 3px var(--warn-soft); }
    100% { box-shadow: inset 0 0 0 1px transparent, 0 0 0 3px transparent; }
}

button:active:not(:disabled),
.btn:active:not(:disabled),
.topbar-btn:active:not(:disabled),
.row-act:active:not(:disabled),
.tab-btn:active,
.tool-tab:active,
.menu-item:active { transform: translateY(1px); }

@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: .18s;
        animation-timing-function: var(--ease);
    }
}

/* -------------------------------------------------- touch target overrides */
/* Keep last: these must beat the later base rules above at equal specificity. */
@media (pointer: coarse), (max-width: 900px) {
    .btn,
    .btn-xs,
    .filter-toggle,
    .topbar-brand,
    .row-act,
    .alert-action,
    .topbar-btn,
    .topbar-link,
    .menu-item,
    .toast-close,
    .tool-tab,
    .chip,
    .seg-btn,
    .tab-btn,
    .select-sm,
    .field-input,
    .tool-input,
    .admin-input,
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        min-height: 44px;
    }

    .btn-xs { padding: .2rem .55rem; }
    .row-act {
        min-width: 44px;
        padding: .1rem .45rem;
    }
    .topbar-btn { min-width: 44px; }
    .topbar-link,
    .menu-item { padding-left: .7rem; padding-right: .7rem; }
    .chip { padding: .3rem .65rem; }
    .chip > button {
        min-width: 44px;
        min-height: 44px;
        margin: -.3rem -.5rem -.3rem 0;
        background: transparent;
        border: 0;
        color: inherit;
    }
    .tool-tab { padding: .4rem .7rem; }
    input[type="checkbox"],
    input[type="radio"] { width: 1.5rem; height: 1.5rem; }
    label:has(> input[type="checkbox"]),
    label:has(> input[type="radio"]) { min-height: 44px; }
}

/* ------------------------------------------------------- aurora live theme */
/* Tema opsional. NOC Carbon tetap default; lapisan ini hanya aktif saat
   data-theme="aurora" dan berhenti total pada prefers-reduced-motion. */
[data-theme="aurora"] body {
    background: transparent;
}
[data-theme="aurora"] body.auth {
    background: transparent;
}

[data-theme="aurora"] body::before,
[data-theme="aurora"] body::after {
    content: "";
    position: fixed;
    inset: -18vmax;
    z-index: -1;
    pointer-events: none;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* Nebula: empat bidang warna yang bergeser sangat lambat. */
[data-theme="aurora"] body::before {
    background:
        radial-gradient(42vmax 42vmax at 18% 22%, rgba(0, 222, 190, .40), transparent 64%),
        radial-gradient(38vmax 38vmax at 84% 18%, rgba(108, 84, 255, .42), transparent 66%),
        radial-gradient(50vmax 36vmax at 52% 38%, rgba(0, 190, 255, .22), transparent 70%),
        radial-gradient(46vmax 46vmax at 72% 82%, rgba(0, 118, 255, .30), transparent 68%),
        radial-gradient(34vmax 34vmax at 14% 80%, rgba(255, 150, 48, .16), transparent 66%);
    animation: auroraDrift 52s var(--ease) infinite alternate;
}

/* Bintang: satu petak yang diulang, digeser tepat satu petak agar loop mulus. */
[data-theme="aurora"] body::after {
    background-image:
        radial-gradient(circle at 10% 18%, rgba(255, 255, 255, .65) 0 1px, transparent 1.6px),
        radial-gradient(circle at 34% 62%, rgba(170, 225, 255, .55) 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 58% 30%, rgba(255, 255, 255, .40) 0 1px, transparent 1.5px),
        radial-gradient(circle at 76% 78%, rgba(255, 235, 190, .45) 0 1px, transparent 1.6px),
        radial-gradient(circle at 90% 48%, rgba(180, 210, 255, .38) 0 1px, transparent 1.5px);
    background-size: 360px 360px;
    box-shadow: inset 0 0 22vmax 8vmax rgba(2, 4, 8, .55);
    opacity: .55;
    animation: starDrift 120s linear infinite;
}

@keyframes auroraDrift {
    0% { transform: translate3d(-2%, -1.5%, 0) scale(1.04) rotate(-2deg); }
    50% { transform: translate3d(2%, 2%, 0) scale(1.10) rotate(2deg); }
    100% { transform: translate3d(-1%, 3%, 0) scale(1.06) rotate(-1deg); }
}
@keyframes starDrift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-360px, -360px, 0); }
}

/* Kaca gelap: wallpaper tetap terlihat, teks tetap punya bidang baca. */
[data-theme="aurora"] .topbar {
    background: rgba(5, 9, 16, .48);
    border-bottom-color: rgba(126, 151, 199, .30);
    backdrop-filter: blur(14px) saturate(1.12);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
}
[data-theme="aurora"] .topbar-logo {
    background: rgba(20, 28, 43, .72);
    border-color: rgba(154, 183, 236, .45);
    box-shadow: 0 0 18px -7px rgba(92, 242, 196, .55);
}
[data-theme="aurora"] .panel,
[data-theme="aurora"] .card,
[data-theme="aurora"] .stat-tile,
[data-theme="aurora"] .kpi-tile {
    background: rgba(8, 12, 21, .68);
    border-color: rgba(126, 151, 199, .26);
    box-shadow: 0 18px 40px -36px rgba(0, 0, 0, .95);
}
[data-theme="aurora"] .panel-head {
    background: rgba(20, 28, 43, .52);
    border-bottom-color: rgba(126, 151, 199, .24);
}
[data-theme="aurora"] .panel-foot {
    background: rgba(20, 28, 43, .46);
}
[data-theme="aurora"] .readout-rail {
    background: rgba(7, 11, 20, .52);
    border-color: rgba(126, 151, 199, .30);
}
[data-theme="aurora"] .status-strip {
    background: rgba(7, 11, 20, .52);
    border-color: rgba(126, 151, 199, .28);
}
[data-theme="aurora"] .auth-card {
    background: rgba(9, 14, 24, .74);
    border-color: rgba(126, 151, 199, .30);
    box-shadow: 0 30px 70px -46px rgba(0, 0, 0, .95);
}
[data-theme="aurora"] .menu-panel {
    background: rgba(10, 15, 25, .97);
    border-color: rgba(154, 183, 236, .38);
}
[data-theme="aurora"] .modal-backdrop {
    background: rgba(2, 4, 9, .72);
}

/* ------------------------------------------------------- senja anime theme */
/* Pemandangan orisinal: langit senja, Tokyo, Skytree, dan siluet karakter.
   Semua bentuk dibuat dengan CSS dan SVG inline, tanpa aset eksternal. */
.senja-scene { display: none; }

[data-theme="senja"] body,
[data-theme="senja"] body.auth {
    background: transparent;
}

[data-theme="senja"] .senja-scene {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: #150b1d;
}

/* Wallpaper video. Poster tampil lebih dulu, video memudar di atasnya. */
.senja-poster,
.senja-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 52% 40%;
    filter: brightness(.88) saturate(1.02);
}
.senja-poster {
    z-index: 0;
    opacity: 0;
}
.senja-video {
    z-index: 1;
    opacity: 0;
    background: transparent;
    transition: opacity .9s var(--ease);
}
.senja-scene.has-video .senja-poster { opacity: 1; }
.senja-scene.has-video.is-playing .senja-video { opacity: 1; }

/* Halaman aplikasi: wallpaper diredupkan agar tabel dan grafik tetap tenang. */
[data-theme="senja"] body.min-h-screen .senja-poster,
[data-theme="senja"] body.min-h-screen .senja-video {
    filter: brightness(.74) saturate(1.02);
}

/* Saat video aktif, scene CSS diganti total; vignette tetap menjaga kontras. */
.senja-scene.has-video .senja-sky,
.senja-scene.has-video .senja-sun,
.senja-scene.has-video .senja-haze,
.senja-scene.has-video .senja-cloud,
.senja-scene.has-video .senja-bird,
.senja-scene.has-video .senja-city,
.senja-scene.has-video .senja-girl,
.senja-scene.has-video .senja-ember {
    display: none;
}

.senja-sky {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        #090514 0%,
        #140d29 14%,
        #29163f 30%,
        #532248 46%,
        #96394d 60%,
        #d95a4c 71%,
        #ff9058 80%,
        #ffc182 88%,
        #4a2030 96%,
        #150b1d 100%);
}

.senja-sun {
    position: absolute;
    right: 13%;
    bottom: 24%;
    width: min(28vmin, 320px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        #fff7db 0 13%,
        #ffdd96 28%,
        #ffac68 46%,
        rgba(255, 116, 84, .48) 62%,
        rgba(255, 116, 84, 0) 73%);
    box-shadow: 0 0 12vmin 5vmin rgba(255, 132, 82, .26);
    animation: senjaSun 14s ease-in-out infinite alternate;
}

.senja-haze {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18%;
    height: 48vh;
    background: radial-gradient(ellipse 70% 55% at 62% 62%,
        rgba(255, 148, 96, .42), transparent 70%);
    mix-blend-mode: screen;
}

.senja-cloud {
    position: absolute;
    border-radius: 50%;
    opacity: .5;
    background:
        radial-gradient(ellipse 42% 55% at 22% 55%, rgba(255, 168, 148, .72), transparent 70%),
        radial-gradient(ellipse 36% 62% at 43% 42%, rgba(255, 212, 180, .66), transparent 72%),
        radial-gradient(ellipse 34% 55% at 63% 58%, rgba(190, 132, 200, .52), transparent 72%),
        radial-gradient(ellipse 28% 48% at 81% 46%, rgba(255, 146, 138, .44), transparent 72%);
    animation: senjaCloud 110s ease-in-out infinite alternate;
}
.senja-cloud--a { top: 16%; left: -14%; width: 68vw; height: 17vh; opacity: .46; animation-duration: 118s; }
.senja-cloud--b { top: 31%; left: 40%; width: 52vw; height: 14vh; opacity: .38; animation-duration: 92s; animation-direction: alternate-reverse; }
.senja-cloud--c { top: 45%; left: -20%; width: 72vw; height: 15vh; opacity: .44; animation-duration: 136s; }
.senja-cloud--d { top: 9%; left: 58%; width: 46vw; height: 13vh; opacity: .3; animation-duration: 104s; animation-direction: alternate-reverse; }

.senja-bird {
    position: absolute;
    left: 0;
    width: 42px;
    opacity: .55;
    animation: senjaBird 70s linear infinite;
}
.senja-bird svg { display: block; width: 100%; height: auto; }
.senja-bird path { fill: none; stroke: #2a1220; stroke-width: 2; stroke-linecap: round; }
.senja-bird--a { top: 15%; animation-duration: 74s; animation-delay: -9s; }
.senja-bird--b { top: 22%; width: 32px; animation-duration: 92s; animation-delay: -42s; opacity: .42; }
.senja-bird--c { top: 11%; width: 26px; animation-duration: 108s; animation-delay: -64s; opacity: .34; }

.senja-city {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: clamp(340px, 62vh, 760px);
}

.senja-girl {
    position: absolute;
    left: clamp(-24px, 3vw, 64px);
    bottom: 0;
    height: clamp(400px, 70vh, 760px);
    width: auto;
    filter: drop-shadow(0 0 22px rgba(255, 150, 110, .12));
}
[data-theme="senja"] body.min-h-screen .senja-girl { opacity: .68; }

.senja-hair {
    transform-box: fill-box;
    transform-origin: 55% 8%;
    animation: senjaHair 9s ease-in-out infinite alternate;
}
.senja-scarf {
    transform-box: fill-box;
    transform-origin: 82% 18%;
    animation: senjaScarf 6.4s ease-in-out infinite alternate;
}
.senja-coat {
    transform-box: fill-box;
    transform-origin: 50% 12%;
    animation: senjaCoat 12s ease-in-out infinite alternate;
}
.senja-hair-light { animation: senjaHairLight 5.5s ease-in-out infinite alternate; }
.senja-beacon { animation: senjaBeacon 3.4s ease-in-out infinite alternate; }
.senja-twinkle { animation: senjaTwinkle 7s ease-in-out infinite alternate; }

.senja-ember {
    position: absolute;
    left: var(--x, 50%);
    bottom: -2vh;
    width: calc(3px * var(--s, 1));
    height: calc(3px * var(--s, 1));
    border-radius: 50%;
    background: #ffd09a;
    box-shadow: 0 0 8px 2px rgba(255, 170, 110, .45);
    opacity: 0;
    animation: senjaEmber 17s linear infinite;
    animation-delay: var(--d, 0s);
}

.senja-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        radial-gradient(ellipse at 50% 42%, transparent 0 38%, rgba(10, 4, 16, .16) 68%, rgba(8, 3, 12, .52) 100%),
        linear-gradient(180deg, rgba(8, 3, 12, .18) 0%, transparent 22%, transparent 70%, rgba(8, 3, 12, .35) 100%);
}

/* Scrim lebih kuat di atas video agar teks di luar panel tetap 4.5:1. */
.senja-scene.has-video .senja-vignette {
    background:
        linear-gradient(180deg,
            rgba(8, 3, 12, .72) 0%,
            rgba(8, 3, 12, .36) 20%,
            rgba(8, 3, 12, .16) 46%,
            rgba(8, 3, 12, .32) 70%,
            rgba(8, 3, 12, .70) 100%),
        radial-gradient(ellipse at 50% 44%,
            rgba(8, 3, 12, .08) 0 24%,
            rgba(8, 3, 12, .32) 62%,
            rgba(8, 3, 12, .64) 100%);
}

/* Halaman auth menaruh teks langsung di atas wallpaper, jadi scrim lebih tebal
   di pita atas dan bawah. Kartu form tetap menjadi fokus utama. */
[data-theme="senja"] body.auth .senja-scene.has-video .senja-vignette {
    background:
        linear-gradient(180deg,
            rgba(8, 3, 12, .92) 0%,
            rgba(8, 3, 12, .84) 12%,
            rgba(8, 3, 12, .62) 24%,
            rgba(8, 3, 12, .44) 38%,
            rgba(8, 3, 12, .52) 55%,
            rgba(8, 3, 12, .64) 70%,
            rgba(8, 3, 12, .78) 84%,
            rgba(8, 3, 12, .92) 100%),
        radial-gradient(ellipse at 50% 44%,
            rgba(8, 3, 12, .18) 0 26%,
            rgba(8, 3, 12, .42) 64%,
            rgba(8, 3, 12, .72) 100%);
}

@keyframes senjaSun {
    from { transform: scale(1); opacity: .94; }
    to { transform: scale(1.035); opacity: 1; }
}
@keyframes senjaCloud {
    from { transform: translate3d(-3vw, 0, 0); }
    to { transform: translate3d(3vw, -1.5vh, 0); }
}
@keyframes senjaBird {
    0% { transform: translate3d(-14vw, 0, 0); }
    50% { transform: translate3d(52vw, -2vh, 0); }
    100% { transform: translate3d(114vw, 1vh, 0); }
}
@keyframes senjaHair {
    from { transform: rotate(-.7deg) translate(0, 0); }
    to { transform: rotate(1.5deg) translate(3px, -2px); }
}
@keyframes senjaScarf {
    from { transform: rotate(-1.2deg) translate(0, 0); }
    to { transform: rotate(2deg) translate(-4px, 2px); }
}
@keyframes senjaCoat {
    from { transform: rotate(-.4deg); }
    to { transform: rotate(.8deg); }
}
@keyframes senjaHairLight {
    from { opacity: .55; }
    to { opacity: 1; }
}
@keyframes senjaBeacon {
    from { opacity: .28; }
    to { opacity: 1; }
}
@keyframes senjaTwinkle {
    from { opacity: .35; }
    to { opacity: .9; }
}
@keyframes senjaEmber {
    0% { transform: translate3d(0, 0, 0); opacity: 0; }
    8% { opacity: .85; }
    55% { opacity: .5; }
    100% { transform: translate3d(3vw, -74vh, 0); opacity: 0; }
}

/* Kaca hangat: teks tetap terbaca di atas langit yang terang. */
[data-theme="senja"] .topbar {
    background: rgba(15, 8, 22, .62);
    border-bottom-color: rgba(255, 190, 150, .26);
    backdrop-filter: blur(14px) saturate(1.08);
    -webkit-backdrop-filter: blur(14px) saturate(1.08);
}
[data-theme="senja"] .topbar-logo {
    background: rgba(37, 22, 48, .78);
    border-color: rgba(255, 201, 166, .45);
    box-shadow: 0 0 18px -7px rgba(255, 166, 107, .55);
}
[data-theme="senja"] .panel,
[data-theme="senja"] .card,
[data-theme="senja"] .stat-tile,
[data-theme="senja"] .kpi-tile {
    background: rgba(17, 9, 24, .90);
    border-color: rgba(255, 177, 140, .24);
    box-shadow: 0 18px 40px -36px rgba(0, 0, 0, .95);
}
[data-theme="senja"] .page-sub {
    color: #f0d8cc;
}
[data-theme="senja"] .panel-head {
    background: rgba(37, 22, 48, .90);
    border-bottom-color: rgba(255, 177, 140, .22);
}
[data-theme="senja"] .panel-foot {
    background: rgba(37, 22, 48, .86);
}
[data-theme="senja"] .readout-rail {
    background: rgba(17, 9, 24, .86);
    border-color: rgba(255, 177, 140, .26);
}
[data-theme="senja"] .status-strip {
    background: rgba(17, 9, 24, .84);
    border-color: rgba(255, 177, 140, .24);
}
[data-theme="senja"] .auth-card {
    background: rgba(18, 10, 26, .88);
    border-color: rgba(255, 201, 166, .30);
    box-shadow: 0 30px 70px -46px rgba(0, 0, 0, .96);
}
[data-theme="senja"] .menu-panel {
    background: rgba(20, 11, 28, .98);
    border-color: rgba(255, 201, 166, .38);
}
[data-theme="senja"] .modal-backdrop {
    background: rgba(8, 3, 12, .78);
}

@media (max-width: 900px) {
    .senja-poster,
    .senja-video { object-position: 54% 34%; }
}

@media (max-width: 700px) {
    .senja-city { height: clamp(300px, 54vh, 520px); }
    .senja-girl {
        left: -18vw;
        height: clamp(320px, 54vh, 520px);
        opacity: .78;
    }
    .senja-sun { width: min(44vmin, 260px); right: 6%; bottom: 28%; }
    .senja-cloud { opacity: .34; }
}

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
    .toast-progress { display: none; }
    .spinner { animation: none; border-right-color: currentColor; opacity: .7; }
    .dot-green::after { display: none; }
    [data-theme="aurora"] body::before,
    [data-theme="aurora"] body::after { animation: none !important; }
    [data-theme="senja"] .senja-sun,
    [data-theme="senja"] .senja-cloud,
    [data-theme="senja"] .senja-bird,
    [data-theme="senja"] .senja-hair,
    [data-theme="senja"] .senja-scarf,
    [data-theme="senja"] .senja-coat,
    [data-theme="senja"] .senja-hair-light,
    [data-theme="senja"] .senja-beacon,
    [data-theme="senja"] .senja-twinkle,
    [data-theme="senja"] .senja-ember { animation: none !important; }
    [data-theme="senja"] .senja-ember { display: none; }
    /* Tema Anime dikecualikan: wallpaper video adalah pilihan pemilik dashboard,
       jadi tetap diputar walaupun sistem meminta reduced motion. */
    [data-theme="senja"] .senja-scene.has-video .senja-video { display: block; }
    .table-wrap tbody tr.is-new-row { opacity: 1 !important; }
    html.theme-switching body,
    html.theme-switching .topbar,
    html.theme-switching .panel,
    html.theme-switching .card,
    html.theme-switching .readout-rail,
    html.theme-switching .status-strip,
    html.theme-switching .tool-tabs,
    html.theme-switching .tool-tab,
    html.theme-switching .menu-panel,
    html.theme-switching .toast,
    html.theme-switching .btn,
    html.theme-switching .field-input,
    html.theme-switching .table-wrap thead th,
    html.theme-switching .modal-backdrop { transition: none !important; }
    ::view-transition-old(root),
    ::view-transition-new(root),
    ::view-transition-group(root) { animation: none !important; }
}
