/* public/assets/css/style.css */

:root {
    /* --- PALETA DE CORES (Baseada na Logo IBO Evolution) --- */
    --primary-cyan: #00d2ff;
    --primary-blue: #0072ff;
    --gradient-logo: linear-gradient(135deg, #00d2ff 0%, #0072ff 100%);
    
    /* --- FUNDOS DARK PREMIUM --- */
    --bg-body: #05080f;       /* Preto azulado profundo */
    --bg-sidebar: #0b111a;    /* Lateral levemente mais clara */
    --bg-card: rgba(18, 24, 38, 0.85); /* Efeito vidro escuro */
    
    /* --- TEXTO E BORDAS --- */
    --text-white: #ffffff;
    --text-muted: #a0aec0;
    --border-color: rgba(0, 210, 255, 0.15); /* Borda sutil ciano */
}

/* RESET GERAL */
* { box-sizing: border-box; outline: none; }

body {
    background-color: var(--bg-body);
    color: var(--text-white);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Evita rolagem horizontal */
}

/* =========================================
   BARRA LATERAL (SIDEBAR) - FIXA E ROBUSTA
   ========================================= */
.sidebar {
    position: fixed; /* OBRIGATÓRIO para não quebrar layout */
    top: 0;
    left: 0; /* No Desktop é 0 (visível) */
    bottom: 0;
    width: 260px;
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
    transition: all 0.3s ease; /* ANIMAÇÃO SUAVE ADICIONADA */
}

/* Esconder scrollbar da sidebar para ficar bonito */
.sidebar::-webkit-scrollbar { width: 0px; background: transparent; }

/* ÁREA DA LOGO (Trava o tamanho para não explodir) */
.logo-area {
    text-align: center;
    padding: 0 15px 20px 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    min-height: 80px; /* Garante espaço */
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-area img {
    max-width: 140px; /* Tamanho máximo da logo */
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.3));
}

/* LINKS DO MENU */
.nav-link-custom {
    color: var(--text-muted);
    text-decoration: none;
    padding: 14px 25px;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.nav-link-custom i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 1.1rem;
    color: var(--primary-cyan); /* Ícones Ciano */
}

.nav-link-custom:hover {
    background: rgba(0, 210, 255, 0.05);
    color: #fff;
}

.nav-link-custom.active {
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.15) 0%, transparent 100%);
    border-left-color: var(--primary-cyan);
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

/* RODAPÉ DA SIDEBAR */
.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* =========================================
   CONTEÚDO PRINCIPAL (MAIN)
   ========================================= */
.main-content {
    margin-left: 260px; /* Empurra o conteúdo para direita da sidebar */
    width: calc(100% - 260px);
    padding: 30px;
    min-height: 100vh;
    transition: all 0.3s ease; /* ANIMAÇÃO SUAVE ADICIONADA */
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* =========================================
   CARDS, TABELAS E MODAIS (ESTILO VIDRO)
   ========================================= */
.card-custom, .stat-card, .table-responsive, .modal-content {
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.stat-card { padding: 25px; }
.stat-card h3 { font-size: 2.2rem; font-weight: 700; margin: 0; color: #fff; }
.stat-card p { color: var(--text-muted); margin: 5px 0 0 0; font-size: 0.9rem; text-transform: uppercase; }
.icon-box { font-size: 2.5rem; opacity: 0.8; }

/* TABELAS - FORÇANDO DARK MODE */
.table {
    margin-bottom: 0;
    width: 100%;
    color: var(--text-muted);
    border-color: var(--border-color);
    --bs-table-bg: transparent; /* Remove fundo branco do bootstrap */
}

.table thead th {
    background-color: rgba(0, 210, 255, 0.1);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody td {
    padding: 15px 20px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-hover tbody tr:hover td {
    background-color: rgba(0, 210, 255, 0.05);
    color: #fff;
}

/* =========================================
   FORMULÁRIOS E INPUTS (LEGIBILIDADE)
   ========================================= */
.form-control, .form-select {
    background-color: #050505 !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important; /* Texto BRANCO */
    padding: 12px 15px;
    border-radius: 10px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.2);
}

/* Cor do texto placeholder */
.form-control::placeholder { color: #555; }

label {
    color: #e2e8f0;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* =========================================
   BOTÕES (GRADIENTE DA LOGO)
   ========================================= */
.btn-primary, .btn-purple, .btn-success {
    background: var(--gradient-logo) !important;
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
    transition: transform 0.2s;
}

.btn-primary:hover, .btn-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.5);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c, #ff4b2b) !important;
    border: none;
    color: white;
}

/* =========================================
   TELA DE LOGIN (BACKGROUND ESPECIAL)
   ========================================= */
.login-bg {
    background: radial-gradient(circle at center, #1a202c 0%, #000 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Glow atrás do login */
.login-bg::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 114, 255, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}

.login-card {
    background: rgba(15, 20, 30, 0.9);
    border: 1px solid var(--border-color);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.badge { padding: 6px 10px; font-weight: 600; }
.bg-success { background-color: #00b09b !important; color: #fff; }
.bg-danger { background-color: #ff416c !important; color: #fff; }
.bg-warning { background-color: #f59e0b !important; color: #000; }

/* --- CORREÇÃO DE EMERGÊNCIA PARA TEXTOS PRETOS --- */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: #ffffff !important; }
small, .small, .text-muted { color: #b0c4de !important; }
.table thead th { color: #ffffff !important; }
.table tbody td { color: #e0e0e0 !important; }
a { color: #00d2ff; text-decoration: none; }
a:hover { color: #ffffff; }

/* =========================================
   NOVO: RESPONSIVIDADE (MOBILE)
   ========================================= */

/* Overlay (Fundo escuro quando menu abre) */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    backdrop-filter: blur(3px);
}
.overlay.active { display: block; }

@media (max-width: 768px) {
    /* Esconde a Sidebar jogando ela para esquerda */
    .sidebar {
        left: -260px;
    }

    /* Quando ativada via JS, volta para 0 (Aparece) */
    .sidebar.active {
        left: 0;
        box-shadow: 5px 0 25px rgba(0,0,0,0.8);
    }

    /* O Conteúdo principal ocupa 100% da tela e zera a margem */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px; /* Menos espaçamento no mobile */
    }

    /* Ajuste para cabeçalho da página não quebrar */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header .btn {
        width: 100%; /* Botões ocupam largura total no celular */
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    /* Impede que tabelas complexas quebrem o layout */
    .table-responsive {
        border: none !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Ajusta os cards do dashboard para não ficarem grudados */
    .stat-card {
        margin-bottom: 20px;
    }
}