:root {
  --bg: #07080d;
  --panel: #12141c;
  --panel2: #1b1e29;
  --line: #ffffff1a;
  --text: #f5f6fa;
  --muted: #adb2c2;
  --faint: #747a8b;
  --mint: #5eead4;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --bad: #ff6b7a;
  --warn: #fbbf24;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); background: radial-gradient(1000px 500px at 85% -10%, #5eead412, transparent), var(--bg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 16px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 8px 0 0; color: var(--muted); font-weight: 600; }
code { font-size: 13px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
small { color: var(--faint); font-size: 12px; }
.sub { margin: 4px 0 0; color: var(--muted); }
.crumb { margin: 0 0 10px; font-size: 14px; }

/* Estrutura */
body.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; background: #0c0e14; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--text); font-weight: 800; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand em { color: var(--muted); font-style: normal; font-weight: 400; }
.brand.big { padding: 0; margin-bottom: 22px; font-size: 18px; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--bg); font-weight: 900; background: linear-gradient(135deg, var(--mint), var(--blue), var(--violet)); }
.side nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.side nav a:hover { color: var(--text); background: #ffffff0a; text-decoration: none; }
.side nav a.on { color: var(--text); background: #5eead41c; box-shadow: inset 2px 0 0 var(--mint); }
.side svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side nav a.on svg { color: var(--mint); }
.exit { width: 100%; }
main { width: 100%; max-width: 1180px; padding: 30px 32px 56px; margin: 0 auto; }
body.guest main { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 20px; }

/* Cartões */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; min-width: 0; }
.card.narrow { width: 100%; max-width: 400px; padding: 28px; margin: 0; }
.card.narrow h1 { font-size: 22px; margin-bottom: 18px; }
.card.danger { border-color: #ff6b7a55; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.columns .card { margin: 0; }
.columns + .card, .card + .columns { margin-top: 16px; }
.plan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }

/* Formulários */
label { display: block; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
input:not([type=radio]), textarea, select { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; font: inherit; }
select option { background: var(--panel2); color: var(--text); }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0 16px; }
.grid .full { grid-column: 1 / -1; }
button, .button { display: inline-block; padding: 10px 18px; color: var(--bg); background: var(--mint); border: 1px solid transparent; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; }
button:hover, .button:hover { filter: brightness(1.1); text-decoration: none; }
button.wide { width: 100%; }
button.ghost { color: var(--text); background: var(--panel2); border-color: var(--line); font-weight: 600; }
button.bad { color: #fff; background: #c8324a; }
button.small { padding: 5px 10px; font-size: 13px; font-weight: 500; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.row.inline label { width: 170px; margin: 0; }
.row.inline { margin-left: auto; }
.search { display: flex; gap: 8px; margin: 0 0 14px; }
.search input { flex: 1; width: auto; min-width: 0; margin: 0; }
.search button { flex: none; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 0; }
fieldset.choices { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.choices legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.choice { display: flex; gap: 10px; margin: 0; padding: 13px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--mint); background: #5eead412; }
.choice input { accent-color: var(--mint); margin: 3px 0 0; flex: none; }
.choice b { display: block; color: var(--text); font-size: 14px; }
.choice small { display: block; color: var(--muted); margin-top: 2px; }

/* Avisos */
.flash, .error, .warn-box { padding: 11px 14px; border-radius: 10px; margin: 0 0 16px; }
.flash { color: var(--mint); background: #5eead41a; }
.error { color: var(--bad); background: #ff6b7a1a; }
.error a { color: inherit; text-decoration: underline; }
.warn-box { color: var(--warn); background: #fbbf241a; }
.warn-box a { color: inherit; text-decoration: underline; }

/* Números */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stats.six { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 1280px) { .stats.six { grid-template-columns: repeat(6, 1fr); } }
.stat { display: block; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
a.stat:hover { border-color: #ffffff40; text-decoration: none; }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 32px; line-height: 1.25; font-weight: 800; }
.stat.warn b { color: var(--warn); }
.stat.bad b { color: var(--bad); }
.stat.ok b { color: var(--mint); }

/* Tabelas */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tabs a { padding: 6px 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--bg); background: var(--mint); border-color: var(--mint); font-weight: 700; }
.table { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.table.flat { background: transparent; border: 0; border-radius: 0; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.flat th, .flat td { padding: 9px 8px; }
th { color: var(--faint); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #ffffff05; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--faint); text-align: center; padding: 26px 14px; white-space: normal; }
.actions { display: flex; justify-content: flex-end; gap: 6px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag.ok { color: var(--mint); background: #5eead41f; }
.tag.bad { color: var(--bad); background: #ff6b7a1f; }
.tag.trial { color: var(--violet); background: #a78bfa24; }
.tag.off { color: var(--muted); background: #ffffff14; }

/* Telas estreitas: o menu vira uma faixa no topo. */
@media (max-width: 820px) {
  body.app { display: block; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; flex: 1; }
  .side form { order: 2; }
  .exit { width: auto; padding: 6px 12px; }
  .side nav { order: 3; flex: 0 0 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .side nav a { padding: 8px 6px; gap: 6px; font-size: 13px; justify-content: center; }
  .stats.six { grid-template-columns: repeat(2, 1fr); }
  .side nav a.on { box-shadow: none; }
  .side svg { width: 16px; height: 16px; }
  main { padding: 20px 16px 40px; }
  h1 { font-size: 24px; }
  .row.inline { margin-left: 0; }
}
