/* ==========================================================================
   1. VARIÁVEIS GLOBAIS DO TEMA E ESTRUTURA BÁSICA
   ========================================================================== */
:root {
    --accent: #FFB900;
    --accent-weak: rgba(255, 185, 0, .18);
    --black: #000000;
    --bg-light: #f8f9fa;
    --bg-body: #f4f6f9;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-body);
}

/* Isolamento do fundo degradê apenas para a tela de Login (index.php) */
body.bg-login {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.container-principal {
    max-width: var(--max-width);
    margin: 0 auto;
    margin-top: 1rem !important; /* Força a redução do espaço, ignorando mt-4 e mt-5 */
    padding: 0.5rem 1rem 1rem 1rem;
}

.container-narrow {
    max-width: 980px;
}

/* Campo oculto Honeypot (Segurança - inscricao.php) */
.hp-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   2. MENU, NAVEGAÇÃO E LOGO
   ========================================================================== */
.navbar-custom {
    background-color: var(--black) !important;
    border-bottom: 3px solid var(--accent);
}

/* Estilo do menu encaixotado (usado na inscrição e painel) */
.navbar-custom.navbar-boxed {
    max-width: var(--max-width);
    width: 100%;
    margin: .5rem auto;
    border-radius: .75rem;
    border: 1px solid rgba(255, 185, 0, .25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    padding: .5rem 0;
}

.logo-container {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.logo-img {
    height: 60px;
    max-width: 100%;
    object-fit: contain;
}

.action-buttons {
    margin: 1rem 0;
    padding: 0 1rem;
}

.nav-item.active {
    background-color: var(--accent-weak);
    border-radius: 5px;
}

.nav-item.active .nav-link {
    color: var(--accent) !important;
    font-weight: 500;
}

/* Correção de Conflitos no Submenu (Dropdown) */
.dropdown-menu-dark {
    background-color: var(--black) !important;
    border: 1px solid rgba(255, 185, 0, .35) !important;
}

.dropdown-menu-dark .dropdown-item {
    color: #fff !important;
    transition: all 0.2s ease;
}

.dropdown-menu-dark .dropdown-item:hover, 
.dropdown-menu-dark .dropdown-item:focus {
    background-color: var(--accent-weak) !important;
    color: var(--accent) !important;
}

/* ==========================================================================
   3. TELA DE LOGIN (index.php)
   ========================================================================== */
.login-container {
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.6s ease-out;
}

.login-header {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    border-bottom: 4px solid var(--accent);
}

.login-header h2 { font-size: 1.8rem; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.login-header p { color: rgba(255, 255, 255, 0.8); font-size: 1rem; }

.login-body { padding: 30px; }
.login-body .form-control {
    width: 100%; padding: 14px 16px; border: 1px solid #ddd;
    border-radius: 8px; font-size: 1rem; transition: all 0.3s; margin-bottom: 20px;
}
.login-body .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 185, 0, 0.2); outline: none; }

.login-body .btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #FFA000 100%);
    color: #000; border: none; padding: 14px 20px; border-radius: 8px;
    font-size: 1.1rem; font-weight: 600; width: 100%; cursor: pointer;
    transition: all 0.3s; box-shadow: 0 4px 12px rgba(255, 185, 0, 0.3);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.login-body .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(255, 185, 0, 0.4); }

.login-footer { text-align: center; padding: 25px 0; color: #666; font-size: 0.9rem; margin-top: auto; }

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

@media (max-width: 768px) {
    .login-container { max-width: 100%; margin-top: 10px; }
    .login-header { padding: 25px 15px; }
    .login-header h2 { font-size: 1.5rem; }
    .login-body { padding: 25px 20px; }
    .login-body .form-control { padding: 12px 14px; }
    .login-body .btn-primary { padding: 13px 18px; font-size: 1rem; }
}

/* ==========================================================================
   4. DASHBOARD CARDS (Estatísticas Financeiras e Contadores)
   ========================================================================== */
.stat-card-link { text-decoration: none; }
.stat-card-link:hover { text-decoration: underline; text-underline-offset: 6px; }

.stat-card {
    background: var(--black);
    border: 1px solid rgba(255, 185, 0, .25);
    border-radius: 1.25rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
    border-color: var(--accent);
}

.stat-card .card-body { padding: 1.3rem 1rem; }

.stat-label {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: .5rem;
    letter-spacing: .3px;
}

.stat-number { font-size: 1.8rem; line-height: 1.2; font-weight: 800; }

.stat-icon-wrap {
    width: 55px; height: 55px; border-radius: 12px;
    background: var(--accent-weak); display: grid; place-items: center;
    border: 1px solid rgba(255, 185, 0, .35);
}

.stat-icon { font-size: 1.6rem; color: var(--accent); }

.text-positivo { color: #2ecc71 !important; }
.text-negativo { color: #e74c3c !important; }

/* ==========================================================================
   5. CALENDÁRIO (dashboard.php)
   ========================================================================== */
.calendar-card {
    border-radius: 1rem;
    border: 1px solid rgba(255, 185, 0, .25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    overflow: hidden;
}

.calendar-header {
    background: var(--black);
    color: #fff;
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-title { margin: 0; font-weight: 700; letter-spacing: .2px; }
.calendar-title .month { color: var(--accent); }

.calendar-nav a {
    color: var(--accent);
    text-decoration: none;
    padding: .25rem .6rem;
    border: 1px solid rgba(255, 185, 0, .35);
    border-radius: .5rem;
}
.calendar-nav a:hover { background: var(--accent-weak); text-decoration: underline; text-underline-offset: 4px; }

.calendar-table th { background: #111; color: #fff; font-weight: 600; padding: .5rem; text-align: center; }
.calendar-table td { height: 90px; vertical-align: top; padding: .5rem; border: 1px solid rgba(0, 0, 0, .06); position: relative; }

.day-number { font-weight: 700; color: #222; }
.day-badge {
    display: inline-block; margin-top: .35rem; padding: .2rem .45rem;
    font-size: .8rem; border-radius: .5rem; background: var(--accent-weak);
    border: 1px solid rgba(255, 185, 0, .35); color: #222;
}
.day-link { display: inline-block; margin-top: .35rem; color: #0d6efd; text-decoration: none; font-weight: 600; }
.day-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.today-outline { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: .5rem; }

@media (max-width: 576px) { .calendar-table td { height: 72px; padding: .4rem; } }

/* ==========================================================================
   6. FORMULÁRIOS, GRUPOS E INPUTS (Inscrição e Edição)
   ========================================================================== */
.campo-label {
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
}

.grupo {
    background: #fff;
    border: 1px solid #eee;
    border-left: 4px solid var(--accent);
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .04);
}

.grupo .titulo { font-weight: 700; color: #333; margin-bottom: .75rem; }
.btn-success { font-weight: 600; }
.turma-option { white-space: normal !important; }

/* ==========================================================================
   7. IMAGENS, FOTOS E AVATARES DE ALUNOS
   ========================================================================== */
.foto-container {
    gap: 15px; margin-bottom: 15px; width: 100px; height: 100px;
    border-radius: 50%; overflow: hidden; position: relative;
}
.foto-container img { width: 100%; height: 100%; object-fit: cover; }
.foto-acoes { display: flex; flex-direction: column; gap: 10px; }

.thumb-aluno {
    width: 96px; height: 96px; object-fit: cover; border-radius: 50%; cursor: pointer;
    transition: transform 0.2s; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.thumb-aluno:hover { transform: scale(1.05); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); }

.aluno-info { display: flex; align-items: center; }

.miniatura-aluno {
    width: 40px; height: 40px; object-fit: cover; border-radius: 50%;
    margin-right: 10px; border: 2px solid #dee2e6; cursor: pointer; transition: transform 0.2s;
}
.miniatura-aluno:hover { transform: scale(1.1); }

.foto-container .sem-foto {
    width: 96px; height: 96px; border-radius: 50%; background: #f0f0f0;
    display: flex; align-items: center; justify-content: center; border: 2px dashed #ccc;
}
.foto-container .sem-foto i { font-size: 24px; color: #999; }

.aluno-info .sem-foto {
    display: inline-block; width: 40px; height: 40px; border-radius: 50%;
    background-color: #f8f9fa; border: 2px solid #dee2e6; margin-right: 10px;
    text-align: center; line-height: 36px; color: #6c757d;
}

/* ==========================================================================
   8. TABELAS (Relatórios, Contabilidade e Chamada)
   ========================================================================== */
.table-container { max-height: 500px; overflow-y: auto; }
.sticky-header th { position: sticky; top: 0; background-color: #f8f9fa; z-index: 10; }

.table-custom { border-radius: 10px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }

.secao-titulo {
    font-weight: 700; color: #333; margin-top: 2rem; margin-bottom: 1rem;
    border-left: 4px solid var(--accent); padding-left: 10px;
}

.tabela-relatorio {
    width: 100%; border-collapse: collapse; margin-bottom: 2rem; font-size: 0.9rem;
    background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.tabela-relatorio th, .tabela-relatorio td { border: 1px solid #dee2e6; padding: 8px 12px; vertical-align: middle; }
.tabela-relatorio thead th { background-color: #f1f3f5; font-weight: 700; text-align: center; color: #495057; }

/* Destaques das Tabelas */
.linha-grupo { background-color: #fff9c4 !important; font-weight: bold; }
.linha-total { background-color: #e9ecef; font-weight: bold; }
.linha-total-geral { background-color: #fff9c4; font-weight: bold; font-size: 1rem; }
.col-numero { width: 60px; text-align: center; font-weight: bold; }

/* Status Badge (relatorios.php) */
.status-badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 500; white-space: nowrap; }
.status-icon { width: 16px; height: 16px; vertical-align: -2px; }

/* Cronograma e Turma Info */
.tabela-cronograma th { background-color: #adb5bd; color: #fff; text-align: center; }
.tabela-cronograma td { text-align: center; }

.turma-info { background-color: #f8f9fa; border-radius: 5px; padding: 15px; margin-bottom: 20px; }
.turma-info h5 { margin-bottom: 10px; color: #0d6efd; }
.turma-detalhes { display: flex; flex-wrap: wrap; gap: 15px; }
.turma-detalhe-item { background-color: white; padding: 10px; border-radius: 5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); min-width: 120px; }
.turma-detalhe-item strong { display: block; margin-bottom: 5px; color: #6c757d; font-size: 0.9rem; }
.turma-detalhe-item span { font-size: 1.1rem; color: #212529; }
.option-detalhes { font-size: 0.85rem; color: #6c757d; margin-left: 10px; }

/* ==========================================================================
   9. MODAIS (Ampliação de Imagem)
   ========================================================================== */
.modal.modal-foto .modal-dialog { max-width: 80%; display: flex; align-items: center; min-height: calc(100% - 1rem); }
.modal.modal-foto .modal-content { background-color: transparent; border: none; margin: 0 auto; }
.modal.modal-foto .modal-body { padding: 0; text-align: center; }
.modal.modal-foto .modal-body img { max-width: 100%; max-height: 80vh; border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); }
.modal.modal-foto .btn-close {
    position: absolute; top: 10px; right: 10px; background: white; opacity: 1;
    padding: 10px; border-radius: 50%; z-index: 1000; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.modal.modal-foto .btn-close:hover { opacity: 0.9; background: #f8f9fa; }

/* Modal Vanilla JS (Registro de Chamada) */
.modal-foto:not(.modal) {
    display: none; position: fixed; z-index: 1050; padding-top: 100px; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.9);
}
.modal-foto:not(.modal) .modal-conteudo {
    margin: auto; display: block; width: 80%; max-width: 700px;
    animation-name: zoom; animation-duration: 0.6s;
}
@keyframes zoom { from { transform: scale(0.1) } to { transform: scale(1) } }
.fechar-modal {
    position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px;
    font-weight: bold; transition: 0.3s; cursor: pointer;
}
.fechar-modal:hover, .fechar-modal:focus { color: #bbb; text-decoration: none; cursor: pointer; }
.legenda-foto {
    margin: auto; display: block; width: 80%; max-width: 700px;
    text-align: center; color: #ccc; padding: 10px 0; height: 150px;
}

/* ==========================================================================
   10. RODAPÉ (Footer)
   ========================================================================== */
.rodape {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%); color: #ecf0f1;
    padding: 20px 0; text-align: center; margin-top: 40px; border-top: 3px solid #3498db;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.rodape-conteudo { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.rodape p { margin: 10px 0; font-size: 14px; }
.rodape a { color: #3498db; text-decoration: none; transition: color 0.3s ease; font-weight: 600; }
.rodape a:hover { color: #1abc9c; text-decoration: underline; }
.rodape-logo { font-weight: bold; font-size: 18px; letter-spacing: 1px; color: #3498db; margin-bottom: 10px; }
.rodape-versao { font-size: 12px; opacity: 0.8; margin-top: 15px; }
.rodape-contato { margin-top: 15px; font-size: 13px; }

/* ==========================================================================
   11. IMPRESSÃO (Regras para gerar PDF/Imprimir)
   ========================================================================== */
@media print {
    .no-print, .action-buttons { display: none !important; }
    
    body { background: #fff !important; font-size: 12px; }
    
    .stat-card {
        background: #f8f9fa !important; border: 1px solid #ccc !important;
        color: #000 !important; box-shadow: none !important; height: auto !important;
    }
    
    .stat-label, .stat-icon { color: #000 !important; }
    
    .linha-grupo, .linha-total-geral {
        background-color: #fdf59a !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}