:root {
  --ink: #241f2b;
  --muted: #696172;
  --nav: #151416;
  --nav-soft: #242126;
  --paper: #ffffff;
  --lavender: #c8baf2;
  --lavender-deep: #765aa5;
  --lavender-soft: #eee9fb;
  --lemon: #eaff77;
  --lemon-soft: #f2f8c9;
  --green: #4f8b70;
  --green-soft: #e4f2eb;
  --sky: #d9edf3;
  --sky-deep: #3f7181;
  --peach: #f5d1b8;
  --rose: #f3e6f3;
  --danger: #a34157;
  --danger-soft: #f9e9ed;
  --line: rgba(45, 35, 56, .11);
  --line-strong: rgba(45, 35, 56, .18);
  --shadow: 0 18px 55px rgba(62, 46, 80, .08);
  --radius: 24px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .55rem; font-size: clamp(2.15rem, 4.8vw, 3.5rem); line-height: 1.02; letter-spacing: -.065em; font-weight: 680; }
h2 { letter-spacing: -.035em; }
:focus-visible { outline: 3px solid rgba(118, 90, 165, .36); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

.app-body {
  background: linear-gradient(145deg, #eff6c7 0%, #e4ddf8 58%, #c8baf2 100%);
}
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 100vh;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: var(--nav);
  border-radius: 0 28px 28px 0;
}
.brand { min-height: 130px; margin: 0 5px 30px; padding: 8px; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: radial-gradient(circle at 5% 5%, rgba(234,255,119,.92), transparent 45%), linear-gradient(145deg, #fbfceb, #e8e1f8); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.app-brand-logo { width: min(185px, 100%); height: auto; }
.nav-list { display: grid; gap: 7px; }
.nav-link {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 14px;
  color: #d8d2dd;
  font-size: .93rem;
  font-weight: 650;
}
.nav-link > span { width: 23px; text-align: center; color: #aaa4b1; font-size: 1.15rem; }
.nav-link:hover { color: #fff; background: #28252b; }
.nav-link.is-active { color: #2a2136; background: var(--lavender); }
.nav-link.is-active > span { color: #4e3b68; }
.sidebar-profile {
  margin-top: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 17px;
  background: var(--nav-soft);
}
.avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; color: #633f28; background: var(--peach); font-size: .75rem; font-weight: 850; }
.profile-copy { min-width: 0; display: grid; line-height: 1.25; }
.profile-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.profile-copy small { color: #aaa3b1; font-size: .72rem; }
.logout-button { width: 32px; height: 32px; border: 0; border-radius: 9px; color: #bcb5c3; background: transparent; font-size: 1rem; }
.logout-button:hover { color: #fff; background: rgba(255,255,255,.08); }

.main {
  min-width: 0;
  min-height: 100vh;
  background-color: #dcd4f5;
  background-image:
    radial-gradient(ellipse at 0 0, rgba(234,255,119,.98) 0, rgba(234,255,119,.72) 14%, transparent 47%),
    radial-gradient(ellipse at 100% 0, rgba(200,186,242,.95) 0, transparent 51%),
    radial-gradient(ellipse at 66% 68%, rgba(217,237,243,.78) 0, transparent 46%),
    linear-gradient(155deg, #f1f8c4 0%, #e9e5df 34%, #ded6f6 72%, #c8baf2 100%);
  background-size: 100% 52rem, 100% 52rem, 100% 68rem, 100% 100%;
  background-repeat: no-repeat;
}
.topbar {
  min-height: 76px;
  padding: 16px clamp(24px, 4vw, 58px);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 13px;
  color: #514a59;
  font-size: .84rem;
  font-weight: 650;
}
.topbar > :first-child { margin-right: auto; }
.demo-pill, .role-pill { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 999px; }
.demo-pill { color: #36400f; background: rgba(234,255,119,.78); }
.demo-pill i { width: 7px; height: 7px; border-radius: 50%; background: #63751d; }
.role-pill { color: #4c3b63; background: rgba(255,255,255,.48); }
.mobile-header, .bottom-nav { display: none; }
.mobile-account { position: relative; }
.mobile-account > summary { list-style: none; cursor: pointer; }
.mobile-account > summary::-webkit-details-marker { display: none; }
.mobile-account-menu { position: absolute; z-index: 70; top: 48px; right: 0; width: 205px; padding: 14px; display: grid; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 15px 40px rgba(32,24,39,.18); }
.mobile-account-menu strong { font-size: .84rem; }
.mobile-account-menu small { margin-bottom: 10px; color: var(--muted); font-size: .72rem; }
.mobile-account-menu button { width: 100%; min-height: 38px; border: 0; border-radius: 10px; color: #67438d; background: var(--lavender-soft); font-size: .78rem; font-weight: 800; }

.page { width: min(1240px, 100%); margin: 0 auto; padding: 30px clamp(24px, 4vw, 58px) 72px; }
.narrow-page { width: min(1080px, 100%); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.page-header > div:first-child { max-width: 760px; }
.page-header p { margin-bottom: 0; color: #5b5362; font-size: 1rem; }
.compact-header { align-items: center; }
.eyebrow, .section-kicker { display: block; color: #59476f; font-size: .78rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.eyebrow { margin-bottom: 8px; }
.eyebrow::before { content: ""; width: 24px; height: 5px; display: inline-block; margin-right: 10px; border-radius: 99px; background: var(--lemon); vertical-align: 2px; }
.section-kicker { margin-bottom: 4px; color: #64586d; }
.back-link { display: inline-flex; margin-bottom: 20px; color: #604688; font-size: .88rem; font-weight: 750; }

.button {
  min-height: 43px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .87rem;
  font-weight: 750;
  white-space: nowrap;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; border-color: #694497; background: #694497; }
.button-primary:hover { border-color: #553476; background: #553476; }
.button-soft { color: #4f3a6c; border-color: rgba(105,68,151,.14); background: var(--lavender-soft); }
.button-soft:hover { border-color: rgba(105,68,151,.3); background: #e4daf7; }
.button-ghost { color: #625a69; border-color: var(--line-strong); background: rgba(255,255,255,.48); }
.button-booked { color: #315f4c; border-color: rgba(79,139,112,.22); background: var(--green-soft); }
.button-disabled { color: #8b8490; border-color: #e5e1e7; background: #f0edf1; cursor: not-allowed; }
.button-wide { width: 100%; }
.text-link { color: #62428a; font-size: .87rem; font-weight: 800; }
.text-link:hover { text-decoration: underline; }

.flash-stack { position: fixed; z-index: 100; top: 18px; right: 22px; width: min(430px, calc(100% - 32px)); display: grid; gap: 9px; }
.flash { min-height: 60px; padding: 13px 14px 13px 17px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 16px 40px rgba(37,27,45,.16); font-size: .87rem; font-weight: 650; }
.flash-success { border-left: 5px solid var(--green); }
.flash-error { border-left: 5px solid var(--danger); }
.flash-info { border-left: 5px solid var(--lavender-deep); }
.flash button { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--muted); background: #f4f1f5; font-size: 1.1rem; }

/* Family dashboard */
.progress-panel {
  min-height: 318px;
  padding: clamp(24px, 4vw, 38px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 32px;
  align-items: stretch;
  border-radius: 28px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.progress-copy { align-self: center; }
.progress-number { margin: 10px 0 28px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 11px; }
.progress-number strong { font-size: clamp(3.4rem, 7vw, 5.5rem); line-height: .9; letter-spacing: -.08em; font-weight: 650; }
.progress-number span { color: #4f4856; font-size: clamp(1.05rem, 2.2vw, 1.42rem); font-weight: 620; }
.progress-stamps { display: grid; grid-template-columns: repeat(10, minmax(35px, 1fr)); gap: 8px; }
.stamp { aspect-ratio: 1; max-height: 50px; display: grid; place-items: center; border: 2px solid rgba(48,39,57,.14); border-radius: 12px; color: #817989; background: rgba(255,255,255,.72); font-size: .82rem; font-weight: 850; }
.stamp.is-done { color: #fff; border-color: var(--green); background: var(--green); }
.stamp.is-booked { color: #493467; border-color: #8469ad; background: repeating-linear-gradient(135deg, #f1ecfc 0 6px, #ded3f4 6px 12px); }
.legend { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: .78rem; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 10px; height: 10px; border: 2px solid #c9c3cc; border-radius: 3px; background: #fff; }
.dot.done { border-color: var(--green); background: var(--green); }
.dot.booked { border-color: #8469ad; background: var(--lavender-soft); }
.remaining-card { padding: 25px; display: flex; flex-direction: column; justify-content: center; border-radius: 22px; color: #332d16; background: var(--lemon-soft); }
.remaining-card span { font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.remaining-card strong { margin: 8px 0 -3px; font-size: 4rem; line-height: 1; letter-spacing: -.08em; }
.remaining-card small { color: #55562c; font-size: .8rem; }
.remaining-card a { margin-top: 22px; color: #4b4c25; font-size: .82rem; font-weight: 850; }
.two-column-cards { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.focus-card { min-height: 260px; padding: 26px; border-radius: 24px; }
.parent-focus { background: var(--lavender); }
.child-focus { background: var(--sky); }
.focus-head { display: flex; gap: 13px; align-items: center; margin-bottom: 22px; }
.focus-head small { display: block; color: #5e5566; font-size: .76rem; }
.focus-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.55); font-size: 1.1rem; }
.focus-date { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.focus-date strong { padding: 6px 10px; border-radius: 9px; background: rgba(255,255,255,.58); font-size: .83rem; }
.focus-date span { color: #554d5c; font-size: .83rem; font-weight: 680; }
.focus-card h2 { max-width: 480px; margin-bottom: 6px; font-size: 1.28rem; }
.focus-card p { margin-bottom: 20px; color: #554e5b; font-size: .88rem; }
.empty-compact h2, .empty-compact h3 { margin-bottom: 5px; }
.empty-compact p { margin-bottom: 0; color: var(--muted); }

/* Tabs and event tables */
.participate-toolbar { margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.participate-toolbar .tabs { margin-bottom: 0; }
.tabs { width: fit-content; margin-bottom: 20px; padding: 4px; display: flex; gap: 3px; border-radius: 14px; background: rgba(255,255,255,.5); }
.tabs a { min-height: 40px; padding: 0 15px; display: grid; place-items: center; border-radius: 11px; color: #625a6a; font-size: .85rem; font-weight: 750; }
.tabs a.is-active { color: #372747; background: var(--lavender); }
.view-switch { min-height: 48px; padding: 4px; display: flex; align-items: center; gap: 3px; border: 1px solid rgba(255,255,255,.5); border-radius: 14px; background: rgba(255,255,255,.46); }
.view-switch > span:first-child { padding: 0 8px 0 10px; color: #746b7a; font-size: .69rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.view-option { min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border-radius: 10px; color: #655d6c; font-size: .79rem; font-weight: 780; }
.view-option > span { color: #7b6e86; font-size: .96rem; }
.view-option:hover { color: #443451; background: rgba(255,255,255,.62); }
.view-option.is-active { color: #372747; background: var(--lavender); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset; }
.view-option.is-active > span { color: #594176; }
.clarity-note { margin-bottom: 22px; padding: 13px 17px; display: flex; gap: 12px; align-items: center; border-radius: 15px; color: #4e4259; background: rgba(255,255,255,.52); }
.clarity-note p { margin: 0; font-size: .86rem; }
.clarity-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--lavender-deep); font-size: .78rem; font-weight: 850; }
.events-list { display: grid; gap: 24px; }
.event-panel { border-radius: 25px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); overflow: hidden; }
.event-header { min-height: 138px; padding: 24px 28px; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 20px; align-items: center; color: #fff; background: var(--lavender-deep); }
.event-date { width: 70px; height: 76px; display: grid; place-items: center; align-content: center; border-radius: 17px; color: #273011; background: var(--lemon); line-height: 1.05; }
.event-date span { font-size: .85rem; font-weight: 900; text-transform: uppercase; }
.event-date strong { margin-top: 5px; font-size: .72rem; }
.event-title .section-kicker { color: var(--lemon); }
.event-title h2 { margin: 4px 0 3px; font-size: clamp(1.35rem, 2.5vw, 2rem); }
.event-title p { margin: 0; color: #eee8f7; font-size: .86rem; }
.places-summary { min-width: 128px; padding: 14px 17px; display: flex; gap: 9px; align-items: center; border-radius: 16px; color: #362947; background: var(--lavender); }
.places-summary strong { font-size: 2rem; line-height: 1; }
.places-summary span { font-size: .72rem; font-weight: 750; line-height: 1.2; }
.table-wrap { width: 100%; overflow-x: auto; }
.mission-table, .data-table { width: 100%; border-collapse: collapse; }
.mission-table th, .data-table th { padding: 14px 17px; color: #6c6373; background: #f0ebf5; font-size: .72rem; font-weight: 850; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.mission-table td { padding: 19px 17px; border-top: 1px solid var(--line); vertical-align: middle; font-size: .84rem; }
.mission-table td:first-child { width: 150px; }
.mission-table td:nth-child(2) { min-width: 265px; }
.mission-table td strong, .data-table td strong { display: block; }
.mission-table td small, .data-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }
.slot-section { display: block; margin-bottom: 3px; color: #71539a; font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.type-pill, .credit-pill { display: inline-flex; min-height: 30px; align-items: center; padding: 0 9px; border-radius: 9px; font-size: .73rem; font-weight: 750; }
.type-pill { color: #544361; background: var(--rose); }
.credit-pill { color: #3b4718; background: var(--lemon-soft); }
.action-cell { width: 160px; text-align: right; }
.action-cell form { display: inline-flex; }
.family-booking-note { display: block; margin-bottom: 6px; color: #6d5a79; font-size: .68rem; font-weight: 750; }

/* Spreadsheet-style participation view */
.sheet-panel { overflow: hidden; border: 1px solid rgba(255,255,255,.72); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.sheet-toolbar { padding: 22px 24px; display: grid; grid-template-columns: minmax(270px, 1fr) minmax(260px, .8fr) minmax(190px, .48fr); grid-template-areas: "copy search filter" "copy count count"; gap: 10px 12px; align-items: center; border-bottom: 1px solid var(--line); }
.sheet-toolbar-copy { grid-area: copy; }
.sheet-toolbar-copy h2 { margin: 2px 0 4px; font-size: 1.2rem; }
.sheet-toolbar-copy p { max-width: 520px; margin: 0; color: var(--muted); font-size: .79rem; }
.sheet-search { position: relative; grid-area: search; }
.sheet-search > span[aria-hidden] { position: absolute; z-index: 1; left: 13px; top: 50%; color: #746a7c; font-size: 1.1rem; transform: translateY(-52%); }
.sheet-search input { min-height: 42px; padding-left: 37px; background: #fff; font-size: .79rem; }
.sheet-filter { grid-area: filter; }
.sheet-filter select { min-height: 42px; background: #fff; font-size: .79rem; }
.sheet-count { grid-area: count; margin: 0; color: #756d7b; font-size: .72rem; font-weight: 750; text-align: right; }
.sheet-scroll { max-height: min(70vh, 760px); overflow: auto; overscroll-behavior: contain; background: #fff; }
.sheet-scroll:focus-visible { outline-offset: -4px; }
.sheet-scroll-hint { display: none; }
.sheet-table { width: 100%; min-width: 1120px; border-spacing: 0; border-collapse: separate; color: #342e39; font-size: .77rem; }
.sheet-table th, .sheet-table td { border-right: 1px solid #ddd9e1; border-bottom: 1px solid #ddd9e1; }
.sheet-table thead th { position: sticky; z-index: 4; top: 0; height: 42px; padding: 0 12px; color: #625a68; background: #f2eff4; font-size: .68rem; font-weight: 850; letter-spacing: .035em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.sheet-table thead th:first-child { z-index: 7; }
.sheet-table td { height: 58px; padding: 9px 12px; vertical-align: middle; background: #fff; white-space: nowrap; }
.sheet-table tbody:nth-of-type(even) td { background: #fdfcff; }
.sheet-table td strong { display: block; font-size: .78rem; }
.sheet-table td small { display: block; margin-top: 2px; color: #827a87; font-size: .68rem; }
.sheet-table tbody tr[data-sheet-row]:hover td { background: #fafcdd; }
.sheet-table .sheet-row-number { position: sticky; z-index: 2; left: 0; width: 46px; min-width: 46px; padding-inline: 6px; color: #837b88; background: #f2eff4; text-align: center; }
.sheet-table tbody tr[data-sheet-row]:hover .sheet-row-number { background: #eef3bd; }
.sheet-event-row th { height: 48px; padding: 8px 14px; border-top: 2px solid rgba(118,90,165,.42); color: #3f314f; background: #dfd6f5; text-align: left; }
.sheet-event-row th > span:first-child { display: inline-grid; gap: 1px; }
.sheet-event-row strong { font-size: .84rem; }
.sheet-event-row small { color: #6c5d78; font-size: .68rem; font-weight: 650; }
.sheet-event-places { float: right; margin-top: 3px; padding: 5px 8px; border-radius: 8px; color: #4e3b66; background: rgba(255,255,255,.5); font-size: .67rem; font-weight: 800; }
.sheet-table th:nth-child(2), .sheet-table td:nth-child(2) { width: 96px; }
.sheet-table th:nth-child(3), .sheet-table td:nth-child(3) { width: 112px; }
.sheet-table th:nth-child(4), .sheet-table td:nth-child(4) { width: 118px; }
.sheet-table th:nth-child(5), .sheet-table td:nth-child(5) { min-width: 270px; }
.sheet-table th:nth-child(6), .sheet-table td:nth-child(6) { width: 145px; }
.sheet-table th:nth-child(7), .sheet-table td:nth-child(7) { width: 90px; }
.sheet-table th:nth-child(8), .sheet-table td:nth-child(8) { width: 76px; }
.sheet-table th:nth-child(9), .sheet-table td:nth-child(9) { width: 168px; }
.sheet-task-cell { white-space: normal !important; }
.sheet-table .slot-section { margin: 0; font-size: .65rem; }
.sheet-table .type-pill, .sheet-table .credit-pill { min-height: 26px; font-size: .67rem; }
.sheet-action-cell { min-width: 168px; text-align: right; }
.sheet-action-cell form { display: inline-flex; }
.sheet-action-cell .button { min-height: 36px; padding-inline: 12px; font-size: .73rem; }
.sheet-action-cell .family-booking-note { max-width: 160px; margin-left: auto; white-space: normal; }
.sheet-empty-filter { min-height: 190px; padding: 28px; display: grid; place-items: center; align-content: center; text-align: center; }
.sheet-empty-filter > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #5b4477; background: var(--lavender-soft); font-size: 1.2rem; }
.sheet-empty-filter strong { margin-top: 10px; font-size: .9rem; }
.sheet-empty-filter small { margin-top: 3px; color: var(--muted); font-size: .72rem; }

/* Childcare */
.page-header-actions { align-items: center; }
.child-picker { min-width: 230px; display: grid; gap: 5px; }
.child-picker label { color: #675e6e; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
select, input, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255,255,255,.83);
}
input, select { padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; }
.childcare-banner { margin-bottom: 20px; padding: 16px 18px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 13px; align-items: center; border-radius: 18px; color: #29414a; background: var(--sky); }
.child-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #284652; background: rgba(255,255,255,.58); font-weight: 900; }
.childcare-banner strong { display: block; }
.childcare-banner p { margin: 2px 0 0; color: #55717b; font-size: .82rem; }
.no-credit-badge { padding: 7px 10px; border-radius: 999px; color: #476671; background: rgba(255,255,255,.56); font-size: .74rem; font-weight: 800; }
.care-panel { padding: 24px; border-radius: 24px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.care-toolbar { margin-bottom: 20px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; text-align: center; }
.care-toolbar div { display: grid; }
.care-toolbar span { color: var(--muted); font-size: .75rem; }
.care-toolbar strong { font-size: 1rem; }
.icon-link { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.1rem; }
.care-grid { display: grid; gap: 7px; }
.care-row { display: grid; grid-template-columns: 86px repeat(5, minmax(110px, 1fr)); gap: 7px; }
.care-head > span { min-height: 51px; display: grid; place-items: center; align-content: center; color: #665e6d; font-size: .78rem; }
.care-head strong { font-size: .77rem; text-transform: uppercase; }
.care-head small { color: #8a828f; font-size: .7rem; }
.period-label { display: grid; place-items: center start; color: #6f6675; font-size: .78rem; font-weight: 850; text-transform: uppercase; }
.care-cell { min-height: 74px; padding: 10px; display: grid; place-items: center; align-content: center; border: 1px solid var(--line); border-radius: 13px; text-align: center; }
.care-cell strong { font-size: .8rem; }
.care-cell small { margin-top: 3px; color: #6d6573; font-size: .69rem; }
.care-cell.status-registered { border-color: rgba(63,113,129,.12); color: #315c69; background: var(--sky); }
.care-cell.status-added { border-color: rgba(118,90,165,.16); color: #543c73; background: var(--lavender-soft); }
.care-cell.status-absent { color: #9b4559; background: var(--danger-soft); }
.care-cell.status-closed { color: #756e78; background: #eeebed; }
.care-cell.status-empty { color: #9b949f; background: #fbfafb; }
.care-legend { margin-top: 17px; display: flex; flex-wrap: wrap; gap: 16px; color: #766e7c; font-size: .76rem; }
.care-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mobile-scroll-hint { display: none; }
.care-dot { width: 9px; height: 9px; border-radius: 3px; }
.care-dot.registered { background: #8fc3d0; }
.care-dot.added { background: var(--lavender); }
.care-dot.absent { background: #d89aaa; }
.care-dot.empty { border: 1px solid #cfc9d1; background: #fff; }
.exceptions-panel { margin-top: 22px; padding: 24px; border-radius: 23px; background: rgba(255,255,255,.68); }
.section-heading h2 { margin: 0; font-size: 1.22rem; }
.exception-list { margin-top: 16px; display: grid; }
.exception-list article { padding: 14px 0; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: center; border-top: 1px solid var(--line); }
.exception-date { font-weight: 800; }
.exception-list strong { font-size: .88rem; }
.exception-list p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }

/* Data panels and status */
.history-summary { margin-bottom: 22px; display: grid; grid-template-columns: repeat(3, minmax(130px, .72fr)) minmax(230px, 1.35fr); gap: 10px; }
.history-summary > div { min-height: 125px; padding: 19px; display: grid; align-content: center; border-radius: 20px; }
.history-summary > div:nth-child(1) { background: var(--green-soft); }
.history-summary > div:nth-child(2) { background: var(--lavender); }
.history-summary > div:nth-child(3) { background: var(--lemon-soft); }
.history-summary > div:nth-child(4) { background: rgba(255,255,255,.72); }
.history-summary span { color: #625a69; font-size: .76rem; font-weight: 800; text-transform: uppercase; }
.history-summary strong { font-size: 2.2rem; line-height: 1.15; }
.history-summary small { color: var(--muted); }
.data-panel { border-radius: 23px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); overflow: hidden; }
.data-panel-head { min-height: 82px; padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.data-panel-head h2 { margin: 2px 0 0; font-size: 1.16rem; }
.privacy-chip { padding: 7px 10px; border-radius: 999px; color: #5d4b67; background: var(--rose); font-size: .7rem; font-weight: 750; }
.data-table td { padding: 17px; border-top: 1px solid var(--line); vertical-align: middle; font-size: .84rem; }
.data-table tbody tr:first-child td { border-top: 0; }
.status-badge { min-height: 29px; display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.status-done, .status-attended, .status-published { color: #315f4c; background: var(--green-soft); }
.status-booked, .status-draft { color: #563c76; background: var(--lavender-soft); }
.status-cancelled, .status-no_show { color: #984258; background: var(--danger-soft); }
.care-status-added { color: #563c76; background: var(--lavender-soft); }
.care-status-absent { color: #984258; background: var(--danger-soft); }
.care-status-closed { color: #69616c; background: #ebe8ec; }
.empty-state { min-height: 280px; padding: 42px 24px; display: grid; place-items: center; align-content: center; border-radius: 24px; background: rgba(255,255,255,.7); text-align: center; }
.empty-state > span { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--lavender); font-size: 1.35rem; font-weight: 800; }
.empty-state h2, .empty-state h1 { margin: 15px 0 6px; }
.empty-state p { color: var(--muted); }
.error-state > span { width: auto; padding-inline: 16px; }
.standalone-error { min-height: 100vh; padding: 30px; display: grid; place-items: center; background: linear-gradient(145deg, var(--lemon-soft), var(--lavender)); }

/* Admin */
.kpi-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi-grid article { min-height: 142px; padding: 20px; display: grid; align-content: center; border-radius: 20px; background: rgba(255,255,255,.76); }
.kpi-grid article:nth-child(1) { background: var(--green-soft); }
.kpi-grid article:nth-child(2) { background: var(--lavender); }
.kpi-grid article:nth-child(3) { background: var(--lemon-soft); }
.kpi-grid article:nth-child(4) { background: var(--sky); }
.kpi-grid span { color: #625a69; font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.kpi-grid strong { font-size: 2.55rem; line-height: 1.1; }
.kpi-grid small { color: #655d6c; }
.admin-columns { margin-bottom: 22px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; align-items: start; }
.action-list { padding: 0 22px 9px; }
.action-list article { padding: 16px 0; display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 15px; align-items: center; border-top: 1px solid var(--line); }
.action-list article:first-child { border-top: 0; }
.action-list p { margin: 2px 0; color: var(--muted); font-size: .78rem; }
.action-list small { color: #807887; font-size: .72rem; }
.action-date { display: grid; }
.action-date strong { font-size: .85rem; }
.action-date span { color: #71539a; font-size: .7rem; font-weight: 750; }
.compact-list { padding: 0 20px 10px; }
.compact-list article { padding: 15px 0; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-top: 1px solid var(--line); }
.compact-list article:first-child { border-top: 0; }
.list-date { color: #5c447b; font-size: .75rem; font-weight: 850; }
.compact-list strong { display: block; font-size: .85rem; }
.compact-list small { display: block; color: var(--muted); font-size: .7rem; }
.family-bars { padding: 0 22px 12px; }
.family-bars article { padding: 14px 0; display: grid; grid-template-columns: minmax(180px, .8fr) minmax(200px, 1fr) 105px; gap: 18px; align-items: center; border-top: 1px solid var(--line); }
.family-bars article:first-child { border-top: 0; }
.family-bars strong { display: block; font-size: .86rem; }
.family-bars small { color: var(--muted); font-size: .73rem; }
.mini-progress { height: 9px; overflow: hidden; border-radius: 99px; background: #e9e5eb; }
.mini-progress-fill { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--green); transition: width .4s ease; }

/* Forms */
.event-form { display: grid; gap: 18px; }
.form-section { padding: 26px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 5px 18px; border-radius: 24px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.form-section-number { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #46365b; background: var(--lavender); font-weight: 900; }
.form-section-heading h2 { margin: 0 0 2px; font-size: 1.2rem; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.form-grid, .slot-editor, .add-slot-button { grid-column: 2; }
.form-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span, .form-stack label > span:first-child { color: #655d6b; font-size: .75rem; font-weight: 800; }
.field-wide { grid-column: 1 / -1; }
.slots-section { overflow: hidden; }
.slot-editor { margin-top: 20px; overflow-x: auto; }
.slot-editor-head, .slot-edit-row { min-width: 1000px; display: grid; grid-template-columns: .65fr 1.35fr .85fr .8fr 1.15fr .5fr .75fr 34px; gap: 8px; align-items: center; }
.slot-editor-head { padding: 0 8px 8px; color: #756d7a; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.slot-edit-row { padding: 12px 8px; border-top: 1px solid var(--line); }
.slot-edit-row label { margin: 0; }
.slot-edit-row input, .slot-edit-row select { min-height: 40px; padding-inline: 9px; font-size: .78rem; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.mobile-label { display: none; }
.remove-row { width: 32px; height: 32px; border: 0; border-radius: 9px; color: #984258; background: var(--danger-soft); font-size: 1.1rem; }
.add-slot-button { width: fit-content; margin-top: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Login */
.auth-body { min-height: 100vh; background: #ede7fb; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .94fr) minmax(480px, 1.06fr); }
.login-visual { position: relative; padding: clamp(30px, 5vw, 70px); display: flex; flex-direction: column; overflow: hidden; color: var(--ink); background: radial-gradient(circle at 5% 4%, rgba(234,255,119,.95), transparent 38%), linear-gradient(145deg, #fbfceb 0%, #eee9fb 58%, #d9edf3 100%); }
.login-visual::after { content: ""; position: absolute; width: 470px; height: 470px; right: -190px; bottom: -165px; border: 65px solid rgba(118,90,165,.09); border-radius: 50%; }
.login-logo { position: relative; z-index: 1; width: min(360px, 82%); height: auto; margin-inline: auto; object-fit: contain; object-position: center; }
.login-message { position: relative; z-index: 1; max-width: 560px; margin: auto 0; }
.login-message h1 { max-width: 540px; font-size: clamp(3rem, 5.5vw, 5rem); }
.login-message p { max-width: 470px; color: #5f5766; font-size: 1.05rem; }
.login-chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.login-chips span { padding: 8px 11px; border: 1px solid rgba(45,35,56,.12); border-radius: 999px; color: #5f5766; background: rgba(255,255,255,.46); font-size: .74rem; }
.login-panel { padding: 34px; display: grid; place-items: center; background: radial-gradient(circle at 0 0, var(--lemon) 0, transparent 36%), linear-gradient(145deg, #eef6c8, var(--lavender)); }
.login-card { width: min(470px, 100%); padding: clamp(28px, 5vw, 46px); border-radius: 28px; background: rgba(255,255,255,.91); box-shadow: 0 24px 80px rgba(47,36,59,.14); }
.login-card h2 { margin: 2px 0 6px; font-size: 2rem; }
.login-card > .muted { margin-bottom: 24px; }
.form-stack { display: grid; gap: 16px; }
.form-stack label { display: grid; gap: 7px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 62px; }
.password-field button { position: absolute; right: 7px; top: 7px; min-height: 30px; padding: 0 8px; border: 0; border-radius: 8px; color: #604688; background: var(--lavender-soft); font-size: .7rem; font-weight: 800; }
.demo-access { margin-top: 24px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 15px; background: var(--lemon-soft); }
.demo-access strong { display: block; font-size: .82rem; }
.demo-access small { display: block; color: #63643a; font-size: .72rem; }
.login-help { margin: 19px 0 0; color: var(--muted); font-size: .76rem; text-align: center; }
.inline-alert { margin-bottom: 17px; padding: 11px 13px; border-radius: 11px; font-size: .8rem; }
.inline-alert-error { color: #8e3e52; background: var(--danger-soft); }
.inline-alert-info { color: #553c73; background: var(--lavender-soft); }
.inline-alert-success { color: #315f4c; background: var(--green-soft); }

@media (max-width: 1120px) {
  :root { --sidebar: 225px; }
  .progress-panel { grid-template-columns: minmax(0, 1fr) 205px; }
  .progress-stamps { grid-template-columns: repeat(5, 1fr); }
  .admin-columns { grid-template-columns: 1fr; }
  .care-row { grid-template-columns: 70px repeat(5, minmax(102px, 1fr)); }
  .sheet-toolbar { grid-template-columns: minmax(260px, 1fr) minmax(190px, .65fr); grid-template-areas: "copy copy" "search filter" "count count"; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar, .topbar { display: none; }
  .main { min-height: 100vh; }
  .mobile-header { height: 74px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.3); backdrop-filter: blur(14px); }
  .mobile-brand { min-width: 0; display: flex; align-items: center; }
  .mobile-brand-logo { width: 112px; height: auto; max-height: 62px; object-fit: contain; object-position: left center; }
  .mobile-header .avatar { width: 39px; height: 39px; }
  .page { padding: 27px 18px 105px; }
  .bottom-nav { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: 12px; min-height: 66px; padding: 7px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; border-radius: 18px; color: #c5becb; background: var(--nav); box-shadow: 0 14px 38px rgba(25,20,29,.26); }
  .bottom-nav a { min-width: 0; padding: 5px 2px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 12px; }
  .bottom-nav a.is-active { color: #31263e; background: var(--lavender); }
  .bottom-nav span { font-size: 1rem; }
  .bottom-nav small { overflow: hidden; max-width: 100%; text-overflow: ellipsis; color: inherit; font-size: .62rem; font-weight: 800; }
  .two-column-cards { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .history-summary { grid-template-columns: 1fr 1fr; }
  .participate-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .sheet-scroll-hint { margin: 0; padding: 10px 16px; display: block; color: #6f6675; border-bottom: 1px solid var(--line); background: #f8f5fa; font-size: .7rem; font-weight: 700; }
  .sheet-scroll-hint span { margin-right: 6px; color: #614786; }
  .care-panel { overflow-x: auto; }
  .care-grid, .care-legend { min-width: 710px; }
  .mobile-scroll-hint { display: block; margin: -7px 0 14px; color: var(--muted); font-size: .72rem; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 0; padding: 24px; gap: 24px; }
  .login-logo { width: min(240px, 72vw); }
  .login-message { margin: 0; }
  .login-message h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .login-message p { margin-bottom: 0; }
  .login-chips { display: none; }
  .login-panel { padding: 24px 18px 42px; }
}

@media (max-width: 680px) {
  h1 { font-size: 2.25rem; }
  .page-header, .compact-header, .page-header-actions { display: grid; align-items: start; gap: 18px; }
  .page-header .button { width: 100%; }
  .page-header p { font-size: .92rem; }
  .participate-toolbar { display: grid; gap: 10px; }
  .participate-toolbar .tabs { width: 100%; overflow-x: auto; }
  .participate-toolbar .tabs a { min-width: max-content; flex: 1; }
  .view-switch { width: 100%; }
  .view-switch > span:first-child { margin-right: auto; }
  .view-option { justify-content: center; }
  .sheet-panel { border-radius: 20px; }
  .sheet-toolbar { padding: 18px 16px; grid-template-columns: 1fr; grid-template-areas: "copy" "search" "filter" "count"; gap: 11px; }
  .sheet-count { text-align: left; }
  .sheet-scroll { max-height: 65vh; }
  .sheet-table { min-width: 1040px; }
  .progress-panel { padding: 22px 18px; grid-template-columns: 1fr; gap: 20px; border-radius: 22px; }
  .progress-number { margin-bottom: 22px; }
  .progress-number strong { font-size: 4rem; }
  .progress-number span { font-size: 1rem; }
  .progress-stamps { gap: 7px; }
  .stamp { border-radius: 10px; }
  .remaining-card { min-height: 155px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 13px; }
  .remaining-card span, .remaining-card small, .remaining-card a { grid-column: 2; }
  .remaining-card strong { grid-column: 1; grid-row: 1 / span 3; }
  .remaining-card a { margin-top: 10px; }
  .focus-card { min-height: 0; }
  .event-header { grid-template-columns: 62px minmax(0, 1fr); padding: 20px 18px; }
  .event-date { width: 60px; height: 67px; border-radius: 14px; }
  .places-summary { grid-column: 1 / -1; width: 100%; min-width: 0; justify-content: center; }
  .mission-table thead, .data-table thead { display: none; }
  .mission-table, .mission-table tbody, .mission-table tr, .mission-table td,
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .mission-table tr, .data-table tr { padding: 15px 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; border-top: 1px solid var(--line); }
  .mission-table tr:first-child, .data-table tr:first-child { border-top: 0; }
  .mission-table td, .data-table td { min-width: 0 !important; padding: 0; border: 0; }
  .mission-table td::before, .data-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: #8b838f; font-size: .65rem; font-weight: 850; text-transform: uppercase; }
  .mission-table td:nth-child(2), .history-table td:nth-child(2), .admin-events-table td:first-child, .families-table td:first-child { grid-column: 1 / -1; }
  .mission-table .action-cell { grid-column: 1 / -1; }
  .mission-table .action-cell form, .mission-table .action-cell .button { width: 100%; }
  .data-panel-head { align-items: flex-start; flex-direction: column; }
  .privacy-chip { white-space: normal; }
  .childcare-banner { grid-template-columns: 44px 1fr; }
  .no-credit-badge { grid-column: 1 / -1; width: fit-content; }
  .exception-list article { grid-template-columns: 68px 1fr; }
  .exception-list .status-badge { grid-column: 2; width: fit-content; }
  .history-summary { gap: 8px; }
  .history-summary > div { min-height: 105px; padding: 15px; border-radius: 16px; }
  .history-summary strong { font-size: 1.8rem; }
  .kpi-grid { gap: 8px; }
  .kpi-grid article { min-height: 122px; padding: 15px; }
  .kpi-grid strong { font-size: 2rem; }
  .action-list article { grid-template-columns: 68px minmax(0, 1fr); }
  .action-list form { grid-column: 1 / -1; }
  .action-list form .button { width: 100%; }
  .compact-list article { grid-template-columns: 56px minmax(0, 1fr); }
  .compact-list .status-badge { grid-column: 2; width: fit-content; }
  .family-bars article { grid-template-columns: 1fr auto; }
  .family-bars .mini-progress { grid-column: 1 / -1; grid-row: 2; }
  .form-section { padding: 20px 16px; grid-template-columns: 38px minmax(0, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .slots-section { display: block; }
  .slots-section .form-section-number { float: left; margin-right: 12px; }
  .slot-editor, .add-slot-button { grid-column: auto; }
  .slot-editor-head { display: none; }
  .slot-edit-row { min-width: 0; padding: 16px 0; grid-template-columns: 1fr 1fr; gap: 11px; }
  .slot-edit-row > label:nth-child(2) { grid-column: 1 / -1; }
  .mobile-label { display: block; margin-bottom: 5px; color: #756d7a; font-size: .66rem; font-weight: 850; text-transform: uppercase; }
  .remove-row { align-self: end; }
  .form-actions { position: static; padding: 10px 0 0; background: transparent; }
  .form-actions .button { flex: 1; }
  .demo-access { align-items: stretch; flex-direction: column; }
  .demo-access .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
