* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #060B18;
    color: #ffffff;
    overflow-x: hidden;
    color-scheme: dark;
}

.gemini-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: #060B18;
    overflow: hidden;
    pointer-events: none;
}

.aurora-light {
    position: absolute;
    border-radius: 50%;
    top: -45%;
    filter: blur(90px);
}

.al-green {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #19B96A 0%, transparent 60%);
    left: -15%;
    opacity: 0.85;
    animation: drift-green 8s ease-in-out infinite alternate;
}

.al-blue {
    width: 65vw;
    height: 65vw;
    background: radial-gradient(circle, #3A8BFF 0%, transparent 60%);
    left: 10%;
    opacity: 0.85;
    animation: drift-blue 10s ease-in-out infinite alternate;
}

.al-red {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #F84645 0%, transparent 60%);
    left: 40%;
    opacity: 0.85;
    animation: drift-red 9s ease-in-out infinite alternate;
}

.al-yellow {
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle, #F1BB1C 0%, transparent 60%);
    right: -10%;
    opacity: 0.80;
    animation: drift-yellow 11s ease-in-out infinite alternate;
}

@keyframes drift-green {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(25vw, 8vh) scale(1.1);
    }
}

@keyframes drift-blue {
    0% {
        transform: translate(0, 0) scale(1.05);
    }

    100% {
        transform: translate(30vw, 5vh) scale(1.0);
    }
}

@keyframes drift-red {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-10vw, 5vh) scale(1.15);
    }
}

@keyframes drift-yellow {
    0% {
        transform: translate(0, 0) scale(0.95);
    }

    100% {
        transform: translate(-15vw, 20vh) scale(1.0);
    }
}

/* --- HOME & MODULOS --- */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.module-cards {
    display: flex;
    gap: 30px;
    max-width: 900px;
    width: 100%;
    justify-content: center;
}

.module-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px 20px;
    color: white;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.module-card:hover {
    transform: translateY(-8px);
    border-color: #3A8BFF;
    background: rgba(58, 139, 255, 0.08);
    box-shadow: 0 10px 30px rgba(58, 139, 255, 0.25);
}

.module-card h2 {
    margin-bottom: 15px;
    font-size: 1.6rem;
    color: #fff;
}

.module-card p {
    font-size: 0.95rem;
    color: #8292A6;
    line-height: 1.5;
    margin: 0;
}

.btn-voltar {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #A0AEC0;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 20px;
}

.btn-voltar:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* --- SIDEBAR E ESTRUTURA BASE --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 320px;
    background-color: #060B18;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.sidebar h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

hr {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.filter-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: #A0AEC0;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.95rem;
    outline: none;
}

.filter-group select:disabled,
.filter-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.filter-group select option {
    background: #060B18;
    color: white;
}

.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #A0AEC0;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #3A8BFF;
}

.action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    margin-top: 5px;
    background: rgba(58, 139, 255, 0.1);
    border: 1px solid #3A8BFF;
    color: #3A8BFF;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.action-btn:hover {
    background: #3A8BFF;
    color: white;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    height: 100vh;
}

.hero {
    text-align: center;
    margin-bottom: 40px;
}

.title-glow {
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #3A8BFF, #19B96A, #F1BB1C);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #A0AEC0;
    font-size: 1.1rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.chart-card,
.map-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    position: relative;
}

.dashboard h3 {
    margin-bottom: 16px;
    font-weight: 600;
    color: #E2E8F0;
}

.inline-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.inline-filter label {
    font-size: 0.85rem;
    color: #A0AEC0;
    white-space: nowrap;
    font-weight: 600;
}

.inline-filter input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.chart-scroll-wrapper {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

.chart-scroll-wrapper::-webkit-scrollbar {
    width: 8px;
}

.chart-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chart-scroll-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.chart-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* --- TABELAS COMPARATIVAS (ATUALIZADO) --- */
.card-table {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Container com rolagem vertical e horizontal */
.table-responsive {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    padding-right: 5px;
}

/* Customização da barra de rolagem da tabela */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: #fff;
    min-width: 800px;
}

.data-table th,
.data-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

/* Cabeçalho fixo (Sticky) para não sumir no scroll */
.data-table th {
    position: sticky;
    top: 0;
    background: #0B1221;
    /* Cor sólida combinando com o tema para cobrir o texto rolando */
    font-weight: 600;
    color: #A0AEC0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* Sombra suave para separar o cabeçalho dos dados */
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.data-table td.destaque {
    color: #3A8BFF;
    font-weight: 800;
    font-size: 1rem;
}

.rank-votos {
    color: #8292A6;
    font-size: 0.85em;
    margin-left: 4px;
}

/* --- ABAS E SPINNERS --- */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #A0AEC0;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 16px;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}

.tab-btn.active {
    color: #3A8BFF;
    border-bottom-color: #3A8BFF;
    font-weight: 600;
}

.loading {
    text-align: center;
    color: #A0AEC0;
    padding: 20px;
}

.spinner {
    font-size: 2rem;
    animation: pulse 1.5s infinite;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .module-cards {
        flex-direction: column;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        height: auto;
    }

    .main-content {
        height: auto;
        padding: 20px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .inline-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .inline-filter input {
        width: 100%;
    }
}