:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #e8eaed;
    
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5a;
    --text-muted: #6c757d;
    
    --accent-primary: #004d40;
    --accent-secondary: #00796b;
    --accent-tertiary: #7b1fa2;
    --accent-glow: rgba(0, 77, 64, 0.15);
    
    --tab-active: #7b1fa2;
    --tab-hover: #9c27b0;
    
    --success: #2e7d32;
    --success-bg: rgba(46, 125, 50, 0.1);
    --warning: #ed6c02;
    --warning-bg: rgba(237, 108, 2, 0.1);
    --danger: #d32f2f;
    --danger-bg: rgba(211, 47, 47, 0.1);
    
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --border-accent: rgba(0, 77, 64, 0.3);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --header-gradient: linear-gradient(135deg, #004d40 0%, #00695c 100%);
}

/* Dark Theme - CODxAI Style */
[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #161b22;
    --bg-hover: #30363d;
    
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --accent-primary: #58a6ff;
    --accent-secondary: #79c0ff;
    --accent-tertiary: #a371f7;
    --accent-glow: rgba(88, 166, 255, 0.3);
    
    --tab-active: #a371f7;
    --tab-hover: #c297ff;
    
    --success: #3fb950;
    --success-bg: rgba(63, 185, 80, 0.15);
    --warning: #d29922;
    --warning-bg: rgba(210, 153, 34, 0.15);
    --danger: #f85149;
    --danger-bg: rgba(248, 81, 73, 0.15);
    
    --border: #30363d;
    --border-hover: #484f58;
    --border-accent: rgba(88, 166, 255, 0.4);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --header-gradient: linear-gradient(135deg, #161b22 0%, #21262d 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Style (ALESP inspired) */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.header-top {
    background: var(--header-gradient);
    padding: 0.5rem 0;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text h1 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: white;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.theme-toggle .icon-sun {
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* Searchable Select Component */
.selector-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.searchable-select {
    position: relative;
    min-width: 480px;
}

.searchable-select .select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.searchable-select .select-display:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.searchable-select.open .select-display {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.searchable-select .dropdown-icon {
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.searchable-select.open .dropdown-icon {
    transform: rotate(180deg);
}

.searchable-select #selected-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select .options-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.searchable-select.open .options-dropdown {
    display: block;
}

.searchable-select .search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.searchable-select .search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.searchable-select .search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.searchable-select .search-box input::placeholder {
    color: var(--text-muted);
}

.searchable-select .options-list {
    max-height: 280px;
    overflow-y: auto;
}

.searchable-select .option-item {
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.searchable-select .option-item:last-child {
    border-bottom: none;
}

.searchable-select .option-item:hover {
    background: var(--bg-hover);
}

.searchable-select .option-item.selected {
    background: var(--accent-primary);
    color: white;
}

.searchable-select .option-item.highlighted {
    background: var(--bg-hover);
}

.searchable-select .option-item.no-results {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

.searchable-select .option-item.no-results:hover {
    background: transparent;
}

/* Scrollbar styles */
.searchable-select .options-list::-webkit-scrollbar,
.table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.searchable-select .options-list::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.searchable-select .options-list::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.searchable-select .options-list::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    width: 100%;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    max-width: 400px;
    font-size: 0.95rem;
}

/* Dashboard Content */
.dashboard-content {
    animation: fadeIn 0.4s ease;
}

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

/* Candidato Profile Card (ALESP style) */
.candidato-profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.profile-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.candidato-avatar {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    border: 3px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.candidato-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.candidato-avatar svg {
    width: 80px;
    height: 80px;
}

.profile-info h2 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.candidato-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag.partido {
    background: var(--accent-glow);
    color: var(--accent-secondary);
}

.tag.numero {
    background: var(--success-bg);
    color: var(--success);
}

.tag.cargo {
    background: var(--warning-bg);
    color: var(--warning);
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.5rem 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.detail-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-financial {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.financial-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.financial-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.financial-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--success);
}

.financial-value.gastos {
    color: var(--warning);
}

/* Tabs Container (ALESP style) */
.tabs-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: fit-content;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--tab-hover);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: #ffffff;
    background: var(--tab-active);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn.active::after {
    display: none;
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.info-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.info-table .label-cell {
    color: var(--text-muted);
    width: 120px;
}

/* Redes Sociais */
.redes-sociais-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rede-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rede-social-link:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Section Block */
.section-block {
    margin-bottom: 1.5rem;
}

.section-block h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h4 {
    margin-bottom: 0;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239595a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

.filter-select:hover {
    border-color: var(--border-hover);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Bens Declarados */
.bens-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.bens-total-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.bens-total-valor {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
}

/* Table Container with Pagination */
.table-container {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-container.paginated {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table td.good {
    color: var(--success);
    font-weight: 600;
}

.data-table td.medium {
    color: var(--warning);
    font-weight: 600;
}

.data-table td.low {
    color: var(--danger);
    font-weight: 600;
}

.data-table td.votes-cell {
    font-weight: 600;
    color: var(--accent-secondary);
}

.data-table td.valor-cell {
    font-weight: 600;
    color: var(--success);
    text-align: right;
}

.data-table .no-data-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Section Header with Actions */
.section-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header-with-actions h4 {
    margin: 0;
}

/* Export Button */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: #1da34d;
    transform: translateY(-1px);
}

.btn-export svg {
    width: 16px;
    height: 16px;
}

/* Table Filters */
.table-filters {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 1px solid var(--border);
}

.filter-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.filter-input::placeholder {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* Pagination Controls */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.page-select {
    padding: 0.4rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
}

/* KPIs Grid */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.kpi-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon.votes {
    background: var(--success-bg);
    color: var(--success);
}

.kpi-icon.ranking {
    background: var(--warning-bg);
    color: var(--warning);
}

.kpi-icon.money {
    background: var(--accent-glow);
    color: var(--accent-secondary);
}

.kpi-icon.donations {
    background: var(--danger-bg);
    color: var(--danger);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.kpi-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.kpi-badge.secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Map and Regions */
.map-and-regions {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.map-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow: hidden;
}

.votos-map {
    height: 350px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.votos-map .leaflet-popup-content-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.votos-map .leaflet-popup-tip {
    background: var(--bg-card);
}

.votos-map .leaflet-popup-content {
    margin: 12px 14px;
}

.votos-map .leaflet-popup-content h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.votos-map .leaflet-popup-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.votos-map .votos-label {
    background: rgba(0, 0, 0, 0.85);
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.votos-map .votos-label::before {
    display: none;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-color.forte {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.legend-color.medio {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.legend-color.fraco {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.region-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.region-column {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    flex: 1;
}

.region-column h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.indicator.green {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.indicator.red {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.region-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
}

.region-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.region-item:hover {
    background: var(--bg-hover);
}

.region-item .region-name {
    font-weight: 500;
    font-size: 0.85rem;
}

.region-item .region-zone {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.4rem;
}

.region-item .region-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.region-item .region-votes {
    font-weight: 600;
    font-size: 0.85rem;
}

.region-item .region-percent {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.region-column.strong .region-percent {
    background: var(--success-bg);
    color: var(--success);
}

.region-column.weak .region-percent {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.charts-grid .full-width {
    grid-column: 1 / -1;
}

.chart-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.chart-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.chart-container {
    height: 250px;
    position: relative;
}

/* Fornecedores */
.fornecedores-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.fornecedores-column {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.fornecedores-column h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.badge-confiavel {
    width: 18px;
    height: 18px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.badge-nao-confiavel {
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.fornecedores-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 300px;
    overflow-y: auto;
}

.fornecedor-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
}

.fornecedor-item.confiavel {
    border-left-color: var(--success);
}

.fornecedor-item.nao-confiavel {
    border-left-color: var(--danger);
}

.fornecedor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.35rem;
}

.fornecedor-nome {
    font-weight: 600;
    font-size: 0.85rem;
}

.fornecedor-score {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.fornecedor-item.confiavel .fornecedor-score {
    background: var(--success-bg);
    color: var(--success);
}

.fornecedor-item.nao-confiavel .fornecedor-score {
    background: var(--danger-bg);
    color: var(--danger);
}

.fornecedor-tipo {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.fornecedor-valor {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.fornecedor-justificativas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.justificativa-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Concorrentes */
.concorrentes-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.concorrente-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.concorrente-posicao {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.concorrente-posicao.pos-1 {
    background: linear-gradient(135deg, #ffd700, #ffb800);
    color: #1a1a24;
}

.concorrente-posicao.pos-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #1a1a24;
}

.concorrente-posicao.pos-3 {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: white;
}

.concorrente-info {
    flex: 1;
}

.concorrente-nome {
    font-weight: 600;
    font-size: 0.95rem;
}

.concorrente-partido {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.concorrente-stats {
    text-align: right;
}

.concorrente-votos {
    font-weight: 600;
}

.concorrente-percent {
    font-size: 0.8rem;
    color: var(--success);
}

/* Abstencao Grid */
.abstencao-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.abstencao-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.abstencao-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.abstencao-card.alta::before {
    background: var(--success);
}

.abstencao-card.media::before {
    background: var(--warning);
}

.abstencao-card.baixa::before {
    background: var(--danger);
}

.abstencao-municipio {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.abstencao-zona {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.abstencao-percent {
    font-size: 1.15rem;
    font-weight: 700;
}

.abstencao-card.alta .abstencao-percent {
    color: var(--success);
}

.abstencao-card.media .abstencao-percent {
    color: var(--warning);
}

.abstencao-card.baixa .abstencao-percent {
    color: var(--danger);
}

.abstencao-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Ranking Partido */
.ranking-partido-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.ranking-partido-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.ranking-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.ranking-position {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ranking-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
}

.ranking-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ranking-text strong {
    color: var(--text-primary);
}

.ranking-stats {
    display: flex;
    gap: 2.5rem;
}

.ranking-stat {
    text-align: center;
}

.ranking-stat-value {
    font-size: 1.15rem;
    font-weight: 600;
}

.ranking-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 1.25rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* No Data Message */
.no-data-message {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .candidato-profile-card {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .profile-details,
    .profile-financial {
        padding: 0.75rem 1rem;
    }
    
    .kpis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .abstencao-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .searchable-select {
        min-width: 100%;
    }
    
    .map-and-regions {
        grid-template-columns: 1fr;
    }
    
    .votos-map {
        height: 280px;
    }
    
    .info-grid,
    .charts-grid,
    .fornecedores-grid {
        grid-template-columns: 1fr;
    }
    
    .ranking-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 1rem;
    }
    
    .kpis-grid {
        grid-template-columns: 1fr;
    }
    
    .abstencao-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tabs-nav {
        flex-wrap: nowrap;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .profile-left {
        flex-direction: column;
        text-align: center;
    }
    
    .candidato-tags {
        justify-content: center;
    }
}

/* Chat Assistant Styles */
.chat-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: all 0.3s ease;
    z-index: 1000;
}

.chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px var(--accent-glow);
}

.chat-fab.active {
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-md);
}

.chat-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    height: 560px;
    max-height: calc(100vh - 4rem);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    animation: chatSlideIn 0.3s ease;
}

.chat-panel.open {
    display: flex;
}

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

.chat-header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-title svg {
    width: 22px;
    height: 22px;
}

.chat-header-title span {
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.2s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-config {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.chat-config-row {
    margin-bottom: 0.5rem;
}

.chat-config-row:last-child {
    margin-bottom: 0;
}

.chat-config-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.chat-config-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    transition: border-color 0.2s ease;
}

.chat-config-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.chat-config-input::placeholder {
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.chat-empty-state svg {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-empty-state p {
    font-size: 0.85rem;
}

.chat-message {
    display: flex;
    animation: chatMessageIn 0.3s ease;
}

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

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-bubble pre {
    background: var(--bg-primary);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 0.4rem 0;
    font-size: 0.75rem;
}

.chat-bubble code {
    background: var(--bg-primary);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.chat-bubble pre code {
    background: transparent;
    padding: 0;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.65rem 0.9rem;
}

.chat-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: chatTyping 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.chat-input-area {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}

.chat-error {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-bottom: 0.6rem;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 500px) {
    .chat-panel {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 1rem;
        height: calc(100vh - 6rem);
    }
    
    .chat-fab {
        right: 1rem;
        bottom: 1rem;
    }
}

/* Light Theme Specific Overrides */
[data-theme="light"] .candidato-avatar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

[data-theme="light"] .kpi-icon.votes {
    background: var(--success-bg);
    color: var(--success);
}

[data-theme="light"] .kpi-icon.ranking {
    background: var(--warning-bg);
    color: var(--warning);
}

[data-theme="light"] .kpi-icon.money {
    background: var(--accent-glow);
    color: var(--accent-primary);
}

[data-theme="light"] .kpi-icon.donations {
    background: var(--danger-bg);
    color: var(--danger);
}

[data-theme="light"] .tag.partido {
    background: var(--accent-glow);
    color: var(--accent-primary);
}

[data-theme="light"] .tag.numero {
    background: var(--success-bg);
    color: var(--success);
}

[data-theme="light"] .tag.cargo {
    background: var(--warning-bg);
    color: var(--warning);
}

[data-theme="dark"] .tab-btn.active {
    color: #ffffff;
    background: var(--tab-active);
}

[data-theme="dark"] .tab-btn:hover {
    color: var(--tab-hover);
}

[data-theme="light"] .ranking-number {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

[data-theme="light"] .concorrente-posicao.pos-1 {
    background: linear-gradient(135deg, #ffd700, #ffb800);
    color: #1a1a24;
}

[data-theme="light"] .concorrente-posicao.pos-2 {
    background: linear-gradient(135deg, #b0b0b0, #909090);
    color: #1a1a24;
}

[data-theme="light"] .concorrente-posicao.pos-3 {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
    color: white;
}

[data-theme="light"] .chat-fab {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 4px 20px var(--accent-glow);
}

[data-theme="light"] .chat-header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

[data-theme="light"] .chat-message.user .chat-bubble {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

[data-theme="light"] .chat-send-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

[data-theme="light"] .logo-icon {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .profile-financial {
    border-left-color: var(--accent-primary);
}

[data-theme="light"] .legend-color.forte {
    background: var(--success);
    box-shadow: 0 0 6px rgba(46, 125, 50, 0.5);
}

[data-theme="light"] .legend-color.medio {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(237, 108, 2, 0.5);
}

[data-theme="light"] .legend-color.fraco {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(211, 47, 47, 0.5);
}

[data-theme="light"] .indicator.green {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

[data-theme="light"] .indicator.red {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

[data-theme="light"] .kpi-badge {
    background: var(--success-bg);
    color: var(--success);
}

[data-theme="light"] .kpi-badge.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

[data-theme="light"] .pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

[data-theme="light"] .searchable-select .option-item.selected {
    background: var(--accent-primary);
    color: white;
}

[data-theme="light"] .data-table td.votes-cell {
    color: var(--accent-primary);
}

[data-theme="light"] .fornecedor-item.confiavel {
    border-left-color: var(--success);
}

[data-theme="light"] .fornecedor-item.confiavel .fornecedor-score {
    background: var(--success-bg);
    color: var(--success);
}

[data-theme="light"] .fornecedor-item.nao-confiavel {
    border-left-color: var(--danger);
}

[data-theme="light"] .fornecedor-item.nao-confiavel .fornecedor-score {
    background: var(--danger-bg);
    color: var(--danger);
}

[data-theme="light"] .region-column.strong .region-percent {
    background: var(--success-bg);
    color: var(--success);
}

[data-theme="light"] .region-column.weak .region-percent {
    background: var(--danger-bg);
    color: var(--danger);
}

[data-theme="light"] .abstencao-card.alta .abstencao-percent {
    color: var(--success);
}

[data-theme="light"] .abstencao-card.media .abstencao-percent {
    color: var(--warning);
}

[data-theme="light"] .abstencao-card.baixa .abstencao-percent {
    color: var(--danger);
}

[data-theme="light"] .abstencao-card.alta::before {
    background: var(--success);
}

[data-theme="light"] .abstencao-card.media::before {
    background: var(--warning);
}

[data-theme="light"] .abstencao-card.baixa::before {
    background: var(--danger);
}

/* Photo Modal */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.photo-modal.active {
    display: flex;
}

.photo-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.photo-modal-content {
    position: relative;
    z-index: 1;
    text-align: center;
    animation: photoModalIn 0.3s ease;
}

@keyframes photoModalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.photo-modal-content img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.photo-modal-name {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.candidato-avatar {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.candidato-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 450px;
    width: 90%;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.modal-icon {
    font-size: 1.5rem;
}

.modal-icon.warning {
    color: var(--warning);
}

.modal-icon.danger {
    color: var(--danger);
}

.modal-icon.success {
    color: var(--success);
}

.modal-icon.info {
    color: var(--accent-primary);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-submessage {
    margin-top: 0.75rem !important;
    font-size: 0.9rem;
    color: var(--text-secondary) !important;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
    justify-content: flex-end;
}

.btn-modal-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-modal-confirm {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-confirm:hover {
    background: var(--accent-secondary);
}

.btn-modal-confirm.danger {
    background: var(--danger);
}

.btn-modal-confirm.danger:hover {
    filter: brightness(1.1);
}

/* =============================================== */
/* PESQUISAS ELEITORAIS                           */
/* =============================================== */

.pesquisas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pesquisas-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pesquisas-filters {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: var(--border-hover);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.pesquisas-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.pesquisas-stats .stat-item {
    background: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pesquisas-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.pesquisas-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#pesquisas-table {
    font-size: 0.8125rem;
}

#pesquisas-table th,
#pesquisas-table td {
    padding: 0.75rem 0.625rem;
}

#pesquisas-table td {
    vertical-align: middle;
}

.pesquisa-empresa {
    font-weight: 500;
    color: var(--text-primary);
}

.pesquisa-registro {
    font-family: monospace;
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
}

.pesquisa-periodo {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.pesquisa-contratante {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pesquisa-custo {
    font-weight: 600;
    color: var(--success);
}

.pesquisa-margem {
    font-family: monospace;
    font-size: 0.75rem;
}

