/* ============================================================
   MODAL: NOVO AGENDAMENTO
   Arquivo: assets/css/agendamento-modal.css
   ============================================================ */

/* ---------- Container do modal ---------- */
#modalAgendamento .modal-box {
    max-width: 720px;
}

#modalAgendamento .modal-body {
    padding: 20px 24px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ---------- Steps (cada bloco de campo) ---------- */
.ag-step {
    margin-bottom: 18px;
}

.ag-step:last-child {
    margin-bottom: 0;
}

.ag-step .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.ag-step .form-label .ag-obrig {
    color: #dc2626;
    margin-left: 2px;
}

.ag-step .form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ag-step .form-control:focus {
    outline: none;
    border-color: #2f5f57;
    box-shadow: 0 0 0 3px rgba(47, 95, 87, 0.12);
}

.ag-step .form-control:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* ---------- Campo Paciente (input + botao pesquisar) ---------- */
.ag-paciente-linha {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.ag-paciente-linha .form-control {
    flex: 1;
    background: #f9fafb;
    cursor: pointer;
}

.ag-btn-pesquisar-pac {
    padding: 0 16px;
    background: #2f5f57;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background 0.15s;
}

.ag-btn-pesquisar-pac:hover {
    background: #245049;
}

.ag-paciente-selecionado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-top: 8px;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    font-size: 13px;
    color: #065f46;
}

.ag-paciente-selecionado small {
    color: #047857;
    margin-left: 6px;
}

.ag-paciente-remover {
    background: transparent;
    border: none;
    color: #065f46;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.ag-paciente-remover:hover {
    color: #dc2626;
}

/* ---------- Data + Horarios ---------- */
.ag-data-hora-wrap {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: start;
}

.ag-data-hora-wrap .ag-data-col {
    display: flex;
    flex-direction: column;
}

.ag-data-hora-wrap .ag-horarios-col {
    display: flex;
    flex-direction: column;
    min-height: 60px;
}

.ag-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 6px;
}

.ag-slot {
    padding: 8px 4px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s;
    font-family: inherit;
}

.ag-slot:hover {
    border-color: #2f5f57;
    background: #f0f5f4;
}

.ag-slot.is-selecionado {
    background: #2f5f57;
    color: #fff;
    border-color: #2f5f57;
    box-shadow: 0 2px 6px rgba(47, 95, 87, 0.3);
}

.ag-slot-msg {
    font-size: 12px;
    color: #9ca3af;
    padding: 12px 0;
    text-align: center;
}

/* ---------- Unidade / Sala (select combinado) ---------- */
.ag-step select.ag-unidade-sala {
    width: 100%;
}

/* ---------- Recorrencia ---------- */
.ag-recorrencia-linha {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---------- Resumo ---------- */
.ag-resumo {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 13px;
    color: #4b5563;
}

.ag-resumo-linha {
    display: flex;
    padding: 3px 0;
}

.ag-resumo-linha strong {
    color: #1f2937;
    min-width: 110px;
    flex-shrink: 0;
}

.ag-resumo-vazio {
    color: #9ca3af;
    font-style: italic;
}

/* ---------- Checkbox ---------- */
.ag-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    user-select: none;
}

.ag-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2f5f57;
    cursor: pointer;
}

/* ---------- Footer ---------- */
#modalAgendamento .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
}

/* ---------- Modal de Pesquisa de Paciente ---------- */
#modalPesquisaPaciente .modal-box {
    max-width: 620px;
}

#modalPesquisaPaciente .modal-body {
    padding: 20px 24px;
}

.ag-busca-linha {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.ag-busca-linha input {
    flex: 1;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.ag-busca-linha input:focus {
    outline: none;
    border-color: #2f5f57;
    box-shadow: 0 0 0 3px rgba(47, 95, 87, 0.12);
}

.ag-busca-linha button {
    padding: 0 18px;
    background: #2f5f57;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.ag-busca-linha button:hover {
    background: #245049;
}

.ag-busca-resultado {
    max-height: 320px;
    overflow-y: auto;
}

.ag-busca-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.1s;
}

.ag-busca-item:hover {
    background: #f0f5f4;
}

.ag-busca-item strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.ag-busca-item small {
    font-size: 12px;
    color: #6b7280;
}

.ag-busca-vazio {
    text-align: center;
    padding: 30px 20px;
    color: #9ca3af;
    font-size: 13px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 600px) {
    .ag-data-hora-wrap {
        grid-template-columns: 1fr;
    }
    .ag-recorrencia-linha {
        grid-template-columns: 1fr;
    }
    .ag-paciente-linha {
        flex-direction: column;
    }
    .ag-btn-pesquisar-pac {
        padding: 10px;
        justify-content: center;
    }
}
