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

:root {
  --pink: #ff6b9d;
  --orange: #ffa94d;
  --yellow: #ffd43b;
  --green: #51cf66;
  --blue: #4dabf7;
  --purple: #9775fa;
  --bg: #fff6ea;
  --ink: #3b2f4a;
}

* { box-sizing: border-box; }

/* === Form fields — shared look for every input/select/textarea site-wide === */
body.kids input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=image]),
body.kids select,
body.kids textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 2px solid #f0e6ff;
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body.kids input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=image]):focus,
body.kids select:focus,
body.kids textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(151,117,250,0.15);
}
body.kids textarea { resize: vertical; }

body.kids {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito', sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #fff6ea 0%, #ffe8f0 45%, #e9f3ff 100%);
}

.kids h1, .kids h2, .kids h3, .kids-logo {
  font-family: 'Baloo 2', sans-serif;
}

.kids-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  flex-wrap: wrap;
  gap: 0.6rem;
}
.kids-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--pink);
  text-decoration: none;
}
.kids-nav-links { display: flex; flex-direction: column; gap: 0.4rem; }
.nav-row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.kids-nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: #f3f0ff;
}
.kids-nav-links a:hover { background: var(--purple); color: #fff; }
.kids-nav-links .logout { background: none; color: #999; font-weight: 600; }
.nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.6rem;
  border-left: 2px solid #f0e6ff;
}
.nav-group-label { display: none; }

.nav-toggle-check { display: none; }
.nav-toggle-btn {
  display: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
}
.nav-toggle-btn:hover { background: #f3f0ff; }

@media (max-width: 700px) {
  .nav-toggle-btn { display: block; }
  .kids-nav { padding: 0.9rem 1.2rem; }
  .kids-nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.4rem;
  }
  .nav-row { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .kids-nav-links a { text-align: center; }
  .nav-group {
    flex-direction: column;
    align-items: stretch;
    border-left: none;
    border-top: 2px solid #f0e6ff;
    padding: 0.5rem 0 0;
    margin-top: 0.1rem;
  }
  .nav-group-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    font-weight: 700;
    padding: 0.2rem 0.9rem;
  }
  .nav-toggle-check:checked ~ .kids-nav-links { display: flex; }

  .kids-container { padding: 1rem 0.8rem; }
  .cal-nav-btn { padding: 0.5rem 0.8rem; font-size: 0.82rem; }
  .cal-add-btn { width: 2.3rem; height: 2.3rem; font-size: 1.3rem; }
  .cal-strip-day { min-width: 2.4rem; padding: 0.4rem 0.2rem 0.3rem; }
  .cal-month-cell { min-height: 2.2rem; border-radius: 8px; }
  .cal-month-daynum { font-size: 0.78rem; }
  .cal-owner-dot { width: 6px; height: 6px; }
  .cal-view-btn { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
}

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

.kids-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(100,60,120,0.08);
  padding: 1.5rem;
}

.kids-login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 90vh;
}
.kids-login-card {
  background: #fff; border-radius: 24px; padding: 2.5rem 2rem;
  box-shadow: 0 10px 30px rgba(100,60,120,0.15);
  width: 100%; max-width: 360px; text-align: center;
}
.kids-login-card h1 { font-size: 2rem; margin: 0 0 1.5rem; color: var(--pink); }
.kids-login-card input { margin-bottom: 0.8rem; }
.kids-btn {
  display: inline-block; border: none; cursor: pointer;
  background: var(--pink); color: #fff; font-weight: 700;
  font-family: 'Nunito', sans-serif;
  padding: 0.75rem 1.5rem; border-radius: 999px; font-size: 1rem;
  box-shadow: 0 4px 12px rgba(255,107,157,0.4);
}
.kids-btn:hover { background: #ff4f89; }
.kids-btn.wide { width: 100%; }
.kids-error { color: #e03131; font-weight: 700; margin-bottom: 1rem; }

.kid-avatars { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin: 1.5rem 0; }
.kid-avatar {
  width: 70px; height: 70px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; color: #fff;
  font-family: 'Baloo 2', sans-serif;
  background-size: cover; background-position: center; flex-shrink: 0;
}
.kid-avatar.elad  { background-color: var(--blue); }
.kid-avatar.yael  { background-color: var(--pink); }
.kid-avatar.leah  { background-color: var(--orange); }
.kid-avatar.libby { background-color: var(--green); }
.kid-avatar.hili  { background-color: var(--purple); }

.chore-board { display: flex; gap: 1rem; flex-wrap: wrap; }
.chore-col {
  flex: 1; min-width: 220px; border-radius: 20px; padding: 1rem;
  background: #fff; box-shadow: 0 4px 14px rgba(100,60,120,0.08);
}
.chore-col-head {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem;
}
.chore-col-head .kid-avatar { width: 42px; height: 42px; font-size: 1rem; }
.chore-col-head h3 { margin: 0; font-size: 1.1rem; }
.chore-earned {
  margin-left: auto; background: #eafbee; color: #2b8a3e;
  font-weight: 800; font-size: 0.8rem; padding: 3px 10px; border-radius: 999px;
}
.chore-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.5rem; border-radius: 12px; margin-bottom: 0.4rem;
  background: #faf9fe;
}
.chore-item.done { background: #eafbee; text-decoration: line-through; opacity: 0.7; }
.chore-item input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; }
.chore-item .chore-title { flex: 1; font-weight: 700; font-size: 0.95rem; }
.chore-item .chore-pay { font-size: 0.8rem; color: #868e96; font-weight: 700; }
.chore-empty { color: #adb5bd; font-style: italic; font-size: 0.9rem; padding: 0.5rem; }

.kids-section-title {
  font-size: 1.3rem; margin: 1.5rem 0 0.8rem; color: var(--ink);
}
.kids-add-form {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end;
  background: #fff; border-radius: 16px; padding: 1rem; margin-bottom: 1.5rem;
}
.kids-add-form label { display: block; font-size: 0.75rem; font-weight: 700; color: #868e96; margin-bottom: 3px; }

.house-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.house-item {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
  background: #fff; border-radius: 16px; padding: 0.9rem 1rem; box-shadow: 0 4px 14px rgba(100,60,120,0.08);
}
.house-item.done { background: #eafbee; }
.house-item-main { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.house-item-actions select { width: auto; margin-right: 0.4rem; }
.house-turn-tag { background: #fff3bf; color: #997404; font-weight: 700; font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; }
.house-done-tag { background: #eafbee; color: #2b8a3e; font-weight: 700; font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; }
.house-btn-undo {
  border: none; cursor: pointer; background: #f1f3f5; color: #495057; font-weight: 700;
  padding: 0.5rem 1rem; border-radius: 999px; font-family: 'Nunito',sans-serif;
}
.house-solo-kids { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.house-solo-kid { display: flex; align-items: center; gap: 0.35rem; font-weight: 700; font-size: 0.9rem; }
.house-counters { display: flex; gap: 1rem; flex-wrap: wrap; }
.house-counter {
  display: flex; align-items: center; gap: 0.7rem; background: #fff; border-radius: 16px;
  padding: 0.8rem 1rem; box-shadow: 0 4px 14px rgba(100,60,120,0.08); flex: 1; min-width: 180px;
}
.house-counter-n { font-size: 1.1rem; font-weight: 800; color: var(--purple); }

.grocery-suggest {
  display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  background: #fff; border-radius: 12px; box-shadow: 0 6px 20px rgba(100,60,120,0.18); margin-top: 4px; overflow: hidden;
}
.grocery-suggest-row { padding: 0.5rem 0.8rem; cursor: pointer; font-size: 0.9rem; }
.grocery-suggest-row:hover { background: #f8f0ff; }
.grocery-health { font-weight: 700; font-size: 0.75rem; padding: 2px 9px; border-radius: 999px; }
.grocery-health-healthy { background: #eafbee; color: #2b8a3e; }
.grocery-health-moderate { background: #fff3bf; color: #997404; }
.grocery-health-treat { background: #ffe3e3; color: #c92a2a; }
.grocery-health-unrated { background: #f1f3f5; color: #495057; }
.grocery-swap { font-size: 0.75rem; color: #8a5a00; background: #fff9db; padding: 2px 8px; border-radius: 999px; }

.receipt-dropzone {
  border: 2px dashed #d0bfe8; border-radius: 14px; padding: 1rem; text-align: center;
  background: #faf7ff; transition: background 0.15s, border-color 0.15s;
}
.receipt-dropzone.drag-over { background: #f1e6ff; border-color: var(--purple); }
#rx-dropzone-hint { color: #868e96; font-size: 0.85rem; margin-bottom: 0.5rem; }

.bday-list { display: flex; flex-direction: column; gap: 1rem; }
.bday-card { background: #fff; border-radius: 20px; padding: 1.2rem 1.4rem; box-shadow: 0 6px 20px rgba(100,60,120,0.08); }
.bday-head { display: flex; align-items: center; gap: 0.9rem; }
.bday-head h3 { margin: 0 0 2px; }
.bday-countdown {
  margin-left: auto; background: #f3f0ff; color: var(--purple); font-weight: 800;
  font-size: 0.85rem; padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.bday-wishlist-title { margin: 1rem 0 0.4rem; font-size: 1rem; }
.bday-wishlist { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.bday-wishlist li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.4rem 0.2rem; border-bottom: 1px solid #f5f2fa; font-weight: 600;
}
.bday-wishlist li.bought label { text-decoration: line-through; color: #adb5bd; }
.bday-wishlist li label { display: flex; align-items: center; gap: 0.5rem; }
.bday-wishlist-del { border: none; background: none; color: #ced4da; cursor: pointer; font-weight: 700; }
.bday-wishlist-del:hover { color: #e03131; }
.bday-wishlist-add { display: flex; gap: 0.5rem; }
.bday-wishlist-add input { flex: 1; width: auto; }

.cal-week-nav { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-nav-btn { padding: 0.55rem 1rem; font-size: 0.9rem; }
.cal-add-btn {
  margin-left: auto; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: none; cursor: pointer; background: var(--pink); color: #fff;
  font-size: 1.5rem; line-height: 1; font-weight: 700;
  box-shadow: 0 4px 12px rgba(255,107,157,0.4); flex: 0 0 auto;
}
.cal-add-btn:hover { background: #ff4f89; }
.cal-strip { display: flex; gap: 0.35rem; overflow-x: auto; padding: 0.2rem 0.1rem 0.6rem; margin-bottom: 0.8rem; -webkit-overflow-scrolling: touch; }
.cal-strip-day {
  flex: 1 0 auto; min-width: 2.7rem; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: none; border-radius: 12px; padding: 0.5rem 0.3rem 0.4rem; cursor: pointer;
  box-shadow: 0 2px 8px rgba(100,60,120,0.08); color: var(--ink, #333);
}
.cal-strip-dow { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: #868e96; }
.cal-strip-num { font-size: 1.05rem; font-weight: 800; }
.cal-strip-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--purple); opacity: 0; margin-top: 1px; }
.cal-strip-day.has-events .cal-strip-dot { opacity: 1; }
.cal-strip-day.today .cal-strip-dow { color: var(--purple); }
.cal-strip-day.active { background: var(--purple); color: #fff; }
.cal-strip-day.active .cal-strip-dow { color: rgba(255,255,255,0.85); }
.cal-strip-day.active .cal-strip-dot { background: #fff; }
#cal-agenda { touch-action: pan-y; min-height: 40vh; }
.cal-agenda-day.hidden { display: none; }
.cal-agenda-head { font-weight: 800; font-size: 1rem; margin-bottom: 0.7rem; color: var(--purple); }
.cal-event { border-radius: 10px; padding: 0.6rem 0.7rem; margin-bottom: 0.5rem; background: #faf9fe; font-size: 0.9rem; }
.cal-event-owner { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.cal-owner-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cal-owner-dot.elad  { background: var(--blue); }
.cal-owner-dot.yael  { background: var(--pink); }
.cal-owner-dot.leah  { background: var(--orange); }
.cal-owner-dot.libby { background: var(--green); }
.cal-owner-dot.hili  { background: var(--purple); }
.cal-owner-dot.family { background: var(--ink); }
.cal-event-title { font-weight: 700; display: block; }
.cal-event-time { color: #868e96; font-size: 0.78rem; }
.cal-event-del { border: none; background: none; color: #ced4da; cursor: pointer; font-weight: 700; float: right; }
.cal-event-del:hover { color: #e03131; }
.cal-oot { background: #fff3bf; color: #997404; font-weight: 700; font-size: 0.7rem; padding: 1px 6px; border-radius: 999px; margin-left: 3px; }

.cal-view-toggle { display: flex; gap: 0.3rem; background: #f1edf7; border-radius: 999px; padding: 0.25rem; margin-bottom: 0.8rem; width: fit-content; }
.cal-view-btn { padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700; color: #868e96; text-decoration: none; }
.cal-view-btn.active { background: #fff; color: var(--purple); box-shadow: 0 2px 6px rgba(100,60,120,0.12); }

.cal-who-filter { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.cal-who-chip { display: inline-flex; align-items: center; gap: 5px; padding: 0.3rem 0.6rem; border-radius: 999px; background: #f1edf7; font-size: 0.8rem; font-weight: 700; color: #868e96; cursor: pointer; }
.cal-who-chip.active { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(100,60,120,0.12); }
.cal-who-chip input { margin: 0; }

.cal-month-label { font-weight: 800; color: var(--purple); font-size: 0.95rem; }
.cal-month-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: #868e96; margin-bottom: 0.3rem; }
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-month-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  aspect-ratio: 1; min-height: 2.6rem; border-radius: 10px; background: #fff; text-decoration: none;
  color: var(--ink, #333); padding: 0.3rem 0.1rem; box-shadow: 0 1px 4px rgba(100,60,120,0.06);
}
.cal-month-cell.out { opacity: 0.35; }
.cal-month-cell.today { background: var(--purple); color: #fff; }
.cal-month-daynum { font-size: 0.85rem; font-weight: 800; }
.cal-month-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 100%; }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: #fff; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 100%; max-width: 420px; margin: 1rem;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.25rem; border-bottom: 1px solid #f1f5f9;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: #6b7280; padding: 0 0.2rem; line-height: 1;
}
.modal-close:hover { color: #1a1a2e; }
.modal-box.modal-lg { max-width: 720px; }
