/* =============================================================================
   ROUT3 Monitor — base visual (protótipo aprovado: docs/design/prototipo-visao-geral-v3.html)
   Tokens de cor nos dois temas; todas as telas usam estas variáveis.
   ============================================================================= */
@font-face { font-family: "Geist"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/static/fonts/geist-latin-wght-normal.woff2") format("woff2");
  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: "Geist"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/static/fonts/geist-latin-ext-wght-normal.woff2") format("woff2");
  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; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/static/fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); }

:root {
  --bg: #f3f5f9; --panel: #ffffff; --panel-2: #f8f9fc; --hover: #f2f5fb;
  --line: #e4e8f0; --line-2: #d5dbe6;
  --text: #0e1628; --text-2: #414b5e; --muted: #5d677a;
  --brand: #2f66f6; --brand-2: #1f4fd1; --brand-soft: #eaf0ff; --brand-ink: #1b47c2;
  --side: #0c1630; --side-line: #1c2a4c; --side-text: #c9d3ea; --side-muted: #8c99b8; --side-active: #1d3066;
  --red: #d9342b;    --red-soft: #fdeceb;    --red-ink: #b42318;
  --orange: #ea6a12; --orange-soft: #fff1e6; --orange-ink: #b9500a;
  --amber: #d39b0b;  --amber-soft: #fdf6df;  --amber-ink: #8a6100;
  --slate: #7b879c;  --slate-soft: #eef1f6;  --slate-ink: #4a5468;
  --green: #12a46b;  --green-soft: #e6f6ef;  --green-ink: #0b7a4f;
  --shadow-sm: 0 1px 2px rgba(14, 22, 40, .05);
  --shadow: 0 1px 2px rgba(14, 22, 40, .04), 0 4px 12px -2px rgba(14, 22, 40, .06);
  --shadow-lg: 0 2px 4px rgba(14, 22, 40, .04), 0 12px 32px -8px rgba(14, 22, 40, .12);
  --ring: 0 0 0 3px rgba(47, 102, 246, .22);
  --sans: "Geist", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  /* nomes antigos, usados pelos CSS das telas */
  --card: var(--panel); --border: var(--line); --primary: var(--brand); --ok: var(--green); --bad: var(--red); --warn: var(--orange-ink);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="claro"]) {
    --bg: #080d19; --panel: #0f1628; --panel-2: #121a2e; --hover: #16203a; --line: #1d2742; --line-2: #2a3657;
    --text: #e8edf7; --text-2: #b8c2d6; --muted: #8d98b0;
    --brand: #5b8cff; --brand-2: #7aa2ff; --brand-soft: rgba(91, 140, 255, .14); --brand-ink: #9db9ff;
    --side: #060a14; --side-line: #151e35; --side-text: #c9d3ea; --side-muted: #7d89a6; --side-active: #162651;
    --red: #ff5f56; --red-soft: rgba(255, 95, 86, .13); --red-ink: #ff8a83;
    --orange: #ff8f3f; --orange-soft: rgba(255, 143, 63, .13); --orange-ink: #ffab70;
    --amber: #f3c24a; --amber-soft: rgba(243, 194, 74, .12); --amber-ink: #f5cf6e;
    --slate: #7a86a0; --slate-soft: rgba(122, 134, 160, .14); --slate-ink: #aab4c8;
    --green: #2fd08c; --green-soft: rgba(47, 208, 140, .12); --green-ink: #5fdca7;
    --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset;
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 16px 40px -12px rgba(0, 0, 0, .6);
    --ring: 0 0 0 3px rgba(91, 140, 255, .3);
    color-scheme: dark;
  }
}
:root[data-theme="escuro"] {
  --bg: #080d19; --panel: #0f1628; --panel-2: #121a2e; --hover: #16203a; --line: #1d2742; --line-2: #2a3657;
  --text: #e8edf7; --text-2: #b8c2d6; --muted: #8d98b0;
  --brand: #5b8cff; --brand-2: #7aa2ff; --brand-soft: rgba(91, 140, 255, .14); --brand-ink: #9db9ff;
  --side: #060a14; --side-line: #151e35; --side-text: #c9d3ea; --side-muted: #7d89a6; --side-active: #162651;
  --red: #ff5f56; --red-soft: rgba(255, 95, 86, .13); --red-ink: #ff8a83;
  --orange: #ff8f3f; --orange-soft: rgba(255, 143, 63, .13); --orange-ink: #ffab70;
  --amber: #f3c24a; --amber-soft: rgba(243, 194, 74, .12); --amber-ink: #f5cf6e;
  --slate: #7a86a0; --slate-soft: rgba(122, 134, 160, .14); --slate-ink: #aab4c8;
  --green: #2fd08c; --green-soft: rgba(47, 208, 140, .12); --green-ink: #5fdca7;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 16px 40px -12px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(91, 140, 255, .3);
  color-scheme: dark;
}

/* ----------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 14px/1.5 var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; } a:hover { color: var(--brand); }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 16px; }
h2 { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; } .nowrap { white-space: nowrap; }

/* ----------------------------------------------------------------- estrutura: menu lateral + conteúdo */
.shell { display: flex; min-height: 100vh; }
.shell-side { position: sticky; top: 0; height: 100vh; width: 248px; flex: none; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; gap: 22px; padding: 18px 14px 14px; overflow-y: auto; }
.shell-brand-row { display: flex; align-items: center; justify-content: space-between; }
.shell-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px; color: #fff; min-width: 0; }
.shell-brand:hover { color: #fff; }
.shell-logo { width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--brand); display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px rgba(47, 102, 246, .7), 0 0 0 1px rgba(255, 255, 255, .12) inset; }
.shell-logo svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shell-logo-img { height: 32px; width: auto; max-width: 120px; border-radius: 8px; }
.shell-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.shell-brand-text strong { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-brand-text span { color: var(--side-muted); font-size: 12px; }
.shell-navs { display: flex; flex-direction: column; gap: 18px; }
.shell-nav { display: flex; flex-direction: column; gap: 2px; }
.shell-nav-group { display: flex; flex-direction: column; gap: 2px; }
.shell-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-text); transition: background .15s, color .15s; }
.shell-nav a svg { color: var(--side-muted); transition: color .15s; }
.shell-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.shell-nav a:hover svg { color: #fff; }
.shell-nav a[aria-current="page"] { background: var(--side-active); color: #fff; box-shadow: 0 0 0 1px rgba(122, 162, 255, .18) inset; }
.shell-nav a[aria-current="page"] svg { color: #8fb0ff; }
.shell-nav summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; font-weight: 500; color: var(--side-muted); padding: 4px 10px 8px; border-radius: 6px; }
.shell-nav summary::-webkit-details-marker { display: none; }
.shell-nav summary:hover { color: #fff; }
.shell-nav summary svg { transition: transform .2s; }
.shell-nav details[open] summary svg { transform: rotate(90deg); }
.shell-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 4px 0 6px; border-top: 1px solid var(--side-line); }
.shell-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #23325c; color: #cfdcff; display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.shell-who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.shell-who strong { color: #fff; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-who span { color: var(--side-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-iconbtn { width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: 8px; border: 0; padding: 0;
  background: none; color: var(--side-muted); cursor: pointer; transition: background .15s, color .15s; }
.shell-iconbtn:hover, .shell-iconbtn[aria-current] { background: rgba(255, 255, 255, .07); color: #fff; }
.shell-menu-btn { display: none; }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell-main > main { width: 100%; }
.shell-top { position: sticky; top: 0; z-index: 20; height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.shell-top-left { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.theme-switch button { width: 32px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; background: none; border-radius: 7px; color: var(--muted); cursor: pointer; }
.theme-switch button:hover { color: var(--text); background: none; }
.theme-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .shell-side { position: static; height: auto; width: auto; padding: 12px 14px; gap: 12px; }
  .shell-menu-btn { display: inline-grid; }
  .shell-navs, .shell-foot { display: none; }
  .shell-nav-toggle:checked ~ .shell-side .shell-navs { display: flex; }
  .shell-nav-toggle:checked ~ .shell-side .shell-foot { display: flex; }
  .shell-top { position: static; padding: 0 16px; }
  .shell-top .btn-ghost { display: none; }
  .container { padding: 20px 16px; }
}

/* ----------------------------------------------------------------- componentes comuns */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.value.ok { color: var(--green-ink); } .value.bad { color: var(--red); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; font-size: 12.5px; background: var(--panel-2); white-space: nowrap; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--hover); }
.table tr:last-child td { border-bottom: none; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--slate); }
.dot.up { background: var(--green); } .dot.down { background: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--slate-soft); color: var(--slate-ink); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--slate-soft); color: var(--slate-ink); }
.chip > i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip.green { background: var(--green-soft); color: var(--green-ink); }
.chip.red { background: var(--red-soft); color: var(--red-ink); }
.chip.orange { background: var(--orange-soft); color: var(--orange-ink); }
.chip.amber { background: var(--amber-soft); color: var(--amber-ink); }
.chip.blue { background: var(--brand-soft); color: var(--brand-ink); }
.count-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font: 500 12px/1 var(--mono); background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.sev-critical, .if-down, .if-lowerLayerDown { background: var(--red-soft); color: var(--red-ink); }
.sev-warning { background: var(--amber-soft); color: var(--amber-ink); }
.sev-info, .if-up { background: var(--green-soft); color: var(--green-ink); }
.alert { background: var(--red-soft); color: var(--red-ink); padding: 11px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--red) 22%, transparent); }
.info { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; } .info dt { color: var(--muted); } .info dd { margin: 0; }

label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 500; color: var(--text-2); }
input, select, textarea { font: inherit; color: var(--text); padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line-2) 50%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; }
label > input[type=checkbox], label > input[type=radio] { width: 16px; height: 16px; margin: 0; flex: none; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 4px 0 22px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 720px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.back-link:hover { color: var(--text); }
.back-link svg { transform: rotate(180deg); }
button { font: inherit; font-weight: 500; padding: 8px 16px; border: 1px solid transparent; border-radius: 9px; background: var(--brand); color: #fff; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 4px 12px -6px rgba(47, 102, 246, .6); transition: background .15s, border-color .15s, transform .15s; }
button:hover { background: var(--brand-2); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--panel); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-sm); }
button.secondary:hover { border-color: var(--line-2); background: var(--hover); }
button.danger { background: var(--red); box-shadow: none; } button.danger:hover { background: var(--red-ink); }
.btn { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-weight: 500; box-shadow: var(--shadow-sm); white-space: nowrap; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--line-2); color: var(--text); }
.btn-primary { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 16px -6px rgba(47, 102, 246, .65); }
.btn-primary:hover { background: var(--brand-2); color: #fff; }
.btn-ghost { background: none; box-shadow: none; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.inline { display: inline; margin: 0; } .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form { max-width: 680px; } .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; padding: 14px; }
legend { padding: 0 6px; color: var(--muted); font-weight: 500; }
.notice { background: var(--green-soft); color: var(--green-ink); padding: 11px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); }
.warn { background: var(--amber-soft); color: var(--amber-ink); padding: 11px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); margin: 12px 0 0; }
.form-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.tpl-form select { padding: 2px 6px; font-size: 12px; margin-left: 8px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .info { grid-template-columns: 1fr; gap: 2px 0; } .info dd { margin-bottom: 8px; } }

/* ----------------------------------------------------------------- login */
body.auth { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100vh; background: var(--bg); }
.auth svg:not(.auth-logo) { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex: none; }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; color: var(--side-text); background: var(--side); }
.auth-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(140, 153, 184, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 153, 184, .14) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(180deg, #000, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); }
.auth-hero > * { position: relative; }
.auth-hero-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; color: #fff; }
.auth-hero-body h2 { font-size: 30px; line-height: 1.2; font-weight: 600; color: #fff; margin: 0 0 32px; max-width: 440px; letter-spacing: -.025em; }
.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; max-width: 440px; }
.auth-features li { display: flex; gap: 14px; align-items: flex-start; }
.auth-features li > svg { width: 38px; height: 38px; padding: 9px; flex: none; border-radius: 10px; color: #8fb0ff; background: rgba(91, 140, 255, .12); border: 1px solid rgba(143, 176, 255, .16); }
.auth-features strong { display: block; color: #fff; font-weight: 600; }
.auth-features span { color: var(--side-muted); font-size: 13.5px; }
.auth-hero-foot { margin: 0; color: var(--side-muted); font-size: 12.5px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.025em; }
.auth-sub { color: var(--muted); margin: 0 0 28px; }
.auth-mobile-brand { display: none; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; margin-bottom: 36px; }
.auth-msg { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; margin-bottom: 20px; font-size: 13.5px; }
.auth-msg svg { width: 18px; height: 18px; flex: none; }
.auth-msg.error { background: var(--red-soft); color: var(--red-ink); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent); }
.auth-msg.info { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.auth-field { margin-bottom: 18px; font-weight: 500; gap: 6px; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color .15s; }
.auth-input input { width: 100%; height: 46px; padding: 0 44px 0 42px; font-size: 15px; border-radius: 10px; }
.auth-input input::placeholder { color: var(--muted); }
.auth-input:focus-within > svg { color: var(--brand); }
.auth-form.tried .auth-input input:invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.auth-eye { position: absolute; right: 6px; width: 34px; height: 34px; padding: 7px; border-radius: 8px; background: none; color: var(--muted); box-shadow: none; }
.auth-eye:hover { background: var(--hover); color: var(--text); }
.auth-eye.on { color: var(--brand); }
.auth-eye svg { width: 20px; height: 20px; }
.auth-caps { color: var(--warn); font-weight: 500; font-size: 12.5px; }
.auth-submit { width: 100%; height: 46px; margin-top: 6px; font-size: 15px; font-weight: 600; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-submit:disabled { opacity: .85; cursor: progress; }
.auth-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: auth-spin .7s linear infinite; }
.auth-submit.loading .auth-spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-help { margin: 24px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  body.auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-main { align-items: flex-start; padding-top: 12vh; }
}

/* @legacy-start — estilos antigos do mapa; as cores ganham versão escura automática (light-dark). */
.container-wide { padding: 20px; }
.wm-toolbar[hidden], .wm-panel[hidden], .wm-head-actions[hidden] { display: none; }
.wm-shell { background: light-dark(#0f2744, #b0cdf3); border: 1px solid light-dark(#1e3a5f, #accdfb); border-radius: 12px; padding: 16px 18px 18px; color: light-dark(#e2e8f0, #1f2533);
  display: flex; flex-direction: column; height: calc(100vh - 100px); min-height: 520px; }
.wm-shell:fullscreen { height: 100vh; border-radius: 0; }
.wm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.wm-head h1 { color: #fff; font-size: 20px; margin: 0; }
.wm-sub { margin: 2px 0 0; color: light-dark(#93c5fd, #93c5fd); font-size: 12.5px; }
.wm-head-actions { display: flex; gap: 8px; }
.wm-body { flex: 1; display: flex; gap: 12px; min-height: 0; }
.wm-stage { position: relative; flex: 1; background: light-dark(#fff, #090f1c); border-radius: 10px; overflow: hidden; min-width: 0; }
#wm-svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; touch-action: none; }
#wm-svg:active { cursor: grabbing; }

.wm-controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.wm-controls button { background: light-dark(#fff, #090f1c); color: light-dark(#1f2937, #b3b7bf); border: 1px solid light-dark(#cbd5e1, #2e3441); padding: 5px 10px; min-width: 30px; font-size: 13px; }
.wm-controls button:hover { background: light-dark(#f1f5f9, #141a28); }
.wm-legend { position: absolute; top: 52px; right: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: light-dark(#1f2937, #b3b7bf); background: light-dark(rgba(255, 255, 255, .85), rgba(9, 15, 28, 0.85)); padding: 6px; border-radius: 6px; }
.wm-legend strong { font-size: 11px; margin-bottom: 2px; }
.wm-legend > div { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.wm-leg, .wm-leg-unknown { display: block; min-width: 64px; text-align: right; padding: 0 5px; border-radius: 2px;
  font-family: ui-monospace, Consolas, monospace; color: light-dark(#111, #c9ccd3); }
.wm-leg-unknown { background: light-dark(#94a3b8, #94a3b8); color: #fff; text-align: center; }

.wm-link .wm-hit { cursor: default; }
.editing .wm-link .wm-hit { cursor: pointer; }
.wm-link.selected polyline:not(.wm-hit) { filter: drop-shadow(0 0 3px rgba(37, 99, 235, .9)); }
.wm-traffic text { font-size: 10px; fill: light-dark(#475569, #bccce3); paint-order: stroke; stroke: light-dark(#fff, #090f1c); stroke-width: 3px; stroke-linejoin: round; }
.wm-iface rect { fill: light-dark(#dbeafe, #1e2432); stroke: light-dark(#60a5fa, #60a5fa); stroke-width: 1; }
.wm-iface text { font-size: 10px; fill: light-dark(#1e3a8a, #a5c9ff); }


.wm-node-bg { fill: transparent; stroke: none; }
.wm-node.selected .wm-node-bg { fill: light-dark(rgba(37, 99, 235, .08), rgba(82, 149, 255, 0.08)); stroke: light-dark(#2563eb, #5295ff); stroke-width: 1.5; stroke-dasharray: 4 3; }
.wm-node.clickable { cursor: pointer; }
.editing .wm-node { cursor: move; }
.wm-node-label { font-size: 11px; fill: light-dark(#334155, #bbcce5); font-weight: 500; paint-order: stroke; stroke: light-dark(#fff, #090f1c); stroke-width: 3px; }
.wm-dot { stroke: light-dark(#fff, #090f1c); stroke-width: 2; fill: light-dark(#94a3b8, #94a3b8); }
.status-up .wm-dot { fill: light-dark(#16a34a, #3bba60); }
.status-down .wm-dot { fill: light-dark(#dc2626, #ff584e); }
.status-down .wm-node-label { fill: light-dark(#dc2626, #ff584e); font-weight: 700; }
.status-down .wm-node-bg { fill: light-dark(rgba(220, 38, 38, .1), rgba(255, 88, 78, 0.1)); stroke: light-dark(#dc2626, #ff584e); stroke-width: 2; animation: wm-pulse 1.6s ease-in-out infinite; }
@keyframes wm-pulse { 50% { stroke-opacity: .2; } }
.wm-handle { fill: light-dark(#fff, #090f1c); stroke: light-dark(#2563eb, #5295ff); stroke-width: 2; cursor: move; }

.wm-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 8px;
  background: light-dark(#16365c, #a8cefd); border: 1px solid light-dark(#1e4976, #a0cfff); border-radius: 8px; }
.wm-toolbar button { padding: 6px 12px; font-size: 13px; }
.wm-toolbar button.active { background: light-dark(#f59e0b, #f59e0b); color: light-dark(#111, #c9ccd3); }
.wm-hint { color: light-dark(#cbd5e1, #2e3441); font-size: 12.5px; }
.wm-spacer { flex: 1; }

.wm-panel { position: absolute; top: 10px; left: 10px; bottom: 10px; width: 290px; background: light-dark(#fff, #090f1c); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow-y: auto; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.wm-panel h3 { font-size: 15px; margin: 0 0 12px; }
.wm-panel label { font-size: 13px; }
.wm-panel input, .wm-panel select { width: 100%; }
.wm-panel input[type=range] { padding: 0; }
.wm-panel-note { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.wm-icon-preview { display: block; margin: -4px auto 12px; background: light-dark(#f8fafc, #0f1623); border-radius: 8px; }
.wm-panel button { width: 100%; margin-top: 6px; }
.wm-leg-down { display: block; min-width: 64px; text-align: center; padding: 0 5px; border-radius: 2px; background: light-dark(#dc2626, #ff584e); color: #fff;
  font-family: ui-monospace, Consolas, monospace; }
.wm-tag-down rect { fill: light-dark(#dc2626, #ff584e); }
.wm-tag-down text { font-size: 10px; font-weight: 700; fill: light-dark(#fff, #090f1c); stroke: none; }
.wm-tag-pick { cursor: pointer; }
.wm-tag-pick rect { fill: light-dark(#fff7ed, #101724); stroke: light-dark(#f59e0b, #f59e0b); stroke-width: 1.2; stroke-dasharray: 3 2; }
.wm-tag-pick text { font-size: 10px; font-weight: 600; fill: light-dark(#b45309, #e58044); }
.wm-panel-gap { height: 12px; }

.wm-modal-back { position: absolute; inset: 0; z-index: 5; background: light-dark(rgba(15, 23, 42, .35), rgba(190, 203, 229, 0.35)); display: flex; align-items: center; justify-content: center; }
.wm-modal { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); display: flex; flex-direction: column; background: light-dark(#fff, #090f1c);
  color: var(--text); border-radius: 12px; padding: 18px; box-shadow: 0 20px 50px rgba(15, 23, 42, .3); }
.wm-modal h3 { margin: 0 0 6px; font-size: 16px; }
.wm-modal input[type=search] { width: 100%; margin-bottom: 10px; }
.wm-iface-list { overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; min-height: 80px; }
.wm-iface-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 0; background: light-dark(#fff, #090f1c);
  color: var(--text); text-align: left; border-bottom: 1px solid var(--border); }
.wm-iface-row:last-child { border-bottom: 0; }
.wm-iface-row:hover { background: light-dark(#eff6ff, #131a27); }
.wm-iface-row.current { background: light-dark(#dbeafe, #1e2432); }
.wm-iface-name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-iface-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.wm-dot-sm { width: 9px; height: 9px; border-radius: 50%; flex: none; background: light-dark(#94a3b8, #94a3b8); }
.wm-dot-sm.up { background: light-dark(#16a34a, #3bba60); } .wm-dot-sm.down { background: light-dark(#dc2626, #ff584e); }
.wm-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tpl-form select { padding: 2px 6px; font-size: 12px; margin-left: 8px; }
.notice { background: light-dark(#ecfdf5, #101725); color: light-dark(#065f46, #92ddbf); padding: 10px 14px; border-radius: 8px; border: 1px solid light-dark(#a7f3d0, #003e29); }
.warn { background: light-dark(#fffbeb, #0e1522); color: light-dark(#92400e, #ffb186); padding: 10px 14px; border-radius: 8px; border: 1px solid light-dark(#fde68a, #3b2f00); margin: 12px 0 0; }
.form-actions { margin-top: 14px; display: flex; justify-content: flex-end; }

.wm-field-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.wm-icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; max-height: 240px; overflow-y: auto; }
.wm-icon-tile { width: 100%; aspect-ratio: 1; padding: 4px; display: flex; align-items: center; justify-content: center;
  background: light-dark(#f8fafc, #0f1623); border: 1px solid var(--border); border-radius: 8px; margin: 0 !important; }
.wm-icon-tile:hover { background: light-dark(#eff6ff, #131a27); border-color: light-dark(#93c5fd, #93c5fd); }
.wm-icon-tile.current { background: light-dark(#dbeafe, #1e2432); border: 2px solid var(--primary); }
.wm-upload { display: block; text-align: center; padding: 9px; border: 1px dashed light-dark(#94a3b8, #94a3b8); border-radius: 8px; color: var(--primary);
  font-size: 13px; cursor: pointer; margin-bottom: 12px; }
.wm-upload:hover { background: light-dark(#eff6ff, #131a27); }
.wm-upload.busy { opacity: .6; pointer-events: none; }
.wm-upload input { display: none; }

.wm-resize { fill: light-dark(#fff, #090f1c); stroke: light-dark(#2563eb, #5295ff); stroke-width: 2; cursor: nwse-resize; }
.wm-size-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wm-size-row input[type=range] { flex: 1; padding: 0; }
.wm-panel .wm-size-row button { width: 34px; margin: 0; padding: 4px 0; font-size: 16px; line-height: 1; }
.wm-panel .wm-size-all { font-size: 12.5px; padding: 6px 8px; }
.wm-missing rect { fill: light-dark(#f8fafc, #0f1623); stroke: light-dark(#94a3b8, #94a3b8); stroke-width: 1.5; stroke-dasharray: 4 3; }
.wm-missing text { fill: light-dark(#64748b, #8fa0b8); }

.wm-modal-wide { width: min(900px, calc(100% - 32px)); }
.wm-cmds { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.8; }
.wm-cmds code { background: light-dark(#f1f5f9, #141a28); padding: 1px 6px; border-radius: 4px; color: var(--text); }
.wm-paste { width: 100%; font: 12px/1.45 ui-monospace, Consolas, monospace; padding: 10px; border: 1px solid var(--border);
  border-radius: 8px; resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.wm-nb-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; max-height: 52vh; margin-bottom: 10px; }
.wm-nb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wm-nb-table th { position: sticky; top: 0; background: light-dark(#f8fafc, #0f1623); text-align: left; font-weight: 600; font-size: 12px;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.wm-nb-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wm-nb-table tr:last-child td { border-bottom: 0; }
.wm-nb-table select { padding: 4px 6px; font-size: 12.5px; max-width: 220px; }
.wm-nb-table .muted-row td { color: var(--muted); }
.wm-match { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: light-dark(#e2e8f0, #1f2533); color: light-dark(#334155, #bbcce5); }
.wm-match.suggested { background: light-dark(#fef3c7, #302500); color: light-dark(#92400e, #ffb186); }
.wm-match.exact, .wm-match.chosen { background: light-dark(#dcfce7, #032e19); color: light-dark(#166534, #94dfa7); }
.wm-sit { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.wm-sit.ok { background: light-dark(#e2e8f0, #1f2533); color: light-dark(#475569, #bccce3); }
.wm-sit.new { background: light-dark(#dbeafe, #1e2432); color: light-dark(#1e40af, #a5c9ff); }
.wm-sit.add { background: light-dark(#dcfce7, #032e19); color: light-dark(#166534, #94dfa7); }
.wm-sit.warn { background: light-dark(#fef3c7, #302500); color: light-dark(#92400e, #ffb186); }

.wm-organize { position: relative; display: inline-block; }
.wm-organize-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 6; width: 290px; background: light-dark(#fff, #090f1c);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 23, 42, .25); padding: 6px; }
.wm-organize-menu[hidden] { display: none; }
.wm-organize-menu button { display: block; width: 100%; text-align: left; background: light-dark(#fff, #090f1c); color: var(--text); padding: 8px 10px; border-radius: 7px; }
.wm-organize-menu button:hover { background: light-dark(#eff6ff, #131a27); }
.wm-organize-menu strong { display: block; font-size: 13px; }
.wm-organize-menu small { color: var(--muted); font-size: 12px; }
.wm-info { left: auto; right: 10px; top: 52px; width: 340px; }
.wm-info h3 { margin: 0; font-size: 14px; }
.wm-info-close { background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 6px; width: auto !important; margin: 0 !important; }
.wm-info-close:hover { color: var(--text); background: light-dark(#f1f5f9, #141a28); }
.wm-info-dl { grid-template-columns: 110px 1fr; font-size: 12.5px; margin: 10px 0 12px; }
.wm-info-chart { height: 200px; margin-bottom: 10px; }
.wm-info-link { font-size: 13px; }
