:root {
    --green: #198754;
    --green-dark: #11643d;
    --mint: #e8f6ef;
    --ink: #24312a;
    --muted: #65716a;
    --line: #dce7df;
    --paper: #ffffff;
    --soft: #f6faf7;
    --accent: #c58a1f;
}

body {
    background: var(--soft);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
    color: var(--green-dark);
}

.brand-mark,
.sidebar-brand {
    color: var(--ink);
    text-decoration: none;
}

.brand-icon {
    align-items: center;
    background: var(--green);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    margin-right: .4rem;
    width: 34px;
}

.hero-band {
    background: linear-gradient(120deg, rgba(25, 135, 84, .10), rgba(197, 138, 31, .12));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(1.5rem, 4vw, 3.5rem);
}

.eyebrow {
    color: var(--green-dark);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.feature-tile,
.stat-card,
.panel,
.auth-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(36, 49, 42, .06);
}

.feature-tile,
.stat-card {
    padding: 1.25rem;
}

.stat-card .stat-icon {
    align-items: center;
    background: var(--mint);
    border-radius: 8px;
    color: var(--green-dark);
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.dashboard-hero-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f4fbf7 58%, #fff8e9 100%);
    border-color: #cfe3d7;
}

.dashboard-insight-strip {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.dashboard-insight-strip span {
    background: rgba(255, 255, 255, .72);
    border: 1px solid #d7e7dc;
    border-radius: 8px;
    color: var(--muted);
    padding: .7rem .85rem;
}

.dashboard-insight-strip strong {
    color: var(--ink);
    display: block;
    font-size: 1.1rem;
}

.dashboard-stat-card {
    border-color: #d5e6dc;
    position: relative;
}

.dashboard-stat-card::before {
    background: linear-gradient(180deg, var(--green), var(--accent));
    border-radius: 8px 0 0 8px;
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 4px;
}

.panel {
    padding: 1.25rem;
}

.auth-wrap {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 2rem 0;
}

.auth-card {
    margin: auto;
    max-width: 460px;
    padding: 2rem;
    width: 100%;
}

.staff-auth-wrap {
    background: linear-gradient(120deg, rgba(25, 135, 84, .10), rgba(197, 138, 31, .10));
    padding: clamp(1rem, 3vw, 2rem);
}

.staff-auth-shell {
    align-items: stretch;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .75fr);
    margin: auto;
    max-width: 1100px;
    width: 100%;
}

.staff-auth-intro {
    align-self: center;
    padding: clamp(1rem, 4vw, 3rem);
}

.staff-auth-card {
    align-self: center;
}

.staff-auth-points {
    display: grid;
    gap: .65rem;
}

.staff-auth-points span,
.staff-auth-help span {
    align-items: center;
    color: var(--muted);
    display: flex;
    gap: .5rem;
}

.account-switch {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-option {
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: .65rem;
    padding: .8rem;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.account-option.active,
.account-option:hover {
    background: var(--mint);
    border-color: var(--green);
    box-shadow: 0 8px 20px rgba(36, 49, 42, .08);
}

.account-option input {
    margin-top: .25rem;
}

.account-option small {
    color: var(--muted);
    display: block;
    line-height: 1.25;
}

.staff-auth-help {
    border-top: 1px solid var(--line);
    display: grid;
    gap: .35rem;
    padding-top: .9rem;
}

.btn,
.form-control,
.form-select,
.alert,
.badge,
.card {
    border-radius: 8px;
}

.btn-success {
    background: var(--green);
    border-color: var(--green);
}

.btn-success:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    flex-direction: column;
    gap: 1rem;
    min-height: 100vh;
    padding: 1.2rem;
    position: sticky;
    top: 0;
    width: 270px;
}

.sidebar-brand {
    align-items: center;
    display: flex;
    font-size: 1.1rem;
    font-weight: 800;
}

.sidebar-user {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    padding: .9rem;
}

.sidebar .nav-link,
.sidebar-mobile .nav-link {
    align-items: center;
    border-radius: 8px;
    color: var(--ink);
    display: flex;
    gap: .65rem;
    margin-bottom: .25rem;
    padding: .72rem .85rem;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover,
.sidebar-mobile .nav-link.active,
.sidebar-mobile .nav-link:hover {
    background: var(--mint);
    color: var(--green-dark);
}

.nav-note {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    display: block;
    font-size: .82rem;
    margin: .25rem 0 .5rem;
    padding: .65rem .8rem;
}

.app-main {
    flex: 1;
    min-width: 0;
}

.topbar {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    min-height: 78px;
    padding: 1rem clamp(1rem, 3vw, 2rem);
    position: sticky;
    top: 0;
    z-index: 20;
}

.content-wrap {
    padding: clamp(1rem, 3vw, 2rem);
}

.table {
    vertical-align: middle;
}

.table thead th {
    background: var(--mint);
    color: var(--ink);
    font-size: .86rem;
    white-space: nowrap;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.activity-review-cell {
    align-items: flex-start;
    display: grid;
    gap: .35rem;
    min-width: 150px;
}

.activity-review-cell form {
    margin: 0;
}

.filter-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.public-search-actions {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.search-action-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    min-height: 112px;
    padding: 1rem;
    text-align: left;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.search-action-card:hover,
.search-action-card:focus,
.search-action-card:focus-within,
.search-action-card.active {
    background: var(--mint);
    border-color: var(--green);
    box-shadow: 0 10px 24px rgba(36, 49, 42, .10);
    outline: none;
    transform: translateY(-1px);
}

.search-action-card strong,
.search-action-card span {
    display: block;
}

.search-action-card span {
    color: var(--muted);
    font-size: .9rem;
    margin-top: .35rem;
}

.report-choice-card {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    position: relative;
}

.search-action-card .report-choice-icon {
    align-items: center;
    background: var(--mint);
    border: 1px solid rgba(25, 135, 84, .18);
    border-radius: 8px;
    color: var(--green-dark);
    display: inline-flex !important;
    font-size: 1.55rem;
    height: 46px;
    justify-content: center;
    margin-bottom: .25rem;
    margin-top: 0;
    width: 46px;
}

.report-choice-card.active .report-choice-icon,
.report-choice-card:hover .report-choice-icon {
    background: var(--green);
    color: #fff;
}

.report-search-panel {
    background: #fbfefc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.15rem;
}

.report-search-panel[hidden],
.report-specific-options[hidden],
[data-weekly-specific-wrap][hidden],
[data-activity-week-wrap][hidden],
[data-activity-month-wrap][hidden] {
    display: none !important;
}

.report-specific-options {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.report-radio-row {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-option {
    min-height: 68px;
    padding: .75rem;
}

.public-search-note {
    align-items: flex-start;
    background: var(--mint);
    border: 1px solid rgba(25, 135, 84, .18);
    border-radius: 8px;
    color: var(--green-dark);
    display: flex;
    gap: .55rem;
    padding: .75rem;
}

.option-tile {
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: .75rem;
    min-height: 78px;
    padding: .9rem;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.option-tile:hover,
.option-tile:has(input:checked) {
    background: var(--mint);
    border-color: var(--green);
    box-shadow: 0 8px 18px rgba(36, 49, 42, .08);
}

.option-tile input {
    flex: 0 0 auto;
    margin-top: .2rem;
}

.option-tile span {
    min-width: 0;
}

.option-tile small {
    color: var(--muted);
    display: block;
}

.optional-roster-table th,
.optional-roster-table td {
    min-width: 150px;
}

.optional-roster-table th:first-child,
.optional-roster-table td:first-child {
    min-width: 72px;
}

.required::after {
    color: #b42318;
    content: " *";
}

.result-school-title {
    border-bottom: 2px solid var(--green);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
}

.print-only {
    display: none;
}

canvas.result-chart {
    max-height: 260px;
    width: 100%;
}

canvas.dashboard-chart {
    display: block;
    min-height: 220px;
    width: 100%;
}

.dashboard-chart-small {
    min-height: 200px;
}

.progress-summary {
    display: grid;
    gap: .6rem;
}

.summary-dot {
    border-radius: 50%;
    display: inline-block;
    height: .7rem;
    margin-right: .4rem;
    width: .7rem;
}

.chart-tooltip {
    background: rgba(36, 49, 42, .94);
    border-radius: 8px;
    color: #fff;
    font-size: .82rem;
    opacity: 0;
    padding: .35rem .55rem;
    pointer-events: none;
    position: fixed;
    transform: translateY(-4px);
    transition: opacity .12s ease, transform .12s ease;
    z-index: 1050;
}

.chart-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.activity-timeline {
    display: grid;
    gap: .9rem;
}

.activity-item {
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 8px;
    display: grid;
    gap: 1rem;
    grid-template-columns: 86px minmax(0, 1fr);
    padding: 1rem;
}

.activity-item.concern {
    border-left-color: var(--accent);
}

.activity-item.serious {
    border-left-color: #b42318;
}

.activity-item.positive {
    border-left-color: var(--green);
}

.activity-date {
    color: var(--muted);
    display: grid;
    font-size: .86rem;
}

.activity-date strong {
    color: var(--ink);
}

.activity-body {
    min-width: 0;
}

.term-ledger-table th,
.term-ledger-table td {
    font-size: .68rem;
    min-width: 58px;
    padding: .28rem;
}

.grade-summary-table th,
.grade-summary-table td {
    font-size: .78rem;
    text-align: center;
    white-space: nowrap;
}

.grade-summary-table th:first-child,
.grade-summary-table td:first-child,
.grade-summary-table th:nth-child(2),
.grade-summary-table td:nth-child(2),
.grade-summary-table th:nth-child(3),
.grade-summary-table td:nth-child(3) {
    text-align: left;
}

.term-ledger-table th:nth-child(3),
.term-ledger-table td:nth-child(3) {
    min-width: 135px;
}

.weekly-ledger-table th,
.weekly-ledger-table td {
    font-size: .78rem;
    min-width: 70px;
    padding: .35rem;
}

.weekly-ledger-table th:nth-child(3),
.weekly-ledger-table td:nth-child(3) {
    min-width: 160px;
    text-align: left;
}

.term-entry-table th,
.term-entry-table td {
    min-width: 110px;
}

.term-entry-table th:nth-child(2),
.term-entry-table td:nth-child(2) {
    min-width: 180px;
}

.term-entry-mobile-table th,
.term-entry-mobile-table td {
    font-size: .86rem;
}

.term-entry-mobile-table .mark-entry-input-wrap {
    align-items: center;
    display: flex;
    gap: .35rem;
}

.term-entry-mobile-table .mark-entry-input-wrap input {
    min-width: 86px;
}

.term-entry-mobile-table .student-cell strong {
    display: inline-block;
    line-height: 1.25;
}

.term-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}

.term-report-stack {
    display: grid;
    gap: 1.5rem;
}

.official-document {
    background: #fff;
    border: 2px solid var(--green-dark);
    color: #17231d;
    padding: 1rem;
}

.official-doc-header {
    align-items: center;
    border-bottom: 2px solid var(--green-dark);
    display: grid;
    gap: 1rem;
    grid-template-columns: 86px minmax(0, 1fr);
    margin-bottom: 1rem;
    padding-bottom: .9rem;
    text-align: center;
}

.official-doc-header h2,
.official-doc-header h3,
.official-doc-header p {
    margin: 0;
}

.official-doc-header h2 {
    font-size: 1.45rem;
    font-weight: 800;
    text-transform: uppercase;
}

.official-doc-header h3 {
    color: var(--green-dark);
    font-size: 1rem;
    font-weight: 800;
    margin-top: .35rem;
    text-transform: uppercase;
}

.school-logo-wrap {
    align-items: center;
    border: 2px solid var(--green-dark);
    border-radius: 8px;
    display: inline-flex;
    height: 72px;
    justify-content: center;
    overflow: hidden;
    width: 72px;
}

.school-logo-wrap img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.school-logo-wrap span {
    color: var(--green-dark);
    font-size: 2rem;
    font-weight: 800;
}

.ledger-meta-grid,
.student-info-grid,
.report-summary-grid {
    border: 1px solid #9fb4a9;
    display: grid;
    gap: 0;
    margin-bottom: 1rem;
}

.ledger-meta-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.student-info-grid,
.report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ledger-meta-grid span,
.student-info-grid span,
.report-summary-grid span {
    border-bottom: 1px solid #d5e2da;
    border-right: 1px solid #d5e2da;
    padding: .45rem .55rem;
}

.official-table {
    border-color: #52685c;
}

.official-table thead th {
    background: #dceee5;
    border-color: #52685c;
    color: #17231d;
    text-align: center;
}

.official-table td,
.official-table th {
    border-color: #52685c;
}

.subject-score-cell strong {
    font-size: .9rem;
}

.official-doc-footer {
    border-top: 1px solid #9fb4a9;
    color: var(--muted);
    display: flex;
    font-size: .78rem;
    justify-content: space-between;
    margin-top: .75rem;
    padding-top: .5rem;
}

.term-report-card {
    background: #fff;
    border: 1px solid #164734;
    border-radius: 0;
    color: #161f1a;
    font-family: "Times New Roman", Times, serif;
    margin: 0 auto;
    max-width: 210mm;
    min-height: 287mm;
    padding: 10mm;
    position: relative;
}

.term-report-card::before {
    background: linear-gradient(90deg, #8f1f24, #b68a2c, #164734);
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.grade-sheet-header {
    align-items: start;
    display: grid;
    gap: .75rem;
    grid-template-columns: 95px minmax(0, 1fr) 95px;
    margin-bottom: 1.4rem;
    text-align: center;
}

.grade-sheet-logo {
    border: 0;
    height: 84px;
    justify-self: center;
    width: 84px;
}

.grade-sheet-title h2,
.grade-sheet-title h3,
.grade-sheet-title h4,
.grade-sheet-title p {
    margin: 0;
}

.grade-sheet-title h2 {
    color: #164734;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.grade-sheet-title p {
    font-size: .94rem;
}

.grade-sheet-title h3 {
    color: #8f1f24;
    font-size: 1.08rem;
    font-weight: 800;
    margin-top: .45rem;
    text-transform: uppercase;
}

.grade-sheet-title h4 {
    color: #164734;
    font-size: 1rem;
    font-weight: 800;
    margin-top: .25rem;
    text-transform: uppercase;
}

.grade-sheet-info,
.grade-sheet-summary {
    display: grid;
    gap: .35rem 2.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: .9rem;
}

.grade-sheet-info div,
.grade-sheet-summary div {
    display: grid;
    gap: .4rem;
    grid-template-columns: 122px minmax(0, 1fr);
}

.grade-sheet-info strong,
.grade-sheet-summary strong {
    font-size: .82rem;
    text-transform: uppercase;
}

.grade-sheet-info span,
.grade-sheet-summary span {
    min-width: 0;
}

.report-marks-table th,
.report-marks-table td {
    border-color: #1f3028 !important;
    color: #111;
    font-size: .84rem;
    padding: .33rem .4rem;
    text-align: center;
}

.report-marks-table thead th {
    background: #e8f1ec;
    color: #164734;
    font-size: .78rem;
    text-transform: uppercase;
}

.report-marks-table th:nth-child(2),
.report-marks-table td:nth-child(2) {
    min-width: 155px;
    text-align: left;
}

.report-marks-table {
    margin-bottom: 0;
}

.report-marks-table .final-grade-cell {
    background: #fff7df;
    color: #8f1f24;
    font-weight: 800;
}

.report-gpa-row td {
    background: #f8faf8;
    color: #164734;
    font-size: .88rem;
    font-weight: 800;
}

.grade-sheet-summary-compact {
    background: #f8faf8;
    border: 1px solid #94aa9f;
    gap: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grade-sheet-summary-compact div {
    border-right: 1px solid #d4ded8;
    gap: .2rem;
    grid-template-columns: 74px minmax(0, 1fr);
    padding: .38rem .5rem;
}

.grade-sheet-summary-compact div:last-child {
    border-right: 0;
}

.report-summary-grid {
    background: #f7fbf8;
    font-size: .9rem;
    margin-top: .8rem;
}

.grade-sheet-remark {
    border: 0;
    margin: 1rem 0 .9rem;
    padding: 0;
}

.grade-sheet-remark p {
    margin-bottom: .35rem;
}

.grade-sheet-signatures {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 4rem;
    text-align: center;
}

.grade-sheet-signatures span {
    border-top: 1px dotted #111;
    display: block;
    margin-bottom: .45rem;
}

.grade-sheet-signatures p,
.grade-sheet-issue {
    margin: 0;
}

.grade-sheet-issue {
    margin-top: 1.8rem;
}

@media (max-width: 991.98px) {
    .topbar {
        min-height: auto;
    }

    .staff-auth-shell {
        grid-template-columns: 1fr;
    }

    .staff-auth-intro {
        padding: 1rem 0 0;
    }
}

@media (max-width: 575.98px) {
    .public-search-actions,
    .report-radio-row {
        grid-template-columns: 1fr;
    }

    .account-switch {
        grid-template-columns: 1fr;
    }

    .activity-item {
        grid-template-columns: 1fr;
    }

    .term-signatures {
        grid-template-columns: 1fr;
    }

    .grade-sheet-header,
    .grade-sheet-info,
    .grade-sheet-summary {
        grid-template-columns: 1fr;
    }

    .ledger-meta-grid,
    .student-info-grid,
    .report-summary-grid,
    .official-doc-header {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .term-entry-mobile-table {
        border: 0;
        margin-bottom: 0;
    }

    .term-entry-mobile-table thead {
        display: none;
    }

    .term-entry-mobile-table,
    .term-entry-mobile-table tbody,
    .term-entry-mobile-table tr,
    .term-entry-mobile-table td {
        display: block;
        width: 100%;
    }

    .term-entry-mobile-table tr {
        background: #fff;
        border: 1px solid var(--line);
        border-left: 4px solid var(--green);
        border-radius: 8px;
        margin-bottom: .85rem;
        padding: .65rem .75rem;
    }

    .term-entry-mobile-table td {
        align-items: center;
        border: 0 !important;
        display: grid;
        gap: .45rem;
        grid-template-columns: minmax(94px, 36%) minmax(0, 1fr);
        min-width: 0;
        padding: .34rem 0;
        white-space: normal;
    }

    .term-entry-mobile-table td::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: .74rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .term-entry-mobile-table .student-cell {
        align-items: start;
        border-bottom: 1px solid var(--line) !important;
        margin-bottom: .2rem;
        padding-bottom: .55rem;
    }

    .term-entry-mobile-table .form-control,
    .term-entry-mobile-table .form-select {
        min-height: 38px;
        width: 100%;
    }

    .term-entry-mobile-table .mark-entry-input-wrap {
        width: 100%;
    }

    .term-entry-mobile-table .mark-entry-input-wrap input {
        min-width: 0;
    }

    .term-entry-mobile-table .text-center {
        text-align: left !important;
    }

    .term-entry-actions .btn {
        flex: 1 1 160px;
    }
}

@media (max-width: 380px) {
    .term-entry-mobile-table td {
        align-items: stretch;
        gap: .18rem;
        grid-template-columns: 1fr;
    }
}

@page term-ledger {
    margin: 0;
    size: A4 landscape;
}

@page term-report-card {
    margin: 8mm;
    size: A4 portrait;
}

@page weekly-ledger {
    margin: 5mm;
    size: A4 landscape;
}

@media print {
    body {
        background: #fff;
    }

    body.term-ledger-print {
        margin: 0 !important;
    }

    .navbar,
    .topbar,
    .sidebar,
    .btn,
    .no-print,
    .alert {
        display: none !important;
    }

    .container,
    .content-wrap {
        max-width: 100%;
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .app-main,
    .term-print-panel,
    .official-document {
        width: 100%;
    }

    .table-responsive {
        overflow: visible !important;
    }

    table {
        break-inside: auto;
    }

    thead {
        display: table-header-group;
    }

    tfoot {
        display: table-footer-group;
    }

    tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .term-ledger-document {
        page: term-ledger;
        border: 1.2pt solid #164734;
        box-sizing: border-box;
        color: #111813;
        font-family: "Times New Roman", Times, serif;
        margin: 4mm;
        padding: 2.6mm 3mm 2.4mm;
        print-color-adjust: exact;
        width: auto;
        -webkit-print-color-adjust: exact;
    }

    .term-report-card {
        page: term-report-card;
    }

    .weekly-ledger-document {
        page: weekly-ledger;
    }

    .official-document {
        border-radius: 0;
        box-shadow: none;
    }

    .term-ledger-table {
        border: .75pt solid #314b3e;
        border-collapse: collapse;
        margin: 0;
        table-layout: fixed;
        width: 100%;
    }

    .term-ledger-table col.ledger-col-sn {
        width: 2%;
    }

    .term-ledger-table col.ledger-col-roll {
        width: 3%;
    }

    .term-ledger-table col.ledger-col-student {
        width: var(--ledger-student-col, 13%);
    }

    .term-ledger-table col.ledger-col-mark {
        width: var(--ledger-mark-col, 2%);
    }

    .term-ledger-table col.ledger-col-gpa {
        width: 3.2%;
    }

    .term-ledger-table col.ledger-col-result {
        width: 4.8%;
    }

    .term-ledger-table col.ledger-col-rank {
        width: 3%;
    }

    .term-ledger-table th,
    .term-ledger-table td {
        border-color: #5d7066 !important;
        border-width: .45pt !important;
        color: #111813;
        font-size: 7.4pt;
        line-height: 1.08;
        min-width: 0;
        overflow: hidden;
        overflow-wrap: anywhere;
        padding: 1.35pt 1.4pt !important;
        vertical-align: middle;
        white-space: normal;
        word-break: normal;
    }

    .term-ledger-print .term-ledger-table th:nth-child(3),
    .term-ledger-print .term-ledger-table td:nth-child(3) {
        min-width: 0 !important;
        width: auto;
    }

    .term-ledger-table thead th {
        background: #e8f1ec;
        color: #123c2b;
        font-weight: 800;
        text-align: center;
    }

    .term-ledger-table .ledger-subject-head {
        font-size: var(--ledger-subject-font, 7.1pt);
        height: 7.8mm;
        hyphens: auto;
        line-height: 1.02;
        padding: 1.4pt 1pt;
        text-transform: none;
    }

    .term-ledger-table .ledger-fixed-head,
    .term-ledger-table .ledger-component-head {
        font-size: 6.3pt;
        line-height: 1;
        padding: 1pt .8pt;
        text-transform: none;
    }

    .term-ledger-table .ledger-component-head {
        font-size: var(--ledger-component-font, 6.3pt);
    }

    .term-ledger-table .ledger-student-head {
        font-size: 7pt;
        text-align: left;
    }

    .term-ledger-table .ledger-student-cell {
        font-size: 7.4pt;
        font-weight: 700;
        text-align: left;
    }

    .term-ledger-table .ledger-sn-cell,
    .term-ledger-table .ledger-roll-cell,
    .term-ledger-table .ledger-mark-cell,
    .term-ledger-table .ledger-gpa-cell,
    .term-ledger-table .ledger-rank-cell {
        font-variant-numeric: tabular-nums;
        overflow-wrap: normal;
        white-space: nowrap;
    }

    .term-ledger-table .ledger-mark-cell {
        font-size: var(--ledger-mark-font, 7.4pt);
    }

    .term-ledger-table .ledger-result-cell {
        font-size: 6.8pt;
        font-weight: 700;
    }

    .term-ledger-table .ledger-muted-cell {
        color: #4f5d55 !important;
        font-size: 6.2pt;
    }

    .term-ledger-table .badge {
        background: transparent !important;
        border: 0 !important;
        color: inherit !important;
        display: inline;
        font-size: inherit;
        padding: 0;
    }

    .term-ledger-table tr.table-danger td {
        background: #fae5e6 !important;
    }

    .term-ledger-table tr.table-warning td {
        background: #fff4d9 !important;
    }

    .term-ledger-print .official-doc-header {
        border-bottom: 1.2pt solid #164734;
        gap: 3mm;
        grid-template-columns: 13mm minmax(0, 1fr);
        margin-bottom: 1.7mm;
        padding-bottom: 1.6mm;
    }

    .term-ledger-print .school-logo-wrap {
        border-width: 1.2pt;
        height: 10.5mm;
        width: 10.5mm;
    }

    .term-ledger-print .school-logo-wrap span {
        font-size: 13pt;
    }

    .term-ledger-print .official-doc-header h2 {
        color: #111813;
        font-size: 14pt;
        letter-spacing: 0;
        line-height: 1.02;
    }

    .term-ledger-print .official-doc-header p {
        font-size: 8pt;
        line-height: 1.08;
    }

    .term-ledger-print .official-doc-header h3 {
        color: #164734;
        font-size: 8.7pt;
        line-height: 1.05;
        margin-top: .8mm;
    }

    .term-ledger-print .official-doc-header strong {
        color: #111813;
        display: block;
        font-size: 11pt;
        line-height: 1.05;
        margin-top: .7mm;
    }

    .term-ledger-print .ledger-meta-grid {
        border-color: #8ca195;
        font-size: 6.3pt;
        line-height: 1.05;
        margin-bottom: 1.8mm;
    }

    .term-ledger-print .ledger-meta-grid span {
        border-color: #c7d5ce;
        padding: 1.2pt 2pt;
    }

    .term-ledger-print .official-doc-footer {
        border-color: #8ca195;
        color: #303c35;
        font-size: 5.8pt;
        line-height: 1;
        margin-top: 1.8mm;
        padding-top: 1.5mm;
    }

    .weekly-ledger-document {
        border: 1.2pt solid #164734;
        color: #111813;
        font-family: "Times New Roman", Times, serif;
        padding: 3mm;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .weekly-ledger-print .official-doc-header {
        border-bottom: 1.2pt solid #164734;
        gap: 3mm;
        grid-template-columns: 14mm minmax(0, 1fr);
        margin-bottom: 2mm;
        padding-bottom: 2mm;
    }

    .weekly-ledger-print .school-logo-wrap {
        border-width: 1.2pt;
        height: 11mm;
        width: 11mm;
    }

    .weekly-ledger-print .official-doc-header h2 {
        font-size: 13pt;
        line-height: 1.02;
    }

    .weekly-ledger-print .official-doc-header h3 {
        color: #164734;
        font-size: 8.2pt;
        line-height: 1.05;
        margin-top: .8mm;
    }

    .weekly-ledger-print .official-doc-header p,
    .weekly-ledger-print .official-doc-header strong {
        font-size: 8pt;
        line-height: 1.05;
    }

    .weekly-ledger-print .ledger-meta-grid {
        font-size: 6.8pt;
        margin-bottom: 2mm;
    }

    .weekly-ledger-print .ledger-meta-grid span {
        padding: 1.4pt 2pt;
    }

    .weekly-ledger-table {
        border-collapse: collapse;
        margin: 0;
        table-layout: fixed;
        width: 100%;
    }

    .weekly-ledger-table th,
    .weekly-ledger-table td {
        border-color: #5d7066 !important;
        border-width: .45pt !important;
        color: #111813;
        font-size: 7pt;
        line-height: 1.05;
        min-width: 0;
        overflow-wrap: anywhere;
        padding: 1.5pt 1.8pt !important;
        white-space: normal;
    }

    .weekly-ledger-table thead th {
        background: #e8f1ec;
        color: #123c2b;
        font-size: 6.4pt;
        font-weight: 800;
        text-align: center;
    }

    .weekly-ledger-table th:nth-child(3),
    .weekly-ledger-table td:nth-child(3) {
        min-width: 0 !important;
        text-align: left;
        width: 15%;
    }

    .weekly-ledger-table .badge {
        background: transparent !important;
        border: 0 !important;
        color: inherit !important;
        display: inline;
        font-size: inherit;
        padding: 0;
    }

    .weekly-ledger-print .official-doc-footer {
        font-size: 6pt;
        margin-top: 2mm;
        padding-top: 1.5mm;
    }

    .term-report-card {
        border: 1px solid #164734;
        box-shadow: none;
        color: #111813;
        font-family: "Times New Roman", Times, serif;
        font-size: 11pt;
        line-height: 1.18;
        margin: 0;
        max-width: none;
        min-height: auto;
        page-break-after: always;
        padding: 7mm 8mm;
    }

    .grade-sheet-header {
        gap: 4mm;
        grid-template-columns: 18mm minmax(0, 1fr) 18mm;
        margin-bottom: 4mm;
    }

    .grade-sheet-logo {
        height: 16mm;
        width: 16mm;
    }

    .grade-sheet-title h2 {
        color: #164734;
        font-size: 16pt;
        line-height: 1.05;
    }

    .grade-sheet-title h3 {
        color: #8f1f24;
        font-size: 14pt;
        font-weight: 800;
        line-height: 1.05;
        margin-top: 3mm;
    }

    .grade-sheet-title h4 {
        color: #164734;
        font-size: 12pt;
        font-weight: 800;
        line-height: 1.08;
    }

    .grade-sheet-title p,
    .grade-sheet-info,
    .grade-sheet-summary,
    .grade-sheet-remark,
    .grade-sheet-signatures,
    .grade-sheet-issue {
        font-size: 11pt;
    }

    .grade-sheet-info,
    .grade-sheet-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.8mm 7mm;
        margin-bottom: 3mm;
    }

    .grade-sheet-info div,
    .grade-sheet-summary div {
        grid-template-columns: 31mm minmax(0, 1fr);
    }

    .grade-sheet-info strong,
    .grade-sheet-summary strong {
        font-size: 10pt;
    }

    .report-marks-table th,
    .report-marks-table td {
        font-size: 10.5pt;
        line-height: 1.12;
        padding: 2.2pt 3pt;
    }

    .report-marks-table thead th {
        background: #edf5ef;
        color: #164734;
        font-size: 10pt;
        font-weight: 800;
    }

    .report-marks-table th:nth-child(2),
    .report-marks-table td:nth-child(2) {
        min-width: 0;
    }

    .report-summary-grid,
    .student-info-grid {
        font-size: 11pt;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 4mm;
    }

    .grade-sheet-summary-compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .grade-sheet-summary-compact div {
        grid-template-columns: 21mm minmax(0, 1fr);
        padding: 2.5pt 3.5pt;
    }

    .grade-sheet-remark {
        margin: 3.5mm 0;
    }

    .grade-sheet-signatures {
        margin-top: 18mm;
    }

    .grade-sheet-issue {
        margin-top: 5mm;
    }

    .print-only {
        display: block;
    }
}
