@import url("fonts.e6c43ac6528c.css");
/* Academy Portal — module styles (materials viewer, exams, evaluations, activities, reports). */
.brand-name { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.brand-upload { height: 40px; max-width: 200px; object-fit: contain; }
.guest-hero .brand-name { color: #fff; font-size: 1.4rem; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flash.info { background: var(--info-soft); color: var(--blue); }
.col-5 { grid-column: span 12; } .col-7 { grid-column: span 12; }
@media (min-width: 1100px) { .col-5 { grid-column: span 5; } .col-7 { grid-column: span 7; } }
.stats.six { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stats.six { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1300px) { .stats.six { grid-template-columns: repeat(6, 1fr); } }
.stat .value.small { font-size: 1.15rem; }
.todo { display: flex; flex-wrap: wrap; gap: 10px; }
.list-row { padding: 9px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.list-row:last-child { border-bottom: 0; }
.list-row.me { background: var(--info-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.scroll-list { max-height: 520px; overflow: auto; padding-right: 4px; }
a.card.tile { text-decoration: none; color: inherit; transition: transform .1s, box-shadow .15s; display: block; }
a.card.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -14px rgba(11,11,18,.3); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters > div { min-width: 160px; flex: 1; }
.filters > div:last-child { flex: 0 0 auto; min-width: 0; }
.form.inline, form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--paper); }
.prewrap { white-space: pre-line; }
.strong { font-weight: 700; }
.qprompt { margin: 6px 0 10px; }
.mt-s { margin-top: 8px; }
.code, .code-input { letter-spacing: .06em; font-weight: 700; text-transform: uppercase; }
.value-lg { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; border-radius: 8px 8px 0 0; font-weight: 700; color: var(--muted); text-decoration: none; }
.tabs a.active { color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; }
.quote { font-style: italic; color: var(--text); border-left: 3px solid var(--line); padding-left: 10px; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 6px; }

/* Charts */
.vbars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; height: 190px; }
.vbar { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.vbar-track { flex: 1; width: 100%; max-width: 46px; background: var(--paper); border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.vbar-fill { width: 100%; background: var(--blue); border-radius: 8px 8px 0 0; min-height: 2px; }
.vbar-val { font-size: .78rem; font-weight: 700; }
.vbar-label { font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* Calendar */
.week { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, 1fr); } }
.week .day h3 { margin: 0 0 8px; font-size: .9rem; }
.week .ev { display: block; padding: 8px; border-radius: 8px; background: var(--info-soft); margin-bottom: 6px; font-size: .84rem; color: var(--text); text-decoration: none; }
.week .ev small { display: block; color: var(--muted); }
.week .ev.cancelled { background: var(--bad-soft); text-decoration: line-through; }

/* Viewer */
.viewer-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.viewer-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.viewer-page { max-width: 100%; background: #fff; box-shadow: var(--shadow); border-radius: 4px; }
.viewer-status { text-align: center; color: var(--muted); padding: 8px; }
.viewer-status.bad { color: var(--bad); }
.viewer-doc { position: relative; background: #fff; color: #111; padding: 40px; max-width: 860px; width: 100%; border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; line-height: 1.6; }
.viewer-doc img { max-width: 100%; height: auto; }
.viewer-doc table { border-collapse: collapse; } .viewer-doc td, .viewer-doc th { border: 1px solid #ccc; padding: 4px 8px; }
.viewer-mark { position: absolute; inset: -50%; transform: rotate(-30deg); color: rgba(29, 78, 216, .12); font-size: 15px; line-height: 6em; word-spacing: 2em; pointer-events: none; overflow: hidden; }
@media print { .viewer-wrap { display: none !important; } }

/* Exams */
.qrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opts { margin: 6px 0 0 18px; padding: 0; } .opts li.correct { color: var(--ok); font-weight: 700; } .opts li.correct::after { content: " ✓"; }
.choices { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--info-soft); }
.timer { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.timer.small { font-size: 1rem; padding: 2px 10px; }
.timer.warn { color: var(--warn); } .timer.bad { color: #fff; background: var(--bad); }
.page-head.sticky { position: sticky; top: 0; z-index: 5; background: var(--paper); padding-top: 8px; }
.score-box { text-align: center; } .score-box .value { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; }

/* Evaluations */
.rating { border: 0; padding: 8px 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.rating legend { float: left; width: 220px; font-weight: 700; padding: 0; }
.rating label { position: relative; }
.rating input { position: absolute; opacity: 0; }
.rating span { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); font-weight: 800; cursor: pointer; }
.rating input:checked + span { background: var(--blue); color: #fff; border-color: var(--blue); }
.rating input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.evalbox { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.evalbox summary { cursor: pointer; }

/* Activities */
.game { min-height: 260px; }
.flashcard { display: grid; place-items: center; width: 100%; min-height: 200px; font-size: 1.6rem; font-weight: 800; border-radius: 16px; border: 2px dashed var(--line); background: var(--card); color: var(--ink); cursor: pointer; margin: 10px 0; padding: 20px; }
.flashcard.back { background: var(--info-soft); border-style: solid; border-color: var(--blue); }
.quiz-options { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .quiz-options { grid-template-columns: 1fr 1fr; } }
.quiz-opt { width: 100%; justify-content: flex-start; padding: 16px; font-size: 1rem; white-space: normal; text-align: left; margin-bottom: 8px; }
.match-row, .gap-row, .order-row, .review-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.match-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.gap { display: inline-block; width: 140px; margin: 0 6px; }
.built { min-height: 44px; border: 2px dashed var(--line); border-radius: 10px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bank { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; }
.built .chipbtn { background: var(--info-soft); border-color: var(--blue); }
.key { color: var(--ok); font-weight: 700; font-size: .9rem; margin-top: 4px; }
.game-result { text-align: center; padding: 14px; margin-bottom: 14px; border-radius: 12px; background: var(--paper); }
.game-result .big { font-size: 2.2rem; font-weight: 800; color: var(--blue); }
.pollrow { margin: 10px 0; } .pollrow.mine span { font-weight: 800; }

/* Payments */
.paymethods { display: grid; gap: 8px; }
.paymethod { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.paymethod small { display: block; color: var(--muted); }
.paymethod:has(input:checked) { border-color: var(--blue); background: var(--info-soft); }

/* Reports */
tr.risk td { background: var(--bad-soft); }
.register th, .register td { text-align: center; padding: 6px 4px; font-size: .82rem; }
.register td:first-child, .register th:first-child { text-align: left; white-space: nowrap; }
.cell.P { color: var(--ok); font-weight: 800; } .cell.L { color: var(--warn); font-weight: 800; } .cell.A { color: #fff; background: var(--bad); font-weight: 800; } .cell.E { color: var(--blue); }
.tl-row { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tl-kind { display: inline-block; min-width: 76px; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: var(--muted); }
.tl-kind.exam { color: var(--blue); } .tl-kind.payment { color: var(--ok); } .tl-kind.attendance { color: var(--warn); }

/* Wall */
.post .reply { margin: 8px 0 0 18px; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--paper); border-radius: 0 10px 10px 0; }
@media print { .sidebar, .topbar, .page-head .actions, .print-bar { display: none !important; } }
.progress-track i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }

/* Language switch */
.langswitch { display: inline-flex; margin: 0 6px; }
.iconbtn.lang { font-weight: 800; font-size: .85rem; }
.guest-lang { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* Right-to-left (Arabic) */
[dir="rtl"] body { font-family: var(--font); }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .nav-open .sidebar { left: auto; right: 0; }
[dir="rtl"] .nav .count, [dir="rtl"] .userbox form { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pill { right: auto; left: -6px; }
[dir="rtl"] .table th, [dir="rtl"] .quiz-opt, [dir="rtl"] .register td:first-child, [dir="rtl"] .register th:first-child { text-align: right; }
[dir="rtl"] .table .num, [dir="rtl"] .hbar .num { text-align: left; }
[dir="rtl"] .legend i { margin-right: 0; margin-left: 5px; }
[dir="rtl"] .notif.unread .title::after { margin-left: 0; margin-right: 8px; }
[dir="rtl"] .seg span { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .seg label:last-child span { border-left: 0; }
[dir="rtl"] .ev.cancelled, [dir="rtl"] .ev.moved { border-left-color: transparent; }
[dir="rtl"] .quote { border-left: 0; padding-left: 0; border-right: 3px solid var(--line); padding-right: 10px; }
[dir="rtl"] .rating legend { float: right; }
[dir="rtl"] .post .reply { margin: 8px 18px 0 0; border-left: 0; border-right: 3px solid var(--line); border-radius: 10px 0 0 10px; }
[dir="rtl"] .scroll-list { padding-right: 0; padding-left: 4px; }
[dir="rtl"] .doc-title { text-align: left; }
[dir="rtl"] .opts { margin: 6px 18px 0 0; }
[dir="rtl"] .stat .label, [dir="rtl"] .table th, [dir="rtl"] .eyebrow, [dir="rtl"] .sep, [dir="rtl"] .kv .k { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .code, [dir="rtl"] .code-input, [dir="rtl"] .timer, [dir="rtl"] .tabular, [dir="rtl"] input[type="email"], [dir="rtl"] .qr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .viewer-wrap, [dir="rtl"] .viewer-doc { direction: ltr; }
[dir="rtl"] .viewer-doc p, [dir="rtl"] .viewer-doc li, [dir="rtl"] .viewer-doc td { unicode-bidi: plaintext; }
[dir="rtl"] .skip { left: auto; right: -999px; } [dir="rtl"] .skip:focus { right: 8px; }
[dir="rtl"] .hp { left: auto; right: -9999px; }

/* ERP additions */
.qimg { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 6px 0 10px; border: 1px solid var(--line); }
.match { display: grid; gap: 8px; }
.match-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
details > summary { cursor: pointer; }
.topsearch { flex: 0 1 320px; }
.topsearch input { width: 100%; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); }
.bad { color: var(--bad); } .ok { color: var(--ok); }
.flash.ok { background: var(--ok-soft); color: var(--ok); } .flash.bad { background: var(--bad-soft); color: var(--bad); }
a.stat { display:block; text-decoration:none; color:inherit; }

/* Attendance colour map: green present · amber late · red absent · blue excused · grey not recorded */
.att { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; font-weight: 800; font-size: .8rem; }
.att.present { background: #16a34a; color: #fff; }
.att.late { background: #f59e0b; color: #fff; }
.att.absent { background: #dc2626; color: #fff; }
.att.excused { background: #2563eb; color: #fff; }
.att.none { background: #e5e7eb; color: #6b7280; }
.att.future { background: transparent; }
.att-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .85rem; }
.att-legend .att { min-width: 22px; height: 22px; }
.register .rate.ok { color: #16a34a; } .register .rate.bad { color: #dc2626; }
.att-take th .att { padding: 0 10px; }
.att-take td.pick { text-align: center; }
.att-take tr:has(input[value="present"]:checked) { background: #dcfce7; }
.att-take tr:has(input[value="late"]:checked) { background: #fef3c7; }
.att-take tr:has(input[value="absent"]:checked) { background: #fee2e2; }
.att-take tr:has(input[value="excused"]:checked) { background: #dbeafe; }
@media print { .att { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.qtools { flex-wrap: nowrap; }
details.qedit { margin: 0 0 12px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; }
details.qedit summary { color: var(--blue); font-weight: 700; }
.results-list .list-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
/* Student file header with photo */
.sf-head { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.sf-photo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sf-photo img { width: 132px; height: 132px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); }
.avatar.xl { width: 132px; height: 132px; border-radius: 16px; font-size: 2.6rem; display: inline-flex; align-items: center; justify-content: center; }
.sf-photo-form { display: flex; gap: 6px; }
.sf-info { flex: 1; min-width: 260px; }
.sf-info h1 { margin: 0 0 6px; }
img.avatar.photo { object-fit: cover; padding: 0; }
a.person { text-decoration: none; color: inherit; }
.unlock-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .unlock-grid { grid-template-columns: repeat(2, 1fr); } }
.unlock-grid form { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }

/* ===== Sidebar sections: students / academic / administrative ===== */
.sidebar .nav { gap: 10px; }
.sidebar .nav a { font-size: .9rem; padding: 7px 12px; }
.sidebar .nav a.home { font-size: .92rem; font-weight: 800; background: rgba(255,255,255,.10); }
.sidebar .nav a.home.active { background: #fff; }
.navsec { --sc: #4fc3f7; border-radius: 14px; padding: 6px 6px 8px; background: rgba(255,255,255,.07); border-inline-start: 5px solid var(--sc); display: flex; flex-direction: column; gap: 2px; }
.navsec.ns-stud { --sc: #ffca28; background: rgba(255,202,40,.12); }
.navsec.ns-acad { --sc: #4dd0e1; background: rgba(77,208,225,.12); }
.navsec.ns-admin { --sc: #b39ddb; background: rgba(179,157,219,.14); }
.navsec.ns-me { --sc: rgba(255,255,255,.45); background: transparent; }
.navsec-title { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 2px; font-size: .95rem; font-weight: 800; color: #fff; letter-spacing: 0; text-transform: none; border-bottom: 1px solid rgba(255,255,255,.18); }
.navsec-title .ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--sc); color: #0d2a4a; font-size: .8rem; flex: none; }
.navsec .sub { margin: 6px 10px 2px; font-size: .72rem; font-weight: 800; color: var(--sc); opacity: .95; }
.navsec a.active { box-shadow: inset -4px 0 0 var(--sc), 0 6px 16px -8px rgba(0,0,0,.35); }
html[dir="ltr"] .navsec a.active { box-shadow: inset 4px 0 0 var(--sc), 0 6px 16px -8px rgba(0,0,0,.35); }
@media (min-width: 960px) { .shell { grid-template-columns: 260px 1fr; } }
.nav-open .sidebar { width: 270px; }
.sidebar .nav { display: flex; flex-direction: column; gap: 8px; }
.navsec a { padding: 6px 12px; }
.sf-name-en { margin: -2px 0 6px; font-size: 1rem; font-weight: 600; color: var(--muted); }

/* ===== Staff dashboard ===== */
.viz, .kgroups, .dash-filters { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --good: #0ca30c; --warning: #fab219; --critical: #d03b3b; --neutral: #9a9a95; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .viz { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s7: #9085e9; --s8: #e66767; } }
:root[data-theme="dark"] .viz { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s7: #9085e9; --s8: #e66767; }
.c-s1 { --c: var(--s1); } .c-s2 { --c: var(--s2); } .c-s3 { --c: var(--s3); } .c-s4 { --c: var(--s4); } .c-s5 { --c: var(--s5); } .c-s6 { --c: var(--s6); } .c-s7 { --c: var(--s7); } .c-s8 { --c: var(--s8); }
.c-good, .st-good { --c: var(--good); } .c-warning, .st-warning { --c: var(--warning); } .c-critical, .st-critical { --c: var(--critical); } .c-neutral { --c: var(--neutral); }

.dash-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 12px 16px; margin-bottom: 16px; }
.dash-filters label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); min-width: 150px; }
.dash-filters select { min-width: 150px; padding: 7px 10px; }

.kgroups { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kgroup { --kc: #2a78d6; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 16px; padding: 12px; border-top: 4px solid var(--kc); }
.kgroup.kg-stud { --kc: #e0a800; } .kgroup.kg-acad { --kc: #0097a7; } .kgroup.kg-admin { --kc: #7e57c2; }
.kg-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 4px 10px; }
.kg-title .ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--kc) 18%, transparent); font-size: .85rem; }
.ktiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ktile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--kc) 7%, var(--card, #fff)); border: 1px solid color-mix(in srgb, var(--kc) 20%, transparent); color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s; }
a.ktile[href]:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--kc) 70%, transparent); }
.kt-label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.kt-value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.kt-value.sm { font-size: 1.25rem; }
.kt-sub { font-size: .76rem; color: var(--muted); }
.kt-sub.up { color: #0a7d32; font-weight: 600; } .kt-sub.down { color: #c62828; font-weight: 600; }
.kt-sub small { font-weight: 400; color: var(--muted); }
.ktile.is-warn { border-color: #f0b429; box-shadow: inset 0 0 0 1px #f0b42955; }
.ktile.is-bad { border-color: #d03b3b; box-shadow: inset 0 0 0 1px #d03b3b44; }
.ktile.is-bad .kt-value { color: #c62828; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.legend.inline { flex-direction: row; flex-wrap: wrap; gap: 14px; margin: 0 0 8px; }
.legend.small { font-size: .76rem; margin-top: 10px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.lg-label { flex: 1; color: var(--text); } .lg-val { font-variant-numeric: tabular-nums; font-weight: 600; } .lg-val small { color: var(--muted); font-weight: 400; }

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.donut-wrap .legend { width: 100%; }
.donut { width: 150px; height: 150px; }
.donut-track { fill: none; stroke: var(--line); opacity: .5; }
.donut-seg { fill: none; stroke: var(--c); transform: rotate(-90deg); transform-origin: 70px 70px; cursor: default; transition: stroke-width .12s; }
.donut-seg:hover { stroke-width: 20; }
.donut-total { text-anchor: middle; font-size: 22px; font-weight: 700; fill: var(--text); }
.donut-cap { text-anchor: middle; font-size: 10px; fill: var(--muted); }

.cols { display: flex; gap: 8px; height: 230px; direction: ltr; padding-top: 8px; }
.cols-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .7rem; color: var(--muted); text-align: right; padding-bottom: 22px; min-width: 40px; font-variant-numeric: tabular-nums; }
.cols-axis span { transform: translateY(-50%); } .cols-axis span:last-child { transform: none; }
.cols-plot { position: relative; flex: 1; display: flex; align-items: stretch; gap: 6px; padding-bottom: 22px; }
.cols-plot .gl { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); opacity: .7; margin-bottom: 22px; }
.col-grp { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.col-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.cbar { width: min(26px, 40%); min-height: 1px; background: var(--c); border-radius: 4px 4px 0 0; outline-offset: 2px; }
.cbar:hover, .cbar:focus { filter: brightness(1.1); }
.col-lbl { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: .74rem; color: var(--muted); }
.tview { margin-top: 10px; font-size: .82rem; } .tview summary { cursor: pointer; color: var(--muted); }

.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; align-items: center; gap: 10px; padding: 6px 0; color: inherit; text-decoration: none; font-size: .86rem; }
.hb-track { height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.hb-fill { display: block; height: 100%; background: var(--c); border-radius: 6px; }
.hb-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 52px; text-align: end; }
.hbar:hover .hb-name { text-decoration: underline; }
.viz-tip { position: fixed; z-index: 9999; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: #0b1f3a; color: #fff; font-size: .8rem; box-shadow: 0 6px 18px rgba(0,0,0,.25); opacity: 0; transition: opacity .1s; white-space: nowrap; }
.viz-tip.on { opacity: 1; }
@media (max-width: 1100px) and (min-width: 720px) { .grid > .col-3.viz { grid-column: span 6; } }

/* ---- Exam taking: tabs, colours, progress ---- */
.exam-head { display: flex; gap: 16px; align-items: center; padding: 14px 18px; margin-bottom: 14px; border-radius: 16px; color: #fff; background: linear-gradient(120deg, #1229c7, #1f3cff 55%, #4f8bff); box-shadow: var(--shadow); }
.exam-head.sticky { position: sticky; top: 8px; z-index: 20; }
.exam-head h1 { margin: 2px 0 8px; color: #fff; font-size: 1.35rem; }
.exam-head .eyebrow, .exam-head .muted { color: rgba(255,255,255,.85); }
.exam-head .timer { background: rgba(255,255,255,.95); color: #1229c7; border: 0; min-width: 104px; text-align: center; }
.exam-head .timer.warn { background: #ffca28; color: #3a2a00; }
.exam-head .timer.bad { background: var(--bad); color: #fff; animation: exam-pulse 1s infinite; }
@keyframes exam-pulse { 50% { transform: scale(1.06); } }
.exam-progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; margin-bottom: 4px; max-width: 520px; }
.exam-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: #4fd08a; transition: width .3s; }
.exam-instr summary { cursor: pointer; font-weight: 700; }
.exam-instr p { margin: 8px 0 0; }

.qtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.qtab { --qc: var(--muted); min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; position: relative; transition: transform .1s, box-shadow .1s; }
.qtab:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.qtab.is-done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qtab.is-flag { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.qtab.is-flag::after { content: "⚑"; position: absolute; top: -8px; inset-inline-end: -6px; font-size: .75rem; background: var(--warn); color: #fff; border-radius: 99px; padding: 0 4px; line-height: 1.4; }
.qtab.is-current { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 3px var(--blue-soft); }
.qtab-review { padding: 0 14px; border-color: var(--ok); color: var(--ok); }
.qtab-review.is-current { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.qlegend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; font-size: .82rem; color: var(--muted); }
.qlegend .lg::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -1px; border: 2px solid var(--line); background: var(--card); }
.qlegend .cur::before { background: var(--blue); border-color: var(--blue); }
.qlegend .done::before { background: var(--ok-soft); border-color: var(--ok); }
.qlegend .flag::before { background: var(--warn-soft); border-color: var(--warn); }

.qpanel { --tc: #1f3cff; border-top: 5px solid var(--tc); }
.qt-mcq { --tc: #1f3cff; } .qt-true_false { --tc: #0097a7; } .qt-multi { --tc: #7e57c2; } .qt-matching { --tc: #ef6c00; }
.qt-fill { --tc: #d81b60; } .qt-short { --tc: #178a52; } .qt-essay { --tc: #2e7d32; } .qreview { --tc: var(--ok); }
.exam-tabs-on .qpanel:not(.is-active) { display: none; }
.exam-tabs-on .qpanel.is-active { animation: exam-in .18s ease-out; }
@keyframes exam-in { from { opacity: 0; transform: translateY(6px); } }
.qhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.qnum { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--tc); color: #fff; font-weight: 800; }
.qtype { padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, transparent); }
.qpts { padding: 3px 10px; border-radius: 99px; font-size: .8rem; background: var(--paper); color: var(--muted); }
.qflag { border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.qflag[aria-pressed="true"] { border-style: solid; border-color: var(--warn); background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.qpanel .qprompt { font-size: 1.12rem; line-height: 1.7; }
.qpanel .choice { transition: border-color .12s, background .12s; }
.qpanel .choice:hover { border-color: var(--tc); }
.qpanel .choice:has(input:checked) { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 10%, transparent); font-weight: 600; }
.qpanel .choice input { accent-color: var(--tc); width: 18px; height: 18px; }
.qpanel input:not([type]), .qpanel textarea, .qpanel select { border-width: 2px; }
.qpanel input:not([type]):focus, .qpanel textarea:focus, .qpanel select:focus { border-color: var(--tc); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 18%, transparent); }
.qnav { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.qnav .grow, .qhead .grow { flex: 1; }
.qnav .btn { min-width: 110px; }
.qsummary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; }
.qsummary .sum { --sc: var(--ok); padding: 12px; border-radius: 12px; text-align: center; border: 2px solid var(--sc); background: color-mix(in srgb, var(--sc) 8%, transparent); }
.qsummary .sum b { display: block; font-size: 1.6rem; color: var(--sc); }
.qsummary .sum span { display: block; font-size: .85rem; color: var(--muted); }
.qsummary .flag { --sc: var(--warn); } .qsummary .open { --sc: var(--bad); }
.qgrid { margin-bottom: 12px; }
.qwarn { padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 600; }
@media (max-width: 640px) { .exam-head { flex-wrap: wrap; } .qtab { min-width: 36px; height: 36px; } }
[data-qtabs][hidden] { display: none !important; }

/* ---- Course achievement & lesson tracker ---- */
.achv { border-top: 5px solid var(--ok); }
.achv-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.achv-head h2 { margin: 2px 0 8px; }
.achv-ring { --p: 0; flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line) 0); }
.achv-ring span { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--card); font-size: 1.35rem; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.achv-bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.achv-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4fd08a, var(--ok)); }
.achv-bar.sm { height: 6px; width: 70px; display: inline-block; vertical-align: middle; }
.achv-pct { color: var(--ok); }
.achv-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.lessons { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-bottom: 10px; }
.lesson { height: 42px; display: grid; place-items: center; border-radius: 9px; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; border: 2px solid var(--line); background: var(--card); color: var(--muted); }
.lesson.ls-present { background: var(--ok); border-color: var(--ok); color: #fff; }
.lesson.ls-late { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.lesson.ls-absent { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.lesson.ls-excused { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.lesson.ls-missed { border-style: dashed; color: var(--muted); }
.qlegend .l-done::before { background: var(--ok); border-color: var(--ok); }
.qlegend .l-late::before { background: var(--warn-soft); border-color: var(--warn); }
.qlegend .l-abs::before { background: var(--bad-soft); border-color: var(--bad); }
.qlegend .l-exc::before { background: var(--blue-soft); border-color: var(--blue); }
.qlegend .l-miss::before { border-style: dashed; }
@media (max-width: 640px) { .lessons { grid-template-columns: repeat(6, 1fr); } .achv-head { flex-wrap: wrap; } }

/* Add-account form */
.uc-card { max-width: 720px; }
.uc-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; margin: 0; display: grid; gap: 10px; background: var(--paper); }
.uc-sec legend { padding: 0 6px; font-weight: 700; font-size: .9rem; color: var(--muted); }
[data-for][hidden] { display: none !important; }

/* ---------- Access levels (shared) ---------- */
.lvl { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.lvl-0 { background: #f1f2f6; color: #8a8fa3; border-color: #e4e6ef; }
.lvl-1 { background: #e8f1ff; color: #1d5fd1; border-color: #c9dcff; }
.lvl-2 { background: #fff4d6; color: #9a6a00; border-color: #f6dfa0; }
.lvl-3 { background: #e3f5ea; color: #13794a; border-color: #b8e4ca; }

/* Roles & permissions grid */
.acl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 14px; }
.acl-legend small { color: var(--muted); margin-inline-end: 12px; }
.acl-card { padding: 0; overflow: hidden; }
.acl-scroll { overflow-x: auto; }
.acl { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.acl th, .acl td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.acl thead th { position: sticky; top: 0; background: var(--card); font-size: .85rem; color: var(--muted); font-weight: 700; }
.acl .acl-area { text-align: start; min-width: 240px; }
.acl .acl-area strong { display: block; color: var(--ink); }
.acl .acl-area small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; line-height: 1.35; margin-top: 2px; }
.acl .acl-owner { background: color-mix(in srgb, var(--blue-soft) 45%, transparent); }
.acl tbody tr:hover td, .acl tbody tr:hover th { background: color-mix(in srgb, var(--blue-soft) 35%, transparent); }
.lvl-select { min-width: 132px; border-radius: 999px; font-weight: 700; font-size: .85rem; padding: 6px 30px 6px 12px; cursor: pointer; }
.lvl-select[data-level="0"] { background-color: #f1f2f6; color: #8a8fa3; border-color: #e4e6ef; }
.lvl-select[data-level="1"] { background-color: #e8f1ff; color: #1d5fd1; border-color: #c9dcff; }
.lvl-select[data-level="2"] { background-color: #fff4d6; color: #9a6a00; border-color: #f6dfa0; }
.lvl-select[data-level="3"] { background-color: #e3f5ea; color: #13794a; border-color: #b8e4ca; }
.acl-actions { padding: 14px 16px; justify-content: flex-end; }

/* ---------- User page ---------- */
.up { --up-r: 18px; display: grid; gap: 18px; padding: 18px; border-radius: 24px;
  background: linear-gradient(180deg, #f7f8fc 0%, #eef1f8 100%); border: 1px solid var(--line); }
.up-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 24px; border-radius: var(--up-r); color: #fff;
  background: linear-gradient(120deg, #13235b 0%, #1f3cff 100%); box-shadow: 0 14px 34px -18px rgba(19, 35, 91, .6); }
.up-role-instructor { background: linear-gradient(120deg, #0f4c46 0%, #1a9a8a 100%); }
.up-role-staff { background: linear-gradient(120deg, #5a3a00 0%, #c98a12 100%); }
.up-role-finance { background: linear-gradient(120deg, #3b1d5e 0%, #7b45c4 100%); }
.up-role-student { background: linear-gradient(120deg, #23324a 0%, #4a6a96 100%); }
.up-avatar { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); }
.up-who { flex: 1; min-width: 220px; }
.up-who h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; color: #fff; }
.up-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; opacity: .85; font-size: .9rem; }
.up-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.up-tags .badge { background: rgba(255, 255, 255, .92); }
.up-chip { padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #fff; color: #13235b; }
.up-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.up-actions .btn:not(.primary) { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .35); }
.up-actions .btn.primary { background: #fff; color: #13235b; border-color: #fff; }
.up-grid { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.up-card { grid-column: span 12; background: var(--card); border: 1px solid var(--line); border-radius: var(--up-r); padding: 20px 22px; box-shadow: var(--shadow); }
@media (min-width: 980px) { .up-span-7 { grid-column: span 7; } .up-span-5 { grid-column: span 5; } .up-span-6 { grid-column: span 6; } }
.up-card > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.up-card > header h2 { margin: 0; font-size: 1.05rem; }
.up-card > header .btn { margin-inline-start: auto; }
.up-ro { margin-inline-start: auto; font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--paper); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; }
.up-fs { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
.up-facts { display: grid; gap: 0; margin: 0 0 14px; }
.up-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.up-facts dt { color: var(--muted); }
.up-facts dd { margin: 0; font-weight: 600; }
.up-pw { gap: 6px; margin-bottom: 12px; }
.up-inline { display: flex; gap: 8px; align-items: stretch; }
.up-inline .pw-wrap { flex: 1; }
.up-acl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.up-acl li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.up-owner { margin: 0; font-weight: 600; }
.up-statusrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.up-statusrow p { margin: 0; flex: 1; min-width: 200px; }
