/* Prumo Hub — site e painel. Sem dependências; claro/escuro pelo sistema. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --line: #e3e6eb;
  --text: #16191f;
  --muted: #5d6573;
  --brand: #1f5eff;
  --brand-ink: #ffffff;
  --brand-soft: #e8efff;
  --ok: #12805c;
  --ok-soft: #e3f5ee;
  --warn: #b25e00;
  --warn-soft: #fff1e0;
  --bad: #c2312f;
  --bad-soft: #fde9e8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --surface-2: #1e222b;
    --line: #2a2f3a;
    --text: #e8eaf0;
    --muted: #9aa3b2;
    --brand: #5b8cff;
    --brand-ink: #0b1020;
    --brand-soft: #1b2540;
    --ok: #3fc495;
    --ok-soft: #12291f;
    --warn: #f0a447;
    --warn-soft: #2d2113;
    --bad: #ff7a72;
    --bad-soft: #321a1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- botões e formulários */
.btn { display: inline-flex; align-items: center; gap: .4em; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 9px; padding: .55em 1em; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.small { padding: .3em .7em; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .6; cursor: default; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: .9em 0 .3em; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 9px; padding: .6em .75em; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .3em; }
.checks label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 500; color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
.checks input { width: auto; margin: 0; }
.err { color: var(--bad); font-size: 14px; min-height: 1.4em; margin-top: .6em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- site público */
.site-head { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 18px 20px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: var(--brand-ink); font-size: 16px; }
.hero { max-width: 1120px; margin: 0 auto; padding: 40px 20px 30px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: start; }
.hero h1 { font-size: clamp(30px, 4.4vw, 48px); letter-spacing: -.02em; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 36em; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.badges li { background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth { padding: 22px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 6px; }
.tabs button { flex: 1; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: .5em; border-radius: 7px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth .btn.primary { width: 100%; justify-content: center; margin-top: 16px; padding: .75em; }
.section { max-width: 1120px; margin: 0 auto; padding: 36px 20px; }
.section > h2 { font-size: 26px; letter-spacing: -.01em; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.feature { padding: 18px; }
.feature h3 { font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.feature .ico { font-size: 22px; margin-bottom: 6px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; margin-top: 18px; }
.step { padding: 18px; }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.site-foot { max-width: 1120px; margin: 0 auto; padding: 30px 20px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* ---------- painel */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 4px 8px 16px; }
.side a.nav { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-radius: 8px; }
.side a.nav:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side a.nav .ico { width: 20px; text-align: center; }
.side a.nav[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.side .grow { flex: 1; }
.side .who { font-size: 13px; padding: 10px; border-top: 1px solid var(--line); }
.side .who b { display: block; color: var(--text); }
.main { padding: 24px 28px 48px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
.top .sub { color: var(--muted); font-size: 14px; }
.menu-btn { display: none; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 14px 16px; }
.kpi .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 24px; font-weight: 750; margin-top: 4px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.kpi .d { font-size: 13px; color: var(--muted); }
.kpi.bad .v { color: var(--bad); }
.kpi.ok .v { color: var(--ok); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.panel { padding: 16px 18px; min-width: 0; }
.panel > h2 { font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.empty { color: var(--muted); font-size: 14px; padding: 14px 0; }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; height: 100%; min-width: 0; position: relative; }
.chart .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.chart .bar { flex: 1; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.prev { background: var(--brand-soft); outline: 1px solid var(--brand); outline-offset: -1px; }
.bar.rec { background: var(--brand); }
.bar.cus { background: var(--warn); }
.chart .col.now::after { content: ""; position: absolute; inset: -4px -4px auto; height: calc(100% + 4px); border-radius: 6px; background: var(--surface-2); z-index: -1; }
.chart-x { display: flex; gap: 8px; margin-top: 6px; }
.chart-x span { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td:first-child b { white-space: nowrap; }
td.r, th.r { text-align: right; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.meter > span { display: block; height: 100%; background: var(--ok); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.list .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.detail-head .meta { color: var(--muted); font-size: 14px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select { width: auto; }
.keybox { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px dashed var(--line); padding: 10px 12px;
  border-radius: 8px; word-break: break-all; font-size: 13px; margin: 8px 0; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 14px; }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(10, 14, 22, .45); }
dialog form { padding: 20px 22px; }
dialog h2 { font-size: 18px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px;
  border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 50; box-shadow: var(--shadow); }

/* ---------- celular */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 16px; }
  .features, .steps { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 250px; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px; }
}
@media (max-width: 560px) {
  .features, .steps { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .kpi .v { font-size: 18px; }
  .kpi { padding: 12px; }
  .toolbar input, .toolbar select { min-width: 0; width: 100%; }
}
