:root {
  color-scheme: light;
  --page: #f2f5f8;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --ink: #212529;
  --ink-2: #495057;
  --muted: #868e96;
  --grid: #e7eaee;
  --axis: #ced4da;
  --border: #dde2e7;
  --accent: #1a6fd6;
  --accent-ink: #ffffff;
  --accent-wash: rgba(26, 111, 214, 0.10);
  --series-1: #1f77d6;
  --series-2: #f08c1a;
  --good: #2bb130;
  --warning: #f5a623;
  --serious: #f08c1a;
  --critical: #e5483b;
  --neutral: #8e959c;
  --success-text: #1d8a22;
  --danger-text: #c8372b;
  --phead: #4b4b4b;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #17191c;
    --surface: #23262a;
    --surface-2: #2c3035;
    --ink: #e9ecef;
    --ink-2: #bfc5cc;
    --muted: #8e959c;
    --grid: #343940;
    --axis: #4a5058;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #4b93e6;
    --accent-wash: rgba(75, 147, 230, 0.16);
    --series-1: #4b93e6;
    --series-2: #f39a3a;
    --neutral: #6c737a;
    --success-text: #43c548;
    --danger-text: #f07b70;
    --phead: #3a3e44;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #17191c;
  --surface: #23262a;
  --surface-2: #2c3035;
  --ink: #e9ecef;
  --ink-2: #bfc5cc;
  --muted: #8e959c;
  --grid: #343940;
  --axis: #4a5058;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #4b93e6;
  --accent-wash: rgba(75, 147, 230, 0.16);
  --series-1: #4b93e6;
  --series-2: #f39a3a;
  --neutral: #6c737a;
  --success-text: #43c548;
  --danger-text: #f07b70;
  --phead: #3a3e44;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
h1 { font-size: 20px; font-weight: 600; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; font-size: 15px; padding: 4px 10px 18px; }
.brand svg { color: var(--accent); }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 8px 10px; border-radius: 8px;
  font-weight: 500; text-decoration: none; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, 0.10); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav .count { margin-left: auto; background: var(--warning); color: #0b0b0b; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7d7c76; padding: 14px 10px 4px; }
.side { overflow-y: auto; }
.side .foot a { display: inline-flex; align-items: center; gap: 5px; }
.side .foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); border-top: 1px solid rgba(255,255,255,.08); }
.side .foot a { color: var(--side-ink); }
.main { padding: 22px 28px 40px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head .sub { color: var(--muted); font-size: 13px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; }
.card.flush > h2 { padding: 14px 18px 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g2, .g3, .g-main { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .app { grid-template-columns: 1fr; } .side { position: static; height: auto; } .main { padding: 16px; } }
.stack > * + * { margin-top: 16px; }

/* ------------------------------------------------------------ tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  display: block; color: inherit; text-decoration: none; box-shadow: var(--shadow); }
a.tile:hover { text-decoration: none; border-color: var(--axis); }
.tile .label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tile .value { font-size: 26px; font-weight: 600; margin-top: 4px; }
.tile .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hero .value { font-size: 48px; line-height: 1.05; }

/* ------------------------------------------------------------ status */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--neutral); }
.dot.good, .dot.online { background: var(--good); }
.dot.warning, .dot.registering { background: var(--warning); }
.dot.serious, .dot.dying_gasp, .dot.high { background: var(--serious); }
.dot.critical, .dot.los, .dot.auth_failed { background: var(--critical); }
.dot.offline, .dot.unknown, .dot.none { background: var(--neutral); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px;
  font-weight: 550; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; color: var(--ink); }
.sig { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sig .glyph { font-size: 11px; width: 12px; text-align: center; color: var(--ink-2); }

/* ------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--grid);
  white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tr.link { cursor: pointer; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.name-cell { font-weight: 550; }
.name-cell small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ forms */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--axis);
  border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, .chart:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; }
textarea.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; min-height: 260px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form { grid-template-columns: 1fr; } }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
label.f input, label.f select { width: 100%; }
label.f .help { font-weight: 400; color: var(--muted); font-size: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 550; font-size: 13px; padding: 7px 13px;
  border-radius: 8px; border: 1px solid var(--axis); background: var(--surface); color: var(--ink); cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger-text); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn .spin { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 12px; font-weight: 550; padding: 4px 10px; border: 0; background: var(--surface);
  color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--axis); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-wash); color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface);
  display: flex; gap: 10px; align-items: flex-start; }
.flash.ok { box-shadow: inset 3px 0 0 var(--good); }
.flash.error { box-shadow: inset 3px 0 0 var(--critical); }
.flash.warn { box-shadow: inset 3px 0 0 var(--warning); }
.flash .ico { font-weight: 700; }
pre.out { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto;
  max-height: 420px; white-space: pre-wrap; margin: 0; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 12.5px; }
dl.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px 14px; font-size: 13px; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); align-items: baseline; }
.events li:last-child { border-bottom: 0; }
.events .when { color: var(--muted); font-size: 12px; white-space: nowrap; width: 72px; flex: none; }
.events .msg { min-width: 0; overflow-wrap: anywhere; }
.bar { height: 8px; border-radius: 999px; background: var(--grid); overflow: hidden; display: flex; gap: 2px; min-width: 80px; }
.bar > span { display: block; height: 100%; border-radius: 999px; }

/* ------------------------------------------------------------ login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 360px; }
.login .brand { color: var(--ink); justify-content: center; font-size: 18px; }
.login form { display: grid; gap: 12px; }
.login input { width: 100%; }

/* ------------------------------------------------------------ charts */
.chart { position: relative; width: 100%; outline: none; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .wash { fill: var(--accent); opacity: 0.10; }
.chart .thr { stroke-width: 1; }
.chart .thr-label { font-size: 11px; fill: var(--ink-2); }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.chart .marker { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .end-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.chart .strip-label { font-size: 11px; fill: var(--muted); }
.chart.loading { opacity: .45; transition: opacity .15s; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); font-size: 12px; min-width: 130px; z-index: 5; white-space: nowrap; }
.tip .v { font-size: 14px; font-weight: 650; color: var(--ink); }
.tip .k { color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tip .k i { display: inline-block; width: 12px; height: 2px; background: var(--accent); border-radius: 1px; }
.tip .t { color: var(--muted); margin-top: 3px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }
.legend .lk { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }
.chart-empty { padding: 40px 0; text-align: center; color: var(--muted); }
.chart-table { max-height: 320px; overflow: auto; margin-top: 8px; }

/* ------------------------------------------------------------ ações em lote */
.batchbar { position: sticky; bottom: 12px; margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--axis); border-radius: var(--radius); padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); z-index: 10; }
.batchbar .sep { width: 1px; height: 22px; background: var(--grid); }
.batchbar select, .batchbar input { padding: 4px 8px; font-size: 12.5px; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 18px 20px;
  max-width: 460px; width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.ports { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.port { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--surface-2); min-height: 62px; }
.port .pn { font-size: 11px; color: var(--muted); font-weight: 600; }
.port.free { background: transparent; border-style: dashed; }
.port a { font-weight: 550; }
.kpi-row { display: flex; gap: 18px; flex-wrap: wrap; }
.kpi-row div { min-width: 90px; }
.kpi-row .v { font-size: 20px; font-weight: 600; }

/* ------------------------------------------------------------ mapa */
.map-wrap { height: calc(100vh - 210px); min-height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
#map { height: 100%; width: 100%; background: var(--surface-2); }
.olt-ico { background: var(--ink); color: var(--surface); font-size: 10px; font-weight: 700; border-radius: 4px; text-align: center;
  line-height: 20px; box-shadow: 0 0 0 2px var(--surface); }
.leaflet-popup-content { color: #0b0b0b; }

/* ------------------------------------------------------------ formulário horizontal (autorização) */
.auth-card { max-width: 1000px; padding: 22px 24px; }
.hform { display: grid; grid-template-columns: 200px minmax(0, 720px); gap: 12px 20px; align-items: center; }
.hform > label.l { text-align: right; font-weight: 600; font-size: 13px; color: var(--ink-2); display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.hform input:not([type=checkbox]):not([type=radio]), .hform select, .hform textarea { width: 100%; padding: 9px 11px; }
.hform .inline { display: flex; gap: 8px; align-items: center; }
.hform .inline input, .hform .inline select { width: auto; }
.hform .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hform .radios { display: flex; gap: 20px; align-items: center; min-height: 36px; }
.hform .hidden { display: none !important; }
.usage { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.usage .bar { width: 170px; min-width: 120px; }
.pill-free { background: rgba(12, 163, 12, .12); color: var(--success-text); padding: 1px 8px; border-radius: 6px; font-weight: 600; }
.btn.success { background: #117a11; border-color: #117a11; color: #fff; }
.btn.success:hover { filter: brightness(1.06); }
@media (max-width: 760px) { .hform { grid-template-columns: 1fr; } .hform > label.l { justify-content: flex-start; } }
.olt-group { margin-bottom: 26px; }
.olt-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 3px 6px; }
details.multi { position: relative; }
details.multi > summary { list-style: none; }
details.multi > summary::-webkit-details-marker { display: none; }
.multi-pop { position: absolute; top: 38px; left: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.12); display: grid; gap: 6px; min-width: 240px; }


/* ============================================================ layout com menu no topo */
body { font-size: 14px; }
.topnav { background: #262b31 linear-gradient(90deg, #1d2329 0%, #2b333c 55%, #1f2a36 100%); background-size: cover;
  background-position: center; color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.tn-in { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 22px; padding: 0 24px; min-height: 58px; }
.tn-brand { color: #fff; font-size: 19px; font-weight: 500; display: flex; align-items: center; gap: 10px; text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55); white-space: nowrap; }
.tn-brand:hover { text-decoration: none; }
.tn-brand img { height: 34px; width: auto; }
.tn-menu { display: flex; align-items: stretch; flex-wrap: wrap; }
.tn-menu > a, .tn-menu .dd > button { color: #fff; font: inherit; font-size: 15px; padding: 18px 11px; background: none; border: 0;
  cursor: pointer; text-decoration: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.tn-menu > a:hover, .tn-menu .dd > button:hover, .tn-menu > a.on, .tn-menu .dd.on > button { background: rgba(255, 255, 255, .13); text-decoration: none; }
.tn-menu .car { font-size: 11px; opacity: .9; }
.tn-menu .count, .tn-in .count { background: var(--warning); color: #1b1b1b; font-size: 11px; font-weight: 700; padding: 1px 7px;
  border-radius: 999px; text-shadow: none; }
.dd { position: relative; display: flex; }
.dd-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--surface); min-width: 230px; border: 1px solid var(--border);
  border-radius: 4px; box-shadow: 0 8px 22px rgba(0, 0, 0, .2); padding: 6px 0; z-index: 60; }
.dd:hover .dd-menu, .dd:focus-within .dd-menu { display: block; }
.dd-menu a { display: block; padding: 8px 18px; color: var(--ink); text-decoration: none; font-size: 14px; }
.dd-menu a:hover { background: var(--surface-2); text-decoration: none; }
.tn-icons { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.tn-icons a, .tn-icons button { color: #fff; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 15px; text-decoration: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); padding: 6px 0; }
.page { max-width: 1340px; margin: 0 auto; padding: 18px 24px 30px; }
.pagefoot { text-align: center; color: var(--muted); font-size: 12px; padding: 6px 0 24px; }
@media (max-width: 900px) { .tn-in { flex-wrap: wrap; padding: 8px 14px; gap: 8px; } .tn-menu > a, .tn-menu .dd > button { padding: 10px 8px; }
  .page { padding: 14px; } }

/* botões no padrão de cores operacional */
.btn { border-radius: 4px; }
.btn.primary { background: #1767d4; border-color: #1767d4; color: #fff; }
.btn.success { background: #24a82b; border-color: #24a82b; color: #fff; }
.btn.warning { background: #f39c12; border-color: #f39c12; color: #fff; }
.btn.yellow { background: #f2b705; border-color: #f2b705; color: #fff; }
.btn.red { background: #e5483b; border-color: #e5483b; color: #fff; }
.btn.gray { background: #95a0a8; border-color: #95a0a8; color: #fff; }
.btn.primary:hover, .btn.success:hover, .btn.warning:hover, .btn.yellow:hover, .btn.red:hover, .btn.gray:hover { filter: brightness(1.07); }
th { background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: 13.5px; }
a { color: var(--accent); }

/* cartões com cabeçalho escuro */
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-width: 0; }
.pcard > .ph { background: var(--phead); color: #fff; padding: 11px 16px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.pcard > .ph .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.pcard > .ph a, .pcard > .ph select { color: #fff; }
.pcard > .ph select { background: transparent; border-color: rgba(255, 255, 255, .35); padding: 3px 6px; font-size: 13px; }
.pcard > .ph select option { color: #111; }
.pcard > .pb { padding: 14px 16px; }
.pcard > .pb.flush { padding: 0; }

/* painel: blocos coloridos */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; margin-bottom: 12px; }
@media (max-width: 1050px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
.stile { border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); display: block;
  color: inherit; text-decoration: none; }
.stile:hover { text-decoration: none; filter: brightness(1.02); }
.stile .top { color: #fff; display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 16px 12px; min-height: 98px; }
.stile .top svg { width: 58px; height: 58px; flex: none; }
.stile .num { font-size: 40px; line-height: 1.15; text-align: right; }
.stile .lbl { font-size: 16px; text-align: right; }
.stile .bot { display: flex; justify-content: space-between; gap: 8px; padding: 11px 16px; font-size: 15px; flex-wrap: wrap; }
.stile.blue .top { background: #1b6fd4; } .stile.blue .bot { color: #1b6fd4; }
.stile.green .top { background: #29b130; } .stile.green .bot { color: #1d9a24; }
.stile.dark .top { background: #4b4b4b; } .stile.dark .bot { color: var(--ink-2); }
.stile.orange .top { background: #f5a623; } .stile.orange .bot { color: #df8b07; }
.stile .bot .crit { color: #e5483b; }
.upd { display: flex; justify-content: flex-end; align-items: center; gap: 12px; color: var(--ink-2); font-size: 13.5px; margin: 0 0 14px; }
.upd .sep { width: 1px; height: 16px; background: var(--axis); }
.upd .clock { border: 1px solid var(--axis); border-radius: 4px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.olt-list { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow: auto; }
.olt-list li { border: 1px solid var(--grid); border-radius: 4px; margin: 8px 12px; padding: 9px 12px; }
.olt-list .nm { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.olt-list .meta { text-align: right; color: var(--ink-2); font-style: italic; font-size: 13px; }

/* ícones de status e de sinal */
.sti { display: inline-flex; vertical-align: middle; }
.sigb { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sigb small { font-size: 10px; color: var(--muted); }
.mode-b { display: inline-block; background: #2c3e50; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.mode-b.bridge { background: #5a6570; }
.flt { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 10px; }
.flt label.fl { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; }
.flt select, .flt input { padding: 8px 10px; min-width: 110px; }
.tgl { display: inline-flex; border: 1px solid var(--axis); border-radius: 4px; overflow: hidden; }
.tgl a { padding: 6px 10px; border-right: 1px solid var(--axis); display: inline-flex; align-items: center; background: var(--surface); color: var(--ink); text-decoration: none; }
.tgl a:last-child { border-right: 0; }
.tgl a.on { background: var(--accent-wash); box-shadow: inset 0 -2px 0 var(--accent); }
.pagin { display: inline-flex; border: 1px solid var(--axis); border-radius: 4px; overflow: hidden; }
.pagin a, .pagin span { padding: 6px 12px; border-right: 1px solid var(--axis); color: var(--accent); text-decoration: none; background: var(--surface); }
.pagin a:last-child, .pagin span:last-child { border-right: 0; }
.pagin .on { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.btn.view { background: #1767d4; border-color: #1767d4; color: #fff; padding: 7px 16px; font-size: 14.5px; }

/* página da ONU */
.onu-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .onu-top { grid-template-columns: 1fr; } }
dl.kvr { display: grid; grid-template-columns: 190px 1fr; gap: 5px 14px; margin: 0; }
dl.kvr dt { text-align: right; font-weight: 700; color: var(--ink); }
dl.kvr dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.kvr dd.empty-v { color: var(--muted); font-style: italic; }
.devbox { border: 2px solid var(--ink); border-radius: 6px; display: flex; align-items: center; gap: 18px; padding: 10px 18px; width: fit-content;
  margin: 0 auto 14px; background: var(--surface); }
.devbox .mode { font-size: 38px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.rxbox { display: inline-flex; gap: 8px; border: 1px solid var(--border); border-radius: 4px; padding: 6px; }
.rxbox > div { border: 1px solid var(--grid); border-radius: 4px; padding: 5px 10px; min-width: 130px; }
.rxbox .t { font-size: 12px; color: var(--ink-2); }
.rxbox .v { font-size: 20px; font-weight: 700; }
.rxbox .v small { font-size: 12px; font-weight: 400; color: var(--ink-2); }
.gauge { position: relative; height: 4px; border-radius: 2px; margin: 4px 0 2px;
  background: linear-gradient(90deg, #e5483b 0%, #e5483b 18%, #f5a623 30%, #2bb130 45%, #2bb130 85%, #f5a623 100%); }
.gauge i { position: absolute; top: -4px; width: 3px; height: 12px; background: var(--ink); border-radius: 1px; }
.st-badge { display: inline-flex; align-items: center; gap: 6px; color: #fff; border-radius: 4px; padding: 2px 9px; font-weight: 700; font-size: 13.5px; }
.st-badge.online { background: #29b130; } .st-badge.los { background: #e5483b; } .st-badge.dying_gasp { background: #f08c1a; }
.st-badge.offline, .st-badge.unknown { background: #7d858c; } .st-badge.registering { background: #f5a623; }
.sec-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; margin-top: 16px; align-items: start; }
.sec-row > .lab { text-align: right; font-weight: 700; padding-top: 8px; }
@media (max-width: 760px) { .sec-row, dl.kvr { grid-template-columns: 1fr; } .sec-row > .lab, dl.kvr dt { text-align: left; } }
.brand-preview { display: inline-flex; align-items: center; justify-content: center; background: #2b333c; border-radius: 4px; padding: 6px 10px; }
.brand-preview img { height: 34px; }
.brand-preview.wide { width: 260px; height: 46px; background-size: cover; background-position: center; }

/* abas da OLT e painel de saúde */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 10px 16px; color: var(--accent); text-decoration: none; border: 1px solid transparent; border-bottom: 0;
  border-radius: 4px 4px 0 0; margin-bottom: -1px; font-size: 14.5px; }
.tabs a:hover { background: var(--surface-2); }
.tabs a.on { color: var(--ink); background: var(--surface); border-color: var(--border); }
.tabs .count { background: var(--warning); color: #1b1b1b; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.olt-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .olt-grid { grid-template-columns: 1fr; } }
.health-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.health-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--grid); gap: 10px; }
.health-list li:last-child { border-bottom: 0; }
.health-list li.sub { padding-left: 30px; font-size: 13.5px; }
.health-list span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
pre.diff .add { color: var(--success-text); } pre.diff .del { color: var(--danger-text); } pre.diff .hdr { color: var(--accent); }
