:root {
  --bg: #161D31; --bg2: #1c2438; --panel: #283046; --panel2: #323a56; --input: #1f2740;
  --line: #3a4263; --text: #ecf0f8; --text2: #b0b9d2; --muted: #8a92ae;
  --accent: #708ffb; --accent-dim: rgba(112, 143, 251, 0.12); --ok: #12b76a; --bad: #f04438;
  --s1: #3987e5; --s2: #d95926;
  --good: #12b76a; --warning: #f79009; --critical: #f97066;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
input, select { width: 100%; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: var(--text); font-size: 15px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { cursor: pointer; border: 0; border-radius: 9px; padding: 11px 14px; font-weight: 600; font-size: 15px; background: var(--accent); color: #fff; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); padding: 7px 12px; font-size: 13px; }
.full { width: 100%; margin-top: 22px; }
.err { color: var(--bad); font-size: 13px; min-height: 20px; margin-top: 12px; }

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
nav { display: flex; gap: 4px; padding: 10px 20px; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 14px; }
nav a.on { background: #1f2430; color: var(--text); }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.tile h3 { margin: 0 0 6px; font-size: 15px; }
.tile p { margin: 0; color: var(--muted); font-size: 13px; }
.pill { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: #1f2430; color: var(--muted); margin-top: 10px; }
.who { color: var(--muted); font-size: 13px; }
@media (max-width: 520px) { header, nav, main { padding-left: 16px; padding-right: 16px; } }

/* ── Etapa 2 ── */
h2 { font-size: 16px; margin: 26px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hostline { color: var(--text2); font-size: 13px; margin-bottom: 14px; line-height: 1.9; }
.row-between { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-between h2 { margin-bottom: 4px; }
.stats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.stat-val { font-size: 26px; font-weight: 700; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.stat-val small { font-size: 14px; color: var(--muted); font-weight: 500; }
.meter { height: 6px; background: var(--input); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.meter span { display: block; height: 100%; background: var(--s1); border-radius: 99px; }
.meter.thin { height: 4px; margin: 4px 0 0; min-width: 70px; }
.st { font-size: 12px; white-space: nowrap; color: var(--text2); }
.st-good { color: var(--good); } .st-warning { color: var(--warning); } .st-critical { color: var(--critical); } .st-off { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { background: transparent; color: var(--muted); border-radius: 0; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--panel2); color: var(--text); }
.charts { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.chart { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 6px; min-width: 0; }
.chart.wide { grid-column: 1 / -1; }
.chart figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.chart svg { display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .dlabel { fill: var(--text2); font-size: 11px; }
.chart .cross { stroke: #5a6275; stroke-width: 1; }
.chart .dot { stroke: var(--panel); stroke-width: 2; }
.chart .empty { padding: 50px 0; text-align: center; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text2); margin-bottom: 2px; }
.legend i, .tip i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tip { position: absolute; z-index: 300; pointer-events: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.tablewrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #323a56; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.port { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--input); color: var(--text2); font-variant-numeric: tabular-nums; }
.port.pub { color: var(--warning); }
button:disabled { opacity: .6; cursor: default; }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }

/* ── Etapa 3 ── */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; margin: 12px 0 4px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--input); padding: 1px 6px; border-radius: 5px; }
.tokenform { margin-top: 10px; max-width: 520px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btns button { padding: 9px 14px; font-size: 14px; }
button.danger { color: var(--critical); border-color: #4a2a2a; }
.err:empty { display: none; }
.total { color: var(--text); font-size: 15px; }
.stack { display: grid; gap: 14px; }
.stats.mini { margin: 14px 0; }
.stats.mini .stat-val { font-size: 20px; }
.sec-title { margin: 0 0 4px; font-size: 16px; }


/* ── Layout com barra lateral ── */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 210px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 200; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); min-height: 60px; }
.sidebar-logo { padding: 12px 18px; flex: 1; }
.logo-text { font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: .2px; }
.sidebar-logo small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.sidebar-toggle { background: transparent; border: 0; color: var(--muted); width: 38px; height: 60px; font-size: 18px; padding: 0; border-radius: 0; font-weight: 400; }
.sidebar-toggle:hover { color: var(--text); background: var(--panel2); }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; padding: 12px 10px; gap: 3px; }
.nav-btn { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-btn:hover { background: var(--panel2); color: var(--text); }
.nav-btn.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-label { flex: 1; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.sidebar-user { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer button { width: 100%; }
.only-collapsed { display: none; }
body.sidebar-collapsed .sidebar { width: 52px; }
body.sidebar-collapsed .sidebar-logo, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .sidebar-user { display: none; }
body.sidebar-collapsed .sidebar-top { justify-content: center; }
body.sidebar-collapsed .sidebar-toggle { width: 52px; }
body.sidebar-collapsed .nav-btn { justify-content: center; padding: 9px 0; }
body.sidebar-collapsed .sidebar-footer { padding: 8px; }
body.sidebar-collapsed .only-collapsed { display: inline; }
.main { flex: 1; min-width: 0; padding: 22px 26px 40px; max-width: 1400px; }
.page-head { margin-bottom: 14px; }
.page-head h1 { font-size: 20px; margin: 0; }
.mobile-topbar, .mobile-overlay { display: none; }
.hamburger { background: transparent; border: 0; padding: 6px; display: flex; flex-direction: column; gap: 5px; border-radius: 6px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text2); border-radius: 2px; }

/* sub-abas */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.subtab { padding: 7px 13px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13px; border: 1px solid transparent; line-height: 1.25; }
.subtab small { display: block; font-size: 11px; opacity: .8; }
.subtab:hover { background: var(--panel2); color: var(--text); }
.subtab.on { background: var(--accent-dim); color: var(--accent); border-color: rgba(112, 143, 251, .35); font-weight: 600; }

/* visão geral e filtros */
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(112, 143, 251, .05); }
td.att { max-width: 260px; }
td.att .st { display: inline-block; margin: 0 6px 3px 0; }
.meter span.lv-warning { background: var(--warning); }
.meter span.lv-critical { background: var(--critical); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); margin: 0; min-width: 180px; flex: 1; max-width: 280px; }
.filters select, .filters input { padding: 8px 10px; font-size: 14px; }
td a { color: var(--accent); text-decoration: none; }

@media (max-width: 768px) {
  .app { flex-direction: column; }
  .mobile-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; height: 52px; background: var(--bg2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 150; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; width: 230px; }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .mobile-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 190; }
  body.sidebar-collapsed .sidebar { width: 230px; }
  body.sidebar-collapsed .sidebar-logo, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .sidebar-user { display: initial; }
  .sidebar-toggle { display: none; }
  .main { padding: 16px; }
  .filters .f { max-width: none; }
}

/* ── Visão única do servidor ── */

/* Conta */
.conta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; max-width: 860px; }
.conta-btn { margin-top: 14px; }
.conta-msg-ok { color: var(--ok); }
.conta-qr { display: block; background: #fff; border-radius: 8px; margin: 12px 0; width: 220px; height: 220px; }
.conta-secret { display: block; font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; color: var(--text); margin-top: 4px; }
.conta-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px; margin: 12px 0; font-family: ui-monospace, monospace; font-size: 14px; color: var(--text); }

/* ⌨ Terminal (07/11/2026) */
#term-wrap { background: #000000; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-top: 10px; }
#term-screen { height: calc(100vh - 230px); min-height: 280px; }
.term-keys { display: none; gap: 6px; flex-wrap: wrap; padding-top: 8px; }
.term-keys button { background: var(--panel2); color: var(--text); padding: 8px 12px; font-size: 14px; font-weight: 500; }
.term-keys button.on { background: var(--accent); }
.term-actions { margin-top: 0; }
#term-devices { margin-top: 10px; }
#term-devices p { margin: 6px 0; }
#term-devices .nowrap { white-space: nowrap; }
button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 768px), (pointer: coarse) {
  .term-keys { display: flex; }
  #term-screen { height: calc(100vh - 290px); }
}
#tab-terminal .page-head { flex-wrap: wrap; gap: 10px; }
#tab-terminal .page-head > div:first-child { min-width: 0; }
#term-wrap { max-width: 100%; overflow: hidden; }
#term-screen { width: 100%; }
#tab-terminal { min-width: 0; max-width: 100%; }
@media (max-width: 768px) { .term-actions button { padding: 8px 11px; font-size: 14px; } }
#term-screen { overflow: hidden; }
@media (max-width: 768px) { #term-wrap { width: calc(100vw - 32px); } #term-meta { overflow-wrap: anywhere; } }

/* abas do terminal (07/11/2026) */
.term-tabs { display: flex; gap: 6px; align-items: center; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: thin; }
.ttab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; padding: 6px 10px; border-radius: 9px 9px 0 0;
  background: var(--panel); border: 1px solid var(--line); border-bottom: 0; color: var(--text2); font-size: 14px; user-select: none; }
.ttab.on { background: #000000; color: var(--text); border-color: var(--accent); }
.ttab-dot { color: var(--muted); font-size: 10px; }
.ttab-dot.live { color: var(--good, #2ecc71); }
.ttab-x { background: transparent; color: var(--muted); padding: 0 4px; font-size: 16px; line-height: 1; font-weight: 400; }
.ttab-x:hover { color: var(--text); }
.ttab-new { white-space: nowrap; padding: 6px 10px; font-size: 13px; }
.term-tab-actions { display: flex; gap: 8px; justify-content: flex-end; padding-bottom: 6px; flex-wrap: wrap; }
.term-tab-actions button { padding: 5px 10px; font-size: 12px; }
.term-pane { height: 100%; }
#term-wrap { margin-top: 0; border-top-left-radius: 0; }

/* grade de terminais + tela cheia (07/11/2026) */
.term-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 6px; }
.term-toolbar .seg button { padding: 5px 10px; font-size: 13px; }
.term-toolbar > button.ghost { padding: 5px 10px; font-size: 13px; }
.term-toolbar-gap { flex: 1; }
.term-tab-actions { display: inline-flex; gap: 8px; padding: 0; }
#term-screen { display: grid; gap: 6px; }
#term-screen .term-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: auto; border: 1px solid transparent; border-radius: 8px; }
#term-screen .term-pane[hidden] { display: none; }
.tp-head { display: none; align-items: center; gap: 6px; padding: 2px 8px; font-size: 12px; color: var(--muted); background: #111111; border-radius: 7px 7px 0 0; }
#term-screen.multi .tp-head { display: flex; }
.tp-head .tp-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dot { font-size: 9px; }
.tp-dot.live { color: var(--good, #2ecc71); }
.tp-max { background: transparent; color: var(--muted); padding: 0 4px; font-size: 14px; font-weight: 400; }
.tp-max:hover { color: var(--text); }
.tp-body { flex: 1; min-height: 0; min-width: 0; padding: 2px 0 0 4px; }
#term-screen.multi .term-pane.active { border-color: var(--accent); }
#term-screen.multi .term-pane.active .tp-head { color: var(--text); }
.term-pane.placeholder .tp-body { display: flex; align-items: center; justify-content: center; }
body.term-full .sidebar, body.term-full .mobile-topbar, body.term-full #tab-terminal .page-head, body.term-full #term-help, body.term-full #term-err:empty { display: none !important; }
body.term-full .main { max-width: none; padding: 8px 10px; }
body.term-full #term-wrap { margin-top: 0; }
body.term-full #term-screen { height: calc(100vh - 110px); }
.term-tabs { max-width: 100%; min-width: 0; }
@media (max-width: 768px) { .term-tabs { max-width: calc(100vw - 32px); } #term-modes, #term-full, .term-toolbar-gap { display: none !important; } }

/* 🖥 Monitor inteiro (09/11/2026) */
.term-fs-head { display: none; }
#tab-terminal:fullscreen { background: #0b1020; padding: 4px 6px 6px; display: flex; flex-direction: column; width: 100vw; height: 100vh; max-width: none; box-sizing: border-box; overflow: hidden; }
#tab-terminal:fullscreen > .page-head, #tab-terminal:fullscreen > #term-help, #tab-terminal:fullscreen > #term-devices { display: none !important; }
#tab-terminal:fullscreen > #term-err:empty { display: none; }
#tab-terminal:fullscreen > #term-err { margin: 0 0 4px; font-size: 12px; }
#tab-terminal:fullscreen .term-fs-head { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-width: 0; }
#tab-terminal:fullscreen .term-fs-head .term-tabs { flex: 1; min-width: 0; padding: 0; }
#tab-terminal:fullscreen .term-fs-head .ttab { padding: 3px 9px; font-size: 13px; border-radius: 7px 7px 0 0; }
#tab-terminal:fullscreen .term-fs-head .ttab-new { padding: 3px 9px; font-size: 12px; }
#tab-terminal:fullscreen .term-fs-head .term-toolbar { flex: 0 0 auto; padding: 0; flex-wrap: nowrap; gap: 6px; }
#tab-terminal:fullscreen .term-fs-head .term-toolbar .seg button, #tab-terminal:fullscreen .term-fs-head .term-toolbar > button { padding: 3px 8px; font-size: 12px; }
#tab-terminal:fullscreen .term-fs-head #term-full, #tab-terminal:fullscreen .term-fs-head .term-toolbar-gap, #tab-terminal:fullscreen .term-fs-head .term-tab-actions { display: none !important; }
#tab-terminal:fullscreen #term-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 0; padding: 4px; border-radius: 0 8px 8px 8px; width: auto; }
#tab-terminal:fullscreen #term-screen { flex: 1 1 auto; height: auto !important; min-height: 0; }

/* ordem das abas: arrastar + divisória na tela/fora (09/11/2026) */
.ttab.out { opacity: .5; border-style: dashed; }
.ttab.out:hover { opacity: .85; }
.ttab.peek { opacity: 1; border-color: var(--warn, #e0a030); }
.ttab.dragging { opacity: .35; }
.ttab.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.ttab.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
.ttab-sep { color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; user-select: none; cursor: help; }

/* faixa de desconectado por cima do quadro (09/11/2026) */
#term-screen .term-pane { position: relative; }
.tp-overlay { position: absolute; inset: 24px 0 0 0; display: flex; align-items: center; justify-content: center; background: rgba(11,16,32,.78); cursor: pointer; z-index: 5; border-radius: 0 0 8px 8px; }
.tp-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 18px; border: 1px solid var(--warn, #e0a030); border-radius: 10px; background: #141a2e; color: var(--text); font-size: 13px; text-align: center; }
.tp-overlay strong { color: var(--warn, #e0a030); font-size: 14px; }
.tp-overlay:hover > div { border-color: var(--accent); }

/* 14/11 copiar/colar no terminal */
#term-mouse.on { border-color: var(--accent, #4f8cff); }
.term-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9999; background: #1b2230; color: #fff; border: 1px solid #3a4558; border-radius: 8px; padding: 8px 14px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.35); pointer-events: none; opacity: 0; transition: opacity .15s; }
.term-toast.show { opacity: 1; }
#term-screen.drop-on { outline: 2px dashed #4f8cff; outline-offset: -4px; }

/* 14/11 login com passkey */
#pk-btn { margin-top: 4px; }
.login-or { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; color: var(--muted); font-size: 12px; }
.login-or::before, .login-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }



/* 25/11/2026: selos 🔵 trabalhando / ✅ parou + 🔍 busca */
@keyframes term-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.ttab.busy .ttab-dot, .term-pane.busy .tp-dot { color: #3b82f6 !important; animation: term-pulse 1.1s ease-in-out infinite; }
.ttab-badge:empty, .tp-badge:empty { display: none; }
.ttab-badge { font-size: 12px; line-height: 1; }
.ttab.done { border-color: var(--good, #2ecc71); }
.tp-badge { font-size: 11px; white-space: nowrap; color: #93c5fd; }
.term-pane.done .tp-badge { color: var(--good, #2ecc71); font-weight: 700; }
.term-pane.done .tp-head { box-shadow: inset 0 -2px 0 var(--good, #2ecc71); }
.term-find { position: fixed; top: 76px; right: 24px; z-index: 60; display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: #111111; border: 1px solid var(--accent, #3b82f6); border-radius: 9px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.term-find[hidden] { display: none; }
.term-find input { width: 240px; padding: 5px 8px; font-size: 13px; }
.term-find button { padding: 4px 8px; font-size: 13px; }
.term-find-n { font-size: 12px; color: var(--muted); min-width: 58px; text-align: center; }
.term-find-n.none { color: var(--bad, #e74c3c); }
@media (max-width: 768px) { .term-find { left: 12px; right: 12px; top: 64px; } .term-find input { width: auto; flex: 1; min-width: 0; } }

/* 25/11/2026: faixa "Religar todos" */
.term-relink { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; padding: 8px 12px; border-radius: 9px;
  background: rgba(224,160,48,.12); border: 1px solid var(--warn, #e0a030); color: var(--text); font-size: 13px; }
.term-relink[hidden] { display: none; }
.term-relink span { flex: 1; min-width: 200px; }
.term-relink button { padding: 6px 14px; font-size: 13px; }

/* 25/11/2026: 📜 Histórico por cima do quadro */
.tp-hist { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: #05070d; border: 1px solid #e0a030; border-radius: 8px; }
.tp-hist-bar { display: flex; align-items: center; gap: 8px; padding: 3px 8px; font-size: 12px; color: #fcd34d; background: #1a1405; border-radius: 8px 8px 0 0; }
.tp-hist-bar span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-hist-n { color: var(--muted); white-space: nowrap; }
.tp-hist-bar button { padding: 2px 8px; font-size: 12px; }
.tp-hist-body { flex: 1; min-height: 0; padding: 2px 4px; }
#term-screen:not(.multi) .term-pane { position: relative; }

/* 25/11/2026: 📦 Arquivados */
.term-archive { margin: 0 0 10px; }
.term-archive[hidden] { display: none; }
.arch-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.arch-head h3 { margin: 0; }
.arch-head input { flex: 1; min-width: 180px; max-width: 420px; }
#arch-list { display: grid; gap: 8px; max-height: 46vh; overflow: auto; }
.arch-card { border: 1px solid var(--border, #2a3142); border-radius: 9px; padding: 8px 10px; background: rgba(255,255,255,.02); }
.arch-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.arch-msg { font-size: 12.5px; margin-top: 4px; color: var(--text); white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.arch-msg b { color: var(--muted); font-weight: 600; }
.arch-bot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.arch-bot button { padding: 4px 10px; font-size: 12.5px; }
.arch-until { flex: 1; }
.arch-warn { color: var(--warn, #e0a030); }
.term-modal { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.term-modal[hidden] { display: none; }
.term-modal-box { background: var(--card, #111827); border: 1px solid var(--border, #2a3142); border-radius: 12px; width: min(980px, 100%); max-height: 88vh; overflow: auto; padding: 12px 14px; }
.term-modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.term-modal-head strong { flex: 1; }
.term-modal-box .arch-card { margin-bottom: 8px; }
.arch-screen { height: 62vh; background: #05070d; border-radius: 8px; padding: 4px; }

/* Servidor do Gaspar: aviso do 2FA obrigatório e linhas do journal */
.setup-2fa { margin-bottom: 18px; border-color: var(--warning); }
.errline { font-size: 12px; line-height: 1.5; padding: 3px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.errline code { font-size: 11px; }
details summary { cursor: pointer; padding: 4px 0; }
