/* ===================================================================
   NIXX — Sistema de Gestão Financeira
   Tema escuro, responsivo (desktop + celular)
   =================================================================== */

:root {
  --bg:            #0a0a0b;
  --bg-elev:       #141416;
  --card:          #161618;
  --card-hover:    #1d1d20;
  --border:        #262629;
  --border-soft:   #1f1f22;

  --text:          #f4f4f5;
  --text-2:        #a1a1aa;
  --text-3:        #6b6b73;

  --brand:         #ff6a1a;
  --brand-soft:    rgba(255,106,26,.14);
  --green:         #22c55e;
  --green-soft:    rgba(34,197,94,.14);
  --red:           #ef4444;
  --red-soft:      rgba(239,68,68,.14);
  --blue:          #3b82f6;

  --radius:        16px;
  --radius-sm:     11px;
  --shadow:        0 8px 30px rgba(0,0,0,.35);
  --sidebar-w:     248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= LAYOUT ================= */
.app { display: flex; height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  z-index: 60;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 26px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(150deg, #1c1c1f, #0e0e10);
  border: 1px solid rgba(255,106,26,.35);
  box-shadow: 0 6px 16px rgba(255,106,26,.12);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px; letter-spacing: -1px;
}
.brand .logo span:first-child { color: #fff; }
.brand .logo .lx { color: var(--brand); margin-left: -3px; }

/* Tela de login: apenas a mini logo, um pouco maior */
.brand-solo { padding: 0 0 18px; justify-content: center; }
.brand-solo .logo { width: 56px; height: 56px; border-radius: 16px; font-size: 25px; }
.brand .name { font-size: 22px; font-weight: 800; letter-spacing: .5px; color: var(--text); }
.brand .name .ax { color: var(--brand); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 12px;
  color: var(--text-2); font-size: 15px; font-weight: 500;
  position: relative; transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-item.active::before {
  content: ""; position: absolute; left: -16px; top: 20%; bottom: 20%;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--brand);
}

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.mode-pill {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 12px;
}
.mode-pill .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); display:grid; place-items:center; }
.mode-pill .dot svg { width: 15px; height: 15px; color: #fff; }
.mode-pill .chev { margin-left: auto; color: var(--text-3); }

/* ---------- Main ---------- */
.main { flex: 1; overflow-y: auto; padding: 26px 30px 60px; }

/* Topbar */
.topbar {
  display: flex; align-items: flex-start; gap: 20px; margin-bottom: 26px; flex-wrap: wrap;
  padding-bottom: 22px; border-bottom: 1px solid var(--border);
}
.hello h1 { font-size: 27px; font-weight: 700; }
.hello p  { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.month-select {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 12px; font-weight: 500; font-size: 14px;
}
.month-select svg { width: 17px; height: 17px; color: var(--text-2); }
.month-select select {
  background: none; border: none; color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; outline: none;
}
.badge-ok {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--green); background: var(--green-soft);
  padding: 9px 14px; border-radius: 11px; font-size: 13px; font-weight: 600;
}
.badge-ok.bad { color: var(--red); background: var(--red-soft); }
.badge-ok.neutral { color: var(--text-2); background: var(--card); border: 1px solid var(--border); }
.icon-btn .dot-alert { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

/* Painel de notificações */
.notif-panel {
  position: absolute; right: 0; top: 52px; width: 330px; max-width: calc(100vw - 30px);
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.5); padding: 8px; display: none; z-index: 80;
}
.notif-panel.open { display: block; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; }
.notif-head h4 { font-size: 14px; margin: 0; }
.notif-head a { font-size: 12px; color: var(--brand); cursor: pointer; font-weight: 600; }
.notif-head a:hover { text-decoration: underline; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; align-items: flex-start; }
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-item .ni-ic { font-size: 16px; line-height: 1.3; }
.notif-item p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.notif-item.unread p { color: var(--text); }
.notif-item .nd { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; visibility: hidden; }
.notif-item.unread .nd { visibility: visible; }
.notif-empty { padding: 26px 14px; text-align: center; color: var(--text-3); font-size: 13px; line-height: 1.6; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--border); display: grid; place-items: center;
  color: var(--text-2); position: relative; background: var(--card);
}
.icon-btn:hover { color: var(--text); }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background:#333; }
.avatar-btn {
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: var(--brand); color: #111;
}
.avatar-btn:hover { filter: brightness(1.06); }

/* Menu da conta (abre no avatar) */
.account-menu {
  position: absolute; right: 0; top: 52px; width: 262px; max-width: calc(100vw - 30px);
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.5); padding: 8px; display: none; z-index: 80;
}
.account-menu.open { display: block; }
.account-head {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px; border-radius: 10px;
}
.account-head:hover { background: rgba(255,255,255,.04); }
.account-av {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  background: var(--brand); color: #111;
}
.account-id { min-width: 0; }
.account-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-mail { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-sep { height: 1px; background: var(--border-soft); margin: 6px 4px; }
.account-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 11px 10px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
}
.account-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.account-item svg { width: 17px; height: 17px; flex: none; }
.account-item.danger { color: var(--red); }
.account-item.danger:hover { background: var(--red-soft); color: var(--red); }

.hamburger { display: none; }

/* ===== Convite para instalar o app (PWA) ===== */
.install-card {
  position: fixed; z-index: 90; bottom: 22px;
  left: 50%; transform: translateX(-50%) translateY(160%);
  width: calc(100% - 28px); max-width: 430px;
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 16px; padding: 12px 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: transform .32s ease, opacity .32s ease;
}
.install-card.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.ic-logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: #141416; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 19px; letter-spacing: -2px;
}
.ic-logo .lx { color: var(--brand); }
.ic-text { flex: 1; min-width: 0; }
.ic-title { font-weight: 700; font-size: 14px; }
.ic-sub { color: var(--text-3); font-size: 12px; line-height: 1.45; margin-top: 2px; }
.ic-sub b { color: var(--text-2); }
.ic-btn {
  flex: none; background: var(--brand); color: #111;
  font-weight: 700; font-size: 13px; padding: 9px 15px; border-radius: 10px;
}
.ic-btn:active { transform: scale(.96); }
.ic-close { flex: none; color: var(--text-3); font-size: 15px; width: 30px; height: 30px; border-radius: 8px; }
.ic-close:hover { color: var(--text); background: var(--card); }

/* ===== Barra de navegação inferior (só aparece no mobile) ===== */
.bottom-nav { display: none; }
.bn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  flex: 1; min-width: 0; padding: 8px 1px;
  color: var(--text-3); font-size: 10px; font-weight: 600;
}
.bn-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-item svg { width: 22px; height: 22px; }
.bn-item.active { color: var(--brand); }
.bn-fab {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  background: var(--brand); color: #111; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(255,106,26,.4); margin-top: -24px;
}
.bn-fab svg { width: 26px; height: 26px; }
.bn-fab:active { transform: scale(.94); }

/* ================= CARDS / GRID ================= */
.grid { display: grid; gap: 18px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card.pad-lg { padding: 24px; }

.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px; }
.stat-icon svg { width: 22px; height: 22px; }
.i-green { background: var(--green-soft); color: var(--green); }
.i-red   { background: var(--red-soft);   color: var(--red); }
.i-brand { background: var(--brand-soft); color: var(--brand); }

.card .label { color: var(--text-2); font-size: 14px; display:flex; align-items:center; gap:8px; }
.card .value { font-size: 27px; font-weight: 700; margin: 8px 0 12px; letter-spacing: -.5px; }
.trend { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.card .sub { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.eye { color: var(--text-3); cursor: pointer; display:inline-flex; }

/* Dica card */
.tip .value-tip { font-size: 14px; color: var(--text-2); line-height: 1.55; margin: 6px 0 14px; }
.tip b { color: var(--brand); }
.link-brand { color: var(--brand); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }

/* Banner positivo */
.banner {
  display: flex; align-items: center; gap: 22px;
  background: linear-gradient(90deg, rgba(34,197,94,.06), transparent 60%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 18px;
}
.banner .emoji {
  width: 66px; height: 66px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 30px;
  background: radial-gradient(circle, rgba(34,197,94,.28), rgba(34,197,94,.05));
  box-shadow: 0 0 30px rgba(34,197,94,.35);
}
.banner-text h2 { font-size: 22px; font-weight: 700; }
.banner-text h2 span { color: var(--green); }
.banner-text p { color: var(--text-2); font-size: 14px; margin-top: 5px; line-height: 1.5; }
.btn-outline {
  margin-left: auto; flex-shrink: 0;
  border: 1px solid var(--brand); color: var(--brand);
  padding: 12px 20px; border-radius: 12px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline:hover { background: var(--brand-soft); }

/* Panel (bottom sections) */
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h3 { font-size: 18px; font-weight: 600; }
.chip {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  border: 1px solid var(--border); padding: 6px 12px; border-radius: 9px;
}
.chip:hover { color: var(--brand); border-color: var(--brand); }
.chip.brand { color: var(--brand); border-color: rgba(255,106,26,.4); }

/* Lista de contas / movimentações */
.row-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.row-item:last-child { border-bottom: none; }
.row-ic { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; color:#fff; }
.row-main { flex: 1; min-width: 0; }
.row-main .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main .s { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.row-val { font-weight: 700; font-size: 14.5px; text-align: right; white-space: nowrap; }
.row-val .d { display:block; color: var(--text-3); font-weight: 500; font-size: 12px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.total-row { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--border); font-weight: 700; }
.total-row .lbl { color: var(--text-2); font-weight: 600; }
.total-row .v { font-size: 18px; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut .center small { color: var(--text-3); font-size: 12px; }
.donut .center b { display: block; font-size: 17px; margin-top: 2px; }
.legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 11px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend-item .lc { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-item .ln { color: var(--text-2); }
.legend-item .lp { margin-left: auto; font-weight: 600; }

.cta-wide {
  margin: 22px auto 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--border); background: var(--card);
  padding: 15px 26px; border-radius: 13px; font-weight: 600; color: var(--text-2);
}
.cta-wide:hover { color: var(--brand); border-color: var(--brand); }

/* ================= BOTÕES / FORMULÁRIOS ================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 18px; border-radius: 11px; font-weight: 600; font-size: 14px;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
}
.btn:hover { background: var(--card-hover); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #111; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: rgba(239,68,68,.4); }
.btn.danger:hover { background: var(--red-soft); }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 14px; }
.page-head h2 { font-size: 23px; font-weight: 700; }
.page-head p { color: var(--text-2); font-size: 14px; margin-top: 3px; }

/* Tabela de lançamentos */
.tx-list { display: flex; flex-direction: column; }
.tx-filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.seg button { padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--brand-soft); color: var(--brand); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--card);
  border: 1px solid var(--border); border-radius: 11px; padding: 0 14px; flex: 1; min-width: 180px;
}
.search svg { width: 16px; height: 16px; color: var(--text-3); }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); padding: 11px 0; font-size: 14px; }

.tx-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border-soft); }
.tx-row:hover { background: var(--card); border-radius: 10px; }
.tx-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.tx-row:hover .tx-actions { opacity: 1; }
.mini-btn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); border: 1px solid transparent; }
.mini-btn:hover { border-color: var(--border); color: var(--text); }
.mini-btn.del:hover { color: var(--red); border-color: rgba(239,68,68,.4); }

.empty { text-align: center; color: var(--text-3); padding: 60px 20px; }
.empty svg { width: 46px; height: 46px; margin-bottom: 14px; opacity: .5; }

/* ================= MODAL ================= */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  display: none; place-items: center; z-index: 100; padding: 20px;
}
.overlay.open { display: grid; }
.modal {
  width: 100%; max-width: 440px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 18px; padding: 24px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal h3 { font-size: 19px; font-weight: 700; margin-bottom: 20px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field input, .field select {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 12px 14px; border-radius: 11px; font-size: 14.5px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.type-toggle { display: flex; gap: 10px; margin-bottom: 18px; }
.type-toggle button {
  flex: 1; padding: 12px; border-radius: 11px; border: 1px solid var(--border);
  color: var(--text-2); font-weight: 600; font-size: 14px;
}
.type-toggle button.on-income { background: var(--green-soft); color: var(--green); border-color: rgba(34,197,94,.4); }
.type-toggle button.on-expense { background: var(--red-soft); color: var(--red); border-color: rgba(239,68,68,.4); }
.modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }

/* Entrada suave dos modais */
@keyframes modalPop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.overlay.open .modal { animation: modalPop .18s ease-out; }

/* Modal de confirmação */
.modal-confirm { max-width: 384px; text-align: center; }
.modal-confirm h3 { margin-bottom: 8px; }
.confirm-icon {
  width: 54px; height: 54px; border-radius: 50%; margin: 2px auto 16px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.confirm-icon svg { width: 26px; height: 26px; }
.modal-confirm.is-danger .confirm-icon { background: var(--red-soft); color: var(--red); }
.confirm-msg { color: var(--text-2); font-size: 14px; line-height: 1.55; margin: 0 auto; max-width: 300px; }
.modal-confirm .modal-actions { justify-content: center; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-solid:hover { background: var(--red); filter: brightness(1.08); }
.color-picker { display: flex; gap: 9px; flex-wrap: wrap; }
.color-picker .sw { width: 30px; height: 30px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.color-picker .sw.on { border-color: #fff; }

/* Reports */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding: 10px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: flex-end; height: 100%; }
.bar { width: 60%; max-width: 46px; border-radius: 8px 8px 0 0; display: flex; flex-direction: column; justify-content: flex-end; min-height: 4px; }
.bar-col small { color: var(--text-3); font-size: 12px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  padding: 13px 22px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); z-index: 200; transition: transform .3s; display:flex; align-items:center; gap:10px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast svg { width: 18px; height: 18px; color: var(--green); }

.hide { display: none !important; }

/* ================= RESPONSIVO (CELULAR) ================= */
.scrim { display: none; }

@media (max-width: 1100px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .app { display: block; height: auto; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow); height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
  .scrim.open { display: block; }
  .main { height: auto; padding: 16px 15px calc(96px + env(safe-area-inset-bottom)); }

  /* barra de navegação inferior */
  .bottom-nav {
    display: flex; align-items: center; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--bg-elev); border-top: 1px solid var(--border);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  /* convite de instalação fica acima da barra inferior */
  .install-card { bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* linha de lançamento em grade: descrição + valor em cima,
     detalhe + botões embaixo. Assim a descrição ganha a largura toda
     e no touch os botões editar/excluir ficam sempre visíveis. */
  .tx-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "ic main val" "ic main act";
    align-items: center; column-gap: 12px; row-gap: 4px;
  }
  .row-ic { grid-area: ic; }
  .row-main { grid-area: main; }
  .row-val { grid-area: val; }
  .tx-actions { grid-area: act; justify-content: flex-end; opacity: 1; }
  .row-main .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini-btn { width: 36px; height: 36px; }
  /* filtros ocupam a largura toda, sem cortar "Transferências" */
  .tx-filters .seg { width: 100%; }
  .tx-filters .seg button { flex: 1; padding: 9px 4px; font-size: 12px; }
  .hamburger {
    display: grid; place-items: center; width: 42px; height: 42px;
    border-radius: 11px; border: 1px solid var(--border); background: var(--card); color: var(--text);
  }
  .hamburger svg { width: 22px; height: 22px; }
  .topbar { align-items: center; }
  .hello h1 { font-size: 21px; }
  .hello p { display: none; }
  .cards-4 { grid-template-columns: 1fr; }
  .month-select { padding: 9px 12px; }
  .topbar-actions .icon-btn.help { display: none; }
  .banner { flex-direction: column; text-align: center; align-items: center; }
  .btn-outline { margin-left: 0; }
  .donut-wrap { justify-content: center; }
}

@media (max-width: 420px) {
  .hello h1 { font-size: 18px; }
  .badge-ok { display: none; }
}

/* ================= TELA DE BLOQUEIO ================= */
.lock {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(255,106,26,.08), transparent), var(--bg);
  overflow-y: auto;
}
.lock-card {
  width: 100%; max-width: 384px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 30px 26px;
  box-shadow: var(--shadow);
}
.lock-head { text-align: center; margin-bottom: 26px; }
.lock-title { font-size: 21px; font-weight: 700; letter-spacing: .2px; margin: 0 0 7px; }
.lock-sub { color: var(--text-3); font-size: 13px; line-height: 1.5; max-width: 250px; margin: 0 auto; }
.lock-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 8px; text-align: center; }
.lock-foot {
  color: var(--text-3); font-size: 11.5px; text-align: center; line-height: 1.5;
  margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-soft);
}
.auth-switch { text-align: center; color: var(--text-2); font-size: 13.5px; margin-top: 18px; }
.auth-switch a { color: var(--brand); font-weight: 600; cursor: pointer; }
.auth-switch a:hover { text-decoration: underline; }
.auth-forgot { text-align: right; font-size: 12.5px; margin: -6px 0 4px; }
.auth-forgot a { color: var(--text-2); cursor: pointer; }
.auth-forgot a:hover { color: var(--brand); text-decoration: underline; }
.auth-terms { text-align: center; color: var(--text-3); font-size: 11.5px; margin-top: 12px; line-height: 1.5; }
.auth-terms a { color: var(--brand); }

/* FAQ (Ajuda) */
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; background: rgba(255,255,255,.02); }
.faq summary { padding: 13px 0; cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-size: 16px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--text-2); font-size: 13px; line-height: 1.65; margin: 0; padding-bottom: 14px; }
.faq details a { color: var(--brand); }

/* Botões de contato / suporte */
.contact-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.whats { color: var(--green); border-color: rgba(34,197,94,.4); }
.btn.whats:hover { background: var(--green-soft); }

.pw-field { position: relative; }
.pw-field input { padding-right: 44px !important; }
.pw-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-3); font-size: 15px; transition: color .15s;
}
.pw-toggle:hover { color: var(--text-2); }
.pw-toggle:hover { color: var(--text); }
.lock .field input[type="file"] {
  width: 100%; background: var(--card); border: 1px solid var(--border);
  color: var(--text-2); padding: 10px 12px; border-radius: 11px; font-size: 13px;
}

/* ================= MENU DE ESPAÇOS (PESSOAL/EMPRESA) ================= */
.space-menu {
  display: none;
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); z-index: 80;
}
.space-menu.open { display: block; }
.space-menu button {
  display: block; width: 100%; text-align: left;
  padding: 12px 16px; font-size: 14px; font-weight: 500; color: var(--text-2);
}
.space-menu button:hover { background: var(--card); color: var(--text); }

/* ================= RESERVA (BARRA DE PROGRESSO) ================= */
.progress {
  height: 12px; background: var(--border-soft); border-radius: 8px; overflow: hidden;
}
.progress i {
  display: block; height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, var(--green), #4FD1E8);
  transition: width .4s ease;
}
.progress-info {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 10px; font-size: 13.5px; color: var(--text-2); flex-wrap: wrap;
}

/* ================= TAGS (TRANSFERÊNCIA / NATUREZA) ================= */
.tag-transfer {
  display: inline-block; font-size: 11px; font-weight: 600;
  color: var(--blue); background: rgba(59,130,246,.14);
  padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: middle;
}
.tag-nature {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: middle;
}
.tag-nature.fixo     { color: #f59e0b; background: rgba(245,158,11,.14); }
.tag-nature.variavel { color: #8b5cf6; background: rgba(139,92,246,.14); }
.tag-nature.receita  { color: var(--green); background: var(--green-soft); }
.tag-nature.entrada  { color: var(--green); background: var(--green-soft); }
.tag-nature.reserva  { color: #38bdf8; background: rgba(56,189,248,.14); }
.tag-nature.divida   { color: var(--red); background: var(--red-soft); }
.tag-nature.investimento { color: #14b8a6; background: rgba(20,184,166,.14); }
.tag-nature.imposto  { color: #eab308; background: rgba(234,179,8,.16); }

/* Botão de transferência no modal */
.type-toggle button.on-transfer {
  background: rgba(59,130,246,.14); color: var(--blue); border-color: rgba(59,130,246,.4);
}

/* ================= SEPARAÇÃO PF/PJ ================= */
/* Diálogo de escolha (casos de mistura) */
.choose-options { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.choose-opt {
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 13px 15px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg-elev);
  transition: border-color .15s, background .15s;
}
.choose-opt:hover { border-color: var(--brand); background: var(--card-hover); }
.choose-opt .co-label { font-weight: 600; font-size: 15px; color: var(--text); }
.choose-opt .co-desc { font-size: 13px; color: var(--text-2); line-height: 1.4; }
/* opção marcada (perguntas de múltipla escolha do questionário inicial) */
.choose-opt.sel {
  border-color: var(--brand); background: rgba(255,106,26,.1);
}
.choose-opt.sel .co-label::after { content: " ✓"; color: var(--brand); }

/* bolinhas de progresso do questionário inicial */
.ob-dots { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
.ob-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); transition: background .2s;
}
.ob-dots span.on { background: var(--brand); }

/* Etiquetas PF / PJ */
.tag-side {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: middle;
}
.tag-side.pf { color: var(--blue); background: rgba(59,130,246,.14); }
.tag-side.pj { color: #a78bfa; background: rgba(139,92,246,.14); }
.tag-side.reembolso { color: var(--green); background: var(--green-soft); }
.tag-side.aporte    { color: #38bdf8; background: rgba(56,189,248,.14); }
.tag-side.retirada  { color: #fb923c; background: rgba(251,146,60,.16); }
.tag-side.devolver  { color: var(--red); background: var(--red-soft); }
.tag-side.review    { color: #eab308; background: rgba(234,179,8,.16); }

/* Selo "provisório" */
.prov-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  color: #eab308; background: rgba(234,179,8,.14);
  padding: 3px 9px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}

/* Blocos do painel de empresa */
.block-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-2);
}
.block-head .bdot { width: 9px; height: 9px; border-radius: 50%; }
.bdot.pf { background: var(--blue); } .bdot.pj { background: #a78bfa; } .bdot.sep { background: var(--brand); }
.big-num { font-size: 26px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 2px; }
.mini-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; color: var(--text-2); border-top: 1px solid var(--border-soft); }
.mini-row:first-of-type { border-top: none; }
.mini-row b { color: var(--text); font-weight: 600; }

/* Banner de pendências (Revisão / Fechar o mês) */
.nag {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(234,179,8,.09); border: 1px solid rgba(234,179,8,.30);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.nag .nag-emoji { font-size: 26px; line-height: 1; }
.nag h3 { font-size: 17px; margin-bottom: 4px; }
.nag p { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.rev-line {
  display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border-soft);
}
.rev-line:first-child { border-top: none; }
.rev-line .rl-main { flex: 1; }
.rev-line .rl-main .t { font-weight: 600; font-size: 14.5px; }
.rev-line .rl-main .s { font-size: 12.5px; color: var(--text-3); }
.rev-line .rl-val { font-weight: 700; font-variant-numeric: tabular-nums; }

/* O modal de dividir e o de escolha PF/PJ abrem por cima do modal de lançamento */
#splitModal, #chooseModal { z-index: 120; }
