/* Kulmis CMS — "Nurture Daycare" look from the Stitch project "Daycare Management Dashboard UI" */
:root {
  --navy: #18253B; --ink: #0E1C31; --muted: #4A626E; --cream: #FFF7EB; --canvas: #FFF9F0;
  --amber: #F5B82E; --amber-ink: #684A00; --amber-soft: #FFF1D0;
  --green: #2F8A3B; --green-soft: #DDF6D2; --salmon: #F06A58; --salmon-soft: #FFE3DE;
  --sky: #CDE6F5; --sky-ink: #24506A; --lilac: #EEF1FF; --line: #EFE6D6; --white: #fff;
  --radius: 18px; --shadow: 0 1px 2px rgba(24, 37, 59, .04), 0 6px 20px -8px rgba(24, 37, 59, .10);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.5 'Inter', system-ui, sans-serif; color: var(--ink); background: var(--canvas); }
h1, h2, h3, .brand b, .nav button, .btn, th, .stat b, .eyebrow { font-family: 'Nunito Sans', 'Inter', sans-serif; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
a { color: var(--sky-ink); }
.ico { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  display: inline-block; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; vertical-align: middle; user-select: none; }

button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: .6em .8em; border: 1.5px solid var(--line); border-radius: 12px; background: var(--white); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
input[type=checkbox] { width: auto; accent-color: var(--navy); }
textarea { min-height: 5em; resize: vertical; }
label { display: block; font-weight: 600; font-size: .85rem; color: var(--muted); margin: .8em 0 .3em; }
label.check { display: flex; gap: .5em; align-items: center; font-weight: 600; color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .6em 1.15em; border: 0; border-radius: 999px;
  background: var(--amber); color: var(--navy); font-weight: 800; cursor: pointer; white-space: nowrap; box-shadow: 0 4px 14px -6px rgba(245, 184, 46, .7); }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: var(--white); border: 1.5px solid var(--line); box-shadow: none; }
.btn.navy { background: var(--navy); color: var(--white); box-shadow: none; }
.btn.danger { background: var(--salmon); color: var(--white); box-shadow: none; }
.btn.small { padding: .35em .85em; font-size: .85rem; }
.btn .ico { font-size: 18px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.shell > * { min-width: 0; } /* wide tables scroll inside their card instead of widening the page */
.side { background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .75rem; padding: 0 .25rem; }
.logo { width: 48px; height: 48px; border-radius: 14px; background: var(--amber); display: grid; place-items: center; color: var(--navy); flex: none; }
.brand b { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1.1; }
.brand small { font-size: .7rem; letter-spacing: .08em; color: var(--muted); }
.badge-line { display: flex; align-items: center; gap: .5rem; font-size: .8rem; background: var(--lilac); border-radius: 12px; padding: .5rem .75rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.nav { display: flex; flex-direction: column; gap: .25rem; }
.nav button { display: flex; align-items: center; gap: .8rem; border: 0; background: none; padding: .7rem .9rem; border-radius: 14px;
  font-size: 1rem; font-weight: 600; cursor: pointer; text-align: left; color: var(--ink); }
.nav button:hover { background: var(--cream); }
.nav button[aria-current=page] { background: var(--amber); font-weight: 800; color: var(--navy); }
.side-foot { margin-top: auto; background: var(--lilac); border-radius: 14px; padding: .8rem; display: flex; gap: .6rem; align-items: center; font-size: .82rem; }
.side-foot .ico { background: var(--green); color: var(--white); border-radius: 50%; padding: 6px; font-size: 18px; }

.topbar { display: flex; align-items: center; gap: .6rem; padding: .8rem 2rem; background: rgba(255, 249, 240, .9); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .85rem; border-radius: 999px; background: var(--lilac); font-size: .85rem; font-weight: 600; }
.chip.green { background: var(--green-soft); color: #1E5E14; }
.chip .ico { font-size: 18px; }
.me { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.me .who { line-height: 1.15; font-size: .85rem; } .me .who b { display: block; font-size: .95rem; }
.icon-btn { border: 0; background: var(--white); border: 1.5px solid var(--line); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }

main { padding: 1.5rem 2rem 3rem; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; display: flex; gap: .5rem; align-items: center; }
.eyebrow .ok { color: var(--green); }

/* ---------- content blocks ---------- */
.card { background: var(--white); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.bar { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1.25rem; background: var(--white); padding: .9rem 1rem;
  border-radius: var(--radius); box-shadow: var(--shadow); }
.bar > * { width: auto; }
.bar label { margin: 0 0 .25em; }
.bar .grow { flex: 1 1 220px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--white); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); position: relative; }
.stat .eyebrow { margin-bottom: .6rem; }
.stat b { display: block; font-size: 2.3rem; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.stat b small { font-size: 1rem; color: var(--muted); font-weight: 700; }
.stat .ico.corner { position: absolute; top: 1rem; right: 1rem; background: var(--cream); color: var(--amber-ink); border-radius: 12px; padding: 8px; }
.stat .sub { color: var(--muted); font-size: .85rem; margin-top: .4rem; }
.meter { height: 8px; border-radius: 99px; background: var(--lilac); overflow: hidden; margin-top: .8rem; }
.meter i { display: block; height: 100%; background: var(--amber); border-radius: 99px; }
.banner { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.25rem; }
.banner .logo { width: 44px; height: 44px; }
.banner h2 { margin: 0 0 .15rem; color: var(--white); }
.banner p { margin: 0; opacity: .8; font-size: .9rem; }
.banner .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.banner .btn.ghost { background: transparent; color: var(--white); border-color: #ffffff44; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.25rem; align-items: start; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 14px; background: var(--lilac); margin-bottom: .5rem; }
.list-row .grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .88rem; }

.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; border-radius: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75em .9em; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FFFCF6; }
th { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--white); white-space: nowrap; }
td input[type=time] { min-width: 7.4em; padding: .4em .5em; }
td input.note { min-width: 9em; }
tr.inactive td { opacity: .55; }
.who-cell { display: flex; align-items: center; gap: .75rem; min-width: 190px; }
.who-cell b { display: block; font-family: 'Nunito Sans', sans-serif; font-size: 1.02rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none;
  font-family: 'Nunito Sans', sans-serif; }
.pill { display: inline-flex; align-items: center; gap: .35em; padding: .2em .7em; border-radius: 999px; background: var(--lilac); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill.green, .pill.ok { background: var(--green-soft); color: #1E5E14; }
.pill.amber, .pill.new { background: var(--amber-soft); color: var(--amber-ink); }
.pill.red { background: var(--salmon-soft); color: #A0281A; }
.pill.blue { background: var(--sky); color: var(--sky-ink); }
.pill.green::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

dialog { border: 0; border-radius: 22px; padding: 1.5rem; width: min(560px, calc(100vw - 32px)); max-height: 90vh; box-shadow: 0 30px 60px -20px rgba(24, 37, 59, .4); }
dialog::backdrop { background: rgba(24, 37, 59, .45); backdrop-filter: blur(3px); }
dialog .actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; }
dialog .actions .left { margin-right: auto; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35em 1em; margin: .5em 0; background: var(--lilac); padding: .8rem 1rem; border-radius: 14px; }
dl.kv dt { font-weight: 700; } dl.kv dd { margin: 0; white-space: pre-wrap; }
details summary { cursor: pointer; font-weight: 600; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, var(--amber-soft), transparent 40%), var(--canvas); }
.login { width: min(400px, 100%); margin: 0; padding: 2rem; }
.login .brand { margin-bottom: 1.25rem; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: .75em 1.3em; border-radius: 14px; background: var(--navy);
  color: var(--white); max-width: calc(100vw - 32px); z-index: 20; display: none; font-weight: 600; box-shadow: var(--shadow); }
#toast.bad { background: #B3261E; }
#toast.show { display: block; }

@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: .75rem 16px; gap: .6rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .badge-line, .side-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { white-space: nowrap; padding: .55rem .8rem; font-size: .9rem; }
  .topbar { padding: .6rem 16px; position: static; }
  .topbar .chip.hide-sm, .me .who { display: none; }
  .bar > * { flex: 1 1 100%; }
  .stats { grid-template-columns: 1fr 1fr; } .stat b { font-size: 1.8rem; }
  .banner .actions { margin-left: 0; }
  main { padding: 1rem 16px 2rem; }
}
@media print {
  .side, .topbar, .bar, .no-print, #toast, .banner { display: none !important; }
  .shell { display: block; } body { background: var(--white); } .card, .table-wrap, .stat { box-shadow: none; }
}

/* sheet entry next to the scanned sheet */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.split-preview { position: sticky; top: 80px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .split-preview { position: static; order: -1; } }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.tile { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.tile b { display: block; font: 900 2rem/1.05 'Nunito Sans', sans-serif; }
.tile span:not(.tile-ico):not(.ico) { font-weight: 600; }
.tile-ico { width: 56px; height: 56px; border-radius: 14px; background: var(--white); display: grid; place-items: center; flex: none; }
.tile-ico .ico { font-size: 28px; }
.tile.yellow { background: #FFF1A8; } .tile.green { background: #BDF3CC; } .tile.red { background: #FFC9C2; } .tile.blue { background: #D6E6FF; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.cal-head b { font: 800 1.15rem 'Nunito Sans', sans-serif; }
.cal-head > div { display: flex; gap: .4rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow { font-size: .75rem; font-weight: 700; color: var(--muted); padding: .25rem 0; }
.cal-day { position: relative; aspect-ratio: 1; border: 0; background: none; border-radius: 50%; cursor: pointer; font-weight: 600; min-width: 32px; }
.cal-day:hover { background: var(--cream); }
.cal-day.has::after, .cal-dot { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.cal-day.has::after { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--amber); }
.cal-day.sel { background: var(--green); color: var(--white); }
.cal-day.sel::after { background: var(--white); }

.mark { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C9CED6; background: #EEF0F3; }
.mark.on-green { background: #22C55E; border-color: #15803D; }
.mark.on-red { background: #EF4444; border-color: #B91C1C; }

.viz { width: 100%; height: auto; display: block; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-axis { font: 600 11px 'Inter', sans-serif; fill: var(--muted); }
.viz-bar { fill: #2a78d6; opacity: .55; }
.viz-bar.current { opacity: 1; }
.viz-bar.hover { opacity: 1; fill: #1e5fae; }
.viz-tip { position: absolute; z-index: 30; padding: .45em .75em; background: var(--navy); color: var(--white); border-radius: 10px; font-size: .85rem; font-weight: 600; pointer-events: none; white-space: nowrap; }
.mixbar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; margin: .5rem 0 1rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.legend li { display: flex; align-items: center; gap: .6rem; }
.legend .grow { flex: 1; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }

.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.kid-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; }
.kid-card .avatar { width: 56px; height: 56px; font-size: 1.1rem; margin-bottom: .4rem; }
.kid-card > b { font-family: 'Nunito Sans', sans-serif; }
.kid-stats { display: flex; align-items: center; gap: .75rem; margin-top: .6rem; text-align: left; }
.ring { width: 56px; height: 56px; }
.ring-bg { fill: none; stroke: var(--lilac); stroke-width: 6; }
.ring-fg { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring.good .ring-fg { stroke: #22C55E; } .ring.warn .ring-fg { stroke: #F5B82E; } .ring.bad .ring-fg { stroke: #EF4444; }
.ring-text { font: 800 13px 'Nunito Sans', sans-serif; fill: var(--ink); }
table.nowrap td { white-space: nowrap; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: end; }
td.nowrap-cell { white-space: nowrap; }

/* child names link to their attendance page */
.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linkish:hover b, .linkish:hover { color: var(--sky-ink); text-decoration: underline; }
.seg { display: flex; gap: .3rem; flex-wrap: wrap; }
.cc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cc-grid.small { gap: 2px; }
.cc-day { border: 1.5px solid var(--line); background: var(--white); border-radius: 10px; min-height: 64px; padding: .35rem; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; cursor: pointer; font: inherit; }
.cc-day.on { background: #BDF3CC; border-color: #6BCB8B; }
.cc-day.today { box-shadow: inset 0 0 0 2px var(--amber); }
.cc-day:hover { border-color: var(--navy); }
.cc-day.small { min-height: 0; aspect-ratio: 1; padding: 0; border-radius: 4px; align-items: center; justify-content: center; font-size: .65rem; }
.cc-num { font-weight: 700; }
.cc-h { font-size: .8rem; font-weight: 700; color: #1E5E14; }
.cc-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.cc-mname { border: 0; background: none; font: 800 1rem "Nunito Sans", sans-serif; cursor: pointer; padding: 0 0 .4rem; }
.cc-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.cc-wday { border: 1.5px solid var(--line); background: var(--white); border-radius: 12px; padding: .75rem; display: flex; flex-direction: column; gap: .3rem; text-align: left; cursor: pointer; font: inherit; }
.cc-wday.on { background: #BDF3CC; border-color: #6BCB8B; }
