/* style.css */

/*
  Paleta de Cores (Sugestão para referência):
  - Fundo Geral: #1a1a1a (Tailwind: gray-900)
  - Texto Principal: #e0e0e0 (Tailwind: gray-200)
  - Destaque/Primário (Laranja): #ff8c00 (Tailwind: orange-500/600)
  - Fundos de Componentes: #2a2a2a (Tailwind: gray-800)
  - Bordas/Divisores: #4a4a4a (Tailwind: gray-700)
  - Sombras Laranja Sutis: rgba(255, 140, 0, 0.1) ou rgba(255, 140, 0, 0.2)
*/

/* Reset e Estilos Base */
body {
    font-family: 'Inter', sans-serif; /* Consistente com a tela de login */
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%); /* Gradiente escuro para o corpo */
    color: #e0e0e0; /* Texto claro */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased; /* Suavização de fonte */
    -moz-osx-font-smoothing: grayscale; /* Suavização de fonte */
    overflow-x: hidden; /* Evita rolagem horizontal indesejada */
}

/* Light Mode (mantido e ajustado para nova paleta, se necessário) */
body.light-mode {
  background-color: #f5f5f5;
  color: #1a1a1a;
}

body.light-mode .main-header {
  background-color: #ffffff;
  color: #1a1a1a;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body.light-mode .header-btn {
    background-color: rgba(200, 200, 200, 0.6); /* Cinza claro transparente */
    color: #333;
}
body.light-mode .theme-toggle-btn {
    background-color: rgba(255, 140, 0, 0.6); /* Laranja transparente */
    color: white;
}
body.light-mode .toggle-chart-btn {
    background-color: rgba(59, 130, 246, 0.6); /* Azul transparente */
    color: white;
}


body.light-mode .kpi-card,
body.light-mode .chart-container,
/* body.light-mode .table-section, */ /* Removido, pois é o antigo */
body.light-mode .table-modular-section { /* Adicionado table-modular-section */
  background-color: #ffffff;
  color: #1a1a1a;
  border-color: #ccc;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Removidos estilos de .controls-section */

/* Removidos estilos de .fab-filter-btn */

/* Removidos estilos de .filter-modal-content e seus filhos */


/* Antigos estilos de tab, removidos */
/*
body.light-mode .tab-button {
    background-color: #e0e0e0;
    color: #555;
}

body.light-mode .tab-button.active {
    background-color: #ff8c00;
    color: white;
}
*/

/* NOVO: Estilos para as tabs da tabela em Light Mode */
body.light-mode .table-tab-button {
    background-color: #e0e0e0;
    color: #555;
}

body.light-mode .table-tab-button.active {
    background-color: #ff8c00;
    color: white;
}


body.light-mode footer {
  background-color: #dddddd;
  color: #333;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

/* Cabeçalho Principal */
/* Estas regras podem ser substituídas por classes Tailwind no HTML */
.main-header {
    /* Exemplo: `bg-gray-900 text-white py-3 px-4 sm:px-6 flex items-center justify-between shadow-lg shadow-orange-700/20 sticky top-0 z-40 rounded-b-2xl` */
}

/* Estilos para os botões do cabeçalho */
.header-btn {
    /* Aplicado no HTML via @apply */
}
.header-btn i {
    font-size: 1.1rem; /* Ajuste para o tamanho do ícone */
}

/* Seção de Controles (Filtros) - COMPLETAMENTE REMOVIDA */


/* Seção de KPIs */
.kpis-section {
    /* As colunas foram definidas no HTML com grid-cols-2 lg:grid-cols-4 */
    gap: 1rem; /* gap-4 Tailwind */
    margin-bottom: 1.5rem; /* mb-6 Tailwind */
}

.kpi-card {
    background-color: #2a2a2a;
    padding: 1rem; /* p-4 Tailwind */
    border-radius: 0.75rem; /* rounded-xl Tailwind */
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 140, 0, 0.5);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.kpi-card:hover {
    transform: scale(1.05); /* hover:scale-105 Tailwind */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 140, 0, 0.3); /* hover:shadow-xl hover:shadow-orange-700/20 */
}

.kpi-card h3 {
    font-size: 0.75rem; /* text-xs Tailwind */
    color: #ffaa00;
    margin-bottom: 0.25rem; /* mb-1 Tailwind */
    font-weight: 600;
}

.kpi-card p {
    font-size: 1.25rem; /* text-xl Tailwind */
    font-weight: bold;
    color: #ffffff;
    margin: 0;
}

/* Seção de Gráficos */
.charts-section {
    gap: 1.5rem; /* gap-6 Tailwind */
    margin-bottom: 1.5rem; /* mb-6 Tailwind */
}

.chart-container {
    background-color: #2a2a2a;
    padding: 1rem; /* p-4 Tailwind */
    border-radius: 0.75rem; /* rounded-xl Tailwind */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    height: 300px; /* Altura fixa, Chart.js ajusta internamente */
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 140, 0, 0.5);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.chart-container:hover {
    transform: scale(1.02); /* hover:scale-102 Tailwind */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 140, 0, 0.3);
}

.chart-container h2 {
    color: #ffaa00;
    font-size: 1rem; /* text-base Tailwind */
    text-align: center;
    margin-bottom: 0.75rem; /* mb-3 Tailwind */
    font-weight: 700;
}

.chart-container canvas {
    flex-grow: 1;
    width: 100% !important;
    height: auto !important;
    max-height: 100%;
}

/* Seção da Tabela Modular */
.table-modular-section { /* Renomeado de table-section */
    background-color: #2a2a2a; /* Fundo cinza escuro */
    padding: 1.25rem; /* p-5 Tailwind */
    border-radius: 0.75rem; /* rounded-xl Tailwind */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem; /* mb-6 Tailwind */
    border: 1px solid rgba(255, 140, 0, 0.5);
}

.table-modular-section h2 { /* Título geral da seção modular */
    color: #ffaa00;
    text-align: center;
    margin-bottom: 1rem; /* mb-4 Tailwind */
    font-size: 1rem; /* text-base Tailwind */
    font-weight: 700;
}

.table-container { /* Contêiner para as tabelas dentro das abas */
    max-height: 350px; /* Altura máxima para rolagem vertical */
    overflow-y: auto;
    border: 1px solid #4a4a4a;
    border-radius: 0.5rem; /* rounded-lg Tailwind */
}

.product-data-table {
    width: 100%;
    border-collapse: collapse;
    color: #e0e0e0;
    font-size: 0.875rem; /* text-sm Tailwind */
}

.product-data-table th,
.product-data-table td {
    padding: 0.75rem 1rem; /* px-4 py-3 Tailwind */
    text-align: left;
    border-bottom: 1px solid #3a3a3a;
}

.product-data-table th {
    background-color: #3a3a3a;
    color: #ffaa00;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap; /* Evita que o texto do cabeçalho quebre */
}

.product-data-table th .sort-icon {
    margin-left: 0.25rem; /* ml-1 */
    color: #e0e0e0; /* Cor inicial neutra */
    font-size: 0.75rem; /* text-xs */
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.product-data-table th .sort-icon:hover {
    color: #ffaa00; /* Cor de destaque ao passar o mouse */
}

.product-data-table tbody tr:hover {
    background-color: #3a3a3a; /* Fundo mais escuro no hover para contraste */
    transition: background-color 0.2s ease-in-out;
}

/* Alinhamento de texto para colunas de valor */
.product-data-table td:nth-child(n+4) { /* Alinha a partir da 4ª coluna (assumindo Produto, Marca/SKU) */
    text-align: right;
    font-family: 'Inter', sans-serif;
}

.no-data-message {
    text-align: center;
    color: #888888;
    padding: 1.25rem; /* p-5 Tailwind */
    font-style: italic;
}

/* Removido Botão de Limpar Filtros */


/* Rodapé */
footer {
    background-color: #000000;
    color: #888888;
    padding: 1rem 0; /* py-4 Tailwind */
    text-align: center;
    font-size: 0.75rem; /* text-xs Tailwind */
    border-top-left-radius: 1rem; /* rounded-t-2xl Tailwind */
    border-top-right-radius: 1rem; /* rounded-t-2xl Tailwind */
    box-shadow: 0 -4px 15px rgba(0,0,0,0.5), 0 0 8px rgba(255, 140, 0, 0.1);
    margin-top: 2rem; /* mt-8 Tailwind */
}

/* Media Queries para Responsividade Geral */
@media (max-width: 768px) {
    /* Ajustes específicos para mobile que não foram cobertos pelo Tailwind */
    .header-btn {
        padding: 0.5rem; /* p-2 */
    }
    .header-btn i {
        font-size: 1rem; /* Ícones menores no cabeçalho mobile */
    }
    .main-header .logo {
        height: 2rem; /* h-8 */
    }
    .main-header h1 {
        font-size: 1.5rem; /* text-2xl */
    }
    .main-header p {
        font-size: 0.875rem; /* text-sm */
    }
    /* Estilos das tabs globais foram removidos */
    /*
    .tabs-container {
        padding-top: 0.75rem; 
        padding-bottom: 0.75rem;
    }
    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    */
    .kpi-card h3 {
        font-size: 0.625rem; /* text-xs */
    }
    .kpi-card p {
        font-size: 1rem; /* text-xl */
    }
    .chart-container {
        height: 250px; /* Menor altura para gráficos em mobile */
        padding: 0.75rem; /* p-3 */
    }
    .chart-container h2 {
        font-size: 0.875rem; /* text-sm */
    }
    .table-modular-section { /* Ajuste para nova seção modular */
        padding: 0.75rem; /* p-3 */
    }
    .table-modular-section h2 { /* Título geral da seção modular */
        font-size: 1rem; /* text-base */
    }
    .product-data-table {
        font-size: 0.75rem; /* text-xs */
    }
    .product-data-table th,
    .product-data-table td {
        padding: 0.5rem 0.75rem; /* px-3 py-2 */
    }
    .no-data-message {
        padding: 1rem; /* p-4 */
    }
    /* Removido .clear-filters-btn */
    footer {
        padding: 0.75rem 0; /* py-3 */
        font-size: 0.625rem; /* text-xs */
    }
}