/* World Class Staff Dashboard. Brand: red #D03040, blue #20C0F0, white, charcoal. */
:root {
  --red: #D03040;
  --red-600: #B82636;
  --red-700: #9E1F2D;
  --red-50: #FDEEF0;
  --red-100: #F9D9DD;
  --blue: #20C0F0;
  --blue-700: #07759A;   /* blue for text on white (AA) */
  --blue-50: #E8F8FE;
  --blue-100: #C9EFFC;
  --charcoal: #2A2E33;
  --charcoal-2: #3A3F45;
  --ink: #23272B;
  --muted: #5B636C;
  --line: #E1E5EA;
  --line-2: #CDD3DA;
  --bg: #F3F5F7;
  --card: #FFFFFF;
  --amber: #B45309;
  --amber-50: #FEF3E2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .06), 0 2px 8px rgba(20, 24, 28, .05);
  --shadow-lg: 0 18px 48px rgba(20, 24, 28, .22);
  --nav-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: var(--blue-700); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--charcoal); }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.grow { flex: 1 1 auto; }
.push { margin-left: auto; }

/* ---------- top bar & nav ---------- */
.topbar { background: var(--charcoal); color: #fff; position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.topbar::after { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--red) 0 50%, var(--blue) 50% 100%); }
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 8px 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; flex: none; }
.brand img { width: 44px; height: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 1.02rem; font-weight: 800; letter-spacing: .01em; }
.brand-text small { font-size: .74rem; color: #C9CED4; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-item { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 10px; color: #D9DDE1; font-weight: 650; font-size: .92rem; text-decoration: none !important; transition: background .15s, color .15s; position: relative; }
.nav-item.on { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px; border-radius: 3px; background: var(--red); }
.by-chip { margin-left: auto; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #fff; padding: 7px 12px; border-radius: 999px; font-size: .85rem; max-width: 260px; min-height: 40px; transition: background .15s; }
.by-chip b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.by-label { color: #C9CED4; }
.by-chip.unset { border-color: var(--blue); }
.by-chip.unset b { color: var(--blue); }
body.staff-mode .nav { display: none; }   /* the account chip stays: staff need Change password / Sign out */

@media (max-width: 899px) {
  .topbar-inner { padding: 6px 12px; min-height: 54px; gap: 10px; }
  .brand img { width: 38px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; background: var(--charcoal); justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); gap: 0; z-index: 40; box-shadow: 0 -2px 12px rgba(0,0,0,.18); }
  .nav-item { flex: 1; flex-direction: column; gap: 2px; padding: 7px 2px 6px; font-size: .7rem; border-radius: 10px; min-height: 52px; justify-content: center; }
  .nav-item .ic { width: 22px; height: 22px; }
  .nav-item.on { background: transparent; color: #fff; }
  .nav-item.on::after { left: 30%; right: 30%; top: 0; bottom: auto; }
  .nav-item.on .ic { color: var(--blue); }
  .by-label { display: none; }
  .by-chip { padding: 6px 10px; max-width: 46vw; }
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  body.staff-mode { padding-bottom: 0; }
}
@media (max-width: 380px) { .brand-text small { display: none; } }

/* ---------- layout ---------- */
.view { max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; outline: none; }
@media (max-width: 600px) { .view { padding: 12px 10px 28px; } h1 { font-size: 1.3rem; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
@media (max-width: 600px) { .card { padding: 13px; border-radius: 12px; margin-bottom: 10px; } }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 1.02rem; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--red); }
.card-head > .muted, .card-head > .btn, .card-head > .link-btn { margin-left: auto; font-size: .85rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; flex-wrap: wrap; }
.page-head p { margin-top: 3px; font-size: .9rem; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; margin: 0 0 10px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font-weight: 700; font-size: .92rem; min-height: 44px; background: var(--charcoal); color: #fff; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; text-decoration: none !important; white-space: nowrap; user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--red); color: #fff; }
.btn.danger { background: var(--red-700); color: #fff; }
.btn.ghost { background: #fff; color: var(--charcoal); border-color: var(--line-2); }
.btn.ghost.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.btn.sm { min-height: 38px; padding: 7px 12px; font-size: .85rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.on-head { background: rgba(255,255,255,.95); color: var(--charcoal); border-color: transparent; }
.btn.on-dark { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.danger-text { color: var(--red-700) !important; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); transition: background .15s, color .15s; flex: none; }
.icon-btn.lg { width: 46px; height: 46px; border: 1px solid var(--line-2); background: #fff; color: var(--charcoal); }
.icon-btn.lg .ic { width: 22px; height: 22px; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 6px 4px; color: var(--blue-700); font-weight: 650; display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row.end { justify-content: flex-end; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; flex: 1; }
.field > span { font-size: .78rem; font-weight: 700; color: var(--charcoal-2); letter-spacing: .01em; }
.field em, .check-line em { font-style: normal; font-weight: 500; color: var(--muted); }
.field.inline { margin: 0; flex: 0 1 auto; }
input[type=text], input:not([type]), input[type=search], input[type=date], input[type=month], input[type=time], input[type=number], input[type=tel], input[type=email], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: #fff; min-height: 44px; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 84px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-700); box-shadow: 0 0 0 3px rgba(32,192,240,.3); }
.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(208,48,64,.18) !important; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232A2E33' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-row { display: flex; gap: 10px; }
@media (max-width: 420px) { .form-row { flex-direction: column; gap: 0; } }
.check-line { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; font-weight: 600; font-size: .92rem; }
.check-line input, .inline-check input { width: 20px; height: 20px; accent-color: var(--red); }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.search-field { position: relative; display: flex; align-items: center; min-width: 180px; }
.search-field .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 38px; }
.add-inline { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.add-inline input, .add-inline select { flex: 1; }
.add-inline .btn { min-height: 44px; }
.toolbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 12px; }
.toolbar .field.inline > span { font-size: .72rem; }
.toolbar .field.inline select, .toolbar .field.inline input { min-width: 140px; }
@media (max-width: 600px) {
  .toolbar { gap: 8px; }
  .toolbar .search-field { flex: 1 1 100%; }
  .toolbar .field.inline { flex: 1 1 calc(50% - 8px); }
  .toolbar .field.inline select, .toolbar .field.inline input { min-width: 0; }
}
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- segmented ---------- */
.seg { display: inline-flex; background: #EAEDF0; border-radius: 11px; padding: 3px; gap: 2px; }
.seg.full { display: flex; width: 100%; margin-bottom: 14px; }
.seg.full .seg-btn { flex: 1; }
.seg-btn { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: .88rem; color: var(--muted); min-height: 38px; transition: background .15s, color .15s, box-shadow .15s; }
.seg-btn.on { background: #fff; color: var(--charcoal); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg-btn.inv.on { background: var(--red); color: #fff; }
.seg-btn.hoo.on { background: var(--blue); color: var(--charcoal); }
.tabs-seg { margin-bottom: 14px; display: flex; max-width: 520px; }
.tabs-seg .seg-btn { flex: 1; }

/* ---------- tags, pills, points ---------- */
.tag { display: inline-flex; align-items: center; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; margin-right: 4px; line-height: 1.5; }
.tag-inv { background: var(--red-50); color: var(--red-700); }
.tag-hoo { background: var(--blue-50); color: #075E7A; }
.tiny-tag { display: inline-flex; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #EEF1F4; color: var(--charcoal-2); margin-right: 4px; }
.tiny-tag.warn { background: var(--amber-50); color: var(--amber); }
.level-pill { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.level-pill.lvx { color: var(--muted); border-color: var(--line-2); border-style: dashed; background: #fff; }
.level-pill.lv0 { color: var(--charcoal-2); border-color: var(--line-2); background: #F6F7F9; }
.level-pill.lv1 { color: #075E7A; border-color: var(--blue-100); background: var(--blue-50); }
.level-pill.lv2 { color: #fff; border-color: var(--blue-700); background: var(--blue-700); }
.level-pill.lv3 { color: var(--red-700); border-color: var(--red-100); background: var(--red-50); }
.level-pill.lv4 { color: #fff; border-color: var(--red); background: var(--red); }
.pts { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 2px 8px; border-radius: 999px; font-weight: 800; font-size: .82rem; font-variant-numeric: tabular-nums; }
.pts.pos { background: var(--blue-50); color: #075E7A; }
.pts.neg { background: var(--red-50); color: var(--red-700); }
.pts.zero { background: #EEF1F4; color: var(--charcoal-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 650; font-size: .85rem; }
.chip.static { cursor: default; }
.chip.err { background: var(--red-50); border-color: var(--red-100); color: var(--red-700); }
.chip.warn { background: var(--amber-50); border-color: #F6D9A8; color: var(--amber); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.summary-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--charcoal); color: #fff; font-weight: 800; font-size: .8rem; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 34px; height: 34px; font-size: .75rem; }
.avatar.xl { width: 64px; height: 64px; font-size: 1.3rem; background: linear-gradient(135deg, var(--red), var(--red-700)); }
.streak, .streak-mini { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: var(--red-700); }
.streak .ic, .streak-mini .ic { width: 15px; height: 15px; color: var(--red); }
.streak-mini .ic { width: 13px; height: 13px; }
.perk-mini .ic { width: 14px; height: 14px; color: var(--blue-700); vertical-align: -2px; }
.ms-flag { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 800; color: #075E7A; background: var(--blue-50); padding: 3px 8px; border-radius: 999px; }
.ms-flag .ic { width: 14px; height: 14px; }

/* ---------- progress ---------- */
.progress { height: 8px; background: #E8ECEF; border-radius: 999px; overflow: hidden; flex: 1; min-width: 60px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-700)); border-radius: 999px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
.prog-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.prog-line b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty-ic { width: 40px; height: 40px; color: var(--line-2); margin-bottom: 8px; stroke-width: 1.6; }
.empty h3 { font-size: 1rem; color: var(--charcoal); margin-bottom: 4px; }
.empty p { font-size: .9rem; max-width: 360px; margin: 0 auto 12px; }
.empty-inline { font-size: .9rem; padding: 6px 0 4px; }

/* ---------- TODAY ---------- */
.daybar { padding: 12px 14px; }
.daybar-row { display: flex; align-items: center; gap: 10px; }
.daybar-row.sub { margin-top: 10px; flex-wrap: wrap; }
.daybar-mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.daybar-title { font-size: 1.15rem; font-weight: 800; color: var(--charcoal); display: flex; align-items: center; gap: 8px; text-align: center; flex-wrap: wrap; justify-content: center; }
.today-dot { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; background: var(--red); color: #fff; padding: 2px 8px; border-radius: 999px; }
.date-input input { min-height: 36px; padding: 5px 10px; font-size: 16px; width: auto; border-color: var(--line); color: var(--muted); }
.daybar-stats { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.daybar-stats b { color: var(--charcoal); font-size: 1.05rem; }
@media (max-width: 600px) {
  .daybar-title { font-size: 1rem; }
  .daybar-row.sub .seg { flex: 1; display: flex; } .daybar-row.sub .seg-btn { flex: 1; padding: 8px 6px; }
  .daybar-stats { gap: 12px; } .daybar-stats .push { margin-left: 0; width: 100%; }
}
.schools { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.schools.single { grid-template-columns: 1fr; max-width: 760px; }
@media (max-width: 1023px) { .schools { grid-template-columns: 1fr; } }
.school-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.school-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.school-card.inv .school-head { background: var(--red); color: #fff; }
.school-card.hoo .school-head { background: var(--blue); color: var(--charcoal); }
.school-head h2 { font-size: 1.15rem; font-weight: 800; color: inherit; letter-spacing: .01em; }
.school-count { font-size: .82rem; font-weight: 600; opacity: .92; }
.shift-list { list-style: none; margin: 0; padding: 0; }
.shift { padding: 12px 14px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; transition: background .3s; }
.shift:last-child { border-bottom: 0; }
.shift.m-showed { border-left-color: var(--blue); }
.shift.m-late { border-left-color: #E8838E; }
.shift.m-noshow_cover, .shift.m-noshow { border-left-color: var(--red); }
.shift.flash { animation: flash .9s ease-out; }
@keyframes flash { 0% { background: var(--blue-50); } 100% { background: transparent; } }
.shift-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.shift-name { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.shift-name b { display: block; font-size: 1rem; }
.shift-time { display: block; font-size: .82rem; color: var(--muted); }
.status-chip { font-size: .75rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.status-chip.st-showed { background: var(--blue-50); color: #075E7A; }
.status-chip.st-late { background: var(--red-50); color: var(--red-700); }
.status-chip.st-noshow_cover, .status-chip.st-noshow { background: var(--red); color: #fff; }
.score-btns { display: grid; grid-template-columns: repeat(4, 1fr) 54px; gap: 6px; }
.sb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 56px; padding: 6px 4px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff; color: var(--charcoal); font-size: .74rem; font-weight: 700; line-height: 1.1; text-align: center; transition: background .12s, border-color .12s, color .12s, transform .08s; -webkit-tap-highlight-color: transparent; }
.sb:active { transform: scale(.95); }
.sb .ic { width: 17px; height: 17px; margin-bottom: 1px; }
.sb-p { font-size: .7rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-showed .ic { color: var(--blue-700); }
.sb-late .ic, .sb-noshow_cover .ic, .sb-noshow .ic { color: var(--red); }
.sb-more { color: var(--muted); }
.sb.on .sb-p { color: inherit; opacity: .85; }
.sb-showed.on { background: var(--blue); border-color: var(--blue); color: var(--charcoal); }
.sb-showed.on .ic { color: var(--charcoal); }
.sb-late.on { background: var(--red-50); border-color: var(--red); color: var(--red-700); }
.sb-noshow_cover.on, .sb-noshow.on { background: var(--red); border-color: var(--red); color: #fff; }
.sb-noshow_cover.on .ic, .sb-noshow.on .ic { color: #fff; }
@media (max-width: 380px) { .score-btns { grid-template-columns: repeat(4, 1fr) 44px; gap: 4px; } .sb { font-size: .68rem; } }
.shift-below { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.shift-below .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.shift-below .dot { color: var(--muted); }
.shift-below .pts { min-width: 0; font-size: .74rem; padding: 0 6px; }
.covers-line { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 14px; background: var(--blue-50); font-size: .84rem; border-top: 1px solid var(--blue-100); }
.covers-line > .ic { color: var(--blue-700); }
.school-foot { padding: 6px 10px; border-top: 1px solid var(--line); background: #FAFBFC; }
.leaderboard .lb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .leaderboard .lb-cols { grid-template-columns: 1fr; } }
.lb-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 3px solid var(--red); }
.lb-col.hoo h4 { border-color: var(--blue); }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.lb-row a { flex: 1; font-weight: 700; color: var(--ink); }
.lb-rank { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; background: #EEF1F4; color: var(--charcoal); }
.lb-row.r1 .lb-rank { background: var(--red); color: #fff; }
.lb-row.r2 .lb-rank { background: var(--blue); color: var(--charcoal); }
.lb-row.r3 .lb-rank { background: var(--charcoal); color: #fff; }
.lb-empty { color: var(--muted); font-size: .88rem; padding: 6px 0; }
.perks-card { border-color: var(--blue-100); background: linear-gradient(180deg, var(--blue-50), #fff 70%); }
.perks-card .card-head h3 .ic { color: var(--blue-700); }
.perk-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--blue-100); flex-wrap: wrap; }
.perk-row:first-of-type { border-top: 0; }
.perk-name { font-weight: 800; color: var(--ink); }
.perk-what { flex: 1; font-size: .9rem; color: var(--charcoal-2); }

/* ---------- modal / sheet ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 24, 28, .5); opacity: 0; transition: opacity .18s; }
.modal { position: relative; background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); opacity: 0; transition: transform .2s cubic-bezier(.2,.8,.2,1), opacity .18s; outline: none; }
.modal.small { max-width: 440px; }
.modal-wrap.in .modal-backdrop { opacity: 1; }
.modal-wrap.in .modal { transform: none; opacity: 1; }
.modal-grip { display: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 8px; }
.modal-head h2 { font-size: 1.15rem; font-weight: 800; }
.modal-sub { font-size: .86rem; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 8px 18px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #FAFBFC; border-radius: 0 0 18px 18px; }
.modal-foot .push-left { margin-right: auto; }
.confirm-msg { font-size: .95rem; color: var(--charcoal-2); margin-bottom: 12px; line-height: 1.5; }
@media (max-width: 759px) {
  .modal-wrap { align-items: flex-end; padding: 0; }
  .modal, .modal.small { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; transform: translateY(100%); opacity: 1; }
  .modal.tall { height: 92vh; }
  .modal-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; }
  .modal-head { padding-top: 10px; }
  .modal-foot { border-radius: 0; }
  .modal-foot .btn { flex: 1; }
  .modal-foot .push-left { flex: 0 0 auto; }
}
.group-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 8px; }
.group-label:first-child { margin-top: 4px; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 420px) { .sheet-grid { grid-template-columns: 1fr; } }
.sheet-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; min-height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-weight: 700; font-size: .92rem; text-align: left; color: var(--ink); text-decoration: none !important; transition: border-color .12s, background .12s; }
.sheet-btn span { display: inline-flex; align-items: center; gap: 8px; }
.sheet-btn.warn { color: var(--red-700); }
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; text-align: left; min-height: 54px; transition: border-color .12s, background .12s; }
.pick-name { flex: 1; font-weight: 700; }
.search-field + .group-label { margin-top: 14px; }
.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
@media (max-width: 520px) { .type-grid { grid-template-columns: 1fr 1fr; } }
.type-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 700; font-size: .86rem; min-height: 64px; transition: all .12s; }
.type-btn.on { border-color: var(--charcoal); background: var(--charcoal); color: #fff; }
.type-btn.on .pts { background: rgba(255,255,255,.18); color: #fff; }
.qa-group { margin-top: 6px; }
.qa-group-head { display: flex; align-items: center; justify-content: space-between; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.check-chip { position: relative; display: block; }
.check-chip input { position: absolute; opacity: 0; inset: 0; }
.check-chip span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 10px; border-radius: 11px; border: 1.5px solid var(--line-2); font-weight: 700; font-size: .9rem; background: #fff; transition: all .12s; text-align: center; cursor: pointer; }
.check-chip input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.check-chip.inv input:checked + span { background: var(--red); border-color: var(--red); }
.check-chip.hoo input:checked + span { background: var(--blue); border-color: var(--blue); color: var(--charcoal); }
.check-chip input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.rate-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rate-l { width: 92px; font-weight: 700; font-size: .92rem; }
.rate-btns { display: flex; gap: 6px; flex: 1; }
.rate-btn { flex: 1; height: 44px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 800; transition: all .12s; }
.rate-btn.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80; background: var(--charcoal); color: #fff; padding: 10px 10px 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 24px)); font-size: .92rem; transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast.error { background: var(--red-700); }
.toast .pts { margin-left: 2px; }
.toast .pts.pos { background: rgba(32,192,240,.25); color: #BFEFFF; }
.toast .pts.neg { background: rgba(208,48,64,.35); color: #FFD5DA; }
.toast .pts.zero { background: rgba(255,255,255,.15); color: #fff; }
.toast-msg { padding: 4px 0; }
.toast-msg .ic { width: 16px; height: 16px; vertical-align: -3px; }
.toast-btn { background: transparent; border: 1px solid rgba(255,255,255,.35); color: var(--blue); font-weight: 800; padding: 8px 14px; border-radius: 9px; min-height: 38px; flex: none; }
@media (max-width: 899px) {
  .toast { left: 12px; right: 12px; max-width: none; transform: translateY(20px); bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); }
  .toast.show { transform: none; }
  .toast-msg { flex: 1; }
  body.staff-mode .toast { bottom: 20px; }
}

/* ---------- STAFF ---------- */
.staff-table { padding: 0; overflow: hidden; }
.st-row { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(282px, 1.5fr) 60px 66px 72px 110px minmax(110px, 1fr); align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; transition: background .12s; }
.st-row:last-child { border-bottom: 0; }
.st-head { background: #F6F7F9; padding-top: 6px; padding-bottom: 6px; }
.th-btn { background: none; border: 0; padding: 6px 0; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; display: inline-flex; align-items: center; gap: 3px; }
.th-btn.on { color: var(--charcoal); }
.th-btn .ic { width: 14px; height: 14px; }
.th-btn .ic.flip { transform: rotate(180deg); }
.c-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.c-name .nm { display: flex; flex-direction: column; min-width: 0; }
.c-name .tags { margin-top: 2px; }
.c-num { font-variant-numeric: tabular-nums; }
.c-num .lbl { display: none; }
.c-prog { display: flex; align-items: center; gap: 8px; }
@media (max-width: 1023px) {
  .st-row.st-head { display: none; }
  .st-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; }
  .c-name { flex: 1 1 calc(100% - 110px); min-width: 0; order: 0; }
  .c-total { order: 1; flex-direction: column; align-items: flex-end; }
  .c-total .pts { font-size: .95rem; min-width: 46px; padding: 3px 10px; }
  .c-level, .c-streak, .c-month, .c-ms, .c-prog { order: 2; }
  .c-level { margin-left: 46px; }
  .c-num { display: inline-flex; align-items: center; gap: 5px; }
  .c-num .lbl { display: inline; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .c-total .lbl { font-size: .6rem; }
  .c-ms:not(.pending) { display: none; }
  .c-prog { flex: 1 1 110px; max-width: 220px; }
  .c-prog .no-tasks { display: none; }
}
/* staff rows: the name link stretches over the row; the level dropdown sits above it */
.st-row { position: relative; }
.st-link { color: var(--ink); text-decoration: none !important; }
.st-link::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.st-link:focus-visible { outline: none; }
.st-link:focus-visible::after { outline: 3px solid var(--blue); outline-offset: -3px; border-radius: 6px; }
.c-level { position: relative; z-index: 1; }
.lvl-select { width: auto; max-width: 100%; min-height: 36px; padding: 5px 30px 5px 11px; border-radius: 999px; font-size: .82rem; font-weight: 700; background-position: right 11px center; cursor: pointer; }
.lvl-select.lvx { color: var(--muted); border-style: dashed; }
.lvl-select.lv0 { color: var(--charcoal-2); background-color: #F6F7F9; }
.lvl-select.lv1 { color: #075E7A; background-color: var(--blue-50); border-color: var(--blue-100); }
.lvl-select.lv3 { color: var(--red-700); background-color: var(--red-50); border-color: var(--red-100); }
.lvl-select.lv2, .lvl-select.lv4 { color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FFFFFF' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.lvl-select.lv2 { background-color: var(--blue-700); border-color: var(--blue-700); }
.lvl-select.lv4 { background-color: var(--red); border-color: var(--red); }
.lvl-select option { color: var(--ink); background: #fff; }
.lvl-select:disabled { opacity: .7; cursor: default; }
.lvl-select.hero-select { min-height: 40px; font-size: .9rem; }
@media (max-width: 1023px) { .st-row .lvl-select { max-width: calc(100vw - 100px); } }

/* ---------- PROFILE ---------- */
.profile-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-main { display: flex; align-items: center; gap: 16px; }
.hero-main h1 { margin-bottom: 4px; }
.hero-main, .hero-main > div { min-width: 0; }
.hero-level .lvl-select { max-width: 100%; text-overflow: ellipsis; }
.hero-level { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .hero-actions { width: 100%; } .hero-actions .btn { flex: 1 1 calc(50% - 8px); } .hero-actions .btn.primary { flex-basis: 100%; } }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 760px) { .stat-tiles { grid-template-columns: 1fr 1fr; gap: 10px; } }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-l { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.tile-l .ic { width: 14px; height: 14px; color: var(--red); }
.tile-v { font-size: 1.9rem; font-weight: 850; color: var(--charcoal); line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile-v.pos { color: var(--blue-700); } .tile-v.neg { color: var(--red-700); }
.tile-v small { font-size: .85rem; font-weight: 700; color: var(--muted); }
.tile-v.sm { font-size: 1.2rem; }
.tile-s { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .progress { flex: none; margin-top: 4px; }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .quick-row .btn { flex: 1 1 calc(50% - 8px); } }
.profile-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; align-items: start; }
.profile-grid > .col { min-width: 0; }
@media (max-width: 1023px) { .profile-grid { grid-template-columns: 1fr; gap: 0; } }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-check { display: flex; align-items: center; gap: 12px; flex: 1; cursor: pointer; min-height: 40px; }
.task-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.task-check .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: all .15s; background: #fff; }
.task-check .box .ic { width: 15px; height: 15px; color: #fff; opacity: 0; transform: scale(.5); transition: all .15s; stroke-width: 3; }
.task.done .box { background: var(--blue-700); border-color: var(--blue-700); }
.task.done .box .ic { opacity: 1; transform: none; }
.task-check input:focus-visible + .box { outline: 3px solid var(--blue); outline-offset: 2px; }
.task.done .task-text { color: var(--muted); text-decoration: line-through; }
.task-list.ro .task-check { cursor: default; }
@media (max-width: 480px) { .task > .muted.small { display: none; } }
.old-tasks { margin-top: 12px; font-size: .88rem; }
.old-tasks summary { cursor: pointer; color: var(--muted); font-weight: 650; }
.old-tasks ul { list-style: none; padding: 6px 0 0; margin: 0; }
.old-tasks li { display: flex; align-items: center; gap: 6px; padding: 3px 0; color: var(--muted); }
.old-tasks .ic { width: 14px; height: 14px; color: var(--blue-700); }
.review { padding: 4px 0; }
.review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-top .avg { margin-left: auto; font-weight: 850; font-size: 1.3rem; color: var(--charcoal); }
.review-top .avg small { font-size: .8rem; color: var(--muted); }
.ratings { display: grid; gap: 6px; margin: 10px 0; }
.rating { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 650; font-size: .92rem; }
.stars { display: inline-flex; gap: 2px; }
.star .ic { width: 18px; height: 18px; color: var(--line-2); fill: var(--line-2); stroke: none; }
.star.on .ic { color: var(--red); fill: var(--red); }
.review-comment { background: #F6F7F9; border-radius: 10px; padding: 10px 12px; font-size: .92rem; margin-top: 8px; white-space: pre-wrap; }
.row-actions { display: flex; gap: 8px; margin-top: 4px; }
.review-history { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.review-history summary { cursor: pointer; color: var(--muted); font-weight: 650; font-size: .88rem; padding: 4px 0; }
.review-history ul { list-style: none; margin: 0; padding: 0; }
.review-history li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-history li:last-child { border-bottom: 0; }
.review-history .avg { font-size: 1rem; }
.mini-sched { list-style: none; margin: 0; padding: 0; }
.mini-sched li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.mini-sched li:last-child { border-bottom: 0; }
.mini-sched li b { width: 82px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 4px 0 10px 8px; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.details { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; font-size: .9rem; border-top: 1px solid var(--line); padding-top: 12px; }
.details dt { font-weight: 700; color: var(--muted); }
.details dd { margin: 0; }

/* ---------- LOG ---------- */
.log-list { list-style: none; margin: 0 0 14px; padding: 0; }
.log-list.card { padding: 4px 0; }
.log-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.log-list.compact .log-item { padding: 9px 0; }
.log-item:last-child { border-bottom: 0; }
.log-item > .pts { margin-top: 2px; }
.log-main { flex: 1; min-width: 0; }
.log-title { font-size: .94rem; }
.log-title a { color: var(--ink); }
.log-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.log-item.deleted .log-title { text-decoration: line-through; color: var(--muted); }
.log-item.deleted > .pts { opacity: .5; }
.del-note { color: var(--red-700); font-weight: 600; }

/* ---------- NOTES ---------- */
.notes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
@media (max-width: 600px) { .notes-list { grid-template-columns: 1fr; gap: 10px; } }
.notes-list .note-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.note-item { border-left: 4px solid var(--line-2) !important; padding: 10px 12px; margin-bottom: 10px; background: #FAFBFC; border-radius: 10px; }
.notes-list .note-item { margin: 0; }
.note-item.k-feedback { border-left-color: var(--red) !important; }
.note-item.k-shift { border-left-color: var(--blue) !important; }
.note-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.note-top a { color: var(--ink); }
.kind-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; }
.kind-tag.k-feedback { background: var(--red-50); color: var(--red-700); }
.kind-tag.k-shift { background: var(--blue-50); color: #075E7A; }
.kind-tag.off { background: var(--red-50); color: var(--red-700); }
.kind-tag.add { background: var(--blue-50); color: #075E7A; }
.note-text { font-size: .94rem; white-space: normal; }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.note-foot .row-actions { margin: 0; }

/* ---------- SCHEDULE ---------- */
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 10px; }
.week-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.week-col h3 { font-size: .86rem; text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.week-col h3 span { color: var(--muted); }
.shift-chip { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--red); background: #FCFCFD; font-size: .88rem; transition: background .12s, border-color .12s; }
.shift-chip.hoo { border-left-color: var(--blue); }
.shift-chip span { color: var(--muted); font-size: .8rem; }
.shift-chip em { font-style: normal; font-size: .76rem; color: var(--blue-700); font-weight: 650; }
.none { padding: 6px 2px; }
.plain-list { list-style: none; padding: 4px 0; margin: 0 0 14px; }
.ov-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ov-item:last-child { border-bottom: 0; }
.ov-date { width: 100px; }
.ov-item a { color: var(--ink); }
.steps { padding: 6px 16px; }
.step { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step h3 { font-size: 1rem; margin-bottom: 4px; }
.step > div { min-width: 0; flex: 1; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--charcoal); color: #fff; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.file-drop { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 18px; border: 2px dashed var(--line-2); border-radius: 12px; background: #FAFBFC; color: var(--charcoal-2); font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.file-drop .ic { width: 24px; height: 24px; color: var(--blue-700); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: .9rem; margin-bottom: 12px; }
.callout.warn { background: var(--amber-50); border: 1px solid #F6D9A8; color: #6B3A06; }
.callout .ic { color: var(--amber); margin-top: 1px; }
.radio-set { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.radio-set legend { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 4px; }
.radio-set label:not(.field) { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.radio-set input[type=radio] { width: 18px; height: 18px; accent-color: var(--red); }
.radio-set .field.inline { flex-direction: row; align-items: center; gap: 10px; }
.radio-set .field.inline input { width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 420px; overflow-y: auto; }
table.preview { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.preview th { position: sticky; top: 0; background: #F6F7F9; text-align: left; padding: 8px 10px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.preview td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.preview tr.row-err td { background: #FFF7F8; }
.st { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .78rem; white-space: normal; }
.st .ic { width: 14px; height: 14px; }
.st.ok { color: var(--blue-700); } .st.warn { color: var(--amber); } .st.err { color: var(--red-700); }

/* ---------- SETTINGS ---------- */
.settings-grid { columns: 2; column-gap: 14px; }
.settings-grid > .card { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 14px; }
@media (max-width: 899px) { .settings-grid { columns: 1; } .settings-grid > .card { margin-bottom: 10px; } }
.settings-grid .card > p.muted { margin-bottom: 8px; }
.ms-table { display: flex; flex-direction: column; gap: 4px; }
.ms-row { display: flex; gap: 10px; align-items: flex-end; }
.ms-row .field { margin-bottom: 6px; }
.ms-row .field:first-child { flex: 0 0 96px; }
.ms-row .icon-btn { margin-bottom: 8px; }
.backup-status { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; padding: 8px 12px; border-radius: 10px; margin: 6px 0; }
.backup-status.warn { background: var(--amber-50); color: #6B3A06; }
.backup-status.warn .ic { color: var(--amber); }
.backup-status.ok { background: var(--blue-50); color: #075E7A; }
.ref-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ref-table td { padding: 7px 0; border-bottom: 1px solid var(--line); }
.ref-table td:last-child { text-align: right; }
.levels-ref { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.danger-zone { border-color: var(--red-100); }
.foot-note { margin-top: 18px; }

/* ---------- STAFF VIEW PREVIEW ---------- */
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--charcoal); color: #fff; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; border-left: 5px solid var(--blue); }
.pv-left { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.pv-left .ic { color: var(--blue); }
.pv-right { display: flex; gap: 8px; align-items: center; }
.pv-right select { color: var(--ink); min-height: 38px; padding: 6px 32px 6px 10px; width: auto; font-size: 16px; }
.pv-wrap { max-width: 1040px; margin: 0 auto; }
.pv-hello { display: flex; align-items: center; gap: 16px; }
.pv-hello .tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }

/* hover styles only on devices that really hover (no sticky highlights after a tap) */
@media (hover: hover) {
  a:hover { text-decoration: underline; }
  .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
  .by-chip:hover { background: rgba(255,255,255,.15); }
  .btn.primary:hover:not(:disabled) { background: var(--red-600); }
  .btn.danger:hover:not(:disabled) { background: #861A26; }
  .btn.ghost:hover:not(:disabled) { border-color: var(--charcoal); background: #FAFBFC; }
  .btn.on-head:hover { background: #fff; }
  .btn.ghost.danger-text:hover { border-color: var(--red-700); background: var(--red-50); }
  .icon-btn:hover { background: #EEF1F4; color: var(--charcoal); }
  .link-btn:hover { text-decoration: underline; }
  .seg-btn:hover { color: var(--charcoal); }
  .shift-name:hover b { text-decoration: underline; }
  .sb:hover { border-color: var(--charcoal); }
  .sheet-btn:hover { border-color: var(--charcoal); background: #FAFBFC; }
  .pick-item:hover { border-color: var(--blue-700); background: var(--blue-50); }
  .toast-btn:hover { background: rgba(255,255,255,.08); }
  .st-row:not(.st-head):hover { background: #F8FAFB; }
  .cl-toggle:hover .cl-title { text-decoration: underline; }
  .tpl-tab:not(.top):not(.on):hover { border-color: var(--charcoal); }
  .g-check:hover .box { border-color: var(--blue-700); }
  .shift-chip:hover { background: #F3F5F7; border-color: var(--line-2); }
  .file-drop:hover { border-color: var(--blue-700); background: var(--blue-50); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .topbar, .nav, .toast, .score-btns, .btn, .icon-btn { display: none !important; } body { background: #fff; padding: 0; } .card, .school-card { box-shadow: none; break-inside: avoid; } }

/* ---------- next level requirements ---------- */
.next-level .blurb { margin: 0 0 12px; color: var(--charcoal-2); font-style: italic; border-left: 3px solid var(--blue); padding: 2px 0 2px 10px; font-size: .92rem; }
.req-grid { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; margin: 0; font-size: .92rem; }
.req-grid dt { font-weight: 800; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; padding-top: 3px; }
.req-grid dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.req-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 750; padding: 3px 9px; border-radius: 999px; }
.req-chip .ic { width: 13px; height: 13px; }
.req-chip.ok { background: var(--blue-50); color: #075E7A; }
.req-chip.warn { background: var(--amber-50); color: var(--amber); }
.req-chip.na { background: #EEF1F4; color: var(--charcoal-2); }
.time-counter { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.time-counter .tc-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.time-counter .progress { width: 100%; max-width: 340px; }
@media (max-width: 420px) { .req-grid { grid-template-columns: 1fr; gap: 2px; } .req-grid dd { margin-bottom: 8px; } }

/* ---------- level checklist ---------- */
.sheet-overview { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--charcoal-2); background: #F6F7F9; border-radius: 10px; padding: 8px 10px; margin: 0 0 12px; }
.sheet-overview .ic, .sync-note .ic, .tpl-foot .ic { width: 16px; height: 16px; color: var(--blue-700); flex: none; margin-top: 2px; }
.cl-bulk { display: flex; justify-content: flex-end; margin: -6px 0 2px; }
.cl-groups { list-style: none; margin: 0 0 10px; padding: 0; }
.cl-group { border-bottom: 1px solid var(--line); padding: 6px 0 8px; }
.cl-group:last-child { border-bottom: 0; }
.cl-head { display: flex; align-items: center; gap: 8px; }
.g-check { background: none; border: 0; padding: 8px; margin: -8px -4px -8px -8px; display: inline-flex; flex: none; cursor: pointer; border-radius: 9px; }
span.g-check { cursor: default; }
.box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: all .15s; background: #fff; position: relative; }
.box .ic { width: 15px; height: 15px; color: #fff; opacity: 0; transform: scale(.5); transition: all .15s; stroke-width: 3; }
.box .dash { position: absolute; width: 10px; height: 3px; border-radius: 2px; background: var(--blue-700); opacity: 0; }
.g-check[data-state="true"] .box { background: var(--blue-700); border-color: var(--blue-700); }
.g-check[data-state="true"] .box .ic { opacity: 1; transform: none; }
.g-check[data-state="mixed"] .box { border-color: var(--blue-700); }
.g-check[data-state="mixed"] .box .dash { opacity: 1; }
.g-check:focus-visible { outline: 3px solid var(--blue); outline-offset: 0; }
.cl-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 6px 0; text-align: left; cursor: pointer; min-height: 40px; color: var(--ink); }
.cl-toggle.static { cursor: default; }
.cl-title { font-weight: 750; color: var(--charcoal); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cl-toggle > .cl-title { flex: 0 1 auto; }
.cl-sum { flex: 1; min-width: 0; }
.cl-preview { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-group.done .cl-title { color: var(--muted); }
.cl-count { font-size: .78rem; font-weight: 800; color: var(--charcoal-2); background: #EEF1F4; border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; flex: none; }
.cl-group.done .cl-count { background: var(--blue-50); color: #075E7A; }
.cl-toggle .chev { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform .15s; }
.cl-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.cl-tools { display: flex; flex: none; }
.cl-bar { height: 4px; background: #EEF1F4; border-radius: 4px; margin: 2px 0 0 36px; overflow: hidden; }
.cl-bar span { display: block; height: 100%; background: var(--blue-700); border-radius: 4px; transition: width .3s; }
.cl-subs { list-style: none; margin: 6px 0 0 36px; padding: 0; }
.cl-subs .task { padding: 2px 0; border-bottom: 0; }
.cl-subs .task-check { min-height: 38px; gap: 10px; }
.cl-subs .task-text { font-size: .93rem; }
.task.done .box { background: var(--blue-700); border-color: var(--blue-700); }
.task.done .box .ic { opacity: 1; transform: none; }
.sync-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--blue-50); border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; font-size: .86rem; color: var(--charcoal-2); }
.sync-note span { flex: 1 1 200px; }
.sheet-note { margin: 0 0 10px; }
.old-tasks h5 { margin: 10px 0 2px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--charcoal-2); }
.old-tasks li .ic { color: var(--muted); }
.old-tasks li.ok .ic { color: var(--blue-700); }
.old-tasks li span:first-of-type { flex: 1; }
.warn-list { display: block; margin: 10px 0; padding: 8px 10px; border-radius: 8px; background: var(--amber-50); color: var(--amber); }
.warn-list > span { display: block; padding: 2px 0; }
.warn-list b { color: var(--amber); }
@media (max-width: 480px) {
  .cl-subs, .cl-bar { margin-left: 30px; }
  .cl-tools .icon-btn { width: 34px; }
  .cl-preview { display: none; }
}
.levels-ref li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

/* ---------- checklist template editor ---------- */
.tpl-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.tpl-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; cursor: pointer; min-height: 44px; color: var(--ink); }
.tpl-tab .tt-num { font-size: .7rem; font-weight: 800; color: var(--red-700); letter-spacing: .06em; }
.tpl-tab .tt-name { font-weight: 800; color: var(--charcoal); font-size: .9rem; line-height: 1.2; }
.tpl-tab .tt-count { font-size: .76rem; color: var(--muted); }
.tpl-tab.on { background: var(--charcoal); border-color: var(--charcoal); }
.tpl-tab.on .tt-name, .tpl-tab.on .tt-count { color: #fff; }
.tpl-tab.on .tt-num { color: var(--blue); }
.tpl-tab.top { cursor: default; background: #F6F7F9; border-style: dashed; }
@media (max-width: 899px) { .tpl-tabs { grid-template-columns: 1fr 1fr; } .tpl-tab.top { grid-column: 1 / -1; } }
.tpl-card .card-head { flex-wrap: wrap; gap: 8px; }
.tpl-card .card-head .btn-row { margin-left: auto; }
.ic.flip { transform: rotate(180deg); }
.tpl-info { font-size: .9rem; background: #F6F7F9; border-radius: 10px; padding: 4px 12px; margin-bottom: 10px; }
.tpl-info p { margin: 8px 0; }
.tpl-list { list-style: none; margin: 0; padding: 0; }
.tpl-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tpl-item:last-child { border-bottom: 0; }
.tpl-num { width: 26px; height: 26px; border-radius: 50%; background: var(--red-50); color: var(--red-700); font-weight: 800; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tpl-body { flex: 1; min-width: 0; }
.tpl-body b { color: var(--charcoal); }
.tpl-lines { margin: 4px 0 0; padding-left: 18px; color: var(--charcoal-2); font-size: .88rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 28px; }
.tpl-tools { display: flex; flex: none; }
.tpl-tools .icon-btn:disabled { opacity: .35; cursor: default; }
@media (max-width: 480px) { .tpl-item { flex-wrap: wrap; } .tpl-tools { width: 100%; justify-content: flex-end; margin-top: -4px; } }
.tpl-foot { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; }

/* ===================== Cloud edition: sign-in, sync status ===================== */
body.auth-mode .topbar .nav, body.auth-mode .by-chip, body.auth-mode .sync-pill, body.auth-mode .net-banner { display: none !important; }
body.auth-mode .topbar { display: none; }
body.auth-mode { background: linear-gradient(160deg, #fff 0%, var(--blue-50) 55%, var(--red-50) 100%); min-height: 100vh; }
.auth-wrap { min-height: calc(100vh - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px 26px 22px; border-top: 6px solid var(--red); position: relative; }
.auth-card::before { content: ""; position: absolute; top: -6px; right: 0; width: 50%; height: 6px; background: var(--blue); border-top-right-radius: 18px; }
.auth-card.wide { max-width: 520px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand b { display: block; font-size: 1.15rem; color: var(--charcoal); }
.auth-brand small { color: var(--muted); font-size: .85rem; }
.auth-card h1 { font-size: 1.35rem; margin-bottom: 4px; }
.auth-lead { color: var(--muted); margin-bottom: 14px; font-size: .92rem; }
.auth-card .field { margin-bottom: 12px; }
.auth-card .btn.block { width: 100%; justify-content: center; min-height: 46px; font-size: 1rem; margin-top: 4px; }
.auth-links { display: flex; justify-content: center; margin-top: 12px; }
.auth-links .link-btn { color: var(--blue-700); font-weight: 600; }
.auth-note { margin-top: 14px; color: var(--muted); font-size: .8rem; text-align: center; }
.auth-foot { margin-top: 16px; color: var(--muted); font-size: .8rem; text-align: center; }
.auth-msg { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: .88rem; margin-bottom: 12px; }
.auth-msg .ic { flex: none; margin-top: 2px; }
.auth-msg.err { background: var(--red-50); color: var(--red-700); border: 1px solid var(--red-100); }
.auth-msg.ok { background: var(--blue-50); color: #065A76; border: 1px solid var(--blue-100); }
.auth-msg.info { background: var(--blue-50); color: var(--ink); border: 1px solid var(--blue-100); }
.auth-msg code { background: rgba(0,0,0,.05); padding: 0 4px; border-radius: 4px; }
.auth-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px 0 8px; justify-content: center; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid rgba(255,255,255,.22); color: #fff; margin-left: auto; min-height: 30px; }
.sync-pill .ic { width: 15px; height: 15px; }
.sync-pill.ok .ic { color: var(--blue); }
.sync-pill.busy { color: #fff; }
.sync-pill.busy .ic { color: var(--blue); }
.sync-pill.off { background: #fff; color: var(--red-700); border-color: #fff; }
.sync-pill.err { background: var(--red); border-color: var(--red); color: #fff; }
.sync-pill + .by-chip { margin-left: 8px; }
@media (max-width: 899px) { .sync-pill span { display: none; } .sync-pill { padding: 5px 7px; } .sync-pill.off span, .sync-pill.err span { display: inline; } }
.net-banner { position: sticky; top: 63px; z-index: 29; }
.net-banner.off { background: var(--red-50); color: var(--red-700); border-bottom: 1px solid var(--red-100); }
.net-banner.err { background: var(--red); color: #fff; }
.nb-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: .88rem; }
.nb-inner > span { flex: 1; }
.nb-inner .ic { flex: none; }
.btn.on-banner { background: #fff; color: var(--red-700); border: 1px solid var(--red-100); }
.net-banner.err .btn.on-banner { color: var(--red-700); border-color: #fff; }
@media (max-width: 899px) { .net-banner { top: 57px; } .nb-inner { padding: 8px 12px; font-size: .82rem; } }
.sheet-grid.one { grid-template-columns: 1fr; }
.acct-sync { margin-top: 12px; }
.ro-tag { background: var(--blue-50); color: var(--blue-700); }
.lb-name { font-weight: 600; color: var(--charcoal); }
.users-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.users-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.users-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.users-table select { max-width: 220px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; }
.steps-ol { padding-left: 20px; margin: 10px 0; }
.steps-ol li { margin-bottom: 4px; }
.sync-failures { font-size: .82rem; margin-top: 8px; }
.sync-failures ul { margin: 6px 0 0; padding-left: 18px; color: var(--red-700); }
.ms-ro td { padding: 6px 0; }
@media (max-width: 899px) { .sync-pill + .by-chip { margin-left: 2px; } .by-chip { max-width: 32vw; } }
@media (max-width: 380px) { .by-chip { max-width: 28vw; } }
