:root {
    /* Color Palette - Premium Modern */
    --bg-body: #f4f6fa;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #3b82f6;
    /* Modern Blue */
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --border-color: #e2e8f0;

    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 80px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-progress {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
    /* Body remains hidden overflow because main-content handles scrolling */
    font-size: 0.9rem;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    transition: width 0.25s ease-out, padding 0.25s ease-out;
    z-index: 50;
    flex-shrink: 0;
    overflow: hidden;
    /* GPU acceleration for smooth animation */
    will-change: width;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.sidebar.collapsed {
    width: 80px;
    padding: 1.25rem 0.75rem;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-separator,
.sidebar.collapsed .nav-separator-text,
.sidebar.collapsed .logout-icon {
    display: none !important;
}

.sidebar.collapsed .logo-area {
    justify-content: center;
    margin-bottom: 2rem;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .nav-item i {
    font-size: 1.25rem;
    margin: 0;
}

#sidebar-toggle {
    margin-left: auto;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

#sidebar-toggle:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.sidebar.collapsed #sidebar-toggle {
    margin-left: 0;
}

.logo-area {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-separator {
    margin: 1rem 0 0.5rem;
    padding: 0 1rem;
}

.nav-separator-text {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    opacity: 0.7;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.95rem;
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background-color: #f1f5f9;
    color: var(--text-primary);
    transform: translateX(4px);
}

.sidebar.collapsed .nav-item:hover {
    transform: none;
    background-color: #eff6ff;
}

.nav-item.active {
    background-color: #eff6ff;
    color: var(--accent-color);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 3px;
    background-color: var(--accent-color);
    border-radius: 0 4px 4px 0;
}

.sidebar.collapsed .nav-item.active::before {
    display: none;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.nav-item:hover i {
    transform: scale(1.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    overflow: hidden;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent-color);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    /* Force scrollbar track always visible */
    position: relative;
    /* Performance optimization - isolate repaints */
    contain: layout style;
    will-change: auto;
}




h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    padding: 0;
    font-weight: inherit;
    font-size: inherit;
}

h1.page-title,
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.content-area {
    padding: 1.5rem;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Tables Styling */
.table-container {
    background: var(--bg-card);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-controls {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.search-bar input {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 250px;
    outline: none;
    font-size: 0.85rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    /* Prevent expensive layout recalculation */
    table-layout: fixed;
    contain: layout;
}

th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-normal {
    background: #dcfce7;
    color: #166534;
}

.status-warning {
    background: #fef9c3;
    color: #854d0e;
}

.status-critical {
    background: #fee2e2;
    color: #991b1b;
}

.status-blue {
    background: #eff6ff;
    color: #1e40af;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-buttons .btn-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    min-width: 32px;
}

.pagination-buttons .btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 0.75rem;
    color: var(--text-primary);
}

/* Views switching */
.section-view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.mobile-menu-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--bg-body);
}

.mobile-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        height: 100vh;
        z-index: 50;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        width: var(--sidebar-width) !important;
        padding: 1.25rem !important;
    }

    /* Force show all sidebar content on mobile */
    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
        padding: 1.25rem !important;
    }

    .sidebar .logo-text,
    .sidebar .nav-text,
    .sidebar .user-info,
    .sidebar .nav-separator,
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .nav-separator {
        display: block !important;
    }

    .sidebar .nav-item,
    .sidebar.collapsed .nav-item {
        justify-content: flex-start !important;
        padding: 0.75rem 1rem !important;
    }

    .sidebar .nav-item i,
    .sidebar.collapsed .nav-item i {
        margin-right: 1rem;
    }

    .sidebar .logo-area,
    .sidebar.collapsed .logo-area {
        justify-content: space-between !important;
        margin-bottom: 2rem !important;
    }

    /* Hide collapse toggle on mobile */
    .sidebar #sidebar-toggle {
        display: none;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    .data-actions {
        flex-direction: column;
    }

    .data-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Data Management Styles */
.data-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Edit Modal */
.modal-overlay {
    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: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Table Edit Button */
.btn-edit {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
}

.btn-edit:hover {
    background: var(--accent-hover);
}

/* CSR Status Checkbox Group */
.csr-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-body);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.csr-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.csr-checkbox-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.csr-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.csr-checkbox-item span {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* History Button */
.btn-history {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-history:hover {
    background: #4f46e5;
}

/* CSR History Modal Styling */
.csr-site-info-box {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.csr-site-info-row {
    display: flex;
    font-size: 0.9rem;
}

.csr-site-info-label {
    width: 100px;
    font-weight: 600;
    color: var(--text-secondary);
}

.csr-history-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    /* Prevent text wrapping */
}

#csrHistoryTable th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

#csrHistoryTable td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

#csrHistoryTable tr:last-child td {
    border-bottom: none;
}

/* Specific column widths for History Table */
#csrHistoryTable th:nth-child(1),
#csrHistoryTable td:nth-child(1) {
    width: 200px;
    /* Wider for Category Badge */
    min-width: 180px;
}

#csrHistoryTable th:nth-child(2),
#csrHistoryTable td:nth-child(2) {
    width: 150px;
    /* For Nominal */
    white-space: nowrap;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-body);
    border-radius: 0.5rem;
    display: none;
}

.upload-progress.active {
    display: block;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
    border-left: 4px solid var(--accent-color);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-icon {
    font-size: 1.25rem;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}



/* User Management Styles */
.btn-delete {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* User table specific styles */
#users-table-body tr:hover {
    background-color: #f8fafc;
}

#users-table .btn-edit,
#users-table .btn-delete {
    min-width: auto;
    white-space: nowrap;
}

/* Role badge colors */
.status-badge.role-superadmin {
    background: #fef2f2;
    color: #991b1b;
}

.status-badge.role-admin {
    background: #fef9c3;
    color: #854d0e;
}

/* Modal scrollable body */
.modal-body {
    max-height: calc(80vh - 140px);
    overflow-y: auto;
}

/* Form readonly inputs */
.form-group input[readonly] {
    background: #f0f0f0;
    cursor: not-allowed;
    color: var(--text-secondary);
}

/* Small text helper */
small {
    display: block;
    margin-top: 0.25rem;
}

/* --- CUSTOM LOADING SCREEN (FOP VSAT) --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Highest priority */
    transition: opacity 0.5s ease, visibility 0.5s;
    opacity: 1;
    visibility: visible;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Animated Title "FOP VSAT" */
.loading-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #2563eb 0%, #10b981 50%, #2563eb 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientText 3s linear infinite, floatTitle 2s ease-in-out infinite;
    margin: 0;
    padding: 0.5rem;
}

/* Progress Bar Container */
.loading-bar-container {
    width: 250px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Animated Progress Bar */
.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #2563eb, #10b981);
    border-radius: 99px;
    animation: loadingBar 1.5s ease-in-out infinite;
}

/* Status Text */
.loading-text {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 0.5px;
    min-height: 1.5em;
    /* Prevent layout shift */
    animation: pulseText 2s ease-in-out infinite;
}

/* Animations */
@keyframes gradientText {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes floatTitle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes loadingBar {
    0% {
        left: -40%;
        width: 40%;
    }

    50% {
        width: 60%;
    }

    100% {
        left: 100%;
        width: 40%;
    }
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}