/**
 * Estilos para DataTableAnalytics
 * Sistema de análises avançadas para DataTables
 * Layout: Sidebar + Content Area
 */

/* ============================================
   MODAL BASE
   ============================================ */
#datatableAnalyticsModal .modal-dialog {
    max-width: 100%;
    height: 100%;
    margin: 0;
}

#datatableAnalyticsModal .modal-content {
    height: 100%;
    border-radius: 0;
    border: none;
}

#datatableAnalyticsModal .modal-body {
    padding: 0;
    overflow: hidden;
}

/* ============================================
   CONTAINER PRINCIPAL (Flexbox Sidebar + Content)
   ============================================ */
.analytics-container {
    display: flex;
    height: calc(100vh - 120px);
    overflow: hidden;
}

/* ============================================
   SIDEBAR DE NAVEGAÇÃO
   ============================================ */
.analytics-sidebar {
    width: 320px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 2px solid #dee2e6;
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.analytics-sidebar::-webkit-scrollbar {
    width: 6px;
}

.analytics-sidebar::-webkit-scrollbar-track {
    background: #e9ecef;
}

.analytics-sidebar::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.analytics-sidebar::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Header do Sidebar */
.sidebar-header {
    padding: 1.5rem 1.25rem;
    background: #6B21A8;
    color: #fff;
    border-bottom: 3px solid #4C1D95;
}

.sidebar-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-header i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Categorias do Sidebar */
.sidebar-category {
    margin-bottom: 0.5rem;
}

.category-title {
    padding: 1rem 1.25rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #495057;
    letter-spacing: 0.5px;
    background: transparent;
}

.category-title i {
    margin-right: 0.5rem;
    color: #6B21A8;
}

/* Menu Items */
.sidebar-menu {
    padding: 0;
}

.analytics-sidebar .sidebar-item {
    padding: 1rem 1.25rem;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    background: transparent;
}

.analytics-sidebar .sidebar-item:hover:not(.disabled) {
    background: #fff;
    border-left-color: #6B21A8;
    transform: translateX(4px);
}

.analytics-sidebar .sidebar-item.active {
    background: #fff;
    border-left-color: #6B21A8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.analytics-sidebar .sidebar-item.active::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #6B21A8;
    border-radius: 50%;
}

.analytics-sidebar .sidebar-item.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.analytics-sidebar .sidebar-item.disabled:hover {
    background: transparent;
    border-left-color: transparent;
    transform: none;
}

.analytics-sidebar .sidebar-item i {
    font-size: 1.2rem;
    color: #6B21A8;
    margin-right: 0.75rem;
    width: 24px;
    text-align: center;
}

.analytics-sidebar .sidebar-item span {
    display: block;
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.analytics-sidebar .sidebar-item small {
    display: block;
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: 32px;
}

.analytics-sidebar .sidebar-item.disabled small {
    color: #adb5bd;
}

/* ============================================
   ÁREA DE CONTEÚDO PRINCIPAL
   ============================================ */
.analytics-content {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    padding: 2rem;
}

.analytics-content::-webkit-scrollbar {
    width: 8px;
}

.analytics-content::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.analytics-content::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

.analytics-content::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ============================================
   TELA DE BOAS-VINDAS
   ============================================ */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.welcome-icon {
    font-size: 5rem;
    color: #6B21A8;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.welcome-screen h4 {
    color: #212529;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.welcome-screen p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.welcome-tips {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
    text-align: left;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #6B21A8;
    transition: all 0.3s ease;
}

.tip-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.tip-item i {
    font-size: 1.5rem;
    color: #6B21A8;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.tip-item span {
    flex: 1;
    color: #495057;
    line-height: 1.6;
}

/* ============================================
   CONTEÚDO DAS ANÁLISES
   ============================================ */
#analyticsContent .card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#analyticsContent .card-title {
    color: #6B21A8;
    font-weight: 600;
    border-bottom: 2px solid #6B21A8;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Container do Gráfico */
#comparisonChartContainer {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Container da Tabela de Comparação */
#comparisonTableContainer {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

#comparisonTable {
    width: 100% !important;
    margin: 0 !important;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

#comparisonTable thead th {
    background: #6B21A8;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    padding: 0.75rem;
    border: none;
}

#comparisonTable tbody tr {
    transition: all 0.2s ease;
}

#comparisonTable tbody tr:hover {
    background: #e9ecef;
    transform: scale(1.01);
}

#comparisonTable tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
}

#comparisonTable tbody tr:last-child td {
    border-bottom: none;
}

/* Botão Toggle Tabela/Gráfico */
#toggleViewBtn {
    transition: all 0.3s ease;
}

#toggleViewBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 33, 168, 0.3);
}

/* Formulários */
#analyticsContent .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

#analyticsContent .form-select,
#analyticsContent .form-control {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

#analyticsContent .form-select:focus,
#analyticsContent .form-control:focus {
    border-color: #6B21A8;
    box-shadow: 0 0 0 0.2rem rgba(107, 33, 168, 0.25);
}

#analyticsContent small.text-muted {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

#btnApplyTransform{
    background-color: #4C1D95 !important;
    color: #fff !important;
}

#btnApplyDeduplication{
    background-color: #4C1D95 !important;
    color: #fff !important;
}

/* Botões de Ação */
#generateComparisonBtn,
#downloadComparisonBtn {
    transition: all 0.3s ease;
}

#generateComparisonBtn:hover,
#downloadComparisonBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */
[data-bs-theme="dark"] .analytics-sidebar,
.theme-dark .analytics-sidebar,
body.dark-mode .analytics-sidebar {
    background: linear-gradient(180deg, #2b2b2b 0%, #1a1a1a 100%);
    border-right-color: #444;
}

[data-bs-theme="dark"] .sidebar-header,
.theme-dark .sidebar-header,
body.dark-mode .sidebar-header {
    background: #4C1D95;
    border-bottom-color: #3b1578;
}

[data-bs-theme="dark"] .category-title,
.theme-dark .category-title,
body.dark-mode .category-title {
    color: #ccc;
}

[data-bs-theme="dark"] .analytics-sidebar .sidebar-item span,
.theme-dark .analytics-sidebar .sidebar-item span,
body.dark-mode .analytics-sidebar .sidebar-item span {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .analytics-sidebar .sidebar-item small,
.theme-dark .analytics-sidebar .sidebar-item small,
body.dark-mode .analytics-sidebar .sidebar-item small {
    color: #999;
}

[data-bs-theme="dark"] .analytics-sidebar .sidebar-item:hover:not(.disabled),
[data-bs-theme="dark"] .analytics-sidebar .sidebar-item.active,
.theme-dark .analytics-sidebar .sidebar-item:hover:not(.disabled),
.theme-dark .analytics-sidebar .sidebar-item.active,
body.dark-mode .analytics-sidebar .sidebar-item:hover:not(.disabled),
body.dark-mode .analytics-sidebar .sidebar-item.active {
    background: #333;
}

[data-bs-theme="dark"] .analytics-content,
.theme-dark .analytics-content,
body.dark-mode .analytics-content {
    background: #2b2b2b;
}

[data-bs-theme="dark"] .welcome-screen h4,
.theme-dark .welcome-screen h4,
body.dark-mode .welcome-screen h4 {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .tip-item,
.theme-dark .tip-item,
body.dark-mode .tip-item {
    background: #333;
    border-left-color: #A78BFA;
}

[data-bs-theme="dark"] .tip-item:hover,
.theme-dark .tip-item:hover,
body.dark-mode .tip-item:hover {
    background: #3a3a3a;
}

[data-bs-theme="dark"] .tip-item span,
.theme-dark .tip-item span,
body.dark-mode .tip-item span {
    color: #ccc;
}

[data-bs-theme="dark"] #analyticsContent .card,
.theme-dark #analyticsContent .card,
body.dark-mode #analyticsContent .card {
    background: #333;
    border-color: #444;
    color: #e0e0e0;
}

[data-bs-theme="dark"] #analyticsContent .card-title,
.theme-dark #analyticsContent .card-title,
body.dark-mode #analyticsContent .card-title {
    color: #A78BFA;
    border-bottom-color: #A78BFA;
}

[data-bs-theme="dark"] #comparisonChartContainer,
.theme-dark #comparisonChartContainer,
body.dark-mode #comparisonChartContainer {
    background: #2b2b2b;
    border-color: #444;
}

[data-bs-theme="dark"] #comparisonTableContainer,
.theme-dark #comparisonTableContainer,
body.dark-mode #comparisonTableContainer {
    background: #2b2b2b;
    border-color: #444;
}

[data-bs-theme="dark"] #comparisonTable,
.theme-dark #comparisonTable,
body.dark-mode #comparisonTable {
    background: #333;
    color: #e0e0e0;
}

[data-bs-theme="dark"] #comparisonTable thead th,
.theme-dark #comparisonTable thead th,
body.dark-mode #comparisonTable thead th {
    background: #4C1D95;
    color: #fff;
}

[data-bs-theme="dark"] #comparisonTable tbody tr:hover,
.theme-dark #comparisonTable tbody tr:hover,
body.dark-mode #comparisonTable tbody tr:hover {
    background: #3a3a3a;
}

[data-bs-theme="dark"] #comparisonTable tbody td,
.theme-dark #comparisonTable tbody td,
body.dark-mode #comparisonTable tbody td {
    border-bottom-color: #444;
    color: #e0e0e0;
}

[data-bs-theme="dark"] #analyticsContent .form-label,
.theme-dark #analyticsContent .form-label,
body.dark-mode #analyticsContent .form-label {
    color: #ccc;
}

[data-bs-theme="dark"] #analyticsContent .form-select,
[data-bs-theme="dark"] #analyticsContent .form-control,
.theme-dark #analyticsContent .form-select,
.theme-dark #analyticsContent .form-control,
body.dark-mode #analyticsContent .form-select,
body.dark-mode #analyticsContent .form-control {
    background: #444;
    color: #e0e0e0;
    border-color: #555;
}

[data-bs-theme="dark"] #analyticsContent .form-select:focus,
[data-bs-theme="dark"] #analyticsContent .form-control:focus,
.theme-dark #analyticsContent .form-select:focus,
.theme-dark #analyticsContent .form-control:focus,
body.dark-mode #analyticsContent .form-select:focus,
body.dark-mode #analyticsContent .form-control:focus {
    background: #555;
    border-color: #5dade2;
    box-shadow: 0 0 0 0.2rem rgba(93, 173, 226, 0.25);
}

[data-bs-theme="dark"] #analyticsContent small.text-muted,
.theme-dark #analyticsContent small.text-muted,
body.dark-mode #analyticsContent small.text-muted {
    color: #999 !important;
}

/* Drill-Down - Dark Mode */
[data-bs-theme="dark"] #drillBreadcrumbContainer,
.theme-dark #drillBreadcrumbContainer,
body.dark-mode #drillBreadcrumbContainer {
    background: #2d3748;
    border-color: #4a5568;
}

[data-bs-theme="dark"] #drillBreadcrumb .breadcrumb-link,
.theme-dark #drillBreadcrumb .breadcrumb-link,
body.dark-mode #drillBreadcrumb .breadcrumb-link {
    color: #5dade2;
}

[data-bs-theme="dark"] #drillBreadcrumb .breadcrumb-link:hover,
.theme-dark #drillBreadcrumb .breadcrumb-link:hover,
body.dark-mode #drillBreadcrumb .breadcrumb-link:hover {
    background: #4a5568;
    color: #81d4fa;
}

[data-bs-theme="dark"] #drillBreadcrumb .breadcrumb-item.active,
.theme-dark #drillBreadcrumb .breadcrumb-item.active,
body.dark-mode #drillBreadcrumb .breadcrumb-item.active {
    color: #cbd5e0;
}

[data-bs-theme="dark"] #drillBreadcrumb .breadcrumb-item + .breadcrumb-item::before,
.theme-dark #drillBreadcrumb .breadcrumb-item + .breadcrumb-item::before,
body.dark-mode #drillBreadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: #a0aec0;
}

[data-bs-theme="dark"] #drillDisplayContainer .card,
.theme-dark #drillDisplayContainer .card,
body.dark-mode #drillDisplayContainer .card {
    background: #2d3748;
    border-color: #4a5568;
}

[data-bs-theme="dark"] #drillDisplayContainer .card-header,
.theme-dark #drillDisplayContainer .card-header,
body.dark-mode #drillDisplayContainer .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom: 1px solid #4a5568;
}

[data-bs-theme="dark"] #drillTableWrapper table thead th,
.theme-dark #drillTableWrapper table thead th,
body.dark-mode #drillTableWrapper table thead th {
    background: #1a202c;
    color: #e2e8f0;
    border-bottom-color: #4a5568;
}

[data-bs-theme="dark"] #drillTableWrapper table tbody tr,
.theme-dark #drillTableWrapper table tbody tr,
body.dark-mode #drillTableWrapper table tbody tr {
    background: #2d3748;
    color: #e2e8f0;
}

[data-bs-theme="dark"] #drillTableWrapper table tbody tr:hover,
.theme-dark #drillTableWrapper table tbody tr:hover,
body.dark-mode #drillTableWrapper table tbody tr:hover {
    background: #374151;
}

[data-bs-theme="dark"] #drillTableWrapper table tbody td,
.theme-dark #drillTableWrapper table tbody td,
body.dark-mode #drillTableWrapper table tbody td {
    border-bottom-color: #4a5568;
    color: #e2e8f0;
}

[data-bs-theme="dark"] #drillTableWrapper table td:last-child,
.theme-dark #drillTableWrapper table td:last-child,
body.dark-mode #drillTableWrapper table td:last-child {
    color: #81d4fa;
}

[data-bs-theme="dark"] .analytics-form .alert-info,
.theme-dark .analytics-form .alert-info,
body.dark-mode .analytics-form .alert-info {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border-color: #2b6cb0;
    color: #bee3f8;
}

[data-bs-theme="dark"] .analytics-form .alert-info i,
.theme-dark .analytics-form .alert-info i,
body.dark-mode .analytics-form .alert-info i {
    color: #90cdf4;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 992px) {
    .analytics-sidebar {
        width: 280px;
    }
    
    .sidebar-header {
        padding: 1.25rem 1rem;
    }
    
    .analytics-sidebar .sidebar-item {
        padding: 0.875rem 1rem;
    }
    
    .analytics-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .analytics-container {
        flex-direction: column;
    }
    
    .analytics-sidebar {
        width: 100%;
        max-height: 250px;
        border-right: none;
        border-bottom: 2px solid #dee2e6;
    }
    
    .analytics-content {
        padding: 1rem;
        height: auto;
    }
    
    .welcome-screen {
        min-height: 40vh;
        padding: 1rem;
    }
    
    .welcome-icon {
        font-size: 3rem;
    }
    
    .welcome-screen h4 {
        font-size: 1.25rem;
    }
    
    #comparisonChartContainer > div {
        height: 400px !important;
    }
}

/* ============================================ */
/* ESTATÍSTICAS DESCRITIVAS                    */
/* ============================================ */

.stats-column-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stats-column-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.stats-column-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-column-title i {
    color: #3498db;
}

.stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    height: 100%;
    min-height: 90px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    word-break: break-all;
}

/* Variantes de cores para os cards */
.stat-card-primary {
    border-left: 4px solid #3498db;
}

.stat-card-primary .stat-icon {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
}

.stat-card-success {
    border-left: 4px solid #27ae60;
}

.stat-card-success .stat-icon {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
}

.stat-card-warning {
    border-left: 4px solid #f39c12;
}

.stat-card-warning .stat-icon {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
}

.stat-card-danger {
    border-left: 4px solid #e74c3c;
}

.stat-card-danger .stat-icon {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.stat-card-info {
    border-left: 4px solid #1abc9c;
}

.stat-card-info .stat-icon {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: #fff;
}

.stat-card-secondary {
    border-left: 4px solid #95a5a6;
}

.stat-card-secondary .stat-icon {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: #fff;
}

/* Dark Mode para Estatísticas */
body.dark-mode .stats-column-card {
    background: linear-gradient(135deg, #2b2b2b 0%, #1a1a1a 100%);
    border-color: #3a3a3a;
}

body.dark-mode .stats-column-title {
    color: #e0e0e0;
    border-bottom-color: #3498db;
}

body.dark-mode .stat-card {
    background: #1e1e1e;
    border-color: #3a3a3a;
}

body.dark-mode .stat-label {
    color: #b0b0b0;
}

body.dark-mode .stat-value {
    color: #e0e0e0;
}

#statisticsColumnsCheckboxes {
    background-color: transparent !important;
}

body.dark-mode #statisticsColumnsCheckboxes {
    background: #1e1e1e !important;
    border-color: #3a3a3a !important;
    color: #e0e0e0;
}

body.dark-mode #statisticsColumnsCheckboxes .form-check-label {
    color: #e0e0e0;
}

/* Responsividade dos Cards de Estatísticas */
@media (max-width: 992px) {
    .stat-card {
        min-height: 85px;
    }
    
    .stat-icon {
        font-size: 1.75rem;
        width: 45px;
        height: 45px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .stats-column-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 0.875rem;
        min-height: auto;
        gap: 0.5rem;
    }
    
    .stat-icon {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}

/* ============================================ */
/* HEATMAP DE VALORES                          */
/* ============================================ */

.heatmap-grid {
    overflow-x: auto;
    padding: 1rem;
}

.heatmap-table {
    display: inline-block;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.heatmap-row {
    display: flex;
}

.heatmap-cell {
    min-width: 80px;
    padding: 12px;
    text-align: center;
    font-size: 0.875rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.heatmap-corner {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.heatmap-header,
.heatmap-row-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    font-weight: 600;
    position: sticky;
}

.heatmap-header {
    top: 0;
    z-index: 2;
}

.heatmap-row-header {
    left: 0;
    z-index: 1;
    min-width: 120px;
}

.heatmap-value {
    font-weight: 500;
    cursor: pointer;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-gradient {
    width: 200px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.legend-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

/* Dark Mode para Heatmap */
body.dark-mode .heatmap-table {
    border-color: #3a3a3a;
}

body.dark-mode .heatmap-cell {
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .heatmap-corner {
    background: linear-gradient(135deg, #2b2b2b 0%, #1a1a1a 100%);
}

body.dark-mode .heatmap-header,
body.dark-mode .heatmap-row-header {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
}

body.dark-mode .heatmap-legend {
    background: #2b2b2b;
}

body.dark-mode .legend-label {
    color: #e0e0e0;
}

body.dark-mode .legend-gradient {
    border-color: #3a3a3a;
}

/* Responsividade do Heatmap */
@media (max-width: 768px) {
    .heatmap-cell {
        min-width: 60px;
        padding: 8px;
        font-size: 0.75rem;
    }
    
    .heatmap-row-header {
        min-width: 90px;
    }
    
    .legend-gradient {
        width: 120px;
        height: 16px;
    }
    
    .legend-label {
        font-size: 0.75rem;
    }
}

/* ============================================ */
/* ANÁLISE DE TENDÊNCIA                        */
/* ============================================ */

#movingAverageOptions {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid #3498db;
}

body.dark-mode #movingAverageOptions {
    background: #2b2b2b;
    border-left-color: #2980b9;
}

#trendMetricsCards .stat-card {
    transition: all 0.3s ease;
}

#trendMetricsCards .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#trendDisplayContainer canvas {
    max-height: 400px;
}

/* Badges de correlação R² */
.correlation-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.correlation-excellent {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
}

.correlation-good {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
}

.correlation-moderate {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
}

.correlation-weak {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

/* Responsividade */
@media (max-width: 768px) {
    #trendDisplayContainer canvas {
        max-height: 300px;
    }
}

/* ============================================
   DRILL-DOWN INTERATIVO
   ============================================ */

/* Breadcrumb de navegação */
#drillBreadcrumbContainer {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    animation: slideInFromTop 0.3s ease-out;
}

#drillBreadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
}

#drillBreadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    font-size: 1.2em;
}

#drillBreadcrumb .breadcrumb-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

#drillBreadcrumb .breadcrumb-link:hover {
    background: #e7f1ff;
    color: #0a58ca;
    text-decoration: none;
}

#drillBreadcrumb .breadcrumb-item.active {
    color: #495057;
    font-weight: 600;
}

/* Botão de expansão drill-down */
.drill-expand-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
}

.drill-expand-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.drill-expand-btn i {
    transition: transform 0.2s ease;
}

.drill-expand-btn:hover i {
    transform: translateX(2px);
}

/* Card do drill-down */
#drillDisplayContainer .card {
    border: 2px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: fadeInUp 0.3s ease-out;
}

#drillDisplayContainer .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

#drillDisplayContainer .card-header h5 {
    margin: 0;
    font-size: 1.25rem;
}

#drillDisplayContainer .card-header .btn {
    margin-left: 0.5rem;
}

/* Tabela drill-down */
#drillTableWrapper table {
    margin-top: 0;
}

#drillTableWrapper table thead th {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
}

#drillTableWrapper table tbody tr {
    transition: all 0.2s ease;
}

#drillTableWrapper table tbody tr:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Estilo dos percentuais */
#drillTableWrapper table td:last-child {
    font-weight: 600;
    color: #0d6efd;
}

/* Alert informativo */
.analytics-form .alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #90caf9;
    border-radius: 8px;
    color: #0d47a1;
}

.analytics-form .alert-info i {
    color: #1976d2;
    margin-right: 0.5rem;
}

/* Animações */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsividade */
@media (max-width: 768px) {
    #drillBreadcrumb {
        font-size: 0.85rem;
    }
    
    #drillDisplayContainer .card-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    #drillDisplayContainer .card-header h5 {
        margin-bottom: 0.75rem;
    }
    
    #drillDisplayContainer .card-header .btn {
        margin-left: 0;
        margin-top: 0.25rem;
        width: 100%;
    }
    
    .analytics-form .row > div {
        margin-bottom: 1rem;
    }
}

/* ============================================
   TRANSFORMAÇÃO DE DADOS
   ============================================ */
.transform-container {
    padding: 2rem;
    animation: fadeIn 0.3s ease-in-out;
}

.transform-header {
    margin-bottom: 2rem;
}

.transform-header h5 {
    font-size: 1.75rem;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.transform-header p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Status da Transformação */
#transformStatus {
    border-left: 4px solid #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

#transformStatus i {
    font-size: 1.5rem;
    color: #3498db;
}

#transformStatus strong {
    color: #2c3e50;
    margin-right: 0.5rem;
}

#transformStatus span {
    color: #34495e;
    font-size: 0.95rem;
}

#transformStatus .btn {
    margin-left: auto;
}

/* Card de Configuração */
.transform-config-card {
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.transform-config-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.transform-config-card .card-body {
    padding: 2rem;
}

.transform-config-card h6 {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.transform-config-card h6 i {
    color: #667eea;
    margin-right: 0.5rem;
}

.transform-config-card .small {
    font-size: 0.9rem;
}

/* Linhas de Agregação */
.aggregation-row {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.aggregation-row:hover {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.aggregation-row .form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.aggregation-row .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.aggregation-row .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.aggregation-row .btn-danger {
    border-radius: 6px;
    padding: 0.5rem 1rem;
}

/* Botões de Ação */
.transform-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem 0;
}

.transform-actions .btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.transform-actions .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.transform-actions .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.3);
}

.transform-actions .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
}

.transform-actions .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.3);
}

/* Responsividade Transform */
@media (max-width: 768px) {
    .transform-container {
        padding: 1rem;
    }
    
    .transform-header h5 {
        font-size: 1.5rem;
    }
    
    .transform-config-card .card-body {
        padding: 1rem;
    }
    
    .aggregation-row {
        padding: 0.75rem;
    }
    
    .transform-actions {
        flex-direction: column;
    }
    
    .transform-actions .btn-lg {
        width: 100%;
    }
}

/* ============================================
   DARK MODE - TRANSFORMAÇÃO
   ============================================ */
[data-bs-theme="dark"] .transform-container,
.theme-dark .transform-container,
body.dark-mode .transform-container {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .transform-header h5,
.theme-dark .transform-header h5,
body.dark-mode .transform-header h5 {
    color: #f7fafc;
}

[data-bs-theme="dark"] #transformStatus,
.theme-dark #transformStatus,
body.dark-mode #transformStatus {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border-left-color: #5dade2;
}

[data-bs-theme="dark"] #transformStatus i,
.theme-dark #transformStatus i,
body.dark-mode #transformStatus i {
    color: #5dade2;
}

[data-bs-theme="dark"] #transformStatus strong,
.theme-dark #transformStatus strong,
body.dark-mode #transformStatus strong {
    color: #f7fafc;
}

[data-bs-theme="dark"] #transformStatus span,
.theme-dark #transformStatus span,
body.dark-mode #transformStatus span {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .transform-config-card,
.theme-dark .transform-config-card,
body.dark-mode .transform-config-card {
    background: #2d3748;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-bs-theme="dark"] .transform-config-card .card-body,
.theme-dark .transform-config-card .card-body,
body.dark-mode .transform-config-card .card-body {
    background: #2d3748;
}

[data-bs-theme="dark"] .transform-config-card h6,
.theme-dark .transform-config-card h6,
body.dark-mode .transform-config-card h6 {
    color: #f7fafc;
}

[data-bs-theme="dark"] .transform-config-card .small,
.theme-dark .transform-config-card .small,
body.dark-mode .transform-config-card .small {
    color: #a0aec0;
}

[data-bs-theme="dark"] .aggregation-row,
.theme-dark .aggregation-row,
body.dark-mode .aggregation-row {
    background: #1a202c;
}

[data-bs-theme="dark"] .aggregation-row:hover,
.theme-dark .aggregation-row:hover,
body.dark-mode .aggregation-row:hover {
    background: #374151;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

[data-bs-theme="dark"] .aggregation-row .form-label,
.theme-dark .aggregation-row .form-label,
body.dark-mode .aggregation-row .form-label {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .aggregation-row .form-select,
.theme-dark .aggregation-row .form-select,
body.dark-mode .aggregation-row .form-select {
    background-color: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-bs-theme="dark"] .aggregation-row .form-select:focus,
.theme-dark .aggregation-row .form-select:focus,
body.dark-mode .aggregation-row .form-select:focus {
    background-color: #374151;
    border-color: #667eea;
    color: #e2e8f0;
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */
#datatableAnalyticsModal .modal-body.fullscreen-body {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #fff;
}

#datatableAnalyticsModal .modal-body.fullscreen-body .analytics-container {
    height: 100vh;
}

/* Botão flutuante para sair do fullscreen - aparece no canto da área de conteúdo */
.fullscreen-exit-btn {
    display: none;
}

#datatableAnalyticsModal .modal-body.fullscreen-body .fullscreen-exit-btn {
    display: block;
    position: fixed;
    top: 10px;
    right: 15px;
    z-index: 10001;
}

[data-bs-theme="dark"] #datatableAnalyticsModal .modal-body.fullscreen-body,
.theme-dark #datatableAnalyticsModal .modal-body.fullscreen-body,
body.dark-mode #datatableAnalyticsModal .modal-body.fullscreen-body {
    background: #1f2937;
}



