/* ========================================
   🎯 CONSOLE LAYOUT - SIDEBAR VERTICAL
   Estrutura profissional e limpa
======================================== */

/* ====================
   ✅ CORES DEBUG REMOVIDAS!
==================== */

/* ====================
   MAIN CONTENT AREA - COM LIMITE DE LARGURA - REDUZIDO 20%
==================== */
body main.dashboard-main.unified-layout > .main-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important; /* Reduzido de 20px (20% menos) */
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important; /* Mudado de calc(100vw - 320px) para 100% */
    max-width: 1600px !important; /* ADICIONA limite máximo de largura */
    height: calc(100vh - 120px) !important;
    padding: 16px !important; /* Reduzido de 20px (20% menos) */
    margin: 0 auto !important; /* Centraliza se passar do max-width */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    grid-area: content !important;
    background: transparent !important;
}

/* ====================
   LAYOUT PRINCIPAL - TELA COMPLETA
==================== */
.unified-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 15px;
    height: calc(100vh - 80px);
    padding: 10px;
    width: 100vw;
    margin: 0;
}

/* SOBRESCREVE TEMA - LAYOUT COM SIDEBAR GLASS */
body main.dashboard-main.unified-layout {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    grid-template-areas: "sidebar content" !important;
    width: 100vw !important;
    max-width: none !important;
    padding: 10px !important;
    gap: 15px !important;
    height: 100vh !important;
    margin: 0 !important;
}

/* WIDE SCREEN OPTIMIZATIONS - SEM LIMITAÇÕES DE MAX-WIDTH */
.screen-ultrawide .unified-layout {
    padding: 20px 60px !important;
    gap: 40px !important;
}

.screen-wide .unified-layout {
    padding: 20px 40px !important;
    gap: 30px !important;
}

.screen-desktop .unified-layout {
    padding: 20px 30px !important;
    gap: 25px !important;
}

/* ====================
   SIDEBAR GLASSMORPHISM - FORÇADO EXTREMO
==================== */
body main.dashboard-main.unified-layout > aside.sidebar,
body main.dashboard-main.unified-layout > aside.glass-card-premium,
body main.dashboard-main.unified-layout > .sidebar {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 270px !important;
    min-width: 270px !important;
    max-width: 270px !important;
    height: calc(100vh - 120px) !important;
    overflow: hidden !important;
    padding: 20px !important;
    position: relative !important;
    z-index: 10 !important;
    grid-area: sidebar !important;
    
    /* GLASSMORPHISM LIMPO */
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Controls */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.glass-input {
    padding: 12px 16px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-color-alpha);
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Export button */
.btn-primary {
    width: 100%;
    padding: 12px 16px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* ====================
   MAIN CONTENT AREA - FORÇADO!
==================== */
.main-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 500px !important;
    padding: 16px !important; /* ✅ Padding para cards não ficarem colados nas bordas */
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Evita scroll horizontal */
}

/* 🎯 Stats Grid - PROFISSIONAL E CONSISTENTE! */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 🎴 Stat Card - Layout horizontal simples */
.stats-grid > * {
    /* Aplica a TODOS os filhos diretos do grid */
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 18px 20px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    height: 100px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.stats-grid > *:hover {
    transform: translateY(-2px) scale(1.005) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15) !important;
}

/* 🎨 Stat Icon */
.stats-grid .stat-icon {
    font-size: 2.2rem !important;
    flex-shrink: 0 !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* 📝 Stat Content */
.stats-grid .stat-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    flex: 1 !important;
    min-width: 0 !important;
}

/* 🔢 Stat Value */
.stats-grid .stat-value {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 🏷️ Stat Label */
.stats-grid .stat-label {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 🎨 Status Colors - Indicadores de conexão */
.status-connected {
    color: #00d4aa !important; /* Verde sucesso */
    text-shadow: 0 0 8px rgba(0, 212, 170, 0.4) !important;
}

.status-disconnected {
    color: #ff6b6b !important; /* Vermelho erro */
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.4) !important;
}

/* ====================
   NAVIGATION TABS
==================== */
.navigation-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.nav-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.navigation-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.service-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.service-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.service-tab__icon {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.service-tab.active .service-tab__icon {
    opacity: 1;
}

/* ====================
   CONTENT SECTIONS
==================== */
.licenses-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

.table-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-content {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

/* ====================
   RESPONSIVO
==================== */
@media (max-width: 1024px) {
    body .dashboard-main.unified-layout {
        grid-template-columns: 1fr !important;
        grid-template-areas: 
            "sidebar"
            "content" !important;
        gap: 16px !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .sidebar {
        position: relative !important;
        max-height: none !important;
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .main-content {
        height: auto !important;
        overflow: visible !important;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stats-grid > * {
        height: 90px !important;
        padding: 14px 16px !important;
    }
    
    .stats-grid .stat-icon {
        font-size: 1.8rem !important;
        width: 36px !important;
        height: 36px !important;
    }
    
    .stats-grid .stat-value {
        font-size: 1.3rem !important;
    }
    
    .stats-grid .stat-label {
        font-size: 0.65rem !important;
    }
}

/* 📱 Tablet (2 colunas) */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
    
    .stats-grid > * {
        height: 95px !important;
    }
}

/* ====================
   TEMA COMPATIBILITY
==================== */

/* Dark Theme */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .licenses-section {
    background: rgba(17, 25, 40, 0.8);
    border-color: rgba(75, 85, 99, 0.3);
}

[data-theme="dark"] .service-tab {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .service-tab:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Light Theme */
[data-theme="light"] .sidebar,
[data-theme="light"] .stat-card,
[data-theme="light"] .licenses-section {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(226, 232, 240, 0.8);
}

[data-theme="light"] .service-tab {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .service-tab:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ====================
   FORÇA VISIBILIDADE TOTAL
==================== */
.sidebar,
.sidebar *,
.main-content,
.main-content *,
.stats-grid,
.stats-grid *,
.stat-card,
.licenses-section,
.table-container,
.table-content {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.stats-grid {
    display: grid !important;
}

.unified-layout {
    display: grid !important;
}

/* Força cores básicas se variáveis CSS falharem */
.sidebar {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: white !important;
}

.stat-card {
    background: rgba(30, 41, 59, 0.8) !important;
    border: 1px solid rgba(100, 116, 139, 0.3) !important;
    color: white !important;
}

.sidebar-title,
.form-group label,
.service-tab span {
    color: white !important;
}

/* Layout estrutural global - FORÇA TELA CHEIA */
* {
    box-sizing: border-box !important;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow-x: hidden !important;
}

.dashboard-container {
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dashboard-header {
    width: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1000 !important;
    height: 60px !important;
}

.dashboard-main {
    margin-top: 60px !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
    padding: 0 !important;
}

/* FORÇA TELA COMPLETA - ANULA TODOS MAX-WIDTH */
.dashboard-main.unified-layout,
main.unified-layout,
.unified-layout {
    width: calc(100vw - 40px) !important;
    max-width: none !important;
    margin: 0 !important;
}

.main-content {
    width: 100% !important;
    max-width: none !important;
}

/* Anula containers que possam limitar */
.container,
.container-fluid,
.dashboard-container {
    max-width: none !important;
    width: 100% !important;
}

/* ANULA LIMITAÇÕES DOS TEMAS */
.header-container,
.footer-content {
    max-width: none !important;
    margin: 0 !important;
}

/* ANULA LIMITAÇÃO CRÍTICA DO layout.css */
body .dashboard-container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* FORÇA LARGURA TOTAL SEMPRE */
html, body {
    width: 100% !important;
    max-width: none !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ANULA QUALQUER CONTAINER QUE LIMITE LARGURA */
* {
    box-sizing: border-box !important;
}

*[class*="container"],
*[class*="wrapper"],
*[class*="main"],
section, article, div {
    max-width: none !important;
}

/* FORÇA TODOS OS GRIDS E FLEX A USAR ESPAÇO TOTAL */
.grid, .flex, .d-flex, 
.dashboard-grid, .dashboard-content,
.tabs-container, .tab-content {
    width: 100% !important;
    max-width: none !important;
}

/* SIDEBAR - FORÇA VISIBILIDADE E INTERATIVIDADE */
.sidebar,
aside.sidebar,
.glass-card-premium {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100 !important;
}

.sidebar .controls-section,
.sidebar .navigation-section,
.sidebar .form-group,
.sidebar .navigation-tabs {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    margin-bottom: 15px !important;
    pointer-events: auto !important;
}

.sidebar .service-tab {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    margin-bottom: 8px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    pointer-events: auto !important;
    user-select: none !important;
}

.sidebar .service-tab:hover,
.sidebar .service-tab.active {
    background: rgba(0, 120, 212, 0.3) !important;
    transform: translateX(2px) !important;
}

/* BOTÕES E CONTROLES FUNCIONAIS */
.sidebar button,
.sidebar select,
.sidebar input,
.sidebar .service-tab {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 10 !important;
}

/* CORRIGE ELEMENTOS BRANCOS NO TEMA DARK */
[data-theme="dark"] .main-content,
[data-theme="dark"] .dashboard-content,
[data-theme="dark"] .tabs-container,
[data-theme="dark"] .tab-content,
[data-theme="dark"] .datatable-container,
[data-theme="dark"] .chart-container {
    background: transparent !important;
    color: #ffffff !important;
}

[data-theme="dark"] .glass-card,
[data-theme="dark"] .stats-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .card {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* CORRIGE TODOS OS FUNDOS BRANCOS */
[data-theme="dark"] canvas,
[data-theme="dark"] .chart-container,
[data-theme="dark"] .chart-wrapper,
[data-theme="dark"] svg,
[data-theme="dark"] .datatable,
[data-theme="dark"] .datatable-wrapper,
[data-theme="dark"] table,
[data-theme="dark"] tbody,
[data-theme="dark"] thead,
[data-theme="dark"] tr,
[data-theme="dark"] td,
[data-theme="dark"] th {
    background: transparent !important;
    background-color: transparent !important;
    color: #ffffff !important;
    position: relative !important;
    z-index: 15 !important;
}

/* MINI GRÁFICOS - TAMANHO E VISIBILIDADE NORMAL */
[data-theme="dark"] .mini-chart,
[data-theme="dark"] .chart-mini,
[data-theme="dark"] .stats-chart,
[data-theme="dark"] .chart {
    background: transparent !important;
    background-color: transparent !important;
    filter: none !important;
    position: relative !important;
    z-index: 20 !important;
    min-height: 80px !important;
    min-width: 120px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 60px !important;
    min-width: 100px !important;
}

/* TABELAS - REMOVE FUNDOS BRANCOS */
[data-theme="dark"] .datatable-container,
[data-theme="dark"] .table-responsive,
[data-theme="dark"] .table-container {
    background: transparent !important;
    background-color: transparent !important;
}

/* ZOOM DAS TABELAS - ESCALA NORMAL */
[data-theme="dark"] .datatable,
[data-theme="dark"] table {
    transform: scale(1) !important;
    transform-origin: top left !important;
    font-size: 0.9rem !important;
}

/* SIDEBAR CONTROLES - GLASSMORPHISM */
.sidebar .sidebar-title {
    color: #ffffff !important;
    font-weight: 600 !important;
    margin-bottom: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.sidebar .form-group label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
}

.sidebar .glass-input,
.sidebar select,
.sidebar input {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 12px 16px !important;
    width: 100% !important;
    margin-bottom: 16px !important;
}

.sidebar button {
    background: rgba(0, 120, 212, 0.8) !important;
    border: 1px solid rgba(0, 120, 212, 0.4) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 12px 20px !important;
    width: 100% !important;
    cursor: pointer !important;
}

/* STATS GRID - LAYOUT RESPONSIVO */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    margin-bottom: 30px !important;
}

/* TABELAS E CONTEÚDO */
.dashboard-content,
.tabs-container,
.tab-content,
.table-container {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
}

/* FORÇA TODOS OS ELEMENTOS A USAR LARGURA TOTAL */
* {
    box-sizing: border-box !important;
}

html, body {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ANULA QUALQUER CONTENTOR QUE LIMITE */
.unified-layout *,
.main-content *,
.dashboard-content *,
div[class*="container"],
div[class*="wrapper"],
section,
article {
    max-width: none !important;
}

/* FORÇA GRID E FLEXBOX A USAR ESPAÇO TOTAL */
.grid,
.flex,
.d-flex,
.dashboard-grid {
    width: 100% !important;
    max-width: none !important;
}

/* Anula responsive que pode limitar largura */
@media (min-width: 1200px) {
    .dashboard-main,
    .unified-layout,
    .main-content {
        max-width: none !important;
        width: 100vw !important;
    }
}

/* ====================
   EMERGÊNCIA - CORREÇÃO FINAL DE TODOS OS PROBLEMAS!
==================== */

/* BOTÕES DA SIDEBAR - MÁXIMA PRIORIDADE Z-INDEX E FUNCIONALIDADE */
body .sidebar .sidebar-nav a,
body .sidebar .sidebar-nav .nav-item,
body .sidebar .service-tab,
.sidebar button,
.service-tab[data-service] {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 9999 !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: all 0.3s ease !important;
}

/* HOVER nos botões */
.service-tab[data-service]:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: translateX(5px) !important;
}

/* ACTIVE nos botões */
.service-tab[data-service].active {
    background: rgba(0, 191, 255, 0.3) !important;
    border-left: 3px solid #00BFFF !important;
}

/* CONTEÚDO PRINCIPAL - FLUXO NATURAL! */
body .dashboard-main .main-content,
body .main-content .tab-content,
body .main-content .summary-cards,
body .main-content .data-table-container {
    position: static !important; /* ✅ STATIC = EMPURRA! */
    z-index: auto !important;
}

/* FORÇA VISIBILIDADE DAS TABELAS E ABAS */
.tab-content,
.tab-content.active,
.content-section,
div[id*="tab-"],
div[class*="tab-"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 400px !important;
    position: static !important; /* ✅ STATIC = EMPURRA! */
    z-index: auto !important;
}

/* FORÇA DATATABLES */
.datatable-wrapper,
.datatable,
table {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    overflow-x: auto !important;
}

/* FORÇA CONTAINERS DE CONTEÚDO ESPECÍFICOS */
#summary-cards,
#table-content,
#alerts-container,
.licenses-section,
.table-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important; /* ✅ STATIC = EMPURRA! */
    z-index: auto !important;
    width: 100% !important;
    margin-bottom: 16px !important; /* REDUZIDO de 20px para 16px */
    overflow: visible !important;
}

/* FORÇA SEÇÃO DE LICENÇAS */
.licenses-section {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 12px !important; /* Reduzido de 24px para 12px */
}

/* REDUZIR ESPAÇAMENTO DAS TABELAS - SEM LIMITAR ALTURA */
.datatable-wrapper,
.datatable,
table {
    font-size: 0.85rem !important; /* Reduz tamanho da fonte */
}

table th,
table td {
    padding: 4px 6px !important; /* Reduz padding das células ainda mais */
    line-height: 1.1 !important;
}

table th {
    padding: 6px !important; /* Cabeçalho um pouco maior */
}

.table-title {
    font-size: 1rem !important; /* Reduz título da tabela */
    margin-bottom: 8px !important;
}

/* MINI GRÁFICOS - REDUZIDOS DRASTICAMENTE */
.summary-cards canvas,
.chart-container canvas,
.mini-chart,
.chart-mini {
    position: relative !important;
    z-index: 25 !important;
    min-height: 50px !important; /* REDUZIDO de 80px para 50px */
    max-height: 100px !important; /* LIMITA altura máxima em 100px */
    min-width: 80px !important; /* REDUZIDO de 120px para 80px */
    max-width: 200px !important; /* LIMITA largura máxima */
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    background: transparent !important;
    height: auto !important; /* Permite ajuste automático */
    width: 100% !important; /* Usa largura do container */
}

/* FORÇA CANVAS DOS MINI GRÁFICOS */
canvas {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
}

/* GARANTE ROLAGEM DA PÁGINA */
/* REMOVE TODAS AS ROLAGENS - CORPO FIXO */
body {
    overflow: hidden !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* LAYOUT PRINCIPAL - GRID CORRIGIDO */
body .dashboard-main.unified-layout {
    overflow: hidden !important;
    height: calc(100vh - 80px) !important;
    display: grid !important;
    grid-template-columns: 270px 1fr !important;
    grid-template-areas: "sidebar content" !important;
    gap: 20px !important;
    margin-top: 80px !important;
    padding: 20px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

/* CONTEÚDO PRINCIPAL - AQUI SIM A ROLAGEM CORRETA */
.main-content {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: calc(100vh - 120px) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding-right: 10px !important;
    grid-area: content !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

@media (min-width: 1400px) {
    .dashboard-main,
    .unified-layout,
    .main-content {
        max-width: none !important;
        width: 100vw !important;
    }
}

/* Layout finalizado - sem debug */