/* Ajuste visual para los inputs de hora en formularios (más compacto y moderno) */
input[type="time"].form-control,
input[type="time"].form-control-lg {
  font-size: 1rem;
  padding-top: 8px;
  padding-bottom: 8px;
  height: 42px;
  min-height: 38px;
  max-width: 100%;
}

:root {
  --brand-1: #3B82F6;
  /* primary azul claro moderno */
  --brand-2: #2563EB;
  /* primary azul oscuro */
  --accent: #10B981;
  /* accent verde moderno */
  --bg-light: #F9FAFB;
  --muted: #6B7280;
  --card-shadow: 0 8px 32px rgba(59, 130, 246, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
  color: #1F2937;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.3px;
}

.card {
  border: 1px solid rgba(59, 130, 246, 0.1);
  transition: var(--transition);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow);
  border-color: rgba(59, 130, 246, 0.2);
}

.status-card {
  display: flex;
  align-items: center;
  border: 1px solid rgba(139, 111, 71, 0.1);
  font-weight: 600;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(59, 130, 246, 0.02));
}

.timeline-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.time-slot {
  flex: 0 0 calc(25% - 6px);
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.time-slot:hover {
  opacity: 0.9;
  transform: scale(1.05);
  background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

.modal-content {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.1);
  background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
}

.modal-header {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  border: none;
  align-items: center;
}

.modal-header .modal-title {
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.2px;
}

.modal-body {
  padding: 26px;
}

.modal-footer {
  padding: 18px 24px;
  border-top: none;
}

.form-control,
.form-select {
  border-radius: 14px;
  padding: 12px 16px;
  border: 1.5px solid rgba(59, 130, 246, 0.1);
  background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
  color: #1F2937;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-1);
  background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
  outline: none;
}

/* Mejoras visuales específicas para el modal de reserva */
.modal-dialog.modal-lg {
  max-width: 820px;
}

.modal-header {
  padding: 18px 22px;
}

.modal-body {
  padding: 24px 28px;
}

.modal-body .form-label {
  font-weight: 700;
  color: var(--brand-2);
}

.modal-body .form-label i {
  color: var(--brand-1);
}

.modal-body .form-control {
  padding: 14px 12px;
  font-size: 1rem;
}

.modal-body .form-control.form-control-lg {
  padding: 14px 12px;
  height: 48px;
}

/* Mejora del switch y del contenedor de participantes */
.form-check-input:checked {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  border-color: var(--brand-1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.form-check-label {
  font-weight: 600;
  color: var(--muted);
}

.modal-body #participantsContainer {
  margin-top: 8px;
}

.modal-body #participants {
  min-height: 90px;
  border-radius: 10px;
}

/* Botón de confirmación más prominente y consistente */
.modal-footer .btn-primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  border: none;
  padding: 12px 28px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  transition: var(--transition);
  color: #FFFFFF;
}

.modal-footer .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.35);
  background: linear-gradient(135deg, var(--brand-2), #1B3A8A);
}

.modal-footer .btn-secondary {
  border-radius: 10px;
  padding: 8px 14px;
}

/* Error inline adaptado al estilo general */
#bookingError {
  margin-top: 6px;
  border-radius: 8px;
  padding: 10px 12px;
}

/* Ajustes responsivos: inputs ocupen más espacio en móvil */
@media (max-width: 576px) {
  .modal-dialog.modal-lg {
    max-width: 92%;
    margin: 12px;
  }

  .modal-body {
    padding: 18px;
  }

  .modal-footer {
    padding: 12px;
  }
}

/* Estilos para modal de resultado de reserva (centrado y limpio) */
#bookingResultModal .modal-header {
  color: #fff;
  border: none;
}

#bookingResultModal .result-success {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

#bookingResultModal .result-error {
  background: linear-gradient(135deg, #EF4444, #DC2626);
}

#bookingResultModal .modal-body {
  background: linear-gradient(135deg, #F9FAFB, #F3F4F6);
}

#bookingResultModal .conflict-item {
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

#bookingResultModal .conflict-item .title {
  font-weight: 800;
  color: var(--brand-1);
  margin-bottom: 8px;
  font-size: 1rem;
}

#bookingResultModal .conflict-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
}

#bookingResultModal .conflict-row .label {
  color: var(--muted);
  font-weight: 700;
  width: 80px;
  flex: 0 0 80px;
  font-size: 0.92rem;
}

#bookingResultModal .conflict-row .value {
  color: #1F2937;
  font-size: 0.95rem;
}

/* Conflict table layout */
#bookingResultModal .conflict-table-wrap {
  overflow: auto;
  margin-bottom: 8px;
}

#bookingResultModal .conflict-table {
  width: 100%;
  border-collapse: collapse;
}

#bookingResultModal .conflict-table thead th {
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.92rem;
  white-space: nowrap;
}

#bookingResultModal .conflict-table tbody td {
  padding: 8px 10px;
  vertical-align: top;
  font-size: 0.95rem;
  color: #18333b;
}

#bookingResultModal .conflict-table tbody tr td {
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

#bookingResultModal .conflict-table tbody tr:last-child td {
  border-bottom: none;
}

#bookingResultModal .conflict-table th:first-child,
#bookingResultModal .conflict-table td:first-child {
  max-width: 240px;
}

.status-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
}

.status-finalized {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.16);
  box-shadow: none;
}

.status-inprogress {
  background: rgba(16, 185, 129, 0.08);
  color: #DC2626;
  border-color: rgba(16, 185, 129, 0.16);
}

.status-pending {
  background: rgba(16, 185, 129, 0.08);
  color: #f59e42;
  border-color: rgba(16, 185, 129, 0.16);
}

/* Versión compacta para mensajes de éxito */
#bookingResultModal.compact .modal-dialog {
  max-width: 420px;
}

#bookingResultModal.compact .modal-content {
  border-radius: 14px;
  padding: 18px;
}

#bookingResultModal.compact .modal-header {
  display: none;
}

#bookingResultModal.compact .modal-footer {
  display: none;
}

#bookingResultModal.compact #bookingResultMessage {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  font-size: 1rem;
}

#bookingResultModal.compact .success-check {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), rgba(16, 185, 129, 0.9));
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.2);
}

#bookingResultModal.compact .success-check i {
  color: white;
  font-size: 26px;
}

#bookingResultModal.compact .modal-body {
  background: transparent;
  text-align: center;
}

/* Smooth fade for compact modal content */
#bookingResultModal.compact .modal-content {
  transition: opacity 420ms ease, transform 260ms ease;
}

#bookingResultModal.compact.show .modal-content {
  opacity: 1;
  transform: translateY(0);
}

#bookingResultModal.compact .modal-content {
  opacity: 0;
  transform: translateY(6px);
}


/* Compacta para errores/conflictos: no demasiado grande, icono de exclamación */
#bookingResultModal.compact-error .modal-dialog {
  max-width: 520px;
}

#bookingResultModal.compact-error .modal-content {
  border-radius: 12px;
  overflow: visible;
}

#bookingResultModal.compact-error .modal-header {
  padding: 14px 18px;
  border-radius: 12px 12px 0 0;
}

#bookingResultModal.compact-error .modal-footer {
  display: none;
}

#bookingResultModal.compact-error #bookingResultMessage {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

#bookingResultModal.compact-error .error-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2);
}

#bookingResultModal.compact-error .error-badge i {
  color: white;
  font-size: 22px;
}

#bookingResultModal.compact-error .modal-body {
  background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
  padding: 18px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

#bookingResultModal.compact-error .conflict-item {
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 10px;
}

#bookingResultModal.compact-error .conflict-item .title {
  font-size: 0.98rem;
}

#bookingResultModal.compact-error .conflict-item .meta {
  font-size: 0.88rem;
  color: var(--muted);
}


/* Small helpers */
.helper-text {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .col-md-6 {
    flex: 0 0 100%;
  }

  .status-card {
    margin-bottom: 10px;
  }
}

/* Header */
.header-bar {
  border-bottom: 1px solid rgba(139, 111, 71, 0.1);
  padding-bottom: 10px;
}

/* Imagen en la card */
.room-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.04));
  border-bottom: 1px solid rgba(59, 130, 246, 0.08);
}

/* Grid layout for rooms */

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* Hasta 5 columnas en desktop */
  gap: 32px; /* Más espacio entre tarjetas */
  width: 100%;
  align-items: stretch;
}

@media (max-width: 1399px) {
  .rooms-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
  }
}

@media (max-width: 1199px) {
  .rooms-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
}

@media (max-width: 991px) {
  .rooms-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

.room-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.room-block-label {
  font-size: 1rem;
  font-weight: 700;
  color: #1F2937;
}

.room-carousel-nav {
  display: flex;
  gap: 10px;
}

.block-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: #F8FAFC;
  color: #0F172A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.block-nav-btn:hover {
  background: #E2E8F0;
  transform: translateY(-1px);
}

.block-nav-btn:disabled {
  opacity: 0.45;
  background: #F1F5F9;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 575px) {
  .rooms-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Room card Ciudaris style */
.room-card-ciudaris {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.5);
  border-radius: 16px;
  padding: 28px 18px 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.28s, transform 0.18s;
  box-shadow: 0 8px 32px rgba(8, 30, 45, 0.10);
  backdrop-filter: blur(8px);
  min-height: 320px;
}

.room-card-ciudaris:hover {
  box-shadow: 0 8px 40px rgba(59, 130, 246, 0.13);
  transform: translateY(-4px) scale(1.03);
}

.room-card-icon-area {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(224, 242, 254, 0.55);
  /* subtle translucent icon area */
  width: 100%;
  border-radius: 8px;
  margin-bottom: 16px;
}

.room-card-icon-area svg {
  width: 80px;
  height: 80px;
  display: block;
}

.room-card-content {
  width: 100%;
  text-align: center;
}

.room-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 12px;
  margin-top: 0;
}

.room-card-info {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid transparent;
}

.info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.info-label {
  font-size: 0.75rem;
  color: #6B7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.info-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1F2937;
}

.room-card-status {
  margin-bottom: 16px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  /* color eliminado para permitir color específico por estado */
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  display: inline-block;
}

.btn-reservar-ciudaris {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
  width: 100%;
}

.btn-reservar-ciudaris:hover {
  background: linear-gradient(135deg, #005a9e 0%, #003d82 100%);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.25);
  transform: translateY(-1px);
}

.btn-reservar-ciudaris:active {
  transform: translateY(0);
}

.btn-reservar-ciudaris:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1), 0 2px 8px rgba(0, 120, 212, 0.15);
}

/* Old rooms-row styles for backwards compatibility - now converted to grid */
.rooms-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.room-card {
  flex: 1 1 calc(25% - 15px);
  min-width: 260px;
  max-width: 320px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

/* Make the main sheet panel transparent so the background image is fully visible */
.sheet {
  background: rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 18px 50px rgba(8, 30, 45, 0.06) !important;
  backdrop-filter: blur(8px) saturate(120%) !important;
}

.room-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

/* Accent badge */
.room-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), rgba(16, 185, 129, 0.85));
  color: #1F2937;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.2);
}

/* Botón principal */
.btn-reservar {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-reservar:hover {
  background: linear-gradient(135deg, #005a9e 0%, #003d82 100%);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.25);
  transform: translateY(-1px);
  color: #FFFFFF;
  text-decoration: none;
}

.btn-reservar:active {
  transform: translateY(0);
}

/* Botón MS (login) */
.btn-ms {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fffbf6;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(139, 111, 71, 0.15);
  border: none;
  transition: var(--transition);
}

.btn-ms:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 111, 71, 0.25);
}

/* Sheet (caja principal) */
.sheet {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.995));
  padding: 40px 48px;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 90, 120, 0.06);
  max-width: 1400px;
  width: calc(100% - 64px);
  margin: 28px auto;
}

/* Botón MS (login) */
.btn-ms {
  background: linear-gradient(90deg, #0078d4, #005ea6);
  color: white;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 122, 212, 0.12);
  border: none;
}

/* Sheet (caja principal) */
.sheet {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.98));
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(8, 30, 45, 0.06);
}

/* Tabla de pendientes */
.pending-table thead th {
  background: #f6f7fb;
  border-bottom: 0;
  color: #334e63;
  font-weight: 600;
}

.pending-table tbody tr:hover {
  background: #fbfcfd;
}

.pending-table td {
  vertical-align: middle;
}

/* Animaciones de fade para filas: entrada y salida suave */
.pending-table tbody tr.fade-in {
  animation: pendingFadeIn 320ms ease forwards;
}

@keyframes pendingFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pending-table tbody tr.fade-out {
  opacity: 1;
  /* start from visible */
  transform: translateX(0);
  transition: opacity 320ms ease, transform 320ms ease;
  opacity: 0;
  transform: translateX(-12px);
}


/* Controls for pending modal */
.pending-controls {
  gap: 14px;
}

.pending-date {
  width: 150px;
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid #d7e6ea;
}

.pending-date:focus {
  outline: none;
  box-shadow: 0 6px 18px rgba(15, 77, 114, 0.06);
  border-color: var(--primary-dark);
}

/* Booking modal inline error */
#bookingError {
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f5c2c7;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* Toast */
#appToast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1100;
  min-width: 220px;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 8px 26px rgba(8, 30, 45, 0.12);
  background: #fff;
  display: none;
}

#appToast.success {
  border-left: 4px solid #198754;
}

#appToast.error {
  border-left: 4px solid #dc3545;
}

#appToast .toast-title {
  font-weight: 700;
  color: #214a59;
  margin-bottom: 6px;
}

#appToast .toast-body {
  color: #3d5258;
  font-size: 0.95rem;
}


/* Siempre una sola fila de tarjetas, incluso en móvil */
.rooms-grid {
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .rooms-grid {
    flex-wrap: wrap;
  }
}

/* ========== Estilos para Autocompletado de Participantes ========== */

#participantsSuggestions {
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

/* Time dropdowns (start/end) - appear attached to the input and animate from top */
.time-dropdown {
  display: none;
  top: 100%;
  left: 0;
  margin-top: 0;
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 0.375rem 0.375rem;
  transform-origin: top center;
  transform: scaleY(0);
  opacity: 0;
  transition: transform 120ms cubic-bezier(.2, .8, .2, 1), opacity 120ms linear;
}

.time-dropdown.open {
  display: block;
  transform: scaleY(1);
  opacity: 1;
}

#participantsSuggestions .list-group-item {
  cursor: pointer;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  padding: 8px 12px;
  background: #ffffff;
  transition: background-color 0.12s ease;
  font-size: 13px;
  line-height: 1.2;
}

#participantsSuggestions .list-group-item:hover {
  background-color: #f8f9fa;
  color: #0078d4;
}

#participantsSuggestions .list-group-item:last-child {
  border-bottom: none;
}

#participantsSuggestions .list-group-item:first-child {
  border-radius: 0;
}

#participantsListContainer {
  background-color: #f8f9fa;
  border-color: #dee2e6 !important;
  min-height: 80px;
  display: flex;
  align-items: center;
}

#participantsList {
  width: 100%;
}

.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
  border-radius: 0.375rem;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
}

.badge .btn-close {
  opacity: 0.8;
  transition: opacity 0.15s ease;
  margin-left: 6px;
}

.badge .btn-close:hover {
  opacity: 1;
}

#participantsInput {
  border-radius: 0.375rem 0.375rem 0 0 !important;
}

#participantsInput:focus {
  border-color: #0078d4 !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 120, 212, 0.25) !important;
}

/* ===== MEDIA QUERIES & RESPONSIVE DESIGN ===== */

/* Tablet landscape (1024px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .sheet {
    max-width: calc(100% - 32px);
    padding: 28px;
    margin: 28px 16px;
  }

  .rooms-row {
    gap: 16px;
  }

  .room-card {
    flex: 1 1 calc(50% - 8px);
  }

  .room-card img {
    max-height: 280px;
  }

  .btn-reservar {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .modal-dialog.modal-lg {
    max-width: 90vw;
  }

  .modal-body {
    padding: 20px;
  }

  .time-slot {
    flex: 0 0 calc(33% - 4px);
    min-height: 42px;
    font-size: 0.95rem;
  }

  .form-control,
  .form-select {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .pending-table {
    font-size: 0.92rem;
  }

  .pending-table thead th {
    padding: 12px 8px;
    font-size: 0.88rem;
  }

  .pending-table tbody td {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
}

/* Tablet portrait (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  body {
    padding-top: 72px !important;
  }

  .top-header {
    min-height: 72px;
  }

  .top-header h1 {
    font-size: 18px;
  }

  .top-right {
    top: 14px;
    right: 14px;
  }

  .sheet {
    max-width: 100%;
    padding: 20px;
    margin: 16px 12px;
    border-radius: 16px;
  }

  .rooms-row {
    gap: 12px;
    flex-direction: column;
  }

  .room-card {
    flex: 1 1 100%;
  }

  .room-card img {
    max-height: 220px;
  }

  .room-title {
    font-size: 1.08rem;
    margin-bottom: 8px;
  }

  .btn-reservar {
    padding: 12px 14px;
    font-size: 0.96rem;
    width: 100%;
  }

  .modal-dialog {
    margin: 12px;
  }

  .modal-lg {
    max-width: calc(100vw - 24px);
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header .modal-title {
    font-size: 1rem;
  }

  .row.g-3 {
    gap: 0.75rem !important;
  }

  .col-md-6,
  .col-md-3 {
    max-width: 100%;
  }

  .form-label {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .form-control,
  .form-select {
    font-size: 16px;
    padding: 10px 12px;
    height: auto;
    min-height: 44px;
  }

  .time-slot {
    flex: 0 0 calc(50% - 3px);
    min-height: 40px;
    font-size: 0.9rem;
  }

  .pending-table {
    font-size: 0.9rem;
  }

  .pending-table thead th {
    padding: 10px 6px;
    font-size: 0.82rem;
  }

  .pending-table tbody td {
    padding: 8px 6px;
    font-size: 0.88rem;
  }

  .card-login {
    max-width: 90vw;
  }
}

/* Small phones (< 576px) */
@media (max-width: 575px) {
  * {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
  }

  body {
    padding-top: 68px !important;
    font-size: 14px;
  }

  /* Header optimization */
  .top-header {
    position: fixed;
    min-height: 68px;
  }

  .top-header h1 {
    font-size: 16px;
    letter-spacing: 0;
  }

  .top-header .container {
    padding: 0 12px;
    min-height: 68px;
  }

  .top-header .header-logo {
    height: 48px;
    margin-left: 12px;
  }

  .top-right {
    top: 16px;
    right: 16px;
    font-size: 0.9rem;
    gap: 8px;
    flex-wrap: wrap;
  }

  .top-right .btn {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
  }

  /* Main content */
  .sheet {
    max-width: 100%;
    padding: 16px;
    margin: 12px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1);
  }

  .rooms-row {
    flex-direction: column;
    gap: 10px;
  }

  .room-card {
    flex: 1 1 100%;
  }

  .room-card img {
    max-height: 180px;
    display: block;
    width: 100%;
  }

  .room-title {
    font-size: 1rem;
    margin-bottom: 6px;
    font-weight: 700;
  }

  .room-capacity {
    font-size: 0.85rem;
  }

  .btn-reservar {
    padding: 11px 12px;
    font-size: 0.93rem;
    width: 100%;
    border-radius: 10px;
    min-height: 44px;
  }

  /* Login card */
  .card-login {
    width: 100% !important;
    padding: 18px !important;
    border-radius: 14px;
    margin-top: 50px !important;
    max-width: 500px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .login-logo-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    margin-bottom: 12px;
  }

  .login-desc {
    font-size: 0.95rem;
    margin-bottom: 14px;
  }

  .btn-ms {
    padding: 12px;
    font-size: 0.95rem;
    border-radius: 10px;
    min-height: 44px;
  }

  .login-note {
    font-size: 0.9rem;
    margin-top: 12px;
  }

  /* Modal optimization */
  .modal-dialog {
    margin: 10px;
  }

  .modal-lg {
    max-width: calc(100vw - 20px);
  }

  .modal-content {
    border-radius: 14px;
  }

  .modal-header {
    padding: 14px;
  }

  .modal-header h5 {
    font-size: 1rem;
  }

  .modal-header .modal-title {
    font-size: 0.95rem;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-footer {
    padding: 12px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .btn-close {
    padding: 0.25rem;
  }

  /* Form elements */
  .form-label {
    font-size: 0.93rem;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .form-control,
  .form-control-lg,
  .form-select {
    font-size: 16px;
    padding: 10px 12px;
    height: auto;
    min-height: 44px;
    border-radius: 10px;
  }

  .form-control:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }

  .form-control:focus,
  .form-select:focus {
    border-color: var(--brand-1);
  }

  .row.g-3 {
    gap: 0.6rem !important;
    margin-bottom: 0;
  }

  .col-md-6,
  .col-md-3 {
    max-width: 100%;
  }

  .position-relative {
    width: 100%;
  }

  .time-dropdown {
    width: 100% !important;
    max-height: 140px;
    overflow-y: auto;
  }

  /* Dropdowns and suggestions */
  .list-group-item {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .list-group {
    border-radius: 8px;
  }

  /* Time slots */
  .time-slot {
    flex: 0 0 calc(50% - 3px);
    min-height: 38px;
    font-size: 0.88rem;
    padding: 6px 4px;
  }

  .time-slot:hover {
    transform: scale(1.02);
  }

  .time-option.disabled-time {
    opacity: 0.4;
  }

  /* Tables */
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    font-size: 0.85rem;
    margin-bottom: 0;
  }

  .pending-table {
    font-size: 0.85rem;
  }

  .pending-table thead th {
    padding: 8px 4px;
    font-size: 0.8rem;
    font-weight: 700;
  }

  .pending-table tbody td {
    padding: 6px 4px;
    font-size: 0.85rem;
  }

  .pending-controls {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start !important;
    margin-bottom: 12px;
  }

  .pending-controls>div {
    width: 100%;
  }

  .pending-date {
    width: 100% !important;
  }

  /* Badges and status - improved colors and no underline */
  .badge {
    padding: 4px 8px;
    font-size: 0.75rem;
    max-width: 100%;
    word-break: break-word;
  }

  /* Generic status badge used across tables/cards */
  .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    text-decoration: none !important;
    -webkit-text-decoration: none !important;
    border: 1px solid transparent;
    white-space: nowrap;
  }

  .status-badge:hover {
    text-decoration: none !important;
    cursor: default;
  }

  /* Pending (neutral/info) */
  .status-pending {
    background: rgba(16, 185, 129, 0.08);
    /* soft green, igual que finalized */
    color: #f59e42;
    /* naranja */
    border-color: rgba(16, 185, 129, 0.16);
  }

  /* In-progress / attention */
  .status-inprogress {
    background: rgba(16, 185, 129, 0.08);
    /* soft green, igual que finalized */
    color: #DC2626;
    /* rojo */
    border-color: rgba(16, 185, 129, 0.16);
  }

  /* Finalized / success */
  .status-finalized {
    background: rgba(16, 185, 129, 0.08);
    /* soft green */
    color: #059669;
    /* green-600 */
    border-color: rgba(16, 185, 129, 0.16);
  }

  /* Ensure any links inside status badges don't show underlines */
  .status-badge a {
    text-decoration: none !important;
    color: inherit;
  }


  #participantsList {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Checkboxes and toggles */
  .form-check {
    margin-bottom: 12px;
  }

  .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0.3em;
    cursor: pointer;
  }

  .form-check-label {
    margin-left: 6px;
    font-size: 0.95rem;
    cursor: pointer;
  }

  /* Alerts */
  .alert {
    padding: 10px 12px;
    font-size: 0.9rem;
    border-radius: 10px;
    margin-bottom: 12px;
  }

  .alert i {
    margin-right: 8px;
  }

  /* Animation optimization for mobile */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* Utility classes */
  .gap-4 {
    gap: 10px !important;
  }

  .mb-3 {
    margin-bottom: 12px !important;
  }

  .mt-3 {
    margin-top: 12px !important;
  }

  .p-3 {
    padding: 12px !important;
  }

  .px-4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .py-3 {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
}

/* Background para móviles */
@media (max-width: 768px) {
  body {
    background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), url('img/MONET_MOVIL.jpg') center/cover fixed no-repeat !important;
  }
}