/* ==========================================================================
   1. RESET & LAYOUT GERAL
   ========================================================================== */
.cota-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #2d3748;
    max-width: 1200px;
    margin: 0 auto;
    line-height: 1.6;
}

.cota-login-wrap {
    max-width: 400px;
    margin: 50px auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   2. BOTÕES & AÇÕES
   ========================================================================== */
.cota-btn-topo {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    transition: 0.3s;
    border: none;
    line-height: 1;
    background-color: #1A365D !important; 
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.cota-btn-topo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    color: #fff !important;
}

.cota-btn-topo.guest {
    background-color: #3182ce !important;
}

.cota-btn-new, 
#loginform #wp-submit, 
.login-submit #wp-submit,
input[type="submit"].cota-btn-new {
    background: #1A365D !important;
    color: #fff !important;
    padding: 12px 25px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 16px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
    transition: 0.3s !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
}

.cota-btn-new:hover, 
#loginform #wp-submit:hover {
    background: #2B6CB0 !important;
    transform: translateY(-2px);
    color: #fff !important;
}

.cota-btn-gerir {
    background: #edf2f7;
    color: #4a5568;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: 0.3s;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.cota-btn-gerir:hover {
    background: #cbd5e0;
    color: #2d3748;
}

.cota-btn-sair {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.3);
    transition: 0.3s;
}

.cota-btn-sair:hover {
    background: #e53e3e;
    border-color: #e53e3e;
}

/* ==========================================================================
   3. DASHBOARD EXECUTIVO
   ========================================================================== */
.cota-dash-header {
    background: linear-gradient(135deg, #1A365D 0%, #2B6CB0 100%);
    color: #fff;
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 10px 25px rgba(26, 54, 93, 0.25);
    position: relative;
    overflow: hidden;
}

.cota-dash-header h2 {
    color: #fff !important;
    margin: 0 0 10px 0 !important;
    font-size: 28px !important;
    font-weight: 800 !important;
}

.cota-stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.cota-stat-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 130px;
}

.cota-stat-val {
    font-size: 32px;
    font-weight: 800;
    display: block;
    line-height: 1;
    margin-bottom: 5px;
    color: #fff;
}

.cota-stat-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    color: #fff;
}

/* ==========================================================================
   4. GRID SYSTEM (CARDS)
   ========================================================================== */
.cota-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
}

.cota-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.cota-card-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: 0.3s;
}

.cota-card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: #cbd5e0;
}

.cota-card-status-bar {
    height: 100%;
    width: 6px;
    position: absolute;
    left: 0;
    top: 0;
}

.status-verde { background: #38A169; }
.status-cinza { background: #A0AEC0; }

.cota-card-body {
    padding: 25px 25px 25px 35px;
    flex: 1;
}

.cota-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748 !important;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    line-height: 1.4;
}

.cota-card-title:hover {
    color: #3182ce !important;
}

.cota-card-info {
    font-size: 13px;
    color: #718096;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cota-card-actions {
    border-top: 1px solid #f7fafc;
    padding: 15px 25px 15px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
}

.cota-btn-ver {
    color: #3182ce;
    font-weight: 700;
    text-decoration: none;
    font-size: 14px;
}

.cota-empty {
    text-align: center;
    padding: 50px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
    color: #718096;
}

.cota-msg-success {
    padding: 20px;
    background: #f0fff4;
    color: #22543d;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #c6f6d5;
    margin-bottom: 20px;
}

/* ==========================================================================
   5. FORMULÁRIOS ACF & FIXES VISUAIS (V16.23) 🛠️
   ========================================================================== */
.cota-form-wrapper {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.cota-form-header h3 {
    margin: 0 0 25px 0;
    color: #1A365D;
    font-size: 24px;
    border-bottom: 2px solid #f0f4f8;
    padding-bottom: 20px;
}

/* --- GRID PADRÃO (2 COLUNAS) --- */
.acf-form-fields {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.acf-field {
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
}

/* --- REGRAS DE LARGURA TOTAL (100%) --- */
.acf-field[data-name="servico_principal_cotacao"], /* Busca */
.acf-field[data-type="message"],                   /* Alertas */
.acf-field[data-name="grupo_atuacao_principal"],
.acf-field[data-name^="lista_g"],
.acf-field[data-name="logo_empresa"],
.acf-field[data-type="tab"],
.acf-field[data-name="_post_title"],
.acf-field[data-name="desc_servico"],
.acf-field[data-type="textarea"],
.acf-field[data-name="itens_tdr"],
.acf-form-submit {
    grid-column: span 2 !important;
    width: 100% !important;
}

/* --- ESTILIZAÇÃO DA BUSCA INTELIGENTE (CORREÇÃO DE ALTURA E TEXTO) --- */
.acf-field[data-name="servico_principal_cotacao"] .select2-container .select2-selection--single {
    height: 55px !important; /* Altura maior para não cortar */
    display: flex !important;
    align-items: center !important; /* Centraliza o texto verticalmente */
    border: 1px solid #cbd5e0 !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important; /* Reseta altura de linha */
    padding-left: 15px !important;
    color: #1A365D !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-top: 0 !important; /* Remove margens estranhas */
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 55px !important; /* Acompanha a altura */
    top: 0 !important;
    right: 15px !important;
}

/* --- INPUTS NORMAIS --- */
.acf-label label {
    font-weight: 700;
    color: #1A365D;
    margin-bottom: 8px;
    font-size: 14px;
    display: block;
}

.acf-input input:not([type=file]):not([type=submit]), 
.acf-input select, 
.acf-input textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 15px;
    color: #2d3748;
    box-sizing: border-box;
    transition: 0.3s;
    height: auto !important;
}

.acf-input input:focus, 
.acf-input select:focus, 
.acf-input textarea:focus {
    border-color: #3182ce;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(49,130,206,0.1);
}

/* --- ESTILO DOS ALERTAS (FUNDO CLARO 100%) --- */
.cota-risk-header {
    width: 100%;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    margin-top: 10px;
    box-sizing: border-box; /* Garante que padding não estoure a largura */
    border-left: 8px solid; /* Tarja lateral grossa */
    animation: slideDown 0.4s ease-out;
    display: block; /* Garante bloco */
}

.cota-risk-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cota-risk-header p {
    margin: 0;
    font-size: 15px;
    opacity: 0.95;
    line-height: 1.5;
}

/* CORES SUAVES (PASTEL) - FUNDO CLARO 100% */
.g1-header { background: #f0fff4; color: #22543d; border-color: #38a169; } /* Verde */
.g2-header { background: #fffff0; color: #744210; border-color: #d69e2e; } /* Amarelo */
.g3-header { background: #fffaf0; color: #7b341e; border-color: #dd6b20; } /* Laranja */
.g4-header { background: #fff5f5; color: #742a2a; border-color: #e53e3e; } /* Vermelho */
.g5-header { background: #ebf8ff; color: #2a4365; border-color: #3182ce; } /* Azul */
.g6-header { background: #faf5ff; color: #44337a; border-color: #805ad5; } /* Roxo */
.g7-header { background: #f7fafc; color: #2d3748; border-color: #4a5568; } /* Cinza */
.g8-header { background: #edf2f7; color: #1a202c; border-color: #000; }    /* Preto Suave */

/* OCULTAR CAMPO TÉCNICO */
.cota-hidden-field { display: none !important; }

/* BOTÃO SALVAR */
.acf-form-submit .acf-button {
    background: linear-gradient(90deg, #1A365D, #2B6CB0) !important;
    color: #fff !important;
    padding: 15px 40px !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    border: none !important;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
    margin-top: 20px;
}

.acf-form-submit .acf-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 54, 93, 0.4) !important;
}

/* ANIMAÇÃO */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   6. MODAL & FLUTUANTES
   ========================================================================== */
.cota-modal {
    display: none; position: fixed; z-index: 99999; left: 0; top: 0; 
    width: 100%; height: 100%; overflow: auto; 
    background-color: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
}

.cota-modal-content {
    background-color: #fefefe; margin: 5% auto; padding: 40px; 
    width: 90%; max-width: 900px; border-radius: 12px; position: relative; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); 
    animation: slideDownModal 0.3s ease-out;
}

@keyframes slideDownModal { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.cota-modal-close {
    color: #aaa; float: right; font-size: 28px; font-weight: bold; 
    cursor: pointer; position: absolute; top: 15px; right: 25px; transition: 0.2s;
}
.cota-modal-close:hover { color: #e53e3e; }

/* Barra Flutuante */
.cota-action-bar {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: #fff; padding: 15px 30px; border-radius: 50px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 1000; display: none;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translate(-50%, 50px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.js-select-prop { cursor: pointer; width: 20px; height: 20px; accent-color: #1A365D; }

/* ==========================================================================
   7. RESPONSIVO
   ========================================================================== */
@media (max-width: 768px) {
    .acf-form-fields { grid-template-columns: 1fr !important; }
    .acf-field { grid-column: span 1 !important; }
    .cota-dash-header { padding: 25px; }
    .cota-stat-card { min-width: 100%; margin-bottom: 10px; }
    .cota-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   6. ESTILO DE DECISÃO (BOTÕES GRANDES - V16.36) 🎨
   ========================================================================== */

/* 1. CONFIGURAÇÃO GERAL DOS "CARTÕES DE RÁDIO" */
/* Aplica apenas aos campos de decisão crítica */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list,
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr; /* Dois botões lado a lado */
    gap: 15px !important;
}

/* 2. O CARTÃO (A CAIXA CLICÁVEL) */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li,
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
}

.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li label,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li label,
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px 15px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #4a5568;
    transition: all 0.2s ease-in-out;
    text-align: center;
    line-height: 1.4;
}

/* 3. EFEITO HOVER (AO PASSAR O MOUSE) */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li label:hover,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li label:hover {
    border-color: #3182ce;
    background: #ebf8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 4. ESTADO SELECIONADO (QUANDO MARCA) */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li label.selected,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li label.selected,
/* ACF adiciona a classe 'selected' no label automaticamente ou usamos o input:checked */
.acf-field[data-name="tem_projeto_tecnico"] input:checked + label, /* Fallback */
.acf-field[data-name="tem_projeto_tecnico"] label.selected {
    border-color: #2b6cb0 !important;
    background-color: #2b6cb0 !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(43, 108, 176, 0.3);
}

/* Tratamento especial para o botão "Não Tenho Projeto" (Vermelho Suave) */
.acf-field[data-name="tem_projeto_tecnico"] input[value="nao"]:checked + label {
    background-color: #fff5f5 !important;
    border-color: #fc8181 !important;
    color: #c53030 !important;
}

/* Tratamento especial para o botão "Sim Tenho Projeto" (Verde Suave) */
.acf-field[data-name="tem_projeto_tecnico"] input[value="sim"]:checked + label {
    background-color: #f0fff4 !important;
    border-color: #68d391 !important;
    color: #22543d !important;
}

/* 5. A BOLINHA DO RÁDIO (ESCONDER OU DESTACAR) */
/* Vamos deixar a bolinha visível mas estilizada */
.acf-field[data-name="tem_projeto_tecnico"] input[type="radio"],
.acf-field[data-name="acao_sem_projeto"] input[type="radio"] {
    margin-right: 10px !important;
    transform: scale(1.5); /* Aumenta a bolinha */
    accent-color: #1A365D;
}

/* 6. CORREÇÃO RESPONSIVA (CELULAR VIRA UM EMBAIXO DO OUTRO) */
@media (max-width: 768px) {
    .acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list,
    .acf-field[data-name="acao_sem_projeto"] .acf-radio-list {
        grid-template-columns: 1fr !important; /* Uma coluna */
    }
}

/* 7. DESTAQUE PARA A CAIXA "DECISÃO DO SÍNDICO" (SOS) */
.acf-field[data-name="acao_sem_projeto"] {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px dashed #cbd5e0;
    margin-top: 15px !important;
}

/* Estilo do Botão "SOS PERITO" */
.acf-field[data-name="acao_sem_projeto"] input[value="contratar_perito"] + label {
    border-left: 5px solid #805ad5 !important; /* Roxo */
}

/* Estilo do Botão "VISITA TÉCNICA" */
.acf-field[data-name="acao_sem_projeto"] input[value="visita_tecnica"] + label {
    border-left: 5px solid #3182ce !important; /* Azul */
    
    /* ==========================================================================
   6. ESTILO DE DECISÃO (BOTÕES GRANDES - V16.36) 🎨
   ========================================================================== */

/* 1. TRANSFORMAR A LISTA EM GRID (LADO A LADO) */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list,
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr; /* Divide em 2 colunas iguais */
    gap: 20px !important;
}

/* 2. REMOVER MARGENS DOS ITENS DA LISTA */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li,
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
}

/* 3. ESTILO DO CARTÃO (O BOTÃO EM SI) */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li label,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li label,
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li label {
    display: flex !important;
    align-items: center; /* Alinha ícone e texto verticalmente */
    justify-content: center; /* Centraliza tudo */
    width: 100%;
    padding: 25px 20px; /* Mais gordo */
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: #4a5568;
    transition: all 0.2s ease-in-out;
    text-align: left; /* Texto alinhado à esquerda fica melhor com ícones */
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* 4. EFEITO AO PASSAR O MOUSE (HOVER) */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li label:hover,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li label:hover {
    border-color: #3182ce;
    background: #ebf8ff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* 5. ESTADO SELECIONADO (CHECKED) - O PULO DO GATO */
/* Quando o input (bolinha) está marcado, mudamos o label vizinho */
.acf-field[data-name="tem_projeto_tecnico"] input:checked + label,
.acf-field[data-name="acao_sem_projeto"] input:checked + label,
.acf-field[data-name="tipo_proposta_forn"] input:checked + label {
    border-color: #2b6cb0 !important;
    background-color: #fff !important;
    color: #2b6cb0 !important;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2) !important; /* Anel de foco */
}

/* --- CORES ESPECÍFICAS PARA "TEM PROJETO" --- */

/* "NÃO tenho projeto" (Opção de Risco) -> Vermelho Suave quando selecionado */
.acf-field[data-name="tem_projeto_tecnico"] input[value="nao"]:checked + label {
    border-color: #fc8181 !important;
    background-color: #fff5f5 !important;
    color: #c53030 !important;
    box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.2) !important;
}

/* "SIM tenho projeto" (Opção Segura) -> Verde Suave quando selecionado */
.acf-field[data-name="tem_projeto_tecnico"] input[value="sim"]:checked + label {
    border-color: #48bb78 !important;
    background-color: #f0fff4 !important;
    color: #22543d !important;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.2) !important;
}

/* 6. MELHORAR A BOLINHA DO RÁDIO */
.acf-field[data-name="tem_projeto_tecnico"] input[type="radio"],
.acf-field[data-name="acao_sem_projeto"] input[type="radio"],
.acf-field[data-name="tipo_proposta_forn"] input[type="radio"] {
    margin-right: 12px !important;
    transform: scale(1.4); /* Aumenta a bolinha */
    accent-color: #1A365D; /* Cor da marca */
}

/* 7. CELULAR (UM EMBAIXO DO OUTRO) */
@media (max-width: 768px) {
    .acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list,
    .acf-field[data-name="acao_sem_projeto"] .acf-radio-list,
    .acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
        grid-template-columns: 1fr !important; /* Uma coluna só */
    }
}
}

/* ... [ADICIONE NO FINAL DO ARQUIVO] ... */

/* FORÇAR GRID NOS BOTÕES DE DECISÃO */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list,
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* Força 2 colunas */
    gap: 15px !important;
    width: 100% !important;
}

/* GARANTIR QUE O ITEM DA LISTA NÃO TENHA MARGEM ESTRANHA */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li {
    width: 100% !important;
    margin: 0 !important;
}

/* ESTILO DO LABEL (BOTÃO) */
.acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list li label,
.acf-field[data-name="acao_sem_projeto"] .acf-radio-list li label {
    display: flex !important;
    flex-direction: column; /* Texto embaixo do icone */
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 80px; /* Altura mínima para ficarem iguais */
    padding: 15px !important;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* RESPONSIVO */
@media (max-width: 600px) {
    .acf-field[data-name="tem_projeto_tecnico"] .acf-radio-list,
    .acf-field[data-name="acao_sem_projeto"] .acf-radio-list {
        grid-template-columns: 1fr !important; /* 1 Coluna no celular */
    }
}

/* ==========================================================================
   7. CORREÇÕES DE LAYOUT V16.46 (WhatsApp, Tabela e Botões) 🛠️
   ========================================================================== */

/* 1. CORREÇÃO DO CARD DO CLIENTE (WHATSAPP) */
.cota-client-card {
    display: flex !important;
    flex-wrap: wrap !important; /* Permite quebrar linha se apertar */
    align-items: center !important;
    justify-content: space-between !important; /* Espalha os itens */
    gap: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* O botão do WhatsApp agora fica sempre alinhado, sem vazar */
.cota-whatsapp-btn-wrap {
    flex-shrink: 0 !important; /* Não deixa esmagar */
    margin-left: auto !important; /* Empurra para a direita */
}

/* No celular, o botão desce e ocupa largura total */
@media (max-width: 600px) {
    .cota-client-card {
        flex-direction: column !important;
        text-align: center !important;
    }
    .cota-whatsapp-btn-wrap {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .cota-whatsapp-btn-wrap a {
        justify-content: center !important;
        width: 100% !important;
    }
}

/* 2. FORÇAR TABELA DE PREÇOS A OCUPAR 100% DA LINHA */
.acf-field[data-name="itens_proposta"] {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
    clear: both !important; /* Limpa qualquer elemento ao lado */
    float: none !important;
    display: block !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

/* Melhorar espaço dentro da tabela */
.acf-field[data-name="itens_proposta"] .acf-table {
    width: 100% !important;
}

/* 3. ALINHAR BOTÕES "TIPO DE PROPOSTA" */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* 50% para cada */
    gap: 20px !important;
    width: 100% !important;
}

.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li {
    width: 100% !important;
    margin: 0 !important;
}

/* Garante que o rótulo ocupe todo o espaço do cartão */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li label {
    width: 100% !important;
    height: 100% !important;
    min-height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important; /* Permite quebra de texto */
}

/* ==========================================================================
   9. DESIGN SYSTEM V16.53 (Correção Título e Card Flex) 🛠️
   ========================================================================== */

/* --- 1. CARD DO CLIENTE (FLEXBOX PARA NÃO QUEBRAR) --- */
.cota-card-grid {
    display: flex !important; /* Mudamos para Flex */
    flex-wrap: wrap !important; /* Permite quebrar linha se apertar */
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Logo (Tamanho fixo) */
.cota-col-logo {
    flex: 0 0 80px !important;
}
.cota-col-logo img, .cota-fake-logo {
    width: 80px; height: 80px;
    object-fit: contain; border-radius: 50%;
    border: 2px solid #edf2f7; display: block;
}
.cota-fake-logo {
    background: #edf2f7; display: flex; 
    align-items: center; justify-content: center; font-size: 30px;
}

/* Info (Ocupa o espaço que sobra) */
.cota-col-info {
    flex: 1 1 200px !important; /* Cresce e encolhe, min 200px */
}
.cota-col-info h3 { margin: 0 0 8px 0; color: #2d3748; font-size: 18px; }
.cota-meta { color: #718096; font-size: 14px; }
.cota-contact-info {
    font-size: 13px; color: #4a5568; margin-top: 8px;
    border-top: 1px dashed #cbd5e0; padding-top: 8px;
}

/* Botão (Tamanho automático, alinhado) */
.cota-col-btn {
    flex: 0 0 auto !important; /* Não encolhe */
}
.cota-btn-whatsapp {
    background: #25D366; color: #fff !important;
    text-decoration: none; padding: 12px 25px;
    border-radius: 50px; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; gap: 8px;
    white-space: nowrap; transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2);
}
.cota-btn-whatsapp:hover { transform: scale(1.05); }

/* --- 2. BOTÕES TIPO DE PROPOSTA (CORREÇÃO DO TÍTULO) --- */

/* Resetar o Título Principal (Caso tenha pego estilo errado) */
.acf-field[data-name="tipo_proposta_forn"] > .acf-label label {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    width: auto !important;
    display: block !important;
    font-weight: bold !important;
    color: #2d3748 !important;
    box-shadow: none !important;
    pointer-events: none !important; /* Não clicável */
}

/* Container dos Botões */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
    display: flex !important;
    gap: 15px !important;
    width: 100% !important;
}
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li {
    flex: 1 !important; margin: 0 !important;
}

/* Estilo APENAS dos Botões de Opção (usando seletor .acf-radio-list) */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    padding: 20px !important;
    background: #fff;
    border: 2px solid #cbd5e0;
    border-radius: 50px;
    font-weight: 700;
    color: #718096;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
    box-shadow: none; /* Remove sombra inicial */
}

/* Hover nos Botões */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li label:hover {
    border-color: #1A365D; color: #1A365D; background: #f7fafc;
    transform: translateY(-2px);
}

/* Classe Ativa (JS) */
.cota-btn-ativo {
    background-color: #1A365D !important;
    color: #ffffff !important;
    border-color: #1A365D !important;
    box-shadow: 0 5px 15px rgba(26, 54, 93, 0.4) !important;
}

/* Esconder input radio original */
.acf-field[data-name="tipo_proposta_forn"] input {
    position: absolute; opacity: 0; width: 0; height: 0;
}

/* --- 3. RESPONSIVO (MOBILE) --- */
@media (max-width: 600px) {
    .cota-card-grid {
        flex-direction: column !important;
        text-align: center !important;
    }
    .cota-col-logo, .cota-col-info, .cota-col-btn {
        width: 100% !important;
        display: flex; justify-content: center;
    }
    .cota-btn-whatsapp { width: 100%; justify-content: center; }
}

/* --- 3. BOTÕES TIPO DE PROPOSTA (CORREÇÃO V16.52) --- */

/* 1. Alinhamento lado a lado */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
    display: flex !important;
    gap: 15px !important;
    width: 100% !important;
}

.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li {
    flex: 1 !important; /* Ocupa espaço igual */
    margin: 0 !important;
}

/* 2. Visual do Botão (Desativado) */
.acf-field[data-name="tipo_proposta_forn"] label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    padding: 20px !important; /* Botão mais gordo */
    background: #fff;
    border: 2px solid #cbd5e0;
    border-radius: 50px; /* Redondo */
    font-weight: 700;
    color: #718096; /* Cinza */
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

/* 3. Hover (Passar o mouse) */
.acf-field[data-name="tipo_proposta_forn"] label:hover {
    border-color: #1A365D;
    color: #1A365D;
    background: #f7fafc;
    transform: translateY(-2px);
}

/* 4. CLASSE ATIVA (Forçada pelo JS abaixo) - AZUL FORTE */
.cota-btn-ativo {
    background-color: #1A365D !important;
    color: #ffffff !important;
    border-color: #1A365D !important;
    box-shadow: 0 5px 15px rgba(26, 54, 93, 0.4) !important;
}

/* 5. Esconder a bolinha original (Radio) */
.acf-field[data-name="tipo_proposta_forn"] input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* ==========================================================================
   10. CORREÇÃO FINAL DE LAYOUT DA TABELA (V16.62) 🛠️
   ========================================================================== */

/* 1. OBRIGAR O CAMPO DA TABELA A OCUPAR 100% DA LARGURA (SEM VIZINHOS) */
.acf-field[data-name="itens_proposta"],
.acf-field[data-name="msg_tabela_intro"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important; /* Quebra o Flexbox */
    float: none !important;
    clear: both !important; /* Empurra tudo para baixo */
    margin-bottom: 20px !important;
    background: #fff;
    padding: 0 !important;
}

/* 2. EMPURRAR AS ABAS (TOTAIS & CONDIÇÕES) PARA A LINHA DE BAIXO */
.acf-field[data-name="tab_prop_fin"],
.acf-tab-wrap,
.acf-field-tab {
    display: block !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    clear: both !important;
    margin-top: 30px !important; /* Espaço extra para separar da tabela */
}

/* 3. LARGURAS MÍNIMAS DAS COLUNAS (PARA NÃO ESPREMER O TEXTO) */
/* Isso impede que o navegador encolha as colunas se a tela for pequena */

.acf-field[data-name="itens_proposta"] table {
    width: 100% !important;
    table-layout: fixed !important; /* Respeita as larguras abaixo */
}

/* Coluna 1: Item / Descrição (Maior espaço) */
.acf-field[data-name="itens_proposta"] td[data-name="item_nome"] {
    width: 40% !important;
    min-width: 250px !important; 
}

/* Coluna 2 e 3: Qtd e Un (Pequenas) */
.acf-field[data-name="itens_proposta"] td[data-name="item_qtd"],
.acf-field[data-name="itens_proposta"] td[data-name="item_unidade"] {
    width: 8% !important;
    min-width: 50px !important;
    text-align: center !important;
}

/* Coluna 4 e 5: Preço e Subtotal (Médias) */
.acf-field[data-name="itens_proposta"] td[data-name="item_preco_unitario"],
.acf-field[data-name="itens_proposta"] td[data-name="item_subtotal"] {
    width: 20% !important;
    min-width: 130px !important;
}

/* Ajuste nos inputs dentro da tabela para ficarem bonitos */
.acf-field[data-name="itens_proposta"] input[type="text"],
.acf-field[data-name="itens_proposta"] input[type="number"] {
    width: 100% !important;
    min-height: 40px !important;
    padding: 5px 10px !important;
}

/* 4. RESETAR O WRAPPER GERAL DO ACF (CASO O TEMA ESTEJA FORÇANDO COLUNAS) */
.acf-fields {
    display: flex !important;
    flex-wrap: wrap !important;
}
.acf-field {
    box-sizing: border-box !important;
}

/* ==========================================================================
   11. BADGES DE STATUS - CORES OBRIGATÓRIAS (V16.65) 🎨
   ========================================================================== */

/* 1. Garantir que o Card permita posicionamento absoluto dentro dele */
.cota-card-item {
    position: relative !important;
    overflow: hidden !important; /* Para o canto não vazar */
}

/* 2. Estilo Base da Etiqueta (Canto Superior Direito) */
.cota-card-header-badge {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    padding: 6px 12px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-bottom-left-radius: 8px !important;
    color: #ffffff !important; /* Texto sempre branco */
    z-index: 10 !important; /* Fica acima de tudo */
    box-shadow: -1px 1px 3px rgba(0,0,0,0.2) !important;
}

/* 3. Cor: ABERTA (Verde) */
.status-aberta {
    background-color: #2F855A !important; 
    border-left: 1px solid #276749 !important;
    border-bottom: 1px solid #276749 !important;
}

/* 4. Cor: ENCERRADA (Vermelho) */
.status-encerrada {
    background-color: #C53030 !important;
    border-left: 1px solid #9B2C2C !important;
    border-bottom: 1px solid #9B2C2C !important;
}

/* ==========================================================================
   12. ESTILIZAÇÃO PROFISSIONAL DOS FILTROS (V16.68) 🎨
   ========================================================================== */

/* 1. Container da Barra (O fundo branco) */
.cota-filter-bar {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Sombra suave */
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
    margin-top: 10px;
    max-width: 100%;
}

/* 2. Grupo Flexível (Alinha os itens lado a lado) */
.cota-filter-group {
    display: flex;
    flex-wrap: wrap; /* Permite quebrar linha se faltar espaço */
    gap: 15px; /* Espaço entre os campos */
    align-items: center;
    justify-content: center;
}

/* 3. Inputs e Selects (Design Moderno) */
.cota-input-filter {
    flex: 1; /* Ocupa o espaço disponível */
    min-width: 200px; /* Largura mínima */
    height: 50px !important; /* Altura fixa para alinhar com botão */
    padding: 0 15px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    color: #4a5568 !important;
    background-color: #fff !important;
    outline: none !important;
    transition: all 0.2s ease;
    box-sizing: border-box !important;
}

/* Efeito ao clicar no campo */
.cota-input-filter:focus {
    border-color: #3182ce !important; /* Azul ao focar */
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1) !important;
}

/* 4. Botão de Filtrar (Azul da Marca) */
.cota-btn-filter {
    height: 50px !important;
    padding: 0 30px !important;
    background-color: #1A365D !important; /* Azul Escuro */
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: background 0.2s, transform 0.1s !important;
    min-width: 120px;
}

.cota-btn-filter:hover {
    background-color: #2c5282 !important; /* Azul mais claro no hover */
    transform: translateY(-2px); /* Leve subida */
}

/* 5. Link Limpar (Texto simples) */
.cota-btn-clear {
    color: #e53e3e; /* Vermelho para ação de cancelar */
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed #e53e3e;
    margin-left: 5px;
    cursor: pointer;
    white-space: nowrap;
}

.cota-btn-clear:hover {
    color: #c53030;
    border-bottom-style: solid;
}

/* 6. Responsividade (Celular) */
@media (max-width: 768px) {
    .cota-filter-bar {
        padding: 15px;
    }
    
    .cota-filter-group {
        flex-direction: column; /* Empilha um embaixo do outro */
        align-items: stretch;
    }
    
    .cota-input-filter, 
    .cota-btn-filter {
        width: 100% !important; /* Largura total no celular */
        min-width: 100% !important;
    }
    
    .cota-btn-clear {
        text-align: center;
        display: block;
        margin-top: 10px;
        margin-left: 0;
        padding: 10px;
    }
}

/* ==========================================================================
   CARDS COMPACTOS (V16.71)
   ========================================================================== */
.cota-card-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px; /* Arredondamento menor */
    overflow: hidden;
    position: relative !important;
}

.cota-card-body {
    padding: 15px; /* Menos espaçamento interno */
}

.cota-card-title {
    font-size: 16px; /* Fonte do título menor */
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
    display: block;
    text-decoration: none;
    line-height: 1.3;
}

.cota-card-info {
    font-size: 12px;
    color: #718096;
    margin-bottom: 8px;
}

.cota-card-actions {
    padding: 10px 15px;
    background: #f7fafc;
    border-top: 1px solid #edf2f7;
    display: flex;
    gap: 8px;
}

.cota-btn-ver, .cota-btn-gerir {
    padding: 6px 12px; /* Botões mais finos */
    border-radius: 6px;
    font-size: 12px;
}

/* Mantém os outros estilos (Filtros, Badges, etc.) do passo anterior *//* Cards Compactos e Títulos Ajustados */
.cota-card-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px; /* Cantos menos redondos */
    overflow: hidden;
    position: relative !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px; /* Altura padrão reduzida */
}

.cota-card-body {
    padding: 15px; /* Menos espaçamento */
}

.cota-card-title {
    font-size: 16px; /* Fonte menor (era 18px) */
    font-weight: 700;
    color: #2d3748;
    margin: 5px 0 10px 0;
    line-height: 1.3;
    display: block;
    text-decoration: none;
}

.cota-card-info {
    font-size: 12px;
    color: #718096;
}

.cota-card-actions {
    padding: 10px 15px;
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
    display: flex;
    gap: 8px;
}

.cota-btn-ver, .cota-btn-gerir {
    padding: 6px 12px; /* Botão menor */
    font-size: 12px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    flex: 1;
}

/* ==========================================================================
   BOTÕES DE ESCOLHA (TIPO DE PROPOSTA) 🔘
   ========================================================================== */

/* Remove as bolinhas padrão e alinha lado a lado */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list {
    display: flex !important;
    gap: 20px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list li {
    flex: 1; /* Ocupa 50% cada */
}

/* Estilo do Botão Desativado (Cinza/Branco) */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 10px;
    border: 2px solid #cbd5e0;
    border-radius: 50px; /* Borda redonda */
    background: #fff;
    color: #718096;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}

/* Esconde o Input Original (A bolinha pequena) */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list input {
    display: none !important; /* Some com a bolinha */
}

/* ESTADO ATIVO: Quando a classe .cota-btn-ativo é adicionada pelo JS */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list label.cota-btn-ativo {
    background-color: #1A365D !important; /* Azul Escuro */
    color: #ffffff !important;
    border-color: #1A365D !important;
    box-shadow: 0 4px 10px rgba(26, 54, 93, 0.3);
    transform: translateY(-2px);
}

/* Hover (Passar o mouse) */
.acf-field[data-name="tipo_proposta_forn"] .acf-radio-list label:hover {
    border-color: #1A365D;
    color: #1A365D;
}