/* =====================================================================
   AFERYX CALC — sistema visual (v2, 14/11/2026)
   Linguagem de produto SaaS: menu verde-profundo, superfícies claras,
   dourado só como acento. TODAS as cores ficam neste bloco.
   ===================================================================== */
:root {
  color-scheme: light;
  /* marca (tons da logo AFERYX: verde #01271f e dourado #eea107) */
  --brand: #0e3a2d;
  --brand-hover: #155040;
  --brand-2: #1d5b47;          /* verde médio para gradientes */
  --brand-soft: #e7f0eb;
  --brand-ink: #0e3a2d;
  --brand-deep: #01271f;
  --on-brand: #ffffff;
  --accent: #d9960a;
  --accent-2: #eea107;
  --accent-soft: #fbf1db;

  /* menu lateral (escuro nos dois temas) */
  --side-bg: #01271f;
  --side-bg-2: #06352a;
  --side-text: rgba(255, 255, 255, .66);
  --side-text-strong: #ffffff;
  --side-muted: rgba(255, 255, 255, .38);
  --side-hover: rgba(255, 255, 255, .06);
  --side-active: rgba(238, 161, 7, .12);
  --side-line: rgba(255, 255, 255, .08);

  /* superfícies e tinta */
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --surface-3: #eef0eb;
  --field: #f7f8f5;
  --border: rgba(16, 32, 26, .08);
  --border-strong: rgba(16, 32, 26, .16);
  --text: #0f1a15;
  --muted: #5b6660;
  --faint: #8b948f;

  /* estados (fixos) */
  --good: #1f7a4d; --good-soft: #e6f3ec;
  --warn: #8f5d00; --warn-soft: #fbf3e2;
  --bad: #b42318;  --bad-soft: #fdeceb;
  --info: #2c5aa0; --info-soft: #ecf2fb;

  /* gráficos (validados: CVD, contraste, chroma) */
  --series-1: #1f8152; --series-2: #c48a1c; --series-3: #4a72d4;
  --grid: #ebebe6; --axis: #c9c9c1;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(1, 39, 31, .04), 0 1px 1px rgba(1, 39, 31, .03);
  --shadow-2: 0 1px 2px rgba(1, 39, 31, .05), 0 8px 24px -12px rgba(1, 39, 31, .14);
  --shadow-3: 0 2px 6px rgba(1, 39, 31, .06), 0 24px 48px -20px rgba(1, 39, 31, .28);
  --ring: 0 0 0 4px rgba(14, 58, 45, .12);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #3f9e72; --brand-hover: #52b386; --brand-2: #2a7a57; --brand-soft: rgba(79, 174, 128, .13); --brand-ink: #82d2aa; --on-brand: #04130d;
    --accent: #eea107; --accent-2: #f5b52e; --accent-soft: rgba(238, 161, 7, .12);
    --side-bg: #04140f; --side-bg-2: #082019; --side-line: rgba(255, 255, 255, .06);
    --bg: #0b100e; --surface: #121916; --surface-2: #161e1a; --surface-3: #1c2520; --field: #0f1613;
    --border: rgba(255, 255, 255, .07); --border-strong: rgba(255, 255, 255, .14);
    --text: #ecf1ee; --muted: #9fa9a3; --faint: #6f7a74;
    --good: #4cc28a; --good-soft: rgba(76, 194, 138, .12); --warn: #e0a53a; --warn-soft: rgba(224, 165, 58, .12); --bad: #f0796e; --bad-soft: rgba(240, 121, 110, .12); --info: #7aa6ec; --info-soft: rgba(122, 166, 236, .12);
    --series-1: #13906b; --series-2: #b8801a; --series-3: #6a7fe0;
    --grid: #222a26; --axis: #36403b;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6); --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .7);
    --ring: 0 0 0 4px rgba(79, 174, 128, .18);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #3f9e72; --brand-hover: #52b386; --brand-2: #2a7a57; --brand-soft: rgba(79, 174, 128, .13); --brand-ink: #82d2aa; --on-brand: #04130d;
  --accent: #eea107; --accent-2: #f5b52e; --accent-soft: rgba(238, 161, 7, .12);
  --side-bg: #04140f; --side-bg-2: #082019; --side-line: rgba(255, 255, 255, .06);
  --bg: #0b100e; --surface: #121916; --surface-2: #161e1a; --surface-3: #1c2520; --field: #0f1613;
  --border: rgba(255, 255, 255, .07); --border-strong: rgba(255, 255, 255, .14);
  --text: #ecf1ee; --muted: #9fa9a3; --faint: #6f7a74;
  --good: #4cc28a; --good-soft: rgba(76, 194, 138, .12); --warn: #e0a53a; --warn-soft: rgba(224, 165, 58, .12); --bad: #f0796e; --bad-soft: rgba(240, 121, 110, .12); --info: #7aa6ec; --info-soft: rgba(122, 166, 236, .12);
  --series-1: #13906b; --series-2: #b8801a; --series-3: #6a7fe0;
  --grid: #222a26; --axis: #36403b;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6); --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --ring: 0 0 0 4px rgba(79, 174, 128, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01", "ss03"; }
.app { display: flex; min-height: 100vh; }
::selection { background: rgba(238, 161, 7, .28); }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: none; box-shadow: var(--ring); }
@media (prefers-reduced-motion: no-preference) {
  .view > * { animation: entrar .32s var(--ease) both; }
  .view > *:nth-child(2) { animation-delay: .03s; } .view > *:nth-child(3) { animation-delay: .06s; }
}
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------- menu lateral ---------------------------- */
.sidebar { width: 264px; flex-shrink: 0; background: radial-gradient(120% 60% at 0% 0%, var(--side-bg-2) 0%, var(--side-bg) 60%); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.sidebar::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(238, 161, 7, .55), transparent); }
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 20px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: block; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(238, 161, 7, .35), 0 8px 18px -8px rgba(0, 0, 0, .6); }
.empty-marca { width: 48px; height: 48px; border-radius: 13px; display: block; margin: 0 auto 14px; box-shadow: var(--shadow-2); }
.brand-name { font-weight: 800; font-size: 15.5px; letter-spacing: .1em; line-height: 1.1; white-space: nowrap; color: var(--side-text-strong); }
.brand-name span { color: var(--accent-2); font-weight: 700; }
.brand-sub { font-size: 8.5px; color: var(--side-muted); text-transform: uppercase; letter-spacing: .09em; margin-top: 5px; white-space: nowrap; }
.nav { padding: 4px 12px 16px; flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--side-muted); margin: 18px 12px 6px; font-weight: 600; }
.nav a { display: flex; gap: 11px; align-items: center; padding: 8px 12px; border-radius: 10px; cursor: pointer; color: var(--side-text); text-decoration: none; font-weight: 500; font-size: 13.5px; user-select: none; position: relative; transition: background .15s var(--ease), color .15s var(--ease); }
.nav a:hover { background: var(--side-hover); color: var(--side-text-strong); }
.nav a.active { background: var(--side-active); color: var(--side-text-strong); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-2); box-shadow: 0 0 12px rgba(238, 161, 7, .6); }
.nav a.active .ico { color: var(--accent-2); opacity: 1; }
.nav .ico { display: inline-flex; opacity: .8; transition: color .15s; }
.nav .ico svg.i { width: 17px; height: 17px; }
.sidebar-foot { margin: 8px 12px 14px; padding: 12px 14px; font-size: 11.5px; color: var(--side-muted); border: 1px solid var(--side-line); border-radius: 12px; background: rgba(255, 255, 255, .03); line-height: 1.55; }
.sidebar-foot b { color: var(--side-text-strong); font-weight: 600; }
.sidebar-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3fcf8e; box-shadow: 0 0 0 3px rgba(63, 207, 142, .18); margin-right: 6px; vertical-align: 1px; }

/* ------------------------------ topo ---------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 36px; position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.topbar.rolou { border-bottom-color: var(--border); }
.titulo-box { min-width: 0; }
/* Painel: saudação grande e minimalista */
.topbar.inicio { padding-top: 26px; padding-bottom: 18px; }
.topbar.inicio .eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); }
.topbar.inicio .eyebrow::after { display: none; }
.topbar.inicio h1 { font-size: 34px; font-weight: 600; letter-spacing: -1.1px; line-height: 1.15; margin-top: 4px; }
@media (max-width: 860px) { .topbar.inicio h1 { font-size: 24px; letter-spacing: -.6px; } .topbar.inicio { padding-top: 14px; padding-bottom: 12px; } }
.eyebrow { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; display: flex; align-items: center; gap: 6px; min-height: 16px; }
.eyebrow:empty { display: none; }
.eyebrow::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.topbar h1 { font-size: 21px; margin: 0; font-weight: 700; letter-spacing: -.45px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; }
.busca-btn { display: flex; flex-shrink: 0; white-space: nowrap; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; min-width: 240px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--faint); font: inherit; font-size: 13px; cursor: pointer; box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s, color .15s; }
.busca-btn:hover { border-color: var(--border-strong); color: var(--muted); }
.busca-btn span:not([data-ico]):not(.kbd) { flex: 1; text-align: left; } .busca-btn [data-ico] { display: inline-flex; }
.kbd { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface-2); font-family: var(--font); }
.pill { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); padding: 0 12px; height: 38px; border-radius: 10px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-1); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.theme-btn { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 10px; width: 38px; height: 38px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-1); transition: color .15s, border-color .15s, transform .15s; font-size: 14px; }
.theme-btn:hover { color: var(--text); border-color: var(--border-strong); }
.theme-btn:active { transform: scale(.94); }
.view { padding: 12px 36px 72px; max-width: 1480px; width: 100%; }

/* ----------------------------- estrutura ------------------------------ */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.sticky { position: sticky; top: 86px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow-2); }
.card h2 { font-size: 15px; margin: 0 0 4px; font-weight: 650; display: flex; align-items: center; gap: 10px; letter-spacing: -.2px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.55; }
.step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: linear-gradient(160deg, var(--brand-2), var(--brand)); color: #fff; font-size: 11.5px; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 6px -2px rgba(14, 58, 45, .5); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text); opacity: .85; }
.field .sub { font-size: 11.5px; color: var(--faint); font-weight: 450; }

input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--field); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 42px; width: 100%; min-width: 0; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease); }
textarea { min-height: 84px; line-height: 1.5; resize: vertical; }
input[type=range] { min-height: 0; padding: 0; border: 0; background: none; accent-color: var(--brand); }
input[type=file] { min-height: 0; padding: 8px; background: var(--surface-2); border-style: dashed; cursor: pointer; font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12.5px; border: 0; border-radius: 8px; padding: 7px 12px; margin-right: 10px; background: var(--brand); color: var(--on-brand); cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: var(--ring); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b948f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input[type=month], input[type=date] { cursor: pointer; }

/* controle segmentado: trilho + "pílula" que desliza */
.seg { display: inline-flex; position: relative; background: var(--surface-3); border-radius: 11px; padding: 4px; gap: 2px; flex-wrap: wrap; box-shadow: inset 0 1px 2px rgba(1, 39, 31, .06); }
.seg button { position: relative; z-index: 1; flex: 1 1 auto; white-space: nowrap; border: 0; background: transparent; padding: 7px 12px; min-height: 34px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(1, 39, 31, .1), 0 2px 8px -2px rgba(1, 39, 31, .12); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: auto; min-height: 0; }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; min-height: 0; padding: 0; border-radius: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; flex-shrink: 0; transition: background .15s, border-color .15s; }
input[type=checkbox]::after { content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .15s var(--ease); background: var(--on-brand); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
input[type=checkbox]:checked { background: var(--brand); border-color: var(--brand); }
input[type=checkbox]:checked::after { transform: scale(1); }

.tbl-input { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl-input th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 0 8px 8px 0; letter-spacing: .01em; }
.tbl-input td { padding: 4px 8px 4px 0; vertical-align: middle; }
.tbl-input td input, .tbl-input td select { min-height: 40px; padding: 8px 10px; }
.tbl-input td select { min-width: 128px; padding-right: 32px; }
.tbl-input td input { min-width: 96px; }
.tbl-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.icon-btn { border: 1px solid transparent; background: transparent; color: var(--faint); border-radius: 9px; width: 36px; height: 36px; cursor: pointer; font-size: 0; display: inline-grid; place-items: center; transition: background .15s, color .15s; }
.icon-btn::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat; }
.icon-btn:hover { color: var(--bad); background: var(--bad-soft); }

/* botões */
.btn { --b: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 16px; min-height: 40px; font: inherit; font-size: 13.5px; font-weight: 600; letter-spacing: -.05px; cursor: pointer; color: var(--on-brand); background: linear-gradient(180deg, color-mix(in srgb, var(--b) 88%, #fff) 0%, var(--b) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(1, 39, 31, .2), 0 4px 12px -4px rgba(14, 58, 45, .45); transition: transform .15s var(--ease), box-shadow .15s var(--ease), filter .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 4px rgba(1, 39, 31, .18), 0 10px 20px -8px rgba(14, 58, 45, .5); }
.btn:active { transform: translateY(0) scale(.98); filter: brightness(.97); }
.btn.ghost { color: var(--text); background: var(--surface); border-color: var(--border-strong); box-shadow: var(--shadow-1); filter: none; }
.btn.ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 40%, var(--border-strong)); color: var(--brand-ink); transform: translateY(-1px); }
.btn.accent { --b: var(--accent); color: #1d1300; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(80, 50, 0, .2), 0 4px 12px -4px rgba(217, 150, 10, .55); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label.btn { cursor: pointer; }

/* ----------------------------- resultados ----------------------------- */
/* destaque principal: cartão verde-profundo com brilho dourado */
.kpi-main { position: relative; overflow: hidden; border-radius: 18px; padding: 24px 26px 22px; margin-bottom: 16px; color: #fff; background: radial-gradient(130% 120% at 100% 0%, rgba(238, 161, 7, .22) 0%, transparent 46%), linear-gradient(150deg, #0e3a2d 0%, #01271f 100%); box-shadow: 0 20px 40px -22px rgba(1, 39, 31, .75), inset 0 1px 0 rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .06); }
.kpi-main::before { content: ""; position: absolute; inset: auto -40px -60px auto; width: 200px; height: 200px; border-radius: 50%; border: 1px solid rgba(238, 161, 7, .25); }
.kpi-main::after { content: ""; position: absolute; inset: auto -10px -90px auto; width: 200px; height: 200px; border-radius: 50%; border: 1px solid rgba(238, 161, 7, .14); }
.kpi-main .lbl { font-size: 12.5px; color: rgba(255, 255, 255, .72); font-weight: 600; letter-spacing: .01em; position: relative; }
.kpi-main .val { font-size: 40px; font-weight: 750; letter-spacing: -1.4px; margin: 6px 0 4px; line-height: 1.1; font-variant-numeric: tabular-nums; position: relative; }
.kpi-main .sm { font-size: 12.5px; color: rgba(255, 255, 255, .66); position: relative; }
.kpi-main .val small, .kpi-main .sm b { color: #fff; }
.kpi-main.good .val { color: #f8c75a; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-1); transition: transform .15s var(--ease), box-shadow .15s; }
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.kpi .lbl { font-size: 10.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; line-height: 1.35; }
.kpi .val { font-size: 18px; font-weight: 700; margin-top: 6px; letter-spacing: -.35px; font-variant-numeric: tabular-nums; }
.kpi.good .val { color: var(--good); }
.kpi.bad .val { color: var(--bad); }

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child, .tbl .l { text-align: left; }
.tbl thead th { font-size: 10.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tbl thead th:first-child { border-top-left-radius: 10px; } .tbl thead th:last-child { border-top-right-radius: 10px; }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong); border-bottom: 0; background: var(--surface-2); }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.tbl tr.dim td { color: var(--faint); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.tbl-wrap .tbl tbody tr:last-child td { border-bottom: 0; }
.lines { display: grid; gap: 0; }
.line { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border-strong); font-size: 13.5px; }
.line span:first-child { color: var(--muted); }
.line b { white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.line.total { border-bottom: 0; border-top: 2px solid var(--text); margin-top: 4px; padding-top: 12px; font-size: 16px; }
.line.total span:first-child { color: var(--text); font-weight: 700; }
.line.total b { font-weight: 750; }
.alert { border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 10px 0; display: flex; gap: 10px; border: 1px solid transparent; line-height: 1.5; }
.alert.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 18%, transparent); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 18%, transparent); }
.alert.good { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 18%, transparent); }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 18%, transparent); }
.progress { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 10px 0 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2) 70%, var(--accent)); border-radius: 99px; transition: width .5s var(--ease); }
details.memo { border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px; background: var(--surface-2); }
details.memo summary { cursor: pointer; font-weight: 650; color: var(--brand-ink); padding: 8px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.memo summary::-webkit-details-marker { display: none; }
details.memo summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease); }
details.memo[open] summary::before { transform: rotate(45deg); }
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 650; background: var(--surface-3); color: var(--muted); border: 1px solid transparent; vertical-align: 1px; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.good { background: var(--good-soft); color: var(--good); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); line-height: 1.6; }
.muted { color: var(--muted); }

/* Ajuda e tutoriais */
.tut { border-top: 1px solid var(--border); }
.tut:first-of-type { border-top: 0; }
.tut summary { list-style: none; cursor: pointer; padding: 14px 36px 14px 0; position: relative; display: flex; flex-direction: column; gap: 3px; }
.tut summary::-webkit-details-marker { display: none; }
.tut summary::after { content: ""; position: absolute; right: 8px; top: 20px; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .2s var(--ease); }
.tut[open] summary::after { transform: rotate(-135deg); top: 24px; }
.tut-tit { font-weight: 650; font-size: 14.5px; transition: color .15s; }
.tut summary:hover .tut-tit { color: var(--brand-ink); }
.tut-res { font-size: 13px; color: var(--muted); }
.tut-corpo { padding: 0 0 18px; font-size: 13.5px; line-height: 1.65; }
.tut-passos { margin: 0; padding-left: 0; list-style: none; counter-reset: p; }
.tut-passos li { counter-increment: p; position: relative; padding: 4px 0 4px 36px; margin: 2px 0; }
.tut-passos li::before { content: counter(p); position: absolute; left: 0; top: 4px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); }
.tut-dicas { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); font-size: 13px; }
.tut-dicas ul { margin: 4px 0 0; padding-left: 18px; }
.tut-pe { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; }
.gloss { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gloss > div { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.gloss dt { font-weight: 650; font-size: 13.5px; color: var(--brand-ink); }
.gloss dd { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.mt { margin-top: 14px; }
.right { text-align: right; }

/* ------------------------------ dashboard ----------------------------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-esc { font-size: 13px; font-weight: 600; color: var(--muted); }
.dash-head .ola { font-size: 13px; color: var(--muted); font-weight: 500; }
.dash-head .titulo { font-size: 26px; font-weight: 750; letter-spacing: -.7px; margin-top: 2px; }
.dash-head select { min-height: 38px; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.dash-grid > .card { margin: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }
.card.hero-num { color: #fff; border: 0; background: radial-gradient(120% 120% at 100% 0%, rgba(238, 161, 7, .24) 0%, transparent 45%), linear-gradient(150deg, #0e3a2d 0%, #01271f 100%); box-shadow: 0 24px 44px -24px rgba(1, 39, 31, .8); position: relative; overflow: hidden; }
.card.hero-num::after { content: ""; position: absolute; right: -50px; bottom: -70px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(238, 161, 7, .25); }
.hero-num .lbl { font-size: 12.5px; color: rgba(255, 255, 255, .72); font-weight: 600; }
.hero-num .val { font-size: 46px; font-weight: 750; letter-spacing: -1.6px; line-height: 1.1; margin: 8px 0 6px; color: #fff; font-variant-numeric: tabular-nums; }
.hero-num .sub { font-size: 12.5px; color: rgba(255, 255, 255, .66); }
.stat { padding: 4px 2px; }
.stat .lbl { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.stat .val { font-size: 26px; font-weight: 750; letter-spacing: -.7px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: #0f1a15; color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 3; box-shadow: var(--shadow-3); }
.chart .tip b { font-weight: 650; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; padding: 7px 0; }
.hbar-row .nome { font-size: 13px; color: var(--text); }
.hbar-row .trilho { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar-row .trilho > div { height: 100%; border-radius: 99px; background: var(--series-1); }
.hbar-row .valor { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.status-list { display: grid; gap: 10px; }
.status-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.status-item .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex-shrink: 0; margin-top: 1px; }
.status-item.ok .ic { background: var(--good-soft); color: var(--good); }
.status-item.warn .ic { background: var(--warn-soft); color: var(--warn); }
.status-item .t { font-weight: 650; font-size: 13px; }
.status-item .d { font-size: 12px; color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.quick button { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 16px; cursor: pointer; font: inherit; color: var(--text); position: relative; overflow: hidden; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.quick button::after { content: ""; position: absolute; right: 14px; top: 16px; width: 7px; height: 7px; border-top: 2px solid var(--faint); border-right: 2px solid var(--faint); transform: rotate(45deg); opacity: 0; transition: opacity .2s, transform .2s var(--ease); }
.quick button:hover { border-color: color-mix(in srgb, var(--brand) 40%, transparent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.quick button:hover::after { opacity: 1; transform: translateX(3px) rotate(45deg); }
.quick .i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--accent-2); background: linear-gradient(150deg, #0e3a2d, #01271f); box-shadow: 0 6px 14px -6px rgba(1, 39, 31, .6); }
.quick .t { font-weight: 650; font-size: 13.5px; margin-top: 12px; }
.quick .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.demo-flag { font-size: 11.5px; color: var(--warn); background: var(--warn-soft); padding: 5px 12px; border-radius: 99px; font-weight: 650; }

/* legado: blocos antigos ainda usados por alguma tela */
.hero, .tiles, .tile { display: none; }

.fab-result { display: none; position: fixed; right: 16px; bottom: 18px; z-index: 25; border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 650; background: linear-gradient(150deg, #0e3a2d, #01271f); color: #fff; box-shadow: 0 12px 28px -10px rgba(1, 39, 31, .7); cursor: pointer; }
@media (max-width: 1100px) { .fab-result.on { display: block; } }
.toast { position: fixed; bottom: 24px; right: 24px; display: flex; align-items: center; gap: 10px; transform: translateY(16px) scale(.98); opacity: 0; pointer-events: none; background: #0f1a15; color: #fff; padding: 12px 16px 12px 14px; border-radius: 12px; transition: transform .3s var(--ease), opacity .3s var(--ease); z-index: 60; font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-3); max-width: min(420px, calc(100vw - 32px)); border: 1px solid rgba(255, 255, 255, .08); }
.toast::before { content: ""; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; background: var(--accent-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301271f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.toast.show { transform: none; opacity: 1; }
.print-area { display: none; }

/* -------------- entrada das telas de cálculo (novo × consultar) -------- */
.entrada { max-width: 1040px; }
.entrada-topo { display: flex; gap: 16px; align-items: center; margin: 6px 0 22px; }
.entrada-topo h2 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.5px; }
.entrada-topo p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.entrada-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent-2); background: linear-gradient(150deg, #0e3a2d, #01271f); box-shadow: 0 10px 22px -10px rgba(1, 39, 31, .7); }
.entrada-ic svg.i { width: 24px; height: 24px; }
.entrada-opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.opcao { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; cursor: pointer; box-shadow: var(--shadow-2); position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.opcao:hover:not([disabled]) { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.opcao:active:not([disabled]) { transform: translateY(-1px) scale(.99); }
.opcao[disabled] { cursor: default; opacity: .6; box-shadow: none; }
.opcao-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 10px; }
.opcao-t { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.opcao-d { font-size: 13px; color: var(--muted); line-height: 1.5; min-height: 39px; }
.opcao-d b { color: var(--text); font-weight: 650; }
.opcao-ir { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--brand-ink); }
.opcao-ir svg.i { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.opcao:hover .opcao-ir svg.i { transform: translateX(3px); }
.opcao.primaria { color: #fff; border: 0; background: radial-gradient(120% 120% at 100% 0%, rgba(238, 161, 7, .24) 0%, transparent 50%), linear-gradient(150deg, #0e3a2d 0%, #01271f 100%); box-shadow: 0 22px 40px -22px rgba(1, 39, 31, .8); }
.opcao.primaria .opcao-ic { background: rgba(238, 161, 7, .16); color: var(--accent-2); }
.opcao.primaria .opcao-d { color: rgba(255, 255, 255, .7); }
.opcao.primaria .opcao-ir { color: var(--accent-2); }
.entrada-lista .card-head { flex-wrap: wrap; }
.tbl tr.clicavel { cursor: pointer; }

/* --------------------- caixa de diálogo própria ----------------------- */
.dlg { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 20, 15, .5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fundo .18s var(--ease); }
.dlg.saindo { opacity: 0; transition: opacity .15s; }
.dlg-box { position: relative; width: min(440px, 100%); border: 2px solid transparent; border-radius: 20px; padding: 28px 28px 22px; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 40%, var(--accent-2) 100%) border-box; box-shadow: 0 0 0 5px rgba(238, 161, 7, .09), 0 0 28px -6px rgba(14, 58, 45, .35), 0 24px 60px -20px rgba(1, 39, 31, .45); animation: caixa .24s var(--ease); text-align: left; }

.dlg-box.perigo { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--bad) 0%, #e8774d 100%) border-box; box-shadow: 0 0 0 4px rgba(194, 50, 31, .07), 0 24px 60px -20px rgba(80, 10, 0, .4); }
.dlg-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s; }
.dlg-x:hover { background: var(--surface-3); color: var(--text); }
.dlg-x svg.i { width: 16px; height: 16px; }
.dlg-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--accent-2); background: linear-gradient(150deg, #0e3a2d, #01271f); box-shadow: 0 10px 22px -10px rgba(1, 39, 31, .7); margin-bottom: 16px; }
.dlg-box.perigo .dlg-ic { color: var(--bad); background: var(--bad-soft); box-shadow: none; }
.dlg-ic svg.i { width: 22px; height: 22px; }
.dlg-box h3 { margin: 0 0 6px; font-size: 18px; font-weight: 750; letter-spacing: -.35px; }
.dlg-box p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.dlg-box p b { color: var(--text); font-weight: 650; }
.dlg-dica { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.dlg-btns .btn { min-height: 42px; padding: 0 18px; }
.btn.perigo { --b: #c2321f; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(80, 10, 0, .2), 0 4px 12px -4px rgba(194, 50, 31, .5); color: #fff; }
@media (max-width: 480px) { .dlg-btns .btn { flex: 1; } }

/* --------------------------- busca rápida (Ctrl+K) -------------------- */
.cmdk { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(4, 20, 15, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cmdk.on { display: flex; animation: fundo .18s var(--ease); }
@keyframes fundo { from { opacity: 0; } }
.cmdk-box { width: min(620px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-3); overflow: hidden; animation: caixa .22s var(--ease); }
@keyframes caixa { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.cmdk-top { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--faint); }
.cmdk-top input { border: 0; background: transparent; box-shadow: none; min-height: 56px; font-size: 15px; padding: 0; }
.cmdk-top input:focus { box-shadow: none; background: transparent; }
.cmdk-lista { max-height: min(420px, 60vh); overflow: auto; padding: 8px; }
.cmdk-grupo { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 10px 10px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--text); font-size: 13.5px; font-weight: 500; }
.cmdk-item .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.cmdk-item .ic svg.i { width: 16px; height: 16px; }
.cmdk-item small { margin-left: auto; color: var(--faint); font-size: 12px; }
.cmdk-item.sel { background: var(--brand-soft); }
.cmdk-item.sel .ic { background: linear-gradient(150deg, #0e3a2d, #01271f); color: var(--accent-2); }
.cmdk-vazio { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
.cmdk-pe { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--faint); background: var(--surface-2); }
.cmdk-pe span { display: inline-flex; gap: 6px; align-items: center; }

/* PDF gerado direto (html2pdf): sempre no tema claro, largura útil da folha A4 */
.pdf-render {
  color-scheme: light;
  --brand: #0e3a2d; --brand-hover: #155040; --brand-soft: #e9f1ed; --brand-ink: #0e3a2d; --on-brand: #fff; --accent: #d9960a;
  --bg: #fff; --surface: #fff; --surface-2: #f6f7f5; --border: #d9ddd9; --border-strong: #b9bfba;
  --text: #111; --muted: #555; --faint: #777;
  --good: #1f7a4d; --good-soft: #e8f4ed; --warn: #8f5d00; --warn-soft: #fbf3e2; --bad: #b42318; --bad-soft: #fdeceb; --info: #2c5aa0; --info-soft: #ecf2fb;
  display: block; width: 182mm; background: #fff; color: #111; font-size: 11.5px; line-height: 1.45;
}
/* o desenho do PDF erra o espaçamento de números tabulares (ex.: "11 /2026") */
.pdf-render, .pdf-render * { font-variant-numeric: normal !important; font-feature-settings: normal !important; }
.pdf-render .ph { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1.5px solid var(--brand); padding-bottom: 8px; margin-bottom: 14px; }
.pdf-render .ph h1 { font-size: 17px; margin: 0; color: var(--brand); }
.pdf-render .ph img { height: 38px; display: block; margin-bottom: 4px; }
.pdf-render .pf-marca { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 9.5px; color: #777; letter-spacing: .04em; }
.pdf-render .pf-marca img { width: 14px; height: 14px; }
.pdf-render h3 { font-size: 12.5px; color: var(--brand); margin: 14px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.pdf-render .tbl-wrap { overflow: visible; }
.pdf-render .tbl th, .pdf-render .tbl td { padding: 4px 5px; font-size: 10px; }
.pdf-render .tbl th { white-space: normal; letter-spacing: 0; font-size: 8.5px; vertical-align: bottom; }
.pdf-render .tbl-wrap, .pdf-render .tbl-scroll { overflow: visible; margin: 0; padding: 0; }
.pdf-render .card { border: 0; padding: 0; margin-bottom: 10px; box-shadow: none; background: #fff; }
.pdf-render details { display: block; }
.pdf-render details > summary { display: none; }
.pdf-render .doc-paper { border: 0; padding: 0; font-size: 12px; border-radius: 0; }
.pdf-render .doc-quebra { break-before: page; page-break-before: always; }
.pdf-render .doc-recibo { border-bottom: 0; }
.pdf-render .no-print { display: none !important; }

/* ------------------------------ documentos ---------------------------- */
.doc-paper { background: #fff; color: #111; border-radius: 6px; padding: 34px 40px; font-family: Georgia, "Times New Roman", serif; font-size: 13.5px; line-height: 1.55; border: 1px solid var(--border); }
.doc-paper p { text-align: justify; margin: 0 0 10px; }
.doc-titulo { text-align: center; font-family: var(--font); font-size: 15px; margin: 4px 0 18px; letter-spacing: .02em; }
.doc-paper h3 { font-family: var(--font); font-size: 12.5px; margin: 16px 0 8px; }
.doc-lista { margin: 4px 0 12px 18px; padding: 0; } .doc-lista li { margin-bottom: 4px; text-align: justify; }
.doc-data { margin-top: 18px !important; text-align: right !important; }
.doc-assin { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; margin: 40px 0 10px; text-align: center; font-family: var(--font); font-size: 12px; font-weight: 600; }
.doc-assin > div { min-width: 240px; }
.doc-linha { border-top: 1px solid #111; margin-bottom: 6px; }
.doc-destaque { background: #f1f5f2; border-left: 3px solid #0e3a2d; padding: 10px 14px; margin: 10px 0 14px; font-family: var(--font); }
.doc-recibo-topo { display: flex; justify-content: space-between; align-items: center; }
.doc-recibo-topo .doc-titulo { text-align: left; margin: 0; }
.doc-valor { font-family: var(--font); font-weight: 700; font-size: 18px; border: 1.5px solid #111; padding: 4px 12px; border-radius: 6px; }
.doc-tab { width: 100%; border-collapse: collapse; font-size: 11.5px; font-family: var(--font); margin-top: 10px; }
.doc-tab td { border: 1px solid #bbb; padding: 4px 6px; }
.doc-recibo { padding-bottom: 18px; border-bottom: 1px dashed #999; margin-bottom: 18px; }
.doc-timbre img { width: 100%; display: block; }
.doc-timbre-texto { border-bottom: 1px solid #0e3a2d; padding-bottom: 6px; margin-bottom: 16px; font-family: var(--font); display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: #333; }
.doc-timbre-texto b { font-size: 14px; color: #0e3a2d; }
.doc-timbre-texto img { height: 34px; }
/* no PDF os destaques voltam ao visual de papel (fundo branco, fio verde) */
.pdf-render { --surface-3: #eef0eb; --field: #fff; --accent-soft: #fbf1db; --brand-2: #1d5b47; }
.pdf-render .kpi-main, .pdf-render .card.hero-num { background: #fff; color: #111; border: 1px solid var(--border); box-shadow: none; border-radius: 10px; }
.pdf-render .kpi-main::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; height: auto; border: 0; border-radius: 0; background: var(--brand); }
.pdf-render .kpi-main::after, .pdf-render .card.hero-num::after { display: none; }
.pdf-render .kpi-main .lbl, .pdf-render .kpi-main .sm { color: var(--muted); }
.pdf-render .kpi-main .val { color: #111; font-size: 30px; }
.pdf-render .kpi-main.good .val { color: var(--good); }
.pdf-render .kpi { box-shadow: none; }
.pdf-render .line { border-bottom-style: solid; border-bottom-color: var(--border); }
.pdf-render .tbl-wrap { border: 0; border-radius: 0; }
.pdf-render .tbl thead th { background: transparent; }
.pdf-render .tbl tfoot td { background: transparent; }
.pdf-render .alert { border-radius: 8px; }
.pdf-render details.memo { border: 0; padding: 0; background: transparent; }
/* ------------------------------ conta --------------------------------- */
.conta-chip { display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 10px 12px; border: 1px solid var(--side-line); border-radius: 12px; background: rgba(255, 255, 255, .04); color: var(--side-text); font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.conta-chip:hover { background: rgba(255, 255, 255, .08); border-color: rgba(238, 161, 7, .3); }
.conta-av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 12px; font-weight: 700; color: #01271f; background: linear-gradient(150deg, #f5b52e, #d9960a); }
.conta-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.conta-info b { color: var(--side-text-strong); font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conta-info small { font-size: 11px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conta-info small.warn { color: #f5c25a; } .conta-info small.bad { color: #f39b8f; } .conta-info small.good { color: #7fdcb0; }
.sync { width: 8px; height: 8px; border-radius: 50%; background: #3fcf8e; box-shadow: 0 0 0 3px rgba(63, 207, 142, .18); flex-shrink: 0; }
.sync[data-estado="offline"] { background: #f5b52e; box-shadow: 0 0 0 3px rgba(245, 181, 46, .2); }

/* telas cheias: planos, sem conexão */
.conta-tela { position: fixed; inset: 0; z-index: 100; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(90% 70% at 50% 0%, #0b3b2d 0%, #01271f 55%, #00170f 100%); }
.conta-caixa { width: min(440px, 100%); background: var(--surface); border-radius: 22px; padding: 36px 32px 28px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); text-align: center; animation: caixa .3s var(--ease); }
.conta-caixa.largo { width: min(680px, 100%); }
.conta-marca { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 18px; box-shadow: 0 0 0 1px rgba(238, 161, 7, .35), 0 12px 24px -10px rgba(0, 0, 0, .5); }
.conta-caixa h1 { margin: 0 0 8px; font-size: 24px; font-weight: 750; letter-spacing: -.6px; }
.conta-sub { margin: 0 auto 22px; color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 480px; }
.conta-msg { min-height: 20px; color: var(--bad); font-size: 13px; margin: 14px 0 0; }
.conta-link { margin-top: 16px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.planos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; text-align: left; }
.plano { position: relative; border: 1px solid var(--border-strong); border-radius: 16px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.plano.destaque { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--brand), var(--accent-2)) border-box; }
.plano-selo { position: absolute; top: -11px; right: 16px; font-size: 11px; font-weight: 700; color: #1d1300; background: linear-gradient(150deg, #f5b52e, #d9960a); padding: 3px 10px; border-radius: 99px; }
.plano-n { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.plano-v { font-size: 30px; font-weight: 750; letter-spacing: -1px; margin-top: 4px; }
.plano-v small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.plano-d { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.plano .btn { margin-top: auto; width: 100%; }

/* ------------------------------ responsivo ---------------------------- */
@media (max-width: 1240px) { .busca-btn { min-width: 0; } .busca-btn span:not([data-ico]), .busca-btn .kbd { display: none; } .busca-btn { width: 38px; padding: 0; justify-content: center; } .pill { display: none; } }
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; } .sticky { position: static; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } .span-3 { grid-column: span 6; }
}
.sidebar-fundo { display: none; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); transition: transform .28s var(--ease); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
  .sidebar.open + .sidebar-fundo { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(4, 20, 15, .4); backdrop-filter: blur(2px); }
  .menu-btn { display: inline-flex; }
  .view { padding: 6px 16px 88px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
  .eyebrow { font-size: 10.5px; }
  .card { padding: 18px 16px; border-radius: 12px; }
  .kpi-main .val { font-size: 32px; }
  .tbl-input thead { display: none; }
  .tbl-input tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .tbl-input td { padding: 0; }
  .hero-num .val { font-size: 36px; }
  .hbar-row { grid-template-columns: 100px 1fr auto; }
  .toast { right: 16px; left: 16px; bottom: 16px; }
}
@media (max-width: 480px) { .span-3 { grid-column: span 12; } .dash-head .titulo { font-size: 22px; } }
/* ------------------------------ impressão ----------------------------- */
@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    color-scheme: light;
    --brand: #0e3a2d; --brand-hover: #155040; --brand-soft: #e9f1ed; --brand-ink: #0e3a2d; --on-brand: #fff; --accent: #d9960a;
    --bg: #fff; --surface: #fff; --surface-2: #f6f7f5; --border: #d9ddd9; --border-strong: #b9bfba;
    --text: #111; --muted: #555; --faint: #777;
    --good: #1f7a4d; --good-soft: #e8f4ed; --warn: #8f5d00; --warn-soft: #fbf3e2; --bad: #b42318; --bad-soft: #fdeceb; --info: #2c5aa0; --info-soft: #ecf2fb;
  }
  @page { size: A4; margin: 14mm; }
  body { background: #fff; color: #000; font-size: 11.5px; }
  .app, .toast, .fab-result { display: none !important; }
  .print-area { display: block; }
  .print-area .ph { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 1.5px solid var(--brand); padding-bottom: 8px; margin-bottom: 14px; }
  .print-area .pf-marca { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 9.5px; color: #777; letter-spacing: .04em; }
  .print-area .pf-marca img { width: 14px; height: 14px; }
  .print-area .ph h1 { font-size: 17px; margin: 0; color: var(--brand); }
  .print-area .ph img { height: 38px; display: block; margin-bottom: 4px; }
  .print-area h3 { font-size: 12.5px; color: var(--brand); margin: 14px 0 6px; border-bottom: 1px solid var(--border); padding-bottom: 3px; }
  .print-area .tbl th, .print-area .tbl td { padding: 4px 6px; font-size: 10.5px; }
  .print-area .card { border: 0; padding: 0; margin-bottom: 10px; break-inside: avoid; }
  .print-area .kpi-main, .print-area .kpi, .print-area .alert, .print-area .tag, .print-area .doc-destaque, .print-area .kpi-main::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area details { display: block; }
  .print-area details > summary { display: none; }
  .print-area .doc-paper { border: 0; padding: 0; font-size: 12px; }
  .print-area .doc-quebra { page-break-before: always; }
  .print-area .doc-recibo { border-bottom: 0; }
  .no-print { display: none !important; }
}
