nav.navbar {
    position: static !important;
    min-height: 56px;
}

main.app-container {
    padding-top: 4rem !important;
}
/* ===================== AJUSTES FILTROS AVANÇADOS ===================== */
.filters-container, .filter-summary, .filters-body, .filter-card, .summary-item {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    word-break: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.summary-number, .summary-label, .summary-icon, .filter-card-title, .filter-card-subtitle, .filter-card-body, .summary-content {
    word-break: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.filters-title, .filters-subtitle, .summary-label, .summary-number, .summary-icon, .filter-card-title, .filter-card-subtitle {
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}
.filters-body, .filter-summary {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
.filter-card {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

nav.navbar {
     margin-bottom: 1.5rem !important;
     z-index: 1040;
}
/* ===================== MELHORIAS MOBILE ===================== */
@media (max-width: 575.98px) {
    html, body {
        font-size: 15px;
    }
    .main-wrapper, .app-container .main-wrapper {
        padding: 0.25rem !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        overflow-x: auto !important;
    }
    .container-fluid, .filters-container, .results-container, .filter-card, .stat-card, .chart-card {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        box-sizing: border-box;
        max-width: 100vw !important;
        min-width: 0 !important;
        overflow-x: auto !important;
    }
    .filters-header, .results-header, .filters-body, .chart-card-body, .stat-card-content, .filter-card-body {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        font-size: 0.98em;
    }
    .summary-item, .filter-card, .stat-card, .chart-card {
        flex-direction: column !important;
        align-items: flex-start !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }
    .summary-number, .stat-number {
        font-size: 1.2rem !important;
        word-break: break-word !important;
    }
    .filters-title, .chart-title, .results-title {
        font-size: 1.1rem !important;
        word-break: break-word !important;
    }
    .filters-subtitle, .chart-subtitle, .results-subtitle {
        font-size: 0.95rem !important;
        word-break: break-word !important;
    }
    input, select, textarea {
        font-size: 1em !important;
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    table, th, td {
        font-size: 0.95em !important;
        word-break: break-word !important;
        min-width: 0 !important;
    }
    .table-responsive, .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-width: 100vw !important;
    }
    .btn, button {
        font-size: 1em !important;
        padding: 0.5rem 0.75rem !important;
        min-width: 0 !important;
        word-break: break-word !important;
    }
}
/* ===================== MELHORIAS GERAIS ===================== */

/* Foco visível para acessibilidade */
button:focus, .btn:focus, a:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.2);
    transition: box-shadow 0.2s;
}

/* Transições suaves para botões, cards e elementos interativos */
.btn, .stat-card, .chart-card, .filter-card, .summary-item, .filters-container, .results-container {
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

/* Utilitários de espaçamento (exemplo, pode expandir conforme necessidade) */
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* Padronização de bordas e sombras */
.rounded-md { border-radius: 0.75rem !important; }
.shadow-light { box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important; }
.shadow-medium { box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important; }
.shadow-heavy { box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important; }

/* Scrollbar refinado para todos navegadores modernos */
* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

/* Comentários para manutenção */
/*
    .btn, .stat-card, .chart-card, .filter-card, .summary-item, .filters-container, .results-container:
        - Transições suaves para hover/focus
    .rounded-md, .shadow-light, .shadow-medium, .shadow-heavy:
        - Utilitários para padronizar bordas e sombras
    .mb-2, .mb-3, .mt-2, .mt-3, .px-2, .px-3, .py-2, .py-3:
        - Utilitários de espaçamento
    Foco visível:
        - Melhora navegação por teclado e acessibilidade
    Scrollbar refinado:
        - Aparência consistente em todos navegadores
*/
/* Estilos globais do projeto (responsividade e controle do accordion) */

/* Garante que o conteúdo principal ocupe a tela, ajuste o valor conforme seu header/nav */
.full-height {
	min-height: calc(100vh - 120px);
}

/* Limita altura do corpo do accordion e permite rolagem interna para evitar empurrar o layout */
.accordion-body-scroll {
	max-height: 45vh;
	overflow: auto;
}

/* Ajustes responsivos: em telas menores o accordion pode ter limite menor */
@media (max-width: 767.98px) {
	.accordion-body-scroll {
		max-height: 60vh;
	}
	/* Garante que cards dentro de colunas ocupem 100% da largura em mobile */
	.card.w-100 { width: 100% !important; }
}

/* Pequenas melhorias visuais */
.card.mb-3 { margin-bottom: 1rem; }


html, body {
  height: 100%;
  margin: 0;
}

body {
    min-height: 100vh; /* garante ocupar a viewport inteira */
}

/* Header e footer mantêm altura natural */
header, footer {
  flex: 0 0 auto; /* não crescem nem encolhem */
}

/* Main (ou a sua div.container) ocupa todo o espaço restante */
main, .app-container { /* substitua .app-container pela sua div.container se preferir */
    min-height: 60vh; /* garante que o conteúdo principal apareça */
    overflow: auto; /* permite rolagem apenas na área principal */
}

/* App Container - responsivo e flexível */
.app-container {
  margin: 1rem auto;
  margin-bottom: 1rem auto;
  margin-top: 3px;
  width: 100%;
  max-width: 1140px; /* Bootstrap 5 XL breakpoint */
  padding: 0 0.75rem;
}

/* ===== ESTILOS DA PÁGINA MAIN ===== */

/* Main Wrapper - Design system responsivo */
main .main-wrapper,
.app-container .main-wrapper {
    background: white;
    max-width: 1140px;
    width: 100%;
    min-height: 100vh;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.125);
     overflow: visible;
     /* Garantir que o wrapper contenha elementos flutuantes e não colapse
         usando flow-root (substitui clearfix manual) */
     display: flow-root;
}

/* Responsive adjustments - Bootstrap 5 breakpoints */
@media (max-width: 767.98px) {
    main .main-wrapper,
    .app-container .main-wrapper {
        margin: 0.75rem auto;
        border-radius: 0.5rem;
        max-width: calc(100% - 1.5rem);
        min-height: auto;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 575.98px) {
    main .main-wrapper,
    .app-container .main-wrapper {
        margin: 0.5rem auto;
        border-radius: 0.375rem;
        max-width: calc(100% - 1rem);
    }
    
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* Modern UX/UI Improvements */

/* Root Variables */
:root {
    --primary-color: #0d6efd;
    --primary-rgb: 13, 110, 253;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --shadow-light: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-medium: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.stat-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.bg-gradient-primary { background: var(--primary-gradient); }
.bg-gradient-success { background: var(--success-gradient); }
.bg-gradient-warning { background: var(--warning-gradient); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.stat-progress {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* Chart Card */
.chart-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.chart-card-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.chart-subtitle {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.chart-card-body {
    padding: 2rem;
}

.chart-wrapper {
    min-height: 350px;
}

.chart-legend-wrapper {
    padding-left: 1rem;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chart-legend li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: #495057;
}

/* Filters Container */
.filters-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.filters-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.filters-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.filters-subtitle {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.filters-actions .btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

/* Filter Summary */
.filter-summary {
    padding: 2rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.summary-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.summary-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    transition: all 0.3s ease;
}

/* Animação de destaque quando o número muda */
.summary-number.highlight-change {
    transform: scale(1.2);
    color: #0d6efd;
    text-shadow: 0 0 8px rgba(13, 110, 253, 0.3);
}

.summary-label {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Filter Cards */
.filters-body {
    padding: 2rem;
}

.filter-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    transition: var(--transition);
    height: 100%;
}

.filter-card:hover {
    border-color: #0d6efd;
    box-shadow: var(--shadow-light);
}

.filter-card-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #f1f3f4;
}

/* Controles da Tabela CNAE */
.cnae-controls {
    background: #f8f9fa;
    border-radius: var(--border-radius-small);
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.cnae-controls .form-floating > label {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.filter-card-subtitle {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.filter-card-body {
    padding: 1.5rem;
}

.filter-card-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Table Container */
.table-container {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    width: 100% !important;
    box-sizing: border-box;
}

.custom-table {
    margin-bottom: 0;
    font-size: 0.9rem;
    width: 100% !important;
    table-layout: auto;
}

/* Garantir que a tabela de CNAE ocupe toda largura disponível */
#cnaeTable {
    width: 100% !important;
    min-width: 100%;
}

/* Forçar larguras das colunas da tabela CNAE */
#cnaeTable th:nth-child(1) {
    width: 50px !important;
    min-width: 50px;
    max-width: 50px;
}

#cnaeTable th:nth-child(2) {
    width: 120px !important;
    min-width: 120px;
    max-width: 120px;
}

#cnaeTable th:nth-child(3) {
    width: auto !important;
    min-width: 200px;
}

.custom-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cnae-row:hover {
    background-color: #f8f9fa;
}

.cnae-description {
    color: #495057;
    line-height: 1.4;
}

/* States Grid - Duas colunas fixas */
.location-section .states-container .states-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* Duas colunas iguais - forçado */
    grid-auto-flow: row !important;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Garantir que cada item do estado ocupe apenas uma célula */
.states-grid .state-item {
    display: block !important;
    width: 100% !important;
}

.state-item .btn {
    width: 100%;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 0.25rem;
    border-radius: 6px;
    transition: var(--transition);
}

.state-item .btn-check:checked + .btn {
    background: #0d6efd;
    border-color: #0d6efd;
    color: white;
    transform: scale(1.05);
}

/* Botões de localização menores */
.state-item .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 45px;
    text-align: center;
}

/* Section Titles */
.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* Location Section */
.location-section {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Results Container */
.results-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.results-subtitle {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.results-body {
    background: white;
}

/* Results Table */
.results-table {
    margin-bottom: 0;
}

.results-table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    padding: 1rem 0.75rem;
}

.results-table tbody tr:hover {
    background-color: #f8f9fa;
}

.results-table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

/* Loading State */
.loading-state {
    padding: 4rem 2rem;
    text-align: center;
    background: white;
}

.loading-content {
    max-width: 300px;
    margin: 0 auto;
}

.loading-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Empty State */
.empty-state-content {
    padding: 2rem;
}

.empty-state-content i {
    opacity: 0.3;
}

/* Pagination */
.pagination-container {
    padding: 1.5rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    font-size: 0.9rem;
}

/* Form Improvements */
.form-floating > label {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* CEP Result */
.cep-result {
    font-size: 0.8rem;
    color: #6c757d;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* Responsive Improvements - Bootstrap 5 breakpoints */
@media (max-width: 767.98px) {
    .filters-header, .results-header {
        padding: 1rem;
    }

    .filters-body {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .chart-card-body {
        padding: 1rem;
    }

    .states-container .states-grid {
        grid-template-columns: 1fr 1fr !important; /* Mantém duas colunas em mobile - forçado */
    }

    .results-table {
        font-size: 0.8rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Custom Scrollbars */
.table-container::-webkit-scrollbar,
.states-grid::-webkit-scrollbar {
    width: 6px;
}

.table-container::-webkit-scrollbar-track,
.states-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb,
.states-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.states-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========================================
   LOADING OVERLAY - GLOBAL SCREEN LOADER
======================================== */
.global-loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    z-index: 999999 !important; /* Z-index máximo */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    pointer-events: none; /* Inicialmente não bloqueia */
}

.global-loading-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important; /* Bloqueia cliques quando ativo */
}

.loading-content-overlay {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    width: 90%;
    animation: loadingPulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1000000; /* Z-index ainda maior para o conteúdo */
}

.loading-gif {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 50%;
}

.loading-title-overlay {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.loading-subtitle-overlay {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 0;
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Loading spinner para quando não houver GIF */
.loading-spinner-overlay {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(var(--primary-rgb), 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== DESIGN SYSTEM RESPONSIVO ===== */



/* ===== OVERLAY DE LOADING OTIMIZADO PARA PERFORMANCE ===== */
.main-loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.97), rgba(255, 255, 255, 0.95)) !important;
    backdrop-filter: blur(8px) !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: all !important;
    will-change: opacity, visibility !important;
}

.main-loading-overlay.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.main-loading-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    max-width: 380px;
    width: 90%;
    border: 1px solid rgba(0, 123, 255, 0.2);
    backdrop-filter: blur(10px);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.main-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e8f4ff;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: mainLoadingSpin 0.8s linear infinite;
    margin: 0 auto 1.2rem auto;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.2);
}

@keyframes mainLoadingSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.main-loading-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.main-loading-subtitle {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.main-loading-progress {
    width: 100%;
    height: 6px;
    background: #f1f3f4;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.main-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745, #007bff);
    background-size: 200% 100%;
    border-radius: 8px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.main-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.main-loading-step {
    color: #495057;
    font-size: 0.85rem;
    font-style: italic;
    display: block;
}
