:root {
  --bg: #e3f1f7;
  --surface: #ffffff;
  --ink: #0b2a36;
  --ink-2: #44606b;
  --ink-3: #7b939c;
  --line: #d3e4eb;
  --brand: #0284c7;
  --brand-ink: #075985;
  --up: #0284c7;
  --down: #dc5a1e;
  --ok: #15803d;
  --warn: #b45309;
  --radius: 16px;
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 600; }
h2 { font-size: 22px; font-weight: 600; margin-top: 8px; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 1em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* Header */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { font-family: var(--font-head); font-weight: 700; font-size: 19px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px #bae6fd; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--bg); }
.auth-slot { display: flex; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .topbar .wrap { gap: 10px; }
  .nav a { padding: 6px 8px; font-size: 14px; }
  .logo span.full { display: none; }
}

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 9px 18px; font: 600 14px var(--font-body); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #7dd3fc; outline-offset: 0; border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.check input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.msg { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; display: none; }
.msg.show { display: block; }
.msg.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.msg.ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.msg.info { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }

/* Cards & layout */
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; }
.section { padding: 36px 0; }
.hero { padding: 44px 0 20px; }
.kicker { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.grid-2 { display: grid; grid-template-columns: 2fr 3fr; gap: 24px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 999px; margin-bottom: 18px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 999px; font: 600 14px var(--font-body); color: var(--ink-2); cursor: pointer; }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.pill.up { background: #e0f2fe; color: #075985; }
.pill.down { background: #ffedd5; color: #9a3412; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.warn { background: #fef3c7; color: #92400e; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; }
th.sortable { cursor: pointer; }
td { padding: 9px 8px; border-bottom: 1px solid #edf4f7; font-variant-numeric: tabular-nums; }
td.r, th.r { text-align: right; }
tr:hover td { background: #f7fbfd; }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text { font: 11px var(--font-body); fill: var(--ink-3); }
.axis line, .grid line { stroke: #e6eff3; }
.tooltip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; white-space: nowrap; opacity: 0; transition: opacity .1s; z-index: 5; }
.tooltip.show { opacity: 1; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Radar specifics */
.top10 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 640px) { .top10 { grid-template-columns: 1fr; } }
.out-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.out-card .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.out-card .nm { font-weight: 600; }
.out-card .z { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.news { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.news .alerta { color: var(--warn); font-weight: 600; }
.news a { font-size: 12px; }

/* Products */
.prod { display: flex; flex-direction: column; }
.prod .price { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin: 8px 0 2px; }
.prod ul { padding-left: 18px; color: var(--ink-2); font-size: 14px; flex: 1; }
.prod .btn { margin-top: 12px; }

/* Area do usuario */
.side-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.side-nav button { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font: 600 14px var(--font-body); cursor: pointer; }
.side-nav button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.panel { display: none; }
.panel.show { display: block; }
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; max-height: 280px; overflow-y: auto; z-index: 10; box-shadow: 0 8px 24px rgba(11,42,54,.08); display: none; }
.suggest-list.show { display: block; }
.suggest-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; font: inherit; cursor: pointer; }
.suggest-list button:hover, .suggest-list button.hl { background: var(--bg); }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; color: var(--ink-2); cursor: pointer; }
.dropzone.drag { border-color: var(--brand); background: #f0f9ff; }

/* Legal pages */
.legal { max-width: 760px; }
.legal h2 { margin-top: 28px; font-size: 19px; }
.legal li { margin-bottom: 6px; }

footer.site { padding: 40px 0 60px; color: var(--ink-2); font-size: 13px; }
footer.site a { color: var(--ink-2); }
.disclaimer { font-size: 12px; color: var(--ink-3); max-width: 760px; }
.hidden { display: none !important; }

.add-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .add-form { grid-template-columns: 1fr; } }
