/* FlexiHTV Gateway — painel de operação inspirado num rack de headend.
   Visual da marca FlexiHTV: fundo claro, cabeçalho em ardósia com o logótipo branco e o âmbar (#f59e0b) como acento.
   Sem recursos externos (a letra DM Sans e o logótipo vão com o gateway): tem de funcionar numa rede de hotel isolada. */

@font-face {
  font-family: "DM Sans"; font-style: normal; font-display: swap; font-weight: 100 1000;
  src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans"; font-style: normal; font-display: swap; font-weight: 100 1000;
  src: url("fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


:root {
  --paper: #f8f8f6;  /* fundo quase branco, com um toque quente */
  --panel: #ffffff;
  --steel: #efede8;
  --edge: #e3e0d9;
  --ink: #1d2433;  /* ardósia (do site da Flexispectrum) */
  --ink-soft: #5e6676;
  --brand: #f59e0b;  /* âmbar FlexiHTV: acentos, seleção, botão principal */
  --brand-ink: #9a5800;  /* âmbar escuro: texto e ligações (contraste AA sobre branco) */
  --amber: #f59e0b;
  --lcd: #1d2433;
  --lcd-ink: #ffc24d;
  --lcd-dim: #5b6576;
  --ok: #178a5d;
  --warn: #c2410c;  /* avisos em laranja, para não se confundirem com o âmbar da marca */
  --bad: #c23b3b;
  --focus: #b45309;
  --radius: 8px;
  --font: "DM Sans", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Roboto, "Noto Sans", system-ui, sans-serif;
  --warn-fill: #f97316;
  --head-bg: #1d2433;  /* cabeçalho escuro */
  --head-ink: #ffffff;
  --head-soft: #b4bccb;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 0.95rem; }
a { color: var(--brand-ink); }
.grow { flex: 1; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
[hidden] { display: none !important; }

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

/* ---------- cabeçalho ---------- */
.top {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--ink); color: #eaf1f7;
  border-bottom: 4px solid var(--brand);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; }
#nav { display: flex; gap: 4px; }
#nav a {
  color: #c4d3e2; text-decoration: none; padding: 8px 12px; border-radius: var(--radius);
}
#nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
#nav a[aria-current="page"] { background: var(--brand); color: #fff; }
.nav-badge { display: inline-block; min-width: 1.4em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--amber); color: #3b2500; font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 1.5; }
.nav-badge-bad { background: var(--bad); color: #fff; }
.top-meta { margin-left: auto; color: #9fb4c8; font-size: 0.85rem; }

.banner { padding: 10px 24px; font-weight: 600; }
.banner-bad { background: var(--bad); color: #fff; }

main { max-width: 1480px; margin: 0 auto; padding: 22px 24px 60px; }
.view > * + *, #painel-body > * + *, #sistema-body > * + * { margin-top: 20px; }

/* ---------- botões e campos ---------- */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 7px 14px; border-radius: var(--radius);
  border: 1px solid var(--edge); background: var(--panel); color: var(--ink);
}
.btn:hover { border-color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand-ink); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
a.btn { text-decoration: none; display: inline-block; }
.btn-small { padding: 3px 9px; font-size: 0.85rem; font-weight: 550; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  font: inherit; color: var(--ink);
  padding: 7px 9px; border: 1px solid var(--edge); border-radius: var(--radius); background: #fff;
  min-width: 0; max-width: 100%;
}
input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--brand); }
textarea { width: 100%; font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 0.82rem; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar input[type="search"] { flex: 1 1 260px; max-width: 420px; }

.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: var(--steel); color: var(--ink);
}
.chip-amber { background: var(--amber); color: #3b2500; }
.chip-blue { background: #cfe3f5; color: var(--brand-ink); }
.chip-link { cursor: pointer; border: 1px solid transparent; font-family: inherit; }
.chip-link:hover { border-color: var(--brand); }

/* ---------- Canais: Ativos / Disponíveis ---------- */
.seg { display: inline-flex; border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.seg button { font: inherit; font-weight: 600; padding: 7px 14px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--edge); }
.seg button:hover { background: #e6eef6; }
.seg button[aria-selected="true"] { background: var(--brand); color: #fff; }
.seg .count { font-weight: 500; opacity: .85; }
.av-input > * + * { margin-top: 12px; }
.av-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.av-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
th.chk, td.chk { width: 34px; padding-right: 0; }
tbody tr.sel td { background: #e6f0fa; }
.mono { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; }
.av-act td { vertical-align: top; }
.av-act input[data-f="name"] { width: 100%; min-width: 180px; }
.av-act .biss-key { margin-top: 6px; width: 100%; }
.spin { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 6px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: spin 0.8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- indicadores (LED + texto) ---------- */
.led { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; white-space: nowrap; }
.led::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--lc, var(--edge)); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--lc, var(--edge));
}
.led-ok { --lc: var(--ok); }
.led-warn { --lc: var(--amber); color: var(--warn); }
.led-bad { --lc: var(--bad); color: var(--bad); }
.led-idle { --lc: #8aa0b4; color: var(--ink-soft); font-weight: 500; }
.led-start { --lc: var(--brand); color: var(--brand-ink); }
@media (prefers-reduced-motion: no-preference) {
  .led-bad::before { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes pulse { 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(194,59,59,.25); } }

/* ---------- painel: resumo ---------- */
.summary { display: flex; flex-wrap: wrap; gap: 28px 44px; align-items: flex-end; }
.stat strong { display: block; font-size: 2rem; line-height: 1.05; font-weight: 650; }
.stat span { color: var(--ink-soft); font-size: 0.88rem; }
.stat-bad strong { color: var(--bad); }
.stat-ok strong { color: var(--ok); }

.alerts { display: grid; gap: 8px; }
.alert {
  padding: 9px 12px; border-radius: var(--radius); background: #fdeaea; border-left: 4px solid var(--bad);
}
.alert-warn { background: #fff4de; border-left-color: var(--amber); }

/* ---------- o rack ---------- */
.rack-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.rack {
  display: grid; gap: 8px;
  grid-template-columns: repeat(2, 1fr);
  padding: 14px 26px;
  background:
    radial-gradient(circle at 10px 12px, #8d9eaf 2.2px, transparent 3px) 0 0 / 20px 28px repeat-y,
    radial-gradient(circle at calc(100% - 10px) 12px, #8d9eaf 2.2px, transparent 3px) 100% 0 / 20px 28px repeat-y,
    linear-gradient(90deg, var(--steel), #dfe6ed 8%, #dfe6ed 92%, var(--steel));
  border: 1px solid var(--edge); border-radius: 8px;
}
@media (min-width: 720px) { .rack { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .rack { grid-template-columns: repeat(8, 1fr); } }

.slot {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 5px;
  padding: 8px 9px 9px; display: grid; gap: 6px; min-width: 0;
  box-shadow: 0 1px 0 #fff inset;
}
.slot:hover { border-color: var(--brand); }
.slot-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.82rem; font-weight: 650; }
.slot-top .led { font-weight: 650; }
.lcd {
  background: var(--lcd); color: var(--lcd-ink); border-radius: 3px; padding: 4px 8px;
  display: flex; align-items: baseline; justify-content: flex-end; gap: 5px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.55);
}
.lcd b { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.02em; }
.lcd i { font-style: normal; font-size: 0.7rem; color: #c99a3b; }
.lcd.off b { color: var(--lcd-dim); }
.lcd.off i { color: var(--lcd-dim); }
.slot-name { font-size: 0.8rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.2em; }
.slot-free { opacity: .75; }
.slot-err { border-color: var(--bad); }

/* ---------- sinal dos tuners (painel e entradas) ---------- */
.sig { display: grid; gap: 3px; font-size: 0.74rem; min-width: 0; }
.sig-head { display: flex; justify-content: space-between; gap: 6px; font-weight: 650; color: var(--ink-soft); }
.st-ok { color: var(--ok); } .st-warn { color: var(--warn); } .st-bad { color: var(--bad); }
.st-start { color: var(--brand-ink); } .st-idle { color: var(--ink-soft); font-weight: 500; }
.sm { display: grid; grid-template-columns: 2.7em minmax(0, 1fr) auto; align-items: center; gap: 5px; }
.sm-l { color: var(--ink-soft); }
.sm-bar { position: relative; height: 6px; border-radius: 3px; background: #dbe3ea; }
.sm-bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.sm-bar i.ok { background: var(--ok); }
.sm-bar i.warn { background: var(--amber); }
.sm-bar i.bad { background: var(--bad); }
.sm-bar .tick { position: absolute; top: -2px; width: 2px; height: 10px; background: var(--ink); opacity: .5; }
.sm-v { min-width: 4.4em; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sig-off .sm-v { color: var(--ink-soft); font-weight: 500; }
.sig-cell { min-width: 210px; }
.sig-btn { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; border-radius: 4px; padding: 3px 4px; margin: -3px -4px; font-size: 0.9rem; }
.sig-btn:hover { background: #e3edf6; }
.sig-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.sig-btn .sig { font-size: 0.8rem; }
.chip-ok { background: #d5efe3; color: #0e5a3b; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 16px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; font-weight: 600; }
.spark { display: block; width: 100%; height: 64px; background: #f3f7fb; border: 1px solid var(--edge); border-radius: 4px; }
.sp-line { fill: none; stroke: var(--brand); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.sp-grid { stroke: var(--edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sp-warn { stroke: var(--amber); stroke-width: 1.2; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.spark-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--ink-soft); margin: 2px 0 12px; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); }
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; vertical-align: middle; }
th { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--edge); background: #eef2f6; white-space: nowrap; }
tbody tr + tr td { border-top: 1px solid #e1e8ee; }
tbody tr:hover td { background: #f0f5fa; }
td.num { text-align: right; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.name { font-weight: 600; }
.sub { color: var(--ink-soft); font-size: 0.82rem; }
.meter { width: 90px; height: 6px; background: var(--steel); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.meter i { display: block; height: 100%; background: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

.empty { padding: 36px 24px; text-align: center; background: var(--panel); border: 1px dashed var(--edge); border-radius: var(--radius); }
.empty h2 { margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- sistema ---------- */
.cols { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .cols { grid-template-columns: 1fr 1fr; } }
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 16px 18px; }
.card > * + * { margin-top: 12px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.cmd { background: var(--lcd); color: #d7e6f5; padding: 10px 12px; border-radius: 4px; overflow-x: auto; font: 0.8rem/1.5 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.cmd-title { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }

/* ---------- sessão e papéis ---------- */
.role-operador .need-tech, .role-operador .need-admin, .role-tecnico .need-admin { display: none !important; }
.user-box { display: flex; align-items: center; gap: 8px; color: #c4d3e2; font-size: 0.85rem; }
.user-box .who strong { color: #fff; }
.user-box .muted { color: #9fb4c8; }
.btn-ghost { background: transparent; color: #c4d3e2; border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { color: #fff; border-color: #fff; }
.login { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(160deg, var(--ink) 0%, #16395a 100%); }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; padding: 26px 26px 24px; background: var(--panel);
  border-radius: 10px; border-top: 4px solid var(--amber); box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.login-card .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.login-card h1 { margin: 0; font-size: 1.3rem; }
.login-card .btn { justify-self: stretch; padding: 9px 14px; }
.roles-help { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.audit-wrap { max-height: 420px; overflow-y: auto; }

/* ---------- alertas ---------- */
h2.sec { font-size: 1.05rem; margin: 18px 0 8px; }
.empty-ok { padding: 14px 16px; background: var(--panel); border: 1px dashed var(--edge); border-radius: var(--radius); }
td.nowrap, .nowrap { white-space: nowrap; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
code { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; background: #e6edf4; padding: 0 4px; border-radius: 3px; }

/* ---------- número de canal ---------- */
td.chno { font-weight: 700; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.av-act .num-in { width: 5.5em; }
ul.tight { margin: 4px 0 0; padding-left: 18px; }
.lab.small { display: block; font-weight: 600; margin-bottom: 4px; }

/* ---------- versões ---------- */
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.versions .v-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.versions ul { margin: 4px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- diálogo ---------- */
dialog {
  border: 1px solid var(--edge); border-radius: 8px; padding: 0; width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px); background: var(--panel); color: var(--ink);
  box-shadow: 0 18px 50px rgba(8, 24, 40, .35);
}
dialog::backdrop { background: rgba(10, 28, 46, .5); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--edge); background: #eef2f6; }
.dlg-body { padding: 16px 20px; overflow-y: auto; max-height: calc(100vh - 190px); display: grid; gap: 14px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--edge); background: #eef2f6; }
.form-grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.field { display: grid; gap: 4px; align-content: start; }
.field > label, .field > span.lab { font-size: 0.85rem; font-weight: 600; }
.field .hint { font-size: 0.78rem; color: var(--ink-soft); }
.field.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.out-row { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--edge); border-radius: var(--radius); background: #fff; }
.out-row .row-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.form-error { background: #fdeaea; border-left: 4px solid var(--bad); padding: 9px 12px; border-radius: var(--radius); }
.form-error ul { margin: 4px 0 0; padding-left: 18px; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius); font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 20;
}

/* ---------- marca FlexiHTV (cabeçalho, acentos, superfícies) ---------- */
.top { gap: 18px; padding: 10px 20px; }
#nav { gap: 2px; }
#nav a { padding: 8px 11px; }
.top-meta { font-size: 0.8rem; white-space: nowrap; }
.user-box { white-space: nowrap; }
@media (max-width: 1359px) { .top-meta { display: none; } }
@media (max-width: 1279px) { .user-box .muted { display: none; } }
@media (max-width: 719px) { #nav { flex-wrap: wrap; } .logo { width: 90px; height: 30px; } }
/* ---------- cabeçalho com o logótipo ---------- */
.top {
  background: var(--head-bg); color: var(--head-ink);
  border-bottom: 3px solid var(--amber);
  box-shadow: 0 1px 0 rgba(29, 36, 51, .06);
}
.logo {
  display: inline-block; width: 104px; height: 35px; flex: none;
  -webkit-mask: url("flexihtv-logo.png") no-repeat center / contain;
          mask: url("flexihtv-logo.png") no-repeat center / contain;
  background: #ffffff;  /* logótipo original, branco */
}
.brand { gap: 12px; font-weight: 600; }
#site-name {
  padding-left: 12px; border-left: 1px solid rgba(255,255,255,.18); color: var(--head-soft); font-weight: 600;
}
#site-name { border-left-color: rgba(255,255,255,.18); }
#nav a { color: var(--head-soft); font-weight: 600; }
#nav a:hover { background: rgba(245, 158, 11, .14); color: var(--head-ink); }
#nav a { border-radius: 6px; box-shadow: inset 0 -2px 0 transparent; }
#nav a[aria-current="page"] { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 -3px 0 var(--amber); }
.top-meta { color: var(--head-soft); }
.user-box { color: var(--head-soft); }
.user-box .who strong { color: var(--head-ink); }
.user-box .muted { color: var(--head-soft); }
.btn-ghost { color: var(--head-soft); border-color: rgba(255,255,255,.25); }
.btn-ghost { border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { color: var(--head-ink); border-color: var(--amber); }

/* ---------- botões, campos, chips ---------- */
.btn { border-radius: var(--radius); }
.btn:hover { border-color: var(--amber); }
.btn-primary { background: var(--amber); border-color: #d98a06; color: #1d2433; }
.btn-primary:hover { background: #e89307; }
input, select, textarea { border-radius: 6px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(245, 158, 11, .25);
}
.chip-amber { background: #fde7b8; color: #6b3d00; }
.chip-blue { background: #fdf0d5; color: #7a4600; }
.chip-link:hover { border-color: var(--amber); }
.nav-badge { background: var(--warn-fill); color: #fff; }
.seg button:hover { background: #fbf3e4; }
.seg button[aria-selected="true"] { background: var(--amber); color: #1d2433; }
tbody tr.sel td { background: #fdf3df; }

/* ---------- indicadores ---------- */
.led-warn { --lc: var(--warn-fill); }
.led-idle { --lc: #a3a9b5; }
.led-start { --lc: var(--amber); }
.alert-warn { background: #fff1e6; border-left-color: var(--warn-fill); }
.sm-bar { background: #ebe9e3; }
.sm-bar i.warn { background: var(--warn-fill); }
.sig-btn:hover { background: #fbf3e4; }
.spark { background: #fbf9f5; }
.sp-warn { stroke: var(--warn-fill); }

/* ---------- rack dos tuners ---------- */
.rack {
  background:
    radial-gradient(circle at 10px 12px, #c3bdb2 2.2px, transparent 3px) 0 0 / 20px 28px repeat-y,
    radial-gradient(circle at calc(100% - 10px) 12px, #c3bdb2 2.2px, transparent 3px) 100% 0 / 20px 28px repeat-y,
    linear-gradient(90deg, var(--steel), #f5f4f0 8%, #f5f4f0 92%, var(--steel));
  border-radius: 10px;
}
.slot { border-radius: 7px; box-shadow: 0 1px 2px rgba(29, 36, 51, .05); }
.slot:hover { border-color: var(--amber); }
.lcd i { color: #d6a64a; }

/* ---------- tabelas, cartões, diálogos ---------- */
.table-wrap, .card {
  border-radius: 10px; box-shadow: 0 1px 2px rgba(29, 36, 51, .05);
}
th { background: #fbfbf9; }
tbody tr + tr td { border-top-color: #eee8de; }
tbody tr:hover td { background: #fbfaf7; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 4px; height: 1em; border-radius: 2px; background: var(--amber); }
code { background: #f1f0ec; }
.dlg-head, .dlg-foot { background: #fbfbf9; }
dialog { border-radius: 12px; }
dialog::backdrop { background: rgba(29, 36, 51, .45); }

/* ---------- entrada ---------- */
.login { background: linear-gradient(160deg, #fbfbf9 0%, #efede7 100%); }
.login-card { border-top: 0; overflow: hidden; padding-top: 0; box-shadow: 0 18px 50px rgba(29, 36, 51, .14); }
.login-card .brand {
  margin: 0 -26px 6px; padding: 18px 26px; background: #1d2433; color: #b4bccb;
  border-bottom: 3px solid var(--amber); gap: 14px;
}
.login-card .logo { width: 132px; height: 44px; }
.login-card #login-site { font-weight: 600; }
#toast { background: #1d2433; }

/* ---------- afinações ---------- */
.lcd.off { background: #ecebe6; box-shadow: inset 0 1px 3px rgba(29, 36, 51, .12); }
.lcd.off b, .lcd.off i { color: #a8a59d; }
.chip-blue { background: #f1f0ec; color: #3d4656; }
.sp-line { stroke: var(--brand-ink); }

@media (max-width: 719px) {
  .toolbar .seg { width: 100%; }
  .seg button { flex: 1; }
  main { padding: 16px 12px 48px; }
  .top { padding: 10px 12px; gap: 12px; }
  .top-meta { margin-left: 0; }
  .lcd b { font-size: 1.05rem; }
  .slot-top .chip { display: none; }
  .rack { padding: 12px 22px; }
  .stat strong { font-size: 1.6rem; }
}
