/* =========================================================
   NossaCasa — Design System
   ========================================================= */
:root {
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-d: 'Outfit', 'Manrope', system-ui, sans-serif;
  --accent: #d4ff3a; --accent-rgb: 212,255,58; --accent-ink: #0b0b0c; --accent-strong: #6e8a1e;
  --danger: #ff5d6c; --danger-rgb: 255,93,108;
  --success: #3ddc97; --success-rgb: 61,220,151;
  --warn: #ffb547; --info: #7c8cff;
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 12px; --r-xs: 9px;
  --ease: cubic-bezier(.2,.8,.2,1);
  --side-w: 248px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* tema escuro (padrão) */
  --bg: #09090a;
  --bg-2: #0f0f11;
  --surface: #141416;
  --surface-2: #1b1b1e;
  --surface-3: #232327;
  --surface-4: #2d2d32;
  --line: rgba(255,255,255,.065);
  --line-2: rgba(255,255,255,.12);
  --text: #f4f4f5;
  --text-2: #c8c8ce;
  --muted: #8a8a94;
  --faint: #56565e;
  --accent-text: var(--accent);
  --glass: rgba(16,16,18,.74);
  --shadow: 0 24px 60px -28px rgba(0,0,0,.75);
  --shadow-sm: 0 8px 24px -12px rgba(0,0,0,.6);
  --panel-grad: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,0) 60%);
  --hatch: repeating-linear-gradient(-45deg, rgba(255,255,255,.07) 0 6px, transparent 6px 12px);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eceee8;
  --bg-2: #e4e7df;
  --surface: #ffffff;
  --surface-2: #f5f6f2;
  --surface-3: #ebede7;
  --surface-4: #dfe2da;
  --line: rgba(15,18,10,.07);
  --line-2: rgba(15,18,10,.13);
  --text: #111214;
  --text-2: #33353b;
  --muted: #6a6d74;
  --faint: #a5a8ad;
  --accent-text: var(--accent-strong);
  --glass: rgba(255,255,255,.8);
  --shadow: 0 24px 50px -30px rgba(30,40,10,.35);
  --shadow-sm: 0 8px 22px -14px rgba(30,40,10,.3);
  --panel-grad: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0) 60%);
  --hatch: repeating-linear-gradient(-45deg, rgba(0,0,0,.07) 0 6px, transparent 6px 12px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 500 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-d); font-weight: 600; margin: 0; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
svg { width: 1em; height: 1em; flex-shrink: 0; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }
.num { font-family: var(--font-d); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.acc { color: var(--accent-text); }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
::selection { background: rgba(var(--accent-rgb), .35); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   Layout
   ========================================================= */
.booting { display: grid; place-items: center; min-height: 100vh; }
.boot-loader { display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  padding: 22px 16px; display: flex; flex-direction: column; gap: 20px;
  border-right: 1px solid var(--line); background: var(--bg-2);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 10px 30px -10px rgba(var(--accent-rgb), .6);
}
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.brand-name { font: 700 19px/1 var(--font-d); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-img { max-height: 40px; max-width: 170px; object-fit: contain; }
.sidebar .brand { padding: 2px 8px 6px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 14px 14px 6px; font-weight: 700; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 13px;
  height: 46px; padding: 0 14px; border-radius: 14px; color: var(--muted); font-weight: 600;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); }
.nav-item.active .nav-ic { background: var(--accent); color: var(--accent-ink); }
.nav-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; transition: background .2s, color .2s; }
.nav-ic .ic { width: 18px; height: 18px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.theme-switch { display: flex; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.theme-switch button { flex: 1; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: .2s; }
.theme-switch button.on { background: var(--surface-4); color: var(--text); }
[data-theme="light"] .theme-switch button.on { background: var(--surface); box-shadow: var(--shadow-sm); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); transition: .2s; }
.side-user:hover { border-color: var(--line-2); }
.side-user .who { min-width: 0; flex: 1; }
.side-user b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--muted); font-size: 11.5px; }

.main { min-width: 0; padding: 28px 32px 48px; }
.page { max-width: 1480px; margin: 0 auto; animation: pageIn .35s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 34px; font-weight: 600; }
.page-title span { color: var(--muted); font-weight: 400; }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* topo mobile */
.topbar { display: none; }
.bottomnav { display: none; }

/* grade */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.grid + .grid { margin-top: 16px; }
.s-12 { grid-column: span 12; } .s-9 { grid-column: span 9; } .s-8 { grid-column: span 8; } .s-7 { grid-column: span 7; }
.s-6 { grid-column: span 6; } .s-5 { grid-column: span 5; } .s-4 { grid-column: span 4; } .s-3 { grid-column: span 3; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* =========================================================
   Painéis
   ========================================================= */
.panel {
  position: relative; background: var(--surface); background-image: var(--panel-grad);
  border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; min-width: 0;
  box-shadow: var(--shadow-sm);
}
.panel.pad-0 { padding: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 40px; }
.panel-title { font: 600 17px/1.2 var(--font-d); letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.panel-title small { font: 500 12.5px var(--font); color: var(--muted); }
.panel-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.panel.accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 30px 60px -30px rgba(var(--accent-rgb), .55); }
.panel.accent .muted, .panel.accent .panel-sub { color: inherit; opacity: .7; }
.panel.accent .icon-btn { background: rgba(0,0,0,.1); color: inherit; border-color: transparent; }
.panel.accent::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .18;
  background: repeating-radial-gradient(circle at 110% -10%, transparent 0 22px, rgba(0,0,0,.35) 22px 23px);
}
.panel.glow::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px 220px at 100% 0%, rgba(var(--accent-rgb), .12), transparent 60%);
}
.panel.danger-tint { background: linear-gradient(160deg, rgba(var(--danger-rgb), .16), var(--surface) 60%); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); transition: .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); transform: translateY(-1px); }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.icon-btn.acc { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.icon-btn.danger:hover { color: var(--danger); }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-label { color: var(--muted); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.kpi-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.kpi-ic.acc { background: rgba(var(--accent-rgb), .14); color: var(--accent-text); }
.kpi-ic.pos { background: rgba(var(--success-rgb), .13); color: var(--success); }
.kpi-ic.neg { background: rgba(var(--danger-rgb), .13); color: var(--danger); }
.kpi-value { font: 600 30px/1 var(--font-d); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .55em; font-weight: 500; color: var(--muted); margin-right: 3px; letter-spacing: 0; }
.panel.accent .kpi-value small { color: inherit; opacity: .65; }
.kpi-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 20px; background: var(--surface-3); }
.delta.up { color: var(--success); background: rgba(var(--success-rgb), .12); }
.delta.down { color: var(--danger); background: rgba(var(--danger-rgb), .12); }

.progress { height: 8px; border-radius: 10px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent); transition: width .8s var(--ease); }
.progress.lg { height: 14px; }
.progress.hatch { background: var(--hatch), var(--surface-3); }
.progress.pos > i { background: var(--success); }
.progress.neg > i { background: var(--danger); }

/* Meta (barra estilo referência) */
.target-bar { position: relative; height: 34px; border-radius: 20px; background: var(--hatch), var(--surface-2); overflow: visible; margin: 8px 0 4px; }
.target-bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 20px; background: var(--accent); min-width: 34px; transition: width 1s var(--ease); box-shadow: 0 0 30px -6px rgba(var(--accent-rgb), .55); }
.target-bar > b { position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%; transform: translate(-30px, -50%); background: var(--surface); border: 4px solid var(--accent); transition: left 1s var(--ease); }

/* =========================================================
   Botões e controles
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 40px; font-weight: 700; font-size: 13.5px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); transition: .2s var(--ease); user-select: none;
}
.btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .ic { width: 18px; height: 18px; }
.btn svg:not(.ic) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 12px 30px -14px rgba(var(--accent-rgb), .7); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: rgba(var(--danger-rgb), .12); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: rgba(var(--danger-rgb), .2); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 12.5px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 40px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 34px; padding: 0 16px; border-radius: 30px; font-weight: 700; font-size: 12.5px; color: var(--muted); white-space: nowrap; transition: .2s var(--ease); display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--text); color: var(--bg); }
.seg.acc button.on { background: var(--accent); color: var(--accent-ink); }
.seg.block { display: flex; width: 100%; }
.seg.block button { flex: 1; justify-content: center; }

.monthpick { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 40px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.monthpick .icon-btn { width: 34px; height: 34px; background: transparent; border: 0; }
.monthpick .icon-btn:hover { background: var(--surface-3); transform: none; }
.monthpick-label { min-width: 136px; text-align: center; font: 600 14px var(--font-d); padding: 0 6px; text-transform: capitalize; height: 34px; border-radius: 20px; }
.monthpick-label:hover { background: var(--surface-3); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip .ic { width: 13px; height: 13px; }
.chip.acc { background: rgba(var(--accent-rgb), .14); color: var(--accent-text); }
.chip.pos { background: rgba(var(--success-rgb), .13); color: var(--success); }
.chip.neg { background: rgba(var(--danger-rgb), .13); color: var(--danger); }
.chip.warn { background: rgba(255,181,71,.14); color: var(--warn); }
.chip.solid { background: var(--accent); color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* =========================================================
   Formulários
   ========================================================= */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 12.5px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.label small { font-weight: 500; color: var(--muted); }
.inp, .select, textarea.inp {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s; font-weight: 600; font-size: 15px;
  appearance: none; -webkit-appearance: none;
}
textarea.inp { height: auto; min-height: 90px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.inp.code { font-family: ui-monospace, monospace; font-size: 12px; }
.inp::placeholder { color: var(--faint); font-weight: 500; }
.inp:focus, .select:focus { border-color: rgba(var(--accent-rgb), .8); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); background: var(--surface); }
.select { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a94' 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 14px center; background-size: 18px; }
.select option { background: var(--surface); color: var(--text); }
input[type="date"].inp, input[type="month"].inp { min-height: 48px; }
input[type="date"].inp::-webkit-calendar-picker-indicator, input[type="month"].inp::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
[data-theme="dark"] input[type="date"].inp::-webkit-calendar-picker-indicator, [data-theme="dark"] input[type="month"].inp::-webkit-calendar-picker-indicator { filter: invert(1); }
.inp-wrap { position: relative; display: block; }
.inp-pre { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; font-size: 14px; }
.inp-suf { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; font-size: 13px; }
.inp-wrap .inp.has-pre { padding-left: 46px; }
.inp-wrap .inp.has-suf { padding-right: 54px; }
.inp-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.inp-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.inp.big { height: 64px; font: 600 28px var(--font-d); letter-spacing: -.02em; }
.inp-wrap .inp.big.has-pre { padding-left: 58px; }
.inp-wrap .inp.big + .inp-pre, .inp-wrap .inp-pre.big { font-size: 18px; left: 20px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-sec { margin-top: 6px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.form-sec-title { font: 600 14px var(--font-d); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.hint { font-size: 12px; color: var(--muted); }

/* switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); user-select: none; }
.switch-text b { display: block; font-size: 13.5px; }
.switch-text small { color: var(--muted); font-size: 12px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 46px; height: 28px; border-radius: 20px; background: var(--surface-4); flex-shrink: 0; transition: .25s var(--ease); }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .25s var(--ease); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25); }

/* checkbox */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text-2); user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; transition: .2s; flex-shrink: 0; }
.check input:checked + .check-box { background: var(--accent); border-color: transparent; }
.check input:checked + .check-box::after { content: ''; width: 10px; height: 6px; border: 2.5px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* seletor em chips */
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin: 0 -2px; scrollbar-width: none; }
.pick.scroll::-webkit-scrollbar { display: none; }
.pick-opt {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 8px; border-radius: 30px;
  background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 700; font-size: 12.5px; color: var(--text-2);
  transition: .18s var(--ease); white-space: nowrap; flex-shrink: 0;
}
.pick-opt.noic { padding-left: 14px; }
.pick-opt:hover { border-color: var(--faint); color: var(--text); }
.pick-opt.on { background: var(--text); color: var(--bg); border-color: transparent; }
.pick-opt .cat-ic { width: 26px; height: 26px; border-radius: 50%; }
.pick-opt .cat-ic .ic { width: 14px; height: 14px; }
.pick-opt .avatar { width: 26px; height: 26px; font-size: 10px; }

/* seletor de cartões */
.card-pick { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.card-pick-opt { flex: 0 0 210px; scroll-snap-align: start; border-radius: 18px; padding: 3px; border: 2px solid transparent; transition: .2s var(--ease); position: relative; }
.card-pick-opt:hover { transform: translateY(-2px); }
.card-pick-opt.on { border-color: var(--accent); }
.card-pick-opt.on::after { content: ''; position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b0b0c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/14px no-repeat; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.card-pick-opt .ccard { font-size: 8.6px; }
.card-pick-add { flex: 0 0 120px; border-radius: 16px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 12px; text-align: center; gap: 6px; padding: 10px; }

/* cores */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); transition: .15s; position: relative; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.swatch-custom { position: relative; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); box-shadow: 0 0 0 1px var(--line-2); }
.swatch-custom input { position: absolute; inset: -6px; width: 50px; height: 50px; opacity: 0; cursor: pointer; }

/* ícones selecionáveis */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.icon-grid button { height: 44px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); }
.icon-grid button.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* =========================================================
   Avatares
   ========================================================= */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; font: 700 14px var(--font-d); color: #0b0b0c; background: var(--surface-3); position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-edit { position: relative; display: inline-block; }
.avatar-edit .icon-btn { position: absolute; right: -4px; bottom: -4px; width: 34px; height: 34px; background: var(--accent); color: var(--accent-ink); border: 3px solid var(--surface); }

/* =========================================================
   Cartão de crédito (visual)
   ========================================================= */
.ccard {
  --c1: #2a2a2e; --c2: #111113; --ink: #fff;
  position: relative; aspect-ratio: 1.586; width: 100%; border-radius: 1.6em; padding: 1.6em 1.7em;
  font-size: 10px; color: var(--ink); overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 1.8em 3.5em -1.6em rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.18);
  display: flex; flex-direction: column; justify-content: space-between; user-select: none;
}
.ccard::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.22), transparent 55%), repeating-radial-gradient(circle at 115% 120%, transparent 0 2.1em, rgba(255,255,255,.06) 2.1em 2.2em); }
.ccard::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.08) 50%, transparent 60%); }
.ccard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1em; }
.ccard-bank { font: 700 1.55em/1.1 var(--font-d); letter-spacing: -.02em; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-name { font-size: 1.05em; opacity: .75; font-weight: 600; margin-top: .2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-wave svg { width: 2.2em; height: 2.2em; fill: none; stroke: currentColor; stroke-width: 1.8; opacity: .85; }
.ccard-mid { display: flex; align-items: center; gap: 1.2em; }
.ccard-chip { width: 3.8em; height: 2.9em; border-radius: .55em; background: linear-gradient(135deg, #f5dd9a, #c9a34f 55%, #f0d58c); position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.ccard-chip::before { content: ''; position: absolute; inset: .5em .9em; border: 1px solid rgba(0,0,0,.25); border-radius: .3em; }
.ccard-chip::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(0,0,0,.25); }
.ccard-num { font: 600 1.7em/1 var(--font-d); letter-spacing: .14em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ccard-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 1em; }
.ccard-holder small { display: block; font-size: .85em; opacity: .6; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.ccard-holder b { font-size: 1.2em; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; display: block; max-width: 17em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-brand { height: 3em; display: flex; align-items: center; }
.ccard-brand svg { height: 100%; width: auto; }
.ccard.mini { font-size: 4px; border-radius: 1.4em; box-shadow: 0 6px 14px -8px rgba(0,0,0,.6); }
.ccard.mini > * { visibility: hidden; }
.ccard.mini .ccard-brand { visibility: visible; position: absolute; right: 1.6em; bottom: 1.6em; height: 4em; }
.cc-thumb { width: 46px; flex-shrink: 0; }

/* =========================================================
   Gráficos
   ========================================================= */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 210px; padding-top: 36px; }
.bars-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; min-width: 0; cursor: default; }
.bars-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 5px; position: relative; }
.bar { width: 100%; max-width: 30px; border-radius: 30px; background: var(--surface-3); position: relative; min-height: 8px; transition: height .9s var(--ease), background .2s; }
.bar.b-in { background: color-mix(in srgb, var(--text) 22%, transparent); }
.bar.b-out { background: var(--hatch), var(--surface-4); }
.bars-col.on .bar.b-in { background: var(--accent); box-shadow: 0 0 30px -4px rgba(var(--accent-rgb), .55); }
.bars-col.on .bar.b-out { background: var(--text); }
.bars-col:hover .bar.b-in { background: rgba(var(--accent-rgb), .7); }
.bars-lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: capitalize; }
.bars-col.on .bars-lbl { color: var(--text); }
.bars-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font: 700 11px var(--font-d); padding: 4px 9px; border-radius: 10px; white-space: nowrap; opacity: 0; pointer-events: none; transition: .2s; z-index: 2; }
.bars-tip::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--accent); }
.bars-col.on .bars-tip, .bars-col:hover .bars-tip { opacity: 1; }
.bars-col:hover .bars-tip { background: var(--text); color: var(--bg); }
.bars-col:hover .bars-tip::after { border-top-color: var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 4px; display: inline-block; }

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 4.4; }
.donut .trk { stroke: var(--surface-3); }
.donut .seg-c { transition: stroke-dasharray .9s var(--ease); stroke-linecap: round; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; align-content: center; }
.donut-center b { font: 600 17px var(--font-d); letter-spacing: -.02em; }
.donut-center small { color: var(--muted); font-size: 11px; font-weight: 600; }
.cat-list { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.cat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cat-row .ellipsis { flex: 1; color: var(--text-2); font-weight: 600; }
.cat-row b { font-variant-numeric: tabular-nums; font-family: var(--font-d); font-weight: 600; }
.cat-row em { font-style: normal; color: var(--muted); font-size: 11.5px; width: 36px; text-align: right; }

.ring { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .trk { stroke: var(--surface-3); }
.ring .val { stroke: var(--accent); transition: stroke-dasharray 1s var(--ease); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), .45)); }
.ring .val.alt { stroke: var(--text); filter: none; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.ring-center b { font: 600 24px/1 var(--font-d); letter-spacing: -.03em; }
.ring-center small { color: var(--muted); font-size: 11px; font-weight: 600; margin-top: 4px; }
.ring-center .ic { width: 22px; height: 22px; color: var(--muted); margin-bottom: 4px; }
.rings { display: flex; justify-content: space-around; gap: 16px; flex-wrap: wrap; }
.ring-item { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ring-item .lbl { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 12.5px; color: var(--text-2); }
.ring-item .lbl i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ring-item .sub { font-size: 12px; color: var(--muted); margin-top: -6px; }

.arc { position: relative; width: 100%; max-width: 290px; margin: 0 auto; }
.arc svg { width: 100%; height: auto; display: block; }
.arc line { stroke-linecap: round; stroke-width: 9; }
.arc-center { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.arc-center b { font: 600 34px/1 var(--font-d); letter-spacing: -.04em; }
.arc-center small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 4px; }

.area { width: 100%; height: 150px; display: block; }
.area-wrap { position: relative; }

.spark-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.spark-bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; min-width: 0; }
.spark-bars i { display: block; border-radius: 8px; background: var(--surface-3); min-height: 4px; transition: height .8s var(--ease); }
.spark-bars i.n { background: var(--accent); margin-top: 3px; }
.spark-bars > div.today i.g { background: var(--text); }
.spark-bars > div:hover i { filter: brightness(1.25); }
.spark-days { display: flex; gap: 4px; margin-top: 8px; }
.spark-days span { flex: 1; text-align: center; font-size: 9.5px; color: var(--faint); font-weight: 700; min-width: 0; overflow: hidden; }

/* =========================================================
   Hero (dashboard)
   ========================================================= */
.hero { overflow: hidden; padding: 26px; min-height: 100%; display: flex; flex-direction: column; gap: 18px; }
.hero::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(500px 260px at 0% 0%, rgba(var(--accent-rgb), .16), transparent 60%),
    radial-gradient(420px 300px at 100% 100%, rgba(124,140,255,.16), transparent 60%);
}
.hero > * { position: relative; }
.hero-hi { font: 500 26px/1.15 var(--font-d); letter-spacing: -.03em; }
.hero-hi b { font-weight: 700; }
.hero-hi span { color: var(--muted); }
.hero-months { display: flex; gap: 8px; align-items: flex-end; }
.hero-month { flex: 1; min-width: 0; height: 54px; border-radius: 14px; border: 1px solid var(--line-2); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: lowercase; transition: .25s var(--ease); position: relative; overflow: hidden; }
.hero-month.past { background: var(--hatch); }
.hero-month:hover { color: var(--text); border-color: var(--faint); }
.hero-month.on { height: 72px; background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 14px 30px -14px rgba(var(--accent-rgb), .7); }
.hero-month.on::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 58%; background: rgba(255,255,255,.75); border-radius: 12px 12px 0 0; }
[data-theme="light"] .hero-month.on::before { background: rgba(255,255,255,.85); }
.hero-month.on span { position: relative; color: #0b0b0c; }
.hero-balance { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-balance .kpi-value { font-size: 42px; }
.hero-balance .lbl { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.hero-split { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-split div { display: flex; flex-direction: column; gap: 2px; }
.hero-split small { color: var(--muted); font-size: 12px; font-weight: 600; }
.hero-split b { font: 600 16px var(--font-d); font-variant-numeric: tabular-nums; }

/* =========================================================
   Listas
   ========================================================= */
.list { display: flex; flex-direction: column; }
.list-day { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 800; padding: 16px 6px 8px; display: flex; justify-content: space-between; }
.list-day:first-child { padding-top: 0; }
.tx {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 12px 12px; border-radius: 18px; transition: background .15s; cursor: pointer; position: relative;
}
.tx + .tx { margin-top: 2px; }
.tx:hover { background: var(--surface-2); }
.cat-ic { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; position: relative; }
.cat-ic .ic { width: 20px; height: 20px; }
.tx-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tx-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.tx-title .ellipsis { flex: 0 1 auto; }
.tx-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; font-weight: 600; min-width: 0; }
.tx-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.tx-meta .chip { height: 22px; font-size: 11px; padding: 0 8px; }
.tx-amt { text-align: right; font: 600 15.5px var(--font-d); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.tx-amt small { display: block; font: 600 11px var(--font); color: var(--muted); margin-top: 2px; }
.tx-amt.in { color: var(--success); }
.tx.is-paid .tx-amt { opacity: .55; }
.paid-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px dashed var(--faint); display: grid; place-items: center; color: transparent; transition: .2s var(--ease); flex-shrink: 0; }
.paid-btn .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.paid-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.paid-btn.on { background: var(--accent); border: 0; color: var(--accent-ink); }
.paid-btn.late { border-color: var(--danger); border-style: solid; }
.paid-btn[disabled] { pointer-events: none; }
.mini-card-chip { display: inline-flex; align-items: center; gap: 6px; }
.mini-card-chip .ccard { width: 24px; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty-ic { width: 64px; height: 64px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--faint); }
.empty-ic .ic { width: 28px; height: 28px; }
.empty b { color: var(--text); font: 600 16px var(--font-d); }

.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.mini-row .grow { flex: 1; min-width: 0; }
.mini-row b { font-size: 13.5px; display: block; }
.mini-row small { color: var(--muted); font-size: 12px; font-weight: 600; }
.mini-row .amt { font: 600 14px var(--font-d); font-variant-numeric: tabular-nums; white-space: nowrap; }

.member-bar { display: flex; align-items: center; gap: 12px; }
.member-bar + .member-bar { margin-top: 14px; }
.member-bar .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.member-bar .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.member-bar .row span:last-child { font-family: var(--font-d); font-weight: 600; font-variant-numeric: tabular-nums; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.stat small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 12px; }
.stat small .ic { width: 14px; height: 14px; }
.stat b { display: block; font: 600 20px/1.2 var(--font-d); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b small { display: inline; font-size: 12px; color: var(--muted); }

.comp-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.comp-row + .comp-row { border-top: 1px solid var(--line); }
.comp-row .grow { flex: 1; }
.comp-row b { font: 600 15px var(--font-d); font-variant-numeric: tabular-nums; }

/* tabela responsiva */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 800; padding: 10px 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; }
.table td.strong { font-family: var(--font-d); font-weight: 600; font-size: 14px; }

/* cards de pessoas */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.person { display: flex; flex-direction: column; gap: 16px; cursor: pointer; transition: transform .2s var(--ease), border-color .2s; }
.person:hover { transform: translateY(-2px); border-color: var(--line-2); }
.person-top { display: flex; align-items: center; gap: 14px; }
.person-top .grow { min-width: 0; flex: 1; }
.person-top b { font: 600 17px var(--font-d); display: block; }
.person-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.person-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); font-weight: 600; }
.person-foot b { color: var(--text); font: 600 15px var(--font-d); }
.person.off { opacity: .55; }

.perm-table { display: flex; flex-direction: column; gap: 8px; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.perm-row b { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.perm-row .seg { background: var(--surface); }
.perm-row .seg button { height: 30px; padding: 0 11px; font-size: 11.5px; }

/* cartões (página) */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card-item { display: flex; flex-direction: column; gap: 14px; cursor: pointer; padding: 14px; transition: .2s var(--ease); }
.card-item:hover { border-color: var(--line-2); }
.card-item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.card-item .ccard { font-size: 10.5px; }
.card-info { padding: 2px 6px 4px; display: flex; flex-direction: column; gap: 10px; }
.card-info-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.card-info-row b { color: var(--text); font: 600 14px var(--font-d); font-variant-numeric: tabular-nums; }
.card-add { border: 1.5px dashed var(--line-2); border-radius: var(--r-xl); display: grid; place-items: center; min-height: 240px; color: var(--muted); font-weight: 700; gap: 10px; align-content: center; transition: .2s; background: transparent; }
.card-add:hover { border-color: var(--accent); color: var(--text); }
.card-add .icon-btn { width: 54px; height: 54px; }
.invoice-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.invoice-total { font: 600 34px/1 var(--font-d); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.banks { display: flex; gap: 8px; flex-wrap: wrap; }
.bank-opt { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 20px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); }
.bank-opt i { width: 24px; height: 24px; border-radius: 50%; display: inline-block; }
.bank-opt.on { border-color: var(--text); color: var(--text); background: var(--surface-3); }
.brand-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.brand-opt { height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; padding: 10px; color: var(--text); }
.brand-opt svg { height: 24px; width: auto; max-width: 100%; }
.brand-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-preview { max-width: 360px; margin: 0 auto 6px; }
.card-preview .ccard { font-size: 11px; }

/* tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 44px; padding: 0 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.tabs button .chip { height: 20px; padding: 0 7px; font-size: 10.5px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 220px; position: relative; }
.toolbar .search .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.toolbar .search .inp { padding-left: 44px; height: 44px; border-radius: 40px; }
.toolbar .select { height: 44px; border-radius: 40px; width: auto; min-width: 150px; font-size: 13px; }
.filters { display: contents; }

.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-strip .stat b { font-size: 19px; }

/* configurações */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.upload-box { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.upload-prev { width: 64px; height: 64px; border-radius: 16px; background: var(--surface-3) center/contain no-repeat; flex-shrink: 0; display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.upload-prev img { max-width: 80%; max-height: 80%; object-fit: contain; }
.upload-box .grow { flex: 1; min-width: 0; }
.upload-box b { font-size: 13.5px; display: block; }
.upload-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.cat-manage { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.cat-manage .mini-row { cursor: pointer; }
.cat-manage .mini-row:hover { border-color: var(--line-2); }

/* =========================================================
   Modais / bottom sheets
   ========================================================= */
#modals { position: relative; z-index: 100; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; animation: fadeIn .2s ease; overflow-y: auto; }
.modal {
  width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 30px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.7); display: flex; flex-direction: column; max-height: calc(100dvh - 48px);
  animation: popIn .3s var(--ease); position: relative;
}
.modal.lg { max-width: 760px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.modal-title { font: 600 21px var(--font-d); letter-spacing: -.02em; }
.modal-body { padding: 14px 24px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.modal-foot { padding: 14px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
.modal-grip { display: none; }
.modal-bg.closing { animation: fadeOut .2s ease forwards; }
.modal-bg.closing .modal { animation: popOut .2s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes popOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

.calc-box { border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.calc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.calc-row b { font-family: var(--font-d); font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-row.total { border-top: 1px dashed var(--line-2); padding-top: 10px; margin-top: 4px; font-size: 15px; color: var(--text); }
.calc-row.total b { font-size: 22px; }
.calc-mini { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; transition: .2s var(--ease); width: 100%; }
.choice:hover { border-color: var(--line-2); background: var(--surface-3); }
.choice .grow { flex: 1; min-width: 0; }
.choice b { display: block; font-size: 14px; }
.choice small { color: var(--muted); font-size: 12.5px; }
.choice.danger b { color: var(--danger); }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; transition: .2s var(--ease); }
.quick:hover { border-color: var(--line-2); transform: translateY(-2px); }
.quick b { font-size: 14px; }
.quick small { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }

/* toasts */
#toasts { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px; background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-weight: 600; font-size: 13.5px; max-width: 380px; animation: toastIn .35s var(--ease); }
.toast-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex-shrink: 0; }
.toast.err .toast-ic { background: var(--danger); color: #fff; }
.toast-ic .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

.alert { padding: 12px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; line-height: 1.45; display: flex; gap: 10px; align-items: flex-start; }
.alert .ic { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-danger { background: rgba(var(--danger-rgb), .12); color: var(--danger); }
.alert-warn { background: rgba(255,181,71,.12); color: var(--warn); }
.alert-info { background: rgba(var(--accent-rgb), .1); color: var(--accent-text); }
.alert-muted { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }

.skeleton { border-radius: var(--r-xl); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* =========================================================
   Login / instalação
   ========================================================= */
.auth-body { background: var(--bg); }
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; min-height: 100dvh; }
.auth-art { position: relative; overflow: hidden; background: #0b0b0c; color: #f4f4f5; margin: 14px; border-radius: 34px; }
.auth-art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(700px 420px at 20% 10%, rgba(var(--accent-rgb), .22), transparent 60%), radial-gradient(600px 500px at 100% 100%, rgba(124,140,255,.22), transparent 60%); }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, #000 70%, transparent); }
.auth-art-inner { position: relative; z-index: 1; height: 100%; padding: 48px; display: flex; flex-direction: column; }
.auth-art .brand-name { color: #fff; }
.auth-title { margin-top: auto; font: 500 54px/1.02 var(--font-d); letter-spacing: -.045em; max-width: 520px; }
.auth-title span { color: var(--accent); }
.auth-float { position: absolute; background: rgba(26,26,29,.94); border: 1px solid rgba(255,255,255,.08); border-radius: 22px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); will-change: transform; transform: translate3d(0,0,0); backface-visibility: hidden; -webkit-backface-visibility: hidden; contain: layout paint; }
.auth-float small { display: block; color: #8a8a94; font-size: 12px; font-weight: 600; }
.auth-float strong { font: 600 19px var(--font-d); letter-spacing: -.02em; }
.auth-float.f1 { top: 120px; right: 48px; flex-direction: column; align-items: flex-start; gap: 6px; }
.auth-float.f2 { top: 300px; right: 200px; }
.auth-float.f3 { top: 230px; left: 48px; }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -6px, 0); } }
.mini-bars { display: flex; align-items: flex-end; gap: 5px; height: 48px; margin-top: 6px; }
.mini-bars i { width: 14px; border-radius: 8px; background: rgba(255,255,255,.14); }
.mini-bars i.on { background: var(--accent); }
.ring-sm { position: relative; width: 52px; height: 52px; }
.ring-sm svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-sm circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.ring-sm .trk { stroke: rgba(255,255,255,.1); }
.ring-sm .val { stroke: var(--accent); }
.ring-sm b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12px var(--font-d); }
.cc-mini { width: 62px; aspect-ratio: 1.586; border-radius: 9px; background: linear-gradient(135deg, #8a05be, #3b0a5c); position: relative; }
.cc-mini::after { content: ''; position: absolute; right: 7px; bottom: 7px; width: 18px; height: 11px; background: radial-gradient(circle at 30% 50%, #eb001b 5px, transparent 5.5px), radial-gradient(circle at 70% 50%, #f79e1b 5px, transparent 5.5px); }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h2 { font-size: 32px; }
.auth-brand-mobile { display: none; margin-bottom: 10px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; }
.brand-lg .brand-mark { width: 46px; height: 46px; }

.install { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(700px 400px at 50% 0%, rgba(var(--accent-rgb), .12), transparent 70%), var(--bg); }
.install-card { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 30px; padding: 32px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.install-card h2 { font-size: 28px; margin-top: 8px; }
.install-card h3 { font-size: 15px; color: var(--text-2); margin: 10px 0 2px; }
.install-form { display: flex; flex-direction: column; gap: 14px; }
.checks { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; border-radius: 18px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
.checks li { display: flex; align-items: center; gap: 8px; }
.checks li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex-shrink: 0; }
.checks li.ok span { background: rgba(var(--success-rgb), .16); color: var(--success); }
.checks li.bad span { background: rgba(var(--danger-rgb), .16); color: var(--danger); }
.checks small { color: var(--muted); }

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 1360px) {
  .t-6 { grid-column: span 6; } .t-12 { grid-column: span 12; } .t-4 { grid-column: span 4; } .t-8 { grid-column: span 8; }
}
@media (max-width: 1180px) {
  :root { --side-w: 88px; }
  .sidebar { padding: 20px 12px; align-items: center; }
  .sidebar .brand-name, .sidebar .brand-img, .nav-label, .nav-item span.txt, .side-user .who, .side-user .ic { display: none; }
  .sidebar .brand { padding: 0; }
  .nav-item { width: 56px; height: 52px; padding: 0; justify-content: center; }
  .nav-item .nav-badge { position: absolute; top: 4px; right: 2px; margin: 0; }
  .nav-ic { width: 40px; height: 40px; border-radius: 13px; }
  .theme-switch { flex-direction: column; }
  .theme-switch button { width: 44px; }
  .side-user { padding: 4px; border-radius: 50%; }
  .main { padding: 24px 24px 48px; }
  .m-6 { grid-column: span 6; } .m-12 { grid-column: span 12; }
  .settings-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr 1fr; }
  .auth-title { font-size: 42px; }
  .auth-float.f2 { right: 40px; top: 330px; }
}
@media (max-width: 900px) {
  .p-12 { grid-column: span 12; } .p-6 { grid-column: span 6; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-brand-mobile { display: flex; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .shell { display: block; }
  .sidebar { display: none; }
  .main { padding: calc(74px + var(--safe-t)) 16px calc(108px + var(--safe-b)); }
  .topbar {
    display: flex; position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    height: calc(64px + var(--safe-t)); padding: var(--safe-t) 16px 0; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand-mark { width: 36px; height: 36px; border-radius: 12px; }
  .topbar .brand-name { font-size: 17px; }
  .topbar .brand-img { max-height: 34px; max-width: 140px; }
  .topbar-actions { display: flex; align-items: center; gap: 8px; }
  .topbar .avatar { width: 38px; height: 38px; }

  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 30;
    height: 70px; padding: 0 6px; border-radius: 26px;
    background: var(--glass); backdrop-filter: saturate(160%) blur(20px); -webkit-backdrop-filter: saturate(160%) blur(20px);
    border: 1px solid var(--line-2); box-shadow: 0 20px 50px -16px rgba(0,0,0,.6);
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 58px; border-radius: 18px; color: var(--muted); font-size: 10.5px; font-weight: 700; position: relative; transition: color .2s; }
  .bn-item .ic { width: 22px; height: 22px; transition: transform .25s var(--ease); }
  .bn-item.active { color: var(--text); }
  .bn-item.active .ic { transform: translateY(-1px); }
  .bn-item.active::after { content: ''; position: absolute; bottom: 3px; width: 18px; height: 3px; border-radius: 3px; background: var(--accent); }
  .bn-item .nav-badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }
  .bn-fab { justify-self: center; width: 58px; height: 58px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 14px 30px -10px rgba(var(--accent-rgb), .75); transform: translateY(-14px); transition: transform .2s var(--ease); }
  .bn-fab:active { transform: translateY(-14px) scale(.94); }
  .bn-fab .ic { width: 26px; height: 26px; stroke-width: 2.4; }

  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .page-title { font-size: 27px; }
  .page-actions { width: 100%; }
  .page-actions .monthpick { flex: 1; justify-content: space-between; }
  .page-actions .btn-desk { display: none; }
  .grid { gap: 12px; }
  .grid + .grid { margin-top: 12px; }
  .grid > [class*="s-"] { grid-column: span 12; }
  .grid > .x-6 { grid-column: span 6; }
  .panel { padding: 18px; border-radius: 24px; }
  .kpi-value { font-size: 26px; }
  .hero { padding: 20px; }
  .hero-hi { font-size: 22px; }
  .hero-balance .kpi-value { font-size: 34px; }
  .hero-month { height: 46px; font-size: 10.5px; border-radius: 12px; }
  .hero-month.on { height: 60px; }
  .bars { height: 180px; gap: 6px; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .tx { grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 10px 8px; }
  .tx .paid-btn { grid-column: 3; grid-row: 1; display: none; }
  .tx .tx-amt { grid-column: 3; }
  .tx.show-paid { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .tx.show-paid .paid-btn { display: grid; grid-column: auto; grid-row: auto; width: 32px; height: 32px; }
  .cat-ic { width: 40px; height: 40px; border-radius: 13px; }
  .tx-amt { font-size: 14.5px; }
  .toolbar .select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .filters { display: none; }
  .filters.open { display: contents; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cards-grid { grid-template-columns: 1fr; }
  .people { grid-template-columns: 1fr; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid .m-full { grid-column: 1 / -1; }
  .table-wrap.cardify { margin: 0; overflow: visible; }
  .table-wrap.cardify .table thead { display: none; }
  .table-wrap.cardify .table, .table-wrap.cardify .table tbody, .table-wrap.cardify .table tr, .table-wrap.cardify .table td { display: block; }
  .table-wrap.cardify .table tr { padding: 12px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .table-wrap.cardify .table td { padding: 0; border: 0; white-space: normal; font-size: 12.5px; }
  .table-wrap.cardify .table td::before { content: attr(data-l); display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 800; }
  .table-wrap.cardify .table td.full { grid-column: 1 / -1; }
  .table-wrap.cardify .table td.r { text-align: left; }
  .table-wrap.cardify .table tbody tr:hover td { background: transparent; }

  /* modal vira bottom sheet */
  .modal-bg { padding: 0; place-items: end stretch; align-items: end; }
  .modal, .modal.lg, .modal.sm { max-width: none; border-radius: 28px 28px 0 0; max-height: calc(100dvh - 24px - var(--safe-t)); animation: sheetIn .32s var(--ease); border-bottom: 0; }
  .modal-bg.closing .modal { animation: sheetOut .22s ease forwards; }
  .modal-grip { display: block; width: 42px; height: 5px; border-radius: 5px; background: var(--surface-4); margin: 10px auto 0; flex-shrink: 0; }
  .modal-head { padding: 12px 18px 4px; }
  .modal-title { font-size: 19px; }
  .modal-body { padding: 12px 18px 18px; }
  .modal-foot { padding: 12px 18px calc(14px + var(--safe-b)); }
  .modal-foot .btn { flex: 1; }
  .modal-foot .spacer { display: none; }
  .modal-foot .btn-danger { flex: 0 0 auto; }
  .inp, .select { font-size: 16px; }

  #toasts { top: calc(12px + var(--safe-t)); left: 12px; right: 12px; align-items: center; }
  .toast { max-width: 100%; width: 100%; }
  .stat b { font-size: 18px; }
  .ring { width: 128px; height: 128px; }
  .install-card { padding: 22px; border-radius: 24px; }
  .checks { grid-template-columns: 1fr; }
  .invoice-total { font-size: 28px; }
}
@media (max-width: 380px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .bn-item { font-size: 9.5px; }
  .hero-balance .kpi-value { font-size: 30px; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
}
@media (hover: none) {
  .btn:hover, .icon-btn:hover, .quick:hover, .person:hover, .card-pick-opt:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  /* Windows com "efeitos de animação" desligados: nada de animações repetitivas */
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .auth-float, .skeleton { animation: none !important; }
  .spinner, .btn.loading::after { animation: spin .8s linear infinite !important; }
}

/* ---------- complementos ---------- */
.inv-list { display: flex; flex-direction: column; gap: 8px; }
.inv-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.inv-row .ellipsis { flex: 1; }
.inv-row b { font: 600 14px var(--font-d); font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-row .cc-thumb { width: 38px; }
.uber-dash { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.uber-dash .rings { gap: 22px; }
.mob-only { display: none; }
.side-add { margin-bottom: 4px; }
details > summary::-webkit-details-marker { display: none; }
details > summary { display: inline-flex !important; gap: 6px; align-items: center; justify-content: flex-start !important; }
.perm-row .hint { display: block; margin-top: 2px; font-weight: 500; }
.perm-row > div:first-child { min-width: 0; flex: 1 1 200px; }
.stat small + small { margin-top: 4px; }
@media (max-width: 1180px) {
  .side-add { width: 52px; height: 52px; padding: 0; border-radius: 18px; }
  .side-add .txt { display: none; }
}
@media (max-width: 900px) {
  .uber-dash { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mob-only { display: inline-flex; }
  .perm-row .seg { width: 100%; }
  .perm-row .seg button { flex: 1; justify-content: center; }
  .uber-dash .rings { justify-content: space-around; }
  .card-pick-opt { flex-basis: 190px; }
}

/* ---------- correções de layout ---------- */
.modal, .modal-body, .modal-body > *, .stack > *, .field, .form-grid > * { min-width: 0; }
.modal-bg > .modal { justify-self: center; }
.ccard-top > div:first-child { flex: 1; min-width: 0; }
.ccard-bank { max-width: 100%; }
.calc-row b { white-space: nowrap; }
.calc-row span { min-width: 0; }
.donut-wrap { flex-wrap: wrap; justify-content: center; }
.donut-wrap .cat-list { min-width: 190px; }
.ccard.mini .ccard-brand { height: 3.6em; max-width: 62%; }
.ccard.mini .ccard-brand svg { max-width: 100%; height: auto; max-height: 100%; }
.stat b.compact { font-size: 15px; white-space: normal; overflow: visible; }
@media (max-width: 760px) {
  .modal-bg > .modal { justify-self: stretch; width: 100%; }
}

/* ---------- Pagamentos ---------- */
.pay-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px; border-radius: 18px; cursor: pointer; transition: background .15s; }
.pay-row + .pay-row { margin-top: 2px; }
.pay-row:hover { background: var(--surface-2); }
.pay-row.is-paid .tx-main, .pay-row.is-paid .tx-amt, .pay-row.is-paid .cat-ic, .pay-row.is-paid .pay-card { opacity: .5; }
.pay-row.is-paid .tx-title .ellipsis { text-decoration: line-through; text-decoration-color: var(--faint); }
.pay-check { width: 40px; height: 40px; }
.pay-card { width: 44px; display: block; flex-shrink: 0; }
.panel-head .seg button { height: 30px; padding: 0 12px; }
a.stat:hover { border-color: var(--line-2); }
a.alert { text-decoration: none; }
@media (max-width: 760px) {
  .pay-row { grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; padding: 10px 6px; }
  .pay-row .tx-amt { grid-column: 3; text-align: left; font-size: 15px; }
  .pay-row .tx-amt small { display: inline; margin-left: 6px; }
  .pay-check { width: 34px; height: 34px; }
  .pay-card { width: 38px; }
  .panel-head:has(.seg) { flex-wrap: wrap; }
}

/* ---------- v1.5 ---------- */
.invoice-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.paid-spacer { width: 36px; height: 36px; flex-shrink: 0; }
.inc-split { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.inc-split .kpi-foot { margin-top: 0; }
.inc-split .progress { height: 5px; }
@media (max-width: 760px) { .paid-spacer { width: 32px; height: 32px; } }
