/* ==========================================================================
   VariÃ¡veis Globais - Tema Premium (Igreja Batista Peniel)
   Baseado na paleta Preto, Cinza e Branco
   ========================================================================== */
:root {
    /* Cores Principais (Dark Mode Modernizado - Aura System) */
    --color-bg-base: #0a0a0a;
    --color-bg-surface: #141414;
    --color-bg-glass: rgba(20, 20, 20, 0.75);
    
    /* Textos */
    --color-text-primary: #ffffff;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #52525b;
    
    /* Acentos e InteraÃ§Ã£o */
    --color-accent: #f4f4f5;
    --color-border: #27272a;
    --color-hover: #1f1f22;
    
    /* VariÃ¡veis de componentes */
    --color-surface: #1a1a1f;
    --color-primary: #6366f1;
    
    /* Sombras e Efeitos */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --border-glass: 1px solid rgba(255, 255, 255, 0.08);
    
    /* EspaÃ§amentos e Raios */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Fontes */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-elegant: 'Space Grotesk', sans-serif;
}

/* ==========================================================================
   Reset e Estilos Base
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-base);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
}

/* ==========================================================================
   Layout Principal (Sidebar + Main)
   ========================================================================== */

/* 
 * Estrutura base da pÃ¡gina (Container Flex)
 * Garante que a barra lateral e o conteÃºdo principal fiquem lado a lado no desktop.
 */
.layout {
    display: flex;
    width: 100%;
}

/* --- Barra Lateral (Sidebar) --- */
/*
 * A sidebar fica fixa Ã  esquerda.
 * Suporta o modo colapsado via classe .sidebar--collapsed no body.
 */
.sidebar {
    width: 280px;
    background-color: var(--color-bg-surface);
    border-right: var(--border-glass);
    padding: 2rem 1rem; /* Reduzido padding lateral para acomodar modo Ã­cone */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden; /* Evita que o texto quebre para a linha de baixo ao encolher */
}

/* Container da Logo na Sidebar - Agora Ã© clicÃ¡vel e usa Flexbox */
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 0.5rem 1.5rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: opacity 0.3s ease;
    text-decoration: none;
    color: var(--color-text-primary);
}

.sidebar__brand:hover {
    opacity: 0.8;
}

/* Wrapper para manter o Ã­cone sempre com o mesmo tamanho fixo */
.sidebar__logo-container {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar__logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sidebar__brand-text {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* NavegaÃ§Ã£o da Sidebar (Lista de Links) */
.nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Item individual do menu lateral */
.nav__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-sm);
    margin: 0.2rem 0;
    font-weight: 500;
    white-space: nowrap;
}

/* Textos dentro do link */
.nav__link span {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Efeito ao passar o mouse (Hover) ou quando o link Ã© a pÃ¡gina atual (Active) */
.nav__link:hover, .nav__link--active {
    background-color: var(--color-hover);
    color: var(--color-text-primary);
    transform: translateX(4px);
}

/* --- ESTADOS DO MODO COLAPSADO (DESKTOP) --- */
body.sidebar--collapsed .sidebar {
    width: 80px;
}

body.sidebar--collapsed .sidebar__brand-text,
body.sidebar--collapsed .nav__link span {
    opacity: 0;
    pointer-events: none;
    display: none;
    /* O texto fica invisÃ­vel e nÃ£o ocupa espaÃ§o, garantindo que o Ã­cone fique centralizado */
}

body.sidebar--collapsed .nav__link {
    justify-content: center;
    padding: 0.8rem 0; /* Remove padding lateral no modo colapsado */
}
body.sidebar--collapsed .sidebar__brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* --- ConteÃºdo Principal (Main Content) --- */
/*
 * Ocupa todo o espaÃ§o restante e tem uma margem Ã  esquerda
 * igual Ã  largura da sidebar para nÃ£o sobrepor o conteÃºdo.
 */
.main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}

body.sidebar--collapsed .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}

/* CabeÃ§alho de cada pÃ¡gina (TÃ­tulo + BotÃµes de AÃ§Ã£o) */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.header__title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header__actions {
    display: flex;
    gap: 1rem;
}

/* ==========================================================================
   Responsividade (Mobile Navbar)
   ========================================================================== */

/* 
 * Barra de NavegaÃ§Ã£o Superior (Mobile)
 * Oculta por padrÃ£o no Desktop. SerÃ¡ exibida apenas em telas menores.
 */
.mobile-navbar {
    display: none; /* Escondido no Desktop */
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: rgba(15, 15, 15, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 90;
}

html.light-theme .mobile-navbar {
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Logo na barra superior mobile */
.mobile-navbar__logo {
    height: 35px;
    width: auto;
}

/* BotÃ£o HambÃºrguer para abrir o menu */
.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 
 * Media Query para Dispositivos MÃ³veis (Tablets e Celulares)
 * Ativado quando a tela for menor que 768px.
 */
@media (max-width: 768px) {
    /* Esconde a Sidebar jogando-a para a esquerda (-100%) */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }
    
    /* Classe adicionada via JavaScript para abrir a Sidebar no mobile */
    .sidebar--open {
        transform: translateX(0);
    }

    /* Remove a margem esquerda do conteÃºdo principal, pois a sidebar nÃ£o ocupa mais espaÃ§o */
    .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}

    /* Mostra a Navbar Superior (Logo + HambÃºrguer) */
    .mobile-navbar {
        display: flex;
    }
    
    /* Reorganiza o cabeÃ§alho das pÃ¡ginas (ex: TÃ­tulo e botÃ£o "Novo Membro") para ficar um embaixo do outro */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* ==========================================================================
   Componentes
   ========================================================================== */

/* --- Buttons --- */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: var(--font-primary);
}

.btn--primary {
    background-color: var(--color-accent);
    color: var(--color-bg-base);
}

.btn--primary:hover {
    background-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* --- Glass Cards (Membros) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--color-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-text-secondary);
    transition: background 0.3s ease;
}

.card:hover::before {
    background: var(--color-accent);
}

.card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
}

.card__subtitle {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.card__body {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.card__footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

/* --- FormulÃ¡rios e Inputs --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.form-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(242, 242, 242, 0.2);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

select.form-input option {
    background-color: var(--color-bg-surface);
    color: var(--color-text-primary);
}

/* ==========================================================================
   Tabelas de Dados (Data Tables)
   ========================================================================== */
.table-container {
    background: var(--color-bg-glass);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    box-shadow: var(--shadow-glass);
    
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.4);
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   MODAL PREMIUM DESIGN (Gemini Inspired)
   ========================================================================== */

/* Animação base para o Modal */
@keyframes modalFadeScale {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(10, 10, 10, 0.85); /* Fundo Dark Padrão */
    border: 1px solid rgba(255, 255, 255, 0.08); /* Borda Glass fina */
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    box-sizing: border-box;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05); /* Outer Glow & Inner border */
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    max-height: 90vh;
    overflow-y: auto;
    /* Custom Scrollbar for Modal */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Quando o modal fica ativo, dispara a animação */
.modal-overlay.active .modal-content {
    animation: modalFadeScale 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Botão Fechar */
.btn-close {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-close:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.1);
}

/* Base Buttons no Modal */
.modal-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    transition: all 0.3s var(--ease-bounce);
}
.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
}

.btn-save {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e40af 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transition: all 0.3s var(--ease-bounce);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-save:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6 0%, var(--color-primary) 100%);
}

/* Modificações Específicas do Light Mode para Modais */
html.light-theme body .modal-content {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
html.light-theme body .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
html.light-theme body .modal-title {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    color: #0f172a;
}
html.light-theme body .modal-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
html.light-theme body .btn-close:hover {
    background: rgba(0, 0, 0, 0.05);
}
html.light-theme body .btn-cancel {
    border-color: rgba(0, 0, 0, 0.1);
    color: #475569;
}
html.light-theme body .btn-cancel:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

/* ==========================================================================
   Perfil de Membro e Upload
   ========================================================================== */
.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.profile-avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-accent);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.profile-avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    text-align: center;
    font-size: 0.75rem;
    padding: 0.2rem 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-avatar-container:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.profile-info p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.profile-section {
    margin-bottom: 1.5rem;
}

.profile-section h4 {
    font-size: 1rem;
    color: var(--color-text-primary);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-list li {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Cropper JS (Corte de Imagens)
   ========================================================================== */
.cropper-container-wrapper {
    width: 100%;
    max-height: 60vh;
    background: #000;
    overflow: hidden;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cropper-container-wrapper img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* ==========================================================================
   Mapa Modal
   ========================================================================== */
.map-iframe-container {
    width: 100%;
    height: 350px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
}

.map-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Dashboard Layout --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--color-bg-glass);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: transform 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-card__icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
}

.kpi-card__icon svg {
    width: 30px;
    height: 30px;
}

.kpi-card__info h3 {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.kpi-card__info p {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.chart-container {
    background: var(--color-bg-glass);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-glass);
    position: relative;
    height: 300px;
}

.chart-container h2 {
    font-size: 1.1rem;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

.chart-container canvas {
    max-height: 220px;
}

/* --- Action Buttons (Standardized) --- */
.action-btn {
    padding: 0.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 0.25rem;
}

.action-btn:hover {
    transform: scale(1.05);
}

.action-btn.edit {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.action-btn.delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.action-btn.view {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981; /* Verde esmeralda (Success) para a chamada */
}

.action-btn.toggle {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.action-btn i, .action-btn svg {
    width: 18px;
    height: 18px;
}

/* Fix button wrapping */
td:has(.action-btn), td.text-right {
    white-space: nowrap;
}

/* Grid do Perfil com Mapa */
.perfil-grid {
    display: grid;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .perfil-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.perfil-column-left, .perfil-column-right {
    display: flex;
    flex-direction: column;
}
.map-container {
    width: 100%;
    margin-top: 0.5rem;
}


/* ==========================================================================
   SISTEMA RESPONSIVO COMPLETO - Sprint 9
   Suporte: 320px (mobile) -> 640px (sm) -> 1024px (tablet) -> 1280px+ (desktop)
   ========================================================================== */

/* Variaveis de Espacamento Fluido */
:root {
    --spacing-xs: clamp(0.25rem, 1vw, 0.5rem);
    --spacing-sm: clamp(0.5rem, 2vw, 1rem);
    --spacing-md: clamp(1rem, 3vw, 1.5rem);
    --spacing-lg: clamp(1.5rem, 4vw, 2.5rem);
    --spacing-xl: clamp(2rem, 5vw, 4rem);
    --text-xs:   clamp(0.65rem,  1.2vw, 0.75rem);
    --text-sm:   clamp(0.75rem,  1.5vw, 0.875rem);
    --text-base: clamp(0.875rem, 1.8vw, 1rem);
    --text-lg:   clamp(1rem,     2.2vw, 1.25rem);
    --text-xl:   clamp(1.2rem,   2.8vw, 1.5rem);
    --text-2xl:  clamp(1.4rem,   3.5vw, 2rem);
    --text-3xl:  clamp(1.75rem,  4.5vw, 2.5rem);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;

    /* Animations */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Tipografia fluida aplicada */
.header__title { font-size: var(--text-2xl); }
.modal-title   { font-size: var(--text-lg); }
.card__title   { font-size: var(--text-base); }

/* Sidebar e main-content fluidas */
.sidebar { width: var(--sidebar-width); }
.main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}
body.sidebar--collapsed .sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar--collapsed .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}

/* Tabela responsiva com scroll */
.table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); }
.table, .data-table { width: 100%; min-width: 480px; border-collapse: collapse; }

/* Cards responsivos */
.card-grid    { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }

/* Modais responsivos */
.modal-content { width: min(90vw, 600px); max-height: min(90vh, 800px); padding: var(--spacing-md); }

/* Formularios em grid responsivo */
.form-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--spacing-sm); }

/* Botoes adaptaveis */
.btn { padding: clamp(0.5rem, 1.5vw, 0.8rem) clamp(0.75rem, 2vw, 1.5rem); font-size: var(--text-sm); }
.form-input { padding: clamp(0.55rem, 1.5vw, 0.8rem) clamp(0.6rem, 2vw, 1rem); font-size: var(--text-base); }
.form-label { font-size: var(--text-sm); }
body { font-size: var(--text-base); overflow-x: hidden; }
html { scroll-behavior: smooth; }

/* Suporte Retina / High-DPI */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sidebar__logo, .profile-avatar, .mobile-navbar__logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    .card { border-width: 0.5px; }
}

/* TABLET (640px-1024px) */
@media (max-width: 1024px) {
    :root { --sidebar-width: 220px; }
    .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}
    .header { margin-bottom: var(--spacing-lg); }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-text-secondary);
    transition: background 0.3s ease;
}
.kpi-card:hover::before {
    background: var(--color-accent);
}

    .kpi-card { padding: 1rem; gap: 1rem; }
    .kpi-card__info p { font-size: 1.5rem; }
    .table-responsive-cards thead { display: none; }
    .table-responsive-cards tbody tr {
        display: flex; flex-direction: column;
        background: var(--color-bg-glass); border-radius: var(--radius-md);
        margin-bottom: 0.75rem; padding: 0.75rem 1rem; border: var(--border-glass);
    }
    .table-responsive-cards tbody td { border: none; padding: 0.2rem 0; font-size: var(--text-sm); }
    .table-responsive-cards tbody td::before {
        content: attr(data-label) ": ";
        font-weight: 600; color: var(--color-text-secondary);
        font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em;
    }
}

/* MOBILE (<= 768px) */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: min(85vw, 280px); box-shadow: 8px 0 24px rgba(0,0,0,0.6); z-index: 200; }
    .sidebar--open { transform: translateX(0); }
    .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}
    body.sidebar--collapsed .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}
    .mobile-navbar { display: flex; position: sticky; top: 0; z-index: 150; }
    .header { flex-direction: column; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; }
    .header__title { font-size: var(--text-xl); }
    .header__actions { width: 100%; flex-wrap: wrap; }
    .header__actions .btn { flex: 1; min-width: 120px; text-align: center; justify-content: center; }
    .dashboard-grid, .card-grid, .charts-grid { grid-template-columns: 1fr; }
    .kpi-card { padding: 0.85rem 1rem; gap: 0.75rem; }
    .kpi-card__icon { width: 44px; height: 44px; }
    .kpi-card__icon svg { width: 22px; height: 22px; }
    .kpi-card__info p { font-size: 1.4rem; }
    .modal-content { width: 96vw; max-width: 96vw; max-height: 92vh; padding: 1rem; border-radius: var(--radius-md); }
    .modal-header { margin-bottom: 1rem; }
    .table-wrapper, .card .table, .card table { overflow-x: auto; display: block; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .form-actions { flex-wrap: wrap; gap: 0.5rem; }
    .form-actions .btn { flex: 1; min-width: 100px; }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .map-iframe-container { height: 220px; }
    .perfil-grid { grid-template-columns: 1fr; }
    .tabs-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none; }
    .tabs-wrapper::-webkit-scrollbar { display: none; }
    
    #mult-cards-container { grid-template-columns: 1fr !important; }
    .bottom-nav { display: flex; }
    .sidebar-overlay.active { display: block; }
}

/* MOBILE PEQUENO (<= 480px) */
@media (max-width: 480px) {
    .btn { padding: 0.55rem 0.9rem; font-size: 0.8rem; }
    .card { padding: 1rem; }
    .modal-content { padding: 0.85rem; }
    .data-table th, .data-table td, .table th, .table td { padding: 0.55rem 0.7rem; font-size: var(--text-sm); }
    .header__title { font-size: var(--text-lg); }
    .badge { font-size: 0.65rem; padding: 0.15rem 0.5rem; }
}

/* OVERLAY DA SIDEBAR MOBILE */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.55); z-index: 199;
}

/* NAVEGACAO INFERIOR MOBILE (Bottom Nav) */
.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 190;
    background: var(--color-bg-surface); border-top: 1px solid var(--color-border);
    padding: 0.5rem 0 max(0.5rem, env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.bottom-nav__items { display: flex; justify-content: space-around; align-items: center; max-width: 480px; margin: 0 auto; }
.bottom-nav__item {
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
    padding: 0.3rem 0.75rem; color: var(--color-text-secondary); text-decoration: none;
    border-radius: var(--radius-sm); transition: color 0.2s ease; font-size: 0.65rem; font-weight: 500; min-width: 56px;
}
.bottom-nav__item svg { width: 22px; height: 22px; }
.bottom-nav__item.active, .bottom-nav__item:hover { color: var(--color-text-primary); }
.bottom-nav__item.active svg { stroke: white; }

/* DESKTOP LARGE (>= 1440px) */
@media (min-width: 1440px) {
    :root { --sidebar-width: 280px; }
    .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}
    .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
    .charts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* UTILITARIOS */
.hide-mobile { display: block; }
.show-mobile { display: none; }
@media (max-width: 768px) { .hide-mobile { display: none; } .show-mobile { display: block; } }
.hide-tablet { display: block; }
.show-tablet { display: none; }
@media (max-width: 1024px) { .hide-tablet { display: none; } .show-tablet { display: block; } }

/* Safe area para iOS notch */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar { padding-bottom: env(safe-area-inset-bottom); }
}


/* ==========================================================================
   Aura Design System ExtensÃµes
   ========================================================================== */

h1, h2, h3, .header__title, .modal-title, .card__title {
    font-family: var(--font-elegant);
    letter-spacing: -0.02em;
}

/* NOISE GRAIN */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.bg-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-base);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.03), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03), transparent 25%),
        linear-gradient(60deg, transparent 40%, rgba(255, 255, 255, 0.02) 45%, rgba(255, 255, 255, 0.01) 46%, transparent 50%),
        linear-gradient(-30deg, transparent 20%, rgba(255, 255, 255, 0.015) 25%, rgba(255, 255, 255, 0.01) 26%, transparent 30%);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

/* FLASHLIGHT EFFECT (Cards KPI - Dark Mode) */
.kpi-card {
    background: var(--color-bg-glass);
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0px;
    background: radial-gradient(400px circle at var(--mouse-x, 0) var(--mouse-y, 0),
            rgba(255, 255, 255, 0.06),
            transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 2;
}
.kpi-card:hover::before {
    opacity: 1;
}

/* BEAM BUTTON ANIMATION */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-beam {
    position: relative;
    z-index: 10;
    overflow: hidden;
    padding: 2px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    display: inline-block;
    cursor: pointer;
}
.btn-beam::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    background: conic-gradient(from 90deg at 50% 50%, #27272a 0%, #ffffff 50%, #27272a 100%);
    animation: spin 4s linear infinite;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-beam:hover::before {
    opacity: 1;
}
.btn-beam-content {
    background-color: #18181b;
    color: white;
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    border-radius: calc(var(--radius-md) - 2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
}

/* SCROLLBAR - Dark Mode */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}


/* ==========================================================================
   Fluid Typography & Responsiveness (Sprint 9)
   ========================================================================== */

/* Fluid Typography using clamp() */
:root {
    --text-sm: clamp(0.75rem, 0.7rem + 0.2vw, 0.875rem);
    --text-base: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
    --text-lg: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem);
}

body {
    font-size: var(--text-base);
}

.header__title {
    font-size: var(--text-3xl);
}

.card__title {
    font-size: var(--text-xl);
}

.kpi-card__info p {
    font-size: var(--text-2xl);
}

/* Tablet (between 768px and 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
        padding: 2rem 0.5rem;
    }
    .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}
    body.sidebar--collapsed .sidebar {
        width: 70px;
    }
    body.sidebar--collapsed .main-content {
    flex: 1;
    padding: 100px 4rem 2rem 4rem; /* Top padding para navbar fixa */
}
    .card-grid, .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

/* Extra Large Screens (4K / Ultrawide) */
@media (min-width: 1920px) {
    .layout {
        max-width: 1920px;
        margin: 0 auto;
        box-shadow: 0 0 50px rgba(0,0,0,0.1);
    }
}

/* ==========================================================================
   High DPI / Retina Display Support
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Make borders crisper on Retina screens */
    .card, .sidebar, .mobile-navbar, .form-input, .table-container {
        border-width: 0.5px;
    }
    
    /* Adjust glassmorphism blur for better performance and visual fidelity */
    .card {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    
    /* Adjust text smoothing for sharper fonts */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Fine-tune noise overlay for high density screens */
    .noise {
        opacity: 0.03;
    }
}

/* ==========================================================================
   GSAP Reveal Animations
   ========================================================================== */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(15px);
    will-change: transform, opacity, filter;
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.reveal-zoom {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(10px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-zoom.active {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* ==========================================================================
   Modern Navbar Effects
   ========================================================================== */
.nav-link-modern {
    position: relative;
    color: var(--color-text-secondary, #a8a29e);
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}
.nav-link-modern:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}
.nav-link-modern::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    background-color: #ffffff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
}
.nav-link-modern:hover::after {
    width: 100%;
}

/* Mobile Menu Animation */
.mobile-menu-animated {
    display: flex;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-width: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu-animated.active {
    max-height: 500px;
    opacity: 1;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-bottom-width: 1px;
}

.mobile-link-modern {
    display: block;
    color: var(--color-text-secondary, #a8a29e);
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    transform: translateX(-10px);
    opacity: 0;
}
.mobile-menu-animated.active .mobile-link-modern {
    transform: translateX(0);
    opacity: 1;
}
/* Stagger mobile links */
.mobile-menu-animated.active .mobile-link-modern:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-animated.active .mobile-link-modern:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu-animated.active .mobile-link-modern:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu-animated.active .mobile-link-modern:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu-animated.active .mobile-link-modern:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu-animated.active .mobile-link-modern:nth-child(6) { transition-delay: 0.3s; }
.mobile-menu-animated.active .mobile-link-modern:nth-child(7) { transition-delay: 0.35s; }
.mobile-menu-animated.active .mobile-link-modern:nth-child(8) { transition-delay: 0.4s; }

.mobile-link-modern:hover {
    color: #ffffff;
    padding-left: 0.5rem;
}


/* ==========================================================================
   Modern Tabs (Pill Style)
   ========================================================================== */
.tabs-menu {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 2rem;
    padding: 0.4rem;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: max-content;
    max-width: 100%;
    backdrop-filter: blur(10px);
}
.tabs-menu::-webkit-scrollbar { display: none; }
.tab-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary, #a8a29e);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.tab-btn:hover {
    color: var(--color-text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.04);
}
.tab-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-weight: 600;
}
.tab-btn.active::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

/* ==========================================================================
   Sticky Page Header
   ========================================================================== */
.sticky-page-header {
    position: sticky;
    top: 64px;
    z-index: 40;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    background: rgba(30, 30, 35, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    margin-left: -4rem;
    margin-right: -4rem;
    padding-left: 4rem;
    padding-right: 4rem;
    margin-top: -30px;
    padding-top: 30px;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}
.sticky-page-header .tabs-menu { margin-bottom: 0; }
.sticky-page-header .header { margin-bottom: 1rem; align-items: center; }

@media (max-width: 768px) {
    .sticky-page-header {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Override para header fixo da celula ativa - sem efeito sanfona */

/* Restaurando altura fixa para view-gestao-celula sem quebrar a largura */
#view-gestao-celula .sticky-page-header {
    height: 145px !important;
    min-height: 145px !important;
    max-height: 145px !important;
    padding-top: 1rem !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    justify-content: flex-start !important;
    z-index: 30 !important;
}

#view-gestao-celula .sticky-page-header .header__title {
    font-size: 1.25rem !important;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* Header heights e typography padrao */
.sticky-page-header { min-height: 145px; display: flex; flex-direction: column; justify-content: flex-end; }
.header__title { text-transform: uppercase; font-weight: 800; letter-spacing: 0.02em; font-size: clamp(1.2rem, 3vw, 1.8rem) !important; margin: 0; }
.header__actions { display: flex; align-items: center; }

/* ==========================================================================
   Light Theme (Aura System)
   ========================================================================== */
html.light-theme body {
    --color-bg-base: #f8fafc;
    --color-bg-surface: #ffffff;
    --color-bg-glass: rgba(255, 255, 255, 0.85);
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-accent: #0f172a;
    --color-border: #e2e8f0;
    --color-hover: #f1f5f9;
    --color-surface: #ffffff;
    --color-primary: #4f46e5;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    --border-glass: 1px solid rgba(0, 0, 0, 0.05);

    --beam-base-color: rgba(0, 0, 0, 0.15);
    --beam-gradient: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}

body { transition: background-color 0.3s ease, color 0.3s ease; }

/* Navbar em Light Theme */
html.light-theme body #navbar .absolute.inset-0 {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
html.light-theme body .nav-link-modern { color: #475569; }
html.light-theme body .nav-link-modern:hover { color: #0f172a; text-shadow: none; }
html.light-theme body .nav-link-modern::after { background-color: #0f172a; box-shadow: none; }
html.light-theme body #navbar .text-white { color: #0f172a !important; }
html.light-theme body #navbar .text-stone-400 { color: #64748b !important; }
html.light-theme body #navbar .bg-stone-900 { background-color: #e2e8f0; }
html.light-theme body #navbar img[src*="logo_branco.png"] { filter: invert(1); }
html.light-theme body .mobile-menu-animated { background: rgba(255, 255, 255, 0.95) !important; border-color: rgba(0, 0, 0, 0.1) !important; }
html.light-theme body .mobile-link-modern { color: #475569; }
html.light-theme body .mobile-link-modern:hover { color: #0f172a; }

/* Modal e Cards */
html.light-theme body .modal-content { background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1); }
html.light-theme body .card { background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.05); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
html.light-theme body .data-table th { background-color: #f1f5f9; color: #475569; }
html.light-theme body .data-table tr { border-bottom: 1px solid #e2e8f0; }
html.light-theme body .data-table tr:hover { background-color: #f8fafc; }
html.light-theme body .form-input, html.light-theme body .form-select { background-color: #ffffff; border-color: #cbd5e1; color: #0f172a; }
html.light-theme body select.form-input option, html.light-theme body select.form-select option { background-color: #ffffff !important; color: #000000 !important; }
html.light-theme body .form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

/* Light Theme - Sticky Header (escuro por design) */
html.light-theme body .sticky-page-header {
    background: rgba(15, 23, 42, 0.95) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #ffffff !important;
    --color-text-primary: #ffffff !important;
    --color-text-secondary: rgba(255, 255, 255, 0.7) !important;
    --color-surface: rgba(255, 255, 255, 0.05) !important;
    --color-border: rgba(255, 255, 255, 0.15) !important;
}
html.light-theme body .sticky-page-header h1,
html.light-theme body .sticky-page-header h2,
html.light-theme body .sticky-page-header .header__subtitle { color: #ffffff !important; }
html.light-theme body .sticky-page-header .tabs-menu { background: rgba(255, 255, 255, 0.05) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; }
html.light-theme body .sticky-page-header .tab-btn { color: rgba(255, 255, 255, 0.7) !important; }
html.light-theme body .sticky-page-header .tab-btn:hover { background: rgba(255, 255, 255, 0.1) !important; color: #fff !important; }
html.light-theme body .sticky-page-header .tab-btn.active { background: #ffffff !important; color: #0f172a !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important; }
html.light-theme body .sticky-page-header select.form-input { background-color: #ffffff !important; color: #000000 !important; border-color: #cbd5e1 !important; }

/* Light Theme - Celula ativa (header com cores claras) */



/* Light Theme - Tabs fora do header sticky */
html.light-theme body .tabs-menu {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
html.light-theme body .tab-btn { color: #475569 !important; font-weight: 500; }
html.light-theme body .tab-btn:hover { background: rgba(0, 0, 0, 0.05) !important; color: #0f172a !important; }
html.light-theme body .tab-btn.active { background: #ffffff !important; color: #000000 !important; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important; }
html.light-theme body .tab-btn.active::before { display: none; }

/* Light Theme - Botoes primarios */
html.light-theme body .btn--primary { background: #ffffff !important; color: #000000 !important; border: 1px solid rgba(0, 0, 0, 0.1) !important; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important; font-weight: 600; }
html.light-theme body .btn--primary:hover { background: #f8fafc !important; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15) !important; }

/* ==========================================================================
   Fundo Animado Moderno (Gradient Drift) para Tema Claro
   ========================================================================== */
html.light-theme body .bg-grid-overlay {
    background-image:
        radial-gradient(circle at 15% 50%, rgba(15, 23, 42, 0.12), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(15, 23, 42, 0.12), transparent 25%),
        linear-gradient(60deg, transparent 40%, rgba(15, 23, 42, 0.10) 45%, rgba(15, 23, 42, 0.06) 46%, transparent 50%),
        linear-gradient(-30deg, transparent 20%, rgba(15, 23, 42, 0.08) 25%, rgba(15, 23, 42, 0.05) 26%, transparent 30%);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
    opacity: 1;
}

html.light-theme body .mobile-navbar {
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* Fix global content stacking over grid overlay */
.main-content { position: relative; z-index: 1; }

\n
/* FOLDER TAB ANIMATION - SÓ PARA A ABA ATIVA */
#navbar .max-w-\\[1600px\\] {
    position: relative;
}

/* A linha contínua que cruza o menu */
#navbar .max-w-\\[1600px\\]::after {
    content: '';
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    top: calc(50% + 14px); /* Fica exatamente na base dos botões */
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
    z-index: 0;
}

/* Ocultar a borda global original do header para não ficar com duas linhas */
#navbar .absolute.inset-0 {
    border-bottom: none !important;
}

/* Estilo do texto da aba ativa */
.nav-link-modern.active {
    font-weight: 700 !important;
    color: #ffffff !important;
    z-index: 10;
}

/* Esconder o sublinhado original de hover na aba ativa */
.nav-link-modern.active::after {
    display: none !important;
}



/* Ajustes para o Tema Claro */
html.light-theme body #navbar .max-w-\\[1600px\\]::after {
    background-color: rgba(0, 0, 0, 0.1);
}
html.light-theme body .nav-link-modern.active {
    color: #000000 !important;
}

\n\n
\n




/* CONTINUOUS SWEEPING BEAM ANIMATION V4 */
@keyframes sweep {
    0% { background-position: -200px 0; }
    50% { background-position: calc(100vw + 200px) 0; }
    100% { background-position: -200px 0; }
}

.nav-link-modern {
    position: relative;
    z-index: 1; 
}

header nav.hidden.xl\:flex {
    position: relative;
    border-bottom: none !important;
    align-items: flex-end !important;
}

header nav.hidden.xl\:flex::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 2px;
    background-color: var(--beam-base-color, rgba(255,255,255,0.15));
    background-image: var(--beam-gradient, linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent));
    background-size: 150px 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    animation: sweep 6s ease-in-out infinite;
    z-index: 0;
}

#navbar .absolute.inset-0 {
    border-bottom: none !important;
}

.nav-link-modern.active {
    font-weight: 700 !important;
    color: var(--color-text-primary, #ffffff) !important;
    padding: 0.5rem 1rem !important;
    margin-bottom: 0 !important;
    border: none !important; 
    background: transparent !important;
    z-index: 10;
}

.nav-link-modern.active::after {
    display: block !important;
    content: '';
    position: absolute;
    top: -0.25rem; 
    bottom: 0; 
    left: -0.75rem; 
    right: -0.75rem;
    width: auto !important; 
    height: auto !important;
    background-color: var(--color-bg-base);
    border-radius: 8px 8px 0 0;
    transform: none !important;
    z-index: -2;
    clip-path: polygon(-50% -50%, 150% -50%, 150% 100%, -50% 100%);
}

.nav-link-modern.active::before {
    content: '';
    position: absolute;
    top: -0.25rem; 
    bottom: -2px; 
    left: -0.75rem; 
    right: -0.75rem;
    border-radius: 8px 8px 0 0;
    padding: 2px; 
    background-color: var(--beam-base-color, rgba(255,255,255,0.15));
    background-image: var(--beam-gradient, linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent));
    background-size: 150px 100%;
    background-repeat: no-repeat;
    background-attachment: scroll; /* REMOVED FIXED TO PREVENT BUG */
    animation: sweep-btn 4s ease-in-out infinite; /* NEW INDEPENDENT ANIMATION */
    
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2px), 0 calc(100% - 2px));
    
    z-index: -1;
    pointer-events: none;
}


html.light-theme body .nav-link-modern.active {
    color: #000000 !important;
}
html.light-theme body .nav-link-modern.active::after {
    background-color: #ffffff;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
}






@keyframes sweep-btn {
    0% { background-position: -200px 0; }
    50% { background-position: calc(100% + 200px) 0; }
    100% { background-position: -200px 0; }
}


/* WhatsApp Animated Button */
.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--color-success);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid transparent;
}
.whatsapp-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}
.whatsapp-btn:active {
    transform: scale(0.95);
}
.whatsapp-btn iconify-icon {
    font-size: 1.2rem;
    color: #25D366;
    animation: pulse-wa 2s infinite;
}
@keyframes pulse-wa {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.15); filter: brightness(1.2); }
    100% { transform: scale(1); filter: brightness(1); }
}


.action-btn:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important;
}
.action-btn:disabled:hover {
    transform: none !important;
}
