/* UMaT Student Attendance Management System: white workspace, green and orange accents.
   All colours come from the tokens below, so a brand change is a change to this block only.
   System fonts on purpose: nothing to download on a weak campus connection. */
:root {
  --green: #087443;        /* Primary Green */
  --green-deep: #075332;   /* Deep Green */
  --orange: #F28C28;       /* Orange */
  --white: #FFFFFF;
  --green-wash: #EAF5EE;   /* Light Green */
  --orange-wash: #FFF3E5;  /* Light Orange */
  --bg: #F5F7F6;          /* Background */
  --text: #263238;         /* Primary Text */
  --text-2: #64748B;       /* Secondary Text */
  --border: #E2E8F0;       /* Borders */
  --danger: #B3261E;
  --danger-wash: #FDECEA;
  --orange-ink: #9A5200;   /* orange text that stays readable on white */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(8, 116, 67, .08), 0 4px 14px rgba(8, 116, 67, .10);   /* soft light-green drop shadow */
  --glow: 0 3px 10px rgba(8, 116, 67, .16);
  --sidebar-w: 248px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* legacy names used throughout the scripts, mapped onto the brand tokens */
  --paper: var(--bg); --sheet: var(--white); --ink: var(--text); --ink-2: var(--text-2); --rule: var(--border);
  --pen: var(--green); --pen-ink: #fff; --margin: var(--orange); --ok: var(--green); --late: var(--orange-ink); --bad: var(--danger);
  --wash-ok: var(--green-wash); --wash-late: var(--orange-wash); --wash-bad: var(--danger-wash); --wash-pen: var(--green-wash);
  --serif: var(--sans);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; max-width: 66ch; }
a { color: var(--green); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.stack > * + * { margin-top: 16px; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- shell */
#app { min-height: 100dvh; }
.shell { min-height: 100dvh; }
.sidebar { display: none; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; background: var(--white); border-bottom: 1px solid var(--border); padding: 10px 16px; min-height: 60px; }
.topbar .brand-mini { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .page { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--green-wash); color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: .85rem; border: 1px solid #cfe6d8; }
.who .nm { font-weight: 600; font-size: .9rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.who .rl { font-size: .75rem; color: var(--text-2); text-transform: capitalize; }
.who .txt { display: none; }
.workspace { max-width: 1120px; margin: 0 auto; padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
.workspace.narrow { max-width: 640px; }

/* logo slot: the official file is shown as supplied (never recoloured or stretched) */
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo img { display: block; height: 40px; width: auto; max-width: 100%; object-fit: contain; }
.logo.big img { height: 84px; }
.logo .wordmark { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo .wordmark b { font-size: .95rem; color: var(--green-deep); }
.logo .wordmark span { font-size: .72rem; color: var(--text-2); font-weight: 600; letter-spacing: .02em; }
.logo.big .wordmark b { font-size: 1.15rem; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 2px; overflow-x: auto; background: var(--white); border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgba(16,40,30,.05); }
.tabs button { flex: 1 0 auto; min-width: 64px; width: auto; background: none; border: 0; color: var(--text-2); font: 600 .7rem var(--sans); padding: 7px 6px; border-radius: 10px; display: grid; justify-items: center; gap: 2px; cursor: pointer; position: relative; white-space: nowrap; }
.tabs button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--green); background: var(--green-wash); }
.tabs .dot { position: absolute; top: 2px; right: calc(50% - 22px); background: var(--orange); color: #fff; font: 700 .65rem var(--sans); min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--white); border-right: 1px solid var(--border); padding: 18px 14px; gap: 18px; overflow-y: auto; }
  .sidebar .logo { padding: 2px 6px 14px; border-bottom: 1px solid var(--border); }
  .sidebar .logo img { height: 52px; }
  .sidebar .tabs { position: static; display: flex; flex-direction: column; gap: 3px; border: 0; padding: 0; box-shadow: none; overflow: visible; background: none; }
  .sidebar .tabs button { flex: none; width: 100%; grid-auto-flow: column; justify-content: start; justify-items: start; align-items: center; gap: 12px; padding: 10px 12px; font-size: .92rem; border-radius: 10px; }
  .sidebar .tabs button:hover { background: var(--bg); color: var(--text); }
  .sidebar .tabs button[aria-current="page"] { background: var(--green-wash); color: var(--green-deep); box-shadow: inset 3px 0 0 var(--green); }
  .sidebar .tabs .dot { position: static; margin-left: auto; }
  .sidebar .foot { margin-top: auto; font-size: .75rem; color: var(--text-2); padding: 0 6px; }
  .bottom-tabs { display: none; }
  .topbar { padding: 12px 28px; }
  .topbar .brand-mini { display: none; }
  .who .txt { display: block; }
  .workspace { padding: 26px 28px 48px; }
}

/* ------------------------------------------------------------ page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 1.45rem; }
.page-head p { margin: 2px 0 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ cards */
.card, .panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px 0 12px; }
.card > .card-head h2 { font-size: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 14px 16px 0; margin: 0 0 8px; }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .cols.two { grid-template-columns: 3fr 2fr; } .cols.even { grid-template-columns: 1fr 1fr; } }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: flex; gap: 12px; align-items: center; min-width: 0; }
.stat .ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--green-wash); color: var(--green); }
.stat.warn .ico { background: var(--orange-wash); color: var(--orange-ink); }
.stat .ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span.l { font-size: .78rem; color: var(--text-2); display: block; }
.stat .sub { font-size: .72rem; color: var(--text-2); }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding-top: 8px; }
.chart .col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.chart .bar-v { width: 100%; max-width: 26px; background: var(--green); border-radius: 5px 5px 2px 2px; min-height: 3px; }
.chart .bar-v.zero { background: var(--border); }
.chart .xl { font-size: .62rem; color: var(--text-2); height: 14px; margin-top: 4px; white-space: nowrap; }
.chart .vl { font-size: .65rem; color: var(--text-2); font-variant-numeric: tabular-nums; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); align-items: flex-start; }
.feed li:first-child { border-top: 0; padding-top: 2px; }
.feed .dot-i { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--green-wash); color: var(--green); display: grid; place-items: center; }
.feed .dot-i.warn { background: var(--orange-wash); color: var(--orange-ink); }
.feed .dot-i svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feed .t { font-weight: 600; font-size: .9rem; }
.feed .s { font-size: .8rem; color: var(--text-2); }

/* ------------------------------------------------------------------ rows */
.register { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.card .register { border: 0; box-shadow: none; border-radius: 0; }
.row { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 0 12px; padding: 12px 16px 12px 12px; border-top: 1px solid var(--border); min-height: 64px; }
.row:first-child { border-top: 0; }
.row.now { background: var(--green-wash); box-shadow: inset 3px 0 0 var(--green); }
.row .when { text-align: right; padding-right: 8px; font-size: .8rem; line-height: 1.25; color: var(--text-2); }
.row .when b { display: block; font-size: .95rem; color: var(--text); font-weight: 700; }
.row .what { min-width: 0; }
.row .what .t { font-weight: 600; overflow-wrap: anywhere; }
.row .what .s { font-size: .85rem; color: var(--text-2); }
.row.plain { grid-template-columns: 1fr auto; padding: 12px 16px; }
.empty { padding: 28px 18px; color: var(--text-2); }
.empty b { color: var(--text); display: block; font-size: 1.05rem; margin-bottom: 4px; }

.mark { display: inline-flex; align-items: center; gap: 6px; font: 700 .76rem var(--sans); padding: 4px 10px 4px 8px; border-radius: 99px; white-space: nowrap; background: var(--green-wash); color: var(--green-deep); }
.mark i { font-style: normal; font-size: .9rem; line-height: 1; }
.mark.present { background: var(--green-wash); color: var(--green-deep); }
.mark.late, .mark.in_progress, .mark.excused { background: var(--orange-wash); color: var(--orange-ink); }
.mark.incomplete, .mark.rejected, .mark.absent, .mark.bad { background: var(--danger-wash); color: var(--danger); }
.mark.quiet { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }

/* --------------------------------------------------------------- controls */
button, .btn { font: 600 .95rem var(--sans); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--green); background: var(--green); color: #fff; cursor: pointer; text-decoration: none; transition: background .15s; }
.btn:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--white); color: var(--green); border-color: #bcd9c9; }
.btn.secondary:hover { background: var(--green-wash); }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #2b1600; }
.btn.accent:hover { background: #e07d17; border-color: #e07d17; }
.btn.danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: 1rem var(--sans); color: var(--text); background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: 3px solid var(--green-wash); }
input[type="file"] { padding: 9px; }
input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--green); }
textarea { min-height: 84px; resize: vertical; }
.field + .field { margin-top: 14px; }
.hint { font-size: .82rem; color: var(--text-2); margin-top: 4px; }
.err { color: var(--danger); font-weight: 600; font-size: .92rem; min-height: 1.3em; margin: 10px 0 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { background: var(--white); color: var(--text-2); border: 1px solid var(--border); padding: 6px 12px; border-radius: 99px; font-size: .85rem; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

.banner { border-radius: var(--radius); padding: 14px 16px; background: var(--orange-wash); color: var(--text); border: 1px solid #f5cf9f; }
.banner.act { background: var(--green-wash); border-color: #b9dcc8; }
.banner.good { background: var(--green-wash); border-color: #b9dcc8; }
.banner b { display: block; font-size: 1rem; }
.note { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 10px 12px; background: var(--orange-wash); font-size: .88rem; }
.note.good { background: var(--green-wash); }

/* ------------------------------------------------------------------ login */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.auth .hero { display: none; }
.auth .side { display: flex; flex-direction: column; justify-content: center; padding: 28px 20px; gap: 18px; max-width: 460px; width: 100%; margin: 0 auto; }
.auth .side .logo { justify-content: center; }
.auth .side h1 { font-size: 1.4rem; text-align: center; }
.auth .lede { color: var(--text-2); text-align: center; margin: 0 auto; }
.auth .panel { padding: 22px; }
.auth.wide-form .side { max-width: 560px; }
.login { padding-top: 6vh; max-width: 520px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.login .lede { color: var(--text-2); margin-bottom: 20px; }
@media (min-width: 900px) {
  .auth { grid-template-columns: 1.1fr 1fr; }
  .auth .hero { display: flex; flex-direction: column; justify-content: space-between; padding: 44px; color: #fff; background: linear-gradient(160deg, var(--green) 0%, var(--green-deep) 100%); position: relative; overflow: hidden; }
  .auth .hero::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 320px; height: 320px; border-radius: 50%; background: var(--orange); opacity: .9; }
  .auth .hero::before { content: ""; position: absolute; right: 120px; bottom: -150px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
  .auth .hero .plate { background: #fff; display: inline-flex; padding: 10px 14px; border-radius: 14px; width: fit-content; position: relative; z-index: 1; }
  .auth .hero h2 { color: #fff; font-size: 1.9rem; max-width: 18ch; position: relative; z-index: 1; }
  .auth .hero p { color: rgba(255,255,255,.88); position: relative; z-index: 1; }
  .auth .side .logo.only-mobile { display: none; }
}

/* -------------------------------------------------------------------- scan */
.viewfinder { position: relative; border-radius: var(--radius); overflow: hidden; background: #0d1a14; aspect-ratio: 1 / 1; width: 100%; max-width: 520px; margin: 0 auto; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewfinder .guide { position: absolute; inset: 14%; border: 3px solid rgba(255,255,255,.9); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.viewfinder .say { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; font-weight: 600; text-align: center; }
.viewfinder .idle { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; color: #dcebe3; }

/* attendance sheet: session, classroom, then the three-step verification */
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-head h2 { font-size: 1.2rem; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 14px 0; }
.meta > div { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.meta span { display: block; font-size: .72rem; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.meta b { display: block; font-size: .92rem; overflow-wrap: anywhere; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.step { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--white); }
.step .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.step b { display: block; font-size: .9rem; }
.step .d { font-size: .82rem; color: var(--text-2); }
.step.done { background: var(--green-wash); border-color: #b9dcc8; }
.step.done .n { background: var(--green); color: #fff; border-color: var(--green); }
.step.active { border-color: var(--orange); background: var(--orange-wash); }
.step.active .n { background: var(--orange); color: #2b1600; border-color: var(--orange); }
.step.fail { background: var(--danger-wash); border-color: #f1b9b4; }
.step.fail .n { background: var(--danger); color: #fff; border-color: var(--danger); }

.line-result { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px 20px; position: relative; overflow: hidden; }
.line-result::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--green); }
.line-result.fail::before { background: var(--danger); }
.line-result .ruled-line { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin: 14px 0; }
.line-result .nm { font-size: 1.15rem; font-weight: 700; flex: 1; }
.line-result .tk { width: 52px; height: 42px; flex: none; color: var(--green); }
.line-result .tk path { stroke: currentColor; stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 90; stroke-dashoffset: 90; animation: ink .55s .15s ease-out forwards; }
.line-result.fail .tk { color: var(--danger); }
@keyframes ink { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .line-result .tk path { animation: none; stroke-dashoffset: 0; } }

/* --------------------------------------------------------------- lecturer */
.qrbox { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; width: min(100%, 360px); margin: 0 auto; }
.qrbox svg { display: block; width: 100%; height: auto; }
.qrwrap { text-align: center; }
.qrwrap:fullscreen { background: #fff; display: grid; place-content: center; padding: 3vmin; }
.qrwrap:fullscreen .qrbox { width: min(86vh, 86vw); }
.qrwrap:fullscreen .no-full { display: none; }
.drain { height: 4px; background: var(--border); border-radius: 2px; margin: 10px auto 0; width: min(100%, 360px); overflow: hidden; }
.drain i { display: block; height: 100%; background: var(--orange); transform-origin: left; }
.counts { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--white); box-shadow: var(--shadow); }
.counts div { flex: 1; text-align: center; padding: 12px 4px; border-left: 1px solid var(--border); }
.counts div:first-child { border-left: 0; }
.counts b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; color: var(--green-deep); }
.counts span { font-size: .75rem; color: var(--text-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--border); vertical-align: top; }
thead th { border-top: 0; font-size: .75rem; color: var(--text-2); font-weight: 700; background: var(--bg); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover td { background: #fafcfb; }
td .s { display: block; font-size: .8rem; color: var(--text-2); }
tr.attn td:first-child { box-shadow: inset 3px 0 0 var(--orange); }
.flagtxt { color: var(--danger); font-size: .8rem; font-weight: 600; display: block; margin-top: 2px; }
dialog { border: 1px solid var(--border); border-radius: 16px; background: var(--white); color: var(--text); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: 90dvh; box-shadow: 0 20px 50px rgba(8,40,28,.25); }
dialog::backdrop { background: rgba(7, 40, 28, .5); }
dialog form, dialog .inner { padding: 20px; }
dialog h2 { margin-bottom: 10px; font-size: 1.2rem; }
.evidence { font-size: .85rem; border: 1px solid var(--border); border-radius: 8px; max-height: 190px; overflow: auto; margin: 10px 0 14px; }
.evidence div { padding: 7px 10px; border-top: 1px solid var(--border); } .evidence div:first-child { border-top: 0; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.choices.two { grid-template-columns: 1fr 1fr; }

.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; } @media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kv > div { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.kv b { display: block; font-size: 1.4rem; } .kv span { font-size: .8rem; color: var(--text-2); }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); align-items: center; }
.todo li:first-child { border-top: 0; }
.todo .box { flex: none; width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 50%; display: grid; place-items: center; font-size: .75rem; color: #fff; }
.todo li.done .box { border-color: var(--green); background: var(--green); } .todo li.done { color: var(--text-2); }
.pct { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 6px; }
.pct i { display: block; height: 100%; background: var(--green); }
.pct.low i { background: var(--orange); }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--green-deep); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.copybox { font: 600 1.15rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; background: var(--bg); border: 1px dashed var(--text-2); border-radius: 8px; padding: 12px; text-align: center; user-select: all; }
td select { min-width: 220px; }
details.panel summary { list-style-position: inside; }
@media (max-width: 899px) { .workspace { padding-top: 14px; } }
@media (max-width: 480px) { .stat { padding: 12px; gap: 10px; } .stat .ico { width: 36px; height: 36px; } .stat b { font-size: 1.35rem; } .row { grid-template-columns: 54px 1fr auto; } }
.card > .register { margin: 0 -16px -16px; border-radius: 0; }
.logo-m { display: flex; justify-content: center; }
.logo-m .logo.big img { height: 64px; }
@media (min-width: 900px) { .logo-m { display: none; } }
.topbar .btn { white-space: nowrap; }
@media (max-width: 899px) {
  .topbar .page { display: none; }
  .topbar .logo .wordmark span { display: none; }
  .topbar .logo .wordmark b { font-size: .85rem; }
  .topbar .logo img { height: 34px; }
}
.stat span.l, .stat .sub { line-height: 1.25; }
.card:has(> .register) { overflow: hidden; }
/* larger logo for visibility */
.logo img { height: 56px; }
.topbar .logo img { height: 48px; }
.logo.big img { height: 120px; max-width: 100%; }
.logo-m .logo.big img { height: 96px; }
@media (min-width: 900px) {
  .sidebar .logo img { height: 84px; }
  .sidebar .logo { justify-content: center; }
  .auth .hero .plate { padding: 14px 20px; }
}
@media (max-width: 899px) { .topbar .logo img { height: 46px; } .topbar { min-height: 68px; } }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--green-deep); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
.idle-bar { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 60; display: flex; gap: 12px; align-items: center; background: var(--orange-wash); border: 1px solid var(--orange); border-radius: 12px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: calc(100vw - 24px); font-weight: 600; }
.net-bar { position: sticky; top: 0; z-index: 30; background: var(--danger); color: #fff; text-align: center; padding: 6px 12px; font-weight: 600; font-size: .85rem; }
@media print { .side-toggle, .bt-handle, .sidebar, .topbar, .tabs, .bottom-tabs, .btn { display: none !important; } body { background: #fff; } .card, .table-wrap { box-shadow: none; } }

/* Folding cards (Notifications, Recent activity) */
.card.fold { padding: 0; }
.card.fold > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; min-height: 48px; }
.card.fold > summary::-webkit-details-marker { display: none; }
.card.fold > summary h2 { font-size: 1rem; margin: 0; }
.card.fold > summary:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; border-radius: var(--radius, 12px); }
.card.fold .badge { background: var(--green-wash); color: var(--green); border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-weight: 700; }
.card.fold .badge.warn { background: var(--orange-wash); color: var(--orange-ink); }
.card.fold .preview { flex: 1; min-width: 0; color: var(--text-2); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.fold .chev { margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); transition: transform .15s; flex: none; }
.card.fold .preview + .chev { margin-left: 0; }
.card.fold[open] > summary .preview { display: none; }
.card.fold[open] > summary .chev { transform: rotate(-135deg); }
.card.fold > .fold-body { padding: 0 16px 16px; }
@media (prefers-reduced-motion: reduce) { .card.fold .chev { transition: none; } }

/* ---------------------------------------------------------------- slide-away menu, foldable overview, green shadows */
.side-toggle { display: none; flex: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--white); color: var(--green-deep); cursor: pointer; place-items: center; box-shadow: var(--shadow); }
.side-toggle:hover { background: var(--green-wash); }
.side-toggle svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.bt-handle { display: none; }

/* every navigation tab and bar carries a light green drop shadow */
.topbar { box-shadow: 0 4px 14px rgba(8, 116, 67, .10); }
.tabs { box-shadow: 0 -4px 14px rgba(8, 116, 67, .12); }
.tabs button { box-shadow: 0 1px 3px rgba(8, 116, 67, .10); background: var(--white); }
.tabs button[aria-current="page"] { box-shadow: var(--glow); }
.tabs button:hover { box-shadow: var(--glow); }

@media (min-width: 900px) {
  .side-toggle { display: grid; }
  .shell { transition: grid-template-columns .22s ease; }
  .sidebar { box-shadow: 4px 0 18px rgba(8, 116, 67, .10); transition: transform .22s ease, visibility 0s; }
  .sidebar .tabs button { box-shadow: 0 1px 4px rgba(8, 116, 67, .12); }
  .sidebar .tabs button:hover { background: var(--green-wash); box-shadow: var(--glow); }
  .sidebar .tabs button[aria-current="page"] { box-shadow: inset 3px 0 0 var(--green), var(--glow); }
  .shell.side-hidden { grid-template-columns: 0 1fr; }
  .shell.side-hidden .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; overflow: hidden; }
  .shell.side-hidden .workspace { max-width: 1480px; }
}
@media (max-width: 899px) {
  .bt-handle { display: grid; place-items: center; position: fixed; right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 21; width: 52px; height: 22px; border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--white); box-shadow: 0 -3px 10px rgba(8, 116, 67, .14); cursor: pointer; padding: 0; transition: bottom .2s ease; }
  .bt-handle .grip { width: 22px; height: 4px; border-radius: 2px; background: var(--green); opacity: .7; }
  .tabs { transition: transform .2s ease; }
  .shell.bt-hidden .tabs { transform: translateY(110%); }
  .shell.bt-hidden .bt-handle { bottom: env(safe-area-inset-bottom); }
  .shell.bt-hidden .workspace { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .shell, .sidebar, .tabs, .bt-handle { transition: none !important; } }

.dash-hidden-note { display: none; margin: 4px 0 0; }
.dash-collapsed > .dash-hidden-note { display: block; }
.dash-collapsed > :not(.page-head):not(.dash-hidden-note):not(.banner) { display: none; }

/* Choosing classes (lecturers) */
.picklist { display: grid; gap: 0; }
.pick { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; border-top: 1px solid var(--border); cursor: pointer; }
.pick:first-child { border-top: 0; }
.pick input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green); }
.pick .what { flex: 1; min-width: 0; }
.pick .t { font-weight: 600; }
.pick .s { font-size: .82rem; color: var(--text-2); }
.pick .mark { flex: none; align-self: flex-start; }
.pick.locked { cursor: default; opacity: .7; }

/* Notifications bell in the top bar, beside the user's name */
.bell-wrap { position: relative; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); display: grid; place-items: center; cursor: pointer; color: var(--text); box-shadow: var(--shadow); }
.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell:hover { background: var(--green-wash); }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--green); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.bell-badge.warn { background: var(--orange-ink); }
.bell-badge[hidden], .bell-panel[hidden] { display: none; }
.bell-panel { position: absolute; right: 0; top: 48px; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 14px; z-index: 40; box-shadow: var(--shadow), 0 12px 32px rgba(8, 116, 67, .18); }
.bell-title { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.remind-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }

/* Larger UMaT logo */
.sidebar .logo img { height: 120px; }
.logo.big img { height: 168px; }
.logo-m .logo.big img { height: 128px; }
.topbar .logo img { height: 62px; }
.topbar { min-height: 80px; }
@media (max-width: 899px) { .topbar .logo img { height: 54px; } .topbar { min-height: 76px; } }

/* ---- UMaT logo without its white box, with the university name beside it ---- */
.auth .hero .plate { background: none; padding: 0; border-radius: 0; }
.logo .wordmark.beside { border-left: 2px solid var(--orange); padding-left: 12px; font-family: Georgia, "Times New Roman", serif; }
.logo .wordmark b { display: flex; flex-direction: column; line-height: 1.12; letter-spacing: .01em; }
.logo .wordmark b i { font-style: normal; display: block; }
.logo .wordmark .l1 { font-weight: 700; font-size: 1.1rem; color: var(--green-deep); }
.logo .wordmark .l2 { font-weight: 400; font-style: italic; font-size: 1.02rem; color: var(--green); }
.logo .wordmark.beside span { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; margin-top: 5px; font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
/* left menu: logo above the name, centred */
.sidebar .logo { flex-direction: column; text-align: center; gap: 8px; }
.sidebar .logo img { height: 104px; }
.sidebar .logo .wordmark.beside { border-left: 0; padding-left: 0; align-items: center; }
.sidebar .logo .wordmark b { align-items: center; }
.sidebar .logo .wordmark .l1 { font-size: 1.02rem; }
.sidebar .logo .wordmark .l2 { font-size: .96rem; }
/* top bar (phones): logo only, to leave room for the bell and the name */
.topbar .logo .wordmark { display: none; }
/* sign-in, wide screens: logo and name on the green panel with no white box */
.auth .hero .logo.big { gap: 18px; position: relative; z-index: 1; }
.auth .hero .logo.big img { height: 132px; filter: drop-shadow(0 2px 10px rgba(255, 255, 255, .35)); }
.auth .hero .logo.big .wordmark.beside { border-left-color: var(--orange); }
.auth .hero .logo.big .wordmark .l1 { color: #fff; font-size: 1.6rem; }
.auth .hero .logo.big .wordmark .l2 { color: rgba(255, 255, 255, .92); font-size: 1.5rem; }
.auth .hero .logo.big .wordmark.beside span { color: rgba(255, 255, 255, .8); }
/* sign-in, phones: centred, name under the logo */
.logo-m .logo.big { flex-direction: column; text-align: center; gap: 10px; }
.logo-m .logo.big .wordmark { display: flex; }
.logo-m .logo.big .wordmark.beside { border-left: 0; padding-left: 0; align-items: center; }
.logo-m .logo.big .wordmark b { align-items: center; }
.logo-m .logo.big .wordmark .l1 { font-size: 1.3rem; }
.logo-m .logo.big .wordmark .l2 { font-size: 1.2rem; }

/* ---- page-change loader ---- */
.ldr { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; opacity: 0; visibility: hidden; pointer-events: none;
  background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .97), rgba(234, 245, 238, .98) 70%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .35s ease, visibility 0s linear .35s; }
.ldr.on { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .2s ease; }
.ldr-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; text-align: center; transform: translateY(8px) scale(.98); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.ldr.on .ldr-inner { transform: none; }
.ldr-core { position: relative; width: 136px; height: 136px; display: grid; place-items: center; }
.ldr-glow { position: absolute; inset: -22px; border-radius: 50%; background: radial-gradient(closest-side, rgba(8, 116, 67, .20), rgba(8, 116, 67, 0)); animation: ldr-pulse 2s ease-in-out infinite; }
.ldr-ring { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(8, 116, 67, 0) 0 12%, var(--green) 58%, var(--orange) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: ldr-spin 1.15s cubic-bezier(.55, .15, .4, .9) infinite; }
.ldr-ring.two { inset: 14px; opacity: .45; animation-duration: 1.9s; animation-direction: reverse; }
.ldr-mark { position: relative; display: grid; place-items: center; width: 84px; height: 84px; }
.ldr-mark img { max-width: 84px; max-height: 84px; width: auto; height: auto; object-fit: contain; animation: ldr-breathe 2s ease-in-out infinite; }
.ldr-mark:empty::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--green); animation: ldr-breathe 1.4s ease-in-out infinite; }
.ldr-name { margin: 0; font-family: Georgia, "Times New Roman", serif; color: var(--green-deep); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.ldr-name i { font-style: normal; display: block; }
.ldr-name i + i { font-weight: 400; font-style: italic; color: var(--green); }
.ldr-bar { width: 168px; height: 3px; border-radius: 3px; background: rgba(8, 116, 67, .14); overflow: hidden; }
.ldr-bar::after { content: ""; display: block; width: 42%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--orange)); animation: ldr-slide 1.25s cubic-bezier(.6, 0, .4, 1) infinite; }
.ldr-sub { margin: 0; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--text-2); }
.ldr-sub::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: ldr-dots 1.4s steps(4, end) infinite; }
@keyframes ldr-spin { to { transform: rotate(360deg); } }
@keyframes ldr-pulse { 0%, 100% { transform: scale(.92); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes ldr-breathe { 0%, 100% { transform: scale(.96); } 50% { transform: scale(1.04); } }
@keyframes ldr-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes ldr-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .ldr-ring, .ldr-glow, .ldr-mark img { animation-duration: 4s; } .ldr-inner { transition: none; } }
@media print { .ldr { display: none !important; } }

/* University name: plain Times New Roman, formal, one weight */
.logo .wordmark, .logo .wordmark.beside, .logo .wordmark.beside span, .ldr-name, .ldr-name i { font-family: "Times New Roman", Times, serif; }
.logo .wordmark.beside { border-left: 0; padding-left: 4px; }
.logo .wordmark b { letter-spacing: 0; line-height: 1.15; }
.logo .wordmark .l1, .logo .wordmark .l2 { font-style: normal; font-weight: 700; font-size: 1.2rem; color: var(--green-deep); }
.logo .wordmark.beside span { font-size: .8rem; letter-spacing: 0; text-transform: none; margin-top: 4px; color: var(--text-2); }
.sidebar .logo .wordmark .l1, .sidebar .logo .wordmark .l2 { font-size: 1.05rem; }
.auth .hero .logo.big .wordmark .l1, .auth .hero .logo.big .wordmark .l2 { color: #fff; font-size: 1.7rem; font-style: normal; font-weight: 700; }
.auth .hero .logo.big .wordmark.beside span { color: rgba(255, 255, 255, .88); font-size: .9rem; }
.logo-m .logo.big .wordmark .l1, .logo-m .logo.big .wordmark .l2 { font-size: 1.35rem; }
.ldr-name { font-weight: 700; font-size: 1.1rem; }
.ldr-name i + i { font-weight: 700; font-style: normal; color: var(--green-deep); }
.logo .wordmark.beside span { font-weight: 400; }

/* Faint UMaT logo behind every page */
.auth { background: transparent; }
html.has-wm body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07;
  background: var(--logo-wm) center 52% / min(72vmin, 640px) no-repeat; }
@media (min-width: 900px) {
  html.has-wm body:has(.shell:not(.side-hidden))::before { background-position: calc(50% + 124px) 52%; }
  html.has-wm body:has(.auth)::before { background-position: 75% 50%; }
}
@media print { html.has-wm body::before { display: none; } }
@media (max-width: 899px) { html.has-wm body::before { opacity: .055; } }

/* Watermark: nearly the size of the page */
html.has-wm body::before { background-size: min(96vmin, 1500px); background-position: center 50%; opacity: .06; }
@media (min-width: 900px) {
  html.has-wm body:has(.shell:not(.side-hidden))::before { background-position: calc(50% + 124px) 50%; }
  html.has-wm body:has(.auth)::before { background-position: 75% 50%; background-size: min(96vmin, 1100px); }
}
@media (max-width: 899px) { html.has-wm body::before { background-size: 118vmin; opacity: .05; } }

/* ---- Analytics (master administrator) ---- */
.an-grid > .card { min-width: 0; }
.an-card h3 { margin: 0 0 2px; font-size: 1.02rem; }
.an-sub { margin: 0 0 10px; }
.an-chart { margin-top: 6px; }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 6px; font-size: .78rem; color: var(--text-2); }
.an-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.an-bars { display: grid; gap: 8px; }
.an-bar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .84rem; }
.an-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bt { height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; }
.an-bt i { display: block; height: 100%; border-radius: 6px; }
.an-bar b { font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.an-printhead { display: none; }
.an-foot { margin: 4px 0 20px; }
@media print {
  .an-noprint { display: none !important; }
  .an-printhead { display: flex; flex-direction: column; gap: 2px; border-bottom: 2px solid var(--green); padding-bottom: 8px; margin-bottom: 8px; }
  .an-printhead b { font-size: 1.3rem; color: var(--green-deep); }
  .an-card, .stat, .note { break-inside: avoid; }
  .an-break { break-before: page; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .shell, main, .main { display: block !important; }
}

/* room recognition */
.rv-video { width: 100%; max-height: 52dvh; border-radius: 12px; background: #0b1b14; object-fit: cover; display: block; }
.rv-msg { margin: 10px 0; font-weight: 600; } .rv-msg.ok { color: var(--green, #087443); }
.rv-dots { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.rv-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border, #cfd8d3); display: block; }
.rv-dots i.on { background: var(--green, #087443); border-color: var(--green, #087443); }
.rv-panel { margin: 12px 0; padding: 12px; border: 1px solid var(--border, #cfd8d3); border-radius: 12px; }
.rv-opt { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.rv-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.rv-item { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border, #cfd8d3); }
.rv-item img { width: 100%; max-width: 256px; border-radius: 8px; }
.rv-list { max-height: 50dvh; overflow: auto; }
.rv-heads { margin: 8px 0; padding-left: 18px; font-size: .9rem; }

/* Notifications on phones: pin the panel to the screen so no part of it can slide off the left or right edge. */
@media (max-width: 700px) {
  .bell-panel { position: fixed; top: calc(64px + env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); width: auto; max-width: none; max-height: calc(100dvh - 140px); box-sizing: border-box; overflow-wrap: anywhere; }
  .toast { left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); transform: none; width: auto; max-width: none; text-align: center; box-sizing: border-box; }
}

/* events */
.ev-qr { text-align: center; } .ev-qr svg { width: min(100%, 320px); height: auto; }
.ev-progs { max-height: 180px; overflow: auto; border: 1px solid var(--border, #cfd8d3); border-radius: 10px; padding: 6px 10px; margin-top: 6px; }
