/* ═══════════════════════════════════════════════════════════════
   CashFlow Tracker — style.css
   Aesthetic: Dark fintech / Bloomberg-inspired
   Fonts: Space Mono (data/mono) + DM Sans (UI copy)
═══════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ───────────────────────────────────────────── */
:root {
  /* Palette */
  --bg-base:        #0b0e14;
  --bg-surface:     #121720;
  --bg-elevated:    #1a2030;
  --bg-hover:       #1f2840;

  --border:         #1e2a3a;
  --border-accent:  #2a3a52;

  --text-primary:   #e8edf5;
  --text-secondary: #7a8ba0;
  --text-muted:     #4a5568;

  --amber:          #f5a623;
  --amber-dim:      #c8831a;
  --amber-glow:     rgba(245, 166, 35, 0.12);

  --green:          #29d98f;
  --green-dim:      rgba(41, 217, 143, 0.12);

  --red:            #f05252;
  --red-dim:        rgba(240, 82, 82, 0.12);

  --blue:           #3b82f6;
  --blue-dim:       rgba(59, 130, 246, 0.12);

  /* Typography */
  --font-mono:  'Space Mono', 'Courier New', monospace;
  --font-ui:    'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --gap-xs:  4px;
  --gap-sm:  8px;
  --gap-md:  16px;
  --gap-lg:  24px;
  --gap-xl:  32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 180ms var(--ease);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  /* Subtle grid texture */
  background-image:
    linear-gradient(rgba(30, 42, 58, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 42, 58, 0.3) 1px, transparent 1px);
  background-size: 40px 40px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-accent); border-radius: 4px; }

/* ── HEADER ──────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  display: flex;
  top: 0;
  z-index: 100;
  background: rgba(11, 14, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gap-lg);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  text-decoration: none;
}

.brand-icon {
  font-size: 22px;
  color: var(--amber);
  line-height: 1;
}

.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-glow);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.1em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
}

/* ── CURRENCY SELECT ─────────────────────────────────────────── */
.currency-wrap {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.currency-select {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a8ba0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}

.currency-select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-glow);
}

.currency-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--amber);
  color: #0b0e14;
}
.btn-primary:hover:not(:disabled) {
  background: #f0c060;
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-accent {
  background: var(--green);
  color: #0b0e14;
}
.btn-accent:hover:not(:disabled) {
  background: #40e8a4;
  box-shadow: 0 4px 16px rgba(41, 217, 143, 0.3);
  transform: translateY(-1px);
}
.btn-accent:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-accent);
}
.btn-outline:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--amber);
  background: var(--amber-glow);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ── MAIN LAYOUT ─────────────────────────────────────────────── */
.app-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--gap-xl) var(--gap-lg);
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: var(--gap-xl);
  align-items: start;
}

@media (max-width: 900px) {
  .app-main {
    grid-template-columns: 1fr;
    padding: var(--gap-lg) var(--gap-md);
    gap: var(--gap-lg);
  }
}

/* ── PANEL ───────────────────────────────────────────────────── */
.panel {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-accent);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--gap-md);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-md);
}

/* ── SALARY CARD ─────────────────────────────────────────────── */
.salary-card {
  border-top: 2px solid var(--amber);
}

.salary-input-row {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.salary-input-row:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.input-prefix {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--amber);
  font-weight: 700;
  flex-shrink: 0;
}

.salary-field {
  border: none !important;
  background: transparent !important;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 100%;
  padding: 8px 0;
  outline: none;
}

/* ── INPUT FIELDS ────────────────────────────────────────────── */
.input-field {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.input-field:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

/* Remove number spinners */
.input-field[type="number"]::-webkit-inner-spin-button,
.input-field[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.input-field[type="number"] { -moz-appearance: textfield; }

/* ── EXPENSE FORM ────────────────────────────────────────────── */
.expense-form-card {
  border-top: 2px solid var(--green);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.amount-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding-left: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.amount-input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim);
}

.amount-input-wrap .input-prefix {
  color: var(--green);
  font-size: 0.9rem;
}

.amount-input-wrap .input-field {
  background: transparent;
  border: none;
  border-radius: 0;
  padding-left: var(--gap-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.amount-input-wrap .input-field:focus {
  box-shadow: none;
}

.form-error {
  font-size: 0.8rem;
  color: var(--red);
  min-height: 20px;
  text-align: center;
  transition: opacity var(--transition);
}

/* ── EXPENSE LIST ────────────────────────────────────────────── */
.expense-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.expense-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

/* ── EXPENSE ITEM ────────────────────────────────────────────── */
.expense-item {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  animation: slideIn 220ms var(--ease) both;
  transition: border-color var(--transition), background var(--transition);
}

.expense-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scaleY(1); }
  to   { opacity: 0; transform: scaleY(0.8); max-height: 0; padding: 0; margin: 0; }
}

.expense-item.removing {
  animation: fadeOut 200ms var(--ease) forwards;
}

.expense-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.expense-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-amount {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
}

.btn-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.btn-delete:hover {
  color: var(--red);
  background: var(--red-dim);
}

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--gap-xl) var(--gap-md);
  color: var(--text-muted);
}

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

.empty-icon {
  font-size: 2rem;
  margin-bottom: var(--gap-md);
  opacity: 0.4;
}

.empty-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 0.8rem;
}

/* ── STATS GRID ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap-md);
}

@media (max-width: 700px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-md) var(--gap-lg);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover { transform: translateY(-2px); }

.stat-salary  { border-top: 2px solid var(--amber); }
.stat-salary::before { background: linear-gradient(135deg, var(--amber-glow), transparent 60%); }
.stat-salary:hover::before { opacity: 1; }

.stat-expenses { border-top: 2px solid var(--red); }
.stat-expenses::before { background: linear-gradient(135deg, var(--red-dim), transparent 60%); }
.stat-expenses:hover::before { opacity: 1; }

.stat-balance { border-top: 2px solid var(--green); }
.stat-balance::before { background: linear-gradient(135deg, var(--green-dim), transparent 60%); }
.stat-balance:hover::before { opacity: 1; }

/* Alert state for balance */
.stat-balance.danger { border-top-color: var(--red); }
.stat-balance.danger::before { background: linear-gradient(135deg, var(--red-dim), transparent 60%); }

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--gap-sm);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color var(--transition);
  word-break: break-all;
}

.stat-value.danger { color: var(--red) !important; }
.stat-value.positive { color: var(--green); }

.stat-raw {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-percent {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Expense bar */
.stat-bar-wrap {
  margin-top: var(--gap-sm);
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  width: 0%;
  transition: width 600ms var(--ease);
}

/* ── BUDGET ALERT ────────────────────────────────────────────── */
.budget-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-md);
  background: var(--red-dim);
  border: 1px solid rgba(240, 82, 82, 0.3);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
  animation: slideIn 300ms var(--ease);
}

.budget-alert[hidden] { display: none; }

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  color: var(--red);
  margin-top: 1px;
}

.alert-content strong {
  display: block;
  font-size: 0.85rem;
  color: var(--red);
  margin-bottom: 2px;
}

.alert-content p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── CHART CARD ──────────────────────────────────────────────── */
.chart-card {
  border-top: 2px solid var(--blue);
}

.chart-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
}



.chart-wrap canvas {
  padding: 10px;
  width: 100% !important;
  height: auto !important;
  max-width: 400px;   /* optional limit */
  max-height: 400px;  /* optional limit */
  display: block;
}

.chart-placeholder {
  position: absolute;
  text-align: center;
  color: var(--text-muted);
}

.chart-placeholder.hidden { display: none; }

.placeholder-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--gap-sm);
  opacity: 0.3;
  animation: spin 4s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.chart-placeholder p {
  font-size: 0.8rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  justify-content: center;
  margin-top: var(--gap-md);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
}

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

/* ── TOAST ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--gap-lg);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms var(--ease), transform 250ms var(--ease);
  z-index: 999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red);   }
.toast.info    { border-color: var(--amber);  color: var(--amber); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVENESS EXTENSIONS (NON-DESTRUCTIVE)
   Paste at the END of your CSS
═══════════════════════════════════════════════════════════════ */

/* ── LARGE TABLETS (1024px ↓) ───────────────────────────────── */
@media (max-width: 1024px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: var(--gap-md);
  }

  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── TABLETS (768px ↓) ─────────────────────────────────────── */
@media (max-width: 768px) {
  .app-main {
    padding: var(--gap-md);
  }

  .card {
    padding: var(--gap-md);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrap canvas {
    max-width: 220px;
    max-height: 220px;
  }

  .brand-name {
    font-size: 1rem;
  }
}

/* ── MOBILE (480px ↓) ──────────────────────────────────────── */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .header-inner {
    gap: var(--gap-sm);
  }

  .brand-tag {
    display: none;
  }

  .currency-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .currency-select {
    width: 100%;
  }

  .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .salary-field {
    font-size: 1.2rem;
  }

  .expense-item {
    flex-wrap: wrap;
    gap: 4px;
  }

  .expense-name {
    width: 100%;
  }

  .expense-amount {
    font-size: 0.8rem;
  }

  .chart-wrap canvas {
    max-width: 180px;
    max-height: 180px;
  }

  .toast {
    width: 90%;
    text-align: center;
  }
}

/* ── EXTRA SMALL DEVICES (360px ↓) ─────────────────────────── */
@media (max-width: 360px) {
  .btn {
    padding: 5px 10px;
  }

  .card {
    padding: var(--gap-sm);
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .chart-wrap canvas {
    max-width: 150px;
    max-height: 150px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   PREMIUM LIGHT MODE — Professional & Polished
═══════════════════════════════════════════════════════════════ */

body.light-mode {
  /* ── Backgrounds ───────────────────────────────────────────── */
  --bg-base:        #f0f4f8;       /* cool-blue tinted page bg   */
  --bg-surface:     #ffffff;       /* crisp white cards           */
  --bg-elevated:    #e8edf3;       /* inputs, inner panels        */
  --bg-hover:       #dde3ec;       /* hover states                */

  /* ── Borders ───────────────────────────────────────────────── */
  --border:         #d1d9e6;       /* defined, not invisible      */
  --border-accent:  #b0bcd0;       /* stronger dividers           */

  /* ── Text ──────────────────────────────────────────────────── */
  --text-primary:   #0d1b2a;       /* near-black, warm neutral    */
  --text-secondary: #3d5166;       /* readable mid tone           */
  --text-muted:     #7a8fa6;       /* deemphasised labels         */

  /* ── Accent colors ─────────────────────────────────────────── */
  --amber:          #c47d00;       /* richer gold, more contrast  */
  --amber-glow:     rgba(196, 125, 0, 0.12);

  --green:          #0a7c52;       /* deep professional green     */
  --green-dim:      rgba(10, 124, 82, 0.12);

  --red:            #c0202f;       /* strong but not harsh red    */
  --red-dim:        rgba(192, 32, 47, 0.12);

  --blue:           #1a56c4;       /* rich corporate blue         */
  --blue-dim:       rgba(26, 86, 196, 0.12);

  /* ── Page background texture ───────────────────────────────── */
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(26, 86, 196, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(10, 124, 82, 0.04) 0%, transparent 60%);
}

/* ── Header ─────────────────────────────────────────────────── */
body.light-mode .app-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.9), 0 2px 8px rgba(13, 27, 42, 0.06);
}

/* ── Cards — layered depth system ──────────────────────────── */
body.light-mode .card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.8) inset,   /* inner highlight  */
    0 2px 4px rgba(13, 27, 42, 0.04),
    0 8px 24px rgba(13, 27, 42, 0.07);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body.light-mode .card:hover {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.9) inset,
    0 4px 8px rgba(13, 27, 42, 0.06),
    0 16px 40px rgba(13, 27, 42, 0.10);
  transform: translateY(-1px);
}

/* ── Stat cards — colored left border accent ────────────────── */
body.light-mode .stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  box-shadow:
    0 2px 4px rgba(13, 27, 42, 0.04),
    0 6px 20px rgba(13, 27, 42, 0.07);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

body.light-mode .stat-card:hover {
  box-shadow:
    0 4px 8px rgba(13, 27, 42, 0.06),
    0 12px 32px rgba(13, 27, 42, 0.10);
  transform: translateY(-1px);
}

/* Individual accent borders per stat type (optional, add your class names) */
body.light-mode .stat-card.stat-income   { border-left-color: var(--green); }
body.light-mode .stat-card.stat-expenses { border-left-color: var(--red);   }
body.light-mode .stat-card.stat-savings  { border-left-color: var(--blue);  }
body.light-mode .stat-card.stat-total    { border-left-color: var(--amber); }

/* ── Inputs & Selects ───────────────────────────────────────── */
body.light-mode input,
body.light-mode select,
body.light-mode textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: inset 0 1px 3px rgba(13, 27, 42, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus {
  border-color: var(--blue);
  box-shadow:
    inset 0 1px 3px rgba(13, 27, 42, 0.04),
    0 0 0 3px var(--blue-dim);
  outline: none;
}

/* ── Buttons ────────────────────────────────────────────────── */
body.light-mode .btn {
  background: var(--blue);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(26, 86, 196, 0.30);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

body.light-mode .btn:hover {
  background: #1648a8;
  box-shadow: 0 4px 12px rgba(26, 86, 196, 0.38);
  transform: translateY(-1px);
}

body.light-mode .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(26, 86, 196, 0.25);
}

body.light-mode .btn-danger {
  background: var(--red);
  box-shadow: 0 2px 6px rgba(192, 32, 47, 0.30);
}
body.light-mode .btn-danger:hover {
  background: #a01828;
  box-shadow: 0 4px 12px rgba(192, 32, 47, 0.38);
}

body.light-mode .btn-ghost,
body.light-mode .btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}
body.light-mode .btn-ghost:hover,
body.light-mode .btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(13, 27, 42, 0.08);
}

/* ── Expense list items ─────────────────────────────────────── */
body.light-mode .expense-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s ease;
}

body.light-mode .expense-item:hover {
  background: var(--bg-hover);
}

/* ── Progress / range bars ──────────────────────────────────── */
body.light-mode .progress-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

body.light-mode .progress-fill {
  background: linear-gradient(90deg, var(--blue) 0%, #4a8aff 100%);
  box-shadow: 0 1px 4px rgba(26, 86, 196, 0.35);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
body.light-mode ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
body.light-mode ::-webkit-scrollbar-track {
  background: var(--bg-base);
}
body.light-mode ::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 10px;
}
body.light-mode ::-webkit-scrollbar-thumb:hover {
  background: #8fa4bc;
}

/* ── Toast notifications ────────────────────────────────────── */
body.light-mode .toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(13, 27, 42, 0.14);
}

/* ── Section headings / labels ──────────────────────────────── */
body.light-mode .section-title,
body.light-mode .card-title {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.01em;
}

body.light-mode .label,
body.light-mode .input-label {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Salary / big number field ──────────────────────────────── */
body.light-mode .salary-field {
  color: var(--text-primary);
  font-weight: 700;
}

/* ── Stat values with color context ────────────────────────── */
body.light-mode .stat-value.positive { color: var(--green); }
body.light-mode .stat-value.negative { color: var(--red);   }
body.light-mode .stat-value.neutral  { color: var(--amber); }
