:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f0f3f2;
  --ink: #14201d;
  --ink-2: #4b5a56;
  --ink-3: #7b8985;
  --line: #dfe5e3;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #e3f3f0;
  --ok: #15803d;
  --ok-soft: #e5f5ea;
  --warn: #a16207;
  --warn-soft: #fbf3dc;
  --err: #b91c1c;
  --err-soft: #fbe7e7;
  --shadow: 0 1px 2px rgba(16, 32, 28, .06), 0 4px 16px rgba(16, 32, 28, .05);
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513;
    --surface: #151e1c;
    --surface-2: #1b2624;
    --ink: #e6eeec;
    --ink-2: #a9b8b4;
    --ink-3: #7d8d89;
    --line: #26332f;
    --brand: #2dd4bf;
    --brand-ink: #062b27;
    --brand-soft: #123a35;
    --ok: #4ade80; --ok-soft: #14301f;
    --warn: #facc15; --warn-soft: #33290c;
    --err: #f87171; --err-soft: #3a1717;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); }
code, .mono { font-family: var(--mono); font-size: 13px; }
.boot { padding: 40px; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; padding: 4px 8px 18px; }
.logo img { width: 28px; height: 28px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .bottom { margin-top: auto; }
main { padding: 28px 32px 64px; max-width: 1180px; width: 100%; min-width: 0; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--ink-3); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .logo { padding: 0 8px 0 0; }
  .logo span { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 8px 10px; white-space: nowrap; font-size: 14px; }
  .nav a svg { display: none; }
  .side .bottom { margin: 0 0 0 auto; }
  main { padding: 20px 16px 48px; }
}

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card > h2 { margin-bottom: 4px; }
.card > .desc { color: var(--ink-3); margin: 0 0 16px; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink-3); font-size: 13px; }
.stat.alert .n { color: var(--err); }

/* Tabelas */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); border-top: 0; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tfoot td { font-weight: 650; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); }

/* Selos */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.off { color: var(--ink-3); }

/* Formulários */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
input, textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[readonly] { background: var(--surface-2); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.check input { width: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .55; cursor: default; }

/* Técnicos */
.team { display: grid; gap: 8px; }
.team .item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
@media (max-width: 640px) { .team .item { grid-template-columns: 1fr; } }

/* Abas */
.tabs { scrollbar-width: none; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }

/* Passo a passo */
.steps { counter-reset: s; display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.step::before { counter-increment: s; content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.step p { margin: 2px 0 8px; color: var(--ink-2); }
.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: 13px; }

/* Avisos */
.note { border-radius: 10px; padding: 12px 14px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.note.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.note.err { background: var(--err-soft); border-color: transparent; color: var(--err); }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.note + .card, .card + .note, .note + .note { margin-top: 16px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .logo { justify-content: center; padding: 0 0 18px; font-size: 17px; }
.login form > * + * { margin-top: 14px; }
.login .btn { width: 100%; padding: 11px; }

/* Logs */
.log { font-family: var(--mono); font-size: 12.5px; }
.log td { padding: 8px 20px; }
.log td:last-child { word-break: break-word; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--err); color: #fff; }
