/* vle-quiz-admin — QuizVerse's admin side inside the VLE (29 Oct 2026): overview, search, weekly reports, parents,
   settings and the Email results sheet. On the page these sit on the VLE's dark canvas and use its tokens (--vtext,
   --vmuted, --vhair, --vbg2…, which the ERP's skin re-themes); the sheets mount in #modal-root on the app's own theme
   (--text, --line, --fill…). Everything is prefixed qa-. */

/* ---------------- the hub ---------------- */
.qa-pills { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; padding-bottom: 2px; }
.qa-pills::-webkit-scrollbar { display: none; }
.qa-pills a.vle-pill { text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; }
.vle-root .qa-pills a.vle-pill.on { color: #140A30; }
.qa-note { font-size: 13px; line-height: 1.55; margin: 0 0 12px; color: var(--vmuted); }
.qa-note b { color: var(--vtext); }
.qa-dim { color: var(--vdim); }
.qa-bad { color: #FF8FB0; }
.qa-mode { display: inline-flex; align-items: center; gap: 6px; }
.qa-mode.is-live { color: #F6C35A; font-weight: 700; }
.qa-mode svg { flex: none; }
.qa-actions { flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.qa-entry { text-decoration: none; }

/* filters */
.qa-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.qa-filterbar .qa-dim { font-size: 12px; }
.qa-week { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--vmuted); }
.qa-week input { width: 76px; }
.qa-q { flex: 1 1 200px; min-width: 0; }
.vle-root .qv-campus-pick { color: var(--vtext); }
.qa-chip { appearance: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--vhair); background: var(--vbg2); color: var(--vmuted);
  font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.qa-chip:hover { color: var(--vtext); border-color: rgba(var(--vaccent-rgb), .45); }
.qa-chip.is-on { background: rgba(var(--vaccent-rgb), .18); border-color: rgba(var(--vaccent-rgb), .55); color: var(--vtext); }
.qa-chip svg { width: 12px; height: 12px; }

/* tiles: a third line for context, and tiles that filter the list */
.qa-tile-sub { display: block; font-style: normal; font-size: 11.5px; color: var(--vdim); margin-top: 4px; line-height: 1.35; }
.cw-tile b small { font-size: 15px; font-weight: 700; color: var(--vmuted); }
.qa-tile-btn { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s; }
.qa-tile-btn:disabled { cursor: default; }
.qa-tile-btn:not(:disabled):hover { border-color: rgba(var(--vaccent-rgb), .45); }
.qa-tile-btn.is-on { border-color: var(--vgold); box-shadow: inset 0 0 0 1px var(--vgold); }

/* hand-ins per day */
.qa-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; padding-bottom: 22px; }
.qa-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.qa-bar i { display: block; width: 100%; max-width: 30px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--vgold), rgba(var(--vaccent-rgb), .45)); }
.qa-bar span { position: absolute; top: -2px; font-size: 11px; font-weight: 800; color: var(--vmuted); transform: translateY(-100%); }
.qa-bar em { position: absolute; bottom: -20px; font-style: normal; font-size: 10.5px; color: var(--vdim); white-space: nowrap; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 22px; }
.qa-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.qa-feed li { padding: 9px 12px; border-radius: 10px; background: var(--vbg2); border: 1px solid var(--vhair); line-height: 1.45; overflow-wrap: anywhere; }
.qa-feed time { display: block; font-size: 11.5px; color: var(--vdim); margin-top: 2px; }

/* search */
.qa-searchbar { display: flex; align-items: center; gap: 10px; background: var(--vbg2); border: 1px solid var(--vhair); border-radius: 14px; padding: 4px 14px; margin-bottom: 22px; }
.qa-searchbar:focus-within { border-color: rgba(var(--vaccent-rgb), .6); }
.qa-searchbar svg { width: 18px; height: 18px; color: var(--vmuted); flex: none; }
.qa-searchbar input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--vtext); font: inherit; font-size: 15px; padding: 10px 0; }
.qa-searchbar input::-webkit-search-cancel-button { filter: invert(1); }
.qa-row-btn { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }

/* reports */
.qa-rep-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.qa-rep-head h2 { font-size: 20px; font-weight: 800; margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qa-rep-head .qa-dim { font-size: 13px; }
.qa-back2 { margin-top: -4px; }
.mk-row.qa-static { cursor: default; }
.mk-row.qa-rep { text-decoration: none; }
.mk-name .qa-bad { font-size: 11.5px; }
.qa-parent { color: var(--vmuted); }
.qa-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--vmuted); flex-wrap: wrap; }
.qa-pager .st-btn:disabled { opacity: .4; cursor: default; transform: none; }
.qa-banner { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px;
  background: rgba(var(--vaccent-rgb), .12); border: 1px solid rgba(var(--vaccent-rgb), .3); color: var(--vtext); }
.qa-banner svg { flex: none; margin-top: 2px; }
.qa-banner > span { min-width: 0; }
.qa-banner.is-live { background: rgba(246, 195, 90, .12); border-color: rgba(246, 195, 90, .4); }
.qa-banner.is-warn { background: rgba(255, 143, 176, .1); border-color: rgba(255, 143, 176, .35); }

/* whose copy */
.qa-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--vbg2); border: 1px solid var(--vhair); gap: 2px; }
.qa-seg button { appearance: none; border: 0; background: none; color: var(--vmuted); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.qa-seg button.on { background: var(--vgold); color: #140A30; }
/* an email as it arrives: always on its own light page */
.qa-mail { display: block; width: 100%; height: 760px; border: 0; border-radius: 12px; background: #f3f4f6; }

/* settings */
.qa-set { background: var(--vbg2); border: 1px solid var(--vhair); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; }
.qa-set-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.qa-set-head h2 { font-size: 17px; font-weight: 800; margin: 0; }
.qa-kv { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.qa-kv dt { color: var(--vmuted); }
.qa-kv dd { margin: 0; color: var(--vtext); overflow-wrap: anywhere; }

/* ---------------- sheets (in #modal-root, on the app's theme) ---------------- */
#modal-root .qa-sheet { display: flex; flex-direction: column; gap: 12px; }
#modal-root .qa-sub { font-size: 13px; line-height: 1.55; color: var(--text-2); margin: 0 0 10px; overflow-wrap: anywhere; }
#modal-root .qa-sheet .qa-sub { margin: 0; }
#modal-root .qa-dim { color: var(--text-3); }
#modal-root .qa-bad { color: var(--danger); }
#modal-root .qa-mode.is-live { color: var(--gold-700, #8a5a00); }
#modal-root .qa-h4 { font-size: 13px; font-weight: 800; margin: 6px 0 0; color: var(--text); }
#modal-root .qa-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); margin-bottom: 10px; font-size: 13px; }
#modal-root .qa-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
#modal-root .qa-banner { background: var(--info-tint); border-color: transparent; color: var(--text); }
#modal-root .qa-banner.is-live { background: var(--warning-tint); }
#modal-root .qa-banner.is-warn { background: var(--danger-tint); }
#modal-root .qa-kv { grid-template-columns: minmax(150px, 45%) 1fr; font-size: 13px; }
#modal-root .qa-kv dt { color: var(--text-3); }
#modal-root .qa-kv dd { color: var(--text); }
#modal-root .qa-feed li { background: var(--surface-2); border-color: var(--line); color: var(--text); }
#modal-root .qa-feed time { color: var(--text-3); }
#modal-root .qa-seg { background: var(--fill); border-color: var(--line); }
#modal-root .qa-seg button { color: var(--text-2); }
#modal-root .qa-seg button.on { background: var(--accent); color: var(--on-accent, #fff); }
#modal-root .qa-chip { background: var(--card); border-color: var(--line); color: var(--text-2); }
#modal-root .qa-chip.is-on { background: var(--accent-tint); border-color: var(--accent); color: var(--text); }
#modal-root .qa-mail { height: 62vh; min-height: 360px; margin-top: 8px; }
.qa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.qa-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--fill); }
.qa-list a { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: var(--text); }
.qa-list a b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-list a span { font-size: 12px; color: var(--text-3); }
.qa-li-end { font-size: 12.5px; font-weight: 800; white-space: nowrap; color: var(--text-2); }
.qa-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.qa-pv-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.qa-select { flex: 1 1 220px; width: 100%; max-width: 100%; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 13px; }
.qa-skips { margin: 8px 0 0; padding-left: 18px; max-height: 180px; overflow-y: auto; color: var(--text-2); }
.qa-starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.qa-starts label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.qa-bands { display: grid; grid-template-columns: 90px 1fr; gap: 6px 8px; }

/* ---------------- phones ---------------- */
@media (max-width: 640px) {
  .qa-bars { gap: 3px; height: 120px; }
  .qa-bar em { font-size: 9px; transform: rotate(-35deg); transform-origin: top center; bottom: -16px; }
  .qa-bar:nth-child(even) em { display: none; }
  .qa-kv { grid-template-columns: 1fr; gap: 2px 0; }
  #modal-root .qa-kv { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 6px 12px; }
  .qa-kv dd { margin-bottom: 8px; }
  .qa-set { padding: 14px; }
  .qa-mail { height: 70vh; }
  .qa-rep-head h2 { font-size: 18px; }
  .qa-q { flex-basis: 100%; }
  /* list rows: the name with its status beside it, the figures (or the parent) underneath, no chevron */
  .mk-row.qa-rep, .mk-row.qa-prow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name flags" "more more"; gap: 6px 10px; }
  .mk-row.qa-rep > .mk-name:first-child, .mk-row.qa-prow > .mk-name:first-child { grid-area: name; }
  .mk-row.qa-rep .mk-flags, .mk-row.qa-prow .mk-flags { grid-area: flags; align-self: start; }
  .mk-row.qa-rep .mk-mark, .mk-row.qa-prow .qa-parent { grid-area: more; justify-self: start; }
  .mk-row.qa-rep .cw-go, .mk-row.qa-prow .cw-go { display: none; }
  .qa-status-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .qa-status-tiles .cw-tile { padding: 10px 12px; }
  .qa-status-tiles .cw-tile b { font-size: 20px; }
  .qa-status-tiles .cw-tile span { font-size: 11px; }
}
.qa-link { color: var(--vgold); font-weight: 700; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .qa-tile-btn, .qa-chip { transition: none; } }
