/* ═══════════════════════════════════════════
   MoneyMate — style.css
   Premium Dark Finance UI
═══════════════════════════════════════════ */

/* ── THEME VARIABLES ── */
:root {
  --bg: #080c14;
  --bg2: #0d1220;
  --surface: #111827;
  --surface2: #161f30;
  --surface3: #1a2540;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --teal: #00e5c0;
  --teal-dim: rgba(0,229,192,0.12);
  --teal-glow: rgba(0,229,192,0.25);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251,191,36,0.12);
  --purple: #a78bfa;
  --purple-dim: rgba(167,139,250,0.12);
  --green: #34d399;
  --green-dim: rgba(52,211,153,0.12);
  --red: #fb7185;
  --red-dim: rgba(251,113,133,0.12);
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #475569;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0,0,0,0.5);
  --font-display: 'Prompt', sans-serif;
  --font-body: 'IBM Plex Sans Thai', sans-serif;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
  --bg: #f0f4f8;
  --bg2: #e8edf5;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --surface3: #e2e8f0;
  --border: rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.12);
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ── PARTICLES ── */
#particleCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════
   AUTH PAGE
═══════════════════════════════════════════ */
#loginPage {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

#loginPage::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(0,229,192,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 70% 70%, rgba(167,139,250,0.06) 0%, transparent 70%);
}

.auth-card {
  position: relative;
  width: 440px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 28px;
  padding: 48px 44px 40px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,229,192,0.08);
  animation: authIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

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

/* Logo */
.auth-logo { text-align: center; margin-bottom: 32px; }

.logo-ring {
  width: 72px; height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--teal), #00b8a0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 12px 32px var(--teal-glow);
  position: relative;
}

.logo-ring::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 25px;
  background: linear-gradient(135deg, var(--teal), transparent, var(--purple));
  z-index: -1;
  opacity: 0.5;
}

.logo-icon {
  font-size: 32px;
  color: #000;
  font-family: var(--font-display);
  font-weight: 700;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
}

.brand-name span { color: var(--teal); }

.brand-sub {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* Tabs */
.auth-tabs {
  position: relative;
  display: flex;
  background: var(--surface2);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 2px;
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--transition);
}

.auth-tab.active { color: #000; }

.tab-indicator {
  position: absolute;
  top: 4px; left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: linear-gradient(135deg, var(--teal), #00b8a0);
  border-radius: 10px;
  transition: transform var(--transition);
  box-shadow: 0 4px 12px var(--teal-glow);
}

.tab-indicator.right { transform: translateX(calc(100% + 2px)); }

/* Fields */
.field-group { margin-bottom: 18px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.field-wrap { position: relative; }

.field-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,229,192,0.12);
}

.field-input::placeholder { color: var(--text3); }

.toggle-pass {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 16px;
  opacity: 0.5; transition: opacity 0.2s;
}

.toggle-pass:hover { opacity: 1; }

/* Auth Button */
.btn-auth {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--teal), #00b8a0);
  border: none;
  border-radius: 14px;
  color: #000;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  margin-top: 6px;
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--teal-glow);
}

.btn-arrow { transition: transform var(--transition); }
.btn-auth:hover .btn-arrow { transform: translateX(4px); }

.error-msg {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 6px;
  text-align: center;
}

.demo-hint {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.demo-hint code {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 2px 8px;
  color: var(--teal);
  font-size: 12px;
}

.demo-fill {
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 3px 10px;
  color: var(--teal);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.demo-fill:hover { background: var(--teal-dim); }

/* ═══════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 68px;
  background: rgba(8,12,20,0.8);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
}

[data-theme="light"] .navbar { background: rgba(240,244,248,0.85); }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--teal), #00b8a0);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  color: #000;
  box-shadow: 0 4px 12px var(--teal-glow);
}

.nav-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.nav-title span { color: var(--teal); }

.nav-center { flex: 1; display: flex; justify-content: center; }

.month-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.month-nav {
  background: none; border: none;
  color: var(--text2); cursor: pointer;
  font-size: 18px; line-height: 1;
  transition: color 0.2s;
  padding: 0 2px;
}

.month-nav:hover { color: var(--teal); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-icon-btn {
  width: 36px; height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.nav-icon-btn:hover {
  border-color: var(--teal);
  background: var(--teal-dim);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px 5px 6px;
  font-size: 13px;
  color: var(--text);
}

.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.btn-logout {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text2);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ═══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

/* ── STATS ROW ── */
.stats-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: default;
}

.stat-card:hover { transform: translateY(-3px); border-color: var(--border2); }

.card-balance { border-left: 3px solid var(--teal); }
.card-income  { border-left: 3px solid var(--green); }
.card-expense { border-left: 3px solid var(--red); }
.card-saving  { border-left: 3px solid var(--yellow); }

.stat-glow {
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.stat-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  font-size: 28px;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  transition: color 0.3s;
}

.stat-value.green { color: var(--green); }
.stat-value.red   { color: var(--red); }
.stat-value.yellow { color: var(--yellow); }

.stat-bar-wrap {
  height: 3px;
  background: var(--surface3);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #00b8a0);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.stat-trend {
  position: absolute;
  top: 18px; right: 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  padding: 3px 8px;
  border-radius: 8px;
}

.stat-trend.red { color: var(--red); background: var(--red-dim); }

/* Saving Ring */
.saving-ring-wrap {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
}

.saving-ring {
  width: 44px; height: 44px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--surface3);
  stroke-width: 3;
}

.ring-fill {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

/* ── BUDGET SECTION ── */
.budget-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
}

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

.budget-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.budget-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.budget-used {
  font-size: 13px;
  color: var(--text2);
}

.btn-set-budget {
  padding: 5px 14px;
  background: var(--teal-dim);
  border: 1px solid rgba(0,229,192,0.25);
  border-radius: 8px;
  color: var(--teal);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-set-budget:hover { background: var(--teal); color: #000; }

.budget-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.budget-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden;
}

.budget-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--yellow));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.budget-bar-fill.over { background: linear-gradient(90deg, var(--yellow), var(--red)); }

.budget-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  min-width: 36px;
  text-align: right;
}

/* ── CONTENT GRID ── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ── PANEL ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.full-panel { margin-bottom: 0; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

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

.title-dot.teal   { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.title-dot.yellow { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.title-dot.purple { background: var(--purple); box-shadow: 0 0 8px var(--purple); }

.tx-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  background: var(--surface2);
  border-radius: 8px;
  padding: 2px 8px;
}

.ai-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid rgba(0,229,192,0.2);
  border-radius: 8px;
  padding: 3px 10px;
  letter-spacing: 0.5px;
}

.hint-text {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 14px;
  line-height: 1.6;
}

/* Quick Chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  padding: 6px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-dim);
}

/* AI Textarea */
.ai-textarea-wrap {
  position: relative;
  margin-bottom: 14px;
}

.ai-textarea {
  width: 100%;
  min-height: 90px;
  padding: 14px 14px 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.ai-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,229,192,0.1);
}

.ai-textarea::placeholder { color: var(--text3); }

.textarea-footer {
  position: absolute;
  bottom: 10px; left: 12px; right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count { font-size: 11px; color: var(--text3); }

.btn-send {
  padding: 7px 16px;
  background: linear-gradient(135deg, var(--teal), #00b8a0);
  border: none;
  border-radius: 10px;
  color: #000;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-send:hover { transform: scale(1.03); box-shadow: 0 6px 16px var(--teal-glow); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Loading */
.ai-loading {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--teal);
}

.pulse-dots {
  display: flex;
  gap: 4px;
}

.pulse-dots span {
  width: 7px; height: 7px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

.pulse-dots span:nth-child(2) { animation-delay: 0.2s; }
.pulse-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { transform: scale(0.6); opacity: 0.3; }
  50%       { transform: scale(1); opacity: 1; }
}

/* AI Result */
.ai-result-box {
  display: none;
  background: var(--surface2);
  border: 1px solid rgba(0,229,192,0.2);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  animation: fadeSlideUp 0.3s ease;
}

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

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

.result-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
}

.result-close {
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  font-size: 14px; transition: color 0.2s;
}

.result-close:hover { color: var(--red); }

.result-items { display: flex; flex-direction: column; gap: 8px; }

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  animation: fadeSlideUp 0.2s ease;
}

.result-item.income {
  background: var(--green-dim);
  border: 1px solid rgba(52,211,153,0.2);
}

.result-item.expense {
  background: var(--red-dim);
  border: 1px solid rgba(251,113,133,0.2);
}

.result-name { display: flex; align-items: center; gap: 8px; }

.result-cat {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}

.result-item.income .result-cat { background: rgba(52,211,153,0.2); color: var(--green); }
.result-item.expense .result-cat { background: rgba(251,113,133,0.2); color: var(--red); }

.result-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.result-item.income .result-amount { color: var(--green); }
.result-item.expense .result-amount { color: var(--red); }

.result-summary {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text2);
}

.btn-confirm {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--teal), #00b8a0);
  border: none;
  border-radius: 11px;
  color: #000;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-confirm:hover { opacity: 0.9; transform: translateY(-1px); }

/* AI Tip */
.ai-tip {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(0,229,192,0.05), rgba(167,139,250,0.05));
  border: 1px solid rgba(0,229,192,0.15);
  border-radius: 14px;
  padding: 16px;
  animation: fadeSlideUp 0.4s ease;
}

.tip-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tip-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}

/* ── CHART ── */
.chart-type-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 3px;
}

.ct-tab {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 12px;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.ct-tab.active { background: var(--surface3); color: var(--text); }

.chart-wrap {
  position: relative;
  height: 200px;
  margin-bottom: 16px;
}

.chart-center-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

/* Top Categories */
.top-cats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.cat-icon { font-size: 16px; width: 20px; text-align: center; }
.cat-name { flex: 1; color: var(--text); }
.cat-bar-wrap { flex: 2; height: 5px; background: var(--surface3); border-radius: 3px; overflow: hidden; }
.cat-bar-inner { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.cat-amount { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text2); min-width: 60px; text-align: right; }

/* ── TRANSACTIONS ── */
.tx-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
}

.search-input {
  padding: 8px 12px 8px 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  width: 180px;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--teal); }

.filter-select {
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 16px;
}

.tx-list::-webkit-scrollbar { width: 4px; }
.tx-list::-webkit-scrollbar-track { background: transparent; }
.tx-list::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color 0.2s, transform 0.15s;
  animation: fadeSlideUp 0.25s ease;
}

.tx-item:hover { border-color: var(--border2); transform: translateX(3px); }

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

.tx-emoji.income  { background: var(--green-dim); }
.tx-emoji.expense { background: var(--red-dim); }

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

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

.tx-meta {
  display: flex;
  gap: 10px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text3);
}

.tx-cat-tag {
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}

.tx-cat-tag.income  { background: var(--green-dim); color: var(--green); }
.tx-cat-tag.expense { background: var(--red-dim); color: var(--red); }

.tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.tx-amount {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

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

.btn-delete {
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  font-size: 13px; opacity: 0;
  transition: all 0.2s;
  padding: 2px 4px;
}

.tx-item:hover .btn-delete { opacity: 1; }
.btn-delete:hover { color: var(--red); }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 14px; line-height: 1.7; }

/* ═══════════════════════════════════════════
   MODALS
═══════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 32px;
  width: 380px;
  box-shadow: var(--shadow);
  animation: authIn 0.3s ease;
}

.modal-card.small { width: 320px; }

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

.modal-desc {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-modal-cancel {
  flex: 1;
  padding: 11px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s;
}

.btn-modal-cancel:hover { border-color: var(--border2); }

.btn-modal-ok {
  flex: 1;
  padding: 11px;
  background: linear-gradient(135deg, var(--teal), #00b8a0);
  border: none;
  border-radius: 11px;
  color: #000;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-ok:hover { opacity: 0.9; }

.btn-modal-danger {
  flex: 1;
  padding: 11px;
  background: var(--red);
  border: none;
  border-radius: 11px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-danger:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
#toastContainer {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  cursor: pointer;
  max-width: 320px;
}

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

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--teal); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .auth-card { width: 90%; padding: 32px 24px; }
  .navbar { padding: 0 16px; }
  .nav-center { display: none; }
  .main-content { padding: 16px; }
  .tx-controls { flex-wrap: wrap; }
  .search-input { width: 100%; }
}
