/* ===========================
   CSS VARIABLES & RESET
   =========================== */
:root {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --primary-light: #C8E6C9;
  --secondary: #8BC34A;
  --accent: #FFC107;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --background: #F2F4F6;
  --on-primary: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-hint: #9CA3AF;
  --divider: #E5E7EB;
  --error: #EF4444;
  --success: #10B981;
  --income-color: #10B981;
  --expense-color: #EF4444;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --app-bar-height: 56px;
  --bottom-nav-height: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1A1A2E;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

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

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

svg {
  fill: currentColor;
  flex-shrink: 0;
}

/* ===========================
   APP SHELL
   =========================== */
#app {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--background);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.5);
}

/* ===========================
   APP BAR
   =========================== */
.app-bar {
  height: var(--app-bar-height);
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 0 4px;
  border-bottom: 1px solid var(--divider);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.app-bar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.app-bar-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-primary);
  transition: background var(--transition);
  flex-shrink: 0;
}

.app-bar-btn svg {
  width: 22px;
  height: 22px;
}

.app-bar-btn:active {
  background: rgba(0,0,0,0.08);
}

.app-bar-spacer {
  flex: 1;
}

/* ===========================
   SCREENS
   =========================== */
.screens-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--background);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  will-change: transform, opacity;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  transform: translateX(0);
  opacity: 1;
}

.screen.slide-out-left {
  transform: translateX(-40%);
  opacity: 0;
}

.screen-content {
  padding: 12px 16px 0;
  min-height: 100%;
}

/* ===========================
   BOTTOM NAVIGATION
   =========================== */
.bottom-nav {
  height: var(--bottom-nav-height);
  background: var(--surface);
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--divider);
  position: relative;
  z-index: 100;
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-hint);
  transition: color var(--transition);
  position: relative;
  padding: 8px 4px;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
  transition: width var(--transition);
}

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

.nav-item.active::before {
  width: 32px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s;
}

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

.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1;
}

/* ===========================
   FAB
   =========================== */
.fab {
  position: fixed;
  right: calc(50% - 240px + 16px);
  bottom: calc(var(--bottom-nav-height) + 16px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(76,175,80,0.4), 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: transform var(--transition), box-shadow var(--transition),
              background var(--transition), opacity var(--transition);
}

.fab svg {
  width: 24px;
  height: 24px;
}

.fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(76,175,80,0.4);
}

.fab.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .fab {
    right: 16px;
  }
}

/* ===========================
   CARDS
   =========================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
}

/* ===========================
   BALANCE CARD
   =========================== */
.balance-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(76,175,80,0.35);
  color: white;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.balance-card::after {
  content: '';
  position: absolute;
  bottom: -50px; right: 30px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

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

.balance-label {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

.balance-period {
  font-size: 11px;
  opacity: 0.7;
  background: rgba(255,255,255,0.2);
  padding: 3px 8px;
  border-radius: 12px;
}

.balance-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.balance-row {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
}

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

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

.balance-item.income .balance-item-icon {
  background: rgba(255,255,255,0.25);
}

.balance-item.expense .balance-item-icon {
  background: rgba(239,68,68,0.3);
}

.balance-item-icon svg {
  width: 16px;
  height: 16px;
  color: white;
}

.balance-item-label {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.balance-item-value {
  font-size: 16px;
  font-weight: 700;
  margin-top: 1px;
}

.balance-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.3);
  margin: 0 12px;
}

/* ===========================
   SECTION HEADERS
   =========================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  margin-top: 4px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.section-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition);
}

.section-action:active {
  background: var(--primary-light);
}

/* ===========================
   STATS GRID
   =========================== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ===========================
   CATEGORY BARS
   =========================== */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-bar-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-bar-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.category-bar-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

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

.empty-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  gap: 8px;
  color: var(--text-hint);
}

.empty-chart svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

.empty-chart p {
  font-size: 13px;
  font-weight: 500;
}

/* ===========================
   TRANSACTION LIST ITEMS
   =========================== */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.transaction-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}

.transaction-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.15s;
}

.transaction-item:active::after {
  background: rgba(0,0,0,0.04);
}

.transaction-item:active {
  transform: scale(0.98);
}

.tx-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

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

.tx-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.tx-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.tx-amount {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

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

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

.tx-chevron {
  color: var(--text-hint);
  flex-shrink: 0;
}

.tx-chevron svg {
  width: 16px;
  height: 16px;
}

/* ===========================
   TRANSACTIONS GROUPED
   =========================== */
.transactions-grouped {
  display: flex;
  flex-direction: column;
}

.tx-date-group {
  margin-bottom: 4px;
}

.tx-date-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 4px 6px;
}

/* ===========================
   SEARCH BAR
   =========================== */
.search-container {
  margin-bottom: 10px;
}

.search-bar {
  background: var(--surface);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 44px;
  box-shadow: var(--shadow-sm);
  gap: 8px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-hint);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font);
}

.search-bar input::placeholder {
  color: var(--text-hint);
}

.search-clear {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-hint);
  flex-shrink: 0;
}

.search-clear svg {
  width: 16px;
  height: 16px;
}

/* ===========================
   FILTER CHIPS
   =========================== */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1.5px solid var(--divider);
  transition: all var(--transition);
  height: 32px;
  display: flex;
  align-items: center;
}

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

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

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

.empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.empty-icon svg {
  width: 36px;
  height: 36px;
  color: var(--text-hint);
}

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

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

/* ===========================
   BUTTONS
   =========================== */
.btn-primary {
  background: var(--primary);
  color: white;
  border-radius: var(--radius-xl);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 12px rgba(76,175,80,0.35);
}

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

.btn-submit {
  width: 100%;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-xl);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
  transition: transform var(--transition), opacity var(--transition);
  box-shadow: 0 4px 12px rgba(76,175,80,0.35);
  letter-spacing: 0.2px;
}

.btn-submit:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.btn-outline {
  flex: 1;
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-xl);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--transition);
}

.btn-outline svg {
  width: 18px;
  height: 18px;
}

.btn-outline:active {
  background: var(--primary-light);
}

.btn-danger {
  flex: 1;
  background: transparent;
  border: 1.5px solid var(--error);
  color: var(--error);
  border-radius: var(--radius-xl);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--transition);
}

.btn-danger svg {
  width: 18px;
  height: 18px;
}

.btn-danger:active {
  background: #FEE2E2;
}

/* ===========================
   BOTTOM SHEET
   =========================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}

.overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 400;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--divider);
  border-radius: 2px;
  margin: 12px auto 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.sheet-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--surface-2);
  transition: background var(--transition);
}

.sheet-close svg {
  width: 18px;
  height: 18px;
}

.sheet-close:active {
  background: var(--divider);
}

.sheet-body {
  padding: 8px 20px 32px;
}

/* ===========================
   INPUT FIELDS (Material)
   =========================== */
.input-field {
  position: relative;
  margin-bottom: 20px;
}

.input-field input,
.input-field select {
  width: 100%;
  height: 54px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 18px 14px 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition);
  appearance: none;
}

.input-field select {
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236B7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
}

.input-field input:focus,
.input-field select:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.input-field label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--text-hint);
  pointer-events: none;
  transition: all 0.2s;
  font-weight: 400;
}

.input-field input:not(:placeholder-shown) ~ label,
.input-field input:focus ~ label,
.input-field select:valid ~ label {
  top: 10px;
  transform: none;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.input-field input[type="date"]:not(:placeholder-shown) ~ label,
.input-field input[type="date"] ~ label {
  top: 10px;
  transform: none;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ===========================
   TYPE TOGGLE
   =========================== */
.type-toggle {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
}

.type-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.type-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ===========================
   DIALOG
   =========================== */
.dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  max-width: 320px;
  width: calc(100% - 48px);
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s;
  box-shadow: var(--shadow-lg);
}

.dialog.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: all;
}

.dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #FEE2E2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.dialog-icon svg {
  width: 28px;
  height: 28px;
  color: var(--error);
}

.dialog-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
}

.dialog-message {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

.dialog-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.dialog-btn:active {
  transform: scale(0.96);
}

.dialog-btn.cancel {
  background: var(--surface-2);
  color: var(--text-secondary);
}

.dialog-btn.cancel:active {
  background: var(--divider);
}

.dialog-btn.confirm {
  background: var(--error);
  color: white;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

/* ===========================
   SNACKBAR
   =========================== */
.snackbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bottom-nav-height) + 16px);
  max-width: calc(480px - 32px);
  margin: 0 auto;
  background: #1A1A2E;
  color: white;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 600;
  transform: translateY(120%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: var(--shadow-lg);
}

.snackbar.show {
  transform: translateY(0);
}

/* ===========================
   BUDGET SCREEN
   =========================== */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 16px;
}

.month-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition);
}

.month-btn svg {
  width: 20px;
  height: 20px;
}

.month-btn:active {
  background: var(--divider);
}

.month-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 150px;
  text-align: center;
}

.budget-overview {
  margin-bottom: 16px;
}

.budget-overview-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.budget-overview-item {
  flex: 1;
  text-align: center;
}

.budget-ov-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.budget-ov-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

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

.budget-total-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.budget-total-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.budget-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.budget-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.budget-item-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.budget-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-right: 10px;
  flex-shrink: 0;
}

.budget-item-info {
  flex: 1;
}

.budget-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.budget-item-amounts {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.budget-item-actions {
  display: flex;
  gap: 4px;
}

.budget-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-hint);
  transition: background var(--transition), color var(--transition);
}

.budget-action-btn svg {
  width: 16px;
  height: 16px;
}

.budget-action-btn:active {
  background: var(--surface-2);
}

.budget-progress-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.budget-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.budget-progress-fill.safe { background: var(--primary); }
.budget-progress-fill.warning { background: var(--accent); }
.budget-progress-fill.danger { background: var(--error); }

.budget-item-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.budget-item-pct {
  font-size: 11px;
  font-weight: 600;
}

.budget-item-remaining {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===========================
   REPORTS SCREEN
   =========================== */
.period-tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.period-tab {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.period-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(76,175,80,0.3);
}

.report-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.report-summary-card {
  flex: 1;
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.report-summary-card.income-card {
  background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

.report-summary-card.expense-card {
  background: linear-gradient(135deg, #FEE2E2 0%, #FCA5A5 100%);
}

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

.income-card .report-summary-icon {
  background: rgba(16,185,129,0.2);
  color: var(--income-color);
}

.expense-card .report-summary-icon {
  background: rgba(239,68,68,0.2);
  color: var(--expense-color);
}

.report-summary-icon svg {
  width: 20px;
  height: 20px;
}

.report-summary-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.income-card .report-summary-value { color: var(--income-color); }
.expense-card .report-summary-value { color: var(--expense-color); }

.report-summary-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

.income-card .report-summary-label { color: #065F46; }
.expense-card .report-summary-label { color: #991B1B; }

.chart-card {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  width: 100%;
  gap: 6px;
  height: 120px;
  padding: 8px 0;
}

.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

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

.bar-chart-label {
  font-size: 10px;
  color: var(--text-hint);
  font-weight: 500;
  white-space: nowrap;
}

/* Category Report */
.category-report-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.category-report-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-report-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.category-report-info {
  flex: 1;
}

.category-report-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.category-report-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.category-report-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--expense-color);
}

.category-report-bar-track {
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.category-report-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   DETAIL SCREEN
   =========================== */
.detail-screen-content {
  padding-top: 0 !important;
}

.detail-hero {
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.detail-category-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: var(--shadow-md);
  margin-bottom: 4px;
}

.detail-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
}

.detail-category {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  padding: 5px 14px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.detail-card {
  margin: 0 16px 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
}

.detail-row-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-row-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  max-width: 60%;
}

.detail-divider {
  height: 1px;
  background: var(--divider);
}

.detail-actions {
  display: flex;
  gap: 10px;
  padding: 0 16px 32px;
}

/* ===========================
   SKELETON LOADING
   =========================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--divider) 25%,
    var(--surface-2) 50%,
    var(--divider) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ===========================
   RIPPLE EFFECT
   =========================== */
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ===========================
   SCROLLBAR HIDE
   =========================== */
.screen::-webkit-scrollbar { display: none; }
.screen { scrollbar-width: none; }

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

.animate-in {
  animation: fadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-delay-1 { animation-delay: 0.05s; opacity: 0; }
.anim-delay-2 { animation-delay: 0.1s; opacity: 0; }
.anim-delay-3 { animation-delay: 0.15s; opacity: 0; }
.anim-delay-4 { animation-delay: 0.2s; opacity: 0; }
