/* ===== ROOT THEMES & TOKENS ===== */
:root {
  --bg: #020617;
  --card: rgba(15, 23, 42, 0.9);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --danger: #ef4444;
  --border: rgba(148, 163, 184, 0.4);
}

/* LIGHT THEME */
.light {
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #dbe3f0;
}

/* NEON THEME */
.neon {
  --bg: #020617;
  --card: rgba(15, 23, 42, 0.95);
  --text: #e0f2fe;
  --primary: #22d3ee;
  --muted: #7dd3fc;
  --border: rgba(56, 189, 248, 0.4);
}

/* ===== GLOBAL LAYOUT ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1e293b, var(--bg));
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

.app {
  width: min(1120px, 94%);
  margin: 32px auto 56px;
  display: grid;
  gap: 18px;
}

.layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.05fr 1fr;
}

.column {
  display: grid;
  gap: 18px;
}

/* ===== CARD & HERO ===== */
.card {
  background: var(--card);
  backdrop-filter: blur(22px);
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.8);
}

.hero {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 60px rgba(37, 99, 235, 0.7);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 3.1vw, 40px);
  font-weight: 700;
}

.subtext {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.9;
}

.section h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

/* ===== ROWS & GRID ===== */
.row,
.grid {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.row-select {
  grid-template-columns: 130px 1fr auto;
}

.row-end {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.row label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* ===== INPUTS & SELECTS ===== */
input,
select {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.light input,
.light select {
  background: #ffffff;
}

input::placeholder {
  color: var(--muted);
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
}

/* ===== BUTTONS ===== */
button {
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #f9fafb;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.5);
  filter: brightness(1.05);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button.danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

/* ===== LISTS & CHIPS ===== */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.list li {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.list li:hover {
  background: rgba(30, 64, 175, 0.4);
  transform: translateY(-1px);
  border-color: rgba(129, 140, 248, 0.9);
}

.light .list li {
  background: #f8fafc;
  border-color: #dbe3f0;
}

.light .list li:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

#expenseList li span:first-child {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chip {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: var(--muted);
  background: rgba(15, 23, 42, 0.85);
}

.light .chip {
  background: #ffffff;
  border-color: #cbd5e1;
}

.positive {
  color: #22c55e;
  font-weight: 700;
}

.negative {
  color: #ef4444;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

/* ===== CUSTOM SPLIT ===== */
.custom-split-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
}

.custom-split-row label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.hidden {
  display: none;
}

/* ===== MESSAGE / STATUS ===== */
.message {
  margin: 0;
  min-height: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.status-card {
  padding: 12px 16px;
}

/* ===== THEME SWITCHER ===== */
.theme-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.theme-switch button {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.6);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app {
    width: min(100%, 96%);
    margin-top: 64px;
  }

  .row,
  .row-select,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .row-end {
    justify-content: stretch;
  }

  .row-end button {
    width: 100%;
  }

  .custom-split-row {
    grid-template-columns: 1fr;
  }
}