/* Modal configurar día — Programar Agenda */
.cal-modal-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.cal-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.cal-modal-overlay.hidden:not(.active) {
  display: flex;
}

/* Cabecera y botón cerrar siempre visibles */
.cal-modal {
  position: relative;
  overflow: visible;
}
.cal-modal-head {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 0;
  flex-shrink: 0;
}
.cal-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
.cal-modal-close svg {
  display: none;
}

.cal-step.hidden {
  display: none !important;
}

.cal-step-intro {
  margin: 0 0 20px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #64748b;
  text-align: center;
}
.cal-step-intro--left {
  text-align: left;
  margin-bottom: 14px;
}

.cal-obs-absent-form {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.cal-obs-absent-form .cal-motivo-label {
  color: #991b1b;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.cal-btn-confirm-absent {
  margin-top: 4px;
}

.cal-choice-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 18px 20px;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s;
}
.cal-choice-btn:active {
  transform: scale(0.98);
}
.cal-choice-btn-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.cal-choice-btn-desc {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
}

.cal-choice-btn--no {
  background: linear-gradient(180deg, #fef2f2 0%, #fff5f5 100%);
  border-color: #fca5a5;
  color: #991b1b;
}
.cal-choice-btn--no:hover {
  background: #fee2e2;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.15);
}

.cal-choice-btn--config {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-color: #93c5fd;
  color: #1e40af;
}
.cal-choice-btn--config:hover {
  background: #dbeafe;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.cal-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 6px 0;
  border: none;
  background: none;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}
.cal-back-btn:hover {
  color: #334155;
}

.cal-attend-options {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.cal-hora-section.hidden {
  display: none !important;
}

.cal-attend-options-label,
.cal-hora-section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-attend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cal-attend-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-attend-chip.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.cal-obs-attend {
  margin-bottom: 16px;
}

.cal-motivo-input--hidden {
  display: none;
}
.cal-motivo-input:not(.cal-motivo-input--hidden) {
  display: block;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}

.cal-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.cal-btn-save {
  font-weight: 700;
}

.cal-choice-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 768px) {
  .cal-modal-overlay {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }

  .cal-modal {
    width: calc(100vw - 24px) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .cal-modal-head {
    padding: 16px 16px 0;
  }

  .cal-modal-body {
    padding: 14px 16px 20px;
  }
}
