/* ===== CSS Variables & Base ===== */
:root {
  --bg: #09090b;
  --bg-card: #111114;
  --bg-card-hover: #19191e;
  --bg-elevated: #1c1c22;
  --border: #27272a;
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.12);
  --accent-glow-strong: rgba(139, 92, 246, 0.25);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --red: #f43f5e;
  --red-bg: rgba(244, 63, 94, 0.1);
  --cyan: #06b6d4;
  --orange: #f97316;
  --gradient-1: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --gradient-2: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
  --gradient-3: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
  --gradient-card: linear-gradient(160deg, #18181b 0%, #0f172a 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --nav-height: 64px;
  --header-height: 48px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-height) + 16px);
}

/* ===== PIN Screen ===== */
.pin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.pin-screen::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.pin-screen.hidden { display: none; }

.pin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 28px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.pin-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--gradient-3);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: white;
}

.pin-card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.pin-card p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 20px;
  font-weight: 500;
}

.pin-hint {
  font-size: 0.7rem !important;
  margin-top: 14px !important;
  color: var(--text-muted) !important;
}

.pin-card input {
  text-align: center;
  font-size: 1.15rem;
  letter-spacing: 3px;
  font-weight: 700;
}

/* ===== Sync Status ===== */
.sync-status {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.sync-ok { color: var(--green); background: var(--green-bg); }
.sync-error { color: var(--orange); background: rgba(249, 115, 22, 0.1); }
.sync-offline { color: var(--text-muted); background: rgba(255,255,255,0.04); }

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hidden { display: none !important; }

/* ===== Header ===== */
#app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
}

#app-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

/* ===== Views ===== */
.view {
  display: none;
  padding: 16px 18px;
  animation: fadeIn 0.2s ease;
}

.view.active {
  display: block;
}

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

.view h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

/* ===== Balance Card ===== */
.balance-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -40%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.balance-card::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.balance-icon {
  font-size: 2rem;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.change-icon-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 2px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.change-icon-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.balance-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

.balance-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: -2px;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #fff 30%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.balance-sub {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.bal-earned { color: var(--green); }
.bal-spent { color: var(--red); }
.bal-divider { color: var(--text-muted); margin: 0 6px; }

/* ===== Icon Picker ===== */
.icon-picker {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.icon-option {
  font-size: 1.4rem;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-option:hover {
  background: var(--bg-elevated);
}

.icon-option.selected {
  background: var(--accent-glow-strong);
  border-color: var(--accent);
}

/* ===== Summary Row ===== */
.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-card.earned .summary-value { color: var(--green); }
.summary-card.spent .summary-value { color: var(--red); }

.summary-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.summary-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ===== Section Title ===== */
.section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin: 18px 0 8px;
}

/* ===== Cards ===== */
.form-card, .info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
}

.info-card {
  border-left: 3px solid var(--accent);
}

.info-card p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.5;
}

.info-card strong {
  color: var(--text);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.68rem;
  margin-bottom: 5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  background: var(--bg-elevated);
  color: var(--text);
}

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

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ===== Toggle Group ===== */
.toggle-group {
  display: flex;
  gap: 3px;
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.toggle-btn {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.toggle-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(139,92,246,0.3);
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139,92,246,0.35);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-danger {
  background: var(--red);
  color: white;
  width: 100%;
}

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

/* ===== Switch Toggle ===== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: white;
}

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

.txn-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.txn-item:hover { background: var(--bg-card-hover); }

.txn-info {
  display: flex;
  flex-direction: column;
}

.txn-reason {
  font-weight: 600;
  font-size: 0.85rem;
}

.txn-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.txn-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.3px;
}

.txn-amount.positive { color: var(--green); }
.txn-amount.negative { color: var(--red); }

.txn-delete {
  background: none;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
  opacity: 0.25;
  transition: opacity 0.2s;
}

.txn-delete:hover { opacity: 0.7; }

/* ===== Pots ===== */
.pots-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.pot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}

.pot-card:hover { border-color: var(--text-muted); }

.pot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pot-emoji { font-size: 1.6rem; }

.pot-name {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}

.pot-amounts {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.5s ease;
  min-width: 0;
}

.progress-fill.complete {
  background: var(--gradient-1);
}

.pot-pct {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: -4px;
  margin-bottom: 6px;
}

.pot-proj-detail {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.75rem;
}

.pot-proj-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-weight: 500;
}

.pot-proj-label { color: var(--text-muted); }

.pot-proj-extra {
  color: var(--orange);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.pot-proj-ok { color: var(--green); font-weight: 700; }
.pot-proj-warn { color: var(--red); font-weight: 700; }

.pot-proj-bar-wrap { margin-top: 8px; }

.pot-proj-timeline {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.pot-proj-timeline-fill {
  height: 100%;
  background: var(--gradient-2);
  border-radius: 2px;
  transition: width 0.3s;
}

.pot-proj-timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 600;
}

.pot-complete-badge {
  background: var(--green-bg);
  color: var(--green);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
}

.pot-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
  gap: 6px;
}

.pot-actions {
  display: flex;
  gap: 4px;
}

.pot-actions .btn {
  padding: 5px 12px;
  font-size: 0.72rem;
}

/* ===== Pots Preview (Dashboard) ===== */
.pots-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pot-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.pot-mini-emoji { font-size: 1.2rem; }
.pot-mini-info { flex: 1; }
.pot-mini-name { font-weight: 600; font-size: 0.78rem; }
.pot-mini-bar { margin-top: 4px; }
.pot-mini .progress-bar { height: 3px; }

.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.82rem;
}

/* ===== Emoji Picker ===== */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.emoji-option {
  font-size: 1.5rem;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.emoji-option:hover {
  background: var(--bg-elevated);
}

.emoji-option.selected {
  border-color: var(--accent);
  background: var(--accent-glow-strong);
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-content h3 {
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 18px;
  font-size: 1.05rem;
  letter-spacing: -0.3px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions .btn { flex: 1; }

/* ===== Projections ===== */
.projection-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
}

.projection-period {
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 3px;
}

.projection-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

.projection-bar-container { margin-top: 8px; }

.projection-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.5s ease;
  min-width: 3px;
}

.projection-bar-bg {
  background: var(--bg-elevated);
  border-radius: 2px;
  height: 3px;
}

/* ===== Summary Charts ===== */
.chart-section { margin-bottom: 20px; }

.chart-title {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  width: 55px;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: right;
  color: var(--text-muted);
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 0;
}

.bar-fill.earnings { background: var(--green); }
.bar-fill.spending { background: var(--red); }

.bar-value {
  width: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}

.summary-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-stat-label { font-weight: 600; font-size: 0.82rem; }
.summary-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
}

.top-reasons {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reason-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
}

.reason-name { font-weight: 600; }
.reason-count {
  color: var(--text-secondary);
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

/* ===== Sticker Grid ===== */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.sticker-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  transition: all 0.2s;
}

.sticker-card.earned {
  border-color: var(--accent);
  background: var(--accent-glow);
  box-shadow: 0 0 20px var(--accent-glow);
}

.sticker-card.locked {
  opacity: 0.2;
}

.sticker-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 4px;
}

.sticker-name {
  font-weight: 700;
  font-size: 0.68rem;
}

.sticker-months {
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* ===== Streak Preview ===== */
.streak-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.streak-count {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.streak-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.streak-stickers {
  font-size: 1.3rem;
  margin-left: auto;
}

/* ===== Quick Links ===== */
.quick-links {
  display: flex;
  gap: 6px;
  margin-top: 18px;
}

.quick-link-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}

.quick-link-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ===== File Input ===== */
.file-input { display: none; }

.file-label {
  display: inline-block;
  margin-bottom: 8px;
  cursor: pointer;
}

.file-name {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.danger-zone {
  border-color: rgba(244, 63, 94, 0.25);
}

.form-card p {
  color: var(--text-secondary);
  font-size: 0.78rem;
  margin-bottom: 10px;
  font-weight: 500;
}

/* ===== Tasks ===== */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color 0.2s;
}

.task-card:hover { border-color: var(--text-muted); }

.task-card.task-done {
  border-color: var(--green);
  background: linear-gradient(160deg, rgba(16,185,129,0.06) 0%, var(--bg-card) 100%);
}

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

.task-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.task-reward {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green);
}

.task-deadline {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.task-jobs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.task-job {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.task-job:hover { background: var(--bg-card-hover); }

.task-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 0.6rem;
  font-weight: 800;
}

.task-job.done .task-checkbox {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.task-job-text {
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
}

.task-job.done .task-job-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-progress {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.task-footer {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.task-footer .btn {
  padding: 5px 12px;
  font-size: 0.72rem;
}

.task-collect-btn {
  background: var(--green) !important;
  color: white !important;
  animation: pulse 1.8s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.task-jobs-edit {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.task-job-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 500;
}

.task-job-edit span { flex: 1; }

.task-job-remove {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.task-job-remove:hover { background: var(--red-bg); }

.task-add-job-row {
  display: flex;
  gap: 4px;
}

.task-add-job-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text);
}

.task-add-job-row input::placeholder { color: var(--text-muted); }
.task-add-job-row input:focus { outline: none; border-color: var(--accent); }

.task-add-job-row .btn {
  padding: 8px 14px;
  font-size: 0.95rem;
  width: auto;
}

/* Tasks preview on dashboard */
.tasks-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.task-mini:hover { border-color: var(--text-muted); }

.task-mini-check { font-size: 1.1rem; }
.task-mini-info { flex: 1; }
.task-mini-name { font-weight: 600; font-size: 0.78rem; }
.task-mini-progress {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.task-mini-reward {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--green);
}

/* ===== Light Theme ===== */
body.light {
  --bg: #f8f8fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f3f6;
  --bg-elevated: #ededf0;
  --border: #e4e4e7;
  --text: #18181b;
  --text-secondary: #71717a;
  --text-muted: #a1a1aa;
  --accent: #7c3aed;
  --accent-light: #6d28d9;
  --accent-glow: rgba(124, 58, 237, 0.06);
  --accent-glow-strong: rgba(124, 58, 237, 0.12);
  --green: #059669;
  --green-bg: rgba(5, 150, 105, 0.06);
  --red: #e11d48;
  --red-bg: rgba(225, 29, 72, 0.06);
  --cyan: #0891b2;
  --orange: #ea580c;
  --gradient-card: linear-gradient(160deg, #f8f8ff 0%, #f0f4ff 100%);
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.light #app-header h1 {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--accent);
}

body.light .balance-amount {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--text);
}

body.light .streak-count {
  -webkit-text-fill-color: unset;
  background: none;
  color: var(--accent);
}

body.light .balance-card::before,
body.light .balance-card::after {
  opacity: 0.5;
}

/* ===== Bottom Navigation ===== */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  transition: all 0.2s;
  color: var(--text-muted);
  min-width: 48px;
}

.nav-svg {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.2s;
}

.nav-btn .nav-label {
  font-size: 0.52rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.nav-btn.active {
  color: var(--accent-light);
}

/* ===== Celebration ===== */
.celebration {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.3s ease;
}

.celebration.hidden { display: none; }

.celebration-content {
  text-align: center;
  animation: bounceIn 0.4s ease;
}

.celebration-emoji {
  font-size: 4rem;
  animation: wiggle 0.5s ease 0.3s;
}

.celebration-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  margin-top: 10px;
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.confetti {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  z-index: 301;
  animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  #app { max-width: 520px; }
  .sticker-grid { grid-template-columns: repeat(4, 1fr); }
  .emoji-grid { grid-template-columns: repeat(8, 1fr); }
  .icon-picker-grid { grid-template-columns: repeat(10, 1fr); }
}

@media (max-width: 360px) {
  .balance-amount { font-size: 2.2rem; }
  .nav-btn .nav-label { font-size: 0.48rem; }
  .nav-btn { min-width: 42px; padding: 6px 4px; }
  .sticker-grid { grid-template-columns: repeat(2, 1fr); }
}
