/* public/student_portal/assets/css/portal.css */
:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f3f4f6;
    color: var(--text-main);
    line-height: 1.5;
}

/* Glassmorphism Utilities */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Login Page Specifics */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fff;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: none;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    position: fixed;
    height: 100vh;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: #eff6ff;
    color: var(--primary);
}

.nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.25rem;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info p {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

/* Tables */
.table-container {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f9fafb;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.9rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ===== BALANCE DETAILS REDESIGN STYLES ===== */

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-title i {
    color: var(--primary);
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Student Profile Card */
.student-profile-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: var(--shadow-md);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar i {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.profile-info {
    flex: 1;
}

.student-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.student-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.meta-item i {
    width: 16px;
}

.admin-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Enhanced Stats Section */
.stats-section {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.balance-card::before {
    background: var(--danger);
}

.paid-card::before {
    background: var(--success);
}

.total-card::before {
    background: var(--primary);
}

.status-card::before {
    background: var(--warning);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.balance-card .stat-icon {
    background: #fee2e2;
    color: var(--danger);
}

.paid-card .stat-icon {
    background: #d1fae5;
    color: var(--success);
}

.total-card .stat-icon {
    background: #e0e7ff;
    color: var(--primary);
}

.status-card .stat-icon {
    background: #fef3c7;
    color: var(--warning);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1rem 0;
}

.stat-progress {
    margin-top: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 1s ease-out;
    border-radius: 2px;
}

.progress-fill.success {
    background: var(--success);
}

.progress-fill.danger {
    background: var(--danger);
}

.stat-meta {
    margin-top: 0.5rem;
}

.stat-meta small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Content Grid Layout */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.content-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--primary);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 2px;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-all-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Enhanced Table Styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f9fafb;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.9rem;
}

.fee-row {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fee-name strong {
    color: #111827;
    font-weight: 600;
}

.fee-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.amount-due {
    font-weight: 500;
}

.amount-paid {
    color: var(--success);
    font-weight: 600;
}

.amount-outstanding {
    font-weight: 600;
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.due-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.actions {
    text-align: right;
}

/* Payments List */
.payments-list {
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.payment-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: background 0.2s;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.payment-item:hover {
    background: #f3f4f6;
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.payment-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
}

.payment-amount {
    font-weight: 700;
    color: var(--success);
    font-size: 0.9rem;
}

.payment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.payment-date,
.payment-receipt {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Analytics Section */
.analytics-section {
    margin-bottom: 2rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    background: #fff;
    color: #374151;
}

.chart-container {
    padding: 1.5rem;
    height: 300px;
    position: relative;
}

.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-muted);
}

.chart-error i {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.help-icon {
    width: 48px;
    height: 48px;
    background: #0ea5e9;
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.help-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0c4a6e;
    margin: 0 0 0.5rem 0;
}

.help-content p {
    color: #0369a1;
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
}

.help-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Loading and Empty States */
.loading-state,
.empty-state,
.error-state,
.admin-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.loading-state i,
.empty-state i,
.error-state i,
.admin-message i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.error-state i {
    color: var(--danger);
}

.admin-message i {
    color: #6366f1;
}

.loading-state h4,
.empty-state h4,
.error-state h4,
.admin-message h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.loading-state p,
.empty-state p,
.error-state p,
.admin-message p {
    margin: 0;
    font-size: 0.9rem;
}

.loading-row td {
    padding: 2rem !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.contact-item i {
    width: 20px;
    color: var(--primary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    text-align: center;
    color: var(--primary);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-section {
        order: -1;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .student-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-tabs {
        justify-content: center;
    }

    .help-card {
        flex-direction: column;
        text-align: center;
    }

    .help-actions {
        justify-content: center;
    }

    .modal-content {}

    .modal-close {
        background: none;
        border: none;
        font-size: 1.25rem;
        color: var(--text-muted);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 6px;
        transition: background 0.2s;
    }

    .modal-close:hover {
        background: #f3f4f6;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .contact-info {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }

    .contact-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
        background: #f9fafb;
        border-radius: 8px;
    }

    .contact-item i {
        width: 20px;
        color: var(--primary);
    }

    /* Loading Overlay */
    .loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        backdrop-filter: blur(4px);
    }

    .loading-spinner {
        text-align: center;
        color: var(--primary);
    }

    .loading-spinner i {
        font-size: 2rem;
        margin-bottom: 1rem;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        from {
            transform: rotate(0deg);
        }

        to {
            transform: rotate(360deg);
        }
    }

    .loading-spinner p {
        font-size: 0.9rem;
        color: var(--text-muted);
        margin: 0;
    }

    /* Responsive Design */
    @media (max-width: 1200px) {
        .content-grid {
            grid-template-columns: 1fr;
        }

        .sidebar-section {
            order: -1;
        }
    }

    @media (max-width: 768px) {
        .page-header {
            flex-direction: column;
            align-items: stretch;
            gap: 1rem;
        }

        .header-actions {
            justify-content: flex-start;
            flex-wrap: wrap;
        }

        .stats-grid {
            grid-template-columns: 1fr;
        }

        .student-meta {
            flex-direction: column;
            gap: 0.75rem;
        }

        .profile-header {
            flex-direction: column;
            text-align: center;
            gap: 1rem;
        }

        .card-header {
            flex-direction: column;
            gap: 1rem;
            align-items: stretch;
        }

        .filter-tabs {
            justify-content: center;
        }

        .help-card {
            flex-direction: column;
            text-align: center;
        }

        .help-actions {
            justify-content: center;
        }

        .modal-content {
            width: 95%;
            margin: 1rem;
        }
    }

    @media (max-width: 480px) {
        .main-content {
            padding: 1rem;
        }

        .stats-grid {
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .stat-card {
            padding: 1rem;
        }

        .stat-value {
            font-size: 1.5rem;
        }

        .data-table th,
        .data-table td {
            padding: 0.75rem;
            font-size: 0.8rem;
        }

        .tab-btn {
            padding: 0.375rem 0.75rem;
            font-size: 0.7rem;
        }
    }

    /* Mobile Sidebar & Navigation Styles */
    @media (max-width: 768px) {
        .app-container {
            flex-direction: column;
        }

        .sidebar {
            transform: translateX(-100%);
            transition: transform 0.3s ease-in-out;
            z-index: 50;
            width: 280px;
            box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
        }

        .sidebar.open {
            transform: translateX(0);
        }

        .main-content {
            margin-left: 0;
            padding: 1rem;
            width: 100%;
        }

        #menuToggle {
            display: block !important;
            background: transparent;
            color: var(--text-main);
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 60;
        }

        /* Utilities */
        .md-hidden {
            display: block !important;
        }

        .md-visible {
            display: none !important;
        }
    }

    /* Overlay for mobile sidebar */
    #sidebarOverlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        backdrop-filter: blur(4px);
    }

    #sidebarOverlay.hidden {
        display: none;
    }

    /* Profile Grid */
    .profile-grid {
        display: grid;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 9999;
        backdrop-filter: blur(4px);
    }

    .loading-spinner {
        text-align: center;
        color: var(--primary);
    }

    .loading-spinner i {
        font-size: 2rem;
        margin-bottom: 1rem;
        animation: spin 1s linear infinite;
    }

    @keyframes spin {
        from {
            transform: rotate(0deg);
        }

        to {
            transform: rotate(360deg);
        }
    }

    .loading-spinner p {
        font-size: 0.9rem;
        color: var(--text-muted);
        margin: 0;
    }

    /* Responsive Design */
    @media (max-width: 1200px) {
        .content-grid {
            grid-template-columns: 1fr;
        }

        .sidebar-section {
            order: -1;
        }
    }

    @media (max-width: 768px) {
        .page-header {
            flex-direction: column;
            align-items: stretch;
            gap: 1rem;
        }

        .header-actions {
            justify-content: flex-start;
            flex-wrap: wrap;
        }

        .stats-grid {
            grid-template-columns: 1fr;
        }

        .student-meta {
            flex-direction: column;
            gap: 0.75rem;
        }

        .profile-header {
            flex-direction: column;
            text-align: center;
            gap: 1rem;
        }

        .card-header {
            flex-direction: column;
            gap: 1rem;
            align-items: stretch;
        }

        .filter-tabs {
            justify-content: center;
        }

        .help-card {
            flex-direction: column;
            text-align: center;
        }

        .help-actions {
            justify-content: center;
        }

        .modal-content {
            width: 95%;
            margin: 1rem;
        }
    }

    @media (max-width: 480px) {
        .main-content {
            padding: 1rem;
        }

        .stats-grid {
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .stat-card {
            padding: 1rem;
        }

        .stat-value {
            font-size: 1.5rem;
        }

        .data-table th,
        .data-table td {
            padding: 0.75rem;
            font-size: 0.8rem;
        }

        .tab-btn {
            padding: 0.375rem 0.75rem;
            font-size: 0.7rem;
        }
    }

    /* Mobile Sidebar & Navigation Styles */
    @media (max-width: 768px) {
        .app-container {
            flex-direction: column;
        }

        .sidebar {
            transform: translateX(-100%);
            transition: transform 0.3s ease-in-out;
            z-index: 50;
            width: 280px;
            box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
        }

        .sidebar.open {
            transform: translateX(0);
        }

        .main-content {
            margin-left: 0;
            padding: 1rem;
            width: 100%;
        }

        #menuToggle {
            display: block !important;
            background: transparent;
            color: var(--text-main);
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            position: fixed;
            top: 1rem;
            right: 1rem;
            z-index: 60;
        }

        /* Utilities */
        .md-hidden {
            display: block !important;
        }

        .md-visible {
            display: none !important;
        }
    }

    /* Overlay for mobile sidebar */
    #sidebarOverlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 40;
        backdrop-filter: blur(4px);
    }

    #sidebarOverlay.hidden {
        display: none;
    }

    /* Profile Grid */
    .profile-grid {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 2rem;
    }

    @media (max-width: 768px) {
        .profile-grid {
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }

        #paymentOverviewCard {
            display: none;
        }
    }