/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --green-dark:   #1b4332;
  --green-mid:    #2d6a4f;
  --green:        #40916c;
  --green-light:  #74c69d;
  --green-pale:   #d8f3dc;
  --yellow:       #f9c74f;
  --yellow-pale:  #fff8e1;
  --red:          #e63946;
  --red-pale:     #fdecea;
  --blue:         #4361ee;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #f9fafb;
  --white:        #ffffff;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 2px 8px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.12);
  --font:         'Nunito', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 2px solid var(--green-pale);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  text-decoration: none;
}
.navbar-links { display: flex; align-items: center; gap: 1.5rem; }
.navbar-links a { font-weight: 600; color: var(--text-muted); font-size: .95rem; }
.navbar-links a:hover { color: var(--green); text-decoration: none; }
.navbar-links a.btn-primary { color: var(--white); }
.btn-link { background: none; border: none; cursor: pointer; font: inherit; color: var(--text-muted); font-weight: 600; font-size: .95rem; }
.btn-link:hover { color: var(--red); }

/* ── Main ──────────────────────────────────────────────────────────────────── */
.main-content { flex: 1; max-width: 1100px; margin: 0 auto; width: 100%; padding: 2rem 1.5rem; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: .85rem; border-top: 1px solid var(--border); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
}
.btn-primary   { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-primary:hover { background: var(--green-mid); text-decoration: none; }
.btn-success   { background: #22c55e; color: var(--white); border-color: #22c55e; }
.btn-success:hover { background: #16a34a; text-decoration: none; }
.btn-danger    { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-danger:hover { background: #c1121f; text-decoration: none; }
.btn-outline   { background: transparent; color: var(--green); border-color: var(--green); }
.btn-outline:hover { background: var(--green-pale); text-decoration: none; }
.btn-sm  { padding: .35rem .75rem; font-size: .85rem; }
.btn-lg  { padding: .8rem 1.75rem; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert { padding: .85rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-weight: 600; }
.alert-success { background: var(--green-pale); color: var(--green-dark); border: 1px solid var(--green-light); }
.alert-error   { background: var(--red-pale); color: var(--red); border: 1px solid #f5a7ac; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 700; margin-bottom: .4rem; font-size: .9rem; color: var(--text); }
.form-control {
  width: 100%;
  padding: .65rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  background: var(--white);
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--green); }
.form-control-lg { padding: .85rem 1rem; font-size: 1.1rem; }
textarea.form-control { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.form-check-label { font-weight: 600; cursor: pointer; }
.form-actions { display: flex; gap: 1rem; justify-content: flex-end; margin-top: 1.5rem; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.form-hint { font-size: .875rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.field-error { color: var(--red); font-size: .82rem; font-weight: 600; }
.validation-summary { background: var(--red-pale); border: 1px solid #f5a7ac; border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; color: var(--red); font-size: .88rem; }
.validation-summary ul { padding-left: 1.2rem; }

/* ── Panels ────────────────────────────────────────────────────────────────── */
.panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.panel-warning { border-left: 4px solid var(--yellow); background: var(--yellow-pale); }
.panel-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 1rem; color: var(--green-dark); }
.panel-header-row { display: flex; align-items: center; justify-content: space-between; }
.form-panel { max-width: 640px; }

/* ── Page header ───────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; }
.header-actions { display: flex; gap: .75rem; }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 100px; font-size: .78rem; font-weight: 700; }
.badge-daily     { background: #dbeafe; color: #1e40af; }
.badge-weekly    { background: #ede9fe; color: #5b21b6; }
.badge-oneoff    { background: #fce7f3; color: #9d174d; }
.badge-pending   { background: #fef9c3; color: #854d0e; }
.badge-processing{ background: #dbeafe; color: #1e40af; }
.badge-completed { background: var(--green-pale); color: var(--green-dark); }
.badge-failed    { background: var(--red-pale); color: var(--red); }

.child-badge {
  display: inline-block;
  background: var(--green-pale);
  color: var(--green-dark);
  border-radius: 100px;
  padding: .15rem .65rem;
  font-size: .82rem;
  font-weight: 700;
}
.reward-tag {
  display: inline-block;
  background: var(--yellow-pale);
  color: #7c4f00;
  border-radius: 100px;
  padding: .15rem .6rem;
  font-size: .82rem;
  font-weight: 700;
}

/* ── Tables ────────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.data-table th { text-align: left; padding: .75rem 1rem; border-bottom: 2px solid var(--border); font-weight: 800; color: var(--text-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* ── Approval list ─────────────────────────────────────────────────────────── */
.approval-list { display: flex; flex-direction: column; gap: .75rem; }
.approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.approval-info { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.approval-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.time-ago { font-size: .8rem; color: var(--text-muted); }

/* ── Child grid ────────────────────────────────────────────────────────────── */
.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.child-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
}
.child-avatar {
  width: 48px; height: 48px;
  background: var(--green);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800;
  flex-shrink: 0;
}
.child-info h3 { font-size: 1rem; font-weight: 800; margin-bottom: .4rem; }
.child-stats { display: flex; gap: .75rem; }
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.1rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; }

/* ── Auth pages ────────────────────────────────────────────────────────────── */
.auth-page { display: flex; justify-content: center; padding: 2rem 1rem; }
.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}
.auth-card h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: .4rem; }
.auth-sub { color: var(--text-muted); margin-bottom: 1.75rem; }
.auth-footer { margin-top: 1.25rem; font-size: .88rem; color: var(--text-muted); text-align: center; }
.child-login-card { border-top: 4px solid var(--green); text-align: center; }
.child-login-icon { font-size: 3rem; margin-bottom: .5rem; }

/* ── Approval detail ───────────────────────────────────────────────────────── */
.approval-detail-card {
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.approval-child  { font-weight: 700; font-size: 1.05rem; }
.approval-task   { font-size: 1.1rem; font-weight: 800; }
.approval-reward { font-size: 1.4rem; font-weight: 800; color: var(--green-dark); }
.result-icon { font-size: 3rem; margin-bottom: .75rem; }
.text-center { text-align: center; }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0 3rem;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.15; margin-bottom: 1rem; }
.hero h1 .accent { color: var(--green); }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 420px; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.task-card-demo {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.task-demo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .95rem;
}
.task-demo-item.done    { background: var(--green-pale); color: var(--green-dark); }
.task-demo-item.pending { background: var(--yellow-pale); color: #7c4f00; }
.task-demo-item.todo    { background: var(--bg); color: var(--text-muted); border: 1px dashed var(--border); }
.reward { font-weight: 800; }

/* ── How it works ──────────────────────────────────────────────────────────── */
.how-it-works { padding: 3rem 0; text-align: center; }
.how-it-works h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 2rem; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.step { padding: 1.5rem; }
.step-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.step h3 { font-size: 1rem; font-weight: 800; margin-bottom: .5rem; }
.step p { font-size: .9rem; color: var(--text-muted); }

/* ── Child dashboard ───────────────────────────────────────────────────────── */
.child-dashboard { max-width: 640px; margin: 0 auto; }
.child-header { text-align: center; margin-bottom: 2rem; }
.child-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; }
.earnings-widget {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0 auto;
  max-width: 320px;
}
.earnings-label { font-size: .85rem; opacity: .85; font-weight: 600; }
.earnings-amount { font-size: 3rem; font-weight: 800; line-height: 1.1; }
.earnings-sub { font-size: .8rem; opacity: .75; margin-top: .25rem; }

.tasks-section h2, .payouts-section h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 1rem; }
.task-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 2rem; }
.task-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--white);
  transition: transform .1s;
}
.task-item:hover { transform: translateY(-1px); }
.task-item-approved  { border-color: var(--green-light); background: var(--green-pale); }
.task-item-awaitingapproval { border-color: var(--yellow); background: var(--yellow-pale); }
.task-item-rejected  { border-color: #fca5a5; background: var(--red-pale); }
.task-item-icon { font-size: 1.4rem; flex-shrink: 0; }
.task-item-body { flex: 1; }
.task-item-name { font-weight: 800; font-size: 1rem; }
.task-item-desc { font-size: .85rem; color: var(--text-muted); }
.task-status-label { font-size: .8rem; color: #7c4f00; font-weight: 700; margin-top: .2rem; }
.rejection-note { font-size: .83rem; color: var(--red); font-weight: 600; margin-top: .25rem; }
.task-item-reward { font-size: 1rem; font-weight: 800; color: var(--green-dark); flex-shrink: 0; }
.task-item-action { flex-shrink: 0; }

.payout-list { display: flex; flex-direction: column; gap: .6rem; }
.payout-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: .9rem;
}
.payout-amount { font-weight: 800; font-size: 1rem; }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state p { margin-bottom: 1rem; }

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-success { color: #16a34a; }
.text-warning { color: #d97706; }
small { font-size: .82em; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 0; }
  .hero h1 { font-size: 2rem; }
  .hero-visual { order: -1; }
  .steps { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .approval-item { flex-direction: column; align-items: flex-start; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .navbar { padding: 0 1rem; }
  .navbar-links { gap: .75rem; }
  .main-content { padding: 1.5rem 1rem; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
  .auth-card { padding: 1.75rem 1.25rem; }
}
