/* =====================================================================
   SierraGrade++  ·  UI theme (dark blue & white, light/dark mode)
   ===================================================================== */
:root {
    --navy: #0b2a5b;
    --navy-2: #123a7a;
    --navy-ink: #e9f0fc;
    --blue: #196bde;
    --blue-hover: #1158c0;
    --blue-soft: #e8f1fd;
    --blue-line: #cfe0fa;
    --accent: #fcc63b;
    --accent-hover: #f2b81f;
    --accent-ink: #13254a;
    --green: #12a150;  --green-soft: #e3f6eb;
    --red: #d93a3a;    --red-soft: #fdeaea;
    --amber: #c27a00;  --amber-soft: #fff3d6;
    --violet: #6d4ae0; --violet-soft: #efeafd;
    --sky: #0e8ac7;    --sky-soft: #e2f4fc;

    --bg: #f4f7fc;
    --surface: #ffffff;
    --surface-2: #f7faff;
    --border: #dbe6f6;
    --border-strong: #c4d5ef;
    --text: #0f1b33;
    --muted: #5b6b85;
    --input-bg: #ffffff;
    --sidebar: #0b2a5b;
    --sidebar-2: #0e3270;
    --shadow-sm: 0 1px 2px rgba(15, 40, 90, .06);
    --shadow: 0 1px 2px rgba(15, 40, 90, .05), 0 10px 30px -12px rgba(15, 40, 90, .18);
    --shadow-lg: 0 24px 60px -20px rgba(11, 42, 91, .35);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --font: "Inter", "Segoe UI", "Poppins", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    --navy: #091a38; --navy-2: #0f2a57; --blue: #4b8ef1; --blue-hover: #6aa3f5; --blue-soft: #13284a; --blue-line: #21406f;
    --green-soft: #0f2e22; --red-soft: #3a1717; --amber-soft: #33270b; --violet-soft: #241c45; --sky-soft: #0d2a3a;
    --green: #3ccf7f; --red: #ff6b6b; --amber: #f6b73c; --violet: #a28bff; --sky: #4cc3f5;
    --bg: #070f1f; --surface: #0e1a31; --surface-2: #12213d; --border: #1d3054; --border-strong: #2a4272;
    --text: #e6edf8; --muted: #93a3bf; --input-bg: #0b1629; --sidebar: #050c1a; --sidebar-2: #0b1a36;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        --navy: #091a38; --navy-2: #0f2a57; --blue: #4b8ef1; --blue-hover: #6aa3f5; --blue-soft: #13284a; --blue-line: #21406f;
        --green-soft: #0f2e22; --red-soft: #3a1717; --amber-soft: #33270b; --violet-soft: #241c45; --sky-soft: #0d2a3a;
        --green: #3ccf7f; --red: #ff6b6b; --amber: #f6b73c; --violet: #a28bff; --sky: #4cc3f5;
        --bg: #070f1f; --surface: #0e1a31; --surface-2: #12213d; --border: #1d3054; --border-strong: #2a4272;
        --text: #e6edf8; --muted: #93a3bf; --input-bg: #0b1629; --sidebar: #050c1a; --sidebar-2: #0b1a36;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -12px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
    [data-theme="system"] .show-light { display: none; }
    [data-theme="system"] .show-dark { display: inline-flex; }
}
.show-dark { display: none; }
.show-light { display: inline-flex; }
[data-theme="dark"] .show-dark { display: inline-flex; }
[data-theme="dark"] .show-light { display: none; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 3.2rem); letter-spacing: -.03em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.08rem; }
h4 { font-size: .98rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; background: var(--blue-soft); color: var(--text); padding: .12em .45em; border-radius: 6px; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.right { text-align: right; margin-left: auto; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.pt-2 { padding-top: 1rem; } .py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.d-inline { display: inline-block; }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.link { font-weight: 600; font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; }
.truncate { max-width: 460px; }
.scroll-y { max-height: 320px; overflow: auto; }
.only-mobile { display: none !important; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .62rem 1.1rem; border-radius: var(--radius-sm); border: 1.5px solid transparent;
    font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 16px -8px var(--blue); }
.btn-primary:hover { background: var(--blue-hover); color: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px rgba(242, 184, 31, .9); }
.btn-accent:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-outline { background: var(--surface); color: var(--blue); border-color: var(--blue-line); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.94); color: #fff; }
.btn-sm { padding: .4rem .7rem; font-size: .82rem; border-radius: var(--radius-xs); }
.btn-lg { padding: .85rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn-row form { margin: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: .15s; font: inherit; font-weight: 700; }
.icon-btn:hover { border-color: var(--blue-line); color: var(--blue); background: var(--blue-soft); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn-danger:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .01em; line-height: 1.4; white-space: nowrap; }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge-dark { background: var(--navy); color: #fff; }
.badge-light { background: rgba(255, 255, 255, .16); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue); margin-left: .4rem; }
.tag-green { background: var(--green-soft); color: var(--green); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1.25rem; min-width: 0; }
.card-pad { padding: 1.4rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.card-head.wrap { flex-wrap: wrap; }
.stack > .card:last-child { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.grid-2 > .card, .grid-2-1 > .card { margin-bottom: 0; }
.grid-2, .grid-2-1 { margin-bottom: 1.25rem; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.split h3, .split p { margin-bottom: .2rem; }
.danger-zone { border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }

/* ---------- Alerts ---------- */
.alert { position: relative; padding: .85rem 2.5rem .85rem 1rem; border-radius: 12px; margin-bottom: 1rem; border: 1px solid; font-size: .92rem; }
.alert-success { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--text); }
.alert-error { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, transparent); color: var(--text); }
.alert-info { background: var(--blue-soft); border-color: var(--blue-line); color: var(--text); }
.alert-success::before, .alert-error::before, .alert-info::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; }
.alert-success::before { background: var(--green); } .alert-error::before { background: var(--red); } .alert-info::before { background: var(--blue); }
.alert-close { position: absolute; right: .6rem; top: .5rem; background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.field label, .label { font-weight: 600; font-size: .86rem; display: block; }
.hint { color: var(--muted); font-size: .78rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    width: 100%; font: inherit; font-size: .94rem; color: var(--text); background: var(--input-bg); border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm); padding: .62rem .8rem; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent); }
input:disabled { opacity: .65; }
select { appearance: none; padding-right: 2.2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235b6b85' stroke-width='2'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .8rem center; }
textarea { resize: vertical; min-height: 90px; }
input[type=file] { font: inherit; font-size: .86rem; padding: .5rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); width: 100%; background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); width: 17px; height: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; }
.form-narrow { max-width: 680px; }
.form-wide { max-width: 900px; }
.divider-label { grid-column: 1 / -1; display: flex; align-items: center; gap: .8rem; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .6rem 0 1rem; }
.divider-label::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.input-group { display: flex; gap: .4rem; }
.input-group .icon-btn { height: auto; width: 46px; }
.check-list { display: grid; gap: .5rem; }
.check { display: flex; align-items: flex-start; gap: .6rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface-2); font-weight: 500; }
.check:hover { border-color: var(--blue-line); }
.check input { margin-top: 2px; }
.check small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.switch { display: flex; align-items: center; gap: .6rem; font-weight: 500 !important; cursor: pointer; margin: .2rem 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 40px; height: 23px; border-radius: 999px; background: var(--border-strong); position: relative; transition: .2s; flex: none; }
.switch span::after { content: ""; position: absolute; width: 17px; height: 17px; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { left: 20px; }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); }
.segmented { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.segmented button, .segmented label { border: 0; background: transparent; font: inherit; font-size: .87rem; font-weight: 600; padding: .45rem .9rem; border-radius: 9px; cursor: pointer; color: var(--muted); display: inline-flex; gap: .4rem; align-items: center; }
.segmented button.active, .segmented label:has(input:checked) { background: var(--surface); color: var(--blue); box-shadow: var(--shadow-sm); }
.segmented label input { position: absolute; opacity: 0; }
.search { display: flex; align-items: center; gap: .4rem; background: var(--input-bg); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 .7rem; color: var(--muted); min-width: 220px; }
.search input { border: 0 !important; box-shadow: none !important; padding: .55rem 0 !important; background: transparent !important; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.filters select { width: auto; min-width: 160px; padding-top: .5rem; padding-bottom: .5rem; }
.inline-edit { display: flex; gap: .4rem; align-items: center; margin: 0; }
.inline-edit input { padding: .4rem .6rem !important; border-color: transparent !important; background: transparent !important; font-weight: 600; }
.inline-edit input:hover, .inline-edit input:focus { border-color: var(--border-strong) !important; background: var(--input-bg) !important; }
.w-code { max-width: 110px; } .w-num { max-width: 100px; } .w-check { width: 36px; }

/* ---------- Tables & lists ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .75rem 1.25rem; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .8rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--blue-soft) 45%, transparent); }
.table-compact th, .table-compact td { padding: .4rem .4rem; }
.table-compact input { padding: .45rem .55rem !important; }
.table td form { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 1rem; justify-content: space-between; padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list-compact li { padding: .5rem 1.25rem; font-size: .88rem; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; padding: 1rem; border-top: 1px solid var(--border); }
.person { display: flex; align-items: center; gap: .7rem; }
.person h3 { margin: 0; }
.person p { margin: 0; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .7rem 1.25rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.bulk-bar select { width: auto; padding-top: .4rem; padding-bottom: .4rem; font-size: .86rem; }
.info-row { display: flex; align-items: center; gap: .6rem; justify-content: space-between; padding: .55rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; flex-wrap: wrap; }
.info-row > span:first-child { color: var(--muted); }

/* ---------- Empty, progress, misc ---------- */
.empty { text-align: center; padding: 2.6rem 1.25rem; }
.empty-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--blue-soft); color: var(--blue); margin-bottom: .8rem; }
.empty-icon .icon { width: 28px; height: 28px; }
.empty h4 { margin-bottom: .3rem; }
.progress { display: block; height: 8px; border-radius: 99px; background: var(--blue-soft); overflow: hidden; min-width: 120px; max-width: 360px; margin-top: .4rem; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #4aa3ff); border-radius: inherit; transition: width .6s ease; }
.progress-sm { height: 6px; min-width: 70px; margin: 0; display: inline-block; vertical-align: middle; }
.progress-red > span { background: linear-gradient(90deg, var(--red), #ff9a7a); }
.mini-bar { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.h-sub { font-size: .95rem; font-weight: 500; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 0 rgba(18, 161, 80, .6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(18, 161, 80, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0); } }
.date-chip { width: 50px; flex: none; text-align: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); padding: .35rem 0; line-height: 1.1; }
.date-chip b { display: block; font-size: 1.15rem; } .date-chip small { font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: linear-gradient(135deg, var(--blue), #5fa8ff); color: #fff; font-weight: 700; font-size: .85rem; }
.avatar-sm { width: 30px; height: 30px; border-radius: 9px; font-size: .72rem; }
.avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--blue), #4fa1ff); color: #fff; flex: none; }
.brand-mark-sm { width: 32px; height: 32px; border-radius: 9px; }
.brand-mark-lg { width: 64px; height: 64px; border-radius: 16px; }
.brand-mark-lg .icon { width: 32px; height: 32px; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.page-actions form { margin: 0; }
.section-title { display: flex; align-items: center; gap: .55rem; margin: 1.6rem 0 .9rem; font-size: 1.05rem; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; background: linear-gradient(90deg, var(--sidebar-2) 268px, transparent 268px); }
.sidebar { width: 268px; flex: none; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); color: var(--navy-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 1.1rem .85rem; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; padding: .3rem .5rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: .8rem; }
.brand:hover { color: #fff; }
.brand-logo-img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { font-size: .72rem; color: rgba(233, 240, 252, .6); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 11px; color: rgba(233, 240, 252, .78); font-weight: 500; font-size: .92rem; transition: .15s; width: 100%; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.active { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }
[data-theme="dark"] .nav-link.active { background: var(--blue); color: #fff; }
@media (prefers-color-scheme: dark) { [data-theme="system"] .nav-link.active { background: var(--blue); color: #fff; } }
.nav-link.active .icon { color: var(--blue); }
[data-theme="dark"] .nav-link.active .icon { color: #fff; }
@media (prefers-color-scheme: dark) { [data-theme="system"] .nav-link.active .icon { color: #fff; } }
.nav-button { background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: .7rem; margin-top: .7rem; }
.sidebar-foot form { margin: 0; }
.sidebar-backdrop { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .8rem 1.75rem; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.topbar-title { font-size: 1.2rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }
.role-switch { display: flex; align-items: center; gap: .3rem; background: var(--blue-soft); color: var(--blue); border-radius: 11px; padding: 0 0 0 .6rem; margin: 0; }
.role-switch select { border: 0; background-color: transparent; color: var(--blue); font-weight: 700; font-size: .85rem; padding: .5rem 2rem .5rem .2rem; width: auto; }
.user-chip { display: flex; align-items: center; gap: .6rem; color: var(--text); padding: .25rem .6rem .25rem .25rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.user-chip:hover { color: var(--text); border-color: var(--blue-line); }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip-text strong { font-size: .85rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text small { color: var(--muted); font-size: .72rem; }
.content { padding: 1.75rem; width: 100%; max-width: 1400px; flex: 1; }
.app-footer { padding: 1rem 1.75rem 1.5rem; color: var(--muted); font-size: .8rem; }

/* ---------- Dashboard ---------- */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.welcome h2 { margin: 0; font-size: 1.6rem; }
.welcome p { margin: .1rem 0 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; flex: none; }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-blue { background: var(--blue-soft); color: var(--blue); } .stat-green { background: var(--green-soft); color: var(--green); }
.stat-violet { background: var(--violet-soft); color: var(--violet); } .stat-amber { background: var(--amber-soft); color: var(--amber); }
.stat-red { background: var(--red-soft); color: var(--red); } .stat-sky { background: var(--sky-soft); color: var(--sky); }
.stat-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.setup-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.3rem 1.4rem; background: linear-gradient(120deg, var(--blue-soft), var(--surface)); border-color: var(--blue-line); }
.setup-card h3 { margin-bottom: .2rem; } .setup-card p { margin: 0; }
.exam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.exam-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .3rem; transition: transform .15s, box-shadow .15s; }
.exam-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.exam-card.live { border-color: color-mix(in srgb, var(--green) 40%, var(--border)); }
.exam-card h4 { font-size: 1.08rem; margin: .4rem 0 0; }
.exam-card p { margin: 0; }
.exam-card-top { display: flex; justify-content: space-between; align-items: center; }
.exam-card .btn { margin-top: auto; }
.meta { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .35rem; font-size: .86rem; color: var(--muted); }
.meta li { display: flex; align-items: center; gap: .45rem; }
.countdown { margin-top: auto; text-align: center; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 10px; padding: .55rem; font-variant-numeric: tabular-nums; }
.countdown-lg { font-size: 1.3rem; padding: 1rem; margin-bottom: 1rem; }
.profile-head { display: flex; gap: 1rem; align-items: center; }
.profile-head h3 { margin: 0; }
.profile-head p { margin: 0 0 .4rem; }

/* ---------- Credentials box ---------- */
.cred-box { border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1.25rem; }
.cred-head { display: flex; gap: .8rem; align-items: center; margin-bottom: .7rem; }
.cred-head strong { display: block; } .cred-head small { color: var(--muted); }
.cred-list { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; }
.cred-list dt { color: var(--muted); font-size: .85rem; } .cred-list dd { margin: 0; }
.cred-list code { font-size: 1rem; cursor: copy; background: var(--surface); border: 1px solid var(--border); }
.logo-upload { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.logo-upload img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--border); border-radius: 14px; background: #fff; padding: 4px; }

/* ---------- Exam builder ---------- */
.exam-status-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.2rem 1.4rem; }
.exam-status-card h2 { margin: .45rem 0 .2rem; }
.exam-status-card p { margin: 0; }
.exam-status-card form { margin: 0; }
.q-summary { display: flex; align-items: center; gap: 1.6rem; padding: 1rem 1.4rem; flex-wrap: wrap; }
.q-summary > div:not(.q-add) { display: flex; flex-direction: column; line-height: 1.1; }
.q-summary strong { font-size: 1.5rem; }
.q-summary span { font-size: .78rem; color: var(--muted); }
.q-add { margin-left: auto; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.q-list { list-style: none; padding: 0; margin: 0; }
.q-item { display: flex; gap: 1rem; padding: 1.1rem 1.2rem; margin-bottom: .8rem; }
.q-num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--blue-soft); color: var(--blue); }
.q-main { flex: 1; min-width: 0; }
.q-meta { display: flex; gap: .4rem; margin-bottom: .45rem; }
.q-body { font-weight: 500; margin-bottom: .5rem; overflow-wrap: anywhere; }
.q-opts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .35rem; font-size: .88rem; }
.q-opts li { padding: .4rem .65rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: flex; gap: .4rem; align-items: center; }
.q-opts li.correct { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green); font-weight: 600; }
.q-actions { display: flex; gap: .3rem; align-items: flex-start; }
.q-actions form { margin: 0; }
.opt-editor { display: grid; gap: .5rem; margin: .4rem 0 .7rem; }
.opt-row { display: flex; gap: .5rem; align-items: center; }
.opt-letter { width: 26px; font-weight: 800; color: var(--muted); text-align: center; flex: none; }
.opt-correct { position: relative; cursor: pointer; flex: none; }
.opt-correct input { position: absolute; opacity: 0; }
.opt-correct span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid var(--border-strong); color: transparent; transition: .15s; }
.opt-correct input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.opt-correct input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); }

/* ---------- Results ---------- */
.histogram { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 1rem; }
.hbar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.hbar-fill { width: 100%; background: color-mix(in srgb, var(--red) 70%, var(--surface)); border-radius: 6px 6px 2px 2px; min-height: 3px; height: 0; transition: height .6s ease; }
.hbar-fill.pass { background: linear-gradient(180deg, #4aa3ff, var(--blue)); }
.hbar small { font-size: .68rem; color: var(--muted); margin-top: 4px; }
.hbar b { position: absolute; top: -2px; font-size: .72rem; }
.paper-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; flex-wrap: wrap; }
.paper-total { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.paper-total strong { font-size: 1.6rem; line-height: 1; }
.paper-total span { color: var(--muted); font-size: .85rem; }
.paper-q { padding: 1.1rem 1.3rem; border-left: 4px solid var(--border); }
.paper-q.right { border-left-color: var(--green); }
.paper-q.wrong { border-left-color: var(--red); }
.paper-q.pending { border-left-color: var(--amber); }
.paper-q-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.paper-score { margin-left: auto; font-weight: 800; }
.paper-opts { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .35rem; }
.paper-opts li { padding: .5rem .75rem; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); font-size: .92rem; }
.paper-opts li.picked { border-color: var(--red); background: var(--red-soft); }
.paper-opts li.key { border-color: var(--green); background: var(--green-soft); }
.paper-text { padding: .8rem 1rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; white-space: normal; margin-bottom: .5rem; overflow-wrap: anywhere; }
.mark-box { display: flex; gap: 1rem; flex-wrap: wrap; padding: .8rem; border-radius: 12px; background: var(--amber-soft); margin-top: .6rem; }
.mark-box .field { margin: 0; }
.mark-box .field:first-child { width: 150px; }
.feedback { font-size: .88rem; color: var(--blue); display: flex; gap: .4rem; align-items: center; margin: .4rem 0 0; }
.explanation { font-size: .88rem; background: var(--blue-soft); padding: .6rem .8rem; border-radius: 10px; margin: .6rem 0 0; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: .6rem; justify-content: flex-end; padding: 1rem; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); margin: 0 -1.75rem -1.75rem; }

/* ---------- Student: lobby & result ---------- */
.lobby { max-width: 820px; margin: 0 auto; overflow: hidden; }
.lobby-hero { padding: 2rem 2rem 1.6rem; color: #fff; background: radial-gradient(circle at 85% 0%, rgba(80, 160, 255, .45), transparent 55%), linear-gradient(135deg, var(--navy), var(--navy-2)); }
.lobby-hero h2 { font-size: 1.8rem; margin: .7rem 0 .2rem; }
.lobby-hero p { margin: 0; opacity: .8; }
.lobby-body { padding: 1.6rem 2rem 2rem; }
.lobby-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: -2.8rem 0 1.6rem; }
.lobby-facts > div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .9rem; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.lobby-facts .icon { color: var(--blue); }
.lobby-facts strong { font-size: 1.1rem; }
.lobby-facts span { font-size: .75rem; color: var(--muted); }
.instructions { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.rules { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .5rem; font-size: .9rem; color: var(--muted); }
.rules li { display: flex; gap: .55rem; align-items: center; }
.rules .icon { color: var(--blue); }
.result-hero { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: 1.8rem 2rem; color: #fff; border: 0; background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.result-hero.pass { background: linear-gradient(135deg, #0b4d34, #10794f); }
.result-hero.fail { background: linear-gradient(135deg, var(--navy), #3b2a6b); }
.result-hero h2 { font-size: 1.7rem; margin: .3rem 0; }
.result-hero p { margin: 0; opacity: .85; }
.result-score { display: flex; align-items: center; gap: 1.2rem; max-width: 420px; }
.result-score > .icon { width: 42px; height: 42px; }
.result-score strong { display: block; font-size: 1.3rem; }
.result-score span { display: block; opacity: .85; font-size: .9rem; margin-bottom: .3rem; }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255, 255, 255, .18) 0); }
.ring span { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; background: rgba(5, 18, 45, .55); font-weight: 800; font-size: 1.2rem; }

/* ---------- Exam room ---------- */
.exam-body { background: var(--bg); user-select: none; -webkit-user-select: none; }
.exam-body textarea, .exam-body input { user-select: text; -webkit-user-select: text; }
.exam-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.4rem; background: var(--navy); color: #fff; box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .6); }
.exam-bar-title { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; }
.exam-bar-title div { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.exam-bar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-bar-title small { opacity: .7; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-timer { display: flex; align-items: center; gap: .45rem; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .1); padding: .4rem .9rem; border-radius: 12px; }
.exam-timer.warn { background: var(--accent); color: var(--accent-ink); }
.exam-timer.danger { background: var(--red); color: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .75; } }
.exam-bar-actions { display: flex; align-items: center; gap: .6rem; }
.exam-bar .icon-btn { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.save-state { font-size: .8rem; opacity: .8; display: flex; align-items: center; gap: .3rem; }
.save-state.saving { opacity: 1; color: var(--accent); }
.save-state.error { opacity: 1; color: #ffb4b4; }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; max-width: 1240px; margin: 0 auto; padding: 1.5rem; }
.exam-progress { height: 6px; background: var(--blue-soft); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.exam-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #4aa3ff); transition: width .3s; }
.question { padding: 1.6rem 1.8rem; margin-bottom: 1rem; }
.question-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; flex-wrap: wrap; }
.question-no { font-weight: 800; color: var(--blue); }
.question-no small { color: var(--muted); font-weight: 500; }
.flag-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 600; color: var(--muted); cursor: pointer; padding: .35rem .7rem; border-radius: 9px; border: 1px solid var(--border); }
.flag-toggle input { position: absolute; opacity: 0; }
.flag-toggle:has(input:checked) { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.question-body { font-size: 1.12rem; line-height: 1.65; margin-bottom: 1.2rem; font-weight: 500; overflow-wrap: anywhere; }
.choices { display: grid; gap: .65rem; }
.choices-row { grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border: 1.5px solid var(--border-strong); border-radius: 14px; cursor: pointer; background: var(--surface); transition: .12s; position: relative; }
.choice:hover { border-color: var(--blue); background: var(--blue-soft); }
.choice input { position: absolute; opacity: 0; }
.choice-letter { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-weight: 800; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); transition: .12s; }
.choice-text { flex: 1; overflow-wrap: anywhere; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.choice:has(input:checked) .choice-letter { background: var(--blue); color: #fff; border-color: var(--blue); }
.choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); }
.answer-input { font-size: 1.05rem !important; }
.exam-nav { display: flex; justify-content: space-between; gap: .6rem; }
.exam-side .card { position: sticky; top: 84px; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: .7rem 0 1rem; max-height: 330px; overflow: auto; padding: 2px; }
.palette button { aspect-ratio: 1; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 9px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; position: relative; }
.palette button:hover { border-color: var(--blue); }
.palette button.answered { background: var(--blue); border-color: var(--blue); color: #fff; }
.palette button.flagged::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.palette button.current { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); border-color: var(--blue); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem .8rem; font-size: .75rem; color: var(--muted); margin-bottom: .8rem; }
.legend span { display: flex; align-items: center; gap: .3rem; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1.5px solid var(--border-strong); }
.legend .lg-answered { background: var(--blue); border-color: var(--blue); }
.legend .lg-flagged { background: var(--accent); border-color: var(--accent); border-radius: 50%; }
.answered-count { font-size: .9rem; margin-bottom: .8rem; }
.modal { position: fixed; inset: 0; background: rgba(5, 14, 32, .55); display: grid; place-items: center; z-index: 100; padding: 1rem; backdrop-filter: blur(3px); }
.modal-card { max-width: 440px; width: 100%; margin: 0; }
.modal-card form { margin: 0; }
.offline-banner { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; padding: .7rem 1.2rem; border-radius: 12px; font-weight: 600; z-index: 90; box-shadow: var(--shadow-lg); }

/* ---------- Statement of result ---------- */
.statement { background: #fff; color: #10203e; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.2rem 2.4rem; max-width: 900px; margin: 0 auto 1.5rem; --muted: #5b6b85; }
.statement .muted { color: #5b6b85; }
.statement-head { display: flex; align-items: center; gap: 1.2rem; padding-bottom: 1rem; border-bottom: 3px double #0b2a5b; }
.statement-head h2 { margin: 0; font-size: 1.6rem; color: #0b2a5b; }
.statement-head p { margin: 0; color: #5b6b85; }
.statement-head .motto { font-style: italic; }
.statement-logo { width: 74px; height: 74px; object-fit: contain; }
.statement-title { text-align: center; font-weight: 800; letter-spacing: .14em; margin: 1.1rem 0; color: #fff; background: #0b2a5b; padding: .5rem; border-radius: 8px; font-size: .95rem; }
.statement-info { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 0 0 1.2rem; }
.statement-info dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: #5b6b85; font-weight: 700; }
.statement-info dd { margin: 0; font-weight: 700; }
.verified .statement-info { margin-top: 1rem; }
.statement-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.statement-table th { background: #e8f1fd; color: #0b2a5b; text-align: left; padding: .55rem .6rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; border: 1px solid #cfe0fa; }
.statement-table td { padding: .5rem .6rem; border: 1px solid #dbe6f6; }
.statement-table tfoot td { font-weight: 800; background: #f4f7fc; }
.statement-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.statement-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1.2rem 0; }
.statement-summary > div { border: 1px solid #cfe0fa; background: #f4f8fe; border-radius: 12px; padding: .7rem .9rem; display: flex; flex-direction: column; }
.statement-summary span { font-size: .74rem; color: #5b6b85; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.statement-summary strong { font-size: 1.3rem; color: #0b2a5b; }
.verified .statement-summary { grid-template-columns: repeat(3, 1fr); }
.verified .statement-summary > div { background: var(--surface-2); border-color: var(--border); }
.verified .statement-summary strong { color: var(--text); }
.statement-key { font-size: .78rem; color: #5b6b85; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.statement-foot { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 1.5rem; margin-top: 2.6rem; align-items: end; }
.sign { font-size: .8rem; color: #5b6b85; text-align: center; }
.sign span { display: block; border-bottom: 1px solid #10203e; height: 2.2rem; margin-bottom: .3rem; }
.verify { text-align: right; font-size: .8rem; }
.verify strong { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .05em; color: #0b2a5b; }
.verify small { color: #5b6b85; }
.verify-form { display: flex; gap: .6rem; padding: 1rem; }
.verify-form input { font-size: 1.15rem !important; letter-spacing: .12em; text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace; }
.verified-head { display: flex; align-items: center; gap: 1rem; }
.verified-head h3 { margin: 0; color: var(--green); }
.verified-head p { margin: 0; }
.broadsheet { padding: 1.5rem; background: #fff; color: #10203e; }
.broadsheet h2 { color: #0b2a5b; }
.broadsheet .rot span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 170px; display: inline-block; }

/* ---------- Print: login slips, statements ---------- */
.print-body { background: #e9eef7; color: #10203e; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: center; gap: .6rem; padding: .8rem; background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); border-bottom: 1px solid #dbe6f6; margin-bottom: 1.5rem; }
.slips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 1000px; margin: 0 auto 2rem; padding: 0 1rem; }
.slip { background: #fff; border: 1.5px dashed #9fb6dc; border-radius: 12px; padding: .9rem 1rem; break-inside: avoid; page-break-inside: avoid; font-size: .82rem; }
.slip-head { display: flex; align-items: center; gap: .55rem; padding-bottom: .5rem; border-bottom: 1px solid #dbe6f6; margin-bottom: .5rem; }
.slip-head img { width: 32px; height: 32px; object-fit: contain; }
.slip-head strong { display: block; font-size: .85rem; color: #0b2a5b; line-height: 1.2; }
.slip-head small { color: #5b6b85; }
.slip-name { font-weight: 800; font-size: .98rem; }
.slip-sub { color: #5b6b85; font-size: .76rem; margin-bottom: .45rem; }
.slip table { width: 100%; border-collapse: collapse; }
.slip th { text-align: left; font-weight: 500; color: #5b6b85; padding: .14rem 0; width: 45%; }
.slip td { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: .92rem; letter-spacing: .03em; }
.slip-foot { font-size: .66rem; color: #5b6b85; margin-top: .45rem; word-break: break-all; }
.page-break { break-after: page; page-break-after: always; padding: 0 1rem; }

/* ---------- Guest / marketing ---------- */
.guest-body { background: var(--surface); }
.announce { background: var(--surface-2); color: var(--muted); text-align: center; font-size: .82rem; padding: .45rem 1rem; border-bottom: 1px solid var(--border); }
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header-inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.site-logo { display: flex; align-items: center; gap: .6rem; font-size: 1.4rem; color: var(--blue); font-weight: 500; letter-spacing: -.02em; }
.site-logo b { font-weight: 800; }
.site-logo sup { font-size: .7em; color: var(--accent-hover); font-weight: 800; }
.site-nav { display: flex; gap: 1.6rem; flex: 1; }
.site-nav a { color: var(--text); font-weight: 500; font-size: .95rem; }
.site-nav a:hover { color: var(--blue); }
.site-actions { display: flex; align-items: center; gap: .6rem; }
.hero { position: relative; overflow: hidden; padding: 4.5rem 0 4rem; background: radial-gradient(1000px 420px at 85% -10%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 60%), radial-gradient(700px 300px at 0% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%); }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--blue); background: var(--blue-soft); border: 1px solid var(--blue-line); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.2rem; }
.eyebrow-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .2); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 560px; margin: 1.1rem 0 1.6rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; color: var(--muted); font-size: .9rem; }
.hero-points li { display: flex; align-items: center; gap: .4rem; }
.hero-points .icon { color: var(--green); }
.hero-visual { position: relative; }
.mock-window { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; transform: rotate(1.2deg); }
.mock-top { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; background: var(--navy); color: #fff; font-size: .85rem; }
.mock-top > span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.mock-top b { margin-left: .6rem; flex: 1; font-weight: 600; }
.mock-top em { font-style: normal; display: flex; gap: .3rem; align-items: center; background: var(--accent); color: var(--accent-ink); padding: .15rem .55rem; border-radius: 8px; font-weight: 800; }
.mock-body { padding: 1.3rem 1.4rem 1.4rem; }
.mock-q { font-size: .8rem; font-weight: 800; color: var(--blue); }
.mock-text { font-weight: 600; font-size: 1.05rem; margin: .4rem 0 .9rem; }
.mock-opt { padding: .6rem .8rem; border: 1.5px solid var(--border-strong); border-radius: 11px; margin-bottom: .45rem; font-size: .92rem; display: flex; gap: .4rem; align-items: center; }
.mock-opt.selected { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.mock-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 1rem; }
.mock-grid i { font-style: normal; font-size: .62rem; text-align: center; padding: 3px 0; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); }
.mock-grid i.done { background: var(--blue); color: #fff; border-color: var(--blue); }
.mock-grid i.cur { border-color: var(--blue); color: var(--blue); font-weight: 800; }
.mock-badge { position: absolute; left: -1.5rem; bottom: -1.4rem; display: flex; gap: .7rem; align-items: center; background: var(--surface); border: 1px solid var(--border); padding: .7rem 1rem; border-radius: 14px; box-shadow: var(--shadow-lg); }
.mock-badge b { display: block; font-size: .9rem; } .mock-badge small { color: var(--muted); font-size: .75rem; font-family: ui-monospace, Menlo, monospace; }
.feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); flex: none; }
.feature-icon-green { background: var(--green-soft); color: var(--green); }
.feature-icon-red { background: var(--red-soft); color: var(--red); margin-bottom: 1rem; }
.section { padding: 4.5rem 0; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 2.6rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); letter-spacing: -.03em; }
.kicker { display: inline-block; font-size: .8rem; letter-spacing: .12em; font-weight: 600; color: var(--text); margin-bottom: .8rem; }
.promo-card { border: 1px solid var(--blue-line); border-radius: 22px; padding: 1rem 1rem 1.6rem; background: var(--surface); transition: transform .2s, box-shadow .2s; }
.promo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.promo-card h3 { font-size: 1.45rem; margin: 1.2rem .4rem .4rem; letter-spacing: -.02em; }
.promo-card p { margin: 0 .4rem; color: var(--muted); }
.promo-art { height: 230px; border-radius: 16px; display: grid; place-items: center; position: relative; overflow: hidden; }
.art-blue { background: linear-gradient(135deg, #1d4fa8, #8ec2ff); }
.art-navy { background: radial-gradient(circle at 70% 70%, #5aa7ff 0, transparent 45%), linear-gradient(135deg, #0b2a5b, #1d5bc2); }
.art-sky { background: linear-gradient(135deg, #dcecff, #f5f9ff); }
[data-theme="dark"] .art-sky { background: linear-gradient(135deg, #18345f, #23497f); }
.mini-panel { background: #fff; color: #10203e; border-radius: 14px; padding: .9rem 1rem; width: 72%; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45); font-size: .85rem; }
.mini-panel b { display: block; margin-bottom: .5rem; color: #0b2a5b; }
.mini-row { display: flex; justify-content: space-between; align-items: center; padding: .38rem 0; border-top: 1px solid #edf2fa; }
.mini-row em { font-style: normal; font-weight: 800; color: #196bde; }
.toggle { width: 30px; height: 17px; border-radius: 99px; background: #d4def0; position: relative; }
.toggle::after { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fff; top: 2px; left: 2px; }
.toggle.on { background: #196bde; } .toggle.on::after { left: 15px; }
.mini-shield { width: 92px; height: 92px; border-radius: 28px; display: grid; place-items: center; background: linear-gradient(135deg, #20b26a, #0e8a4f); color: #fff; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55); position: absolute; left: 20%; top: 18%; }
.mini-shield .icon { width: 46px; height: 46px; }
.mini-pill { position: absolute; right: 9%; bottom: 20%; background: rgba(255, 255, 255, .95); color: #10203e; padding: .6rem .9rem; border-radius: 12px; font-size: .82rem; font-weight: 700; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55); }
.mini-pill small { font-weight: 500; color: #5b6b85; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem 2rem; margin-top: 3.5rem; }
.feature { display: flex; gap: 1rem; }
.feature h4 { margin: .1rem 0 .2rem; }
.feature p { margin: 0; font-size: .92rem; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); }
.step b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--navy); color: #fff; margin-bottom: .9rem; }
.step p { margin: 0; font-size: .9rem; }
.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; align-items: stretch; }
.price-card { position: relative; border: 1px solid var(--blue-line); border-radius: 20px; padding: 1.6rem 1.4rem; background: var(--surface); display: flex; flex-direction: column; }
.price-card.hot { border: 2px solid var(--blue); box-shadow: var(--shadow-lg); }
.price-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 800; padding: .25rem .8rem; border-radius: 99px; white-space: nowrap; }
.price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; margin: .2rem 0 1rem; }
.price small { font-size: .85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .55rem; font-size: .92rem; flex: 1; }
.price-card li { display: flex; gap: .5rem; align-items: center; }
.price-card li .icon { color: var(--green); }
.cta-band { background: linear-gradient(120deg, var(--navy), var(--navy-2)); color: #fff; padding: 3rem 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-inner h2 { font-size: 1.7rem; margin-bottom: .3rem; }
.cta-inner p { margin: 0; opacity: .8; }
.site-footer { padding: 2rem 0; border-top: 1px solid var(--border); }
.site-footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-footer p { margin: .4rem 0 0; font-size: .88rem; }
.auth-wrap { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 2.5rem 1rem; background: radial-gradient(800px 380px at 80% 0%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 60%); }
.auth-card { display: grid; grid-template-columns: 1fr 1fr; max-width: 940px; width: 100%; overflow: hidden; margin: 0; box-shadow: var(--shadow-lg); }
.auth-side { background: radial-gradient(circle at 90% 10%, rgba(80, 160, 255, .5), transparent 50%), linear-gradient(150deg, var(--navy), var(--navy-2)); color: #fff; padding: 2.6rem; display: flex; flex-direction: column; }
.auth-side h2 { font-size: 1.9rem; letter-spacing: -.02em; }
.auth-side p { opacity: .8; }
.auth-points { list-style: none; padding: 0; margin: auto 0 0; display: grid; gap: .7rem; }
.auth-points li { display: flex; gap: .6rem; align-items: center; font-size: .92rem; }
.auth-points .icon { color: var(--accent); }
.auth-form { padding: 2.6rem; }
.auth-form h3 { font-size: 1.5rem; margin-bottom: 1.2rem; }
.error-code { font-size: 4rem; font-weight: 800; color: var(--blue); letter-spacing: -.04em; line-height: 1; margin-bottom: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .grid-2-1 { grid-template-columns: 1fr; }
    .pricing { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .exam-layout { grid-template-columns: minmax(0, 1fr) 250px; }
}
@media (max-width: 900px) {
    .app-shell { background: none; }
    .only-mobile { display: inline-flex !important; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(5, 14, 32, .5); z-index: 35; }
    .topbar { padding: .7rem 1rem; }
    .content { padding: 1.1rem; }
    .sticky-actions { margin: 0 -1.1rem -1.1rem; }
    .user-chip-text { display: none; }
    .grid-2, .grid-3, .feature-grid { grid-template-columns: 1fr; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { max-width: 520px; margin: 1rem auto 0; }
    .site-nav { display: none; }
    .auth-card { grid-template-columns: minmax(0, 1fr); }
    .auth-form { padding: 1.6rem 1.25rem; }
    .auth-side { display: none; }
    .exam-layout { grid-template-columns: 1fr; padding: 1rem; }
    .exam-side { position: fixed; inset: auto 0 0 0; z-index: 60; transform: translateY(calc(100% + 80px)); visibility: hidden; transition: transform .25s, visibility .25s; }
    .exam-side.open { transform: none; visibility: visible; }
    .exam-side .card { position: static; margin: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, .35); }
    .palette { grid-template-columns: repeat(8, 1fr); }
    .statement { padding: 1.3rem; }
    .statement-info, .statement-summary { grid-template-columns: repeat(2, 1fr); }
    .statement-foot { grid-template-columns: 1fr 1fr; }
    .verify { grid-column: 1 / -1; text-align: left; }
    .slips { grid-template-columns: repeat(2, 1fr); }
    .lobby-facts { grid-template-columns: repeat(2, 1fr); margin-top: -2.2rem; }
}
@media (max-width: 600px) {
    body { font-size: 14.5px; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .pricing, .steps { grid-template-columns: 1fr; }
    .hide-sm { display: none !important; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
    .stat { padding: .85rem; gap: .6rem; }
    .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
    .stat-value { font-size: 1.25rem; }
    .exam-bar { padding: .6rem .8rem; gap: .5rem; flex-wrap: wrap; }
    .exam-bar-title small, .save-state { display: none; }
    .exam-timer { font-size: 1.05rem; padding: .3rem .6rem; }
    .question { padding: 1.1rem; }
    .question-body { font-size: 1.02rem; }
    .choices-row { grid-template-columns: 1fr; }
    .lobby-hero, .lobby-body { padding-left: 1.2rem; padding-right: 1.2rem; }
    .result-hero { padding: 1.4rem; }
    .search { min-width: 0; width: 100%; }
    .filters select { min-width: 0; flex: 1; }
    .slips { grid-template-columns: 1fr; }
    .mock-badge { left: .5rem; }
    .q-item { flex-wrap: wrap; }
    .q-actions { width: 100%; justify-content: flex-end; }
    .welcome h2 { font-size: 1.3rem; }
    .verify-form { flex-direction: column; }
}

/* ---------- Print ---------- */
@media print {
    @page { margin: 12mm; }
    body, .print-body, .app-body { background: #fff !important; color: #000; }
    .sidebar, .topbar, .app-footer, .no-print, .print-toolbar, .page-actions, .alert, .sidebar-backdrop { display: none !important; }
    .content { padding: 0; max-width: none; }
    .statement { box-shadow: none; border: 0; padding: 0; max-width: none; }
    .statement-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .statement-table th, .statement-summary > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .slips { grid-template-columns: repeat(3, 1fr); padding: 0; gap: 6px; }
    .slip { border-color: #777; }
    .page-break { padding: 0; }
    .page-break:last-child { break-after: auto; page-break-after: auto; }
    .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Exam security (v1.1) ---------- */
.gate { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 1rem;
    background: radial-gradient(800px 400px at 50% 0%, rgba(75, 142, 241, .35), transparent 60%), linear-gradient(160deg, #071a3d, #0b2a5b); }
.gate-warn { background: radial-gradient(800px 400px at 50% 0%, rgba(255, 107, 107, .35), transparent 60%), linear-gradient(160deg, #2a0b12, #4a1020); }
.gate-card { max-width: 460px; width: 100%; margin: 0; text-align: left; }
.gate-card .feature-icon { margin-bottom: .8rem; }
.gate-card.center { text-align: center; }
.watermark { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 70px 90px; padding: 40px; transform: rotate(-24deg) scale(1.4); opacity: .07; }
.watermark span { font-weight: 800; font-size: 15px; white-space: nowrap; color: var(--text); user-select: none; }
.cam-preview { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: #000; border: 2px solid rgba(255, 255, 255, .35); transform: scaleX(-1); }
.rule-warn { color: var(--text) !important; font-weight: 600; background: var(--red-soft); border-radius: 10px; padding: .55rem .7rem; }
.rule-warn .icon { color: var(--red) !important; }
@media print { .exam-body * { display: none !important; } }

/* ---------- Live invigilation ---------- */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; padding: 1rem 1.25rem 1.25rem; }
.live-card { border: 1px solid var(--border); border-radius: 14px; padding: .9rem 1rem; background: var(--surface); display: flex; flex-direction: column; gap: .55rem; position: relative; }
.live-card.st-offline { opacity: .78; }
.live-card.st-locked { border-color: var(--red); background: color-mix(in srgb, var(--red-soft) 55%, var(--surface)); }
.live-card.st-paused { border-color: var(--amber); }
.live-card.alert-flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 40%, transparent); }
.live-top { display: flex; gap: .7rem; align-items: center; }
.live-top .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-top .grow small { color: var(--muted); font-size: .76rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-snap { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex: none; cursor: zoom-in; }
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; font-size: .78rem; }
.live-stats div { background: var(--surface-2); border-radius: 8px; padding: .35rem .5rem; }
.live-stats b { display: block; font-size: .95rem; font-variant-numeric: tabular-nums; }
.live-stats .bad b { color: var(--red); }
.live-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.live-actions .btn { padding: .32rem .55rem; font-size: .76rem; }
.live-event { font-size: .76rem; color: var(--muted); }
.live-event.v { color: var(--red); font-weight: 600; }
.live-feed { max-height: 520px; overflow: auto; }
.live-feed li { align-items: flex-start; }
.live-feed .when { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-green { background: var(--green); } .dot-amber { background: var(--amber); } .dot-red { background: var(--red); } .dot-grey { background: var(--border-strong); }
.report-item { border-left: 4px solid var(--amber); }
.report-item.serious { border-left-color: var(--red); }
.report-item.info { border-left-color: var(--blue); }
.snap-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; padding: 1rem 1.25rem; }
.snap-strip figure { margin: 0; font-size: .7rem; color: var(--muted); text-align: center; }
.snap-strip img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.timeline { list-style: none; margin: 0; padding: .5rem 1.25rem 1rem; }
.timeline li { display: flex; gap: .7rem; padding: .4rem 0; font-size: .86rem; border-bottom: 1px dashed var(--border); }
.timeline li.v { color: var(--red); font-weight: 600; }
.timeline time { color: var(--muted); font-size: .76rem; width: 70px; flex: none; }
.changes { margin: .35rem 0 0; padding: 0; list-style: none; font-size: .8rem; }
.changes li { padding: .1rem 0; }
.changes del { color: var(--red); text-decoration: line-through; background: var(--red-soft); padding: 0 .25rem; border-radius: 4px; }
.changes ins { color: var(--green); text-decoration: none; background: var(--green-soft); padding: 0 .25rem; border-radius: 4px; }
.ai-row { display: grid; grid-template-columns: 34px 1fr; gap: .8rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.ai-row.excluded { opacity: .45; }
.ai-row .q-body { margin-bottom: .4rem; }
.ai-opts { display: grid; gap: .3rem; margin: .4rem 0; }
.ai-opts label { display: flex; gap: .5rem; align-items: center; font-size: .9rem; padding: .3rem .55rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.ai-opts label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.ai-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .82rem; }
.ai-meta input, .ai-meta select { width: auto; padding: .3rem .5rem; font-size: .82rem; }
.ai-warn { font-size: .8rem; color: var(--amber); font-weight: 600; }
.dropzone { border: 2px dashed var(--blue-line); border-radius: 16px; padding: 1.6rem; text-align: center; background: var(--blue-soft); }
.dropzone input[type=file] { margin-top: .8rem; background: var(--surface); }
.owner-line { font-size: .78rem; color: var(--muted); }
.owner-line strong { color: var(--text); }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; max-width: 380px; box-shadow: var(--shadow-lg); animation: toastIn .2s ease; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }
.text-red { color: var(--red) !important; }
.filters input[type=date] { width: auto; padding-top: .45rem; padding-bottom: .45rem; }
.ai-opts label input:not([type=checkbox]) { border: 0 !important; background: transparent !important; padding: .1rem .3rem !important; box-shadow: none !important; }
.exam-owner { text-align: center; font-size: .72rem; color: var(--muted); padding: 0 1rem 1.2rem; }
.statement-owner { text-align: center; font-size: .68rem; color: #8a97ad; margin: 1.4rem 0 0; }
.app-footer strong { color: var(--text); }
.filters input[type=date] { width: auto !important; min-width: 150px; }
.card .sticky-actions { margin: 0; border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Student photos (v1.2) ---------- */
.student-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); display: inline-grid; place-items: center; color: var(--muted); }
.student-photo-sm { width: 30px; height: 30px; }
.student-photo-lg { width: 112px; height: 112px; }
.student-photo-lg .icon { width: 44px; height: 44px; }
.photo-box { display: flex; gap: 1rem; align-items: center; }
.photo-box form { margin: 0; }
.photo-box label.btn { cursor: pointer; }
.cropper-card { max-width: 380px; }
.cropper-stage { position: relative; width: 300px; height: 300px; margin: .6rem auto; border-radius: 14px; overflow: hidden; touch-action: none; background: #111; }
.cropper-stage canvas { display: block; cursor: grab; }
.cropper-stage canvas:active { cursor: grabbing; }
.cropper-mask { position: absolute; inset: 0; pointer-events: none; border-radius: 14px; box-shadow: inset 0 0 0 9999px rgba(5, 14, 32, .45); -webkit-mask: radial-gradient(circle at center, transparent 0 142px, #000 143px); mask: radial-gradient(circle at center, transparent 0 142px, #000 143px); }
.cropper-zoom { display: flex; align-items: center; gap: .6rem; margin: .4rem 0; }
.cropper-zoom input { flex: 1; accent-color: var(--blue); }
.cropper-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.exam-id { display: flex; align-items: center; gap: .6rem; }
.exam-id .student-photo { width: 40px; height: 40px; border-color: rgba(255, 255, 255, .6); box-shadow: none; }
.statement-photo { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; border: 1px solid #cfe0fa; }
.statement-info-wrap { display: flex; gap: 1.2rem; align-items: flex-start; margin-bottom: 1.2rem; }
.statement-info-wrap .statement-info { flex: 1; margin: 0; }
.live-photos { display: flex; gap: 4px; flex: none; }
.live-photos .student-photo { width: 48px; height: 48px; border-radius: 8px; }
.lobby-id { display: flex; align-items: center; gap: .8rem; margin-top: .9rem; }
.lobby-id .student-photo { width: 56px; height: 56px; border-color: rgba(255, 255, 255, .7); box-shadow: none; }
.slip-photo { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; float: right; border: 1px solid #dbe6f6; }

/* ---------- Bookmarks (v1.2) ---------- */
.bookmark-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 600; color: var(--muted); cursor: pointer; padding: .4rem .75rem; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); }
.bookmark-toggle input { position: absolute; opacity: 0; }
.bookmark-toggle:hover { border-color: var(--amber); color: var(--amber); }
.bookmark-toggle:has(input:checked) { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.bookmark-toggle:has(input:checked) .icon { fill: currentColor; }
.bookmark-toggle:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); }
.bookmarks { margin: 0 0 1rem; }
.bookmarks h4 { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.bookmarks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; max-height: 220px; overflow: auto; }
.bookmarks li button { width: 100%; text-align: left; display: flex; gap: .5rem; align-items: center; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 9px; padding: .4rem .55rem; font: inherit; font-size: .82rem; cursor: pointer; }
.bookmarks li button:hover { border-color: var(--amber); }
.bookmarks li button b { flex: none; width: 26px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--amber-soft); color: var(--amber); font-size: .74rem; }
.bookmarks li button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmarks li button.answered b { background: var(--blue); color: #fff; }
.bookmarks .empty-note { font-size: .8rem; color: var(--muted); }
.legend .lg-flagged { background: var(--accent); border-color: var(--accent); border-radius: 50%; }
.exam-nav .btn-bookmark-next { border-color: color-mix(in srgb, var(--amber) 45%, transparent); color: var(--amber); }
.submit-bookmarks { margin: .4rem 0 1rem; }
.bookmarks ul { grid-template-columns: minmax(0, 1fr); }
.bookmarks li { min-width: 0; }
.bookmarks li button { min-width: 0; }
.bookmarks li button span { min-width: 0; flex: 1; }

/* ---------- Assignments (v1.3) ---------- */
.access-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .8rem; }
.access-modes .check:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.pick-list li label { display: flex; align-items: center; gap: .7rem; padding: .55rem 1.25rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.pick-list li label:hover { background: color-mix(in srgb, var(--blue-soft) 50%, transparent); }
.pick-list li label:has(input:checked) { background: var(--blue-soft); }
.pick-list small { display: block; color: var(--muted); font-size: .76rem; }
.check-inline { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; font-weight: 600; cursor: pointer; }
.subject-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .4rem; }
@media (max-width: 600px) { .access-modes { grid-template-columns: 1fr; } }

/* ---------- Two-step login (v1.4) ---------- */
.twofa-card { max-width: 440px; width: 100%; }
.code-input { font-size: 1.5rem !important; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; max-width: 260px; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0; }
.inline-form input { width: auto !important; }
.w-code-wide { max-width: 160px; }
.setup-steps { padding-left: 1.2rem; display: grid; gap: 1rem; }
.qr-wrap { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border); line-height: 0; }
.qr svg { width: 180px; height: 180px; }
.setup-key { font-size: 1rem; letter-spacing: .05em; word-break: break-all; cursor: copy; }
.recovery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .4rem; }
.recovery-grid code { text-align: center; font-size: 1rem; padding: .4rem; background: var(--surface); border: 1px solid var(--border); }
.backup-table td { vertical-align: middle; }
.input-sm { padding: .4rem .6rem !important; font-size: .85rem !important; max-width: 260px; }
.list li.wrap-li { align-items: flex-start; flex-wrap: wrap; }

/* ---------- v2.0 registration ---------- */
.register-card { max-width: 760px; width: 100%; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.reg-card.highlight { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.reg-card h3 { margin-bottom: .2rem; }

/* ---------- Question figures ---------- */
.q-figure { margin: 1rem 0; display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; max-width: 100%; }
.q-figure img { max-width: min(100%, 640px); max-height: 460px; height: auto; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.q-fig-ai img { padding: .4rem; }
.q-figure figcaption { font-size: .85rem; color: var(--muted); font-style: italic; }
.fig-svg { max-width: 100%; height: auto; color: var(--text); }
.fig-table-wrap { max-width: 100%; overflow-x: auto; }
.fig-table { border-collapse: collapse; font-size: .95rem; min-width: 200px; }
.fig-table th, .fig-table td { border: 1px solid var(--border-strong, var(--border)); padding: .45rem .8rem; text-align: left; }
.fig-table th { background: var(--surface-2); font-weight: 700; }
.figures-panel { border: 1px dashed var(--border); border-radius: 14px; padding: 1rem; margin-bottom: 1.25rem; background: var(--surface-2); }
.figures-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.figure-row { display: flex; gap: 1rem; align-items: flex-start; border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; flex-wrap: wrap; }
.figure-thumb { flex: 1 1 280px; min-width: 0; background: var(--surface); border-radius: 12px; padding: .5rem 1rem; border: 1px solid var(--border); }
.figure-thumb .q-figure { margin: .25rem 0; }
.figure-thumb .fig-svg { max-height: 220px; width: auto; }
.figure-thumb img { max-height: 200px; }
.figure-meta { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.figure-editor { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.figure-preview { position: sticky; top: 1rem; overflow: auto; }
.figure-preview .fig-svg { width: 100%; }
@media (max-width: 960px) { .figure-editor { grid-template-columns: 1fr; } .figure-preview { position: static; } }
.seg-links a { font-size: .87rem; font-weight: 600; padding: .45rem .9rem; border-radius: 9px; color: var(--muted); text-decoration: none; }
.seg-links a.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow-sm); }
.q-context { border-left: 4px solid var(--blue); }
.upload-preview { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--border); margin-top: .5rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }
.table-editor-grid { display: grid; gap: 4px; margin-bottom: .75rem; overflow-x: auto; }
.table-editor-grid input { padding: .45rem .55rem; font-size: .9rem; border-radius: 8px; min-width: 0; }
.question .q-figure img, .paper-q .q-figure img { cursor: zoom-in; }
.q-figure.zoomed { position: fixed; inset: 0; z-index: 400; margin: 0; background: rgba(5, 12, 26, .88); align-items: center; justify-content: center; padding: 2rem; cursor: zoom-out; }
.q-figure.zoomed img { max-width: 96vw; max-height: 88vh; cursor: zoom-out; }
.q-figure.zoomed figcaption { color: #fff; }

/* ---------- Sessions, classes, academic setup ---------- */
.dropdown-details { position: relative; display: inline-block; }
.dropdown-details > summary { list-style: none; }
.dropdown-details > summary::-webkit-details-marker { display: none; }
.details-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(360px, 88vw); box-shadow: var(--shadow-lg, 0 20px 50px rgba(15, 27, 51, .18)); }
.details-pop hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.card-foot { padding: .9rem 1.25rem; border-top: 1px solid var(--border); align-items: center; }
.setup-hero { max-width: 760px; margin: 1rem auto; text-align: left; }
.setup-hero h2 { margin: .75rem 0 .35rem; }
.session-card.is-active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.term-table input { min-width: 130px; padding: .45rem .6rem; font-size: .9rem; }
.term-table td:first-child input { min-width: 200px; }
.term-table .w-num { min-width: 80px; width: 90px; }
.table select.compact, .table input.compact { padding: .4rem .55rem; font-size: .88rem; min-width: 120px; }
.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .85rem; }
.check-row { display: flex; align-items: center; gap: .55rem; padding: .35rem 0; font-size: .93rem; cursor: pointer; }
.inline-field { display: flex; align-items: center; gap: .6rem; margin: 0; }
.inline-field label { margin: 0; white-space: nowrap; }
.px { padding: .75rem 1.25rem 0; margin: 0; }

/* ---------- Mark entry ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.filter-bar .field { margin: 0; min-width: 180px; flex: 1 1 180px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.tile { color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: .5rem; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md, 0 10px 30px rgba(15, 27, 51, .12)); }
.tile h3 { margin: 0; }
.marks-layout { align-items: start; }
.marks-table td, .marks-table th { vertical-align: middle; }
.mark-input { width: 84px; text-align: center; padding: .4rem .3rem; font-weight: 600; }
.mark-input.from-online, .legend-online { background: var(--blue-soft); color: var(--blue); }
.legend-online { padding: 0 .35rem; border-radius: 4px; }
.marks-table .mark-input.invalid, .mark-input.invalid { border-color: var(--red); background: var(--red-soft) !important; color: var(--red) !important; }
.center { text-align: center; }
.rating-select { width: 64px; padding: .35rem; text-align: center; }
.comment-input { min-width: 260px; width: 100%; }
.vertical-th { height: 150px; vertical-align: bottom !important; padding-bottom: .6rem !important; }
.vertical-th span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: .8rem; }
.traits-table td, .traits-table th { padding: .4rem .35rem; }
.comments-table td { vertical-align: top; }

/* ---------- Report template editor ---------- */
.tpl-editor { display: flex; flex-direction: column; gap: 1.25rem; }
.tpl-editor h4 { margin: .25rem 0 .6rem; }
.rep-row { display: flex; gap: .6rem; align-items: flex-end; margin-bottom: .5rem; flex-wrap: wrap; }
.rep-row .field { margin: 0; min-width: 90px; }
.rep-row .field.grow, .rep-row .grow { flex: 1 1 180px; }
.rep-row .icon-btn { margin-bottom: .3rem; }
.rep-stack .field:first-child { max-width: 90px; }
.compact-table td, .compact-table th { padding: .35rem .5rem; font-size: .88rem; }
.check-columns { columns: 3 220px; column-gap: 1.5rem; }
.check-columns .check-row { break-inside: avoid; }
.comment-cfg { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; background: var(--surface-2); }
.img-slot { display: flex; gap: 1rem; align-items: center; border: 1px dashed var(--border); border-radius: 14px; padding: .75rem; }
.img-slot-preview { width: 96px; height: 96px; border-radius: 10px; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 16px 16px; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; border: 1px solid var(--border); }
.img-slot-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sticky-actions { position: sticky; bottom: .75rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; z-index: 20; box-shadow: var(--shadow-lg, 0 20px 50px rgba(15, 27, 51, .18)); }
.tpl-card { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.tpl-card h3 { margin: 0 0 .25rem; }
.tpl-swatch { width: 56px; height: 56px; border-radius: 14px; position: relative; flex: none; }
.tpl-swatch span { position: absolute; left: 8px; right: 8px; bottom: 10px; height: 8px; border-radius: 4px; }
.grow { flex: 1; min-width: 0; }
input[type="color"] { height: 42px; padding: 4px; min-width: 70px; }

/* ---------- ID cards ---------- */
.idt-row { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.idt-preview { flex: none; }
.idt-preview .idc { zoom: 1.15; }
.idt-side { position: sticky; top: 1rem; }
.idt-side .idc { zoom: 1.05; }
.scroll-list { max-height: 220px; overflow: auto; padding-right: .5rem; }
.verify-card { margin: 0 auto; }
.verify-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.25rem; text-align: left; margin: 1.25rem auto; max-width: 420px; }
.verify-list dt { color: var(--muted); }
.verify-list dd { margin: 0; font-weight: 600; }
.feature-icon-amber { background: var(--amber-soft); color: var(--amber); margin-bottom: 1rem; }
.gate-time .gate-card { border-top: 4px solid var(--amber); }
.time-warning-left { font-size: 1.6rem; font-weight: 800; color: var(--amber); margin: .25rem 0 1rem; font-variant-numeric: tabular-nums; }
.btn-col-left { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }

/* ---------- Examinations (subject papers) ---------- */
.event-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.event-head h2 { margin: .4rem 0 .2rem; }

.chip-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 .2rem; font-size: 1rem; line-height: 1; }
.chip-x:hover { color: var(--red); }
.event-card { margin-bottom: 1rem; }
.event-card .card-head h3 a { color: inherit; }
.paper-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .9rem 1.25rem; }
.paper-chip { display: inline-flex; gap: .45rem; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: .4rem .7rem; font-size: .88rem; color: inherit; text-decoration: none; background: var(--surface-2); }
.paper-chip:hover { border-color: var(--blue); }
.paper-chip .n { font-weight: 700; color: var(--blue); }
.paper-chip.empty .n { color: var(--amber); }
.exam-group-title { margin: 1.25rem 0 .6rem; font-size: 1rem; color: var(--muted); }
.tt-cell label { display: flex; align-items: center; gap: .4rem; margin: .15rem 0; font-size: .78rem; color: var(--muted); }
.tt-cell label span { width: 52px; flex: none; }
.tt-cell input[type="datetime-local"] { min-width: 0; width: 190px; padding: .3rem .45rem; font-size: .82rem; }
.tt-cell .w-num { width: 74px; padding: .3rem .45rem; }
.event-table select.compact { max-width: 170px; }
.paper-actions { white-space: nowrap; } .paper-actions .btn { margin-bottom: .3rem; } .mt-1 { margin-top: .35rem; }
.rc-card-box { margin: 1rem auto; text-align: center; }
.rc-card-box form { text-align: left; }
.serial-input { font-size: 1.5rem; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- Attendance ---------- */
.inline { display: inline; margin: 0; }
.w-100 { width: 100%; justify-content: center; }
.att-feed { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.att-feed li { padding-bottom: .6rem; border-bottom: 1px dashed var(--border); }
.att-video-wrap { position: relative; background: #0b1220; aspect-ratio: 4 / 3; max-height: 62vh; overflow: hidden; }
.att-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-video-frame { position: absolute; inset: 18% 22%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .28); pointer-events: none; }
.att-video-idle { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #cbd5e1; padding: 1.5rem; background: #0b1220; }
.att-video-idle .icon { width: 54px; height: 54px; margin: 0 auto .6rem; color: #60a5fa; }
.att-video-idle[hidden] { display: none; }
.att-cam-select { width: auto; max-width: 200px; padding: .35rem .5rem; font-size: .82rem; }
.att-result { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.25rem; border-top: 1px solid var(--border); border-left: 6px solid var(--blue); background: var(--blue-soft); }
.att-result.ok { border-left-color: var(--green); background: var(--green-soft); }
.att-result.warn { border-left-color: var(--amber); background: var(--amber-soft); }
.att-result.bad { border-left-color: var(--red); background: var(--red-soft); }
.att-result-photo { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; font-size: 1.3rem; }
.att-result-photo img { width: 100%; height: 100%; object-fit: cover; }
.att-result-name { font-weight: 800; font-size: 1.15rem; }
.att-result-msg { font-weight: 600; margin-top: .2rem; }
.att-manual { display: flex; gap: .5rem; }
.att-manual input { flex: 1; }
.att-checks { list-style: none; margin: 0; padding: .5rem 1.25rem 0; display: grid; gap: .2rem; }
.att-checks li { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.att-checks li .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--border-strong, #cbd5e1); flex: none; }
.att-checks li.ok .dot { background: var(--green); } .att-checks li.bad .dot { background: var(--red); } .att-checks li.warn .dot { background: var(--amber); }
.att-checks li small { display: block; color: var(--muted); font-size: .8rem; }
.att-checks li.bad small { color: var(--red); }
.att-log-ok { color: var(--green); } .att-log-bad { color: var(--red); } .att-log-warn { color: var(--amber); }
.att-map { height: 380px; border-bottom: 1px solid var(--border); z-index: 0; }
.att-zone-list { list-style: none; margin: 0; padding: 0; }
.att-zone-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem 1.25rem; border-bottom: 1px solid var(--border); }
.att-zone-list li.off { opacity: .6; }
.att-guide { padding-left: 1.1rem; }
.att-rate { font-weight: 700; padding: .15rem .45rem; border-radius: 6px; }
.att-rate.good { color: var(--green); background: var(--green-soft); } .att-rate.mid { color: var(--amber); background: var(--amber-soft); } .att-rate.low { color: var(--red); background: var(--red-soft); }
.att-register { font-size: .78rem; }
.att-register th, .att-register td { padding: .35rem .3rem; }
.att-register th span { display: block; color: var(--muted); font-weight: 500; font-size: .7rem; }
.att-cell { font-weight: 700; }
.att-present { color: var(--green); } .att-late { color: var(--amber); } .att-half_day { color: var(--violet); } .att-absent, .att-none { color: var(--red); } .att-excused { color: var(--blue); }
@media print { .att-report { box-shadow: none; border: 0; } .att-register { font-size: 9px; } }
.att-zone-list .btn-row { flex-wrap: nowrap; }
.att-hero { padding: 1.4rem 1.5rem; background: linear-gradient(120deg, var(--blue-soft), var(--surface)); }
.att-hero-main { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.att-hero-title { margin: .25rem 0; font-size: 1.35rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.att-big-btn { font-size: 1.2rem; padding: 1rem 2.2rem; border-radius: 999px; background: var(--green); color: #fff; box-shadow: 0 10px 24px -10px var(--green); }
.att-big-btn:hover { filter: brightness(.95); color: #fff; }
.att-big-btn.out { background: var(--blue); box-shadow: 0 10px 24px -10px var(--blue); }
.att-big-btn .icon { width: 22px; height: 22px; }
.att-big-done { font-weight: 700; color: var(--green); display: flex; gap: .4rem; align-items: center; }
.att-face-guide { position: absolute; left: 50%; top: 50%; width: 46%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%); border: 3px dashed rgba(255, 255, 255, .85); border-radius: 50%; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .25); pointer-events: none; max-height: 86%; }
.att-face-guide[hidden], .att-video-frame[hidden] { display: none; }
.att-cam-status { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(11, 18, 32, .82); color: #fff; padding: .45rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 600; max-width: 92%; text-align: center; }
.att-cam-status[hidden] { display: none; }
video.mirror { transform: scaleX(-1); }
.att-pin-row { display: flex; gap: .6rem; margin-top: .4rem; }
.att-pin-row input { max-width: 220px; letter-spacing: .5em; text-align: center; font-size: 1.4rem; }
.att-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: inline-block; }
.att-thumb.sm { width: 34px; height: 34px; border-radius: 7px; margin: .2rem .2rem 0 0; }
.att-pin-code { font-size: 1.1rem; font-weight: 800; letter-spacing: .2em; }
.att-checks-card { align-self: start; }
@media (max-width: 700px) { .att-big-btn { width: 100%; justify-content: center; } .att-hero-main { flex-direction: column; align-items: stretch; } }
.att-public { padding-top: 2rem; padding-bottom: 3rem; }
.att-public .att-hero { margin-bottom: 1.25rem; }
.text-upper { text-transform: uppercase; }
.att-home-btn { background: var(--green); color: #fff; }
.att-home-btn:hover { filter: brightness(.95); color: #fff; }
.site-nav a { white-space: nowrap; }
@media (max-width: 1200px) { .site-nav { gap: 1.1rem; } .site-nav a { font-size: .9rem; } }
.att-marks { display: inline-flex; gap: .3rem; align-items: center; }
.att-mark { position: relative; cursor: pointer; }
.att-mark input { position: absolute; opacity: 0; pointer-events: none; }
.att-mark span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); font-weight: 800; color: var(--muted); background: var(--surface-2); }
.att-mark:hover span { border-color: var(--blue-line); }
.att-mark input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.att-mark-green input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.att-mark-amber input:checked + span { background: var(--amber); border-color: var(--amber); color: #fff; }
.att-mark-red input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.att-mark-blue input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.att-reg-table input[type=text] { min-width: 220px; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; }
.perm-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .9rem .7rem; margin: 0; }
.perm-group legend { font-weight: 700; font-size: .85rem; padding: 0 .3rem; color: var(--blue); }
.perm-preset { background: #4f46e5; color: #fff; }
.perm-preset:hover { filter: brightness(1.08); color: #fff; }
.perm-preset.active { box-shadow: 0 0 0 3px color-mix(in srgb, #4f46e5 35%, transparent); }
.module-boxes { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem; }
.module-boxes legend { font-weight: 600; padding: 0 .35rem; }
.module-boxes .hint { grid-column: 1 / -1; }
.q-ctx-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.q-ctx-row > .field { min-width: 180px; margin: 0; }
.q-ctx-form { margin-top: .6rem; display: grid; gap: .6rem; }
.q-context details summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.q-ctx-warn { margin: .75rem 0 0; color: var(--amber, #b45309); font-weight: 500; }
.live-search-hit mark, mark.hl { background: #fde68a; color: inherit; border-radius: 2px; }
.marks-search { display: flex; align-items: center; gap: .5rem; }
.marks-search input { min-width: 220px; }
.rc-unlock { max-width: 520px; margin: 0 auto; text-align: center; }
.rc-unlock-form { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .75rem; }
.rc-unlock-form .rc-serial { max-width: 220px; text-align: center; letter-spacing: .12em; font-size: 1.1rem; }
.rc-row-locked td { color: var(--muted); }
.doc-note { max-width: 1100px; margin: .75rem auto 0; padding: .6rem .9rem; border-radius: var(--radius-sm); background: #fff7e6; color: #92400e; font-size: .85rem; }
.bulk-key-form { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; border-left: 4px solid var(--amber, #f59e0b); }
.bulk-key-form .rc-serial { min-width: 260px; letter-spacing: .08em; text-transform: uppercase; }
.new-key-box { border-left: 4px solid var(--green, #16a34a); }
.new-key { font: 700 1.6rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; margin: .4rem 0; cursor: pointer; user-select: all; }
.bring-box { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--blue); }
/* Candidate identity (exam lobby and exam room) */
.cand-card { display: flex; gap: .9rem; align-items: center; margin-top: 1rem; padding: .75rem .9rem; border-radius: var(--radius-sm); border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); text-align: left; }
.cand-photo { width: 84px; height: 96px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; border: 2px solid rgba(255, 255, 255, .7); background: #fff; }
.cand-nophoto { display: grid; place-items: center; font-weight: 700; font-size: 1.5rem; color: var(--blue); }
.cand-card dl { display: grid; grid-template-columns: repeat(3, auto); gap: .35rem 1.25rem; margin: 0; }
.cand-card dl > div { min-width: 0; }
.cand-card .cand-name { grid-column: 1 / -1; }
.cand-card dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.cand-card dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cand-card .cand-name dd { font-size: 1.1rem; }
.exam-side .cand-card { margin: 0 0 1rem; border-color: var(--border); background: var(--surface-2); color: var(--text); }
.cand-compact { align-items: flex-start; }
.cand-compact .cand-photo { width: 64px; height: 74px; border-color: var(--border); }
.cand-compact dl { grid-template-columns: 1fr 1fr; gap: .25rem .75rem; font-size: .85rem; }
.cand-compact .cand-name dd { font-size: .95rem; }
.add-examinee { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; border-left: 4px solid var(--green, #16a34a); }
.add-examinee input[name=student] { min-width: 230px; }
.notice-box { border-left: 4px solid var(--blue); }
.notice-list li.unread { background: var(--surface-2); }
.notice-body { margin: .25rem 0; white-space: normal; }
.notice-text { white-space: pre-line; }
.exam-side .cand-compact { flex-wrap: wrap; gap: .6rem; }
.exam-side .cand-compact .cand-photo { width: 72px; height: 84px; margin: 0 auto; }
.exam-side .cand-compact dl { grid-template-columns: 1fr; width: 100%; gap: .15rem; }
.exam-side .cand-compact dl > div { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.exam-side .cand-compact .cand-name { display: block !important; text-align: center; }
.exam-side .cand-compact dd { text-align: right; }
.exam-side .cand-compact .cand-name dd { text-align: center; }
.tpl-hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.tpl-hub-card { display: flex; flex-direction: column; gap: .4rem; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.tpl-hub-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.12)); }
.tpl-hub-card h3 { margin: .4rem 0 0; }
.cert-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.cert-card { display: flex; flex-direction: column; gap: .5rem; }
.cert-card .thumb-box { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: #e2e8f0; }
.cert-card .thumb-box .cert { position: absolute; top: 0; left: 0; transform-origin: top left; box-shadow: none; margin: 0; }
.cert-card .thumb-box { aspect-ratio: 297 / 210; display: block; }
.cert-editor { align-items: start; }
.cert-editor-preview .sticky-top { position: sticky; top: 84px; }
.cert-big-thumb { position: relative; overflow: hidden; border-radius: 10px; border: 1px solid var(--border); background: #e2e8f0; aspect-ratio: 297 / 210; }
.cert-big-thumb.portrait { aspect-ratio: 210 / 297; max-height: 80vh; }
.cert-big-thumb .cert { position: absolute; top: 0; left: 0; transform-origin: top left; box-shadow: none; margin: 0; }
.img-slot-mini { height: 54px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); border-radius: 8px; margin-bottom: .35rem; background: var(--surface-2); }
.img-slot-mini img { max-height: 48px; max-width: 100%; object-fit: contain; }
.sig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.sig-slot { display: grid; gap: .35rem; }
.font-sample { margin-top: .4rem; padding: .3rem .6rem; font-size: 2rem; line-height: 1.3; color: var(--text); background: var(--surface-2); border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Verify dropdown in the public header */
.nav-drop { position: relative; }
.nav-drop summary { list-style: none; cursor: pointer; color: var(--text); font-weight: 500; font-size: .95rem; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.nav-drop summary::-webkit-details-marker { display: none; }
.nav-drop summary:hover, .nav-drop[open] summary { color: var(--blue); }
.nav-drop .nav-caret { transform: rotate(90deg); transition: transform .15s; }
.nav-drop[open] .nav-caret { transform: rotate(-90deg); }
.nav-drop-menu { position: absolute; top: calc(100% + .6rem); left: -.75rem; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 40px rgba(15, 23, 42, .16); padding: .35rem; z-index: 80; display: grid; }
.nav-drop-menu a { display: flex; align-items: center; gap: .55rem; padding: .6rem .75rem; border-radius: 8px; }
.nav-drop-menu a:hover { background: var(--surface-2); }

/* Keys, PINs & cards: one tab per thing to generate (v2.9.2) */
.gen-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.gen-tab { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 1.5px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; transition: .12s; }
.gen-tab:hover { border-color: var(--blue); background: var(--blue-soft); }
.gen-tab.active { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.gen-tab-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue); color: #fff; }
.gen-tab:not(.active) .gen-tab-icon { background: var(--surface-2); color: var(--blue); border: 1px solid var(--border); }
.gen-tab-count { color: var(--blue); font-weight: 600; margin-top: auto; }
.gen-form { border-top: 4px solid var(--blue); }

/* Exam room on phones (v2.9.2): no long-press menus or selection, questions hidden while the page is not in front,
   tiny silent video that keeps the screen on where Wake Lock is not allowed. */
.exam-body { -webkit-touch-callout: none; touch-callout: none; -webkit-tap-highlight-color: transparent; }
.exam-body img, .exam-body svg { -webkit-user-drag: none; user-drag: none; }
.exam-veiled .exam-main, .exam-veiled .exam-side { visibility: hidden; }
.exam-veiled .exam-layout::before { content: "Exam hidden while you are away from this page"; display: block; padding: 3rem 1rem; text-align: center; color: var(--muted); font-weight: 600; }
.keep-awake { position: fixed; left: 0; bottom: 0; width: 2px; height: 2px; opacity: .01; pointer-events: none; z-index: -1; }
@media (pointer: fine) { .rules .phone-only { display: none; } }

/* Arabic text (v2.9.5) */
@font-face { font-family: 'Noto Naskh Arabic'; font-weight: 400; font-display: swap; src: url('../fonts/arabic/noto-naskh-arabic-arabic-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Noto Naskh Arabic'; font-weight: 700; font-display: swap; src: url('../fonts/arabic/noto-naskh-arabic-arabic-700-normal.woff2') format('woff2'); }
[lang=ar], .ar-input { font-family: 'Noto Naskh Arabic', 'Traditional Arabic', Arial, sans-serif; }
.ar-input { direction: rtl; text-align: right; font-size: 1.05rem; }
.more-toggle { display: inline-flex; align-items: center; gap: .4rem; border: 1.5px dashed var(--border-strong); background: transparent; color: var(--blue); font-weight: 600; border-radius: 10px; padding: .45rem .8rem; cursor: pointer; }
.more-toggle:hover { background: var(--blue-soft); border-color: var(--blue); }
.more-toggle .icon { transition: transform .15s; }
.more-toggle[aria-expanded=true] .icon { transform: rotate(45deg); }
.form-subhead { grid-column: 1 / -1; margin: .6rem 0 0; padding-top: .7rem; border-top: 1px solid var(--border); font-size: .95rem; }
.photo-drop { display: flex; align-items: center; gap: 1rem; border: 2px dashed var(--border-strong); border-radius: 14px; padding: .9rem; background: var(--surface-2); transition: .12s; }
.photo-drop.over { border-color: var(--blue); background: var(--blue-soft); }
.photo-drop img, .photo-drop .photo-empty { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; }
.sf-table td, .sf-table th { padding: .35rem .5rem; vertical-align: middle; }
.sf-table input[type=text] { min-width: 10rem; }
.sf-table input[type=number] { width: 4.5rem; }
.w-ar { width: 7.5rem; }
.cls-name { display: flex; gap: .3rem; align-items: center; }
/* Staff registration form (v2.10) */
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.span-3 { grid-column: 1 / -1; }
.staff-grid { display: grid; grid-template-columns: 1fr 220px; gap: 1.25rem; align-items: start; }
.staff-side { display: flex; flex-direction: column; }
.photo-drop-tall { flex-direction: column; text-align: center; padding: 1rem .75rem; gap: .6rem; }
.photo-drop-tall img, .photo-drop-tall .photo-empty { width: 150px; height: 150px; border-radius: 14px; }
.photo-drop-tall .photo-empty { display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }
.center-row { justify-content: center; }
.sig-box { height: 84px; border: 1px solid var(--border); border-radius: 10px; display: grid; place-items: center; background: var(--surface); overflow: hidden; }
.sig-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.doc-rows { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .5rem; }
.doc-row { display: grid; grid-template-columns: 180px 1fr 1fr; gap: .5rem; align-items: center; }
.cam-video { width: 100%; max-width: 420px; border-radius: 12px; background: #000; margin: .5rem 0; }
@media (max-width: 900px) { .staff-grid { grid-template-columns: 1fr; } .form-grid-3 { grid-template-columns: 1fr 1fr; } .doc-row { grid-template-columns: 1fr; } }
.search-wide { max-width: 520px; } .filter-note { padding: .6rem 1rem; }
/* Two-step verification (v2.10.4) */
.two-step-setup { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.qr-box { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--border); flex: none; }
.qr-box canvas, .qr-box img, .qr-box svg { width: 100% !important; height: 100% !important; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .4rem; margin-top: .6rem; font-size: 1rem; }
.recovery-codes span { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 8px; padding: .35rem .5rem; text-align: center; }
/* Certificate design gallery filters (v2.10.5) */
.design-chips { display: flex; flex-wrap: wrap; gap: .45rem; padding-bottom: 0; }
.design-chips .chip { cursor: pointer; font-weight: 600; color: var(--text); }
.design-chips .chip:hover { border-color: var(--blue); }
.design-chips .chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* v2.10.6 — class editing, class counts */
.table tr.row-active td { background: color-mix(in srgb, var(--primary, #1a6fd6) 9%, transparent); }
.card-editing { border: 2px solid var(--primary, #1a6fd6); }
.class-counts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.class-counts .cc { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 10px; font-size: .88rem; border: 1px solid var(--border, #dbe3ee); background: var(--surface, #fff); white-space: nowrap; }
.class-counts .cc b { font-size: 1.05rem; }
.class-counts .cc-m { border-color: #b9d3f5; background: #eef5fe; color: #1a5bb0; }
.class-counts .cc-f { border-color: #f2c2da; background: #fdf0f6; color: #a3245f; }
.class-counts .cc-t { border-color: #c7e6cf; background: #eef9f1; color: #1d7a3e; }
.class-counts .cc-o { color: var(--muted, #6b7a90); }
[data-theme="dark"] .class-counts .cc-m, [data-theme="dark"] .class-counts .cc-f, [data-theme="dark"] .class-counts .cc-t { background: transparent; }
.pt-0 { padding-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.inline-edit input[name="name"] { min-width: 11rem; flex: 1 1 11rem; }
.inline-edit input.w-code { width: 5rem; flex: 0 0 5rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; align-items: center; max-width: 6.5rem; margin-left: auto; }
.row-actions form { margin: 0; }
.table.table-tight th, .table.table-tight td { padding-left: .6rem; padding-right: .6rem; }
.table.table-tight th:first-child, .table.table-tight td:first-child { padding-left: 1rem; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.row-between.wrap { flex-wrap: wrap; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .15rem 1rem; }
.class-edit .check-grid.scroll-list { max-height: 300px; }
.upper { text-transform: uppercase; letter-spacing: .05em; font-size: .74rem; margin: .5rem 0; }
.exam-tick { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.sticky-save { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .5rem; align-items: center; padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 -6px 18px rgba(15, 27, 51, .08); }
.row-between .check-row { white-space: nowrap; }

/* v2.10.8 — clickable stat tiles, today's attendance on the dashboard */
a.stat-link { position: relative; color: inherit; text-decoration: none; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
a.stat-link:hover, a.stat-link:focus-visible { transform: translateY(-2px); border-color: var(--primary, #3b82f6); box-shadow: 0 10px 26px rgba(15, 27, 51, .16); }
a.stat-link .stat-go { position: absolute; top: .6rem; right: .65rem; color: var(--muted); opacity: 0; transition: opacity .12s ease; }
a.stat-link:hover .stat-go, a.stat-link:focus-visible .stat-go { opacity: 1; }
.att-today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; padding: 0 1.25rem 1.25rem; }
.att-group { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; background: var(--surface-2); }
.att-group-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.att-bar { height: 8px; border-radius: 99px; background: var(--border); overflow: hidden; margin-bottom: .3rem; }
.att-bar span { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 99px; }
.att-nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.att-num { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .65rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.att-num:hover { border-color: var(--primary, #3b82f6); }
.att-num b { font-size: 1.35rem; line-height: 1.1; }
.att-num span { font-size: .76rem; color: var(--muted); }
.att-num.n-in b { color: #16a34a; } .att-num.n-still b { color: #2563eb; } .att-num.n-out b { color: #7c3aed; }
.att-num.n-late b { color: #d97706; } .att-num.n-half b { color: #a855f7; } .att-num.n-none b { color: #dc2626; } .att-num.n-exc b { color: #0891b2; }
.th-sort { color: inherit; text-decoration: none; }
.th-sort:hover, .th-sort.active { color: var(--primary, #3b82f6); }

/* v2.11 — skills editor */
.skills-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .9rem; align-items: start; }
.skills-editor > [data-add-row] { justify-self: start; align-self: center; }
.skill-group { display: flex; flex-direction: column; gap: .4rem; padding: .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.skill-group .field { margin: 0; }
.skill-group textarea { font-size: .88rem; line-height: 1.45; }
.skill-group-head { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.skill-group-head .grow { flex: 1 1 180px; }
.icon.rot90 { transform: rotate(90deg); }
.rate-student { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; align-items: start; }
.rate-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rate-group h4 { margin: 0; padding: .55rem .8rem; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: .92rem; }
.rate-row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .35rem .8rem; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.rate-row:last-child { border-bottom: 0; }
.rate-opts { display: inline-flex; gap: .2rem; }
.rate-opts label { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; border: 1px solid var(--border-strong, #c5d0e0); border-radius: 8px; cursor: pointer; font-weight: 700; font-size: .85rem; }
.rate-opts input { position: absolute; opacity: 0; pointer-events: none; }
.rate-opts input:checked + span { color: #fff; }
.rate-opts label:has(input:checked) { background: var(--primary, #1a6fd6); border-color: var(--primary, #1a6fd6); color: #fff; }
.rate-opts label:has(input:focus-visible) { outline: 2px solid var(--primary, #1a6fd6); outline-offset: 2px; }
.rate-progress { display: inline-flex; align-items: center; gap: .4rem; }
.grid-1-3 { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .grid-1-3 { grid-template-columns: 1fr; } }
.rate-list { max-height: 70vh; overflow: auto; }
.rate-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.rate-list li.active { background: color-mix(in srgb, var(--primary, #1a6fd6) 10%, transparent); }
.rate-list a { color: inherit; text-decoration: none; }
.skills-editor > .rep-row.skill-group { display: flex; flex-direction: column; align-items: stretch; grid-template-columns: none; }
.skill-group .field, .skill-group textarea, .skill-group input { width: 100%; }
.skill-group textarea { min-height: 7rem; resize: vertical; }
.skill-group-head .btn-row { flex-wrap: nowrap; }

/* ---------- Timetable module (v2.12) ---------- */
.tt-progress { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.tt-progress .att-bar { flex: 1 1 160px; margin: 0; }
.tt-view-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chip-checks { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--border); cursor: pointer; font-size: .88rem; }
.chip-check input:checked + span { background: var(--primary, #1a6fd6); border-color: var(--primary, #1a6fd6); color: #fff; }
.chip-check input:focus-visible + span { outline: 2px solid var(--primary, #1a6fd6); outline-offset: 2px; }
.br-rows .rep-row { margin-bottom: .35rem; }
.w-num { width: 5rem; }
.tt-bell-head, .tt-bell { display: grid !important; grid-template-columns: 1.3fr 1fr 1fr 1.4fr auto; gap: .5rem; align-items: center; }
.tt-bell-head { padding: 0 0 .3rem; font-weight: 600; }
.tt-bell { margin-bottom: .4rem; }
.tt-lessons select, .tt-lessons input:not([type=checkbox]) { min-width: 0; }
.tt-lessons td:first-child { min-width: 12rem; }
.w-room { width: 7rem; }
.mx-3 { margin-left: 1rem; margin-right: 1rem; }
.tt-board { display: grid; grid-template-columns: 190px 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .tt-board { grid-template-columns: 1fr; } }
.tt-side { position: sticky; top: 5rem; }
.tt-side .rate-list { max-height: 60vh; }
.tt-who-list li.tt-has-clash strong { color: #dc2626; }
.tt-main { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.tt-grid-wrap { overflow-x: auto; padding: .75rem; }
.tt-grid { display: grid; gap: 2px; min-width: 720px; grid-auto-rows: minmax(26px, auto); position: relative; }
.tt-busy .tt-grid { opacity: .6; pointer-events: none; }
.tt-h { background: var(--surface-2); font-size: .74rem; text-align: center; padding: .25rem .2rem; font-weight: 600; color: var(--muted); }
.tt-h-first { text-align: left; color: var(--text); }
.tt-h-break { background: transparent; font-size: .62rem; }
.tt-day { background: var(--surface-2); font-weight: 700; display: flex; align-items: center; padding: .4rem .6rem; border-radius: 8px; min-height: 64px; }
.tt-cell { border: 1px dashed var(--border); border-radius: 8px; min-height: 64px; background: var(--surface); transition: background .1s; }
.tt-cell.tt-over-cell { background: color-mix(in srgb, var(--primary, #1a6fd6) 18%, transparent); border-color: var(--primary, #1a6fd6); border-style: solid; }
.tt-break { background: var(--surface-2); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.tt-break span { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; letter-spacing: .12em; font-size: .78rem; color: var(--muted); }
.tt-slot { position: relative; z-index: 2; border-radius: 8px; padding: .3rem .45rem 1.3rem; color: #0f172a; font-size: .78rem; line-height: 1.2; cursor: grab; border: 1px solid rgba(15, 23, 42, .12); display: flex; flex-direction: column; gap: .1rem; min-height: 62px; overflow: hidden; }
.tt-slot strong { font-size: .82rem; }
.tt-slot small { color: #334155; }
.tt-slot.tt-locked { box-shadow: inset 3px 0 0 #1e3a8a; }
.tt-slot.tt-clash { background: #fecaca !important; border: 2px solid #dc2626; color: #7f1d1d; }
.tt-slot.tt-clash small { color: #7f1d1d; }
.tt-why { font-size: .68rem; font-style: normal; font-weight: 700; color: #b91c1c; }
.tt-slot.tt-picked, .tt-chip.tt-picked { outline: 3px solid var(--primary, #1a6fd6); outline-offset: 1px; }
.tt-tools { position: absolute; right: .2rem; bottom: .15rem; display: none; gap: .1rem; }
.tt-slot:hover .tt-tools, .tt-slot:focus-within .tt-tools, .tt-slot.tt-picked .tt-tools { display: inline-flex; }
.tt-tools button { border: 0; background: rgba(255, 255, 255, .85); border-radius: 5px; font-size: .72rem; line-height: 1; padding: .2rem .32rem; cursor: pointer; color: #0f172a; }
.tt-tools button:hover { background: #fff; }
.tt-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .tt-lower { grid-template-columns: 1fr; } }
.tt-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; padding: .75rem; min-height: 70px; }
.tt-chip { border-radius: 10px; padding: .45rem .6rem; border: 1px solid rgba(15, 23, 42, .12); cursor: grab; color: #0f172a; display: flex; flex-direction: column; gap: .1rem; font-size: .82rem; }
.tt-chip small { color: #334155; }
.tt-chip .tt-count { font-size: .74rem; font-weight: 700; color: #1e3a8a; }
.tt-chip.tt-done { opacity: .55; cursor: default; }
.tt-chip.tt-over { border: 2px solid #dc2626; }
.tt-chip.tt-over .tt-count { color: #b91c1c; }
.tt-clashes { list-style: none; margin: 0; padding: .5rem 1rem 1rem; max-height: 320px; overflow: auto; font-size: .85rem; }
.tt-clashes li { padding: .35rem .5rem; border-left: 3px solid #dc2626; background: #fef2f2; color: #7f1d1d; border-radius: 6px; margin-bottom: .35rem; }
.tt-clashes li.muted { border-left-color: #16a34a; background: transparent; color: var(--muted); }
.tt-board-actions .grow { flex: 1; }
.tt-msg { margin: 0; }
[data-theme="dark"] .tt-cell { background: transparent; }
.tt-slot strong { overflow-wrap: anywhere; hyphens: auto; }
tr.rep-row { display: table-row; margin: 0; }
.tt-lessons td { vertical-align: top; }
.tt-lessons td:first-child select, .tt-lessons td:nth-child(2) select { width: 100%; }
.tt-lessons select[name$="[block]"] { min-width: 6.6rem; }
.tt-lessons .w-num { width: 4.4rem; }
.tt-lessons .w-room { width: 6.2rem; }
.tt-lessons .w-code { width: 5.4rem; }
.tt-lessons td:first-child { min-width: 11rem; }
.tt-lessons td:nth-child(2) { min-width: 9.5rem; }
.grid-1-3 > * { min-width: 0; }
.grid-1-3 { grid-template-columns: minmax(200px, 230px) minmax(0, 1fr); }
@media (max-width: 900px) { .grid-1-3 { grid-template-columns: 1fr; } }

/* ===== v2.13 Finance ===== */
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .form-grid-4 { grid-template-columns: 1fr 1fr; } }
.w-money { max-width: 140px; }
.fin-tabs { flex-wrap: wrap; }
.fin-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.fin-find { flex-wrap: nowrap; }
.fin-find input { min-width: 260px; }
.fin-pies { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.fin-pie-card { padding: 1.1rem 1.2rem; color: inherit; text-decoration: none; display: block; transition: transform .15s, box-shadow .15s; }
.fin-pie-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg, var(--shadow)); }
.fin-pie-card h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.fin-pie-wrap { display: flex; align-items: center; gap: 1rem; }
.fin-pie { flex: none; filter: drop-shadow(0 3px 6px rgba(15, 23, 42, .12)); }
.fin-pie-big strong { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--blue); }
.fin-pie-big span { font-size: .8rem; color: var(--muted); }
.fin-legend { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; gap: .35rem; }
.fin-legend li { display: flex; align-items: center; gap: .5rem; font-size: .86rem; }
.fin-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.fin-legend span { flex: 1; color: var(--muted); }
.fin-bar-row { margin-bottom: .6rem; }
.fin-over span { background: linear-gradient(90deg, #f97316, #dc2626) !important; }
.plain-list { list-style: none; margin: 0; padding-left: 0; display: grid; gap: .35rem; }
.fin-filter { display: flex; flex-wrap: wrap; gap: 0 .75rem; align-items: flex-end; }
.fin-filter .field { margin-bottom: .4rem; }
.fin-filter .grow { flex: 1 1 220px; }
.fin-student-hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.fin-hit { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: inherit; text-decoration: none; }
.fin-hit:hover { border-color: var(--blue); }
.fin-acc-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.fin-acc-who { display: flex; gap: .9rem; align-items: center; }
.fin-acc-bal { padding: .6rem 1.1rem; border-radius: 14px; text-align: right; }
.fin-acc-bal span { display: block; font-size: .8rem; font-weight: 600; }
.fin-acc-bal strong { font-size: 1.5rem; }
.fin-acc-bal.owes { background: var(--red-soft); color: var(--red); }
.fin-acc-bal.clear { background: var(--green-soft); color: var(--green); }
.fin-bill { padding: .9rem 1.1rem; border-top: 1px solid var(--border); }
.fin-bill.is-cancelled { opacity: .55; }
.fin-bill-head { display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; margin-bottom: .4rem; }
.fin-bill .table { margin: 0; }
.fin-minus td { color: var(--green); }
.fin-tot td { font-weight: 700; border-top: 1px solid var(--border); }
.fin-void td { text-decoration: line-through; }
.fin-more summary { cursor: pointer; color: var(--muted); }
.fin-disc-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.fin-check-cols { columns: 2 220px; margin-top: .35rem; }
.fee-table td { vertical-align: middle; }
.fee-table select, .fee-table input:not([type=checkbox]) { min-width: 0; width: 100%; }
.row-on td { background: var(--blue-soft); }
.fin-reports { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.fin-rep-nav { display: flex; flex-direction: column; padding: .5rem; }
.fin-rep-nav a { padding: .55rem .75rem; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.fin-rep-nav a.active { background: var(--blue-soft); color: var(--blue); }
@media (max-width: 860px) { .fin-reports { grid-template-columns: 1fr; } .fin-rep-nav { flex-direction: row; flex-wrap: wrap; } }
.fin-rep-head td { background: var(--surface-2); font-weight: 800; letter-spacing: .03em; }
.fin-grand td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--text); }
.fin-budget .w-bar { width: 140px; }
.dash-fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; padding: 0 1.1rem 1rem; }
.dash-fin-kpi { display: flex; flex-direction: column; padding: .8rem .95rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.dash-fin-kpi:hover { border-color: var(--blue); }
.dash-fin-kpi span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.dash-fin-kpi strong { font-size: 1.25rem; }
.dash-fin-kpi small { color: var(--muted); }
.fin-dash-alert { display: block; text-decoration: none; }
/* Printed report (print layout) */
.fin-doc { max-width: 1000px; margin: 0 auto; padding: 1.5rem; background: #fff; color: #111; }
.fin-doc-head { display: flex; gap: 1rem; align-items: center; border-bottom: 3px double #1e3a8a; padding-bottom: .6rem; }
.fin-doc-head h1 { margin: 0; font-size: 1.4rem; color: #1e3a8a; }
.fin-doc-head p { margin: .1rem 0 0; font-size: .85rem; }
.fin-doc-logo { height: 64px; width: auto; }
.fin-doc-title { text-align: center; margin: .9rem 0 .2rem; text-transform: uppercase; letter-spacing: .05em; }
.fin-doc .table th, .fin-doc .table td { padding: .35rem .5rem; font-size: .85rem; }
.fin-sign { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; font-size: .85rem; }
.table .num, .fin-rep .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fee-table td:nth-child(1) { min-width: 200px; }
.fee-table td:nth-child(2), .fee-table td:nth-child(3) { min-width: 160px; }
.fee-table td:nth-child(4) { min-width: 190px; }
.fee-table td:nth-child(5) { width: 140px; }
.fee-table th:nth-child(6), .fee-table th:nth-child(7), .fee-table td:nth-child(6), .fee-table td:nth-child(7) { width: 1%; white-space: nowrap; }
.fin-pick-class { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.chip-on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); font-weight: 600; }

/* ===== v2.14 Notice board & to-do lists ===== */
.board-one { max-width: 860px; }
.notice { padding: 1.1rem 1.25rem; margin-bottom: 1rem; border-left: 5px solid var(--blue); }
.notice-important { border-left-color: var(--amber); }
.notice-urgent { border-left-color: var(--red); background: linear-gradient(90deg, var(--red-soft), var(--surface) 40%); }
.notice-pinned { box-shadow: 0 0 0 2px var(--blue-line), var(--shadow); }
.notice-new h3::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-left: .45rem; vertical-align: middle; }
.notice-head { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.notice-head h3 { margin: 0 0 .2rem; font-size: 1.08rem; }
.notice-body { margin-top: .7rem; line-height: 1.6; white-space: normal; }
.notice-foot { margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed var(--border); display: flex; gap: .35rem; align-items: center; }
.notice-aud { margin-left: 1.4rem; transition: opacity .15s; }
.notice-aud.is-dim { opacity: .45; }
.notice-classes { margin: .3rem 0 0 1.4rem; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.todo-card { padding: 1rem 1.15rem; border-top: 4px solid var(--blue); }
.todo-card.todo-done { border-top-color: var(--green); }
.todo-head { display: flex; justify-content: space-between; gap: .75rem; }
.todo-head h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.todo-pct { min-width: 90px; text-align: right; }
.todo-pct .att-bar { margin-top: .3rem; }
.todo-desc { margin: .5rem 0 0; color: var(--muted); }
.todo-items { margin-top: .7rem; display: grid; gap: .15rem; }
.todo-item { display: flex; align-items: flex-start; gap: .6rem; padding: .45rem .5rem; border-radius: 9px; cursor: pointer; }
.todo-item:hover { background: var(--surface-2); }
.todo-item input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--green); }
.todo-item span { flex: 1; }
.todo-item.is-done span { text-decoration: line-through; color: var(--muted); }
.todo-note { margin-top: .5rem; }
.todo-note summary { cursor: pointer; color: var(--muted); }
.todo-pick { max-height: 260px; overflow: auto; padding: .2rem .4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.todo-stat { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; margin-top: .45rem; }
.pick-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .6rem; margin-bottom: .35rem; }
.pick-group summary { cursor: pointer; font-weight: 600; }
.dash-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; align-items: start; }
.dash-notice { padding: .65rem 0; border-bottom: 1px solid var(--border); }
.dash-notice:last-child { border-bottom: 0; }
.dash-notice a { color: inherit; text-decoration: none; font-weight: 600; }
.bill-lines .rep-row { display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.bill-lines .rep-row .field { margin: 0; }
.bill-lines .rep-row .grow { flex: 1 1 auto; min-width: 0; }
.bill-lines .rep-row select { max-width: 190px; }
.bill-lines .check-inline { white-space: nowrap; font-size: .8rem; }
@media (max-width: 760px) { .bill-lines .rep-row { flex-wrap: wrap; } }

/* ===== v2.15 Calendar & leave ===== */
.cal-head h2 { font-size: 1.25rem; min-width: 170px; text-align: center; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: .4rem .3rem; text-align: center; }
.cal-grid { gap: 3px; }
.cal-day { min-height: 104px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .3rem .35rem; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; overflow: hidden; }
.cal-day:hover { border-color: var(--blue); }
.cal-out { opacity: .45; }
.cal-we { background: color-mix(in srgb, var(--surface-2) 70%, var(--border)); }
.cal-today { border: 2px solid var(--blue); }
.cal-today .cal-n { background: var(--blue); color: #fff; border-radius: 99px; padding: 0 .4rem; }
.cal-sel { box-shadow: 0 0 0 2px var(--accent); }
.cal-n { font-size: .8rem; font-weight: 700; align-self: flex-start; }
.cal-ev { font-size: .72rem; line-height: 1.25; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--c) 16%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: .7rem; color: var(--muted); }
.cal-mini .cal-day { min-height: 38px; align-items: center; padding: .2rem; }
.cal-mini .cal-n { align-self: center; font-weight: 600; }
.cal-dots { display: flex; gap: 2px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; }
.cal-item { display: flex; justify-content: space-between; gap: .75rem; padding: .6rem .7rem; border-left: 4px solid var(--c); background: var(--surface-2); border-radius: 8px; margin-bottom: .5rem; }
.cal-up { display: flex; gap: .75rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.cal-up:last-child { border-bottom: 0; }
.cal-up-date { width: 46px; flex: none; text-align: center; border-radius: 10px; padding: .3rem 0; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.cal-up-date b { display: block; font-size: 1.1rem; line-height: 1; }
.cal-up-date span { font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.cal-up-sm .cal-up-date { width: 40px; }
.dash-cal .cal { margin-bottom: .6rem; }
.dash-leave { display: flex; gap: .4rem; align-items: center; margin-top: .6rem; padding: .5rem .6rem; border-radius: 9px; background: var(--amber-soft); color: inherit; text-decoration: none; }
.leave-row { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.15rem; border-top: 1px solid var(--border); }
.leave-pending { background: color-mix(in srgb, var(--amber-soft) 55%, transparent); }
.leave-main { display: grid; gap: .2rem; }
.leave-purpose { padding: .35rem .55rem; border-left: 3px solid var(--border); margin: .2rem 0; }
.leave-act { flex: none; }
.leave-decide { display: grid; gap: .4rem; width: 260px; }
.leave-t th { width: 34%; text-align: left; background: #f8fafc; }
@media (max-width: 760px) { .cal-day { min-height: 64px; } .cal-ev { font-size: .62rem; } .leave-row { flex-direction: column; } .leave-decide { width: 100%; } }
@media print { .cal-day { min-height: 90px; } .sidebar, .topbar, .no-print, #event-form { display: none !important; } }
/* Home page: statistics band & testimonials (v2.15) */
.stats-band { background: linear-gradient(135deg, #0b2a6b, #1d4ed8 60%, #2563eb); color: #fff; padding: 2.4rem 0; }
.stats-title { text-align: center; margin: 0 0 1.4rem; font-weight: 600; letter-spacing: .02em; opacity: .9; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.stats-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; padding: 1rem .5rem; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.stats-item strong { font-size: 2.3rem; line-height: 1.05; font-weight: 800; color: #ffd166; }
.stats-item > span:last-child { font-size: .95rem; opacity: .92; }
.stats-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); margin-bottom: .25rem; }
.tst-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 380px)); justify-content: center; gap: 1.25rem; }
.tst-card { margin: 0; padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .9rem; position: relative; }
.tst-card::before { content: "“"; position: absolute; top: -.6rem; right: 1.1rem; font-size: 5rem; line-height: 1; color: var(--blue-soft); font-family: Georgia, serif; }
.tst-stars { color: #f59e0b; letter-spacing: 2px; }
.tst-stars span { color: var(--border); }
.tst-card blockquote { margin: 0; font-size: 1rem; line-height: 1.65; flex: 1; }
.tst-card figcaption { display: flex; gap: .7rem; align-items: center; }
.tst-card figcaption small { display: block; color: var(--muted); }
.stars { color: #f59e0b; }
.share-card { display: flex; gap: .9rem; align-items: center; color: inherit; text-decoration: none; margin-top: 1rem; }
.site-stat-row { grid-template-columns: 130px 1fr; }
.fin-rep th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.fin-rep th, .fin-rep td { padding: .55rem .65rem; }
.fin-rep td:first-child { white-space: nowrap; }
/* v2.15.1 payroll approval steps */
.pr-steps { list-style: none; display: flex; gap: .4rem; margin: 0; padding: .9rem 1.15rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pr-steps li { flex: 1 1 140px; display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .88rem; }
.pr-steps li b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--border); color: var(--text); font-size: .8rem; flex: none; }
.pr-steps li.done { color: var(--green); background: var(--green-soft); }
.pr-steps li.done b { background: var(--green); color: #fff; }
.pr-steps li.now { color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px var(--blue-line); }
.pr-steps li.now b { background: var(--blue); color: #fff; }
.pr-next { padding: 0 1.15rem 1rem; }
.vch-act { display: inline-flex; gap: .35rem; align-items: flex-start; flex-wrap: wrap; }
.vch-pop { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
.vch-pay summary { list-style: none; display: inline-flex; }
.vch-pay summary::-webkit-details-marker { display: none; }
.vch-pay-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; padding: .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); max-width: 720px; }
.vch-pay-form > div.small { grid-column: 1 / -1; }
.vch-pay-form label { display: grid; gap: .2rem; }
.vch-pay-form button { align-self: end; }
.approve-box { border-left: 5px solid var(--amber); }
.approve-row { display: flex; gap: .75rem; align-items: center; padding: .45rem 0; border-top: 1px dashed var(--border); }
.approve-row span { flex: 1; }
.fin-more summary.btn { list-style: none; }
.fin-more summary.btn::-webkit-details-marker { display: none; }
/* v2.16 assignments on the dashboard */
.asg-dash-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; padding: 0 1.1rem 1.1rem; }
.asg-dash-item { display: flex; flex-direction: column; gap: .35rem; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--border); border-left: 5px solid var(--blue); background: var(--surface-2); color: inherit; text-decoration: none; }
.asg-dash-item.is-soon { border-left-color: var(--amber); }
.asg-dash-item.is-late { border-left-color: var(--red); }
.asg-dash-item .btn { align-self: flex-start; margin-top: .2rem; }

/* ===== v2.16 LMS — online courses ===== */
.lms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.lms-card { --c: var(--blue); position: relative; display: flex; flex-direction: column; gap: .45rem; padding: 1.1rem 1.15rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-top: 5px solid var(--c); color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(15,35,70,.05); transition: transform .15s, box-shadow .15s; }
a.lms-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,35,70,.10); }
.lms-card-top { display: flex; justify-content: space-between; align-items: center; }
.lms-card-ico { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); flex: none; }
.lms-card-title { font-size: 1.05rem; line-height: 1.3; }
.lms-card-sum { color: var(--muted); }
.lms-card-stats { display: flex; gap: 1rem; font-size: .85rem; color: var(--muted); margin-top: auto; padding-top: .4rem; border-top: 1px dashed var(--border); }
.lms-card-stats strong { color: var(--text); }
.lms-card-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: auto; }
.lms-go { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; color: var(--c); font-size: .9rem; }
.lms-h { display: flex; align-items: center; gap: .4rem; margin: .25rem 0 .75rem; }
.lms-bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.lms-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--green)); min-width: 0; transition: width .4s; }
.lms-bar-light { background: rgba(255,255,255,.25); border-color: transparent; }
.lms-bar-light > span { background: #fff; }
.lms-colors { display: flex; gap: .5rem; flex-wrap: wrap; }
.lms-color input { position: absolute; opacity: 0; pointer-events: none; }
.lms-color span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px transparent; }
.lms-color input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.lms-color input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.lms-hero { --c: var(--blue); display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding: 1.5rem 1.6rem; margin-bottom: 1rem; border-radius: var(--radius); color: #fff;
    background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #0b1530)); box-shadow: 0 12px 30px color-mix(in srgb, var(--c) 30%, transparent); }
.lms-hero h2 { margin: .15rem 0 .5rem; color: #fff; font-size: 1.6rem; }
.lms-hero-sm { padding: 1.15rem 1.4rem; }
.lms-hero-sm h2 { font-size: 1.35rem; }
.lms-hero-kicker { opacity: .85; font-size: .88rem; }
.lms-hero-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; font-size: .9rem; opacity: .95; }
.lms-hero-progress { display: flex; align-items: center; gap: .8rem; font-size: .9rem; }
.lms-hero-progress .lms-bar { width: min(320px, 60vw); }
.lms-hero .btn-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); }
.lms-section { margin-bottom: 1rem; overflow: visible; }
.lms-section-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lms-section-head h3 { margin: 0; font-size: 1.02rem; }
.lms-section-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: .85rem; }
.lms-tools { display: inline-flex; align-items: center; gap: .15rem; margin-left: auto; }
.lms-tools form { display: inline-flex; }
.lms-pop { position: relative; }
.lms-pop > summary { list-style: none; }
.lms-pop > summary::-webkit-details-marker { display: none; }
.lms-pop-body { position: absolute; right: 0; top: 110%; z-index: 20; display: flex; gap: .4rem; padding: .6rem; width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.15); }
.lms-lesson-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--border); }
.lms-lesson-row:target { background: color-mix(in srgb, var(--blue) 7%, transparent); }
.lms-lesson-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lms-lesson-main a { color: inherit; }
.lms-lesson-ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; flex: none; background: var(--surface-2); color: var(--muted); }
.lms-kind-video { color: #dc2626; background: rgba(220,38,38,.09); }
.lms-kind-audio { color: #7c3aed; background: rgba(124,58,237,.09); }
.lms-kind-file { color: #2563eb; background: rgba(37,99,235,.09); }
.lms-kind-link { color: #0891b2; background: rgba(8,145,178,.09); }
.lms-kind-quiz { color: #16a34a; background: rgba(22,163,74,.10); }
.lms-kind-text { color: #ca8a04; background: rgba(202,138,4,.10); }
.lms-add { padding: .6rem 1.1rem 1rem; }
.lms-add-btn { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; font-weight: 600; color: var(--blue); padding: .45rem .8rem; border-radius: 10px; border: 1px dashed var(--border-strong); list-style: none; }
.lms-add-btn::-webkit-details-marker { display: none; }
.lms-add[open] .lms-add-btn { margin-bottom: .8rem; }
.lms-add-form { padding: 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.lms-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.lms-kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.lms-kind-pick span { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .75rem .5rem; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-size: .85rem; font-weight: 600; text-align: center; }
.lms-kind-pick input:checked + span { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.lms-kind-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.lms-drop { position: relative; display: grid; place-items: center; min-height: 120px; border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--surface); text-align: center; padding: 1rem; transition: border-color .15s, background .15s; }
.lms-drop.is-over { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.lms-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.lms-drop-hint { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: .25rem; color: var(--muted); }
.lms-drop-hint strong { color: var(--text); }
.upload-progress { display: flex; flex-direction: column; gap: .3rem; margin: .6rem 0; }
.upload-bar { height: 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--green)); transition: width .2s; }
.lms-add-section { display: flex; align-items: center; gap: .6rem; }
.lms-add-section input { flex: 1; }
.lms-danger { margin-top: 1rem; border-color: color-mix(in srgb, var(--red) 30%, var(--border)); }
/* Student player */
.lms-player { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
.lms-outline { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.lms-outline-sec { padding: .65rem 1rem .35rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); display: flex; justify-content: space-between; }
.lms-outline-item { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 1rem; color: inherit; text-decoration: none; border-left: 3px solid transparent; font-size: .92rem; }
.lms-outline-item > span:last-child { display: flex; flex-direction: column; }
a.lms-outline-item:hover { background: var(--surface-2); }
.lms-outline-item.is-current { background: color-mix(in srgb, var(--blue) 8%, transparent); border-left-color: var(--blue); font-weight: 600; }
.lms-outline-item.is-locked { color: var(--muted); }
.lms-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; color: var(--muted); }
.lms-dot .icon { width: 12px; height: 12px; }
.lms-outline-item.is-done .lms-dot { background: var(--green); border-color: var(--green); color: #fff; }
.lms-stage-title { margin: .2rem 0 1rem; }
.lms-media { border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 1rem; }
.lms-media video { display: block; width: 100%; max-height: 70vh; background: #000; }
.lms-audio { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; border-radius: 14px; background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(37,99,235,.10)); margin-bottom: 1rem; }
.lms-audio audio { flex: 1; min-width: 0; }
.lms-audio-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #7c3aed; color: #fff; flex: none; }
.lms-doc { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 1rem; }
.lms-doc iframe { display: block; width: 100%; height: 75vh; border: 0; background: #fff; }
.lms-img img { display: block; max-width: 100%; margin: 0 auto; }
.lms-file-card, .lms-link-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); margin-bottom: 1rem; color: inherit; text-decoration: none; }
.lms-link-card > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lms-file-ext { display: grid; place-items: center; width: 56px; height: 64px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 800; font-size: .8rem; flex: none; }
.lms-text { line-height: 1.7; margin-bottom: 1rem; overflow-wrap: anywhere; }
.lms-download { margin-bottom: 1rem; }
.lms-nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--border); }
.lms-nav-right { display: inline-flex; gap: .5rem; align-items: center; }
.lms-finish { display: flex; gap: .5rem; align-items: center; }
.lms-q-row { display: flex; gap: .8rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); }
.lms-q-main { flex: 1; min-width: 0; }
.lms-q-no { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--blue); color: #fff; font-weight: 700; font-size: .82rem; flex: none; }
.lms-q-opts { margin: .4rem 0; padding-left: 1.4rem; }
.lms-q-opts li.is-right { color: var(--green); font-weight: 600; }
.lms-opt-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.lms-opt-row input[name="opt[]"] { flex: 1; }
.lms-opt-letter { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: .8rem; flex: none; }
.lms-opt-right input { width: 18px; height: 18px; accent-color: var(--green); }
.lms-quiz-q { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; margin: 0 0 .9rem; }
.lms-quiz-text { display: flex; gap: .6rem; font-weight: 600; margin-bottom: .7rem; padding: 0; }
.lms-quiz-opt { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: .4rem; cursor: pointer; }
label.lms-quiz-opt:hover { background: var(--surface-2); }
label.lms-quiz-opt:has(input:checked) { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 7%, transparent); }
.lms-quiz-opt.is-right { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); font-weight: 600; }
.lms-quiz-opt.is-wrong { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.lms-quiz-why { color: var(--muted); margin-top: .3rem; }
.lms-result { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: 14px; margin-bottom: 1rem; flex-wrap: wrap; }
.lms-result > div:nth-child(2) { flex: 1; }
.lms-result.is-pass { background: color-mix(in srgb, var(--green) 12%, transparent); }
.lms-result.is-fail { background: color-mix(in srgb, var(--amber) 14%, transparent); }
.lms-result-score { font-size: 2.2rem; font-weight: 800; }
.lms-preview-label { display: flex; align-items: center; gap: .3rem; margin-bottom: .3rem; }
.lms-lesson-stats { margin-top: .8rem; }
.lms-dash-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; padding: 0 1.1rem 1.1rem; }
.lms-dash-item { --c: var(--blue); display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: inherit; text-decoration: none; }
.lms-dash-main { flex: 1; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
@media (max-width: 900px) {
    .lms-player { grid-template-columns: 1fr; }
    .lms-outline { position: static; max-height: none; order: 2; }
    .lms-doc iframe { height: 60vh; }
}

/* ===== v2.17 Notifications on the profile picture ===== */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu[open] > summary { border-color: var(--blue); }
.avatar { position: relative; }
.avatar-badge { position: absolute; top: -7px; right: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #e11d48; color: #fff; font-size: .68rem; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--surface); animation: badge-pop .35s ease-out; }
.avatar-badge[hidden] { display: none; }
@keyframes badge-pop { 0% { transform: scale(.2); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.user-chip-bell { display: inline-grid; place-items: center; color: var(--muted); }
.user-chip-bell.has-new { color: #e11d48; animation: bell-ring 1.4s ease-in-out 2; transform-origin: 50% 0; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(400px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 18px 44px rgba(9, 26, 56, .22); overflow: hidden; }
.um-head { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.um-head form { margin-left: auto; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.um-list { max-height: min(420px, 60vh); overflow: auto; }
.um-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.5rem 1.2rem; text-align: center; color: var(--muted); font-size: .88rem; }
.um-item { --k: var(--blue); display: flex; gap: .7rem; padding: .7rem 1rem; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border); position: relative; }
.um-item:hover { background: var(--surface-2); color: inherit; }
.um-item.is-new { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.um-item.is-new::after { content: ''; position: absolute; right: .9rem; top: 1rem; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.um-ico { --k: var(--blue); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); }
.um-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding-right: .8rem; }
.um-text strong { font-size: .88rem; line-height: 1.3; }
.um-body { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.um-when { font-size: .74rem; color: var(--muted); }
.um-all { display: flex; justify-content: center; align-items: center; gap: .3rem; padding: .7rem; font-weight: 600; font-size: .88rem; border-bottom: 1px solid var(--border); }
.um-foot { display: flex; justify-content: space-between; padding: .4rem .6rem; }
.um-foot a, .um-foot button { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .6rem; border-radius: 8px; background: none; border: 0; color: var(--text); font: inherit; font-size: .85rem; cursor: pointer; }
.um-foot a:hover, .um-foot button:hover { background: var(--surface-2); }
.alert-list { overflow: hidden; }
.alert-row { --k: var(--blue); display: flex; align-items: flex-start; gap: .8rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); }
.alert-row.is-new { background: color-mix(in srgb, var(--blue) 5%, var(--surface)); border-left: 4px solid var(--blue); }
.alert-row .um-ico { --k: inherit; }
.alert-main { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.alert-main:hover strong { color: var(--blue); }
.alert-filters { flex-wrap: wrap; }
.sg-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; display: flex; align-items: center; gap: .6rem; max-width: 360px; padding: .8rem 1rem; border-radius: 14px; background: var(--navy, #091a38); color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: toast-in .3s ease-out; text-decoration: none; }
.sg-toast:hover { color: #fff; }
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }
@media (max-width: 760px) { .user-chip-bell { display: none; } .user-menu-panel { position: fixed; top: 64px; right: 12px; } }
/* v2.17 Testimonials carousel: four in a row, sliding */
.tst-carousel { position: relative; padding: 0 3rem; }
.tst-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 1.25rem) / 4); gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 1rem .15rem 1.25rem; }
.tst-track::-webkit-scrollbar { display: none; }
.tst-track > .tst-card { scroll-snap-align: start; }
.tst-track .tst-card blockquote { font-size: .95rem; }
.tst-nav { position: absolute; top: 50%; transform: translateY(-60%); width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; z-index: 2; }
.tst-nav:hover { border-color: var(--blue); color: var(--blue); }
.tst-nav[disabled] { opacity: .35; cursor: default; }
.tst-prev { left: 0; } .tst-next { right: 0; }
.tst-dots { display: flex; justify-content: center; gap: .45rem; margin-top: .4rem; }
.tst-dots button { width: 9px; height: 9px; padding: 0; border-radius: 99px; border: 0; background: var(--border-strong); cursor: pointer; transition: width .25s, background .25s; }
.tst-dots button.active { width: 26px; background: var(--blue); }
.tst-carousel.is-static .tst-nav, .tst-carousel.is-static .tst-dots { display: none; }
.tst-carousel.is-static .tst-track { justify-content: center; }
@media (max-width: 1100px) { .tst-track { grid-auto-columns: calc((100% - 1.25rem) / 2); } }
@media (max-width: 640px) { .tst-carousel { padding: 0; } .tst-track { grid-auto-columns: 88%; } .tst-nav { display: none; } }
/* v2.17 AI writing for courses */
.btn-ai { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: 0; }
.btn-ai:hover { filter: brightness(1.08); color: #fff; }
.btn-ai[disabled] { opacity: .7; cursor: progress; }
.lms-label-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.lms-label-row .btn-ai { margin-left: auto; }
.ai-msg { margin-top: .35rem; color: var(--muted); }
.ai-msg.is-error { color: var(--red); }
.ai-build { border: 1px solid color-mix(in srgb, #7c3aed 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #7c3aed 7%, var(--surface)), color-mix(in srgb, #2563eb 6%, var(--surface))); border-radius: 14px; padding: .9rem 1rem; margin: .4rem 0 1rem; }
.ai-build-main { align-items: flex-start; }
.ai-build-opts { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: .7rem 0 0 1.8rem; }
.ai-build-opts select, .ai-panel-body select { width: auto; margin-left: .35rem; }
.ai-off { margin: .3rem 0 1rem; }
.ai-panel { margin-bottom: 1rem; border-color: color-mix(in srgb, #7c3aed 35%, var(--border)); }
.ai-panel > summary { display: flex; align-items: center; gap: .55rem; padding: .9rem 1.1rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.ai-panel > summary::-webkit-details-marker { display: none; }
.ai-spark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; }
.ai-panel-body { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0 1.1rem 1rem; }
.busy-box { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-radius: 12px; background: color-mix(in srgb, #7c3aed 8%, var(--surface)); margin: .6rem 0; flex-basis: 100%; font-weight: 600; }
.busy-box[hidden] { display: none; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid color-mix(in srgb, #7c3aed 25%, transparent); border-top-color: #7c3aed; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
/* v2.17.1 Home page: CORE Features */
.cf-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0 0 1.6rem; }
.cf-tabs button { --c: var(--blue); padding: .5rem 1rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.cf-tabs button:hover { border-color: var(--c); color: var(--c); }
.cf-tabs button.active { background: var(--c); border-color: var(--c); color: #fff; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; }
.cf-card { --c: var(--blue); display: flex; flex-direction: column; gap: .55rem; padding: 1.35rem 1.3rem 1.2rem; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--c); border-radius: 18px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.cf-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(9, 26, 56, .12); }
.cf-card[hidden] { display: none; }
.cf-top { display: flex; justify-content: space-between; align-items: center; }
.cf-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); }
.cf-group { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c); }
.cf-card h3 { margin: .2rem 0 0; font-size: 1.08rem; }
.cf-card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
.cf-card ul { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.cf-card li { display: flex; gap: .45rem; align-items: flex-start; font-size: .88rem; line-height: 1.4; }
.cf-card li .icon { color: var(--c); flex: none; margin-top: .12rem; }
@media (max-width: 480px) { .site-actions { gap: .35rem; } .site-actions .btn-accent { padding: .5rem .7rem; font-size: .8rem; white-space: nowrap; } .site-logo span { font-size: 1.05rem; } }
@media (max-width: 400px) { .site-actions .btn-accent { padding: .45rem .55rem; font-size: .74rem; } }
/* v2.17.2 Score and attendance boxes keep their size on phones (the table scrolls sideways instead) */
.mark-input { min-width: 66px; box-sizing: border-box; -moz-appearance: textfield; appearance: textfield; }
.mark-input::-webkit-outer-spin-button, .mark-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.marks-table td:has(.mark-input), [data-grid-nav] td:has(.mark-input) { min-width: 78px; }
.rating-select { min-width: 58px; }
.att-reg-table input[type=text] { min-width: 160px; }
@media (max-width: 600px) { .mark-input { width: 70px; font-size: 1rem; padding: .45rem .2rem; } .marks-table td, .marks-table th { padding-left: .4rem; padding-right: .4rem; } }
/* v2.17.2 Top bar fits small phones: the session and role pickers shrink */
@media (max-width: 600px) {
    .topbar { gap: .4rem; }
    .topbar-actions { gap: .35rem; min-width: 0; flex-shrink: 1; }
    .role-switch { padding-left: .35rem; min-width: 0; }
    .role-switch > .icon { display: none; }
    .role-switch select { font-size: .74rem; padding: .45rem 1.4rem .45rem .15rem; max-width: 96px; text-overflow: ellipsis; background-position: right .3rem center; }
    .topbar .icon-btn { width: 36px; height: 36px; }
}
@media (max-width: 400px) { .topbar-title { display: none; } .role-switch select { max-width: 84px; } }
.ai-off-note { display: flex; gap: .4rem; align-items: flex-start; margin: .6rem 0 0 1.8rem; padding: .55rem .75rem; border-radius: 10px; background: var(--amber-soft); color: var(--amber); }
.ai-panel-body .ai-off-note { margin: 0; flex-basis: 100%; }
.setup-card { width: 100%; max-width: 760px; }
.desk-card { margin-bottom: 1rem; } .desk-status { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; } .desk-key table { margin-top: .5rem; background: var(--surface); } .tenant-banner { display: flex; gap: .5rem; align-items: flex-start; }
.sync-table th { width: 220px; } .sync-list li { margin-bottom: .35rem; }

/* Connect phones (v2.19.1) */
.connect-qr img { width: 220px; max-width: 100%; height: auto; image-rendering: pixelated; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border); }
@media print { .connect-qr img { width: 300px; } }

/* Assignments (v2.15 styles, added in v2.19.1: the pages showed unstyled on phones) */
.asg-row { display: flex; align-items: center; gap: .9rem; padding: .95rem 1.2rem; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.asg-row:last-child { border-bottom: 0; }
.asg-row:hover { background: var(--blue-soft); }
.asg-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.asg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.asg-main strong { color: var(--text); overflow-wrap: anywhere; }
.asg-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; text-align: right; }
.asg-brief h2 { margin: .25rem 0 .6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.asg-due { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding: .45rem .75rem; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-size: .92rem; }
.asg-due.past { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.asg-text { margin-top: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.asg-file { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; }
.asg-file:hover { border-color: var(--blue-line); background: var(--blue-soft); }
.asg-file > .icon { flex: none; color: var(--blue); width: 26px; height: 26px; }
.asg-hand h3 { margin-top: 0; }
.asg-done { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-weight: 600; color: var(--green, #15803d); margin-bottom: .5rem; }
.asg-mark { margin: .9rem 0; padding: 1rem; border-radius: 12px; background: var(--blue-soft); }
.asg-score-big { font-size: 2.2rem; font-weight: 800; color: var(--blue); line-height: 1; }
.asg-score-big span { font-size: 1.1rem; font-weight: 600; color: var(--muted); }
.asg-feedback { margin-top: .6rem; font-style: italic; overflow-wrap: anywhere; }
.asg-upload { margin-top: 1rem; }
.asg-current { margin-top: .35rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.asg-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.asg-stat .n { font-size: 1.6rem; font-weight: 800; color: var(--blue); margin-right: .2rem; }
.asg-missing td { color: var(--muted); }
.asg-answer summary { cursor: pointer; color: var(--blue); font-size: .88rem; }
.asg-answer > div { margin-top: .4rem; padding: .6rem .75rem; border-radius: 8px; background: var(--surface-2); white-space: normal; max-width: 460px; }
@media (max-width: 560px) {
    .asg-row { padding: .85rem 1rem; gap: .7rem; align-items: flex-start; }
    .asg-ico { width: 36px; height: 36px; }
}
@media (max-width: 560px) { .card-head { flex-wrap: wrap; } .card-head > h3 { flex: 1 1 auto; } }
.legal-page { max-width: 820px; padding-top: 2.5rem; padding-bottom: 3rem; line-height: 1.65; }
.legal-page h1 { margin: .4rem 0 .2rem; }
.legal-page h2 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }
.legal-page ul { padding-left: 1.2rem; } .legal-page li { margin: .35rem 0; }

/* Loading ring (v2.19.1) */
.sg-loader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 1rem; background: color-mix(in srgb, var(--bg, #f4f7fc) 55%, transparent); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s; }
.sg-loader[hidden] { display: none; }
.sg-loader.on { opacity: 1; }
.sg-loader.sg-loader-light { background: color-mix(in srgb, var(--bg, #f4f7fc) 25%, transparent); backdrop-filter: none; }
.sg-loader-card { display: flex; flex-direction: column; align-items: center; gap: .55rem; min-width: 230px; max-width: 360px; padding: 1.6rem 1.8rem 1.35rem; border-radius: 18px; background: var(--surface, #fff); border: 1px solid var(--border); box-shadow: 0 24px 60px -18px rgba(15, 30, 70, .35); text-align: center; }
.sg-loader-light .sg-loader-sub { display: none; }
.sg-ring { width: 64px; height: 64px; animation: sg-ring-spin 1.1s linear infinite; }
.sg-ring-track { fill: none; stroke: #e2e1fb; stroke-width: 4.5; }
.sg-ring-arc { fill: none; stroke: #5b57e8; stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 34 126; animation: sg-ring-arc 1.6s ease-in-out infinite; }
[data-theme="dark"] .sg-ring-track { stroke: #2a2f5a; }
[data-theme="dark"] .sg-ring-arc { stroke: #8b88ff; }
@keyframes sg-ring-spin { to { transform: rotate(360deg); } }
@keyframes sg-ring-arc { 0%, 100% { stroke-dasharray: 22 126; } 50% { stroke-dasharray: 62 126; } }
.sg-loader-msg { font-weight: 700; color: var(--text); margin-top: .35rem; }
.sg-loader-sub { font-size: .85rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .sg-ring { animation-duration: 2.5s; } .sg-ring-arc { animation: none; } }
@media print { .sg-loader { display: none !important; } }
.desk-db > summary { cursor: pointer; }
.desk-db .btn-row { grid-column: 1 / -1; align-items: center; }
.desk-key .table { table-layout: fixed; width: 100%; margin-top: .5rem; }
.desk-key .table th { width: 38%; white-space: normal; }
.desk-key code { word-break: break-all; white-space: normal; }

/* Desktop online sync status (v2.19.3) */
.sync-chip { --c: var(--muted); display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .8rem; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); background: color-mix(in srgb, var(--c) 9%, var(--surface)); color: var(--text); font-size: .82rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
a.sync-chip:hover { border-color: var(--c); }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.sync-green { --c: var(--green, #12a150); } .sync-blue { --c: #5b57e8; } .sync-amber { --c: var(--amber, #d97706); } .sync-red { --c: var(--red, #dc2626); }
.sync-blue .sync-dot { animation: sync-pulse 1.2s ease-in-out infinite; }
@keyframes sync-pulse { 50% { opacity: .3; transform: scale(.7); } }
@media (max-width: 760px) { .sync-chip-text { display: none; } .sync-chip { width: 38px; padding: 0; justify-content: center; } }
.sync-card { --c: var(--muted); border-left: 5px solid var(--c); }
.sync-card-green { --c: var(--green, #12a150); } .sync-card-blue { --c: #5b57e8; } .sync-card-amber { --c: var(--amber, #d97706); } .sync-card-red { --c: var(--red, #dc2626); }
.sync-card-main { display: flex; align-items: flex-start; gap: .9rem; padding: 1.1rem 1.25rem .6rem; }
.sync-card-main > div { flex: 1; min-width: 0; }
.sync-card-main h3 { margin: .1rem 0 .25rem; }
.sync-card-main p { margin: 0; }
.sync-card-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.sync-card-blue .sync-card-icon .icon { animation: spin 1.6s linear infinite; }
.eyebrow-plain { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sync-card-btn { flex: none; }
.sync-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; padding: .4rem 1.25rem 1.1rem; }
.sync-facts > div { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .75rem; border-radius: 10px; background: var(--surface-2); font-size: .8rem; color: var(--muted); }
.sync-facts .n { font-size: 1.1rem; font-weight: 800; color: var(--text); }
@media (max-width: 760px) { .sync-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sync-card-main { flex-wrap: wrap; } }

/* 10-digit school codes (v2.19.6) */
.code-auto { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .55rem .8rem; border-radius: 10px; border: 1px dashed var(--border); background: var(--surface-2); color: var(--muted); font-size: .88rem; }
.code-show { display: flex; flex-direction: column; align-items: center; gap: .2rem; margin: 1rem 0; padding: 1rem; border-radius: 14px; background: var(--blue-soft); text-align: center; }
.code-show span { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.code-show strong { font-size: 1.9rem; letter-spacing: .08em; color: var(--blue); }
.code-show small { color: var(--muted); }
.code-big { font-size: 1.3rem; letter-spacing: .06em; }
/* Desktop first-run page with the welcome photo (v2.19.6) */
.setup-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); padding: 0; overflow: hidden; max-width: 1080px !important; width: 100%; align-items: stretch; background: var(--surface); }
.setup-photo { background: linear-gradient(180deg, #0b2560, #081a45); }
.setup-photo-in { position: sticky; top: 0; }
.setup-photo img { display: block; width: 100%; aspect-ratio: 386 / 550; object-fit: cover; -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, #000 72%, transparent 100%); }
.setup-photo-text { margin-top: -2.2rem; padding: 0 1rem 1.6rem; text-align: center; color: #fff; display: flex; flex-direction: column; gap: .3rem; position: relative; }
.setup-photo-text strong { font-size: 1.25rem; } .setup-photo-text sup { color: #ffc83d; }
.setup-photo-text span { color: #c9d8f5; font-size: .9rem; }
.setup-body { min-width: 0; }
@media (max-width: 860px) { .setup-split { grid-template-columns: 1fr; } .setup-photo img { aspect-ratio: 16 / 10; object-position: center 22%; } }

/* Bulk photos (v2.20) */
.photo-names { display: grid; gap: .3rem; padding: .75rem .9rem; margin-bottom: 1rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.photo-report details { margin-bottom: .6rem; } .photo-report summary { cursor: pointer; font-weight: 600; } .photo-report ul { margin: .4rem 0 0 1.2rem; max-height: 260px; overflow: auto; }
.mark-input.mark-locked { background: var(--surface-2); color: var(--muted); border-style: dashed; cursor: not-allowed; }
/* Letterhead picture across the top of a report card (v2.20) */
.rc-lh-img { margin: 0 0 6px; } .rc-lh-img img { display: block; width: 100%; max-height: 46mm; object-fit: contain; }
/* Letterheads (v2.20) */
.lh-link { display: flex; align-items: center; gap: 1rem; color: inherit; text-decoration: none; }
.lh-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.lh-link-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.lh-link:hover { border-color: var(--blue-line); }
.lh-pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.2rem; margin-top: .6rem; }
.img-slot-preview.wide { width: 180px; }
.lh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1.1rem; }
.lh-card { overflow: hidden; margin: 0; }
.lh-preview { background: #fff; color: #10203f; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.lh-head { display: grid; grid-template-columns: 54px 1fr 54px; gap: 10px; align-items: center; text-align: center; border-bottom: 3px double #1e3a8a; padding-bottom: 8px; }
.lh-head strong { display: block; font-size: 15px; letter-spacing: .02em; color: #1e3a8a; }
.lh-head em, .lh-head span { display: block; font-size: 11px; line-height: 1.35; }
.lh-logo img { width: 54px; height: 54px; object-fit: contain; }
.lh-head-img { display: block; width: 100%; max-height: 110px; object-fit: contain; }
.lh-sign { display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; margin-top: 6px; min-height: 34px; }
.lh-sign img { height: 30px; object-fit: contain; }
.lh-meta { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
@media (max-width: 700px) { .lh-pics { grid-template-columns: 1fr; } .lh-grid { grid-template-columns: 1fr; } }

/* Digital library (v2.20) */
.lib-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; padding: 1.4rem 1.5rem; border-radius: var(--radius); background: linear-gradient(120deg, var(--blue-soft), var(--surface)); border: 1px solid var(--border); }
.lib-hero h2 { margin: .3rem 0 .8rem; }
.lib-hero > div { flex: 1; min-width: 260px; }
.lib-search { display: flex; align-items: center; gap: .5rem; max-width: 640px; padding: .35rem .4rem .35rem .8rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.lib-search input { flex: 1; border: 0; background: transparent; padding: .4rem 0; min-width: 0; color: var(--text); font: inherit; }
.lib-search input:focus { outline: none; }
.lib-kinds { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.lib-kinds a { --c: var(--blue); display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 600; }
.lib-kinds a span { color: var(--muted); font-weight: 500; }
.lib-kinds a.active { background: var(--c); border-color: var(--c); color: #fff; } .lib-kinds a.active span { color: rgba(255,255,255,.8); }
.lib-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.lib-cats { display: flex; flex-direction: column; padding: .4rem; }
.lib-cats a { display: flex; justify-content: space-between; padding: .5rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; }
.lib-cats a:hover { background: var(--blue-soft); } .lib-cats a.active { background: var(--blue); color: #fff; } .lib-cats a.active .muted { color: rgba(255,255,255,.8); }
.lib-cat-row { display: flex; gap: .35rem; margin-bottom: .35rem; } .lib-cat-row input { flex: 1; min-width: 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 1rem; }
.lib-grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.lib-card { --c: var(--blue); display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.lib-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.lib-cover { position: relative; display: block; aspect-ratio: 3 / 4; background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.lib-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-cover-blank { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1rem; text-align: center; color: var(--c); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 18%, var(--surface)), color-mix(in srgb, var(--c) 6%, var(--surface))); }
.lib-cover-blank .icon { width: 38px; height: 38px; } .lib-cover-blank b { font-size: .85rem; color: var(--text); line-height: 1.3; }
.lib-draft { position: absolute; top: .5rem; left: .5rem; }
.lib-meta { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .8rem .85rem; }
.lib-meta strong { font-size: .92rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-kind { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c, var(--blue)); }
.lib-item { --c: var(--blue); display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.lib-info { margin: 0; overflow: hidden; }
.lib-info-top { display: flex; gap: 1rem; padding: 1.2rem 1.2rem 0; }
.lib-info-top h2 { margin: .25rem 0 .3rem; font-size: 1.3rem; }
.lib-cover-sm { width: 92px; flex: none; border-radius: 10px; overflow: hidden; }
.lib-desc { line-height: 1.6; overflow-wrap: anywhere; }
.lib-view { margin: 0; overflow: hidden; min-height: 300px; }
.lib-view iframe { display: block; width: 100%; height: 78vh; border: 0; }
.lib-view video { display: block; width: 100%; max-height: 78vh; background: #000; }
.lib-view audio { width: 100%; }
.lib-view > img { display: block; max-width: 100%; margin: 0 auto; }
.lib-big { position: static; display: inline-flex; width: 110px; height: 140px; border-radius: 12px; margin: 1rem auto; }
@media (max-width: 900px) { .lib-layout, .lib-item { grid-template-columns: 1fr; } .lib-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
/* PDF reader (PDF.js, v2.20) */
.pdfv { display: flex; flex-direction: column; background: #525659; border-radius: 0; min-height: 320px; }
.pdfv-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .45rem .7rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pdfv-bar .icon-btn { font-size: 1.15rem; font-weight: 700; }
.pdfv-pages { height: 76vh; overflow: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; -webkit-overflow-scrolling: touch; }
.pdfv-page { flex: none; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); max-width: none; }
.pdfv-page canvas { display: block; }
.lms-pdf { padding: 0; overflow: hidden; border-radius: 12px; }
@media (max-width: 700px) { .pdfv-pages { height: 70vh; padding: 8px; } }
/* Result access defaults on the platform dashboard (v2.21) */
.ra-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.ra-item { padding: 1rem 1.25rem; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: .5rem; }
.ra-item:last-child { border-right: 0; }
.ra-item p { margin: 0; flex: 1; }
.ra-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
@media (max-width: 1000px) { .ra-grid { grid-template-columns: 1fr; } .ra-item { border-right: 0; border-bottom: 1px solid var(--border); } }
