:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 75px;
    --topbar-height: 70px;

    --primary-color: #405189;
    --primary-hover: #344576;

    --body-bg: #f5f7fb;
    --card-bg: #ffffff;

    --text-primary: #212529;
    --text-secondary: #74788d;

    --border-color: #e9ebec;
}

body {
    background-color: var(--body-bg);
    color: var(--text-primary);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* =========================
   Application Wrapper
========================= */

.app-wrapper {
    min-height: 100vh;
}

/* =========================
   Sidebar
========================= */

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: all .25s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-logo a {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
}

/* Scrollable sidebar menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 12px 30px;
}

/* Sidebar scrollbar */
.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #d9dce3;
    border-radius: 10px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #bfc3cd;
}

/* Firefox */
.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: #d9dce3 transparent;
}

.sidebar-title {
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #9aa0ac;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    margin-bottom: 4px;
    color: #555b6d;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-link:hover {
    background: #f3f5f9;
    color: var(--primary-color);
}

.sidebar-link.active {
    background: rgba(64, 81, 137, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-link i {
    font-size: 18px;
}

/* =========================
   Main Content
========================= */

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.25s ease;
}

/* =========================
   Navbar
========================= */

.app-navbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.menu-toggle {
    border: 0;
    background: transparent;
    font-size: 22px;
    color: #555b6d;
}

/* =========================
   Page Content
========================= */

.page-content {
    padding: 28px;
}

/* =========================
   Cards
========================= */

.dashboard-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    transition: all 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

/* =========================
   Responsive
========================= */

@media (max-width: 991.98px) {

    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .page-content {
        padding: 20px;
    }

    
}

/* =========================
   Action Menu
========================= */

/* =========================
   Custom Action Dropdown
========================= */

.action-menu-wrapper {
    position: relative;
    display: inline-block;
}

.action-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 190px;

    background: #ffffff;
    border: 1px solid #e9ebec;
    border-radius: 10px;

    padding: 6px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);

    z-index: 9999;

    display: none;
}

.action-menu.is-open {
    display: block;
}

.action-menu-button {
    border: 0;
    background: #f8f9fa;

    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    color: #555b6d;

    cursor: pointer;
}

.action-menu-button:hover {
    background: #eef0f4;
    color: var(--primary-color);
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;

    width: 100%;

    padding: 9px 10px;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: #555b6d;

    font-size: 14px;

    text-align: left;

    cursor: pointer;

    text-decoration: none;
}

.action-menu-item:hover {
    background: #f5f7fb;
    color: var(--primary-color);
}

.action-menu-item.danger {
    color: #dc3545;
}

.action-menu-item.danger:hover {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

.action-menu-divider {
    height: 1px;
    background: #e9ebec;
    margin: 5px 0;
}

.student-registration-modal-body {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
}

.student-registration-modal-body::-webkit-scrollbar {
    width: 6px;
}

.student-registration-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.student-registration-modal-body::-webkit-scrollbar-thumb {
    background: #cfd3dc;
    border-radius: 10px;
}

.student-registration-modal-body::-webkit-scrollbar-thumb:hover {
    background: #adb3c0;
}

/* =========================================
   STUDENT PROFILE
========================================= */

.student-profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 14px;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    overflow: hidden;
}

.student-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    background: #f5f7fb;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    color: #555b6d;
    font-size: 13px;
}

.profile-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    overflow-x: auto;
}

.profile-tab {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 8px;
    color: #74788d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all .2s ease;
}

.profile-tab:hover {
    background: #f5f7fb;
    color: var(--primary-color);
}

.profile-tab.active {
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    font-weight: 600;
}

.profile-tab.disabled {
    opacity: .45;
    pointer-events: none;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.section-heading > i {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .08);
    color: var(--primary-color);
    border-radius: 8px;
    font-size: 18px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profile-field span {
    font-size: 12px;
    color: #9aa0ac;
    font-weight: 500;
}

.profile-field strong {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.academic-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fb;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.academic-profile-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    font-size: 20px;
}

.academic-profile-card span {
    display: block;
    color: #9aa0ac;
    font-size: 12px;
    margin-bottom: 2px;
}

.academic-profile-card strong {
    display: block;
    font-size: 15px;
}

.guardian-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #9aa0ac;
}

.empty-state i {
    display: block;
    font-size: 34px;
    margin-bottom: 10px;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

.profile-module-card {
    padding: 24px;
    text-align: center;
    height: 100%;
}

.profile-module-card > i {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .08);
    color: var(--primary-color);
    border-radius: 10px;
    font-size: 21px;
    margin-bottom: 14px;
}

.profile-module-card h6 {
    margin-bottom: 7px;
    font-size: 15px;
}

.profile-module-card p {
    color: #74788d;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.profile-module-card span {
    font-size: 11px;
    color: #9aa0ac;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
}

.guardian-search-results {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.guardian-search-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: all .2s ease;
}

.guardian-search-item:last-child {
    border-bottom: 0;
}

.guardian-search-item:hover {
    background: #f7f8fb;
}

.guardian-search-item > i {
    color: var(--primary-color);
    font-size: 18px;
}

.new-guardian-box {
    padding: 20px;
    background: #f8f9fb;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.selected-guardian-card {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
}

/* =========================================
   STUDENT PROMOTION
========================================= */

.promotion-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.promotion-step-number {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.promotion-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(64, 81, 137, .15);
    background: rgba(64, 81, 137, .04);
    border-radius: 10px;
}

.promotion-summary-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    border-radius: 9px;
    font-size: 19px;
}

.promotion-summary strong {
    display: block;
    font-size: 14px;
    margin-bottom: 3px;
}

.promotion-summary span {
    display: block;
    color: #74788d;
    font-size: 13px;
}

/* =========================================
   CLASS ROSTER
========================================= */

.roster-summary-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    border-radius: 9px;
    font-size: 20px;
    margin-bottom: 14px;
}

.roster-summary-label {
    display: block;
    color: #9aa0ac;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

.attendance-status-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.attendance-status-btn {
    border: 1px solid var(--border-color);
    background: #fff;
    color: #74788d;
    padding: 6px 9px;
    border-radius: 6px;
    font-size: 12px;
    transition: all .2s ease;
}

.attendance-status-btn:hover {
    background: #f5f7fb;
}

.attendance-status-btn.present.active {
    background: rgba(25, 135, 84, .10);
    border-color: rgba(25, 135, 84, .25);
    color: #198754;
}

.attendance-status-btn.absent.active {
    background: rgba(220, 53, 69, .10);
    border-color: rgba(220, 53, 69, .25);
    color: #dc3545;
}

.attendance-status-btn.late.active {
    background: rgba(255, 193, 7, .12);
    border-color: rgba(255, 193, 7, .30);
    color: #997404;
}

.attendance-status-btn.excused.active {
    background: rgba(13, 110, 253, .10);
    border-color: rgba(13, 110, 253, .25);
    color: #0d6efd;
}

.student-list-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

/* =========================================================
   REPORT CARD
========================================================= */

.report-card-generator-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(64, 81, 137, .1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}


/* A4 document */

.report-card {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 12mm;
    background: #fff;
    color: #212529;
    font-family: Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}


/* Header */

.report-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    text-align: center;
    border-bottom: 2px solid #212529;
    padding-bottom: 12px;
}

.report-school-logo {
    width: 85px;
    height: 85px;
    object-fit: contain;
    flex-shrink: 0;
}

.report-school-details {
    flex: 1;
}

.report-school-details h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    text-transform: uppercase;
}

.report-school-motto {
    font-style: italic;
    font-size: 12px;
    margin-top: 3px;
}

.report-school-details > div {
    font-size: 11px;
    margin-top: 3px;
}

.report-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}


/* Title */

.report-card-title {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 14px 0;
}


/* Meta */

.report-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #212529;
    margin-bottom: 12px;
}

.report-meta-grid > div {
    padding: 8px 10px;
    border-right: 1px solid #212529;
}

.report-meta-grid > div:last-child {
    border-right: 0;
}

.report-meta-grid span,
.student-report-grid span,
.report-summary-grid span,
.attendance-report-grid span {
    display: block;
    font-size: 9px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 2px;
}

.report-meta-grid strong,
.student-report-grid strong,
.report-summary-grid strong,
.attendance-report-grid strong {
    display: block;
    font-size: 11px;
}


/* Sections */

.report-section {
    margin-top: 12px;
}

.report-section-title {
    background: #f1f3f5;
    border: 1px solid #212529;
    border-bottom: 0;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}


/* Student */

.student-report-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #212529;
}

.student-report-grid > div {
    padding: 7px 9px;
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.student-report-grid > div:nth-child(3n) {
    border-right: 0;
}


/* Results */

.report-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.report-results-table th {
    background: #f1f3f5;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 9px;
}

.report-results-table th,
.report-results-table td {
    border: 1px solid #212529;
    padding: 6px 7px;
    vertical-align: middle;
}

.report-results-table td:first-child,
.report-results-table th:first-child,
.report-results-table td:nth-child(n+3),
.report-results-table th:nth-child(n+3) {
    text-align: center;
}

.report-results-table td small {
    display: block;
    color: #6c757d;
    font-size: 8px;
    margin-top: 1px;
}


/* Summary */

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #212529;
    margin-top: 12px;
}

.report-summary-grid > div {
    padding: 8px 9px;
    border-right: 1px solid #212529;
}

.report-summary-grid > div:last-child {
    border-right: 0;
}


/* Attendance */

.attendance-report-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border: 1px solid #212529;
}

.attendance-report-grid > div {
    padding: 8px;
    text-align: center;
    border-right: 1px solid #212529;
}

.attendance-report-grid > div:last-child {
    border-right: 0;
}


/* Remarks */

.remark-box {
    border: 1px solid #212529;
    border-top: 0;
    padding: 8px 10px 10px;
}

.remark-label {
    font-size: 10px;
    font-weight: 700;
    margin-bottom: 7px;
}

.remark-line {
    height: 18px;
    border-bottom: 1px solid #adb5bd;
}


/* Signatures */

.report-signatures {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    margin-top: 35px;
}

.report-signatures > div {
    text-align: center;
}

.signature-line {
    height: 25px;
    border-bottom: 1px solid #212529;
    margin-bottom: 5px;
}

.report-signatures span {
    font-size: 9px;
    color: #495057;
}


/* Footer */

.report-card-footer {
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
    padding-top: 8px;
    text-align: center;
    font-size: 9px;
    color: #6c757d;
}


/* Print */

@media print {

    @page {
        size: A4 portrait;
        margin: 0;
    }

    html,
    body {
        width: 210mm;
        min-height: 297mm;
        background: #fff !important;
    }

    body {
        margin: 0 !important;
    }

    .app-sidebar,
    .app-navbar,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .report-card {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 12mm;
        box-shadow: none !important;
    }

    .report-section,
    .report-results-table,
    .report-summary-grid,
    .attendance-report-grid,
    .report-signatures {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-results-table {
        page-break-inside: auto;
    }

    .report-results-table tr {
        page-break-inside: avoid;
    }
}

.saved-remark {
    min-height: 32px;
    padding: 4px 0;
    font-size: 10px;
    line-height: 1.5;
}

/* =========================================================
   TIMETABLE
   ========================================================= */

.timetable-card {
    overflow: hidden;
}

.timetable-scroll {
    overflow-x: auto;
}

.timetable-grid {
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
}

.timetable-grid th,
.timetable-grid td {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.timetable-grid thead th {
    background: #f8f9fb;
    color: #555b6d;
    font-size: 13px;
    font-weight: 600;
    padding: 14px 12px;
    text-align: center;
    white-space: nowrap;
}

.timetable-time-column {
    width: 150px;
    min-width: 150px;
    text-align: left !important;
}

.timetable-day-column {
    width: 180px;
    min-width: 180px;
}

.timetable-time-cell {
    background: #fafbfc;
    vertical-align: middle;
    padding: 14px 12px !important;
    color: #555b6d;
}

.timetable-time-cell small {
    display: block;
    margin-top: 4px;
    color: #9aa0ac;
    font-size: 11px;
}

.timetable-slot {
    position: relative;
    min-width: 180px;
    height: 105px;
    padding: 8px !important;
    vertical-align: middle;
    background: #fff;
}

.timetable-slot:hover {
    background: #fafbfe;
}

.timetable-entry {
    position: relative;
    height: 100%;
    min-height: 88px;
    padding: 12px;
    border-radius: 9px;
    background: rgba(64, 81, 137, .08);
    border-left: 3px solid var(--primary-color);
}

.timetable-entry-subject {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    padding-right: 35px;
}

.timetable-entry-teacher,
.timetable-entry-room {
    color: #74788d;
    font-size: 11px;
    margin-top: 6px;
}

.timetable-entry-actions {
    position: absolute;
    top: 7px;
    right: 7px;
    display: flex;
    gap: 3px;
}

.timetable-action-btn {
    width: 25px;
    height: 25px;
    border: 0;
    border-radius: 5px;
    background: rgba(255, 255, 255, .8);
    color: #74788d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}

.timetable-action-btn:hover {
    background: #fff;
    color: var(--primary-color);
}

.timetable-action-btn.danger:hover {
    color: #dc3545;
}

.timetable-empty-slot {
    width: 100%;
    height: 88px;
    border: 1px dashed #dfe2e8;
    border-radius: 9px;
    background: transparent;
    color: #a0a5b1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: all .2s ease;
}

.timetable-empty-slot i {
    font-size: 18px;
}

.timetable-empty-slot span {
    font-size: 11px;
}

.timetable-empty-slot:hover {
    border-color: var(--primary-color);
    background: rgba(64, 81, 137, .04);
    color: var(--primary-color);
}

.timetable-break-slot {
    background: #fffaf0 !important;
}

.timetable-break {
    min-height: 88px;
    border-radius: 9px;
    background: #fff7df;
    color: #a2761d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
}

.timetable-break i {
    font-size: 19px;
}

.timetable-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 14px;
    background: rgba(64, 81, 137, .08);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

@media print {

    .app-sidebar,
    .app-navbar,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .timetable-card {
        border: 0 !important;
        box-shadow: none !important;
    }

    .timetable-card .card-header {
        border: 0 !important;
    }

    .timetable-grid {
        min-width: 100%;
    }

    .timetable-action-btn,
    .timetable-empty-slot {
        display: none !important;
    }

    .timetable-entry {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .timetable-break {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* =========================================================
   STUDENT FEE ALLOCATION
   ========================================================= */

.student-fee-allocation-table {
    min-width: 1150px;
}

.student-fee-allocation-table thead th {
    background: #f8f9fb;
    color: #555b6d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 14px 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.student-fee-allocation-table tbody td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-color);
    color: #555b6d;
    font-size: 14px;
}

.student-fee-allocation-table tbody tr:last-child td {
    border-bottom: 0;
}

.student-fee-allocation-table tbody tr:hover {
    background: #fafbfc;
}

.student-fee-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
}

.student-fee-modal-body {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
}

.student-fee-net-amount {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 7px;
    background: rgba(64, 81, 137, .08);
    color: var(--primary-color);
    font-weight: 700;
}

.student-fee-empty-state {
    padding: 20px;
}

.student-fee-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 14px;
    background: rgba(64, 81, 137, .08);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}


/* Bulk Student Selection */

.student-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 16px;
    background: #f8f9fb;
    border: 1px solid var(--border-color);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
}

.bulk-student-list {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0 0 9px 9px;
}

.bulk-student-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all .15s ease;
}

.bulk-student-item:last-child {
    border-bottom: 0;
}

.bulk-student-item:hover {
    background: #f8f9fb;
}

.bulk-student-item .form-check-input {
    margin: 0;
    cursor: pointer;
}

.bulk-student-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f6;
    color: #555b6d;
    font-size: 12px;
    font-weight: 700;
}

.selected-student-check {
    opacity: 0;
    transition: opacity .15s ease;
}

.bulk-student-item:has(input:checked) {
    background: rgba(64, 81, 137, .04);
}

.bulk-student-item:has(input:checked) .selected-student-check {
    opacity: 1;
}

@media (max-width: 767.98px) {

    .student-selection-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .student-fee-modal-body {
        padding: 18px;
    }

}

/* =========================================================
   STUDENT FEE PAYMENTS
   ========================================================= */

.student-fee-payment-table {
    min-width: 1150px;
}

.student-fee-payment-table thead th {
    background: #f8f9fb;
    color: #555b6d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 14px 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.student-fee-payment-table tbody td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-color);
    color: #555b6d;
    font-size: 14px;
}

.student-fee-payment-table tbody tr:last-child td {
    border-bottom: 0;
}

.student-fee-payment-table tbody tr:hover {
    background: #fafbfc;
}

.payment-receipt-number {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.payment-allocation-summary {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fafbfc;
    padding: 16px;
}

.payment-summary-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.payment-summary-box {
    padding: 11px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.payment-summary-box span {
    display: block;
    color: #74788d;
    font-size: 11px;
    margin-bottom: 4px;
}

.payment-summary-box strong {
    font-size: 14px;
}

@media (max-width: 767.98px) {

    .payment-summary-header {
        flex-direction: column;
        gap: 10px;
    }

}

/* =========================================================
   A4 FEE RECEIPT
   ========================================================= */

.receipt-page-wrapper {
    width: 100%;
}

.receipt-a4 {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 14mm;
    background: #fff;
    box-shadow: 0 5px 25px rgba(0, 0, 0, .08);
    color: #212529;
}


/* School Header */

.receipt-school-header {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-bottom: 18px;
    border-bottom: 2px solid var(--primary-color);
}

.receipt-school-logo {
    width: 90px;
    min-width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.receipt-school-logo img {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.receipt-logo-placeholder {
    width: 75px;
    height: 75px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f6;
    color: var(--primary-color);
    font-size: 32px;
}

.receipt-school-details {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #555b6d;
    line-height: 1.6;
}

.receipt-school-details h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.receipt-motto {
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
    margin-bottom: 2px;
}

.receipt-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}


/* Title */

.receipt-title-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 22px 0;
}

.receipt-title-line {
    flex: 1;
    height: 1px;
    background: #dfe2e6;
}

.receipt-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: .08em;
    white-space: nowrap;
}


/* Labels */

.receipt-label {
    display: block;
    color: #74788d;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 3px;
}


/* Meta */

.receipt-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 15px;
    background: #f8f9fb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.receipt-meta-grid strong {
    font-size: 12px;
}


/* Sections */

.receipt-section {
    margin-top: 20px;
}

.receipt-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 10px;
}


/* Student */

.receipt-student-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 25px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.receipt-student-grid strong,
.receipt-transaction-grid strong {
    font-size: 13px;
}


/* Details Table */

.receipt-details-table {
    width: 100%;
    border-collapse: collapse;
}

.receipt-details-table th {
    background: #f8f9fb;
    color: #555b6d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 11px 13px;
    border: 1px solid var(--border-color);
}

.receipt-details-table td {
    padding: 13px;
    border: 1px solid var(--border-color);
    font-size: 13px;
}


/* Payment Summary */

.receipt-payment-summary {
    margin-top: 20px;
    margin-left: auto;
    width: 55%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.receipt-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 14px;
    font-size: 12px;
    border-bottom: 1px solid var(--border-color);
}

.receipt-summary-row:last-child {
    border-bottom: 0;
}

.receipt-summary-row.current-payment {
    background: rgba(64, 81, 137, .06);
    color: var(--primary-color);
}

.receipt-summary-row.total-paid {
    font-weight: 700;
}

.receipt-summary-row.balance {
    background: #f8f9fb;
    font-size: 13px;
    font-weight: 700;
}

.receipt-summary-row.balance strong {
    color: #dc3545;
}


/* Transaction */

.receipt-transaction-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}


/* Amount Words */

.receipt-amount-words {
    margin-top: 20px;
    padding: 14px;
    border: 1px dashed #cfd3da;
    border-radius: 8px;
}

.receipt-amount-words > strong {
    font-size: 15px;
    margin-left: 10px;
}


/* Footer */

.receipt-footer {
    margin-top: 45px;
}

.receipt-footer-note {
    text-align: center;
    color: #74788d;
    font-size: 11px;
    margin-bottom: 45px;
}

.receipt-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

.receipt-signature {
    text-align: center;
}

.signature-line {
    height: 1px;
    background: #343a40;
    margin-bottom: 7px;
}

.receipt-signature span {
    display: block;
    color: #74788d;
    font-size: 10px;
}

.receipt-signature strong {
    display: block;
    margin-top: 3px;
    font-size: 11px;
}


/* Receipt List */

.receipt-table {
    min-width: 1100px;
}

.receipt-table thead th {
    background: #f8f9fb;
    color: #555b6d;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 14px 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.receipt-table tbody td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-color);
    color: #555b6d;
    font-size: 14px;
}

.receipt-table tbody tr:last-child td {
    border-bottom: 0;
}

.receipt-table tbody tr:hover {
    background: #fafbfc;
}

.receipt-number {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.receipt-avatar {
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .10);
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
}

.receipt-empty-state {
    padding: 35px 20px;
}

.receipt-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 14px;
    background: rgba(64, 81, 137, .08);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}


/* Print */

@media print {

    @page {
        size: A4 portrait;
        margin: 0;
    }

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

    .app-sidebar,
    .app-navbar,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .receipt-page-wrapper {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .receipt-a4 {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 14mm;
        box-shadow: none !important;
    }
}

.receipt-item-note {
    margin-top: 4px;
    color: #74788d;
    font-size: 10px;
}

.receipt-details-table tfoot td {
    background: #f8f9fb;
    padding: 11px 13px;
    border: 1px solid var(--border-color);
    font-size: 12px;
}

.receipt-words {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e9ebec;
    color: #555b6d;
    font-size: 12px;
    font-style: italic;
    text-transform: capitalize;
}

/* =========================================================
   STUDENT FEE STATEMENT
   ========================================================= */

.student-statement-empty {
    padding: 60px 20px;
    text-align: center;
}

.student-statement-empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 81, 137, .08);
    color: var(--primary-color);
    font-size: 30px;
}

.student-statement-print-area {
    background: #fff;
    padding: 28px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.student-statement-school-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.student-statement-school-header h2 {
    margin: 0 0 5px;
    color: var(--primary-color);
    font-size: 22px;
    font-weight: 700;
}

.student-statement-title {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .06em;
    white-space: nowrap;
}

.student-statement-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 18px;
    margin: 20px 0;
    background: #f8f9fb;
    border: 1px solid var(--border-color);
    border-radius: 9px;
}

.student-statement-info span,
.student-statement-summary-card span {
    display: block;
    color: #74788d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.student-statement-info strong {
    font-size: 13px;
}

.student-statement-summary-card {
    height: 100%;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 9px;
}

.student-statement-summary-card strong {
    display: block;
    color: var(--primary-color);
    font-size: 17px;
}

.student-statement-summary-card.paid strong {
    color: #198754;
}

.student-statement-summary-card.balance strong {
    color: #dc3545;
}

.student-statement-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.student-statement-section-header h6 {
    font-weight: 600;
}

.student-statement-table {
    min-width: 900px;
}

.student-statement-table thead th {
    background: #f8f9fb;
    color: #555b6d;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 12px 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.student-statement-table tbody td {
    padding: 13px 14px;
    color: #555b6d;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.student-statement-table tbody tr:last-child td {
    border-bottom: 0;
}

.statement-receipt-number {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
}

.student-statement-final-balance {
    display: flex;
    justify-content: flex-end;
    gap: 45px;
    margin-top: 20px;
    padding: 18px;
    background: #f8f9fb;
    border: 1px solid var(--border-color);
    border-radius: 9px;
}

.student-statement-final-balance span {
    display: block;
    color: #74788d;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.student-statement-final-balance strong {
    display: block;
    margin-top: 4px;
    font-size: 17px;
    color: var(--primary-color);
}

.student-statement-final-balance > div:last-child strong {
    color: #dc3545;
}

.student-statement-footer {
    margin-top: 35px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #74788d;
    font-size: 10px;
}


/* Responsive */

@media (max-width: 767.98px) {

    .student-statement-print-area {
        padding: 18px;
    }

    .student-statement-school-header {
        flex-direction: column;
    }

    .student-statement-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .student-statement-final-balance {
        flex-direction: column;
        gap: 15px;
    }

}


/* Print */

@media print {

    @page {
        size: A4 portrait;
        margin: 10mm;
    }

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

    .app-sidebar,
    .app-navbar,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .student-statement-print-area {
        border: 0 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .student-statement-school-header {
        page-break-inside: avoid;
    }

    .student-statement-info {
        page-break-inside: avoid;
    }

    .student-statement-summary-card {
        page-break-inside: avoid;
    }

    .student-statement-section-header {
        page-break-after: avoid;
    }

    .student-statement-table {
        width: 100%;
    }

    .student-statement-table tr {
        page-break-inside: avoid;
    }

    .dashboard-card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    .student-statement-footer {
        margin-top: 20px;
    }

}

/* =========================================================
   Roles & Permissions
   ========================================================= */

.role-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: rgba(64, 81, 137, 0.10);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.permission-group-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
}

.permission-group-header {
    padding: 13px 14px;
    background: #f8f9fb;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.permission-module-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(64, 81, 137, 0.10);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 9px;
}

.permission-list {
    padding: 8px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border-radius: 7px;
    cursor: pointer;
    color: #555b6d;
    font-size: 14px;
    transition: background .15s ease;
}

.permission-item:hover {
    background: #f5f7fb;
}

.permission-item .form-check-input {
    margin: 0;
    cursor: pointer;
}

.permission-item .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* =========================================================
   Users
   ========================================================= */

.user-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: rgba(64, 81, 137, 0.10);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
}

.user-role-info {
    padding: 14px 16px;
    background: #f8f9fb;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.user-role-info-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 9px;
    background: rgba(64, 81, 137, 0.10);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* Reports module */

.report-category-card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    transition: all .2s ease;
}

button.report-category-card {
    cursor: pointer;
}

.report-category-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(64, 81, 137, .08);
}

.report-category-card.disabled {
    opacity: .7;
}

.report-category-icon,
.report-summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.report-print-header {
    background: #fff;
}

.report-signatures {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    font-size: 12px;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    body {
        background: #fff !important;
        font-size: 10px;
    }

    .app-sidebar,
    .app-navbar,
    .no-print,
    .report-category-card,
    .report-category-icon,
    .report-summary-icon {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .dashboard-card {
        border: none !important;
        box-shadow: none !important;
    }

    .report-print-area {
        width: 100%;
    }

    .report-table {
        font-size: 9px;
    }

    .report-table th,
    .report-table td {
        padding: 5px !important;
        border: 1px solid #ddd !important;
    }

    .report-print-header {
        padding: 0 0 12px !important;
    }

    .report-signatures {
        margin-top: 25px;
    }
}
