:root {
    --primary: #0F172A;
    --secondary: #2563EB;
    --success: #16A34A;
    --warning: #F59E0B;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --muted: #64748B;
    --line: #E2E8F0;
}

* { letter-spacing: 0; }
body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--primary);
}

.app-navbar {
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(226,232,240,.8);
    backdrop-filter: blur(18px);
    min-height: 61px;
    padding-top: 0;
    padding-bottom: 0;
}
.app-navbar .container-fluid {
    min-height: 61px;
    align-items: center;
}
.app-navbar .navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
}
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}
.app-logo {
    display: block;
    width: auto;
    max-width: 300px;
    max-height: 48px;
    object-fit: contain;
}

.app-logo--navbar {
    max-height: 48px;
    max-width: 300px;
}
.app-logo--auth {
    max-height: 90px;
    margin-bottom: 14px;
}
.app-logo--receipt {
    max-height: 80px;
}
.app-logo--print {
    max-height: 80px;
}
.camera-preview {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #111827;
}
.app-shell { display: block; min-height: calc(100vh - 61px); }
.app-sidebar {
    --bs-offcanvas-bg: #0F172A;
    --bs-offcanvas-color: #fff;
    width: 270px;
    position: fixed !important;
    top: 61px;
    bottom: 0;
    left: 0;
    z-index: 1020;
    height: calc(100vh - 61px);
    min-height: calc(100vh - 61px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: #0F172A !important;
    background-color: #0F172A !important;
    color: #fff;
    border-right: 0;
}
.app-sidebar .offcanvas-header,
.app-sidebar .offcanvas-body {
    background: #0F172A !important;
    background-color: #0F172A !important;
    color: #fff;
}
.app-sidebar .offcanvas-body {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    gap: 6px;
    overflow-y: auto;
}
.app-sidebar .nav-link {
    color: rgba(255,255,255,.72);
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 600;
    transition: .18s ease;
}
.app-sidebar .nav-link i { width: 26px; }
.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
    color: #fff;
    background: rgba(37,99,235,.9);
    transform: translateX(3px);
}
.app-main { min-height: calc(100vh - 61px); margin-left: 270px; padding: 26px; overflow-x: hidden; }
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}
.breadcrumb { margin: 0; font-size: .9rem; }
.card-pro {
    background: var(--card);
    border: 1px solid rgba(226,232,240,.85);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15,23,42,.06);
}
.metric-card {
    padding: 18px;
    position: relative;
    overflow: hidden;
}
.metric-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(37,99,235,.1);
    color: var(--secondary);
}
.metric-value { font-size: clamp(1.25rem, 2vw, 1.9rem); font-weight: 800; margin: 12px 0 2px; }
.metric-label { color: var(--muted); font-weight: 600; font-size: .9rem; }
.dashboard-analytics-grid > [class*="col-"] { display: flex; }
.dashboard-chart-card {
    width: 100%;
    min-height: 340px;
    display: flex;
    flex-direction: column;
}
.dashboard-overview-card { min-height: 380px; }
.dashboard-chart-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 250px;
}
@media (max-width: 1199.98px) {
    .dashboard-chart-card { min-height: 320px; }
    .dashboard-overview-card { min-height: 350px; }
}
.btn-primary { --bs-btn-bg: var(--secondary); --bs-btn-border-color: var(--secondary); }
.btn-success { --bs-btn-bg: var(--success); --bs-btn-border-color: var(--success); }
.btn-icon {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}
.table { vertical-align: middle; }
.table thead th {
    color: var(--muted);
    font-size: .78rem;
    text-transform: uppercase;
    background: #F8FAFC;
}
.form-control, .form-select { border-radius: 12px; min-height: 44px; }
.form-control:focus, .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 .2rem rgba(37,99,235,.12);
}
.de-student-admission-form {
    padding: 24px 25px !important;
}
.de-student-admission-form .row {
    --bs-gutter-x: 16px;
    --bs-gutter-y: 18px;
}
.de-student-admission-form .form-label {
    display: block;
    min-height: 22px;
    margin-bottom: 8px;
    color: #020617;
    font-weight: 500;
    line-height: 1.25;
}
.de-student-admission-form .form-control,
.de-student-admission-form .form-select {
    width: 100%;
    min-height: 44px;
    height: 44px;
    padding: 9px 13px;
    border-radius: 12px;
}
.de-student-admission-form textarea.form-control {
    height: auto;
    min-height: 86px;
    resize: vertical;
}
.de-student-admission-form input[type="file"].form-control {
    padding: 8px 12px;
    line-height: 1.45;
}
.de-student-admission-form .form-text {
    min-height: 20px;
    margin-top: 7px;
    color: #475569;
    line-height: 1.35;
}
.phone-number-fields {
    display: flex !important;
    flex-wrap: wrap;
    width: 100%;
    align-items: start;
}
.phone-number-fields .form-control,
.phone-number-fields .form-select {
    min-width: 0;
}
.de-student-admission-form .phone-number-fields .form-select {
    flex: 0 0 112px;
    width: 112px !important;
    border-radius: 12px 0 0 12px;
}
.de-student-admission-form .phone-number-fields .form-control {
    flex: 1 1 0;
    width: auto !important;
    border-radius: 0 12px 12px 0;
    margin-left: -1px;
}
.phone-validation-message {
    flex-basis: 100%;
    margin-top: -2px;
}
.de-student-admission-form .col-md-6,
.de-student-admission-form .col-md-4,
.de-student-admission-form .col-md-3,
.de-student-admission-form .col-xl-3,
.de-student-admission-form .col-12 {
    display: flex;
    flex-direction: column;
}
@media (max-width: 575.98px) {
    .de-student-admission-form .phone-number-fields .form-select { flex-basis: 96px; width: 96px !important; }
}
.global-search { position: relative; width: min(470px, 40vw); }
.global-search i { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.global-search input { padding-left: 40px; background: #F8FAFC; }
.search-results {
    position: fixed;
    top: 66px;
    right: 110px;
    width: min(520px, calc(100vw - 30px));
    z-index: 1040;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}
.search-results a { display: block; padding: 13px 16px; color: var(--primary); text-decoration: none; border-bottom: 1px solid var(--line); }
.search-results a:hover { background: #F8FAFC; }
.user-chip { border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 700; }
.sidebar-note {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    display: grid;
    gap: 2px;
    color: rgba(255,255,255,.8);
}
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(248,250,252,.65);
    backdrop-filter: blur(3px);
    place-items: center;
}
.loader-overlay:not(.d-none) { display: grid !important; }
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(37,99,235,.20), transparent 28%),
        linear-gradient(135deg, #0F172A, #111827 55%, #1E293B);
}
.auth-card {
    width: min(460px, 100%);
    padding: 30px;
    color: #0F172A;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 16px;
    box-shadow: 0 28px 70px rgba(0,0,0,.24);
    backdrop-filter: blur(18px);
}
.public-record-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15,23,42,.96), rgba(37,99,235,.78)),
        #0F172A;
}
.public-record-nav {
    background: linear-gradient(135deg, #0F172A, #1E3A8A);
    border-bottom: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(16px);
}
.public-record-nav .navbar-brand { color: #fff; }
.public-record-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.public-brand-shell {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15,23,42,.14);
}
.public-brand-shell .app-logo {
    max-width: 340px;
    max-height: 76px;
}
.public-login-btn {
    color: #fff;
    border: 1px solid rgba(255,255,255,.95);
    background: transparent;
    font-weight: 700;
}
.public-login-btn:hover,
.public-login-btn:focus {
    color: #fff;
    border-color: #fff;
    background: rgba(255,255,255,.12);
}
.public-record-shell { min-height: calc(100vh - 67px); }
.public-record-hero { padding: 54px 0; }
.public-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-weight: 700;
}
.public-record-card { overflow: hidden; }
.public-student-photo {
    width: 136px;
    height: 136px;
    object-fit: cover;
    border-radius: 16px;
    border: 4px solid #fff;
    box-shadow: 0 16px 34px rgba(15,23,42,.16);
}
.public-table-photo {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 12px;
}
.public-record-table th {
    width: 32%;
    background: #F8FAFC;
    color: #334155;
}
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; }

/* Student Management: compact desktop table with touch-friendly mobile cards. */
.student-management-table-wrap { border: 1px solid var(--line); border-radius: 12px; }
.student-management-table { margin-bottom: 0; }
.student-row-actions { flex-wrap: nowrap; }

@media (max-width: 767.98px) {
    .app-main { padding: 14px; }
    .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
    .page-head .action-bar { width: 100%; }
    .page-head .action-bar .btn { flex: 1 1 auto; }
    .student-management-card { padding: 14px !important; }
    .student-management-filters > div { width: 100%; }
    .student-management-table-wrap { overflow: visible; border: 0; }
    .student-management-table,
    .student-management-table tbody,
    .student-management-table tr,
    .student-management-table td { display: block; width: 100%; }
    .student-management-table thead { display: none; }
    .student-management-table tbody { display: grid; gap: 12px; }
    .student-management-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 14px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
    }
    .student-management-table td {
        min-width: 0;
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
    }
    .student-management-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--muted);
        font-size: .72rem;
        font-weight: 700;
        text-transform: uppercase;
    }
    .student-management-table .student-row-select,
    .student-management-table td[data-label="Course"],
    .student-management-table td[data-label="Actions"] { grid-column: 1 / -1; }
    .student-management-table .student-row-select::before { display: none; }
    .student-management-table .student-row-actions {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }
    .student-management-table .student-row-actions .btn {
        flex: 1 1 42px;
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .student-management-card .pagination { overflow-x: auto; max-width: 100%; }
}
.de-student-admission-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 0;
    width: 100%;
}
.de-student-admission-actions .btn {
    min-height: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 7px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}
.de-student-admission-actions .btn i {
    width: 15px;
    text-align: center;
    font-size: .95rem;
}
.de-student-admission-actions .btn-success {
    color: #fff;
    background: #16A34A;
    border-color: #16A34A;
}
.de-student-admission-actions .btn-outline-secondary {
    color: #64748B;
    border-color: #64748B;
    background: #fff;
}
.de-student-admission-actions .btn-outline-danger {
    color: #DC2626;
    border-color: #EF4444;
    background: #fff;
}
.de-student-admission-actions .btn-outline-dark {
    color: #0F172A;
    border-color: #0F172A;
    background: #fff;
}
.badge-soft { background: #EFF6FF; color: var(--secondary); border-radius: 999px; padding: 6px 10px; font-weight: 700; }
.de-student-upload-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #F8FAFC;
}
.de-student-upload-preview img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 12px;
}
.de-student-upload-preview span {
    display: block;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.35;
}
.de-student-file-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #FEE2E2;
    color: #DC2626;
    font-size: 1.6rem;
}
.de-student-file-icon.neutral {
    background: #E0F2FE;
    color: #0369A1;
}
.de-student-upload-empty {
    border-style: dashed;
    background: #FBFDFF;
}
.receipt-print-page {
    background: #F8FAFC;
    color: #0F172A;
}
.receipt-print-page,
.receipt-print-page .receipt-paper {
    box-sizing: border-box;
}
.receipt-paper {
    max-width: 210mm;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 24px 70px rgba(15,23,42,.10);
    padding: 14mm 12mm;
    margin: 0 auto;
}
.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0F172A;
}
.receipt-header > div:first-child {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.receipt-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
}
.receipt-header p,
.receipt-meta span,
.receipt-grid span,
.receipt-summary span,
.receipt-footer span {
    color: #64748B;
}
.receipt-contact--top {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 12px 0 8px;
    padding: 7px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #F8FAFC;
    color: #0F172A;
    font-size: .62rem;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.2;
}
.receipt-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}
.receipt-contact-item--address { justify-content: flex-start; }
.receipt-contact-item--phone { justify-content: flex-end; text-align: right; }
.receipt-contact-sep {
    color: #94A3B8;
    font-weight: 700;
    flex: 0 0 auto;
    justify-self: center;
}
.receipt-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 10px 0 14px;
}
.receipt-meta div,
.receipt-grid div,
.receipt-summary div {
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 12px 14px;
    background: #F8FAFC;
}
.receipt-meta span,
.receipt-grid span,
.receipt-summary span {
    display: block;
    margin-bottom: 4px;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
}
.receipt-section {
    margin-top: 14px;
}
.receipt-section h2 {
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 800;
}
.receipt-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.receipt-grid .span-2 {
    grid-column: span 2;
}
.receipt-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.receipt-summary strong {
    font-size: 1.15rem;
}
.receipt-total {
    background: #EFF6FF !important;
    border-color: #BFDBFE !important;
}
.receipt-total strong {
    color: #2563EB;
}
.receipt-table {
    border: 1px solid #E2E8F0;
}
.receipt-table thead th,
.receipt-table tfoot th {
    background: #F1F5F9;
}
.receipt-footer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 24px;
    margin-top: 18px;
    width: 100%;
}
.receipt-contact {
    max-width: 360px;
    font-size: .95rem;
}
.receipt-contact strong {
    display: inline-block;
    margin-bottom: 4px;
}
.receipt-contact--inline {
    max-width: none;
    white-space: nowrap;
}
.receipt-contact--inline strong,
.receipt-contact--inline span {
    display: inline;
    margin: 0;
}
.upload-option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.upload-option-group .btn {
    min-width: 148px;
}
.upload-note {
    min-height: 20px;
    margin-top: 7px;
    color: #475569;
    line-height: 1.35;
}
.signature-box {
    min-width: 220px;
    padding-top: 72px;
    border-top: 1px solid #0F172A;
    text-align: center;
    font-weight: 700;
    justify-self: end;
}
@page {
    size: A4 portrait;
    margin: 6mm;
}
@media (max-width: 991.98px) {
    .app-main { margin-left: 0; padding: 18px; }
    .app-shell { display: block; }
    .app-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        height: 100vh;
        overflow: visible;
    }
    /* Keep the opened navigation above Bootstrap's offcanvas backdrop so its links receive taps. */
    .app-sidebar.offcanvas.show,
    .app-sidebar.offcanvas.showing {
        z-index: 1055 !important;
        pointer-events: auto !important;
    }
    .offcanvas-backdrop { z-index: 1040 !important; }
    .app-sidebar .offcanvas-body { height: auto; min-height: auto; }
}
@media (max-width: 575.98px) {
    .public-record-hero { padding: 32px 0; }
    .public-record-table th,
    .public-record-table td {
        display: block;
        width: 100%;
    }
    .public-record-table th {
        border-bottom: 0;
    }
}
@media (max-width: 767.98px) {
    .receipt-meta,
    .receipt-grid,
    .receipt-summary {
        grid-template-columns: 1fr;
    }
    .receipt-grid .span-2 {
        grid-column: span 1;
    }
    .receipt-header,
    .receipt-footer {
        flex-direction: column;
    }
}
@media print {
    html, body {
        width: 210mm;
        min-height: 297mm;
        background: #fff !important;
    }
    body.receipt-print-page {
        padding: 0 !important;
        margin: 0 !important;
    }
    .app-navbar, .app-sidebar, .no-print { display: none !important; }
    .app-main { padding: 0; }
    .card-pro { box-shadow: none; border: 0; }
    .receipt-print-page { background: #fff; }
    .receipt-print-page,
    .receipt-print-page * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .receipt-paper {
        width: 100%;
        max-width: none;
        min-height: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 6mm 8mm 7mm;
        margin: 0;
        page-break-inside: avoid;
        overflow: hidden;
        font-size: 10.5px;
        line-height: 1.22;
    }
    .receipt-paper .app-logo--receipt {
        max-width: 260px;
        max-height: 64px;
    }
    .receipt-header {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }
    .receipt-header > div:first-child {
        grid-column: 2;
        justify-self: center;
        justify-content: center;
    }
    .receipt-header .btn {
        grid-column: 3;
        justify-self: end;
    }
    .receipt-meta,
    .receipt-grid,
    .receipt-summary,
    .receipt-footer {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .receipt-contact--top { display: none !important; }
    .receipt-header {
        grid-template-columns: 1fr auto 1fr;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .receipt-section {
        margin-top: 8px;
    }
    .receipt-section h2 {
        margin-bottom: 6px;
        font-size: .84rem;
    }
    .receipt-meta div,
    .receipt-grid div,
    .receipt-summary div {
        padding: 7px 9px;
    }
    .receipt-meta span,
    .receipt-grid span,
    .receipt-summary span,
    .receipt-footer span {
        margin-bottom: 2px;
        font-size: .62rem;
    }
    .receipt-meta strong,
    .receipt-grid strong,
    .receipt-summary strong,
    .receipt-footer strong {
        font-size: .92rem;
    }
    .receipt-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .receipt-summary .receipt-total {
        grid-column: span 2;
    }
    .receipt-table {
        font-size: .74rem;
        margin-bottom: 0 !important;
    }
    .receipt-table th,
    .receipt-table td {
        padding: 4px 6px;
    }
    .receipt-table thead th,
    .receipt-table tfoot th {
        font-size: .64rem;
    }
    .receipt-summary strong {
        font-size: .98rem;
    }
    .receipt-footer {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        align-items: end !important;
        margin-top: 18px;
    }
    .receipt-footer > div:first-child {
        justify-self: start;
        text-align: left;
    }
    .receipt-contact {
        max-width: none;
        font-size: .72rem;
    }
    .receipt-contact--inline {
        white-space: nowrap;
    }
    .signature-box {
        min-width: 150px;
        padding-top: 54px;
        font-size: .72rem;
        justify-self: end;
    }
    .receipt-header .btn {
        padding: 4px 8px;
        font-size: .72rem;
    }
}

/* =========================================
   COMPLETE RECEIPT SCREEN + PRINT CSS
========================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body.receipt-print-page {
    padding: 24px;
    background: #f3f6fb;
    font-family: Arial, Helvetica, sans-serif;
    color: #07162f;
}

.receipt-paper {
    width: 100%;
    max-width: 794px;
    margin: 0 auto;
    padding: 34px;
    background: #ffffff;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
}

/* Header */

.receipt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid #14213d;
}

.app-logo--receipt {
    display: block;
    width: 225px;
    max-width: 100%;
    height: auto;
}

/* Contact */

.receipt-contact {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 10px;
    padding: 6px 10px;
    font-size: 12px;
}

.receipt-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.receipt-contact-sep {
    color: #718096;
}

/* Receipt Meta */

.receipt-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.receipt-meta > div,
.receipt-grid > div,
.receipt-summary > div {
    min-width: 0;
    padding: 12px;
    background: #f7f9fc;
    border: 1px solid #d9e1ec;
    border-radius: 8px;
}

.receipt-meta span,
.receipt-grid span,
.receipt-summary span {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 700;
    color: #607086;
    text-transform: uppercase;
}

.receipt-meta strong,
.receipt-grid strong,
.receipt-summary strong {
    display: block;
    font-size: 14px;
    line-height: 1.25;
    color: #07162f;
}

/* Sections */

.receipt-section {
    margin-top: 12px;
}

.receipt-section h2 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #07162f;
}

/* Student Details */

.receipt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.receipt-grid .span-2 {
    grid-column: 1 / -1;
}

/* Fee Summary */

.receipt-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.receipt-summary > div,
.receipt-summary .receipt-total {
    grid-column: auto;
    width: auto;
    margin: 0;
}

.receipt-summary .receipt-total {
    background: #eef5ff;
    border-color: #9ec5fe;
}

.receipt-summary .receipt-total strong {
    color: #175cff;
}

/* Payment Table */

.receipt-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
}

.receipt-table th,
.receipt-table td {
    padding: 8px;
    vertical-align: middle;
    border: 1px solid #d9e1ec;
}

.receipt-table thead th,
.receipt-table tfoot th {
    background: #edf2f8;
}

.receipt-table th:first-child,
.receipt-table td:first-child {
    width: 34%;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2) {
    width: 20%;
}

.receipt-table th:nth-child(3),
.receipt-table td:nth-child(3) {
    width: 22%;
}

.receipt-table th:nth-child(4),
.receipt-table td:nth-child(4) {
    width: 24%;
}

/* Footer */

.receipt-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    margin-top: 55px;
}

.receipt-footer > div:first-child {
    margin-right: auto;
    text-align: left;
}

.receipt-footer > div:first-child span {
    margin-right: 4px;
    color: #607086;
}

.signature-box {
    position: relative;
    width: 180px;
    margin-left: auto;
    padding-top: 30px;
    text-align: center;
    font-weight: 700;
}

.signature-box::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    border-top: 1px solid #111;
}

/* Prevent breaking */

.receipt-section,
.receipt-meta > div,
.receipt-grid > div,
.receipt-summary > div,
.receipt-table,
.receipt-footer {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* =========================================
   PRINT CSS
========================================= */

@page {
    size: A4 portrait;
    margin: 6mm;
}

@media print {

    html,
    body {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    body.receipt-print-page {
        padding: 0 !important;
        margin: 0 !important;
    }

    .no-print {
        display: none !important;
    }

    .receipt-paper {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        padding: 5mm 7mm 4mm !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
        font-size: 9.75px !important;
        line-height: 1.14 !important;
    }

    .receipt-header {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding-bottom: 5px !important;
    }

    .app-logo--receipt {
        width: 205px !important;
        max-width: 205px !important;
        height: auto !important;
        margin: 0 auto !important;
    }

    .receipt-contact {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        gap: 8px !important;
        margin: 6px 0 5px !important;
        padding: 5px 9px !important;
        font-size: 8.5px !important;
    }

    .receipt-contact-item {
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
    }

    /* Three meta boxes in one row */

    .receipt-meta {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
        margin: 6px 0 8px !important;
    }

    .receipt-meta > div {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    /* Student details in two columns */

    .receipt-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .receipt-grid > div {
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .receipt-grid .span-2 {
        grid-column: 1 / -1 !important;
    }

    /* All four fee boxes in one row */

    .receipt-summary {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .receipt-summary > div,
    .receipt-summary .receipt-total {
        grid-column: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .receipt-summary span {
        font-size: 7px !important;
        line-height: 1.2 !important;
    }

    .receipt-summary strong {
        font-size: 10.5px !important;
        white-space: nowrap !important;
    }

    /* Payment table */

    .receipt-table {
        display: table !important;
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }

    .receipt-table th,
    .receipt-table td {
        padding: 4px 5px !important;
        vertical-align: middle !important;
        white-space: nowrap !important;
    }

    .receipt-table th:first-child,
    .receipt-table td:first-child {
        width: 34% !important;
        white-space: normal !important;
    }

    .receipt-table th:nth-child(2),
    .receipt-table td:nth-child(2) {
        width: 20% !important;
    }

    .receipt-table th:nth-child(3),
    .receipt-table td:nth-child(3) {
        width: 22% !important;
    }

    .receipt-table th:nth-child(4),
    .receipt-table td:nth-child(4) {
        width: 24% !important;
    }

    /* Generated date left and signature right */

    .receipt-footer {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: space-between !important;
        width: 100% !important;
        margin-top: 22px !important;
    }

    .receipt-footer > div:first-child {
        margin-left: 0 !important;
        margin-right: auto !important;
        text-align: left !important;
    }

    .signature-box {
        width: 180px !important;
        margin-right: 0 !important;
        margin-left: auto !important;
        text-align: center !important;
        padding-top: 24px !important;
    }

    body,
    .receipt-paper,
    .receipt-meta > div,
    .receipt-grid > div,
    .receipt-summary > div,
    .receipt-table th,
    .receipt-table td {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
.fee-timeline {
    position: relative;
    margin: 1.25rem 0 0;
    padding-left: 2.25rem;
}

.fee-timeline::before {
    position: absolute;
    top: .25rem;
    bottom: .25rem;
    left: .85rem;
    width: 2px;
    content: '';
    background: #dbe5f4;
}

.fee-timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.fee-timeline-item:last-child { margin-bottom: 0; }

.fee-timeline-marker {
    position: absolute;
    top: .85rem;
    left: -2.25rem;
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    color: #fff;
    background: #2563eb;
    border: 3px solid #eff6ff;
    border-radius: 50%;
    place-items: center;
    font-size: .7rem;
}

.fee-timeline-card {
    padding: 1rem;
    background: #f8fbff;
    border: 1px solid #dbe5f4;
    border-radius: .75rem;
}

/* Mobile sidebar: keep navigation above the dark backdrop */
@media (max-width: 991.98px) {
    .app-sidebar {
        z-index: 1055 !important;
        pointer-events: auto !important;
    }

    .app-sidebar.offcanvas.show,
    .app-sidebar.offcanvas.showing {
        z-index: 1055 !important;
        pointer-events: auto !important;
    }

    .offcanvas-backdrop {
        z-index: 1040 !important;
    }
}
