/* Portal dos radares Khomp. Mesmos tokens do radar Telefônica (IBM Plex, verde Khomp só no que é clicável/selecionado,
   estado só nas cores de estado, superfícies planas com borda). Tema segue o sistema. */
:root {
  color-scheme: light;
  --brand: #377243; --brand-ink: #2c5c36; --brand-gray: #878786;
  --bg: #f5f6f5; --panel: #ffffff; --panel-2: #f3f5f3; --line: #e3e6e3;
  --ink: #2a302c; --ink-strong: #0f1411; --muted: #5f6661;
  --good: #138a3a; --warn: #b97c00; --crit: #c62f2f; --idle: #a3a8a4;
  --good-ink: #0f6e2e; --warn-ink: #8a5d00; --crit-ink: #b02a2a;
  --header: #ffffff; --on-brand: #ffffff;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", "Roboto Mono", ui-monospace, monospace;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand: #5fa86d; --brand-ink: #8cc898; --brand-gray: #9a9a98;
    --bg: #111412; --panel: #181c19; --panel-2: #1e231f; --line: #2b322d;
    --ink: #cfd6d1; --ink-strong: #ffffff; --muted: #9aa29c;
    --good: #1fa74a; --warn: #e8a317; --crit: #e04848; --idle: #4f5751;
    --good-ink: #4cc46e; --warn-ink: #e8a317; --crit-ink: #f07070;
    --header: #161a17; --on-brand: #0f1411;
  }
}
[data-state="good"] { --tone: var(--good); --tone-ink: var(--good-ink); }
[data-state="warn"] { --tone: var(--warn); --tone-ink: var(--warn-ink); }
[data-state="crit"] { --tone: var(--crit); --tone-ink: var(--crit-ink); }
[data-state="idle"] { --tone: var(--idle); --tone-ink: var(--muted); }

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); }
.mono { font-family: var(--font-data); font-size: 12px; }
.hint { font-size: 13px; color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* cabeçalho */
.top { background: var(--header); border-bottom: 1px solid var(--line); }
.topin { display: flex; align-items: center; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 12px 24px; flex-wrap: wrap; }
.brand { display: flex; gap: 16px; align-items: center; text-decoration: none; color: inherit; }
.logo { height: 40px; width: auto; display: block; }
.sep { width: 1px; height: 28px; background: var(--line); }
.brand h1 { margin: 0; font-size: 18px; font-weight: 600; color: var(--ink-strong); }
.who { margin-left: auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.who .me { color: var(--muted); }
main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; }
h2 { font-size: 16px; font-weight: 600; color: var(--ink-strong); margin: 0 0 4px; }
.sec { margin-top: 36px; }
.sec:first-child { margin-top: 0; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

/* botões e campos */
button, .btn { font: 500 14px var(--font-body); border-radius: var(--radius); padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink-strong); text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--brand); }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.link { border: 0; background: none; color: var(--brand-ink); padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
button.danger { color: var(--crit-ink); }
button:disabled { opacity: .55; cursor: default; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-strong); }
input[type=text], input[type=email], input[type=password], input[type=url] { font: 14px var(--font-body); color: var(--ink-strong);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; min-width: 0; width: 100%; }
input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }

/* cartão, aviso, chip */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px; border-left: 3px solid var(--tone);
  background: color-mix(in srgb, var(--tone) 8%, var(--panel)); border-radius: var(--radius); }
.notice p { margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--tone-ink);
  background: color-mix(in srgb, var(--tone) 14%, transparent); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.err { color: var(--crit-ink); font-size: 13px; min-height: 20px; margin: 0; }

/* login e troca de senha */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 32px 28px 28px; }
.auth .logo { height: 44px; margin-bottom: 20px; }
.auth h1 { font-size: 20px; font-weight: 600; color: var(--ink-strong); margin: 0 0 4px; }
.auth form { display: grid; gap: 14px; margin-top: 20px; }
.auth button.primary { width: 100%; padding: 10px; }
.auth .foot { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* lista de radares */
.radars { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.radar { display: flex; flex-direction: column; gap: 6px; padding: 20px; text-decoration: none; color: inherit; transition: border-color .15s; }
.radar:hover { border-color: var(--brand); }
.radar h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink-strong); }
.radar p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.radar .go { margin-top: 10px; font-weight: 500; color: var(--brand-ink); }
.empty { color: var(--muted); padding: 32px; text-align: center; }

/* admin */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button { border: 0; background: none; border-radius: 0; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected=true] { color: var(--ink-strong); border-bottom-color: var(--brand); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.c, td.c { text-align: center; }
td .sub { color: var(--muted); font-size: 12px; }
td.acts { white-space: nowrap; text-align: right; }
td.acts button + button { margin-left: 12px; }
tr.off td:not(.acts) { opacity: .55; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; padding: 16px; margin-bottom: 16px; }
.form .wide { grid-column: span 2; }
.form .row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pw { font-family: var(--font-data); font-size: 15px; font-weight: 500; color: var(--ink-strong); letter-spacing: .03em; }
@media (max-width: 640px) { .form .wide { grid-column: auto; } .who .me { display: none; } }
form.inline { display: inline; margin: 0; }
.auth form { display: grid; gap: 14px; margin-top: 20px; }
.err p { margin: 0; }
main > .notice { margin-bottom: 20px; }
/* login: "Khomp Radar" e, no subdomínio do radar, o cliente na linha de baixo */
.auth h1.brand-title { display: grid; gap: 2px; }
.auth h1.brand-title span { font-size: 26px; font-weight: 600; color: var(--brand-ink); line-height: 1.2; }
