@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Manrope:wght@600;700;800&display=swap");

:root {
  --bg: #fff9f2;
  --surface: #ffffff;
  --surface-warm: #fff4e8;
  --surface-neutral: #f8f5ef;
  --primary: #274c77;
  --primary-2: #4f7cac;
  --primary-soft: #e9f2f8;
  --green: #78a978;
  --green-soft: #e6f3e5;
  --coral: #d96c63;
  --coral-soft: #fbe5e2;
  --amber: #e5a83b;
  --amber-soft: #fff1d2;
  --teal: #4f9a94;
  --teal-soft: #dff1ef;
  --family: #78a9d1;
  --family-soft: #e7f2fb;
  --text: #263238;
  --muted: #66737f;
  --line: #e7e1d8;
  --shadow: 0 12px 32px rgba(48, 67, 82, .08);
  --shadow-sm: 0 5px 16px rgba(48, 67, 82, .07);
  --radius: 20px;
  --radius-sm: 14px;
  --demo-h: 62px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); overflow-x: hidden; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); overflow-x: hidden; }
#app, .app-stage, .app-shell { width: 100%; max-width: 100%; min-width: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

.demo-toolbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--demo-h);
  padding: 10px 16px;
  background: #17324f;
  color: white;
  box-shadow: 0 8px 24px rgba(20, 44, 69, .18);
}
.demo-toolbar-inner {
  width: min(1500px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.demo-brand { display: flex; align-items: center; gap: 10px; min-width: max-content; }
.demo-brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: #fff; color: var(--primary); font-weight: 950; font-size: 20px;
}
.demo-brand-copy strong { display: block; letter-spacing: .08em; font-size: 13px; }
.demo-brand-copy span { display: block; opacity: .72; font-size: 10px; margin-top: 2px; }
.demo-role-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-role-btn, .demo-action-btn {
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 850;
}
.demo-role-btn:hover, .demo-action-btn:hover { background: rgba(255,255,255,.12); }
.demo-role-btn.active { background: white; color: var(--primary); border-color: white; }
.demo-spacer { flex: 1; }
.demo-action-btn.primary { background: var(--amber); color: #4f3500; border-color: transparent; }
.demo-action-btn.danger { background: transparent; color: #ffd5d0; }
.demo-mobile-controls { display: none; align-items:center; gap: 8px; width: 100%; }
.demo-role-select-wrap { flex:1; min-width:0; display:flex; align-items:center; gap:8px; color:rgba(255,255,255,.72); font-size:10px; font-weight:850; }
.demo-role-select-wrap span { flex:0 0 auto; }
.demo-select {
  flex: 1; min-width: 0; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.1); color: white; border: 1px solid rgba(255,255,255,.2); padding: 0 10px;
}
.demo-select option { color: var(--text); }

.app-stage { min-height: calc(100vh - var(--demo-h)); }
.app-shell { min-height: calc(100vh - var(--demo-h)); background: var(--bg); }

/* Desktop */
.desktop-layout { display: grid; grid-template-columns: 258px minmax(0,1fr); min-height: calc(100vh - var(--demo-h)); }
.sidebar {
  position: sticky; top: var(--demo-h); height: calc(100vh - var(--demo-h)); overflow: auto;
  padding: 20px 16px 16px;
  background: #fffdf9;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.preschool-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 18px; border-bottom: 1px solid var(--line); }
.preschool-logo {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 15px; background: var(--primary); color: white;
  display: grid; place-items: center; font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 24px; font-weight: 900;
  box-shadow: 0 8px 18px rgba(39,76,119,.18);
}
.preschool-brand-name { color: var(--primary); font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 800; line-height: 1.15; font-size: 14px; }
.preschool-brand-sub { margin-top: 4px; font-size: 10px; color: var(--muted); line-height: 1.25; }
.side-nav { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; }
.side-nav-btn {
  width: 100%; border: 0; background: transparent; color: var(--muted);
  min-height: 43px; padding: 10px 12px; border-radius: 12px;
  display: flex; align-items: center; gap: 11px; text-align: left; font-size: 13px; font-weight: 780;
}
.side-nav-btn:hover { background: var(--surface-neutral); color: var(--primary); }
.side-nav-btn.active { background: var(--primary-soft); color: var(--primary); }
.side-nav-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; }
.side-nav-icon svg { width: 19px; height: 19px; }
.sidebar-bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 9px 8px; }
.avatar {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 900; border: 1px solid rgba(39,76,119,.1);
}
.user-name { font-weight: 850; font-size: 13px; color: var(--primary); }
.user-role { font-size: 10px; color: var(--muted); margin-top: 3px; }

.workspace { min-width: 0; }
.topbar {
  position: sticky; top: var(--demo-h); z-index: 60;
  height: 66px; padding: 0 28px;
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,249,242,.93); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(39,76,119,.07);
}
.topbar-title { min-width: 0; }
.topbar-kicker { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 900; }
.topbar-page { color: var(--primary); font-weight: 900; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: white; color: var(--primary);
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-neutral); }
.icon-btn svg { width: 19px; height: 19px; }
.notification-dot { position: relative; }
.notification-dot::after { content:""; position:absolute; width:8px; height:8px; border-radius:50%; background:var(--coral); top:7px; right:7px; border:2px solid white; }

.page { padding: 28px; max-width: 1540px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-title { margin: 0; font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--primary); font-size: clamp(28px, 3vw, 38px); line-height: 1.05; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Shared components */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.layout-main-aside { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid rgba(39,76,119,.09); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-title { margin: 0; color: var(--primary); font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 19px; }
.card-subtitle { color: var(--muted); font-size: 11px; margin-top: 5px; }
.section { margin-top: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.section-title { margin: 0; color: var(--primary); font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 20px; }
.section-note { color: var(--muted); font-size: 11px; }
.metric-card { padding: 18px; min-height: 116px; position: relative; overflow: hidden; }
.metric-card::after { content:""; position:absolute; width:90px; height:90px; border-radius:50%; right:-24px; top:-25px; opacity:.28; background:currentColor; }
.metric-card.green { color: var(--green); background: linear-gradient(145deg, white, var(--green-soft)); }
.metric-card.coral { color: var(--coral); background: linear-gradient(145deg, white, var(--coral-soft)); }
.metric-card.amber { color: var(--amber); background: linear-gradient(145deg, white, var(--amber-soft)); }
.metric-card.teal { color: var(--teal); background: linear-gradient(145deg, white, var(--teal-soft)); }
.metric-card.blue { color: var(--primary-2); background: linear-gradient(145deg, white, var(--primary-soft)); }
.metric-value { color: var(--primary); font-size: 32px; line-height: 1; font-weight: 950; position:relative; z-index:1; }
.metric-label { color: var(--text); margin-top: 10px; font-size: 12px; font-weight: 850; position:relative; z-index:1; }
.metric-meta { color: var(--muted); margin-top: 6px; font-size: 10px; position:relative; z-index:1; }

.btn {
  border: 0; border-radius: 13px; min-height: 42px; padding: 10px 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; font-weight: 850; transition: transform .12s ease, opacity .12s ease, box-shadow .12s ease;
}
.btn:hover { box-shadow: 0 6px 16px rgba(39,76,119,.12); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--primary); color: white; }
.btn.green { background: var(--green); color: white; }
.btn.coral { background: var(--coral); color: white; }
.btn.amber { background: var(--amber); color: #4d3300; }
.btn.teal { background: var(--teal); color: white; }
.btn.ghost { background: var(--surface-neutral); color: var(--primary); border: 1px solid var(--line); }
.btn.white { background: white; color: var(--primary); border: 1px solid var(--line); }
.btn.small { min-height: 34px; padding: 7px 10px; font-size: 10px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.badge { display: inline-flex; align-items:center; gap:5px; border-radius:999px; padding:5px 8px; font-size:10px; font-weight:900; white-space:nowrap; }
.badge.green { color:#356b3a; background:var(--green-soft); }
.badge.coral { color:#9c4038; background:var(--coral-soft); }
.badge.amber { color:#72500f; background:var(--amber-soft); }
.badge.teal { color:#286d68; background:var(--teal-soft); }
.badge.blue { color:var(--primary); background:var(--primary-soft); }
.badge.neutral { color:var(--muted); background:var(--surface-neutral); }

.toolbar { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 14px; }
.search-box { position: relative; min-width: 240px; flex: 1; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.search-box input, .input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: white; color: var(--text); border-radius: 12px; min-height: 42px; padding: 10px 12px;
}
.search-box input { padding-left: 38px; }
.textarea { min-height: 110px; resize: vertical; }
.filter-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { border:1px solid var(--line); background:white; color:var(--muted); border-radius:999px; min-height:34px; padding:7px 10px; font-size:10px; font-weight:850; }
.chip.active { background:var(--primary); color:white; border-color:var(--primary); }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { position: sticky; top: 0; z-index: 1; padding: 12px 14px; text-align: left; background: var(--surface-neutral); color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 13px 14px; border-top: 1px solid #eee9e1; font-size: 12px; vertical-align: middle; }
tr.clickable:hover td { background: #fffdf9; cursor: pointer; }
.cell-main { font-weight: 850; color: var(--primary); }
.cell-sub { color: var(--muted); font-size: 10px; margin-top: 3px; }

.list { display:flex; flex-direction:column; gap:9px; }
.list-row { display:flex; align-items:center; gap:11px; padding:13px 14px; border:1px solid rgba(39,76,119,.08); background:white; border-radius:14px; }
.list-row.clickable:hover { background:#fffdf9; cursor:pointer; }
.list-icon { width:36px; height:36px; border-radius:11px; display:grid; place-items:center; flex:0 0 auto; }
.list-icon svg { width:18px; height:18px; }
.list-icon.green { background:var(--green-soft); color:#467e49; }
.list-icon.coral { background:var(--coral-soft); color:#a4443c; }
.list-icon.amber { background:var(--amber-soft); color:#7b5511; }
.list-icon.teal { background:var(--teal-soft); color:#2c756f; }
.list-icon.blue { background:var(--primary-soft); color:var(--primary); }
.list-main { min-width:0; flex:1; }
.list-title { display:block; font-weight:850; color:var(--primary); font-size:12px; }
.list-sub { display:block; color:var(--muted); font-size:10px; margin-top:4px; line-height:1.35; }
.chevron { color:var(--muted); font-size:20px; }

.group-card { padding: 16px; }
.group-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.group-name { color:var(--primary); font-weight:950; font-size:15px; }
.progress { height:8px; background:#ede9e2; border-radius:999px; overflow:hidden; margin-top:11px; }
.progress > span { display:block; height:100%; background:var(--green); border-radius:inherit; }
.group-meta { display:flex; gap:9px; flex-wrap:wrap; color:var(--muted); font-size:10px; margin-top:9px; }

.child-card { padding: 20px; display:flex; align-items:center; gap:16px; }
.child-avatar { width:66px; height:66px; border-radius:50%; background:linear-gradient(135deg,var(--amber-soft),var(--teal-soft)); display:grid; place-items:center; font-size:28px; border:4px solid white; box-shadow:var(--shadow-sm); }
.child-name { color:var(--primary); font-family:Manrope,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:24px; font-weight:900; }
.child-meta { display:flex; gap:7px; flex-wrap:wrap; margin-top:8px; }

.notice { padding:13px 14px; border-radius:13px; font-size:11px; line-height:1.45; }
.notice.green { background:var(--green-soft); color:#356b3a; }
.notice.coral { background:var(--coral-soft); color:#963c35; }
.notice.amber { background:var(--amber-soft); color:#6d4b0e; }
.notice.blue { background:var(--primary-soft); color:var(--primary); }

.quick-actions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.quick-action { border:1px solid var(--line); background:white; border-radius:16px; min-height:96px; padding:13px; color:var(--primary); text-align:left; display:flex; flex-direction:column; justify-content:space-between; font-weight:850; }
.quick-action:hover { background:var(--surface-neutral); }
.quick-action .qa-icon { width:36px; height:36px; border-radius:11px; display:grid; place-items:center; background:var(--primary-soft); }
.quick-action .qa-icon svg { width:18px; height:18px; }

.message-layout { display:grid; grid-template-columns:320px minmax(0,1fr); min-height:570px; overflow:hidden; }
.conversation-list { border-right:1px solid var(--line); padding:12px; background:#fffdf9; }
.conversation-item { padding:12px; border-radius:12px; display:flex; gap:10px; align-items:flex-start; cursor:pointer; }
.conversation-item:hover, .conversation-item.active { background:var(--primary-soft); }
.conversation-main { min-width:0; flex:1; }
.conversation-name { color:var(--primary); font-weight:850; font-size:12px; }
.conversation-preview { color:var(--muted); font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:4px; }
.chat-panel { display:flex; flex-direction:column; min-width:0; background:white; }
.chat-header { padding:15px 18px; border-bottom:1px solid var(--line); }
.chat-scroll { padding:18px; flex:1; display:flex; flex-direction:column; gap:10px; overflow:auto; background:#fffdf9; }
.bubble { max-width:72%; padding:11px 13px; border-radius:14px; font-size:11px; line-height:1.45; }
.bubble.mine { margin-left:auto; background:var(--surface-warm); border-bottom-right-radius:4px; }
.bubble.theirs { background:var(--primary-soft); color:var(--primary); border-bottom-left-radius:4px; }
.bubble-time { margin-top:5px; font-size:9px; color:var(--muted); }
.chat-composer { display:flex; gap:8px; padding:13px; border-top:1px solid var(--line); background:white; }
.chat-composer input { flex:1; min-width:0; border:1px solid var(--line); border-radius:12px; padding:10px 12px; }

.calendar-layout { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(280px,.7fr); gap:18px; }
.event-list { display:flex; flex-direction:column; gap:10px; }
.event-card { display:grid; grid-template-columns:58px 1fr auto; gap:12px; align-items:center; padding:14px; }
.event-date { width:52px; min-height:52px; border-radius:13px; display:flex; flex-direction:column; align-items:center; justify-content:center; background:var(--teal-soft); color:#286d68; font-weight:900; }
.event-date strong { font-size:20px; line-height:1; }
.event-date span { font-size:9px; margin-top:3px; }
.event-title { color:var(--primary); font-weight:900; font-size:13px; }
.event-meta { color:var(--muted); font-size:10px; margin-top:5px; }
.month-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.month-cell { min-height:56px; border:1px solid var(--line); border-radius:10px; padding:6px; font-size:10px; background:white; }
.month-cell.has-event { border-color:rgba(79,154,148,.45); background:var(--teal-soft); }

.menu-grid { display:grid; grid-template-columns:repeat(5,minmax(150px,1fr)); gap:8px; overflow:auto; padding-bottom:4px; }
.menu-day { min-width:150px; }
.menu-day-head { padding:11px; border-radius:12px 12px 0 0; background:var(--primary); color:white; font-weight:900; text-align:center; font-size:11px; }
.menu-cell { min-height:92px; padding:10px; border:1px solid var(--line); border-top:0; background:white; font-size:10px; line-height:1.45; }
.menu-label { color:var(--muted); text-transform:uppercase; letter-spacing:.04em; font-size:8px; font-weight:900; display:block; margin-bottom:5px; }

.attendance-list { display:flex; flex-direction:column; gap:9px; }
.attendance-row { display:grid; grid-template-columns:minmax(170px,1fr) minmax(230px,320px); gap:12px; align-items:center; padding:13px 14px; }
.attendance-person { display:flex; align-items:center; gap:10px; }
.initials { width:38px; height:38px; border-radius:50%; background:var(--teal-soft); color:#286d68; display:grid; place-items:center; font-weight:900; flex:0 0 auto; }
.status-controls { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.status-btn { min-height:38px; border:1px solid var(--line); border-radius:11px; background:var(--surface-neutral); color:var(--muted); font-size:10px; font-weight:900; }
.status-btn.present.active { background:var(--green-soft); color:#356b3a; border-color:rgba(120,169,120,.5); }
.status-btn.absent.active { background:var(--coral-soft); color:#963c35; border-color:rgba(217,108,99,.5); }

.offer-card { padding:20px; min-height:210px; display:flex; flex-direction:column; }
.offer-card .offer-icon { width:48px; height:48px; border-radius:15px; display:grid; place-items:center; margin-bottom:14px; }
.offer-card .offer-icon svg { width:23px; height:23px; }
.offer-card h3 { margin:0; color:var(--primary); font-family:Manrope,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:20px; }
.offer-card p { color:var(--muted); font-size:11px; line-height:1.55; }
.offer-card .btn { margin-top:auto; }

.role-matrix { min-width:900px; }
.role-matrix th:not(:first-child), .role-matrix td:not(:first-child) { text-align:center; }
.toggle { width:42px; height:24px; border-radius:999px; background:#dfe3e5; border:0; padding:3px; display:inline-flex; align-items:center; }
.toggle span { width:18px; height:18px; border-radius:50%; background:white; box-shadow:0 2px 6px rgba(0,0,0,.16); transition:transform .15s ease; }
.toggle.on { background:var(--green); }
.toggle.on span { transform:translateX(18px); }

/* Mobile */
.mobile-layout { display:none; width:100%; max-width:100%; min-width:0; min-height:calc(100dvh - var(--demo-h)); background:var(--bg); padding-bottom:86px; overflow-x:hidden; }
.mobile-header { position:sticky; top:var(--demo-h); z-index:60; min-height:62px; padding:10px 16px; display:flex; align-items:center; gap:10px; background:rgba(255,249,242,.94); backdrop-filter:blur(14px); border-bottom:1px solid rgba(39,76,119,.07); }
.mobile-brand { min-width:0; flex:1; display:flex; align-items:center; gap:9px; }
.mobile-brand .preschool-logo { width:38px; height:38px; border-radius:12px; font-size:18px; }
.mobile-brand-name { color:var(--primary); font-family:Manrope,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-weight:900; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mobile-brand-sub { color:var(--muted); font-size:9px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mobile-content { width:100%; max-width:100%; min-width:0; padding:18px 16px 34px; overflow-x:hidden; }
.mobile-content > .page { width:100%; max-width:100%; min-width:0; padding:0; }
.mobile-content .page > *,
.mobile-content .layout-main-aside > *,
.mobile-content .grid > *,
.mobile-content aside,
.mobile-content section { min-width:0; max-width:100%; }
.mobile-content .page-title { font-size:28px; }
.mobile-content .page-header { display:block; margin-bottom:16px; }
.mobile-content .page-actions { justify-content:flex-start; margin-top:12px; }
.mobile-content .grid-2, .mobile-content .grid-3, .mobile-content .grid-4 { grid-template-columns:minmax(0,1fr); }
.mobile-content .grid { width:100%; max-width:100%; min-width:0; }
.mobile-content .metric-grid-mobile { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.mobile-content .metric-card { min-height:96px; padding:14px; }
.mobile-content .metric-value { font-size:26px; }
.mobile-content .quick-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
.mobile-content .quick-action { min-height:88px; }
.mobile-content .layout-main-aside, .mobile-content .calendar-layout { width:100%; max-width:100%; min-width:0; grid-template-columns:minmax(0,1fr); }
.mobile-content .layout-main-aside > div,
.mobile-content .layout-main-aside > aside { width:100%; max-width:100%; min-width:0; }
.mobile-content .child-card { display:block; }
.mobile-content .child-avatar { margin-bottom:12px; }
.mobile-content .attendance-row { grid-template-columns:1fr; }
.mobile-content .message-layout { grid-template-columns:1fr; min-height:580px; }
.mobile-content .conversation-list { border-right:0; border-bottom:1px solid var(--line); max-height:220px; overflow:auto; }
.mobile-content .chat-panel { min-height:360px; }
.mobile-content .bubble { max-width:88%; }
.mobile-content .event-card { grid-template-columns:52px 1fr; }
.mobile-content .event-card > .btn { grid-column:2; justify-self:start; }
.mobile-content .table-wrap { width:100%; max-width:100%; min-width:0; overflow-x:auto; border-radius:13px; -webkit-overflow-scrolling:touch; }
.mobile-content table { width:max-content; min-width:680px; max-width:none; }
.mobile-content .table-wrap::after { content:"Przesuń tabelę w bok"; display:block; padding:6px 10px; color:var(--muted); font-size:9px; text-align:right; }
.mobile-content .menu-grid { grid-template-columns:1fr; overflow:visible; }
.mobile-content .menu-day { min-width:0; }
.mobile-content .menu-day:not(:first-child) { display:none; }

.bottom-nav { position:fixed; left:0; right:0; width:100vw; max-width:100vw; bottom:0; z-index:80; display:grid; grid-template-columns:repeat(5,1fr); padding:7px 6px calc(7px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.97); border-top:1px solid rgba(39,76,119,.1); box-shadow:0 -8px 24px rgba(39,76,119,.08); }
.bottom-nav-btn { border:0; background:transparent; color:var(--muted); min-width:0; padding:3px 1px; display:flex; flex-direction:column; align-items:center; gap:3px; font-size:9px; font-weight:850; }
.bottom-nav-btn svg { width:18px; height:18px; }
.bottom-nav-btn.active { color:var(--primary); }
.bottom-nav-icon { width:32px; height:26px; border-radius:999px; display:grid; place-items:center; }
.bottom-nav-btn.active .bottom-nav-icon { background:var(--primary-soft); }
.mobile-more-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.mobile-more-btn { min-height:95px; border:1px solid var(--line); background:white; border-radius:16px; padding:13px; text-align:left; color:var(--primary); font-size:11px; font-weight:850; }
.mobile-more-btn svg { width:20px; height:20px; margin-bottom:10px; }

.mobile-content .section-head { min-width:0; flex-wrap:wrap; }
.mobile-content .section-head > * { min-width:0; }
.mobile-content .card,
.mobile-content .group-card,
.mobile-content .list,
.mobile-content .list-row { max-width:100%; min-width:0; }
.mobile-content .list-main { min-width:0; }
.mobile-content .list-title,
.mobile-content .list-sub { overflow-wrap:anywhere; }
.mobile-content .btn { max-width:100%; }

/* Modal / drawer */
.modal-backdrop { position:fixed; inset:0; z-index:2000; background:rgba(23,40,55,.55); display:flex; align-items:center; justify-content:center; padding:20px; }
.modal { width:min(620px,100%); max-height:calc(100vh - 40px); overflow:auto; background:white; border-radius:24px; box-shadow:0 30px 90px rgba(0,0,0,.28); }
.modal-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:20px 22px 14px; border-bottom:1px solid var(--line); }
.modal-title { margin:0; color:var(--primary); font-family:Manrope,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:24px; }
.modal-subtitle { margin:5px 0 0; color:var(--muted); font-size:11px; }
.modal-body { padding:20px 22px; }
.modal-footer { display:flex; gap:8px; justify-content:flex-end; padding:14px 22px 20px; border-top:1px solid var(--line); }
.close-btn { width:38px; height:38px; border-radius:12px; border:1px solid var(--line); background:white; color:var(--primary); display:grid; place-items:center; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.field label { display:block; color:var(--muted); font-size:10px; font-weight:850; margin-bottom:6px; }
.field.full { grid-column:1/-1; }

.drawer-backdrop { position:fixed; inset:0; z-index:1900; background:rgba(23,40,55,.35); }
.drawer { position:absolute; top:0; right:0; width:min(520px,100%); height:100%; overflow:auto; background:white; box-shadow:-24px 0 70px rgba(0,0,0,.2); padding:22px; }
.drawer-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:18px; }

.scenario-panel { position:fixed; right:18px; bottom:18px; z-index:1500; width:min(370px,calc(100vw - 36px)); background:white; border:1px solid var(--line); border-radius:20px; box-shadow:0 22px 60px rgba(23,50,79,.22); overflow:hidden; }
.scenario-head { padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--primary); color:white; }
.scenario-title { font-weight:900; font-size:13px; }
.scenario-body { padding:14px; }
.scenario-step { display:flex; gap:10px; align-items:flex-start; padding:10px; border-radius:12px; cursor:pointer; }
.scenario-step:hover { background:var(--surface-neutral); }
.scenario-number { width:25px; height:25px; border-radius:50%; background:var(--primary-soft); color:var(--primary); display:grid; place-items:center; font-weight:900; font-size:10px; flex:0 0 auto; }
.scenario-step.done .scenario-number { background:var(--green-soft); color:#356b3a; }
.scenario-copy strong { display:block; color:var(--primary); font-size:11px; }
.scenario-copy span { display:block; color:var(--muted); font-size:9px; margin-top:3px; line-height:1.35; }

.toast { position:fixed; left:50%; bottom:22px; transform:translateX(-50%); z-index:3000; max-width:min(520px,calc(100vw - 32px)); padding:12px 16px; border-radius:13px; background:#17324f; color:white; box-shadow:0 18px 50px rgba(0,0,0,.24); font-size:11px; font-weight:800; }
.empty-state { padding:40px 20px; text-align:center; color:var(--muted); }
.empty-state svg { width:38px; height:38px; margin:0 auto 12px; color:var(--primary-2); }



@media (max-width: 1120px) {
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quick-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .layout-main-aside { grid-template-columns:1fr; }
}

@media (max-width: 820px) {
  :root { --demo-h: 58px; }
  .demo-toolbar { min-height:var(--demo-h); padding:8px 10px; }
  .demo-toolbar-inner { display:none; }
  .demo-mobile-controls { display:flex; }
  .demo-select { min-width:0; height:38px; }
  .desktop-layout { display:none; }
  .mobile-layout { display:block; }
  .app-stage, .app-shell { min-height:calc(100dvh - var(--demo-h)); }
  .modal-backdrop { align-items:flex-end; padding:0; }
  .modal { width:100%; max-height:92dvh; border-radius:24px 24px 0 0; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .scenario-panel { bottom:86px; }
}

@media (max-width: 520px) {
  .demo-toolbar { padding:8px; }
  .demo-mobile-controls { gap:6px; }
  .demo-role-select-wrap { gap:5px; }
  .demo-role-select-wrap span { display:none; }
  .demo-action-btn { min-height:38px; padding:7px 9px; font-size:10px; }
  .mobile-header { top:var(--demo-h); }
  .mobile-content { padding-left:14px; padding-right:14px; }
  .mobile-content .page-title { font-size:26px; }
  .mobile-content .metric-grid-mobile { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .scenario-panel { right:8px; width:calc(100vw - 16px); }
}


/* =========================================================
   KINDAY DEMO v3 — desktop app shell correction
   One module title only. The outer document never scrolls.
   ========================================================= */
html,
body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.demo-toolbar {
  position: relative;
  top: auto;
}

.app-stage,
.app-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.desktop-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  position: static;
  top: auto;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.workspace {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  position: static;
  top: auto;
  height: 58px;
  min-height: 58px;
  padding: 0 28px;
  z-index: 60;
}

/* The top utility bar no longer repeats the active module name. */
.topbar-title,
.topbar-kicker,
.topbar-page {
  display: none !important;
}

.topbar-context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.topbar-context-name {
  color: var(--primary);
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-context-separator {
  color: #b4ada4;
}

.topbar-context-role {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  white-space: nowrap;
}

.workspace-content {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.workspace-content > .page {
  min-height: 100%;
}

/* Mobile uses the same fixed-shell principle: header and navigation stay put,
   only the content area scrolls. */
.mobile-layout {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.mobile-header {
  position: static;
  top: auto;
}

.mobile-content {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 34px;
  -webkit-overflow-scrolling: touch;
}

.bottom-nav {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 820px) {
  .mobile-layout {
    display: grid;
  }

  .app-stage,
  .app-shell {
    height: 100%;
    min-height: 0;
  }
}

/* =========================================================
   KINDAY DEMO v4 — role login, single app bar and menu import
   ========================================================= */
:root { --demo-h: 0px; }

html,
body,
#app {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#app {
  display: block;
}

.demo-toolbar {
  display: none !important;
}

.app-stage,
.app-shell,
.desktop-layout,
.mobile-layout {
  height: 100dvh;
  min-height: 0;
}

/* Role-selection login replaces the permanent demo control bar. */
.demo-login {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(560px, 1.22fr);
  overflow: hidden;
  background: var(--bg);
}

.demo-login-hero {
  min-height: 0;
  padding: clamp(34px, 5vw, 72px);
  color: white;
  background:
    radial-gradient(circle at 18% 20%, rgba(120,169,209,.33), transparent 34%),
    radial-gradient(circle at 85% 75%, rgba(229,168,59,.23), transparent 34%),
    linear-gradient(145deg, #17324f, #274c77 72%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.demo-login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.demo-login-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: white;
  color: var(--primary);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 28px;
  font-weight: 950;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
}

.demo-login-brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: .12em;
}

.demo-login-brand span {
  display: block;
  margin-top: 4px;
  color: rgba(255,255,255,.68);
  font-size: 11px;
}

.demo-login-copy {
  max-width: 520px;
  margin: auto 0;
  padding: 40px 0;
}

.demo-login-eyebrow {
  display: block;
  color: var(--amber);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.demo-login-copy h1 {
  margin: 14px 0 18px;
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(40px, 5vw, 66px);
  line-height: .98;
}

.demo-login-copy p {
  max-width: 470px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: 15px;
  line-height: 1.65;
}

.demo-login-notice {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 760;
}

.demo-login-panel {
  min-width: 0;
  min-height: 0;
  padding: clamp(28px, 4vw, 58px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
}

.demo-login-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.demo-login-panel-head h2 {
  margin: 8px 0 0;
  color: var(--primary);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(26px, 3vw, 36px);
}

.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.demo-role-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 17px;
  border: 1px solid rgba(39,76,119,.1);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.demo-role-card .btn {
  grid-column: 1 / -1;
  justify-content: center;
}

.demo-role-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}

.demo-role-icon.blue { background: var(--primary-soft); color: var(--primary); }
.demo-role-icon.green { background: var(--green-soft); color: #3f7745; }
.demo-role-icon.teal { background: var(--teal-soft); color: #2d716c; }
.demo-role-icon.amber { background: var(--amber-soft); color: #805b11; }
.demo-role-icon.coral { background: var(--coral-soft); color: #9a463f; }

.demo-role-copy h3 {
  margin: 2px 0 5px;
  color: var(--primary);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}

.demo-role-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.demo-scenario-start {
  width: 100%;
  margin-top: 14px;
  padding: 15px 17px;
  border: 1px solid rgba(229,168,59,.3);
  border-radius: 17px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--amber-soft);
  color: var(--primary);
}

.demo-scenario-start > span:first-child {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: white;
  color: #8a6110;
}

.demo-scenario-start strong,
.demo-scenario-start small {
  display: block;
}

.demo-scenario-start strong { font-size: 12px; }
.demo-scenario-start small { margin-top: 4px; color: var(--muted); font-size: 10px; }

/* Desktop session controls live with the user card, not in a second top bar. */
.sidebar-session-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}

.sidebar-session-btn {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  background: white;
  color: var(--muted);
  font-size: 10px;
  font-weight: 820;
}

.sidebar-session-btn:hover {
  background: var(--surface-neutral);
  color: var(--primary);
}

.topbar-actions .avatar {
  display: none;
}

.mobile-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

/* Mobile menu: one day at a time with an explicit route back to the week. */
.menu-mobile-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-neutral);
}

.menu-mobile-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.menu-mobile-tabs button.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.menu-mobile-back {
  margin-bottom: 10px;
}

.menu-mobile-back .btn svg {
  transform: rotate(180deg);
}

.menu-day-navigator {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.menu-day-navigator > div {
  min-width: 0;
  text-align: center;
}

.menu-day-navigator strong,
.menu-day-navigator span {
  display: block;
}

.menu-day-navigator strong {
  color: var(--primary);
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}

.menu-day-navigator span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.menu-day-navigator .icon-btn:disabled {
  opacity: .32;
  cursor: default;
}

.menu-chevron-left {
  display: grid;
  place-items: center;
  transform: rotate(180deg);
}

.menu-mobile-meals {
  display: grid;
  gap: 10px;
}

.menu-mobile-meal {
  padding: 14px;
  border-left: 4px solid var(--amber);
}

.menu-mobile-meal p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.menu-mobile-week {
  display: grid;
  gap: 9px;
}

.menu-week-row {
  width: 100%;
  min-width: 0;
  padding: 13px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.menu-week-date strong,
.menu-week-date small {
  display: block;
}

.menu-week-date strong {
  color: var(--primary);
  font-size: 11px;
}

.menu-week-date small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.menu-week-summary {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Word import guidance. */
.import-format-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--primary-soft);
}

.import-format-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: white;
  color: var(--primary);
}

.import-format-card strong {
  color: var(--primary);
  font-size: 12px;
}

.import-format-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.import-requirements {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-warm);
}

.import-requirements h3 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
}

.import-requirements ul {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.upload-zone {
  min-height: 150px;
  padding: 18px;
  border: 1.5px dashed #b8c9d8;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  background: #fbfdff;
  cursor: pointer;
}

.upload-zone-icon {
  color: var(--primary);
}

.upload-zone strong {
  color: var(--primary);
  font-size: 12px;
}

.upload-zone > span:not(.upload-zone-icon) {
  color: var(--muted);
  font-size: 10px;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone em {
  margin-top: 7px;
  max-width: 100%;
  color: var(--primary-2);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.modal-footer {
  flex-wrap: wrap;
}

@media (max-width: 1040px) {
  .demo-login {
    grid-template-columns: minmax(280px, .65fr) minmax(500px, 1.35fr);
  }

  .demo-login-hero {
    padding: 32px;
  }
}

@media (max-width: 820px) {
  .demo-login {
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .demo-login-hero {
    min-height: auto;
    padding: 24px 18px 26px;
  }

  .demo-login-copy {
    margin: 30px 0 24px;
    padding: 0;
  }

  .demo-login-copy h1 {
    font-size: 38px;
  }

  .demo-login-copy p {
    font-size: 13px;
  }

  .demo-login-notice {
    width: 100%;
  }

  .demo-login-panel {
    padding: 22px 16px 34px;
    overflow: visible;
  }

  .demo-login-panel-head {
    align-items: flex-start;
  }

  .demo-role-grid {
    grid-template-columns: 1fr;
  }

  .app-stage,
  .app-shell,
  .mobile-layout {
    height: 100dvh;
  }

  .modal-footer .btn {
    flex: 1 1 130px;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .demo-login-panel-head {
    display: block;
  }

  .demo-login-panel-head > .btn {
    margin-top: 12px;
  }

  .menu-week-row {
    grid-template-columns: 80px minmax(0, 1fr) auto;
  }
}

/* =========================================================
   KINDAY DEMO v5 — stable desktop canvas across resolutions
   Desktop UI is NOT scaled with viewport width. Larger displays
   add breathing room; they do not stretch typography/cards.
   ========================================================= */
@media (min-width: 821px) {
  :root {
    --desktop-shell-max: 1600px;
    --desktop-content-max: 1280px;
    --desktop-sidebar: 258px;
  }

  body {
    background: #f2ece4;
  }

  /* Stable login composition. No vw-based typography/padding. */
  .demo-login {
    width: min(1440px, 100%);
    max-width: 1440px;
    margin: 0 auto;
    grid-template-columns: 500px minmax(0, 1fr);
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(39,76,119,.04), 0 18px 70px rgba(30,48,63,.08);
  }

  .demo-login-hero {
    padding: 48px;
  }

  .demo-login-copy {
    max-width: 410px;
    padding: 34px 0;
  }

  .demo-login-copy h1 {
    font-size: 50px;
    line-height: 1.02;
    letter-spacing: -.035em;
    font-weight: 800;
  }

  .demo-login-copy p {
    font-size: 14px;
  }

  .demo-login-panel {
    padding: 44px 48px;
  }

  .demo-login-panel-head h2 {
    font-size: 34px;
  }

  .demo-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .demo-role-card {
    padding: 16px;
  }

  /* Stable desktop application shell. */
  .desktop-layout {
    width: min(var(--desktop-shell-max), 100%);
    max-width: var(--desktop-shell-max);
    margin: 0 auto;
    grid-template-columns: var(--desktop-sidebar) minmax(0, 1fr);
    background: var(--bg);
    box-shadow: 0 0 0 1px rgba(39,76,119,.035);
  }

  .workspace {
    min-width: 0;
    min-height: 0;
  }

  .topbar {
    padding-left: 28px;
    padding-right: 28px;
  }

  .page {
    width: 100%;
    max-width: var(--desktop-content-max);
    margin: 0 auto;
    padding: 28px 32px 36px;
  }

  .page-title {
    font-size: 36px;
  }

  /* Prevent large monitors from turning components into giant tiles. */
  .metric-card {
    min-height: 108px;
  }

  .layout-main-aside {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 360px);
  }

  .modal {
    width: min(620px, calc(100% - 48px));
  }
}

/* Compact desktop / MacBook class: same composition, tighter fixed values. */
@media (min-width: 821px) and (max-width: 1240px) {
  :root {
    --desktop-sidebar: 236px;
  }

  .demo-login {
    grid-template-columns: 390px minmax(0, 1fr);
  }

  .demo-login-hero {
    padding: 32px;
  }

  .demo-login-copy h1 {
    font-size: 44px;
    line-height: 1.03;
    letter-spacing: -.035em;
    font-weight: 800;
  }

  .demo-login-panel {
    padding: 30px 32px;
  }

  .demo-login-panel-head h2 {
    font-size: 30px;
  }

  .demo-role-card {
    padding: 14px;
  }

  .page {
    padding: 24px 26px 32px;
  }

  .page-title {
    font-size: 34px;
  }
}

/* Very wide desktop: preserve the same desktop design instead of scaling it. */
@media (min-width: 1921px) {
  .demo-login,
  .desktop-layout {
    border-left: 1px solid rgba(39,76,119,.05);
    border-right: 1px solid rgba(39,76,119,.05);
  }
}


/* KINDAY v6 typography: modern, warm sans-serif headings */
.page-title, .card-title, .section-title, .modal-title, .child-name, .preschool-brand-name, .mobile-brand-name, .demo-login-copy h1, .demo-login-panel-head h2, .demo-role-copy h3, .offer-card h3 {
  font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
}
.demo-login-copy h1 { font-weight: 800; }
.demo-login-panel-head h2, .page-title { font-weight: 800; }
.card-title, .section-title, .modal-title, .demo-role-copy h3 { font-weight: 700; }

/* KINDAY v7 — karty NFC i kontrola dostępu */
.access-device-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.access-device-card { display:flex; align-items:center; gap:12px; padding:15px 16px; }
.access-device-icon { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; flex:0 0 auto; }
.access-device-icon.green { background:var(--green-soft); color:#356b3a; }
.access-device-icon.teal { background:var(--teal-soft); color:#286d68; }
.access-device-icon.blue { background:var(--primary-soft); color:var(--primary); }
.access-live-card { background:linear-gradient(145deg,#fff,var(--green-soft)); }
.access-timeline { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; margin-top:18px; }
.access-timeline > div:not(.access-line) { display:flex; flex-direction:column; gap:4px; }
.access-timeline span { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.access-timeline strong { color:var(--primary); font-size:22px; }
.access-line { height:3px; background:linear-gradient(90deg,var(--green),var(--teal)); border-radius:999px; }
@media (max-width: 1100px) { .access-device-grid { grid-template-columns:1fr; } }
@media (max-width: 820px) {
  .access-device-grid { grid-template-columns:1fr; }
  .access-device-card { padding:13px; }
  .access-timeline strong { font-size:18px; }
  #cards-table .btn { min-width:70px; }
}

/* KINDAY v10 — public parent demo / PWA */
html,body,#app{height:100%;min-height:0;overflow:hidden;}
body{overscroll-behavior:none;}
.workspace-content,.mobile-content{overscroll-behavior:contain;}
@media (min-width:821px){
  .desktop-layout{max-width:1600px;margin:0 auto;}
  .sidebar{width:248px;}
  .workspace-content{padding-top:18px;padding-bottom:18px;}
  .workspace-content>.page{max-width:1280px;margin:0 auto;}
}
@media (max-width:820px){
  .mobile-layout{height:100dvh;}
  .mobile-header{min-height:58px;padding:8px 12px;gap:7px;}
  .mobile-header .icon-btn{width:36px;height:36px;flex:0 0 36px;}
  .mobile-header .avatar{width:34px;height:34px;flex:0 0 34px;font-size:10px;}
  .mobile-content{padding:12px 12px 18px;}
  .mobile-content .page-header{margin-bottom:12px;}
  .mobile-content .page-title{font-size:22px;}
  .mobile-content .page-subtitle{font-size:10px;line-height:1.35;}
  .mobile-content .child-card{padding:12px;}
  .mobile-content .child-avatar{width:48px;height:48px;font-size:24px;}
  .mobile-content .child-name{font-size:17px;}
  .mobile-content .grid.grid-3{gap:8px;}
  .mobile-content .card-pad{padding:12px;}
  .bottom-nav{min-height:66px;padding-bottom:max(5px,env(safe-area-inset-bottom));}
  .bottom-nav-btn{min-height:56px;}
}


/* =========================================================
   KINDAY v11 — mobile web-app: fixed shell, no document scroll
   ========================================================= */
html, body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}
body {
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}
#app, .app-stage, .app-shell { height: 100dvh !important; min-height: 0 !important; overflow: hidden !important; }
@supports (-webkit-touch-callout: none) {
  #app, .app-stage, .app-shell, .mobile-layout { height: -webkit-fill-available !important; }
}
@media (max-width: 820px) {
  .mobile-layout {
    height: 100dvh !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-rows: 58px minmax(0,1fr) 66px !important;
    overflow: hidden !important;
    padding: 0 !important;
  }
  .mobile-header { height:58px; min-height:58px; overflow:hidden; }
  .mobile-content {
    min-height: 0 !important;
    height: auto !important;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 10px 12px 14px !important;
  }
  .bottom-nav { height:66px; min-height:66px; overflow:hidden; padding:5px 6px max(5px,env(safe-area-inset-bottom)) !important; }

  /* Start screen behaves like a native app dashboard: no vertical scroll. */
  .mobile-layout.route-dashboard .mobile-content { overflow: hidden !important; }
  .mobile-layout.route-dashboard .mobile-content > .page { height:100%; min-height:0; overflow:hidden; }
  .parent-mobile-home { display:grid; grid-template-rows:auto auto minmax(0,1fr); gap:9px; }
  .parent-mobile-hero { border:1px solid rgba(39,76,119,.10); border-radius:18px; background:white; box-shadow:var(--shadow-sm); padding:11px; display:grid; gap:9px; }
  .parent-mobile-child { display:flex; align-items:center; gap:10px; min-width:0; }
  .parent-mobile-child .child-avatar { width:43px;height:43px;margin:0;font-size:21px; }
  .parent-mobile-child .child-name { font-size:16px; }
  .parent-mobile-child .child-meta { gap:5px; margin-top:4px; }
  .parent-mobile-child .badge { font-size:8px; padding:4px 7px; }
  .parent-mobile-time { border:0; border-radius:13px; background:var(--green-soft); color:var(--primary); display:grid; grid-template-columns:34px 1fr auto; gap:8px; align-items:center; text-align:left; padding:8px 10px; }
  .parent-mobile-time > span:first-child { width:32px;height:32px;border-radius:10px;background:white;display:grid;place-items:center;color:#356b3a; }
  .parent-mobile-time small { display:block;color:var(--muted);font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.05em; }
  .parent-mobile-time strong { display:block;font-size:12px;margin-top:2px; }
  .parent-mobile-alert { min-height:34px; border-radius:11px; background:var(--green-soft); color:#356b3a; font-size:9px; line-height:1.25; padding:7px 9px; display:flex; gap:7px; align-items:center; }
  .parent-mobile-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:8px; min-height:0; }
  .parent-app-tile { min-width:0; min-height:0; border:1px solid rgba(39,76,119,.08); border-radius:16px; padding:11px; text-align:left; display:flex; flex-direction:column; justify-content:center; gap:5px; box-shadow:var(--shadow-sm); }
  .parent-app-tile > span { width:32px;height:32px;border-radius:10px;background:rgba(255,255,255,.72);display:grid;place-items:center; }
  .parent-app-tile strong { color:var(--primary); font-size:12px; line-height:1.1; }
  .parent-app-tile small { color:var(--muted); font-size:8.5px; line-height:1.25; }
  .parent-app-tile.coral { background:var(--coral-soft); }
  .parent-app-tile.teal { background:var(--teal-soft); }
  .parent-app-tile.amber { background:var(--amber-soft); }
  .parent-app-tile.blue { background:var(--primary-soft); }
  .parent-mobile-feed { display:none; }

  /* RCP phone flow */
  .parent-rcp-card { margin-bottom:10px; padding:12px; border-radius:18px; background:linear-gradient(145deg,#fff,var(--primary-soft)); }
  .parent-rcp-head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; }
  .parent-rcp-kicker { font-size:8px; font-weight:900; letter-spacing:.08em; color:var(--amber); }
  .parent-rcp-head h2 { margin:3px 0 3px; color:var(--primary); font-size:18px; }
  .parent-rcp-head p { margin:0; color:var(--muted); font-size:9px; line-height:1.35; }
  .parent-rcp-person { display:grid; gap:5px; margin-top:10px; }
  .parent-rcp-person > span { font-size:9px; font-weight:800; color:var(--muted); }
  .parent-rcp-person .select { height:40px; }
  .parent-rcp-actions { display:grid; grid-template-columns:1fr; gap:7px; margin-top:9px; }
  .parent-rcp-actions .btn { min-height:43px; justify-content:center; }
  .parent-phone-btn { font-size:12px; }
  .parent-rcp-note { margin-top:9px; padding:8px 9px; border-radius:11px; background:white; color:var(--muted); font-size:8.5px; line-height:1.35; display:flex; gap:6px; align-items:flex-start; }

  /* Time view remains scrollable only inside the app content pane, never the page/body. */
  .mobile-layout.route-time .mobile-content { overflow-y:auto !important; }
  .mobile-layout.route-time .page-header { margin-bottom:8px; }
  .mobile-layout.route-time .page-title { font-size:20px; }
  .mobile-layout.route-time .child-card { margin-bottom:9px !important; }
  .mobile-layout.route-time .layout-main-aside { gap:9px; }
  .mobile-layout.route-time .section { margin-top:9px; }
}

@media (max-width: 380px), (max-height: 720px) and (max-width: 820px) {
  .mobile-layout { grid-template-rows:54px minmax(0,1fr) 62px !important; }
  .mobile-header { height:54px; min-height:54px; }
  .bottom-nav { height:62px; min-height:62px; }
  .parent-mobile-home { gap:6px; }
  .parent-mobile-hero { padding:8px; gap:6px; }
  .parent-mobile-child .child-avatar { width:38px;height:38px;font-size:18px; }
  .parent-mobile-time { padding:6px 8px; }
  .parent-app-tile { padding:8px; gap:4px; border-radius:13px; }
  .parent-app-tile > span { width:28px;height:28px; }
  .parent-app-tile small { font-size:7.5px; }
}

/* KINDAY v11.3 — parent welcome + simplified parent-facing experience */
.parent-welcome-shell{
  width:100%;height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column;
  background:linear-gradient(145deg,#f8fbff 0%,#fffaf3 52%,#eef8f6 100%);color:var(--primary);
}
.parent-welcome-main{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:grid;place-items:center;padding:24px 18px 12px;}
.parent-welcome-card{width:min(930px,100%);background:rgba(255,255,255,.94);border:1px solid rgba(39,76,119,.10);border-radius:28px;padding:28px;box-shadow:0 24px 70px rgba(39,76,119,.10);}
.parent-welcome-brand{display:flex;align-items:center;gap:12px;margin-bottom:22px;}
.parent-welcome-logo{width:48px;height:48px;border-radius:15px;background:var(--primary);color:#fff;display:grid;place-items:center;font-weight:950;font-size:22px;box-shadow:0 10px 24px rgba(39,76,119,.18);}
.parent-welcome-brand strong{display:block;font-size:18px;letter-spacing:.04em;}
.parent-welcome-brand span{display:block;color:var(--muted);font-size:11px;margin-top:2px;}
.parent-welcome-copy{max-width:720px;}
.parent-welcome-eyebrow{display:inline-block;color:var(--teal);font-weight:900;font-size:11px;text-transform:uppercase;letter-spacing:.1em;margin-bottom:8px;}
.parent-welcome-copy h1{font-size:clamp(30px,4.5vw,48px);line-height:1.02;margin:0 0 10px;letter-spacing:-.035em;}
.parent-welcome-copy p{margin:0;color:var(--muted);font-size:15px;line-height:1.55;max-width:680px;}
.parent-welcome-features{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:22px;}
.parent-welcome-feature{display:flex;align-items:flex-start;gap:10px;border:1px solid var(--line);border-radius:16px;padding:13px;background:#fff;min-width:0;}
.parent-welcome-feature .list-icon{flex:0 0 34px;width:34px;height:34px;}
.parent-welcome-feature strong{display:block;font-size:12px;line-height:1.2;}
.parent-welcome-feature span:not(.list-icon){display:block;color:var(--muted);font-size:10px;line-height:1.35;margin-top:4px;}
.parent-welcome-note{display:flex;align-items:center;gap:8px;margin-top:18px;padding:10px 12px;border-radius:12px;background:var(--primary-soft);font-size:10px;color:var(--primary);font-weight:750;}
.parent-welcome-footer{flex:0 0 auto;padding:12px 18px max(14px,env(safe-area-inset-bottom));background:rgba(255,255,255,.96);border-top:1px solid rgba(39,76,119,.08);backdrop-filter:blur(12px);display:flex;justify-content:center;}
.parent-welcome-enter{width:min(930px,100%);min-height:50px;font-size:13px;letter-spacing:.04em;}
@media(max-width:820px){
  .parent-welcome-main{padding:12px 12px 8px;display:block;}
  .parent-welcome-card{padding:16px;border-radius:20px;box-shadow:none;min-height:100%;}
  .parent-welcome-brand{margin-bottom:12px;}
  .parent-welcome-logo{width:40px;height:40px;border-radius:12px;font-size:18px;}
  .parent-welcome-brand strong{font-size:15px;}.parent-welcome-brand span{font-size:9px;}
  .parent-welcome-eyebrow{font-size:9px;margin-bottom:5px;}
  .parent-welcome-copy h1{font-size:27px;margin-bottom:6px;}
  .parent-welcome-copy p{font-size:11px;line-height:1.4;}
  .parent-welcome-features{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:12px;}
  .parent-welcome-feature{padding:9px;border-radius:13px;gap:7px;}
  .parent-welcome-feature .list-icon{width:29px;height:29px;flex-basis:29px;}
  .parent-welcome-feature strong{font-size:10px;}.parent-welcome-feature span:not(.list-icon){font-size:8.5px;margin-top:2px;}
  .parent-welcome-note{margin-top:10px;padding:8px 9px;font-size:8.5px;}
  .parent-welcome-footer{padding:8px 12px max(9px,env(safe-area-inset-bottom));}
  .parent-welcome-enter{min-height:47px;}
}
@media(max-width:380px) and (max-height:700px){
  .parent-welcome-copy p{font-size:10px;}
  .parent-welcome-features{gap:5px;margin-top:9px;}
  .parent-welcome-feature{padding:7px;}
  .parent-welcome-feature span:not(.list-icon){display:none;}
  .parent-welcome-note{margin-top:8px;}
}
