/* Painel Comercial · Risco Zero Paraná */
:root {
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --nav-w: 232px;
  --ease: cubic-bezier(.2,.7,.2,1);
  /* light */
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #f5f7fb; --surface-3: #e9edf5;
  --ink: #0b1633; --ink-2: #46526c; --ink-3: #6f7a91;
  --line: #dde2ec; --line-2: #c9d1e0;
  --brand: #0a1f5c; --brand-ink: #ffffff;
  --gold: #d6a83a; --gold-text: #7d5a0e; --gold-wash: rgba(214,168,58,.14);
  --blue: #2a78d6; --blue-wash: rgba(42,120,214,.12);
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #5598e7; --seq-4: #256abf; --seq-5: #104281;
  --good: #0a7a0a; --warn: #9a6a00; --bad: #c23232; --crit: #d03b3b;
  --good-wash: rgba(12,163,12,.12); --warn-wash: rgba(250,178,25,.2); --bad-wash: rgba(208,59,59,.12);
  --shadow: 0 1px 0 rgba(11,22,51,.04), 0 8px 24px -12px rgba(11,22,51,.18);
  --nav-bg: #030d2e; --nav-ink: #c8d3ec; --nav-ink-active: #ffffff; --nav-line: rgba(255,255,255,.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --bg: #040b24; --surface: #0b1738; --surface-2: #0f1d44; --surface-3: #15244f;
    --ink: #eaf0fb; --ink-2: #aab7d1; --ink-3: #7c89a6;
    --line: #1b2a52; --line-2: #2a3b69;
    --brand: #d6a83a; --brand-ink: #1a1203;
    --gold-text: #e6bf68; --gold-wash: rgba(214,168,58,.14);
    --blue: #3987e5; --blue-wash: rgba(57,135,229,.16);
    --seq-1: #1a3a6e; --seq-2: #1c5cab; --seq-3: #2a78d6; --seq-4: #5598e7; --seq-5: #9ec5f4;
    --good: #2fc02f; --warn: #fab219; --bad: #ec835a; --crit: #e66767;
    --good-wash: rgba(47,192,47,.14); --warn-wash: rgba(250,178,25,.16); --bad-wash: rgba(236,131,90,.16);
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px -14px rgba(0,0,0,.6);
    --nav-bg: #030a20;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #040b24; --surface: #0b1738; --surface-2: #0f1d44; --surface-3: #15244f;
  --ink: #eaf0fb; --ink-2: #aab7d1; --ink-3: #7c89a6;
  --line: #1b2a52; --line-2: #2a3b69;
  --brand: #d6a83a; --brand-ink: #1a1203;
  --gold-text: #e6bf68; --gold-wash: rgba(214,168,58,.14);
  --blue: #3987e5; --blue-wash: rgba(57,135,229,.16);
  --seq-1: #1a3a6e; --seq-2: #1c5cab; --seq-3: #2a78d6; --seq-4: #5598e7; --seq-5: #9ec5f4;
  --good: #2fc02f; --warn: #fab219; --bad: #ec835a; --crit: #e66767;
  --good-wash: rgba(47,192,47,.14); --warn-wash: rgba(250,178,25,.16); --bad-wash: rgba(236,131,90,.16);
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px -14px rgba(0,0,0,.6);
  --nav-bg: #030a20;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #030d2e; }
.login-brand { position: relative; padding: 52px 60px; display: flex; flex-direction: column; justify-content: space-between; color: #eaf0fb; overflow: hidden; isolation: isolate;
  background: #030d2e url("assets/login-art.webp") center top / cover no-repeat; }
.login-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3,13,46,.92) 0%, rgba(3,13,46,.35) 22%, rgba(3,13,46,0) 40%, rgba(3,13,46,.7) 62%, rgba(3,13,46,.97) 78%),
    linear-gradient(90deg, rgba(3,13,46,.78) 0%, rgba(3,13,46,0) 55%); }
.login-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, #d6a83a 30%, #f3d27a 50%, #d6a83a 70%, transparent); }
.login-brand > * { position: relative; z-index: 1; }
.login-brand > div:nth-child(2) { margin-top: auto; margin-bottom: 36px; }
.brand-top { display: flex; align-items: center; gap: 18px; }
.login-brand .rzpro { width: 96px; height: auto; border-radius: 0; filter: drop-shadow(0 4px 14px rgba(0,0,0,.55)); }
.brand-tag { padding-left: 18px; border-left: 1px solid rgba(214,168,58,.55); display: grid; gap: 3px; }
.brand-tag span { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #b9c4dc; }
.brand-tag b { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: #e9c767; font-weight: 700; }
.login-brand h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; margin: 0 0 16px; max-width: 15ch; text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.login-brand h1 em { font-style: normal; color: #e9c767; }
.login-brand p { margin: 0; color: #c3cde2; max-width: 44ch; font-size: 16px; line-height: 1.6; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.login-foot { color: #7c89a6; font-size: 13px; }
.login-panel { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.01em; }
.login-card .sub { color: var(--ink-2); margin: 0 0 28px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; height: 46px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-md); font-weight: 700; background: var(--brand); color: var(--brand-ink); transition: transform .12s var(--ease), filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.wa { background: #1fa855; color: #fff; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.link-btn:hover { color: var(--ink); }
.form-error { min-height: 22px; margin: 4px 0 12px; color: var(--bad); font-size: 14px; font-weight: 600; }
.login-alt { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); }
.nav { background: var(--nav-bg); color: var(--nav-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; border-right: 1px solid var(--nav-line); }
.nav-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.nav-brand img { width: 40px; height: 45px; object-fit: cover; border-radius: 4px; flex: none; }
.nav-brand b { display: block; color: #fff; font-size: 14px; line-height: 1.2; }
.nav-brand small { color: #7c89a6; font-size: 12px; }
.nav-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: transparent; color: var(--nav-ink); border-radius: 9px; text-align: left; font-weight: 600; font-size: 14px; position: relative; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item[aria-current="page"] { background: rgba(214,168,58,.14); color: #fff; }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--nav-line); font-size: 13px; }
.nav-foot .who { color: #fff; font-weight: 700; display: block; }
.nav-foot .role { color: #7c89a6; display: block; margin-bottom: 10px; }
.nav-foot .row { display: flex; gap: 8px; }
.nav-foot .btn { background: rgba(255,255,255,.08); color: #fff; border-color: transparent; height: 32px; font-size: 12px; padding: 0 10px; }

.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 64px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar h1 { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; margin: 0; }
.topbar .asof { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 18px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.banner.warn { background: var(--warn-wash); border-color: transparent; }
.banner.demo { background: var(--gold-wash); border-color: transparent; }
.banner b { font-weight: 700; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 16px; margin: 0 0 2px; letter-spacing: -.005em; }
.card .hint { color: var(--ink-3); font-size: 13px; margin: 0 0 14px; max-width: 70ch; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { padding: 20px 20px 0; }

.hero { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); margin-bottom: 16px; }
.hero h2 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -.02em; font-weight: 800; max-width: 34ch; }
.hero h2 .money { color: var(--gold-text); }
.hero p { color: var(--ink-2); margin: 10px 0 0; max-width: 62ch; }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--ink-3); font-size: 12.5px; }
.kpi .value.gold { color: var(--gold-text); }

/* ---------- Charts ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-3); font-size: 12px; }
.chart .tick { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .lbl { fill: var(--ink-2); font-weight: 600; }
.chart .lbl-strong { fill: var(--ink); font-weight: 700; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .hl, .chart .bar:hover { filter: brightness(1.12); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.4; max-width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.35); opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip b { display: block; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .num { white-space: nowrap; }
.tbl tbody tr:hover { background: var(--surface-2); }
.minibar { display: inline-block; height: 8px; border-radius: 4px; background: var(--blue); vertical-align: middle; min-width: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-wash); color: var(--good); }
.pill.warn { background: var(--warn-wash); color: var(--warn); }
.pill.bad { background: var(--bad-wash); color: var(--bad); }
.pill.gold { background: var(--gold-wash); color: var(--gold-text); }
.pill.blue { background: var(--blue-wash); color: var(--blue); }

/* heat */
.heat td { text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; padding: 0; height: 44px; border: 2px solid var(--surface); }
.heat th { text-align: center; }
.heat th:first-child, .heat td:first-child { text-align: left; font-weight: 600; padding: 0 12px 0 0; border: 0; white-space: nowrap; color: var(--ink-2); }

/* ---------- Queue ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.select { height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); min-width: 200px; }
.q-list { display: flex; flex-direction: column; gap: 10px; }
.lead { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.lead.done { opacity: .55; }
.lead .rank { font-size: 13px; font-weight: 800; color: var(--ink-3); text-align: center; line-height: 1.1; }
.lead .rank b { display: block; font-size: 20px; color: var(--ink); }
.lead h3 { margin: 0; font-size: 16px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lead h3 small { font-weight: 500; color: var(--ink-3); font-size: 13px; }
.lead .meta { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.lead .why { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lead .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lead .ev { text-align: right; line-height: 1.15; }
.lead .ev b { display: block; font-size: 19px; color: var(--gold-text); font-variant-numeric: tabular-nums; }
.lead .ev small { color: var(--ink-3); font-size: 12px; }
.lead .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.outcome { height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 8px; font-size: 13px; }

/* goal */
.progress { height: 12px; border-radius: 6px; background: var(--surface-3); position: relative; overflow: visible; }
.progress > i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--blue); }
.progress > u { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--gold); text-decoration: none; }
.steps { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.steps b { color: var(--ink); }

/* kit */
.obj { padding: 18px 20px; }
.obj h3 { margin: 0 0 4px; font-size: 16px; }
.obj .say { margin: 10px 0 0; padding: 12px 14px; background: var(--surface-2); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; font-size: 14.5px; }
.obj dl { margin: 10px 0 0; display: grid; gap: 8px; font-size: 14px; }
.obj dt { font-weight: 700; color: var(--ink-2); font-size: 12.5px; }
.obj dd { margin: 0; color: var(--ink); }
.obj .never { color: var(--bad); }
.guard { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 16px; }
.guard ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }

/* states */
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.loading { display: grid; gap: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 22px; min-height: 420px; gap: 28px; background-position: center 30%; }
  .login-brand .rzpro { width: 72px; }
  .brand-tag span { font-size: 10.5px; } .brand-tag b { font-size: 13px; }
  .app { grid-template-columns: 1fr; }
  .nav { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; gap: 8px; overflow-x: auto; }
  .nav-brand { padding: 0 8px 0 0; } .nav-brand div { display: none; }
  .nav-list { flex-direction: row; } .nav-item { white-space: nowrap; padding: 9px 12px; } .nav-item[aria-current="page"]::before { display: none; }
  .nav-foot { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: 8px; align-items: center; } .nav-foot .who, .nav-foot .role { display: none; }
  .g-3, .g-2 { grid-template-columns: 1fr; }
  .lead { grid-template-columns: 1fr; } .lead .rank { text-align: left; display: flex; gap: 6px; align-items: baseline; } .lead .rank b { display: inline; font-size: 16px; }
  .lead .side { align-items: stretch; } .lead .ev { text-align: left; } .lead .acts { justify-content: flex-start; }
}
@media (max-width: 560px) { .g-4 { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 23px; } .main { padding-top: 18px; } .hero { padding: 20px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.file-note { font-size: 12.5px; color: var(--ink-3); margin: 8px 2px 4px; text-align: center; }
.login-alt .btn.block { margin-bottom: 2px; }

.forgot-row { margin: -6px 0 6px; text-align: right; }
.form-msg { min-height: 22px; margin: 4px 0 12px; font-size: 14px; font-weight: 600; color: var(--good); }
.form-msg.err { color: var(--bad); }

.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 84px; }
.pw-eye { position: absolute; right: 6px; top: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--blue); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.pw-eye:hover { background: var(--blue-wash); }
.pw-eye:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.done { text-align: left; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: #e3f6ea; color: #1a7f45; font-size: 30px; font-weight: 700; display: grid; place-items: center; margin-bottom: 20px; }
