/* ===========================
   Budget Blossom - Style.css
   =========================== */

:root {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --primary-light: #E8F5E9;
  --secondary: #8BC34A;
  --accent: #CDDC39;
  --accent-dark: #AFB42B;
  --surface: #FFFFFF;
  --bg: #F5F7F5;
  --bg2: #EEFBEF;
  --on-surface: #1B1B1B;
  --on-surface-2: #555;
  --on-surface-3: #999;
  --border: #E0E0E0;
  --income-color: #2E7D32;
  --income-bg: #E8F5E9;
  --expense-color: #C62828;
  --expense-bg: #FFEBEE;
  --warning: #F57F17;
  --warning-bg: #FFF8E1;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --nav-height: 64px;
  --appbar-height: 56px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #111;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 430px;
  height: 100%;
  max-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

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

.app-bar-leading, .app-bar-actions {
  display: flex;
  align-items: center;
  min-width: 40px;
}

.app-bar-actions { justify-content: flex-end; }

.app-bar-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
}

/* ===== SCREEN CONTAINER ===== */
.screen-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 1;
  transition: opacity var(--transition), transform var(--transition);
}

.screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 12px 16px 0;
  scrollbar-width: none;
}

.screen-scroll::-webkit-scrollbar { display: none; }

.bottom-spacer { height: 24px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  height: var(--nav-height);
  background: var(--surface);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  padding: 8px 4px;
}

.nav-tab:active { background: var(--primary-light); }

.nav-icon {
  font-size: 22px;
  color: var(--on-surface-3);
  transition: color var(--transition), transform var(--transition);
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--on-surface-3);
  transition: color var(--transition);
}

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

.nav-tab.active .nav-icon { color: var(--primary); transform: translateY(-1px); }
.nav-tab.active .nav-label { color: var(--primary); font-weight: 600; }
.nav-tab.active .nav-indicator { width: 32px; }

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

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

.hero-card::after {
  content: '';
  position: absolute;
  bottom: -20px; left: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.hero-label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.hero-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 10px 0;
}

.hero-stat {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-value {
  font-size: 15px;
  font-weight: 700;
}

.hero-stat-label {
  font-size: 10px;
  opacity: 0.8;
  font-weight: 500;
}

.hero-stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.25);
}

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

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
}

.section-action {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

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

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--on-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.quick-action-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-icon .material-icons-round { font-size: 22px; }

/* ===== BUDGET CARDS ===== */
.budget-list, .dash-budget-list { display: flex; flex-direction: column; gap: 10px; }

.budget-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-left: 4px solid var(--primary);
}

.budget-card:active { transform: scale(0.98); box-shadow: var(--shadow-md); }

.budget-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.budget-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  flex: 1;
  margin-right: 8px;
}

.budget-card-amount {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}

.budget-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
}

.badge.active { background: var(--income-bg); color: var(--income-color); }
.badge.upcoming { background: var(--warning-bg); color: var(--warning); }
.badge.expired { background: #F5F5F5; color: var(--on-surface-3); }
.badge.category { background: var(--primary-light); color: var(--primary-dark); }

.progress-container {
  margin-top: 6px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--on-surface-3);
  margin-bottom: 5px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--primary);
  transition: width 0.6s ease;
}

.progress-fill.warn { background: var(--warning); }
.progress-fill.over { background: var(--expense-color); }

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

.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 12px;
  padding: 0 12px;
  height: 44px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  transition: border-color var(--transition);
}

.search-bar:focus-within { border-color: var(--primary); }

.search-icon { color: var(--on-surface-3); font-size: 20px; margin-right: 8px; }

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: none;
  color: var(--on-surface);
  font-family: inherit;
}

.search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--on-surface-3);
  display: flex;
  align-items: center;
}

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

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

.chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
  color: var(--on-surface-2);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}

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

/* ===== FAB ===== */
.fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(76,175,80,0.4);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  z-index: 5;
}

.fab:active { transform: scale(0.92); box-shadow: 0 2px 10px rgba(76,175,80,0.3); }
.fab .material-icons-round { font-size: 28px; }

/* ===== TRANSACTION SCREEN ===== */
.tx-summary-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

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

.tx-summary-card.income {
  background: var(--income-bg);
  border-left: 3px solid var(--income-color);
}

.tx-summary-card.income .material-icons-round { color: var(--income-color); }

.tx-summary-card.expense {
  background: var(--expense-bg);
  border-left: 3px solid var(--expense-color);
}

.tx-summary-card.expense .material-icons-round { color: var(--expense-color); }

.tx-summary-label {
  font-size: 11px;
  color: var(--on-surface-3);
  font-weight: 500;
}

.tx-summary-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
}

/* Segmented Control */
.seg-control {
  display: flex;
  background: var(--surface);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.seg-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: none;
  color: var(--on-surface-3);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

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

/* Transaction List */
.transaction-list { display: flex; flex-direction: column; gap: 8px; }

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

.tx-date-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0 4px;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition);
}

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

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

.tx-icon.income { background: var(--income-bg); }
.tx-icon.expense { background: var(--expense-bg); }

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

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

.tx-meta {
  font-size: 11px;
  color: var(--on-surface-3);
  margin-top: 2px;
}

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

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

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

.period-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: none;
  color: var(--on-surface-3);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

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

.report-balance-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.report-balance-label {
  font-size: 12px;
  color: var(--on-surface-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.report-balance-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 14px;
}

.report-balance-bar {
  height: 8px;
  background: var(--expense-bg);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 10px;
}

.report-balance-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 100px;
  transition: width 0.6s ease;
}

.report-balance-row {
  display: flex;
  justify-content: space-between;
}

.report-balance-sub {
  font-size: 12px;
  color: var(--on-surface-3);
}

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

.report-progress-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

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

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

.report-progress-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
}

.report-progress-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Chart Card */
.chart-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--on-surface-2);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.top-expenses-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.top-expense-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.top-expense-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.top-expense-info { flex: 1; }

.top-expense-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
}

.top-expense-date {
  font-size: 11px;
  color: var(--on-surface-3);
}

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

/* ===== CATEGORY LIST (dashboard) ===== */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

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

.category-info { flex: 1; }

.category-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  text-transform: capitalize;
}

.category-count {
  font-size: 11px;
  color: var(--on-surface-3);
}

.category-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

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

.empty-state.hidden { display: none; }

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--on-surface-3);
  margin-bottom: 20px;
  max-width: 240px;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 24px;
  border-radius: 100px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(76,175,80,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.btn-primary:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(76,175,80,0.3); }
.btn-primary.full-width { width: 100%; margin-top: 8px; }
.btn-primary .material-icons-round { font-size: 18px; }

.btn-outline {
  padding: 10px 24px;
  border-radius: 100px;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--on-surface-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
}

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

.btn-danger {
  padding: 10px 24px;
  border-radius: 100px;
  background: var(--expense-color);
  color: white;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  font-family: inherit;
}

.btn-danger:active { opacity: 0.8; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--on-surface);
  transition: background var(--transition);
}

.icon-btn:active { background: var(--bg); }
.icon-btn.danger { color: var(--expense-color); }
.icon-btn .material-icons-round { font-size: 22px; }

/* ===== OVERLAY & SHEETS ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 50;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}

.overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.bottom-sheet {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  z-index: 51;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.bottom-sheet.hidden { display: none; }

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to { transform: translateX(-50%) translateY(0); }
}

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

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--on-surface);
}

.sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-surface-2);
}

.sheet-close .material-icons-round { font-size: 18px; }

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

/* ===== FORMS ===== */
.input-group {
  margin-bottom: 16px;
  position: relative;
}

.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--on-surface-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.required { color: var(--expense-color); }

.input-field {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--on-surface);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  -webkit-appearance: none;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
  background: var(--surface);
}

.input-field.error { border-color: var(--expense-color); }

.input-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-prefix-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
  background: var(--surface);
}

.input-prefix {
  padding: 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-surface-3);
  background: var(--border);
  height: 48px;
  display: flex;
  align-items: center;
}

.input-field.with-prefix {
  border: none;
  box-shadow: none;
  background: transparent;
  flex: 1;
}

.input-field.with-prefix:focus {
  border: none;
  box-shadow: none;
}

.select-wrap {
  position: relative;
}

.select-field {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-3);
  pointer-events: none;
  font-size: 20px;
}

.input-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }

.input-error {
  display: block;
  font-size: 12px;
  color: var(--expense-color);
  margin-top: 4px;
  min-height: 16px;
}

/* ===== TYPE TOGGLE ===== */
.type-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-3);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.type-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.type-btn .material-icons-round { font-size: 18px; }

/* ===== DETAIL MODAL ===== */
.detail-modal {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 51;
  display: flex;
  flex-direction: column;
  max-width: 430px;
  left: 50%;
  transform: translateX(-50%);
  animation: slideInRight 0.25s ease;
  overflow: hidden;
}

.detail-modal.hidden { display: none; }

@keyframes slideInRight {
  from { transform: translateX(calc(-50% + 40px)); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}

.detail-header {
  display: flex;
  align-items: center;
  height: var(--appbar-height);
  padding: 0 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: var(--on-surface);
  text-align: center;
  padding: 0 8px;
}

.detail-header-actions {
  display: flex;
  gap: 0;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Detail cards */
.detail-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-xl);
  padding: 20px;
  color: white;
  margin-bottom: 16px;
  text-align: center;
}

.detail-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.detail-name {
  font-size: 16px;
  font-weight: 500;
  opacity: 0.9;
}

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

.detail-info-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

.detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--bg);
}

.detail-info-row:last-child { border-bottom: none; }

.detail-info-key {
  font-size: 13px;
  color: var(--on-surface-3);
}

.detail-info-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
}

.detail-tx-list { display: flex; flex-direction: column; gap: 8px; }

/* ===== DIALOG ===== */
.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 64px);
  max-width: 320px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  z-index: 52;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dialog.hidden { display: none; }

@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.dialog-icon { font-size: 44px; margin-bottom: 12px; }
.dialog-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.dialog-message { font-size: 14px; color: var(--on-surface-3); margin-bottom: 20px; }

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

/* ===== SNACKBAR ===== */
.snackbar {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: white;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  animation: snackIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: calc(100% - 48px);
}

.snackbar.hidden { display: none; }

@keyframes snackIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.snackbar.out {
  animation: snackOut 0.25s ease forwards;
}

@keyframes snackOut {
  to { transform: translateX(-50%) translateY(20px); opacity: 0; }
}

/* ===== MISC ===== */
.hidden { display: none !important; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

/* Date input */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

/* Scrollbar thin */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
