/* ==========================================================================
   Horizonte Tropical — style.css
   Sistema visual basado en DESIGN.md (editorial red-pen sobre blanco):
   canvas gris #f3f4f6, superficies blancas, hairlines #e5e7eb, botones pill
   y UN solo acento coral, racionado a CTA principal, hover y foco.
   Sin dependencias de clases: se apoya en la estructura HTML existente.
   Ubicación: public/style.css
   ========================================================================== */

/* Inter: coloca el archivo en public/fonts/InterVariable.woff2 (CSP font-src → default-src 'self').
   Si el archivo no existe o no carga, font-display: swap muestra de inmediato la pila del sistema
   definida en --font, sin texto invisible ni errores. */
@font-face {
  font-family: "Inter";
  src: local("Inter Variable"), local("Inter"),
       url("fonts/InterVariable.woff2") format("woff2-variations"),
       url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #111827;
  --slate: #374151;
  --graphite: #1f2937;
  --steel: #6b7280;
  --fog: #9ca3af;
  --mist: #d1d5db;
  --cloud: #e5e7eb;
  --paper: #f3f4f6;
  --snow: #ffffff;
  --coral: #f02d5e;          /* énfasis / foco / hover */
  --coral-cta: #f43f5e;      /* acción principal rellena */
  --coral-cta-hover: #e11d48;
  --cobalt: #3762e2;         /* solo enlaces */
  --lilac: #e9d5ff;          /* borde suave de avisos */
  --banner: linear-gradient(to right top, rgb(255, 128, 181), rgb(144, 137, 252));

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --r-input: 8px;
  --r-card: 12px;
  --r-pill: 9999px;

  --shadow-card: rgba(17, 24, 39, .05) 0 0 0 1px, rgba(0, 0, 0, .1) 0 10px 15px -3px, rgba(0, 0, 0, .1) 0 4px 6px -4px;
  --shadow-btn: rgba(0, 0, 0, .05) 0 1px 2px 0;

  --page: 1200px;
  --gutter: 24px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
  margin: 0;
  padding-bottom: 96px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Layout: banda completa + columna central de 1200px sin wrappers en el HTML */
  display: grid;
  grid-template-columns: minmax(var(--gutter), 1fr) minmax(0, var(--page)) minmax(var(--gutter), 1fr);
  grid-auto-rows: min-content;
  align-content: start;
  min-height: 100vh;
}
body > * { grid-column: 2; margin: 0; min-width: 0; }

::selection { background: rgba(240, 45, 94, .18); }

/* Franja superior degradada (único elemento cromático decorativo) */
body::before {
  content: "";
  grid-column: 1 / -1;
  grid-row: 1;
  height: 6px;
  background: var(--banner);
}

/* ---------- Cabecera: wordmark + navegación (bandas blancas a sangre) ---------- */
body > h1,
body > nav {
  grid-row: 2;
  min-height: 72px;
  display: flex;
  align-items: center;
  background: var(--snow);
  /* truco full-bleed: extiende el fondo a todo el ancho + hairline inferior */
  box-shadow: 0 0 0 100vmax var(--snow), 0 1px 0 100vmax var(--cloud);
  clip-path: inset(0 -100vmax -1px 0);
}

body > h1 {
  justify-self: start;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.4px;
  color: var(--ink);
}
/* Logomark geométrico: sol sobre el horizonte */
body > h1::before {
  content: "";
  width: 20px;
  height: 10px;
  border-radius: 20px 20px 0 0;
  background: var(--ink);
  flex: none;
}

body > nav {
  justify-self: end;
  flex-wrap: wrap;
  gap: 8px 32px;
  font-size: 14px;
  font-weight: 500;
}
body > nav a {
  color: var(--ink);
  text-decoration: none;
  transition: color .15s ease;
}
body > nav a:hover { color: var(--coral); }
body > nav form { display: inline-flex; margin: 0; }

/* ---------- Tipografía ---------- */
h2 {
  margin-top: 48px;
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 700;
  line-height: 1.17;
  letter-spacing: -1.2px;
  color: var(--ink);
}
/* Lead (403/404 y textos de sección) */
h2 + p:not(.alerta-error) {
  margin-top: 16px;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.78;
  color: var(--steel);
}

a { color: var(--cobalt); font-weight: 500; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

/* ---------- Avisos ---------- */
/* Flash (mensajes de éxito/estado): <p><strong>…</strong></p> */
body > p:has(> strong) {
  margin-top: 24px;
  padding: 12px 16px;
  max-width: 640px;
  justify-self: start;
  background: var(--snow);
  border: 1px solid var(--lilac);
  border-radius: var(--r-card);
  font-size: 14px;
  line-height: 1.71;
  box-shadow: var(--shadow-btn);
}
body > p:has(> strong) strong { font-weight: 500; color: var(--ink); }
body > p:has(> strong) + h2 { margin-top: 24px; }

/* Errores de formulario: <p class="alerta-error" role="alert"> (sin estilos en línea, CSP) */
.alerta-error {
  margin-top: 24px;
  max-width: 520px;
  padding: 12px 16px;
  justify-self: start;
  background: var(--snow);
  border: 1px solid var(--coral);
  border-radius: var(--r-input);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.71;
}

/* ---------- Formularios (tarjeta) ---------- */
body > form {
  margin-top: 32px;
  width: 100%;
  max-width: 520px;
  justify-self: start;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--snow);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
body > form br { display: none; }

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--slate);
}

input:not([type="hidden"]),
select {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--snow);
  border: 1px solid var(--cloud);
  border-radius: var(--r-input);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: var(--fog); }
input:not([type="hidden"]):hover,
select:hover { border-color: var(--mist); }
input:not([type="hidden"]):focus,
select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(240, 45, 94, .16);
}

/* Select con chevron dibujado en CSS puro (sin data: URI, compatible con la CSP) */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--steel) 50%),
    linear-gradient(135deg, var(--steel) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* ---------- Botones (pill) ---------- */
button,
body > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 24px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--coral-cta);
  color: var(--snow);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.71;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
}
button:hover,
body > a:hover { background: var(--coral-cta-hover); text-decoration: none; }
button:active { transform: translateY(1px); }

/* CTA principal dentro de formularios: ancho completo en móvil, natural en escritorio */
body > form button { align-self: flex-start; padding: 10px 28px; font-size: 15px; }

/* Enlace de acción de página ("+ Nuevo") */
body > a { justify-self: start; margin-top: 24px; }
body > a + table { margin-top: 24px; }

/* Botones secundarios (nav / tablas): ghost, para mantener UN solo relleno coral por vista */
body > nav button,
table button {
  padding: 6px 16px;
  background: transparent;
  border-color: var(--slate);
  color: var(--slate);
  box-shadow: none;
}
body > nav button:hover,
table button:hover {
  background: transparent;
  border-color: var(--coral);
  color: var(--coral);
}

/* ---------- Tablas (tarjeta) ---------- */
table {
  margin-top: 32px;
  width: 100%;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--snow);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.71;
}
th, td {
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--cloud);
  text-align: left;
  vertical-align: middle;
}
th {
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.33;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--steel);
  white-space: nowrap;
}
tr:last-child > td { border-bottom: 0; }
tr:not(:first-child):hover > td { background: var(--paper); }
td:first-child { color: var(--steel); font-variant-numeric: tabular-nums; }

/* Enlaces de detalle con flecha */
td a::after { content: " \2192"; }
td a { margin-right: 12px; }

/* Formularios embebidos en celdas */
td form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
td select { padding: 6px 36px 6px 12px; font-size: 14px; background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* Wordmark arriba, navegación en su propia banda */
  body > nav {
    grid-row: 3;
    justify-self: stretch;
    min-height: 0;
    padding: 4px 0 14px;
    gap: 8px 20px;
  }
  body > h1:has(+ nav) {
    box-shadow: 0 0 0 100vmax var(--snow);
    clip-path: inset(0 -100vmax);
    min-height: 60px;
  }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body > form { padding: 20px; }
  body > form button { align-self: stretch; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 12px 16px; white-space: nowrap; }
  h2 { margin-top: 32px; letter-spacing: -0.8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ==========================================================================
   v2 — componentes nuevos (panel por rol, tickets, filtros, paginación)
   ========================================================================== */
h3 {
  margin-top: 40px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.4px;
}

textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 14px;
  background: var(--snow);
  border: 1px solid var(--cloud);
  border-radius: var(--r-input);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  resize: vertical;
  box-shadow: var(--shadow-btn);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(240, 45, 94, .16);
}

input[type="checkbox"] { width: auto; accent-color: var(--coral-cta); margin-right: 8px; }
label > span { display: inline-flex; align-items: center; font-weight: 500; }

/* Texto suelto bajo tablas, formularios o títulos */
body > p { margin-top: 16px; }
table + p { margin-top: 16px; font-size: 14px; color: var(--steel); }

/* Panel de inicio: tarjetas por módulo */
body > ul {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
body > ul > li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--snow);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  transition: transform .15s ease;
}
body > ul > li:hover { transform: translateY(-2px); }
body > ul > li a { font-size: 16px; font-weight: 600; color: var(--ink); }
body > ul > li a::after { content: " \2192"; color: var(--coral); }
body > ul > li span { font-size: 14px; line-height: 1.5; color: var(--steel); }

/* Filtros (formularios GET): fila compacta */
body > form[method="get"] {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  max-width: none;
  padding: 16px 20px;
}
body > form[method="get"] label { flex: 0 1 260px; }
body > form[method="get"] button { align-self: flex-end; }

/* Acciones sueltas dentro de tablas: varios formularios/enlaces en línea */
td { white-space: normal; }
td form { margin-right: 6px; }
td input:not([type="hidden"]) { width: 180px; padding: 6px 10px; font-size: 14px; }
td form + form { margin-top: 6px; }

/* Formularios de acción única (p. ej. "Verificar integridad"): botón sin tarjeta alta */
body > form:has(> button:only-of-type):not(:has(label)) { padding: 12px 16px; max-width: 280px; }

/* ==========================================================================
   v3 — favicon/wordmark, catálogo en tarjetas, badges de estado, footer.
   Solo presentación: no cambia formularios, rutas ni datos.
   ========================================================================== */

/* La banda blanca de la cabecera cubre también el margen izquierdo */
body > h1 { clip-path: inset(0 -100vmax -1px -100vmax); }
@media (max-width: 900px) {
  body > h1:has(+ nav) { clip-path: inset(0 -100vmax); }
  body > nav { clip-path: inset(0 -100vmax -1px -100vmax); }
}

/* Wordmark enlazado al inicio */
body > h1 a { color: inherit; font-weight: inherit; text-decoration: none; }
body > h1 a:hover { text-decoration: none; color: var(--coral); }

/* ---------- Footer ---------- */
body > footer {
  margin-top: 72px;
  padding: 24px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  border-top: 1px solid var(--cloud);
  font-size: 13px;
  line-height: 1.6;
  color: var(--steel);
}
.footer-marca { font-weight: 600; color: var(--ink); }
body { padding-bottom: 0; }

/* ---------- Catálogo: cabecera ---------- */
.catalogo-hero {
  margin-top: 32px;
  padding: 40px 40px 44px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 88% 30%, rgba(255, 255, 255, .55) 0 56px, transparent 57px),
    var(--banner);
  color: var(--snow);
  overflow: hidden;
}
.catalogo-hero h2 { margin-top: 0; color: var(--snow); }
.catalogo-hero .lead { margin-top: 12px; max-width: 560px; font-size: 18px; line-height: 1.6; color: rgba(255, 255, 255, .92); }

/* Chips de filtro (enlaces GET: mismo comportamiento que el filtro anterior) */
.chips { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 6px;
  border: 1px solid var(--cloud);
  border-radius: var(--r-pill);
  background: var(--snow);
  color: var(--slate);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: var(--shadow-btn);
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.chip:first-child { padding-left: 16px; }
.chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.chip:hover { text-decoration: none; border-color: var(--coral); color: var(--coral); }
.chip.activo { background: var(--ink); border-color: var(--ink); color: var(--snow); }

.conteo { margin-top: 20px; font-size: 14px; color: var(--steel); }

/* ---------- Catálogo: grid de tarjetas ---------- */
.catalogo-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.catalogo-card {
  display: flex;
  flex-direction: column;
  background: var(--snow);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
}
.catalogo-card:hover {
  transform: translateY(-4px);
  box-shadow: rgba(17, 24, 39, .05) 0 0 0 1px, rgba(0, 0, 0, .12) 0 20px 25px -5px, rgba(0, 0, 0, .08) 0 8px 10px -6px;
}
.catalogo-media { position: relative; }
.catalogo-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform .4s ease; }
.catalogo-card:hover .catalogo-media img { transform: scale(1.04); }
.catalogo-tipo {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--coral);
}
.catalogo-card-body { flex: 1; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; }
.catalogo-card-body h3 { margin: 0; font-size: 18px; line-height: 1.35; letter-spacing: -0.3px; }
.catalogo-card-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--steel);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalogo-pie {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.catalogo-precio { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

.btn-reservar,
.btn-secundario {
  display: inline-flex;
  align-items: center;
  padding: 7px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-reservar { background: var(--coral-cta); color: var(--snow); box-shadow: var(--shadow-btn); }
.btn-reservar:hover { background: var(--coral-cta-hover); text-decoration: none; }
.btn-secundario { border-color: var(--slate); color: var(--slate); }
.btn-secundario:hover { border-color: var(--coral); color: var(--coral); text-decoration: none; }

/* Estado vacío */
.vacio {
  margin-top: 24px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--snow);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  text-align: center;
  color: var(--steel);
}
.vacio img { width: 160px; border-radius: var(--r-card); opacity: .85; }
.vacio p { margin: 0; }

/* ---------- Miniatura de servicio en tablas ---------- */
.servicio-celda { display: inline-flex; align-items: center; gap: 12px; }
.servicio-celda img { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; }
.servicio-celda > span { display: flex; flex-direction: column; line-height: 1.35; font-weight: 500; color: var(--ink); }
.servicio-celda small { font-size: 12px; font-weight: 400; color: var(--steel); }

/* ---------- Badges de estado ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--slate);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge[data-estado="Confirmada"], .badge[data-estado="Aprobado"], .badge[data-estado="Publicado"], .badge[data-estado="Cerrado"]
  { background: #dcfce7; color: #15803d; }
.badge[data-estado="Pendiente"], .badge[data-estado="Abierto"]
  { background: #fef3c7; color: #b45309; }
.badge[data-estado="En proceso"]
  { background: #dbeafe; color: #1d4ed8; }
.badge[data-estado="Cancelada"], .badge[data-estado="Rechazado"]
  { background: #ffe4e6; color: #be123c; }
.badge[data-estado="Oculto"], .badge[data-estado="Sin pago"]
  { background: var(--paper); color: var(--steel); }

@media (max-width: 720px) {
  .catalogo-hero { padding: 28px 24px 32px; border-radius: 16px; }
  .catalogo-hero .lead { font-size: 16px; }
  .catalogo-grid { gap: 16px; }
  body > footer { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .catalogo-card:hover, .catalogo-card:hover .catalogo-media img { transform: none; }
}

/* ==========================================================================
   v3.1 — fotos del catálogo, acceso con portada, panel con iconos, resumen
   de reserva, estados vacíos, paginación, páginas de error, aviso de sesión.
   ========================================================================== */

/* ---------- Tarjeta de formulario reutilizable (formularios dentro de contenedores) ---------- */
.auth-panel > form,
.reserva-layout > form {
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--snow);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.auth-panel > form button,
.reserva-layout > form button { align-self: flex-start; padding: 10px 28px; font-size: 15px; }
.ayuda { font-size: 13px; line-height: 1.5; color: var(--steel); }

/* ---------- Acceso (login / registro / OTP) ---------- */
.auth {
  margin-top: 40px;
  width: 100%;
  max-width: 960px;
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  background: var(--snow);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.auth-portada { position: relative; min-height: 520px; }
.auth-portada img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-portada::after {
  content: "";
  position: absolute;
  inset: 0 0 45% 0;
  background: linear-gradient(to bottom, rgba(49, 36, 110, .55), rgba(49, 36, 110, 0));
}
.auth-portada-texto {
  position: absolute;
  left: 32px;
  right: 32px;
  top: 32px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--snow);
  text-shadow: 0 1px 12px rgba(30, 20, 70, .35);
}
.auth-portada-texto strong { font-size: clamp(24px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.8px; }
.auth-portada-texto span { max-width: 360px; font-size: 16px; line-height: 1.6; opacity: .92; }
.auth-panel { padding: 40px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-panel h2 { margin-top: 0; }
.auth-panel > form { margin-top: 24px; padding: 0; box-shadow: none; }
.auth-panel > form button { align-self: stretch; }
.auth-intro { margin-top: 12px; color: var(--steel); }
.auth-alterno { margin-top: 20px; font-size: 14px; color: var(--steel); }

/* ---------- Panel de inicio: módulos con icono y tono por área ---------- */
.panel-hero {
  margin-top: 32px;
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--snow);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.panel-hero h2 { margin-top: 8px; }
.panel-hero .lead { margin-top: 8px; font-size: 17px; color: var(--steel); }
.panel-hero img { width: 180px; flex: none; border-radius: var(--r-card); }
.panel-rol {
  display: inline-block;
  padding: 2px 12px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--snow);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}

.modulos {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.modulo { --tono: var(--slate); --tono-fondo: var(--paper); }
.modulo a {
  height: 100%;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--snow);
  border-radius: var(--r-card);
  border-top: 3px solid var(--tono);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.modulo a:hover { text-decoration: none; transform: translateY(-3px); }
.modulo-icono {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tono-fondo);
  color: var(--tono);
}
.modulo-texto { display: flex; flex-direction: column; gap: 2px; }
.modulo-texto strong { font-size: 16px; font-weight: 600; line-height: 1.4; }
.modulo-texto strong::after { content: " \2192"; color: var(--tono); }
.modulo-texto span { font-size: 14px; line-height: 1.5; color: var(--steel); }

.tono-catalogo  { --tono: #d97706; --tono-fondo: #fef3c7; }
.tono-reservas  { --tono: #e11d48; --tono-fondo: #ffe4e6; }
.tono-pagos     { --tono: #15803d; --tono-fondo: #dcfce7; }
.tono-soporte   { --tono: #1d4ed8; --tono-fondo: #dbeafe; }
.tono-clientes  { --tono: #0e7490; --tono-fondo: #cffafe; }
.tono-seguridad { --tono: #6d28d9; --tono-fondo: #ede9fe; }
.tono-datos     { --tono: #374151; --tono-fondo: #f3f4f6; }

/* ---------- Nueva reserva: formulario + resumen ---------- */
.reserva-layout {
  margin-top: 32px;
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 380px);
  gap: 24px;
  align-items: start;
}
.resumen-servicio {
  position: sticky;
  top: 24px;
  background: var(--snow);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.resumen-servicio .catalogo-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.resumen-cuerpo { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.resumen-cuerpo h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.resumen-cuerpo p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--steel); }
.resumen-total {
  margin-top: 6px;
  padding-top: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--cloud);
  font-size: 14px;
  color: var(--steel);
}
.resumen-total strong { font-size: 24px; letter-spacing: -0.5px; color: var(--ink); }

/* ---------- Catálogo: campo de foto ---------- */
.campo-foto {
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px dashed var(--mist);
  border-radius: var(--r-card);
}
.campo-foto legend { padding: 0 6px; font-size: 14px; font-weight: 600; color: var(--slate); }
.foto-actual { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--steel); }
.foto-actual img { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow-btn); }
input[type="file"] { padding: 8px; font-size: 14px; cursor: pointer; }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 14px;
  border: 1px solid var(--slate);
  border-radius: var(--r-pill);
  background: var(--snow);
  color: var(--slate);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--coral); color: var(--coral); }

/* ---------- Estados vacíos ---------- */
.vacio h3 { margin: 4px 0 0; font-size: 18px; color: var(--ink); }
.vacio .btn-reservar { margin-top: 8px; }
body > a + .vacio { margin-top: 24px; }

/* ---------- Paginación ---------- */
.paginacion {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
}
.pag-btn {
  padding: 6px 18px;
  border: 1px solid var(--cloud);
  border-radius: var(--r-pill);
  background: var(--snow);
  color: var(--slate);
  font-weight: 600;
  box-shadow: var(--shadow-btn);
}
a.pag-btn:hover { border-color: var(--coral); color: var(--coral); text-decoration: none; }
.pag-btn.deshabilitado { color: var(--fog); box-shadow: none; cursor: default; }
.pag-actual { color: var(--steel); font-variant-numeric: tabular-nums; }

/* ---------- Páginas de error 403 / 404 ---------- */
.error-pagina {
  margin-top: 48px;
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  background: var(--snow);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}
.error-pagina img { width: 100%; border-radius: var(--r-card); }
.error-pagina h2 { margin-top: 8px; }
.error-pagina p { margin: 12px 0 24px; max-width: 480px; font-size: 17px; color: var(--steel); }
.error-codigo { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--coral); }

/* ---------- Aviso de cierre de sesión por inactividad (lo crea app.js) ---------- */
.aviso-sesion {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  width: min(560px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 14px 20px;
  background: var(--ink);
  color: var(--snow);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-portada { min-height: 260px; }
  .auth-portada::after { inset: 0 0 25% 0; }
  .auth-panel { padding: 28px 24px; }
  .reserva-layout { grid-template-columns: 1fr; }
  .resumen-servicio { position: static; order: -1; }
  .error-pagina { grid-template-columns: 1fr; padding: 28px 24px; gap: 24px; }
  .error-pagina img { max-width: 320px; }
}
@media (max-width: 720px) {
  .panel-hero { padding: 24px; }
  .panel-hero img { display: none; }
  .reserva-layout > form button { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .modulo a:hover { transform: none; }
}

/* OTP / TOTP: clave manual y QR de alta */
.totp-clave { padding: 2px 8px; border-radius: 6px; background: var(--paper); font-size: 14px; word-break: break-all; }
.totp-qr { margin-top: 16px; width: 200px; height: 200px; border-radius: var(--r-input); box-shadow: var(--shadow-card); }
