:root {
  --navy: #00183D;
  --gold: #FFC300;
  --black: #1F1F1F;
  --bg: #FBF9F4;
  --green: #1E8E5A;
  --red: #C0392B;
  --grey: #6b7280;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--black);
}

.site-header {
  background: var(--navy);
  padding: 1rem 2rem;
}
.brand {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
}
.hero h1 { color: var(--navy); font-size: 2.2rem; }
.cta-row { margin-top: 1.5rem; display: flex; gap: 1rem; justify-content: center; }
.price-note { margin-top: 1rem; color: var(--grey); }

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-secondary { background: var(--navy); color: white; }
.btn-link { background: none; color: var(--navy); text-decoration: underline; padding: 0.3rem 0; }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.form-card {
  max-width: 420px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.form-card label { display: block; margin-bottom: 1rem; font-size: 0.9rem; color: var(--grey); }
.form-card input, .form-card select {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.3rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}
.error { color: var(--red); font-size: 0.9rem; }
.success { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; border-radius: 8px; padding: .75rem 1rem; font-size: 0.9rem; }
.hint { color: var(--grey); font-size: 0.85rem; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.age-band-tag { font-size: 0.9rem; background: var(--gold); color: var(--navy); padding: 0.2rem 0.6rem; border-radius: 999px; margin-left: 0.5rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.child-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem;
  text-decoration: none;
  color: var(--black);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.child-card h3 { margin: 0 0 0.3rem 0; color: var(--navy); }
.age-band { color: var(--grey); font-size: 0.85rem; }
.wallet-balance { font-weight: 600; }
.add-card { display: flex; align-items: center; justify-content: center; border: 2px dashed #ccc; color: var(--grey); }

.pot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.pot-card { background: white; border-radius: var(--radius); padding: 1rem; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.pot-card h4 { margin: 0 0 0.5rem 0; font-size: 0.85rem; color: var(--grey); }
.pot-card p { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--navy); }

.task-form, .pot-split-form { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; margin-bottom: 1.5rem; }
.task-form input, .task-form select, .pot-split-form input {
  padding: 0.55rem; border: 1px solid #ddd; border-radius: 8px;
}
.pot-split-form label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--grey); }
.checkbox-label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; }

.task-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; background: white; border-radius: var(--radius); overflow: hidden; }
.task-table th, .task-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.status { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-assigned { background: #eee; }
.status-submitted { background: #FFF3CD; }
.status-approved { background: #D4EDDA; }
.status-paid { background: var(--navy); color: white; }
.status-rejected { background: #F8D7DA; }

.payslip-list { list-style: none; padding: 0; }
.payslip-list li { margin-bottom: 0.5rem; }
.payslip-list a { color: var(--navy); }

.payslip-doc { background: white; padding: 2rem; border-radius: var(--radius); max-width: 500px; margin: 0 auto; }
.payslip-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.payslip-table td { padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.net-row td { font-weight: 700; color: var(--navy); }
.payslip-period { color: var(--grey); }

.inline-form { margin-bottom: 2rem; }

.add-work-row { margin-bottom: 1rem; }

.band-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem 0; }
.band-tab {
  padding: 0.4rem 0.9rem; border-radius: 999px; background: white; color: var(--navy);
  text-decoration: none; font-size: 0.85rem; border: 1px solid #ddd;
}
.band-tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.band-tab.native::after { content: ' ★'; }

.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.lesson-card { background: white; border-radius: var(--radius); padding: 1.2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.lesson-card h3 { margin: 0.4rem 0; color: var(--navy); }
.lesson-type-tag { font-size: 0.7rem; background: var(--gold); color: var(--navy); padding: 0.15rem 0.5rem; border-radius: 999px; font-weight: 700; }
.assign-form { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.8rem; }
.assign-form label { font-size: 0.85rem; color: var(--grey); display: flex; align-items: center; gap: 0.3rem; }
.assign-form input { width: 70px; padding: 0.3rem; border: 1px solid #ddd; border-radius: 6px; }

.lesson-badge { font-size: 0.7rem; background: var(--gold); color: var(--navy); padding: 0.1rem 0.4rem; border-radius: 999px; }

.lesson-doc { background: white; padding: 2rem; border-radius: var(--radius); max-width: 640px; margin: 0 auto; }
.lesson-intro { color: var(--grey); margin-bottom: 1.5rem; }
.quiz-question { margin-bottom: 1.3rem; padding-bottom: 1.3rem; border-bottom: 1px solid #eee; }
.question-text { font-weight: 600; margin-bottom: 0.6rem; }
.quiz-option { display: block; margin-bottom: 0.5rem; font-size: 0.95rem; cursor: pointer; }
.quiz-option input { margin-right: 0.5rem; }

.budget-banner {
  background: var(--bg); border: 1px solid #eee; border-radius: var(--radius);
  padding: 0.8rem 1rem; margin-bottom: 1.5rem; font-weight: 600;
}
.budget-warning { color: var(--red); margin-left: 0.6rem; font-weight: 700; }
.shop-item { margin-bottom: 1.3rem; padding-bottom: 1.3rem; border-bottom: 1px solid #eee; }
.item-name { font-weight: 600; margin-bottom: 0.6rem; }

.result-list { list-style: none; padding: 0; }
.result-list li { padding: 0.5rem 0; border-bottom: 1px solid #eee; }
.result-correct { color: var(--green); }
.result-incorrect { color: var(--red); }
.result-explanation { color: var(--grey); font-size: 0.85rem; }

.day-out-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.day-out-table th, .day-out-table td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.day-out-table th { color: var(--grey); font-weight: 600; }

.savings-summary {
  background: var(--bg); border: 1px solid #eee; border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1.5rem;
}
.savings-summary p { margin: 0.3rem 0; font-size: 0.95rem; }

/* Family code banner (parent dashboard) */
.trial-banner {
  background: var(--gold); color: var(--navy); border-radius: var(--radius);
  padding: 0.9rem 1.5rem; margin-bottom: 1rem; font-size: 0.95rem;
}
.trial-banner a { color: var(--navy); text-decoration: underline; font-weight: 600; }

.family-code-banner {
  background: var(--navy); color: white; border-radius: var(--radius);
  padding: 1rem 1.5rem; margin-bottom: 1.5rem;
}
.family-code-banner .hint { color: #cbd5e1; margin-top: 0.4rem; }
.family-code {
  display: inline-block; background: var(--gold); color: var(--navy);
  font-weight: 700; font-size: 1.2rem; letter-spacing: 0.15em;
  padding: 0.2rem 0.7rem; border-radius: 8px; margin-left: 0.5rem;
}

/* Child PIN-set form (parent's child detail page) */
.pin-form { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 1.5rem; }
.pin-form input {
  padding: 0.55rem; border: 1px solid #ddd; border-radius: 8px;
  width: 140px; letter-spacing: 0.2em; font-size: 1.1rem; text-align: center;
}

/* Kids-facing pages (family code entry, PIN entry) */
.kids-card { text-align: center; }
.kids-card input[type="text"], .kids-card input[type="password"] {
  text-align: center; font-size: 1.3rem; letter-spacing: 0.25em;
}

/* Child selection grid */
.kids-select-wrap { max-width: 600px; margin: 2rem auto; text-align: center; }
.kids-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem; margin-top: 1.5rem;
}
.kid-select-card {
  background: white; border-radius: var(--radius); padding: 1.5rem 1rem;
  text-decoration: none; color: var(--black); box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  text-align: center; transition: transform 0.1s ease;
}
.kid-select-card:hover { transform: translateY(-2px); }
.kid-select-card h3 { margin: 0.6rem 0 0.2rem 0; color: var(--navy); }
.kid-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--gold);
  color: var(--navy); font-size: 1.5rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
