/* One stylesheet for the login, kid and admin pages. Each kid page sets --brand from the business color. */
:root {
  --bg: #FBF7F0;
  --card: #FFFFFF;
  --ink: #2A2420;
  --muted: #6E645B;
  --line: #E8DFD3;
  --brand: #5B6B3A;
  --good: #2F7A3E;
  --good-bg: #E5F3E7;
  --warn: #9A5B00;
  --warn-bg: #FFF1D6;
  --bad: #B3261E;
  --bad-bg: #FCE4E1;
  --open-bg: #EEF4E6;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1C1917; --card: #26221F; --ink: #F4EEE6; --muted: #B5AA9D; --line: #3A342F;
    --good: #7FD08D; --good-bg: #1F3523; --warn: #F2B94B; --warn-bg: #3A2D14;
    --bad: #FF8A80; --bad-bg: #3D1E1B; --open-bg: #26301D; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1C1917; --card: #26221F; --ink: #F4EEE6; --muted: #B5AA9D; --line: #3A342F;
  --good: #7FD08D; --good-bg: #1F3523; --warn: #F2B94B; --warn-bg: #3A2D14;
  --bad: #FF8A80; --bad-bg: #3D1E1B; --open-bg: #26301D; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 "Nunito", system-ui, -apple-system, sans-serif;
}
h1, h2, h3 { font-family: "Lilita One", "Nunito", system-ui, sans-serif; font-weight: 400; margin: 0 0 .4em; letter-spacing: .2px; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 10px 16px;
  background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; display: inline-block;
}
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.small { padding: 6px 10px; font-size: .875rem; border-radius: 9px; }
button:disabled { opacity: .5; cursor: default; }
input, select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px; min-width: 0;
}
label { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; color: var(--muted); font-weight: 600; }
.error { color: var(--bad); font-weight: 700; min-height: 1.4em; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 800; }
.pill.late { background: var(--bad-bg); color: var(--bad); }
.pill.today { background: var(--warn-bg); color: var(--warn); }
.pill.soon { background: var(--line); color: var(--muted); }
.pill.paid { background: var(--good-bg); color: var(--good); }

/* ---- login ---- */
.kid-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kid-btn {
  background: var(--card); color: var(--ink); border: 3px solid var(--c); border-radius: 22px;
  padding: 22px 14px; text-align: center; font-size: 1.1rem;
}
.kid-btn .emoji { font-size: 3rem; display: block; }
.kid-btn strong { font-family: "Lilita One", system-ui; font-weight: 400; font-size: 1.6rem; display: block; color: var(--c); }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; justify-content: center; margin: 14px 0; }
.pinpad button { height: 64px; font-size: 1.5rem; background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.dots { display: flex; gap: 12px; justify-content: center; margin: 10px 0; }
.dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--brand); }
.dots span.on { background: var(--brand); }

/* ---- kid board ---- */
.hero { display: flex; align-items: center; gap: 14px; }
.hero .emoji { font-size: 3rem; }
.hero h1 { color: var(--brand); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .big { font-family: "Lilita One", system-ui; font-size: 2rem; line-height: 1.1; }
.stat .label { color: var(--muted); font-weight: 700; font-size: .875rem; }
.lesson { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.15rem; }
.lesson .box { background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; text-align: center; min-width: 110px; }
.lesson .box b { display: block; font-family: "Lilita One", system-ui; font-weight: 400; font-size: 1.7rem; }
.lesson .op { font-family: "Lilita One", system-ui; font-size: 1.8rem; color: var(--muted); }
.lesson .box.profit { border-color: var(--good); }
.lesson .box.profit b { color: var(--good); }

.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.grid .head { text-align: center; font-weight: 800; color: var(--muted); font-size: .8rem; }
.cell {
  border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-height: 84px;
  display: flex; flex-direction: column; gap: 2px; background: var(--card); font-size: .8rem;
}
.cell .d { font-weight: 800; color: var(--muted); }
.cell.past { opacity: .45; }
.cell.today { outline: 3px solid var(--brand); outline-offset: -1px; }
.cell.open { background: var(--open-bg); }
.cell.make { background: var(--warn-bg); border-color: var(--warn); }
.cell.full { background: var(--bad-bg); border-color: var(--bad); }
.cell .what { font-weight: 800; font-size: .95rem; color: var(--ink); line-height: 1.15; }
.cell .room { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; margin-top: 10px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--line); }

.collect-list { list-style: none; margin: 0; padding: 0; }
.collect-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.collect-list li:last-child { border-bottom: 0; }
.collect-list .who { font-weight: 800; }
.collect-list .amt { font-family: "Lilita One", system-ui; font-size: 1.3rem; }

/* ---- admin ---- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
.tabs button.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
td.num, th.num { text-align: right; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row label { flex: 1 1 120px; }
.weekday-picks { display: flex; gap: 4px; flex-wrap: wrap; }
.weekday-picks label { flex-direction: row; align-items: center; gap: 3px; flex: none; color: var(--ink); }
.overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.overview .card { border-top: 6px solid var(--c); }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 700; display: none; }

@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  .cell { min-height: 70px; padding: 4px; font-size: .7rem; }
  .cell .what { font-size: .8rem; }
  .lesson { font-size: 1rem; }
  .lesson .box { min-width: 86px; padding: 8px; }
}
