/* ============================================================
   ESTILO MINIMALISTA PREMIUM RESPONSIVE
============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #f7f8fa;
    font-family: 'Inter', 'Segoe UI', Tahoma, sans-serif;
    color: #333;
    overflow-x: hidden;
}

/* CABECERA */
header {
    background: #ffffff;
    padding: 25px 0;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
}

/*BANNER DE PRUEBA 7 DIAS */

.trial-banner {
    background: #ffcc00;
    color: #000;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
}


/* LAYOUT */
.admin-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 25px;
    width: 100%;
    max-width: 1600px;
    margin: 30px auto;
    padding: 0 20px;
    overflow-x: hidden;
    justify-content: center;
    align-items: stretch;
}

.panel-izquierdo,
.panel-derecho {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
}


/* ================================
   PANEL CENTRAL
================================= */
.panel-central {
    background: #ffffff;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column; /* Asegura que los elementos se apilen en columna */
    align-items: stretch;     /* antes: center */
    justify-content: flex-start; /* antes: center */
    box-sizing: border-box; /* Para tener en cuenta los paddings */
	position: relative;
	min-height: 400px; /* ajusta según tu diseño */
	height: auto; /* 🔥 Esto es lo que faltaba */
}

/* CONTROLES — DISEÑO PREMIUM Y SIEMPRE ALINEADO */
.controles-wrapper {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra los controles */
    justify-content: center;
    width: 100%; /* Ocupa todo el ancho disponible */
}

.controles-texto {
    font-size: 1.1rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 14px;
    position: relative;
    display: inline-block;
    padding: 0 12px;
	box-sizing: border-box;
    word-wrap: break-word;
}

/* Líneas de separación */
.controles-texto::before,
.controles-texto::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background: #d1d5db;
}

.controles-texto::before { left: -70px; }
.controles-texto::after { right: -70px; }

/* CONTROLES */
.controles {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;   /* Siempre en línea */
    width: 100%;         /* Se ajusta al ancho del wrapper */
    box-sizing: border-box;
}

/* 🔥 CADA CONTROL */
.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   PANEL DE MESAS — INPUTS Y SELECTS (ESTILO MODAL)
============================================================ */

/* Quitamos el appearance:none global que mataba el input date */
.controles input,
.controles select {
    appearance: auto;
    -webkit-appearance: auto;
}

.sin-recursos {
    grid-column: 1 / -1; /* Ocupa todas las columnas del grid */
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    color: #555;
    padding: 20px 0;
}


@keyframes fadeIn {
    to { opacity: 1; }
}

/* ============================================================
   INPUT FECHA — ESTILO PREMIUM + ICONO NATIVO
============================================================ */

#fecha {
    width: 160px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    background: #fafafa;
    padding: 0 14px;

    /* MISMO TEXTO QUE EL MODAL */
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #3f3f3f;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    text-align: left;
    text-align-last: left;

    cursor: pointer;
}

/* Icono nativo visible en escritorio */
#fecha::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
}


/* ============================================================
   INPUT HORA — IGUAL QUE EL MODAL
============================================================ */

#hora {
    width: 160px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    background: #fafafa;
    padding: 0 14px;
    padding-right: 26px;

    /* MISMO TEXTO QUE EL MODAL */
    font-family: "Inter", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #3f3f3f;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'>\
<path d='M7 10l5 5 5-5'/>\
</svg>");
    background-repeat: no-repeat;
    background-size: 18px;
    background-position: right 8px center;

    cursor: pointer;
}

/* ============================================================
   TEXTO UNIFICADO PARA FECHA Y HORA (MISMO QUE MODAL)
============================================================ */

#fecha,
#hora,
#fecha::-webkit-datetime-edit,
#fecha::-webkit-datetime-edit-fields-wrapper,
#fecha::-webkit-datetime-edit-text,
#fecha::-webkit-datetime-edit-month-field,
#fecha::-webkit-datetime-edit-day-field,
#fecha::-webkit-datetime-edit-year-field {
    font-family: "Inter", sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    color: #3f3f3f;
    line-height: 40px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   ELIMINAMOS EL BLOQUE QUE ROMPÍA EL ESTILO
============================================================ */

/* Este bloque se elimina porque sobrescribía todo:
#fecha,
#hora {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    font-weight: 700; 
    color: #666;
}
*/


/* ESTADO RECURSOS */
.estado-recursos {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #374151;
}

.estado-recursos span {
    padding: 6px 12px;
    border-radius: 8px;
    margin: 0 6px;
}

.estado-recursos .libres {
    background: #d1fae5;
    color: #065f46;
}

.estado-recursos .ocupadas {
    background: #fee2e2;
    color: #991b1b;
}

/* RECURSOS */
#recursos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    justify-content: center;
    justify-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 8px;
}

/* Aseguramos que cada recurso sea cuadrado */
.recurso-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 120px;
}

.recurso {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    color: white;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recurso-tipo {
    text-align: center;
    width: 100%;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recurso:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.recurso .nombre {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  margin: 2px 8px;
  padding: 0px 8px;
  box-sizing: border-box;
}


/* 🟩 Recurso libre (las que ves en verde ahora) */
.recurso-libre {
    background-color: #4CAF50; /* verde */
    color: white;
    font-weight: bold;
}

/* 🔵 Recurso ocupado EXACTAMENTE a la hora seleccionada */
.recurso-ocupada-exacta {
    color: white;
    font-size: 4rem;
    font-weight: 600;
}

/* 🔴 Recurso ocupado por ARRASTRE */
.recurso-ocupada-arrastre {
    background-color: #d9534f; /* rojo */
    color: white;
    font-weight: bold;
    border: 2px solid #b52b27;
}

/* MENSAJE DE ADVERTENCIA RECURSO OCUPADO */
.recurso {
  position: relative;
}


/* ICONO Y TOOLTIP */
.warning-icon {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ffcc00;
  color: #000;
  font-size: 14px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 50%;
  border: 2px solid #000;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
  cursor: default;
  z-index: 100;
}

/* 🟦 TOOLTIP FLOTANTE */
.floating-tooltip {
  position: absolute;
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  max-width: 220px;
  white-space: normal;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  z-index: 9999;
}

.floating-tooltip::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

/* HOVER CARD - Mostrar el tooltip cuando el icono es hover */
.warning-icon:hover .floating-tooltip {
  display: block;
}


/* TIPOGRAFÍA BASE (ESCRITORIO) */
.recurso .recurso-nombre {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.recurso .capacidad,
.recurso .estado {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.recurso .reservaId,
.recurso .nombre,
.recurso .telefono,
.recurso .personas {
    font-size: 0.85rem;
    margin: 2px 0;
}







/* ================================
   PANEL IZQUIERDO
================================= */


.panel-izquierdo h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: #1f2937;
}

.contador-reservas {
    text-align: center;
    font-size: 1rem;
    color: #374151;
    margin-bottom: 26px; /*modficado 14/01/20206 15:22*/
    font-weight: 500;
    padding: 12px 0;
}

#listaReservas {
    /*height: 65vh;*/
    max-height: 65vh;
    overflow-y: auto;
}

#listaReservas {
    margin-top: 20px;
}

/* Tarjetas de reservas y resultados (unificadas) */
.reserva-item,
.resultado-item {
    background: #f9fafb;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 14px;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #374151;
    transition: transform 0.15s ease, background 0.2s ease;
}

.reserva-item:hover,
.resultado-item:hover {
    transform: translateY(-2px);
    background: #f3f4f6;
}

.reserva-item .linea,
.resultado-item .linea {
    margin-bottom: 6px;
}

.reserva-item .linea:last-child,
.resultado-item .linea:last-child {
    margin-bottom: 0;
}

.reserva-item .linea.nombre,
.resultado-item .linea.nombre,
.reserva-item .linea.recursos,
.resultado-item .linea.recursos {
    font-weight: 600;
}


.reserva-item .linea span,
.resultado-item .linea span {
    display: inline-block;
}

/* Botones dentro de la tarjeta */
.reserva-item .botones {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.reserva-item .botones button {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.reserva-item .botones .btn-liberar {
    background: #ef4444;
    color: white;
}

.reserva-item .botones .btn-liberar:hover {
    background: #dc2626;
}

.reserva-item .botones .btn-modificar {
    background: #2563eb;
    color: white;
}

.reserva-item .botones .btn-modificar:hover {
    background: #1e40af;
}

/* Botón liberar */
.btn-liberar {
    background: #ef4444;
    color: white;
    padding: 8px;
    width: 48%;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-liberar:hover {
    background: #dc2626;
}

/* Botón modificar */
.btn-modificar {
    background-color: #3498db;
    color: white;
    padding: 8px;
    width: 48%;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-modificar:hover {
    background-color: #2980b9;
}


/* ================================
   PANEL DERECHO e IZQUIERDO
================================= */
.panel-izquierdo,
.panel-derecho {
    height: calc(75vh + 80px);
    overflow: hidden;
}


/* ================================
   PANEL DERECHO
================================= */
.panel-derecho {
    display: flex;
    flex-direction: column;
    align-items: center;   /* centra todo */
    text-align: center;
}


.panel-derecho input {
    width: 100%;
    max-width: 280px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    margin-bottom: 22px;
    font-size: 0.95rem;
}

.panel-derecho h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: #1f2937;
}

/* Alinear líneas del buscador */
.linea {
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    white-space: nowrap;
}

/* Evitar que el email se parta
.linea.email span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    display: inline-block;
}  */

.reserva-item .linea,
.resultado-item .linea {
    overflow: hidden;         /* Oculta el exceso de texto */
    text-overflow: ellipsis;  /* Muestra "..." al final */
    white-space: nowrap;      /* Evita que se haga wrap a la siguiente línea */
    max-width: 100%;          /* Se ajusta al ancho de su contenedor */
    display: block;           /* Para que text-overflow funcione correctamente */
}

/* Input */
#buscadorReservas {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* El contenedor del buscador sirve como referencia */
/* Centrar el buscador */
.buscador-wrapper {
    position: relative;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;

}

/* Panel de resultados flotante */
#resultadosBusqueda {
    position: absolute;
    top: 100%;        /* justo debajo del input */
    left: 0;
    width: 100%;
    height: 65vh;
    max-height: 65vh;
    overflow-y: auto;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 50;
    display: none;    /* oculto por defecto */
}

/* Cuando no hay resultados, no ocupa espacio */
#resultadosBusqueda:empty {
    display: none;
}



/***** Tarjeta para el bloque Calendario *****/
.calendario-envuelto {
    width: 100%;
    display: flex;
    justify-content: center;
}

.tarjeta-calendario {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 18px;
    width: 100%;
    max-width: 280px;
    margin-top: 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tarjeta-calendario h2 {
    margin-bottom: 15px;
}


/* Botón dentro de la tarjeta */
/* Estado normal (Abrir) */
#btnCalendario {
    width: 100%;
    max-width: 220px;
    padding: 12px;
    border-radius: 10px;
    background: #2563eb; /* azul */
    color: white;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

#btnCalendario:hover {
    background: #1e40af;
}

/* Estado "Salir" */
#btnCalendario.cerrar {
    background: #ffffff;      /* fondo blanco */
    color: #dc2626;           /* rojo */
    border: 2px solid #dc2626; /* borde rojo */
}

#btnCalendario.cerrar:hover {
    background: #ffe5e5;      /* blanco con toque rosado */
}




/***** Tarjeta Historial (misma estética que la de Calendario) *****/
.tarjeta-historial {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 18px;
    width: 100%;
    max-width: 280px;
    margin: 25px auto 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.tarjeta-historial h2 {
    margin-bottom: 15px;
}

/* Botón estilo azul (igual que Abrir Calendario) */
.enlace-historial {
    display: inline-block;
    width: 100%;
    max-width: 220px;
    padding: 12px;
    border-radius: 10px;
    background: #2563eb;
    color: white;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.enlace-historial:hover {
    background: #1e40af;
}



/* ============================================================
   MODAL MODIFICAR RESERVA
============================================================ */

.modal.oculto {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.25s ease;
}

.modal-contenido {
    background: #ffffff;
    width: 95%;
    max-width: 420px;
    padding: 28px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    animation: slideUp 0.25s ease;
}

.modal-contenido h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 18px;
    text-align: center;
}

/* ============================================================
   LABELS
============================================================ */

.modal-contenido label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    display: block;
}

/* ============================================================
   INPUTS GENERALES (100%)
============================================================ */

#formModificar input,
#formModificar select {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    font-size: clamp(14px, 4vw, 15px);
    background: #fafafa;
    margin-bottom: 14px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

/* ============================================================
   CONTENEDOR FECHA + HORA
============================================================ */

.modificar-controles {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}

.modificar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modificar-item input,
.modificar-item select {
    width: 100%;
    margin-bottom: 0;
}

/* ============================================================
   ESTILO FECHA Y HORA UNIFORME (MISMO TAMAÑO)
============================================================ */

#formModificar #mod-fecha,
#formModificar #mod-hora {
    height: 40px;
    border-radius: 12px;
    border: 1px solid #d2d2d7;
    font-size: clamp(14px, 4vw, 15px);
    font-weight: 500;
    color: #3f3f3f;
}

/* ============================================================
   TEXTO UNIFICADO PARA FECHA Y HORA
============================================================ */

#formModificar #mod-fecha,
#formModificar #mod-hora,
#formModificar #mod-fecha::-webkit-datetime-edit,
#formModificar #mod-fecha::-webkit-datetime-edit-fields-wrapper,
#formModificar #mod-fecha::-webkit-datetime-edit-text,
#formModificar #mod-fecha::-webkit-datetime-edit-month-field,
#formModificar #mod-fecha::-webkit-datetime-edit-day-field,
#formModificar #mod-fecha::-webkit-datetime-edit-year-field {
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    color: #3f3f3f;
    line-height: 40px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   INPUT DATE (MANTENEMOS TU FLECHITA)
============================================================ */

#formModificar input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding-right: 42px;

    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237a7a7a'>\
<path d='M5.5 7.5L10 12l4.5-4.5'/>\
</svg>");
    background-repeat: no-repeat;
    background-size: 16px;
    background-position: right 8px center;
    text-align: left;
    text-align-last: left;
}

#formModificar input[type="date"]::-webkit-calendar-picker-indicator {
    filter: brightness(0.55);
    opacity: 0.9;
    cursor: pointer;
}

/* ============================================================
   SELECT HORA (FLECHA AJUSTADA)
============================================================ */

#formModificar #mod-hora {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding-right: 26px;

    background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'>\
<path d='M7 10l5 5 5-5'/>\
</svg>");
    background-repeat: no-repeat;
    background-size: 16px;
    background-position: right 8px center;
}

/* ============================================================
   BOTONES
============================================================ */

.modal-botones {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.modal-botones button {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease, transform 0.15s ease;
}

.modal-botones button:active {
    transform: scale(0.97);
}

.btn-cancelar {
    background: #e5e7eb;
    color: #374151;
}

.btn-cancelar:hover {
    background: #d1d5db;
}

.btn-confirmar {
    background: #2563eb;
    color: white;
}

.btn-confirmar:hover {
    background: #1e40af;
}

/*////////////////////////MODALES MENSAJES//////////////////////////////////*/

/* Modal auto-ajustable para mensajes largos */
.mensaje-largo {
  width: auto;
  max-width: 600px;       /* Máximo ancho */
  padding: 25px 30px;
  border-radius: 12px;
  background: white;
  text-align: left;

  max-height: 75vh;       /* Crece si el texto es largo */
  overflow-y: auto;       /* Scroll interno si se pasa */
}

#modalMensajeLargoTexto {
  white-space: pre-line;  /* Respeta saltos de línea */
  line-height: 1.6;
  font-size: 1.05rem;
}

#modalMensajeLargo .modal-botones {
  margin-top: 25px;     /* 🔥 Más espacio entre el texto y el botón */
}

#modalMensajeLargo button {
  padding: 10px 22px;   /* 🔥 Botón un poco más grande y cómodo */
  font-size: 1rem;
}



/* ============================================================
   MODAL MENSAJE MODIFICAR RESERVA
============================================================ */

#modalError {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

#modalError .modal-contenido {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 350px;
  text-align: center;
}

#modalError.oculto {
  display: none !important;
}

/* Icono de advertencia para recursos no válidos */
.recurso-warning {
    font-size: 1.4rem;
    font-weight: bold;
    color: #f4c542;
    display: block;
    text-align: center;
    margin-bottom: 4px;
}


/* Para bloquear recursos de 23 a 00 */
.recurso-no-disponible {
  opacity: 0.5;
  cursor: not-allowed;
}

/* mensaje de bloqueo liberar recurso en horas invalidas*/
.mensaje-temporal {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #f44336; /* rojo */
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  font-weight: bold;
  z-index: 9999;
  animation: fadeinout 2.5s forwards;
}

@keyframes fadeinout {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}


.recurso-pasada {
    opacity: 0.5;
    cursor: not-allowed;
}


.modal-cerrado-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-cerrado {
  background: #fff;
  padding: 25px 30px;
  border-radius: 10px;
  width: 320px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0,0,0,0.25);
  animation: fadeIn 0.25s ease-out;
}

.modal-cerrado h2 {
  margin-top: 0;
  font-size: 20px;
  color: #b30000;
}

.modal-cerrado p {
  margin: 15px 0;
  font-size: 16px;
}

.modal-cerrado button {
  background: #b30000;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

.modal-cerrado button:hover {
  background: #8a0000;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* HEADER */
.admin-header {
    padding: 30px 10px 20px 10px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
	text-align: center; /* 🔥 CENTRA TODO */
}


/* CONTENEDOR DEL TÍTULO Y USUARIO */
.titulo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center; /* 🔥 CENTRA EL TEXTO */
    gap: 6px;
}
/*.titulo-wrapper {
    display: flex;
    flex-direction: column;
	align-items: center;
}*/

.titulo-wrapper h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #111827;
}

.rol-usuario {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
}

/* CONTENEDOR DE BOTONES */
.admin-buttons {
    display: flex;
    justify-content: center; /* 🔥 CENTRA LOS BOTONES */
    gap: 12px;
    margin-top: 16px;
    flex-wrap: nowrap; /* 🔥 SIEMPRE EN FILA */
}

/* BOTÓN BASE (tu estilo original) */
.card-btn {
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.card-btn:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* TEXTO INTERNO */
.card-btn a {
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

/* CONFIGURACIÓN (gris oscuro) */
.config-card-btn a {
    color: #1f2937;
}

.config-card-btn a:hover {
    color: #111827;
}

/* CERRAR SESIÓN (rojo) */
.logout-card-btn a {
    color: #b91c1c;
}

.logout-card-btn a:hover {
    color: #7f1d1d;
}

/* ================================
   MODAL SECUENCIAL
================================ */

#modalSecuencial.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#modalSecuencial:not(.oculto) {
    display: flex;
}

#modalSecuencial .modal-contenido {
    background: #ffffff;
    padding: 25px 30px;
    border-radius: 12px;
    width: 350px;
    max-width: 90%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    position: relative;
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#modalSecuencial h3 {
    margin-top: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

#secuencialInput {
    width: 100%;
    padding: 10px 12px;
    margin-top: 12px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#secuencialInput:focus {
    border-color: #007bff;
}

.modal-close-x {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.modal-close-x:hover {
    color: #000;
}

#modalSecuencial .modal-botones {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#modalSecuencial .btn-confirmar {
    background: #007bff;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

#modalSecuencial .btn-cancelar {
    background: #ccc;
    color: #333;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#modalSecuencial .btn-confirmar:hover {
    background: #005fcc;
}

#modalSecuencial .btn-cancelar:hover {
    background: #b3b3b3;
}

/* Error visual */
.input-error {
    border-color: #dc3545 !important;
}


/* ============================================================
   📅 CALENDARIO — CONTENEDOR PRINCIPAL
   ============================================================ */

.panel-calendario {
    flex: 1;
    padding: 20px;
    background: white;
}



.panel-animado {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
	position: absolute;
	inset: 0;
	top: 50px;
	
}

.panel-animado.oculto-suave {
    opacity: 0;
    transform: translateY(10px);
    visibility: hidden;
    pointer-events: none;
	transition: opacity 0.8s ease, transform 0.8s ease;


}



#panelCentralContenido.ocultar-panel-central {
    display: none !important;
}

#panelCalendario.ocultar-panel-central {
    display: none !important;
}





/* ============================================================
   📅 CABECERA DEL CALENDARIO
   ============================================================ */

.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendario-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
}

.calendario-header button {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.calendario-header button:hover {
    background: #e5e7eb;
}


/* ============================================================
   MESES
   ============================================================ */

/* CONTENEDOR DEL SELECTOR DE MESES */
.selector-meses {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas como los días */
    gap: 10px;
    margin: 15px 0;
    padding: 0;
    background: transparent; /* sin fondo */
    border: none;            /* sin borde */
}

/* CADA MES */
.selector-meses div {
    padding: 10px 0;
    text-align: center;
    border: 1px solid #d0d0d0;   /* 🔥 borde limpio */
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    background: #ffffff;         /* fondo blanco limpio */
    transition: background 0.2s, border-color 0.2s;
    min-height: 40px;            /* 🔥 tamaño uniforme */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* HOVER 
.selector-meses div:hover {
    background: #f2f2f2;
    border-color: #b5b5b5;
} */

/* OCULTO */
.oculto {
    display: none;
}



/* ============================================================
   📅 GRID DEL MES
   ============================================================ */

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-header {
    text-align: center;
    font-weight: bold;
    padding: 8px 0;
    background: #f3f4f6;
    border-radius: 6px;
    color: #374151;
}

.cal-dia {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px;
    min-height: 70px;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
}

.cal-dia:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cal-dia.vacio {
    background: transparent;
    border: none;
    cursor: default;
}

.cal-num {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.cal-total {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: #2563eb;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* ============================================================
   📅 VISTA DIARIA
   ============================================================ */

.titulo-dia {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2937;
}

.btn-volver-mes {
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 15px;
}

.btn-volver-mes:hover {
    background: #d1d5db;
}

.tabla-dia {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #e5e7eb;
    border-radius: 6px;

    /* 🟢 AÑADIDO: scroll interno */
    max-height: 60vh;      /* Ajustable */
    overflow-y: auto;
    padding-right: 6px;    /* Para que no tape el scroll */
}

/* Scroll elegante tipo SaaS */
.tabla-dia::-webkit-scrollbar {
    width: 6px;
}

.tabla-dia::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.tabla-dia::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.tabla-dia .fila {
    display: contents;
}

.tabla-dia .fila > div {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
}

.tabla-dia .fila.header > div {
    background: #f3f4f6;
    font-weight: bold;
}

.tabla-dia .fila > div:last-child {
    border-right: none;
}




/* ============================================================
   📅 BOTÓN CERRAR CALENDARIO
   ============================================================ */

.btn-cerrar-calendario {
    margin-top: 20px;
    width: 100%;
    padding: 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-cerrar-calendario:hover {
    background: #dc2626;
}

/* ============================================================
   CSS PARA FADE
============================================================ */

/* CONTENEDOR DE PÁGINAS */
.pages-container {
    position: relative;
    width: 100%;
    min-height: 500px; /* puedes ajustar */
    overflow: hidden;  /* evita saltos */
}

/* CADA SECCIÓN (MESAS / CALENDARIO) */
.page {
    position: relative;        /* 🔥 YA NO SACA EL CONTENIDO DEL FLUJO */
    width: 100%;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s ease;
    height: 0;                 /* 🔥 Ocupa 0 cuando está oculta */
    overflow: hidden;          /* 🔥 Evita mostrar contenido oculto */
}


/* CUANDO UNA SECCIÓN ESTÁ ACTIVA */
.page.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    height: auto;             /* 🔥 Ahora sí ocupa espacio real */
    overflow: visible;
}



/* OPCIONAL: ESPACIADO INTERNO PARA RECURSOS Y CALENDARIO */
#recursosPage,
#calendarioPage {
    padding-bottom: 10px;
}

#cerrarCalendario {
    display: none;
}


/*Ocultar meses en el calendario*/

#selectorMeses.oculto {
    display: none !important;
}


/* FOOTER */
footer {
    margin-top: 40px;
    padding: 15px 0;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

/* ============================================================
   RESPONSIVE PREMIUM
============================================================ */

/* =========================================
   ESCRITORIO: DATE CON ICONO NATIVO
========================================= */
@media (min-width: 1024px) {

    /* DATE: quitar flecha custom y usar icono nativo */
    #formModificar input[type="date"] {
        background-image: none !important;
        padding-right: 14px !important;
    }

    #formModificar input[type="date"]::-webkit-calendar-picker-indicator {
        opacity: 1 !important;
        filter: brightness(0.55);
        cursor: pointer;
    }
	
}

/*---------------------------------------
  Grandes pantallas hasta 1200px
----------------------------------------*/
@media (max-width: 1200px) {

  /* Reordenar paneles */
  .admin-layout {
      display: flex;
      flex-direction: column;
      gap: 20px;
  }

  .panel-central { order: 1; }
  .panel-derecho { order: 2; }
  .panel-izquierdo { order: 3; }

  /* Calendario */
  #panelCalendario {
      margin-top: 25px;
  }

  .cal-grid {
      grid-template-columns: repeat(7, minmax(40px, 1fr));
  }

  .cal-dia {
      min-height: 55px;
      padding: 4px;
  }

  .cal-total {
      font-size: 0.65rem;
      padding: 1px 4px;
  }

	.tabla-dia {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		border: 1px solid #e5e7eb;
		border-radius: 6px;
		width: 100%;
		box-sizing: border-box;

		max-height: 60vh;
		overflow-y: auto;
		overflow-x: hidden;
		padding-right: 6px;
	}

	.tabla-dia .fila {
		display: contents;
	}

	.tabla-dia .fila > div {
		padding: 10px;
		border-bottom: 1px solid #e5e7eb;
		border-right: 1px solid #e5e7eb;
		text-align: center;

		/* 🟢 FIX PARA NOMBRES LARGOS */
		word-break: break-word;
		overflow-wrap: break-word;
	}

	.tabla-dia .fila.header > div {
		background: #f3f4f6;
		font-weight: bold;
	}

	.tabla-dia .fila > div:last-child {
		border-right: none;
	}

}

/* ============================================
   TABLETS: MODAL Y CALENDARIO ADAPTATIVOS
   (600px a 1083px)
============================================ */
@media (min-width: 600px) and (max-width: 1083px) {

  /* Modal más grande y SIN scroll horizontal */
  #modalCalendario .modal-contenido {
      width: 95%;              /* más ancho */
      max-width: 900px;        /* límite para tablets grandes */
      max-height: 95vh;
      padding: 25px;
      overflow-x: hidden;      /* evita scroll horizontal */
  }

  /* Calendario adaptativo */
  #modalCalendario.show .cal-grid {
      width: 100%;
      display: grid;
      grid-template-columns: repeat(7, 1fr); /* columnas flexibles */
      gap: 6px;
  }
  
  #selectorMeses {
      grid-template-columns: repeat(4, 1fr) !important;
    }

  #modalCalendario.show .cal-dia {
      aspect-ratio: 1 / 1;
      padding: 6px;
  }

  #modalCalendario.show .cal-num {
      font-size: clamp(1rem, 2vw, 1.4rem);
  }

  #modalCalendario.show .cal-total {
      font-size: clamp(0.8rem, 1.5vw, 1rem);
      padding: 3px 8px;
  }

  #cal-titulo {
      font-size: clamp(1.4rem, 3vw, 2rem);
  }

  #cal-prev,
  #cal-next {
      font-size: clamp(1.2rem, 3vw, 1.8rem);
      padding: 6px 12px;
  }
}


/*---------------------------------------
  Tablets y móviles (max 1083px)
----------------------------------------*/
@media (max-width: 1083px) {
	
	    /* Ocultar icono nativo */
    #fecha::-webkit-calendar-picker-indicator {
        opacity: 0 !important;
    }

    /* Añadir flechita SVG igual que en #hora */
    #fecha {
        background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'>\
<path d='M7 10l5 5 5-5'/>\
</svg>");
        background-repeat: no-repeat;
        background-size: 18px;
        background-position: right 8px center;
        padding-right: 26px !important;
    }
	
	    #fecha.fecha-invalida {
        opacity: 0.45;
        filter: grayscale(1);
    }

	/* 1. El layout principal debe permitir que cada panel crezca según su contenido */
	.admin-layout {
    display: flex;
    align-items: flex-start;   /* evita estiramientos raros */
    gap: 20px;
	}

	/* 2. Cada panel debe tener altura automática */
	.panel-izquierdo,
	.panel-central,
	.panel-derecho {
    height: auto !important;
	}

	/* 3. El panel central NO debe tener alturas forzadas */
	.pages-container {
    position: relative;
    width: 100%;
    min-height: auto !important;  /* antes: 500px */
    overflow: visible !important; /* evita recortes */
	}

	.page {
	position: static !important;
	opacity: 1 !important;
	transform: none !important;
	pointer-events: auto !important;
    height: auto !important;
    }

    .pages-container {
        overflow: visible !important;
    }
  /* ===============================
     MODAL CALENDARIO RESPONSIVE
  =============================== */

  #modalCalendario {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
	}

	#modalCalendario.show {
    display: flex;
	}

	#modalCalendario .modal-contenido {
    background: #fff;
    width: 95%;
    max-height: 90vh;                  /* Limita el alto del modal */
    overflow-y: auto;                  /* Scroll interno */
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    position: relative;                /* Evita problemas de z-index interno */
	}

	/* Ocultar calendario del layout cuando estamos en mobile */
	#calendarioPage {
    display: none;
    width: 100%;
    position: relative; /* Asegura que la vista diaria se quede dentro del modal */
    margin-top: 50px;   /* Añadir espacio arriba para que haya lugar para el botón */
	}

	/* Mostrar calendario SOLO dentro del modal */
	#modalCalendario.show #calendarioPage {
    display: block;
	}

	/* BLOQUE IMPORTANTE: deshabilitar scroll del body mientras el modal esté abierto */
	body.modal-abierto {
    overflow: hidden;
	}

	/* Cerrar botón ahora en la zona superior derecha del calendario */
	#cerrarModalCalendario {
    position: absolute;
    top: 5px;        /* Ajusta el botón aún más cerca de la parte superior */
    right: 10px;     /* Colócalo a la derecha del contenedor */
    z-index: 10001;  /* Asegura que el botón esté sobre otros elementos */
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
	}

	#cerrarModalCalendario:hover {
    background: #f0f0f0;
	}
  
	/* Cuando el calendario está dentro del modal, debe comportarse como un bloque normal */
	#modalCalendario.show #calendarioPage {
    position: static !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    display: block !important;
    width: 100%;
	}

	
	#recursos {
      grid-template-columns: repeat(3, 1fr);
	}

	.floating-tooltip {
      max-width: 90vw;
      font-size: 0.85rem;
      padding: 6px 10px;
      white-space: normal;
      word-break: break-word;
	}

	.floating-tooltip::after {
      top: -5px;
      border-width: 5px;
	}

	.floating-tooltip.tooltip-center::after {
      left: 50%;
      transform: translateX(-50%);
	}

	.floating-tooltip.tooltip-left::after {
      left: calc(100% - 12px);
      transform: translateX(0);
	}

	.floating-tooltip.tooltip-right::after {
      left: 12px;
      transform: translateX(0);
	}
}

/*---------------------------------------
  Móviles pequeños (max 600px)
----------------------------------------*/
@media (max-width: 600px) {
	
    .admin-buttons {
        justify-content: center; /* 🔥 SIGUE CENTRADO */
        gap: 10px;
    }

    .card-btn {
        flex: none; /* 🔥 NO SE ESTIRAN */
    }	
	/* Texto controles */
	.controles-texto {
	font-size: 1rem;
	font-weight: 500;
	color: #4b5563;
      margin-bottom: 12px;
      padding: 0 8px;
      position: relative;
      display: inline-block;
      box-sizing: border-box;
      word-wrap: break-word;
  }

  .controles-texto::before,
  .controles-texto::after {
      content: "";
      position: absolute;
      top: 50%;
      height: 2px;
      background: #d1d5db;
      transform: translateY(-50%);
  }

  .controles-texto::before {
      width: 24px; /* simplificado */
      left: -28px;
  }

  .controles-texto::after {
      width: 24px;
      right: -28px;
  }



#recursos {
    display: grid;
    grid-template-columns: repeat(3, minmax(10px, 1fr));
    gap: 8px;
    justify-content: center;   /* centra el grid dentro del panel */
    justify-items: center;     /* centra cada mesa dentro de su celda */
    width: 100%;
    max-width: 400px;
	margin: 0 auto;


}
	
  .recurso-container {
      width: 100%;
      max-width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      font-size: 0.8rem;
  }


/* Recursos */
.recurso {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1rem;
}

.recurso * {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    font-size: clamp(0.6rem, 2vw, 0.85rem);
}

.recurso-label {
    font-size: clamp(0.65rem, 2.2vw, 0.9rem);
    margin-bottom: 4px;
}

.recurso .nombre,
.recurso .recurso-nombre,
.recurso .capacidad,
.recurso .estado,
.recurso .reservaId,
.recurso .telefono,
.recurso .personas {
    font-size: 0.8rem;
    margin: 2px 0;
}

  /* Tooltips */
  .floating-tooltip {
      max-width: 90vw;
      font-size: 0.85rem;
      padding: 6px 10px;
      white-space: normal;
      word-break: break-word;
  }

  .floating-tooltip::after {
      top: -5px;
      border-width: 5px;
  }

  .floating-tooltip.tooltip-center::after {
      left: 50%;
      transform: translateX(-50%);
  }

  .floating-tooltip.tooltip-left::after {
      left: calc(100% - 12px);
      transform: translateX(0);
  }

  .floating-tooltip.tooltip-right::after {
      left: 12px;
      transform: translateX(0);
  }

/* Calendario en móviles pequeños */
#modalCalendario.show .cal-grid {
    grid-template-columns: repeat(7, minmax(22px, 1fr));
    gap: 2px;
}

#modalCalendario.show .cal-dia {
    aspect-ratio: 1 / 1;
    padding: 1px;
}

#modalCalendario.show .cal-num {
    font-size: clamp(0.7rem, 3vw, 1rem);
}

#modalCalendario.show .cal-total {
    font-size: clamp(0.55rem, 2.5vw, 0.8rem);
}


}

/*---------------------------------------
  Móviles muy pequeños (max 400px)
----------------------------------------*/
@media (max-width: 440px) {
	
	    .cal-num {
        font-size: 1.6rem;
    }

    .cal-total {
        font-size: 1.4rem;
        padding: 4px 8px;
    }

#recursos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    justify-content: center;   /* centra el grid dentro del panel */
    justify-items: center;     /* centra cada recurso dentro de su celda */
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.recurso-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

/* Recursos */
.recurso {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.80rem;
}

.recurso .nombre,
.recurso .recurso-nombre,
.recurso .capacidad,
.recurso .estado,
.recurso .reservaId,
.recurso .telefono,
.recurso .personas {
    font-size: 0.60rem;
    margin: 2px 0;
}

.selector-meses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
    margin: 15px 0;
    padding: 0;
    background: transparent;
    border: none;
}

/* Galaxy Z Fold 5 cerrado (pantalla muy estrecha) */
@media (max-width: 390px) {

  #modalCalendario.show .cal-grid {
      grid-template-columns: repeat(7, minmax(28px, 1fr));
      gap: 2px;
  }

  #modalCalendario.show .cal-dia {
      aspect-ratio: unset !important;
      min-height: 38px !important;
      padding: 3px !important;
  }

  #modalCalendario.show .cal-num {
      font-size: 0.9rem !important;
  }

  #modalCalendario.show .cal-total {
      font-size: 0.7rem !important;
  }
}


/* Galaxy S20 Ultra y móviles muy altos */
@media (min-height: 1200px) and (max-width: 500px) {

  #modalCalendario.show .cal-dia {
      min-height: 50px !important;
  }

  #modalCalendario.show .cal-num {
      font-size: 1.1rem !important;
  }

  #modalCalendario.show .cal-total {
      font-size: 0.85rem !important;
  }
}

@media (hover: hover) and (pointer: fine) {
    .selector-meses div:hover {
        background: #f2f2f2;
        border-color: #b5b5b5;
    }
}


/*---------------------------------------
  Inputs focus accesibilidad
----------------------------------------*/
input:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}






@media (max-width: 390px) {

    .cal-dia {
        height: 70px;   /* 🔥 altura REAL, no mínima */
        padding: 12px;
    }

    .cal-num {
        font-size: 1.6rem;
    }

    .cal-total {
        font-size: 1.4rem;
        padding: 4px 8px;
    }
}


