/* Agendado — estilos base sobre Tailwind (ver includes/header.php para el theme) */

body {
  min-height: 100vh;
}

.font-heading {
  font-family: 'Fraunces', serif;
}

/* Interruptor on/off reutilizable */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch .slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(22, 35, 31, 0.15);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.toggle-switch .slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.toggle-switch input:checked + .slider {
  background: #1F4B43;
}
.toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}
.toggle-switch input:focus-visible + .slider {
  outline: 2px solid #E2A33D;
  outline-offset: 2px;
}

/* Botón primario: degradado cálido + sombra difuminada (glow) en hover */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(135deg, #F0B85A, #E2A33D, #C6862A);
  color: #16231F;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 4px 14px -2px rgba(226, 163, 61, 0.45);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  box-shadow: 0 10px 30px -4px rgba(226, 163, 61, 0.65);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Botón secundario: fondo plano con borde, sin blur */
.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid rgba(22, 35, 31, 0.14);
  color: #1F4B43;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-glass:hover {
  background: rgba(31, 75, 67, 0.05);
  border-color: rgba(22, 35, 31, 0.22);
}

.card {
  background: #FFFFFF;
  border: 1px solid rgba(22, 35, 31, 0.06);
  border-radius: 1rem;
  box-shadow: 0 4px 20px -2px rgba(22, 35, 31, 0.06);
}

.input-field {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgba(22, 35, 31, 0.15);
  background: #FFFFFF;
  padding: 0.65rem 0.9rem;
  font-size: 0.925rem;
  color: #16231F;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-field:focus {
  outline: none;
  border-color: #1F4B43;
  box-shadow: 0 0 0 3px rgba(31, 75, 67, 0.12);
}

.alert {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.alert-error {
  background: rgba(193, 80, 63, 0.1);
  color: #C1503F;
  border: 1px solid rgba(193, 80, 63, 0.25);
}

.alert-success {
  background: rgba(31, 75, 67, 0.08);
  color: #1F4B43;
  border: 1px solid rgba(31, 75, 67, 0.2);
}

/* Badges de estado de cita */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pendiente { background: rgba(226, 163, 61, 0.16); color: #a1721f; }
.badge-confirmada { background: rgba(31, 75, 67, 0.14); color: #1F4B43; }
.badge-cancelada { background: rgba(193, 80, 63, 0.14); color: #C1503F; }
.badge-completada { background: rgba(22, 35, 31, 0.1); color: #16231F; }
.badge-no_asistio { background: rgba(22, 35, 31, 0.08); color: rgba(22, 35, 31, 0.55); }
.badge-enviado { background: rgba(31, 75, 67, 0.14); color: #1F4B43; }
.badge-confirmado { background: rgba(31, 75, 67, 0.14); color: #1F4B43; }
.badge-fallido { background: rgba(193, 80, 63, 0.14); color: #C1503F; }
.badge-cancelado { background: rgba(193, 80, 63, 0.14); color: #C1503F; }

/* Modales */
/* Tarjeta flotante de detalle de cita (anclada junto al bloque, sin fondo oscurecido) */
.popover-cita {
  position: fixed;
  top: -9999px;
  left: -9999px;
  z-index: 60;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: #FFFFFF;
  border-radius: 1rem;
  border: 1px solid rgba(22, 35, 31, 0.08);
  box-shadow: 0 16px 40px -8px rgba(22, 35, 31, 0.35);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 35, 31, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}

/* Calendario: grilla de horario */
.calendario-columna {
  position: relative;
  border-left: 1px solid rgba(22, 35, 31, 0.08);
  cursor: crosshair;
}

.calendario-linea-hora {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(22, 35, 31, 0.08);
}

.cita-bloque {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 2;
  border-radius: 0.5rem;
  border-left: 4px solid;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  box-shadow: 0 1px 4px rgba(22, 35, 31, 0.12);
}

/* Franja de horario bloqueado / fuera de atención ("No disponible") */
.bloqueo-franja {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  color: rgba(22, 35, 31, 0.4);
  font-size: 11px;
  font-weight: 600;
  cursor: not-allowed;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(22, 35, 31, 0.045),
    rgba(22, 35, 31, 0.045) 6px,
    rgba(22, 35, 31, 0.09) 6px,
    rgba(22, 35, 31, 0.09) 12px
  );
}

/* Línea que marca la hora actual en el calendario */
.calendario-linea-ahora {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  border-top: 2px solid #C1503F;
  pointer-events: none;
}
.calendario-linea-ahora::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C1503F;
}

.cita-bloque:hover {
  box-shadow: 0 4px 14px rgba(22, 35, 31, 0.2);
  transform: translateY(-1px);
  z-index: 10;
}

.cita-bloque.estado-cancelada {
  opacity: 0.55;
  text-decoration: line-through;
}

.cita-bloque.arrastrando {
  opacity: 0.35;
}

.cita-resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
}

.calendario-columna.columna-drag-over {
  background: rgba(31, 75, 67, 0.05);
}
