/* OLT Manager — "Lightpath" design system
   Night-shift NOC console: deep duct navy, splice-cyan light, status colours that
   map to real fiber faults (power fail = violet, LoS = amber-orange). */

:root, :root[data-theme="dark"] {
  --bg: #0F1A2B;
  --bg-glow: radial-gradient(1200px 600px at 85% -10%, rgba(25,194,224,.10), transparent 60%);
  --surface: #15233A;
  --surface-2: #1B2C47;
  --surface-3: #22365A;
  --line: #26385A;
  --line-soft: #1E2F4C;
  --text: #E8EEF8;
  --text-2: #B7C5DB;
  --muted: #8193B0;
  --accent: #19C2E0;
  --accent-2: #5B8CFF;
  --accent-ink: #04222B;
  --accent-soft: rgba(25,194,224,.14);
  --good: #34D399; --good-soft: rgba(52,211,153,.14);
  --bad: #F8717A;  --bad-soft: rgba(248,113,122,.14);
  --warn: #FBBF24; --warn-soft: rgba(251,191,36,.14);
  --power: #A78BFA; --power-soft: rgba(167,139,250,.16);
  --los: #FB923C;  --los-soft: rgba(251,146,60,.16);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(3,10,22,.35);
  --radius-lg: 14px; --radius: 10px; --radius-sm: 7px;
  --sidebar: 236px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EEF2F8;
  --bg-glow: radial-gradient(1200px 600px at 85% -10%, rgba(10,143,176,.08), transparent 60%);
  --surface: #FFFFFF;
  --surface-2: #F5F8FC;
  --surface-3: #EAF0F8;
  --line: #DCE3EE;
  --line-soft: #E8EDF5;
  --text: #13233B;
  --text-2: #33476A;
  --muted: #5D6F8C;
  --accent: #0A8FB0;
  --accent-2: #3563E9;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(10,143,176,.10);
  --good: #059669; --good-soft: rgba(5,150,105,.10);
  --bad: #DC2640;  --bad-soft: rgba(220,38,64,.09);
  --warn: #B7791F; --warn-soft: rgba(183,121,31,.12);
  --power: #7C3AED; --power-soft: rgba(124,58,237,.10);
  --los: #C2410C;  --los-soft: rgba(194,65,12,.10);
  --shadow: 0 1px 2px rgba(19,35,59,.06), 0 6px 18px rgba(19,35,59,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); background-image: var(--bg-glow); background-attachment: fixed;
  color: var(--text); font: 14px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand b { font-size: 16px; font-weight: 600; letter-spacing: -.01em; display: block; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 11.5px; }
.search { position: relative; margin: 0 2px 14px; }
.search input { width: 100%; padding: 8px 10px 8px 32px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 13px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.nav-group { margin: 6px 0 10px; }
.nav-group > span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; padding: 6px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px; position: relative; }
.nav a svg { color: var(--muted); flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--text); }
.nav a.on svg { color: var(--accent); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; background: var(--bad); color: #fff; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3);
  color: var(--text); font-weight: 600; font-size: 12px; flex: none; }
.side-foot .who { min-width: 0; flex: 1; line-height: 1.2; }
.side-foot .who b { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--muted); font-size: 11.5px; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.main { min-width: 0; padding: 22px 28px 40px; max-width: 1480px; width: 100%; }
.mobilebar { display: none; }
footer { color: var(--muted); font-size: 12px; padding: 26px 0 0; }

/* ---------- page head ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 2px 0 18px; }
h1 { font-size: 23px; font-weight: 600; letter-spacing: -.015em; margin: 0; line-height: 1.2; }
h1 .muted { font-weight: 400; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.005em; }
h3 { font-size: 13.5px; font-weight: 600; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.head .row { align-items: center; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px;
  margin-bottom: 16px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > .head:first-child { margin-top: 0; }
.card .head { margin-bottom: 12px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid > .card, .grid > div > .card { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .three { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }

/* ---------- KPI strip ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 14px 16px 13px; color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.stat:hover { text-decoration: none; border-color: var(--surface-3); }
.stat b { display: block; font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat i { position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line); }
.stat.good i { background: var(--good); } .stat.bad i { background: var(--bad); } .stat.warn i { background: var(--warn); }
.stat.accent i { background: var(--accent); } .stat.power i { background: var(--power); }
.stat .split { display: flex; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.stat .split em { font-style: normal; display: inline-flex; align-items: center; gap: 5px; }

/* ---------- PON patch panel (dashboard hero) ---------- */
.ponpanel { display: grid; gap: 10px; }
.slotrow { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; }
.slotrow > span { color: var(--muted); font-size: 12px; }
.slotrow > span b { color: var(--text-2); display: block; font-weight: 500; font-size: 13px; }
.ports { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 1100px) { .ports { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.port { position: relative; display: block; border-radius: 8px; padding: 7px 6px 6px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text); min-height: 54px; overflow: hidden; }
.port:hover { text-decoration: none; border-color: var(--accent); }
.port .pn { font-size: 11px; color: var(--muted); display: block; }
.port .pc { font-size: 15px; font-weight: 600; display: block; line-height: 1.25; }
.port .po { font-size: 11px; color: var(--bad); }
.port .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--good); }
.port.h-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.port.h-bad { border-color: color-mix(in srgb, var(--bad) 70%, var(--line)); background: var(--bad-soft); }
.port.h-bad .fill { background: var(--bad); }
.port.h-warn .fill { background: var(--warn); }
.port.empty { opacity: .45; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
th a { color: var(--muted); }
tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td, table.list tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.scroll { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.scroll table th:first-child { border-top-left-radius: var(--radius-lg); }
.card table th { background: transparent; position: static; padding-top: 4px; }
table.compact td { padding: 7px 8px; }
table.compact td:first-child { padding-left: 0; }
.kv th { width: 132px; background: transparent; position: static; color: var(--muted); font-weight: 400; padding-left: 0; }
.kv td { word-break: break-word; padding-right: 0; }
.kv tr td, .kv tr th { border-bottom: 1px dashed var(--line-soft); }

/* ---------- small things ---------- */
.mono, code { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.small { font-size: 12px; } .muted { color: var(--muted); } .nowrap { white-space: nowrap; }
.big { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.err { color: var(--bad); } .good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.power { background: var(--power-soft); color: var(--power); }
.pill.los { background: var(--los-soft); color: var(--los); }
.pill.plain::before { display: none; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--surface-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--muted); vertical-align: 1px; }
.dot.alert { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.ok { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot.info { background: var(--accent); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; text-align: center; }
.bar { background: var(--surface-3); height: 6px; border-radius: 4px; min-width: 70px; overflow: hidden; }
.bar i { display: block; height: 6px; border-radius: 4px; background: var(--bad); }

/* signal meter: -8 dBm (full) ... -30 dBm (empty) */
.sig { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.sig .m { width: 46px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.sig .m i { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.sig.weak .m i { background: var(--warn); } .sig.crit .m i { background: var(--bad); }
.sig.weak b { color: var(--warn); } .sig.crit b { color: var(--bad); }
.sig b { font-weight: 500; font-family: "IBM Plex Mono", monospace; font-size: 12.5px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 500; font-size: 13px; line-height: 1.3; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.warn { color: var(--warn); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions form { display: inline; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input, select, textarea { font: inherit; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); }
input::placeholder { color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input { min-width: 230px; }
.filters input.short { min-width: 0; width: 130px; }
.form label { display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.form label input, .form label select { display: block; width: 100%; margin-top: 5px; color: var(--text); font-weight: 400; }
.form label.check { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.form label.check input { display: inline; width: auto; margin: 0; }
.form .cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.form h2 { margin-top: 6px; }
.hint { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.actions-grid form { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.actions-grid form h3 { margin: 0 0 2px; }
.actions-grid input, .actions-grid select { width: 100%; }
.actions-grid p { margin: 0; }

.flash { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px; background: var(--good-soft); color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); font-weight: 500; }
.flash.wait { background: var(--warn-soft); color: var(--ink, inherit); border-color: color-mix(in srgb, var(--warn) 40%, transparent); font-weight: 400; }
.flash.err { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; color: var(--muted); }
.empty { text-align: center; padding: 34px; color: var(--muted); }
pre { background: var(--surface-2); border: 1px solid var(--line); padding: 12px; border-radius: var(--radius); overflow: auto;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--text-2); }
pre.cli { max-height: 440px; }
details > summary { cursor: pointer; font-weight: 600; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; color: var(--muted); }
details[open] > summary::before { content: "▾ "; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }

/* ---------- ONU hero ---------- */
.onu-hero { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .onu-hero { grid-template-columns: 1fr; } }
.gauge { display: flex; align-items: center; gap: 16px; }
.gauge svg { flex: none; }
.gauge .gv { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.gauge .gl { color: var(--muted); font-size: 12.5px; }
.cause { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 380px; }
.login .brand { justify-content: center; padding-bottom: 22px; }
.login .card { padding: 24px; }
.login label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.login input { width: 100%; margin-top: 6px; }
.login .btn { width: 100%; justify-content: center; padding: 10px; }

/* ---------- responsive shell ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(5,12,24,.55); }
  .mobilebar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; padding: 10px 16px;
    background: var(--surface); border-bottom: 1px solid var(--line); }
  .main { padding: 16px 16px 30px; }
  .filters input { min-width: 0; flex: 1; }
  .stat b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 600px) {
  .slotrow { grid-template-columns: 1fr; gap: 6px; }
  .slotrow > span b { display: inline; margin-right: 6px; }
  .ports { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
  .port { min-height: 42px; padding: 4px 4px 5px; border-radius: 6px; }
  .port .po { display: none; }
  .port .pc { font-size: 13px; }
  .port.h-bad .pc { color: var(--bad); }
  .stats { grid-template-columns: 1fr 1fr; }
  .head > .row, .head > form { width: 100%; }
}

/* extra VLAN rows (authorize) */
.xvlans { display: grid; gap: 8px; margin-bottom: 10px; }
.xrow { display: grid; grid-template-columns: 110px 90px 1fr 1fr auto; gap: 10px; align-items: end;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.xrow .xhint { grid-column: 1 / -1; }
@media (max-width: 720px) { .xrow { grid-template-columns: 1fr 1fr; } }

/* batch action bar */
.batchbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 12px; margin: 0 0 12px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--surface-2); box-shadow: var(--shadow); }
.batchbar[hidden] { display: none; }
.batchbar select, .batchbar input { width: auto; min-width: 0; }
.batchbar .bf { display: inline-flex; gap: 6px; }

/* PON graphs grid */
.pon-graphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pon-graphs .pg { margin: 0; padding: 12px; color: inherit; text-decoration: none; display: block; }
.pon-graphs .pg:hover, .pon-graphs .pg.on { border-color: var(--accent); }
.msg { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.msg:last-child { border-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 10px; }
.installer { max-width: 560px; margin: 0 auto; }
.installer input, .installer select { font-size: 16px; }

.unsaved { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid var(--warn);
  background: var(--warn-soft); color: var(--text); font-size: 14px; }
.diff .add { color: var(--good); } .diff .del { color: var(--bad); } .diff .hunk { color: var(--accent); }
.odb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.odb-port { padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.odb-port.used { border-color: var(--good); } .odb-port.bad { border-color: var(--bad); }
.odb-port.free { opacity: .7; }

/* =====================================================================
   Appearance: per-user color scheme + ONU page design (palette button, saved on the user).
   Color schemes: carbon / sand / aurora.  ONU page: classic / tabs / split.
   ===================================================================== */

/* ---- A · Carbon: black + amber, square, terminal feel ---- */
:root[data-theme="carbon"] {
  --bg: #0A0A0B; --bg-glow: linear-gradient(transparent, transparent);
  --surface: #121214; --surface-2: #19191C; --surface-3: #232327;
  --line: #2A2A2F; --line-soft: #1F1F23;
  --text: #ECECEC; --text-2: #C2C2C6; --muted: #85858C;
  --accent: #F5A524; --accent-2: #22D3A6; --accent-ink: #1A1100; --accent-soft: rgba(245,165,36,.13);
  --good: #3DDC84; --good-soft: rgba(61,220,132,.12);
  --bad: #FF5C5C; --bad-soft: rgba(255,92,92,.13);
  --warn: #FFD43B; --warn-soft: rgba(255,212,59,.12);
  --power: #C084FC; --power-soft: rgba(192,132,252,.14);
  --los: #FF8A3D; --los-soft: rgba(255,138,61,.14);
  --shadow: none; --radius-lg: 4px; --radius: 4px; --radius-sm: 3px;
  color-scheme: dark;
}
[data-theme="carbon"] h1, [data-theme="carbon"] h2, [data-theme="carbon"] .brand b,
[data-theme="carbon"] .stat b, [data-theme="carbon"] .big { font-family: "IBM Plex Mono", monospace; letter-spacing: -.02em; }
[data-theme="carbon"] h2, [data-theme="carbon"] h3, [data-theme="carbon"] th, [data-theme="carbon"] .nav-group > span {
  text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; }
[data-theme="carbon"] h2 { font-size: 12.5px; color: var(--accent); }
[data-theme="carbon"] .card, [data-theme="carbon"] .stat, [data-theme="carbon"] .scroll { border-color: var(--line); }
[data-theme="carbon"] .card { border-top: 2px solid var(--surface-3); }
[data-theme="carbon"] .nav a.on { background: var(--accent); color: var(--accent-ink); }
[data-theme="carbon"] .nav a.on svg { color: var(--accent-ink); }
[data-theme="carbon"] .nav a.on::before { display: none; }
[data-theme="carbon"] .pill { border-radius: 3px; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
[data-theme="carbon"] .btn { text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }

/* ---- B · Sand: warm paper, terracotta + forest, dark espresso sidebar ---- */
:root[data-theme="sand"] {
  --bg: #F3EEE4; --bg-glow: radial-gradient(900px 500px at 100% 0, rgba(194,85,45,.07), transparent 60%);
  --surface: #FFFDF8; --surface-2: #F8F3EA; --surface-3: #EFE6D8;
  --line: #E3D8C6; --line-soft: #EDE4D5;
  --text: #2B2118; --text-2: #4E3F31; --muted: #85725F;
  --accent: #C2552D; --accent-2: #2F6B4F; --accent-ink: #FFFFFF; --accent-soft: rgba(194,85,45,.10);
  --good: #2F7D4F; --good-soft: rgba(47,125,79,.11);
  --bad: #B83232; --bad-soft: rgba(184,50,50,.09);
  --warn: #A86A0C; --warn-soft: rgba(168,106,12,.12);
  --power: #6D4BB8; --power-soft: rgba(109,75,184,.10);
  --los: #C2410C; --los-soft: rgba(194,65,12,.10);
  --shadow: 0 1px 2px rgba(60,40,20,.05), 0 10px 30px rgba(60,40,20,.06);
  --radius-lg: 18px; --radius: 12px; --radius-sm: 9px;
  color-scheme: light;
}
[data-theme="sand"] h1, [data-theme="sand"] h2, [data-theme="sand"] .brand b, [data-theme="sand"] .stat b,
[data-theme="sand"] .gauge .gv, [data-theme="sand"] .op-name { font-family: "Fraunces", Georgia, serif; font-weight: 600; letter-spacing: -.01em; }
[data-theme="sand"] h1 { font-size: 27px; }
[data-theme="sand"] .sidebar { background: #2B2118; border-right: 0; }
[data-theme="sand"] .sidebar .brand, [data-theme="sand"] .side-foot .who b { color: #F6EEDF; }
[data-theme="sand"] .sidebar .brand small, [data-theme="sand"] .nav-group > span, [data-theme="sand"] .side-foot .who small { color: #B09A80; }
[data-theme="sand"] .nav a { color: #E3D5C0; }
[data-theme="sand"] .nav a svg { color: #A38D72; }
[data-theme="sand"] .nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
[data-theme="sand"] .nav a.on { background: var(--accent); color: #fff; }
[data-theme="sand"] .nav a.on svg { color: #fff; }
[data-theme="sand"] .nav a.on::before { display: none; }
[data-theme="sand"] .sidebar .search input { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); color: #fff; }
[data-theme="sand"] .side-foot { border-color: rgba(255,255,255,.1); }
[data-theme="sand"] .sidebar .icon-btn { border-color: rgba(255,255,255,.14); color: #E3D5C0; }
[data-theme="sand"] .avatar { background: var(--accent); color: #fff; }
[data-theme="sand"] .btn { border-radius: 30px; }
[data-theme="sand"] .stat i { width: 100%; height: 3px; top: auto; bottom: 0; left: 0; border-radius: 0; }

/* ---- C · Aurora: deep indigo, glass cards, violet / pink ---- */
:root[data-theme="aurora"] {
  --bg: #100D26;
  --bg-glow: radial-gradient(900px 600px at 0% 0%, rgba(139,92,246,.22), transparent 60%),
             radial-gradient(800px 500px at 100% 100%, rgba(236,72,153,.14), transparent 60%);
  --surface: rgba(255,255,255,.045); --surface-2: rgba(255,255,255,.06); --surface-3: rgba(255,255,255,.10);
  --line: rgba(255,255,255,.09); --line-soft: rgba(255,255,255,.06);
  --text: #F1EEFF; --text-2: #CFC8F0; --muted: #9A90C4;
  --accent: #A78BFA; --accent-2: #F472B6; --accent-ink: #160C33; --accent-soft: rgba(167,139,250,.16);
  --good: #2DD4BF; --good-soft: rgba(45,212,191,.14);
  --bad: #FB7185; --bad-soft: rgba(251,113,133,.15);
  --warn: #FCD34D; --warn-soft: rgba(252,211,77,.13);
  --power: #F472B6; --power-soft: rgba(244,114,182,.15);
  --los: #FB923C; --los-soft: rgba(251,146,60,.15);
  --shadow: 0 10px 40px rgba(5,0,30,.35);
  --radius-lg: 20px; --radius: 14px; --radius-sm: 10px;
  color-scheme: dark;
}
[data-theme="aurora"] body { font-family: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif; }
[data-theme="aurora"] .card, [data-theme="aurora"] .stat, [data-theme="aurora"] .scroll, [data-theme="aurora"] .sidebar,
[data-theme="aurora"] .mobilebar { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
[data-theme="aurora"] .sidebar { background: rgba(16,13,38,.65); }
[data-theme="aurora"] select option { background: #1B1640; }
[data-theme="aurora"] .btn.primary { background: linear-gradient(135deg, #A78BFA, #F472B6); border: 0; color: #160C33; }
[data-theme="aurora"] .nav a.on { background: linear-gradient(90deg, rgba(167,139,250,.28), rgba(244,114,182,.10)); }
[data-theme="aurora"] .nav a.on::before { background: linear-gradient(#A78BFA, #F472B6); }
[data-theme="aurora"] h1 { font-weight: 700; font-size: 26px; }
[data-theme="aurora"] .stat b { background: linear-gradient(90deg, #fff, #CFC8F0); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- designer panel ---- */
.designer { position: fixed; left: 16px; bottom: 16px; z-index: 80; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 14px 16px 16px; backdrop-filter: blur(18px); }
:root[data-theme="aurora"] .designer { background: #1A153C; }
.designer[hidden] { display: none; }
.dz-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dz-head b { font-size: 15px; white-space: nowrap; } .dz-head .icon-btn { margin-left: auto; font-size: 18px; }
.designer h3 { margin: 12px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.dz-opts { display: grid; gap: 6px; }
.dz-opts button { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.dz-opts button i { grid-row: span 2; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); }
.dz-opts button small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.dz-opts button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.lay { background: var(--surface-3); position: relative; overflow: hidden; }
.lay::before, .lay::after { content: ""; position: absolute; background: var(--muted); opacity: .55; border-radius: 2px; }
.lay-classic::before { left: 6px; right: 6px; top: 6px; height: 5px; } .lay-classic::after { left: 6px; right: 6px; top: 14px; bottom: 6px; opacity: .25; }
.lay-tabs::before { left: 4px; right: 4px; top: 5px; height: 6px; background: var(--accent); opacity: .8; }
.lay-tabs::after { left: 4px; width: 9px; top: 14px; height: 4px; box-shadow: 11px 0 0 var(--muted), 22px 0 0 var(--muted); }
.lay-split::before { left: 4px; top: 4px; bottom: 4px; width: 10px; background: var(--accent); opacity: .8; }
.lay-split::after { left: 17px; right: 4px; top: 4px; bottom: 4px; opacity: .25; }

/* ---- ONU page: shared bits (hidden in classic) ---- */
.onu-side, .onu-strip, .onu-tabs { display: none; }
.onu-strip { grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); gap: 0; margin: -4px 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.onu-strip .f { padding: 10px 12px; min-width: 0; border-right: 1px solid var(--line-soft); }
.onu-strip .f:last-child { border-right: 0; }
.onu-strip .f.st { grid-column: span 2; min-width: 0; }
.onu-strip .f.st .pill { white-space: normal; }
.onu-strip small, .op-facts small { display: block; color: var(--muted); font-size: 11.5px; }
.onu-strip b, .op-facts b { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onu-strip b em, .op-facts b em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 400; }
.onu-strip .pill { font-size: 12px; }
.tab-off { display: none !important; }

/* ---- design 1 · Cockpit (tabs) ---- */
[data-onu="tabs"] .onu-strip { display: grid; position: sticky; top: 8px; z-index: 6; }
[data-onu="tabs"] .onu-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.onu-tabs button { font: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); background: none; border: 0;
  padding: 9px 14px 11px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.onu-tabs button:hover { color: var(--text); }
.onu-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
[data-onu="tabs"] .onu-hero > section:first-child { display: none; }
[data-onu="tabs"] .onu-hero { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { [data-onu="tabs"] .onu-hero { grid-template-columns: 1fr; } }
@media (max-width: 900px) { [data-onu="tabs"] .onu-strip { position: static; } }

/* ---- design 2 · Profile (split) ---- */
[data-onu="split"] .onu-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
[data-onu="split"] .onu-side { display: block; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
[data-onu="split"] .onu-main > .head h1, [data-onu="split"] .onu-main > .head .sub,
[data-onu="split"] .onu-hero > section:first-child { display: none; }
[data-onu="split"] .onu-main > .head { margin-top: 0; }
[data-onu="split"] .onu-hero { grid-template-columns: 1fr 1fr; }
.op-card { padding: 18px; }
.op-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.op-av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 16px;
  background: var(--surface-3); color: var(--text); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--muted); }
.op-av.good { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--good); }
.op-av.bad { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--bad); }
.op-av.power { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--power); }
.op-av.los { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--los); }
.op-name { display: block; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.op-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 14px 0; padding: 14px 0;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.op-facts b { font-size: 15px; }
.op-meta { display: grid; gap: 4px; color: var(--text-2); }
.op-meta .muted { display: inline-block; min-width: 58px; }
.op-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.op-quick form { display: inline; }
.op-nav { display: grid; gap: 2px; margin-top: 12px; }
.op-nav a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px; font-weight: 500; }
.op-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
@media (max-width: 1000px) {
  [data-onu="split"] .onu-layout { grid-template-columns: 1fr; }
  [data-onu="split"] .onu-side { position: static; max-height: none; }
  [data-onu="split"] .op-nav { display: none; }
  [data-onu="split"] .onu-hero { grid-template-columns: 1fr; }
}
html { scroll-padding-top: 16px; }
[data-onu="tabs"] { scroll-padding-top: 90px; }

/* OLT health (temperature / fans / power) + uplink list */
.olth { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.olth:first-of-type { border-top: 0; padding-top: 0; }
.olth-top { margin-bottom: 8px; }
.olth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.olth-grid > div { background: var(--surface-2, rgba(127,127,127,.06)); border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.olth-grid span { display: block; color: var(--muted); font-size: 12px; }
.olth-grid b { display: block; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.olth-grid b.warn { color: var(--warn); } .olth-grid b.bad { color: var(--bad); }
.olth-grid em { display: block; font-style: normal; font-size: 11.5px; color: var(--text-2, var(--muted)); overflow-wrap: anywhere; }
.olth details { margin-top: 8px; } .olth details summary { cursor: pointer; color: var(--accent); }
.upsel select { min-width: 0; flex: 1 1 260px; }
.scroll-x { overflow-x: auto; }
#uplinks tr.sel td { background: var(--good-soft); }
.three > *, .two > * { min-width: 0; }
.upsel select { width: 100%; text-overflow: ellipsis; }
.upsel { flex-wrap: nowrap; }
.fanctl select { width: 100%; max-width: 100%; min-width: 0; flex: 1 1 100%; text-overflow: ellipsis; }

/* PON port capacity */
.cap { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.cap-full { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); font-weight: 600; }
.cap-near { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.caplist { display: flex; flex-wrap: wrap; gap: 8px; }
.caplist .cap { padding: 6px 10px; text-decoration: none; max-width: 100%; overflow-wrap: anywhere; }
.caplist .cap b { font-weight: 600; } .caplist .cap em { font-style: normal; opacity: .8; }
.port .pfull { font-size: 10px; font-weight: 700; color: var(--bad); letter-spacing: .02em; }
.port .pfull.near { color: var(--warn); font-weight: 600; }

/* section tabs (OLT settings pages): one section at a time */
.sec-tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; margin: 0 0 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 720px) { .sec-tabs .sp { display: none; } .sec-tabs button, .sec-tabs a { padding: 8px 9px; font-size: 13.5px; } .os input.n, .vsw input.n { width: 100px; } }
.sec-tabs button, .sec-tabs a { font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; text-decoration: none; }
.sec-tabs button:hover, .sec-tabs a:hover { color: var(--text); }
.sec-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.sec-tabs .n { font-size: 11px; color: var(--muted); margin-left: 4px; }
.sec-tabs .sp { flex: 1; }
[data-sec].sec-off { display: none !important; }

/* ================= top navigation (replaces the side menu) ================= */
.shell { display: block; min-height: auto; }
.main { margin: 0 auto; padding: 20px 24px 40px; max-width: 1560px; }
.topnav { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tn-in { max-width: 1560px; margin: 0 auto; display: flex; align-items: center; gap: 6px; padding: 0 16px; height: 58px; }
.tn-brand { display: flex; align-items: center; gap: 9px; color: var(--text); margin-right: 14px; flex: none; }
.tn-brand:hover { text-decoration: none; }
.tn-brand b { font-size: 18px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.tn-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.tn-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 8px; color: var(--text-2);
  font: inherit; font-size: 14.5px; font-weight: 500; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.tn-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tn-link.on, .tn-dd.on > .tn-link { color: var(--text); background: var(--accent-soft); }
.tn-link .count, .tn-menu .count { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; background: var(--bad); color: #fff; }
.tn-dd { position: relative; }
.tn-menu { display: none; position: absolute; left: 0; top: calc(100% + 6px); min-width: 210px; padding: 6px; z-index: 70;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.35); }
.tn-menu.right { left: auto; right: 0; }
.tn-menu a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.tn-menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tn-dd.open > .tn-menu { display: block; }
@media (hover: hover) and (min-width: 1101px) { .tn-dd:hover > .tn-menu { display: block; } .tn-dd > .tn-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } }
.tn-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tn-who b { display: block; font-size: 14px; } .tn-who small { color: var(--muted); font-size: 12px; }
.tn-right { display: flex; align-items: center; gap: 6px; flex: none; }
.tn-search { position: relative; }
.tn-search input { width: 190px; padding: 7px 10px 7px 30px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 13px; }
.tn-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tn-user .tn-link { padding: 4px; }
.warnbtn { color: var(--warn); border-color: var(--warn); }
.tn-burger { display: none; }
@media (max-width: 1100px) {
  .tn-burger { display: grid; }
  .tn-nav { display: none; position: fixed; left: 0; right: 0; top: 58px; bottom: 0; overflow-y: auto; flex-direction: column; align-items: stretch;
    background: var(--surface); padding: 10px 14px 30px; gap: 2px; }
  body.nav-open .tn-nav { display: flex; }
  .tn-nav .tn-link { width: 100%; justify-content: space-between; padding: 12px 12px; font-size: 15px; }
  .tn-menu { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 6px 12px; background: none; }
  .tn-dd.open > .tn-menu { display: block; }
  .tn-search input { width: 130px; }
  .main { padding: 16px 14px 30px; }
}
@media (max-width: 560px) { .tn-search { display: none; } .tn-brand b { font-size: 16px; } }

/* ================= dashboard tiles ================= */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 4px 0 18px; }
.tile { display: block; border-radius: 14px; overflow: hidden; color: #fff; background: var(--surface); border: 1px solid var(--line); }
.tile:hover { text-decoration: none; transform: translateY(-1px); }
.tile .tt { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 18px 14px; min-height: 108px; }
.tile .tt svg { width: 54px; height: 54px; opacity: .95; flex: none; }
.tile .tt div { text-align: right; }
.tile .tt b { display: block; font-size: 44px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.tile .tt span { display: block; margin-top: 8px; font-size: 15px; opacity: .95; }
.tile .tb { display: flex; justify-content: space-between; gap: 10px; padding: 11px 18px; font-size: 14px; color: var(--text-2); background: var(--surface); }
.tile.t-blue .tt { background: linear-gradient(135deg, #0b5bd3, #0a4fb8); }
.tile.t-green .tt { background: linear-gradient(135deg, #1fb24a, #179a3e); }
.tile.t-grey .tt { background: linear-gradient(135deg, #5b6170, #4a4f5c); }
.tile.t-orange .tt { background: linear-gradient(135deg, #f5a234, #e48f1f); }
.tile.t-orange .tb .w { color: #f5a234; } .tile.t-orange .tb .c { color: #f07a3a; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tiles { gap: 10px; } .tile .tt { min-height: 90px; padding: 12px; } .tile .tt b { font-size: 32px; } .tile .tt svg { width: 38px; height: 38px; } .tile .tb { padding: 9px 12px; font-size: 12.5px; } }
.dash-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dash-row { grid-template-columns: 1fr; } }
.oltlist { display: flex; flex-direction: column; gap: 8px; }
.oltlist a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); background: var(--surface-2); }
.oltlist a:hover { text-decoration: none; border-color: var(--accent); }
.oltlist .r { text-align: right; font-size: 12.5px; color: var(--muted); font-style: italic; }
.oltlist .r .bad { font-style: normal; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 12px; }
.card-h h2 { margin: 0; font-size: 16px; }
.infolist { list-style: none; margin: 0; padding: 0; }
.infolist li { display: flex; gap: 10px; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line-soft, var(--line)); font-size: 13.5px; }
.infolist li em { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dash-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 0 10px; }
.ponblock + .ponblock { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dash-row + .dash-row { margin-top: 16px; }
.dash-row > .card { margin-bottom: 0; }
@media (max-width: 1100px) { .topnav { backdrop-filter: none; background: var(--surface); } }
.ponblock .ports { grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 5px; }
.ponblock .port { min-width: 0; padding: 6px 4px 5px; }
@media (max-width: 1500px) { .ponblock .ports { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.ponblock .slotrow { grid-template-columns: 90px minmax(0, 1fr); }
@media (max-width: 520px) { .tile .tt span { font-size: 13px; } .dash-top { justify-content: space-between; } }
.dash-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-col > .card { margin: 0; }
.outage .og { border-bottom: 1px solid var(--line); padding: 4px 0; }
.outage .og:last-child { border-bottom: 0; }
.outage summary { display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; list-style: none; font-size: 15px; }
.outage summary::-webkit-details-marker { display: none; }
.outage summary::before { content: "▸"; color: var(--muted); font-size: 12px; width: 10px; }
.outage details[open] > summary::before { content: "▾"; }
.outage .okmark { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--good); color: #062; font-size: 12px; font-weight: 700; }
.outage .ok-line { margin: 0 0 8px 34px; color: var(--muted); }
.outage table { margin: 0 0 8px 20px; width: calc(100% - 20px); }
.oi { width: 20px; height: 20px; flex: none; border-radius: 6px; display: inline-block; }
.oi-signal { background: linear-gradient(90deg, var(--good) 0 20%, transparent 20% 30%, var(--good) 30% 50%, transparent 50% 60%, var(--good) 60% 80%, transparent 80%); clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.oi-partial_los { background: var(--warn); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.oi-full_los { background: var(--bad); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.oi-power { background: var(--power, #3b82f6); clip-path: polygon(55% 0, 15% 55%, 45% 55%, 35% 100%, 85% 40%, 55% 40%); }
.oi-na { background: var(--muted); border-radius: 50%; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
details.more { margin: 4px 0 10px; }
details.more > summary { cursor: pointer; color: var(--accent); list-style: none; padding: 4px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { color: var(--muted); }
.sigd > summary { cursor: pointer; padding: 4px 0; list-style: none; }
.sigd > summary::-webkit-details-marker { display: none; }
.sigd > summary::before { content: "▸ "; color: var(--muted); }
.sigd[open] > summary::before { content: "▾ "; }
.sigd table { margin: 6px 0 4px 14px; width: calc(100% - 14px); }
.dash-top .sp { flex: 1; }
.olt-chip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.oltlist a.sel { border-color: var(--accent); background: var(--accent-soft); }
.tile .tb a { color: inherit; text-decoration: none; } .tile .tb a:hover { text-decoration: underline; }
