.table-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
}
.table-filters {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    height: 100%;
}
.table-filters h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-label { font-size: 12px; color: var(--text-secondary); margin: 10px 0 6px; display: block; }

/* Campos dentro do painel de filtros ocupam largura total */
.table-filters .search-box { width: 100%; }
.table-filters .search-box input { width: 100%; }
.table-filters .table-filter { width: 100%; min-width: 0; }
.table-filters #tableMunicipio { width: 100%; }

@media (max-width: 1024px) {
    .table-layout { grid-template-columns: 1fr; }
}
/* ===== RESET E CONFIGURAÇÕES BÁSICAS ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1976d2;
    --primary-dark: #0d47a1;
    --secondary-color: #1565c0;
    --success-color: #388e3c;
    --warning-color: #f57c00;
    --danger-color: #d32f2f;
    --info-color: #2196f3;
    
    --status-pendente: #f57c00;
    --status-analise: #0288d1;
    --status-aprovado: #388e3c;
    --status-vencido: #d32f2f;
    --status-reprovado: #757575;
    
    --risco-baixo: #4caf50;
    --risco-medio: #ff9800;
    --risco-alto: #f44336;
    
    --bg-light: #f5f5f5;
    --bg-dark: #212121;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    
    --sidebar-width: 380px;
    --header-height: 65px;
    --transition: all 0.3s ease;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-light);
    color: var(--text-primary);
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

.header-content {
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 28px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 600;
}

.header-subtitle {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 400;
}

/* ===== HEADER USER ===== */
.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.user-role {
    font-size: 12px;
    opacity: 0.8;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.save-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--success-color);
    color: white;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    margin-left: 12px;
}

.save-status.saving {
    background: var(--warning-color);
}

.save-status.error {
    background: var(--error-color);
}

.save-status i {
    font-size: 10px;
}

.user-menu {
    position: relative;
}

.btn-user {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.btn-user:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    min-width: 200px;
}

.user-dropdown.active {
    display: flex;
}

.user-dropdown a {
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.user-dropdown hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
    z-index: 900;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    display: none;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-toggle-sidebar {
    background: white;
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

/* Remover botão de alternância da barra lateral (sem quebrar JS) */
.btn-toggle-sidebar { display: none; }

.btn-toggle-sidebar:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== CONTEÚDO DA SIDEBAR ===== */
.sidebar-content {
    padding: 0 20px 20px 20px;
}

/* Abas da sidebar - visual melhorado */
.sidebar-tabs {
    display: flex;
    gap: 6px;
    margin: 10px 0 14px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.sidebar-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.sidebar-tab-btn:hover { background: var(--bg-light); color: var(--text-primary); }
.sidebar-tab-btn:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.sidebar-tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}
.sidebar-tab-content { display: none; }
.sidebar-tab-content.active { display: block; }
.advanced-box { background: #fff; border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }

/* ===== CONTROLE DE CAMADAS GEOJSON ===== */
.geojson-control-section {
    margin-top: 12px;
    margin-bottom: 20px;
    position: relative;
}

.btn-geojson-toggle {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.btn-geojson-toggle:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.btn-geojson-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.btn-geojson-toggle.active::after {
    transform: rotate(180deg);
}

.geojson-layers-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.geojson-layers-menu.open {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
}

.geojson-layers-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
    position: sticky;
    top: 0;
    z-index: 1;
}

.geojson-layers-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close-small {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-small:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.geojson-layers-list {
    padding: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.geojson-layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateX(-10px);
    animation: slideInItem 0.3s ease forwards;
    background: #fff;
    border: 1px solid var(--border-color);
    border-left: 6px solid transparent; /* cor da camada inline no JS */
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.geojson-layer-item:nth-child(1) { animation-delay: 0.1s; }
.geojson-layer-item:nth-child(2) { animation-delay: 0.15s; }
.geojson-layer-item:nth-child(3) { animation-delay: 0.2s; }
.geojson-layer-item:nth-child(4) { animation-delay: 0.25s; }
.geojson-layer-item:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInItem {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.geojson-layer-item:hover {
    background: var(--bg-light);
    transform: translateX(0);
}

.geojson-layer-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.geojson-layer-item.active:hover {
    background: #b71c1c;
}

.geojson-layer-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.geojson-layer-name {
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.geojson-layer-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    opacity: 0.9;
}

.no-layers-message {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.no-layers-message i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
}

.no-layers-message p {
    margin: 8px 0;
    font-weight: 500;
}

.no-layers-message small {
    font-size: 11px;
    opacity: 0.8;
    line-height: 1.4;
}

/* ===== DASHBOARD STATS ===== */
.dashboard-stats {
    padding: 0 0 20px 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 12px;
}

/* Card Total ocupa toda a primeira linha */
.dashboard-stats .stat-total {
    grid-column: 1 / -1;
}

/* Card Total com largura completa */
.stat-card-full {
    grid-column: 1 / -1;
}

/* Título da seção */
.stat-section-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin: 8px 0;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compactação para caber na sidebar */
.sidebar .dashboard-stats { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
}
.sidebar .dashboard-stats .stat-card { 
    padding: 12px; 
    gap: 8px; 
    min-width: 0; 
    justify-content: center; 
    text-align: center; 
}
.sidebar .dashboard-stats .stat-icon { display: none; }
.sidebar .dashboard-stats .stat-info { align-items: center; }
.sidebar .dashboard-stats .stat-number { font-size: 20px; }
.sidebar .dashboard-stats .stat-label { font-size: 11px; }

/* Cores dos cards da sidebar */
.sidebar .dashboard-stats .stat-card.stat-total {
    background: var(--info-color);
    color: #fff;
    border-color: transparent;
}
.sidebar .dashboard-stats .stat-card.stat-aprovado {
    background: var(--success-color);
    color: #fff;
    border-color: transparent;
}
.sidebar .dashboard-stats .stat-card.stat-pendente {
    background: var(--warning-color);
    color: #fff;
    border-color: transparent;
}
.sidebar .dashboard-stats .stat-card.stat-vencido {
    background: var(--danger-color);
    color: #fff;
    border-color: transparent;
}

.sidebar .dashboard-stats .stat-card.stat-total .stat-label,
.sidebar .dashboard-stats .stat-card.stat-aprovado .stat-label,
.sidebar .dashboard-stats .stat-card.stat-pendente .stat-label,
.sidebar .dashboard-stats .stat-card.stat-vencido .stat-label {
    color: #fff;
}

/* Cores dos cards de nível de risco na sidebar */
.sidebar .dashboard-stats .stat-card.stat-inspecoes {
    background: var(--success-color);
    color: #fff;
    border-color: transparent;
}

.sidebar .dashboard-stats .stat-card.stat-autorizacoes {
    background: #ffc107;
    color: #fff;
    border-color: transparent;
}

.sidebar .dashboard-stats .stat-card.stat-licencas {
    background: #ff9800;
    color: #fff;
    border-color: transparent;
}

.sidebar .dashboard-stats .stat-card.stat-multas {
    background: var(--danger-color);
    color: #fff;
    border-color: transparent;
}

/* Card "Dispensa de Projeto Arquitônico" na sidebar */
.sidebar .dashboard-stats .stat-card.stat-dispensa {
    background: #7b1fa2;
    color: #fff;
    border-color: transparent;
}
.sidebar .dashboard-stats .stat-card.stat-dispensa .stat-label,
.sidebar .dashboard-stats .stat-card.stat-dispensa .stat-number,
.sidebar .dashboard-stats .stat-card.stat-dispensa .stat-percent {
    color: #fff;
}

/* Card "Ver pergunta" na sidebar */
.sidebar .dashboard-stats .stat-card.stat-pergunta {
    background: #000000;
    color: #fff;
    border-color: transparent;
}
.sidebar .dashboard-stats .stat-card.stat-pergunta .stat-label,
.sidebar .dashboard-stats .stat-card.stat-pergunta .stat-number,
.sidebar .dashboard-stats .stat-card.stat-pergunta .stat-percent {
    color: #fff;
}

.sidebar .dashboard-stats .stat-card.stat-inspecoes .stat-label,
.sidebar .dashboard-stats .stat-card.stat-autorizacoes .stat-label,
.sidebar .dashboard-stats .stat-card.stat-licencas .stat-label,
.sidebar .dashboard-stats .stat-card.stat-multas .stat-label,
.sidebar .dashboard-stats .stat-card.stat-inspecoes .stat-number,
.sidebar .dashboard-stats .stat-card.stat-autorizacoes .stat-number,
.sidebar .dashboard-stats .stat-card.stat-licencas .stat-number,
.sidebar .dashboard-stats .stat-card.stat-multas .stat-number,
.sidebar .dashboard-stats .stat-card.stat-inspecoes .stat-percent,
.sidebar .dashboard-stats .stat-card.stat-autorizacoes .stat-percent,
.sidebar .dashboard-stats .stat-card.stat-licencas .stat-percent,
.sidebar .dashboard-stats .stat-card.stat-multas .stat-percent {
    color: #fff;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
}

/* Forçar cor preta para o card "Ver pergunta" (alta especificidade) */
.sidebar .dashboard-stats .stat-card.stat-pergunta {
    background: #000000 !important;
    color: #ffffff !important;
}
.sidebar #filterCardPergunta {
    background: #000000 !important;
    color: #ffffff !important;
}
.sidebar .dashboard-stats .stat-card.stat-pergunta .stat-label,
.sidebar .dashboard-stats .stat-card.stat-pergunta .stat-number,
.sidebar .dashboard-stats .stat-card.stat-pergunta .stat-percent {
    color: #ffffff !important;
}
.sidebar #filterCardPergunta .stat-label,
.sidebar #filterCardPergunta .stat-number,
.sidebar #filterCardPergunta .stat-percent {
    color: #ffffff !important;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-total .stat-icon { background: var(--info-color); }
.stat-aprovado .stat-icon { background: var(--success-color); }
.stat-vencido .stat-icon { background: var(--danger-color); }

/* Novos cards - Níveis de Risco */
.stat-inspecoes .stat-icon { background: var(--success-color); } /* Não Aplicável - verde */
.stat-autorizacoes .stat-icon { background: var(--warning-color); } /* Risco I - amarelo */
.stat-licencas .stat-icon { background: #ff9800; } /* Risco II - laranja */
.stat-multas .stat-icon { background: var(--danger-color); } /* Risco III - vermelho */

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== DASHBOARD ANALYTICS ===== */
.analytics-section {
    padding: 20px 24px;
    border-bottom: 2px solid var(--border-color);
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.analytics-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.analytics-controls select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.analytics-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.analytics-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    background: var(--primary-color);
}

.analytics-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.analytics-number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.analytics-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
}

/* ===== BUSCA AVANÇADA ===== */
.search-box {
    position: relative;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 12px 12px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.btn-search-advanced {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-search-advanced:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.advanced-search {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
    animation: slideDown 0.3s ease;
}

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

.date-range {
    display: flex;
    gap: 8px;
}

.date-range input {
    flex: 1;
}

.range-inputs {
    display: flex;
    gap: 8px;
}

.range-inputs input {
    flex: 1;
}

/* ===== ALERTAS DE VENCIMENTO ===== */
.alerts-section {
    padding: 0 0 16px 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.alerts-section.has-alerts {
    max-height: 400px;
    overflow-y: auto;
}

.alert {
    background: white;
    border-left: 4px solid;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-critical {
    border-color: #d32f2f;
    background: linear-gradient(90deg, rgba(211,47,47,0.05) 0%, white 50%);
}

.alert-warning {
    border-color: #f57c00;
    background: linear-gradient(90deg, rgba(245,124,0,0.05) 0%, white 50%);
}

.alert-info {
    border-color: #0288d1;
    background: linear-gradient(90deg, rgba(2,136,209,0.05) 0%, white 50%);
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-critical .alert-icon { color: #d32f2f; }
.alert-warning .alert-icon { color: #f57c00; }
.alert-info .alert-icon { color: #0288d1; }

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.alert-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.alert-action {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: var(--bg-light);
    transition: var(--transition);
}

.alert-action:hover {
    background: var(--primary-color);
    color: white;
}

.alerts-header {
    padding: 12px 24px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ===== BOTÕES ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    white-space: nowrap;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #2e7d32;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(56, 142, 60, 0.3);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #01579b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(2, 136, 209, 0.3);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-primary);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #b71c1c;
}

.btn-add-property {
    margin: 0 24px 16px 24px;
    width: calc(100% - 48px);
    padding: 14px;
    font-size: 15px;
}

/* ===== BOTÕES DE AÇÃO (IMPORT/EXPORT) ===== */
.action-buttons {
    padding: 0 24px 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-action {
    padding: 12px 16px;
    font-size: 14px;
}

.export-dropdown {
    position: relative;
}

.export-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.export-menu.active {
    display: flex;
}

.export-option {
    padding: 12px 16px;
    background: white;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.export-option:last-child {
    border-bottom: none;
}

.export-option:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.export-option i {
    font-size: 16px;
    width: 20px;
}

/* ===== BUSCA E FILTROS ===== */
.search-section {
    padding: 0 24px 20px 24px;
    border-bottom: 2px solid var(--border-color);
}

.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* ===== LISTA DE IMÓVEIS ===== */
.property-list {
    padding: 0 0 20px 0;
}

.property-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.property-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.property-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.property-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.property-address {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.property-badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-status {
    color: white;
}

.badge-pendente { background: var(--status-pendente); }
.badge-em_analise { background: var(--status-analise); }
.badge-aprovado { background: var(--status-aprovado); }
.badge-vencido { background: var(--status-vencido); }
.badge-reprovado { background: var(--status-reprovado); }

.badge-risco {
    border: 1px solid;
}

.badge-baixo { 
    background: rgba(76, 175, 80, 0.1);
    color: var(--risco-baixo);
    border-color: var(--risco-baixo);
}

.badge-medio { 
    background: rgba(255, 152, 0, 0.1);
    color: var(--risco-medio);
    border-color: var(--risco-medio);
}

.badge-alto { 
    background: rgba(244, 67, 54, 0.1);
    color: var(--risco-alto);
    border-color: var(--risco-alto);
}

.property-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.property-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ===== MAP ===== */
#map {
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    height: calc(100vh - var(--header-height));
    transition: var(--transition);
}

#map.expanded {
    left: 0;
}

.leaflet-container {
    background: #f0f0f0;
}

/* Controles do mapa */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-control-zoom a {
    background-color: #fff !important;
    color: #333 !important;
    border: none !important;
    font-size: 18px !important;
    font-weight: bold !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f8f9fa !important;
    color: var(--primary-color) !important;
}

/* Popups do mapa */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 240px;
}

.leaflet-popup-content {
    margin: 16px;
    line-height: 1.5;
}

.popup-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.popup-content p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.popup-content .popup-badges {
    display: flex;
    gap: 6px;
    margin: 10px 0;
}

.popup-content .btn {
    width: 100%;
    margin-top: 8px;
    font-size: 13px;
    padding: 8px 16px;
}

/* Marcadores customizados */
.custom-marker {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-icon {
    transform: rotate(45deg);
    color: white;
    font-size: 16px;
}

/* Botão de controle de camada */
.layer-btn {
    background-color: #fff !important;
    border: none !important;
    color: #333 !important;
    font-size: 16px !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    text-align: center !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    transition: var(--transition) !important;
}

.layer-btn:hover {
    background-color: #f8f9fa !important;
    color: var(--primary-color) !important;
    transform: scale(1.05) !important;
}

.leaflet-control-layers {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 2001;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-light);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
    position: relative;
    z-index: 2001;
    pointer-events: auto;
}

.btn-close:hover {
    background: white;
    color: var(--danger-color);
}

.btn-close i {
    pointer-events: none;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-light);
}

/* ===== FORMULÁRIO ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
}

/* ===== SEÇÕES DE FORMULÁRIO ===== */
.form-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.form-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ===== UPLOAD DE ARQUIVOS ===== */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-light);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(211, 47, 47, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(211, 47, 47, 0.1);
    transform: scale(1.02);
}

.upload-content i {
    font-size: 48px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: block;
}

.upload-content p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-content small {
    font-size: 13px;
    color: var(--text-secondary);
}

.uploaded-files {
    margin-top: 16px;
}

.uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.uploaded-file:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.file-icon.pdf { background: #dc3545; }
.file-icon.doc { background: #0d6efd; }
.file-icon.jpg, .file-icon.png { background: #198754; }

.file-details {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ===== DETALHES DO IMÓVEL ===== */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.detail-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.detail-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.detail-badges {
    display: flex;
    gap: 8px;
}

/* ===== MODAL DETALHES COM ABAS ===== */
.modal-details {
    max-width: 900px;
}

.details-tabs {
    margin-top: 20px;
    border-top: 2px solid var(--border-color);
    padding-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(211, 47, 47, 0.05);
}

.tab-content {
    display: none;
}

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

/* ===== SEÇÕES DAS ABAS ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* ===== DOCUMENTOS ===== */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition);
}

.document-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.document-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.document-icon.avcb { background: var(--primary-color); }
.document-icon.laudo { background: var(--info-color); }
.document-icon.projeto { background: var(--success-color); }
.document-icon.vistoria { background: var(--warning-color); }
.document-icon.correspondencia { background: var(--text-secondary); }
.document-icon.foto { background: var(--danger-color); }
.document-icon.outro { background: #6c757d; }

.document-details {
    flex: 1;
}

.document-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.document-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

.document-actions {
    display: flex;
    gap: 8px;
}

/* ===== HISTÓRICO ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 20px;
}

.history-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 30px;
    bottom: -16px;
    width: 2px;
    background: var(--border-color);
}

.history-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    background: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.history-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-action {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-details {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== COMENTÁRIOS ===== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    position: relative;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.comment-author {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comment-type.geral { background: var(--bg-light); color: var(--text-secondary); }
.comment-type.vistoria { background: rgba(2, 136, 209, 0.1); color: var(--info-color); }
.comment-type.cliente { background: rgba(56, 142, 60, 0.1); color: var(--success-color); }
.comment-type.documentacao { background: rgba(245, 124, 0, 0.1); color: var(--warning-color); }
.comment-type.prazo { background: rgba(211, 47, 47, 0.1); color: var(--danger-color); }
.comment-type.problema { background: rgba(211, 47, 47, 0.1); color: var(--danger-color); }
.comment-type.solucao { background: rgba(56, 142, 60, 0.1); color: var(--success-color); }

.comment-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* ===== MODAL LOGIN ===== */
.modal-login {
    max-width: 400px;
    width: 90%;
}

.login-container {
    padding: 40px 30px;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.login-logo i {
    font-size: 32px;
    color: var(--primary-color);
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 20px;
}

.btn-demo {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    margin-top: 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-demo:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== MODAL CONFIGURAÇÕES ===== */
.modal-settings {
    max-width: 800px;
    width: 95%;
}

.settings-tabs {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-tab-buttons {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
}

.settings-tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.settings-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(211, 47, 47, 0.05);
}

.settings-tab-content {
    display: none;
}

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

/* ===== SUB ABAS ===== */
.settings-sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.settings-sub-tab-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.settings-sub-tab-btn:hover {
    background: var(--bg-light);
}

.settings-sub-tab-btn.active {
    background: var(--secondary-color);
    color: white;
}

.settings-sub-tab-content {
    display: none;
}

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

.settings-section {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.backup-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.backup-actions .btn {
    flex: 1;
}

/* ===== MODAL RELATÓRIOS ===== */
.modal-reports {
    max-width: 700px;
    width: 95%;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.report-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.report-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.report-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background: var(--primary-color);
}

.report-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.report-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== MODAL IMPORTAÇÃO ===== */
.modal-import {
    max-width: 700px;
}

.import-instructions {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.import-instructions h3 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.import-instructions ol {
    margin: 16px 0;
    padding-left: 24px;
}

.import-instructions li {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.import-section {
    margin-top: 20px;
}

.import-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.file-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-file-select {
    width: 100%;
    padding: 14px;
}

.file-name {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    text-align: center;
}

.import-preview {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.import-preview h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.preview-stats {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.preview-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-stat strong {
    color: var(--primary-color);
    font-size: 16px;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-item {
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    border-left: 3px solid var(--primary-color);
}

.preview-item-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.preview-item-details {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 320px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
        --header-height: 60px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .header-subtitle {
        display: none;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    #map {
        left: 0;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats .stat-total,
    .dashboard-stats .stat-card-full {
        grid-column: 1 / -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
}

/* ===== SCROLLBAR ===== */
.sidebar::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.sidebar::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== BOTÃO GRÁFICO ===== */
.btn-chart {
    width: 100%;
    margin: 12px 0;
    padding: 12px 20px;
    background: var(--info-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-chart:hover {
    background: #0277bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.3);
}

.btn-chart i {
    font-size: 16px;
}

/* ===== SELETOR DE PERÍODO ===== */
.period-selector {
    margin: 12px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.period-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-selector label i {
    color: var(--info-color);
    font-size: 16px;
}

.period-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.period-select:focus {
    outline: none;
    border-color: var(--info-color);
    box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.1);
}

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

.period-select option {
    padding: 8px;
    background: white;
    color: var(--text-primary);
}

/* ===== CARD AVCBs À VENCER ===== */
.avcb-expiring-card {
    margin: 12px 0;
    padding: 18px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.avcb-expiring-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.avcb-expiring-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.avcb-expiring-content {
    flex: 1;
    text-align: left;
}

.avcb-expiring-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.avcb-expiring-label {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 2px;
}

.avcb-expiring-period {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}

/* Lista de AVCBs à vencer */
.avcb-expiring-list {
    margin: 10px 0 16px 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 240px;
    overflow: auto;
}
.avcb-expiring-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}
.avcb-expiring-item:last-child { border-bottom: none; }
.avcb-expiring-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.avcb-expiring-meta { font-size: 12px; color: var(--text-secondary); }
.avcb-expiring-date { font-size: 12px; font-weight: 700; color: var(--danger-color); align-self: center; }

/* Responsividade para o card */
@media (max-width: 768px) {
    .avcb-expiring-card {
        padding: 15px;
        gap: 12px;
    }
    
    .avcb-expiring-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .avcb-expiring-number {
        font-size: 24px;
    }
    
    .avcb-expiring-label {
        font-size: 13px;
    }
    
    .avcb-expiring-period {
        font-size: 11px;
    }
}

/* ===== MODAL GRÁFICO ===== */
.chart-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.chart-period,
.chart-municipios,
.chart-type {
    flex: 1;
}

/* Primeira linha fixa: Ano e Tipo de Gráfico */
.chart-period { order: 1; min-width: 220px; }
.chart-type { order: 2; min-width: 220px; }
.chart-municipios { order: 3; min-width: 280px; }

.chart-period label,
.chart-municipios label,
.chart-type label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.chart-period select,
.chart-type select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.chart-period select:focus,
.chart-type select:focus {
    outline: none;
    border-color: var(--info-color);
    box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.1);
}

/* Checkboxes de municípios */
.municipios-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    max-height: 160px;
    overflow-y: auto;
    overflow-x: hidden;
}
.municipios-checkboxes label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    white-space: normal;
    line-height: 1.3;
}
.municipios-checkboxes label input { accent-color: var(--primary-color); }
.municipios-checkboxes label.selected {
    background: rgba(211, 47, 47, 0.06);
    border-color: rgba(211, 47, 47, 0.2);
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.chart-info {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-item:last-child { border-bottom: none; }

.stat-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
}

.stat-value {
    font-weight: 700;
    color: var(--info-color);
    font-size: 16px;
}

/* Responsividade para o modal do gráfico */
@media (max-width: 768px) {
    .chart-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .chart-stats { grid-template-columns: 1fr; }
}

/* ===== ESTILOS DO MAPA ===== */
#map {
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    width: calc(100vw - var(--sidebar-width));
    height: calc(100vh - var(--header-height));
    z-index: 1;
    background: #f5f5f5;
}

/* Controles do Leaflet */
.leaflet-control-container {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-control-zoom a {
    background: white !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-weight: 600 !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-light) !important;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Controles de camadas */
.leaflet-control-layers {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-control-layers-toggle {
    background: white !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.leaflet-control-layers-toggle:hover {
    background: var(--bg-light) !important;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Controles GeoJSON */
.leaflet-control-geojson-layers {
    background: white !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.geojson-control {
    background: white !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

/* Popups do GeoJSON */
.geojson-popup {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    min-width: 300px;
    max-width: 400px;
    line-height: 1.4;
}

.geojson-popup h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.geojson-popup p {
    margin: 6px 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-color);
}

.geojson-popup strong {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

.popup-risk {
    margin-bottom: 12px !important;
    font-weight: 600;
    font-size: 14px;
}

/* Responsividade do mapa */
@media (max-width: 768px) {
    #map {
        left: 0;
        width: 100vw;
    }
    
    .sidebar:not(.collapsed) ~ #map {
        left: var(--sidebar-width);
        width: calc(100vw - var(--sidebar-width));
    }
}

/* ===== BOTÕES DA SIDEBAR ===== */
.btn-dashboard,
.btn-chart {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    background: var(--text-secondary);
    color: #fff;
}

.btn-dashboard:hover,
.btn-chart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ===== MODAL DASHBOARD ===== */
.modal-dashboard {
    max-width: 1400px;
    width: 95vw;
}

/* ===== ABAS DO DASHBOARD ===== */
.dashboard-tabs {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-tabs .tab-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.dashboard-tabs .tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px 8px 0 0;
}

.dashboard-tabs .tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.dashboard-tabs .tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(211, 47, 47, 0.05);
}

.dashboard-tabs .tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.dashboard-tabs .tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ===== TABELA DO DASHBOARD ===== */
.table-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.table-controls .search-box {
    position: relative;
    min-width: 200px;
}

.table-controls .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.table-controls .search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    transition: var(--transition);
}

.table-controls .search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.table-filter {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
    min-width: 150px;
}

.table-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.table-wrapper {
    flex: 1;
    overflow: auto;
    max-height: 65vh; /* aumenta a área visível e usa scroll */
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dashboard-table th {
    background: var(--bg-light);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.dashboard-table tbody tr {
    transition: var(--transition);
}

.dashboard-table tbody tr:hover {
    background: rgba(211, 47, 47, 0.05);
}

.dashboard-table .status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.valido {
    background: rgba(56, 142, 60, 0.1);
    color: var(--success-color);
}

.status-badge.semData {
    background: rgba(245, 124, 0, 0.1);
    color: var(--warning-color);
}

.status-badge.vencido {
    background: rgba(211, 47, 47, 0.1);
    color: var(--danger-color);
}

.empty-value {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.6;
}

.table-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-info {
    font-size: 14px;
    color: var(--text-secondary);
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

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

/* Responsividade da Tabela */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .table-controls .search-box {
        min-width: auto;
    }
    
    .table-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .dashboard-table {
        font-size: 12px;
    }
    
    .dashboard-table th,
    .dashboard-table td {
        padding: 8px 12px;
    }
}

.dashboard-grid {
    display: grid;
    gap: 24px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Força 3 colunas apenas na aba Valores do Dashboard */
#dashboardValores .dashboard-cards {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.dashboard-card.valid {
    border-left-color: var(--success-color);
}

.dashboard-card.warning {
    border-left-color: var(--warning-color);
}

.dashboard-card.danger {
    border-left-color: var(--danger-color);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(211, 47, 47, 0.1);
    border-radius: 50%;
}

.dashboard-card.valid .card-icon {
    color: var(--success-color);
    background: rgba(56, 142, 60, 0.1);
}

.dashboard-card.warning .card-icon {
    color: var(--warning-color);
    background: rgba(245, 124, 0, 0.1);
}

.dashboard-card.danger .card-icon {
    color: var(--danger-color);
    background: rgba(211, 47, 47, 0.1);
}

.card-content {
    flex: 1;
}

.card-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.card-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.card-percent {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.05);
    color: var(--text-secondary);
    display: inline-block;
}

.dashboard-alerts {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-alerts h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerts-list {
    max-height: 200px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    margin-bottom: 8px;
    color: #856404;
}

.alert-item:last-child {
    margin-bottom: 0;
}

.alert-item i {
    color: var(--warning-color);
    font-size: 1.1rem;
}

.no-alerts {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
}

/* Responsividade do Dashboard */
@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card {
        padding: 16px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .card-number {
        font-size: 1.5rem;
    }
}

/* Card espaçador para manter a grade 3xN */
.dashboard-card.card-spacer {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ... existing code ... */
.modal-chart { max-width: 1100px; }

#modalChart .modal-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    gap: 16px;
}
#modalChart .chart-controls {
    grid-column: 1;
    grid-row: 1 / span 2;
    height: 100%;
    overflow: auto;
}
#modalChart .chart-container {
    grid-column: 2;
    grid-row: 1;
}
#modalChart .chart-info {
    grid-column: 2;
    grid-row: 2;
}

@media (max-width: 1024px) {
    #modalChart .modal-body { display: block; }
}

/* ===== ESTILOS PARA FILTROS ===== */

/* Cards clicáveis para filtro */
.filter-card {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
    border: 2px solid transparent;
}

.filter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(25, 118, 210, 0.3);
}

.filter-card:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

.filter-card.active {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.25);
    transform: translateY(-2px);
}

.filter-card.active::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Adicionar indicador visual de que é clicável */
.filter-card::before {
    content: "👆";
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-card:hover::before {
    opacity: 0.7;
}

.filter-card.active::before {
    opacity: 0;
}

/* Controles de filtro */
.filter-controls {
    margin-top: 15px;
    text-align: center;
}

.clear-filters-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.clear-filters-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.clear-filters-btn i {
    font-size: 10px;
}

/* Indicador de filtro ativo */
.filter-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
}

.filter-indicator.show {
    display: block;
}

/* Estilos para edição de tabelas */
.editable-cell {
    transition: background-color 0.2s ease;
}

.editable-cell[contenteditable="true"] {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    border-radius: 4px;
}

.editable-cell[contenteditable="true"]:focus {
    outline: 2px solid var(--primary-dark);
    background-color: #fffde7 !important;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-success:hover {
    background-color: #2e7d32;
}
