:root {
    --purple: #6d28d9;
    --purple-soft: #ede9fe;
    --purple-light: #f5f3ff;
    --purple-dark: #4c1d95;
    --white: #ffffff;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #faf9ff;
    --success: #15803d;
    --danger: #b91c1c;
    --warning: #a16207;
    --shadow: 0 18px 45px rgba(76, 29, 149, .08);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, var(--bg) 45%, #f4f0ff 100%);
    color: var(--ink);
}

a { color: inherit; text-decoration: none; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 280px;
    padding: 24px;
    background: rgba(255,255,255,.88);
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    background: var(--purple-light);
    border: 1px solid #ddd6fe;
}
.brand-mark {
    width: 44px; height: 44px;
    border-radius: 15px;
    background: var(--purple);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
}
.brand-title { font-weight: 800; color: var(--purple-dark); }
.brand-subtitle { font-size: 12px; color: var(--muted); }
.nav-list { display: grid; gap: 10px; margin-top: 24px; }
.nav-link {
    padding: 12px 14px;
    border-radius: 16px;
    color: var(--muted);
    font-weight: 700;
}
.nav-link.active, .nav-link:hover { background: var(--purple); color: #fff; }

.main-content { flex: 1; padding: 32px; overflow-x: hidden; }
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}
.page-header.compact { margin-bottom: 16px; }
.eyebrow {
    margin: 0 0 6px;
    color: var(--purple);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); color: var(--purple-dark); }
h2 { margin: 0; font-size: 21px; color: var(--purple-dark); }
.header-copy, .panel-header p { color: var(--muted); margin: 8px 0 0; max-width: 760px; }

.btn {
    border: 0;
    border-radius: 15px;
    padding: 12px 16px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.btn.primary { background: var(--purple); color: white; box-shadow: 0 12px 28px rgba(109, 40, 217, .22); }
.btn.ghost { background: var(--purple-soft); color: var(--purple-dark); }
.btn.small { padding: 8px 11px; font-size: 13px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.back-dashboard-btn {
    background: #2563eb;
    color: #ffffff;
    padding: 10px 18px;
    min-width: 88px;
    min-height: 38px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .24);
    text-decoration: none;
}

.btn.back-dashboard-btn:hover {
    background: #1d4ed8;
    color: #ffffff;
}


.panel, .stat-card, .info-strip {
    background: rgba(255,255,255,.92);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: var(--shadow);
}
.panel { padding: 22px; margin-bottom: 20px; }
.panel-header { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 18px; }
.stat-card span { color: var(--muted); font-weight: 700; font-size: 13px; }
.stat-card strong { display: block; font-size: 30px; color: var(--purple-dark); margin-top: 8px; }

.table-wrap, .assessment-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    color: var(--purple-dark);
    background: var(--purple-light);
    font-size: 13px;
    padding: 13px 12px;
    border-bottom: 1px solid #ddd6fe;
}
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dashboard-table tr:hover td { background: #fcfbff; }
.block { display: block; }
.muted { color: var(--muted); font-size: 12px; }
.score-pill {
    display: inline-block;
    min-width: 68px;
    text-align: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple-dark);
    font-weight: 800;
}
.empty-state { text-align: center; padding: 40px; color: var(--muted); }

.alert { padding: 14px 16px; border-radius: 18px; margin-bottom: 18px; font-weight: 700; }
.alert.success { background: #ecfdf5; color: #166534; border: 1px solid #bbf7d0; }
.alert.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert ul { margin-bottom: 0; }

.student-form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
label span { display: block; color: var(--muted); font-weight: 800; margin-bottom: 7px; font-size: 13px; }
input, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 13px;
    font: inherit;
    background: white;
    outline: none;
}
input:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-soft); }
.form-actions { display: flex; justify-content: flex-end; }
.info-strip {
    padding: 14px 18px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}
.info-strip strong { color: var(--purple-dark); }

.sem-grid { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; margin-top: 16px; }
.sem-card { background: var(--purple-light); border: 1px solid #ddd6fe; border-radius: 22px; padding: 14px; }
.sem-card.locked { opacity: .68; filter: grayscale(.25); }
.sem-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.unlock-btn, .mini-unlock {
    width: 28px; height: 28px;
    border-radius: 10px;
    border: 1px solid #c4b5fd;
    background: white;
    color: var(--purple);
    font-weight: 900;
    cursor: pointer;
}
.mini-unlock { width: 23px; height: 23px; font-size: 12px; vertical-align: middle; }
.date-row { display: grid; gap: 8px; margin-bottom: 12px; }
.lock-badge { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; font-weight: 800; }
.lock-badge.open { color: var(--success); }
.lock-badge.locked { color: var(--warning); }

.module-title-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.assessment-table { min-width: 1280px; }
.assessment-col { width: 310px; }
.assessment-text { font-weight: 700; color: #374151; }
.sem-head { text-align: center; background: #eee8ff; }
.assessment-table th:not(.assessment-col), .assessment-table td:not(.assessment-text) { text-align: center; }
.check-box {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 2px solid #c4b5fd;
    background: #fff;
    color: white;
    cursor: pointer;
    font-weight: 900;
    font-size: 18px;
}
.check-box.selected { background: var(--success); border-color: var(--success); }
.check-box.selected.no { background: var(--danger); border-color: var(--danger); }
.check-box.locked { background: #f3f4f6; color: #9ca3af; border-color: #d1d5db; cursor: not-allowed; }
.cell-status { color: var(--muted); font-size: 12px; font-weight: 800; }
.cell-status.saved { color: var(--success); }
.cell-status.saving { color: var(--warning); }
.score-table .overall { font-weight: 900; color: var(--purple-dark); background: var(--purple-light); }
.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: var(--purple-dark);
    color: white;
    padding: 13px 16px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 1000;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .app-shell { display: block; }
    .sidebar { width: auto; height: auto; position: static; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
    .nav-list { margin-top: 0; grid-auto-flow: column; }
    .stats-grid, .form-grid, .info-strip { grid-template-columns: repeat(2, 1fr); }
    .sem-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}

@media (max-width: 720px) {
    .main-content, .sidebar { padding: 18px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .stats-grid, .form-grid, .info-strip, .sem-grid { grid-template-columns: 1fr; }
    .sidebar { display: block; }
    .nav-list { grid-auto-flow: row; }
}

.assessment-table-wide {
    min-width: 1850px;
}
.assessment-table-wide .assessment-col {
    width: 275px;
    min-width: 275px;
}
.assessment-table-wide .answer-col {
    width: 58px;
    min-width: 58px;
    text-align: center;
}
.assessment-table-wide .status-col {
    width: 82px;
    min-width: 82px;
    text-align: center;
}
.sem-assessment-head {
    background: var(--purple-light);
    vertical-align: middle;
}
.sem-assessment-text {
    text-align: left !important;
    line-height: 1.35;
    color: #111827;
}

/* Hamburger sidebar menu */
.app-shell {
    display: block;
}
.hamburger-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1200;
    width: 42px;
    height: 42px;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(76, 29, 149, .12);
    display: grid;
    place-content: center;
    gap: 4px;
    cursor: pointer;
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--purple-dark);
}
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    width: 260px;
    max-width: 82vw;
    height: 100vh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 45px rgba(76, 29, 149, .13);
}
.sidebar-open .sidebar {
    transform: translateX(0);
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(17, 24, 39, .28);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}
.main-content {
    width: 100%;
    padding: 26px 26px 26px 70px;
    overflow-x: hidden;
}

/* Compact typography and no horizontal module-table scrollbar */
body {
    font-size: 13px;
}
h1 {
    font-size: clamp(22px, 3vw, 32px);
}
h2 {
    font-size: 17px;
}
.eyebrow {
    font-size: 10px;
    margin-bottom: 4px;
}
.header-copy,
.panel-header p,
.info-strip,
label span,
.muted {
    font-size: 11px;
}
.btn {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 12px;
}
.panel {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 20px;
}
.module-title-row {
    margin-bottom: 10px;
}
.assessment-table-wrap {
    overflow-x: hidden;
    width: 100%;
}
.assessment-table,
.assessment-table-wide {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.assessment-table th,
.assessment-table td {
    padding: 5px 4px;
    font-size: 9px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: normal;
}
.assessment-table-wide .assessment-col,
.assessment-table .assessment-col,
.sem-assessment-text {
    width: 16.8%;
    min-width: 0;
}
.assessment-table-wide .answer-col {
    width: 2.5%;
    min-width: 0;
}
.assessment-table-wide .status-col {
    width: 3.2%;
    min-width: 0;
}
.assessment-text {
    font-weight: 700;
}
.check-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border-width: 1px;
    font-size: 11px;
    padding: 0;
    line-height: 1;
}
.cell-status {
    font-size: 8px;
    font-weight: 800;
}
.mini-unlock {
    width: 17px;
    height: 17px;
    border-radius: 6px;
    font-size: 9px;
    padding: 0;
}
th {
    font-size: 11px;
    padding: 8px 7px;
}
td {
    padding: 9px 7px;
}
.score-table th,
.score-table td,
.dashboard-table th,
.dashboard-table td {
    font-size: 11px;
}
.sem-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sem-card {
    padding: 10px;
    border-radius: 16px;
}
input,
textarea {
    padding: 9px 10px;
    border-radius: 11px;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        width: 260px;
        height: 100vh;
        display: block;
    }
    .nav-list {
        grid-auto-flow: row;
        margin-top: 24px;
    }
    .main-content {
        padding: 22px 16px 22px 64px;
    }
    .sem-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .main-content {
        padding: 68px 12px 18px;
    }
    .hamburger-btn {
        top: 12px;
        left: 12px;
    }
    .sem-grid {
        grid-template-columns: 1fr;
    }
    .assessment-table th,
    .assessment-table td {
        font-size: 8px;
        padding: 4px 2px;
    }
    .check-box {
        width: 15px;
        height: 15px;
    }
    .cell-status {
        font-size: 7px;
    }
}

/* Latest assessment table adjustments */
.assessment-table th,
.assessment-table td {
    font-size: 10.5px;
    padding: 6px 5px;
    line-height: 1.25;
}
.assessment-table-wide .assessment-col,
.assessment-table .assessment-col,
.sem-assessment-text {
    width: 18.5%;
    min-width: 0;
}
.assessment-table-wide .answer-col {
    width: 3.25%;
    min-width: 0;
}
.check-box {
    width: 20px;
    height: 20px;
    font-size: 12px;
}
.mini-unlock {
    width: 18px;
    height: 18px;
    font-size: 10px;
}

.result-summary-table {
    width: auto;
    max-width: 940px;
    table-layout: fixed;
    border: 2px solid #111827;
    background: #fff;
}
.result-summary-table th,
.result-summary-table td {
    border: 1px solid #111827;
    padding: 7px 8px;
    color: #000;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
    background: #f3f4f6;
}
.result-summary-table th {
    background: #fff;
    font-weight: 900;
}
.result-summary-table .score-sem-head,
.result-summary-table .result-title-col {
    font-size: 14px;
}
.result-summary-table .module-result-name {
    width: 190px;
    text-align: left;
    font-weight: 900;
    background: #fff;
}
.result-summary-table .age-result-cell {
    width: 110px;
    background: #d9d9d9;
}
.result-summary-table td:nth-child(n+3) {
    background: #d9d9d9;
    font-weight: 800;
}
.dashboard-table td[rowspan] {
    vertical-align: middle;
}

@media (max-width: 720px) {
    .assessment-table th,
    .assessment-table td {
        font-size: 9px;
        padding: 4px 2px;
    }
    .check-box {
        width: 16px;
        height: 16px;
    }
}
.result-summary-table [data-score-achieved],
.result-summary-table [data-score-assessed],
.result-summary-table [data-score-percentage] {
    background: #d9d9d9;
    font-weight: 800;
}

/* Unlock button state fix */
.unlock-btn.unlocked,
.mini-unlock.unlocked {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* Dashboard filter and 2-row student list */
.dashboard-filter-panel {
    margin-bottom: 14px;
}
.dashboard-filter-form {
    display: grid;
    grid-template-columns: minmax(190px, 1.15fr) minmax(190px, 1.15fr) minmax(160px, 1fr) minmax(260px, 1.45fr) auto;
    gap: 12px;
    align-items: end;
}
.dashboard-filter-form .teacher-filter-field {
    min-width: 260px;
}
.dashboard-filter-form label {
    display: grid;
    gap: 6px;
}
.dashboard-filter-form select {
    width: 100%;
    border: 1px solid #ddd6fe;
    border-radius: 11px;
    padding: 9px 10px;
    font: inherit;
    background: #fff;
    color: var(--text);
}
.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.dashboard-table td[rowspan] {
    vertical-align: middle;
    background: #fff;
}
.dashboard-table th,
.dashboard-table td {
    white-space: normal;
}
@media (max-width: 900px) {
    .dashboard-filter-form {
        grid-template-columns: 1fr 1fr;
    }
    .filter-actions {
        justify-content: flex-start;
    }
}
@media (max-width: 620px) {
    .dashboard-filter-form {
        grid-template-columns: 1fr;
    }
}

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sem-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.open-sem-btn { min-width: 92px; }
.report-notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 42px; }
.report-note-block { min-height: 330px; padding: 8px 10px; }
.report-note-block h3 { text-align: center; font-family: Georgia, 'Times New Roman', serif; font-size: 18px; color: #111827; margin: 0 0 16px; font-weight: 600; }
.comment-row { display: grid; grid-template-columns: 135px 1fr; align-items: start; gap: 12px; margin-bottom: 12px; }
.comment-row > span { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; color: #111827; font-weight: 400; padding-top: 10px; }
.comment-row textarea { border: 0; border-bottom: 1px solid #111827; border-radius: 0; resize: vertical; min-height: 42px; padding: 8px; font-family: Georgia, 'Times New Roman', serif; background: transparent; box-shadow: none; }
.parent-signature-space { height: 120px; padding-top: 28px; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; color: #111827; }
.signature-line { display: grid; grid-template-columns: 52px 1fr; align-items: center; max-width: 300px; margin-bottom: 8px; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; }
.signature-line span { font-weight: 400; color: #111827; }
.signature-line input { border: 0; border-bottom: 1px solid #111827; border-radius: 0; padding: 5px 6px; background: transparent; box-shadow: none; }

@media (max-width: 900px) {
    .report-notes-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media print {
    @page { size: A4 landscape; margin: 8mm; }
    body { background: #fff !important; color: #000 !important; font-family: Arial, sans-serif; }
    .sidebar, .print-hide, .toast, .btn, button, .nav-list { display: none !important; }
    .app-shell { display: block !important; min-height: 0 !important; }
    .main-content { padding: 0 !important; overflow: visible !important; }
    .panel, .stat-card, .info-strip { box-shadow: none !important; border: 1px solid #000 !important; border-radius: 0 !important; background: #fff !important; padding: 10px !important; margin-bottom: 10px !important; break-inside: avoid; }
    .student-panel input, .report-notes-panel input, .report-notes-panel textarea { border: 0 !important; border-bottom: 1px solid #000 !important; border-radius: 0 !important; background: transparent !important; padding: 3px 4px !important; box-shadow: none !important; }
    .student-form .form-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }
    label span { color: #000 !important; font-size: 10px !important; }
    h1, h2, .eyebrow { color: #000 !important; }
    .module-title-row { margin-bottom: 6px !important; }
    .assessment-table-wrap, .table-wrap { overflow: visible !important; }
    .assessment-table { min-width: 0 !important; width: 100% !important; font-size: 8px !important; table-layout: fixed !important; }
    .assessment-col { width: auto !important; }
    th, td { border: 1px solid #000 !important; padding: 3px 4px !important; color: #000 !important; background: #fff !important; }
    .check-box { display: inline-flex !important; width: 14px !important; height: 14px !important; min-width: 14px !important; border: 1px solid #000 !important; border-radius: 2px !important; color: #000 !important; background: #fff !important; font-size: 10px !important; line-height: 1 !important; align-items: center !important; justify-content: center !important; padding: 0 !important; }
    .check-box.selected, .check-box.selected.no { background: #fff !important; color: #000 !important; }
    .score-table { font-size: 8px !important; }
    .report-notes-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 24px !important; }
    .report-notes-panel { border: 0 !important; }
    .report-note-block h3, .comment-row > span, .parent-signature-space, .signature-line { font-family: Georgia, 'Times New Roman', serif !important; color: #000 !important; }
    .comment-row textarea { min-height: 34px !important; resize: none !important; }
    .parent-signature-space { height: 90px !important; }
}

/* 2026-05-20: School label, readable module table, edit/submit placement */
body {
    font-size: 14px;
}
h1 {
    font-size: clamp(25px, 3vw, 36px);
}
h2 {
    font-size: 19px;
}
label span,
.header-copy,
.panel-header p,
.info-strip,
.muted {
    font-size: 12.5px;
}
.assessment-table-wrap {
    overflow-x: auto;
}
.assessment-table,
.assessment-table-wide {
    min-width: 1760px;
    table-layout: fixed;
}
.assessment-table th,
.assessment-table td {
    font-size: 12px;
    padding: 8px 7px;
    line-height: 1.35;
    vertical-align: middle;
}
.assessment-table-wide .assessment-col,
.assessment-table .assessment-col,
.sem-assessment-text {
    width: 19%;
    min-width: 255px;
}
.assessment-table-wide .answer-col {
    width: 3.75%;
    min-width: 52px;
}
.sem-assessment-text {
    text-align: left !important;
    word-break: normal;
    overflow-wrap: break-word;
}
.check-box {
    width: 24px;
    height: 24px;
    font-size: 14px;
    border-radius: 7px;
}
.edit-sem-btn {
    min-width: 72px;
}
.open-sem-btn {
    min-width: 0;
}
.submit-sem-row td {
    background: #faf7ff;
    border-top: 2px solid #ddd6fe;
    text-align: center !important;
    padding-top: 10px;
    padding-bottom: 10px;
}
.submit-sem-cell .btn {
    margin: 0 auto;
}
.comment-row input {
    border: 0;
    border-bottom: 1px solid #111827;
    border-radius: 0;
    padding: 8px;
    font-family: Georgia, 'Times New Roman', serif;
    background: transparent;
    box-shadow: none;
}
.comment-row input:focus {
    box-shadow: none;
}

@media (max-width: 720px) {
    .assessment-table th,
    .assessment-table td {
        font-size: 10px;
        padding: 5px 3px;
    }
    .check-box {
        width: 18px;
        height: 18px;
    }
}

@media print {
    .student-panel input,
    .report-notes-panel input {
        border: 0 !important;
        border-bottom: 1px solid #000 !important;
        border-radius: 0 !important;
        background: transparent !important;
        padding: 3px 4px !important;
        box-shadow: none !important;
    }
    .assessment-table,
    .assessment-table-wide {
        min-width: 0 !important;
    }
    .assessment-table th,
    .assessment-table td {
        font-size: 8px !important;
        padding: 3px 3px !important;
    }
    .comment-row input {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        font-family: Georgia, 'Times New Roman', serif !important;
        color: #000 !important;
    }
}

/* 2026-05-20 redo: one submit at Module 6, larger table text, centered score, two-line remarks */
.score-panel .table-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}
.score-panel .result-summary-table {
    margin-left: auto;
    margin-right: auto;
}
.assessment-table,
.assessment-table-wide {
    min-width: 1960px;
}
.assessment-table th,
.assessment-table td {
    font-size: 14px;
    padding: 10px 9px;
    line-height: 1.45;
}
.assessment-table th {
    font-size: 13.5px;
    font-weight: 900;
}
.sem-assessment-text {
    font-weight: 700;
}
.assessment-table-wide .assessment-col,
.assessment-table .assessment-col,
.sem-assessment-text {
    min-width: 300px;
}
.assessment-table-wide .answer-col {
    min-width: 58px;
}
.check-box {
    width: 28px;
    height: 28px;
    font-size: 16px;
}
.submit-assessment-row td {
    background: #faf7ff;
    border-top: 2px solid #ddd6fe;
    padding: 16px 10px !important;
    text-align: center !important;
}
.submit-assessment-cell .btn,
.submit-all-assessment {
    margin: 0 auto;
    min-width: 190px;
}
.print-only {
    display: none;
}
.comment-row {
    grid-template-columns: 145px 1fr;
}
.comment-row .remark-field {
    min-height: 54px;
    height: 54px;
    line-height: 1.35;
    border: 0;
    border-bottom: 1px solid #111827;
    border-radius: 0;
    padding: 6px 8px;
    font-family: Georgia, 'Times New Roman', serif;
    background: transparent;
    box-shadow: none;
    resize: vertical;
    overflow: auto;
    white-space: pre-wrap;
}
.comment-row .remark-field:focus {
    box-shadow: none;
}

@media (max-width: 720px) {
    .assessment-table th,
    .assessment-table td {
        font-size: 12px;
        padding: 7px 5px;
    }
}

@media print {
    .assessment-table th,
    .assessment-table td {
        font-size: 8.5px !important;
        padding: 3px 3px !important;
    }
    .print-only {
        display: block !important;
    }
    .comment-row .remark-field {
        display: none !important;
    }
    .remark-print-value {
        min-height: 34px;
        line-height: 1.2;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        border-bottom: 1px solid #000;
        padding: 2px 4px 4px;
        font-family: Georgia, 'Times New Roman', serif !important;
        color: #000 !important;
    }
}

/* 2026-05-20 refinement: compact readable module tables, larger summary text, aligned dynamic print comments */
.assessment-table-wrap {
    overflow-x: hidden !important;
    width: 100%;
}
.assessment-table,
.assessment-table-wide {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}
.assessment-table th,
.assessment-table td {
    font-size: 13.5px !important;
    padding: 7px 5px !important;
    line-height: 1.28 !important;
    vertical-align: middle !important;
}
.assessment-table th {
    font-size: 13px !important;
}
.assessment-table-wide .assessment-col,
.assessment-table .assessment-col,
.sem-assessment-text {
    width: 19.1% !important;
    min-width: 0 !important;
}
.assessment-table-wide .answer-col {
    width: 2.95% !important;
    min-width: 0 !important;
}
.sem-assessment-text {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}
.check-box {
    width: 25px !important;
    height: 25px !important;
    font-size: 15px !important;
}
.result-summary-table th,
.result-summary-table td {
    font-size: 14px !important;
    padding: 8px 9px !important;
    line-height: 1.25 !important;
}
.result-summary-table .score-sem-head,
.result-summary-table .result-title-col {
    font-size: 15px !important;
}
.result-summary-table {
    max-width: 1040px !important;
}
.comment-row .remark-field {
    min-height: 64px !important;
    height: 64px !important;
    line-height: 1.35 !important;
}

@supports (grid-template-rows: subgrid) {
    .report-notes-grid {
        grid-template-rows: auto auto auto auto auto auto;
        align-items: stretch;
    }
    .report-note-block {
        display: grid;
        grid-template-rows: subgrid;
        grid-row: span 6;
        align-content: start;
        min-height: 0;
    }
    .report-note-block h3,
    .report-note-block .comment-row,
    .report-note-block .parent-signature-space,
    .report-note-block .signature-line {
        margin-top: 0;
    }
}

@media print {
    .report-notes-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 22px !important;
        align-items: stretch !important;
    }
    @supports (grid-template-rows: subgrid) {
        .report-notes-grid {
            grid-template-rows: auto auto auto auto auto auto !important;
        }
        .report-note-block {
            display: grid !important;
            grid-template-rows: subgrid !important;
            grid-row: span 6 !important;
            min-height: 0 !important;
        }
    }
    .report-note-block {
        padding: 0 4px !important;
    }
    .report-note-block h3 {
        font-size: 16px !important;
        margin: 0 0 8px !important;
    }
    .comment-row {
        grid-template-columns: 98px 1fr !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
        align-items: start !important;
    }
    .comment-row > span {
        font-size: 12px !important;
        padding-top: 3px !important;
        line-height: 1.2 !important;
    }
    .remark-print-value {
        min-height: 30px !important;
        height: auto !important;
        max-height: none !important;
        white-space: pre-wrap !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        overflow: visible !important;
        font-size: 12px !important;
        line-height: 1.18 !important;
        padding: 0 3px 3px !important;
    }
    .parent-signature-space {
        height: 72px !important;
        padding-top: 18px !important;
        font-size: 13px !important;
    }
    .signature-line {
        grid-template-columns: 42px 1fr !important;
        max-width: 260px !important;
        margin-bottom: 5px !important;
        font-size: 12px !important;
    }
    .signature-line input {
        font-size: 12px !important;
        padding: 2px 3px !important;
    }
    .assessment-table th,
    .assessment-table td {
        font-size: 8px !important;
        padding: 2px 2px !important;
        line-height: 1.12 !important;
    }
    .result-summary-table th,
    .result-summary-table td {
        font-size: 9px !important;
        padding: 3px 4px !important;
    }
}


/* 2026-05-20: static student details on edit page */
.student-static-panel {
    padding: 16px 18px;
    margin-bottom: 18px;
}
.student-static-head {
    margin-bottom: 10px;
}
.student-static-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.student-static-item {
    border: 1px solid #e5e7eb;
    background: #faf7ff;
    border-radius: 16px;
    padding: 12px 14px;
    min-height: 68px;
}
.student-static-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 6px;
}
.student-static-item strong {
    display: block;
    color: #1f2937;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .student-static-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .student-static-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .student-static-panel {
        border: 1px solid #000 !important;
        padding: 6px !important;
        margin-bottom: 8px !important;
        break-inside: avoid;
    }
    .student-static-head {
        margin-bottom: 4px !important;
    }
    .student-static-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
    }
    .student-static-item {
        border: 1px solid #000 !important;
        background: #fff !important;
        border-radius: 0 !important;
        padding: 4px 5px !important;
        min-height: 0 !important;
    }
    .student-static-item span {
        color: #000 !important;
        font-size: 8px !important;
        margin-bottom: 2px !important;
    }
    .student-static-item strong {
        color: #000 !important;
        font-size: 10px !important;
        line-height: 1.15 !important;
    }
}

/* 2026-05-21: compact page width + clearer dashboard/assessment table readability */
.main-content {
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.page-header,
.panel,
.stats-grid {
    width: 100%;
}

/* Teacher dashboard: larger text and visible row/column lines */
.dashboard-table {
    border-collapse: collapse !important;
    table-layout: fixed;
    font-size: 15.5px;
    border: 1px solid #d8dceb;
    background: #ffffff;
}
.dashboard-table th,
.dashboard-table td {
    border: 1px solid #d8dceb !important;
    border-bottom: 1px solid #d8dceb !important;
    padding: 13px 12px !important;
    font-size: 15.5px !important;
    line-height: 1.35 !important;
    vertical-align: middle !important;
}
.dashboard-table th {
    background: #f2efff !important;
    color: var(--purple-dark) !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    letter-spacing: .01em;
}
.dashboard-table td[rowspan] {
    border-right: 1px solid #cfd5e6 !important;
}
.dashboard-table tbody tr:nth-child(4n+1) td,
.dashboard-table tbody tr:nth-child(4n+2) td {
    background: #ffffff;
}
.dashboard-table tbody tr:nth-child(4n+3) td,
.dashboard-table tbody tr:nth-child(4n+4) td {
    background: #fbfaff;
}
.dashboard-table tr:hover td {
    background: #f7f3ff !important;
}
.dashboard-table strong {
    font-size: 15.8px;
}
.dashboard-table .muted {
    font-size: 13px !important;
    margin-top: 4px;
}
.dashboard-table .score-pill {
    font-size: 14px;
    min-width: 74px;
    padding: 7px 10px;
}
.dashboard-table .btn.small {
    font-size: 14px;
    padding: 9px 13px;
}
.dashboard-filter-form label span,
.dashboard-filter-form input,
.dashboard-filter-form select {
    font-size: 15px;
}

/* Assessment page: keep page compact, readable, and without module-table scrollbars */
.module-card.panel,
.score-panel,
.report-notes-panel,
.student-static-panel,
.semester-panel,
.student-panel {
    max-width: 100%;
}
.assessment-table-wrap,
.table-wrap {
    max-width: 100%;
}
.assessment-table,
.assessment-table-wide {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border: 1px solid #d8dceb !important;
}
.assessment-table th,
.assessment-table td {
    border: 1px solid #d8dceb !important;
    font-size: 14.2px !important;
    padding: 8px 6px !important;
    line-height: 1.3 !important;
}
.assessment-table th {
    font-size: 13.6px !important;
    font-weight: 900 !important;
    background: #f2efff !important;
}
.assessment-table-wide .assessment-col,
.assessment-table .assessment-col,
.sem-assessment-text {
    width: 19.25% !important;
    min-width: 0 !important;
}
.assessment-table-wide .answer-col {
    width: 2.875% !important;
    min-width: 0 !important;
}
.sem-assessment-text {
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}
.result-summary-table {
    max-width: 1120px !important;
    border-collapse: collapse !important;
    border: 1px solid #d8dceb !important;
}
.result-summary-table th,
.result-summary-table td {
    border: 1px solid #d8dceb !important;
    font-size: 15px !important;
    padding: 9px 10px !important;
}
.result-summary-table .score-sem-head,
.result-summary-table .result-title-col {
    font-size: 15.5px !important;
}

@media (min-width: 1700px) {
    .main-content {
        max-width: 1560px;
    }
}

@media (max-width: 900px) {
    .main-content {
        padding-left: 18px;
        padding-right: 18px;
        max-width: 100%;
    }
    .dashboard-table {
        min-width: 900px;
        table-layout: auto;
    }
    .table-wrap {
        overflow-x: auto;
    }
}

@media print {
    .main-content {
        max-width: none !important;
        padding: 0 !important;
    }
}

/* 2026-05-21: standalone layout, sidebar removed for dashboard and assessment pages */
.standalone-shell {
    display: block !important;
    min-height: 100vh;
    width: 100%;
}
.standalone-content {
    width: min(100% - 48px, 1560px) !important;
    max-width: 1560px !important;
    margin: 0 auto !important;
    padding: 30px 0 42px !important;
    overflow-x: hidden !important;
}
.hamburger-btn,
.sidebar,
.sidebar-backdrop,
.nav-list,
.brand-card {
    display: none !important;
}

@media (max-width: 900px) {
    .standalone-content {
        width: min(100% - 28px, 100%) !important;
        padding-top: 18px !important;
        padding-bottom: 28px !important;
    }
}

@media print {
    .standalone-content {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }
}


/* 2026-05-21: assessment form branded header/footer images */
.assessment-brand-header {
    width: 100%;
    margin: 0 0 18px;
}
.assessment-brand-header img,
.assessment-brand-footer img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #d8dceb;
    background: #ffffff;
}
.assessment-brand-header img {
    border-radius: 0;
    object-fit: cover;
}
.assessment-brand-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}
.assessment-brand-footer {
    width: 100%;
    margin: 22px 0 0;
}
.assessment-brand-footer img {
    border-radius: 0;
}

@media (max-width: 700px) {
    .assessment-brand-actions {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }
    .assessment-brand-actions .btn {
        width: 100%;
    }
}

@media print {
    .assessment-brand-header {
        margin: 0 0 6px !important;
        break-inside: avoid;
    }
    .assessment-brand-header img,
    .assessment-brand-footer img {
        border: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
    }
    .assessment-brand-footer {
        margin-top: 8px !important;
        break-inside: avoid;
    }
}

.not-assessed-text {
    color: #111827;
    background: #f8fafc;
}

.not-assessed-cell {
    background: #f8fafc;
    text-align: center;
}

.not-assessed-mark {
    color: #94a3b8;
    font-weight: 700;
    font-size: 15px;
}


/* 2026-05-21: remove create alert and compact print layout */
@media print {
    .alert,
    .alert.success {
        display: none !important;
    }

    @page {
        size: A4 landscape;
        margin: 6mm;
    }

    html,
    body {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .standalone-content,
    .main-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .assessment-brand-header {
        margin: 0 0 4px !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .assessment-brand-header img {
        width: 100% !important;
        max-height: 54px !important;
        object-fit: cover !important;
        display: block !important;
        border: 0 !important;
        border-radius: 0 !important;
    }

    .student-static-panel {
        margin: 0 0 5px !important;
        padding: 4px !important;
        border: 1px solid #000 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .student-static-head {
        margin-bottom: 2px !important;
    }

    .student-static-head .eyebrow {
        font-size: 7px !important;
        line-height: 1 !important;
        margin: 0 0 2px !important;
    }

    .student-static-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2px !important;
    }

    .student-static-item {
        padding: 2px 4px !important;
        min-height: 0 !important;
        border: 1px solid #000 !important;
    }

    .student-static-item span {
        font-size: 6.5px !important;
        line-height: 1 !important;
        margin: 0 0 1px !important;
    }

    .student-static-item strong {
        font-size: 7px !important;
        line-height: 1.05 !important;
    }

    .panel {
        margin: 0 0 5px !important;
        padding: 5px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .module-card.panel {
        margin: 0 0 5px !important;
        padding: 5px !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
        break-before: auto !important;
        page-break-before: auto !important;
    }

    .module-title-row {
        margin: 0 0 3px !important;
        padding: 0 !important;
    }

    .module-title-row .eyebrow {
        font-size: 6.5px !important;
        line-height: 1 !important;
        margin: 0 0 1px !important;
        letter-spacing: .08em !important;
    }

    .module-title-row h2 {
        font-size: 10px !important;
        line-height: 1.05 !important;
        margin: 0 !important;
    }

    .assessment-table-wrap,
    .table-wrap {
        overflow: visible !important;
    }

    .assessment-table,
    .assessment-table-wide {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }

    .assessment-table th,
    .assessment-table td {
        font-size: 6.8px !important;
        padding: 1px 1.5px !important;
        line-height: 1.05 !important;
        vertical-align: middle !important;
        border: 1px solid #000 !important;
    }

    .assessment-table th {
        font-size: 6.8px !important;
        font-weight: 900 !important;
    }

    .assessment-table-wide .assessment-col,
    .assessment-table .assessment-col,
    .sem-assessment-text {
        width: 19.4% !important;
    }

    .assessment-table-wide .answer-col {
        width: 2.8% !important;
    }

    .check-box {
        width: 9px !important;
        height: 9px !important;
        min-width: 9px !important;
        font-size: 7px !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    .not-assessed-mark {
        font-size: 7px !important;
        line-height: 1 !important;
    }

    .score-panel,
    .report-notes-panel {
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    .assessment-brand-footer {
        margin-top: 4px !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
}

/* 2026-05-21: duration gate, summary table lines, per-semester print reports */
.sem-card-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lock-badge.pending {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.check-box.locked {
    opacity: .45;
    cursor: not-allowed;
}

.result-summary-table,
.result-summary-table th,
.result-summary-table td {
    background: transparent !important;
    border: 1.5px solid #111827 !important;
}

.result-summary-table th,
.result-summary-table td {
    color: #111827;
}

.result-summary-table .score-sem-head {
    background: transparent !important;
}

.result-summary-table .percentage-sem-1 {
    background: #eaf4ff !important;
    color: #0f4c81 !important;
    font-weight: 900;
}

.result-summary-table .percentage-sem-2 {
    background: #f3e8ff !important;
    color: #5b21b6 !important;
    font-weight: 900;
}

.report-notes-grid-sem {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.report-note-block[data-comment-sem] {
    min-height: 260px;
}

@media (max-width: 900px) {
    .sem-card-head {
        align-items: flex-start;
        gap: 10px;
    }
    .sem-card-buttons {
        justify-content: flex-start;
    }
    .report-notes-grid-sem {
        grid-template-columns: 1fr;
    }
}

@media print {
    body[data-print-scope] [data-sem-col],
    body[data-print-scope] [data-score-sem-col],
    body[data-print-scope] .result-summary-table tbody tr,
    body[data-print-scope] [data-comment-sem] {
        display: none !important;
    }

    body[data-print-scope="sem1"] [data-sem-col="1"],
    body[data-print-scope="sem2"] [data-sem-col="1"],
    body[data-print-scope="sem2"] [data-sem-col="2"],
    body[data-print-scope="sem3"] [data-sem-col="3"],
    body[data-print-scope="sem4"] [data-sem-col="3"],
    body[data-print-scope="sem4"] [data-sem-col="4"] {
        display: table-cell !important;
    }

    body[data-print-scope="sem1"] [data-score-sem-col="1"],
    body[data-print-scope="sem2"] [data-score-sem-col="1"],
    body[data-print-scope="sem2"] [data-score-sem-col="2"],
    body[data-print-scope="sem3"] [data-score-sem-col="1"],
    body[data-print-scope="sem4"] [data-score-sem-col="1"],
    body[data-print-scope="sem4"] [data-score-sem-col="2"] {
        display: table-cell !important;
    }

    body[data-print-scope="sem1"] .result-summary-table tbody tr[data-score-age="2"],
    body[data-print-scope="sem2"] .result-summary-table tbody tr[data-score-age="2"],
    body[data-print-scope="sem3"] .result-summary-table tbody tr[data-score-age="3"],
    body[data-print-scope="sem4"] .result-summary-table tbody tr[data-score-age="3"] {
        display: table-row !important;
    }

    body[data-print-scope="sem1"] [data-comment-sem="1"],
    body[data-print-scope="sem2"] [data-comment-sem="2"],
    body[data-print-scope="sem3"] [data-comment-sem="3"],
    body[data-print-scope="sem4"] [data-comment-sem="4"] {
        display: block !important;
    }

    body[data-print-scope] .assessment-table,
    body[data-print-scope] .assessment-table-wide {
        table-layout: auto !important;
    }

    body[data-print-scope] .assessment-table-wide .assessment-col,
    body[data-print-scope] .assessment-table .assessment-col,
    body[data-print-scope] .sem-assessment-text,
    body[data-print-scope] .assessment-table-wide .answer-col {
        width: auto !important;
    }

    body[data-print-scope] .result-summary-table,
    body[data-print-scope] .result-summary-table th,
    body[data-print-scope] .result-summary-table td {
        border: 1.4px solid #000 !important;
        background: transparent !important;
    }

    body[data-print-scope] .result-summary-table .percentage-sem-1 {
        background: #eaf4ff !important;
        color: #000 !important;
    }

    body[data-print-scope] .result-summary-table .percentage-sem-2 {
        background: #f3e8ff !important;
        color: #000 !important;
    }

    body[data-print-scope] .report-notes-grid-sem {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 18px !important;
    }

    body[data-print-scope="sem1"] .report-notes-grid-sem,
    body[data-print-scope="sem2"] .report-notes-grid-sem,
    body[data-print-scope="sem3"] .report-notes-grid-sem,
    body[data-print-scope="sem4"] .report-notes-grid-sem {
        grid-template-columns: 1fr !important;
    }

    body[data-print-scope] .report-note-block[data-comment-sem] {
        min-height: 170px !important;
        border: 0 !important;
        padding: 4px 8px !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body[data-print-scope] .report-note-block h3 {
        margin-bottom: 8px !important;
    }

    body[data-print-scope] .comment-row textarea {
        display: none !important;
    }

    body[data-print-scope] .signature-line input[type="text"] {
        border: 0 !important;
        border-bottom: 1px solid #000 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 3px 4px !important;
    }
}

/* 2026-05-21: compact readable per-semester print layout */
@media print {
    @page {
        size: A4 portrait;
        margin: 7mm;
    }

    body[data-print-scope] {
        background: #fff !important;
        font-size: 9.5px !important;
    }

    body[data-print-scope] .assessment-brand-header,
    body[data-print-scope] .student-static-panel,
    body[data-print-scope] .module-card.panel,
    body[data-print-scope] .score-panel,
    body[data-print-scope] .report-notes-panel {
        width: 184mm !important;
        max-width: 184mm !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body[data-print-scope="sem1"] .module-card.panel,
    body[data-print-scope="sem3"] .module-card.panel,
    body[data-print-scope="sem1"] .score-panel,
    body[data-print-scope="sem3"] .score-panel,
    body[data-print-scope="sem1"] .report-notes-panel,
    body[data-print-scope="sem3"] .report-notes-panel {
        width: 176mm !important;
        max-width: 176mm !important;
    }

    body[data-print-scope] .assessment-brand-header img {
        max-height: 44px !important;
        object-fit: cover !important;
        object-position: center !important;
    }

    body[data-print-scope] .student-static-panel {
        padding: 5px !important;
        margin-bottom: 5px !important;
    }

    body[data-print-scope] .student-static-head .eyebrow {
        font-size: 8.5px !important;
    }

    body[data-print-scope] .student-static-item span {
        font-size: 7.5px !important;
    }

    body[data-print-scope] .student-static-item strong {
        font-size: 8.5px !important;
    }

    body[data-print-scope] .module-card.panel {
        padding: 5px 6px !important;
        margin-bottom: 5px !important;
        border: 1px solid #000 !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
    }

    body[data-print-scope] .module-title-row .eyebrow {
        font-size: 7.6px !important;
        letter-spacing: .06em !important;
    }

    body[data-print-scope] .module-title-row h2 {
        font-size: 11.5px !important;
        line-height: 1.12 !important;
    }

    body[data-print-scope] .assessment-table,
    body[data-print-scope] .assessment-table-wide {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        margin: 0 auto !important;
    }

    body[data-print-scope] .assessment-table th,
    body[data-print-scope] .assessment-table td {
        font-size: 8.7px !important;
        line-height: 1.18 !important;
        padding: 2px 3px !important;
        border: 1px solid #000 !important;
        vertical-align: top !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    body[data-print-scope] .assessment-table th {
        font-size: 8.3px !important;
        text-align: center !important;
        vertical-align: middle !important;
        font-weight: 900 !important;
    }

    body[data-print-scope] .sem-assessment-text {
        width: auto !important;
        text-align: left !important;
        font-weight: 700 !important;
    }

    body[data-print-scope] .answer-col,
    body[data-print-scope] .answer-cell {
        width: 8mm !important;
        max-width: 8mm !important;
        min-width: 8mm !important;
        text-align: center !important;
        vertical-align: middle !important;
        padding-left: 1px !important;
        padding-right: 1px !important;
    }

    body[data-print-scope="sem2"] .answer-col,
    body[data-print-scope="sem2"] .answer-cell,
    body[data-print-scope="sem4"] .answer-col,
    body[data-print-scope="sem4"] .answer-cell {
        width: 6mm !important;
        max-width: 6mm !important;
        min-width: 6mm !important;
    }

    body[data-print-scope] .check-box {
        width: 10px !important;
        height: 10px !important;
        min-width: 10px !important;
        font-size: 8px !important;
        line-height: 1 !important;
        margin: 0 auto !important;
    }

    body[data-print-scope] .score-panel {
        padding: 7px !important;
        margin-top: 6px !important;
        border: 1px solid #000 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body[data-print-scope] .score-panel .panel-header {
        margin-bottom: 5px !important;
    }

    body[data-print-scope] .score-panel h2 {
        font-size: 13px !important;
    }

    body[data-print-scope] .score-panel p {
        font-size: 8.5px !important;
        line-height: 1.25 !important;
        margin-top: 3px !important;
    }

    body[data-print-scope] .result-summary-table {
        width: 100% !important;
        table-layout: fixed !important;
        font-size: 8.5px !important;
    }

    body[data-print-scope] .result-summary-table th,
    body[data-print-scope] .result-summary-table td {
        font-size: 8.5px !important;
        line-height: 1.15 !important;
        padding: 3px 4px !important;
        border: 1.5px solid #000 !important;
    }

    body[data-print-scope] .result-summary-table .result-title-col,
    body[data-print-scope] .result-summary-table .module-result-name {
        width: 32mm !important;
    }

    body[data-print-scope] .result-summary-table .age-result-cell {
        width: 17mm !important;
    }

    body[data-print-scope] .report-notes-panel {
        padding: 7px !important;
        border: 1px solid #000 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body[data-print-scope] .report-note-block[data-comment-sem] {
        min-height: 105px !important;
        padding: 4px 6px !important;
    }

    body[data-print-scope] .report-note-block h3 {
        font-size: 11px !important;
        margin-bottom: 5px !important;
    }

    body[data-print-scope] .remark-print-value,
    body[data-print-scope] .signature-line,
    body[data-print-scope] .parent-signature-space {
        font-size: 9.5px !important;
        line-height: 1.3 !important;
    }
}


/* 2026-05-21: print refinements for header/footer, static student details, and summary table widths */
@media print {
    body[data-print-scope] {
        display: flex !important;
        flex-direction: column !important;
        min-height: 277mm !important;
        background: #fff !important;
        font-size: 10px !important;
    }

    body[data-print-scope] .assessment-brand-header,
    body[data-print-scope] .student-static-panel,
    body[data-print-scope] .module-card.panel,
    body[data-print-scope] .score-panel,
    body[data-print-scope] .report-notes-panel,
    body[data-print-scope] .assessment-brand-footer {
        width: 186mm !important;
        max-width: 186mm !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body[data-print-scope="sem1"] .module-card.panel,
    body[data-print-scope="sem3"] .module-card.panel,
    body[data-print-scope="sem1"] .score-panel,
    body[data-print-scope="sem3"] .score-panel,
    body[data-print-scope="sem1"] .report-notes-panel,
    body[data-print-scope="sem3"] .report-notes-panel,
    body[data-print-scope="sem1"] .assessment-brand-header,
    body[data-print-scope="sem3"] .assessment-brand-header,
    body[data-print-scope="sem1"] .student-static-panel,
    body[data-print-scope="sem3"] .student-static-panel,
    body[data-print-scope="sem1"] .assessment-brand-footer,
    body[data-print-scope="sem3"] .assessment-brand-footer {
        width: 178mm !important;
        max-width: 178mm !important;
    }

    body[data-print-scope] .assessment-brand-header {
        margin-bottom: 4mm !important;
    }

    body[data-print-scope] .assessment-brand-header img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        object-position: center top !important;
        border: 1px solid #000 !important;
        background: #fff !important;
    }

    body[data-print-scope] .student-static-panel {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 4mm !important;
    }

    body[data-print-scope] .student-static-head {
        margin: 0 0 1mm !important;
        padding: 0 !important;
    }

    body[data-print-scope] .student-static-head .eyebrow {
        margin: 0 !important;
        color: #000 !important;
        font-size: 8.4px !important;
        letter-spacing: .06em !important;
    }

    body[data-print-scope] .student-static-grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 0 !important;
        border-top: 1px solid #000 !important;
        border-left: 1px solid #000 !important;
    }

    body[data-print-scope] .student-static-item {
        border-right: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        border-radius: 0 !important;
        background: transparent !important;
        min-height: auto !important;
        padding: 2px 3px !important;
    }

    body[data-print-scope] .student-static-item span {
        display: block !important;
        font-size: 6.8px !important;
        color: #000 !important;
        margin-bottom: 1px !important;
        font-weight: 700 !important;
        text-transform: none !important;
    }

    body[data-print-scope] .student-static-item strong {
        display: block !important;
        font-size: 8.4px !important;
        line-height: 1.2 !important;
        color: #000 !important;
        font-weight: 800 !important;
    }

    body[data-print-scope] .score-panel .panel-header {
        margin-bottom: 4px !important;
    }

    body[data-print-scope] .score-panel h2 {
        font-size: 13px !important;
        line-height: 1.15 !important;
    }

    body[data-print-scope] .result-summary-table th,
    body[data-print-scope] .result-summary-table td {
        vertical-align: top !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    body[data-print-scope="sem1"] .result-summary-table .result-title-col,
    body[data-print-scope="sem1"] .result-summary-table .module-result-name,
    body[data-print-scope="sem3"] .result-summary-table .result-title-col,
    body[data-print-scope="sem3"] .result-summary-table .module-result-name {
        width: 56mm !important;
    }

    body[data-print-scope="sem1"] .result-summary-table .age-result-cell,
    body[data-print-scope="sem3"] .result-summary-table .age-result-cell {
        width: 16mm !important;
        white-space: nowrap !important;
    }

    body[data-print-scope="sem1"] .result-summary-table th[data-score-sem-col="1"],
    body[data-print-scope="sem1"] .result-summary-table td[data-score-sem-col="1"],
    body[data-print-scope="sem3"] .result-summary-table th[data-score-sem-col="1"],
    body[data-print-scope="sem3"] .result-summary-table td[data-score-sem-col="1"] {
        width: 20mm !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    body[data-print-scope="sem2"] .result-summary-table .result-title-col,
    body[data-print-scope="sem2"] .result-summary-table .module-result-name,
    body[data-print-scope="sem4"] .result-summary-table .result-title-col,
    body[data-print-scope="sem4"] .result-summary-table .module-result-name {
        width: 34mm !important;
    }

    body[data-print-scope="sem2"] .result-summary-table .age-result-cell,
    body[data-print-scope="sem4"] .result-summary-table .age-result-cell {
        width: 14mm !important;
        white-space: nowrap !important;
    }

    body[data-print-scope="sem2"] .result-summary-table th[data-score-sem-col],
    body[data-print-scope="sem2"] .result-summary-table td[data-score-sem-col],
    body[data-print-scope="sem4"] .result-summary-table th[data-score-sem-col],
    body[data-print-scope="sem4"] .result-summary-table td[data-score-sem-col] {
        width: 18mm !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    body[data-print-scope] .assessment-brand-footer {
        margin-top: auto !important;
        padding-top: 4mm !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body[data-print-scope] .assessment-brand-footer img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        object-position: center bottom !important;
        border: 0 !important;
        background: #fff !important;
    }
}

/* 2026-05-21: combined semester print shows only final semester comment/signature */
@media print {
    body[data-print-scope="sem2"] [data-comment-sem="1"],
    body[data-print-scope="sem4"] [data-comment-sem="3"] {
        display: none !important;
    }
}


/* 2026-05-21: sem card button colors and print duration block */
.sem-card .btn,
.sem-card .btn:disabled {
    opacity: 1 !important;
    filter: none !important;
}

.sem-card .btn.ghost {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
    box-shadow: none !important;
}

.sem-card .btn.primary {
    background: #8b5cf6 !important;
    color: #fff !important;
    box-shadow: none !important;
}

.print-duration-panel {
    display: none;
}

.print-duration-head h2 {
    margin: 0 0 10px;
}

.print-duration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.print-duration-item {
    border: 1px solid #000;
    padding: 6px 8px;
    background: transparent;
}

.print-duration-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.print-duration-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.print-duration-row span {
    font-weight: 700;
}

@media print {
    body[data-print-scope] .print-duration-panel {
        display: block !important;
        padding: 6px 8px !important;
        margin-bottom: 5px !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        background: #fff !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body[data-print-scope] .print-duration-head h2 {
        font-size: 11.5px !important;
        line-height: 1.15 !important;
        margin: 0 0 4px !important;
        color: #000 !important;
    }

    body[data-print-scope] .print-duration-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 4px !important;
    }

    body[data-print-scope] .print-duration-item {
        display: none !important;
        border: 1px solid #000 !important;
        padding: 4px 6px !important;
        background: transparent !important;
    }

    body[data-print-scope="sem1"] .print-duration-item[data-duration-sem="1"],
    body[data-print-scope="sem2"] .print-duration-item[data-duration-sem="1"],
    body[data-print-scope="sem2"] .print-duration-item[data-duration-sem="2"],
    body[data-print-scope="sem3"] .print-duration-item[data-duration-sem="3"],
    body[data-print-scope="sem4"] .print-duration-item[data-duration-sem="3"],
    body[data-print-scope="sem4"] .print-duration-item[data-duration-sem="4"] {
        display: block !important;
    }

    body[data-print-scope="sem1"] .print-duration-grid,
    body[data-print-scope="sem3"] .print-duration-grid {
        grid-template-columns: 1fr !important;
    }

    body[data-print-scope] .print-duration-title {
        font-size: 8.8px !important;
        line-height: 1.15 !important;
        margin-bottom: 3px !important;
        font-weight: 800 !important;
        color: #000 !important;
    }

    body[data-print-scope] .print-duration-row {
        grid-template-columns: 30px 1fr !important;
        gap: 5px !important;
        font-size: 8px !important;
        line-height: 1.2 !important;
    }

    body[data-print-scope] .remark-print-value {
        border-bottom: 0 !important;
        padding: 1px 0 2px !important;
        min-height: 20px !important;
    }

    body[data-print-scope] .comment-row {
        margin-bottom: 8px !important;
    }
}


/* 2026-05-21: clearer semester action buttons + compact summary table */
.sem-card [data-edit-sem],
.sem-card [data-print-sem] {
    opacity: 1 !important;
    filter: none !important;
    cursor: pointer !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

.sem-card [data-edit-sem],
.sem-card [data-edit-sem]:disabled {
    background: #dbeafe !important;
    color: #2563eb !important;
    border: 1px solid #93c5fd !important;
}

.sem-card [data-print-sem],
.sem-card [data-print-sem]:disabled {
    background: #a78bfa !important;
    color: #ffffff !important;
    border: 1px solid #8b5cf6 !important;
}

.sem-card [data-edit-sem]:hover,
.sem-card [data-print-sem]:hover {
    transform: translateY(-1px);
}

.score-panel .table-wrap {
    display: flex;
    justify-content: center;
}

.result-summary-table {
    width: 100% !important;
    max-width: 1160px !important;
    margin: 0 auto !important;
    table-layout: fixed !important;
}

.result-summary-table th,
.result-summary-table td {
    font-size: 12.5px !important;
    line-height: 1.18 !important;
    padding: 6px 7px !important;
}

.result-summary-table .score-sem-head,
.result-summary-table .result-title-col {
    font-size: 13px !important;
}

.result-summary-table .module-result-name,
.result-summary-table .result-title-col {
    width: 31% !important;
    text-align: left !important;
    vertical-align: middle !important;
}

.result-summary-table .age-result-cell {
    width: 9% !important;
    white-space: nowrap !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.result-summary-table th[data-score-sem-col],
.result-summary-table td[data-score-sem-col] {
    width: 10% !important;
    text-align: center !important;
    vertical-align: middle !important;
    font-size: 11.5px !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
}

.result-summary-table .module-result-name {
    word-break: normal !important;
    overflow-wrap: anywhere !important;
}

@media print {
    body[data-print-scope] .result-summary-table .module-result-name,
    body[data-print-scope] .result-summary-table .result-title-col {
        width: 34% !important;
    }

    body[data-print-scope] .result-summary-table .age-result-cell {
        width: 8% !important;
    }

    body[data-print-scope] .result-summary-table th[data-score-sem-col],
    body[data-print-scope] .result-summary-table td[data-score-sem-col] {
        width: 9.5% !important;
        font-size: 8.2px !important;
        padding: 3px 4px !important;
    }
}

/* 2026-05-21: final requested layout corrections */
.sem-card.locked {
    opacity: 1 !important;
    filter: none !important;
}

.sem-card input:disabled,
.sem-card .save-sem:disabled {
    opacity: .58 !important;
    cursor: not-allowed !important;
}

.sem-card [data-edit-sem],
.sem-card [data-edit-sem]:disabled,
.sem-card [data-print-sem],
.sem-card [data-print-sem]:disabled {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.result-summary-table col.summary-module-col {
    width: 34% !important;
}

.result-summary-table col.summary-age-col {
    width: 6% !important;
}

.result-summary-table col.summary-score-col {
    width: 10% !important;
}

.result-summary-table .module-result-name,
.result-summary-table .result-title-col {
    width: auto !important;
}

.result-summary-table .age-result-cell {
    width: auto !important;
    white-space: nowrap !important;
}

.result-summary-table th[data-score-sem-col],
.result-summary-table td[data-score-sem-col] {
    width: auto !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
}

@media print {
    body[data-print-scope] .print-duration-panel {
        width: 186mm !important;
        max-width: 186mm !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 4px 6px !important;
        overflow: hidden !important;
    }

    body[data-print-scope="sem1"] .print-duration-panel,
    body[data-print-scope="sem3"] .print-duration-panel {
        width: 178mm !important;
        max-width: 178mm !important;
    }

    body[data-print-scope] .print-duration-grid {
        width: 100% !important;
        max-width: 100% !important;
        gap: 3px !important;
    }

    body[data-print-scope] .print-duration-item {
        min-width: 0 !important;
        padding: 3px 5px !important;
        overflow-wrap: anywhere !important;
    }

    body[data-print-scope] .print-duration-title {
        font-size: 8px !important;
        line-height: 1.1 !important;
    }

    body[data-print-scope] .print-duration-row {
        grid-template-columns: 22px minmax(0, 1fr) !important;
        gap: 3px !important;
        font-size: 7.5px !important;
        line-height: 1.15 !important;
    }

    body[data-print-scope] .result-summary-table col.summary-module-col {
        width: 30% !important;
    }

    body[data-print-scope] .result-summary-table col.summary-age-col {
        width: 5% !important;
    }

    body[data-print-scope] .result-summary-table col.summary-score-col {
        width: 10.833% !important;
    }

    body[data-print-scope] .result-summary-table th,
    body[data-print-scope] .result-summary-table td {
        padding: 3px 3px !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    body[data-print-scope] .result-summary-table .age-result-cell {
        width: auto !important;
        white-space: nowrap !important;
        font-size: 8px !important;
    }

    body[data-print-scope] .result-summary-table th[data-score-sem-col],
    body[data-print-scope] .result-summary-table td[data-score-sem-col] {
        width: auto !important;
        font-size: 8px !important;
        line-height: 1.1 !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    body[data-print-scope] .result-summary-table .result-title-col,
    body[data-print-scope] .result-summary-table .module-result-name {
        width: auto !important;
    }
}

/* 2026-05-21: summary table module merge on teacher screen + print age-column removal */
.result-summary-table .screen-module-result-name {
    vertical-align: middle !important;
}

@media print {
    body[data-print-scope] .module-card.panel[data-module="module_6"] {
        break-before: page !important;
        page-break-before: always !important;
        margin-top: 8mm !important;
    }

    body[data-print-scope] .result-summary-table col.summary-module-col {
        width: 0 !important;
        visibility: collapse !important;
    }

    body[data-print-scope] .result-summary-table .screen-module-result-name {
        display: none !important;
        width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    body[data-print-scope] .result-summary-table .age-result-cell {
        display: table-cell !important;
        width: 52mm !important;
        white-space: normal !important;
        text-align: left !important;
        vertical-align: middle !important;
        font-weight: 900 !important;
        overflow-wrap: anywhere !important;
    }

    body[data-print-scope] .result-summary-table .age-result-cell strong {
        display: none !important;
    }

    body[data-print-scope] .result-summary-table .age-result-cell::before {
        content: attr(data-print-module);
        display: block;
        color: #000;
        font-weight: 900;
    }

    body[data-print-scope="sem1"] .result-summary-table .age-result-cell,
    body[data-print-scope="sem3"] .result-summary-table .age-result-cell {
        width: 64mm !important;
    }

    body[data-print-scope="sem2"] .result-summary-table .age-result-cell,
    body[data-print-scope="sem4"] .result-summary-table .age-result-cell {
        width: 42mm !important;
    }
}

/* 2026-05-21 hotfix: use a dedicated print summary table so age-column removal does not break rowspan layout */
.print-result-summary-table {
    display: none;
}

@media print {
    body[data-print-scope] .result-summary-table {
        display: none !important;
    }

    body[data-print-scope] .print-result-summary-table {
        display: table !important;
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        margin: 0 auto !important;
        font-size: 8.4px !important;
    }

    body[data-print-scope] .print-result-summary-table th,
    body[data-print-scope] .print-result-summary-table td {
        border: 1.4px solid #000 !important;
        background: transparent !important;
        color: #000 !important;
        font-size: 8.4px !important;
        line-height: 1.12 !important;
        padding: 3px 4px !important;
        vertical-align: middle !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    body[data-print-scope] .print-result-summary-table th {
        text-align: center !important;
        font-weight: 900 !important;
    }

    body[data-print-scope] .print-result-summary-table .module-result-name {
        text-align: left !important;
        font-weight: 900 !important;
    }

    body[data-print-scope] .print-result-summary-table td:not(.module-result-name) {
        text-align: center !important;
        font-weight: 800 !important;
    }

    body[data-print-scope] .print-result-summary-table .percentage-sem-1 {
        background: #eaf4ff !important;
        font-weight: 900 !important;
    }

    body[data-print-scope] .print-result-summary-table .percentage-sem-2 {
        background: #f3e8ff !important;
        font-weight: 900 !important;
    }

    body[data-print-scope] .print-result-summary-table tbody tr[data-print-score-age] {
        display: none !important;
    }

    body[data-print-scope="sem1"] .print-result-summary-table tbody tr[data-print-score-age="2"],
    body[data-print-scope="sem2"] .print-result-summary-table tbody tr[data-print-score-age="2"],
    body[data-print-scope="sem3"] .print-result-summary-table tbody tr[data-print-score-age="3"],
    body[data-print-scope="sem4"] .print-result-summary-table tbody tr[data-print-score-age="3"] {
        display: table-row !important;
    }

    body[data-print-scope] .print-result-summary-table [data-score-sem-col] {
        display: none !important;
    }

    body[data-print-scope="sem1"] .print-result-summary-table [data-score-sem-col="1"],
    body[data-print-scope="sem2"] .print-result-summary-table [data-score-sem-col="1"],
    body[data-print-scope="sem2"] .print-result-summary-table [data-score-sem-col="2"],
    body[data-print-scope="sem3"] .print-result-summary-table [data-score-sem-col="1"],
    body[data-print-scope="sem4"] .print-result-summary-table [data-score-sem-col="1"],
    body[data-print-scope="sem4"] .print-result-summary-table [data-score-sem-col="2"] {
        display: table-cell !important;
    }

    body[data-print-scope="sem1"] .print-result-summary-table .print-summary-module-col,
    body[data-print-scope="sem3"] .print-result-summary-table .print-summary-module-col {
        width: 70mm !important;
    }

    body[data-print-scope="sem2"] .print-result-summary-table .print-summary-module-col,
    body[data-print-scope="sem4"] .print-result-summary-table .print-summary-module-col {
        width: 48mm !important;
    }
}

/* 2026-05-21: combined semester print pagination fix
   - Combined reports (Sem 2 / Sem 4) start Module 4 on a new page.
   - Module 6 no longer starts a new page; it continues after Module 5.
*/
@media print {
    body[data-print-scope="sem2"] .module-card.panel[data-module="module_4"],
    body[data-print-scope="sem4"] .module-card.panel[data-module="module_4"] {
        break-before: page !important;
        page-break-before: always !important;
        margin-top: 8mm !important;
    }

    body[data-print-scope="sem2"] .module-card.panel[data-module="module_6"],
    body[data-print-scope="sem4"] .module-card.panel[data-module="module_6"] {
        break-before: auto !important;
        page-break-before: auto !important;
        margin-top: 0 !important;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.super-stats-grid .stat-card strong {
    font-size: 28px;
}

.school-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.school-card {
    display: grid;
    gap: 16px;
    min-height: 210px;
    padding: 22px;
    border-radius: 28px;
    background: rgba(255,255,255,.94);
    border: 1px solid #ddd6fe;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.school-card:hover {
    transform: translateY(-3px);
    border-color: #a78bfa;
    box-shadow: 0 22px 55px rgba(76, 29, 149, .14);
}

.school-card h2 {
    font-size: 24px;
    line-height: 1.2;
}

.school-card-top,
.school-card-footer,
.school-card-metrics {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.school-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--purple-soft);
    color: var(--purple-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.school-card-metrics {
    align-items: stretch;
}

.school-card-metrics div {
    flex: 1;
    padding: 14px;
    border-radius: 18px;
    background: var(--purple-light);
    border: 1px solid #ddd6fe;
}

.school-card-metrics span,
.school-card-footer span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.school-card-metrics strong {
    display: block;
    margin-top: 5px;
    color: var(--purple-dark);
    font-size: 22px;
}

.school-card-footer strong {
    color: var(--purple-dark);
    white-space: nowrap;
}

.management-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
}
.management-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.management-form { display: grid; gap: 14px; }
.management-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.management-form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 13px;
    font: inherit;
    background: white;
    outline: none;
}
select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-soft); }
select[multiple] { padding: 8px; min-height: 112px; }
select[multiple] option { padding: 7px 8px; border-radius: 8px; }
.compact-table th, .compact-table td { padding: 10px 11px; }
.action-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action-cell form { margin: 0; }
.btn.danger { background: #fee2e2; color: var(--danger); }
.management-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
    .management-form-grid,
    .management-form-grid.three,
    .management-stats { grid-template-columns: 1fr; }
    .management-shortcut { align-items: flex-start; flex-direction: column; }
}

.field-title {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 900;
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.school-checkbox-grid,
.class-checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    max-height: 310px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
}
.checkbox-list-search {
    width: 100%;
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 13px;
    font: inherit;
    background: white;
    outline: none;
}
.checkbox-list-search:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-soft); }
.check-card {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-weight: 800;
}
.check-card input { margin-top: 3px; }
.check-card em {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}
.create-toggle { display: grid; gap: 16px; }
.create-toggle > summary {
    width: fit-content;
    list-style: none;
    cursor: pointer;
}
.create-toggle > summary::-webkit-details-marker { display: none; }
.stacked-lines {
    display: grid;
    gap: 4px;
}
.stacked-lines span {
    display: block;
    padding: 2px 0;
    border-bottom: 1px solid #eef2ff;
}
.stacked-lines span:last-child { border-bottom: 0; }
.small-note { margin: -4px 0 8px; }
.merged-overview-table td[rowspan] {
    vertical-align: top;
    background: #faf5ff;
}

.action-cell-nowrap {
    flex-wrap: nowrap;
    white-space: nowrap;
}
.import-form {
    gap: 12px;
}
.import-actions {
    justify-content: flex-start;
    gap: 10px;
}
.import-result ul {
    margin: 8px 0 0 18px;
    padding: 0;
}
.import-result li {
    margin: 3px 0;
}

.dashboard-table td.action-cell {
    display: table-cell;
    vertical-align: middle;
}
.dashboard-table td.action-cell .btn,
.dashboard-table td.action-cell form {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 8px;
}
.dashboard-table td.action-cell form:last-child,
.dashboard-table td.action-cell .btn:last-child {
    margin-right: 0;
}


.playschool-search-panel {
    margin-top: 14px;
    padding: 18px 20px;
}

.playschool-search-label {
    display: block;
    margin-bottom: 8px;
    color: var(--purple-dark);
    font-weight: 900;
    font-size: 13px;
}

.playschool-card-search {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 15px;
    font-weight: 800;
    background: #fff;
}

.playschool-card-search:focus {
    outline: 3px solid rgba(109, 40, 217, .14);
    border-color: #8b5cf6;
}

.compact-checkbox-grid.class-checkbox-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    max-height: none;
}
.compact-check-card {
    align-items: center;
    justify-content: flex-start;
    min-height: 42px;
}
.form-note {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
