/* The team's app: side menu, sign-in, families, teachers, team, activity log. Colours come from theme.js tokens. */
:root{--side:232px}
:root.sq-fold{--side:72px}
.sq-in body{padding-inline-start:var(--side);transition:padding .2s}
.ap-side{position:fixed;inset-block:0;inset-inline-start:0;z-index:20;width:var(--side);display:flex;flex-direction:column;gap:6px;padding:12px 10px;
  background:var(--card);border-inline-end:2px solid var(--line);transition:width .2s,transform .2s;overflow:hidden auto}
.ap-sidehead{display:flex;align-items:center;justify-content:space-between;gap:6px;min-height:46px;padding-inline:4px 0}
.ap-brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--brand-text);font-size:16px;min-width:0}
.ap-brand b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ap-brand img{height:34px;max-width:84px;object-fit:contain}
.ap-fold{appearance:none;flex:0 0 auto;width:40px;height:40px;border-radius:12px;border:2px solid var(--line);background:var(--card);color:var(--ink);cursor:pointer;display:grid;place-items:center}
.ap-fold svg,.ap-item svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.ap-foldbtn{position:fixed;z-index:21;top:26px;inset-inline-start:calc(var(--side) - 15px);width:30px;height:30px;border-radius:50%;
  border:2px solid var(--line);background:var(--card);color:var(--ink);cursor:pointer;display:grid;place-items:center;padding:0;
  box-shadow:0 2px 6px var(--shadow);transition:inset-inline-start .2s}
.ap-foldbtn:hover{border-color:var(--accent)}
.ap-foldbtn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:899px){.ap-foldbtn{display:none}}
/* the arrow points to the edge the menu folds into, and back out once folded */
[dir="ltr"] #fold svg,[dir="rtl"].sq-fold #fold svg{transform:scaleX(-1)}
[dir="ltr"].sq-fold #fold svg{transform:none}
.ap-nav{display:flex;flex-direction:column;gap:4px;flex:1;margin-top:6px}
.ap-item{appearance:none;font:inherit;font-weight:800;font-size:15px;display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:8px 12px;
  border:0;border-radius:14px;background:none;color:var(--ink);cursor:pointer;text-decoration:none;text-align:start;white-space:nowrap}
.ap-item:hover{background:var(--soft)}
.ap-item[aria-pressed="true"]{background:var(--brand);color:var(--on-brand)}
.ap-me{display:flex;flex-direction:column;gap:2px;border-top:1px dashed var(--line);padding-top:8px}
.ap-me>span{color:var(--muted);padding-inline:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* folded: icons only, names as tooltips */
.sq-fold .ap-brand b,.sq-fold .ap-item span,.sq-fold .ap-me>span{display:none}
.sq-fold .ap-sidehead{justify-content:center;padding:0}
.sq-fold .ap-brand img{max-width:48px}
.sq-fold .ap-item{justify-content:center;padding:8px}
.ap-top{display:none}
.ap-scrim{position:fixed;inset:0;z-index:15;background:rgba(20,10,30,.4)}
/* a phone: the menu is a drawer, opened from the top bar */
@media (max-width:899px){
  :root,:root.sq-fold{--side:0px}
  .ap-side{width:260px;transform:translateX(100%)}
  [dir="ltr"] .ap-side{transform:translateX(-100%)}
  .sq-drawer .ap-side{transform:none}
  .sq-fold .ap-brand b,.sq-fold .ap-item span,.sq-fold .ap-me>span{display:revert}
  .sq-fold .ap-item{justify-content:flex-start;padding:8px 12px}
  .sq-fold .ap-sidehead{flex-direction:row}
  #fold{display:none}
  .ap-top:not([hidden]){display:flex;position:sticky;top:0;z-index:10;align-items:center;gap:10px;padding:8px 12px;background:var(--card);border-bottom:2px solid var(--line)}
}

.ap-signin{max-width:420px;margin:7vh auto 0;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.ap-signin img{max-height:90px;max-width:200px;object-fit:contain}
.ap-signin h1{color:var(--brand-text)}
.ap-col{display:flex;flex-direction:column;gap:10px;width:100%;text-align:start}
.ap-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px;margin:4px 0}
.ap-or::before,.ap-or::after{content:"";flex:1;border-top:1px solid var(--line)}
#googleBox{width:100%;display:flex;flex-direction:column}
.ap-err{background:#fee2e2;color:#991b1b;border-radius:14px;padding:8px 12px;font-weight:800;margin:0;width:100%}

.ap-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.ap-bar h1{margin:0}
.ap-bar input{max-width:320px}
.ap-filters{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.ap-filters .chip b{margin-inline-start:6px;font-weight:900}
.ap-filters .chip.review{border-color:var(--brand)}
.ap-hint{background:var(--brand-soft);border-radius:14px;padding:8px 12px;margin:0 0 12px}

.ap-list{display:flex;flex-direction:column;gap:8px}
.ap-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;background:var(--card);border:2px solid var(--line);border-radius:18px;padding:10px 14px;text-align:start;font:inherit;color:inherit;width:100%}
button.ap-row{cursor:pointer}
button.ap-row:hover{border-color:var(--accent)}
.ap-row .nm{font-weight:900;flex:1 1 200px;min-width:0}
.ap-row .nm small{display:block;font-weight:500;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-row .ph{direction:ltr;color:var(--muted);font-size:14px}
.st-review{background:var(--brand-soft);color:var(--brand-text)}
.st-active{background:#dcfce7;color:#166534}
.st-left{background:#f1f5f9;color:#475569}
:root[data-theme="dark"] .st-active{background:#14532d;color:#dcfce7}
:root[data-theme="dark"] .st-left{background:#334155;color:#e2e8f0}
.ap-empty{color:var(--muted);text-align:center;padding:24px}

.ap-dlg{border:2px solid var(--line);border-radius:var(--r-l);padding:18px;width:min(640px,calc(100vw - 24px));max-height:calc(100vh - 40px);background:var(--card);color:var(--ink);box-shadow:0 8px 22px var(--shadow)}
.ap-dlg::backdrop{background:rgba(20,10,30,.45)}
.ap-x{position:sticky;top:0;display:flex;justify-content:flex-end;margin:-6px -6px 0 0;float:inline-end}
.ap-dlg h2{margin-top:0}
.ap-dlg h3{margin-top:14px}
.ap-kv{display:flex;flex-wrap:wrap;gap:4px 16px;color:var(--muted);font-size:14px;margin-bottom:6px}
.ap-kv b{color:var(--ink)}
.ap-st{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 10px}
.ap-dlg ul{margin:0;padding-inline-start:20px}
.ap-dlg li{margin:2px 0}
.ap-hist{font-size:13px;color:var(--muted)}
.ap-check span{display:flex;align-items:center;gap:8px;min-height:42px}
#permBox label{display:inline-flex;align-items:center;gap:6px;margin-inline-end:14px;font-weight:700}
.row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.small{font-size:13px}
.st-pilot{background:var(--accent);color:var(--on-accent)}
.ap-pilot{margin-top:12px;padding:10px 12px;border:2px dashed var(--line);border-radius:16px;display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.ap-pilot.on{border-style:solid;border-color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,transparent)}
.ap-pilot p{margin:0}
.ap-avail{display:flex;flex-direction:column;gap:6px}
.ap-day{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;padding:6px 0;border-bottom:1px dashed var(--line)}
.ap-day>b{min-width:70px}
.ap-ranges{display:flex;flex-wrap:wrap;gap:6px;flex:1}
.ap-range{display:inline-flex;align-items:center;gap:4px;background:var(--soft);border-radius:12px;padding:3px 6px}
.ap-range input{width:auto;min-height:34px;padding:2px 6px;font-size:14px}
.ap-range button{appearance:none;border:0;background:none;color:var(--muted);cursor:pointer;font:inherit;min-width:28px;min-height:28px}
.ap-offnew{margin-top:8px}
.ap-offnew select,.ap-offnew input{width:auto;flex:1 1 140px}
#permBox{border:0;padding:0;margin:0}
#permBox legend{font-weight:800;font-size:14px;padding:0;margin-bottom:6px}
#permBox label{min-height:36px}
/* the classes board */
.ap-datebar{gap:6px}
.ap-datebar input[type="date"]{width:auto}
.ap-inline{display:inline-flex;align-items:center;gap:6px;font-weight:700;font-size:14px}
.ap-tiles{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-bottom:12px}
.ap-tile{appearance:none;font:inherit;text-align:start;cursor:pointer;background:var(--card);border:2px solid var(--line);border-radius:16px;padding:8px 12px;display:flex;flex-direction:column;color:var(--ink)}
.ap-tile small{color:var(--muted);font-weight:700}
.ap-tile b{font-size:24px;line-height:1.2}
.ap-tile[aria-pressed="true"]{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
.ap-tile[data-st="now"] b{color:#15803d}
.ap-tile[data-st="absent"] b,.ap-tile[data-st="cancelled"] b{color:var(--brand-text)}
@media (max-width:760px){.ap-tiles{grid-template-columns:repeat(3,minmax(0,1fr))}}
.ap-cfilter{margin-bottom:6px}
.ap-cfilter select,.ap-cfilter input{width:auto;flex:1 1 180px}
.ap-seg{display:inline-flex;border:2px solid var(--line);border-radius:999px;overflow:hidden}
.ap-seg button{appearance:none;font:inherit;font-weight:800;font-size:13px;border:0;background:var(--card);color:var(--ink);padding:6px 14px;cursor:pointer;min-height:38px}
.ap-seg button[aria-pressed="true"]{background:var(--ink);color:var(--paper)}
#cStatus:empty{display:none}
.ap-day-h{font-size:18px;margin:16px 0 8px}
.ap-group{background:var(--card);border:2px solid var(--line);border-radius:18px;margin-bottom:10px;overflow:hidden}
.ap-ghead{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;background:var(--soft)}
.ap-time{background:var(--ink);color:var(--paper);border-radius:999px;padding:2px 12px;font-weight:900;font-size:14px}
.ap-cls.cards .ap-gbody{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px;padding:8px}
.ap-cls.cards .ap-ses{border:2px solid var(--line);border-radius:14px}
.ap-cls.list .ap-ses{border-top:1px solid var(--line)}
.ap-cls.list .ap-ses:first-child{border-top:0}
.ap-ses{appearance:none;font:inherit;color:inherit;background:var(--card);cursor:pointer;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 10px;padding:8px 12px;text-align:start;width:100%}
.ap-ses:hover{background:var(--soft)}
.ap-ses .nm{font-weight:900;flex:1 1 160px;min-width:0}
.ap-ses .nm small{display:block;font-weight:500;color:var(--muted)}
.ss-now,.ss-live{background:#dcfce7;color:#166534}
.ss-done{background:#e0e7ff;color:#3730a3}
.ss-student_absent,.ss-teacher_absent{background:#fee2e2;color:#991b1b}
.ss-cancelled{background:#f1f5f9;color:#475569;text-decoration:line-through}
:root[data-theme="dark"] .ss-now,:root[data-theme="dark"] .ss-live{background:#14532d;color:#dcfce7}
:root[data-theme="dark"] .ss-done{background:#312e81;color:#e0e7ff}
:root[data-theme="dark"] .ss-student_absent,:root[data-theme="dark"] .ss-teacher_absent{background:#7f1d1d;color:#fee2e2}
.ap-times{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.ap-times span{display:flex;flex-direction:column;background:var(--soft);border-radius:14px;padding:6px 12px}
.ap-times small{color:var(--muted);font-weight:700}
.ap-times b{font-size:18px}
.su-ok{color:var(--brand-text);font-weight:800;margin:8px 0 0}
.ap-setframe{width:100%;border:0;min-height:600px;display:block;background:transparent}
/* courses */
.ap-link{appearance:none;border:0;background:none;font:inherit;color:var(--brand-text);cursor:pointer;text-align:start;padding:2px 0;text-decoration:underline;text-underline-offset:3px}
.ap-tiles4{grid-template-columns:repeat(4,minmax(0,1fr))}
.ap-tiles4 .ap-tile{cursor:default}
.ap-other{width:110px;min-height:36px}
.ap-day input[type="time"]{width:auto;min-height:36px}
.ap-warn{background:#fef3c7;color:#78350f;border-radius:14px;padding:10px 12px;margin:6px 0;line-height:1.8}
:root[data-theme="dark"] .ap-warn{background:#78350f;color:#fef3c7}
.ap-plan{display:flex;flex-direction:column;max-height:320px;overflow:auto;border:2px solid var(--line);border-radius:14px}
.ap-prow{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;padding:6px 10px;border-top:1px solid var(--line);font-size:14px}
.ap-prow:first-child{border-top:0}
.ap-prow>span:first-child{color:var(--muted);min-width:22px}
.ap-prow.bad{background:#fee2e2}
:root[data-theme="dark"] .ap-prow.bad{background:#7f1d1d}
.ap-tagbar{margin:-4px 0 12px}
.ap-tagbar select{width:auto;min-width:200px;max-width:100%}
.ap-count{font-size:14px;color:var(--ink)}
.ap-count b{font-size:17px;color:var(--brand-text)}
.ap-count.none{color:var(--muted)}
.ap-taglist{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:6px}
.ap-tagrow{display:flex;align-items:center;gap:8px;padding:4px 8px;border:1px solid var(--line);border-radius:12px}
.ap-tagrow .small{margin-inline-start:auto}
.ap-x2{appearance:none;border:0;background:none;color:var(--muted);cursor:pointer;font:inherit;min-width:32px;min-height:32px;border-radius:8px}
.ap-x2:hover{background:var(--soft);color:var(--ink)}
.ap-swatches{display:inline-flex;flex-wrap:wrap;gap:6px}
.ap-sw{appearance:none;width:28px;height:28px;border-radius:50%;border:3px solid var(--card);box-shadow:0 0 0 2px var(--line);cursor:pointer}
.ap-sw[aria-pressed="true"]{box-shadow:0 0 0 3px var(--ink)}
