:root {
  --bg: #0a0a0a; --surface: #141414; --border: #222;
  --text-primary: #f0f0f0; --text-muted: #888;
  --accent-habits: #3b82f6; --accent-finance: #10b981; --accent-velero: #f59e0b;
  --success: #22c55e; --warning: #f59e0b; --danger: #ef4444;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh; font-size: 14px; }
/* Header */
.app-header { display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem; border-bottom: 1px solid var(--border); }
.app-logo { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.08em; }
.app-level { font-size: 0.8rem; color: var(--text-muted); }
/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem; padding: 1.5rem 2rem; height: calc(100vh - 57px); }
/* Cards */
.pillar-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; cursor: pointer;
  transition: border-color 0.15s; display: flex; flex-direction: column; gap: 1rem; overflow: hidden; }
.pillar-card:hover { border-color: #333; }
.habits-card { border-top: 2px solid var(--accent-habits); }
.finance-card { border-top: 2px solid var(--accent-finance); }
.velero-card { border-top: 2px solid var(--accent-velero); }
/* Pillar header */
.pillar-header { display: flex; justify-content: space-between; align-items: center; }
.pillar-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); }
/* Habit rows */
.habit-row { display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.habit-row:last-child { border-bottom: none; }
.habit-check { width: 20px; height: 20px; border: 2px solid var(--border);
  border-radius: 4px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; transition: all 0.15s; }
.habit-check.done { background: var(--success); border-color: var(--success); }
.habit-check.done::after { content: '✓'; color: #000; font-size: 11px; font-weight: 700; }
.habit-name { flex: 1; }
.habit-xp { font-size: 0.7rem; color: var(--text-muted); }
/* XP summary */
.xp-summary { display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-muted); margin-top: auto;
  padding-top: 0.75rem; border-top: 1px solid var(--border); }
/* Progress bars */
.metric-row { display: flex; flex-direction: column; gap: 0.3rem; }
.metric-label { display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted); }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.progress-fill.habits { background: var(--accent-habits); }
.progress-fill.finance { background: var(--accent-finance); }
.progress-fill.velero { background: var(--accent-velero); }
/* Streak badge */
.streak-badge { font-size: 0.85rem; font-weight: 700; }
.phase-badge { font-size: 0.7rem; padding: 0.15rem 0.5rem;
  background: var(--accent-velero); color: #000; border-radius: 999px; font-weight: 700; }
/* Buttons */
.btn-primary { background: var(--accent-finance); color: #000; border: none;
  border-radius: 6px; padding: 0.6rem 1rem; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; width: 100%; transition: opacity 0.15s; margin-top: auto; }
.btn-primary:hover { opacity: 0.85; }
.btn-secondary { background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.5rem 1rem; font-size: 0.85rem; cursor: pointer; }
/* Login */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3rem; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 1.25rem; }
.login-card h1 { font-size: 1.5rem; }
.login-input { background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.75rem 1rem; color: var(--text-primary);
  font-size: 0.9rem; width: 100%; transition: border-color 0.15s; }
.login-input:focus { outline: none; border-color: var(--accent-habits); }
.login-remember { display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; color: var(--text-muted); cursor: pointer; }
.login-error { color: var(--danger); font-size: 0.85rem; display: none; }
/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 1rem; }
.modal-card h3 { font-size: 1rem; font-weight: 600; }
.modal-input { background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.65rem 0.9rem; color: var(--text-primary);
  font-size: 0.9rem; width: 100%; }
.modal-input:focus { outline: none; border-color: var(--accent-finance); }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
/* Detail layout */
.detail-layout { max-width: 960px; margin: 0 auto; padding: 2rem;
  display: flex; flex-direction: column; gap: 1.5rem; }
.section-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; }
.section-title { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 1rem; }
.nav-back { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; display: inline-flex; }
.nav-back:hover { color: var(--text-primary); }
/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.65rem; color: var(--text-muted); }
.cal-day.complete { background: var(--success); color: #000; }
.cal-day.partial { background: var(--warning); color: #000; }
.cal-day.empty { background: var(--border); }
/* Streak rows */
.streak-row { display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.streak-row:last-child { border-bottom: none; }
.streak-num { font-size: 1.25rem; font-weight: 700; }
/* Milestone */
.milestone-row { display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.milestone-row:last-child { border-bottom: none; }
.milestone-check { width: 18px; height: 18px; border: 2px solid var(--border);
  border-radius: 3px; flex-shrink: 0; cursor: pointer; }
.milestone-check.done { background: var(--success); border-color: var(--success); }
.milestone-name { flex: 1; font-size: 0.9rem; }
.milestone-name.done { color: var(--text-muted); text-decoration: line-through; }
/* Expense list */
.expense-row { display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.expense-row:last-child { border-bottom: none; }
.expense-amount { font-weight: 600; }
.expense-cat { font-size: 0.7rem; color: var(--text-muted); }
/* XP bar chart */
.xp-bars { display: flex; gap: 6px; align-items: flex-end; height: 60px; }
.xp-bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.xp-bar { width: 100%; background: var(--accent-habits); border-radius: 3px 3px 0 0; min-height: 2px; }
.xp-bar-label { font-size: 0.6rem; color: var(--text-muted); }
/* Misc */
.muted { color: var(--text-muted); }
.big-number { font-size: 2rem; font-weight: 700; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.alert-banner { padding: 0.75rem 1rem; border-radius: 6px; font-size: 0.85rem;
  background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3);
  color: var(--warning); }
/* XP bar labels */
.xp-bar-meta { font-size: 0.7rem; color: var(--text-muted); }
/* Dashboard stats footer */
.dashboard-stats-footer {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  padding-top: 0.75rem; border-top: 1px solid var(--border); margin-top: auto;
}
.stat-chip {
  font-size: 0.68rem; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.2rem 0.6rem; white-space: nowrap;
}
/* Global WoW-style XP bar */
#global-xp-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 20px;
  background: #0d0d0d; border-top: 1px solid #1a1a1a;
  z-index: 200; overflow: hidden;
}
#gxp-fill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0%;
  background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 60%, #60a5fa 100%);
  transition: width 0.8s ease;
  box-shadow: 0 0 8px rgba(59,130,246,0.6);
}
#gxp-label {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 0.65rem; font-weight: 600;
  color: rgba(255,255,255,0.85); letter-spacing: 0.05em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}
/* Push page content above the fixed XP bar */
body { padding-bottom: 20px; }
