        :root {
            --primary-color: #2c3e50;
            --secondary-color: #3498db;
            --accent-color: #2980b9;
            --success-color: #27ae60;
            --warning-color: #f39c12;
            --danger-color: #e74c3c;
            --light-color: #f8f9fa;
            --dark-color: #343a40;
            --border-color: #e9ecef;
            --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
        }

        body {
            background-color: #f5f7fa;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            color: #333;
            line-height: 1.6;
        }

        .login-container {
            background-color: white;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .login-card {
            border-radius: 12px;
            box-shadow: var(--card-shadow);
            border: none;
            overflow: hidden;
            max-width: 420px;
            width: 100%;
        }

        .login-header {
            background-color: var(--primary-color);
            color: white;
            padding: 25px;
            text-align: center;
        }

        .login-body {
            padding: 30px;
        }

        .form-control {
            border-radius: 8px;
            padding: 12px 15px;
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
        }

        .form-control:focus {
            border-color: var(--secondary-color);
            box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
        }

        .btn-primary {
            background-color: var(--secondary-color);
            border-color: var(--secondary-color);
            border-radius: 8px;
            padding: 12px 20px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .btn-primary:hover {
            background-color: var(--accent-color);
            border-color: var(--accent-color);
            transform: translateY(-2px);
        }

        .admin-header {
            background-color: white;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
            position: sticky;
            top: 0;
            z-index: 1000;
        }

        .nav-tabs-custom {
            border-bottom: none;
            background-color: white;
            padding: 0 15px;
        }

        .nav-tabs-custom .nav-link {
            border: none;
            border-radius: 8px 8px 0 0;
            color: #6c757d;
            font-weight: 600;
            padding: 12px 20px;
            margin: 0 5px;
            transition: all 0.3s ease;
        }

        .nav-tabs-custom .nav-link:hover {
            background-color: rgba(52, 152, 219, 0.05);
            color: var(--secondary-color);
        }

        .nav-tabs-custom .nav-link.active {
            color: var(--secondary-color);
            background-color: rgba(52, 152, 219, 0.1);
            border-bottom: 3px solid var(--secondary-color);
        }

        .card {
            border: none;
            border-radius: 12px;
            box-shadow: var(--card-shadow);
            transition: all 0.3s ease;
            margin-bottom: 20px;
        }

        .card:hover {
            box-shadow: var(--card-shadow-hover);
        }

        .card-header {
            background-color: white;
            border-bottom: 1px solid var(--border-color);
            padding: 20px 25px;
            border-radius: 12px 12px 0 0 !important;
            font-weight: 600;
        }

        .card-body {
            padding: 25px;
        }

        .stat-card {
            text-align: center;
            transition: transform 0.3s ease;
            border-left: 4px solid var(--secondary-color);
        }

        .stat-card:hover {
            transform: translateY(-5px);
        }

        .stat-card .card-body {
            padding: 25px 15px;
        }

        .stat-card i {
            font-size: 2.5rem;
            margin-bottom: 15px;
            color: var(--secondary-color);
        }

        .stat-card h3 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 5px;
            color: var(--primary-color);
        }

        .stat-card p {
            color: #6c757d;
            font-weight: 500;
        }

        .tab-content {
            display: none;
        }

        .floating-action-button {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1050;
            /* Above modals (1040) but below toast (1060) */
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-color: var(--secondary-color);
            color: white;
            border: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .floating-action-button:hover {
            background-color: var(--accent-color);
            transform: scale(1.05);
        }

        .tab-content.active {
            display: block;
        }

        .btn {
            border-radius: 8px;
            padding: 10px 18px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .btn:hover {
            transform: translateY(-2px);
        }

        .btn-outline-primary {
            color: var(--secondary-color);
            border-color: var(--secondary-color);
        }

        .btn-outline-primary:hover {
            background-color: var(--secondary-color);
            border-color: var(--secondary-color);
        }

        .table {
            border-radius: 8px;
            overflow: hidden;
        }

        .table thead th {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 15px;
            font-weight: 600;
        }

        .table tbody td {
            padding: 15px;
            vertical-align: middle;
            border-color: var(--border-color);
        }

        .table tbody tr:hover {
            background-color: rgba(52, 152, 219, 0.05);
        }

        .badge {
            border-radius: 20px;
            padding: 6px 12px;
            font-weight: 600;
        }

        .student-card-modern {
            border-radius: 12px;
            overflow: hidden;
            height: 100%;
            transition: all 0.3s ease;
        }

        .student-card-modern:hover {
            transform: translateY(-8px);
        }

        .student-card-header {
            background-color: var(--primary-color);
            color: white;
            padding: 25px 20px;
            position: relative;
            text-align: center;
        }

        .student-avatar {
            width: 120px !important;
            height: 120px !important;
            border-radius: 50% !important;
            object-fit: cover !important;
            border: 4px solid rgba(255, 255, 255, 0.3) !important;
            margin: 0 auto 15px !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
            display: block !important;
        }

        .student-detail-photo {
            width: 250px !important;
            height: 300px !important;
            object-fit: cover !important;
            border-radius: 8px !important;
            border: 4px solid rgba(52, 152, 219, 0.2) !important;
            margin: 0 auto 15px !important;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
            display: block !important;
        }

        .no-photo-container {
            width: 120px;
            height: 120px;
            margin: 0 auto 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            border: 2px dashed rgba(255, 255, 255, 0.3);
        }

        .no-photo-icon {
            font-size: 2.5rem;
            color: rgba(255, 255, 255, 0.7);
        }

        .student-name {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .student-id {
            font-size: 0.95rem;
            opacity: 0.9;
            margin-bottom: 5px;
        }

        .student-course {
            font-size: 0.9rem;
            opacity: 0.85;
            margin-bottom: 10px;
        }

        .student-card-body {
            padding: 25px 20px;
        }

        .student-detail-item {
            display: flex;
            align-items: flex-start;
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border-color);
        }

        .student-detail-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

        .detail-icon {
            width: 32px;
            height: 32px;
            background: #f8f9fa;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            flex-shrink: 0;
            color: var(--secondary-color);
            font-size: 1rem;
        }

        .detail-content {
            flex: 1;
        }

        .detail-label {
            font-size: 0.8rem;
            color: #6c757d;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .detail-value {
            font-size: 0.95rem;
            color: #212529;
            font-weight: 500;
            line-height: 1.4;
        }

        .token-badge {
            background: #e9ecef;
            color: #495057;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            display: inline-block;
        }

        .course-badge {
            background: rgba(52, 152, 219, 0.1);
            color: var(--secondary-color);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            display: inline-block;
            margin-right: 5px;
            margin-bottom: 5px;
        }

        .student-card-footer {
            padding: 20px;
            background: #f8f9fa;
            border-top: 1px solid var(--border-color);
            display: flex;
            gap: 10px;
        }

        .action-btn {
            background: var(--secondary-color);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 10px 16px;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.2s ease;
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

        .action-btn:hover {
            background: var(--accent-color);
            transform: translateY(-2px);
        }

        .action-btn-secondary {
            background: #6c757d;
        }

        .action-btn-secondary:hover {
            background: #5a6268;
        }

        .courses-container {
            display: flex;
            flex-wrap: wrap;
            margin-top: 5px;
        }

        .student-status {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .receipt-card {
            transition: transform 0.3s ease;
        }

        .receipt-card:hover {
            transform: translateY(-5px);
        }

        .status-badge {
            display: inline-block;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .status-paid {
            background-color: #d1e7dd;
            color: #0f5132;
        }

        .status-partial {
            background-color: #fff3cd;
            color: #664d03;
        }

        .status-pending {
            background-color: #f8d7da;
            color: #842029;
        }

        .toast {
            border-radius: 8px;
            box-shadow: var(--card-shadow);
        }

        .tm-admin-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 9999;
            overflow-y: auto;
        }

        .tm-admin-modal-content {
            position: relative;
            background-color: #fff;
            margin: 5% auto;
            padding: 0;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            width: 90%;
            max-width: 800px;
            animation: tmModalFadeIn 0.3s;
        }

        @keyframes tmModalFadeIn {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .tm-admin-modal-header {
            padding: 20px 25px;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: white;
            border-radius: 12px 12px 0 0;
        }

        .tm-admin-modal-title {
            margin: 0;
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--primary-color);
        }

        .tm-admin-modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #6c757d;
            transition: color 0.3s ease;
        }

        .tm-admin-modal-close:hover {
            color: var(--danger-color);
        }

        .tm-admin-modal-body {
            padding: 25px;
            max-height: 70vh;
            overflow-y: auto;
        }

        .tm-admin-modal-footer {
            padding: 20px 25px;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            background-color: #f8f9fa;
            border-radius: 0 0 12px 12px;
        }

        .school-logo {
            height: 60px;
            width: auto;
        }

        .logo-placeholder {
            width: 100px;
            height: 100px;
            margin: 0 auto 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px dashed #ccc;
            border-radius: 50%;
            color: #999;
            font-size: 12px;
            text-align: center;
        }

        .payment-item {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            padding: 12px;
            background-color: #f9f9f9;
            border-radius: 8px;
            border-left: 4px solid var(--secondary-color);
        }

        .payment-item .delete-btn {
            cursor: pointer;
            color: var(--danger-color);
            font-weight: bold;
            font-size: 1.2rem;
            transition: all 0.3s ease;
        }

        .payment-item .delete-btn:hover {
            transform: scale(1.2);
        }

        .receipt-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #333;
        }

        .receipt-header-left {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .receipt-header-right {
            text-align: right;
        }

        .receipt-logo-container {
            flex-shrink: 0;
        }

        .receipt-logo-container .logo-placeholder,
        .receipt-logo-container .school-logo {
            width: 60px;
            height: 60px;
            margin: 0;
        }

        .receipt-logo-container .logo-placeholder {
            font-size: 9px;
            border-width: 1px;
        }

        .receipt-school-info {
            text-align: left;
        }

        .receipt-school-info h3 {
            margin: 0;
            font-size: 1.3em;
            font-weight: bold;
            color: #333;
        }

        .receipt-school-info h4 {
            margin: 5px 0 0 0;
            font-size: 1em;
            color: #666;
            font-weight: normal;
        }

        .receipt-id-status {
            font-size: 0.95em;
            margin: 5px 0 0 0;
        }

        .receipt-details {
            margin-bottom: 20px;
        }

        .receipt-table {
            width: 100%;
            margin-bottom: 20px;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        .receipt-table th,
        .receipt-table td {
            padding: 12px;
            border-bottom: 1px solid #ddd;
        }

        .receipt-table th {
            background-color: var(--primary-color);
            color: white;
        }

        .receipt-table tfoot .total-amount-row td {
            background-color: var(--primary-color);
            color: white;
            font-size: 1.1em;
            border-top: 2px solid var(--primary-color);
        }

        .receipt-table tfoot .balance-due-row td {
            background-color: #f0f0f0;
            /* Light gray for contrast */
            font-weight: bold;
        }

        .receipt-footer {
            margin-top: 30px;
            text-align: center;
            font-size: 0.9em;
            color: #666;
        }

        .logo-placeholder.has-logo {
            border: none;
            background-color: transparent;
        }

        .school-logo {
            max-width: 100px;
            max-height: 100px;
            object-fit: contain;
        }

        .token-card {
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 15px;
            margin: 10px;
            text-align: center;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            break-inside: avoid;
            page-break-inside: avoid;
        }

        .token-value {
            font-size: 18px;
            font-weight: bold;
            letter-spacing: 1px;
            margin: 10px 0;
        }

        .token-details {
            font-size: 12px;
            color: #666;
        }

        @media print {
            .token-card {
                border: 1px solid #000;
                box-shadow: none;
            }
        }

        .installment-history {
            margin-top: 20px;
            padding: 15px;
            background-color: #f8f9fa;
            border-radius: 8px;
        }

        .installment-item {
            padding: 12px;
            margin-bottom: 10px;
            background-color: white;
            border-left: 4px solid var(--secondary-color);
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .quick-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 20px;
        }

        .quick-action-btn {
            flex: 1;
            min-width: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 15px;
            border-radius: 8px;
            background-color: white;
            border: 1px solid var(--border-color);
            transition: all 0.3s ease;
            text-decoration: none;
            color: var(--dark-color);
            font-weight: 600;
        }

        .quick-action-btn:hover {
            background-color: var(--secondary-color);
            color: white;
            transform: translateY(-3px);
            text-decoration: none;
        }

        .quick-action-btn i {
            font-size: 1.5rem;
        }

        .filter-section {
            background-color: #f8f9fa;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .search-box {
            position: relative;
        }

        .search-box .form-control {
            padding-left: 40px;
        }

        .search-box i {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: #6c757d;
        }

        .empty-state {
            text-align: center;
            padding: 50px 20px;
            color: #6c757d;
        }

        .empty-state i {
            font-size: 4rem;
            margin-bottom: 20px;
            color: #dee2e6;
        }

        .empty-state h4 {
            margin-bottom: 10px;
            color: #6c757d;
        }

        .pagination-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 20px;
        }

        .page-info {
            color: #6c757d;
            font-weight: 500;
        }

        /* FIX: Payment Type Select Dropdown */
        #paymentType {
            display: block !important;
            width: 100% !important;
            opacity: 1 !important;
            visibility: visible !important;
            z-index: 1000 !important;
            position: relative !important;
            background-color: white !important;
        }

        .tm-admin-modal-content .form-select {
            background-color: white !important;
            border: 1px solid #dee2e6 !important;
            border-radius: 8px !important;
            padding: 12px 15px !important;
            /* Explicitly set z-index and position to ensure it's above other elements */
            position: relative !important;
            z-index: 1001 !important;
            /* Above the modal content z-index */
            height: auto !important;
            /* Ensure height is not fixed to a small value */
        }

        .tm-admin-modal-content .form-select:focus {
            border-color: var(--secondary-color) !important;
            box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25) !important;
        }

        /* Ensure the dropdown itself is not hidden by overflow or z-index issues */
        .tm-admin-modal-content {
            overflow: visible !important;
        }

        /* Ensure the parent of the select is not causing issues */
        .col-md-6 {
            overflow: visible !important;
        }

        /* Payment Type Settings Styles */
        .payment-type-card {
            transition: all 0.3s ease;
            border-left: 4px solid var(--secondary-color);
        }

        .payment-type-card:hover {
            transform: translateY(-3px);
        }

        .payment-type-actions {
            display: flex;
            gap: 5px;
        }

        .payment-type-form {
            background-color: #f8f9fa;
            border-radius: 8px;
            padding: 20px;
        }

        .payment-type-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 15px;
            margin-bottom: 10px;
            background-color: white;
            border-radius: 8px;
            border-left: 4px solid var(--secondary-color);
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .payment-type-item:hover {
            background-color: #f8f9fa;
        }

        .payment-type-details {
            flex: 1;
        }

        .payment-type-name {
            font-weight: 600;
            margin-bottom: 5px;
        }

        .payment-type-amount {
            color: #666;
            font-size: 0.9rem;
        }

        .payment-type-category {
            background-color: var(--secondary-color);
            color: white;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.75rem;
            margin-left: 10px;
        }

        @media (max-width: 768px) {
            .nav-tabs-custom .nav-link {
                padding: 10px 15px;
                font-size: 0.9rem;
            }

            .card-body {
                padding: 20px;
            }

            .stat-card .card-body {
                padding: 20px 10px;
            }

            .quick-actions {
                flex-direction: column;
            }

            .quick-action-btn {
                min-width: 100%;
            }

            .student-card-footer {
                flex-direction: column;
            }

            .action-btn {
                margin-bottom: 10px;
            }

            .payment-type-actions {
                flex-direction: column;
            }
        }

        /* Premium Payment Type Cards */
        .payment-type-card-premium {
            border: none;
            border-radius: 12px;
            background: white;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            border-top: 4px solid var(--secondary-color);
            padding: 15px;
            margin-bottom: 15px;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .payment-type-card-premium:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        }

        .payment-type-image-v2 {
            width: 100%;
            height: 120px;
            object-fit: cover;
            border-radius: 8px;
            margin-bottom: 15px;
            background-color: #f8f9fa;
        }

        .payment-type-badge-category {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-weight: 700;
            padding: 4px 10px;
            border-radius: 4px;
            margin-bottom: 8px;
            display: inline-block;
            background-color: rgba(52, 152, 219, 0.1);
            color: var(--secondary-color);
        }

        .payment-type-price-tag {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 10px;
        }

        .payment-type-description-v2 {
            font-size: 0.85rem;
            color: #6c757d;
            margin-bottom: 15px;
            flex-grow: 1;
        }