/* Sistema de design (ui-ux-pro-max: "security admin console dashboard dark", densidade 8,
   variancia 3, movimento 2): Minimalism & Swiss, ardosia escura, destaque verde de status.
   Fontes do sistema (CSP do painel nao carrega Google Fonts): Fira se instalada. */
:root {
  --bg: #0f172a; --panel: #1b2336; --panel2: #272f42; --line: #334155; --line-strong: #475569;
  --text: #f8fafc; --muted: #94a3b8; --accent: #22c55e; --on-accent: #0f172a; --link: #60a5fa;
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --ring: #93c5fd;
  --radius: 8px; --t: 160ms;
  --font: "Fira Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Fira Code", "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--link); text-decoration: none; transition: color var(--t); }
a:hover { color: #93c5fd; text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 18px; }
h2 { font-size: 16px; font-weight: 600; margin: 20px 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.center { text-align: center; }
.muted { color: var(--muted); }
/* foco visivel em todo elemento interativo (teclado) */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.layout { display: flex; min-height: 100vh; }
.side { width: 236px; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 0; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 0 18px 14px; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.side .brand::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.side .who { padding: 0 18px 14px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.side a, .side button.link { display: block; width: 100%; text-align: left; padding: 8px 18px; color: var(--text); background: none; border: 0;
  border-left: 3px solid transparent; font: inherit; cursor: pointer; transition: background var(--t), border-color var(--t); }
.side a:hover, .side button.link:hover { background: var(--panel2); text-decoration: none; }
.side a.active { background: var(--panel2); border-left-color: var(--accent); }
.side .sub { padding-left: 34px; font-size: 13px; color: var(--muted); }
.side .sub.active, .side .sub:hover { color: var(--text); }
.side .sep { border-top: 1px solid var(--line); margin: 8px 0; }
.main { flex: 1; padding: 26px 30px; max-width: 1180px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 9px 14px; cursor: pointer; font: inherit; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--t), border-color var(--t); }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.field { display: grid; grid-template-columns: 300px 1fr; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.field:last-child { border-bottom: 0; }
.field label { font-weight: 500; display: block; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.field.dirty label { color: var(--warn); }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; max-width: 420px; min-height: 34px; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 6px 10px; font: inherit; transition: border-color var(--t), box-shadow var(--t); }
input::placeholder, textarea::placeholder { color: #64748b; }
textarea { min-height: 110px; max-width: 100%; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(147,197,253,.25); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
button.btn { background: var(--accent); color: var(--on-accent); border: 1px solid transparent; border-radius: 6px; padding: 7px 14px; min-height: 34px;
  font: inherit; font-weight: 600; cursor: pointer; transition: filter var(--t), background var(--t), border-color var(--t); }
button.btn:hover:not(:disabled) { filter: brightness(1.08); }
button.btn:active:not(:disabled) { filter: brightness(.95); }
button.btn:disabled { opacity: .45; cursor: not-allowed; }
button.btn.ghost { background: var(--panel2); color: var(--text); border-color: var(--line-strong); font-weight: 500; }
button.btn.ghost:hover:not(:disabled) { background: #313a50; filter: none; }
button.btn.danger { background: var(--bad); color: #fff; }
button.btn.small { padding: 3px 10px; min-height: 28px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar { position: sticky; bottom: 0; background: var(--panel2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px 14px;
  margin-top: 16px; display: flex; gap: 10px; align-items: center; box-shadow: 0 -6px 18px rgba(2,6,23,.45); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr { transition: background var(--t); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--panel2); border: 1px solid var(--line-strong); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(34,197,94,.6); background: rgba(34,197,94,.10); }
.pill.bad { color: #fca5a5; border-color: rgba(239,68,68,.6); background: rgba(239,68,68,.12); }
.pill.warn { color: #fcd34d; border-color: rgba(245,158,11,.6); background: rgba(245,158,11,.12); }
.msg { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.msg.ok { background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.6); }
.msg.err { background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.6); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(34,197,94,.10), transparent 60%), var(--bg); }
.login { width: 100%; max-width: 380px; margin: 0; padding: 26px 26px 20px; box-shadow: 0 18px 50px rgba(2,6,23,.55); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand h1 { margin: 0; font-size: 20px; }
.login-mark { width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0; background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 0 0 4px rgba(34,197,94,.15); position: relative; }
.login-mark::after { content: ""; position: absolute; inset: 9px 11px 8px; border: 2px solid var(--on-accent); border-top-width: 3px;
  border-radius: 2px 2px 9px 9px; }
.login label { display: block; font-weight: 500; font-size: 13px; margin: 12px 0 6px; }
.login input[type=text], .login input[type=password] { max-width: none; min-height: 40px; }
.pw-row { display: flex; gap: 6px; align-items: stretch; }
.pw-row input { flex: 1; }
.pw-toggle { min-width: 76px; }
.login .login-remember { display: flex; margin: 14px 0 16px; font-weight: 400; font-size: 13px; }
.login-submit { width: 100%; min-height: 42px; font-size: 15px; }
.login-note { margin: 14px 0 0; text-align: center; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.changes { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
.hidden { display: none; }
.small { font-size: 12px; }
.clickable { cursor: pointer; }
.clickable:hover { background: var(--panel2); }
details > summary { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.sevcard .big { font-size: 28px; font-weight: 700; margin: 6px 0 2px; }
.sevcard { border-left-width: 4px; }
.pill.sev-critico { color: #fff; background: #c93c37; border-color: #c93c37; }
.pill.sev-alto { color: #fff; background: #d9822b; border-color: #d9822b; }
.pill.sev-medio { color: #1b1b1b; background: #e3c22f; border-color: #e3c22f; }
.pill.sev-baixo { color: #fff; background: #3d7fd9; border-color: #3d7fd9; }
.pill.sev-info { color: var(--text); background: var(--panel2); }
.sev-border-critico { border-left-color: #c93c37; }
.sev-border-alto { border-left-color: #d9822b; }
.sev-border-medio { border-left-color: #e3c22f; }
.sev-border-baixo { border-left-color: #3d7fd9; }
.sev-border-info { border-left-color: var(--line); }
pre.mono { white-space: pre-wrap; margin: 0; }
/* detalhes das opcoes */
.details { margin-top: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.details-list { margin: 0 0 6px; padding-left: 18px; }
.details-list li { margin: 2px 0; }
.details p { margin: 4px 0 8px; }
.field .btn.small { margin-top: 6px; }
table.kv td, table.kv th { padding: 4px 8px; }
/* alertas: linha inteira na cor da gravidade */
.grow { flex: 1; min-width: 220px; max-width: none !important; }
.nowrap { white-space: nowrap; }
table.alerts td { vertical-align: middle; }
tr.sevrow td:first-child { border-left: 4px solid transparent; }
tr.sevrow-critico { background: rgba(201,60,55,.16); }
tr.sevrow-critico td:first-child { border-left-color: #c93c37; }
tr.sevrow-alto { background: rgba(217,130,43,.14); }
tr.sevrow-alto td:first-child { border-left-color: #d9822b; }
tr.sevrow-medio { background: rgba(227,194,47,.11); }
tr.sevrow-medio td:first-child { border-left-color: #e3c22f; }
tr.sevrow-baixo { background: rgba(61,127,217,.10); }
tr.sevrow-baixo td:first-child { border-left-color: #3d7fd9; }
tr.sevrow-info { background: transparent; }
tr.sevrow-info td:first-child { border-left-color: var(--line); }
tr.sevrow.clickable:hover { filter: brightness(1.25); }
tr.alert-detail td { border-left: 4px solid var(--line); }
.drop-wrap { margin-top: 8px; display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.drop { width: 132px; height: 132px; flex-shrink: 0; border: 2px dashed var(--line); border-radius: 8px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; cursor: pointer;
  color: var(--muted); font-size: 12px; transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus { border-color: var(--accent); color: var(--text); outline: none; }
.drop.over { border-color: var(--accent); background: rgba(34,197,94,.10); color: var(--text); }
.drop.busy { border-style: solid; border-color: var(--warn); }
.drop-hint { word-break: break-word; }
.drop-results { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.hash-res { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.hash-res.err { border-color: var(--bad); color: var(--bad); }
.hash-line { display: grid; grid-template-columns: 60px 1fr auto; gap: 8px; align-items: center; margin-top: 4px; }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .side { width: 100%; position: static; height: auto; }
  button.btn { min-height: 40px; }
  .field { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}

.tele-canvas { display: block; max-width: 100%; background: #000; border-radius: 6px; }
.row select { width: auto; }
input[type=range] { accent-color: var(--accent); cursor: pointer; }

/* Alerta que chegou na atualizacao automatica: realce que some em 6 s. */
tr.alert-new td { animation: alertNew 6s ease-out; }
@keyframes alertNew { from { box-shadow: inset 0 0 0 9999px rgba(34,197,94,.22); } to { box-shadow: inset 0 0 0 9999px transparent; } }
@media (prefers-reduced-motion: reduce) { tr.alert-new td { animation: none; outline: 1px solid var(--accent); } }
.alerts-card .switch.small { font-size: 12px; }

/* Aba Protecoes: cada opcao numa caixa; caixas lado a lado, altura do proprio texto
   (ui-ux-pro-max: rotulo visivel ligado ao controle, linha de 65-75 caracteres,
   altura de linha 1.5+, sem rolagem horizontal em tela estreita). */
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; align-items: start; margin-bottom: 16px; }
.field-grid > .field.box { display: block; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--radius); padding: 14px 16px; transition: border-color var(--t); }
.field-grid > .field.box:last-child { border-bottom: 1px solid var(--line); }
.field-grid > .field.box.on { border-left-color: var(--accent); }
.field-grid > .field.box.open { grid-column: 1 / -1; }
.field-grid > .field.box.dirty { border-color: var(--warn); border-left-color: var(--warn); }
.field.box .box-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.field.box .box-title { font-weight: 600; font-size: 14px; line-height: 1.4; min-width: 0; }
.field.box .box-ctl { flex-shrink: 0; }
.field.box .box-ctl .switch { white-space: nowrap; }
.field.box .box-ctl select { max-width: 170px; }
.field.box .help { margin-top: 6px; line-height: 1.55; max-width: 75ch; }
.field.box .btn.small { margin-top: 10px; min-height: 32px; }
@media (prefers-reduced-motion: reduce) { .field-grid > .field.box { transition: none; } }
