@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Modern UI Variables */
:root {
    --primary-color: #3b5bdb; /* Dark Blue */
    --primary-hover: #2f49b5;
    --secondary-color: #82868b;
    --success-color: #28c76f;
    --danger-color: #ea5455;
    --warning-color: #ff9f43;
    --info-color: #00cfe8;
    --dark-color: #4b4b4b;
    --light-color: #f8f9fa;
    --body-bg: #ffffff; /* Pure white background */
    --card-bg: #ffffff;
    --text-color: #5e5873;
    --text-muted: #a0a5ba;
    --border-color: #e2e8f0;
    --card-radius: 20px;
    --input-radius: 20px;
    --btn-radius: 24px;
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* Global Resets */
body {
    background-color: var(--body-bg) !important;
    font-family: 'Poppins', 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark-color);
    font-weight: 600;
}

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border: none;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Button UI */
.btn {
    border-radius: var(--btn-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: var(--input-radius);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.25);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Helper Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-primary-subtle {
    background-color: rgba(115, 103, 240, 0.12) !important;
    color: var(--primary-color) !important;
}

/* Page Header */
.page-header {
    background: transparent;
    padding: 0;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sidebar Overrides via CSS Variables */

.sidebar-link.active-item {
    background: linear-gradient(72.47deg, var(--primary-color) 22.16%, #9e95f5 76.47%) !important;
    box-shadow: 0px 2px 6px 0px rgba(115, 103, 240, 0.48) !important;
}

/* Action Button Icons (Solid Circles) */
.btn-icon {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    color: white !important;
    transition: all 0.2s;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-icon:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.btn-icon.edit {
    background-color: #7367f0;
}

/* Purple */
.btn-icon.delete {
    background-color: #ea5455;
}

/* Red */
.btn-icon.view {
    background-color: #00cfe8;
}

/* Cyan/Blue */


/* --- Dark Mode Overrides for Bootstrap Components --- */

/* 1. Form Elements */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--light-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--light-color);
    color: var(--text-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.25);
}

[data-bs-theme="dark"] .input-group-text {
    background-color: var(--light-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* 2. Tables */
[data-bs-theme="dark"] .table {
    --bs-table-color: var(--text-color);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

[data-bs-theme="dark"] .table thead th {
    color: var(--dark-color);
    /* Lighter text for headers */
    border-bottom-color: var(--border-color);
    background-color: rgba(255, 255, 255, 0.02);
}

/* 3. Text & Background Utilities */
/* Invert text-dark to be light in dark mode */
[data-bs-theme="dark"] .text-dark {
    color: var(--dark-color) !important;
    /* This var is actually light in dark mode */
}

[data-bs-theme="dark"] .text-muted {
    color: #b9b9c3 !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--card-bg) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: var(--light-color) !important;
}

/* 4. Modals & Dropdowns */
[data-bs-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--text-color);
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: rgba(115, 103, 240, 0.12);
    color: var(--primary-color);
}

/* 5. Close Button (Invert) */
[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* 6. Print Styles - Force Light Mode */
@media print {

    :root,
    [data-bs-theme="dark"] {
        --body-bg: #ffffff !important;
        --card-bg: #ffffff !important;
        --text-color: #000000 !important;
        --dark-color: #000000 !important;
        --light-color: #ffffff !important;
        --border-color: #000000 !important;
        --text-muted: #555555 !important;
        --primary-color: #000000 !important;
        /* Optional: Make primary actions black/dark for print readability */
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    .card,
    .table,
    .modal-content {
        background-color: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .text-white,
    .text-light {
        color: #000000 !important;
    }

    /* Ensure backgrounds in tables are removed for ink saving or forced to white */
    .table thead th {
        color: #000000 !important;
        background-color: #f8f9fa !important;
    }

    /* Hide non-printable UI elements if desired, but primarily reset colors */
    .sidebar,
    .navbar,
    .btn-close,
    .no-print {
        display: none !important;
    }

    /* Reset layout for full width */
    .content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}

/* ==========================================================================
   GLOBAL DESIGN SYSTEM EXTENSIONS & CONSOLIDATED COMPONENT STYLES
   ========================================================================== */

/* 1. Global Pill Utilities & Search Filters */
.filter-bar {
    background: transparent;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-btn-group .btn {
    border-radius: 50px;
    margin-right: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
}

.search-input-group {
    position: relative;
}

.form-control-custom,
.form-select-custom {
    border-radius: 50px !important;
    border: 1px solid var(--border-color) !important;
    padding: 10px 20px !important;
    min-width: 250px;
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control-custom:focus,
.form-select-custom:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.15) !important;
}

/* Unified Pills */
.btn-pill {
    border-radius: 50px !important;
}

/* Color Status Tokens */
.col-green, .text-green { color: var(--success-color) !important; }
.col-red, .text-red { color: var(--danger-color) !important; }
.col-yellow, .text-yellow { color: var(--warning-color) !important; }
.col-primary, .text-primary { color: var(--primary-color) !important; }

/* Border utility shortcuts */
.border-left-primary { border-left: 5px solid var(--primary-color) !important; }
.border-left-success { border-left: 5px solid var(--success-color) !important; }
.border-left-danger { border-left: 5px solid var(--danger-color) !important; }
.border-left-warning { border-left: 5px solid var(--warning-color) !important; }

/* 2. Subjects & Classes Cards */
.class-card {
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 20px 20px 50px;
    height: 100%;
    position: relative;
    border: 1px solid var(--border-color);
}

.class-card h5 {
    text-transform: capitalize;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--text-color);
}

.subject-list {
    font-size: 14px;
    margin-bottom: 10px;
}

.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
}

.card-actions a {
    margin-left: 6px;
    text-decoration: none;
}

.icon-box {
    font-size: 24px;
    color: var(--primary-color);
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0.3;
}

.subject-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subject-item:last-child {
    border-bottom: none;
}

.subject-info {
    display: flex;
    flex-direction: column;
}

.subject-item i {
    margin-left: 6px;
    cursor: pointer;
}

.subject-name {
    font-weight: 500;
}

/* 3. ID Cards layout (Student & Staff) */
.custom-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.color-input {
    height: 40px;
    width: 100%;
    cursor: pointer;
    border: 1px solid var(--border-color);
    padding: 2px;
    border-radius: 8px;
}

.preview-container {
    background: var(--light-color);
    border-radius: 12px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.id-card-preview {
    width: 320px;
    height: 480px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
    border: 1px solid var(--border-color);
    color: #333;
}

.id-card-preview.horizontal {
    width: 480px;
    height: 320px;
}

.card-header-section {
    padding: 15px 10px;
}

.student-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: 0 auto 10px;
}

.card-details {
    font-size: 0.85rem;
    padding: 0 20px;
    text-align: left;
}

.card-details table {
    width: 100%;
}

.card-details td {
    padding: 2px 0;
}

.barcode-section {
    margin: 10px 0;
}

.qr-section {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
}

/* 4. Thermal & A4 Receipt Layouts */
.receipt-thermal {
    width: 80mm;
    margin: 0 auto;
    padding: 5mm;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    box-shadow: none;
    border: 1px dashed var(--border-color);
}

.receipt-thermal .receipt-container {
    position: relative;
    width: 100%;
    border: none;
    padding: 0;
}

.receipt-thermal .logo {
    height: 40px;
    display: block;
    margin: 0 auto;
}

.receipt-thermal .mini-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.receipt-thermal .mini-table td {
    padding: 3px 0;
    border-bottom: 1px dotted var(--border-color);
}

.receipt-thermal .paid-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 3px solid var(--success-color);
    color: var(--success-color);
    padding: 5px 20px;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 5px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 10;
}

/* A4 Receipt Layout */
.receipt-a4 {
    max-width: 210mm;
    margin: 0 auto;
    color: var(--text-color);
}

.receipt-a4 .receipt-container {
    padding: 20px;
    border: none;
}

.receipt-a4 .logo {
    height: 80px;
}

.receipt-a4 .info-grid {
    display: flex;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.receipt-a4 .photo-col {
    width: 15%;
    text-align: center;
}

.receipt-a4 .photo-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--border-color);
}

.receipt-a4 .col-data {
    width: 28%;
    padding-left: 20px;
}

.receipt-a4 .label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.receipt-a4 .val {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--dark-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.receipt-a4 .val i {
    margin-right: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.receipt-a4 .arrow-icon::before {
    content: "↳";
    margin-right: 5px;
    color: var(--text-muted);
}

.receipt-a4 .details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.receipt-a4 .details-table th {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    padding: 6px;
    text-align: left;
}

.receipt-a4 .details-table td {
    border: 1px solid var(--border-color);
    padding: 6px;
}

.receipt-a4 .details-table .text-end {
    text-align: right;
}

.receipt-a4 .history-header {
    text-align: center;
    font-weight: bold;
    margin: 20px 0 10px;
    color: var(--text-color);
    font-size: 0.9rem;
}

.receipt-a4 .history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: center;
}

/* Print CSS Extensions */
@media print {
    body * {
        visibility: hidden;
    }
    .print-receipt-wrapper, .print-receipt-wrapper * {
        visibility: visible;
    }
    .print-receipt-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .d-print-none, form, .sidebar, .navbar, .page-header {
        display: none !important;
    }
    .content, body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        width: 100% !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
    }
    .print-card {
        margin-top: 0 !important;
    }
    table {
        width: 100% !important;
    }
    th, td {
        padding: 5px !important;
        border: 1px solid #000 !important;
    }
    .bg-light {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
    }
    .bg-secondary {
        background-color: #6c757d !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
    }
    /* ID Card print helper */
    #idCardContainer, #idCardContainer * {
        visibility: visible;
    }
    #idCardContainer {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }
    .card-col {
        width: 33% !important;
        margin: 0;
        padding: 10px;
        page-break-inside: avoid;
    }
    .id-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        margin: 0 auto;
    }
}

/* 5. Status Badges, Avatar & Toggle Switches */
.status-badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: auto;
    min-width: 90px;
    text-align: center;
    display: inline-block;
}

.status-badge.active,
.status-badge.active-status {
    background-color: rgba(40, 199, 111, 0.15) !important;
    color: #28c76f !important;
}

.status-badge.inactive,
.status-badge.inactive-status {
    background-color: rgba(234, 84, 85, 0.15) !important;
    color: #ea5455 !important;
}

.student-avatar,
.employee-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.table-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table thead th {
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    padding: 18px 20px;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 15px 20px;
    vertical-align: middle;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    -webkit-transform: translateX(24px);
    -ms-transform: translateX(24px);
    transform: translateX(24px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* 6. Utility hover transitions */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.transition-all {
    transition: all 0.3s ease;
}

/* 7. Column Layout wrappers & circular icon buttons */
.login-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.left-sidebar {
    width: 300px;
    min-width: 300px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    height: fit-content;
    border: 1px solid var(--border-color);
}

.main-content {
    flex: 1;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.left-sidebar ::-webkit-scrollbar {
    width: 5px;
}

.left-sidebar ::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

@media (max-width: 900px) {
    .login-wrapper {
        flex-direction: column;
    }
    .left-sidebar {
        width: 100%;
        min-width: 100%;
    }
}

.save-btn {
    background: rgba(115, 103, 240, 0.1);
    border: 1px solid rgba(115, 103, 240, 0.2);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover {
    background: var(--primary-color);
    color: white !important;
    transform: translateY(-2px);
}

/* 8. DataTable Dark Mode Enhancements */
.dt-buttons .btn {
    background: var(--light-color) !important;
    color: var(--text-color) !important;
    border-radius: 50px;
    border: 1px solid var(--border-color) !important;
    margin-right: 5px;
    font-weight: 500;
    padding: 5px 15px;
    font-size: 0.85rem;
}

.dt-buttons .btn:hover {
    background: var(--border-color) !important;
}

table.dataTable tbody tr {
    background-color: transparent !important;
    color: var(--text-color) !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-color) !important;
    margin-top: 10px;
}

.dataTables_wrapper .dataTables_filter input {
    background-color: var(--light-color) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    border-radius: 20px;
    padding: 5px 10px;
}

/* 9. Select2 Custom Styling for Dark & Light Mode */
.select2-container--default .select2-selection--single {
    height: 50px !important;
    border-radius: 50px !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--card-bg) !important;
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-color) !important;
    line-height: normal;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--text-muted) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px !important;
    right: 15px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-muted) transparent transparent transparent !important;
}

.select2-dropdown {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    z-index: 9999;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(115, 103, 240, 0.1) !important;
    color: var(--text-color) !important;
}

.select2-results__option {
    color: var(--text-color) !important;
    padding: 10px 15px;
}

.select2-search--dropdown .select2-search__field {
    background-color: var(--light-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 8px !important;
}

/* 10. Printable Official Letters (Admissions, Appraisals, Jobs) */
.letter {
    max-width: 750px;
    margin: 40px auto;
    padding: 40px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}

.letter .header {
    text-align: center;
    margin-bottom: 40px;
}

.letter .photo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    margin-top: 20px;
}

.letter .info-table {
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
}

.letter .info-table th, 
.letter .info-table td {
    padding: 10px;
    border: 1px solid var(--border-color);
}

.letter .info-table th {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
}

.letter .footer {
    margin-top: 40px;
    text-align: right;
    font-style: italic;
    color: var(--text-muted);
}

.letter .print-btn {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.letter .print-btn button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
}

@media print {
    .letter {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        box-shadow: none !important;
    }
    .signature-section {
        margin-top: 50mm;
        page-break-inside: avoid;
    }
    .rules-section {
        page-break-inside: avoid;
    }
    .print-btn, .sidebar, .navbar, .header-mobile, .no-print {
        display: none !important;
    }
    .content {
        margin: 0 !important;
        padding: 0 !important;
    }
    body {
        margin: 0 !important;
        padding: 15mm !important;
        background-color: white !important;
        height: auto !important;
        display: block !important;
    }
}

/* 11. Receipt & Invoice Layouts */
body.thermal-receipt, body.mini-receipt {
    width: 80mm !important;
    margin: 0 auto !important;
    padding: 5mm !important;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    box-shadow: none !important;
    border: 1px dashed #ccc;
    color: #000;
}

.thermal-receipt .receipt-container,
.mini-receipt .receipt-container {
    position: relative;
    width: 100%;
    border: none;
    padding: 0;
}

.thermal-receipt .logo,
.mini-receipt .logo {
    height: 40px;
    display: block;
    margin: 0 auto;
}

.mini-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.mini-table td {
    padding: 3px 0;
    border-bottom: 1px dotted #ccc;
}

.paid-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    border: 3px solid #28a745;
    color: #28a745;
    padding: 5px 20px;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 5px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 10;
}

/* Detailed / A4 Receipt */
body.detailed-receipt {
    max-width: 210mm !important;
    margin: 0 auto !important;
    color: #000;
    padding: 20px !important;
}

.detailed-receipt .receipt-container {
    padding: 20px;
    border: none;
    margin: 0 auto;
    background: white;
}

.detailed-receipt .logo {
    height: 80px;
}

/* Top Info Grid */
.info-grid {
    display: flex;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.photo-col {
    width: 15%;
    text-align: center;
}

.photo-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #eee;
}

.col-data {
    width: 28%;
    padding-left: 20px;
}

.col-data .label {
    color: #666;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.col-data .val {
    font-weight: bold;
    font-size: 0.9rem;
    color: #000;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.arrow-icon::before {
    content: "↳";
    margin-right: 5px;
    color: #999;
}

/* Tables */
.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.details-table th {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 6px;
    text-align: left;
}

.details-table td {
    border: 1px solid #ddd;
    padding: 6px;
}

.history-header {
    text-align: center;
    font-weight: bold;
    margin: 20px 0 10px;
    color: #333;
    font-size: 0.9rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: center;
}

.history-table th, .history-table td {
    border: 1px solid #ccc;
    padding: 4px;
}

.history-table th {
    background: #fff;
}

.footer-sig {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.sig-line {
    border-top: 1px dashed #000;
    width: 200px;
    padding-top: 5px;
}

@media print {
    body.thermal-receipt, body.mini-receipt {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .paid-stamp {
        -webkit-print-color-adjust: exact;
    }
}

/* 12. Mass Print Invoice / A4 Landscape Styles */
.small-row { font-size: 0.9rem; }
.small-table { font-size: 0.85rem; }

@media print {
    @page { 
        size: A4 landscape; 
        margin: 5mm; 
    }
    
    body {
        margin: 0;
        padding: 0;
        background: white;
        font-family: sans-serif;
        -webkit-print-color-adjust: exact;
    }

    .d-print-flex-row, .d-print-flex-row *,
    .mass-print-row, .mass-print-row *,
    .print-break-after-student, .print-break-after-student * {
        visibility: visible;
    }

    /* Main Flex Row - A4 Landscape Fit */
    .d-print-flex-row {
        position: fixed; 
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex !important;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 8mm;
        padding: 0;
        background: white;
        z-index: 9999;
        box-sizing: border-box;
    }
    
    .invoice-section {
        flex: 1; 
        height: 100%;
        margin: 0 !important;
        padding: 5px !important;
        border: 1px solid #000 !important;
        border-radius: 4px;
        background: white;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        font-size: 10px;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .invoice-section > .row {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }
    
    .col-print-12 {
        width: 100% !important;
        flex: 1 0 auto !important;
        max-width: 100% !important;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
    }
    
    .border-end-print-none {
        border-right: none !important;
        border-bottom: 1px dashed #ccc;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }
    
    /* A4 Optimized Fonts */
    h6, .h6 { font-size: 0.9rem !important; margin-bottom: 2px; font-weight: 800; }
    .small, .small-row, .text-muted { font-size: 0.7rem !important; }
    .small-table td, .small-table th { font-size: 0.7rem !important; padding: 1px 2px !important; }
    
    .invoice-section .mt-2 > div[style*="height"] {
        height: 25px !important;
    }

    /* Hide UI Elements */
    .btn, header, .sidebar, .card-header, footer, hr {
        display: none !important;
    }
    .card, .card-body, .container-fluid {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Strict Reset */
    * {
        box-sizing: border-box !important;
    }
    
    /* The Page Wrapper */
    .print-break-after-student {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 5mm 0 !important;
        page-break-after: always;
        break-after: page;
    }
    
    /* Mass Print Row - Inner Container */
    .mass-print-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 5mm !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    /* Last child fix to avoid trailing blank page */
    .print-break-after-student:last-child {
        page-break-after: auto;
        break-after: auto;
    }
}

/* 13. Paid Slip Invoice Layout */
body.paid-slip {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    color: #000;
}
.paid-slip .print-btn {
    position: fixed;
    top: 15px;
    right: 30px;
}
.paid-slip .print-btn button {
    padding: 6px 14px;
    background-color: #007bff;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}
.paid-slip .receipt {
    text-align: center;
}
.paid-slip .receipt h2 {
    margin: 5px 0;
}
.paid-slip .receipt h3 {
    color: #3366cc;
    margin-bottom: 20px;
}
.paid-slip .info-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}
.paid-slip .profile {
    width: 100px;
    height: 100px;
    background: #eee url('https://cdn-icons-png.flaticon.com/512/149/149071.png') no-repeat center center;
    background-size: cover;
    border-radius: 50%;
}
.paid-slip .info-box {
    width: 30%;
    font-size: 14px;
}
.paid-slip .info-box strong {
    color: #3366cc;
}
.paid-slip table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}
.paid-slip th, .paid-slip td {
    border: 1px solid #000;
    padding: 6px;
    text-align: left;
}
.paid-slip .summary {
    text-align: right;
    margin-top: 10px;
    font-size: 14px;
}
.paid-slip .summary div {
    margin-bottom: 4px;
}
@media print {
}

/* 14. Student Invoice (Portrait Stacked) Layout */
body.student-invoice {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.student-invoice .copy {
    padding: 4px 6px;
    margin-bottom: 6px;
    border: 1px solid #000;
    font-size: 10px;
    page-break-inside: avoid;
}

.student-invoice .header {
    text-align: center;
    border-bottom: 1px solid #000;
    padding-bottom: 3px;
    margin-bottom: 3px;
}

.student-invoice .header h2 {
    margin: 0;
    font-size: 14px;
}

.student-invoice .header h4, .student-invoice .header p {
    margin: 1px 0;
    font-size: 10px;
}

.student-invoice .section-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    font-size: 9px;
    margin-bottom: 2px;
}

.student-invoice .section {
    flex: 1 1 30%;
    margin: 1px 0;
    font-size: 10px;
}

.student-invoice .section strong {
    width: auto;
    display: inline-block;
}

.student-invoice .invoice-row {
    display: block;
}

.student-invoice .copy-title {
    background: #eee;
    text-align: center;
    font-weight: bold;
    margin: 3px 0;
    font-size: 10px;
    padding: 2px;
}

.student-invoice table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
    margin-top: 3px;
}

.student-invoice th, .student-invoice td {
    border: 1px solid #000;
    padding: 3px;
    text-align: left;
}

.student-invoice .footer {
    font-size: 8px;
    margin-top: 3px;
}

.student-invoice .footer .left, .student-invoice .footer .right {
    width: 49%;
    display: inline-block;
    vertical-align: top;
}

.student-invoice .footer .right {
    text-align: right;
}

.student-invoice .print-btn {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 9999;
}

.student-invoice .print-btn button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media print {
    .student-invoice .print-btn {
        display: none;
    }
}

/* 15. Salary Slip Layout */
.slip-container {
    max-width: 800px;
    margin: 30px auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.slip-container .watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
    font-size: 5rem;
    font-weight: bold;
    pointer-events: none;
}

@media print {
    .slip-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* 16. Subject & Class Cards */
.class-card {
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 20px 20px 50px;
    height: 100%;
    position: relative;
    border: 1px solid var(--border-color);
}

.class-card h5 {
    text-transform: capitalize;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--text-color);
}

.subject-list {
    font-size: 14px;
    margin-bottom: 10px;
}

.class-card .card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
}

.class-card .card-actions a {
    margin-left: 6px;
    text-decoration: none;
}

.class-card .icon-box {
    font-size: 24px;
    color: var(--primary-color);
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0.3;
}

.subject-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subject-item:last-child {
    border-bottom: none;
}

.subject-info {
    display: flex;
    flex-direction: column;
}

.subject-item i {
    margin-left: 6px;
    cursor: pointer;
}

.subject-name {
    font-weight: 500;
    color: var(--text-color);
}

.subject-marks {
    font-size: 12px;
    color: var(--text-muted);
}

/* 17. Timetable Print Styles */
@media print {
    body.timetable-print {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        width: 100% !important;
    }
    body.timetable-print .sidebar, 
    body.timetable-print .navbar, 
    body.timetable-print .page-header, 
    body.timetable-print .d-print-none, 
    body.timetable-print form {
        display: none !important;
    }
    body.timetable-print .content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    body.timetable-print .card {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
    }
    body.timetable-print .print-card {
        margin-top: 0 !important;
    }
    body.timetable-print table {
        width: 100% !important;
    }
    body.timetable-print th, body.timetable-print td {
        padding: 5px !important;
        border: 1px solid #000 !important;
    }
    body.timetable-print .bg-light {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    body.timetable-print .bg-secondary {
        background-color: #6c757d !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* 18. Attendance Status Buttons & Avatars */
.btn-status {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 5px;
}
.btn-status:hover {
    transform: scale(1.1);
}

.radio-hide { display: none; }

.radio-hide:checked + .btn-status-p {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}
.radio-hide:checked + .btn-status-l {
    background-color: #6f42c1; /* Purple for leave */
    color: white;
    border-color: #6f42c1;
}
.radio-hide:checked + .btn-status-a {
    background-color: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

    .avatar-sm {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
    }

    /* 19. Generic Report Print Styles */
    @media print {
        body.report-print .sidebar, 
        body.report-print .navbar, 
        body.report-print .page-header, 
        body.report-print .footer,
        body.report-print .btn,
        body.report-print .d-print-none, 
        body.report-print form { 
            display: none !important; 
        }
        
        body.report-print, 
        body.report-print .wrapper, 
        body.report-print .main, 
        body.report-print .content, 
        body.report-print .container-fluid {
            background: white !important;
            width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            overflow: visible !important;
        }
        
        body.report-print .card {
            border: none !important;
            box-shadow: none !important;
            margin: 0 !important;
            padding: 0 !important;
            width: 100% !important;
        }

        body.report-print .table {
            width: 100% !important;
            border-collapse: collapse !important;
            font-size: 10pt;
        }
        
        body.report-print th, body.report-print td {
            padding: 4px !important;
            border: 1px solid #000 !important;
        }

        body.report-print table {
            font-size: 10pt;
        }
        body.report-print th {
            font-size: 11pt;
            background-color: #f8f9fa !important;
            -webkit-print-color-adjust: exact;
        }

        body.report-print input,
        body.timetable-print input {
            border: none !important; 
            background: transparent !important; 
            padding: 0 !important; 
            width: auto !important;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }
        
        body.report-print input::-webkit-calendar-picker-indicator,
        body.timetable-print input::-webkit-calendar-picker-indicator,
        body.report-print input::-webkit-inner-spin-button,
        body.timetable-print input::-webkit-inner-spin-button {
            display: none !important;
            -webkit-appearance: none;
        }
    }

    /* 20. Custom Form & Page Utilities */
    .rounded-card {
        border-radius: 15px;
        border: none;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }
    .page-header {
        background: transparent;
        padding: 0;
        margin-bottom: 20px;
        box-shadow: none;
        border: none;
    }
    .filter-label {
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--text-color);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
        display: block;
    }
    .filter-input {
        background: var(--bg-color);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        border-radius: 50px;
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    .filter-input:focus {
        background: var(--card-bg);
        border-color: var(--primary-color);
        color: var(--text-color);
        box-shadow: none;
        outline: none;
    }
    .form-label-custom {
        font-weight: 600;
        color: var(--text-color);
        margin-bottom: 8px;
        display: block;
        font-size: 0.85rem;
        text-transform: uppercase;
    }
    .form-label-custom span {
        color: var(--danger-color);
    }
    .status-toggle {
        cursor: pointer;
        font-size: 1.5rem;
    }

    /* 21. Result Card Components */
    .nav-pills-custom .nav-link {
        color: var(--text-muted);
        background-color: var(--bg-color);
        border: none;
        margin-right: 5px;
        border-radius: 10px 10px 0 0;
        font-weight: 600;
        padding: 10px 25px;
    }
    .nav-pills-custom .nav-link.active {
        background-color: var(--card-bg);
        color: var(--primary-color);
        border: none;
        box-shadow: none;
    }
    .tab-content-custom {
        background: var(--card-bg);
        padding: 40px;
        border-radius: 0 15px 15px 15px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        margin-top: -1px;
        border: 1px solid var(--border-color);
        color: var(--text-color);
    }
    .form-label-pill {
        font-weight: 600;
        background: var(--primary-color);
        color: white;
        width: fit-content;
        padding: 4px 15px;
        border-radius: 20px;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 12px;
        display: inline-block;
    }
    .btn-generate {
        background-color: var(--warning-color);
        border: none;
        color: #fff;
        font-weight: bold;
        border-radius: 30px;
        padding: 12px 50px;
        font-size: 1rem;
        box-shadow: 0 4px 15px rgba(255, 179, 71, 0.3);
        transition: all 0.3s ease;
    }
    .btn-generate:hover {
        background-color: #e69b33;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 179, 71, 0.4);
        color: white;
    }

    @media print {
        body.result-card-print .sidebar, 
        body.result-card-print .navbar, 
        body.result-card-print .page-header, 
        body.result-card-print .d-print-none, 
        body.result-card-print .nav-tabs, 
        body.result-card-print .tab-pane, 
        body.result-card-print form, 
        body.result-card-print .btn, 
        body.result-card-print footer { 
            display: none !important; 
        }
        body.result-card-print, 
        body.result-card-print .content, 
        body.result-card-print .container-fluid { 
            margin: 0 !important; padding: 0 !important; background: white !important; width: 100% !important; 
        }
        body.result-card-print .content { margin-left: 0 !important; }
        body.result-card-print .card-result { 
            border: none !important; box-shadow: none !important; width: 100% !important; page-break-after: always; 
        }
        body.result-card-print .card-result .card-body { padding: 0 !important; }
        body.result-card-print h2 { font-size: 24pt; }
        body.result-card-print h5 { font-size: 14pt; }
        body.result-card-print td, body.result-card-print th { font-size: 12pt; }
    }

    /* 22. Accounting & General Table Components */
    .form-control-custom, .form-select-custom {
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        border-radius: 25px;
        padding: 10px 15px;
    }
    .form-control-custom:focus, .form-select-custom:focus {
        background-color: var(--card-bg);
        color: var(--text-color);
        border-color: var(--primary-color);
        box-shadow: none;
    }
    .btn-save-custom {
        background-color: var(--warning-color);
        color: #000;
        font-weight: 700;
        border-radius: 25px;
        padding: 10px 30px;
        border: none;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .btn-save-custom:hover {
        background-color: #e0a800;
        color: #000;
    }
    .table-custom thead th {
        background-color: transparent;
        color: var(--text-muted);
        font-size: 0.8rem;
        text-transform: uppercase;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 15px;
    }
    .table-custom tbody td {
        background-color: transparent;
        color: var(--text-color);
        border-bottom: 1px solid var(--border-color);
        padding-top: 15px;
        padding-bottom: 15px;
        vertical-align: middle;
    }
    .btn-action {
        width: 35px;
        height: 35px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: none;
        color: white;
        transition: transform 0.2s;
        margin: 0 4px;
    }
    .btn-action.btn-edit { background-color: var(--primary-color); }
    .btn-action.btn-delete { background-color: var(--danger-color); }
    .btn-action:hover { transform: scale(1.1); color: white; }
    
    .badge-req { background-color: var(--primary-color); color: white; border-radius: 12px; padding: 5px 12px; font-size: 0.75rem; }
    .badge-opt { background-color: var(--text-muted); color: white; border-radius: 12px; padding: 5px 12px; font-size: 0.75rem; }

    /* DataTable Overrides */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        color: var(--text-color) !important;
        font-size: 0.9rem;
    }
    .dataTables_wrapper .dataTables_filter input {
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        border-radius: 20px;
        padding: 5px 15px;
    }

    /* 23. Floating Label & Toggle Form Components */
    .form-label-floating-custom {
        background-color: var(--primary-color);
        color: white;
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        position: absolute;
        top: -12px;
        left: 15px;
        z-index: 10;
        text-transform: uppercase;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .form-label-floating-custom.opt {
        background-color: var(--text-muted);
    }
    .input-group-custom {
        position: relative;
        margin-bottom: 25px;
    }
    .toggle-container {
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        border-radius: 25px;
        padding: 10px 20px;
        display: flex;
        align-items: center;
    }
    .form-check-input:checked {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

    /* Select2 General Theme Overrides */
    .select2-container--classic .select2-selection--single {
        background-color: var(--bg-color) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 25px !important;
        height: 50px !important;
        box-shadow: none !important;
        background-image: none !important;
        display: flex;
        align-items: center;
    }
    .select2-container--classic .select2-selection--single .select2-selection__rendered {
        color: var(--text-color) !important;
        line-height: normal;
        padding-left: 20px;
        font-size: 0.95rem;
    }
    .select2-container--classic .select2-selection--single .select2-selection__arrow {
        background: transparent !important;
        border: none !important;
        height: 100% !important;
        right: 15px !important;
    }
    .select2-container--classic .select2-selection--single .select2-selection__arrow b {
        border-top-color: var(--text-muted) !important;
    }
    .select2-dropdown {
        background-color: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 15px !important;
        overflow: hidden;
    }
    .select2-container--classic .select2-results__option--highlighted[aria-selected] {
        background-color: var(--primary-color) !important;
    }
    .select2-results__option {
        color: var(--text-color) !important;
        padding: 10px 15px;
    }
    .select2-search__field {
        background-color: var(--bg-color) !important;
        color: var(--text-color) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 10px;
    }

    /* 24. Radio Selection Cards */
    .cursor-pointer { cursor: pointer; }

    .structure-card {
        background: var(--bg-color);
        border: 2px solid var(--border-color);
        transition: all 0.3s ease;
    }
    .structure-card .title-text { color: var(--text-color) !important; }
    .structure-card .desc-text { color: var(--text-muted) !important; opacity: 1; }
    .structure-card .check-icon { display: none; }

    .structure-radio:checked + .structure-card.gradient-card {
        background: linear-gradient(135deg, var(--primary-color) 0%, #2575fc 100%);
        border-color: transparent;
    }
    .structure-radio:checked + .structure-card.gradient-card .title-text,
    .structure-radio:checked + .structure-card.gradient-card .desc-text { color: white !important; }
    .structure-radio:checked + .structure-card.gradient-card .desc-text { opacity: 0.9; }

    .structure-radio:checked + .structure-card.outline-card {
        border-color: var(--primary-color);
        background: var(--card-bg);
    }

    .structure-radio:checked + .structure-card .check-icon { display: block; }

    /* 25. Collect Fees Elements */
    .form-label-reference {
        display: block;
        text-transform: uppercase;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 8px;
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }
    
    .select2-container--default .select2-selection--single {
        background-color: var(--bg-color) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        height: 55px !important;
        display: flex;
        align-items: center;
        box-shadow: none !important;
    }
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        color: var(--text-color) !important;
        line-height: normal;
        padding-left: 20px;
        font-size: 1rem;
    }
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 53px !important;
        top: 0;
        right: 15px;
    }

    /* 26. Salary Payment Components */
    .filter-input-custom {
        border-radius: 50px !important;
        padding: 12px 25px !important;
        font-size: 0.95rem !important;
        transition: all 0.3s ease;
        background-color: var(--bg-color) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-color) !important;
    }
    .filter-input-custom:focus {
        background-color: var(--card-bg) !important;
        border-color: var(--primary-color) !important;
        box-shadow: 0 0 0 0.25rem rgba(108, 93, 211, 0.25) !important;
    }
    .filter-input-custom[readonly] {
        opacity: 0.8 !important;
    }

    .form-label-custom-salary {
        background: var(--primary-color);
        color: white;
        padding: 4px 15px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: inline-block;
    }
    .form-label-optional {
        background: var(--text-muted);
        color: white;
        padding: 4px 15px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        display: inline-block;
    }
    .section-label {
        text-transform: uppercase;
        font-weight: bold;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
        display: block;
        margin-bottom: 0.5rem;
        color: var(--text-muted);
    }
    .main-card {
        border-radius: 1rem !important;
        border: none;
        background-color: var(--card-bg);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    }
    .header-title { font-weight: bold; margin-bottom: 1.5rem; color: var(--text-color); }
    .arrow-icon { color: var(--primary-color); }
    .btn-submit-salary {
        background-color: var(--warning-color);
        border: none;
        color: #000;
        font-weight: 700;
        border-radius: 50px;
        padding: 12px 60px;
        font-size: 1.1rem;
        box-shadow: 0 4px 15px rgba(255, 179, 71, 0.3);
        transition: all 0.3s ease;
    }
    .btn-submit-salary:hover {
        background-color: #ffaa33;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 179, 71, 0.4);
    }
    input[type="month"]::-webkit-calendar-picker-indicator,
    input[type="date"]::-webkit-calendar-picker-indicator {
        display: none !important;
        -webkit-appearance: none;
    }
    .calendar-icon {
        position: absolute; 
        right: 15px; 
        top: 50%; 
        transform: translateY(-50%); 
        pointer-events: auto; 
        cursor: pointer;
        z-index: 5;
        color: var(--text-muted);
    }
    .net-payable-label { font-weight: bold; color: var(--text-color); }
    .currency-symbol { font-weight: normal; color: var(--text-muted); }

    /* 27. Fees Report Specific Print & Utility Styles */
    input[type="month"]::-webkit-calendar-picker-indicator { display: none; }
    .text-light-gray { color: #adb5bd; }
    
    @media print {
        .content > *:not(#printable-area) { display: none !important; }
        #printable-area { 
            display: block !important; 
            width: 100% !important; 
            position: static !important; 
        }
        body { background-color: white !important; overflow: visible !important; }
        .print-table { width: 100% !important; border: 1px solid #000 !important; border-collapse: collapse !important; font-size: 10pt; }
        .print-table th, .print-table td { border: 1px solid #000 !important; padding: 5px !important; color: #000 !important; }
        .badge { color: #000 !important; border: 1px solid #000 !important; background: none !important; font-weight: bold; }
        .bg-success, .bg-danger, .bg-warning { background: none !important; color: #000 !important; }
        .print-grid { display: block !important; }
        .print-col-6 { 
            width: 48% !important; 
            float: left; 
            margin: 1%; 
            border: 1px solid #ccc;
            page-break-inside: avoid; 
            padding: 10px;
        }
        .print-card { border: none !important; box-shadow: none !important; }
        .text-primary, .text-success, .text-danger, .text-warning { color: #000 !important; }
        h4, h5, h6 { color: #000 !important; }
        .no-print-chart { display: none !important; }
    }

    /* 28. Utility Classes */
    .hover-shadow:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.3) !important;
    }
    .transition-all {
        transition: all 0.3s ease;
    }

    /* 29. Account Statement Styles */
    .date-btn {
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }
    .date-btn:hover { background-color: #5544c2; color: white; }
    .dt-buttons .btn {
        background: var(--bg-color);
        color: var(--text-color);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        padding: 5px 15px;
        font-size: 12px;
        margin-right: 5px;
    }
    .dt-buttons .btn:hover { background: var(--card-bg); }

    /* 30. DataTables Theme Integration */
    table.dataTable thead th {
        background-color: var(--bg-color) !important;
        color: var(--text-muted) !important;
        border-bottom: 2px solid var(--border-color) !important;
        padding: 15px;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.85rem;
    }
    table.dataTable tbody td {
        background-color: transparent !important;
        padding: 12px 15px;
        vertical-align: middle;
        color: var(--text-color) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .dataTables_wrapper .dataTables_length, 
    .dataTables_wrapper .dataTables_filter, 
    .dataTables_wrapper .dataTables_info, 
    .dataTables_wrapper .dataTables_processing, 
    .dataTables_wrapper .dataTables_paginate {
        color: var(--text-color) !important;
        margin-top: 10px;
    }
    .dataTables_wrapper .dataTables_filter input {
        background-color: var(--bg-color) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-color) !important;
        border-radius: 20px;
        padding: 5px 10px;
    }
    .text-danger-custom { color: #ea5455 !important; font-weight: 600; }
    .text-success-custom { color: #28c76f !important; font-weight: 600; }

    /* 31. Login Page Styles */
    body.login-page {
        height: 100vh;
        display: flex;
        align-items: center;
        overflow: hidden;
    }
    .login-container {
        width: 100%;
        max-width: 1100px;
        margin: auto;
        padding: 20px;
    }
    .slogan-column {
        padding-right: 50px;
    }
    .brand-logo {
        font-size: 3.5rem;
        color: var(--primary-color);
        margin-bottom: 25px;
    }
    .slogan-text {
        font-weight: 800;
        font-size: 2.5rem;
        line-height: 1.2;
        color: var(--text-color);
        margin-bottom: 15px;
        letter-spacing: -1px;
    }
    .slogan-subtext {
        color: #7983bb;
        font-size: 1.1rem;
        max-width: 400px;
    }
    .login-card {
        background-color: var(--card-bg);
        border-radius: 40px;
        padding: 40px;
        box-shadow: 0 20px 50px rgba(0,0,0,0.3);
        border: 1px solid rgba(255,255,255,0.05);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .welcome-text {
        font-weight: 800;
        font-size: 1.8rem;
        color: var(--text-color);
        margin-bottom: 30px;
        letter-spacing: 1px;
    }
    .login-card .form-label {
        color: #7983bb;
        font-size: 0.85rem;
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
        display: block;
    }
    .login-card .form-control {
        background: transparent !important;
        border: none !important;
        border-bottom: 1.5px solid var(--border-color) !important;
        border-radius: 0 !important;
        padding: 10px 0 !important;
        color: var(--text-color) !important;
        font-size: 1rem;
        margin-bottom: 30px;
        box-shadow: none !important;
        transition: border-color 0.3s ease;
    }
    .login-card .form-control:focus {
        border-color: var(--primary-color) !important;
    }
    .login-card .form-control::placeholder {
        color: #4b526d;
        opacity: 0.7;
    }
    .login-card input:-webkit-autofill,
    .login-card input:-webkit-autofill:hover, 
    .login-card input:-webkit-autofill:focus, 
    .login-card input:-webkit-autofill:active{
        -webkit-box-shadow: 0 0 0 30px var(--card-bg) inset !important;
        -webkit-text-fill-color: var(--text-color) !important;
        transition: background-color 5000s ease-in-out 0s;
    }
    .forgot-link {
        float: right;
        color: var(--primary-color);
        text-decoration: none;
        font-size: 0.85rem;
        font-weight: 600;
        margin-top: -55px;
        position: relative;
        z-index: 10;
    }
    .btn-login {
        background-color: var(--primary-color);
        border: none;
        color: white;
        padding: 12px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 1.1rem;
        width: 100%;
        margin-top: 20px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(108, 93, 211, 0.3);
    }
    .btn-login:hover {
        background-color: #5a4db8;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(108, 93, 211, 0.4);
    }
    .footer-link {
        text-align: center;
        margin-top: 25px;
    }
    .footer-link a {
        color: var(--primary-color);
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 600;
    }
    @media (max-width: 991px) {
        .slogan-column {
            display: none;
        }
        .login-card {
            padding: 40px 30px;
        }
    }
    .alert-custom {
        background: rgba(234, 84, 85, 0.1);
        color: var(--danger-color);
        padding: 12px 20px;
        border-radius: 15px;
        margin-bottom: 25px;
        font-size: 0.85rem;
        border: 1px solid rgba(234, 84, 85, 0.2);
    }

    /* 32. Error & Access Denied Pages */
    .error-container {
        max-width: 500px;
        padding: 40px;
        background: var(--card-bg);
        border-radius: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.05);
        margin: 50px auto; 
        text-align: center;
        border: 1px solid var(--border-color);
    }
    .error-title {
        color: var(--danger-color);
        font-weight: 700;
        font-size: 1.5rem;
        margin-bottom: 10px;
        text-transform: uppercase;
        letter-spacing: 2px;
    }
    .error-message {
        color: var(--text-muted);
        font-size: 1.1rem;
        margin-bottom: 30px;
    }
    .btn-back {
        display: inline-block;
        background-color: var(--primary-color);
        color: white;
        padding: 10px 30px;
        border-radius: 50px;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
    }
    .btn-back:hover {
        background-color: #5544c2;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(108, 93, 211, 0.3);
    }

    /* 33. Theme Selection Cards */
    .cursor-pointer { cursor: pointer; }
    .theme-radio:checked + .theme-option {
        border: 3px solid var(--primary-color) !important;
        transform: scale(1.05);
        transition: all 0.2s;
    }
    .theme-radio:checked + .theme-option .check-icon {
        display: block !important;
    }

    /* 34. Salary Report & Miscs */
    .pointer-event-none { pointer-events: none; }

    /* 35. Layout Structure (from header.php) */
    .sidebar {
        height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        width: 260px;
        background-color: #ffffff; /* White mainly */
        color: #4b4b4b;
        padding-top: 0;
        z-index: 1000;
        overflow: visible; /* Allow toggle button to overflow */
        transition: all 0.3s ease;
        border-top-right-radius: 20px;
        border-bottom-right-radius: 20px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.05);
    }
    .sidebar-scroll {
        height: calc(100vh - 70px);
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 20px;
        overscroll-behavior: contain; /* Prevents scroll chaining to the main body */
    }
    .sidebar-scroll::-webkit-scrollbar {
        width: 4px;
    }
    .sidebar-scroll::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.1);
        border-radius: 4px;
    }
    .sidebar.sidebar-collapsed {
        width: 80px;
        background-color: #12192c; /* Dark blue when collapsed */
        color: #b6bee3;
    }
    .brand-section {
        padding: 20px;
        background: transparent;
        color: #4b4b4b;
        font-size: 1.2rem;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        white-space: nowrap;
    }
    .sidebar-collapsed .brand-section {
        padding: 20px 0;
        justify-content: center;
        color: white;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .sidebar-collapsed .brand-text {
        display: none;
    }
    .menu-header {
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 1px;
        color: #a0a5b1;
        padding: 15px 25px 10px;
        font-weight: 600;
        white-space: nowrap;
    }
    .sidebar-collapsed .menu-header {
        display: none;
    }
    .sidebar-link {
        color: #4b4b4b;
        display: flex;
        align-items: center;
        padding: 12px 20px;
        margin: 5px 15px;
        text-decoration: none;
        transition: all 0.2s;
        font-size: 0.95rem;
        border-radius: 12px;
        white-space: nowrap;
    }
    .sidebar-link:hover {
        color: var(--primary-color);
        background: rgba(59, 91, 219, 0.05);
    }
    .sidebar-link i {
        margin-right: 15px;
        font-size: 1.2rem;
        width: 24px;
        text-align: center;
    }
    .sidebar-collapsed .sidebar-link {
        color: #b6bee3;
        padding: 12px;
        margin: 5px 15px;
        justify-content: center;
    }
    .sidebar-collapsed .sidebar-link:hover {
        color: white;
        background: rgba(255,255,255,0.05);
    }
    .sidebar-collapsed .sidebar-link i {
        margin-right: 0;
    }
    .sidebar-collapsed .sidebar-link i.bi-chevron-down {
        display: none !important;
    }
    .sidebar-link .bi-chevron-down {
        transition: transform 0.3s ease;
    }
    .sidebar-link[aria-expanded="true"] .bi-chevron-down {
        transform: rotate(180deg);
    }
    .sidebar-link .link-text {
        flex-grow: 1;
        text-align: left;
    }
    .sidebar-collapsed .link-text, .sidebar-collapsed .ms-auto {
        display: none !important;
    }
    
    .sidebar .collapse {
        position: relative;
    }
    .sidebar-collapsed .collapse {
        display: none !important; /* Hide submenus when collapsed completely */
    }
    
    .sidebar .collapse::before {
        content: "";
        position: absolute;
        top: 0;
        left: 45px;
        width: 1px;
        height: 100%;
        background-color: rgba(0,0,0,0.05);
    }
    .sidebar-sub-link {
        color: #6c757d;
        padding: 8px 10px 8px 60px;
        display: block;
        text-decoration: none;
        font-size: 0.9rem;
        position: relative;
        white-space: nowrap;
    }
    .sidebar-sub-link:hover {
        color: var(--primary-color);
    }
    .sidebar-sub-link::before {
        content: "";
        position: absolute;
        left: 42px;
        top: 50%;
        transform: translateY(-50%);
        width: 6px;
        height: 6px;
        border-radius: 50%;
        border: 1px solid #a0a5b1;
        background: transparent;
    }
    .sidebar-sub-link:hover::before {
        background: var(--primary-color);
        border-color: var(--primary-color);
    }
    .active-parent {
        color: var(--primary-color) !important;
        background: transparent !important;
        box-shadow: none !important;
        font-weight: 600;
    }
    .sidebar-sub-link.active {
        color: var(--primary-color);
        font-weight: 600;
        background: rgba(59, 91, 219, 0.05);
        border-radius: 8px;
        margin-right: 15px;
    }
    .sidebar-sub-link.active::before {
        background: var(--primary-color);
        border-color: var(--primary-color);
        box-shadow: 0 0 5px rgba(59, 91, 219, 0.5);
    }
    
    /* Toggle Button */
    .sidebar-toggle {
        position: absolute;
        top: 30px;
        right: -15px;
        width: 30px;
        height: 30px;
        background: var(--primary-color);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        border: none;
        transition: transform 0.3s;
    }
    .sidebar-collapsed .sidebar-toggle {
        transform: rotate(180deg);
    }
    
    /* Hide scrollbar for sidebar */
    .sidebar::-webkit-scrollbar {
        width: 0;
        background: transparent;
    }
    .sidebar {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    .navbar {
        position: fixed;
        left: 260px;
        right: 0;
        top: 0;
        z-index: 900;
        background: rgba(255, 255, 255, 0.85) !important; /* White frosted glass */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: none;
        height: 80px;
        padding: 0 30px;
        transition: left 0.3s ease;
    }
    .sidebar-collapsed ~ .navbar {
        left: 80px;
    }
    .content {
        margin-left: 260px;
        padding: 90px 20px 20px 20px;
        min-height: 100vh;
        transition: margin-left 0.3s ease;
    }
    .sidebar-collapsed ~ .content {
        margin-left: 80px;
    }
    .profile-dropdown {
        position: relative;
        display: inline-block;
    }
    .profile-dropdown .dropdown-toggle::after {
        display: none;
    }
    .profile-dropdown .btn-profile {
        background: none;
        border: none;
        color: var(--primary-color);
        font-size: 1.6rem;
        padding: 0;
        line-height: 1;
        transition: all 0.2s ease;
    }
    .profile-dropdown:hover .btn-profile {
        color: #8c7cf0;
        transform: scale(1.1);
    }
    .profile-dropdown .dropdown-menu {
        display: none;
        position: absolute;
        right: 0;
        top: 100%;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.4);
        min-width: 170px;
        z-index: 1050;
        padding: 10px 5px;
        margin-top: 10px;
    }
    .profile-dropdown .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -15px;
        left: 0;
        width: 100%;
        height: 20px;
    }
    .profile-dropdown:hover .dropdown-menu {
        display: block;
    }
    .profile-dropdown .dropdown-item {
        color: var(--text-muted);
        padding: 10px 15px;
        font-size: 0.9rem;
        border-radius: 8px;
        transition: all 0.2s;
    }
    .profile-dropdown .dropdown-item:hover {
        background: rgba(108, 93, 211, 0.1);
        color: var(--primary-color);
    }
    .profile-dropdown .dropdown-item i {
        margin-right: 10px;
        font-size: 1rem;
    }

    /* 36. Print Header Additions */
    @media print {
        .print-header h2 { font-weight: 900 !important; letter-spacing: 1px; }
    }

    /* 37. Global Form Field Consistency */
    .form-control, 
    .form-select, 
    .input-group-text, 
    .filter-input-custom,
    .btn {
        border-radius: 50rem !important; /* Proper round (pill shape) */
    }
    
    textarea.form-control {
        border-radius: 20px !important; /* Slightly less round for textareas to avoid text cut-off */
    }

    /* Fix input-group pill collisions */
    .input-group > .form-control:not(:first-child),
    .input-group > .form-select:not(:first-child),
    .input-group > .input-group-text:not(:first-child),
    .input-group > .btn:not(:first-child) {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }
    .input-group > .form-control:not(:last-child),
    .input-group > .form-select:not(:last-child),
    .input-group > .input-group-text:not(:last-child),
    .input-group > .btn:not(:last-child) {
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }