/* =====================================================================
   Bossa · sistema financeiro
   Preto translúcido e branco, bordas arredondadas, movimento contido.
   ===================================================================== */

/* Fonte da marca Bossa (DM Sans, a mesma de bossa-rio.netlify.app), servida localmente */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../fonts/dmsans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../fonts/dmsans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/dmsans-italic-latin.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f3f3f1;
  --bg-2: #eaeae7;
  --surface: #fcfcfb;
  --surface-2: rgba(255, 255, 255, 0.92);
  --surface-sunk: rgba(10, 10, 10, 0.035);
  --hover: rgba(10, 10, 10, 0.045);
  --border: rgba(10, 10, 10, 0.08);
  --border-strong: rgba(10, 10, 10, 0.16);
  --text: #0b0b0b;
  --text-2: rgba(11, 11, 11, 0.62);
  --text-3: rgba(11, 11, 11, 0.42);
  --ink: #0b0b0b;
  --ink-text: #ffffff;
  --terra: #964942;  /* terracota da marca (logo) */
  --pos: #11813f;
  --neg: #b42318;
  --warn: #a15c00;
  --pos-bg: rgba(17, 129, 63, 0.09);
  --neg-bg: rgba(180, 35, 24, 0.08);
  --warn-bg: rgba(161, 92, 0, 0.1);
  --shadow: 0 1px 0 rgba(255,255,255,0.8) inset, 0 12px 40px -18px rgba(0, 0, 0, 0.18);
  --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, 0.35);
  --wave: rgba(0, 0, 0, 0.035);
  --scrim: rgba(240, 240, 238, 0.7);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #4a3aa7; --series-8: #e34948;
  --grid: rgba(0, 0, 0, 0.07);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  /* desfoque do fundo ("vidro") desligado em 06/10/2026: com um backdrop-filter em cada card, botão e campo, o
     navegador redesfocava o fundo a cada quadro de rolagem e o notebook travava. As superfícies ficaram opacas,
     com a mesma cor que o vidro mostrava. Não religar em elementos que se repetem. */
  --blur: none;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --font: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand: #964942;
  --sidebar: 244px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --logo-ring: rgba(255, 255, 255, 0.16);
    --terra: #c98479;
    --bg: #050505;
    --bg-2: #0d0d0d;
    --surface: #101010;
    --surface-2: rgba(22, 22, 22, 0.92);
    --surface-sunk: rgba(255, 255, 255, 0.03);
    --hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.085);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f4f4f2;
    --text-2: rgba(244, 244, 242, 0.62);
    --text-3: rgba(244, 244, 242, 0.4);
    --ink: #f4f4f2;
    --ink-text: #0a0a0a;
    --pos: #4ad28a;
    --neg: #ff7b72;
    --warn: #f0b451;
    --pos-bg: rgba(74, 210, 138, 0.1);
    --neg-bg: rgba(255, 123, 114, 0.1);
    --warn-bg: rgba(240, 180, 81, 0.12);
    --shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 20px 50px -25px rgba(0, 0, 0, 0.9);
    --shadow-pop: 0 40px 90px -20px rgba(0, 0, 0, 0.85);
    --wave: rgba(255, 255, 255, 0.022);
    --scrim: rgba(0, 0, 0, 0.65);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --grid: rgba(255, 255, 255, 0.07);
  }
}
:root[data-theme="dark"],
.auth {  /* a tela de login é sempre escura: as letras da marca são brancas */
  --logo-ring: rgba(255, 255, 255, 0.16);
  --terra: #c98479;
  color-scheme: dark;
  --bg: #050505;
  --bg-2: #0d0d0d;
  --surface: #101010;
  --surface-2: rgba(22, 22, 22, 0.92);
  --surface-sunk: rgba(255, 255, 255, 0.03);
  --hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f2;
  --text-2: rgba(244, 244, 242, 0.62);
  --text-3: rgba(244, 244, 242, 0.4);
  --ink: #f4f4f2;
  --ink-text: #0a0a0a;
  --pos: #4ad28a;
  --neg: #ff7b72;
  --warn: #f0b451;
  --pos-bg: rgba(74, 210, 138, 0.1);
  --neg-bg: rgba(255, 123, 114, 0.1);
  --warn-bg: rgba(240, 180, 81, 0.12);
  --shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 20px 50px -25px rgba(0, 0, 0, 0.9);
  --shadow-pop: 0 40px 90px -20px rgba(0, 0, 0, 0.85);
  --wave: rgba(255, 255, 255, 0.022);
  --scrim: rgba(0, 0, 0, 0.65);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --grid: rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  overflow-x: hidden;
  transition: background .5s var(--ease), color .3s var(--ease);
}
/* atmosfera: brilho difuso + ondas do calçadão */
body::before {
  content: "";
  position: fixed; inset: -20vh -10vw auto auto;
  width: 70vw; height: 70vh;
  background: radial-gradient(closest-side, var(--hover), transparent 70%);
  pointer-events: none; z-index: 0;
}
.waves-bg {
  position: fixed; left: 0; right: 0; bottom: 0; height: 38vh; pointer-events: none; z-index: 0;
  color: var(--wave);
  mask-image: linear-gradient(to top, #000 10%, transparent 95%);
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 95%);
}
.waves-bg svg { width: 100%; height: 100%; }

a { color: inherit; }
:where(svg) { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
:where(.chip, .sub, .faint, .due .m) svg { width: 13px; height: 13px; vertical-align: -2px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--ink-text); }
.num, .money { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.min0 { min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------ shell */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; text-decoration: none; color: var(--text); }
/* logo da Bossa: o círculo preto com o "BOSSA" (static/img/logo-bossa.png). O anel claro separa o círculo do fundo no tema escuro. */
.logo { flex: none; display: block; width: 38px; height: 38px; border-radius: 50%; background: #0b0b0b url(../img/logo-bossa.png) center / cover no-repeat; box-shadow: 0 0 0 1px var(--logo-ring, rgba(0,0,0,.06)); }
.brand .logo { animation: logo-in .8s .1s var(--ease-spring) backwards; }
@keyframes logo-in { from { transform: scale(.6) rotate(-8deg); opacity: 0; } }
/* "BOSSA" em letras (static/img/wordmark-bossa.svg, vetorial) usado como máscara: pega a cor do texto,
   então fica preto no tema claro e branco no escuro. Na barra larga substitui o círculo; na estreita volta o círculo. */
.brand-letters { display: block; width: 112px; aspect-ratio: 813 / 278; background: currentColor;
  -webkit-mask: url(../img/wordmark-bossa.svg) left center / contain no-repeat; mask: url(../img/wordmark-bossa.svg) left center / contain no-repeat; }
.brand .logo { display: none; }
.brand .brand-letters { animation: letters-in .7s .1s var(--ease-spring) backwards; }
@keyframes letters-in { from { opacity: 0; transform: translateY(4px); } }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; }
.brand .brand-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand .brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 14px 12px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  text-decoration: none; color: var(--text-2); transition: color .2s, background .2s;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a.active { color: var(--ink-text); background: var(--ink); }
.nav a .badge { margin-left: auto; }
.nav a.active .badge { background: var(--ink-text); color: var(--ink); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; cursor: pointer; }
.user-chip:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--ink); color: var(--ink-text); flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; min-height: 68px;
  background: linear-gradient(var(--bg), transparent);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); background: color-mix(in srgb, var(--bg) 96%, transparent); }
.page-title { font-family: var(--font-display); font-size: 28px; line-height: 1.05; letter-spacing: -0.035em; margin: 0; font-weight: 700; }
.page-sub { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.topbar .spacer { flex: 1; }
.content { padding: 8px 28px 60px; max-width: 1480px; width: 100%; }

.search-trigger {
  display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 9px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3); cursor: pointer;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: border-color .2s;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger svg { width: 16px; height: 16px; }
.kbd { margin-left: auto; font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border); }

/* seletor de período (global) */
.period {
  display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.period button { border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer; color: var(--text-2); }
.period button:hover { color: var(--text); background: var(--hover); }
.period .label { min-width: 132px; text-align: center; font-weight: 500; color: var(--text); white-space: nowrap; }
.period .kind { font-size: 12px; }
.period .kind.on { background: var(--ink); color: var(--ink-text); }

/* ------------------------------------------------------------ superfícies */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  padding: 20px;
}
.card.flat { box-shadow: none; }
.card.sunk { background: var(--surface-sunk); box-shadow: none; backdrop-filter: none; }
.card.ink { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.card.ink .muted, .card.ink .faint, .card.ink .stat .label, .card.ink .stat .delta, .card.ink .stat .value small { color: color-mix(in srgb, var(--ink-text) 62%, transparent); }
.card.ink .neg { color: var(--ink-text); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3, .card-title { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.card-head .sub { color: var(--text-3); font-size: 12px; }
.card-head .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row .spacer { flex: 1; }
.section-gap { margin-top: 18px; }

/* KPI / stat tile */
.stat { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat .label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .value.hero { font-size: 44px; letter-spacing: -0.04em; }
.stat .delta { font-size: 12px; color: var(--text-3); }
.stat .value small { font-size: .55em; font-weight: 500; color: var(--text-3); margin-right: 3px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpis .card { padding: 16px 18px; }
a.card, .card.link { text-decoration: none; cursor: pointer; transition: transform .35s var(--ease), border-color .2s; }
a.card:hover, .card.link:hover { transform: translateY(-2px); border-color: var(--border-strong); }

/* ------------------------------------------------------------ botões e campos */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 500; font-size: 13px; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: transform .15s var(--ease), background .2s, border-color .2s, opacity .2s;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.btn:hover { border-color: var(--border-strong); background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.btn.primary:hover { opacity: .88; }
.btn.ghost { background: transparent; border-color: transparent; backdrop-filter: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--neg); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.xs.icon { width: 26px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-sm { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field .help { font-size: 11.5px; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-sunk); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.input { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 4px var(--hover); background: var(--surface-2); }
.input.sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: 10px; }
select.input.sm { padding-right: 28px; }  /* o .sm zerava o espaço da seta e o texto passava por cima dela */
.input.money { text-align: right; }
.input.invalid { border-color: var(--neg); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .25s var(--ease); flex: none; }
.check .box::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-2); box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .3s var(--ease-spring); }
.check input:checked + .box { background: var(--ink); }
.check input:checked + .box::after { transform: translateX(14px); background: var(--ink-text); }
.cb { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }

.search-box { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search-box svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .input { padding-left: 36px; }
/* barra de filtros comum a todas as abas (ui.filterBar) */
.filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filterbar .search-box { min-width: 180px; }
.filterbar .search-box .input { height: 36px; }
.filterbar .fsel { width: auto; max-width: 240px; height: 36px; padding-right: 32px; text-overflow: ellipsis; }
.filterbar .fsel.set { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.filterbar .fcount { font-size: 12.5px; }
@media (max-width: 640px) { .filterbar .search-box { flex-basis: 100%; max-width: none; } .filterbar .fsel { flex: 1 1 140px; max-width: none; } }

/* segmentado */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-sunk); border: 1px solid var(--border); position: relative; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); cursor: pointer; position: relative; z-index: 1; transition: color .25s; white-space: nowrap; }
.seg button.on { color: var(--ink-text); }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; border-radius: 999px; background: var(--ink); transition: left .35s var(--ease), width .35s var(--ease); z-index: 0; }

/* abas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; position: relative; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { border: 0; background: none; padding: 10px 12px; color: var(--text-2); cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 500; font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .on { color: var(--text); }
.tabs .ink-bar { position: absolute; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px; transition: left .35s var(--ease), width .35s var(--ease); }

/* chips / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; background: var(--surface-sunk); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; max-width: 100%; }
.chip.ink { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.chip.pos { background: var(--pos-bg); color: var(--pos); border-color: transparent; }
.chip.neg { background: var(--neg-bg); color: var(--neg); border-color: transparent; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip.btn-chip { cursor: pointer; }
.chip.btn-chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip .x { cursor: pointer; opacity: .6; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--ink); color: var(--ink-text); }
.badge.soft { background: var(--hover); color: var(--text); }

/* ------------------------------------------------------------ tabelas */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
table.t td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .15s; }
table.t tbody tr.clickable { cursor: pointer; }
table.t tbody tr:hover { background: var(--hover); }
table.t tbody tr.selected { background: var(--hover); box-shadow: inset 3px 0 0 var(--ink); }
table.t .r, .r { text-align: right; }
table.t .c { text-align: center; }
table.t td.desc { max-width: 380px; }
table.t td.desc .ellipsis { display: block; }
table.t .sub { font-size: 11.5px; color: var(--text-3); }
table.t tfoot td { font-weight: 600; border-top: 1px solid var(--border-strong); }
table.t.compact td { padding: 7px 10px; }
table.t input.input, table.t select.input { height: 30px; font-size: 12.5px; border-radius: 9px; padding: 0 8px; }
table.t select.input { padding-right: 24px; min-width: 112px; }
table.t .combo { min-width: 150px; }

/* lista de pagar/receber */
.dues { display: flex; flex-direction: column; }
.dues-group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 14px 4px 6px; display: flex; justify-content: space-between; }
.due {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 8px; border-radius: 14px; cursor: pointer; transition: background .2s, transform .3s var(--ease);
}
.due:hover { background: var(--hover); }
.due .when { text-align: center; line-height: 1.05; padding: 6px 0; border-radius: 11px; background: var(--surface-sunk); border: 1px solid var(--border); }
.due .when b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.due .when span { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.due.late .when { background: var(--neg-bg); border-color: transparent; color: var(--neg); }
.due.late .when span { color: var(--neg); }
.due.soon .when { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.due.soon .when span { color: var(--warn); }
.due .what { min-width: 0; }
.due .what .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due .what .m { font-size: 12px; color: var(--text-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.due .amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.due .amt .est { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }

/* ------------------------------------------------------------ overlays */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 90; opacity: 0; transition: opacity .3s var(--ease); }
.scrim.in { opacity: 1; }
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 100; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-pop); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .45s var(--ease-spring), opacity .25s var(--ease);
}
.modal.wide { width: min(880px, calc(100vw - 32px)); }
.modal.xwide { width: min(1180px, calc(100vw - 32px)); }
.modal.in { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 8px; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -0.03em; }
.modal-body { padding: 10px 22px 18px; overflow: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; z-index: 100; width: min(640px, calc(100vw - 20px));
  display: flex; flex-direction: column; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-pop); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transform: translateX(calc(100% + 30px)); transition: transform .5s var(--ease);
}
.drawer.wide { width: min(980px, calc(100vw - 20px)); }
.drawer.in { transform: translateX(0); }
.drawer .modal-body { flex: 1; }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 1200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 999px; background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-pop); font-size: 13px; animation: toastIn .5s var(--ease-spring); max-width: calc(100vw - 32px); }
.toast.err { background: var(--neg); color: #fff; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(20px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

/* paleta de comandos */
.palette { top: 12vh; transform: translate(-50%, -10px) scale(.98); width: min(640px, calc(100vw - 24px)); }
.palette.in { transform: translate(-50%, 0) scale(1); }
.palette .pal-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette .pal-input input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; }
.palette .pal-list { max-height: 56vh; overflow: auto; padding: 8px; }
.pal-group { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 10px 10px 4px; }
.pal-item { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.pal-item.on, .pal-item:hover { background: var(--hover); }
.pal-item .sub { color: var(--text-3); font-size: 12px; margin-left: auto; text-align: right; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* combo (select com busca + criar novo) */
.combo { position: relative; }
.combo .input { cursor: pointer; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.combo .input .ph { color: var(--text-3); }
.combo .input .val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.combo-pop {
  position: fixed; z-index: 1100; min-width: 240px; max-width: 420px; max-height: 320px; display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-pop);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); overflow: hidden;
  animation: popIn .25s var(--ease-spring);
}
@keyframes popIn { from { transform: translateY(-4px) scale(.98); opacity: 0; } }
.combo-pop input { border: 0; border-bottom: 1px solid var(--border); outline: 0; background: none; padding: 11px 13px; }
.combo-pop .opts { overflow: auto; padding: 6px; }
.combo-pop .opt { padding: 8px 10px; border-radius: 10px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.combo-pop .opt .g { color: var(--text-3); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.combo-pop .opt.on, .combo-pop .opt:hover { background: var(--hover); }
.combo-pop .opt.create { color: var(--text); font-weight: 500; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; margin-top: 4px; }
.combo-pop .grp { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px 3px; }

/* upload */
.drop {
  border: 1.5px dashed var(--border-strong); border-radius: 20px; padding: 34px 20px; text-align: center; cursor: pointer;
  transition: background .25s, border-color .25s, transform .3s var(--ease); background: var(--surface-sunk);
}
.drop:hover, .drop.over { background: var(--hover); border-color: var(--ink); transform: scale(1.005); }
.drop svg { width: 34px; height: 34px; color: var(--text-3); }
.drop-global { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; background: var(--scrim); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drop-global.on { opacity: 1; }
.drop-global .card { padding: 40px 60px; text-align: center; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.progress { height: 4px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .4s var(--ease); }

/* estados vazios / carregando */
.empty { text-align: center; padding: 42px 20px; color: var(--text-2); }
.empty .art { width: 96px; height: 40px; margin: 0 auto 12px; color: var(--text-3); }
.empty h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.empty p { margin: 0 auto 14px; max-width: 420px; font-size: 13px; }
.skeleton { background: linear-gradient(90deg, var(--hover) 25%, var(--surface-sunk) 37%, var(--hover) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* entrada animada dos elementos */
.reveal > * { animation: rise .6s var(--ease) backwards; }
.reveal > *:nth-child(2) { animation-delay: .04s; }
.reveal > *:nth-child(3) { animation-delay: .08s; }
.reveal > *:nth-child(4) { animation-delay: .12s; }
.reveal > *:nth-child(5) { animation-delay: .16s; }
.reveal > *:nth-child(6) { animation-delay: .2s; }
.reveal > *:nth-child(7) { animation-delay: .24s; }
.reveal > *:nth-child(n+8) { animation-delay: .28s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.page-enter { animation: pageIn .5s var(--ease) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }  /* sem blur: desfocar a página inteira pesava */
.pulse-once { animation: pulse 1s var(--ease); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--border-strong); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* barras simples (sem canvas) */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item .top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 5px; }
.bar-item .track { height: 8px; border-radius: 6px; background: var(--hover); overflow: hidden; }
.bar-item .fill { height: 100%; border-radius: 6px; background: var(--ink); width: 0; transition: width 1s var(--ease); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark i { flex: 1; min-width: 3px; border-radius: 2px 2px 0 0; background: var(--text-3); transition: height .8s var(--ease); }
.spark i.neg { background: var(--neg); opacity: .7; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 180px; }
.chart-box.lg { height: 320px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* bossa cards */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tile { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tile .name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.tile.inactive { opacity: .6; }
.status-pill { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* conciliação */
.rec-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rec-line { display: grid; grid-template-columns: 22px 62px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.rec-line:hover { background: var(--hover); }
.rec-line.sel { background: var(--ink); color: var(--ink-text); }
.rec-line.sel .faint, .rec-line.sel .muted { color: color-mix(in srgb, var(--ink-text) 60%, transparent); }
.rec-line.done { opacity: .62; }
.pair { display: grid; grid-template-columns: minmax(0,1fr) 28px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--border); }
.pair + .pair { margin-top: 8px; }

/* arquivo */
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.crumbs a { text-decoration: none; color: var(--text-2); cursor: pointer; }
.crumbs a:hover { color: var(--text); }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.folder { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); cursor: pointer; background: var(--surface-sunk); transition: transform .3s var(--ease), border-color .2s; }
.folder:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.folder svg { width: 22px; height: 22px; color: var(--text-2); flex: none; }

/* nota fiscal */
.copy { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 8px; padding: 2px 6px; margin: -2px -6px; transition: background .2s; }
.copy:hover { background: var(--hover); }
.copy svg { width: 13px; height: 13px; opacity: .5; }
.kv { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 6px 12px; font-size: 13px; }
.kv > dt { color: var(--text-3); }
.kv > dd { margin: 0; min-width: 0; word-break: break-word; }

/* login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; z-index: 1; background: var(--bg); color: var(--text); }
.auth .card { width: min(420px, 100%); padding: 34px 30px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
/* login: só as letras "BOSSA" em branco, sem o círculo (pedidos do usuário, 06/10/2026) */
.auth-letters { width: 210px; max-width: 70%; color: #fff; margin: 6px auto 30px; background: currentColor;
  -webkit-mask-position: center; mask-position: center; animation: letters-in .9s .1s var(--ease-spring) backwards; }

/* navegação inferior (celular) */
.bottom-nav { display: none; }
.more-sheet { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 100; border-radius: 24px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-pop); transform: translateY(120%); transition: transform .45s var(--ease); }
.more-sheet.in { transform: translateY(0); }
.more-sheet a { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: 14px; text-decoration: none; }
.more-sheet a:hover { background: var(--hover); }
.more-sheet svg { width: 20px; height: 20px; }

.bulkbar { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); z-index: 60; display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-pop); transition: transform .45s var(--ease-spring); flex-wrap: wrap; max-width: calc(100vw - 24px); }
.bulkbar { opacity: 0; pointer-events: none; transition: transform .45s var(--ease-spring), opacity .25s; }
.bulkbar.in { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bulkbar .btn { background: transparent; color: var(--ink-text); border-color: color-mix(in srgb, var(--ink-text) 25%, transparent); backdrop-filter: none; }
.bulkbar .btn:hover { background: color-mix(in srgb, var(--ink-text) 12%, transparent); }

.info-box { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-sunk); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.info-box svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.info-box.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.steps { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.steps li { margin: 4px 0; }
iframe.pbi { width: 100%; height: 72vh; min-height: 480px; border: 0; border-radius: 16px; background: var(--surface-sunk); }

/* ------------------------------------------------------------ responsivo */
@media (max-width: 1180px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  :root { --sidebar: 76px; }
  .sidebar { padding: 14px 10px; align-items: center; }
  .brand { padding: 4px 0 16px; }
  .brand .logo { display: block; }
  .brand .brand-txt, .nav-label, .nav a .txt, .user-chip .txt { display: none; }
  .nav a { justify-content: center; padding: 11px; }
  .nav a .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .g3, .g2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .rec-cols { grid-template-columns: 1fr; }
  .search-trigger { min-width: 0; }
  .search-trigger .txt, .search-trigger .kbd { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; min-height: 58px; gap: 8px; flex-wrap: wrap; }
  .page-title { font-size: 26px; }
  .topbar .period { order: 5; width: 100%; justify-content: space-between; }
  .topbar > div:first-child { flex: 1 1 0; min-width: 0; }
  .topbar > .spacer { display: none; }
  #period-slot:empty { display: none; }
  #period-slot { order: 5; width: 100%; }
  .page-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-head { flex-wrap: wrap; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .due { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; padding: 9px 4px; }
  .row { gap: 8px; }
  .topbar .period .label { flex: 1; min-width: 0; }
  .content { padding: 4px 16px 110px; }
  .g4, .g5 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 20px; }
  .stat .value.hero { font-size: 32px; }
  .card { padding: 16px; border-radius: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { width: 100vw; max-height: 92vh; max-height: calc(100dvh - 12px - env(safe-area-inset-top)); left: 0; top: auto; bottom: 0; transform: translateY(100%); border-radius: 26px 26px 0 0; }
  .modal.wide, .modal.xwide { width: 100vw; }
  .modal.in { transform: translateY(0); }
  .palette { top: 8px; bottom: auto; border-radius: 22px; left: 8px; width: calc(100vw - 16px); transform: translateY(-20px); }
  .palette.in { transform: translateY(0); }
  /* altura pela área visível (dvh): com 94vh o topo da gaveta (e o X) ficava atrás da barra do navegador no celular */
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100vw; height: 94vh; height: calc(100dvh - 12px - env(safe-area-inset-top)); border-radius: 26px 26px 0 0; transform: translateY(100%); }
  .modal-head .btn.icon[data-close] { width: 40px; height: 40px; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .drawer.wide { width: 100vw; }
  .drawer.in { transform: translateY(0); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 50;
    padding: 6px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-pop);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    padding-bottom: calc(6px + env(safe-area-inset-bottom) / 2);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 16px; text-decoration: none; font-size: 10.5px; color: var(--text-2); position: relative; }
  .bottom-nav a svg { width: 21px; height: 21px; }
  .bottom-nav a.active { background: var(--ink); color: var(--ink-text); }
  .bottom-nav .badge { position: absolute; top: 2px; right: 14%; min-width: 16px; height: 16px; font-size: 10px; }
  /* tabelas viram cartões */
  table.t.responsive thead { display: none; }
  table.t.responsive, table.t.responsive tbody, table.t.responsive tr, table.t.responsive td { display: block; width: 100%; }
  table.t.responsive tr { padding: 10px 4px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
  table.t.responsive td { border: 0; padding: 0; }
  table.t.responsive td.hide-sm { display: none; }
  table.t.responsive td.desc { max-width: none; grid-column: 1; }
  table.t.responsive td.amount { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  table.t.responsive td.cb-cell { display: none; }
  .rec-line { grid-template-columns: 20px 50px minmax(0,1fr) auto; }
  .pair { grid-template-columns: 1fr; }
  .pair .arrow { display: none; }
  .kv { grid-template-columns: 1fr; }
  .search-trigger { padding: 8px; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .waves-bg { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; backdrop-filter: none; }
}

/* lançamento automático */
.smart { position: relative; margin-bottom: 18px; padding: 14px; border-radius: var(--radius); background: var(--surface-sunk); border: 1px solid var(--border); transition: border-color .25s, box-shadow .25s; }
.smart::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: linear-gradient(120deg, transparent 20%, var(--text-3), transparent 80%) 0 0 / 250% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.smart.working::before { opacity: 1; animation: shimmer 1.4s linear infinite; }
.smart.over { border-color: var(--border-strong); box-shadow: 0 0 0 4px var(--hover); }
.smart-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.smart-head > svg { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.smart-head b { display: block; font-weight: 600; font-size: 13.5px; }
.smart-head span { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.smart textarea { resize: vertical; min-height: 58px; background: var(--surface-2); }
.smart-actions { margin-top: 8px; gap: 8px; flex-wrap: nowrap; }
.smart-actions .kbd { margin-left: 0; }
.smart-file { font-size: 12px; min-width: 0; max-width: 45%; }
.smart-result:empty { display: none; }
.smart-result { margin-top: 12px; animation: rise .45s var(--ease) backwards; }
.smart-status { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
.smart-ok { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; }
.smart-ok > svg { width: 16px; height: 16px; flex: none; margin-top: 1px; padding: 3px; box-sizing: content-box; border-radius: 50%; background: var(--ink); color: var(--ink-text); animation: logo-in .5s var(--ease-spring) backwards; }
.smart-ok b { display: block; font-weight: 600; }
.smart-ok span { color: var(--text-2); }
.smart-why { margin-top: 10px; gap: 6px; flex-wrap: wrap; }
.smart-why .chip { height: 22px; font-size: 11.5px; }
.field.auto > label::after { content: "auto"; margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: .02em; background: var(--ink); color: var(--ink-text); vertical-align: 1px; }
.field.auto .input, .field.auto .check .box { animation: autofill 1.1s var(--d, 0ms) var(--ease) backwards; }
.field.auto > .input, .field.auto .combo .input { border-color: var(--border-strong); }
@keyframes autofill { 0% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 4px var(--hover); transform: scale(1.012); } 100% { box-shadow: 0 0 0 0 transparent; } }
.quick-entry { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.quick-entry > svg { position: absolute; z-index: 1; left: 16px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.quick-entry .input { flex: 1; padding-left: 40px; height: 44px; border-radius: 999px; background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.quick-entry .input:focus { border-color: var(--border-strong); }
.quick-entry .btn { position: absolute; right: 7px; }
@media (prefers-reduced-motion: reduce) { .smart.working::before, .field.auto .input { animation: none; } }
.smart-preview:empty { display: none; }
.smart-preview { margin-top: 10px; }
.smart-preview img { display: block; max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: contain; background: var(--surface-2); animation: rise .45s var(--ease) backwards; }

/* seleção em lote nas tabelas de cadastro */
.t th.pick, .t td.pick { width: 34px; padding-left: 10px; padding-right: 0; }
.t td.pick input, .t th.pick input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--ink); }
.tile { position: relative; }
.tile-pick { position: absolute; top: 10px; right: 10px; z-index: 2; opacity: 0; transition: opacity .15s; }
.tile:hover .tile-pick, .tile-pick:has(:checked) { opacity: 1; }
label.pick { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
label.pick input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--ink); }

/* nome do hóspede editável direto na lista de reservas */
.guest-inline { min-width: 170px; height: 32px; padding: 0 10px; font-size: 13px; background: transparent; border-color: transparent; }
.guest-inline:hover { border-color: var(--border); }
.guest-inline:focus { background: var(--surface); border-color: var(--ink); }
.guest-inline:placeholder-shown { border-color: var(--border); border-style: dashed; }
.guest-inline.saved { box-shadow: 0 0 0 2px color-mix(in srgb, var(--pos, #1baf7a) 35%, transparent); }

/* Configurações › Dados: ação que apaga o movimento */
.danger-zone { border: 1px solid color-mix(in srgb, var(--neg) 35%, transparent); }
.danger-zone h3 { color: var(--neg); }

/* Janelas e gavetas com fundo opaco: a 92% a página de trás aparecia por baixo do texto (14/10/2026) */
.modal, .drawer { background: var(--surface); }

/* Tabela de leitura (envio de documentos): conferir e corrigir o que foi lido antes de lançar */
.modal.reading { width: min(1320px, calc(100vw - 32px)); height: calc(100dvh - 48px); }
.modal.reading .modal-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal.reading [data-rt] { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.rt-file { font-size: 12.5px; margin: -4px 0 12px; display: flex; align-items: center; gap: 6px; }
.rt-strip { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-sunk); border: 1px solid var(--border); }
.rt-num { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 10px; min-width: 110px; }
.rt-num span { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.rt-num b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.rt-num b.pos { color: var(--pos); }
.rt-op { align-self: center; color: var(--text-3); font-size: 18px; padding: 0 2px; }
.rt-stmt { margin-left: auto; border-left: 1px solid var(--border); padding-left: 16px; }
.rt-stmt .input { width: 150px; font-weight: 600; }
.rt-verdict { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; background: var(--hover); white-space: nowrap; }
.rt-verdict.ok { background: var(--pos-bg); color: var(--pos); }
.rt-verdict.bad { background: var(--neg-bg); color: var(--neg); }
.rt-verdict svg { width: 15px; height: 15px; }
.rt-why { margin-top: 8px; }
.rt-extra { margin-top: 8px; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); background: var(--warn-bg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.rt-extra summary { cursor: pointer; color: var(--warn); display: flex; gap: 8px; align-items: center; }
.rt-extra summary svg { width: 15px; height: 15px; flex: none; }
.rt-extra table { margin-top: 8px; background: var(--surface-2); border-radius: var(--radius-xs); }
.rt-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; }
.rt-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.rt-filter { border: 1px solid var(--border); background: transparent; color: var(--text-2); border-radius: 999px; height: 30px; padding: 0 12px; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.rt-filter i { font-style: normal; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rt-filter:hover { background: var(--hover); color: var(--text); }
.rt-filter.on { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.rt-filter.on i { color: inherit; opacity: .7; }
.rt-search { width: 220px; }
.rt-wrap { flex: 1; min-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table.rt { font-size: 13px; }
table.rt th { background: var(--surface); }
table.rt td { padding: 3px 4px; border-bottom: 1px solid var(--border); }
table.rt td.rt-ck { width: 34px; text-align: center; }
table.rt td.rt-date { width: 138px; }
table.rt td.rt-amt { width: 128px; }
table.rt td.rt-cls { min-width: 150px; max-width: 200px; }
table.rt td.rt-res { width: 120px; }
table.rt td.rt-act { width: 34px; }
table.rt .combo { min-width: 0; }
.rt-cb { width: 16px; height: 16px; accent-color: var(--ink); cursor: pointer; }
/* célula editável: parece texto até receber o foco */
.cell { width: 100%; height: 32px; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 0 8px; font: inherit; color: inherit; transition: border-color .15s, background .15s; }
.cell:hover { border-color: var(--border); }
.cell:focus { outline: 0; border-color: var(--border-strong); background: var(--surface-2); box-shadow: 0 0 0 3px var(--hover); }
.cell.money { text-align: right; font-variant-numeric: tabular-nums; }
.cell.pos-v { color: var(--pos); }
.cell.neg-v { color: var(--text); }
.combo.cell .input { border-color: transparent; background: transparent; }
.combo.cell .input:hover { border-color: var(--border); }
input.cell[type=date] { padding: 0 6px; }
.cell.edited, td.edited .combo .input { background: color-mix(in srgb, var(--terra) 10%, transparent); border-color: color-mix(in srgb, var(--terra) 35%, transparent); }
table.rt tr.doubt td.rt-cat .combo .input { box-shadow: inset 3px 0 0 var(--warn); }
table.rt tr.skip td:not(.rt-ck) { opacity: .38; }
table.rt tr.skip .cell { text-decoration: line-through; }
.rt-was { font-size: 11.5px; color: var(--pos); padding: 0 8px 4px; display: flex; gap: 4px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rt-was svg { width: 12px; height: 12px; flex: none; }
.rt-mini { height: 18px; font-size: 11px; margin: 0 8px 4px; }
.rt-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; }
.rt-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.rt-legend .dot.edited { background: color-mix(in srgb, var(--terra) 35%, transparent); }
.rt-legend .dot.doubt { background: var(--warn); }
.rt-foot-note { font-size: 12px; }
.read-sum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
@media (max-width: 720px) {
  .modal.reading { width: 100vw; height: 100dvh; border-radius: 0; }
  .rt-stmt { margin-left: 0; border-left: 0; padding-left: 10px; }
  .rt-search { width: 100%; }
  .rt-foot-note { display: none; }
}

/* "ir até" (Verificação): a linha ou o dia de destino pisca na cor da marca */
.goto-hit, .goto-hit > td { background: color-mix(in srgb, var(--terra) 18%, transparent) !important; transition: background .6s var(--ease); }
/* manual */
.manual-body { font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.manual-body p { margin: 0 0 8px; }
.manual-body ul, .manual-body ol { margin: 0 0 8px; padding-left: 20px; }
.manual-body li { margin: 3px 0; }

/* anexos do fechamento (07/11/2026) */
[data-att-box] { transition: box-shadow .15s, background .15s; }
[data-att-box].drag { box-shadow: inset 0 0 0 2px var(--terra); }
[data-att-box] .card-head h3 svg { width: 15px; height: 15px; vertical-align: -2px; }
/* controle de reembolsos (07/11/2026) */
.kpi-btn { font: inherit; color: inherit; border: 1px solid var(--border); cursor: pointer; width: 100%; }
.kpi-btn:hover { border-color: var(--terra); }
.bulk-actions { display: inline-flex; align-items: center; gap: 6px; }
/* ajustar anexos no PDF (07/11/2026): folhas A4 sempre brancas, como no papel */
.att-adj-help { font-size: 12.5px; margin-bottom: 10px; }
.att-adj-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 32px; margin-bottom: 12px; font-size: 12.5px; }
.att-adj-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 8px 0 16px; }
.att-adj-page { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.10); border-radius: 2px; flex: none; }
.att-adj-n { position: absolute; top: -18px; left: 0; font-size: 11px; }
.att-adj-item { position: absolute; cursor: grab; touch-action: none; user-select: none; }
.att-adj-item:hover { outline: 1px solid rgba(150,73,66,.45); }
.att-adj-item.sel { outline: 2px solid #964942; }
.att-adj-item.drop { outline: 2px dashed #964942; outline-offset: 3px; }
.att-adj-item img { display: block; width: 100%; object-fit: fill; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.14); }
.att-adj-cap { color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; display: flex; align-items: center; }
.att-adj-pct { position: absolute; top: 4px; right: 4px; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; opacity: 0; transition: opacity .15s; }
.att-adj-item:hover .att-adj-pct, .att-adj-item.sel .att-adj-pct { opacity: 1; }
.att-adj-handle { position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px; border-radius: 4px; background: #964942; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); cursor: nwse-resize; opacity: 0; transition: opacity .15s; }
.att-adj-item:hover .att-adj-handle, .att-adj-item.sel .att-adj-handle { opacity: 1; }
@media (hover: none) { .att-adj-handle, .att-adj-pct { opacity: 1; } }
.att-adj-ghost { position: fixed; z-index: 1400; opacity: .75; pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,.3); cursor: grabbing; }
.att-adj-page.drop { box-shadow: 0 0 0 2px #964942, 0 8px 24px rgba(0,0,0,.10); }
.att-adj-pages, .att-adj-bar, body.att-dragging { user-select: none; -webkit-user-select: none; }

/* ------------------------------------------------------------------ modo planilha dos Lançamentos (14/11/2026)
   Grade horizontal editável (planilha.js): uma linha por lançamento, cada campo numa célula. */
.pl-help { font-size: 12.5px; display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.pl-help svg { width: 14px; height: 14px; flex: none; }
.pl-card { padding: 0; overflow: hidden; }
.pl-wrap { max-height: calc(100dvh - 230px); overflow: auto; border-radius: 0; }
table.planilha { min-width: 1580px; font-size: 12.5px; table-layout: fixed; }
table.planilha th { padding: 7px 6px; background: var(--surface); border-right: 1px solid var(--border); }
table.planilha td { padding: 0; border-right: 1px solid var(--border); height: 34px; }
table.planilha tbody tr:hover { background: transparent; }
table.planilha .c-date { width: 128px; } table.planilha .c-direction { width: 112px; }
table.planilha .c-description { width: 260px; } table.planilha .c-amount { width: 110px; }
table.planilha .c-category_id { width: 210px; } table.planilha .c-bossa_id { width: 130px; }
table.planilha .c-client_id { width: 140px; } table.planilha .c-supplier_id { width: 150px; }
table.planilha .c-account_id, table.planilha .c-to_account_id { width: 120px; }
table.planilha .c-status { width: 104px; } table.planilha .c-notes { width: 180px; }
table.planilha .c-acts { width: 128px; border-right: 0; padding: 0 6px; white-space: nowrap; text-align: right; }
table.planilha .pc { width: 100%; height: 34px; border: 0; border-radius: 0; background: transparent; color: var(--text);
  font: inherit; padding: 0 8px; outline: none; min-width: 0; }
table.planilha select.pc { padding-right: 2px; cursor: pointer; }
table.planilha .pc.r { text-align: right; font-variant-numeric: tabular-nums; }
table.planilha .pc:focus { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); position: relative; z-index: 1; }
table.planilha .pc:disabled { color: var(--text-3); background: var(--surface-sunk); cursor: not-allowed; }
table.planilha .pc:disabled::placeholder { color: transparent; }
table.planilha .pc::placeholder { color: var(--text-3); }
table.planilha .pc.bad { box-shadow: inset 0 0 0 2px var(--neg); background: var(--neg-bg); }
table.planilha tr.dir-in .c-amount .pc { color: var(--pos); }
table.planilha tr.dir-transfer .c-amount .pc { color: var(--text-2); }
table.planilha tr.pl-new td { background: var(--surface-sunk); border-bottom: 1px solid var(--border-strong); }
table.planilha tr.pl-new td:first-child { box-shadow: inset 3px 0 0 var(--terra); }
table.planilha tr.pl-dirty td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.planilha tr.pl-dirty td { background: var(--warn-bg); }
table.planilha tr.pl-saving { opacity: .6; }
table.planilha tr.pl-ok td { background: var(--pos-bg); transition: background 1s; }
table.planilha tr.pl-err td { background: var(--neg-bg); }
table.planilha tr.pl-err td:first-child { box-shadow: inset 3px 0 0 var(--neg); }
table.planilha .pl-marks { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; margin-right: 4px; }
table.planilha .pl-marks .chip { height: 20px; font-size: 11px; padding: 0 6px; }
table.planilha .pl-marks svg { width: 14px; height: 14px; }
table.planilha td.c-acts .btn.sm { height: 26px; }
table.planilha tr.pl-loading td, table.planilha tr.pl-empty td { padding: 14px; height: auto; }
@media (max-width: 1560px) { .hide-lg { display: none !important; } }
@media (max-width: 760px) { .pl-help { display: none; } .pl-wrap { max-height: calc(100dvh - 200px); } }

/* ------------------------------------------------------------------ gaveta do lançamento na horizontal (14/11/2026)
   Painel largo embaixo, campos lado a lado em células (details.js: txForm(t, true)); ⇆ no topo volta à vertical. */
.drawer.horiz { top: 50%; left: 50%; right: auto; bottom: auto; width: min(1440px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px); transform: translate(-50%, calc(-50% + 40px)) scale(.98); opacity: 0;
  transition: transform .45s var(--ease-spring), opacity .25s var(--ease); }
.drawer.horiz.in { transform: translate(-50%, -50%); opacity: 1; }
.drawer.horiz .modal-head { padding: 22px 28px 8px; }
.drawer.horiz .modal-body { padding: 10px 28px 20px; }
.drawer.horiz .modal-foot { padding: 14px 28px 20px; }
.drawer.horiz .smart { margin-bottom: 14px; }
.hz-tags { gap: 6px; margin-bottom: 14px; }
.hz-tags:empty { display: none; }
.hz-form { display: flex; flex-direction: column; gap: 12px; }
.hz-row { display: flex; overflow-x: auto; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); scrollbar-width: thin; }
.hz-row > .field { flex: 1 1 180px; min-width: 130px; gap: 0; border-right: 1px solid var(--border); }
.hz-row > .field:last-child { border-right: 0; }
.hz-row > .field.hidden { display: none; }
.hz-row > .field > label:not(.check) { font-size: 12px; color: var(--text-3); padding: 8px 12px; background: var(--surface-sunk); border-bottom: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hz-row > .field .help { display: none; }
.hz-row .input, .hz-row select.input, .hz-row textarea.input, .hz-row .combo .input {
  border: 0; border-radius: 0; background: transparent; height: 46px; min-height: 46px; box-shadow: none; width: 100%; padding: 0 12px; font-size: 14px; }
.hz-row select.input { padding-right: 24px; min-width: 0; text-overflow: ellipsis; }
.hz-row textarea.input { height: auto; min-height: 66px; padding: 10px 12px; resize: vertical; line-height: 22px; }
.hz-row .input:focus, .hz-row .combo .input:focus { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface-2); }
.hz-row .input.invalid { box-shadow: inset 0 0 0 2px var(--neg); }
.hz-row > .field:has([name="direction"]) { flex: 0 1 150px; }
.hz-row > .field:has([name="status"]) { flex: 0 1 160px; }
.hz-row > .field:has([name="date"]), .hz-row > .field:has([name="due_date"]) { flex: 0 1 170px; min-width: 150px; }
.hz-row > .field:has([name="amount"]) { flex: 0 1 170px; }
.hz-row > .field:has([name="description"]) { flex: 3 1 360px; min-width: 220px; }
.hz-row > .field:has([name="category_id"]) { flex: 2 1 340px; min-width: 240px; }
.hz-row > .field:has(label.check) { flex: 1.3 1 250px; justify-content: center; padding: 8px 14px; }
.hz-row label.check { font-size: 13px; color: var(--text-2); line-height: 1.3; }
.hz-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 14px; align-items: start; }
.hz-cards .card { margin: 0; }

/* QR do 2FA no login (15/11/2026): o svg vem do servidor com viewBox; aqui ganha tamanho (o :where(svg) dá 16 px) */
.qr-2fa { display: flex; justify-content: center; background: #fff; border-radius: 14px; padding: 12px; }
.qr-2fa svg { width: min(220px, 70vw); height: auto; aspect-ratio: 1; }
