@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap');

:root {
  --surface-0: #f3ede2;
  --surface-1: #faf6ee;
  --surface-2: #ffffff;
  --text-primary: #2b2620;
  --text-secondary: rgba(43,38,32,0.55);
  --text-muted: rgba(43,38,32,0.30);
  --border-default: rgba(43,38,32,0.08);
  --border-mid: rgba(43,38,32,0.14);
  --border-strong: rgba(43,38,32,0.22);
  --accent: #a8632f;
  --accent-dim: rgba(168,99,47,0.10);
  --accent-glow: rgba(168,99,47,0.35);
  --positive: #3f7a53;
  --positive-dim: rgba(63,122,83,0.10);
  --negative: #b04a3f;
  --negative-dim: rgba(176,74,63,0.10);
  --reserve: #5b6b78;
  --reserve-dim: rgba(91,107,120,0.10);
  --radius-base: 18px;
  --radius-small: 10px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

body {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.5), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(0,0,0,0.03), transparent 40%);
}

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

header.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}

header.top h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

header.top .today {
  font-size: 13px;
  color: var(--text-secondary);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 32px 0 12px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-base);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.card.pool {
  background: var(--surface-2);
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.card-name {
  font-weight: 600;
  font-size: 16px;
}

.card-name .tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.card-amount {
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.card-amount.negative { color: var(--negative); }
.card-amount.positive { color: var(--positive); }

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

.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-default);
  margin-top: 12px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: width 0.4s ease;
}

.card-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin-top 0.3s ease;
  opacity: 0;
}

.card-expand.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 16px;
}

.expand-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-default);
}

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

.spend-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.spend-form input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.spend-form input:focus {
  border-color: var(--accent);
}

button {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-small);
  padding: 10px 18px;
  cursor: pointer;
  background: var(--accent);
  color: #fff8f0;
  transition: opacity 0.15s ease;
}

button:hover { opacity: 0.88; }

button.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}

.pools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pool .card-name { font-size: 13px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.pool .card-amount { font-size: 26px; margin-top: 6px; display: block; }
.pool.reward .card-amount { color: var(--accent); }
.pool.reserve .card-amount { color: var(--reserve); }
.pool .card-sub { margin-top: 6px; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,38,32,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--surface-2);
  border-radius: var(--radius-base);
  padding: 28px;
  width: 90%;
  max-width: 380px;
  transform: translateY(8px);
  transition: transform 0.2s ease;
}

.overlay.open .modal { transform: translateY(0); }

.modal h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.modal p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 20px;
}

.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--accent-glow);
}
