/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f4f4f4;
  --dark:      #1a1a1a;
  --accent:    #4f46e5;
  --accent2:   #7c3aed;
  --card:      #ffffff;
  --border:    #e5e7eb;
  --text:      #111827;
  --muted:     #6b7280;
  --success:   #10b981;
  --danger:    #ef4444;
  --radius:    14px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);

  /* difficulty colors */
  --easy:   #10b981;
  --light:  #3b82f6;
  --normal: #f59e0b;
  --tough:  #f97316;
  --heavy:  #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout helpers ─────────────────────────────────────────────────────────── */
.container { max-width: 680px; margin: 0 auto; padding: 16px; }

/* ── Inspirational banner ────────────────────────────────────────────────────── */
.inspire-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 680px;
  margin: 16px auto 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, #1a1a1a 0%, #374151 100%);
  color: #fff;
  border-radius: 14px;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.4;
  animation: slideDown .35s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.inspire-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  padding: 0 4px;
  transition: color .15s;
}
.inspire-close:hover { color: #fff; }

/* ── Today's date heading ────────────────────────────────────────────────────── */
.today-heading {
  max-width: 680px;
  margin: 16px auto 4px;
  padding: 0 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.today-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #9ca3af;
}
.today-date {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--dark);
  color: #fff;
  padding: 20px 16px 16px;
  margin-bottom: 20px;
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.site-header h1 { font-size: 1.4rem; font-weight: 700; }
.site-header .meta { font-size: .85rem; opacity: .7; }
.btn-logout {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.25); }

/* ── Points badge ───────────────────────────────────────────────────────────── */
.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .85rem;
  font-weight: 700;
}

/* ── Progress bar ───────────────────────────────────────────────────────────── */
.progress-wrap { margin: 12px 0; }
.progress-label { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.progress-bar-bg {
  background: var(--border);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width .4s ease;
}

/* ── Chore cards ────────────────────────────────────────────────────────────── */
.chore-list { display: flex; flex-direction: column; gap: 10px; }
.chore-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, opacity .2s;
  user-select: none;
}
.chore-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.chore-card.done { opacity: .55; }
.chore-card.done .chore-name { text-decoration: line-through; }

.chore-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, border-color .2s;
  font-size: .9rem;
}
.chore-card.done .chore-check {
  background: var(--success);
  border-color: var(--success);
}

.chore-info { flex: 1; }
.chore-name { font-size: 1rem; font-weight: 500; }
.chore-pts {
  display: inline-block;
  margin-top: 5px;
  font-size: .72rem;
  font-weight: 700;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 99px;
  padding: 2px 8px;
  letter-spacing: .02em;
}

.diff-badge {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  color: #fff;
  white-space: nowrap;
}
.diff-Easy   { background: var(--easy);   }
.diff-Light  { background: var(--light);  }
.diff-Normal { background: var(--normal); }
.diff-Tough  { background: var(--tough);  }
.diff-Heavy  { background: var(--heavy);  }

/* ── Celebration ────────────────────────────────────────────────────────────── */
.celebration {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, #fef3c7, #d1fae5);
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: none;
}
.celebration.show { display: block; }
.celebration .emoji { font-size: 3rem; }
.celebration h2 { margin-top: 8px; color: #065f46; }

/* ── Login page ─────────────────────────────────────────────────────────────── */
body.login-page {
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-card h1 { font-size: 1.6rem; text-align: center; margin-bottom: 6px; }
.login-card .subtitle { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: .9rem; }

.user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.user-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 2.5px solid var(--border);
  border-radius: 14px;
  background: none;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: border-color .2s, background .2s;
}
.user-btn .avatar { font-size: 2rem; }
.user-btn:hover { border-color: var(--accent); background: #f5f3ff; }
.user-btn.selected { border-color: var(--accent); background: #eef2ff; }

.pw-section { margin-bottom: 16px; display: none; }
.pw-section.show { display: block; }
.pw-label { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.pw-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s;
}
.pw-input:focus { border-color: var(--accent); }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-login:hover { opacity: .9; }
.btn-login:disabled { opacity: .5; cursor: default; }

.error-msg {
  color: var(--danger);
  font-size: .85rem;
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
}

/* ── Parent grid ────────────────────────────────────────────────────────────── */
.parent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 16px;
}
/* ── Kid section heading ─────────────────────────────────────────────────── */
.kid-section-wrap { max-width: 960px; margin: 0 auto; padding: 0 16px 32px; }
.section-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}

/* ── Kid card ────────────────────────────────────────────────────────────── */
.kid-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.kid-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.kid-name { font-size: 1.1rem; font-weight: 700; }
.kid-emoji { font-size: 1.6rem; }
.kid-chore-list { flex: 1; margin-top: 10px; }

/* ── Kid card action footer ──────────────────────────────────────────────── */
.kid-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.kid-action-btn {
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.kid-action-btn:hover { background: var(--border); }
.kid-action-btn--done {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}
.kid-action-btn--done:hover { background: #a7f3d0; }

.chore-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.chore-row:last-child { border-bottom: none; }
.chore-row--critical { background: #fff5f5; border-radius: 6px; padding: 6px 8px; }
.chore-row-top {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.chore-status { font-size: .95rem; flex-shrink: 0; line-height: 1.4; }
.chore-row-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.4;
  font-weight: 500;
}
.chore-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 22px;
}
.chore-pts-label {
  font-size: .72rem;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
}

/* ── Critical task styles ────────────────────────────────────────────────────── */
.critical-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
  letter-spacing: .02em;
}
.chore-card--critical {
  border-color: #fca5a5 !important;
  background: linear-gradient(135deg, #fff 85%, #fff5f5 100%) !important;
  box-shadow: 0 0 0 2px #fee2e2, var(--shadow) !important;
}
.critical-warning {
  font-size: .75rem;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 5px;
  padding: 4px 8px;
  margin: 4px 0 6px;
  font-weight: 600;
}
/* Critical toggle in task modal */
.critical-toggle-wrap { margin-top: 2px; }
.critical-toggle-label { display: block; cursor: pointer; }
.critical-toggle-label input[type="checkbox"] { display: none; }
.critical-toggle-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  transition: border-color .15s, background .15s;
}
.critical-toggle-label input:checked + .critical-toggle-box {
  border-color: #fca5a5;
  background: #fff5f5;
}
.critical-toggle-icon { font-size: 1.4rem; }
.critical-toggle-box strong { font-size: .9rem; display: block; color: var(--text); }
.critical-toggle-sub { font-size: .76rem; color: var(--muted); }

/* ── Leaderboard ────────────────────────────────────────────────────────────── */
/* ── Weekly Payout ───────────────────────────────────────────────────────────── */
.payout-section {
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 0 16px;
}
.payout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.payout-budget-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
}
.payout-budget-label { color: var(--muted); font-size: .82rem; }
.payout-budget-display {
  border: none;
  background: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  padding: 0 2px;
  border-bottom: 1.5px dashed var(--accent);
  line-height: 1.2;
}
.payout-budget-display:hover { background: #eef2ff; border-radius: 4px; }
.payout-week-range {
  font-size: .75rem;
  color: var(--muted);
  margin-left: 8px;
}
.payout-gauge-wrap { margin-bottom: 14px; }
/* Alerts */
.payout-alert {
  font-size: .82rem;
  border-radius: 9px;
  padding: 9px 12px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.payout-alert--red   { color: #9f1239; background: #fff1f2; border: 1px solid #fecdd3; }
.payout-alert--amber { color: #78350f; background: #fffbeb; border: 1px solid #fde68a; }

/* Gauge */
.payout-gauge-track {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
  position: relative;
}
.payout-gauge-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
}
.payout-gauge-fill--potential {
  background: #fde68a; /* amber tint showing potential */
}
.payout-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--muted);
  gap: 4px;
}
.payout-gauge-potential--warn { color: #d97706; font-weight: 600; }

/* Per-kid rows — two-layer bar (potential behind, earned on top) */
.payout-kids { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.payout-kid-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.payout-kid-avatar { font-size: 1.3rem; flex-shrink: 0; }
.payout-kid-name { font-size: .88rem; font-weight: 600; min-width: 64px; }
.payout-kid-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.payout-kid-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
  min-width: 0;
}
.payout-kid-bar--potential { background: #fde68a; }
.payout-kid-bar--earned    { /* color set inline */ }
.payout-kid-pts {
  font-size: .75rem;
  color: var(--muted);
  min-width: 52px;
  text-align: right;
  white-space: nowrap;
}
.payout-kid-euro {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 52px;
  text-align: right;
}
.payout-kid-euro.payout-scaled { color: #f59e0b; }
.payout-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.payout-total-row strong { font-size: 1.1rem; color: var(--text); }
.payout-loading { color: var(--muted); font-size: .85rem; padding: 12px 0; }

.leaderboard { max-width: 960px; margin: 0 auto; padding: 0 16px 24px; }
.leaderboard > div { display: flex; gap: 16px; }
.lb-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border-radius: 16px;
  padding: 24px 16px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.lb-medal { font-size: 2rem; margin-bottom: 6px; }
.lb-avatar { font-size: 2.6rem; margin-bottom: 6px; }
.lb-card-name { font-size: 1rem; font-weight: 700; color: #1a1a1a; margin-bottom: 12px; }
.lb-card-pts { font-size: 3rem; font-weight: 800; color: #1a1a1a; line-height: 1; }
.lb-card-pts-label { font-size: .75rem; color: #9ca3af; font-weight: 600; letter-spacing: .05em; margin-top: 4px; text-transform: uppercase; }
.lb-history-btn {
  margin-top: 14px;
  font-size: .75rem;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lb-history-btn:hover { background: var(--border); color: var(--text); }

/* ── Kid History Modal ───────────────────────────────────────────────────────── */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.history-modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  width: min(560px, 94vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.history-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-modal-title { font-size: 1.15rem; font-weight: 700; }
.history-modal-subtitle { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.history-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 2px 4px;
}
.history-close-btn:hover { color: var(--text); }
.history-modal-body {
  overflow-y: auto;
  padding: 12px 22px 20px;
  flex: 1;
}
.history-loading, .history-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  font-size: .9rem;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: none; }
.history-row-delta {
  font-size: 1rem;
  font-weight: 800;
  min-width: 44px;
  text-align: right;
  flex-shrink: 0;
}
.history-row--positive .history-row-delta { color: #059669; }
.history-row--negative .history-row-delta { color: #dc2626; }
.history-row-detail { flex: 1; min-width: 0; }
.history-row-desc { font-size: .85rem; font-weight: 500; line-height: 1.3; }
.history-row-meta { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.history-row-balance {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Approval states ────────────────────────────────────────────────────────── */
.chore-card.pending { opacity: .75; border-color: #f59e0b; }
.chore-card.pending .chore-check { background: #fef3c7; border-color: #f59e0b; }
.chore-card.approved { opacity: .7; }
.chore-card.approved .chore-check { background: var(--success); border-color: var(--success); }
.chore-card.approved .chore-pts { color: #065f46; background: #d1fae5; border-color: #6ee7b7; }
.chore-card.rejected { border-color: var(--danger); }
.chore-card.rejected .chore-check { background: #fee2e2; border-color: var(--danger); }
.status-label {
  font-size: .72rem;
  font-weight: 600;
  margin-top: 3px;
}
.status-label.pending  { color: #d97706; }
.status-label.approved { color: var(--success); }
.status-label.rejected { color: var(--danger); }

/* ── Trade button & picker ──────────────────────────────────────────────────── */
.trade-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .72rem;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .2s, color .2s;
}
.trade-btn:hover { border-color: var(--accent); color: var(--accent); }
.trade-picker {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.trade-sibling-btn {
  font-size: .8rem;
  padding: 5px 12px;
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  background: none;
  color: var(--accent);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.trade-sibling-btn:hover { background: var(--accent); color: #fff; }
.trade-status {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

/* ── Trade requests section ─────────────────────────────────────────────────── */
.trade-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.trade-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.trade-request-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  flex-wrap: wrap;
}
.trade-request-item:last-child { border-bottom: none; }
.trade-actions { display: flex; gap: 6px; margin-left: auto; }
.btn-accept {
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: .8rem;
  cursor: pointer;
}
.btn-decline {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: .8rem;
  cursor: pointer;
}
.traded-from-label {
  font-size: .72rem;
  background: #ede9fe;
  color: #5b21b6;
  border-radius: 99px;
  padding: 2px 8px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Pending approval section (parent) ──────────────────────────────────────── */
.approval-section {
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 0 16px;
}
.approval-card {
  background: #fffbeb;
  border: 2px solid #f59e0b;
  border-radius: var(--radius);
  padding: 16px 20px;
}
.approval-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #fde68a;
  font-size: .9rem;
  flex-wrap: wrap;
}
.approval-item:last-child { border-bottom: none; }
.approval-kid { font-weight: 700; min-width: 80px; }
.approval-chore { flex: 1; }
.approval-actions { display: flex; gap: 6px; margin-left: auto; }

/* ── Email log section (parent) ─────────────────────────────────────────────── */
.email-section {
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 0 16px;
}
.email-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.email-status-line { font-size: .95rem; margin-bottom: 12px; }
.email-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.email-log-table th {
  text-align: left;
  padding: 4px 8px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.email-log-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
}
.email-log-table tr:last-child td { border-bottom: none; }

/* ── Chore status badge in parent view ──────────────────────────────────────── */
.chore-status-badge {
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.csb-pending  { background: #f59e0b; }
.csb-approved { background: var(--success); }
.csb-rejected { background: var(--danger); }

/* ── Custom badge for custom tasks ─────────────────────────────────────────── */
.diff-Custom { background: #6366f1; }

/* ── Task management section ────────────────────────────────────────────────── */
.task-mgmt-section {
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 0 16px;
}
.task-mgmt-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

/* ── Add-task form ──────────────────────────────────────────────────────────── */
.task-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 16px;
}
.task-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-form-field--inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.task-form-field--inline label { white-space: nowrap; }
.task-form-field--inline input[type=number] { width: 80px; }
.task-form-hint {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
}
.rotating-start-preview {
  margin-top: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: #059669;
  min-height: 18px;
}

.task-form label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.task-form input[type=text],
.task-form input[type=number] {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
  background: #fafafa;
  color: var(--text);
}
.task-form input[type=text]:focus,
.task-form input[type=number]:focus {
  border-color: var(--accent);
  background: #fff;
}

/* ── Toggle button groups ───────────────────────────────────────────────────── */
.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.day-btn,
.kid-btn {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: #fff;
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.day-btn:hover,
.kid-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.day-btn.active,
.kid-btn.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.shortcut-btn {
  padding: 5px 13px;
  border: 1.5px dashed var(--border);
  border-radius: 99px;
  background: none;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.shortcut-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.task-form-error {
  font-size: .84rem;
  color: var(--danger);
  background: #fee2e2;
  border-radius: 8px;
  padding: 8px 12px;
}

.btn-add-task {
  align-self: flex-start;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-add-task:hover { opacity: .88; }
.btn-add-task:disabled { opacity: .5; cursor: default; }
.btn-add-task--rotating {
  background: linear-gradient(135deg, #059669, #0d9488);
}
.btn-add-task--cancel {
  background: #6b7280;
}
.task-mgmt-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

/* ── Task list ──────────────────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 6px; }
.task-list-empty {
  font-size: .88rem;
  color: var(--muted);
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}
.task-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .88rem;
  flex-wrap: wrap;
}
.task-list-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.task-list-name {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-list-meta {
  font-size: .75rem;
  color: var(--muted);
}
.task-delete-btn {
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .85rem;
  color: var(--danger);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  line-height: 1;
}
.task-delete-btn:hover {
  background: #fee2e2;
  border-color: var(--danger);
}
.task-list-item--critical {
  background: #fff5f5;
  border-color: #fca5a5;
}
.task-critical-btn {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  line-height: 1;
}
.task-critical-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.task-critical-btn--on {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.task-critical-btn--on:hover {
  background: var(--bg);
  border-color: var(--border);
  color: var(--muted);
}
/* Rotating task critical toggle — shares the same visual style */
.rotating-critical-btn {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  line-height: 1;
}
.rotating-critical-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.rotating-critical-btn--on {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
.rotating-critical-btn--on:hover {
  background: var(--bg);
  border-color: var(--border);
  color: var(--muted);
}

/* ── Task library ────────────────────────────────────────────────────────────── */
.task-library-wrap {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.task-library-label {
  font-size: .75rem;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.task-library-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-lib-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 99px;
  padding: 5px 12px 5px 14px;
  font-size: .85rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.task-lib-chip:hover {
  border-color: #1a1a1a;
  background: #f3f4f6;
}
.task-lib-pts {
  font-size: .72rem;
  color: #9ca3af;
  font-weight: 700;
}
.task-lib-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  margin-left: 2px;
  transition: color .15s;
}
.task-lib-remove:hover { color: #ef4444; }

.task-save-lib-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .8rem;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}
.task-save-lib-btn:hover {
  background: #fef9c3;
  border-color: #fbbf24;
  color: #92400e;
}

/* ── Schedule editor ────────────────────────────────────────────────────────── */
.schedule-section {
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 0 16px;
}
.schedule-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

/* Kid tabs */
.schedule-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.schedule-tabs::-webkit-scrollbar { display: none; }

.schedule-tab {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: #fff;
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.schedule-tab:hover { border-color: var(--accent); color: var(--accent); }
.schedule-tab.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

/* Day tabs */
.schedule-day-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.schedule-day-tabs::-webkit-scrollbar { display: none; }

.schedule-day-tab {
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.schedule-day-tab:hover { border-color: var(--accent); color: var(--accent); }
.schedule-day-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Task list */
.schedule-task-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.sched-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
  gap: 10px;
  flex-wrap: wrap;
}
.sched-select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .84rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.sched-delete-selected-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.schedule-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .88rem;
}
.schedule-task-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #1a1a1a;
}
.schedule-task-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

/* Inline points editor */
.sched-pts-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sched-pts-input {
  width: 52px;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: .82rem;
  text-align: center;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.sched-pts-input:focus { border-color: #1a1a1a; }
.sched-pts-label {
  font-size: .78rem;
  color: #9ca3af;
  font-weight: 600;
}
.sched-pts-save-btn {
  padding: 4px 10px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.sched-pts-save-btn:hover { opacity: .8; }

/* Add row */
.schedule-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.schedule-add-input {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
  background: #fafafa;
  color: var(--text);
}
.schedule-add-input:focus { border-color: var(--accent); background: #fff; }
.schedule-add-points {
  width: 68px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
  background: #fafafa;
  color: var(--text);
}
.schedule-add-points:focus { border-color: var(--accent); background: #fff; }
.schedule-add-btn {
  padding: 8px 18px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
  white-space: nowrap;
}
.schedule-add-btn:hover { opacity: .85; }
.schedule-add-btn:disabled { opacity: .5; cursor: default; }

/* Save flash */
.schedule-save-flash {
  margin-top: 10px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--success);
  opacity: 0;
  transition: opacity .3s ease;
  height: 18px;
}
.schedule-save-flash.visible { opacity: 1; }

/* ── Week navigation ────────────────────────────────────────────────────────── */
.sched-week-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.sched-week-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}
.sched-week-btn:hover { border-color: var(--accent); color: var(--accent); }
.sched-week-btn--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sched-week-label {
  font-size: .8rem;
  color: var(--muted);
  margin-left: 4px;
}

/* Next-week schedule sub-sections */
.sched-subsection-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 14px 0 6px;
}
.sched-recurring-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1.5px solid var(--border);
  margin-bottom: 6px;
  opacity: .75;
}
.sched-recurring-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e5e7eb;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}
.sched-ot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid #c7d2fe;
  margin-bottom: 6px;
}
.sched-ot-badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #ede9fe;
  color: var(--accent);
  white-space: nowrap;
}
.sched-empty-section {
  font-size: .82rem;
  color: var(--muted);
  padding: 6px 2px;
  font-style: italic;
}

/* ── Kid card edit mode ──────────────────────────────────────────────────────── */
.kid-edit-btn {
  padding: 4px 10px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
}
.kid-edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.kid-edit-btn--done {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.kid-edit-btn--done:hover {
  background: #333;
  border-color: #333;
  color: #fff;
}
.chore-delete-btn {
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: .78rem;
  color: var(--danger);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  line-height: 1;
}
.chore-delete-btn:hover {
  background: #fee2e2;
  border-color: var(--danger);
}
.chore-approve-btn {
  background: none;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: .78rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  line-height: 1;
  opacity: 0;
}
.chore-row:hover .chore-approve-btn { opacity: 1; }
.chore-approve-btn:hover {
  background: #ecfdf5;
  border-color: #10b981;
}

.chore-revoke-btn {
  background: none;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: .75rem;
  color: #92400e;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
  line-height: 1;
  white-space: nowrap;
}
.chore-revoke-btn:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

/* ── Quick Task form ─────────────────────────────────────────────────────────── */
.quick-task-form {
  margin-top: 14px;
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.quick-task-title {
  font-size: .82rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 10px;
  letter-spacing: .02em;
}
.qt-existing-label {
  font-size: .74rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.qt-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.qt-chip {
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.qt-chip:hover { background: #f3f4f6; border-color: #9ca3af; }
.qt-chip--active {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}
.qt-chip-pts {
  font-size: .7rem;
  opacity: .65;
  margin-left: 3px;
}
.quick-task-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.quick-task-input {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
}
.quick-task-input:focus {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}
.quick-task-pts {
  width: 64px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  text-align: center;
}
.quick-task-pts:focus {
  border-color: #1a1a1a;
}
.quick-task-notify {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
}
.quick-task-save {
  padding: 8px 16px !important;
  font-size: .85rem !important;
}
.quick-task-error {
  margin-top: 6px;
  font-size: .8rem;
  color: #dc2626;
  min-height: 16px;
}

/* ── Audit Trail ─────────────────────────────────────────────────────────────── */
/* ── Collapsible secondary sections ─────────────────────────────────────────── */
.secondary-sections {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}
.secondary-section-wrap {
  margin-bottom: 8px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
}
.secondary-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: none;
  border: none;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  font-family: inherit;
}
.secondary-toggle-btn:hover {
  background: var(--bg);
}
.secondary-toggle-arrow {
  font-size: .8rem;
  color: var(--muted);
}
.secondary-section-body {
  border-top: 1px solid var(--border);
  padding: 4px 0;
}
/* Remove double margins inside collapsed sections */
.secondary-section-body .audit-section,
.secondary-section-body .family-settings-section,
.secondary-section-body .email-section {
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.secondary-section-body .audit-card,
.secondary-section-body .family-settings-card,
.secondary-section-body .email-card {
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.audit-section {
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 0 16px;
}
.audit-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}
.audit-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.audit-filter-group,
.audit-limit-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.audit-limit-label {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 600;
}
.audit-filter-btn {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: #fff;
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.audit-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.audit-filter-btn.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.audit-table thead th {
  text-align: left;
  padding: 6px 10px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.audit-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.audit-table tr:last-child td { border-bottom: none; }
.audit-row-even { background: #fff; }
.audit-row-odd  { background: #fafafa; }
.audit-td-time {
  white-space: nowrap;
  font-size: .78rem;
  color: var(--muted);
}
.audit-pts-pos {
  color: var(--success);
  font-weight: 700;
  font-size: .82rem;
}
.audit-pts-neg {
  color: var(--danger);
  font-weight: 700;
  font-size: .82rem;
}
.audit-empty {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 20px 0;
  font-size: .9rem;
}
.audit-load-more-btn {
  padding: 8px 22px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.audit-load-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.audit-del-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  color: #9ca3af;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.audit-del-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
.audit-recalc-btn {
  margin-left: auto;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.audit-recalc-btn:hover {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #059669;
}

/* ── Task Checklists ─────────────────────────────────────────────────────────── */

/* Button on parent kid cards */
.chore-checklist-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: .75rem;
  padding: 2px 7px;
  cursor: pointer;
  color: #6b7280;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.chore-checklist-btn:hover {
  background: #f0fdf4;
  border-color: #6ee7b7;
  color: #059669;
}
.chore-checklist-btn--empty {
  opacity: .4;
}
.chore-checklist-btn--empty:hover {
  opacity: 1;
}

/* Pill on kid dashboard */
.chore-checklist-pill {
  background: #f0fdf4;
  border: 1px solid #6ee7b7;
  border-radius: 20px;
  font-size: .72rem;
  padding: 2px 9px;
  cursor: pointer;
  color: #059669;
  font-weight: 600;
  white-space: nowrap;
}
.chore-checklist-pill:hover {
  background: #dcfce7;
}

/* Checklist edit modal (parent) */
.checklist-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checklist-modal {
  background: #fff;
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 420px;
  width: 92%;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checklist-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.checklist-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.checklist-modal-sub {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
}
.checklist-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
}
.checklist-item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}
.checklist-editor-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.checklist-drag-handle {
  color: #ccc;
  font-size: 1rem;
  cursor: grab;
  user-select: none;
}
.checklist-editor-input {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
}
.checklist-editor-input:focus {
  border-color: var(--accent);
}
.checklist-editor-del {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: .9rem;
  padding: 4px;
  transition: color .15s;
}
.checklist-editor-del:hover { color: #dc2626; }
.checklist-add-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checklist-add-btn {
  align-self: flex-end;
}
.checklist-add-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  line-height: 1.5;
}
.checklist-add-input:focus { border-color: var(--accent); }
.checklist-add-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.checklist-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.checklist-cancel-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: .9rem;
  cursor: pointer;
  font-family: inherit;
}
.checklist-save-btn {
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 20px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}

/* Kid popover list */
.checklist-popover-item {
  font-size: .9rem;
  color: #1a1a1a;
  padding: 3px 0;
  line-height: 1.5;
}
.checklist-popover-empty {
  font-size: .85rem;
  color: #aaa;
  font-style: italic;
  list-style: none;
}

/* ── Custom badge for rotating tasks ───────────────────────────────────────── */
.diff-Rotating { background: #0891b2; }

/* ── Task type tab switcher ─────────────────────────────────────────────────── */
.task-type-tabs {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  border-radius: 99px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 16px;
}
.task-type-tab {
  padding: 6px 18px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.task-type-tab:hover { color: var(--text); }
.task-type-tab.active {
  background: var(--dark);
  color: #fff;
}

/* ── Rotation preview text ──────────────────────────────────────────────────── */
.rotation-preview {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
  min-height: 18px;
}

/* ── Rotating tasks subsection ──────────────────────────────────────────────── */
.rotating-task-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1.5px solid var(--border);
}
.rotating-task-section-header {
  font-size: .88rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Rotating today badge ───────────────────────────────────────────────────── */
.rotating-today-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 99px;
  padding: 2px 9px;
  font-size: .73rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Rotating task per-kid points ───────────────────────────────────────────── */
.task-list-item--rotating { flex-direction: column; align-items: stretch; gap: 0; }
.rotating-task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.rotating-task-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.rotating-kid-pts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1.5px solid var(--border);
}
.rotating-kid-pts-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rotating-kid-pts-row--today { font-weight: 600; }
.rotating-kid-pts-name {
  flex: 1;
  font-size: .84rem;
  color: var(--text);
}

/* ── Motivation / Goals ─────────────────────────────────────────────────────── */
.motivation-section {
  max-width: 680px;
  margin: 16px auto;
  padding: 0 16px 16px;
}

/* On the parent page, motivation spans wider like other parent sections */
.motivation-section--wide {
  max-width: 960px;
}

.motivation-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

.motivation-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.motivation-item:last-child { border-bottom: none; }

.motivation-goal {
  border-left: 4px solid #f59e0b;
  padding-left: 10px;
  background: #fffbeb;
  border-radius: 8px;
  margin: 0 -4px;
  padding-right: 4px;
}

.motivation-item-main { flex: 1; min-width: 0; }

.motivation-item-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.motivation-item-note {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-style: italic;
}

.motivation-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.motivation-goal-btn {
  background: none;
  border: 1.5px solid #f59e0b;
  border-radius: 99px;
  padding: 4px 10px;
  font-size: .75rem;
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.motivation-goal-btn:hover,
.motivation-goal-btn.active {
  background: #f59e0b;
  color: #fff;
}

.motivation-grant-btn {
  background: var(--success);
  border: none;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.motivation-grant-btn:hover { opacity: .85; }

.motivation-goal-badge {
  display: inline-flex;
  align-items: center;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
  border-radius: 99px;
  padding: 1px 8px;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}

.motivation-progress-wrap { margin-top: 6px; }
.motivation-progress-label {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.motivation-pending-label {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 4px;
}

.motivation-granted {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 99px;
  padding: 2px 10px;
  font-size: .78rem;
  font-weight: 700;
  margin-top: 4px;
}

.motivation-empty {
  font-size: .88rem;
  color: var(--muted);
  font-style: italic;
  padding: 8px 0 12px;
}

/* Add form at bottom of kid section */
.motivation-add-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.motivation-add-form input[type=text] {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  outline: none;
  background: #fafafa;
  color: var(--text);
  transition: border-color .2s;
  font-family: inherit;
}
.motivation-add-form input[type=text]:focus {
  border-color: var(--accent);
  background: #fff;
}
.motivation-add-form button {
  align-self: flex-start;
  padding: 9px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
  font-family: inherit;
}
.motivation-add-form button:hover { opacity: .88; }
.motivation-add-form button:disabled { opacity: .5; cursor: default; }

.motivation-form-error {
  font-size: .82rem;
  color: var(--danger);
  min-height: 16px;
}

/* Parent: kid group header */
.motivation-kid-group {
  margin-bottom: 20px;
}
.motivation-kid-group:last-child { margin-bottom: 0; }
.motivation-kid-header {
  font-size: .88rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.motivation-kid-pts {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

/* Parent: set-points inline row */
.motivation-parent-set-pts {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}
.motivation-pts-input {
  width: 80px;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.motivation-pts-input:focus { border-color: var(--accent); }
.motivation-set-pts-btn {
  padding: 5px 12px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
  white-space: nowrap;
  font-family: inherit;
}
.motivation-set-pts-btn:hover { opacity: .85; }

/* ── Add Task Modal ──────────────────────────────────────────────────────────── */
.task-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.task-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  padding: 28px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.task-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.task-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
}
.task-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.task-modal-close:hover { color: var(--danger); background: #fee2e2; }
.task-modal-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.task-modal-left {
  flex: 0 0 200px;
  border-right: 1.5px solid var(--border);
  padding-right: 20px;
}
.task-modal-right {
  flex: 1;
  min-width: 0;
}
.task-modal-section-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.task-chip-search {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
  background: #fafafa;
  transition: border-color .2s;
}
.task-chip-search:focus { border-color: var(--accent); background: #fff; }
.task-chip-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.task-chip-list::-webkit-scrollbar { width: 4px; }
.task-chip-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.task-chip-item {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: #fafafa;
  transition: border-color .15s, background .15s, color .15s;
  user-select: none;
}
.task-chip-item:hover {
  border-color: var(--accent);
  background: #eef2ff;
  color: var(--accent);
}
.task-chip-item.selected {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.task-modal-existing-note {
  font-size: .82rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.task-modal-pts-warning {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}
.task-modal-cancel-btn {
  padding: 10px 20px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  font-family: inherit;
}
.task-modal-cancel-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ── Family Settings ─────────────────────────────────────────────────────────── */
.family-settings-section {
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 0 16px;
}
.family-settings-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
}
.family-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.btn-add-parent {
  padding: 8px 18px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
  white-space: nowrap;
}
.btn-add-parent:hover { opacity: .82; }

.add-parent-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.add-parent-form input {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color .2s;
  min-width: 140px;
}
.add-parent-form input:focus { border-color: var(--accent); }
.add-parent-form button {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
  font-family: inherit;
  white-space: nowrap;
}
#saveParentBtn {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
}
#saveParentBtn:hover { opacity: .88; }
#cancelParentBtn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
}
#cancelParentBtn:hover { border-color: var(--text); color: var(--text); }

.family-form-error {
  width: 100%;
  font-size: .82rem;
  color: var(--danger);
  min-height: 16px;
}

.user-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  flex-wrap: wrap;
}
.user-list-row:last-of-type { border-bottom: none; }

.user-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.user-role-badge--kid    { background: #dbeafe; color: #1d4ed8; }
.user-role-badge--parent { background: #ede9fe; color: #5b21b6; }

.user-email-text {
  font-size: .8rem;
  color: var(--muted);
}
.user-email-text--none {
  font-style: italic;
  color: #9ca3af;
}

.user-inline-edit {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 4px 0 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.user-inline-edit input {
  padding: 7px 11px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color .2s;
  min-width: 130px;
}
.user-inline-edit input:focus { border-color: var(--accent); }

/* ── First Come tasks ─────────────────────────────────────────────────────── */
.first-come-section { margin-top: 18px; }
.first-come-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.fc-open-badge {
  font-size: .72rem;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.fc-claimed-badge {
  font-size: .72rem;
  font-weight: 700;
  color: #065f46;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.fc-row-badge {
  font-size: .85rem;
}
/* Kid dashboard first-come */
.chore-card--claimed {
  opacity: .45;
  pointer-events: none;
}
.fc-available-label {
  font-size: .76rem;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  border-radius: 5px;
  padding: 3px 8px;
  margin: 4px 0 5px;
  display: inline-block;
}
.fc-pending-label {
  font-size: .74rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 5px;
  padding: 4px 8px;
  margin: 4px 0 5px;
  line-height: 1.4;
}
.fc-claimed-label {
  font-size: .76rem;
  font-weight: 700;
  color: #6b7280;
  margin: 4px 0 5px;
}

/* ── History / Audit Tabs ───────────────────────────────────────────────────── */
.hist-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.hist-tab {
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s, background .15s;
}
.hist-tab:hover {
  color: var(--text);
  background: #f3f4f6;
}
.hist-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: none;
}

.hist-panel { padding-top: 4px; }

.hist-loading,
.hist-empty {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  padding: 28px 0;
}

.hist-day-group {
  margin-bottom: 20px;
}
.hist-day-label {
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
}

.hist-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  margin-bottom: 6px;
  background: #f9fafb;
  border: 1px solid var(--border);
  transition: box-shadow .15s;
}
.hist-entry:hover { box-shadow: 0 1px 6px rgba(0,0,0,.07); }

.hist-entry--approved  { border-left: 3px solid #10b981; }
.hist-entry--rejected  { border-left: 3px solid #ef4444; }
.hist-entry--pending   { border-left: 3px solid #f59e0b; }
.hist-entry--penalty   { border-left: 3px solid #dc2626; background: #fff5f5; }
.hist-entry--adjust    { border-left: 3px solid #6366f1; }
.hist-entry--assign    { border-left: 3px solid #3b82f6; }

.hist-entry-icon {
  font-size: 1.1rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.hist-entry-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hist-entry-detail {
  font-size: .86rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}
.hist-entry-time {
  font-size: .74rem;
  color: var(--muted);
}

.hist-pts {
  font-size: .78rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
}
.hist-pts--pos { background: #d1fae5; color: #065f46; }
.hist-pts--neg { background: #fee2e2; color: #991b1b; }

/* ── Calendar ───────────────────────────────────────────────────────────────── */
.cal-section {
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 0 16px;
}
.cal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  overflow: hidden;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.cal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cal-view-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cal-view-btn {
  padding: 5px 14px;
  font-size: .82rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.cal-view-btn.active {
  background: var(--accent);
  color: #fff;
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cal-nav-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background .15s;
}
.cal-nav-btn:hover { background: var(--bg); }
.cal-nav-label {
  font-size: .9rem;
  font-weight: 700;
  min-width: 160px;
  text-align: center;
}
.cal-today-btn {
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: none;
  cursor: pointer;
  color: var(--text);
  transition: background .15s;
}
.cal-today-btn:hover { background: var(--bg); }

/* Body splits grid + day panel side by side on wide screens */
.cal-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cal-grid-wrap { flex: 1; min-width: 0; }

/* ── Month grid ── */
.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-month-dow {
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 4px 0 6px;
}
.cal-month-cell {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 5px 5px;
  min-height: 58px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-month-cell:hover { border-color: var(--accent); background: #f5f3ff; }
.cal-month-cell--empty { border: none; background: none; cursor: default; min-height: 0; }
.cal-month-cell--today { border-color: #f59e0b; background: #fffbeb; }
.cal-month-cell--past { opacity: .55; }
.cal-month-day-num {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.cal-month-cell--today .cal-month-day-num {
  color: #d97706;
}

/* ── Week grid ── */
.cal-week-grid {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  gap: 3px;
}
.cal-week-corner { /* empty top-left cell aligns headers with data columns */ }
.cal-week-header-cell {
  grid-column: span 1;
  text-align: center;
  padding: 5px 2px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cal-week-dow {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.cal-week-date-num {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cal-week-date-num--today {
  background: #f59e0b;
  color: #fff;
}
.cal-week-kid-label {
  display: flex;
  align-items: center;
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 5px;
  color: var(--text);
  border-radius: 6px;
  background: var(--bg);
}
.cal-week-cell {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px;
  min-height: 50px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-week-cell:hover { border-color: var(--accent); background: #f5f3ff; }
.cal-week-cell--today { border-color: #f59e0b; background: #fffbeb; }
.cal-week-cell--past { opacity: .55; }
.cal-week-task {
  font-size: .7rem;
  font-weight: 500;
  color: var(--text);
  background: #f3f4f6;
  border-left: 3px solid #ccc;
  border-radius: 4px;
  padding: 2px 5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.cal-week-task--critical { background: #fff0f0; border-left-color: #ef4444; }
.cal-week-empty { font-size: .7rem; color: var(--muted); }

/* ── Dots (month view) ── */
.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 1px 0;
}
.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cal-dot--critical {
  box-shadow: 0 0 0 2px #fca5a5;
}

/* ── Day panel ── */
.cal-day-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 620px;
  overflow-y: auto;
}
.cal-day-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1.5px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}
.cal-day-panel-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}
.cal-day-panel-close {
  border: none;
  background: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 5px;
  line-height: 1;
}
.cal-day-panel-close:hover { background: var(--border); }
.cal-day-panel-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 12px; }
.cal-panel-loading { text-align: center; color: var(--muted); font-size: .85rem; padding: 16px 0; }
.cal-panel-kid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cal-panel-kid-header {
  font-size: .84rem;
  padding: 3px 0 3px 8px;
  border-left: 3px solid var(--border);
  font-weight: 600;
}
.cal-panel-tasks { display: flex; flex-direction: column; gap: 4px; }
.cal-panel-no-tasks { font-size: .78rem; color: var(--muted); padding-left: 4px; }
.cal-panel-task-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 7px;
}
.cal-panel-task-row--critical { border-left: 3px solid #ef4444; background: #fff5f5; }
.cal-panel-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cal-panel-task-name { font-weight: 500; overflow-wrap: break-word; word-break: break-word; }
.cal-fc-status { font-size: .72rem; font-weight: 500; }
.cal-fc-status--open    { color: #7c3aed; }
.cal-fc-status--pending { color: #d97706; }
.cal-fc-status--taken   { color: #6b7280; }
.cal-fc-status--won     { color: #16a34a; }
.cal-panel-task-badge {
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cal-panel-task-pts {
  font-size: .74rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.cal-panel-delete-btn {
  border: none;
  background: none;
  font-size: .85rem;
  cursor: pointer;
  opacity: 0;
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: opacity .15s;
}
.cal-panel-task-row:hover .cal-panel-delete-btn { opacity: 1; }

/* ── Delete series dialog ────────────────────────────────────────────────────── */
.cal-delete-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.cal-delete-dialog {
  background: var(--card);
  border-radius: 14px;
  padding: 24px 20px 18px;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.cal-delete-dialog-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}
.cal-delete-dialog-msg {
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.cal-delete-dialog-btns {
  display: flex;
  gap: 8px;
}
.cal-delete-day-btn,
.cal-delete-series-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: .82rem;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.cal-delete-day-btn strong,
.cal-delete-series-btn strong { font-size: .85rem; }
.cal-delete-day-btn small,
.cal-delete-series-btn small { color: var(--muted); font-size: .74rem; }
.cal-delete-day-btn:hover {
  border-color: var(--accent);
  background: #eef2ff;
}
.cal-delete-series-btn:hover {
  border-color: #e11d48;
  background: #fff1f2;
}

.cal-panel-add-wrap { margin-top: 2px; }
.cal-panel-add-btn {
  width: 100%;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 600;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, color .15s;
}
.cal-panel-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-add-input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .83rem;
}
.cal-add-input:focus { outline: none; border-color: var(--accent); }
.cal-add-pts-input {
  width: 80px;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .83rem;
}
.cal-add-pts-input:focus { outline: none; border-color: var(--accent); }
.cal-add-form-btns { display: flex; gap: 6px; }

@media (max-width: 600px) {
  .cal-body { flex-direction: column; }
  .cal-day-panel { width: 100%; max-height: 400px; }
  .cal-week-grid { grid-template-columns: 60px repeat(7, 1fr); }
  .cal-week-kid-label { font-size: .7rem; padding: 3px; }
  .cal-week-task { font-size: .62rem; }
}

/* ── Calendar panel — task status & actions ────────────────────────────────── */
.cal-task-status-icon {
  font-size: .85rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.cal-task-actions {
  display: flex;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
}
.cal-action-btn {
  border: none;
  background: none;
  font-size: .8rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
  opacity: 0;
  transition: opacity .15s, background .15s;
  line-height: 1;
}
.cal-panel-task-row:hover .cal-action-btn { opacity: 1; }
.cal-action-approve:hover { background: #d1fae5; }
.cal-action-reject:hover  { background: #fee2e2; }
.cal-action-edit:hover    { background: #e0e7ff; }
.cal-pts-save-btn {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 5px;
  border: 1.5px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  line-height: 1.4;
}
.cal-task-approved { background: #f0fdf4; border-color: #86efac; }
.cal-task-pending  { background: #fffbeb; border-color: #fde68a; }
.cal-task-rejected { background: #fef2f2; border-color: #fca5a5; opacity: .7; }
.cal-task-crit { font-size: .75rem; margin-right: 2px; }
.cal-panel-kid-count {
  margin-left: auto;
  font-size: .74rem;
  font-weight: 400;
  color: var(--muted);
}
.cal-panel-add-section { margin-top: 4px; }

/* ── Calendar type form ─────────────────────────────────────────────────────── */
.cal-type-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-top: 6px;
}
.cal-type-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.cal-type-btns {
  display: flex;
  gap: 6px;
}
.cal-type-btn {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: border-color .15s, background .15s, color .15s;
  color: var(--muted);
}
.cal-type-btn small { font-weight: 400; color: var(--muted); display: block; }
.cal-type-btn.active {
  border-color: var(--accent);
  background: #eef2ff;
  color: var(--accent);
}
.cal-type-btn.active small { color: var(--accent); }
.cal-kid-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cal-kid-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .82rem;
  cursor: pointer;
}
.cal-form-hint {
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.4;
}
.cal-day-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.cal-day-pill {
  cursor: pointer;
}
.cal-day-pill input[type="checkbox"] {
  display: none;
}
.cal-day-pill span {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  transition: border-color .12s, background .12s, color .12s;
  user-select: none;
}
.cal-day-pill input[type="checkbox"]:checked + span {
  border-color: var(--accent);
  background: #eef2ff;
  color: var(--accent);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .task-modal-body { flex-direction: column; }
  .task-modal-left {
    flex: none;
    width: 100%;
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    padding-right: 0;
    padding-bottom: 16px;
    margin-bottom: 4px;
  }
  .task-chip-list { max-height: 160px; }
}
@media (max-width: 480px) {
  .site-header h1 { font-size: 1.1rem; }
  .chore-card { padding: 11px 12px; }
  .chore-name { font-size: .9rem; }
  .task-modal { padding: 18px; }
}

/* ── Daily Bucket (parent) ──────────────────────────────────────────────────── */
.daily-bucket-section {
  max-width: 960px;
  margin: 0 auto 16px;
  padding: 0 16px;
}
.daily-bucket-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
}
.daily-bucket-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}
.daily-bucket-subtitle { font-size: .82rem; color: var(--muted); margin-bottom: 16px; }

.daily-bucket-budget-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  flex-wrap: wrap;
}
.daily-bucket-budget-display {
  font-size: .95rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1.5px dashed var(--accent);
}
.daily-bucket-budget-display:hover { background: #eef2ff; }
.daily-bucket-budget-input {
  width: 72px;
  font-size: .95rem;
  padding: 3px 8px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  font-weight: 700;
}
.daily-bucket-budget-note { font-size: .8rem; color: var(--muted); }
.daily-bucket-budget-note--over { color: #dc2626; font-weight: 600; }

.daily-bucket-pending {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.daily-bucket-pending-title { font-size: .8rem; font-weight: 700; color: #92400e; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.db-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #fde68a;
}
.db-pending-row:last-child { border-bottom: none; }
.db-pending-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.db-pending-name { font-weight: 600; font-size: .9rem; }
.db-pending-kid { font-size: .82rem; color: var(--muted); }
.db-pending-pts { font-size: .82rem; font-weight: 600; color: var(--accent); }
.db-pending-actions { display: flex; gap: 6px; flex-shrink: 0; }
.db-approve-btn { background: #16a34a; color: #fff; border: none; border-radius: 6px; padding: 4px 10px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.db-approve-btn:hover { background: #15803d; }
.db-reject-btn { background: #dc2626; color: #fff; border: none; border-radius: 6px; padding: 4px 10px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.db-reject-btn:hover { background: #b91c1c; }

.daily-bucket-task-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.daily-bucket-empty { font-size: .875rem; color: var(--muted); text-align: center; padding: 16px 0; }
.daily-bucket-loading { font-size: .875rem; color: var(--muted); padding: 8px 0; }

.db-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
}
.db-task-row--inactive { opacity: .5; }
.db-task-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.db-task-name { font-weight: 600; font-size: .9rem; }
.db-task-pts { font-size: .82rem; font-weight: 700; color: var(--accent); }
.db-task-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.db-status { font-size: .75rem; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.db-status--open { background: #d1fae5; color: #065f46; }
.db-status--claimed { background: #dbeafe; color: #1e40af; }
.db-status--pending { background: #fef3c7; color: #92400e; }

/* Toggle switch */
.db-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.db-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.db-toggle-slider {
  width: 34px; height: 18px;
  background: #d1d5db;
  border-radius: 9px;
  position: relative;
  transition: background .2s;
}
.db-toggle-slider::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
}
.db-toggle input:checked + .db-toggle-slider { background: var(--accent); }
.db-toggle input:checked + .db-toggle-slider::after { left: 18px; }

.db-delete-btn { background: none; border: none; font-size: 1rem; cursor: pointer; padding: 2px 4px; opacity: .5; }
.db-delete-btn:hover { opacity: 1; }

.daily-bucket-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.daily-bucket-name-input {
  flex: 1;
  min-width: 140px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}
.daily-bucket-pts-input {
  width: 64px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
}
.daily-bucket-add-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.daily-bucket-add-btn:hover { background: #3730a3; }

/* ── Daily Bucket (kids dashboard) ─────────────────────────────────────────── */
.daily-bucket-kid-section {
  background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
  border: 2px solid #fcd34d;
  border-radius: 16px;
  padding: 18px 18px;
  margin-bottom: 20px;
}
.daily-bucket-kid-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.daily-bucket-kid-icon { font-size: 1.8rem; line-height: 1; }
.daily-bucket-kid-title { font-size: 1rem; font-weight: 700; color: #92400e; }
.daily-bucket-kid-subtitle { font-size: .78rem; color: #b45309; margin-top: 2px; }

.bucket-card {
  background: #fff;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.bucket-card--won { border-color: #86efac; background: #f0fdf4; }
.bucket-card--claimed { border-color: #bfdbfe; background: #eff6ff; opacity: .75; }
.bucket-card--pending { border-color: #fcd34d; background: #fffbeb; }
.bucket-card--other { opacity: .7; }
.bucket-card-main { flex: 1; min-width: 0; }
.bucket-card-name { font-weight: 600; font-size: .95rem; color: var(--text); }
.bucket-card-pts { font-size: .82rem; font-weight: 700; color: #d97706; margin-top: 2px; }
.bucket-card-action { flex-shrink: 0; }

.bucket-claim-btn {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.bucket-claim-btn:hover { background: #d97706; }
.bucket-unclaim-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .8rem;
  color: var(--muted);
  cursor: pointer;
  margin-top: 4px;
}
.bucket-won-label { font-size: .85rem; font-weight: 700; color: #16a34a; }
.bucket-claimed-label { font-size: .82rem; color: #1e40af; }
.bucket-pending-label { font-size: .82rem; color: #92400e; font-weight: 600; }
.bucket-other-label { font-size: .78rem; color: var(--muted); max-width: 200px; }

/* ── First-Come section (kids dashboard) ────────────────────────────────────── */
.fc-section {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 18px 18px 14px;
  margin-bottom: 16px;
}
.fc-section-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.fc-section-icon { font-size: 1.8rem; line-height: 1; }
.fc-section-title { font-size: 1rem; font-weight: 700; color: #92400e; }
.fc-section-subtitle { font-size: .78rem; color: #b45309; margin-top: 2px; }

.fc-task-card {
  background: #fff;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fc-task-card:last-child { margin-bottom: 0; }
.fc-task-card--blocked { opacity: .7; }
.fc-task-card--won { border-color: #86efac; background: #f0fdf4; }

.fc-task-main { flex: 1; min-width: 0; }
.fc-task-name { font-weight: 700; font-size: 1rem; color: var(--text); margin-bottom: 3px; }
.fc-task-pts { font-size: .82rem; font-weight: 700; color: #d97706; margin-bottom: 5px; }

.fc-card-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
}
.fc-card-badge--open    { background: #d1fae5; color: #065f46; }
.fc-card-badge--waiting { background: #fef3c7; color: #92400e; }
.fc-card-badge--won     { background: #bbf7d0; color: #14532d; }
.fc-card-badge--claimed { background: #e0e7ff; color: #3730a3; }
.fc-card-badge--pending { background: #fef3c7; color: #92400e; }
.fc-card-badge--rejected{ background: #fee2e2; color: #991b1b; }

.fc-task-btn {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 9px 16px;
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s;
}
.fc-task-btn:hover { background: #d97706; }
.fc-task-btn--undo {
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
}
.fc-task-btn--undo:hover { background: #f3f4f6; }

/* ── Assigned tasks section label ────────────────────────────────────────────── */
.task-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 2px;
}
.task-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Assigned tasks section (kids dashboard) — styled like Daily Bucket ────── */
.assigned-section {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 2px solid #a5b4fc;
  border-radius: 16px;
  padding: 18px 18px 14px;
  margin-bottom: 16px;
}
.assigned-section-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.assigned-section-icon { font-size: 1.8rem; line-height: 1; }
.assigned-section-title { font-size: 1rem; font-weight: 700; color: #3730a3; }
.assigned-section-subtitle { font-size: .78rem; color: #4f46e5; margin-top: 2px; }

.assigned-progress-bg {
  height: 6px;
  background: #c7d2fe;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 14px;
}
.assigned-progress-fill {
  height: 100%;
  background: #4f46e5;
  border-radius: 99px;
  transition: width .4s ease;
}

/* Chore cards inside assigned section — match bucket-card style */
.assigned-section .chore-list { display: flex; flex-direction: column; gap: 8px; }
.assigned-section .chore-card {
  background: #fff;
  border: 1.5px solid #c7d2fe;
  border-radius: 12px;
  padding: 12px 14px;
  gap: 12px;
  box-shadow: none;
  margin-bottom: 0;
}
.assigned-section .chore-card:hover { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.assigned-section .chore-card.pending { border-color: #f59e0b; }
.assigned-section .chore-card.approved { border-color: #86efac; background: #f0fdf4; }
.assigned-section .chore-card.rejected { border-color: #fca5a5; }
.assigned-section .chore-card--critical { border-color: #f87171; background: #fff5f5; }

/* ── Weekly payout — per-kid comparison bars & payout records ────────────── */
.payout-kid-block {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.payout-kid-block:last-child { border-bottom: none; margin-bottom: 0; }
.payout-kid-block--over { background: #fff5f5; border-radius: 10px; padding: 8px 10px; border-bottom: none; margin-bottom: 8px; }

.payout-kid-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.payout-kid-name  { font-weight: 700; font-size: .9rem; flex: 1; }
.payout-kid-euro  { font-size: .9rem; font-weight: 700; color: var(--accent); }
.payout-kid-avatar { font-size: 1.2rem; flex-shrink: 0; }

.payout-add-btn {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.payout-add-btn:hover { background: #f0fdf4; border-color: #22c55e; color: #16a34a; }

/* Single multi-color bar: payout vs earned */
.payout-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.payout-bar-track {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  background: #e2e8f0;
}
.payout-bar-track--over {
  outline: 2px solid #fca5a5;
  outline-offset: 1px;
}
.payout-bar-seg {
  height: 100%;
  transition: width .4s ease;
}
.payout-bar-seg--payout { background: #22c55e; }
.payout-bar-seg--earned { background: var(--accent); opacity: .35; }
.payout-bar-seg--over {
  background: repeating-linear-gradient(
    45deg,
    #ef4444, #ef4444 5px,
    #fca5a5 5px, #fca5a5 10px
  );
}
.payout-bar-pts { font-size: .75rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.payout-bar-chip {
  font-size: .72rem; font-weight: 700; white-space: nowrap;
  padding: 2px 7px; border-radius: 5px; flex-shrink: 0;
}
.payout-bar-chip--none { color: var(--muted); background: #f1f5f9; }
.payout-bar-chip--ok   { color: #166534; background: #dcfce7; }
.payout-bar-chip--over { color: #dc2626; background: #fee2e2; }

.payout-records { display: flex; flex-direction: column; gap: 5px; margin: 2px 0 6px 32px; }
.payout-record {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: .82rem;
  flex-wrap: wrap;
}
.payout-record--unpaid { background: #fffbeb; border: 1px solid #fcd34d; }
.payout-record--paid   { background: #f0fdf4; border: 1px solid #86efac; opacity: .85; }
.payout-record--pending { background: #f5f3ff; border: 1px solid #c4b5fd; }
.payout-record-icon { font-size: 1rem; flex-shrink: 0; }
.payout-record-pts  { font-weight: 700; color: var(--text); min-width: 36px; }
.payout-record-ref  {
  font-size: .75rem; color: #92400e; background: #fef3c7;
  padding: 2px 7px; border-radius: 5px; font-family: monospace;
  cursor: default; flex: 1;
}
.payout-record-status { font-size: .78rem; color: var(--muted); flex: 1; }
.payout-record-pay {
  background: #16a34a; color: #fff; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: .78rem; font-weight: 700; cursor: pointer;
  font-family: inherit; flex-shrink: 0;
}
.payout-record-pay:hover { background: #15803d; }
.payout-record-del {
  background: none; border: none; cursor: pointer; font-size: .9rem;
  color: var(--muted); flex-shrink: 0; padding: 2px 4px; line-height: 1;
}
.payout-record-del:hover { color: #dc2626; }

.payout-create-row {
  display: flex; align-items: center; gap: 6px;
  margin: 2px 0 6px 32px;
}
.payout-create-input {
  width: 64px; padding: 5px 8px; border: 1.5px solid #86efac;
  border-radius: 7px; font-size: .85rem; font-family: inherit;
  text-align: center; outline: none;
}
.payout-create-save {
  background: #22c55e; color: #fff; border: none; border-radius: 7px;
  padding: 5px 12px; font-size: .82rem; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.payout-create-cancel {
  background: none; border: none; cursor: pointer; font-size: .9rem;
  color: var(--muted); padding: 2px 4px;
}

/* ── Quick FC Task button & modal ────────────────────────────────────────── */
.btn-quick-fc {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
.btn-quick-fc:hover { background: #d97706; }

.quick-fc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.quick-fc-modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  overflow: hidden;
}
.quick-fc-modal-header {
  background: #f59e0b;
  color: #fff;
  padding: 18px 22px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.quick-fc-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  opacity: .85;
}
.quick-fc-close:hover { opacity: 1; }
.quick-fc-modal-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.quick-fc-field { display: flex; flex-direction: column; gap: 5px; }
.quick-fc-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.quick-fc-input {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  background: #fafafa;
  color: var(--text);
  transition: border-color .2s;
}
.quick-fc-input:focus { border-color: #f59e0b; }
.quick-fc-pts {
  width: 80px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  background: #fafafa;
  color: var(--text);
}
.quick-fc-kids { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-fc-kid {
  padding: 7px 14px;
  border: 2px solid var(--border);
  border-radius: 99px;
  background: #fff;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  transition: all .15s;
}
.quick-fc-kid.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
.quick-fc-notify-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text);
}
.quick-fc-error { font-size: .82rem; color: #dc2626; min-height: 16px; }
.quick-fc-submit {
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.quick-fc-submit:hover { background: #d97706; }
.quick-fc-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ── Payout request — kid dashboard ──────────────────────────────────────── */
.payout-request-section {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #86efac;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.payout-request-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.payout-request-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.payout-request-title { font-size: 1rem; font-weight: 700; color: #166534; }
.payout-request-subtitle { font-size: .78rem; color: #4d7c0f; margin-top: 2px; }

.payout-pending-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #86efac;
  border-radius: 12px;
  padding: 12px 16px;
}
.payout-pending-text { font-size: .9rem; color: #166534; }
.payout-cancel-btn {
  background: none;
  border: 1.5px solid #86efac;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: .8rem;
  color: #166534;
  cursor: pointer;
  font-family: inherit;
}
.payout-cancel-btn:hover { background: #dcfce7; }

.payout-notice {
  font-size: .85rem;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.payout-notice--approved { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.payout-notice--denied   { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* Balance hero — big obvious display of what's available */
.payout-balance-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 1.5px solid #d1fae5;
}
.payout-balance-amount {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}
.payout-balance-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* CTA pointing kids to tasks when balance is zero/low */
.payout-empty-cta {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .87rem;
  color: #92400e;
  line-height: 1.5;
  margin-top: 8px;
}

.payout-negative-balance {
  font-size: .85rem;
  color: #9f1239;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 10px 14px;
  line-height: 1.5;
}
.payout-low-balance {
  font-size: .85rem;
  color: #4d7c0f;
  margin-bottom: 2px;
}

.payout-form { display: flex; flex-direction: column; gap: 6px; }
.payout-form-balance { font-size: .9rem; color: #166534; font-weight: 500; }
.payout-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.payout-amount-input {
  width: 80px;
  padding: 8px 10px;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: #166534;
  outline: none;
  text-align: center;
  font-weight: 700;
}
.payout-amount-input:focus { border-color: #22c55e; }
.payout-form-pts-label { font-size: .85rem; color: #4d7c0f; font-weight: 600; }
.payout-submit-btn {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 18px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.payout-submit-btn:hover { background: #16a34a; }
.payout-form-hint { font-size: .75rem; color: #4d7c0f; }
.payout-form-error { font-size: .8rem; color: #dc2626; min-height: 16px; }

/* ── Payout Requests — parent dashboard ──────────────────────────────────── */
.payout-requests-section {
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 0 16px;
}
.payout-requests-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 24px;
  border-top: 4px solid #22c55e;
}
.payout-requests-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.payout-req-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #22c55e;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 99px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
}
.payout-req-group-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #166534;
  margin-bottom: 8px;
}
.payout-req-empty {
  font-size: .88rem;
  color: var(--muted);
  padding: 6px 0 10px;
}
.payout-req-resolved-toggle {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  user-select: none;
}
.payout-req-resolved-toggle:hover {
  color: var(--text);
}
.payout-req-resolved-list .payout-req-item {
  opacity: .7;
}
.payout-req-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
  margin-bottom: 8px;
}
.payout-req-item--approved { background: #f0fdf4; border-color: #86efac; opacity: .8; }
.payout-req-item--denied   { background: #fef2f2; border-color: #fca5a5; opacity: .8; }
.payout-req-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.payout-req-kid-emoji { font-size: 1.2rem; }
.payout-req-kid-name  { font-weight: 700; font-size: .95rem; color: var(--text); }
.payout-req-pts       { font-size: .9rem; font-weight: 700; color: #166534; background: #dcfce7; padding: 2px 10px; border-radius: 99px; }
.payout-req-time      { font-size: .75rem; color: var(--muted); }
.payout-req-status    { font-size: .8rem; font-weight: 600; }
.payout-req-status--approved { color: #166534; }
.payout-req-status--denied   { color: #9f1239; }
.payout-req-note { font-size: .78rem; color: var(--muted); font-style: italic; }
.payout-req-actions { display: flex; gap: 8px; flex-shrink: 0; }
.payout-approve-btn {
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.payout-approve-btn:hover { background: #16a34a; }
.payout-deny-btn {
  background: #fff;
  color: #dc2626;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.payout-deny-btn:hover { background: #fff1f2; }

/* ── FC Today Section (first-come tasks shown once above kid grid) ─── */
.fc-today-section {
  margin: 0 0 22px;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 14px;
  overflow: hidden;
}
.fc-today-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 1px solid #fcd34d;
}
.fc-today-icon { font-size: 1.2rem; line-height: 1; }
.fc-today-title {
  font-size: .88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #92400e;
}
.fc-today-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid #fef3c7;
  flex-wrap: wrap;
}
.fc-today-row:last-child { border-bottom: none; }
.fc-today-name {
  font-weight: 600;
  font-size: .92rem;
  color: var(--text);
  flex: 1;
  min-width: 120px;
}
.fc-today-pts {
  font-size: .82rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 99px;
  padding: 2px 10px;
  white-space: nowrap;
}
.fc-today-badge {
  font-size: .8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.fc-today-badge--open    { background: #dcfce7; color: #166534; }
.fc-today-badge--pending { background: #fef9c3; color: #92400e; }
.fc-today-badge--won     { background: #f0fdf4; color: #15803d; }

/* ── Lifetime Points Section ──────────────────────────────────────────────── */
.lifetime-section {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 24px 24px;
  margin-bottom: 24px;
}
.lifetime-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.lifetime-toggle-btn {
  background: none;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.lifetime-toggle-btn:hover { background: #f9fafb; }

.lifetime-totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.lifetime-kid-card {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 18px;
}
.lifetime-kid-name {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 12px;
  color: var(--text);
}
.lifetime-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.lifetime-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.lifetime-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.lifetime-stat-val--cashed   { color: #16a34a; }
.lifetime-stat-val--uncashed { color: #d97706; }
.lifetime-stat-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-top: 3px;
}
.lifetime-bar-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  margin-bottom: 6px;
}
.lifetime-bar-cashed   { background: #22c55e; height: 100%; }
.lifetime-bar-uncashed { background: #f59e0b; height: 100%; }
.lifetime-bar-legend {
  font-size: .72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.lifetime-legend-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.lifetime-legend-dot--cashed   { background: #22c55e; }
.lifetime-legend-dot--uncashed { background: #f59e0b; }

/* Week-by-week table */
.lifetime-weeks-wrap {
  overflow-x: auto;
  margin-top: 18px;
}
.lifetime-weeks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.lw-th {
  padding: 8px 12px;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  border-bottom: 2px solid #e5e7eb;
}
.lw-th--week { text-align: left; }
.lw-week {
  padding: 9px 12px;
  font-size: .8rem;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 1px solid #f3f4f6;
}
.lw-td {
  padding: 9px 12px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.lw-td--empty { color: #d1d5db; }
.lw-earned  { font-weight: 700; color: var(--text); margin-right: 4px; }
.lw-cashed  { font-size: .78rem; color: #16a34a; font-weight: 600; margin-right: 4px; }
.lw-uncashed { font-size: .78rem; font-weight: 700; }
.lw-uncashed--yes { color: #d97706; }
.lw-record-btn {
  display: block;
  margin-top: 5px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.lw-record-btn:hover { background: #15803d; }
.lw-hint {
  margin: 10px 0 0;
  font-size: .75rem;
  color: var(--muted);
  text-align: center;
}

/* ── Kid dashboard penalty alert ─────────────────────────────────────────── */
.penalty-alert-section {
  background: #fff1f2;
  border: 2px solid #fca5a5;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.penalty-alert-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.penalty-alert-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.penalty-alert-title {
  font-weight: 700;
  font-size: .95rem;
  color: #9f1239;
}
.penalty-alert-sub {
  font-size: .78rem;
  color: #be123c;
  margin-top: 2px;
}
.penalty-alert-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.penalty-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #fecdd3;
  border-radius: 10px;
  padding: 10px 14px;
}
.penalty-alert-task {
  font-weight: 700;
  font-size: .88rem;
  color: #1a1a1a;
}
.penalty-alert-reason {
  font-size: .75rem;
  color: #be123c;
  margin-top: 2px;
}
.penalty-alert-pts {
  font-size: .95rem;
  font-weight: 800;
  color: #dc2626;
  white-space: nowrap;
  flex-shrink: 0;
}
.penalty-alert-tip {
  font-size: .78rem;
  color: #9f1239;
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px solid #fecdd3;
}
