/* =============================================
   FINANCEAPP — COMPLETE STYLESHEET
   Dark + vibrant theme, mobile-first
   ============================================= */

:root {
  --bg-primary:     #0f172a;
  --bg-secondary:   #1e293b;
  --bg-tertiary:    #334155;
  --bg-card:        #1e293b;
  --accent-green:   #10b981;
  --accent-green-d: #059669;
  --accent-red:     #ef4444;
  --accent-blue:    #3b82f6;
  --accent-yellow:  #f59e0b;
  --accent-purple:  #8b5cf6;
  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --border:         #334155;
  --shadow:         0 4px 24px rgba(0,0,0,.4);
  --radius:         16px;
  --radius-sm:      10px;
  --nav-h:          72px;
  --header-h:       60px;
  --transition:     0.25s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
  font-family: inherit;
  outline: none;
  border: none;
}

.hidden { display: none !important; }

/* =============================================
   SPLASH SCREEN
   ============================================= */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
}
.splash-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
  animation: fadeInUp .6s ease;
}
.splash-logo {
  width: 90px; height: 90px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #fff;
  box-shadow: 0 8px 32px rgba(16,185,129,.4);
}
.splash-title {
  font-size: 28px; font-weight: 800;
  color: var(--text-primary); letter-spacing: -0.5px;
}
.splash-sub {
  font-size: 14px; color: var(--text-secondary);
}
.splash-loader {
  width: 160px; height: 4px;
  background: var(--bg-tertiary);
  border-radius: 99px; overflow: hidden;
  margin-top: 8px;
}
.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), #0891b2);
  border-radius: 99px;
  animation: loadBar 1.8s ease-in-out forwards;
}
@keyframes loadBar { from { width: 0 } to { width: 100% } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px) }
  to   { opacity: 1; transform: translateY(0) }
}

/* =============================================
   APP CONTAINER
   ============================================= */
.app-container {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

/* =============================================
   HEADER
   ============================================= */
.app-header {
  height: var(--header-h);
  background: var(--bg-secondary);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 100;
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 18px; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 8px; }
.menu-btn, .icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
  transition: background var(--transition);
  position: relative;
}
.menu-btn:active, .icon-btn:active { background: var(--border); }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.badge {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: var(--accent-red);
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}

/* =============================================
   MAIN & PAGES
   ============================================= */
.app-main {
  flex: 1; overflow: hidden;
  position: relative;
}
.page {
  position: absolute; inset: 0;
  overflow-y: auto;
  padding: 16px 16px calc(var(--nav-h) + 16px);
  display: none;
  animation: pageIn .2s ease;
}
.page.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateX(16px) }
  to   { opacity: 1; transform: translateX(0) }
}
/* Scrollbar */
.page::-webkit-scrollbar { width: 0; }

/* =============================================
   BALANCE CARD
   ============================================= */
.balance-card {
  background: linear-gradient(135deg, #0f766e, #0891b2, #1d4ed8);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(8,145,178,.3);
  position: relative; overflow: hidden;
}
.balance-card::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.balance-card::after {
  content: '';
  position: absolute; bottom: -60px; left: -20px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.balance-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.balance-label {
  font-size: 13px; color: rgba(255,255,255,.75); font-weight: 500;
}
.toggle-visibility {
  background: transparent; color: rgba(255,255,255,.75);
  cursor: pointer; font-size: 16px;
  padding: 4px;
}
.balance-amount {
  font-size: 36px; font-weight: 800;
  color: #fff; letter-spacing: -1px;
  margin-bottom: 4px;
  transition: filter var(--transition);
}
.balance-amount.blurred { filter: blur(8px); }
.balance-period { font-size: 12px; color: rgba(255,255,255,.65); margin-bottom: 18px; }
.balance-stats {
  display: flex; align-items: center;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.balance-stat {
  flex: 1; display: flex; align-items: center; gap: 10px;
}
.balance-stat i { font-size: 18px; }
.balance-stat.income i { color: #6ee7b7; }
.balance-stat.expense i { color: #fca5a5; }
.balance-stat div { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; color: rgba(255,255,255,.65); }
.stat-value { font-size: 14px; font-weight: 700; color: #fff; }
.balance-divider {
  width: 1px; height: 36px;
  background: rgba(255,255,255,.2);
  margin: 0 16px;
}

/* =============================================
   SECTION HEADER
   ============================================= */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}
.section-header h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.see-all {
  font-size: 13px; color: var(--accent-green);
  background: transparent; cursor: pointer; font-weight: 600;
}
.add-btn {
  background: var(--accent-green);
  color: #fff; border-radius: 20px;
  padding: 5px 12px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
  cursor: pointer;
}

/* =============================================
   QUICK ACTIONS
   ============================================= */
.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.quick-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 8px;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
  border: 1px solid var(--border);
}
.quick-btn:active { transform: scale(.96); }
.quick-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.quick-btn span { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.income-btn .quick-icon  { background: linear-gradient(135deg, #059669, #10b981); }
.expense-btn .quick-icon { background: linear-gradient(135deg, #dc2626, #ef4444); }
.transfer-btn .quick-icon{ background: linear-gradient(135deg, #2563eb, #3b82f6); }
.report-btn .quick-icon  { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

/* =============================================
   CARD
   ============================================= */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 20px;
}
.chart-card { padding: 12px; }

/* =============================================
   TRANSACTIONS LIST
   ============================================= */
.transactions-list { display: flex; flex-direction: column; gap: 8px; }

/* Wrapper para swipe-to-delete */
.tx-item-wrapper {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.tx-delete-bg {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 80px;
  background: var(--accent-red);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  border-radius: var(--radius-sm);
}
.tx-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  animation: fadeInUp .2s ease;
  position: relative;
  z-index: 1;
}
.tx-item:active { background: var(--bg-tertiary); }

/* Botão excluir rápido visível no card */
.tx-del-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.25);
  color: var(--accent-red);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.tx-del-btn:active {
  background: rgba(239,68,68,.3);
  transform: scale(.92);
}

/* Botão excluir no modal de edição */
.btn-delete-tx {
  width: 100%; margin-top: 12px;
  padding: 13px;
  background: rgba(239,68,68,.08);
  border: 1.5px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition);
}
.btn-delete-tx:active { background: rgba(239,68,68,.18); }
.tx-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.tx-info { flex: 1; min-width: 0; }
.tx-desc { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-cat  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount { font-size: 15px; font-weight: 700; }
.tx-amount.income   { color: var(--accent-green); }
.tx-amount.expense  { color: var(--accent-red); }
.tx-amount.transfer { color: var(--accent-blue); }
.tx-date  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tx-date-separator {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  padding: 8px 0 4px; letter-spacing: .5px;
}

/* =============================================
   TRANSACTIONS PAGE TOOLBAR
   ============================================= */
.page-toolbar {
  display: flex; gap: 10px; margin-bottom: 12px;
}
.search-bar {
  flex: 1; background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
}
.search-bar i { color: var(--text-muted); font-size: 14px; }
.search-bar input {
  flex: 1; background: transparent;
  color: var(--text-primary); font-size: 14px;
  padding: 11px 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
.filter-btn {
  width: 44px; height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px;
}
.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.filter-row {
  display: flex; gap: 8px;
}
.filter-row select,
.filter-row input {
  flex: 1;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}
.clear-filters {
  background: var(--accent-red);
  color: #fff; border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.transactions-summary {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.tx-sum {
  flex: 1; background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.tx-sum span { font-size: 11px; color: var(--text-muted); }
.tx-sum strong { font-size: 14px; font-weight: 700; }
.tx-sum.income strong  { color: var(--accent-green); }
.tx-sum.expense strong { color: var(--accent-red); }
.tx-sum.balance strong { color: var(--accent-blue); }

/* =============================================
   BUDGETS
   ============================================= */
.budgets-list { display: flex; flex-direction: column; gap: 12px; }
.budget-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  animation: fadeInUp .2s ease;
}
.budget-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 8px;
}
.budget-info { display: flex; align-items: center; gap: 10px; }
.budget-icon { font-size: 24px; }
.budget-name { font-size: 15px; font-weight: 600; }
.budget-actions { display: flex; gap: 8px; }
.budget-amount { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.budget-amount span { color: var(--text-primary); font-weight: 600; }
.progress-bar {
  width: 100%; height: 8px;
  background: var(--bg-tertiary);
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  transition: width .5s ease;
}
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
  margin-top: 5px;
}
.budget-overview .budget-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.budget-mini .bm-header {
  display: flex; justify-content: space-between;
  margin-bottom: 6px;
}
.budget-mini .bm-name { font-size: 13px; font-weight: 600; }
.budget-mini .bm-vals { font-size: 12px; color: var(--text-secondary); }
.budget-mini .bm-vals strong { color: var(--text-primary); }

/* =============================================
   GOALS
   ============================================= */
.goals-list { display: flex; flex-direction: column; gap: 12px; }
.goal-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  animation: fadeInUp .2s ease;
}
.goal-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 12px;
}
.goal-info { display: flex; align-items: center; gap: 12px; }
.goal-icon-big { font-size: 32px; }
.goal-name { font-size: 16px; font-weight: 700; }
.goal-deadline { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.goal-amounts {
  display: flex; justify-content: space-between;
  margin-bottom: 10px;
}
.goal-amounts div { text-align: center; }
.goal-amounts .ga-label { font-size: 11px; color: var(--text-muted); }
.goal-amounts .ga-val  { font-size: 14px; font-weight: 700; }
.goal-amounts .ga-val.current { color: var(--accent-blue); }
.goal-amounts .ga-val.target  { color: var(--accent-green); }
.goal-amounts .ga-val.remain  { color: var(--accent-yellow); }
.goal-pct { font-size: 14px; font-weight: 700; color: var(--accent-green); }
.goal-contribute-btn {
  width: 100%; margin-top: 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 10px; padding: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border);
  transition: background var(--transition);
}
.goal-contribute-btn:active { background: var(--border); }

/* =============================================
   REPORTS
   ============================================= */
.report-period-selector {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.period-btn {
  flex: 1; padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.period-btn.active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}
.report-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 20px;
}
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; text-align: center;
}
.report-card i { font-size: 20px; }
.report-card span { font-size: 11px; color: var(--text-muted); }
.report-card strong { font-size: 13px; font-weight: 700; }
.report-card.income i, .report-card.income strong { color: var(--accent-green); }
.report-card.expense i, .report-card.expense strong { color: var(--accent-red); }
.report-card.savings i, .report-card.savings strong { color: var(--accent-blue); }

.category-report { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.cat-report-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.cat-report-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.cat-report-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.cat-report-amt  { font-size: 14px; font-weight: 700; }
.cat-report-pct  { font-size: 12px; color: var(--text-muted); }

/* =============================================
   SETTINGS
   ============================================= */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-size: 14px; font-weight: 700;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: .5px;
}
.settings-item {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 12px;
}
.settings-item label { font-size: 13px; color: var(--text-secondary); }
.settings-item input {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  font-size: 14px;
}
.settings-btn {
  width: 100%; padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
  transition: opacity var(--transition);
}
.settings-btn:active { opacity: .8; }
.export-btn  { background: var(--accent-blue); color: #fff; }
.import-btn  { background: var(--accent-purple); color: #fff; }
.danger-btn  { background: var(--accent-red); color: #fff; }
.install-btn { background: var(--accent-green); color: #fff; }
.install-info { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.5; }
.install-instructions {
  background: var(--bg-tertiary);
  border-radius: 8px; padding: 12px;
  margin-top: 8px;
}
.install-instructions p { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; line-height: 1.6; }
.categories-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.cat-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.cat-chip .cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.add-category-btn {
  width: 100%; padding: 10px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.accounts-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.account-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.acc-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.acc-info { flex: 1; }
.acc-name { font-size: 14px; font-weight: 600; }
.acc-type { font-size: 12px; color: var(--text-secondary); }
.acc-balance { font-size: 15px; font-weight: 700; color: var(--accent-green); }
.app-version {
  text-align: center; padding: 20px;
  font-size: 12px; color: var(--text-muted); line-height: 2;
}

/* =============================================
   BOTTOM NAV
   ============================================= */
.bottom-nav {
  height: var(--nav-h);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  flex-shrink: 0; position: relative; z-index: 100;
}
.nav-item {
  flex: 1; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
  background: transparent; color: var(--text-muted);
  font-size: 10px; font-weight: 600;
  transition: color var(--transition);
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--accent-green); }
.nav-item span { font-size: 10px; }
.fab-center {
  position: relative; overflow: visible;
}
.fab-btn {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  box-shadow: 0 4px 16px rgba(16,185,129,.5);
  position: relative; bottom: 10px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.fab-center:active .fab-btn {
  transform: scale(.93);
  box-shadow: 0 2px 8px rgba(16,185,129,.4);
}

/* =============================================
   SIDE DRAWER
   ============================================= */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.visible { opacity: 1; pointer-events: all; }
.side-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; background: var(--bg-secondary);
  z-index: 501;
  transform: translateX(-100%);
  transition: transform var(--transition);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.side-drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; gap: 14px;
  padding: 48px 20px 20px;
  background: linear-gradient(135deg, #0f766e22, #0891b222);
  border-bottom: 1px solid var(--border);
}
.drawer-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.drawer-user-info { flex: 1; min-width: 0; }
.drawer-user-info strong { font-size: 16px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-user-info span { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.drawer-balance {
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-tertiary);
  margin: 16px 12px 8px;
  border-radius: 10px;
}
.drawer-balance span { font-size: 13px; color: var(--text-secondary); }
.drawer-balance strong { font-size: 16px; font-weight: 700; color: var(--accent-green); }
.drawer-menu { list-style: none; padding: 8px 0; }
.drawer-menu li {
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background var(--transition);
}
.drawer-menu li:active { background: var(--bg-tertiary); }
.drawer-menu li i { width: 20px; color: var(--accent-green); }

/* =============================================
   BOTTOM SHEET (MODALS)
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 800;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }

.bottom-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg-secondary);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 32px;
  z-index: 900;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  max-height: 92vh; overflow-y: auto;
}
.bottom-sheet.open { transform: translateY(0); }
.bottom-sheet::-webkit-scrollbar { width: 0; }
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 99px; margin: 0 auto 16px;
}
.sheet-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* Tx type tabs */
.tx-type-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.type-tab {
  flex: 1; padding: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--transition);
}
.type-tab.active[data-type="expense"] { background: #7f1d1d; border-color: var(--accent-red); color: var(--accent-red); }
.type-tab.active[data-type="income"]  { background: #064e3b; border-color: var(--accent-green); color: var(--accent-green); }
.type-tab.active[data-type="transfer"]{ background: #1e3a5f; border-color: var(--accent-blue); color: var(--accent-blue); }

/* Amount input */
.amount-input-group {
  display: flex; align-items: center;
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px;
  margin-bottom: 16px;
  transition: border-color var(--transition);
}
.amount-input-group:focus-within { border-color: var(--accent-green); }
.currency-prefix { font-size: 20px; font-weight: 700; color: var(--text-muted); margin-right: 8px; }
.amount-input {
  flex: 1; background: transparent;
  color: var(--text-primary);
  font-size: 28px; font-weight: 800;
  padding: 14px 0; letter-spacing: -1px;
}
.amount-input::placeholder { color: var(--bg-tertiary); }

/* Form group */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent-green); }
.form-group select option { background: var(--bg-secondary); }
.form-group textarea { height: 72px; resize: none; }

/* Category picker */
.category-picker {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cat-pick-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 60px;
}
.cat-pick-item .cat-pick-icon { font-size: 22px; }
.cat-pick-item .cat-pick-name { font-size: 10px; font-weight: 600; color: var(--text-secondary); text-align: center; }
.cat-pick-item.selected { border-color: var(--accent-green); background: #064e3b; }

/* Icon / Color pickers */
.icon-picker, .color-picker {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.icon-opt {
  font-size: 24px; cursor: pointer;
  padding: 6px; border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}
.icon-opt.selected { border-color: var(--accent-green); background: #064e3b22; }
.color-opt {
  width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer;
  border: 3px solid transparent;
  transition: transform var(--transition);
}
.color-opt.selected { border-color: #fff; transform: scale(1.1); }

/* Sheet actions */
.sheet-actions {
  display: flex; gap: 10px; margin-top: 20px;
}
.btn-cancel {
  flex: 1; padding: 14px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.btn-save {
  flex: 2; padding: 14px;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16,185,129,.4);
}
.btn-danger {
  flex: 1; padding: 12px 20px;
  background: var(--accent-red);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
}

/* =============================================
   CONFIRM DIALOG
   ============================================= */
.confirm-dialog {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.85);
  width: min(90vw, 320px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 20px;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: all .25s ease;
  text-align: center;
}
.confirm-dialog.visible {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
.confirm-icon { font-size: 40px; color: var(--accent-yellow); margin-bottom: 12px; }
.confirm-dialog h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-dialog p  { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1e293b;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 13px; font-weight: 600;
  z-index: 2000;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: all .3s ease;
  max-width: 80vw;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: #064e3b; border-color: var(--accent-green); color: var(--accent-green); }
.toast.error   { background: #7f1d1d; border-color: var(--accent-red);   color: var(--accent-red); }
.toast.info    { background: #1e3a5f; border-color: var(--accent-blue);  color: var(--accent-blue); }

/* =============================================
   EMPTY STATES
   ============================================= */
.empty-text { color: var(--text-muted); font-size: 14px; text-align: center; padding: 16px 0; }
.empty-state {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state i { font-size: 48px; color: var(--text-muted); }
.empty-state p { font-size: 15px; color: var(--text-secondary); }
.empty-state button {
  background: var(--accent-green); color: #fff;
  border-radius: 99px; padding: 10px 24px;
  font-size: 14px; font-weight: 700; cursor: pointer;
}

/* =============================================
   SMALL UTILITY BUTTONS
   ============================================= */
.icon-action-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px;
}

/* =============================================
   DESKTOP RESPONSIVE CONTAINER
   ============================================= */
@media (min-width: 480px) {
  .app-container {
    max-width: 430px;
    left: 50%; right: auto;
    transform: translateX(-50%);
    box-shadow: 0 0 80px rgba(0,0,0,.7);
  }
  .drawer-overlay,
  .modal-overlay { background: rgba(0,0,0,.7); }
  .toast { bottom: calc(var(--nav-h) + 20px); }
}

/* =============================================
   AUTH SCREEN
   ============================================= */
.auth-screen {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  display: flex; flex-direction: column;
  align-items: center;
  padding: 0 24px 32px;
  overflow-y: auto;
  z-index: 600;
}
.auth-screen::-webkit-scrollbar { width: 0; }

.auth-bg-decoration {
  position: absolute; top: -80px; right: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(16,185,129,.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-header {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  padding-top: 64px; margin-bottom: 32px;
  position: relative;
}
.auth-logo {
  width: 76px; height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff;
  box-shadow: 0 8px 28px rgba(16,185,129,.4);
  margin-bottom: 4px;
}
.auth-header h1 { font-size: 26px; font-weight: 800; }
.auth-header p  { font-size: 14px; color: var(--text-secondary); }

.auth-tabs {
  display: flex; width: 100%; max-width: 360px;
  background: var(--bg-secondary);
  border-radius: var(--radius); padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 10px;
  border-radius: 12px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16,185,129,.4);
}

.auth-form {
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 0;
}

.auth-field {
  margin-bottom: 14px;
}
.auth-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px; letter-spacing: .4px;
}
.auth-field label i { margin-right: 5px; color: var(--accent-green); }
.auth-field input {
  width: 100%;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  transition: border-color var(--transition);
}
.auth-field input:focus { border-color: var(--accent-green); }

.pwd-wrapper {
  position: relative;
}
.pwd-wrapper input { padding-right: 48px; }
.pwd-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--text-muted);
  font-size: 16px; cursor: pointer;
  padding: 4px;
}

.auth-error {
  font-size: 13px; color: var(--accent-red);
  background: rgba(239,68,68,.1);
  border-radius: 8px;
  padding: 0; max-height: 0; overflow: hidden;
  transition: all .2s ease;
  margin-bottom: 0;
}
.auth-error.visible {
  padding: 10px 14px;
  max-height: 60px;
  margin-bottom: 12px;
}

.auth-btn {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  color: #fff; border-radius: 14px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(16,185,129,.4);
  margin-bottom: 16px;
  transition: opacity var(--transition);
}
.auth-btn:active { opacity: .85; }

.auth-switch {
  text-align: center; font-size: 13px;
  color: var(--text-secondary);
}
.auth-switch a {
  color: var(--accent-green); font-weight: 700; cursor: pointer;
}
.auth-hint {
  text-align: center; font-size: 12px;
  color: var(--text-muted);
  margin-top: -4px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* =============================================
   PROFILE MODAL
   ============================================= */
.profile-modal-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.profile-big-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.profile-email { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.profile-section {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 14px 10px;
  margin-bottom: 12px;
}
.profile-section h4 {
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 7px;
  text-transform: uppercase; letter-spacing: .4px;
}
.profile-section h4 i { color: var(--accent-green); }

.profile-save-btn {
  width: 100%; margin-top: 10px;
  padding: 10px;
  background: var(--accent-green);
  color: #fff; border-radius: 10px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}

.profile-logout-btn {
  width: 100%; padding: 14px;
  background: rgba(239,68,68,.1);
  border: 1.5px solid rgba(239,68,68,.3);
  color: var(--accent-red);
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* =============================================
   SETTINGS USER CARD
   ============================================= */
.settings-user-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #0f766e22, #0891b222);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.settings-user-card:active { background: var(--bg-tertiary); }
.suc-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.suc-info { flex: 1; }
.suc-info strong { display: block; font-size: 16px; font-weight: 700; }
.suc-info span   { font-size: 12px; color: var(--text-secondary); }

/* =============================================
   DRAWER extras
   ============================================= */
.drawer-logout {
  color: var(--accent-red) !important;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 14px !important;
}
.drawer-logout i { color: var(--accent-red) !important; }
.drawer-user-badge {
  padding: 8px 20px 20px;
  font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* =============================================
   CATEGORY MODAL — tab divisor label
   ============================================= */
.cat-section-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 4px 0 6px;
  display: flex; align-items: center; gap: 6px;
}
.cat-section-label::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--border);
}
.cat-chip.custom {
  border-style: dashed;
}
.cat-chip .cat-delete {
  color: var(--accent-red);
  font-size: 11px; margin-left: 4px;
  opacity: .7;
}

/* =============================================
   AGENDA PAGE
   ============================================= */

/* Summary cards */
.agenda-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.agenda-sum-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; transition: background var(--transition);
}
.agenda-sum-card:active { background: var(--bg-tertiary); }
.agenda-sum-card i { font-size: 22px; flex-shrink: 0; }
.agenda-sum-card div { display: flex; flex-direction: column; }
.agenda-sum-card span  { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.agenda-sum-card strong{ font-size: 18px; font-weight: 800; line-height: 1; }
.agenda-sum-card small  { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.agenda-sum-card.pending i, .agenda-sum-card.pending strong { color: var(--accent-blue); }
.agenda-sum-card.overdue i, .agenda-sum-card.overdue strong { color: var(--accent-red); }
.agenda-sum-card.soon    i, .agenda-sum-card.soon    strong { color: var(--accent-yellow); }

/* Tabs */
.agenda-tabs {
  display: flex; gap: 6px; margin-bottom: 12px;
  align-items: center;
}
.agenda-tab-btn {
  flex: 1; padding: 10px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: all var(--transition);
}
.agenda-tab-btn.active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}
.agenda-add-btn {
  flex-shrink: 0;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap;
}

/* Filters */
.agenda-filters {
  display: flex; gap: 6px; margin-bottom: 14px;
  overflow-x: auto; padding-bottom: 2px;
}
.agenda-filters::-webkit-scrollbar { height: 0; }
.agenda-filter-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.agenda-filter-btn.active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: #fff;
}

/* Scheduled card */
.sched-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  animation: fadeInUp .2s ease;
  transition: border-color var(--transition);
}
.sched-card.is-overdue { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.04); }
.sched-card.is-soon    { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.04); }
.sched-card.is-paid    { opacity: .65; }

.sched-card-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.sched-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.sched-info { flex: 1; min-width: 0; }
.sched-desc { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sched-right { text-align: right; flex-shrink: 0; }
.sched-amount { font-size: 15px; font-weight: 800; }
.sched-due    { font-size: 11px; color: var(--text-secondary); margin: 2px 0; }

/* Status badges */
.sched-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
  margin-top: 2px;
}
.sched-badge.pending   { background: rgba(59,130,246,.15);  color: var(--accent-blue); }
.sched-badge.overdue   { background: rgba(239,68,68,.15);   color: var(--accent-red); }
.sched-badge.soon      { background: rgba(245,158,11,.15);  color: var(--accent-yellow); }
.sched-badge.paid      { background: rgba(16,185,129,.15);  color: var(--accent-green); }
.sched-badge.cancelled { background: rgba(100,116,139,.15); color: var(--text-muted); }

/* Action buttons in card */
.sched-actions {
  display: flex; gap: 6px;
}
.sched-btn {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: opacity var(--transition);
  border: 1px solid transparent;
}
.sched-btn:active { opacity: .75; }
.sched-btn.pay-btn  { flex: 1; background: rgba(16,185,129,.15);  color: var(--accent-green); border-color: rgba(16,185,129,.3); }
.sched-btn.edit-btn { background: rgba(59,130,246,.12);  color: var(--accent-blue);  border-color: rgba(59,130,246,.3); }
.sched-btn.del-btn  { background: rgba(239,68,68,.1);    color: var(--accent-red);   border-color: rgba(239,68,68,.25); }

/* Installment card */
.installment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  animation: fadeInUp .2s ease;
}
.installment-card.is-overdue { border-color: rgba(239,68,68,.5); }
.installment-card.is-soon    { border-color: rgba(245,158,11,.5); }
.inst-header  { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.inst-parcela { font-size: 11px; color: var(--accent-purple); font-weight: 700; }
.inst-progress-row {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 6px;
}
.inst-next    { font-weight: 700; }
.overdue-txt  { color: var(--accent-red); }
.soon-txt     { color: var(--accent-yellow); }

/* Parcelas detail rows */
.parcela-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--bg-tertiary);
  border-radius: 10px;
  border-left: 3px solid var(--border);
}
.parcela-num   { font-size: 12px; font-weight: 700; flex: 1.5; }
.parcela-date  { font-size: 12px; font-weight: 600; flex: 1.5; }
.parcela-amt   { font-size: 13px; font-weight: 700; flex: 1.5; text-align: right; }
.parcela-pay-btn {
  background: var(--accent-green); color: #fff;
  border-radius: 8px; padding: 5px 10px;
  font-size: 11px; font-weight: 700; cursor: pointer;
  flex-shrink: 0;
}
.parcela-status-label { font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* Installment modal helpers */
.inst-amount-row { display: flex; gap: 10px; }
.inst-preview {
  font-size: 16px; font-weight: 800;
  text-align: center; margin: -8px 0 14px;
  letter-spacing: -0.5px;
}

/* =============================================
   DASHBOARD upcoming widget
   ============================================= */
.dash-upcoming { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.dash-upcoming-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: background var(--transition);
}
.dash-upcoming-item:active { background: var(--bg-tertiary); }
.due-icon  { font-size: 22px; flex-shrink: 0; }
.due-info  { flex: 1; min-width: 0; }
.due-desc  { font-size: 13px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-meta  { font-size: 11px; color: var(--text-muted); }
.due-amt   { font-size: 13px; font-weight: 800; flex-shrink: 0; }

/* =============================================
   NAV BADGE (agenda bottom nav)
   ============================================= */
.nav-item { position: relative; }
.nav-badge {
  position: absolute; top: 6px; right: calc(50% - 18px);
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent-red);
  border-radius: 99px;
  font-size: 9px; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* Drawer badge */
.drawer-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-red); color: #fff;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; font-size: 10px; font-weight: 800;
  margin-left: 6px;
}

/* =============================================
   NOTIFY SETTINGS ROW
   ============================================= */
.notify-days-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.notify-days-row input {
  width: 70px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px; font-weight: 700;
  text-align: center;
}
.notify-days-row span { font-size: 14px; color: var(--text-secondary); }

/* =============================================
   ADDITIONAL IMPROVEMENTS
   ============================================= */

/* Melhor foco nos inputs */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-green) !important;
  box-shadow: 0 0 0 2px rgba(16,185,129,.15);
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* Badge de status nas contas */
.acc-type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Card de agenda com animação de entrada */
.sched-card, .installment-card {
  animation: slideInCard .25s ease backwards;
}
@keyframes slideInCard {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Botão de pagamento pulsando quando há vencidos */
.sched-btn.pay-btn.urgent {
  animation: pulseGreen 1.5s infinite;
}
@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

/* Total de contas no settings */
.accounts-total {
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.accounts-total-label {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  font-weight: 600;
}
.accounts-total-value {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

/* Indicador de dia restante no card de parcelas */
.days-remaining-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: 4px;
}
.days-remaining-chip.overdue  { background: rgba(239,68,68,.15);  color: var(--accent-red); }
.days-remaining-chip.soon     { background: rgba(245,158,11,.15); color: var(--accent-yellow); }
.days-remaining-chip.ok       { background: rgba(16,185,129,.15); color: var(--accent-green); }

/* Stat cards no topo da agenda */
.agenda-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.agenda-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}
.agenda-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}
.agenda-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Swipe handle melhorado */
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--bg-tertiary);
  border-radius: 99px;
  margin: 0 auto 16px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .2s;
}
.sheet-handle:hover { background: var(--text-muted); }

/* Formulários com espaçamento aprimorado */
.bottom-sheet .form-group + .form-group { margin-top: 2px; }

/* Placeholder style */
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  font-size: 14px;
}

/* Bordas arredondadas nos selects */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
}

/* Loading spinner para async operations */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.7);
  display: flex; align-items: center; justify-content: center;
  border-radius: inherit;
  z-index: 10;
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Chips das contas aprimorados */
.account-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: border-color var(--transition);
}
.account-item:active { border-color: var(--accent-green); }
.acc-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.acc-info { flex: 1; }
.acc-name { font-size: 14px; font-weight: 700; }
.acc-type { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.acc-balance { font-size: 14px; font-weight: 800; color: var(--accent-green); }

/* Melhorias nas seções das configurações */
.settings-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-section h3 i {
  width: 28px; height: 28px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--accent-green);
}

/* Pill buttons no topo dos filtros da agenda */
.agenda-filter-btn {
  white-space: nowrap;
}

/* Rodapé do drawer */
.drawer-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Destaque de linha ativa no relatório por categoria */
.cat-report-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}
.cat-report-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 8px;
}
.cat-report-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
}
.cat-report-amt { font-size: 14px; font-weight: 800; }
.cat-report-pct { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Botão excluir transação com feedback visual */
.tx-del-btn {
  width: 34px; height: 34px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  color: var(--accent-red);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  opacity: 0;
  transition: opacity .2s;
  font-size: 13px;
}
.tx-item-wrapper:hover .tx-del-btn,
.tx-item-wrapper:active .tx-del-btn {
  opacity: 1;
}
/* Em mobile sempre visível */
@media (pointer: coarse) {
  .tx-del-btn { opacity: 0.7; }
}

/* Estilos do mapa de calor de gastos (future feature placeholder) */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin: 12px 0;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg-tertiary);
}
.heatmap-cell.low    { background: rgba(16,185,129,.2); }
.heatmap-cell.medium { background: rgba(16,185,129,.5); }
.heatmap-cell.high   { background: rgba(16,185,129,.9); }

/* Botão flutuante de ação rápida */
.fab-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-green), #0891b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  box-shadow: 0 4px 20px rgba(16,185,129,.5);
  transition: transform .15s ease, box-shadow .15s ease;
}
.nav-item.fab-center:active .fab-btn {
  transform: scale(0.92);
  box-shadow: 0 2px 12px rgba(16,185,129,.4);
}
