/* Asegura que el color se aplique al texto del encabezado */
table#datatable-buttons.dataTable > thead > tr > th {
  background-color: #737373 !important;
  color: #fff !important;
}

/* Bordes suaves */
#datatable-buttons {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Celdas */
#datatable-buttons td {
  vertical-align: middle;
  font-size: 14px;
  color: #333;
}

#datatable-buttons tbody {
  background-color: #f1f1f1;
}

/* Estilo para la primera columna */
#datatable-buttons tbody td:first-child {
  text-align: center;
  font-weight: bold;
  background-color: #eef4fa;
  color: #1a524f;
}

/* Botones de DataTables */
.dt-buttons .btn {
  border-radius: 8px;
  padding: 6px 12px;
  background-color: #265f97;
  color: white;
  border: none;
  font-size: 13px;
}
.custom-offcanvas {
  background-color: #4d4d4d;
  width: 500px !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
}

@media (max-width: 768px) {
  .custom-offcanvas {
    width: 100% !important;
    padding: 10px;
  }
}

.offcanvas-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.offcanvas-logo {
  height: 100px;
}

.offcanvas-title {
  color: #fff;
  font-weight: 700;
}

.offcanvas-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#offcanvasContent {
  width: 100%;
  margin-bottom: 20px;
}

/*lista archivos*/
.botones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 15px;
}

.subirArchivo {
  padding: 5px 0;
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btnSubirArchivo {
  width: 100%;
  padding: 10px;
  border: 2px solid #a3dc65;
  border-radius: 10px;
  background-color: #a3dc65;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.listaExpediente {
  background-color: #737373;
  border-radius: 10px;
  width: 100%;
  list-style: none;
  padding: 20px;
  margin: 0 auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.listaExpediente li {
  padding: 5px;
  font-size: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 2px dotted rgba(0, 0, 0, 0.7);
  position: relative;
}

.listaExpediente li span {
  width: 50%;
  padding: 10px;
}

.listaExpediente li .fa-trash {
  position: absolute;
  top: 50%;
  right: 20px;
  font-size: 1.5rem;
  color: #ececec;
  opacity: 0.5;
  transform: translateY(-50%);
  pointer-events: none;
}

.listaExpediente li .fa-trash.habilitado {
  color: #b71c1c;
  cursor: pointer;
  opacity: 1;
}

.listaExpediente li .fa-file-pdf {
  position: absolute;
  top: 50%;
  right: 50px;
  font-size: 1.5rem;
  color: #ececec;
  opacity: 0.5;
  transform: translateY(-50%);
  pointer-events: none;
}

.listaExpediente li .fa-file-pdf.habilitado {
  color: #a3dc65;
  cursor: pointer;
  opacity: 1;
}

.listaExpediente li .fa-check {
  color: #a3dc65;
  font-size: 1.2rem;
}

.listaExpediente li .btnSeleccionarArchivo {
  font-size: 1.2rem;
  color: #75b432;
  border-radius: 50%;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  right: 85px;
  padding: 5px;
  width: 35px;
  transform: translateY(-50%);
}

.listaExpediente li .btnSeleccionarArchivo:hover {
  color: #ccc;
  cursor: pointer;
}

.listaExpediente li .btnSeleccionarArchivo .inputOculto {
  display: none;
}

@media (max-width: 768px) {
  .listaExpediente {
    padding: 10px;
  }

  .listaExpediente li span {
    font-size: 0.9rem;
  }
}

.visualizarPdf {
  display: none;
}

.visualizarPdf.ver {
  border-radius: 15px;
  background-color: rgb(50, 50, 50);
  width: 50%;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
}

.visualizarPdf #cerrarPdf {
  position: absolute;
  top: 15px;
  left: 15px;
  color: #fff;
  font-size: 2rem;
  border-radius: 50%;
}

.visualizarPdf #cerrarPdf:hover {
  color: #ccc;
  cursor: pointer;
}

.visualizarPdf iframe {
  background: white;
  max-width: 100%;
  max-height: 100%;
  border-radius: 5px;
  margin: 0 auto;
}

/* Fondo semitransparente que cubre toda la pantalla */
.overlayPdf {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  /* Transparencia del fondo */
  display: none;
  /* Oculto por defecto */
  justify-content: center;
  align-items: center;
  z-index: 9998;
}

/* Contenedor del visualizador */
.visualizarPdf {
  position: relative;
  background-color: rgb(50, 50, 50);
  width: 70%;
  height: 90%;
  border-radius: 15px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
  z-index: 9999;
}

/* Botón de cerrar (tache) */
.btn-cerrar {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

.btn-cerrar:hover {
  color: red;
}

/* PDF ocupa todo el contenedor */
.visualizarPdf iframe {
  flex: 1;
  width: 100%;
  border-radius: 10px;
}

/* Modo visible del overlay */
.overlayPdf.ver {
  display: flex;
}

/* Lista del expediente (sobre fondo oscuro) */
.expediente-list-group .list-group-item {
  border-color: rgba(255, 255, 255, 0.12);
  padding: 0.75rem 0.75rem;
}

.expediente-list-group .list-group-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Icono del archivo */
.expediente-file-icon {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  color: #fff;
}

/* Evita saltos por textos largos */
.min-w-0 {
  min-width: 0;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listaExpediente li.resaltado {
  background-color: rgba(46, 125, 50, 0.15);
  /* verde suave */
  border: 1px solid #4caf50;
  border-radius: 6px;
}

/* Select personalizado */
.custom-select-expediente {
  background-color: #f1f1f1;
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 10px 25px;
  font-size: 15px;
  font-weight: 500;
  color: #2e7d32;
  outline: none;
  transition: all 0.3s ease;
  margin: 10px 0 15px;
}

.custom-select-expediente:hover {
  border-color: #2e7d32;
  background-color: #e9f5ee;
  cursor: pointer;
}

.custom-select-expediente:focus {
  border-color: #1a524f;
  box-shadow: 0 0 6px rgba(46, 125, 50, 0.4);
}

/* Resaltado de nuevo li */
.listaExpediente li.resaltado {
  background-color: rgba(76, 175, 80, 0.15);
  border: 1px solid #4caf50;
  border-radius: 6px;
  transition: background-color 0.5s ease;
}

.listaExpediente {
  display: none;
  /* Oculta al inicio */
  transition: all 0.4s ease;
}

:root {
  --modal-base: #737373;
  /* color base solicitado */
  --modal-base-900: #5e5e5e;
  --modal-base-800: #6a6a6a;
  --modal-accent: #d1f7e6;
  --modern-border: rgba(255, 255, 255, 0.12);
  --modern-hr: rgba(255, 255, 255, 0.16);
}

/* Estructura a pantalla completa con body que crece */
.modal-modern .modal-dialog.modal-fullscreen {
  height: 100%;
}

.modal-modern .modal-content {
  display: flex;
  /* clave: permite que el body crezca */
  flex-direction: column;
  height: 100%;
  background: linear-gradient(145deg, var(--modal-base), var(--modal-base-900));
  color: #fff;
  border: 1px solid var(--modern-border);
  border-radius: 20px;
}

@media (min-width: 992px) {
  .modal-modern .modal-content {
    border-radius: 24px;
  }
}

.modern-header {
  flex: 0 0 auto;
  /* no crece */
  background: #4caf50;
  border-bottom: 1px solid var(--modern-border);
  padding: 14px 18px;
}

.modern-header__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--modern-border);
  font-size: 18px;
  color: #fff;
}

.modern-body {
  flex: 1 1 auto;
  /* clave: ocupa el espacio disponible */
  display: flex;
  /* permite que el container h-100 funcione */
  flex-direction: column;
  min-height: 0;
  /* necesario para que el overflow funcione */
  padding: 18px;
 
  overflow: hidden;
  /* evita scroll doble; dentro usamos tarjetas con overflow si hace falta */
}

/* Hace que el grid interno use todo el alto */
.modern-body .container-fluid,
.modern-body .row {
  height: 100%;
}

.modern-footer {
  flex: 0 0 auto;
  /* no crece */
  position: sticky;
  bottom: 0;
  z-index: 2;

  border-top: 1px solid var(--modern-border);
  padding: 12px 18px;
  backdrop-filter: blur(4px);
}

/* Tarjetas que llenan la altura de cada columna */
.modern-card {
  background: #4d4d4d;
  border: 1px solid var(--modern-border);
  border-radius: 16px;
  min-height: 0;
  /* permite que el contenido interno haga scroll si se desborda */
  overflow: auto;
  /* si luego agregas contenido largo, aquí scrollea */
  margin-bottom: 10px;
}

.modern-btn-primary {
  background: linear-gradient(180deg, #34c38f, #2ea97c);
  color: #0a2f22;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.55rem 1rem;
}

.modern-btn-primary:hover {
  filter: brightness(1.05);
}

.modern-btn-light {
  background: rgba(255, 255, 255, 0.9);
  color: #1b1b1b;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.modern-btn-light:hover {
  filter: brightness(0.97);
}

/* Backdrop más sutil */
.modal-backdrop.show {
  opacity: 0.55;
}

/* —— Estilos “modern-formal” para sector hospital —— */
.bg-hospital {
  /* Color principal (tu #e7607b) con un degradado sutil y formal */
  background: linear-gradient(180deg, #e7607b 0%, #d65771 100%);
}

.table-modern thead th {
  border: 0 !important;
  /* limpia bordes del thead */
  vertical-align: middle;
}

.table-modern tbody tr {
  border-color: rgba(0, 0, 0, 0.05);
  /* líneas suaves entre filas */
}

.table-modern tbody tr:hover {
  background-color: rgba(231, 96, 123, 0.06);
  /* hover sutil en tono de marca */
}

/* Celdas compactas pero legibles */
.table-modern td,
.table-modern th {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* Alineación del encabezado/acciones consistente */
.table-modern th:last-child,
.table-modern td:last-child {
  text-align: right;
  white-space: nowrap;
}

/* Soporte para modo oscuro si lo usas */
@media (prefers-color-scheme: dark) {
  .table-modern tbody tr {
    border-color: rgba(255, 255, 255, 0.08);
  }

  .table-modern tbody tr:hover {
    background-color: rgba(231, 96, 123, 0.12);
  }
}

/* Llenar alto, permitir scroll interno */
.modal-body-fill {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#consulta-content {
  flex: 1 1 auto;
}

/* Botón cerrar flotante (porque quitamos el header) */
.btn-close-fab {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Compactar controles sin perder legibilidad */
.g-ctl-sm {
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
  min-height: 2.25rem;
  /* ~36px */
  font-size: 0.9rem;
}

/* Variante compacta para floating labels */
.form-floating-sm > .form-control,
.form-floating-sm > .form-select {
  height: calc(2.5rem + 2px);
  min-height: calc(2.5rem + 2px);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.25;
}

.form-floating-sm > label {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  height: auto;
  /* evita que el label “estire” el contenedor */
  pointer-events: none;
}

/* Estado flotado del label (cuando hay valor o focus) */
.form-floating-sm > .form-control:focus ~ label,
.form-floating-sm > .form-control:not(:placeholder-shown) ~ label,
.form-floating-sm > .form-select:focus ~ label,
.form-floating-sm > .form-select:not([value=""]) ~ label {
  transform: scale(0.85) translateY(-0.55rem) translateX(0.15rem);
  opacity: 0.75;
}

/* Textareas en floating: define altura y paddings */
.form-floating-sm textarea.form-control {
  min-height: 5.25rem;
  /* ~84px */
  height: 5.25rem;
  padding-top: 1.1rem;
  /* deja aire para el label dentro */
  padding-bottom: 0.6rem;
}

/* Opcional: separación más compacta entre campos */
#consulta-form .row.g-2 > [class^="col-"],
#consulta-form .row.g-2 > [class*=" col-"] {
  margin-bottom: 0.15rem;
}

/* Estética moderna existente (si ya la tienes, no dupliques) */
.modern-modal {
  background: #fff;
}

.gcard {
  background: #fff;
  border: 1px solid #eceff3;
}

.gcard-header {
  padding: 1rem 1rem 0.5rem;
}

.gcard-body {
  padding: 0.75rem 1rem 1rem;
}

.gavatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f6f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #5f6368;
}

.gtitle {
  font-size: 1.05rem;
  font-weight: 600;
}

.gsubtitle {
  color: #6b7280;
}

.gsection-label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6368;
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: #4caf50;
}

.ginfo-list {
  display: grid;
  gap: 0.45rem;
}

.ginfo-item {
  padding: 0.55rem 0.65rem;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: #f1f1f1;
}

.ginfo-label {
  font-size: 0.75rem;
  color: #1a524f;
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.ginfo-value {
  font-size: 0.93rem;
  color: #1f2937;
}

.logo-img {
  height: clamp(28px, 4vw, 48px);
  /* tamaño tipo logo y responsivo */
  width: auto;
  /* mantiene proporción */
  max-width: 100%;
  /* no se desborda del contenedor */
  object-fit: contain;
  /* por si el contenedor fuerza tamaños */
  image-rendering: auto;
  /* se ve nítido en la mayoría de pantallas */
  display: inline-block;
}

/* ===== Material-ish tokens (Google style) ===== */
:root {
  --md-primary: #1a73e8;
  /* Google Blue */
  --md-outline: #dadce0;
  /* Borde gris */
  --md-outline-strong: #c7c9cc;
  /* Hover */
  --md-surface: #ffffff;
  --md-text: #202124;
  /* On surface */
  --md-muted: #5f6368;
  /* Labels/ayuda */
  --md-focus-ring: rgba(26, 115, 232, 0.18);
}

/* ===== Card ligera tipo Google ===== */
.gcard {
  background: linear-gradient(180deg, #fff, #fbfbfc);
  box-shadow: 0 6px 16px rgba(60, 64, 67, 0.08) !important;
}

/* ===== Campo "outlined" con label-chip ===== */
.gmd-select {
  position: relative;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

.gmd-control {
  color: var(--md-text);
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: 0.5rem;
  padding: 0.7rem 0.95rem;
  height: calc(2.75rem + 2px);
  line-height: 1.2;
  box-shadow: none;
  appearance: none;
  /* mantiene un aspecto limpio; el ícono nativo sigue */
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
  text-transform: uppercase;
}

/* Hover */
.gmd-control:hover {
  border-color: var(--md-outline-strong);
  background-color: #fcfdff;
}

/* Focus visible */
.gmd-select:focus-within .gmd-control {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 0.25rem var(--md-focus-ring);
  outline: 0;
}

/* Label tipo "chip" que cruza el borde */
.gmd-label {
  position: absolute;
  top: -0.6rem;
  left: 0.85rem;
  padding: 0 0.35rem;
  background: #4caf50;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #fff;
  pointer-events: none;
  border-radius: 5px;
}

/* Realce de label en focus */
.gmd-select:focus-within .gmd-label {
  color: var(--md-primary);
}

/* Texto de ayuda */
.gmd-support {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--md-muted);
}

/* Estados */
.gmd-control:disabled {
  background-color: #f5f6f7;
  color: #9aa0a6;
  border-color: var(--md-outline);
  cursor: not-allowed;
}

/* Afinado responsive */
@media (max-width: 576px) {
  .gmd-control {
    height: calc(2.5rem + 2px);
    padding: 0.55rem 0.8rem;
  }

  .gmd-label {
    top: -0.55rem;
    left: 0.75rem;
  }
}

.calendario-wrapper {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 0.5rem;
}

@media (max-width: 992px) {
  .calendario-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 576px) {
  .calendario-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cal-dia {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.8rem;
  padding: 0.85rem;
  text-align: center;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.cal-dia:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.cal-dia.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f4f5f6;
}

.cal-dia .titulo {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cal-dia .badge-count {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(26, 82, 79, 0.1);
  /* #1a524f con opacidad */
  color: #1a524f;
}

/* Contenedor: grid con encabezado arriba y slots abajo */
#horariosDisponibles {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0.9rem;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.25rem;
  box-sizing: border-box;
}

/* El título (primer hijo que tu JS agrega) va a todo el ancho */
#horariosDisponibles > .mb-2 {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  /* el gap del grid ya separa */
  padding: 0.6rem 0.8rem;
  border-radius: 0.9rem;
  background: #314559;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  color: #e5e7eb;
  cursor: default;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

#horariosDisponibles > .mb-2::before {
  content: "🕒";
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.9;
}

/* Botones de horario */
.h-slot {
  border: 1px solid #314559;
  border-radius: 0.85rem;
  padding: 0.85rem 0.95rem;
  background: #314559;
  font-weight: 700;
  font-size: 0.96rem;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease,
    border-color 0.12s ease;
  cursor: pointer;
  user-select: none;
}

.h-slot:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  background: #fbfeff;
}

.h-slot:focus-visible {
  outline: 3px solid rgba(26, 82, 79, 0.35);
  outline-offset: 2px;
}

/* Responsivo: conserva tu comportamiento original */
@media (max-width: 992px) {
  #horariosDisponibles {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 576px) {
  #horariosDisponibles {
    grid-template-columns: repeat(2, 1fr);
  }

  .h-slot {
    padding: 0.75rem 0.85rem;
    font-size: 0.93rem;
  }
}

/* Dark mode opcional */
@media (prefers-color-scheme: dark) {
  #horariosDisponibles > .mb-2 {
    background: #314559;
    color: #e5e7eb;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  }

  .h-slot {
    background: #314559;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  }

  .h-slot:hover {
    background: #314559;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  }

  .h-slot.sel {
    background: #4caf50;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
  }
}

/* ======= Cabecera / Logo ======= */
.brand-logo {
  max-height: 48px;
  width: auto;
}

/* ======= Formulario de filtros (sustituye el inline style original) ======= */
.agenda-form {
  background: #f1f1f1;
  border-radius: 10px;
  color: white;
  /* (igual que tenías) */
  margin-top: 5px;
  padding: 5px;
  padding-bottom: 15px;
}

/* Opcional: mejora contraste de labels si usas texto blanco */
.agenda-form .gmd-label,
.agenda-form .gmd-support {
  color: #fff;
  /* Si prefieres bajo contraste sobre gris */
}

/* ======= Calendario semanal simple (si usas el contenedor plano) ======= */
.calendario-wrapper {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 0.5rem;
}

@media (max-width: 992px) {
  .calendario-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 576px) {
  .calendario-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Slots (botones de hora) */
.h-slot {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  text-align: center;
  background: #e7607b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

/* ======= Estilos del calendario mensual (si usas el render mensual por JS) ======= */
.cal-month-wrapper {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #4d4d4d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 0.75rem;
}

.cal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.75rem;
}

.cal-bar .cal-title {
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: capitalize;
}

.cal-nav-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.cal-nav-btn:hover {
  background: #f6f7f8;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 0.25rem;
  color: #fff;
  font-size: 0.8rem;
  margin: 0 0.25rem 0.25rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.cal-cell {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0.5rem;
  min-height: 70px;
  position: relative;
}

.cal-cell .num {
  font-weight: 700;
  font-size: 0.9rem;
}

.cal-cell.other {
  background: #fafafa;
  color: #9ca3af;
}

.cal-cell.blocked {
  opacity: 0.6;
}

.cal-cell.enabled {
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

.cal-cell.enabled:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  background: #f9fbfb;
}

.cal-cell.enabled.selected {
  outline: #4caf50;
  background: #4caf50;
  color: white;
}

/* El host del calendario y de horarios ocupan todo el ancho del card */
#calendarioDisponibilidades {
  display: block;
  width: 100%;
  max-width: 100%;
  clear: both;
  /* por si hay floats previos */
}

/* Separación natural debajo del formulario */
#calendarioDisponibilidades {
  margin-top: 0.75rem;
}

/* Asegura que el calendario se adapte al contenedor */
.cal-month-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  /* evita que la grid se “salga” */
}

/* Grid de días sin desbordes */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  /* evita overflow al reducir */
  gap: 0.25rem;
}

/* Ajustes responsivos por si tu card es angosto */
@media (max-width: 576px) {
  .cal-cell {
    min-height: 56px;
    padding: 0.4rem;
  }

  .cal-cell .num {
    font-size: 0.85rem;
  }
}

.cita-header-badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cita-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.cita-card + .cita-card {
  margin-top: 0.75rem;
}

.cita-kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.25rem 0.75rem;
  color: #fff;
}

@media (max-width: 576px) {
  .cita-kv {
    grid-template-columns: 1fr;
  }
}

.cita-card {
  background-color: #4d4d4d;
}
