/* =====================================================================
   CaixaVista — estilos
   Temas: claro (padrão), escuro, automático (segue o sistema)
   ===================================================================== */
:root {
  color-scheme: light;
  --accent: #0e9f6e;
  --accent-ink: #fff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 35%, transparent);

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f3;
  --border: #e4e7eb;
  --border-strong: #d3d8de;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #7a8696;
  --ring: color-mix(in srgb, var(--accent) 45%, transparent);

  /* identidade das séries (entradas/saídas) — par validado para daltonismo */
  --in: #2a78d6;
  --out: #eb6834;
  --in-soft: rgba(42, 120, 214, .12);
  --out-soft: rgba(235, 104, 52, .12);

  /* status */
  --ok: #0a7a3c;
  --ok-bg: #e8f6ee;
  --warn: #a35a00;
  --warn-bg: #fff4e0;
  --bad: #c62828;
  --bad-bg: #fdecec;
  --info: #1d5fae;
  --info-bg: #e9f1fc;

  --grid: #e9ebee;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 50px -12px rgba(15, 23, 42, .25);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 256px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0f14;
    --surface: #121820;
    --surface-2: #161d26;
    --surface-3: #1d2530;
    --border: #232c37;
    --border-strong: #2f3a47;
    --text: #e7edf3;
    --text-2: #b4c0cc;
    --muted: #8593a3;
    --in: #3987e5;
    --out: #d95926;
    --in-soft: rgba(57, 135, 229, .16);
    --out-soft: rgba(217, 89, 38, .16);
    --ok: #34c472;
    --ok-bg: rgba(52, 196, 114, .12);
    --warn: #f5b440;
    --warn-bg: rgba(245, 180, 64, .12);
    --bad: #f47171;
    --bad-bg: rgba(244, 113, 113, .12);
    --info: #6aa8f0;
    --info-bg: rgba(106, 168, 240, .12);
    --grid: #1f2731;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f14;
  --surface: #121820;
  --surface-2: #161d26;
  --surface-3: #1d2530;
  --border: #232c37;
  --border-strong: #2f3a47;
  --text: #e7edf3;
  --text-2: #b4c0cc;
  --muted: #8593a3;
  --in: #3987e5;
  --out: #d95926;
  --in-soft: rgba(57, 135, 229, .16);
  --out-soft: rgba(217, 89, 38, .16);
  --ok: #34c472;
  --ok-bg: rgba(52, 196, 114, .12);
  --warn: #f5b440;
  --warn-bg: rgba(245, 180, 64, .12);
  --bad: #f47171;
  --bad-bg: rgba(244, 113, 113, .12);
  --info: #6aa8f0;
  --info-bg: rgba(106, 168, 240, .12);
  --grid: #1f2731;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--accent); font-weight: 500; }
a.link:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
code { font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.ic { flex-shrink: 0; vertical-align: middle; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
::selection { background: var(--accent-soft); }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 4px 12px -4px var(--accent);
  flex-shrink: 0;
}
.brand-mark.lg { width: 48px; height: 48px; border-radius: 14px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: var(--surface-2); }
.brand-logo.lg { width: 44px; height: 44px; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item span { flex: 1; }
.nav-badge {
  font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--bad); color: #fff; display: grid; place-items: center;
}
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px; display: flex; align-items: center; gap: 6px; }
.me { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; min-width: 0; }
.me:hover, .me.active { background: var(--surface-3); }
.me-txt { display: flex; flex-direction: column; min-width: 0; }
.me-txt strong { font-size: 13px; }
.me-txt small { color: var(--muted); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 600; font-size: 12px; flex-shrink: 0;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 20px; font-weight: 700; }
.topbar-title p { color: var(--muted); font-size: 13px; margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }

.scrim { display: none; }
.only-mobile { display: none !important; }

/* ---------------------------------------------------------------- Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 88%, #000); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-bg); }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.danger:hover { color: var(--bad); background: var(--bad-bg); }
.icon-btn.ok:hover { color: var(--ok); background: var(--ok-bg); }

#themeBtn .t-light, #themeBtn .t-dark, #themeBtn .t-auto { display: none; }
html[data-pref="light"] #themeBtn .t-light, html[data-pref="dark"] #themeBtn .t-dark, html[data-pref="auto"] #themeBtn .t-auto { display: inline-grid; }

/* ---------------------------------------------------------------- Formulários */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: inherit; transition: border-color .12s, box-shadow .12s;
}
.input:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--text-2)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
textarea.input { height: auto; padding: 9px 12px; resize: vertical; }
select.input { appearance: none; padding-right: 32px; 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='%237a8696' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-sm { height: 32px; font-size: 13px; padding: 0 10px; }
select.input-sm { padding-right: 28px; }
input[type="date"].input { padding-right: 8px; }
input[type="color"].input { padding: 4px; width: 56px; }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.input-prefix .input { padding-left: 36px; font-variant-numeric: tabular-nums; }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.pw-toggle:hover { color: var(--text); }
.hint { color: var(--muted); font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; }

.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 4px 0 14px; user-select: none; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 38px; height: 22px; border-radius: 11px; background: var(--border-strong); position: relative; transition: background .15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(16px); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 3px var(--ring); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
input[type="checkbox"] { accent-color: var(--accent); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--surface-3); border-radius: 10px; margin-bottom: 16px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border-radius: 7px; font-weight: 500; color: var(--text-2); transition: all .12s; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-in input:checked + span .ic { color: var(--in); }
.seg-out input:checked + span .ic { color: var(--out); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }

/* ---------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 600; flex: 1; display: flex; align-items: center; gap: 8px; }
.card-head .sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.card-body { padding: 18px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.section-title { font-size: 15px; font-weight: 600; margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 14px; }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.kpi-ic.in { background: var(--in-soft); color: var(--in); }
.kpi-ic.out { background: var(--out-soft); color: var(--out); }
.kpi-ic.acc { background: var(--accent-soft); color: var(--accent); }
.kpi-ic.bad { background: var(--bad-bg); color: var(--bad); }
.kpi-ic.warn { background: var(--warn-bg); color: var(--warn); }
.kpi-ic.ok { background: var(--ok-bg); color: var(--ok); }
.kpi-val { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 10px; white-space: nowrap; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi a.kpi-link { position: absolute; inset: 0; }
.kpi:has(a.kpi-link):hover { border-color: var(--border-strong); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 1px 7px; border-radius: 20px; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--muted); background: var(--surface-3); }
.val-neg { color: var(--bad); }
.val-pos { color: var(--ok); }

/* Alertas */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid transparent; margin-bottom: 14px; font-size: 13.5px; }
.alert .ic { margin-top: 1px; }
.alert > div { flex: 1; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-erro { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-aviso { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert b { font-weight: 600; }
.alert a { text-decoration: underline; font-weight: 500; }

.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.insight { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); align-items: flex-start; }
.insight .kpi-ic { width: 34px; height: 34px; flex-shrink: 0; }
.insight h4 { font-size: 13.5px; font-weight: 600; }
.insight p { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.insight .val { font-weight: 700; font-size: 16px; margin-top: 4px; }
.insight a { font-size: 12.5px; color: var(--accent); font-weight: 500; display: inline-block; margin-top: 6px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: var(--surface-3); }
.badge.nodot::before { display: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); background: var(--surface-3); padding: 1px 7px; border-radius: 10px; }

/* Chips (filtros rápidos) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chip b { font-weight: 600; font-size: 11.5px; background: var(--surface-3); color: var(--text-2); padding: 0 6px; border-radius: 8px; }
.chip.active b { background: var(--accent); color: var(--accent-ink); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.mini-tabs { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: 8px; gap: 2px; }
.mini-tabs button, .mini-tabs a { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-2); padding: 4px 10px; border-radius: 6px; cursor: pointer; }
.mini-tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Tabelas */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .chk { width: 1%; padding-right: 0; }
.table .tipo-ic { width: 1%; padding-right: 0; }
.t-desc { font-weight: 500; }
.t-sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 1px; }
.tipo-in { color: var(--in); }
.tipo-out { color: var(--out); }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.table.compact td { padding: 8px 14px; }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); font-size: 13px; font-weight: 500; }
.bulkbar.show { display: flex; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1; min-width: 200px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filters .field { margin: 0; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager .row { gap: 4px; }
.totals { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.totals span { color: var(--muted); }
.totals b { font-variant-numeric: tabular-nums; margin-left: 4px; }

/* Estados vazios */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { color: var(--border-strong); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { margin-bottom: 14px; }
.empty.big { padding: 80px 20px; }
.empty.big h2 { color: var(--text); margin: 8px 0; }

/* Barras horizontais (ranking) */
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-top { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.hbar-top .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.hbar-top .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar-top .p { color: var(--muted); font-size: 12px; width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; background: var(--out); min-width: 2px; }
.hbar-fill.in { background: var(--in); }

/* Listas */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .meta { font-size: 12px; color: var(--muted); }
.date-box { width: 44px; text-align: center; border-radius: 8px; background: var(--surface-3); padding: 4px 0; flex-shrink: 0; line-height: 1.15; }
.date-box b { display: block; font-size: 15px; }
.date-box small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.date-box.late { background: var(--bad-bg); color: var(--bad); }
.date-box.late small { color: var(--bad); }
.date-box.today { background: var(--warn-bg); color: var(--warn); }
.date-box.today small { color: var(--warn); }

/* Contas bancárias */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.account { padding: 18px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.account::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 5px; background: var(--c, var(--accent)); border-radius: var(--radius) 0 0 var(--radius); }
.account-head { display: flex; align-items: center; gap: 12px; }
.account-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); flex-shrink: 0; }
.account-head h4 { font-size: 15px; }
.account-head small { color: var(--muted); }
.account-bal { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.account-meta { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.account-meta b { color: var(--text); font-weight: 600; }
.account-actions { display: flex; gap: 4px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; }
.account.inactive { opacity: .6; }
.acc-mini { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.acc-mini:last-child { border-bottom: 0; }
.acc-mini .grow { flex: 1; min-width: 0; }

/* Gráficos */
.chart-box { position: relative; height: 290px; }
.chart-box.sm { height: 220px; }
.chart-box.lg { height: 340px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; vertical-align: 3px; }
.legend i.dashed { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; height: 2px; vertical-align: 3px; width: 16px; }
.proj-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.proj-sum > div { background: var(--surface); padding: 12px 18px; }
.proj-sum small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.proj-sum b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Calendário */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; text-transform: uppercase; padding-bottom: 2px; }
.cal-d { min-width: 0; overflow: hidden; min-height: 78px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; background: var(--surface); }
.cal-d.out { background: transparent; border-style: dashed; opacity: .4; }
.cal-d.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-d .n { font-weight: 600; color: var(--text-2); }
.cal-d .e, .cal-d .s, .cal-d .b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-d .e { color: var(--in); font-variant-numeric: tabular-nums; }
.cal-d .s { color: var(--out); font-variant-numeric: tabular-nums; }
.cal-d .b { margin-top: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-d .b.neg { color: var(--bad); font-weight: 600; }
.cal-d a { display: contents; }

/* DRE */
.dre td { padding: 9px 16px; }
.dre .sub td { color: var(--text-2); }
.dre .sub td:first-child { padding-left: 32px; }
.dre .tot td { font-weight: 700; background: var(--surface-2); }
.dre .big td { font-size: 15px; }
.dre .pct { color: var(--muted); font-size: 12px; width: 70px; text-align: right; }

/* Permissões */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.perm-group { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.perm-group h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; }
.perm-group h5 button { margin-left: auto; font-size: 11.5px; text-transform: none; letter-spacing: 0; }
.perm-group .check { padding: 6px 0; }
.perm-group .check small { display: block; color: var(--muted); }
.perm-tags { display: flex; gap: 4px; flex-wrap: wrap; }

/* Cores de destaque */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.swatch input { position: absolute; opacity: 0; }
.swatch i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.swatch input:checked + i { box-shadow: 0 0 0 2px var(--text); }
.swatch i .ic { opacity: 0; }
.swatch input:checked + i .ic { opacity: 1; }
.theme-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)); gap: 12px; }
.theme-opt { cursor: pointer; position: relative; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt .prev { height: 84px; border-radius: 10px; border: 2px solid var(--border); overflow: hidden; display: grid; grid-template-columns: 30% 70%; }
.theme-opt .prev.l { background: #f5f6f8; } .theme-opt .prev.l i { background: #fff; border-right: 1px solid #e4e7eb; }
.theme-opt .prev.d { background: #0b0f14; } .theme-opt .prev.d i { background: #121820; border-right: 1px solid #232c37; }
.theme-opt .prev.a { background: linear-gradient(135deg, #f5f6f8 50%, #0b0f14 50%); }
.theme-opt .prev.a i { background: linear-gradient(135deg, #fff 50%, #121820 50%); }
.theme-opt span { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 6px; font-weight: 500; font-size: 13px; }
.theme-opt input:checked + .prev { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

/* ---------------------------------------------------------------- Modal */
dialog.modal { border: 0; padding: 0; background: transparent; max-width: 620px; width: calc(100% - 24px); color: var(--text); max-height: calc(100vh - 24px); overflow: visible; }
dialog.modal-sm { max-width: 440px; }
dialog.modal-lg { max-width: 860px; }
dialog.modal::backdrop { background: rgba(10, 15, 25, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { flex: 1; font-size: 16px; }
.modal-body { padding: 18px 20px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.pago-box { display: none; }
.pago-box.show { display: grid; }
details.more { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 6px; }
details.more summary { list-style: none; cursor: pointer; color: var(--accent); font-weight: 500; font-size: 13px; padding: 6px 0 10px; display: inline-flex; align-items: center; gap: 4px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .ic { transform: rotate(180deg); }
.repeat { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.baixa-desc { font-weight: 500; margin-bottom: 14px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border); }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: slidein .2s ease-out; }
.toast .ic { color: var(--ok); margin-top: 1px; }
.toast span { flex: 1; }
.toast-erro { border-left-color: var(--bad); } .toast-erro .ic { color: var(--bad); }
.toast-aviso { border-left-color: var(--warn); } .toast-aviso .ic { color: var(--warn); }
.toast-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }

/* Menu suspenso simples */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 4px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 6px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); }

.periodo { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.periodo-custom { display: inline-flex; gap: 6px; align-items: center; }
.periodo .input { width: auto; }

.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.greet h2 { font-size: 22px; font-weight: 700; }
.greet h2 span { color: var(--accent); }
.greet p { color: var(--muted); margin-top: 2px; }

.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.step { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; gap: 12px; }
.step::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.step.done::before { content: "✓"; background: var(--accent); color: var(--accent-ink); }
.step h4 { font-size: 13.5px; }
.step p { font-size: 12.5px; color: var(--muted); margin: 2px 0 6px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* ---------------------------------------------------------------- Login / instalação */
.auth-page { background: var(--bg); }
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side { position: relative; background: var(--accent); color: #fff; display: flex; align-items: center; padding: 48px; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.18), transparent 50%), radial-gradient(circle at 90% 90%, rgba(0,0,0,.25), transparent 55%); pointer-events: none; }
.auth-side-inner { position: relative; z-index: 1; max-width: 440px; }
.auth-side .brand-mark { background: rgba(255,255,255,.18); box-shadow: none; }
.auth-side h2 { font-size: 30px; font-weight: 700; margin: 26px 0 22px; letter-spacing: -.02em; }
.auth-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.auth-list li { display: flex; gap: 10px; align-items: center; opacity: .95; }
.auth-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 38%; color: #fff; opacity: .5; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 36px; }
.auth-brand div { display: flex; flex-direction: column; }
.auth-brand small { color: var(--muted); }
.auth-card h1 { font-size: 26px; font-weight: 700; }
.auth-card > p { margin: 4px 0 24px; }
.auth-card .btn-block { margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; }
.install { max-width: 680px; margin: 0 auto; padding: 40px 16px 60px; }
.install-head { text-align: center; margin-bottom: 24px; }
.install-head .brand-mark { margin: 0 auto 14px; }
.install-head h1 { font-size: 26px; }
.install-head p { color: var(--muted); margin-top: 6px; }
.install-card { padding: 24px; }
.install-card h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin: 6px 0 8px; }
.install-card h2:not(:first-child) { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.install-card > p { margin-bottom: 14px; font-size: 13px; }

/* ---------------------------------------------------------------- Responsivo */
@media (max-width: 1180px) {
  .cols-21, .cols-12 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .only-mobile { display: inline-grid !important; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 40px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .grid-2, .grid-3, .grid-4, .repeat { grid-template-columns: minmax(0, 1fr); }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p { display: none; }
  .kpi-val { font-size: 21px; }
  .proj-sum { grid-template-columns: 1fr; }
  .cal { gap: 3px; }
  .cal-d { min-height: 56px; padding: 4px; font-size: 10px; }
  .cal-d .b { display: none; }
  .cal-d .e, .cal-d .s { font-size: 9px; }
  .dre td { padding: 8px 10px; }
  .dre .sub td:first-child { padding-left: 18px; }
  .dre .pct { width: 44px; }
  .theme-opts { grid-template-columns: repeat(3, 1fr); }
  .table .hide-m { display: none; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
}

/* ---------------------------------------------------------------- Impressão / PDF */
@media print {
  @page { margin: 12mm; }
  :root, :root[data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f6f7f9; --surface-3: #eef0f3; --border: #dde1e6; --text: #000; --text-2: #333; --muted: #666; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar-actions, .no-print, .toasts, .actions, .chk, .bulkbar, .pager, .toolbar .btn, dialog, .only-mobile { display: none !important; }
  .topbar { position: static; background: none; border: 0; padding: 0 0 10px; backdrop-filter: none; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .grid, .kpis { gap: 10px; }
  a { text-decoration: none; }
}

/* =====================================================================
   Guia de uso (ajuda.php)
   ===================================================================== */
.guide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.guide-toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
.guide-toc .input-icon { margin-bottom: 12px; }
.guide-toc nav { display: flex; flex-direction: column; gap: 1px; }
.guide-toc .toc-sec { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 4px; }
.guide-toc a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; }
.guide-toc a:hover { background: var(--surface-3); color: var(--text); }
.guide-toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.guide-toc a .ic { opacity: .8; }
.guide-toc a.locked { opacity: .55; }
.guide-select { display: none; margin-bottom: 14px; }

.guide-hero { padding: 26px 28px; margin-bottom: 22px; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.guide-hero h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; max-width: calc(100% - 110px); }
.guide-hero p { color: var(--text-2); max-width: 680px; }
.guide-hero .row { margin-top: 16px; }
.guide-hero .hero-ic { position: absolute; right: 24px; top: 18px; color: var(--accent); opacity: .18; }

.gsec { scroll-margin-top: 84px; margin-bottom: 22px; }
.gsec > .card-head h3 { font-size: 17px; }
.gsec .gico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.gsec .card-body { font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
.gsec .card-body > * + * { margin-top: 14px; }
.gsec h4 { font-size: 14.5px; color: var(--text); margin-top: 22px !important; display: flex; align-items: center; gap: 8px; }
.gsec p b, .gsec li b { color: var(--text); font-weight: 600; }
.gsec ul { margin: 0; padding-left: 20px; }
.gsec ul li + li { margin-top: 4px; }
.gsec .lead { font-size: 15px; color: var(--text); }

ol.gsteps { list-style: none; counter-reset: g; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
ol.gsteps > li { counter-increment: g; position: relative; padding: 10px 14px 10px 50px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
ol.gsteps > li::before { content: counter(g); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
ol.gsteps > li small { display: block; color: var(--muted); margin-top: 2px; }

.ui { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; white-space: nowrap; vertical-align: 1px; line-height: 1.6; }
.ui.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ui.ok { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.ui.menu { border-style: dashed; }
.ui .ic { width: 13px; height: 13px; }

.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px; }
.callout > .ic { margin-top: 2px; }
.callout.tip { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.callout.tip > .ic { color: var(--info); }
.callout.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.callout.warn > .ic { color: var(--warn); }
.callout b { color: var(--text); }

.gtable { width: 100%; border-collapse: collapse; font-size: 13.5px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.gtable th { text-align: left; background: var(--surface-2); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.gtable td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.gtable tr:last-child td { border-bottom: 0; }
.gtable td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }

.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px; }
.gcard { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.gcard h5 { margin: 0 0 4px; font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.gcard p { font-size: 13px; margin: 0; }

.gfoot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.gfoot .muted { font-size: 12.5px; }
.lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); background: var(--warn-bg); padding: 2px 9px; border-radius: 20px; font-weight: 500; }

.faq details { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.faq details + details { margin-top: 8px; }
.faq summary { cursor: pointer; padding: 11px 14px; font-weight: 500; color: var(--text); list-style: none; display: flex; align-items: center; gap: 8px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 14px 12px; font-size: 14px; }

.gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 10px; }
.gloss div { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 13.5px; }
.gloss b { display: block; color: var(--text); }

.gsec.hide-search { display: none; }
mark.hl { background: color-mix(in srgb, var(--warn) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.no-results { display: none; }

@media (max-width: 640px) {
  .gtable td:first-child { white-space: normal; }
  .gtable td, .gtable th { padding: 8px 9px; }
  .gsec .card-body { padding: 16px 14px; }
  ol.gsteps > li { padding-left: 44px; }
  .ui { white-space: normal; }
}
@media (max-width: 1100px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
  .guide-toc { display: none; }
  .guide-select { display: block; }
}
@media print {
  .guide { display: block; }
  .guide-toc, .guide-select, .guide-hero .row, .gfoot .btn { display: none !important; }
  .gsec { break-inside: auto; }
  .gsec .card-head { break-after: avoid; }
}

/* =====================================================================
   Planos e checkout (assinatura.php)
   ===================================================================== */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.plan { padding: 24px 22px; position: relative; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); }
.plan.selected { outline: 3px solid var(--ring); }
.plan-tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; padding: 3px 12px; border-radius: 20px; white-space: nowrap; }
.plan h4 { font-size: 18px; }
.plan-desc { font-size: 13px; margin: 4px 0 14px; min-height: 38px; }
.plan-price { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; display: flex; align-items: baseline; gap: 3px; }
.plan-price small { font-size: 15px; font-weight: 600; color: var(--text-2); }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-sub { font-size: 12.5px; color: var(--muted); margin: 6px 0 16px; }
.plan-list { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; flex: 1; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list li .ic { color: var(--ok); margin-top: 2px; }
.plan-list li.off { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.plan-list li.off .ic { color: var(--muted); }
.pay-opts { display: flex; flex-direction: column; gap: 8px; }
.pay-opt { cursor: pointer; position: relative; }
.pay-opt input { position: absolute; opacity: 0; }
.pay-opt > span { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; align-items: start; }
.pay-opt > span .ic { grid-row: span 2; color: var(--accent); margin-top: 2px; }
.pay-opt b { font-size: 14px; }
.pay-opt small { color: var(--muted); }
.pay-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.pay-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 6px; border-top: 1px dashed var(--border); margin-top: 4px; }
.checkout-total b { font-size: 22px; }
.trial-bar { margin-bottom: 18px; }
