:root {
  /* warm, friendly palette */
  --cream: #faf6f0;
  --card: #ffffff;
  --card-2: #f6f0e8;
  --line: #eaddce;
  --ink: #40382f;
  --gray: #8c8073;

  --peach: #e08a5b;
  --peach-dark: #cf7645;
  --peach-soft: #fbeadd;

  --sage: #5f7a52;
  --sage-bg: #e6efe1;
  --amber: #a9791f;
  --amber-bg: #f6ead0;
  --red: #c0553f;
  --red-bg: #f7e2db;

  /* gentle accents for small pops of color */
  --a-peach: #e08a5b;
  --a-sage: #7fa06a;
  --a-gold: #e0b15b;
  --a-blue: #7fa1ad;

  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--peach-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.brand-icon { width: 26px; height: 26px; border-radius: 7px; display: block; }
.brand-text { font-weight: 800; font-size: 17px; letter-spacing: 0.2px; color: var(--peach); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.nav a:hover { background: var(--card-2); text-decoration: none; }
.nav a.muted { color: var(--gray); font-weight: 500; margin-left: auto; }

/* ---------- Layout ---------- */
.container { max-width: 760px; margin: 0 auto; padding: 18px 16px 60px; }
.page-title { font-size: 24px; margin: 6px 0 2px; }
h2 { font-size: 18px; margin: 22px 0 10px; }
.muted { color: var(--gray); }
.small { font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Cards / forms ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 1px 2px rgba(64, 56, 47, 0.04);
}
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > label, .row > * { flex: 1; min-width: 130px; }
.grow { flex: 1; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input, select, textarea {
  font: inherit;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input::placeholder, textarea::placeholder { color: #b3a795; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--peach);
  box-shadow: 0 0 0 3px rgba(224, 138, 91, 0.2);
}
fieldset { border: none; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.checkline { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.checkline input { width: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; border-color: var(--gray); }
.btn-primary {
  background: var(--peach); border-color: var(--peach); color: #fff;
  box-shadow: 0 3px 10px rgba(224, 138, 91, 0.28);
}
.btn-primary:hover { background: var(--peach-dark); border-color: var(--peach-dark); }
.btn-block { width: 100%; }
.btn-small { padding: 8px 12px; font-size: 14px; }
.btn-ghost { background: transparent; }
.link-small {
  background: none; border: none; color: var(--peach-dark);
  font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 6px;
}
.link-small.danger { color: var(--red); }

/* ---------- Login ---------- */
.login-wrap { min-height: 78vh; display: flex; align-items: center; justify-content: center; }
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px 24px; width: 100%; max-width: 360px; position: relative; overflow: hidden;
  box-shadow: 0 6px 24px rgba(64, 56, 47, 0.08);
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--peach);
}
.login-brand { text-align: center; margin-bottom: 20px; }
.login-icon { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto; display: block; }
.login-brand h1 { margin: 12px 0 2px; font-size: 24px; font-weight: 800; color: var(--peach); }

/* ---------- Estimate box on log form ---------- */
.estimate {
  background: var(--peach);
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 3px 10px rgba(224, 138, 91, 0.25);
}
.est-rate { font-weight: 500; opacity: 0.95; font-size: 15px; }

/* ---------- Kid chips ---------- */
.kid-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  flex-direction: row;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 11px 18px; font-weight: 700; font-size: 15px; min-height: 44px;
  cursor: pointer; user-select: none; background: #fff; color: var(--ink);
  position: relative;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--peach); }
.chip:has(input:checked) { background: var(--peach); border-color: var(--peach); color: #fff; }
.chip:has(input:checked) span::before { content: "\2713\00a0"; }

/* ---------- Stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.stat-row.tight { grid-template-columns: repeat(2, 1fr); }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center; border-top: 3px solid var(--a-peach);
  box-shadow: 0 1px 2px rgba(64, 56, 47, 0.04);
}
.stat-row .stat:nth-child(4n+1) { border-top-color: var(--a-peach); }
.stat-row .stat:nth-child(4n+2) { border-top-color: var(--a-sage); }
.stat-row .stat:nth-child(4n+3) { border-top-color: var(--a-gold); }
.stat-row .stat:nth-child(4n+4) { border-top-color: var(--a-blue); }
.stat.highlight { border-color: var(--peach); background: var(--peach-soft); border-top-color: var(--peach); }
.stat-num { display: block; font-size: 22px; font-weight: 800; }
.stat-label { display: block; font-size: 12px; color: var(--gray); margin-top: 2px; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center;
  box-shadow: 0 1px 2px rgba(64, 56, 47, 0.04);
}
.li-main { display: flex; flex-direction: column; gap: 2px; }
.li-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.amount { font-weight: 800; font-size: 16px; }

/* ---------- Badges ---------- */
.badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-paid { background: var(--sage-bg); color: var(--sage); }
.badge-unpaid { background: var(--amber-bg); color: var(--amber); }
.badge-off { background: var(--card-2); color: var(--gray); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(64, 56, 47, 0.04); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--gray); background: var(--card-2); }
tr:last-child td { border-bottom: none; }
.row-paid { background: #fbf8f3; color: var(--gray); }
.owed { color: var(--amber); }
.actions { white-space: nowrap; }

/* ---------- Filters / bulk ---------- */
.filters { display: flex; flex-direction: column; gap: 12px; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.hidden-form { display: none; }

/* ---------- Flash ---------- */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.flash-success { background: var(--sage-bg); color: var(--sage); }
.flash-error { background: var(--red-bg); color: var(--red); }

/* ---------- Impersonation banner ---------- */
.impersonate-bar {
  background: var(--ink);
  color: #fff;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.impersonate-bar strong { color: var(--amber); }
.impersonate-bar a {
  color: #fff;
  font-weight: 700;
  background: var(--peach);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.impersonate-bar a:hover { background: var(--peach-dark); text-decoration: none; }

/* ---------- Heads-up banner ---------- */
.headsup {
  background: var(--peach-soft);
  border: 1px solid var(--peach);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 6px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 15px;
}
.headsup .btn { margin-left: auto; }

/* ---------- Pay run ---------- */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 14px; }
.period-label { font-weight: 700; font-size: 16px; }
.payrun-total { font-weight: 600; color: var(--ink); white-space: nowrap; }
.li-actions { display: flex; gap: 6px; margin-top: 2px; }
.print-only { display: none; }

/* ---------- Mobile tap targets ---------- */
@media (max-width: 560px) {
  .container { padding: 16px 14px 72px; }
  .page-title { font-size: 22px; }
  .nav { gap: 2px; }
  .nav a { padding: 9px 12px; font-size: 15px; }
  .link-small { padding: 8px 10px; font-size: 15px; }
  .li-actions { gap: 12px; margin-top: 6px; }
  .btn-small { padding: 10px 14px; font-size: 15px; }
  input, select, textarea { font-size: 16px; }  /* stop iOS zoom-on-focus */
  .stat-num { font-size: 20px; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .no-print, .impersonate-bar { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  .container { max-width: none; padding: 0; }
  .card, .table-wrap, .stat { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

/* ---------- Misc admin ---------- */
.add-block summary { font-weight: 700; cursor: pointer; }
.sitter-card { display: flex; flex-direction: column; gap: 12px; }
.reset-row { border-top: 1px dashed var(--line); padding-top: 12px; align-items: flex-end; }
.add-kid { align-items: center; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kid-row.is-off { opacity: 0.55; }
.kid-row form.row { align-items: center; margin: 0; }
