/* ... Conteúdo do style.css anterior ... */
:root {
    --primary-color: #3699ff; 
    --primary-light: #e1f0ff;
    --text-dark: #3f4254;
    --text-muted: #b5b5c3;
    --bg-body: #f3f6f9;
    --bg-card: #ffffff;
    --success: #1bc5bd;
    --danger: #f64e60;
    --danger-light: #ffe2e5;
    --border-radius: 10px;
    --shadow: 0 0 20px 0 rgba(76, 87, 125, 0.02);
    --excel-red: #c0392b; 
    --excel-black: #000000;
}
body { font-family: 'Poppins', 'Roboto', sans-serif; background-color: var(--bg-body); color: var(--text-dark); margin: 0; padding-bottom: 50px; font-size: 13px; transition: background-color 0.3s; }
.hidden { display: none !important; }
.header-prefeitura { background-color: var(--bg-card); padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 0 40px 0 rgba(82,63,105,0.1); margin-bottom: 20px; border-bottom: 1px solid #ebedf3; flex-wrap: nowrap; gap: 15px; height: 70px; }
.logo-area { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.logo-area img { height: auto; max-height: 50px; max-width: 200px; object-fit: contain; }
.titulo-area { text-align: left; }
.titulo-area h3 { margin: 2px 0; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; border-left: 2px solid #ccc; padding-left: 10px; }
.info-area { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 10px; flex-grow: 1; }
.user-controls { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid #eee; flex-shrink: 0; }
.controles-topo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topo-box { height: 34px; display: flex; align-items: center; background: #fff; padding: 0 8px; border-radius: 6px; border: 1px solid #e4e6ef; box-shadow: 0 1px 2px rgba(0,0,0,0.02); gap: 5px; }
.topo-content { display: flex; flex-direction: column; justify-content: center; }
.topo-content label { font-size: 8px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; margin: 0; line-height: 1; }
.topo-content select, .topo-content input { border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--text-dark); padding: 0; outline: none; cursor: pointer; height: 16px; }
.search-box { background-color: #f8f9fa; border-color: #d1d3e0; padding: 0; }
.search-box input { padding: 0 8px; width: 180px; background: transparent; border: none; height: 100%; outline: none; font-size: 12px; }
.btn-search { background: transparent; border: none; font-size: 14px; cursor: pointer; padding: 0 10px; color: var(--primary-color); height: 100%; border-left: 1px solid #eee; display: flex; align-items: center; }
.btn-header { height: 32px; padding: 0 12px; border: none; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; color: white; }
.btn-admin { background-color: #34495e; }
.btn-theme { background-color: #333; }
.btn-exit { background-color: var(--danger); }
#user-display { font-size: 11px; font-weight: 800; color: var(--primary-color); text-transform: uppercase; margin-right: 5px; white-space: nowrap; }
.main-content { max-width: 98%; margin: 0 auto; }
.controles { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 20px; }
.tabela-container { background: var(--bg-card); border-radius: var(--border-radius); box-shadow: var(--shadow); padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background-color: #f8f9fb; color: var(--text-muted); padding: 15px 20px; text-align: left; font-size: 11px; font-weight: 700; border-bottom: 1px solid #ebedf3; }
td { padding: 15px 20px; border-bottom: 1px solid #ebedf3; color: var(--text-dark); font-size: 12px; font-weight: 600; }
tbody tr:hover { background-color: #f4f6f9; cursor: pointer; }
.t-acoes { display: flex; gap: 8px; justify-content: flex-end; }
.btn-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; padding: 0; }
.btn-editar-circle { background-color: var(--primary-light); color: var(--primary-color); }
.btn-excluir-circle { background-color: var(--danger-light); color: var(--danger); }
.btn-mapa-circle { background-color: #e0f2f1; color: #00897b; }
.texto-vermelho { color: var(--excel-red) !important; font-weight: 700; }
.alerta-doenca { background-color: #ffe6e6 !important; border-left: 4px solid var(--danger); }
.icone-alerta { color: var(--danger); margin-right: 5px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.3); backdrop-filter: blur(2px); overflow-y: auto; }
.modal-content { background-color: #fff; margin: 3% auto; width: 750px; max-width: 95%; border-radius: var(--border-radius); box-shadow: 0 10px 30px rgba(0,0,0,0.1); animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 20px 30px; border-bottom: 1px solid #ebedf3; display: flex; justify-content: space-between; align-items: center; }
#form-atendimento { padding: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.input-group { display: flex; flex-direction: column; gap: 8px; }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
label { font-size: 12px; font-weight: 600; }
input:not([type="checkbox"]), textarea, select { padding: 10px 15px; border: 1px solid #e4e6ef; border-radius: 6px; background-color: #f3f6f9; width: 100%; box-sizing: border-box; }
.view-field { padding: 12px 15px; background-color: #f3f6f9; border-radius: 6px; font-weight: 500; min-height: 45px; }
.modal-footer-custom { padding: 20px 30px; border-top: 1px solid #ebedf3; display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; }
.footer-group { display: flex; flex-direction: row; gap: 10px; align-items: center; }
.btn-modal { height: 36px; padding: 0 15px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.btn-etiqueta { background-color: #e67e22; color: white; }
.btn-whatsapp { background-color: #25D366; color: white; }
.btn-sms { background-color: #3498db; color: white; }
.btn-cancelar { background-color: #eee; color: #333; }
.btn-extra { background-color: #fff; border: 1px solid #ccc; color: #333; }
.btn-salvar { background-color: var(--primary-color); color: white; }
.ficha-visualizacao { padding: 30px; background-color: #fff; color: #000; }
.ficha-linha { display: flex; border-bottom: 1px solid #ddd; padding: 8px 0; align-items: baseline; }
.ficha-label { font-weight: 800; font-size: 12px; color: #555; width: 140px; flex-shrink: 0; text-transform: uppercase; }
.ficha-valor { font-weight: 700; font-size: 14px; color: #000; flex-grow: 1; white-space: pre-wrap; }
.bloqueio-container { display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(30, 30, 45, 0.98); z-index: 10000; align-items: center; justify-content: center; }
.bloqueio-box { background: white; padding: 40px; border-radius: 10px; text-align: center; width: 300px; }
.tab-header { display: flex; border-bottom: 1px solid #ddd; background-color: #f8f9fa; }
.tab-btn { padding: 15px 25px; border: none; background: none; cursor: pointer; font-weight: 600; color: #666; border-bottom: 3px solid transparent; }
.tab-btn.active { color: var(--primary-color); border-bottom: 3px solid var(--primary-color); background-color: white; }
.tab-pane { display: none; padding: 20px; }
.tab-pane.active { display: block; }
.lista-simples li { padding: 10px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; }
.table-logs td { border-bottom: 1px solid #eee; padding: 8px 10px; }
.btn-remove-user { background: none; border: none; color: var(--danger); cursor: pointer; }
.btn-novo { background-color: var(--primary-color); color: white; border: none; border-radius: 6px; padding: 10px 20px; font-weight: 600; cursor: pointer; }
.btn-imprimir { background-color: white; color: var(--text-dark); border: 1px solid #ebedf3; border-radius: 6px; padding: 10px 20px; font-weight: 600; cursor: pointer; }
body.design-classico { background-color: #fff !important; color: #000 !important; font-family: 'Times New Roman', serif !important; }
body.design-classico .header-prefeitura { background-color: #fff !important; border-bottom: 4px solid #000 !important; box-shadow: none !important; }
body.design-classico .topo-box, body.design-classico .search-box, body.design-classico .btn-header, body.design-classico .btn-novo, body.design-classico .btn-imprimir, body.design-classico .btn-modal, body.design-classico input, body.design-classico select, body.design-classico textarea, body.design-classico .tabela-container, body.design-classico .modal-content { border-radius: 0 !important; border: 1px solid #000 !important; box-shadow: none !important; background-color: #fff !important; color: #000 !important; }
body.design-classico th { background-color: #000 !important; color: #fff !important; text-transform: uppercase !important; }
body.design-classico td { border-bottom: 1px solid #000 !important; color: #000 !important; }
body.design-classico .btn-icon { border: 1px solid #000 !important; border-radius: 0 !important; color: #000 !important; background: #fff !important; }
@media print { 
    @page { margin: 5mm; } 
    body { background-color: white; font-size: 8px; margin: 0; padding: 0; } 
    .controles, .btn-icon, .t-acoes, .user-controls, .btn-header, .topo-box.search-box { display: none !important; } 
    th:last-child, td:last-child { display: none !important; } 
    .tabela-container { box-shadow: none; border: none; display: block !important; padding: 0; } 
    table { width: 100% !important; border-collapse: collapse !important; } 
    th, td { border: 1px solid #000 !important; padding: 2px !important; color: black !important; font-size: 8px !important; } 
    .header-prefeitura { box-shadow: none; border-bottom: 2px solid #000; padding: 5px; height: auto; }
/* --- BLOCO DE RESPONSIVIDADE (ADICIONAR AO FINAL DO ARQUIVO) --- */

@media only screen and (max-width: 768px) {
    /* HEADER: Empilhar elementos */
    .header-prefeitura {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 10px;
    }
    
    .logo-area {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .titulo-area h3 {
        font-size: 16px;
        text-align: center;
    }

    .info-area {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .controles-topo {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .topo-box {
        width: 100%;
        margin-right: 0;
        box-sizing: border-box; /* Garante que padding não estoure a largura */
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%; /* Input ocupa todo espaço */
        flex: 1;
    }

    .user-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 10px;
        gap: 5px;
    }
    
    .user-controls span {
        display: none; /* Esconde nome do usuário em telas muito pequenas pra economizar espaço */
    }

    /* CONTEÚDO PRINCIPAL */
    .main-content {
        padding: 10px;
        margin-top: 20px;
    }

    /* CONTROLES (Botões de imprimir/novo) */
    .controles {
        flex-direction: column;
        gap: 10px;
    }
    
    .controles button {
        width: 100%;
    }

    /* TABELA: Habilitar rolagem horizontal */
    .tabela-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 5px;
        border: 1px solid #eee;
    }
    
    table {
        min-width: 1000px; /* Força a tabela a ter largura mínima para não espremer colunas */
    }
    
    /* MODAL: Ajustar largura e grid */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 85vh; /* Evita que o modal passe da tela */
        overflow-y: auto; /* Permite rolar o modal */
        padding: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr; /* Força 1 coluna em tudo */
        gap: 10px;
    }

    /* Força todos os inputs a ocuparem 100% da linha no mobile */
    .input-group.span-1, 
    .input-group.span-2, 
    .input-group.span-3, 
    .input-group.span-4 {
        grid-column: span 1 !important;
    }
    
    /* Ajustes específicos de layout dentro do form */
    #div-local-domicilio, #div-perpetua {
        flex-direction: column !important;
    }
    
    /* Causa Morte: Seletor e Input um abaixo do outro */
    .input-group label + div { 
        flex-direction: column;
    }
    
    #seletor_causas, #causa {
        width: 100% !important;
        margin-bottom: 5px;
    }

    /* RODAPÉ DO MODAL */
    .modal-footer-custom {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-modal {
        width: 100%;
        margin: 0;
    }

    /* LOGIN */
    .bloqueio-box {
        width: 90%;
        padding: 20px;
    }
}
}
/* ==========================================
   ESTILOS DO MAPA VISUAL DE OCUPAÇÃO
   ========================================== */
.painel-mapa {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.legenda-mapa {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.legenda-item {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.legenda-item span {
    width: 15px;
    height: 15px;
    display: inline-block;
    margin-right: 5px;
    border-radius: 3px;
    border: 1px solid #333;
}

.cor-livre { background-color: #4CAF50; } /* Verde */
.cor-ocupada { background-color: #F44336; } /* Vermelho */
.cor-alerta { background-color: #FFC107; } /* Amarelo */

/* Estilos do SVG */
#container-svg-marui svg {
    width: 100%;
    max-height: 600px;
    background-color: #eef2f5;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.quadra-poligono {
    stroke: #333;
    stroke-width: 1px;
    cursor: pointer;
    transition: fill 0.3s, stroke-width 0.2s;
}

.quadra-poligono:hover {
    stroke-width: 3px;
    opacity: 0.8;
}

/* Classes dinâmicas que o JS vai aplicar */
.status-livre { fill: #4CAF50; }
.status-ocupada { fill: #F44336; }
.status-alerta { fill: #FFC107; }
.status-padrao { fill: #b0bec5; } /* Cinza (sem dados) */
/* Estilo para a animação do formulário expandível */
.edit-form-inline {
    max-height: 0; /* Começa com altura zero */
    overflow: hidden; /* Esconde o conteúdo */
    transition: max-height 0.4s ease-out, opacity 0.3s ease; /* Animação suave */
    opacity: 0;
    background-color: #f8fafc; /* Um fundo levemente diferente para destacar */
    border-bottom: 2px solid #e2e8f0;
}

/* Classe que o JavaScript vai adicionar para "baixar" a janela */
.edit-form-inline.expanded {
    max-height: 500px; /* Altura máxima para permitir a animação */
    opacity: 1;
    padding: 20px 0; /* Dá um respiro visual ao expandir */
}

/* Ajuste na linha da tabela para acomodar o formulário */
.table-equipe-row {
    display: flex;
    flex-direction: column; /* Permite que o formulário fique abaixo dos dados */
    border-bottom: 1px solid #e2e8f0;
}

/* Área dos dados principais (o que aparece antes de expandir) */
.row-data {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 10px 0;
}