.modal-overlay-edit {
  position: fixed;
  inset: 0;
  background: rgba(147, 84, 119, 0.25);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s ease-out;
}

.modal-overlay-edit.active {
  display: flex;
}

.modal-overlay-notify {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.modal-overlay-notify.active {
  display: flex;
}

.modal-overlay-image {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-overlay-image.active {
  display: flex;
}


/* ================================
🌸 MODAL EDITAR TRATAMIENTO — BEAUTYCARE PRO (SIN SCROLL)
================================ */

/* Caja principal */
.modal-edit-pro {
  background: linear-gradient(180deg, #fffdf9 0%, #fff9f7 100%);
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(255, 173, 173, 0.25);
  width: 95%;
  max-width: 1100px;

  /* 👇 La clave para evitar el bug */
  height: auto;
  max-height: none;
  overflow: visible;

  padding: 32px 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  color: #444;
  animation: slideUp 0.3s ease-out;
  animation-delay: 0.02s;
  font-family: "Poppins", sans-serif;
}

/* Botón de cierre */
.modal-edit-pro .close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: #ffadad;
  font-size: 26px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-edit-pro .close-btn:hover {
  color: #f56b6b;
}

/* Título */
.modal-edit-pro h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  color: #333;
  border-left: 5px solid #ffadad;
  padding-left: 10px;
  margin-bottom: 20px;
  font-weight: 700;
}

/* GRID principal */
.edit-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.edit-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-column label {
  font-weight: 600;
  color: #555;
  font-size: 15px;
}

.edit-column input,
.edit-column select,
.edit-column textarea {
  border: 1.5px solid #ffd6d6;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  background: #fffdf9;
  font-family: "Poppins", sans-serif;
  color: #333;
  transition: all 0.25s ease;

  /* 🔥 FIX DEL SOLAPAMIENTO */
  width: 100%;
  display: block;
  box-sizing: border-box;
}

/* 🔥 El textarea necesita altura mínima estable */
.edit-column textarea {
  min-height: 90px;
}

/* Hover & Focus */
.edit-column input:focus,
.edit-column select:focus,
.edit-column textarea:focus {
  border-color: #ffadad;
  box-shadow: 0 0 8px rgba(255, 173, 173, 0.3);
  outline: none;
}

/* Select con flecha */
.edit-column select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='10'><path fill='%23ffadad' d='M7 10L0 0h14z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
}

/* ================================
📸 FOTOS ANTES / DESPUÉS
================================ */
.edit-photo-section {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-top: 15px;
}

.photo-block {
  flex: 1;
  text-align: center;
}

.photo-block label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}

.photo-preview {
  width: 100%;
  height: 140px;
  border: 2px dashed rgba(255, 173, 173, 0.35);
  border-radius: 14px;
  background: #fffdf9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.photo-preview:hover {
  border-color: #ffadad;
  box-shadow: 0 0 10px rgba(255, 173, 173, 0.25);
}

.photo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.25s ease;
}

.photo-preview img:hover {
  transform: scale(1.05);
}

/* ================================
⏱️ Input hora coherente
================================ */
input[type="time"] {
  width: 100%;
  background-color: #fffdf9;
  border: 1.5px solid rgba(255, 173, 173, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  color: #444;
  transition: all 0.25s ease;
  cursor: pointer;
}

input[type="time"]:hover {
  border-color: #ffadad;
  background-color: #fff7f7;
}

input[type="time"]:focus {
  outline: none;
  border-color: #ffadad;
  background-color: #fffaf9;
  box-shadow: 0 0 8px rgba(255, 173, 173, 0.3);
}

/* ================================
📱 RESPONSIVE
================================ */
@media (max-width: 768px) {
  .edit-grid {
    flex-direction: column;
    gap: 16px;
  }

  .edit-photo-section {
    flex-direction: column;
    gap: 20px;
  }

  .photo-preview {
    height: 120px;
  }

  .modal-edit-pro {
    height: auto;
    max-height: 92vh;
  }
}

/* ✔️ Ajuste buscador de tratamiento dentro del modal Editar */
.modal-edit-pro .searchable-select {
  width: 100% !important;
  position: relative;
}

.modal-edit-pro #editTreatmentInput {
  width: 100% !important;
  box-sizing: border-box;
  border: 1.5px solid #ffd6d6;
  border-radius: 10px;
  padding: 10px 14px;
  background: #fffdf9;
  font-family: "Poppins", sans-serif;
  font-size: 15px;
}

.modal-edit-pro #editTreatmentOptions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  max-height: 180px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid #ffd6d6;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: none;
  z-index: 50;
}

.modal-edit-pro #editTreatmentOptions div {
  padding: 10px 12px;
  cursor: pointer;
}

.modal-edit-pro #editTreatmentOptions div:hover {
  background: #fff3c2;
}

/* =========================
   PATIENT DETAILS — FIX FINAL
   ========================= */

.patient-details-page .main-top-actions{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
}

.patient-details-page .main-top-actions .right-actions{
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin-left: auto !important;
  justify-content: flex-end !important;
}

/* Si algo te los centra, lo matamos */
.patient-details-page .main-top-actions button{
  margin: 0 !important;
}

/* Botones */
.patient-details-page .btn-back{
  background: transparent !important;
  color: #ffadad !important;
  border: 2px solid #ffadad !important;
  border-radius: 10px !important;
  padding: 10px 18px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: 0.3s !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.patient-details-page .btn-back:hover{
  background: #ffadad !important;
  color: #fff !important;
  transform: translateY(-2px) !important;
}

.patient-details-page .btn-add{
  background: #ffadad !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 12px 20px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: 0.3s !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.patient-details-page .btn-add:hover{
  background: #fff3c2 !important;
  color: #333 !important;
  transform: translateY(-2px) !important;
}

/* Tablas */
.patient-details-page .table-container{
  border-radius: 10px !important;
  border: 1px solid rgba(255,173,173,0.3) !important;
  background: rgba(255,255,255,0.6) !important;
  width: 100% !important;
  max-width: 1000px !important;
  margin: 0 auto !important;
  overflow: hidden !important;
}

.patient-details-page table{
  width: 100% !important;
  border-collapse: collapse !important;
  text-align: left !important;
}

.patient-details-page th,
.patient-details-page td{
  padding: 14px 18px !important;
  border-bottom: 1px solid rgba(255,173,173,0.3) !important;
}

.patient-details-page th{
  background: rgba(255,243,194,0.8) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
}

.patient-details-page tr:hover{
  background: rgba(255,255,255,0.7) !important;
}

/* Solo turnos scrolleable */
.patient-details-page .table-container.table-scroll{
  max-height: 420px !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: #ffadad #fff3c2 !important;
}
.patient-details-page .table-container.table-scroll::-webkit-scrollbar{ width: 8px; }
.patient-details-page .table-container.table-scroll::-webkit-scrollbar-thumb{
  background-color: #ffadad; border-radius: 4px;
}
.patient-details-page .table-container.table-scroll::-webkit-scrollbar-track{
  background-color: #fff3c2;
}

@media (max-width: 700px){
  .patient-details-page .main-top-actions{
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .patient-details-page .main-top-actions .right-actions{
    margin-left: 0 !important;
    justify-content: space-between !important;
  }
  .patient-details-page .btn-back,
  .patient-details-page .btn-add{
    width: 100% !important;
    justify-content: center !important;
  }
}
