/* Staff dashboard (resources/views/layouts/admin.blade.php). Denser than the app: 13–16 px text, one row per
   account, Miao only on empty and error states. Base styles: style.css. */
:root { --page-max: 1500px; --gutter: clamp(16px, 3vw, 40px); }
/* the sidebar grows a little on big screens (250 → 320 px) and the content stays a readable width, centred in what is left */
.shell { min-height: 100vh; display: grid; grid-template-columns: clamp(250px, 14vw, 320px) minmax(0, 1fr); }
.shell.collapsed { grid-template-columns: minmax(0, 1fr); }
.shell.collapsed .side { display: none; }
.col { min-width: 0; display: flex; flex-direction: column; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #fff; border-right: 2px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; }
.side .logo { padding: 0 6px; font-size: 21px; }
.side .seal, .topbar .seal { width: 36px; height: 36px; font-size: 21px; border-radius: 9px; }
.side .tag { font: 800 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px; border-radius: 7px; background: var(--ink); color: #fff; }
.side nav { display: flex; flex-direction: column; gap: 6px; }
.side nav.bottom { margin-top: auto; padding-top: 14px; border-top: 2px solid var(--sunken); }
.side nav a, .navbtn { width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  font: 700 16px/1 var(--round); background: none; border: 0; cursor: pointer; }
.side nav .icon, .navbtn .icon { font-variation-settings: 'FILL' 0; }
.side nav a:hover, .navbtn:hover { background: var(--paper); }
.side nav a[aria-current='page'] { background: var(--tint); color: var(--deep); }
.side nav a[aria-current='page'] .icon { font-variation-settings: 'FILL' 1; }
.navbtn { color: var(--bad-ink); }
.topbar { position: sticky; top: 0; z-index: 30; height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter))); background: rgba(255, 248, 236, .92); backdrop-filter: blur(8px); }
.topbar .logo { font-size: 21px; }
.topbar .logo.wide-hide { display: none; } /* the sidebar already shows the logo */
.menu-scrim, .side .close-menu { display: none; } /* .side: must beat .sq, which is defined later */
@media (max-width: 900px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .shell.collapsed .side { display: flex; }
  .topbar { background: #fff; border-bottom: 2px solid var(--border); padding: 0 16px; }
  .topbar .logo, .topbar .logo.wide-hide { display: inline-flex; }
  .menu-scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(31, 37, 68, .45); }
  .side { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; height: auto; width: min(290px, 85vw); transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 12px 0 32px rgba(31, 37, 68, .14); visibility: hidden; }
  .side.open { transform: none; visibility: visible; }
  .side .close-menu { display: flex; }
  .main { padding-top: 20px; }
}
.main { flex: 1; width: 100%; max-width: var(--page-max); margin-inline: auto; min-width: 0; padding: 12px var(--gutter) 56px; display: flex; flex-direction: column; gap: 24px; }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.pagehead > div:first-child { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pagehead h1 { font-size: 30px; }
.pagehead p { font-size: 15px; color: var(--ink2); }
.me-wrap { display: flex; align-items: center; gap: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 14px; background: #fff; border: 2px solid var(--border); color: var(--ink); text-decoration: none; }
.me:hover { color: var(--ink); border-color: var(--edge); }
@media (max-width: 900px) { .me-wrap { display: none; } } /* on phones the account is in the menu */
.me small { display: block; font: 800 12px/1.2 var(--sans); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 10px; font: 800 16px/1 var(--round); display: flex; align-items: center; justify-content: center; text-transform: uppercase; }
.avatar.lg { width: 42px; height: 42px; border-radius: 13px; font-size: 18px; background: var(--sunken); color: var(--ink2); }
.r-admin { background: var(--tint); color: var(--deep); } .r-support { background: var(--warn-tint); color: var(--warn-ink); } .r-editor { background: var(--peach); color: #8F3412; }
.s-active { background: var(--ok-tint); color: var(--ok-ink); } .s-disabled { background: var(--sunken); color: var(--ink2); } .s-invited { background: var(--warn-tint); color: var(--warn-ink); }
.stack { display: flex; flex-direction: column; gap: 16px; animation: fade .25s ease-out; } /* opacity only: a transform would trap the fixed drawers inside */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toolbar .search { flex: 1 1 260px; }
.toolbar .dd { flex: 0 0 auto; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.kpi .label { display: flex; align-items: center; gap: 8px; font: 800 14px/1.2 var(--sans); color: var(--ink2); }
.kpi .label .icon { font-size: 22px; }
.kpi b { font: 800 38px/1 var(--round); font-variant-numeric: tabular-nums; }
.kpi small { font: 700 13px/1.3 var(--sans); color: var(--ink2); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.panel { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.panel h2 { font-size: 20px; line-height: 1.2; }
.panel .sub { font-size: 14px; color: var(--ink2); }
.bars { display: flex; align-items: flex-end; gap: 6px; min-height: 180px; }
.bars > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font: 800 11px/1 var(--sans); color: var(--ink2); font-variant-numeric: tabular-nums; }
.bars i { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--grid); }
.bars .today { color: var(--primary); } .bars .today i { background: var(--primary); }
.hbar { display: flex; align-items: center; gap: 12px; font: 800 14px/1 var(--sans); }
.hbar .num { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--tint); color: var(--primary); font: 400 20px/1 var(--kai); display: flex; align-items: center; justify-content: center; }
.hbar .name { width: 64px; flex: none; }
.track { flex: 1; height: 12px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 6px; background: var(--primary); }
.hbar .n { width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.list { overflow: hidden; }
.list > * + * { border-top: 2px solid var(--sunken); }
.rowbtn { appearance: none; width: 100%; text-align: left; background: transparent; border: 0; display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; }
.rowbtn:hover { background: #FFFBF3; }
.rowbtn .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.rowbtn .email { font: 700 16px/1.3 var(--sans); overflow-wrap: anywhere; }
.kids { display: flex; flex-wrap: wrap; gap: 6px; }
.kid { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px 0 6px; border-radius: 8px; background: var(--peach); color: #8F3412; font: 700 13px/1 var(--sans); }
.kid .icon { font-size: 16px; }
.lvtag { display: inline-flex; align-items: center; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--tint); color: var(--deep); font: 800 12px/1 var(--sans); }
.kids .lvtag + .kid { margin-left: 6px; } /* a gap between children */
.meta { font: 600 13px/1.35 var(--sans); color: var(--ink2); }
.chev { color: #A8A496; font-variation-settings: 'FILL' 0; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; font: 700 14px/1.3 var(--sans); color: var(--ink2); }
.pager div { display: flex; gap: 8px; }
.sq { appearance: none; cursor: pointer; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 0; }
.sq:disabled { opacity: .4; cursor: default; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; }
.empty img { width: 88px; height: 88px; }
.empty b { font: 800 18px/1.2 var(--round); }
.table { overflow-x: auto; }
.table > div { min-width: 780px; }
.tr { display: grid; grid-template-columns: 88px minmax(120px, 1fr) minmax(160px, 1.4fr) 84px 150px 80px; gap: 16px; align-items: center; padding: 10px 20px; }
.tr + .tr { border-top: 2px solid var(--sunken); }
.tr.th { padding-block: 12px; background: var(--paper); border-bottom: 2px solid var(--sunken); font: 800 13px/1.2 var(--sans); color: var(--ink2); }
.tr .hz { font: 400 30px/1.1 var(--kai); }
.tr .py { font: 800 16px/1.2 var(--sans); color: var(--primary); }
.tr .mean { font: 700 15px/1.3 var(--sans); overflow-wrap: anywhere; }
.play { appearance: none; cursor: pointer; width: 38px; height: 38px; flex: none; border: 0; border-radius: 11px; background: var(--tint); color: var(--primary); display: flex; align-items: center; justify-content: center; padding: 0; }
.play.on { background: var(--primary); color: #fff; }
.play .icon { font-size: 22px; }

/* drawers, dialogs, toast */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(31, 37, 68, .45); animation: fade .18s both; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(480px, 100%); background: var(--paper); display: flex; flex-direction: column;
  animation: slide .25s cubic-bezier(.2, .8, .2, 1) both; box-shadow: -12px 0 32px rgba(31, 37, 68, .14); }
.drawer > header { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px 22px; background: #fff; border-bottom: 2px solid var(--border); }
.drawer > header .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.drawer > header .t small { font: 800 13px/1 var(--sans); color: var(--ink2); }
.drawer > header .t b { font: 800 19px/1.25 var(--round); overflow-wrap: anywhere; }
.drawer .scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.drawer > footer { padding: 16px 22px 20px; background: #fff; border-top: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.drawer > footer .two { display: flex; gap: 10px; }
.drawer > footer .two .btn { flex: 1; }
.close { appearance: none; cursor: pointer; width: 44px; height: 44px; flex: none; border-radius: 14px; background: #fff; border: 2px solid var(--border); box-shadow: 0 3px 0 var(--edge);
  display: flex; align-items: center; justify-content: center; padding: 0; }
.close:active { transform: translateY(3px); box-shadow: none; }
dl.facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; padding: 14px 16px; background: #fff; border: 2px solid var(--border); border-radius: 18px; font: 600 14px/1.4 var(--sans); }
dl.facts dt { color: var(--ink2); }
dl.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.kidcard { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: #fff; border: 2px solid var(--border); border-radius: 20px; }
.kidcard .top { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.kidcard .lvl { width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--tint); color: var(--primary); font: 400 28px/1 var(--kai); display: flex; align-items: center; justify-content: center; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats3 div { padding: 10px; border-radius: 14px; background: var(--paper); display: flex; flex-direction: column; gap: 4px; }
.stats3 b { font: 800 18px/1 var(--round); }
.stats3 small { font: 800 12px/1.2 var(--sans); color: var(--ink2); }
.preview { display: flex; align-items: center; gap: 16px; padding: 14px; background: #fff; border: 2px solid var(--border); border-radius: 20px; }
.box { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: #fff; border: 2px solid var(--border); border-radius: 20px; }
.dialog { position: fixed; inset: 0; z-index: 50; background: rgba(31, 37, 68, .5); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s both; }
.dialog > div, .dialog > form { width: 100%; max-width: 420px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--paper); border-radius: 28px; padding: 24px;
  display: flex; flex-direction: column; gap: 12px; animation: pop .2s ease-out both; }
.dialog h2 { font-size: 23px; line-height: 1.2; overflow-wrap: anywhere; }
.dialog .row { display: flex; gap: 10px; margin-top: 8px; }
.dialog .row .btn { flex: 1; }
.radio { appearance: none; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--border); }
.radio i { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2.5px solid var(--edge); background: #fff; box-shadow: inset 0 0 0 4px #fff; }
.radio[aria-checked='true'] { background: var(--tint); border-color: var(--primary); }
.radio[aria-checked='true'] i { border-color: var(--primary); background: var(--primary); }
.radio b { display: block; font: 700 16px/1.2 var(--round); }
.radio small { font: 600 13px/1.35 var(--sans); color: var(--ink2); }
.toast { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 60; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast div { padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font: 700 15px/1.4 var(--sans); box-shadow: 0 10px 24px rgba(31, 37, 68, .2); animation: pop .2s ease-out both; }
.perm { display: flex; align-items: center; gap: 8px; font: 600 14px/1.3 var(--sans); }
.perm .icon { font-size: 20px; }
.perm.no { color: var(--muted); } .perm.no .icon { color: #C9BFAC; }
.perm.yes .icon { color: var(--ok); }
[x-cloak] { display: none !important; }
.dd { position: relative; min-width: 0; }
.dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; font-weight: 700; padding: 0 10px 0 14px; }
.dd-btn > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn:focus-visible, .dd-btn[aria-expanded='true'] { border-color: var(--primary); }
.dd-caret { font-size: 22px; color: var(--ink2); font-variation-settings: 'FILL' 0; transition: transform .15s; }
.dd-caret.up { transform: rotate(180deg); }
.dd-list { position: fixed; z-index: 70; max-height: 280px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #fff; border: 2px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 28px rgba(31, 37, 68, .18); }
.dd-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; font: 700 15px/1.2 var(--sans); cursor: pointer; white-space: nowrap; }
.dd-list li .icon { font-size: 20px; color: var(--primary); }
.dd-list li.hl { background: var(--paper); }
.dd-list li.on { background: var(--tint); color: var(--deep); }

/* login */
.auth { min-height: 100vh; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.auth .card { width: 100%; max-width: 420px; padding: 28px; border-radius: 28px; animation: in .25s ease-out both; }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.auth h1 { font-size: 28px; line-height: 1.15; }
.code { height: 60px; font: 800 28px/1 var(--sans); letter-spacing: .35em; text-align: center; }
