/* Parent + admin dashboards. Mobile first: phone layout by default, bottom tab bar; wider screens get top tabs and grids. */
body.dash { background: #f4f2fa; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.no-scroll { overflow: hidden; }
.hidden { display: none !important; }
.small { font-size: 13px; }

.dtop { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(135deg, #7b1fa2, #ab47bc); color: #fff; box-shadow: 0 3px 12px rgba(74, 20, 140, .25); }
body.admin .dtop { background: linear-gradient(135deg, #311b92, #5e35b1); }
.dtitle { flex: 1; font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtop .logout { background: rgba(255,255,255,.18); box-shadow: none; color: #fff !important; border: 1px solid rgba(255,255,255,.35); }
@media (max-width: 420px) { .dtop .logout span { display: none; } }
.admin-bar { background: #311b92; color: #fff; display: flex; gap: 10px; align-items: center; padding: 8px 14px; font-size: 14px; }
.admin-bar a { color: #ffe082; font-weight: 800; text-decoration: none; }

/* kid switcher */
.kidbar { display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; background: #fff; border-bottom: 1px solid #eee; scrollbar-width: none; }
.kidbar::-webkit-scrollbar { display: none; }
.kidbar:empty { display: none; }
.kchip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; border: 2px solid #e7e3f3; background: #fff; border-radius: 999px; padding: 6px 14px 6px 10px; font-weight: 800; font-size: 15px; min-height: 44px; }
.kchip span { font-size: 22px; }
.kchip.on { border-color: #7b1fa2; background: #f3e5f5; color: #4a148c; }
.kchip.off { opacity: .55; }
.kchip.add { border-style: dashed; color: #7b1fa2; }

/* tabs: bottom bar on phones */
.dtabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; display: flex; background: #fff; border-top: 1px solid #e6e1f2; box-shadow: 0 -4px 16px rgba(0,0,0,.06);
  padding-bottom: env(safe-area-inset-bottom); }
.dtabs button { flex: 1; border: none; background: none; padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; font-weight: 700; color: #8a84a0; min-height: 60px; }
.dtabs button .ti { font-size: 21px; line-height: 1.1; filter: grayscale(.6); }
.dtabs button.on { color: #6a1b9a; }
.dtabs button.on .ti { filter: none; transform: scale(1.12); }
@media (min-width: 768px) {
  body.dash { padding-bottom: 24px; }
  .dtabs { position: sticky; top: 58px; bottom: auto; justify-content: center; gap: 6px; padding: 8px; box-shadow: none; border-top: none; border-bottom: 1px solid #eee; }
  .dtabs button { flex: 0 1 auto; flex-direction: row; gap: 6px; font-size: 15px; padding: 8px 16px; border-radius: 12px; min-height: 0; }
  .dtabs button.on { background: #f3e5f5; }
  .kidbar { justify-content: center; }
}
.pmain { padding: 14px; max-width: 1100px; margin: 0 auto; }

/* cards of kids / parents */
.klist { display: grid; gap: 12px; }
@media (min-width: 760px) { .klist { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .klist { grid-template-columns: 1fr 1fr 1fr; } }
.kcard { background: #fff; border-radius: 20px; box-shadow: 0 6px 20px rgba(60, 30, 100, .08); overflow: hidden; border: 2px solid transparent; }
.kcard.off { border-color: #ffcdd2; background: #fffafa; }
.khead { display: flex; gap: 12px; align-items: center; padding: 14px; cursor: pointer; }
.kav { width: 56px; height: 56px; border-radius: 18px; background: #f3e5f5; display: grid; place-items: center; font-size: 32px; flex-shrink: 0; }
.kav.sm { width: 40px; height: 40px; font-size: 22px; border-radius: 12px; }
.kav.letter { background: linear-gradient(135deg, #7e57c2, #ab47bc); color: #fff; font-weight: 800; font-size: 26px; }
.kname { font-weight: 800; font-size: 17px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.kuser { color: #8a84a0; font-size: 13px; }
.kmeta { color: #555; font-size: 13px; margin-top: 2px; }
.kgo { font-size: 28px; color: #c5bdd8; }
.bar.thin { height: 6px; margin-top: 6px; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: #e8f5e9; color: #2e7d32; }
.pill.red { background: #ffebee; color: #c62828; }
.kacts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #f1edf8; }
.kacts button { border: none; background: none; padding: 11px 4px; font-size: 13px; font-weight: 700; color: #4a148c; min-height: 46px; border-inline-start: 1px solid #f1edf8; border-bottom: 1px solid #f1edf8; }
.kacts button:nth-child(3n+1) { border-inline-start: none; }
.kacts button:active { background: #f3e5f5; }
.kacts button.red { color: #c62828; }
.kacts button:disabled { color: #bbb; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { flex: 1 1 160px; min-height: 46px; border: 2px solid #e7e3f3; border-radius: 14px; padding: 8px 12px; font: inherit; font-size: 16px; background: #fff; }
.pcard.empty { text-align: center; padding: 28px 16px; }
.pcard.empty .big { font-size: 56px; }
.seats .bar { margin: 10px 0; }
.btn.big { width: 100%; }
.kidhead { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 10px 12px; margin-bottom: 12px; box-shadow: 0 4px 14px rgba(60,30,100,.06); }
.kidhead .kav { width: 44px; height: 44px; font-size: 26px; border-radius: 14px; }
.mini { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3f0f8; cursor: pointer; }
.mini:last-child { border-bottom: none; }
.kpis .kpi b { font-size: 24px; }

/* bottom sheet (phones) / dialog (wide) */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(30, 10, 50, .45); display: none; align-items: flex-end; justify-content: center; }
.sheet-wrap.show { display: flex; }
.sheet { background: #fff; width: 100%; max-height: 92dvh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: #ddd; margin: 4px auto 10px; }
.sheet h3 { margin: 4px 0 6px; font-size: 20px; }
@keyframes up { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { max-width: 480px; border-radius: 24px; } .sheet-grip { display: none; } }
.flabel { display: block; font-weight: 700; margin: 12px 0 4px; font-size: 15px; }
.sheet input:not([type=checkbox]), .sheet select, .sheet textarea { width: 100%; min-height: 50px; border: 2px solid #e7e3f3; border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 17px; }
.sheet input:focus, .sheet select:focus, .sheet textarea:focus, .toolbar input:focus { outline: none; border-color: #ab47bc; }
.fhint { color: #8a84a0; font-size: 12.5px; margin-top: 3px; }
.fcheck { display: flex; align-items: center; gap: 10px; margin: 14px 0 2px; font-weight: 700; }
.fcheck input { width: 24px; height: 24px; accent-color: #7b1fa2; }
.ferr { color: #c62828; font-weight: 700; min-height: 22px; margin-top: 10px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { min-height: 52px; }
.avatar-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.avatar-pick button { font-size: 26px; height: 50px; border-radius: 14px; border: 2px solid #eee; background: #fafafa; }
.avatar-pick button.on { border-color: #7b1fa2; background: #f3e5f5; transform: scale(1.06); }
.cred { background: #f8f5fd; border-radius: 16px; padding: 4px 14px; margin: 10px 0 14px; }
.cred > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #e2daf0; }
.cred > div:last-child { border-bottom: none; }
.cred span { color: #8a84a0; } .cred b { font-size: 18px; word-break: break-all; }
.toast.bad { background: #c62828; }
.btn.danger { background: #e53935; box-shadow: 0 4px 0 #b71c1c; color: #fff; }
.pill.lvl { background: #e3f2fd; color: #1565c0; }
.course-card { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.course-card > span { font-size: 30px; }
