/* =============================================================================
   ExamON - PER-SCREEN STYLES
   -----------------------------------------------------------------------------
   Screen-specific blocks only. The shared layer - design tokens, top chrome,
   page shell, and every reusable component (buttons, cards, tables, forms,
   badges, empty states, overlays) - lives in assets/css/examon_ui.css, which
   loads BEFORE this file.

   RULE: never redefine a component that examon_ui.css owns. Because this file
   loads second, any such rule silently wins and the shared restyle stops
   working. That is exactly what had happened before 2026-08-11: .btn was
   declared twice (line 296 and line 3199) and the tail copy won app-wide.

   Removed 2026-08-11 during the Apple-Glass re-skin:
     - lines 1-1062   the old core (tokens, nav, page shell, and every
                      component) - now owned by examon_ui.css
     - lines 1384-1489, 1679-1877, and a third copy in the Setup and Marks
                      Entry section: three verbatim duplicates of the form-v2
                      block, one also carrying a second csel engine
     - btn-setup-marks x2 (2357, 2628) - unified as .btn-act in examon_ui.css
     - btn / btn-sec / btn-sv (3199-3203) - now in examon_ui.css
   Also dropped as provably unreferenced (no view, controller or JS used them):
     sect-banner, step-hdr, setup-list/setup-row/sr-, s-sel, msel-,
     term-list-wrap/term-box, ch-opt, custom-tog-color
   (s-label WAS in use across 24 sites and now lives in examon_ui.css section 8.)
   ============================================================================= */
/* ── GRADE RANGE FORM ──────────────────────── */
/* Page-specific only — card/header/back/section/footer come from examon_module.css */


/* Range name bar */
.gr-namebar {
    padding:22px 28px;
    border-bottom:1px solid var(--border);
    background:#fdf9f9;
    display:grid; grid-template-columns:1fr 280px 220px; gap:18px; align-items:end;
}

/* Status mini-cards */
.st-mini { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.st-mini-card { position:relative; }
.st-mini-card input { position:absolute; opacity:0; width:0; height:0; }
.st-mini-lbl {
    display:flex; align-items:center; gap:8px;
    padding:10px 13px; border:2px solid var(--border); border-radius:8px;
    cursor:pointer; font-size:13px; font-weight:500; color:var(--t1);
    transition:all 0.2s;
}
.st-mini-lbl:hover { border-color:#ccc; }
.st-mini-card input:checked + .st-mini-lbl { border-color:var(--red); background:var(--red-soft); color:var(--red); }
.st-mini-card input:checked + .st-mini-lbl i { color:var(--red); }

/* ── GRADES TABLE ─────────────────────────── */
.gr-body { padding:24px 28px; }

.grades-tbl-wrap { border:1px solid var(--border); border-radius:10px; overflow:hidden; margin-bottom:16px; }
table.gtbl { width:100%; border-collapse:collapse; }
table.gtbl thead tr { background:#fafafa; border-bottom:1px solid var(--border); }
table.gtbl thead th {
    padding:10px 12px; text-align:left;
    font-size:11px; font-weight:700; color:var(--t3);
    text-transform:uppercase; letter-spacing:0.6px;
}
table.gtbl tbody tr {
    border-bottom:1px solid #f5f3f3;
    transition:background 0.1s;
}
table.gtbl tbody tr:last-child { border-bottom:none; }
table.gtbl tbody tr:hover { background:#fdf9f9; }
table.gtbl tbody td { padding:10px 12px; vertical-align:middle; }

/* Row inputs */
.row-inp {
    padding:8px 10px;
    border:1.5px solid var(--border); border-radius:7px;
    font-size:13.5px; font-family:var(--font);
    color:var(--t1); background:#fff; outline:none; width:100%;
    transition:border-color 0.18s, box-shadow 0.18s;
}
.row-inp:focus { border-color:var(--red); box-shadow:0 0 0 3px var(--red-soft); }
.row-inp::placeholder { color:#bbb; }

/* Fail selector */
.fail-sel-wrap { position:relative; }
.fail-sel {
    width:100%; padding:8px 30px 8px 10px;
    border:1.5px solid var(--border); border-radius:7px;
    font-size:13px; font-family:var(--font);
    color:var(--t1); background:#fff; outline:none; cursor:pointer;
    appearance:none; -webkit-appearance:none;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239b9b9b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 10px center;
    transition:border-color 0.18s;
}
.fail-sel:focus { border-color:var(--red); outline:none; }
.fail-sel.is-fail { background-color:#fef2f2; color:var(--red); border-color:rgba(172,61,60,0.3); }

/* Row #, delete */
.row-num { font-size:12px; font-weight:700; color:var(--t3); text-align:center; width:32px; }
.del-row {
    width:30px; height:30px; border-radius:7px;
    border:none; background:transparent; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    color:var(--t3); font-size:13px; transition:all 0.15s;
}
.del-row:hover { background:var(--red-soft); color:var(--red); }

/* Add row btn */
.btn-add-row {
    display:inline-flex; align-items:center; gap:8px;
    padding:9px 18px;
    border:2px dashed rgba(172,61,60,0.3);
    border-radius:8px;
    background:var(--red-soft); color:var(--red);
    font-size:13.5px; font-weight:600; font-family:var(--font);
    cursor:pointer; transition:all 0.2s;
}
.btn-add-row:hover { background:rgba(172,61,60,0.12); border-color:var(--red); }

/* Page-specific only — shared form components live in examon_module.css */


/* Term multi-select chips */
.term-chip-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px; padding: 12px; border: 1.5px solid var(--border);
    border-radius: 8px; background: #fff;
}
.term-chip {
    display: flex; align-items: center; gap: 8px; padding: 9px 11px;
    border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer;
    transition: all 0.18s; font-size: 13px; font-weight: 500; color: var(--t2);
    user-select: none;
}
.term-chip:hover { border-color: #bbb; background: #f8f8f8; }
.term-chip input[type="checkbox"] { display: none; }
.term-chip.tch-on { border-color: var(--red); background: var(--red-soft); color: var(--red); font-weight: 600; }
.term-chip-dot {
    width: 15px; height: 15px; border-radius: 4px; border: 2px solid currentColor;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 9px;
}
.btn-tiny {
    padding: 5px 11px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--border);
    border-radius: 6px; background: #fff; color: var(--t2); cursor: pointer; transition: all 0.18s;
}
.btn-tiny:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.btn-tiny-ghost { background: transparent; color: var(--t3); border: 1.5px solid var(--border); border-radius: 6px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.18s; }
.btn-tiny-ghost:hover { background: #f0f0f0; color: var(--t2); }

/* --- Linking Modules CSS --- */

.subject-chip {
    display: inline-flex;
    align-items: center;
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
    color: var(--t1, #1e293b);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
}
.subject-chip:hover {
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.subject-chip .s-flag {
    margin-left: 4px;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.s-flag.f-add { background: #6366f1; color: #ffffff; box-shadow: 0 1px 2px rgba(99,102,241,0.3); }
.s-flag.f-sel { background: #f97316; color: #ffffff; box-shadow: 0 1px 2px rgba(249,115,22,0.3); }

.subject-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sg-group {
    margin-bottom: 8px;
}
.sg-group:last-child {
    margin-bottom: 0;
}
.sg-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sb-wrap {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap;
}
.sb-item {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
}

/* Page-specific only. The card, back button and footer come from examon_ui.css.
   This page needs a wider max-width and zero body padding (own summary-strip
   and full-bleed subject rows manage their own spacing).
   NOTE 2026-08-11: this comment used to write the class list as ".fcard2*" plus
   a slash, which closed the comment early — the prose that followed was parsed
   as a selector and swallowed the .form-page-wrap rule below, so that rule had
   never actually applied. Fixed; the rule is live now. */
.form-page-wrap  { padding:16px 0 80px; }

/* Removed 2026-08-11: .fcard2-hdr / .fcard2-hdr-ico / .fcard2-foot colour
   overrides for this screen were UNSCOPED, so a page-specific dark navy card
   header leaked onto every form in the app (it was still painting
   subjects/create dark after the re-skin). The card now uses the shared
   examon_ui.css look everywhere. The one genuinely page-specific rule,
   .fcard2-body{padding:0}, moved into class_subjects/manage.php's own
   <style> block, where a page-specific rule belongs. */

/* Summary strip */
.cs-summary {
    display:flex; gap:0; border-bottom:1px solid var(--border); background:#f8fafd;
}
.cs-summary-item {
    flex:1; padding:16px 24px; text-align:center;
    border-right:1px solid var(--border);
}
.cs-summary-item:last-child { border-right:none; }
.cs-summary-num { font-size:22px; font-weight:800; color:var(--t1); }
.cs-summary-lbl { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.8px; color:var(--t3); margin-top:2px; }

/* Subject row */
.subj-row {
    display:flex; align-items:stretch; border-bottom:1px solid var(--border);
    transition:all 0.2s; position:relative;
}
.subj-row:last-child { border-bottom:none; }
.subj-row.is-off { opacity:0.35; }
.subj-row:hover { background:#fafbff; }
.subj-row.is-off:hover { background:transparent; }

.subj-left {
    width:320px; min-width:320px; padding:16px 20px;
    display:flex; align-items:center; gap:14px;
    border-right:1px solid var(--border);
}
.subj-cb-wrap { position:relative; }
.subj-cb-wrap input { width:18px; height:18px; accent-color:#0052cc; cursor:pointer; }
.subj-info { flex:1; }
.subj-name-txt { font-size:14px; font-weight:700; color:var(--t1); letter-spacing:-0.2px; }
.subj-code-txt { font-size:11px; color:var(--t3); margin-top:1px; }
.subj-idx {
    width:24px; height:24px; border-radius:6px; background:#f0f3f7;
    display:flex; align-items:center; justify-content:center;
    font-size:10px; font-weight:700; color:var(--t3); flex-shrink:0;
}

.subj-right { flex:1; padding:12px 20px; display:flex; flex-direction:column; gap:10px; }

/* Type pills */
.type-row { display:flex; gap:6px; flex-wrap:wrap; }
.type-pill {
    display:inline-flex; align-items:center; gap:6px;
    padding:6px 12px; border-radius:8px; cursor:pointer;
    border:1.5px solid var(--border); background:#fff;
    font-size:11.5px; font-weight:600; color:var(--t2);
    transition:all 0.15s; user-select:none;
}
.type-pill:hover { border-color:#bbb; }
.type-pill input { display:none; }
.type-pill .tp-ico {
    width:22px; height:22px; border-radius:5px;
    display:flex; align-items:center; justify-content:center;
    font-size:10px; transition:all 0.15s;
}
.type-pill.active { border-width:2px; }

/* Flags */
.flag-row { display:flex; gap:6px; }
.flag-chip {
    display:inline-flex; align-items:center; gap:5px;
    padding:5px 10px; border-radius:6px; cursor:pointer;
    border:1.5px solid var(--border); background:#fff;
    font-size:11px; font-weight:500; color:var(--t3);
    transition:all 0.15s; user-select:none;
}
.flag-chip:hover { border-color:#bbb; }
.flag-chip input { display:none; }
.flag-chip .fc-dot {
    width:14px; height:14px; border-radius:4px; border:1.5px solid var(--border);
    display:flex; align-items:center; justify-content:center;
    font-size:7px; color:transparent; transition:all 0.15s;
}
.flag-chip.active { border-color:#0052cc; background:#e6f0ff; color:#0052cc; }
.flag-chip.active .fc-dot { background:#0052cc; border-color:#0052cc; color:#fff; }

/* Select all bar */
.cs-toolbar {
    padding:12px 20px; background:#f4f6f9; border-bottom:1px solid var(--border);
    display:flex; align-items:center; justify-content:space-between;
}
.cs-toolbar-left { display:flex; align-items:center; gap:12px; }
.cs-toolbar-left input { width:16px; height:16px; accent-color:#0052cc; }
.cs-toolbar-left span { font-size:12px; font-weight:600; color:var(--t2); }
.cs-toolbar-right { font-size:12px; color:var(--t3); }

/* Group header (parent subject — a label only, NOT selectable) */
.subj-group-header {
    display:flex; align-items:center; gap:12px;
    padding:13px 20px; background:#eef1f6;
    border-bottom:1px solid var(--border);
    border-left:4px solid #6554c0;
}
.subj-group-header .sgh-ico {
    width:28px; height:28px; border-radius:7px; background:#6554c0;
    display:flex; align-items:center; justify-content:center;
    color:#fff; font-size:12px; flex-shrink:0;
}
.subj-group-header .sgh-name { font-size:14px; font-weight:800; color:var(--t1); letter-spacing:-0.2px; }
.subj-group-header .sgh-sub  { font-size:11px; color:var(--t3); margin-top:1px; }
.subj-group-header .sgh-badge {
    margin-left:auto; font-size:10px; font-weight:700; text-transform:uppercase;
    letter-spacing:0.6px; color:#6554c0; background:#ede9fe;
    padding:4px 10px; border-radius:20px; white-space:nowrap;
}
/* Child rows sit indented under their group header */
.subj-row.subj-child { background:#fcfdff; }
.subj-row.subj-child .subj-left { padding-left:46px; border-left:4px solid #ede9fe; }
.subj-row.subj-child:hover { background:#f6f8ff; }

/* Page-specific only. The card, section labels, field grids, labels, inputs,
   status cards and footer all come from examon_ui.css.
   NOTE 2026-08-11: same early-comment-close typo as above — fixed. */
.form-page-wrap  { padding:16px 0 80px; }

.fg2 { margin-bottom:24px; }
.fg1 { margin-bottom:24px; }

/* Checkbox grid */
.chk-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(190px, 1fr));
    gap:8px;
}
.chk-grid.chk-grid-sm {
    grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));
}
.chk-item { position:relative; }
.chk-item input[type="checkbox"] { position:absolute; opacity:0; width:0; height:0; }
.chk-lbl {
    display:flex; align-items:center; gap:10px; padding:10px 12px;
    border:1.5px solid var(--border); border-radius:9px; cursor:pointer;
    transition:all 0.18s; background:#fff; min-height:42px;
}
.chk-lbl:hover { border-color:#bbb; background:#fafafa; }
.chk-item input:checked + .chk-lbl {
    border-color:var(--red); background:var(--red-soft); color:var(--red);
}
.chk-box {
    width:17px; height:17px; border-radius:4px;
    border:1.5px solid var(--border); background:#fff;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; transition:all 0.18s;
}
.chk-item input:checked + .chk-lbl .chk-box {
    background:var(--red); border-color:var(--red); color:#fff;
}
.chk-box i { font-size:9px; display:none; }
.chk-item input:checked + .chk-lbl .chk-box i { display:block; }
.chk-txt { font-size:13px; font-weight:500; line-height:1.3; }
.chk-sub { font-size:11px; color:var(--t3); }
.chk-item input:checked + .chk-lbl .chk-txt { color:var(--red); font-weight:600; }

/* Class group label inside checkboxes */
.cls-group-lbl {
    font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.6px;
    color:var(--t3); margin:10px 0 6px 2px;
}
.cls-group-lbl:first-child { margin-top:0; }

/* Select-all bar */
.sel-all-bar {
    display:flex; align-items:center; gap:10px;
    margin-bottom:10px; font-size:12px; color:var(--t3);
}
.sel-all-btn {
    font-size:11.5px; font-weight:600; color:var(--red);
    background:none; border:none; padding:0; cursor:pointer; text-decoration:underline;
}

/* Vertical checkbox / radio list */
.vlist { display:flex; flex-direction:column; gap:5px; }
.vlist-item { position:relative; }
.vlist-item input[type="checkbox"],
.vlist-item input[type="radio"] { position:absolute; opacity:0; width:0; height:0; }
.vlist-item label {
    display:flex; align-items:center; gap:10px; padding:9px 12px;
    border:1.5px solid var(--border); border-radius:8px; cursor:pointer;
    transition:all 0.15s; background:#fff; min-height:38px;
}
.vlist-item label:hover { border-color:#bbb; background:#fafafa; }
.vlist-item input:checked + label { border-color:var(--red); background:var(--red-soft); }

.vbox {
    width:16px; height:16px; border-radius:4px; flex-shrink:0;
    border:1.5px solid var(--border); background:#fff;
    display:flex; align-items:center; justify-content:center; transition:all 0.15s;
}
.vbox i { font-size:8px; color:#fff; display:none; }
.vlist-item input[type="checkbox"]:checked + label .vbox {
    background:var(--red); border-color:var(--red);
}
.vlist-item input[type="checkbox"]:checked + label .vbox i { display:block; }

.vbox-radio {
    width:16px; height:16px; border-radius:50%; flex-shrink:0;
    border:1.5px solid var(--border); background:#fff;
    display:flex; align-items:center; justify-content:center; transition:all 0.15s;
}
.vbox-radio i { font-size:6px; color:#fff; display:none; }
.vlist-item input[type="radio"]:checked + label .vbox-radio {
    background:var(--red); border-color:var(--red);
}
.vlist-item input[type="radio"]:checked + label .vbox-radio i { display:block; }
.vlist-item input[type="radio"]:checked + label .vtxt { color:var(--red); font-weight:600; }

.vtxt { font-size:13px; font-weight:500; color:var(--t2); line-height:1.3; }
.vsub { font-size:11px; color:var(--t3); }
.vlist-item input:checked + label .vtxt { color:var(--red); font-weight:600; }
.vempty { font-size:12px; color:var(--t3); padding:10px; background:#f8f8f8; border-radius:8px; }

/* Grade range type group */
.gr-group { border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.gr-group-hdr {
    padding:9px 14px; font-size:12px; font-weight:700;
    background:#f8f8f8; border-bottom:1px solid var(--border);
    display:flex; align-items:center; gap:8px; color:var(--t2);
}
.gr-group .vlist { padding:10px; gap:4px; }

/* Section/Excel-like Grid */
.sec-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: #e2e8f0; /* Creates inner borders */
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.head-grid {
    grid-template-columns: repeat(8, 1fr);
}
.head-grid .sec-lbl {
    padding: 8px 10px;
    gap: 8px;
}
.head-grid .sec-lbl::before {
    width: 16px;
    height: 16px;
    font-size: 9px;
    border-radius: 4px;
}
.head-grid .sec-name {
    font-size: 11.5px;
}
.sec-item { position: relative; background: #fff; }
.sec-item input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }

.sec-lbl {
    display: flex; align-items: center; justify-content: flex-start;
    padding: 12px 16px;
    cursor: pointer; transition: background 0.15s;
    height: 100%; gap: 14px;
}
.sec-lbl:hover {
    background: #f8fafc;
}

/* Custom Checkbox inside label */
.sec-lbl::before {
    content: '';
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    border-radius: 5px;
    background: #f1f5f9;
    transition: all 0.15s;
    flex-shrink: 0;
    color: transparent;
    font-size: 11px;
    font-family: "Font Awesome 5 Free"; font-weight: 900;
}

.sec-item input:checked + .sec-lbl {
    background: #fff;
}
.sec-item input:checked + .sec-lbl::before {
    content: '\f00c'; /* Checkmark icon */
    background: #ac3d3c; /* Theme red */
    color: #fff;
}

.sec-name {
    font-size: 13.5px; font-weight: 500; color: #475569;
}

/* Taken (assigned to another group) */
.sec-item.sec-taken .sec-lbl {
    background: #fcfcfc;
    cursor: help;
}
.sec-item.sec-taken .sec-lbl::before {
    background: #e2e8f0;
}
.sec-item.sec-taken .sec-lbl:hover { background: #f8fafc; }

.sec-taken-badge {
    margin-left: auto; color: #94a3b8; font-size: 12px;
}

/* ── Card grid ─────────────────────────────────────────────────────── */
.stu-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding-bottom: 80px; /* room for the floating bar */
}
@media (max-width: 1400px) { .stu-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .stu-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 780px)  { .stu-grid { grid-template-columns: repeat(2, 1fr); } }

.stu-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.stu-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.07); }
.stu-card.is-assigned { border-color: rgba(59,130,246,0.35); background: #f8fbff; }

.stu-card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #f1f1f1;
}
.stu-avatar {
    width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue, #3b82f6), #8b5cf6);
    color: #fff; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    text-transform: uppercase;
}
.stu-card-name { font-size: 13px; font-weight: 700; color: var(--t1); line-height: 1.2; }
.stu-card-meta { font-size: 11px; color: var(--t3); margin-top: 2px; }

.stu-subjects { padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 5px; }
.subj-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; color: var(--t2); cursor: pointer;
    padding: 3px 0; user-select: none;
}
.subj-label input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--blue, #3b82f6); flex-shrink: 0; }
.subj-label:hover { color: var(--blue, #3b82f6); }

/* ── Quick-select toolbar ──────────────────────────────────────────── */
.qs-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 10px 14px; background: #fafbfd;
    border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: 14px;
}
.qs-label { font-size: 12px; font-weight: 600; color: var(--t3); margin-right: 4px; }
.qs-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: rgba(245,158,11,0.09); color: #b45309;
    border: 1px solid rgba(245,158,11,0.25); cursor: pointer;
    transition: all 0.15s;
}
.qs-btn:hover { background: rgba(245,158,11,0.18); }
.qs-btn input { width: 13px; height: 13px; accent-color: #b45309; cursor: pointer; }
.stu-count { font-size: 12px; color: var(--t3); margin-left: auto; }

/* ── Floating save bar ─────────────────────────────────────────────── */
.ss-float-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 2px solid var(--border, #e2e8f0);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.07);
    z-index: 200;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 28px; gap: 10px;
}
.ss-float-note { font-size: 12px; color: var(--t3); }
.ss-float-note i { color: var(--amber, #f59e0b); margin-right: 5px; }
.ss-float-actions { display: flex; gap: 10px; }

/* ── Empty states ──────────────────────────────────────────────────── */
.ss-empty { text-align: center; padding: 56px 24px; color: var(--t3); }
.ss-empty i { font-size: 30px; color: #cbd5e1; margin-bottom: 12px; display: block; }
.ss-empty h4 { font-size: 15px; color: var(--t2); margin: 0 0 6px; }
.ss-empty p  { font-size: 13px; max-width: 460px; margin: 0 auto; line-height: 1.5; }

.subject-chip {
    display: inline-flex;
    align-items: center;
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
    color: var(--t1, #1e293b);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s;
}
.subject-chip:hover {
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.subject-chip .s-flag {
    margin-left: 4px;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.s-flag.f-sel { background: rgba(245, 158, 11, 0.1); color: #d97706; }

.subject-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 44px;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}
.show-more-wrap { display: none; margin-top: 6px; }
.toggle-chips-btn {
    font-size: 11px; font-weight: 600;
    color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.08);
    padding: 3px 8px; border-radius: 12px;
    transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 4px;
    text-decoration: none; border: none; cursor: pointer;
}
.toggle-chips-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-dark, #2563eb);
    text-decoration: none;
}

.stu-link {
    font-size: 12px; font-weight: 600; color: var(--primary, #3b82f6);
    cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.stu-link:hover { color: var(--primary-dark, #2563eb); text-decoration: underline; }
.stu-link i { font-size: 10px; }

/* ── Modal ── */
.ss-modal-bg {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45); z-index: 900;
    align-items: center; justify-content: center;
}
.ss-modal-bg.open { display: flex; }
.ss-modal {
    background: #fff; border-radius: 14px;
    width: 520px; max-width: 95vw; max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    overflow: hidden;
}
.ss-modal-head {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.ss-modal-title { font-size: 15px; font-weight: 700; color: var(--t1); }
.ss-modal-sub   { font-size: 12px; color: var(--t3); margin-top: 2px; }
.ss-modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--t3); padding: 0 4px; }
.ss-modal-close:hover { color: var(--t1); }
.ss-modal-body  { overflow-y: auto; padding: 10px 0; }
.ss-modal-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 20px; border-bottom: 1px solid #f1f5f9;
}
.ss-modal-row:last-child { border-bottom: none; }
.ss-m-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg,#3b82f6,#8b5cf6);
    color:#fff; font-size:12px; font-weight:700;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; text-transform:uppercase;
}
.ss-m-name { font-size: 13px; font-weight: 700; color: var(--t1); }
.ss-m-meta { font-size: 11px; color: var(--t3); margin-top: 2px; }
.ss-m-subj { font-size: 11.5px; color: var(--blue,#3b82f6); margin-top: 4px; font-weight: 600; }
.ss-modal-empty { text-align:center; padding:40px 20px; color:var(--t3); font-size:13px; }
.ss-modal-loading { text-align:center; padding:40px 20px; color:var(--t3); font-size:13px; }

.btn-setup {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
    text-decoration: none; transition: all 0.2s;
    background: var(--blue-soft); color: var(--blue);
}
.btn-setup:hover { background: rgba(29, 78, 216, 0.15); color: var(--blue); text-decoration: none; }
.sec-pill {
    display:inline-block; padding:3px 10px; background:#f0f0f0; border-radius:6px;
    font-size:12px; font-weight:600; color:var(--t2);
}

.st-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 84px; }
@media (max-width: 1200px) { .st-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .st-grid { grid-template-columns: 1fr; } }

.st-card {
    border: 1px solid var(--border, #e2e8f0); border-radius: 12px; background: #fff;
    padding: 14px 15px; transition: box-shadow .15s, border-color .15s;
}
.st-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.07); }
.st-card.is-set { border-color: rgba(59,130,246,.40); background: #f8fbff; }

.st-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.st-avatar {
    width: 36px; height: 36px; flex-shrink: 0; border-radius: 9px;
    background: linear-gradient(135deg, var(--blue, #3b82f6), #8b5cf6);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; text-transform: uppercase;
}
.st-subj-name { font-size: 13.5px; font-weight: 700; color: var(--t1); line-height: 1.2; }
.st-subj-code { font-size: 11px; color: var(--t3); margin-top: 2px; }
.st-check { margin-left: auto; color: #16a34a; font-size: 15px; opacity: 0; transition: opacity .15s; }
.st-card.is-set .st-check { opacity: 1; }

.st-select {
    width: 100%; box-sizing: border-box; padding: 9px 11px;
    border: 1px solid var(--border, #e2e8f0); border-radius: 8px;
    font-size: 13px; font-family: inherit; color: var(--t1); background: #fff; cursor: pointer;
}
.st-select:focus { outline: none; border-color: var(--blue, #3b82f6); box-shadow: 0 0 0 3px rgba(59,130,246,.12); }

.qs-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    padding: 12px 14px; background: #fafbfd; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px;
}
.qs-label { font-size: 12px; font-weight: 700; color: var(--t3); }
.qs-search {
    padding: 7px 11px 7px 30px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 13px; font-family: inherit; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E") no-repeat 10px center;
    min-width: 200px; color: var(--t1);
}
.qs-mini { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; font-family: inherit; background: #fff; color: var(--t1); }
.qs-btn {
    display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid rgba(59,130,246,.25);
    background: rgba(59,130,246,.08); color: var(--blue, #3b82f6); transition: background .15s;
}
.qs-btn:hover { background: rgba(59,130,246,.16); }
.qs-count { font-size: 12.5px; color: var(--t3); margin-left: auto; font-weight: 600; }
.qs-count b { color: var(--t1); }

.ss-float-bar {
    position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
    border-top: 2px solid var(--border, #e2e8f0); box-shadow: 0 -4px 16px rgba(0,0,0,.07); z-index: 200;
    display: flex; align-items: center; justify-content: space-between; padding: 12px 28px; gap: 10px;
}
.ss-float-note { font-size: 12px; color: var(--t3); }
.ss-float-note i { color: var(--amber, #f59e0b); margin-right: 5px; }
.ss-float-actions { display: flex; gap: 10px; }
.st-no-match { display: none; text-align: center; padding: 40px; color: var(--t3); font-size: 13px; }

.ss-empty { text-align: center; padding: 56px 24px; color: var(--t3); }
.ss-empty i { font-size: 30px; color: #cbd5e1; margin-bottom: 12px; display: block; }
.ss-empty h4 { font-size: 15px; color: var(--t2); margin: 0 0 6px; }
.ss-empty p  { font-size: 13px; max-width: 460px; margin: 0 auto; line-height: 1.5; }

.subject-chip {
    display: inline-flex; align-items: center;
    background: var(--bg-body, #f8fafc); border: 1px solid var(--border-light, #e2e8f0);
    color: var(--t1, #1e293b); padding: 2px 8px; border-radius: 20px;
    font-size: 10px; font-weight: 500;
}
.subject-chips-container { display: flex; flex-wrap: wrap; gap: 4px; max-width: 380px; }
.cov-wrap { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.cov-bar  { flex: 1; height: 6px; background: var(--border, #e2e8f0); border-radius: 3px; overflow: hidden; }
.cov-fill { height: 100%; border-radius: 3px; }
.cov-txt  { font-size: 11px; font-weight: 700; white-space: nowrap; }
.cov-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 8px; border-radius:12px; text-transform:uppercase; letter-spacing:.4px; }
.cov-full   { background: rgba(22,163,74,.10);  color:#16a34a; }
.cov-part   { background: rgba(245,158,11,.10); color:#d97706; }
.cov-none   { background: rgba(100,116,139,.10); color:#64748b; }

/* --- Exam Rules CSS --- */

.cond-row.over { border-top: 2px dashed var(--blue) !important; }

/* Print & Display toggle switch */
.pds-toggle {
    position: relative;
    display: inline-flex;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}
.pds-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.pds-slider {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    border-radius: 20px;
    transition: background 0.18s;
}
.pds-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.18s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.pds-toggle input:checked + .pds-slider { background: #8b5cf6; }
.pds-toggle input:checked + .pds-slider::before { transform: translateX(16px); }

/* Red scope pill radio group */
.pds-scope-pill { display: inline-flex; align-items: center; cursor: pointer; }
.pds-scope-pill input[type=radio] { display: none; }
.pds-scope-pill span {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    background: #fff;
    transition: all 0.15s;
    white-space: nowrap;
}
.pds-scope-pill input[type=radio]:checked + span {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

/* Checkbox pill group */
.pds-checkbox-pill { display: inline-flex; align-items: center; cursor: pointer; }
.pds-checkbox-pill input[type=checkbox] { display: none; }
.pds-checkbox-pill span {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    background: #fff;
    transition: all 0.15s;
    white-space: nowrap;
}
.pds-checkbox-pill input[type=checkbox]:checked + span {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

/* Remove up/down arrows from number inputs */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

/* ── Minimalist Form Field System ── */
.fr-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
    letter-spacing: 0;
}
.fr-select {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 10px 6px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.fr-select:focus {
    border-color: #94a3b8;
}
.fr-input {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.fr-input:focus {
    border-color: #94a3b8;
}

/* --- Setup & Marks Entry CSS --- */

/* A THIRD verbatim copy of the form-v2 block lived here (removed 2026-08-11 —
   see this file's header). Only the narrower shell width was page-specific, so
   that is all that remains. Everything else now comes from examon_ui.css. */
.form-page-inner { width:100%; max-width:900px; margin:0 auto; }

.btn-setup-pending {
    background: rgba(220, 38, 38, 0.08);
    color: var(--red);
    border-color: rgba(220, 38, 38, 0.2);
}
.btn-setup-pending:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.marks-wrap { max-width: 960px; margin: 0 auto 100px; font-family: var(--font); }

/* Header Card Redesign */
.marks-header-card {
    background: var(--surface, #ffffff);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 16px -4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}
.marks-hdr-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.marks-hdr-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.marks-hdr-ico {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(220,38,38,0.12) 0%, rgba(220,38,38,0.04) 100%);
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: inset 0 0 0 1px rgba(220,38,38,0.1);
}
.marks-hdr-title-wrap h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--t1);
    margin: 0 0 2px 0;
    letter-spacing: -0.3px;
}
.marks-hdr-title-wrap p {
    font-size: 12.5px;
    color: var(--t3);
    margin: 0;
    font-weight: 500;
}
.marks-hdr-meta {
    display: flex;
    gap: 28px;
    padding-top: 14px;
    border-top: 1px dashed rgba(0,0,0,0.08);
    flex-wrap: wrap;
}
.marks-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.marks-meta-lbl {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--t3);
}
.marks-meta-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--t1);
}

/* Class block */
.class-block {
    background: var(--surface, #ffffff);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 6px 16px -6px rgba(0,0,0,0.08);
    margin-bottom: 28px;
    overflow: hidden;
}
.class-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg, #f1f5f9);
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.class-hdr-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--t1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.class-hdr-name i {
    color: var(--red);
    background: rgba(220,38,38,0.08);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.btn-fill-class {
    font-size: 11px;
    font-weight: 600;
    color: var(--t2);
    background: var(--surface, #fff);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.btn-fill-class i { color: var(--t3); transition: color 0.2s; }
.btn-fill-class:hover {
    border-color: var(--red);
    color: var(--red);
    background: rgba(220,38,38,0.04);
}
.btn-fill-class:hover i { color: var(--red); }

/* Section block */
.section-block {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.section-block:last-child {
    border-bottom: none;
}
.section-hdr {
    padding: 8px 16px;
    background: var(--surface, #ffffff);
    font-size: 11px;
    font-weight: 700;
    color: var(--t2);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.section-hdr-left {
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-hdr-left i { color: var(--t3); opacity: 0.7; }

/* Marks table */
.marks-table { width: 100%; border-collapse: collapse; }
.marks-table th {
    background: var(--bg, #fafafa);
    padding: 8px 16px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--t3);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    text-align: left;
}
.marks-table td {
    padding: 6px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
}
.marks-table tr:last-child td { border-bottom: none; }
.marks-table tr:hover td { background: rgba(0,0,0,0.015); }
.subject-name { font-size: 13px; font-weight: 600; color: var(--t1); }
.marks-input {
    width: 80px;
    padding: 5px 8px;
    border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    text-align: center;
    color: var(--t1);
    background: var(--surface, #fff);
    outline: none;
    transition: all 0.2s;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.marks-input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(220,38,38,0.15);
}
.marks-input:disabled {
    background: var(--bg, #f8f8f8);
    color: var(--t3);
    cursor: not-allowed;
    border-color: rgba(0,0,0,0.05);
    box-shadow: none;
}
.marks-input.has-val {
    border-color: var(--green);
    background: rgba(16,185,129,0.04);
}

details.class-block summary::-webkit-details-marker { display: none; }
details.class-block[open] summary .caret-icon { transform: rotate(180deg); color: var(--red); }
.caret-icon { transition: transform 0.2s; color: var(--t3); margin-right: 4px; font-size:12px; }

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.xmodal {
    display: none !important;
}
.xmodal.open {
    display: flex !important;
}
#fillMarksInput:focus {
    border-color: var(--red) !important;
    box-shadow: 0 0 0 3px var(--red-soft) !important;
}

.btn-test-entry {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.btn-test-entry:hover, .btn-test-entry.active {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}
.btn-exam-entry {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.btn-exam-entry:hover, .btn-exam-entry.active {
    background: #15803d;
    color: #fff;
    border-color: #15803d;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
    transform: translateY(-1px);
}

@keyframes fadeup { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.bex-lbl { display:block; font-size:11px; font-weight:700; color:var(--t3); text-transform:uppercase; margin-bottom:6px; }
.bex-sel {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: var(--surface, #fff);
    color: var(--t1, #1e293b);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    appearance: auto;
    outline: none;
    transition: border-color 0.2s;
}
.bex-sel:focus  { border-color: var(--red, #dc2626); }
.bex-sel:disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg, #f8fafc); }

/* Indeterminate progress bar for bulk ZIP generation (no real % — the server
   builds the whole ZIP in one request, so this is an activity indicator). */
.bex-prog { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; position: relative; }
.bex-prog-bar {
    position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 999px;
    background: linear-gradient(90deg, var(--red, #dc2626), #f87171);
    animation: bexIndet 1.1s ease-in-out infinite;
}
@keyframes bexIndet { 0% { left: -40%; } 100% { left: 100%; } }

/* The SweetAlert skin moved to examon_ui.css §9 on 2026-08-11. It was declared
   here with !important throughout, so leaving it would have beaten the shared
   version outright. */

/* Search Container */
.search-hub {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 32px;
}
.sh-top { margin-bottom: 16px; }
.sh-title { font-size: 18px; font-weight: 700; color: #1e293b; margin: 0 0 4px; }
.sh-desc { font-size: 13px; color: #64748b; margin: 0; }

.search-bar {
    display: flex; gap: 12px;
}
.sb-select {
    width: 200px;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
}
.sb-select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); background:#fff; }

.sb-input-wrap { flex: 1; position: relative; }
.sb-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 16px; }
.sb-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s;
}
.sb-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.sb-input::placeholder { color: #cbd5e1; }

.btn-search {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 0 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37,99,235,0.2);
}
.btn-search:hover { background: #1d4ed8; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,0.3); }

/* Section Title */
.sec-title {
    font-size: 16px; font-weight: 700; color: #334155; margin: 0 0 16px;
    display: flex; align-items: center; gap: 8px;
}
.sec-title i { color: #cbd5e1; font-size: 14px; }

.stu-card:hover { background:#f8fafc !important; }
            .stu-card a:hover { background:#1d4ed8 !important; transform:translateY(-1px); box-shadow:0 4px 6px rgba(37,99,235,0.3) !important; }

.csg { padding-bottom: 86px; margin-top: 24px; }
/* Hero Section Layout */
.csg-hero { display: flex; justify-content: space-between; align-items: stretch; gap: 16px; margin-bottom: 20px; padding: 0 4px; }

/* Base Hero Card */
.hero-card {
    display: flex; align-items: center; gap: 16px; padding: 12px 18px; min-width: 0;
    border-radius: 12px; background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0; box-shadow: 0 4px 15px rgba(0,0,0,0.03), 0 1px 3px rgba(0,0,0,0.02);
}

/* Term Card (15%) */
.term-card { flex: 0 0 15%; }
.tc-icon {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0;
    background: linear-gradient(135deg, #10b981, #059669); color: white; font-size: 18px;
    border-radius: 10px; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}
.tc-content { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.tc-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.tc-value { font-size: 15px; font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Info Card (25%) */
.info-card { flex: 0 0 25%; }
.ic-icon {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #4f46e5); color: white; font-size: 18px;
    border-radius: 10px; box-shadow: 0 4px 10px rgba(79,70,229,0.2);
}
.ic-content { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.ic-title-row { display: flex; align-items: center; gap: 12px; }
.ic-title { font-size: 18px; font-weight: 800; color: #0f172a; margin: 0; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-prog { font-size: 11px; font-weight: 700; color: #4338ca; background: #e0e7ff; border: 1px solid #c7d2fe; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.ic-sub { font-size: 12.5px; color: #64748b; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Awesome Banner Styles (50%) */
.awesome-banner { flex: 1; margin-bottom: 0; }
.ab-icon {
    display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; font-size: 18px;
    border-radius: 10px; box-shadow: 0 4px 10px rgba(37,99,235,0.2); flex-shrink: 0;
}
.ab-content { display: flex; flex-direction: column; gap: 6px; }
.ab-title { font-size: 13.5px; font-weight: 700; color: #1e293b; letter-spacing: 0.3px; text-transform: uppercase; }
.ab-rules { display: flex; flex-wrap: wrap; gap: 10px; }
.rule-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.rule-chip i { font-size: 11px; }
.rc-code { font-weight: 800; }
.rc-name { opacity: 0.9; font-weight: 500; font-size: 11.5px; }

.csg-banner-danger { display:flex; align-items:center; gap:12px; padding:11px 16px; margin-bottom:14px; border-radius:4px; font-size:13px; font-weight:600; color:var(--red); background:rgba(172,61,60,0.06); border:1px solid rgba(172,61,60,0.2); }

.csg-tools { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.csg-tool { display:flex; align-items:center; gap:8px; }
.csg-tlabel { font-size:12px; font-weight:600; color:var(--t3); }
.csg-search { position:relative; flex:1; min-width:200px; max-width:320px; }
.csg-search i { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--t3); font-size:13px; }
.csg-search input { width:100%; box-sizing:border-box; padding:9px 12px 9px 32px; border:1px solid #cbd5e1; border-radius:4px; font-size:13px; font-family:inherit; background:#fff; color:var(--t1); box-shadow:inset 0 1px 2px rgba(0,0,0,0.02); }
.csg-search input:focus { outline:none; border-color:#2563eb; }

/* Excel Table Design */
.csg-wrap { overflow-x:auto; border:1px solid #94a3b8; background:#fff; position:relative; }
.csg-tbl { width:100%; border-collapse:collapse; font-size:13px; font-family: var(--font); }
.csg-tbl th, .csg-tbl td { border:1px solid #cbd5e1; padding:0; white-space:nowrap; }

/* Fullscreen Mode Optimization */
html:fullscreen .eo-main, html:-webkit-full-screen .eo-main { max-width: 100% !important; padding: 0 16px !important; margin: 0 !important; }
html:fullscreen .eo-top, html:-webkit-full-screen .eo-top { display: none !important; }
html:fullscreen .bcrumb, html:-webkit-full-screen .bcrumb { display: none !important; }
html:fullscreen .csg-hero, html:-webkit-full-screen .csg-hero { display: none !important; }
html:fullscreen .csg, html:-webkit-full-screen .csg { margin-top: 0 !important; padding: 20px 0 !important; }
html:fullscreen .csg-wrap, html:-webkit-full-screen .csg-wrap { max-height: calc(100vh - 120px); overflow-y: auto; border-left: none; border-right: none; }
html:fullscreen body::before, html:-webkit-full-screen body::before { background: var(--bg) !important; }

.csg-tbl thead th { position:sticky; top:0; z-index:3; background:#f1f5f9; color:#334155; font-weight:600; font-size:11.5px; text-transform:uppercase; letter-spacing:.3px; padding:6px 10px; border-bottom:2px solid #94a3b8; }
.csg-subj { text-align:center !important; min-width:80px; max-width:120px; white-space:normal !important; word-wrap:break-word; line-height:1.3; vertical-align:middle; padding:8px 6px !important; }
.csg-max { color:#64748b; font-weight:700; font-size:10px; display:block; margin-top:4px; }
.csg-totcol { text-align:center !important; width:70px; background:#e2e8f0 !important; }

/* Sticky Columns */
.csg-sticky { position:sticky; z-index:2; padding:4px 8px !important; }
.csg-roll { left:0; width:55px; min-width:55px; text-align:center; color:#64748b; font-weight:600; font-size:12px; background:#f1f5f9; }
.csg-name { left:55px; min-width:180px; background:#fff; border-right:2px solid #94a3b8 !important; } /* Hard edge before marks */
.csg-adm { text-align:center; color:#64748b; font-size:12px; background:#f8fafc; min-width:70px; }

.csg-tbl thead .csg-roll, .csg-tbl thead .csg-name { z-index:4; background:#e2e8f0; }

.csg-sname { font-weight:600; color:#0f172a; }

/* Input Cells - Zero Padding */
.csg-cell { position:relative; min-width:80px; }
.csg-in { display:block; width:100%; height:32px; margin:0; padding:0 4px; box-sizing:border-box; text-align:center; border:none; background:transparent; font-size:13.5px; font-weight:600; color:#0f172a; font-family:inherit; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
.csg-in.txt { text-align:left; padding-left:8px; min-width:200px; }
.csg-sel { width:100%; height:32px; border:none; background:transparent; outline:none; text-align:center; padding: 0 4px; font-family:inherit; font-weight:600; font-size:13px; color:#0f172a; transition: .15s; }

.csg-in:focus, .csg-sel:focus { outline:none; border-color:#3b82f6; border-style:solid; background:#fff; color:#0f172a; box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4), 0 8px 10px -6px rgba(59, 130, 246, 0.1); z-index:20; position:relative; transform: scale(1.08); border-radius: 4px; }

/* Special Cell States */
.csg-in.csg-code { background:#fffbeb !important; color:#b45309 !important; border-color:#fcd34d !important; border-style:solid !important; box-shadow:inset 0 0 0 1px #fcd34d !important; text-transform:uppercase; }
.csg-in.csg-bad { background:rgba(239,68,68,0.15); color:#b91c1c; font-weight:700; border-style:solid !important; border-color:#fca5a5 !important; }

/* Skill / Activity & Dropdown Grade Select Elements (Spacious Input Box Style) */
.csg-sel {
    display: inline-block;
    width: 90%;
    max-width: 340px;
    height: 38px;
    margin: 0 auto;
    padding: 0 32px 0 16px;
    box-sizing: border-box;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    color: #1e293b;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ea580c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    border: 1.5px dashed #f97316;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    cursor: pointer;
    text-align-last: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(249, 115, 22, 0.08);
}
.csg-sel:hover {
    border-style: solid;
    border-color: #ea580c;
    background-color: #fff7ed;
}
.csg-sel:focus {
    border-style: solid;
    border-color: #ea580c;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
}
/* Selected Grade Active State (Green Badge) */
.csg-sel.has-value {
    background-color: #ecfdf5 !important;
    border: 1.5px solid #10b981 !important;
    color: #047857 !important;
    font-weight: 700 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}
.csg-sel option {
    font-weight: 500;
    color: #0f172a;
    background: #ffffff;
    text-align: left;
    padding: 8px 12px;
}

.csg-tot { text-align:center; font-weight:700; color:#0f172a; background:#f8fafc; }

/* Selected-subject column tag + locked (not-assigned) cell */
.csg-seltag { display:inline-block; margin-left:2px; padding:0 6px; border-radius:10px; font-size:8.5px; font-weight:800; text-transform:uppercase; letter-spacing:0.3px; color:#9333ea; background:#faf5ff; border:1px solid #e9d5ff; vertical-align:middle; }
.csg-cell.csg-blocked { background:repeating-linear-gradient(45deg,#f1f5f9,#f1f5f9 6px,#e9eef4 6px,#e9eef4 12px) !important; cursor:not-allowed; }
.csg-na { display:flex; align-items:center; justify-content:center; height:32px; font-size:11px; font-weight:700; color:#94a3b8; letter-spacing:0.5px; }

/* 2-level heads (migration 023): a subject with child heads occupies several
   columns, so each one is tagged with the head it belongs to. The parent's own
   column is a DERIVED value (spec §9) — tinted and un-enterable, distinct from
   .csg-blocked above so "calculated" never reads as "not allowed for you". */
.csg-headtag { display:inline-block; margin-top:3px; padding:0 6px; border-radius:10px; font-size:8.5px; font-weight:800; text-transform:uppercase; letter-spacing:0.3px; color:#0369a1; background:#f0f9ff; border:1px solid #bae6fd; vertical-align:middle; }
.csg-headtag.csg-headtag-auto { color:#047857; background:#ecfdf5; border-color:#a7f3d0; }
.csg-subj.csg-auto-th { background:#f0fdf4; }
.csg-cell.csg-autocell { background:#f0fdf4 !important; cursor:not-allowed; }
.csg-cell.csg-autocell .csg-na { color:#047857; }
/* The derived value itself — a number, recomputed live from the child cells. */
.csg-autoval { display:flex; align-items:center; justify-content:center; height:32px; font-size:13px; font-weight:800; color:#047857; }

/* Alternating Rows */
.csg-tbl tbody tr:nth-child(even) td.csg-name { background:#f8fafc; }
.csg-tbl tbody tr:nth-child(even) td.csg-cell { background:#fafaf9; }
.csg-tbl tbody tr:hover td { background:#f1f5f9 !important; }
.csg-tbl tbody tr:hover .csg-in { background:transparent; }

.csg-kbd { font-size:11px; font-weight:700; padding:2px 6px; border-radius:4px; background:#0284c7; color:#fff; }

.csg-bar { position:fixed; left:0; right:0; bottom:0; z-index:50; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 28px; background:var(--surface); border-top:1px solid var(--border); box-shadow:0 -4px 20px rgba(0,0,0,0.06); }
.csg-barinfo { font-size:13px; color:var(--t2); font-weight:600; }
.csg-baract { display:flex; gap:10px; }

/* Responsive Adjustments */
@media (max-width: 1024px) {
    /* Slightly less width for names on smaller screens */
    .csg-name { min-width: 160px !important; }
}

@media (max-width: 768px) {
    /* Un-stick Adm No */
    .csg-adm { left: auto !important; z-index: 1 !important; }
    .csg-tbl thead .csg-adm { z-index: 3 !important; }
    .csg-name { left: 45px !important; min-width: 130px !important; }
    
    .csg-hero { flex-direction: column; align-items: stretch; gap: 14px; }
    .csg-hero-right { width: 100%; }
}

@media (max-width: 576px) {
    .csg-search { max-width: 100%; width: 100%; }
    .csg-tools { flex-direction: column; align-items: stretch; gap: 10px; }
    .csg-tool { justify-content: space-between; }
    
    .csg-bar { flex-direction: column; padding: 12px 16px; gap: 8px; }
    .csg-baract { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .csg-baract button { width: 100%; padding: 8px; font-size: 13px; justify-content: center; }
}

/* Page Header */
.me-header {
    display: flex; align-items: center; gap: 16px;
    padding: 4px 4px 24px; margin-bottom: 4px;
}
.me-header-icon {
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white; font-size: 20px;
    box-shadow: 0 6px 16px rgba(79,70,229,0.2);
}
.me-header-title {
    font-size: 22px; font-weight: 800; color: #0f172a; margin: 0; letter-spacing: -0.5px;
}
.me-header-title span { color: #ac3d3c; }
.me-header-sub { margin: 2px 0 0; font-size: 13px; color: #64748b; font-weight: 500; }

/* Grid — 3 equal columns */
.me-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Base Card */
.me-mode-card {
    display: flex; flex-direction: column; gap: 14px;
    padding: 22px 22px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative; overflow: hidden;
}
.me-mode-card::before {
    content: ''; position: absolute; inset: 0; opacity: 0;
    transition: opacity 0.2s ease;
}
.me-card-class::before  { background: linear-gradient(135deg, rgba(16,185,129,0.04), rgba(5,150,105,0.02)); }
.me-card-excel::before  { background: linear-gradient(135deg, rgba(59,130,246,0.04), rgba(37,99,235,0.02)); }
.me-card-status::before { background: linear-gradient(135deg, rgba(245,158,11,0.05), rgba(217,119,6,0.02)); }
.me-card-student::before { background: linear-gradient(135deg, rgba(147,51,234,0.04), rgba(126,34,206,0.02)); }
.me-card-att::before { background: linear-gradient(135deg, rgba(13,148,136,0.04), rgba(15,118,110,0.02)); }
.me-card-health::before { background: linear-gradient(135deg, rgba(225,29,72,0.04), rgba(190,18,60,0.02)); }
.me-card-rem::before { background: linear-gradient(135deg, rgba(79,70,229,0.04), rgba(67,56,202,0.02)); }

.me-mode-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.1); text-decoration: none; }
.me-mode-card:hover::before { opacity: 1; }

.me-card-class:hover  { border-color: #6ee7b7; }
.me-card-excel:hover  { border-color: #93c5fd; }
.me-card-status:hover { border-color: #fcd34d; }
.me-card-student:hover { border-color: #d8b4fe; }
.me-card-att:hover { border-color: #5eead4; }
.me-card-health:hover { border-color: #fca5a5; }
.me-card-rem:hover { border-color: #a5b4fc; }

/* Card Top Row */
.me-card-top { display: flex; align-items: center; justify-content: space-between; }

.me-mode-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    flex-shrink: 0;
}
.me-card-arrow {
    font-size: 14px; color: #94a3b8;
    transition: transform 0.2s ease, color 0.2s ease;
}
.me-mode-card:hover .me-card-arrow { transform: translateX(4px); color: #475569; }

/* Card Body */
.me-card-body h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; color: #0f172a; }
.me-card-body p  { margin: 0; font-size: 13px; color: #64748b; line-height: 1.55; }

/* Bottom Tag */
.me-card-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; padding: 4px 10px;
    border-radius: 20px; letter-spacing: 0.2px;
    align-self: flex-start;
}
.me-card-class  .me-card-tag { background: #d1fae5; color: #065f46; }
.me-card-excel  .me-card-tag { background: #dbeafe; color: #1d4ed8; }
.me-card-status .me-card-tag { background: #fef3c7; color: #92400e; }
.me-card-student .me-card-tag { background: #f3e8ff; color: #6b21a8; }
.me-card-att .me-card-tag { background: #ccfbf1; color: #0f766e; }
.me-card-health .me-card-tag { background: #ffe4e6; color: #9f1239; }
.me-card-rem .me-card-tag { background: #e0e7ff; color: #4338ca; }

/* Responsive */
@media (max-width: 768px) {
    .me-mode-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) and (min-width: 769px) {
    .me-mode-grid { grid-template-columns: repeat(2, 1fr); }
}

.db-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:18px; }
.db-kpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:16px 18px; display:flex; flex-direction:column; gap:3px; }
.db-kpi-num { font-size:24px; font-weight:800; color:var(--t1); line-height:1; }
.db-kpi-lbl { font-size:12px; color:var(--t3); font-weight:600; }
.db-kpi-lead { flex-direction:row; align-items:center; gap:14px; grid-column:span 1; }
.db-ring { --pct:0; width:62px; height:62px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center;
    background:conic-gradient(#16a34a calc(var(--pct)*1%), var(--border) 0); }
.db-ring span { width:46px; height:46px; border-radius:50%; background:var(--surface); display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:800; color:var(--t1); }

.db-tabs { display:flex; gap:4px; border-bottom:2px solid var(--border); margin-bottom:18px; flex-wrap:wrap; }
.db-tab { background:none; border:none; padding:10px 16px; font-size:13px; font-weight:600; font-family:inherit; color:var(--t3); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; display:inline-flex; align-items:center; gap:7px; }
.db-tab:hover { color:var(--t1); }
.db-tab.active { color:var(--blue,#2563eb); border-bottom-color:var(--blue,#2563eb); }
.db-panel { display:none; }
.db-panel.active { display:block; }

.db-allgood { display:flex; align-items:center; gap:10px; background:rgba(22,163,74,.08); border:1px solid rgba(22,163,74,.25); color:#15803d; border-radius:var(--r); padding:14px 16px; font-size:13px; margin-bottom:16px; }
.db-allgood i { font-size:18px; }

.db-hl-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
.db-hl { display:flex; align-items:center; gap:14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:16px 18px; }
.db-hl-ico { width:42px; height:42px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.db-hl-lbl { font-size:11.5px; color:var(--t3); font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
.db-hl-val { font-size:16px; font-weight:800; color:var(--t1); margin-top:1px; }
.db-hl-sub { font-size:12px; color:var(--t3); margin-top:1px; }

.db-filter { display:flex; gap:6px; margin-bottom:14px; }
.db-fbtn { padding:6px 14px; border:1px solid var(--border); background:var(--surface); border-radius:20px; font-size:12.5px; font-weight:600; font-family:inherit; color:var(--t2); cursor:pointer; }
.db-fbtn.active { background:var(--blue,#2563eb); border-color:var(--blue,#2563eb); color:#fff; }

.db-sec-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.db-sec-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:15px 16px; display:flex; flex-direction:column; gap:11px; }
.db-sec-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.db-sec-name { font-size:14px; font-weight:700; color:var(--t1); }
.db-sec-meta { font-size:11.5px; color:var(--t3); margin-top:2px; }
.db-sec-pending { display:flex; flex-direction:column; gap:6px; }
.db-sec-pending-lbl { font-size:11px; color:var(--t3); font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
.db-pill { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 10px; border:1px solid var(--border); border-radius:8px; text-decoration:none; transition:border-color .15s, background .15s; }
.db-pill:hover { border-color:var(--blue,#2563eb); background:rgba(59,130,246,.04); }
.db-pill span { font-size:12.5px; font-weight:600; color:var(--t1); }
.db-pill em { font-size:11px; color:var(--t3); font-style:normal; white-space:nowrap; }
.db-sec-clear { font-size:12px; color:#16a34a; font-weight:600; }
.db-sec-clear i { margin-right:5px; }
.db-incharge-note { font-size:11.5px; color:var(--t3); margin-top:14px; }

.db-tag { display:inline-block; font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; padding:1px 6px; border-radius:10px; background:rgba(245,158,11,.12); color:#b45309; margin-left:4px; vertical-align:middle; }
.db-badge { display:inline-block; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; padding:3px 9px; border-radius:12px; }
.db-b-done { background:rgba(22,163,74,.10); color:#16a34a; }
.db-b-prog { background:rgba(245,158,11,.10); color:#d97706; }
.db-b-none { background:rgba(220,38,38,.10); color:#dc2626; }

.pv-wrap { max-width:1120px; margin:0 auto; padding-bottom:80px; font-family:var(--font); }
.pv-hero {
    background:linear-gradient(135deg,#0a0f1a 0%,#121c30 100%);
    border-radius:14px; padding:20px 28px; margin-bottom:18px;
    display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;
}
.pv-hero-left { display:flex; align-items:center; gap:14px; }
.pv-hero-ico {
    width:42px; height:42px; border-radius:10px;
    background:rgba(79,70,229,0.25); border:1px solid rgba(79,70,229,0.4);
    display:flex; align-items:center; justify-content:center; font-size:18px; color:#a5b4fc;
}
.pv-hero h2 { font-size:16px; font-weight:700; color:#fff; margin:0 0 2px; }
.pv-hero p  { font-size:12px; color:rgba(255,255,255,0.45); margin:0; }
.pv-actions { display:flex; gap:10px; }
.pv-btn {
    display:inline-flex; align-items:center; gap:7px; padding:8px 14px;
    background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.14);
    border-radius:8px; color:rgba(255,255,255,0.8); font-size:13px; font-weight:500;
    text-decoration:none; cursor:pointer; transition:.2s;
}
.pv-btn:hover { background:rgba(255,255,255,0.16); color:#fff; }

.pv-sheet { background:#fff; border:1px solid var(--border,#e2e8f0); border-radius:12px; padding:26px 28px; box-shadow:0 4px 18px rgba(0,0,0,0.05); margin-bottom:20px; }
.pv-sheet-head { text-align:center; border-bottom:2px solid #1f2937; padding-bottom:14px; margin-bottom:18px; }
.pv-sheet-head h1 { font-size:20px; font-weight:800; color:#111827; letter-spacing:-0.3px; margin:0 0 4px; }
.pv-sheet-head .sub { font-size:12.5px; color:var(--t2,#64748b); margin:0 0 8px; }
.pv-info { display:flex; justify-content:center; gap:26px; flex-wrap:wrap; font-size:12.5px; }
.pv-info span { color:var(--t2,#64748b); } .pv-info strong { color:#111827; }

/* SAMPLE banner — repurposed for rules */
.pv-sample-banner {
    margin:0 0 16px; padding:12px 16px; border-radius:8px;
    background:#f0fdf4; border:1px solid #bbf7d0; color:#166534;
    font-size:12px; display:flex; flex-direction:column; gap:8px;
}
.pv-sb-head { font-weight:700; display:flex; align-items:center; gap:6px; font-size:12.5px; }

.pv-area-title { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:0.8px; color:#1f2937; margin:22px 0 10px; display:flex; align-items:center; gap:8px; }
.pv-tbl { width:100%; border-collapse:collapse; }
.pv-tbl th, .pv-tbl td { border:1px solid #d8dee9; padding:8px 10px; font-size:12.5px; }
.pv-tbl thead th { background:#f3f4f6; color:#374151; font-weight:700; text-align:center; vertical-align:middle; }
.pv-tbl th.subj-col, .pv-tbl td.subj-col { text-align:left; min-width:140px; }
.pv-tbl td.subj-col { font-weight:600; color:#111827; }
.pv-tbl th.head-grp { background:#e7ecf6; color:#1e293b; font-size:12px; }
.pv-tbl th.head-grp-orange { background:#ffedd5 !important; color:#9a3412 !important; font-size:12px; font-weight:700; }
.pv-tbl .hg-max { font-weight:600; color:#6b7280; font-size:11px; }
.pv-tbl th.test-col { background:#f3f4f6; font-weight:600; font-size:11.5px; }
.pv-tbl th.raw-col  { background:#eef2ff; color:#3730a3; font-size:11.5px; }
.pv-tbl th.wt-col   { background:#ecfdf5; color:#047857; font-size:11.5px; }
.pv-tbl th.wt-col-orange { background:#fff7ed !important; color:#c2410c !important; font-size:11.5px; font-weight:700; }
.pv-tbl td.cell { text-align:center; color:#111827; vertical-align:middle; }
.pv-tbl td.cell.test-col { color:#374151; }
.pv-tbl td.cell.raw-col  { background:#f5f7ff; color:#3730a3; font-weight:600; }
.pv-tbl td.cell.wt-col   { background:#f0fdf8; }
.pv-tbl td.cell.wt-col-orange-td { background:#fffaf5 !important; }
.pv-tbl td.cell.na   { color:#cbd5e1; background:#f8fafc; }

/* 2-level heads (migration 023): the derived parent cell of a test whose head
   has child heads. Not an input — its value is computed from the child cells
   (spec §9) and surfaces in the head's Weightage column. */
.pv-tbl th.test-col.auto-col { background:#f0fdf4; color:#047857; }
.pv-tbl td.cell.test-col.auto-col { background:#f0fdf4; }
.pv-tbl .auto-tag { display:inline-block; padding:0 6px; border-radius:10px; font-size:8.5px; font-weight:800; text-transform:uppercase; letter-spacing:0.3px; color:#047857; background:#ecfdf5; border:1px solid #a7f3d0; }
.pv-tbl .auto-val { font-weight:800; color:#047857; font-size:13.5px; }
.pv-tbl .auto-sub { font-size:11px; color:#94a3b8; font-weight:600; margin-left:2px; }
.pv-tbl th.sum, .pv-tbl td.sum { background:#eef2ff; }
.pv-tbl td.sum { text-align:center; font-weight:700; color:#3730a3; }
.pv-tbl td.grade { text-align:center; font-weight:800; color:#7c2d12; background:#fff7ed; }
.pv-empty { padding:14px; text-align:center; color:var(--t3,#94a3b8); font-size:12.5px; background:#f9fafb; border:1px dashed #d8dee9; border-radius:8px; }

.pv-sub-note { font-weight:600; text-transform:none; letter-spacing:0; color:var(--t3,#94a3b8); font-size:11px; }

/* Subject flag pill (Additional / Selected) */
.subj-flag { display:inline-block; margin-left:6px; padding:1px 7px; border-radius:10px; font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.4px; vertical-align:middle; white-space:nowrap; }

/* Result & Remarks box (Text Area subjects) */
.pv-remarks { border:1px solid #d8dee9; border-radius:8px; overflow:hidden; margin-bottom:6px; }
.pv-remark-row { display:flex; gap:12px; padding:11px 14px; border-bottom:1px solid #eef0f4; font-size:12.5px; flex-wrap:wrap; align-items:center; }
.pv-remark-row:last-child { border-bottom:none; }
.pv-remark-lbl { font-weight:700; color:#111827; min-width:150px; }
.pv-remark-txt { color:#374151; flex:1; }

/* Input specific - Always show a subtle border so users know the cell is editable */
.csg-in-wrap { position: relative; display: inline-block; width: 100%; max-width: 65px; }

.csg-sel {
    width: 100%; border: 1px solid transparent; border-radius: 4px; padding: 6px 24px;
    font-size: 13px; font-family: inherit; color:inherit; font-weight:700;
    background-color:transparent;
    /* Custom caret — appearance:none strips the native arrow, so draw our own */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 7px center; background-size: 11px;
    transition:.2s; text-align:center; text-align-last:center; cursor:pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.csg-sel:hover { border-color: #cbd5e1; background-color:rgba(255,255,255,0.6); }
.csg-sel:focus { outline:none; border-color:#3b82f6; background-color:#fff; color:#111827; box-shadow:0 0 0 3px rgba(59,130,246,.15); }

.csg-text { 
    width: 100%; border: 1px solid transparent; border-radius: 4px; padding: 8px 12px; 
    font-size: 13px; font-family: inherit; color:inherit; background:transparent; 
    transition:.2s; 
}
.csg-text:hover { border-color: #cbd5e1; background:rgba(255,255,255,0.6); }
.csg-text:focus { outline:none; border-color:#3b82f6; background:#fff; color:#111827; box-shadow:0 0 0 3px rgba(59,130,246,.15); }

.pv-tbl td.cell.wt-col { color:#047857; font-weight:800; }
.pv-tbl td.cell.test-col { color:#374151; font-weight:700; }
.pv-tbl td.cell { font-weight:700; }

.savebar {
    position:fixed; bottom:0; left:0; right:0; z-index:200;
    background:rgba(255,255,255,.85);
    -webkit-backdrop-filter:blur(30px) saturate(180%);
    backdrop-filter:blur(30px) saturate(180%);
    border-top:.5px solid var(--mod-hair-strong);
    padding:var(--sp-4) var(--sp-7);
    display:flex; justify-content:flex-end; gap:var(--sp-4);
}

.ab-rules { display:flex; flex-wrap:wrap; gap:10px; }
.rule-chip { display:flex; align-items:center; gap:6px; padding:4px 10px 4px 8px; border-radius:20px; font-size:12px; font-weight:600; box-shadow:0 1px 2px rgba(0,0,0,0.05); background:#fff; }

/* ══════════════════════════════════════════════════════════════════════════════
   HEADS TO SUBJECTS  (masters/views/subject_heads/assign.php)
   The subject x head matrix. Columns are the group's scholastic heads for one
   term; a ticked box means that subject carries that head.
   ══════════════════════════════════════════════════════════════════════════════ */

/* Terms are stacked, never tabbed (owner's call, 2026-08-24): staff filling a
   whole section must see every term without hunting for it, because a term left
   unclicked was a term left unassigned. The old .sh-tabs / .sh-tab segmented
   control and the .is-hidden panel state were removed with it. */
.sh-bulk { display:flex; align-items:center; gap:var(--sp-2); }

/* Overview card — the whole section at a glance, above the per-term blocks. */
.sh-overview { margin-bottom:18px; }
.sh-overview-body { padding:var(--sp-4) var(--sp-6) var(--sp-5); }
.sh-overview-hint { margin:var(--sp-3) 0 0; font-size:var(--fs-sm); color:var(--mod-ink-3); }

.sh-progress { display:flex; align-items:center; gap:var(--sp-4); }
.sh-progress-bar {
    flex:1; height:8px; border-radius:99px; overflow:hidden;
    background:var(--mod-track);
}
.sh-progress-fill {
    height:100%; border-radius:99px; background:var(--mod-accent);
    transition:width var(--ease);
}
.sh-progress-txt { font-size:var(--fs-sm); color:var(--mod-ink-2); white-space:nowrap; }
.sh-progress-txt b { color:var(--mod-ink-1); }

/* Term name reads as a heading now that it is not a tab label. */
.sh-term-badge { font-weight:600; }

/* Per-term tally: amber when the term is untouched, green when it is complete. */
.sh-term-count.is-empty { background:var(--mod-amber-soft); color:var(--mod-amber-tx); }
.sh-term-count.is-full  { background:var(--mod-green-soft, #e3fcef); color:var(--mod-green-tx, #00875a); }

/* Each term block is its own visual unit in a long scrolling page. */
.sh-panel { margin-bottom:18px; }
.sh-panel .tcard-top { position:sticky; top:0; z-index:2; background:var(--mod-surface, #fff); }

/* Head column header — name over a toggle-whole-column button. */
.sh-matrix th.sh-head-col { text-align:center; white-space:nowrap; }
.sh-col-toggle {
    display:block; margin:4px auto 0; width:22px; height:20px;
    border:none; border-radius:5px; cursor:pointer;
    background:var(--mod-fill); color:var(--mod-ink-3); font-size:9px;
    transition:var(--ease);
}
.sh-col-toggle:hover { background:var(--mod-accent-soft); color:var(--mod-accent); }

.sh-matrix td.sh-cell { text-align:center; }
.sh-matrix th.sh-count-col,
.sh-matrix td.sh-count-col { width:70px; text-align:center; }

/* The checkbox itself. The native input stays in the DOM (it carries the value
   that posts) but is visually replaced by .sh-tick. */
.sh-box { display:inline-flex; cursor:pointer; }
.sh-box input { position:absolute; opacity:0; width:0; height:0; }
.sh-tick {
    display:inline-flex; align-items:center; justify-content:center;
    width:24px; height:24px; border-radius:var(--r-xs);
    border:1px solid var(--mod-hair); background:#fff;
    color:transparent; font-size:11px;
    transition:var(--ease);
}
.sh-box:hover .sh-tick { border-color:var(--mod-accent); }
.sh-box input:checked + .sh-tick {
    background:var(--mod-accent); border-color:var(--mod-accent); color:#fff;
}
.sh-box input:focus-visible + .sh-tick { box-shadow:var(--sh-ring); }

/* A subject carrying no head in this term is legal — it just means the subject
   is not examined this term — so it is flagged, not blocked. */
.sh-row-count.is-empty { background:var(--mod-amber-soft); color:var(--mod-amber-tx); }

/* The matrix sits above a fixed save bar. */
.sh-panel:last-of-type { margin-bottom:80px; }

/* Subject chips on the Heads-to-Subjects landing. */
.sh-chiprow { display:flex; flex-wrap:wrap; gap:var(--sp-2); }

/* Copy-to-sibling-sections panel. */
.sh-copy { margin-top:18px; }
.sh-copy-body { padding:var(--sp-5) var(--sp-6) var(--sp-6); }
.sh-copy-hint { font-size:var(--fs-sm); color:var(--mod-ink-2); margin-bottom:var(--sp-4); }
.sh-copy-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:var(--sp-3); }
.sh-copy-item {
    display:flex; align-items:center; gap:var(--sp-3);
    padding:10px var(--sp-4); cursor:pointer;
    border:1px solid var(--mod-hair); border-radius:var(--r-md);
    font-size:var(--fs-sm); color:var(--mod-ink);
    transition:var(--ease);
}
.sh-copy-item:hover { border-color:var(--mod-accent); background:var(--mod-surface-2); }
.sh-copy-item input { position:absolute; opacity:0; width:0; height:0; }
.sh-copy-item input:checked ~ span:last-child { font-weight:600; color:var(--mod-accent); }
.sh-copy-item .sh-tick { flex-shrink:0; }
.sh-copy-item input:checked + .sh-tick { background:var(--mod-accent); border-color:var(--mod-accent); color:#fff; }
