/* --- TEMA PORTAL DOMINARIA (FUNDO PRETO, CAIXA BRANCA) --- */
body { 
    background: #000000; /* Fundo da página Preto */
    color: #000000; /* Texto Preto */
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    margin: 0; 
    padding-top: 90px; 
    padding-bottom: 40px; 
}

/* FORÇA BRUTA: Tudo dentro da caixa principal e tab-content DEVE ser branco com texto preto */
.box, #tab-content, #view-app > div,
div[style*="background:#1a1a1a"], 
div[style*="background: #1a0505"],
.nav-item.active { 
    background: #ffffff !important; 
    color: #000000 !important; 
    border-color: #ddd !important;
}

/* Força elementos internos específicos que tinham fundo escuro */
div[style*="background:#1a1a1a"] label,
div[style*="background: #1a0505"] label,
div[style*="background:#1a1a1a"] h3,
div[style*="background: #1a0505"] h3 {
    color: #333 !important;
}

/* Garante que áreas que eram "cards" escuros virem cards claros com borda */
div[style*="background:#1a1a1a"], 
div[style*="background: #1a0505"] {
    border: 1px solid #ccc !important;
    background-color: #f9f9f9 !important; /* Cinza muito claro para destacar levemente do fundo branco */
}

.box { 
    padding: 20px; 
    max-width: 1000px; 
    width: 95%; 
    margin: auto; 
    box-sizing: border-box;
    border: 1px solid #333; 
    border-radius: 4px; 
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1); 
}

/* LOGO */
.login-logo-container { text-align: center; margin-bottom: 10px; }
.icon-logo-login { 
    width: 120px; height: auto; 
    filter: none; 
    object-fit: contain; 
}
.icon-logo-nav { 
    width: 24px; height: 24px; object-fit: contain; 
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3)); 
}

/* Tooltips / Info Boxes */
.page-info { 
    background: #fff0f0 !important; 
    color: #b71c1c !important; 
    padding: 12px; 
    border-radius: 4px; 
    border-left: 4px solid #b71c1c; 
    margin-bottom: 20px; 
    font-size: 0.9em; 
    line-height: 1.5; 
    border: 1px solid #ffcdd2;
}

h2 { 
    border-bottom: 1px solid #eee; 
    padding-bottom: 10px; 
    color: #b71c1c; 
    font-size: 1.4rem; 
    margin-top: 0; 
    margin-bottom: 20px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-weight: 700;
}

h3 {
    color: #b71c1c !important; /* Garante títulos internos vermelhos */
}

/* Labels */
label { 
    font-size: 0.85em; 
    color: #333 !important; /* Cinza escuro */
    margin-top: 15px; 
    display: block; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
}

/* Inputs e Selects (Fundo Claro) */
input, select, textarea { 
    padding: 12px; 
    width: 100%; 
    border-radius: 2px; 
    border: 1px solid #ccc !important; 
    background: #f9f9f9 !important; /* Cinza bem claro */
    color: #000 !important; 
    margin-bottom: 5px; 
    box-sizing: border-box; 
    font-size: 1rem; 
    transition: border 0.2s, box-shadow 0.2s; 
}
input:focus, select:focus, textarea:focus { 
    border-color: #b71c1c !important; 
    outline: none; 
    background: #fff !important; 
    box-shadow: 0 0 5px rgba(183, 28, 28, 0.2);
}
input[readonly] { 
    background: #eee !important; 
    color: #555 !important; 
    border: 1px dashed #ccc !important; 
    cursor: default; 
}

/* Checkbox Customizado */
input.chk-envelope {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #b71c1c; 
}

/* Código em Destaque */
#ent-codigo { 
    font-family: 'Courier New', monospace; 
    font-size: 1.8rem; 
    letter-spacing: 3px; 
    color: #b71c1c; 
    font-weight: bold; 
    border: 2px solid #b71c1c;
    background: #fff !important;
    text-align: center;
}

/* Botões Principais - VERMELHOS */
button { 
    background: #b71c1c; 
    color: #ffffff !important; 
    padding: 14px; 
    width: 100%; 
    border: none; 
    border-radius: 2px; 
    font-weight: bold; 
    cursor: pointer; 
    margin-top: 20px; 
    font-size: 1rem; 
    text-transform: uppercase; 
    transition: transform 0.1s, background 0.2s; 
}
button:active { transform: scale(0.98); }
button:hover { background: #d32f2f; }
button:disabled { background: #ccc; color: #666 !important; cursor: not-allowed; }

/* Botão Secundário (Outline) */
.btn-outline { 
    background: transparent !important; 
    border: 1px solid #b71c1c !important; 
    color: #b71c1c !important; 
    margin-top: 10px; 
}
.btn-outline:hover { background: #b71c1c !important; color: #fff !important; }

/* Link Recuperar Senha */
.link-recover {
    display: block;
    text-align: center;
    color: #666;
    font-size: 0.85em;
    margin-top: 15px;
    text-decoration: underline;
    cursor: pointer;
}
.link-recover:hover { color: #b71c1c; }

/* Instalação PWA */
.install-box { margin-top: 25px; padding-top: 20px; border-top: 1px solid #eee; text-align: center; }
.btn-install { background: transparent !important; border: 2px solid #b71c1c !important; color: #b71c1c !important; margin-top: 10px; }
.btn-install:hover { background: #b71c1c !important; color: #fff !important; }
.ios-guide { background: #f0f0f0; padding: 15px; border-radius: 4px; margin-top: 15px; font-size: 0.9em; color: #333; border: 1px solid #ccc; text-align: left; line-height: 1.6; }

/* NAVBAR (PRETA) */
.nav-bar { 
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100%; 
    background: #000000 !important; /* Navbar Preta */
    display: flex; 
    flex-direction: column; 
    align-items: stretch; 
    z-index: 1000; 
    box-sizing: border-box; 
    box-shadow: 0 2px 10px rgba(255,255,255,0.1); 
    padding: 0;
    height: auto; 
    border-bottom: 1px solid #333;
}

.nav-top-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 15px; 
    border-bottom: 1px solid #222;
    height: 45px; 
    background: #000;
}

.nav-logo { 
    font-weight: 700; 
    color: #fff; 
    font-size: 1rem; 
    white-space: nowrap; 
    margin-right: 10px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.nav-right-group { 
    display: flex; 
    align-items: center; 
    margin-left: auto; 
    padding-left: 10px; 
    gap: 8px; 
    height: 100%; 
}

/* Botão Notificação (Padrão) */
.nav-btn-notif { 
    color: #fff; 
    background: #222; 
    border-radius: 2px; 
    height: 28px; 
    width: 32px; 
    margin-top: 0; 
    border: none; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
} 

/* ESTADO ATIVO (Fundo Vermelho) */
.nav-btn-notif.active-state {
    background-color: #b71c1c !important;
    color: #fff !important;
    border: 1px solid #b71c1c !important;
    animation: none;
}

/* ESTADO PENDENTE (Pulso) */
.nav-btn-notif.pulse-notif {
    animation: pulse-red 2s infinite; 
}

.nav-btn-logout { color: #fff; background: #b71c1c; border-radius: 2px; height: 28px; padding: 0 10px; font-size: 0.75em; margin-top: 0; border: none; cursor: pointer;}
.nav-btn-logout:hover { background: #801313; }

/* Linha 2: Barra de Rolagem das Abas */
.nav-scroll-container { 
    display: flex; 
    align-items: flex-start; 
    overflow-x: auto; 
    width: 100%; 
    height: 45px; 
    background: #000 !important; /* Fundo da barra preto */
    border-bottom: 2px solid #b71c1c; 
    scrollbar-width: none; 
    cursor: grab; 
    user-select: none; 
    padding-top: 5px;
}
.nav-scroll-container:active { cursor: grabbing; }
.nav-scroll-container::-webkit-scrollbar { display: none; }

/* ESTILO DAS ABAS */
.nav-item { 
    padding: 0 15px; 
    margin-right: 2px;
    font-size: 0.85em; 
    color: #999; 
    background: #1a1a1a !important; 
    cursor: pointer; 
    white-space: nowrap; 
    transition: 0.2s; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px;
    height: 40px; 
    box-sizing: border-box; 
    font-family: inherit; 
    text-transform: uppercase; 
    font-weight: 700;
    border-radius: 4px 4px 0 0;
    border: 1px solid #333;
    border-bottom: none;
}

/* Ícone dentro da aba */
.nav-icon { font-size: 1.1em; }

/* ABA ESPECIAL "+" (Troca de Perfil) */
.nav-item-plus {
    font-size: 1.4em; /* Maior */
    font-weight: 900;
    color: #b71c1c !important;
    padding: 0 20px;
}

.nav-item:hover { 
    background: #333 !important; 
    color: #fff; 
}

/* ABA ATIVA - BRANCA (Conecta com a caixa) */
.nav-item.active { 
    background: #ffffff !important; 
    color: #b71c1c !important; 
    height: 43px;
    margin-top: -3px;
    border-color: #fff;
    border-top: 2px solid #b71c1c !important;
    box-shadow: 0 -2px 10px rgba(255,255,255,0.1);
}

/* AUTOCOMPLETE */
.autocomplete-wrapper { position: relative; width: 100%; }
.suggestions-list { 
    position: absolute; top: 100%; left: 0; right: 0; 
    background: #fff !important; 
    border: 1px solid #ccc; border-top: none; 
    max-height: 220px; overflow-y: auto; z-index: 999; 
    border-radius: 0 0 4px 4px; display: none; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}
.suggestion-item { 
    padding: 12px; cursor: pointer; border-bottom: 1px solid #eee; 
    display: flex; justify-content: space-between; align-items: center; 
    color: #000 !important; 
}
.suggestion-item:hover { background: #f5f5f5 !important; }
.suggestion_item small { color: #666 !important; }

/* TABELAS (Claro) */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85em; margin-top: 0; table-layout: auto; } 
.data-table th { 
    text-align: left; 
    background: #eee !important; 
    padding: 10px; 
    color: #333 !important; 
    white-space: nowrap; 
    border-bottom: 2px solid #b71c1c; 
    font-weight: bold; 
}
.data-table td { 
    border-bottom: 1px solid #eee; 
    padding: 10px; 
    vertical-align: middle; 
    color: #333 !important; 
    white-space: normal; 
    word-wrap: break-word; 
    max-width: 200px; 
}
.data-table tr:hover { background: #fafafa !important; }
.table-responsive { width: 100%; overflow-x: hidden; margin-bottom: 20px; border: 1px solid #eee; border-radius: 4px; }
@media (max-width: 600px) { .table-responsive { overflow-x: auto; } .box { width: 98%; padding: 10px; } }

/* BOTÕES MINI */
.btn-mini { padding: 4px 8px; font-size: 0.75em; border-radius: 2px; cursor: pointer; margin-right: 5px; text-transform: uppercase; font-weight: bold; border: 1px solid; background: transparent !important; transition: 0.2s; }
.btn-atendente { color: #b71c1c !important; border-color: #b71c1c !important; }
.btn-atendente:hover { background: rgba(183, 28, 28, 0.1) !important; }
.btn-admin { color: #333 !important; border-color: #333 !important; }
.btn-admin:hover { background: rgba(0,0,0,0.1) !important; }
.btn-rebaixar { color: #d32f2f !important; border-color: #d32f2f !important; } 
.btn-rebaixar:hover { background: rgba(211, 47, 47, 0.1) !important; }
.btn-success { color: #2e7d32 !important; border-color: #2e7d32 !important; } 
.btn-success:hover { background: rgba(46, 125, 50, 0.1) !important; }

/* 🟢 NOVOS BOTÕES DE EVENTO */
.btn-participate {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #333 !important;
}
.btn-participate:hover { background-color: #333 !important; }

.btn-participating {
    background-color: #2e7d32 !important; /* Verde */
    color: #fff !important;
    border: 1px solid #2e7d32 !important;
}

/* Detalhes */
details { margin-bottom: 20px; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; background: #fff !important; }
details > summary { list-style: none; outline: none; background: #f9f9f9 !important; padding: 15px; cursor: pointer; font-weight: bold; color: #b71c1c !important; text-transform: uppercase; font-size: 0.9em; border-left: 4px solid #b71c1c; color: #000; }
details[open] > summary { border-bottom: 1px solid #ddd; }
details > summary::-webkit-details-marker { display: none; }

/* UTILS */
.hidden { display: none !important; }
.error { color: #fff; background: #c62828; padding: 10px; border-radius: 2px; display: none; margin-bottom: 10px; text-align: center; font-weight: bold; }
.success { color: #fff; background: #2e7d32; padding: 10px; border-radius: 2px; display: none; margin-bottom: 10px; text-align: center; font-weight: bold; }
.badge { background: #eee; color: #333; padding: 2px 6px; border-radius: 2px; font-size: 0.8em; text-transform: uppercase; border: 1px solid #ccc; }

/* ANIMAÇÃO DE PULSO */
@keyframes pulse-red {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@media print {
    body * { visibility: hidden; }
    #area-etiqueta-impressao, #area-etiqueta-impressao * { visibility: visible; }
    #area-etiqueta-impressao { position: fixed; left: 0; top: 0; width: 62mm; height: 20mm; display: flex; flex-direction: column; justify-content: center; align-items: center; border: none; color: black; background: white; font-family: Arial, sans-serif; padding: 1mm; box-sizing: border-box; }
    .etiqueta-dest { font-size: 8pt; text-align: center; white-space: nowrap; overflow: hidden; width: 100%; }
    .etiqueta-cod { font-size: 20pt; font-weight: bold; text-align: center; margin: 0; }
    .etiqueta-data { font-size: 7pt; text-align: center; }
    @page { size: 62mm 20mm; margin: 0; }
}

/* 🟢 UPDATE NOTIFICATION BAR */
.update-toast {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #b71c1c;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    border-top: 1px solid #ff5252;
}
.update-toast p { margin: 0; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.update-toast button {
    width: auto;
    margin: 0;
    padding: 8px 15px;
    background: white;
    color: #b71c1c !important;
    border: none;
    font-size: 0.9em;
}
.update-toast button:hover { background: #eee; }

/* 🟢 MOBILE APENAS (ICON-ONLY MODE) */
@media (max-width: 600px) {
    .nav-scroll-container {
        /* Garante que os ícones ocupem todo o espaço horizontal */
        justify-content: space-around; 
    }
    .nav-item {
        /* Remove o padding lateral exagerado e força largura flexível */
        padding: 0 5px;
        flex: 1; 
        text-align: center;
        justify-content: center;
    }
    .nav-label {
        /* ESCONDE O TEXTO NO MOBILE */
        display: none;
    }
    .nav-icon {
        /* Aumenta o ícone para ficar fácil de clicar */
        font-size: 1.6em;
        display: block;
    }
}