/* ===========================
   CSS VARIABLES & RESET
   =========================== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --bg-input: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-light: rgba(255,255,255,0.12);

  --text-primary: #f0f0f5;
  --text-secondary: #9090a8;
  --text-muted: #5a5a72;

  --accent: #7c3aed;
  --accent-light: #9b5cf6;
  --accent-dark: #6d28d9;
  --accent-glow: rgba(124,58,237,0.3);

  --income: #10b981;
  --income-bg: rgba(16,185,129,0.12);
  --income-border: rgba(16,185,129,0.25);
  --expense: #ef4444;
  --expense-bg: rgba(239,68,68,0.12);
  --expense-border: rgba(239,68,68,0.25);

  --blue: #3b82f6;
  --orange: #f59e0b;
  --pink: #ec4899;
  --teal: #14b8a6;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);

  --nav-height: 72px;
  --header-height: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);
  --spring: 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* Light mode */
[data-theme="light"] {
  --bg-primary: #f0f0f7;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255,255,255,0.8);
  --bg-card-hover: rgba(255,255,255,0.95);
  --bg-input: rgba(0,0,0,0.04);
  --border: rgba(0,0,0,0.08);
  --border-light: rgba(0,0,0,0.12);
  --text-primary: #0a0a1a;
  --text-secondary: #4a4a5a;
  --text-muted: #9090a8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.16);
}

/* ===========================
   RESET
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  height: -webkit-fill-available;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
  -webkit-appearance: none;
}

input, textarea, select {
  font-family: var(--font);
  border: none;
  outline: none;
  -webkit-appearance: none;
}

canvas { display: block; }

/* ===========================
   SPLASH SCREEN
   =========================== */
.splash {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 9999;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash.hiding {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-logo {
  animation: splashPulse 1.5s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.splash-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.splash-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.splash-bar {
  width: 120px;
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.splash-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 99px;
  animation: splashLoad 1.2s ease-out forwards;
}

@keyframes splashLoad {
  to { width: 100%; }
}

/* ===========================
   APP SHELL
   =========================== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: -webkit-fill-available;
  overflow: hidden;
}

.app.hidden { display: none; }

/* ===========================
   HEADER
   =========================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 20px 12px;
  background: var(--bg-primary);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.header-greeting {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1;
}

.header-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition), transform var(--transition);
}

.icon-btn:active { transform: scale(0.9); }

.icon-btn-primary {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background var(--transition), transform var(--transition);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.icon-btn-primary:active { transform: scale(0.9); }

/* ===========================
   MAIN SCROLLABLE AREA
   =========================== */
.app-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ===========================
   PAGES
   =========================== */
.page {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 0;
  scroll-behavior: smooth;
}

/* Flex variant: sticky header + scrollable body */
.page.page-flex {
  display: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  flex-direction: column;
  padding: 0;
}

.page.page-flex.active {
  display: flex;
  animation: pageIn 0.25s ease-out;
}

.page-sticky-header {
  flex-shrink: 0;
  padding: 8px 16px 0;
  background: var(--bg-primary);
  z-index: 10;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.page-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 0;
}

.page.active {
  display: block;
  animation: pageIn 0.25s ease-out;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   BOTTOM NAV
   =========================== */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 8px calc(var(--safe-bottom) + 8px);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

[data-theme="light"] .bottom-nav {
  background: rgba(255,255,255,0.92);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition), transform var(--transition);
  flex: 1;
  max-width: 72px;
  position: relative;
}

.nav-item span {
  font-size: 10px;
  font-weight: 500;
}

.nav-item.active {
  color: var(--accent-light);
}

.nav-item:active { transform: scale(0.88); }

.nav-add-btn {
  width: 52px;
  height: 52px;
  max-width: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: white !important;
  box-shadow: 0 4px 16px var(--accent-glow);
  margin-top: -16px;
  flex: 0;
}

.nav-add-btn:active { transform: scale(0.9) translateY(0) !important; }

/* ===========================
   GLASS CARD
   =========================== */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition);
}

/* ===========================
   BALANCE CARD
   =========================== */
.balance-card {
  padding: 24px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(37,99,235,0.15));
  border: 1px solid rgba(124,58,237,0.25);
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%);
  pointer-events: none;
}

.balance-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.balance-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.visibility-btn {
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.balance-value {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 2px;
  transition: filter 0.3s ease;
}

.balance-value.blurred {
  filter: blur(12px);
  user-select: none;
}

.balance-period {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.balance-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-income .stat-icon {
  background: var(--income-bg);
  border: 1px solid var(--income-border);
  color: var(--income);
}

.stat-expense .stat-icon {
  background: var(--expense-bg);
  border: 1px solid var(--expense-border);
  color: var(--expense);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ===========================
   SECTION HEADERS
   =========================== */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.section-link {
  font-size: 16px;
  color: var(--accent-light);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.section-link:active {
  background: var(--accent-glow);
}

.section-month {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

/* ===========================
   QUICK ACTIONS
   =========================== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--spring);
}

.quick-action-btn:active { transform: scale(0.93); }

.qa-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-btn span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.qa-income .qa-icon {
  background: var(--income-bg);
  border: 1px solid var(--income-border);
  color: var(--income);
}

.qa-expense .qa-icon {
  background: var(--expense-bg);
  border: 1px solid var(--expense-border);
  color: var(--expense);
}

.qa-transfer .qa-icon {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  color: var(--blue);
}

.qa-category .qa-icon {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  color: var(--orange);
}

/* ===========================
   CHART CARD
   =========================== */
.chart-card {
  padding: 16px;
  margin-bottom: 4px;
}

/* ===========================
   CATEGORY SUMMARY
   =========================== */
.category-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.cat-summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}

.cat-summary-icon {
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cat-summary-info {
  flex: 1;
  min-width: 0;
}

.cat-summary-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.cat-summary-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin-top: 4px;
  overflow: hidden;
}

.cat-summary-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

.cat-summary-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--expense);
  text-align: right;
  flex-shrink: 0;
}

.cat-summary-pct {
  font-size: 11px;
  color: var(--text-muted);
}

.empty-state-small {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px;
}

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

.tx-group-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 4px 4px;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 1;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  animation: fadeIn 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tx-item:active { transform: scale(0.98); background: var(--bg-card-hover); }

.tx-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tx-item-info {
  flex: 1;
  min-width: 0;
}

.tx-item-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-item-amount {
  font-size: 15px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.tx-item-amount.income { color: var(--income); }
.tx-item-amount.expense { color: var(--expense); }

/* Swipe delete indicator */
.tx-item-actions {
  position: absolute;
  right: 14px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ===========================
   EMPTY STATE
   =========================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 4px;
  filter: grayscale(0.4);
}

.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 240px;
  line-height: 1.5;
}

/* ===========================
   PAGE TOP BAR
   =========================== */
.page-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 12px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

/* ===========================
   FILTER BAR
   =========================== */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-chips {
  display: flex;
  gap: 8px;
}

.chip {
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.chip:active { transform: scale(0.95); }

.filter-search {
  position: relative;
}

.search-input {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px 0 38px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }

.filter-search::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

/* ===========================
   MONTH NAV
   =========================== */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 12px;
}

.month-nav-btn {
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  min-width: 60px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-size: 22px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  cursor: pointer;
}

.month-nav-btn:active, .month-nav-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.month-nav-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  flex: 1;
}

/* ===========================
   TX SUMMARY BAR
   =========================== */
.tx-summary-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.tx-sum-item {
  flex: 1;
  text-align: center;
}

.tx-sum-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.tx-sum-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.tx-sum-sep {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.income-color { color: var(--income) !important; }
.expense-color { color: var(--expense) !important; }

/* ===========================
   REPORTS
   =========================== */
.report-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.report-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.rc-income {
  background: var(--income-bg);
  border-color: var(--income-border);
}

.rc-expense {
  background: var(--expense-bg);
  border-color: var(--expense-border);
}

.rc-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rc-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.rc-delta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.report-card-full {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 4px;
}

.rc-value-big {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin: 4px 0 10px;
}

.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--income), var(--teal));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.rc-save-rate {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Category Breakdown */
.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.cat-breakdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cat-breakdown-icon {
  font-size: 18px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cat-breakdown-info {
  flex: 1;
  min-width: 0;
}

.cat-breakdown-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.cat-breakdown-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.cat-breakdown-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.cat-breakdown-right {
  text-align: right;
  flex-shrink: 0;
}

.cat-breakdown-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--expense);
}

.cat-breakdown-pct {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===========================
   PROFILE
   =========================== */
.profile-header-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.profile-info { flex: 1; }

.profile-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.profile-since {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stats-grid-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stats-label {
  font-size: 11px;
  color: var(--text-muted);
}

.settings-section {
  margin-bottom: 20px;
}

.settings-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 4px;
}

.settings-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  width: 100%;
  text-align: left;
}

.settings-item:last-child { border-bottom: none; }
.settings-item:active { background: var(--bg-card-hover); }

.settings-item-icon {
  font-size: 18px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.settings-item-info { flex: 1; min-width: 0; }

.settings-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.settings-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--accent-light);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
  width: 100%;
  transition: background var(--transition);
}

.settings-add-btn:active { background: var(--bg-card-hover); }

.danger-zone .settings-heading { color: var(--expense); }
.danger-item .settings-item-title { color: var(--expense); }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-light);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Category item in settings */
.cat-settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.cat-settings-item:last-child { border-bottom: none; }

.cat-settings-icon {
  font-size: 18px;
  width: 32px;
  text-align: center;
}

.cat-settings-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.cat-settings-actions {
  display: flex;
  gap: 6px;
}

.cat-settings-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: background var(--transition);
}

.cat-settings-btn.delete { color: var(--expense); }

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 380px) {
  .balance-value { font-size: 32px; }
  .quick-actions { gap: 7px; }
  .quick-action-btn { padding: 12px 4px; }
  .qa-icon { width: 36px; height: 36px; }
}

/* ===========================
   SALARY DASHBOARD CARD
   =========================== */
.salary-dashboard-card {
  padding: 18px;
  margin-bottom: 16px;
  border-radius: var(--radius);
}

.sdc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sdc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sdc-month {
  font-size: 12px;
  color: var(--text-muted);
}

.sdc-balance {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 14px;
}

.sdc-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.sdc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sdc-label {
  font-size: 13px;
  color: var(--text-muted);
}

.sdc-val {
  font-size: 13px;
  font-weight: 600;
}

.sdc-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.sdc-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease, background 0.3s;
}

.sdc-pct {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}
