:root {
    --azul-bebe: #a4d2e8;
    --branco: #ffffff;
}

.btn-gira-nav {
    color: #bbb;
    font-size: 1.05rem;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.btn-gira-nav:disabled {
    color: #e0e0e0;
    opacity: 0.4;
    cursor: default;
}

.btn-gira-nav:not(:disabled):hover {
    color: #0d6efd;
}


/* Navbar personalizada */
.custom-navbar {
    background-color: var(--azul-bebe) !important;
    color: var(--branco);
}

.navbar-brand .titulo {
    color: var(--branco);
    font-weight: 600;
    font-size: 1.1rem;
}

.logo {
    height: 42px;
    width: auto;
    border-radius: 50%;
}

/* Botões da navbar */
.btn-outline-light {
    color: var(--branco);
    border-color: var(--branco);
}

.btn-outline-light:hover {
    background-color: var(--branco);
    color: var(--azul-bebe);
}

.toast-funcao {
  visibility: hidden;
  min-width: 280px;
  max-width: 90vw; 
  background-color: #333;
  color: #fff;
  text-align: center; 
  display: flex;                
  align-items: center;          
  justify-content: center;      
  border-radius: 8px;
  padding: 10px 16px;          
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

/* Ícone do menu hambúrguer */
.navbar-toggler {
    border-color: var(--branco);
}

.navbar-toggler-icon {
    filter: invert(1);
}

.logout-btn {
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: #fff !important;
}
.logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: #fff !important;
}


/* Fundo geral */
body.bg-light {
    background-color: var(--branco) !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .navbar-brand .titulo {
        display: none; 
    }
    .logo {
        height: 36px;
    }
}

/* ===================== Estilo refinado - Templo ===================== */

:root{
  --card-bg: #ffffff;
  --card-border: rgba(0,0,0,0.06);
  --muted: #6b6b6b;
  --accent-blue-1: #002147;
  --accent-blue-2: #6e9cb9;
  --accent-blue-3: #a4d2e8;
  --exu-1: #0b0b0b;
  --exu-2: #4d0000;
  --exu-3: #c00000;
  --success: #198754;
}

body.tema-exu { --accent-1: var(--exu-1); --accent-2: var(--exu-2); --accent-3: var(--exu-3); }
body.tema-azul { --accent-1: var(--accent-blue-1); --accent-2: var(--accent-blue-2); --accent-3: var(--accent-blue-3); }

.custom-navbar {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3)) !important;
  color: #fff;
}

.card.refinado {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(22, 28, 36, 0.04);
  transition: transform .12s ease, box-shadow .12s ease;
}

/* Dropdown temas */
body.tema-azul .dropdown-menu { background-color: #e7f1ff !important; color: #002b5c !important; }
body.tema-exu .dropdown-menu { background: #2b0000; }

/* =======================================================
   LOADER E TRANSIÇÕES DE CARREGAMENTO
   ======================================================= */
#container-funcoes-geral {
    position: relative;
    min-height: 200px;
}

#loader-indicativo {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-align: center;
}

.loading-phase {
    opacity: 0.2 !important;
    filter: grayscale(1);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.toast-funcao.show { visibility: visible; opacity: 1; bottom: 50px; }

/* =======================================================
   RODAPÉ (LINK DAS INSTRUÇÕES GERAIS)
   ======================================================= */
#footer-note {
    color: #6b6b6b !important; /* Cor muted padrão */
    text-decoration: none;
}

#footer-note span {
    color: inherit !important;
    opacity: 0.8;
}

#footer-note:hover span {
    text-decoration: underline;
}

/* =======================================================
   MODAL E PDF (CORRIGIDO E VERTICAL)
   ======================================================= */
.modal-content {
    border: none;
    border-radius: 16px !important;
    display: flex !important;
    flex-direction: column !important; /* Cabeçalho sobre o PDF */
    height: 90vh; 
    width: 100%;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    width: 100%;
    display: flex !important;
    flex-direction: row !important; /* Itens do cabeçalho lado a lado */
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0; /* Não deixa o cabeçalho sumir */
    background: #fff;
}

.modal-body {
    flex-grow: 1; /* Ocupa todo o resto do modal */
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden; /* O scroll será controlado pelo wrapper */
    display: block !important;
}

/* Wrapper para forçar o PDF a ocupar 100% e permitir scroll mobile */
.pdf-wrapper {
    width: 100% !important;
    height: 100% !important;
    padding: 0;
    margin: 0;
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pdf-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 100%;
    border: none;
    display: block;
}

/* --- Ajuste Fullscreen para Celular --- */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
    }
    .modal-content {
        height: 100vh; /* Tela cheia no celular */
        border-radius: 0 !important;
    }
    .pdf-container {
        height: 100%; /* Garante que o PDF ocupe a altura restante */
    }
}

/* --- Ajustes Específicos do Tema Exu --- */

/* 1. Menu Sanduíche e Texto da Navbar (Branco para ler no fundo escuro) */
.tema-exu .navbar-light .navbar-nav .nav-link {
    color: #ffffff !important;
}
.tema-exu .navbar-light .navbar-toggler {
    border-color: rgba(255,255,255,0.5) !important;
}
.tema-exu .navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
.tema-exu .dropdown-menu {
    background-color: #2c0404; /* Fundo escuro no dropdown */
    border: 1px solid #5a0808;
}
.tema-exu .dropdown-item {
    color: #e0e0e0 !important; /* Texto claro no dropdown */
}
.tema-exu .dropdown-item:hover {
    background-color: #4a0404;
    color: #fff !important;
}

/* 2. Título da Gira e Linha (Vinho Escuro) */
.tema-exu #gira-linha, 
.tema-exu #gira-data {
    color: #4a0404 !important; /* Vinho bem escuro */
}

/* 3. Títulos dos Grupos (Vermelho Acinzentado) */
.tema-exu .grupo-titulo {
    color: #8a5a5a !important; /* Vermelho acinzentado/morto */
    font-weight: 700; /* Garante destaque */
}

/* Remove o padding do body se for a página de login */
body.login-page {
    padding-bottom: 0 !important;
}

/* =======================================================
   BOTTOM NAV (MENU INFERIOR) - CORRIGIDO
   ======================================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

.bottom-nav .nav-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    flex: 1;
    transition: 0.2s;
}

.bottom-nav .nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* --- TEMA AZUL (Padrão) --- */
body.tema-azul .bottom-nav {
    background-color: #ffffff;
    border-top: 1px solid #dee2e6;
}
body.tema-azul .bottom-nav .nav-item { color: #6c757d; }
body.tema-azul .bottom-nav .nav-item.active { color: var(--azul-bebe); font-weight: bold; }
body.tema-azul .bottom-nav .item-sair { color: #dc3545; } /* Vermelho para sair */

/* --- TEMA EXU (Escuro/Vinho) --- */
body.tema-exu .bottom-nav {
    background-color: #1a0505; /* Fundo bem escuro */
    border-top: 1px solid #4a0404;
}
body.tema-exu .bottom-nav .nav-item { color: #b0b0b0; }
body.tema-exu .bottom-nav .nav-item.active { color: #ff4d4d; font-weight: bold; } /* Vermelho vivo */
body.tema-exu .bottom-nav .item-sair { color: #ff6b6b; }

/* Espaçamento do corpo para não cobrir conteúdo */
@media (max-width: 991px) {
    body { padding-bottom: 80px !important; }
}
@media (min-width: 992px) {
    .bottom-nav { display: none !important; }
}

/* Navbar Desktop Links */
.custom-navbar .nav-link { font-weight: 500; transition: opacity 0.2s; }
.custom-navbar .nav-link:hover { opacity: 0.8; text-decoration: underline; }


