/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

:root {
    /* --- CORES MODO ESCURO (CORRIGIDO PARA ALTO CONTRASTE) --- */
    --primary: #00e676;       /* Verde ARK */
    --bg-body: #0f1214;       /* Fundo Principal */
    --bg-panel: #1a1d21;      /* Fundo Cards/Menu */
    
    /* Texto agora é BRANCO para leitura perfeita (Tela 02/04/06) */
    --text-main: #ffffff;     
    --text-muted: #d0d2d6;    /* Cinza bem claro, quase branco #d0d2d6     azul  #0000FF  */
    
    --border-color: #2d333b;
    --hover-bg: rgba(255, 255, 255, 0.1); /* Hover mais visível */
    --sidebar-width: 260px;
    --sidebar-mini-width: 80px;
}

[data-theme="light"] {
    /* --- CORES MODO CLARO (Tela 07) --- */
    --bg-body: #f4f6f9;
    --bg-panel: #ffffff; /* #4b716f #ffffff Preto suave */
    --text-main: #212529;     /* Preto suave */
    --text-muted: #495057;    /* Cinza escuro */
    --border-color: #dee2e6;
    --hover-bg: #e9ecef;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* --- LAYOUT & SIDEBAR --- */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar-wrapper {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

/* CONTEÚDO PRINCIPAL */
#page-content-wrapper {
    width: 100%;
    margin-left: var(--sidebar-width);
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 100vh;
}

/* --- ESTADO RECOLHIDO (MINI SIDEBAR) --- */
/* A classe .toggled agora é aplicada no BODY pelo JS */
body.toggled #sidebar-wrapper {
    min-width: var(--sidebar-mini-width);
    max-width: var(--sidebar-mini-width);
}

body.toggled #page-content-wrapper {
    margin-left: var(--sidebar-mini-width);
}

/* Esconde textos quando recolhido */
body.toggled .sidebar-text, 
body.toggled .sidebar-heading small,
body.toggled .dropdown-toggle::after {
    display: none !important;
}

/* Ajusta ícones quando recolhido */
body.toggled .list-group-item {
    text-align: center;
    padding: 15px 0;
    justify-content: center; /* Centraliza ícone */
}

body.toggled .list-group-item i {
    font-size: 1.3rem;
    margin: 0 !important;
}

body.toggled .sidebar-brand {
    justify-content: center;
    padding: 0;
}
body.toggled .sidebar-brand span {
    display: none;
}

/* --- ESTILOS GERAIS --- */
.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer; /* Indica que é clicável */
    transition: all 0.3s;
}
.sidebar-brand:hover {
    background-color: var(--hover-bg);
}

.list-group-item {
    background: transparent;
    color: var(--text-muted); /* Agora é cinza claro */
    border: none;
    padding: 12px 20px;
    font-weight: 500;
    white-space: nowrap; 
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.list-group-item i {
    min-width: 30px;
    text-align: center;
}

.list-group-item:hover, .list-group-item.active {
    color: var(--text-main); /* Fica branco puro ao passar o mouse */
    background-color: rgba(0, 230, 118, 0.15);
    border-right: 3px solid var(--primary);
}

/* --- CORREÇÃO DE CORES (CARDS & TABELAS) --- */
.card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.card-header {
    background-color: rgba(0,0,0,0.2); /* Um pouco mais escuro para contraste */
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
}

/* FORÇAR CORES NAS TABELAS (Correção Tela 02 e 06) */
.table {
    color: var(--text-main) !important; /* Texto BRANCO */
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
}

.table thead th {
    color: var(--primary); /* Cabeçalho Verde ou Branco Brilhante */
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
}

.table tbody td {
    color: var(--text-main) !important; /* Garante visibilidade */
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    color: var(--text-main);
    background-color: var(--hover-bg) !important;
}

/* Inputs de Pesquisa */
input, select, .form-control, .form-select {
    background-color: var(--bg-body) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

input::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

/* DataTables Cores */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter, 
.dataTables_wrapper .dataTables_info, 
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted) !important;
}

/* Links */
a { text-decoration: none; }

/* --- MOBILE --- */
@media (max-width: 768px) {
    #sidebar-wrapper { margin-left: -260px; } 
    #page-content-wrapper { margin-left: 0; }
    
    /* Quando ativo no mobile, abre full */
    body.toggled #sidebar-wrapper { margin-left: 0; min-width: 260px; }
    body.toggled .sidebar-text { display: inline !important; } 
    body.toggled .sidebar-brand span { display: inline !important; }
}