/* Lume — sistema visual (identidade JOLBIX Tecnologia)
   Temas claro e escuro com os mesmos componentes. Toda cor vem dos tokens
   semânticos abaixo; componentes não usam cores fixas. Mobile first.
   Contraste dos pares texto/fundo conferido para WCAG AA. */

/* ── tokens: tema claro (padrão) ─────────────────────── */
:root, :root[data-theme="light"] {
  color-scheme: light;
  /* fundos e superfícies */
  --bg: #F4F7F9;
  --surface: #FFFFFF;
  --surface-raised: #EAF0F4;
  --surface-sunken: #EEF3F6;
  --surface-overlay: #FFFFFF;
  --input-bg: #FFFFFF;
  --nav-bg: rgba(255, 255, 255, .94);
  --tile-bg: #F4F7F9;
  --tile-hover: #FFFFFF;
  --tile-border: #D8E2E9;
  --segment-active: #FFFFFF;
  /* texto */
  --text: #18252D;
  --text-2: #2C3B45;
  --muted: #526575;
  --link: #00777A;
  /* bordas */
  --border: #D8E2E9;
  --control-border: #B9C7D2;
  --input-border: #7A8E9D;
  /* marca */
  --brand: #00BFC1;
  --brand-hover: #00ABAD;
  --brand-strong: #00777A;
  --brand-soft: #DDF5F5;
  --brand-soft-border: #A9E3E4;
  --brand-ink: #0B4F52;
  --on-brand: #06272B;
  /* interação */
  --hover: #EEF3F6;
  --pressed: #E3EBF0;
  --focus: #00777A;
  --focus-ring: 0 0 0 3px rgba(0, 119, 122, .28);
  --selection-bg: #BFEDEE;
  --selection-text: #06272B;
  --chip-active-bg: #18252D;
  --chip-active-text: #F3F7FA;
  /* desabilitado */
  --disabled-bg: #E6ECF0;
  --disabled-text: #6B7D8A;
  --disabled-border: #D8E2E9;
  /* estados */
  --success: #1A7A43;
  --success-soft: #E3F3E9;
  --success-border: #BFE3CB;
  --warn: #875A00;
  --warn-soft: #FCF1D9;
  --warn-border: #F0D9A4;
  --warn-ink: #5B3D00;
  --danger: #B4342A;
  --danger-soft: #FCEAE8;
  --danger-border: #F3C6C0;
  --danger-ink: #7A1F17;
  --info: #1D6390;
  --info-soft: #E3EFF8;
  --info-border: #C1DAEC;
  --info-ink: #174A6B;
  --income: #1A7A43;
  --income-soft: #E3F3E9;
  --expense: #B4342A;
  --expense-soft: #FCEAE8;
  --count-bg: #B4342A;
  --count-text: #FFFFFF;
  /* destaque de saldo */
  --hero-bg: #12303A;
  --hero-border: #12303A;
  --hero-text: #F3F7FA;
  --hero-muted: #B7D0D8;
  --hero-accent: #5FE0E2;
  --hero-chip: rgba(255, 255, 255, .08);
  --hero-chip-border: rgba(255, 255, 255, .12);
  --hero-glow: rgba(0, 191, 193, .30);
  --hero-track: rgba(255, 255, 255, .14);
  /* gráficos */
  --chart-income: #1F8A4C;
  --chart-expense: #D0574B;
  --chart-hatch: rgba(255, 255, 255, .38);
  --chart-grid: #E4EBF0;
  --chart-axis: #B9C7D2;
  --chart-sel: rgba(0, 119, 122, .07);
  --chart-outline: rgba(24, 37, 45, .14);
  --progress-fill: #00898C;
  --progress-warn: #B07A0E;
  --progress-over: #B4342A;
  /* tooltip, toast e diálogo */
  --tooltip-bg: #18252D;
  --tooltip-text: #F3F7FA;
  --toast-bg: #18252D;
  --toast-text: #F3F7FA;
  --toast-error-bg: #7A1F17;
  --toast-warn-bg: #5B3D00;
  --backdrop: rgba(8, 15, 22, .45);
  --empty-icon: #9FB0BD;
  /* sombras */
  --shadow: 0 1px 2px rgba(16, 32, 40, .05), 0 6px 20px rgba(16, 32, 40, .06);
  --shadow-lg: 0 14px 36px rgba(16, 32, 40, .18);
  --shadow-fab: 0 8px 20px rgba(0, 119, 122, .32);
  --shadow-segment: 0 1px 3px rgba(16, 32, 40, .12);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23526575' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ── tokens: tema escuro ─────────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080F16;
  --surface: #111C26;
  --surface-raised: #182632;
  --surface-sunken: #0C151E;
  --surface-overlay: #1A2A37;
  --input-bg: #0C151E;
  --nav-bg: rgba(14, 24, 33, .94);
  --tile-bg: #213343;
  --tile-hover: #263B4C;
  --tile-border: #33485A;
  --segment-active: #22384A;
  --text: #F3F7FA;
  --text-2: #D5E0E8;
  --muted: #A9B8C5;
  --link: #2FD0D2;
  --border: #2A3B49;
  --control-border: #3A4E5F;
  --input-border: #566D80;
  --brand: #00BFC1;
  --brand-hover: #22CDD0;
  --brand-strong: #2FD0D2;
  --brand-soft: #0D3036;
  --brand-soft-border: #17545B;
  --brand-ink: #A6EEEF;
  --on-brand: #04242A;
  --hover: #182632;
  --pressed: #1E2F3D;
  --focus: #2FD0D2;
  --focus-ring: 0 0 0 3px rgba(47, 208, 210, .35);
  --selection-bg: #135A60;
  --selection-text: #F3F7FA;
  --chip-active-bg: #00BFC1;
  --chip-active-text: #04242A;
  --disabled-bg: #15212C;
  --disabled-text: #7B8E9E;
  --disabled-border: #22313E;
  --success: #5BCB8F;
  --success-soft: #10291E;
  --success-border: #1F4A35;
  --warn: #F0C266;
  --warn-soft: #2F2610;
  --warn-border: #5A4718;
  --warn-ink: #F7DDA2;
  --danger: #FF8F86;
  --danger-soft: #371A1C;
  --danger-border: #6A2B2B;
  --danger-ink: #FFC9C3;
  --info: #7FC3EE;
  --info-soft: #0F2537;
  --info-border: #1E4563;
  --info-ink: #BFE1F7;
  --income: #5BCB8F;
  --income-soft: #10291E;
  --expense: #FF8F86;
  --expense-soft: #371A1C;
  --count-bg: #FF8F86;
  --count-text: #2A0B0B;
  --hero-bg: #0E2A33;
  --hero-border: #17434F;
  --hero-text: #F3F7FA;
  --hero-muted: #A9C6CF;
  --hero-accent: #5FE0E2;
  --hero-chip: rgba(255, 255, 255, .06);
  --hero-chip-border: rgba(255, 255, 255, .10);
  --hero-glow: rgba(0, 191, 193, .16);
  --hero-track: rgba(255, 255, 255, .12);
  --chart-income: #4CC38A;
  --chart-expense: #F27A70;
  --chart-hatch: rgba(8, 15, 22, .34);
  --chart-grid: #1C2B37;
  --chart-axis: #3A4E5F;
  --chart-sel: rgba(47, 208, 210, .08);
  --chart-outline: rgba(255, 255, 255, .16);
  --progress-fill: #00BFC1;
  --progress-warn: #E0A93E;
  --progress-over: #F27A70;
  --tooltip-bg: #22384A;
  --tooltip-text: #F3F7FA;
  --toast-bg: #22384A;
  --toast-text: #F3F7FA;
  --toast-error-bg: #5A1D1F;
  --toast-warn-bg: #4A3810;
  --backdrop: rgba(0, 0, 0, .62);
  --empty-icon: #4F6577;
  --shadow: 0 1px 2px rgba(0, 0, 0, .30), 0 6px 20px rgba(0, 0, 0, .22);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .50);
  --shadow-fab: 0 8px 22px rgba(0, 0, 0, .45);
  --shadow-segment: 0 1px 3px rgba(0, 0, 0, .40);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A9B8C5' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ── medidas (iguais nos dois temas) ─────────────────── */
:root {
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tap: 46px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--selection-bg); color: var(--selection-text); }
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 750; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xsmall { font-size: .78rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
[hidden] { display: none !important; } /* "hidden" sempre vence classes como .btn */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; z-index: 100; font-weight: 650; }
.skip-link:focus { top: 8px; }
html:not(.js) .js-only { display: none !important; }
.js .nojs-only { display: none !important; }
.mt-14 { margin-top: 14px; }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* Troca de tema: transição curta só durante a troca */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease !important;
}

/* ── marca JOLBIX ───────────────────────────────────────
   Os arquivos mantêm as margens transparentes originais; as margens negativas
   abaixo apenas descontam essa área (em % do próprio desenho), sem recortar,
   distorcer ou recolorir. A variante exibida segue o tema efetivo. */
.brand-logo, .brand-mark { display: block; position: relative; flex: none; line-height: 0; }
.brand-logo img, .brand-mark img { max-width: none; height: auto; pointer-events: none; }
.brand-logo { width: var(--logo-w, 196px); }
.brand-logo .on-light { width: 113.400%; margin: -9.081% 0 -7.863% -5.759%; }
.brand-logo .on-dark { width: 109.168%; margin: -7.463% 0 -7.889% -3.838%; }
.brand-mark { width: var(--mark-w, 32px); }
.brand-mark .on-light { width: 157.538%; margin: -27.692% 0 -21.231% -28.769%; }
.brand-mark .on-dark { width: 142.222%; margin: -18.889% 0 -17.500% -21.111%; }
:root[data-theme="dark"] .brand-logo .on-light, :root[data-theme="dark"] .brand-mark .on-light,
:root:not([data-theme="dark"]) .brand-logo .on-dark, :root:not([data-theme="dark"]) .brand-mark .on-dark { display: none; }

/* ── layout ─────────────────────────────────────────── */
.app { min-height: 100vh; }
.sidebar { display: none; }
.main { padding: calc(10px + var(--safe-t)) 16px calc(var(--nav-h) + 28px + var(--safe-b)); width: 100%; min-width: 0; max-width: 1180px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 44px; }
.topbar .title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex: none; }

/* cabeçalho global: marca no celular, recolher menu no computador, tema */
.appbar { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 12px; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.appbar-brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.appbar-brand:hover { text-decoration: none; }
.appbar-logo { --logo-w: 176px; }
.appbar-symbol { --mark-w: 30px; display: none; }
.product-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; padding-left: 12px; border-left: 1px solid var(--control-border); line-height: 1.5; white-space: nowrap; }
@media (max-width: 359px) {
  .appbar-logo { display: none; }
  .appbar-symbol { display: block; }
  .product-name { padding-left: 0; border-left: 0; }
}

/* seletor de tema compacto */
.theme-switch { position: relative; }
.theme-switch > summary { list-style: none; }
.theme-switch > summary::-webkit-details-marker { display: none; }
.theme-ico { display: none; }
:root[data-theme-pref="light"] .ti-light, :root[data-theme-pref="dark"] .ti-dark,
:root[data-theme-pref="system"] .ti-system, :root[data-theme-pref=""] .ti-system { display: grid; }
.theme-switch[open] > summary { background: var(--pressed); }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 212px; padding: 8px;
  background: var(--surface-overlay); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.theme-menu fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; }
.theme-menu legend { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 4px 10px 6px; }
.theme-menu .btn { margin-top: 8px; }
.theme-opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; cursor: pointer; font-weight: 620; color: var(--text-2); }
.theme-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.theme-opt:hover { background: var(--hover); }
.theme-opt:has(input:checked) { background: var(--brand-soft); color: var(--brand-strong); font-weight: 750; }
.theme-opt:has(input:checked)::after { content: ""; margin-left: auto; width: 6px; height: 11px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-2px, -1px); }
.theme-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }

/* barra inferior (celular) */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--nav-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + var(--safe-b)); display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
}
.bottom-nav a, .bottom-nav button.navbtn {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; position: relative;
  color: var(--muted); font-size: .72rem; font-weight: 600; border-radius: 12px; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.bottom-nav a:hover { text-decoration: none; color: var(--text); }
.bottom-nav a[aria-current="page"] { color: var(--brand-strong); font-weight: 750; }
.bottom-nav a[aria-current="page"] .icon { stroke-width: 2.3; }
.bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand-strong); }
.nav-dot { position: relative; }
.badge-dot { position: absolute; top: -3px; right: -6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--count-bg); color: var(--count-text); font-size: .65rem; display: grid; place-items: center; padding: 0 4px; font-weight: 750; }
.fab {
  justify-self: center; width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: var(--on-brand);
  border: 0; display: grid; place-items: center; box-shadow: var(--shadow-fab); margin-bottom: 4px; cursor: pointer;
}
.fab:hover { background: var(--brand-hover); }
.fab .icon { width: 26px; height: 26px; stroke-width: 2.4; }

/* menu lateral (computador) */
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 252px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 16px;
    background: var(--surface); border-right: 1px solid var(--border); overflow-x: hidden; overflow-y: auto; scrollbar-width: thin;
  }
  .sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 4px 6px 16px; color: var(--text); }
  .sidebar-brand:hover { text-decoration: none; }
  .sidebar-logo { --logo-w: 196px; }
  .sidebar-symbol { --mark-w: 34px; display: none; }
  .sidebar .product { display: flex; align-items: baseline; gap: 8px; width: 100%; padding-top: 12px; border-top: 1px solid var(--border); }
  .sidebar .product strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
  .sidebar .product span { font-size: .8rem; color: var(--muted); font-weight: 600; }
  .side-cta { margin-bottom: 4px; }
  .side-link { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text-2); font-weight: 560; }
  .side-link:hover { background: var(--hover); text-decoration: none; color: var(--text); }
  .side-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; }
  .side-link[aria-current="page"]::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-strong); }
  .side-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 4px; font-weight: 700; }
  .side-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
  .side-credit { margin: 10px 12px 0; font-size: .74rem; color: var(--muted); }
  .bottom-nav { display: none; }
  .main { padding: 18px 36px 48px; }
  .appbar { margin-bottom: 6px; min-height: 46px; }
  .only-mobile { display: none !important; }

  /* recolhido: só ícones e o símbolo "J" */
  :root[data-sidebar="collapsed"] .app { grid-template-columns: 80px 1fr; }
  :root[data-sidebar="collapsed"] .sidebar { padding: 20px 12px; align-items: center; overflow: visible; }
  :root[data-sidebar="collapsed"] .sidebar-brand { padding: 2px 0 14px; align-items: center; }
  :root[data-sidebar="collapsed"] .sidebar-logo { display: none; }
  :root[data-sidebar="collapsed"] .sidebar-symbol { display: block; }
  :root[data-sidebar="collapsed"] .side-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; white-space: nowrap; }
  :root[data-sidebar="collapsed"] .side-section { font-size: 0; padding: 0; height: 1px; width: 32px; background: var(--border); margin: 10px 0; }
  :root[data-sidebar="collapsed"] .side-link, :root[data-sidebar="collapsed"] .side-cta { width: 48px; justify-content: center; padding: 11px 0; }
  :root[data-sidebar="collapsed"] .side-link[aria-current="page"]::before { left: -12px; }
  :root[data-sidebar="collapsed"] .side-bottom { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
  :root[data-sidebar="collapsed"] .side-cta { position: relative; }
  :root[data-sidebar="collapsed"] .side-link:hover::after, :root[data-sidebar="collapsed"] .side-link:focus-visible::after,
  :root[data-sidebar="collapsed"] .side-cta:hover::after, :root[data-sidebar="collapsed"] .side-cta:focus-visible::after {
    content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: 80;
    background: var(--tooltip-bg); color: var(--tooltip-text); font-size: .8rem; font-weight: 650; padding: 6px 10px; border-radius: 8px;
    white-space: nowrap; box-shadow: var(--shadow-lg); pointer-events: none;
  }
}
@media (min-width: 1024px) and (max-height: 700px) {
  :root[data-sidebar="collapsed"] .sidebar { overflow-y: auto; }
}
@media (max-width: 1023px) { .only-desktop { display: none !important; } }

/* ── cards & grids ─────────────────────────────────── */
.card { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 14px; }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--control-border); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head a { font-size: .875rem; font-weight: 600; white-space: nowrap; }
.card-head-flush { margin: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid > .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 14px; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
}

.hero {
  background: var(--hero-bg); color: var(--hero-text); border-radius: 24px; padding: 20px; position: relative; overflow: hidden; border: 1px solid var(--hero-border);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, var(--hero-glow), transparent 70%); pointer-events: none; }
.hero .label { color: var(--hero-muted); font-size: .85rem; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.hero .big { font-size: clamp(1.75rem, 8vw, 2.4rem); font-weight: 780; letter-spacing: -.02em; margin: 4px 0 14px; line-height: 1.1; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 1; }
.hero-chip { background: var(--hero-chip); border: 1px solid var(--hero-chip-border); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.hero-chip .k { font-size: .75rem; color: var(--hero-muted); }
.hero-chip .v { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.hero .accent { color: var(--hero-accent); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; min-width: 0; }
.kpi .k { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: clamp(1rem, 4.6vw, 1.3rem); font-weight: 750; margin-top: 4px; overflow-wrap: anywhere; }
.kpi .s { font-size: .75rem; color: var(--muted); margin-top: 2px; }
.pos { color: var(--income); }
.neg { color: var(--expense); }

/* ── month switcher ──────────────────────────────── */
.month-nav { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.month-nav a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); }
.month-nav a:hover { background: var(--hover); }
.month-nav strong { min-width: 112px; text-align: center; font-size: .92rem; white-space: nowrap; }
.month-nav.only-mobile { margin-bottom: 14px; justify-content: space-between; }

/* ── buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border-radius: 14px; border: 1px solid transparent; font: inherit; font-weight: 650; font-size: .95rem; cursor: pointer;
  background: var(--brand); color: var(--on-brand); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-brand { box-shadow: 0 2px 8px rgba(0, 119, 122, .18); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--control-border); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: .85rem; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-grow { flex: 1; }
.icon-btn { width: var(--tap); height: var(--tap); border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; position: relative; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > form { display: contents; }
.btn-row.center { justify-content: center; }
button[disabled], .btn[disabled], .btn[aria-disabled="true"] {
  background: var(--disabled-bg); color: var(--disabled-text); border-color: var(--disabled-border); box-shadow: none; cursor: not-allowed; transform: none;
}
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); font-weight: 650; cursor: pointer; text-decoration: underline; }

/* ── lists ───────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); min-width: 0; }
.list > .row:first-child, .list > li:first-child .row { border-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; color: var(--text); }
a.row-title:hover { text-decoration: underline; }
.row-sub { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.row-sub.spread { justify-content: space-between; color: var(--text); }
.row-end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-dot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--brand-strong); background: var(--brand-soft); }
.cat-dot.income { background: var(--income-soft); color: var(--income); }
.cat-dot.expense { background: var(--expense-soft); color: var(--expense); }
.cat-dot.transfer { background: var(--info-soft); color: var(--info); }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; box-shadow: inset 0 0 0 1px var(--chart-outline); }
.swatch-lg { width: 14px; height: 14px; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }
.budget-row { padding: 10px 0; border-top: 1px solid var(--border); }
.budget-row .progress { margin: 8px 0; }
.mini-block { display: block; color: inherit; margin-bottom: 12px; }
.mini-block:hover { text-decoration: none; }
.mini-block:hover strong { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-paid { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge-overdue { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge-due_today { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-pending { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-soft-border); }

/* ── progress & charts ───────────────────────────── */
.progress { height: 10px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--progress-fill); border-radius: 999px; }
.progress.warn > span { background: var(--progress-warn); }
.progress.over > span { background: var(--progress-over); }
.progress.thin { height: 6px; margin-top: 6px; }
.progress-hero { background: var(--hero-track); border-color: transparent; margin-bottom: 12px; position: relative; z-index: 1; }
.progress-hero > span { background: var(--hero-accent); }

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; align-items: end; height: 170px; padding-top: 8px; }
.bar-group { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; padding: 0 4px; border-radius: 8px; color: inherit; }
a.bar-group:hover { text-decoration: none; background: var(--chart-sel); }
.bar-group.sel { background: var(--chart-sel); }
.bar-pair {
  flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center;
  background: linear-gradient(var(--chart-grid) 1px, transparent 1px) 0 0 / 100% 25%; border-bottom: 1px solid var(--chart-axis);
}
.bar { width: min(14px, 40%); border-radius: 6px 6px 3px 3px; min-height: 2px; }
.bar.inc, .swatch-income { background-color: var(--chart-income); }
.bar.exp, .swatch-expense { background-color: var(--chart-expense); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--chart-hatch) 3px 5px); }
.bar-label { font-size: .72rem; color: var(--muted); font-weight: 600; }
.bar-group.sel .bar-label { color: var(--text); font-weight: 800; }
.bar-group[data-tip]:hover::after, .bar-group[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 20;
  width: max-content; max-width: 190px; background: var(--tooltip-bg); color: var(--tooltip-text); font-size: .75rem; font-weight: 600;
  line-height: 1.35; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); pointer-events: none; text-align: left;
}
.bar-group[data-tip]:first-child::after { left: 0; transform: none; }
.bar-group[data-tip]:last-child::after { left: auto; right: 0; transform: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.stackbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-sunken); margin: 6px 0 12px; }
.stackbar span { display: block; height: 100%; }
.stackbar span + span { border-left: 2px solid var(--surface); }

/* ── forms ───────────────────────────────────────── */
.form { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.field label, .field-label { display: block; font-weight: 620; font-size: .9rem; margin-bottom: 6px; color: var(--text-2); }
.field .help { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.field .errorlist, .errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: .82rem; font-weight: 650; }
.errorlist li { display: flex; gap: 6px; align-items: baseline; }
.errorlist li::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: var(--surface); font-size: .7rem; font-weight: 800; transform: translateY(2px); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month], input[type=number], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--input-border); border-radius: 14px;
  font: inherit; font-size: 16px; color: var(--text); background-color: var(--input-bg); appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
select { background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
select option { background-color: var(--surface-overlay); color: var(--text); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--disabled-bg); color: var(--disabled-text); border-color: var(--disabled-border); cursor: not-allowed; }
input[type=color] { width: 64px; height: 46px; border: 1.5px solid var(--input-border); border-radius: 12px; padding: 4px; background: var(--input-bg); }
.money-input { font-size: 1.6rem !important; font-weight: 750; letter-spacing: -.01em; min-height: 64px !important; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 560; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand-strong); flex: none; }
.form-row { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
details.more-fields { border: 1px dashed var(--control-border); border-radius: 14px; padding: 4px 14px; }
details.more-fields > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 650; color: var(--link); list-style: none; }
details.more-fields > summary::-webkit-details-marker { display: none; }
details.more-fields[open] { padding-bottom: 14px; }
details.more-fields[open] > summary { margin-bottom: 8px; }
.bare { border: 0; padding: 0; margin: 0; min-width: 0; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 14px; padding: 4px; gap: 4px; }
fieldset.segmented { margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; border-radius: 10px; font-weight: 650; font-size: .9rem; cursor: pointer; color: var(--muted); text-align: center; padding: 0 6px; }
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--segment-active); color: var(--text); box-shadow: var(--shadow-segment); }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; }
.segmented input:disabled + label { cursor: not-allowed; color: var(--disabled-text); }
.segmented.kind input[value=expense]:checked + label { color: var(--expense); }
.segmented.kind input[value=income]:checked + label { color: var(--income); }
.segmented.theme-choice input:checked + label { color: var(--brand-strong); }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--control-border); border-radius: 14px; cursor: pointer; font-weight: 560; margin: 0; }
.radio-list input { width: 20px; height: 20px; accent-color: var(--brand-strong); margin-top: 1px; flex: none; }
.radio-list label:has(input:checked) { border-color: var(--brand-strong); background: var(--brand-soft); }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 8px); background: linear-gradient(transparent, var(--surface) 30%); padding-top: 14px; z-index: 5; }
@media (min-width: 1024px) { .sticky-actions { bottom: 0; } }
.form-card { max-width: 620px; }

/* ── filters ─────────────────────────────────────── */
.filters { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--control-border); color: var(--text-2); font-size: .85rem; font-weight: 620; white-space: nowrap; }
.chip:hover { text-decoration: none; background: var(--hover); }
.chip[aria-current="true"] { background: var(--chip-active-bg); color: var(--chip-active-text); border-color: var(--chip-active-bg); font-weight: 750; }
.filter-grid { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.filter-grid .full { grid-column: 1 / -1; }
@media (min-width: 900px) { .filter-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; align-items: end; } .filter-grid .full { grid-column: auto; } }
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.period-nav strong { text-align: center; font-size: .95rem; }

/* ── alerts / toasts ─────────────────────────────── */
.messages { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 60; display: grid; gap: 8px; pointer-events: none; }
@media (min-width: 1024px) { .messages { left: auto; right: 24px; bottom: 24px; width: 420px; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--toast-bg); color: var(--toast-text); padding: 12px 14px; border-radius: 16px; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in .2s ease-out; border: 1px solid var(--hero-chip-border); }
.toast.error { background: var(--toast-error-bg); }
.toast.warning { background: var(--toast-warn-bg); }
.toast .t-text { flex: 1; min-width: 0; }
.toast form { margin: 0; }
.toast .undo { background: var(--brand); color: var(--on-brand); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 750; cursor: pointer; font: inherit; font-size: .85rem; min-height: 38px; }
.toast .close { background: none; border: 0; color: var(--toast-text); opacity: .75; cursor: pointer; width: 34px; height: 34px; display: grid; place-items: center; }
.toast .close:hover { opacity: 1; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.notice .icon { margin-top: 2px; }
.notice-danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-ink); }
.notice-warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn-ink); }
.notice-info { background: var(--info-soft); border-color: var(--info-border); color: var(--info-ink); }
.notice-brand { background: var(--brand-soft); border-color: var(--brand-soft-border); color: var(--brand-ink); }
.notice a { color: inherit; text-decoration: underline; }
.notice .n-title { font-weight: 700; display: block; }
.notice .n-body { flex: 1; min-width: 0; }
.mb-14 { margin-bottom: 14px; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty > .icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--empty-icon); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }
.grid > .empty-full { grid-column: 1 / -1; }

/* ── table (desktop) ─────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); font-weight: 700; }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover td { background: var(--hover); }
.table td.r, .table th.r { text-align: right; }

/* ── sheet / dialog ──────────────────────────────── */
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: 520px; max-height: calc(100dvh - 24px); overflow-y: auto; margin: auto auto 0; border-radius: 24px 24px 0 0; background: var(--surface-overlay); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: var(--backdrop); }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-radius: 24px; border: 1px solid var(--border); } }
.sheet-inner { padding: 20px 18px calc(18px + var(--safe-b)); }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--control-border); margin: -6px auto 14px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.quick { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--tile-border); background: var(--tile-bg); color: var(--text); font-weight: 650; min-height: 88px; }
.quick:hover { text-decoration: none; border-color: var(--brand-strong); background: var(--tile-hover); }
.quick small { color: var(--muted); font-weight: 500; font-size: .78rem; }

/* ── auth pages ──────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; padding: calc(12px + var(--safe-t)) 16px calc(24px + var(--safe-b)); }
.auth-top { display: flex; justify-content: flex-end; }
.auth-main { display: grid; place-items: center; padding: 8px 0 12px; }
.auth-main:focus { outline: none; }
.auth-card { width: 100%; max-width: 420px; }
.auth-brand { display: flex; justify-content: center; margin: 0 auto 22px; width: max-content; max-width: 100%; }
.auth-brand:hover { text-decoration: none; }
.auth-logo { --logo-w: 220px; }
.auth-product { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.auth-product strong { color: var(--brand-strong); }
.auth-card h1 { margin-bottom: 6px; }
.auth-card h3 { margin-top: 14px; margin-bottom: 4px; }
.auth-foot { text-align: center; margin-top: 16px; font-size: .92rem; }
.auth-credit { text-align: center; margin: 18px 0 0; font-size: .78rem; color: var(--muted); }

.plan-card { display: flex; flex-direction: column; gap: 10px; }
.plan-card .price { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.plan-card ul { padding-left: 0; list-style: none; margin: 0; display: grid; gap: 6px; }
.plan-card li { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; }
.plan-card li .icon { color: var(--success); }
.plan-card.featured { border-color: var(--brand-strong); box-shadow: 0 0 0 1px var(--brand-strong) inset, var(--shadow); }

.divider { height: 1px; background: var(--border); margin: 14px 0; border: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 620; }
.readonly-bar { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-border); padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; font-size: .9rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.readonly-bar > span, .demo-bar { display: flex; gap: 8px; align-items: center; }
.demo-bar { background: var(--info-soft); color: var(--info-ink); border: 1px solid var(--info-border); padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; font-size: .9rem; }
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-top: 1px solid var(--border); color: var(--text); font-weight: 600; min-height: 52px; }
.menu-list a:first-child { border-top: 0; }
.menu-list a:hover { text-decoration: none; background: var(--hover); }
.menu-list a .chev { margin-left: auto; color: var(--muted); }
.menu-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 4px; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: var(--danger); font-weight: 650; cursor: pointer; min-height: 52px; }
.install-hint[hidden] { display: none; }
.owner-nav { margin-bottom: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
.update-bar { position: fixed; left: 12px; right: 12px; top: calc(10px + var(--safe-t)); z-index: 90; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--toast-bg); color: var(--toast-text); padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: .9rem; }
.update-bar[hidden] { display: none; }
@media (min-width: 1024px) { .update-bar { left: auto; right: 24px; width: 420px; } }
.about-brand { display: flex; align-items: center; gap: 12px; }
.about-brand .brand-mark { --mark-w: 30px; }
.about-brand p { margin: 0; }
.about-brand strong, .row-sub .amount { color: var(--text); }

.row { flex-wrap: wrap; }
.row-pay { margin: -4px 0 0; flex-basis: 100%; display: flex; justify-content: flex-end; }
@media (min-width: 640px) { .row { flex-wrap: nowrap; } .row-pay { flex-basis: auto; margin: 0; } }
.pay-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--brand-strong); background: var(--surface); color: var(--brand-strong); font: inherit; font-size: .75rem; font-weight: 750; cursor: pointer; }
.pay-btn:hover { background: var(--brand-soft); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn:active { transform: none; }
}

/* ── central do proprietário ─────────────────────── */
.owner-app .main { padding-bottom: calc(28px + var(--safe-b)); }
.owner-badge { white-space: nowrap; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.kpi-links + .section-title { margin-top: 22px; }
a.kpi { display: block; color: inherit; transition: border-color .15s, background .15s; }
a.kpi:hover { text-decoration: none; border-color: var(--brand-strong); background: var(--hover); }
a.kpi:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sub-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.defs { padding-left: 18px; margin: 10px 0 0; display: grid; gap: 6px; }
.mt-8 { margin-top: 8px; }
.side-logout { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.owner-logout { margin-top: 22px; }
.customer-row .row-end { align-items: flex-end; }
.usage-bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.usage-bar { flex: 1 1 0; min-width: 2px; min-height: 3px; background: var(--brand); border-radius: 4px 4px 0 0; }
[data-period-for][hidden] { display: none; }

/* ── barra de teste/cortesia ─────────────────────── */
.benefit-bar { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-soft-border); padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; font-size: .9rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.benefit-bar > span { display: flex; gap: 8px; align-items: center; min-width: 0; }

/* ── início: ações rápidas e primeiros passos ────── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quick-actions .btn { min-height: 52px; }
.quick-exp { background: var(--brand); color: var(--on-brand); }
.guide-steps { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; counter-reset: g; }
.guide-steps li { counter-increment: g; display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.guide-steps li::before { content: counter(g); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 750; background: var(--surface-raised); color: var(--text-2); }
.guide-steps li.done { color: var(--muted); }
.guide-steps li.done::before { background: var(--success-soft); color: var(--success); }
.guide-steps li.current::before { background: var(--brand); color: var(--on-brand); }
.guide-steps .icon { color: var(--success); margin-top: 2px; }
.steps-list { padding-left: 18px; margin: 6px 0 0; display: grid; gap: 4px; }

/* ── convite de instalação ───────────────────────── */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 14px + var(--safe-b)); z-index: 60; background: var(--surface-overlay); color: var(--text); border: 1px solid var(--border); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-lg); max-width: 520px; margin: 0 auto; }
.install-banner[hidden] { display: none; }
.install-banner-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.install-banner h2 { font-size: 1rem; margin-bottom: 2px; }
.install-mark { --mark-w: 36px; flex: none; }
@media (min-width: 1024px) { .install-banner { left: auto; right: 24px; bottom: 24px; width: 420px; } }
.install-step { border-top: 1px solid var(--border); padding: 14px 0; }
.install-step h2 { font-size: 1rem; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.install-step ol { padding-left: 18px; margin: 0; display: grid; gap: 4px; }
.install-step[hidden], [data-install-manual][hidden] { display: none; }

/* ── página pública ──────────────────────────────── */
.landing { min-height: 100vh; display: flex; flex-direction: column; padding: calc(12px + var(--safe-t)) 16px calc(24px + var(--safe-b)); max-width: 1080px; margin: 0 auto; }
.landing-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.landing-brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.landing-brand:hover { text-decoration: none; }
.landing-logo { --logo-w: 150px; }
.landing-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.landing-hero { text-align: center; padding: 40px 0 28px; max-width: 640px; margin: 0 auto; display: grid; gap: 12px; justify-items: center; }
.landing-hero h1 { font-size: clamp(1.6rem, 6.5vw, 2.5rem); line-height: 1.15; letter-spacing: -.02em; }
.landing-hero .lead { font-size: 1.05rem; color: var(--text-2); }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 1.05rem; }
.landing-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-top: 10px; }
.landing-grid .card + .card { margin-top: 0; }
.landing-grid h2 { font-size: 1.02rem; margin: 10px 0 4px; }
@media (min-width: 768px) { .landing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .landing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.landing-plans { margin-top: 30px; }
.landing-plans h2 { margin-bottom: 4px; }
.landing-plans .grid { margin-top: 12px; }
.landing-foot { margin-top: auto; padding-top: 32px; display: grid; justify-items: center; gap: 4px; text-align: center; }
.landing-mark { --mark-w: 30px; }
@media (max-width: 359px) { .landing-brand .product-name { display: none; } .landing-logo { --logo-w: 120px; } }
/* botões com rótulo longo quebram linha em vez de estourar a largura no celular */
.btn-row .btn { max-width: 100%; white-space: normal; text-align: center; height: auto; }
.quick-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.quick-actions .btn { min-width: 0; padding: 0 10px; white-space: normal; text-align: center; line-height: 1.2; }
.side-logout:hover { text-decoration: none; }
.landing-eyebrow { font-size: .85rem; font-weight: 750; color: var(--brand-strong); letter-spacing: .02em; }
@media (max-width: 479px) { .landing-brand .product-name { display: none; } }
@media (min-width: 360px) and (max-width: 419px) {
  .appbar-logo { --logo-w: 124px; }
  .appbar-brand { gap: 10px; }
  .product-name { font-size: .95rem; padding-left: 10px; }
}

/* plano anual: fatos calculados do catálogo */
.annual-facts { list-style: none; padding: 0; margin: 8px 0 4px; display: grid; gap: 4px; }
.annual-facts li { display: flex; gap: 8px; align-items: flex-start; }
.annual-facts li > span { min-width: 0; }
.annual-facts li .icon { margin-top: 3px; }
.annual-facts .icon { color: var(--brand-strong); flex: none; }

/* Minha assinatura: contratação pendente em destaque e histórico */
.pending-card { border: 2px solid var(--brand); }
.history-item + .history-item { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }

/* ── parceiros: link individual ─────────────────────── */
.copy-link { display: grid; gap: 6px; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-input { flex: 1 1 220px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.commission-table td { vertical-align: top; }
/* Tabelas que viram cartões no celular (rótulo vem de data-label) */
@media (max-width: 699px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .table-stack tbody tr:hover td { background: none; }
  .table-stack td { padding: 4px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  .table-stack td::after { content: ""; display: block; clear: both; }
  .table-stack td::before { content: attr(data-label); float: left; max-width: 45%; margin-right: 12px; text-align: left; color: var(--muted); font-size: .8rem; font-weight: 650; }
  .table-stack td:first-child { text-align: left; }
  .table-stack td:first-child::before { content: none; }
}
/* Seção Parceiros: no celular, as ações vão para a linha de baixo do título */
@media (max-width: 699px) {
  .topbar:has(.partners-actions) { flex-wrap: wrap; }
  .topbar:has(.partners-actions) .title { flex: 1 1 100%; }
}

/* ── negócio (RendaExtra) ───────────────────────────── */
.bar.profit, .swatch-profit { background-color: var(--brand-strong); }
.bar.profit.loss { background-color: var(--danger); }
.sale-lines { display: grid; gap: 10px; }
.sale-line { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 8rem; gap: 8px; align-items: end; }
.sale-line .field { margin: 0; min-width: 0; }
.sale-line input, .sale-line select { width: 100%; min-width: 0; }
@media (max-width: 520px) { .sale-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .sale-line .field:first-child { grid-column: 1 / -1; } }
.sale-total { font-size: 1.05rem; margin: 4px 0 0; }
table.dre td { padding-top: 7px; padding-bottom: 7px; }
.dre .dre-l1 td:first-child { padding-left: 22px; color: var(--muted); }
.dre .dre-l2 td { font-weight: 700; }
.dre .dre-l3 td { font-weight: 800; font-size: 1rem; border-top: 2px solid var(--border); }
.comp-table input, .comp-table select { min-width: 0; width: 100%; }
@media (min-width: 700px) { .comp-table td { padding: 6px 4px; } .comp-table td:nth-child(2) { min-width: 9rem; } }
.row-title.insight-text { white-space: normal; overflow: visible; text-overflow: clip; display: block; }
/* campos em linha nunca estouram a largura no celular */
.form-row > .field { min-width: 0; }
.form-row input, .form-row select { min-width: 0; max-width: 100%; }
.inline-details { display: inline-block; }
