/* ==========================================================================
   MOBII - FINANCIAL SAAS DASHBOARD & RESPONSIVE LAYOUT (DESKTOP & MOBILE)
   ========================================================================== */

#appScreen {
  display: none;
  min-height: 100vh;
  background-color: var(--bg);
}

/* ── 1. SIDEBAR ARCHITECTURE (DESKTOP & MOBILE DRAWER) ── */
.sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  z-index: 200;
  box-shadow: 1px 0 10px rgba(15, 23, 42, 0.03);
  overflow-y: auto;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Logo Header */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.5rem;
}

.sidebar-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

/* Account Context Switcher Cards */
.account-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #F8FAFC;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.scard {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scard:hover {
  border-color: var(--border-strong);
  background: #FFFFFF;
}

.scard.active {
  background: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  position: relative;
}

.scard.active#scPF {
  border-color: #0891B2;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.12);
}

.scard .sc-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.scard .sc-tag {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.scard .sc-tag.pj {
  background: #EFF6FF;
  color: #1D4ED8;
}

.scard .sc-tag.pf {
  background: #ECFEFF;
  color: #0E7490;
}

.scard .sc-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

.scard .sc-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.scard .sc-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Sidebar Vertical Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background: #EFF6FF;
  color: #1D4ED8;
  font-weight: 700;
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Sidebar Footer (Profile & Logout) */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #162858 0%, #2563EB 100%);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  min-width: 0;
}

.user-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-context {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: #FEE2E2;
  color: #B91C1C;
}

/* ── 2. MAIN WRAPPER & TOPBAR ── */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background: var(--bg-subtle);
}

.mobile-brand {
  display: none;
}

.mobile-logo {
  height: 28px;
  width: auto;
}

.account-context-badge {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.account-context-badge.pf {
  background: #ECFEFF;
  border-color: #A5F3FC;
  color: #0E7490;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mes-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
}

.mes-nav span {
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 800;
  min-width: 76px;
  text-align: center;
}

.mes-nav button {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 800;
}

.mes-nav button:hover {
  background: var(--border);
}

/* ── 3. DYNAMIC MAIN CONTENT & DASHBOARD HEADER ── */
.content {
  padding: 2rem 3rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dh-title-group {
  display: flex;
  flex-direction: column;
}

.dh-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.dh-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1E3A8A 0%, #162858 100%);
  color: #FFFFFF;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(22, 40, 88, 0.2);
  transition: all 0.2s ease;
}

.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(22, 40, 88, 0.28);
}

.btn-primary-action.pf {
  background: linear-gradient(135deg, #0891B2 0%, #06E4D4 100%);
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.2);
}

.btn-primary-action.pf:hover {
  box-shadow: 0 6px 18px rgba(8, 145, 178, 0.28);
}

/* ── 4. 4-CARD KPI GRID ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EFF6FF;
  color: #2563EB;
}

.kpi-badge {
  font-size: 0.675rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-badge.green {
  background: #D1FAE5;
  color: #047857;
}

.kpi-badge.red {
  background: #FEE2E2;
  color: #B91C1C;
}

.kpi-badge.blue {
  background: #DBEAFE;
  color: #1D4ED8;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value.green {
  color: #047857;
}

.kpi-value.red {
  color: #B91C1C;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-sub {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── 5. TRANSACTIONS / LANÇAMENTOS LIST & CARDS ── */
.lanc-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lanc-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
  margin-bottom: 0.65rem;
}

.lanc-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.lanc-type-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 900;
  flex-shrink: 0;
}

.lanc-type-icon.green {
  background: #D1FAE5;
  color: #047857;
}

.lanc-type-icon.red {
  background: #FEE2E2;
  color: #B91C1C;
}

.lanc-type-icon.navy {
  background: #EFF6FF;
  color: #1E3A8A;
}

.lanc-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lanc-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.lanc-desc {
  font-size: 0.925rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.lanc-val {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.val-green { color: #047857; }
.val-red { color: #B91C1C; }
.val-navy { color: #1E3A8A; }

.lanc-meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ltag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.tag-pj { background: #EFF6FF; color: #2563EB; }
.tag-pf { background: #ECFEFF; color: #0891B2; }
.ltag-date { background: #F1F5F9; color: var(--text-muted); }
.ltag-bank { background: #F1F5F9; color: #334155; }
.ltag-pay { background: #EFF6FF; color: #1D4ED8; }
.ltag-prev { background: #FEF3C7; color: #B45309; }
.ltag-parc { background: #EDE9FE; color: #6D28D9; }
.ltag-rec { background: #FCE7F3; color: #BE185D; }

.lanc-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.action-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
  cursor: pointer;
}

.action-btn:hover {
  background: #FFFFFF;
  border-color: var(--border-strong);
  color: var(--text-main);
}

.action-btn.delete:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #B91C1C;
}

/* Section Group Label */
.slabel {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1.5rem 0 0.65rem;
}

.slabel:first-child {
  margin-top: 0;
}

/* ── 6. CHARTS & EXTRATO STYLES ── */
.gcart {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.gcart h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.bc-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.bc-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.bc-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bc-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.bc-val {
  font-weight: 800;
  font-size: 0.9rem;
}

.bc-val.green { color: #16A34A; }
.bc-val.red { color: #DC2626; }
.bc-val.navy { color: #1E3A8A; }
.bc-val.amber { color: #D97706; }

.bc-bar-bg {
  height: 12px;
  background: #F1F5F9;
  border-radius: 6px;
  overflow: hidden;
}

.bc-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.bc-bar-fill.green { background: linear-gradient(90deg, #10B981 0%, #059669 100%); }
.bc-bar-fill.red { background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%); }
.bc-bar-fill.navy { background: linear-gradient(90deg, #2563EB 0%, #1E3A8A 100%); }
.bc-bar-fill.amber { background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%); }

/* GCart Header */
.gcart-header {
  margin-bottom: 1.25rem;
}

.gcart-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.gcart-sub {
  font-size: 0.775rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

/* Empty Chart State */
.empty-chart-state {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
}

.empty-chart-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.empty-chart-title {
  font-size: 0.925rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.empty-chart-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.4;
  display: block;
}

.pizza-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 480px) {
  .pizza-wrap {
    flex-direction: row;
  }
}

.pizza-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pl-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.pl-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pl-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-val {
  font-weight: 800;
}

.pl-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* ── METRICS GRID & CARDS ── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.metric-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.725rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value.green { color: #16A34A; }
.metric-value.red { color: #DC2626; }
.metric-value.neutral { color: #2563EB; }

.metric-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.metric-badge.green { background: #DCFCE7; color: #15803D; }
.metric-badge.red { background: #FEE2E2; color: #B91C1C; }
.metric-badge.neutral { background: #EFF6FF; color: #1D4ED8; }

.metric-sub {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── TOOLBAR / FILTER CARD & BUTTONS ── */
.filter-card {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  background: #FFFFFF;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.25rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 160px;
}

.filter-group.filter-actions {
  flex: 0 0 auto;
  min-width: auto;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.filter-input, .filter-select {
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: #F8FAFC;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
}

.filter-input:focus, .filter-select:focus {
  border-color: #2563EB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-clear-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 42px;
  padding: 0 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-filter:hover {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FCA5A5;
}

.export-btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #F1F5F9;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.export-btn-modern:hover {
  background: #E2E8F0;
  color: #0F172A;
  transform: translateY(-1px);
}

/* ── 7. BOTTOM NAV & MOBILE RESPONSIVENESS (< 1024px & < 768px) ── */
.bottom-nav {
  display: none;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 180;
  pointer-events: none;
}

@media (max-width: 1023px) {
  .sidebar {
    left: -280px;
    width: 280px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .sidebar.open {
    left: 0;
    z-index: 210; /* acima da bottom-nav (200), senão ela cobre o botão Sair no rodapé do menu */
  }

  .mobile-overlay.active {
    display: block;
    pointer-events: auto;
  }

  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  .topbar {
    padding: 0 1rem;
    pointer-events: auto;
  }

  .hamburger-btn {
    display: flex;
    cursor: pointer;
    pointer-events: auto;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
  }

  .content {
    padding: 1.25rem 1rem 5rem;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    z-index: 200;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.05);
    pointer-events: auto;
  }

  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
  }

  .bnav-item * {
    pointer-events: none;
  }

  .bnav-item:active {
    transform: scale(0.95);
  }

  .bnav-item.active {
    color: #1D4ED8;
  }

  .bnav-item.active svg {
    stroke: #1D4ED8;
  }

  .fab {
    bottom: 74px;
    z-index: 210;
    pointer-events: auto;
    cursor: pointer;
  }
}

@media (min-width: 1024px) {
  .fab {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .filter-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filter-group {
    width: 100%;
    min-width: 0;
  }

  .btn-clear-filter {
    width: 100%;
    justify-content: center;
  }

  .export-btn-modern {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .dh-title {
    font-size: 1.25rem;
  }

  .btn-primary-action {
    width: 100%;
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .kpi-card {
    padding: 1rem;
  }

  .kpi-value {
    font-size: 1.2rem;
  }

  /* ── Mobile Transaction Cards: Valor posicionado embaixo do Nome ── */
  .lanc-card {
    padding: 0.875rem 1rem;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .lanc-type-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-top: 2px;
  }

  .lanc-content {
    flex: 1;
    min-width: 0;
    gap: 0.2rem;
  }

  .lanc-header-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    width: 100%;
    min-width: 0;
  }

  .lanc-desc {
    width: 100%;
    max-width: 100%;
    font-size: 0.925rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.35;
  }

  .lanc-val {
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.25;
    text-align: left;
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
  }

  .lanc-meta-row {
    margin-top: 0.2rem;
    gap: 0.35rem;
    width: 100%;
  }

  .lanc-actions {
    align-self: flex-start;
    margin-top: 2px;
    gap: 0.35rem;
  }

  .action-btn {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 420px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 8. ACCOUNT SWITCH OVERLAY & ACTIVE BADGE ── */
.sc-active-badge {
  font-size: 0.625rem;
  font-weight: 900;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: auto;
  letter-spacing: 0.04em;
}

.sc-active-badge.pj {
  background: #DBEAFE;
  color: #1D4ED8;
}

.sc-active-badge.pf {
  background: #CFFAFE;
  color: #0E7490;
}

.account-switch-overlay {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 350;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.account-switch-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.switch-loader-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.5rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: scaleUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #E2E8F0;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.switch-loader-text {
  font-size: 0.925rem;
  font-weight: 700;
  color: #0F172A;
}

/* ── 9. CUSTOM LOGOUT CONFIRMATION MODAL ── */
.logout-modal {
  max-width: 400px;
  text-align: center;
  padding: 2rem 1.75rem 1.75rem !important;
  border-radius: 20px !important;
  animation: scaleUp 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22) !important;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.logout-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FEE2E2;
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.logout-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 0.5rem;
}

.logout-desc {
  font-size: 0.875rem;
  color: #64748B;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.logout-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.btn-logout-cancel {
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.15s ease;
  cursor: pointer;
  min-height: 44px;
}

.btn-logout-cancel:hover {
  background: var(--bg-subtle);
  border-color: #CBD5E1;
}

.btn-logout-confirm {
  border: none;
  background: #DC2626;
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  transition: all 0.15s ease;
  cursor: pointer;
  min-height: 44px;
}

.btn-logout-confirm:hover {
  background: #B91C1C;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

/* ==========================================================================
   CUSTOM SINGLE DELETE MODAL & TOAST NOTIFICATION
   ========================================================================== */

.delete-single-modal {
  max-width: 420px;
  width: 90%;
  border-radius: 16px;
  background: #FFFFFF;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--border);
  text-align: center;
  animation: scaleUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.delete-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #FEE2E2;
  color: #DC2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.delete-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 0.5rem;
}

.delete-modal-desc {
  font-size: 0.925rem;
  color: #64748B;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.delete-modal-desc strong {
  color: #0F172A;
  font-weight: 700;
}

.delete-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.btn-delete-cancel {
  border: 1px solid #CBD5E1;
  background: #F1F5F9;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-delete-cancel:hover {
  background: #E2E8F0;
  color: #334155;
}

.btn-delete-confirm {
  border: none;
  background: #DC2626;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}

.btn-delete-confirm:hover {
  background: #B91C1C;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  z-index: 2000;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}
/* ── PERCENTUAIS DA PF (cards de teto por grupo) ── */
.pct-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.pct-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.pct-name {
  font-size: 14px;
  font-weight: 800;
  flex: 1;
}

.pct-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.pct-nums {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.pct-bar-bg {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.pct-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.pct-itens {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ── FILTROS POR BANCO (botões .ff) E CABEÇALHO DO DIA NO EXTRATO ──
   Recuperados do CSS antigo (foram apagados no commit e12bd1b). */
.filtros-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.ff {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--card);
  cursor: pointer;
}

.ff.fpj {
  background: linear-gradient(to right, #162858 0%, #0C1838 100%);
  border-color: #0C1838;
  color: #FFF;
}

.ff.fpf {
  background: linear-gradient(to right, #06B6D4 0%, #0891B2 100%);
  border-color: #0891B2;
  color: #FFF;
}

.ff.fgr {
  background: var(--text-main);
  border-color: var(--text-main);
  color: #FFF;
}

.dia-group {
  margin-bottom: 16px;
}

.dia-header {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dia-saldo {
  margin-left: auto;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
}

.dia-saldo.pos {
  background: var(--green-bg);
  color: var(--green-text);
}

.dia-saldo.neg {
  background: var(--danger-bg);
  color: var(--danger-text);
}
