/* ==========================================================================
   AIRocket — Sistema Financeiro
   Design system: roxo #2e2e38 / laranja #c5a47e (identidade do site),
   Montserrat nos títulos, Inter na interface (números tabulares).
   ========================================================================== */

:root {
  --roxo-900: #111115;
  --roxo-800: #18181d;
  --roxo-700: #23232b;
  --roxo-600: #2e2e38;
  --roxo-500: #4b4b58;
  --roxo-300: #a3a3b2;
  --roxo-100: #ecebef;
  --roxo-50: #f6f5f8;
  --laranja-600: #a8864f;
  --laranja-500: #c5a47e;
  --laranja-300: #dcc3a1;
  --laranja-100: #f7efe4;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --surface-3: #f0f0f3;
  --border: #e4e4e9;
  --border-strong: #d2d2da;
  --text: #1d1d24;
  --text-2: #55555f;
  --text-3: #86868f;
  --primary: var(--roxo-600);
  --primary-hover: var(--roxo-700);
  --primary-soft: var(--roxo-100);
  --primary-text: var(--roxo-600);
  --accent: var(--laranja-500);
  --accent-hover: var(--laranja-600);
  --accent-soft: var(--laranja-100);

  --ok: #12805c;      --ok-soft: #e3f5ee;
  --warn: #a86400;    --warn-soft: #fff3dc;
  --danger: #c2341d;  --danger-soft: #fdeae6;
  --info: #2563a8;    --info-soft: #e6f0fb;

  --chart-1: #4b4b58; /* despesas */
  --chart-2: #c5a47e; /* receitas */
  --chart-grid: #ebebef;
  --chart-pos: #12805c; /* lucro */
  --chart-neg: #c2341d; /* prejuízo */

  --sidebar-bg: linear-gradient(180deg, #23232b 0%, #18181d 100%);
  --sidebar-text: rgba(255, 255, 255, .78);
  --sidebar-active: rgba(255, 255, 255, .14);

  --shadow-sm: 0 1px 2px rgba(17, 17, 21, .06);
  --shadow: 0 1px 3px rgba(17, 17, 21, .06), 0 6px 20px rgba(17, 17, 21, .06);
  --shadow-lg: 0 10px 40px rgba(17, 17, 21, .18);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Montserrat', 'Inter', system-ui, sans-serif;
  --sidebar-w: 236px;
  --content-max: 1720px;
  --topbar-h: 54px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Tokens do modo escuro. O tema é resolvido por js/tema.js (claro / escuro / automático
   pelo sistema) e aplicado como data-theme no <html> antes da pintura. */
:root[data-theme="dark"] {
  --bg: #131316;
  --surface: #1b1b20;
  --surface-2: #202026;
  --surface-3: #28282f;
  --border: #303038;
  --border-strong: #42424c;
  --text: #f2f2f4;
  --text-2: #b6b6be;
  --text-3: #8a8a93;
  --primary: #c5a47e;
  --primary-hover: #d4b88f;
  --primary-soft: #2f2a22;
  --primary-text: #dcc3a1;
  --accent: #d4b88f;
  --accent-hover: #e0c79f;
  --accent-soft: #33291c;
  --ok: #4cc69a;      --ok-soft: #173229;
  --warn: #f0b24c;    --warn-soft: #3a2c14;
  --danger: #f27a66;  --danger-soft: #3d1d18;
  --info: #6aa8ec;    --info-soft: #172a40;
  --chart-1: #a46fd0;
  --chart-2: #d9671c;
  --chart-grid: #2c2434;
  --chart-pos: #2f9a72;
  --chart-neg: #e2604a;
  --sidebar-bg: linear-gradient(180deg, #0d0d10 0%, #08080a 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 21px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 12px; } .mt-24 { margin-top: 18px; } .mb-16 { margin-bottom: 12px; }
.text-ok { color: var(--ok); } .text-danger { color: var(--danger); } .text-warn { color: var(--warn); }
::selection { background: var(--roxo-300); color: #fff; }

svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex-shrink: 0; }
.ico-sm svg.lucide, svg.lucide.ico-sm { width: 15px; height: 15px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 14px 10px; z-index: 30;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar .brand { display: flex; align-items: center; padding: 2px 8px 6px; }
.sidebar .brand img { height: 46px; width: auto; }
.sidebar .brand-sub { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.5); padding: 0 10px 8px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-section { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; cursor: pointer;
  font: 600 10px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.42); padding: 12px 10px 5px; }
.nav-section:hover { color: rgba(255,255,255,.7); }
.nav-section svg.lucide { width: 13px; height: 13px; transition: transform .2s; }
.nav-group.fechado .nav-section svg.lucide { transform: rotate(-90deg); }
.nav-group.fechado .nav-itens { display: none; }
.nav-itens { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 6.5px 10px; border-radius: 8px;
  color: var(--sidebar-text); font-weight: 500; font-size: 13px; line-height: 1.3; text-decoration: none;
  transition: background .15s, color .15s; position: relative;
}
.nav a svg.lucide { width: 16px; height: 16px; opacity: .9; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--sidebar-active); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--laranja-500); }
.nav a .badge-count { margin-left: auto; background: var(--laranja-500); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }
.nav a .em-breve { margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.45); border: 1px solid rgba(255,255,255,.18); border-radius: 99px; padding: 0 6px; }
.sidebar-foot { margin-top: auto; padding: 10px 4px 0; border-top: 1px solid rgba(255,255,255,.08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent;
  display: none; /* no computador não há barra: o menu lateral já basta */
}
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 12px; max-width: var(--content-max); margin: 0 auto; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .menu-btn { display: none; }
.topbar .page-title-mobile { display: none; font-family: var(--font-title); font-weight: 700; font-size: 15px; }
.content { padding: 16px 24px 32px; max-width: var(--content-max); width: 100%; margin: 0 auto; }
.sidebar-backdrop { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 11px; font-weight: 600; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.page-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 14px 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 0; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 12px 16px 14px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid > * { min-width: 0; }

/* KPI / stat tiles */
.kpi { padding: 12px 14px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; cursor: default; transition: transform .2s var(--ease), box-shadow .2s; }
a.kpi, .kpi.clicavel { cursor: pointer; color: inherit; text-decoration: none; }
a.kpi:hover, .kpi.clicavel:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.kpi .kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.kpi .kpi-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.kpi .kpi-ico svg { width: 14px; height: 14px; }
.kpi.danger .kpi-ico { background: var(--danger-soft); color: var(--danger); }
.kpi.warn .kpi-ico { background: var(--warn-soft); color: var(--warn); }
.kpi.ok .kpi-ico { background: var(--ok-soft); color: var(--ok); }
.kpi.accent .kpi-ico { background: var(--accent-soft); color: var(--accent); }
.kpi .kpi-value { font-family: var(--font-title); font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .kpi-foot { font-size: 12px; color: var(--text-3); }
.kpi-hero, a.kpi.kpi-hero { background: linear-gradient(135deg, #2e2e38 0%, #23232b 60%, #18181d 100%); color: #fff; border: 0; }
.kpi-hero .kpi-label, .kpi-hero .kpi-foot { color: rgba(255,255,255,.75); }
.kpi-hero .kpi-ico { background: rgba(255,255,255,.14); color: #fff; }
.kpi-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(197,164,126,.45), transparent 70%); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--surface); --c: var(--text); --bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px;
  border-radius: 10px; border: 1px solid var(--bd); background: var(--b); color: var(--c);
  font: 600 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 1px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { --b: var(--primary); --c: #fff; --bd: transparent; box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { --b: var(--accent); --c: #fff; --bd: transparent; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { --b: transparent; --bd: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { --b: var(--surface); --c: var(--danger); --bd: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-xs.btn-icon { width: 26px; }
.btn .spinner { width: 15px; height: 15px; border-width: 2px; }
.btn-group { display: inline-flex; }
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.field .error { font-size: 12px; color: var(--danger); }
.input, .select, textarea.input {
  height: 40px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 14px var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border-strong)); }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.invalid { border-color: var(--danger); }
.input[readonly] { background: var(--surface-2); }
.input-sm, .select.input-sm { height: 34px; font-size: 13px; border-radius: 8px; }
.select { appearance: none; padding-right: 34px; 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='%238b8197' 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 10px center; cursor: pointer; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > svg.lucide { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; width: 16px; height: 16px; }
.input-group > .input { padding-left: 38px; }
.input-group .prefix { position: absolute; left: 12px; color: var(--text-3); font-weight: 600; font-size: 13px; pointer-events: none; }
.input-group .prefix + .input { padding-left: 36px; }
.input-money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 14px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-9 { grid-column: span 9; } .col-5 { grid-column: span 5; } .col-2 { grid-column: span 2; } .col-1 { grid-column: span 1; }
.form-section { font-family: var(--font-title); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); grid-column: span 12; padding-top: 6px; display: flex; align-items: center; gap: 10px; }
.form-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; user-select: none; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; width: 36px; height: 21px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(15px); }

/* Segmented control */
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--text-2); font: 600 13px var(--font); padding: 7px 13px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .count { font-size: 11px; font-weight: 700; background: var(--border); color: var(--text-2); padding: 0 6px; border-radius: 99px; line-height: 17px; }
.segmented button.active .count { background: var(--primary-soft); color: var(--primary-text); }
.segmented .count.danger { background: var(--danger-soft); color: var(--danger); }

/* Tabs (sublinhado) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
/* Carregando no painel: barra fina sob as abas + conteúdo esmaecido (sem parecer travado) */
.carga { height: 2px; margin: -17px 0 15px; overflow: hidden; visibility: hidden; }
.carga.ativo { visibility: visible; }
.carga.ativo::before { content: ''; display: block; height: 100%; width: 35%; background: var(--accent); border-radius: 2px; animation: carga 0.9s ease-in-out infinite; }
@keyframes carga { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
#aba-painel { transition: opacity .12s; }
#aba-painel.carregando { opacity: .45; pointer-events: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font: 600 13.5px var(--font); color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary-text); border-bottom-color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th:first-child { border-top-left-radius: var(--radius-lg); }
.table th:last-child { border-top-right-radius: var(--radius-lg); }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr.clicavel { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.selected { background: color-mix(in srgb, var(--primary-soft) 60%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; }
.table td.check, .table th.check { width: 42px; padding-right: 0; }
.table .td-main { font-weight: 600; color: var(--text); }
.table .td-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.table-compact td { padding: 8px 12px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge svg.lucide { width: 12px; height: 12px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary-text); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--text-3); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-text); font-size: 12.5px; font-weight: 600; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 0; opacity: .7; }
.chip button:hover { opacity: 1; }
.chip svg.lucide { width: 14px; height: 14px; }

/* Avatar */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--roxo-500); flex-shrink: 0; font-family: var(--font-title); }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }

/* ---------- Filters bar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.toolbar .input-group { min-width: 240px; flex: 1; max-width: 360px; }
.filters-active { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--primary-soft); color: var(--primary-text); font-weight: 600; border-bottom: 1px solid var(--border); flex-wrap: wrap; }

/* ---------- Empty, skeleton, spinner ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .empty-ico { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); }
.empty .empty-ico svg { width: 28px; height: 28px; }
.empty h3 { margin-bottom: 4px; }
.empty p { margin: 0 auto 16px; max-width: 420px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; min-height: 50vh; color: var(--primary-text); }

/* ---------- Modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(26, 12, 38, .42); backdrop-filter: blur(3px); z-index: 100; opacity: 0; transition: opacity .2s; }
.overlay.open { opacity: 1; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 101; opacity: 0; transition: opacity .2s, transform .25s var(--ease); }
.modal.open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal.lg { width: min(820px, calc(100vw - 32px)); }
.modal.xl { width: min(1180px, calc(100vw - 32px)); height: calc(100vh - 48px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 101; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s var(--ease); }
.drawer.open { transform: none; }
.drawer.wide { width: min(760px, 100vw); }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 13px 15px; background: var(--surface); color: var(--text); border-radius: 12px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary); animation: toastIn .3s var(--ease); font-size: 13.5px; }
.toast.ok { border-left-color: var(--ok); } .toast.ok svg { color: var(--ok); }
.toast.erro { border-left-color: var(--danger); } .toast.erro svg { color: var(--danger); }
.toast.aviso { border-left-color: var(--warn); } .toast.aviso svg { color: var(--warn); }
.toast .toast-close { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Dropdown / popover / combobox ---------- */
.dropdown { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; display: none; }
.menu.open { display: block; animation: pop .15s var(--ease); }
.menu.left { left: 0; right: auto; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font: 500 13.5px var(--font); text-align: left; cursor: pointer; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--surface-3); text-decoration: none; }
.menu .sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu .danger { color: var(--danger); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; z-index: 70; padding: 5px; display: none; }
.combo-list.open { display: block; }
.combo-item { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.combo-item:hover, .combo-item.hl { background: var(--surface-3); }
.combo-item .sub { font-size: 12px; color: var(--text-3); margin-left: auto; }
.combo-item.novo { color: var(--primary-text); font-weight: 600; }

/* ---------- Dropzone ---------- */
.dropzone { display: block; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 30px 20px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; position: relative; overflow: hidden; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.dropzone.over { transform: scale(1.005); }
.dropzone .dz-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(135deg, var(--roxo-500), var(--roxo-700)); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.dropzone .dz-ico svg { width: 26px; height: 26px; }
.dropzone h3 { margin-bottom: 4px; }
.dropzone input { display: none; }
.dropzone.compact { padding: 16px; display: flex; align-items: center; gap: 14px; text-align: left; }
.dropzone.compact .dz-ico { margin: 0; width: 40px; height: 40px; border-radius: 12px; }
.dropzone.compact .dz-ico svg { width: 20px; height: 20px; }

/* ---------- Caixa de entrada (documentos) ---------- */
.inbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; }
.doc-card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: var(--shadow); transform: translateY(-1px); }
.doc-card .doc-top { display: flex; gap: 12px; align-items: flex-start; }
.doc-thumb { width: 46px; height: 56px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); flex-shrink: 0; overflow: hidden; border: 1px solid var(--border); }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-card .doc-valor { font-family: var(--font-title); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.doc-card .doc-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-card.processando { cursor: progress; }
.doc-card.processando::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: scan 1.4s infinite; border-radius: 0 0 var(--radius) var(--radius); }
@keyframes scan { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.review { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); height: 100%; min-height: 0; }
.review-preview { background: var(--surface-3); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.review-preview iframe, .review-preview img { flex: 1; width: 100%; height: 100%; border: 0; object-fit: contain; background: #fff; }
.review-form { overflow-y: auto; padding: 20px 22px; }
.ai-box { border-radius: 12px; padding: 12px 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 80%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); display: flex; gap: 10px; align-items: flex-start; }
.ai-box .ai-ico { color: var(--primary-text); }
.ai-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; }
.sugestao { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: var(--surface-2); }
.sugestao.forte { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: var(--ok-soft); }
.confianca { height: 6px; width: 64px; border-radius: 99px; background: var(--border); overflow: hidden; }
.confianca > span { display: block; height: 100%; border-radius: 99px; background: var(--ok); }

/* ---------- Conciliação ---------- */
.conc-list { display: flex; flex-direction: column; }
/* Movimento do extrato numa linha: data · descrição · valor · sugestão · ação */
.conc-row { display: grid; grid-template-columns: 76px minmax(0, 1.25fr) 112px minmax(0, 1.5fr) 150px; gap: 10px; align-items: center; padding: 6px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.conc-row:hover { background: var(--surface-2); }
.conc-row > * { min-width: 0; }
.conc-row .conc-data { color: var(--text-2); font-variant-numeric: tabular-nums; }
.conc-row .conc-valor { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.conc-row .conc-valor.entrada { color: var(--ok); }
.conc-row .conc-acoes { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.conc-sug { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); text-decoration: none; }
.conc-sug + .conc-sug { margin-top: 2px; }
.conc-sug.ok { color: var(--ok); }
.conc-sug.muted { color: var(--text-3); }
.conc-sug .ellipsis { min-width: 0; flex: 0 1 auto; }
a.conc-sug:hover .ellipsis { text-decoration: underline; }
.conc-item { display: grid; grid-template-columns: 92px minmax(0, 1.2fr) 130px minmax(0, 1.4fr); gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.conc-item:last-child { border-bottom: 0; }
.conc-item:hover { background: var(--surface-2); }
.conc-item .conc-data { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.conc-item .conc-valor { text-align: right; font-weight: 700; font-family: var(--font-title); font-variant-numeric: tabular-nums; font-size: 15px; }
.conc-item .conc-valor.saida { color: var(--text); }
.conc-item .conc-valor.entrada { color: var(--ok); }
.match { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface); }
.match.forte { border-style: solid; border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); }
.match.feito { border-style: solid; border-color: transparent; background: var(--ok-soft); }
.match .match-info { flex: 1; min-width: 0; }
.conc-item > *, .conc-match .row > .match { min-width: 0; }
.conc-match .row > .match { flex: 1; }
.score { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.score.alto { background: var(--ok-soft); color: var(--ok); }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.bank-card { border-radius: var(--radius); padding: 9px 12px; color: #fff; position: relative; overflow: hidden; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; display: flex; flex-direction: column; gap: 2px; border: 2px solid transparent; font-size: 12.5px; }
.bank-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bank-card.active { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.bank-card::after { content: ''; position: absolute; right: -30px; bottom: -50px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.08); }
.bank-card .bank-saldo { font-family: var(--font-title); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #fff)); border-radius: 99px; transition: width .5s var(--ease); }

/* ---------- DRE ---------- */
/* Tamanho em em: o JS reduz a fonte da tabela até os meses caberem sem rolagem horizontal */
.dre-table { font-size: 12.5px; table-layout: fixed; min-width: calc(21em + var(--meses, 12) * 5em + 6.6em); }
.dre-table col.c-conta { width: 21em; }
.dre-table col.c-total { width: 6.6em; }
.dre-table td.num, .dre-table th.num { overflow: hidden; text-overflow: clip; }
.dre-table th { font-size: .82em; padding: .8em .6em; }
/* Nome da conta numa linha só: o que não couber vira reticências (nome completo no mouse over) */
.dre-table th:first-child, .dre-table td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dre-table td[colspan] { overflow: visible; }
.dre-table th:first-child { background: var(--surface-2); z-index: 3; }
.dre-table td { padding: .55em .45em; white-space: nowrap; }
.dre-table tr.grupo td { font-weight: 700; cursor: pointer; }
.dre-table tr.grupo td:first-child::before { content: '▸'; display: inline-block; width: 16px; color: var(--text-3); transition: transform .15s; }
.dre-table tr.grupo.open td:first-child::before { transform: rotate(90deg); }
.dre-table tr.cat td { color: var(--text-2); font-size: .95em; }
.dre-table tr.cat td:first-child { padding-left: 2.6em; }
/* Subtotais (receita líquida, lucro bruto…) um tom mais escuros que as linhas comuns; o final fica no roxo */
.dre-table tr.resultado td { font-weight: 700; background: color-mix(in srgb, var(--text) 8%, var(--surface)); border-top: 1px solid var(--border-strong); }
.dre-table tr.resultado td:first-child { background: color-mix(in srgb, var(--text) 8%, var(--surface)); }
.dre-table tr.resultado.final td { background: var(--primary-soft); color: var(--primary-text); font-size: 1.05em; }
.dre-table tr.resultado.final td:first-child { background: var(--primary-soft); }
.dre-table td.neg { color: var(--danger); }
.dre-table tr.memo td { color: var(--text-3); font-style: italic; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .value-label { fill: var(--text-2); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .bar { transition: opacity .15s; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .bar.hover { opacity: .82; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: 12.5px; z-index: 5; opacity: 0; transition: opacity .12s; min-width: 150px; }
.chart-tip.show { opacity: 1; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-tip .tip-row b { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* Barra em uma linha só (painéis densos): nome · trilho · valor · extra */
/* colunas fixas: barras, valores e % alinhados entre as linhas e entre os cartões */
.hrow { display: grid; grid-template-columns: minmax(0, 36%) minmax(40px, 1fr) 8.2em 3.2em; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.hrow > .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hrow-trilho { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hrow-trilho > span { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.hrow-extra { text-align: right; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
/* Painel · Por Unidade */
.uni-tab { font-size: 12.5px; }
.uni-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.6em 4.6em 5em 3.4em; gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
.uni-row > .num, .uni-row > span:not(.uni-nome) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.uni-head { font-size: 11px; color: var(--text-3); padding-top: 0; }
.uni-head > span:first-child { text-align: left !important; }
.uni-nome { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; }
.uni-total { border-bottom: 0; border-top: 2px solid var(--border-strong, var(--border)); font-weight: 700; background: var(--surface-2); margin-top: -1px; padding-left: 6px; padding-right: 6px; border-radius: 0 0 6px 6px; }
.uni-part { margin-top: 12px; }
.uni-barra { display: flex; gap: 2px; height: 10px; margin: 6px 0; border-radius: 5px; overflow: hidden; }
.uni-barra > span { min-width: 3px; }
.uni-leg { display: flex; gap: 12px; font-size: 11.5px; color: var(--text-2); min-width: 0; }
.uni-leg > span { display: flex; align-items: center; gap: 5px; min-width: 0; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 7px 0; font-size: 13px; }
.hbar .hbar-track { grid-column: 1 / -1; grid-row: 2; height: 10px; position: relative; }
.hbar .hbar-fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--chart-1); min-width: 2px; transition: width .6s var(--ease); }
.hbar .hbar-val { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* Lista de vencimentos */
.venc-list { display: flex; flex-direction: column; }
.venc-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.venc-item:last-child { border-bottom: 0; }
.venc-item:hover .venc-desc { color: var(--primary-text); }
.venc-date { width: 40px; text-align: center; border-radius: 8px; background: var(--surface-3); padding: 3px 0; flex-shrink: 0; }
.venc-date b { display: block; font-family: var(--font-title); font-size: 14px; line-height: 1.1; }
/* Lista de lançamentos mais densa: selos numa linha só e menores */
.table .badge { height: 19px; padding: 0 7px; font-size: 11px; gap: 4px; }
.tabela-lanc td.c-sit { min-width: 260px; }
.tabela-lanc td.c-desc { max-width: 300px !important; }
.tabela-lanc td.c-cat { min-width: 180px; line-height: 1.3; }
.tabela-lanc td.c-desc { max-width: 320px !important; }
.venc-date span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.venc-date.vencido { background: var(--danger-soft); color: var(--danger); }
.venc-date.vencido span { color: var(--danger); }
.venc-date.hoje { background: var(--accent-soft); color: var(--accent); }
.venc-date.hoje span { color: var(--accent); }

/* Checklist do fechamento */
.check-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.check-item:last-child { border-bottom: 0; }
.check-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.check-ico.ok { background: var(--ok-soft); color: var(--ok); }
.check-ico.pend { background: var(--warn-soft); color: var(--warn); }
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); display: grid; place-items: center; flex-shrink: 0; }
.tl-dot svg { width: 14px; height: 14px; }

/* Detalhe (drawer) */
.detail-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--border); }
.detail-valor { font-family: var(--font-title); font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.detail-body { padding: 18px 24px; overflow-y: auto; flex: 1; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv dd .badge { white-space: normal; height: auto; min-height: 22px; padding-top: 2px; padding-bottom: 2px; }
.attach { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
.attach + .attach { margin-top: 8px; }
.attach .grow a { font-weight: 600; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); background: var(--surface); }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(150deg, #2e2e38 0%, #23232b 45%, #111115 100%); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ''; position: absolute; inset: 0; background: url('../img/fundo-login.jpg') center/cover; opacity: .22; mix-blend-mode: screen; }
.auth-art .bolha { position: absolute; border-radius: 50%; filter: blur(2px); }
.auth-art .b1 { width: 380px; height: 380px; right: -120px; top: -100px; background: radial-gradient(circle, rgba(197,164,126,.55), transparent 65%); }
.auth-art .b2 { width: 300px; height: 300px; left: -80px; bottom: -60px; background: radial-gradient(circle, rgba(197,164,126,.22), transparent 65%); }
.auth-art img.logo { height: 44px; width: auto; align-self: flex-start; position: relative; }
.auth-art h1 { color: #fff; font-size: 38px; line-height: 1.15; max-width: 480px; position: relative; font-weight: 800; }
.auth-art h1 em { font-style: normal; color: var(--laranja-300); }
.auth-art p { color: rgba(255,255,255,.75); max-width: 440px; position: relative; font-size: 15px; }
.auth-feats { display: grid; gap: 14px; position: relative; margin-top: 28px; }
.auth-feats div { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.88); }
.auth-feats .lucide { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.12); }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 26px; margin-bottom: 6px; }
.auth-box .logo-mobile { display: none; height: 38px; margin-bottom: 26px; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert-erro { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.pw-meter { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }


/* ---------- Mural de recados / Início ---------- */
.recado { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--recado-cor, var(--primary)); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); }
.recado.alta { box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent), var(--shadow); }
.recado.fixado { background: linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 45%, var(--surface)), var(--surface) 70%); }
.recado-titulo { font-size: 17px; line-height: 1.3; }
.recado-texto { color: var(--text-2); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.recado-texto p { margin: 0 0 8px; }
.recado-texto p:last-child { margin-bottom: 0; }
.recado-texto ul { margin: 0 0 8px; padding-left: 20px; }
.recado-texto b { color: var(--text); }
.recado footer { padding-top: 10px; border-top: 1px solid var(--border); }
.modulos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modulo { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.modulo:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.modulo b { font-family: var(--font-title); font-size: 14px; }
.modulo span:last-child { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.modulo-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); margin-bottom: 4px; }
.pend-link { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13.5px; }
.pend-link:last-child { border-bottom: 0; }
.pend-link:hover { text-decoration: none; color: var(--primary-text); }
.pend-link .check-ico { width: 32px; height: 32px; }

/* ---------- Balanço ---------- */
.balanco { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.bal-lado h2 { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.bal-lado h2 b { font-variant-numeric: tabular-nums; font-size: 18px; letter-spacing: 0; text-transform: none; }
.bal-grupo { padding: 6px 0; border-bottom: 1px solid var(--border); }
.bal-grupo:last-child { border-bottom: 0; }
.bal-grupo-tit { display: flex; justify-content: space-between; padding: 10px 20px 6px; font-weight: 700; font-size: 13.5px; color: var(--text); }
.bal-linha { display: flex; justify-content: space-between; gap: 12px; padding: 7px 20px 7px 30px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.bal-linha:hover { background: var(--surface-2); }
.bal-linha .v { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); white-space: nowrap; }
.bal-linha .nome::before { content: '▸'; display: inline-block; width: 14px; color: var(--text-3); transition: transform .15s; }
.bal-linha.open .nome::before { transform: rotate(90deg); }
.bal-linha.sem-itens .nome::before { visibility: hidden; }
.bal-itens { display: none; padding: 0 20px 8px 58px; }
.bal-linha.open + .bal-itens { display: block; }
.bal-item { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-3); padding: 3px 0; }
.bal-item span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bal-total { display: flex; justify-content: space-between; padding: 14px 20px; background: var(--primary-soft); color: var(--primary-text); font-weight: 700; border-radius: 0 0 var(--radius-lg) var(--radius-lg); font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .balanco { grid-template-columns: 1fr; } }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: minmax(0, 1fr); }
  .conc-item { grid-template-columns: 80px minmax(0, 1fr) 110px; }
  .conc-item .conc-match { grid-column: 1 / -1; }
  .conc-row { grid-template-columns: 70px minmax(0, 1fr) 100px; row-gap: 4px; }
  .conc-row .conc-sugestao { grid-column: 1 / 3; }
  .conc-row .conc-acoes { grid-column: 3; }
}

/* Tablet e celular: menu vira gaveta */
@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-105%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); padding-top: max(14px, env(safe-area-inset-top)); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,10,12,.45); z-index: 29; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .nav a { padding: 10px 12px; font-size: 14.5px; }
  .topbar { display: block; padding: 0 12px; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .page-title-mobile { display: block; }
  .content { padding: 4px 16px calc(40px + env(safe-area-inset-bottom)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .review { grid-template-columns: 1fr; grid-template-rows: 38vh auto; }
  .review-preview { border-right: 0; border-bottom: 1px solid var(--border); }
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100dvh; }
  .auth-art { padding: max(28px, env(safe-area-inset-top)) 22px 30px; gap: 18px; justify-content: flex-start; }
  .auth-art img.logo { height: 34px; }
  .auth-art h1 { font-size: 25px; }
  .auth-art p, .auth-art small { display: none; }
  .auth-feats { margin-top: 14px; gap: 8px; font-size: 13px; }
  .auth-feats .lucide { width: 28px; height: 28px; padding: 6px; }
  .auth-panel { place-items: start center; padding: 26px 20px 40px; margin-top: -14px; border-radius: 18px 18px 0 0; position: relative; }
  .form-grid .col-6, .form-grid .col-4, .form-grid .col-3, .form-grid .col-8, .form-grid .col-9, .form-grid .col-5, .form-grid .col-2 { grid-column: span 12; }
  .kv { grid-template-columns: 130px 1fr; }
  .hide-mobile { display: none !important; }
  .dre-table col.c-conta { width: 14em; }
  .dre-table { min-width: calc(14em + var(--meses, 12) * 5em + 6.6em); }
}

/* Celular */
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  /* iOS não dá zoom em campos com 16px */
  .input, .select, textarea.input, .input-sm, .select.input-sm { font-size: 16px; }
  .input-sm, .select.input-sm { height: 40px; }
  .page-head { margin: 6px 0 16px; align-items: stretch; }
  .page-head h1 { font-size: 21px; }
  .page-head > .row, .page-head > div:last-child:not(:first-child) { width: 100%; }
  .page-head > .row .btn, .page-head > div:last-child:not(:first-child) > .btn { flex: 1; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid { gap: 12px; }
  .kpi { padding: 14px; gap: 4px; }
  .kpi .kpi-value { font-size: 19px; }
  .kpi .kpi-label { font-size: 12px; }
  .kpi .kpi-ico { width: 26px; height: 26px; }
  .kpi .kpi-foot { font-size: 11.5px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 12px 16px 16px; }
  .card-pad { padding: 16px; }
  .toolbar { padding: 12px; gap: 8px; }
  .toolbar > * { flex: 1 1 100%; width: 100% !important; max-width: none !important; min-width: 0 !important; }
  .toolbar > .grow { display: none; }
  .segmented { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { white-space: nowrap; flex-shrink: 0; }
  .tabs { margin-bottom: 14px; }

  /* Tabelas viram cartões: cada <td data-label> mostra o rótulo */
  .table.resp thead { display: none; }
  .table.resp, .table.resp tbody, .table.resp tfoot { display: block; }
  .table.resp tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: relative; }
  .table.resp tbody tr:last-child { border-bottom: 0; }
  .table.resp td { display: block; padding: 0; border: 0; text-align: left; white-space: normal !important; min-width: 0; }
  .table.resp td.num { text-align: right; }
  .table.resp td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; margin-bottom: 1px; }
  .table.resp td.c-full { grid-column: 1 / -1; }
  .table.resp td.check { position: absolute; left: 14px; top: 14px; width: auto; }
  .table.resp tr.has-check { padding-left: 44px; }
  .table.resp tfoot tr { background: var(--surface-2); }
  .table.resp tfoot td:empty { display: none; }
  /* Lançamentos no celular: descrição em cima, vencimento × valor, situação × ação */
  .tabela-lanc.resp td.c-desc { order: -1; grid-column: 1 / -1; max-width: none !important; }
  .tabela-lanc.resp td.c-desc .td-main { white-space: normal; }
  .tabela-lanc.resp td.c-venc { grid-column: 1; }
  .tabela-lanc.resp td.c-valor { grid-column: 2; align-self: center; }
  .tabela-lanc.resp td.c-sit { grid-column: 1; align-self: center; }
  .tabela-lanc.resp td.c-acao { grid-column: 2; }
  .tabela-lanc.resp tfoot tr { grid-template-columns: 1fr auto; }
  .tabela-lanc.resp tfoot td[colspan] { grid-column: 1; }

  /* Modais em tela cheia (estilo app) */
  .modal, .modal.lg, .modal.xl { width: 100vw; max-height: none; height: 100%; height: 100dvh; top: 0; left: 0; transform: translateY(16px); border-radius: 0; }
  .modal.open { transform: none; }
  .modal-head { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .modal-foot .grow { display: none; }
  .drawer, .drawer.wide { width: 100vw; }
  .detail-head { padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }
  .detail-body { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); }
  .detail-valor { font-size: 26px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .review { grid-template-rows: 34vh auto; }
  .review-form { padding: 16px; }

  .conc-item { grid-template-columns: 1fr auto; padding: 12px 14px; gap: 8px 12px; }
  .conc-item .conc-data { grid-column: 1 / -1; font-size: 12.5px; }
  .bank-card { min-height: 112px; padding: 14px 16px; }
  .inbox-grid { grid-template-columns: 1fr; }
  .recado { padding: 14px; }
  .modulos { grid-template-columns: 1fr 1fr; }
  .bal-linha { padding-left: 20px; }
  .bal-itens { padding-left: 34px; }
  .dropzone { padding: 22px 14px; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: none; }
  .hbar .hbar-val { min-width: 0; }
  .chart-tip { min-width: 130px; }
  .attach { flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .auth-feats { display: none; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app { display: block; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Coluna "Variação" some quando não há período anterior para comparar */
.sem-col-9 th:nth-child(9), .sem-col-9 td:nth-child(9), .sem-col-5 th:nth-child(5), .sem-col-5 td:nth-child(5) { display: none; }
/* Título do cartão nunca quebra; a legenda longa desce para a linha de baixo */
.card-head { flex-wrap: wrap; row-gap: 6px; }
.card-head h3 { white-space: nowrap; min-width: 0; }
/* Celular: KPIs em 2 colunas não podem cortar valores de 7 dígitos */
@media (max-width: 480px) { .kpi .kpi-value { font-size: 16px; } }
/* Configurações: contrato social em duas colunas de pares (rótulo · valor) */
.kv.kv-2col { grid-template-columns: 140px minmax(0, 1fr) 140px minmax(0, 1fr); }
@media (max-width: 900px) { .kv.kv-2col { grid-template-columns: 120px minmax(0, 1fr); } }
.cfg-sec[hidden] { display: none !important; }
.kv.kv-2col dd.kv-full { grid-column: span 3; }
@media (max-width: 900px) { .kv.kv-2col dd.kv-full { grid-column: auto; } }
@media (max-width: 1360px) { .col-lanc { display: none; } }

/* ==========================================================================
   Menu por módulos + abas no topo do módulo (30/10/2026)
   ========================================================================== */
.nav > a { margin-bottom: 1px; }
.nav a .nav-img { width: 20px; height: 20px; border-radius: 50%; margin: -2px -2px -2px -2px; object-fit: cover; box-shadow: 0 0 0 1.5px rgba(255,255,255,.35); }
.nav a span.ellipsis { min-width: 0; }
/* Abas do módulo: o mesmo .tabs do Painel Financeiro, logo abaixo do título da tela */
.tabs a { border: 0; background: none; padding: 10px 14px; font: 600 13.5px var(--font); color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; text-decoration: none; flex-shrink: 0; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary-text); border-bottom-color: var(--accent); }
.tabs a svg.lucide { width: 15px; height: 15px; }
.tabs a .badge-count { background: var(--laranja-500); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 17px; }
.mod-tabs { margin-bottom: 14px; }

/* Densidade (pedido do Cesar: mais informação na tela, sem folgas) */
:root { --sidebar-w: 216px; }
body { font-size: 13.5px; }
.content { padding: 14px 20px 28px; }
.card-pad { padding: 12px 14px; }
.card-head { padding: 10px 14px 0; }
.card-body { padding: 10px 14px 12px; }
.sidebar { padding: 12px 8px; }
.nav a { padding: 6px 10px; gap: 9px; }
.nav-section { padding: 10px 10px 4px; }
.modal-body { padding: 16px 18px; }
.page-head { margin-bottom: 12px; }

@media (max-width: 920px) {
  .nav a { padding: 9px 12px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .tabs a { padding: 9px 11px; }
  .tabs a svg.lucide { display: none; }
}

/* ==========================================================================
   AIRocket Bot (agente) — botão em toda tela, gaveta, conversa, tela cheia
   ========================================================================== */
.bot-fab { position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; z-index: 90;
  background: var(--roxo-600); box-shadow: 0 6px 22px rgba(17, 17, 21, .35), 0 0 0 3px #fff; transition: transform .18s var(--ease); }
.bot-fab img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.bot-fab:hover { transform: scale(1.06) translateY(-1px); }
body.bot-aberto .bot-fab, body.na-tela-bot .bot-fab { display: none; }
.bot-painel { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 95;
  display: flex; flex-direction: column; transform: translateX(105%); transition: transform .26s var(--ease); border-left: 1px solid var(--border); }
.bot-painel.open { transform: none; }
.bot-painel-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--border); padding-top: max(10px, env(safe-area-inset-top)); }
.bot-painel-head b { font-family: var(--font-title); }
.bot-painel-corpo { flex: 1; min-height: 0; display: flex; }
.bot-av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.bot-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.bot-mensagens { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.bot-msg { display: flex; gap: 8px; max-width: 100%; }
.bot-msg.eu { justify-content: flex-end; }
.bot-msg.eu .bot-bolha { background: var(--primary); color: #fff; border-radius: 14px; border-bottom-right-radius: 4px; max-width: 85%; }
.bot-corpo { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.bot-bolha { background: var(--surface-3); border-radius: 14px; border-top-left-radius: 4px; padding: 8px 12px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.bot-msg.bot .bot-bolha { align-self: flex-start; max-width: 100%; }
.bot-bolha p { margin: 0 0 6px; }
.bot-bolha p:last-child { margin-bottom: 0; }
.bot-bolha ul, .bot-bolha ol { margin: 2px 0 6px; padding-left: 18px; }
.bot-bolha li { margin: 1px 0; }
.bot-anexo { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: rgba(255,255,255,.18); border-radius: 8px; padding: 2px 8px; margin: 0 4px 4px 0; max-width: 100%; }
.bot-anexos .bot-anexo { background: var(--primary-soft); color: var(--primary-text); }
.bot-anexo button { border: 0; background: none; cursor: pointer; color: inherit; padding: 0; display: grid; }
.bot-anexo .spinner { width: 12px; height: 12px; border-width: 2px; }
.bot-progresso { display: flex; align-items: center; gap: 8px; padding: 4px 14px 6px; font-size: 12.5px; color: var(--text-2); }
.bot-progresso img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; animation: bot-pulso 1.4s ease-in-out infinite; }
@keyframes bot-pulso { 50% { transform: translateY(-2px) scale(1.04); } }
.bot-entrada { border-top: 1px solid var(--border); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); }
.bot-anexos { display: flex; flex-wrap: wrap; padding: 0 2px 6px; }
.bot-linha { display: flex; align-items: flex-end; gap: 6px; }
.bot-linha textarea { flex: 1; resize: none; border: 1px solid var(--border-strong); border-radius: 12px; padding: 8px 10px; font: 13.5px/1.4 var(--font); background: var(--surface); color: var(--text); max-height: 140px; min-height: 36px; }
.bot-linha textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.bot-vazio { text-align: center; padding: 10px 6px; color: var(--text-2); }
.bot-vazio img { width: 132px; height: 132px; border-radius: 22px; object-fit: cover; }
.bot-vazio h3 { margin: 8px 0 4px; }
.bot-vazio p { font-size: 13px; margin: 0 auto 10px; max-width: 360px; }
.bot-sugestoes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bot-sugestoes .chip { border: 0; cursor: pointer; padding: 5px 10px; font-weight: 500; }
.bot-sugestoes .chip:hover { background: var(--roxo-300); color: #fff; }
.bot-consultas { font-size: 12px; color: var(--text-3); }
.bot-consultas summary { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; list-style: none; }
.bot-consultas summary::-webkit-details-marker { display: none; }
.bot-consultas > div { padding: 2px 0 0 18px; }
.bot-consultas .falhou { color: var(--text-2); }
.bot-acao { border: 1px solid var(--border-strong); border-radius: 12px; padding: 8px 10px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.bot-acao.proposta { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 14%, transparent); }
.bot-acao-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.bot-kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; font-size: 12.5px; }
.bot-kv span { color: var(--text-3); }
.bot-kv b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-aviso { display: flex; gap: 6px; font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 4px 8px; }
.bot-aviso.erro { color: var(--danger); background: var(--danger-soft); }
.bot-acao-bts { display: flex; gap: 6px; margin-top: 2px; }
.bot-grafico { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px 2px; margin: 6px 0; }
.bot-grafico-tit { font-size: 12px; font-weight: 600; color: var(--text-2); }
/* tela cheia */
.bot-tela { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; height: calc(100vh - 200px); min-height: 440px; }
.bot-lista { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.bot-lista-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--border); }
.bot-lista-itens { flex: 1; overflow-y: auto; padding: 4px; }
.bot-item { display: flex; align-items: center; gap: 4px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.bot-item:hover { background: var(--surface-3); }
.bot-item.ativa { background: var(--primary-soft); color: var(--primary-text); }
.bot-item .btn { opacity: 0; }
.bot-item:hover .btn { opacity: 1; }
.bot-principal { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bot-principal-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-family: var(--font-title); }
.bot-principal-corpo { flex: 1; min-height: 0; display: flex; }
.lv-so-celular { display: none; }
@media (max-width: 920px) {
  .bot-tela { grid-template-columns: 1fr; height: calc(100dvh - var(--topbar-h) - 150px); position: relative; }
  .bot-lista { position: absolute; inset: 0 30% 0 0; z-index: 5; display: none; box-shadow: var(--shadow-lg); }
  .bot-lista.aberta { display: flex; }
  .lv-so-celular { display: inline-flex; }
  .lv-atalho { display: none; }
  .bot-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
}
@media (max-width: 640px) {
  .bot-painel { width: 100vw; }
  .bot-linha textarea { font-size: 16px; }
  .bot-lista { right: 12%; }
}
/* configuração e WhatsApp */
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.lv-cfg-img { width: 92px; height: 92px; border-radius: 16px; object-fit: cover; }
.lv-regra { align-items: flex-start; }
.lv-regra textarea { font-size: 13px; }
.lv-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.lv-qr img { width: 220px; height: 220px; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.lv-qr ol { margin: 0; padding-left: 18px; flex: 1; min-width: 200px; }

/* sino de avisos */
.sino { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; color: var(--sidebar-text); font: 500 13px var(--font); padding: 6px 10px; border-radius: 8px; cursor: pointer; margin-bottom: 4px; }
.sino:hover { background: rgba(255,255,255,.07); color: #fff; }
.sino svg.lucide { width: 16px; height: 16px; }
.sino .badge-count { margin-left: auto; background: var(--laranja-500); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
.sino-mobile { position: relative; }
.sino-mobile .badge-count { position: absolute; top: 2px; right: 2px; background: var(--laranja-500); color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 999px; padding: 0 5px; line-height: 15px; }
.sino-painel { position: fixed; z-index: 120; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: min(70vh, 520px); overflow-y: auto; }
.sino-head { padding: 10px 14px; border-bottom: 1px solid var(--border); font-family: var(--font-title); }
.sino-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.sino-item:hover { background: var(--surface-2); text-decoration: none; }
.sino-item.nova { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }

/* ==========================================================================
   CRM
   ========================================================================== */
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.crm-board { display: flex; gap: 8px; align-items: flex-start; }
.crm-col { flex: 1 1 0; min-width: 0; background: var(--surface-3); border-radius: 12px; padding: 6px; border: 2px dashed transparent; transition: border-color .15s; }
.crm-col.sobre, .crm-perdidas.sobre { border-color: var(--accent); }
.crm-col.ganho { background: var(--ok-soft); }
.crm-col-head { padding: 4px 6px 8px; border-top: 3px solid var(--cor); border-radius: 2px; display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.crm-col-itens { display: flex; flex-direction: column; gap: 6px; min-height: 60px; max-height: calc(100vh - 260px); overflow-y: auto; }
.crm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font-size: 13px; box-shadow: var(--shadow-sm); }
.crm-card:hover { border-color: var(--roxo-300); }
.crm-card.arrastando { opacity: .45; }
.crm-vazio { text-align: center; padding: 14px 4px; }
.crm-perdidas { margin-top: 10px; border: 2px dashed var(--border-strong); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.crm-perdidas details { width: 100%; }
.crm-perdidas summary { cursor: pointer; font-size: 12.5px; }
.crm-perdido { padding: 4px 0; gap: 8px; cursor: pointer; }
.crm-tarefa { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.crm-tarefa:last-child { border-bottom: 0; }
.crm-tarefa.concluida, tr.concluida .td-main { text-decoration: line-through; color: var(--text-3); }
.crm-linha { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.crm-linha:hover, .crm-tarefa:hover { background: var(--surface-2); }
.crm-linha:last-child { border-bottom: 0; }
.crm-bloco { max-height: 360px; overflow-y: auto; padding-top: 6px; flex: 1; }
.crm-meudia .card { display: flex; flex-direction: column; }
.crm-serv { grid-template-columns: minmax(0, 2fr) 90px 100px 100px 32px; gap: 6px; align-items: center; }
.crm-kpis .kpi { padding: 10px 12px; }
@media (max-width: 920px) {
  .crm-board { flex-direction: column; align-items: stretch; }
  .crm-col-itens { max-height: none; }
  .crm-serv { grid-template-columns: minmax(0, 1fr) 70px 80px; }
  .crm-serv select[data-k="recorrencia"] { grid-column: 1 / 3; }
}
.empty .row { flex-wrap: wrap; }
@media (max-width: 920px) { .crm-col-itens { min-height: 0; } .crm-vazio { display: none; } .crm-col-head { padding-bottom: 4px; } }
.nav-section { cursor: default; }
.nav-section:hover { color: rgba(255,255,255,.42); }
/* Balanço: os dois lados com a mesma altura e os totais alinhados embaixo (como num razonete) */
.balanco { align-items: stretch; }
.bal-lado { display: flex; flex-direction: column; }
.bal-lado .bal-total { margin-top: auto; }

/* ---------- Bloqueio de tela (operação longa em andamento) ---------- */
.bloqueio { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; cursor: progress;
  background: color-mix(in srgb, var(--sidebar-bg) 55%, transparent); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
.bloqueio.open { opacity: 1; }
.bloqueio-caixa { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px 26px; width: min(380px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.bloqueio-caixa .spinner { width: 30px; height: 30px; color: var(--laranja-500); margin-bottom: 4px; }
.bloqueio-caixa p { margin: 0; font-size: 13px; color: var(--text-2); }
.bloqueio-tempo { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bloqueio-caixa small { font-size: 12px; color: var(--text-3); }
