/* RollCall 36 — "site board" theme: hi-vis safety orange on graphite and white.
   Orange is the one accent (active navigation, primary actions, the series colour in charts);
   status colours (green / amber / red) are reserved for on time / late / missing and always carry a label. */
:root{
  --bg:#f2f3f5; --surface:#ffffff; --surface-2:#f6f7f8; --ink:#1d2127; --muted:#5d6470; --line:#e1e4e8;
  --accent:#f06b14; --accent-ink:#1b1e22; --accent-text:#b44c06; --accent-soft:#fff0e5;
  --side:#24282e; --side-2:#2f343b; --side-ink:#c5cad1; --side-mut:#8c939d;
  --ok:#17733f; --ok-soft:#e3f4ea; --okm:#1f8a4c; --warn:#8a5a00; --warn-soft:#fdf1d6; --warnm:#d99a00; --bad:#b42318; --bad-soft:#fde8e6; --badm:#c7362b; --info:#3c5a7d; --info-soft:#e7eef6;
  --f-display:'Barlow Semi Condensed','Barlow','Arial Narrow',system-ui,sans-serif;
  --f-body:'Barlow',system-ui,-apple-system,'Segoe UI',sans-serif;
  --f-mono:'JetBrains Mono',ui-monospace,Menlo,Consolas,monospace;
  --r:12px; --r-sm:8px; --side-w:244px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#15171a; --surface:#1d2024; --surface-2:#24282d; --ink:#eceef1; --muted:#a2a8b1; --line:#33383f;
  --accent:#ff7a24; --accent-ink:#15171a; --accent-text:#ff9b57; --accent-soft:#3a2516;
  --side:#101215; --side-2:#1d2126; --side-ink:#c5cad1; --side-mut:#7d848e;
  --ok:#5fd28f; --ok-soft:#173424; --okm:#3fb878; --warn:#f2c14e; --warn-soft:#3a2f12; --warnm:#e3ad2b; --bad:#ff8a7e; --bad-soft:#43201c; --badm:#f0675b; --info:#9fbde0; --info-soft:#1d2b3b; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#15171a; --surface:#1d2024; --surface-2:#24282d; --ink:#eceef1; --muted:#a2a8b1; --line:#33383f;
  --accent:#ff7a24; --accent-ink:#15171a; --accent-text:#ff9b57; --accent-soft:#3a2516;
  --side:#101215; --side-2:#1d2126; --side-ink:#c5cad1; --side-mut:#7d848e;
  --ok:#5fd28f; --ok-soft:#173424; --okm:#3fb878; --warn:#f2c14e; --warn-soft:#3a2f12; --warnm:#e3ad2b; --bad:#ff8a7e; --bad-soft:#43201c; --badm:#f0675b; --info:#9fbde0; --info-soft:#1d2b3b; color-scheme:dark}
*{box-sizing:border-box}
input[type=checkbox],input[type=radio]{accent-color:var(--accent)}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15.5px;line-height:1.5}
h1,h2,h3{font-family:var(--f-display);font-weight:700;line-height:1.15;margin:0;text-wrap:balance;letter-spacing:.005em}
h2{font-size:1.55rem} h3{font-size:1.08rem;font-weight:600}
p{margin:0}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums;font-size:.92em}
.muted{color:var(--muted)} .small{font-size:.86rem}
a{color:var(--accent-text)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* shell: graphite sidebar + slim top bar; drawer and bottom bar on phones */
.shell{display:grid;grid-template-columns:var(--side-w) minmax(0,1fr);min-height:100vh;background:linear-gradient(to right,var(--side) var(--side-w),var(--bg) var(--side-w))}
.side{position:sticky;top:0;height:100vh;background:var(--side);color:var(--side-ink);display:flex;flex-direction:column;overflow:hidden;z-index:30}
.side-brand{display:flex;align-items:center;gap:10px;padding:18px 18px 14px;border-bottom:1px solid rgba(255,255,255,.06)}
.side-brand b{font-family:var(--f-display);font-size:1.12rem;color:#fff;line-height:1.15}
.logo{width:36px;height:36px;border-radius:9px;background:var(--accent);color:#1b1e22;display:grid;place-items:center;font-family:var(--f-display);font-weight:700;font-size:1rem;flex:none;
  background-image:repeating-linear-gradient(135deg,transparent 0 9px,rgba(0,0,0,.12) 9px 12px)}
.side-nav{flex:1;overflow-y:auto;padding:8px 10px 14px;scrollbar-width:thin;scrollbar-color:var(--side-2) transparent}
.ng{display:grid;gap:1px;margin-top:10px}
.ngl{font-size:.74rem;color:var(--side-mut);padding:6px 10px 4px;font-weight:600;letter-spacing:.02em}
.side .tab{display:flex;align-items:center;gap:11px;width:100%;padding:8px 10px;border:0;border-radius:8px;background:none;color:var(--side-ink);font-weight:500;text-align:left;cursor:pointer;position:relative}
.side .tab svg{flex:none;opacity:.8}
.side .tab .tl{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side .tab:hover{background:var(--side-2);color:#fff}
.side .tab[aria-current="page"]{background:var(--side-2);color:#fff;font-weight:600}
.side .tab[aria-current="page"]::before{content:'';position:absolute;left:-10px;top:6px;bottom:6px;width:4px;border-radius:0 3px 3px 0;background:var(--accent)}
.side .tab[aria-current="page"] svg{color:var(--accent);opacity:1}
.side-me{display:flex;align-items:center;gap:10px;padding:12px 14px;border-top:1px solid rgba(255,255,255,.06)}
.cav.sm{width:34px;height:34px;font-size:.8rem}
.sm-t{display:grid;min-width:0;flex:1;line-height:1.2} .sm-t b{color:#fff;font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} .sm-t small{color:var(--side-mut);font-size:.76rem}
.btn.ghost{background:transparent;border-color:rgba(255,255,255,.18);color:var(--side-ink)} .btn.ghost:hover{background:var(--side-2);color:#fff}
.maincol{min-width:0;display:flex;flex-direction:column}
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;background:color-mix(in srgb,var(--surface) 92%,transparent);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.top-row{max-width:1320px;margin:0 auto;padding:10px 24px;display:flex;align-items:center;gap:12px;min-height:58px}
.top-t{display:flex;align-items:baseline;gap:10px;margin-right:auto;min-width:0}
.top-t b{font-family:var(--f-display);font-size:1.15rem;white-space:nowrap}
.top-grp{font-size:.82rem;color:var(--muted)} .top-org{display:none}
.navbtn{display:none;border:0;background:none;padding:6px;border-radius:8px;cursor:pointer;color:var(--ink)}
.who{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2}
.who small{color:var(--muted);font-size:.78rem}
.scrim{display:none}
.bottom{display:none}
.wrap{width:100%;max-width:1320px;margin:0 auto;padding-inline:24px;padding-block:22px 64px;display:grid;gap:18px}
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.head p{color:var(--muted);margin-top:4px;max-width:78ch}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px 20px;display:grid;gap:14px;min-width:0;align-content:start}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:18px;align-items:start}
.eyebrow{font-size:.86rem;color:var(--muted);font-weight:600}

/* kpis */
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.kpi{background:var(--surface);padding:14px 16px;display:grid;gap:2px}
.kpi b{font-family:var(--f-display);font-size:1.85rem;font-weight:700;font-variant-numeric:tabular-nums;line-height:1.1}
.kpi span{font-size:.8rem;color:var(--muted)}
.kpi.bad b{color:var(--bad)} .kpi.warn b{color:var(--warn)} .kpi.ok b{color:var(--ok)}

/* chips */
.chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:.76rem;font-weight:600;white-space:nowrap;background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}
.chip.ok{background:var(--ok-soft);color:var(--ok);border-color:transparent}
.chip.warn{background:var(--warn-soft);color:var(--warn);border-color:transparent}
.chip.bad{background:var(--bad-soft);color:var(--bad);border-color:transparent}
.chip.info{background:var(--info-soft);color:var(--info);border-color:transparent}
.chips{display:flex;flex-wrap:wrap;gap:4px}
.net{cursor:pointer}

/* buttons & forms */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 14px;border-radius:8px;border:1px solid var(--line);background:var(--surface);font-weight:600;cursor:pointer;text-decoration:none;color:var(--ink)}
.btn:hover{background:var(--surface-2)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:700}
.btn.primary:hover{filter:brightness(1.07)}
.btn.danger{color:var(--bad);border-color:var(--bad)}
.btn.big{padding:14px 20px;font-size:1.05rem;width:100%}
.btn.sm{padding:5px 10px;font-size:.84rem}
.btn:disabled{opacity:.45;cursor:not-allowed;filter:none}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr));gap:12px}
.fields .full{grid-column:1/-1}
label.f{display:grid;gap:4px;font-size:.84rem;font-weight:600;color:var(--muted)}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{width:100%;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--ink);font-weight:400;font-size:.95rem}
textarea{min-height:84px;resize:vertical}
input[type=file]{font-size:.85rem;max-width:100%}
.checks{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:4px 10px;font-weight:400;color:var(--ink)}
.checks label{display:flex;gap:6px;align-items:center;font-size:.86rem}
details.add>summary{cursor:pointer;font-weight:700;list-style:none}
details.add>summary::-webkit-details-marker{display:none}
details.add>summary::before{content:'+ '}
details.add[open]>summary::before{content:'– '}

/* tables */
.tw{overflow-x:auto;border:1px solid var(--line);border-radius:var(--r);background:var(--surface)}
table{width:100%;border-collapse:collapse;font-size:.9rem}
th{font-size:.82rem;color:var(--muted);text-align:left;font-weight:600;padding:10px 12px;background:var(--surface-2);border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:9px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
tr:last-child td{border-bottom:0}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
tr.click{cursor:pointer} tr.click:hover td{background:var(--surface-2)}
.empty{padding:26px;text-align:center;color:var(--muted)}
.bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden;min-width:60px}
.bar i{display:block;height:100%;background:var(--accent)}
.ratecell{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.ratecell .bar{width:70px}

/* photos */
.thumb{width:40px;height:48px;object-fit:cover;border-radius:6px;display:block;border:1px solid var(--line);cursor:zoom-in;background:var(--surface-2)}
.thumb.none{display:grid;place-items:center;font-size:.7rem;color:var(--muted);cursor:default}
.logs{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr));gap:12px}
.log{display:grid;grid-template-columns:86px 1fr;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:10px}
.log img{width:86px;height:104px;object-fit:cover;border-radius:6px;cursor:zoom-in}
.log .meta{display:grid;gap:4px;align-content:start;min-width:0}
.log b{overflow-wrap:anywhere}
.ico{display:inline-block;width:8px;height:8px;border-radius:50%}

/* instructor today */
.status{display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center}
.status img{width:84px;height:100px;object-fit:cover;border-radius:8px}
.status .big{font-family:var(--f-display);font-size:1.4rem;font-weight:700}
.checklist{display:grid;gap:8px;list-style:none;padding:0;margin:0}
.checklist li{display:flex;align-items:center;gap:10px}
.tick{width:22px;height:22px;border-radius:50%;border:2px solid var(--line);display:grid;place-items:center;font-size:.8rem;flex:none}
.done .tick{background:var(--ok);border-color:var(--ok);color:var(--surface)}
.done span{color:var(--muted);text-decoration:line-through}

/* clock */
.cam{position:relative;aspect-ratio:3/4;max-width:100%;width:320px;background:#101814;border-radius:10px;overflow:hidden;display:grid;place-items:center}
.cam video{width:100%;height:100%;object-fit:cover;transform:scaleX(-1);display:none}
.cam.live video{display:block}
.cam .msg{position:absolute;inset:auto 12px 12px;color:#e8efe9;font-size:.86rem;text-align:center}
.shot{width:320px;max-width:100%;border-radius:10px;display:block}
.locbox{display:grid;gap:8px}
.coords{font-family:var(--f-mono);font-size:1rem}
.spin{width:16px;height:16px;border:2px solid var(--line);border-top-color:var(--accent);border-radius:50%;animation:sp 0.8s linear infinite;display:inline-block;vertical-align:-3px}
@keyframes sp{to{transform:rotate(360deg)}}
.notice{padding:10px 12px;border-radius:8px;font-size:.88rem}
.notice.warn{background:var(--warn-soft);color:var(--warn)} .notice.bad{background:var(--bad-soft);color:var(--bad)} .notice.info{background:var(--info-soft);color:var(--info)} .notice.ok{background:var(--ok-soft);color:var(--ok)}

/* attendance */
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.seg button{border:0;background:var(--surface);padding:6px 12px;font-weight:700;cursor:pointer;color:var(--muted);min-width:40px}
.seg button+button{border-left:1px solid var(--line)}
.seg button.on[data-v=P]{background:var(--ok);color:var(--surface)}
.seg button.on[data-v=A]{background:var(--bad);color:var(--surface)}
.seg button.on[data-v=L]{background:var(--warn);color:var(--surface)}

/* login */
.login{min-height:100%;max-width:1040px;margin:0 auto;padding:48px 16px;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:36px;align-items:center}
.login h1{font-size:clamp(2rem,5vw,3rem);margin:14px 0 10px}
.login-brand p{color:var(--muted);max-width:44ch;font-size:1.05rem}
.login-points{margin:20px 0 0;padding:0;list-style:none;display:grid;gap:10px}
.login-points li{display:flex;gap:10px;align-items:baseline}
.login-points li::before{content:'';width:8px;height:8px;border-radius:2px;background:var(--accent);flex:none;transform:translateY(-1px)}
.statebar{display:flex;gap:2px;margin-top:22px;flex-wrap:wrap;max-width:420px}
.statebar i{width:9px;height:18px;border-radius:2px;background:var(--line)}
.statebar i.on{background:var(--accent)}
.login-card{padding:24px}
.hint{font-size:.86rem;color:var(--muted)}

/* modal & toast */
.overlay{position:fixed;inset:0;background:rgba(16,18,21,.6);z-index:50;display:grid;place-items:start center;overflow-y:auto;padding:40px 16px}
.modal{background:var(--surface);border-radius:12px;width:min(820px,100%);padding:20px;display:grid;gap:16px;border:1px solid var(--line)}
.modal img.full{max-width:100%;max-height:75vh;border-radius:8px;margin:0 auto;display:block}
.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:8px;z-index:60;max-width:calc(100% - 32px);font-size:.9rem;font-weight:500}
.toast.bad{background:var(--bad);color:#fff}
.kv{display:grid;grid-template-columns:max-content 1fr;gap:6px 16px;font-size:.92rem}
.kv dt{color:var(--muted)} .kv dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
@media (max-width:560px){.who{display:none}.status{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){.spin{animation:none}}

/* WordPress portal additions */
html{-webkit-text-size-adjust:100%}
:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{margin:0;min-height:100vh}
.boot{max-width:560px;margin:80px auto;padding-inline:16px;text-align:center;color:var(--muted);display:grid;gap:10px;justify-items:center}
.banner{max-width:1240px;margin:12px auto 0;padding-inline:16px}
#loginform{display:grid;gap:12px;margin:0}
#loginform p{margin:0;display:grid;gap:4px}
#loginform label{font-size:.84rem;font-weight:600;color:var(--muted)}
#loginform .login-remember label{display:flex;gap:8px;align-items:center;font-weight:500;color:var(--ink)}
#loginform input[type=text],#loginform input[type=password]{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--ink);font-size:1rem}
#loginform .button{width:100%;padding:13px 20px;border-radius:8px;border:1px solid var(--accent);background:var(--accent);color:var(--accent-ink);font-weight:700;font-size:1rem;cursor:pointer}
.login-card h2{margin-bottom:4px}

.card>details,details.add>div,#impOut{min-width:0}

/* v1.2 */
.nowrap{white-space:nowrap}
.badge{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--bad);color:#fff;font-size:.7rem;font-weight:700;vertical-align:1px}
.badge.warn{background:var(--warn)}
.subtabs{display:inline-flex;gap:2px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:3px;flex-wrap:wrap}
.subtabs button{border:0;background:none;padding:7px 12px;border-radius:7px;font-weight:600;color:var(--muted);cursor:pointer}
.subtabs button.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
/* spreadsheet */
.sheetwrap{max-height:70vh}
table.sheet{border-collapse:separate;border-spacing:0;font-size:.88rem}
table.sheet th{position:sticky;top:0;z-index:1}
table.sheet td{padding:0;border-bottom:1px solid var(--line);border-right:1px solid var(--line);vertical-align:middle}
table.sheet td:first-child{padding:0 8px;background:var(--surface-2)}
table.sheet td.small,table.sheet td:last-child,table.sheet td:nth-last-child(2),table.sheet td:nth-last-child(3){padding:6px 8px}
table.sheet input,table.sheet select{border:0;border-radius:0;background:transparent;padding:9px 8px;width:100%;min-width:90px;font-size:.88rem}
table.sheet .c-name input{min-width:170px;font-weight:600}table.sheet .c-notes input{min-width:220px}
table.sheet .c-qty input,table.sheet .c-qtyFaulty input{min-width:70px;text-align:right;font-family:var(--f-mono)}
table.sheet input:focus,table.sheet select:focus{outline:2px solid var(--accent);outline-offset:-2px;background:var(--surface)}
table.sheet tr.pend td{background:var(--warn-soft)}
table.sheet select.cond-ok{color:var(--ok);font-weight:600}table.sheet select.cond-warn{color:var(--warn);font-weight:600}table.sheet select.cond-bad{color:var(--bad);font-weight:600}
table.sheet tfoot td{background:var(--accent-soft)}table.sheet tfoot input,table.sheet tfoot select{background:var(--surface)}
label.btn.disabled{opacity:.45;pointer-events:none}
/* photo gallery */
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,170px),1fr));gap:12px}
.gallery figure{margin:0;background:var(--surface);border:1px solid var(--line);border-radius:10px;overflow:hidden;display:grid}
.gallery img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;cursor:zoom-in;background:var(--surface-2)}
.gallery figcaption{padding:8px 10px;display:grid;gap:3px;font-size:.84rem;min-width:0;overflow-wrap:anywhere}
/* alerts */
.log.done-al{opacity:.7}
/* profile */
form.bio{display:grid;gap:16px}
form.bio fieldset{border:1px solid var(--line);border-radius:10px;padding:14px;margin:0;min-width:0}
form.bio legend{font-weight:700;padding:0 6px}
.bio-photo{display:flex;gap:14px;align-items:flex-end;flex-wrap:wrap}
.bio-photo img{width:120px;height:150px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.modal{width:min(980px,100%)}
tfoot td{font-weight:600;background:var(--surface-2)}
table.sheet td input,table.sheet td select{border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none}
table.sheet td input:focus,table.sheet td select:focus{background:var(--surface)!important}
table.sheet tfoot td input,table.sheet tfoot td select{background:var(--surface)!important}
table.sheet tbody tr:nth-child(even) td:not(:first-child){background:var(--surface-2)}
.tw td.small{min-width:130px}
.log form input{min-width:0!important;width:100%}.log form{flex-wrap:wrap}
.cred{display:grid;gap:3px;min-width:170px}
.cred .pw{background:var(--warn-soft);color:var(--ink);padding:2px 6px;border-radius:4px;justify-self:start;user-select:all}
.credbox{background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:14px}
.credbox dd{user-select:all;font-size:1.05rem}

/* ===== chats (WhatsApp-style) ===== */
.wrap-chat{padding-block:12px 12px;max-width:1240px}
.chat{display:grid;grid-template-columns:minmax(280px,360px) 1fr;height:calc(100dvh - var(--top-h,110px) - 24px);min-height:420px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.clist{display:flex;flex-direction:column;border-right:1px solid var(--line);min-height:0}
.clist-h{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 14px 8px}
.clist-s{padding:0 14px 10px}
.clist-s input{width:100%;padding:9px 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface-2)}
.clist-items{overflow-y:auto;flex:1;min-height:0}
.citem{display:flex;gap:12px;align-items:center;width:100%;padding:10px 14px;background:none;border:0;border-bottom:1px solid var(--line);text-align:left;cursor:pointer;color:inherit}
.citem:hover{background:var(--surface-2)} .citem.on{background:var(--accent-soft)}
.cav{flex:none;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;color:#fff;font-weight:700;font-size:.95rem;font-family:var(--f-display)}
.cav.grp{background:var(--info-soft);color:var(--info)} .cav.bot{background:var(--side);color:var(--accent)}
.cmid{display:grid;gap:2px;min-width:0;flex:1}
.ctop,.cbot{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.ctop b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ctime{font-size:.74rem;color:var(--muted);flex:none} .ctime.new{color:var(--accent);font-weight:700}
.cprev{font-size:.84rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cun{flex:none;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--accent);color:var(--accent-ink);font-size:.72rem;font-weight:700;display:grid;place-items:center}
.cconv{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--surface-2)}
.cconv.none{display:grid;place-items:center}
.chead{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--surface);border-bottom:1px solid var(--line)}
.chead .cav{width:38px;height:38px;font-size:.85rem}
.chead-t{display:grid;min-width:0} .chead-t b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis} .chead-t small{color:var(--muted);font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cback{display:none;border:0;background:none;padding:4px}
.cmsgs{flex:1;overflow-y:auto;padding:12px 4% 16px;display:flex;flex-direction:column;gap:2px;min-height:0;
  background-image:radial-gradient(color-mix(in srgb,var(--line) 70%,transparent) 1px,transparent 1px);background-size:18px 18px}
.cday{display:flex;justify-content:center;margin:10px 0 6px} .cday span{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:2px 10px;font-size:.75rem;color:var(--muted)}
.msg{display:flex;flex-direction:column;align-items:flex-start;max-width:min(78%,560px)} .msg.first{margin-top:6px}
.msg.me{align-self:flex-end;align-items:flex-end}
.bub{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:6px 10px 18px;min-width:84px;cursor:pointer;overflow-wrap:anywhere;box-shadow:0 1px 0 rgba(0,0,0,.04)}
.msg.me .bub{background:var(--accent-soft);border-color:transparent}
.msg.bm .bub{border-left:3px solid var(--info)}
.mname{display:block;font-size:.8rem;margin-bottom:2px}
.mtxt{line-height:1.42} .mtxt code{font-family:var(--f-mono);font-size:.85em;background:var(--surface-2);padding:0 4px;border-radius:4px}
.mdel{color:var(--muted);font-size:.9rem}
.mmeta{position:absolute;right:8px;bottom:3px;font-size:.68rem;color:var(--muted);white-space:nowrap}
.tk{margin-left:2px;letter-spacing:-.15em} .tk.read{color:#2f8fe0} .tk.bad{color:var(--bad);font-weight:700;letter-spacing:0}
.mrep{border-left:3px solid var(--accent);background:color-mix(in srgb,var(--surface-2) 80%,transparent);border-radius:6px;padding:4px 8px;margin-bottom:4px;display:grid;font-size:.8rem;min-width:0}
.mrep b{color:var(--accent);font-size:.78rem} .mrep span{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.catt{display:block;max-width:min(280px,100%);max-height:320px;border-radius:8px;margin-bottom:4px;object-fit:cover}
.cfile{display:flex;align-items:center;gap:8px;padding:8px;border-radius:8px;background:var(--surface-2);color:var(--ink);text-decoration:none;margin-bottom:4px}
.cfile span{display:grid;min-width:0} .cfile b{font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .cfile small{color:var(--muted);font-size:.74rem}
.macts{display:flex;gap:4px;flex-wrap:wrap;margin:4px 0 2px}
.merr{font-size:.76rem;color:var(--bad);margin-top:2px}
.cmore{display:flex;justify-content:center;margin:6px 0}
.cempty{margin:auto;display:grid;justify-items:center;gap:10px;text-align:center;max-width:420px;padding:24px}
.cempty .cav{width:64px;height:64px}
.csugg{display:flex;flex-wrap:wrap;gap:6px;justify-content:center}
.dots{display:inline-flex;gap:4px;padding:4px 2px} .dots i{width:7px;height:7px;border-radius:50%;background:var(--muted);animation:rcdot 1.2s infinite ease-in-out} .dots i:nth-child(2){animation-delay:.15s} .dots i:nth-child(3){animation-delay:.3s}
@keyframes rcdot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.ccomp{background:var(--surface);border-top:1px solid var(--line);padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px))}
.crow{display:flex;align-items:flex-end;gap:6px}
.crow textarea{flex:1;resize:none;min-height:42px;height:42px;border:1px solid var(--line);border-radius:20px;padding:10px 14px;max-height:140px;line-height:1.35;background:var(--surface-2)}
.cbtn{flex:none;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;border:0;background:none;color:var(--muted);cursor:pointer}
.cbtn:hover{background:var(--surface-2);color:var(--ink)}
.cbtn.send{background:var(--accent);color:var(--accent-ink)} .cbtn.send:hover{filter:brightness(1.07);background:var(--accent);color:var(--accent-ink)} .cbtn:disabled{opacity:.45;cursor:not-allowed}
.cx{display:flex;align-items:center;gap:8px;margin-bottom:6px;padding:6px;border-radius:8px;background:var(--surface-2)} .cx .mrep{flex:1;margin:0} .cx img{width:48px;height:48px;object-fit:cover;border-radius:6px} .cx .small{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
.pick{display:grid;max-height:60vh;overflow-y:auto;border:1px solid var(--line);border-radius:8px}
.pk-h{font-size:.82rem;font-weight:600;color:var(--muted);padding:10px 14px 4px;background:var(--surface-2)}
ul.chg{margin:0;padding-left:16px;display:grid;gap:2px}
@media (max-width:760px){
  .wrap-chat{padding:0}
  .chat{grid-template-columns:1fr;border-radius:0;border-inline:0;height:calc(100dvh - var(--top-h,110px))}
  .chat.has-open .clist{display:none} .chat:not(.has-open) .cconv{display:none}
  .cback{display:grid}
  .msg{max-width:88%}
}
.cedit .chip{gap:2px;padding-right:4px}
.cx-x{border:0;background:none;color:inherit;cursor:pointer;padding:0 4px;font-size:.8rem;line-height:1;opacity:.7}
.cx-x:hover{opacity:1;color:var(--bad)}
.bulkbar{padding:10px 12px;margin-bottom:10px;border-radius:8px;background:var(--accent-soft);gap:12px}
.bulkbar .f{min-width:150px}

/* 1.9: the hidden attribute always wins over display rules (bulk bars, toggled fields); selected zone row */
[hidden]{display:none!important}
tr.sel td{background:var(--info-soft)}
/* 1.10: notice board, visits, attendance trend */
.notice-card{border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin:8px 0;background:var(--surface);display:grid;gap:8px}
.notice-card.unread{border-color:var(--info);box-shadow:inset 4px 0 0 var(--info)}
.notice-card.pinned{background:var(--surface-2)}
.notice-card .card-h{margin:0}
.ntxt{line-height:1.5;overflow-wrap:anywhere}
.stars{color:#c98a00;letter-spacing:1px}
.stars .muted{color:var(--line)}
.stars-in .btn{min-width:38px;font-size:1.05rem}
svg.trend{width:100%;height:auto;display:block}
svg.trend .tax{stroke:var(--line)}
svg.trend .tb{fill:var(--accent)}
svg.trend .tv{font-size:14px;font-weight:600;fill:var(--ink);font-family:var(--f-display)}
svg.trend .tl{font-size:12.5px;fill:var(--muted)}
svg.trend .tb.today{opacity:.45}
.danger-zone{border-color:var(--bad)}

/* ===== 1.11: dashboard ===== */
.dash-hero{display:grid;grid-template-columns:minmax(300px,420px) 1fr;gap:18px}
.roll-card{border-top:4px solid var(--accent)}
.roll-body{display:grid;grid-template-columns:minmax(140px,190px) 1fr;gap:18px;align-items:center}
svg.donut{width:100%;max-width:190px;height:auto;display:block}
.dn-bg{stroke:var(--surface-2)} .dn.ok{stroke:var(--okm)} .dn.warn{stroke:var(--warnm)} .dn.bad{stroke:var(--badm)} .dn.idle{stroke:var(--line)}
.dn-v{font-family:var(--f-display);font-weight:700;font-size:26px;fill:var(--ink)} .dn-s{font-size:11px;fill:var(--muted)}
.legend{list-style:none;margin:0;padding:0;display:grid;gap:9px;font-size:.92rem}
.legend li{display:flex;align-items:center;gap:9px} .legend b{margin-left:auto;font-family:var(--f-display);font-size:1.15rem;font-variant-numeric:tabular-nums}
.legend .lg-sub{border-top:1px solid var(--line);padding-top:9px;color:var(--muted)}
.sw{width:11px;height:11px;border-radius:3px;flex:none;display:inline-block;background:var(--line)} .sw.ok{background:var(--okm)} .sw.warn{background:var(--warnm)} .sw.bad{background:var(--badm)} .sw.idle{background:var(--line)}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px;align-content:start}
.tile{display:grid;gap:2px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px 16px;cursor:pointer;color:var(--ink);position:relative;overflow:hidden}
.tile:hover{border-color:var(--accent)}
.tile b{font-family:var(--f-display);font-size:2rem;font-weight:700;line-height:1.05;font-variant-numeric:tabular-nums}
.tile span{font-weight:600;font-size:.92rem} .tile small{color:var(--muted);font-size:.8rem}
.tile.bad b{color:var(--bad)} .tile.warn b{color:var(--warn)} .tile.ok b{color:var(--ok)}
.tile::after{content:'';position:absolute;inset:0 auto 0 0;width:4px;background:transparent}
.tile.bad::after{background:var(--badm)} .tile.warn::after{background:var(--warnm)}
.dash-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.hbars{display:grid;gap:4px}
.hb{display:grid;grid-template-columns:minmax(90px,150px) 1fr auto;gap:10px;align-items:center;border:0;background:none;padding:5px 4px;border-radius:6px;cursor:pointer;text-align:left;color:var(--ink)}
.hb:hover{background:var(--surface-2)}
.hb-l{font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hb-t{height:12px;display:block}
.hb-d{display:block;height:100%;background:var(--surface-2);border-radius:4px;overflow:hidden;border:1px solid var(--line)}
.hb-n{display:block;height:100%;background:var(--accent);border-radius:0 4px 4px 0}
.hb-v{font-size:.84rem;color:var(--muted);min-width:44px;text-align:right}
.todo,.feed{list-style:none;margin:0;padding:0;display:grid}
.todo li+li,.feed li+li{border-top:1px solid var(--line)}
.todo button,.feed button{display:flex;align-items:center;gap:12px;width:100%;padding:9px 2px;border:0;background:none;text-align:left;cursor:pointer;color:var(--ink)}
.todo button:hover,.feed button:hover{background:var(--surface-2)}
.todo span,.ft{display:grid;min-width:0;flex:1} .todo b,.ft b{font-weight:600;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} .todo small,.ft small{color:var(--muted);font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fi{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-text);flex:none} .fi svg{width:17px;height:17px}
.fi.bad{background:var(--bad-soft);color:var(--bad)}
.feed time{font-size:.8rem;color:var(--muted);font-variant-numeric:tabular-nums;flex:none}
.quick .btn svg{width:18px;height:18px;color:var(--accent-text)}
.wrap>.notices{border-top:4px solid var(--info)}
@media (max-width:1100px){.dash-hero{grid-template-columns:1fr}}
@media (max-width:900px){.dash-grid{grid-template-columns:1fr}}

/* ===== phones & small tablets: drawer + bottom bar ===== */
@media (max-width:960px){
  .shell{grid-template-columns:1fr;background:var(--bg)}
  .side{position:fixed;inset:0 auto 0 0;width:min(86vw,300px);transform:translateX(-102%);transition:transform .22s ease}
  .nav-open .side{transform:none;box-shadow:0 0 40px rgba(0,0,0,.35)}
  .nav-open .scrim{display:block;position:fixed;inset:0;background:rgba(16,18,21,.55);z-index:25}
  .navbtn{display:grid}
  .top-row{padding:8px 14px;min-height:54px;gap:8px}
  .top-org{display:block;font-family:var(--f-display);font-weight:700;font-size:1.02rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw}
  .top-t b,.top-grp{display:none}
  .wrap{padding-inline:14px;padding-block:16px calc(84px + env(safe-area-inset-bottom,0px))}
  .bottom{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;z-index:22;background:var(--surface);border-top:1px solid var(--line);padding:4px 4px calc(4px + env(safe-area-inset-bottom,0px))}
  .bottom .tab{display:grid;justify-items:center;gap:2px;border:0;background:none;padding:6px 2px;border-radius:8px;color:var(--muted);font-size:.72rem;font-weight:600;cursor:pointer;position:relative}
  .bottom .tab[aria-current="page"]{color:var(--accent-text)}
  .bottom .tab[aria-current="page"] svg{color:var(--accent)}
  .bottom .tab .badge{position:absolute;top:2px;left:calc(50% + 6px)}
  .bottom .tab .tl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .wrap-chat{padding:0 0 calc(64px + env(safe-area-inset-bottom,0px))}
  .chat{height:calc(100dvh - var(--top-h,56px) - 64px - env(safe-area-inset-bottom,0px))}
}
@media (max-width:560px){.roll-body{grid-template-columns:1fr;justify-items:center}.legend{width:100%}.tiles{grid-template-columns:1fr 1fr}.tile b{font-size:1.65rem}.top-row .btn.sm[data-act=toggleOffline]{display:none}}
@media (prefers-reduced-motion:reduce){.side{transition:none}}
@media print{.side,.top,.bottom{display:none}.shell{display:block}}
.status-card{border-top:4px solid var(--accent)}
