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

:root {
  --bg: #0F1117;
  --surface: #1A1D27;
  --surface2: #22263A;
  --border: #2E3247;
  --text: #F0F2FF;
  --muted: #8B8FA8;
  --accent: #6C63FF;
  --accent2: #00D4AA;
  --green: #00D4AA;
  --red: #FF4D6D;
  --yellow: #FFD166;
  --orange: #FF9A3C;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-size: 1.3rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}

.brand span { color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.nav-avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  border: 2px solid var(--border);
}

.nav-name { font-weight: 600; font-size: 0.9rem; color: var(--muted); }

/* ── LAYOUT ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 18px;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 1; }

.btn-primary { background: var(--accent);  color: white; }
.btn-green   { background: var(--green);   color: #001a14; }
.btn-red     { background: var(--red);     color: white; }
.btn-orange  { background: var(--orange);  color: white; }
.btn-ghost   { background: var(--surface2); border-color: var(--border); color: var(--muted); }
.btn-sm      { padding: 6px 12px; font-size: 0.82rem; border-radius: 8px; }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
select option { background: var(--surface2); }
input[type=checkbox] { width: auto; margin-right: 6px; accent-color: var(--accent); }

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
}
.tab {
  padding: 7px 18px;
  border-radius: 9px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
}
.tab.active { background: var(--accent); color: white; }
.tab:not(.active):hover { color: var(--text); background: var(--surface2); }

/* ── CHORE CARD ── */
.chore-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
  margin-bottom: 10px;
}
.chore-card:hover { border-color: var(--accent); }

.chore-rewards {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 64px;
  align-items: center;
}
.reward-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}
.reward-pts   { background: rgba(108,99,255,0.2); color: var(--accent); }
.reward-money { background: rgba(0,212,170,0.15); color: var(--green); }

.chore-info { flex: 1; }
.chore-title { font-weight: 700; font-size: 1rem; font-family: 'Space Grotesk', sans-serif; }
.chore-meta  { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.chore-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ── HERO STATS (child) ── */
.hero {
  background: linear-gradient(135deg, #1a1440 0%, #0d2a22 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
}
.hero-pic {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}
.hero-pic-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; color: white;
  flex-shrink: 0;
  border: 3px solid var(--accent);
}
.hero-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.2rem; margin-bottom: 10px; }
.hero-stats { display: flex; gap: 24px; }
.hero-stat .val { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.6rem; line-height: 1; }
.hero-stat .val.money { color: var(--green); }
.hero-stat .val.pts   { color: var(--accent); }
.hero-stat .lbl { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* ── PARENT STATS ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-box .val { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.5rem; }
.stat-box .lbl { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* ── PROFILE PHOTO ── */
.profile-img {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.profile-placeholder {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; color: white;
  flex-shrink: 0;
}

/* ── KID CARD ── */
.kid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.kid-name { font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.kid-stats { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.kid-owed  { font-weight: 700; color: var(--green); }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.78rem;
}
.badge-pending  { background: rgba(255,209,102,0.15); color: var(--yellow); }
.badge-approved { background: rgba(0,212,170,0.15);  color: var(--green); }
.badge-rejected { background: rgba(255,77,109,0.15); color: var(--red); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.modal h2 { margin-bottom: 20px; font-size: 1.2rem; }

/* ── AUTH ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 6px; font-size: 2rem; font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.auth-logo span { color: var(--accent); }
.auth-tagline { text-align: center; color: var(--muted); margin-bottom: 28px; font-size: 0.88rem; }

/* ── PHOTO PROOF ── */
.proof-preview {
  width: 100%;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid var(--border);
  display: none;
}
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  color: var(--muted);
  font-size: 0.88rem;
}
.photo-upload-area:hover { border-color: var(--accent); color: var(--text); }
.photo-upload-area .icon { font-size: 2rem; margin-bottom: 6px; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-header h2 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ── EMPTY ── */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty .icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty p { font-size: 0.9rem; }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  max-width: 320px;
}
#toast.show   { opacity: 1; transform: translateY(0); }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.error   { border-color: var(--red);   color: var(--red); }

/* ── APPROVAL CARD ── */
.approval-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.approval-card:hover { border-color: var(--accent); }
.approval-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.approval-info { flex: 1; }
.approval-proof { width: 100%; border-radius: 10px; margin: 10px 0; cursor: pointer; max-height: 300px; object-fit: cover; }
.approval-proof:hover { opacity: 0.9; }
.approval-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .hero-stats { gap: 16px; }
  .hero-stat .val { font-size: 1.3rem; }
  .auth-box { padding: 24px 16px; }
  .modal { padding: 20px 16px; }
  .chore-card { flex-wrap: wrap; }
  nav { padding: 0 14px; }
  .container { padding: 18px 12px; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; }
}

/* ── EMOJI / AVATAR PICKER ── */
.avatar-option {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.avatar-option:hover { border-color: var(--accent); }
.avatar-option.selected { border-color: var(--accent); background: rgba(108,99,255,0.15); }
