/* Estructura común. Los colores, la tipografía y algunos detalles los pone cada tema (tema-*.css). */
:root {
  --fuente: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --fondo: #f5f7fa;
  --superficie: #ffffff;
  --superficie-2: #f8fafc;
  --texto: #1c2433;
  --suave: #5d6878;
  --linea: #e2e7ee;
  --acento: #1f6f6a;
  --acento-texto: #ffffff;
  --acento-suave: #e3f2f0;
  --rojo: #b8343a;
  --rojo-fondo: #fbeceb;
  --azul: #245fa8;
  --azul-fondo: #e8f0fb;
  --ambar: #9a5b00;
  --ambar-fondo: #fdf1dc;
  --verde: #23744a;
  --verde-fondo: #e6f4ec;
  --lateral-fondo: #1b2340;
  --lateral-texto: #e9edf7;
  --lateral-suave: #9aa5c4;
  --lateral-activo: rgba(255, 255, 255, .1);
  --radio: 12px;
  --radio-pequeno: 8px;
  --sombra: 0 1px 2px rgba(20, 30, 50, .05), 0 2px 8px rgba(20, 30, 50, .04);
  --ancho-lateral: 236px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fondo);
  font-variant-numeric: tabular-nums;
}
a { color: var(--acento); text-underline-offset: 2px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 1rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 .9rem; font-weight: 650; }
p { margin: .3rem 0; }
small { color: var(--suave); display: block; font-size: .82rem; }
code { background: var(--superficie-2); border: 1px solid var(--linea); padding: 0 .3em; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--acento) 45%, transparent); outline-offset: 2px; }

/* ---------- estructura con barra lateral ---------- */
body.con-sesion { display: grid; grid-template-columns: var(--ancho-lateral) minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1.2rem;
  background: var(--lateral-fondo); color: var(--lateral-texto); padding: 1.3rem .9rem 1rem;
}
.marca { display: block; text-decoration: none; color: inherit; padding: .2rem .55rem .6rem; }
.marca-nombre { display: block; font-weight: 800; font-size: 1.12rem; line-height: 1.2; letter-spacing: -.01em; }
.marca-sub { display: block; color: var(--lateral-suave); font-size: .82rem; margin-top: .15rem; }
.marca-version { display: block; color: var(--lateral-suave); opacity: .65; font-size: .7rem; margin-top: .1rem; }
.menu { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.menu a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: var(--radio-pequeno);
  color: var(--lateral-texto); text-decoration: none; font-weight: 500; opacity: .86;
}
.menu a:hover { opacity: 1; background: var(--lateral-activo); }
.menu a.activo { opacity: 1; background: var(--lateral-activo); font-weight: 650; }
.menu svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-separador { color: var(--lateral-suave); font-size: .78rem; padding: 1rem .6rem .3rem; }
.sesion { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .4rem 0; border-top: 1px solid rgba(255,255,255,.1); }
.sesion form { margin: 0; }
.sesion-usuario { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; font-weight: 600; min-width: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--acento); color: var(--acento-texto); font-weight: 700; font-size: .85rem;
}
button.enlace { background: none; border: 0; color: var(--lateral-suave); cursor: pointer; font: inherit; font-size: .88rem; padding: .3rem; }
button.enlace:hover { color: var(--lateral-texto); }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 2rem 2.2rem 3rem; }

/* ---------- avisos ---------- */
.aviso { padding: .75rem 1rem; border-radius: var(--radio-pequeno); margin-bottom: 1.2rem; border: 1px solid transparent; }
.aviso.ok { background: var(--verde-fondo); color: var(--verde); border-color: color-mix(in srgb, var(--verde) 20%, transparent); }
.aviso.error { background: var(--rojo-fondo); color: var(--rojo); border-color: color-mix(in srgb, var(--rojo) 20%, transparent); }

/* ---------- botones ---------- */
.boton, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; line-height: 1.2;
  padding: .58rem 1rem; border-radius: var(--radio-pequeno);
  border: 1px solid var(--linea); background: var(--superficie); color: var(--texto);
  transition: background-color .15s, border-color .15s;
}
.boton:hover, button:hover { border-color: color-mix(in srgb, var(--acento) 50%, var(--linea)); }
.boton.principal { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.boton.principal:hover { background: color-mix(in srgb, var(--acento) 86%, black); }
.boton.peligro { background: var(--rojo); color: #fff; border-color: var(--rojo); }
button.mini { padding: .22rem .6rem; font-size: .82rem; font-weight: 600; border-radius: 6px; white-space: nowrap; }
button.peligro-mini { color: var(--rojo); border-color: color-mix(in srgb, var(--rojo) 40%, var(--linea)); }
button.peligro-mini:hover { background: var(--rojo); color: #fff; border-color: var(--rojo); }

/* ---------- tarjetas y rejillas ---------- */
.tarjeta {
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.25rem 1.35rem; margin-bottom: 1.3rem; box-shadow: var(--sombra);
}
.tarjeta.rojo { border-top: 3px solid var(--rojo); }
.tarjeta.rojo h2 { color: var(--rojo); }
.tarjeta.azul { border-top: 3px solid var(--azul); }
.tarjeta.azul h2 { color: var(--azul); }
.rejilla { display: grid; gap: 1.3rem; margin-bottom: 1.3rem; }
.rejilla > .tarjeta { margin-bottom: 0; }
.rejilla.dos { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.rejilla.tres { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.panel-rejilla { grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); align-items: start; }

.titulo-seccion { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.titulo-seccion h1, .titulo-seccion h2 { margin: 0; }
.acciones { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.acciones form { margin: 0; }
.miga { margin: 0 0 .5rem; font-size: .9rem; }
.miga a { text-decoration: none; color: var(--suave); }
.miga a:hover { color: var(--acento); }
.miga a::before { content: "‹ "; }

.cabecera-ficha { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.cabecera-ficha h1 { margin-bottom: .45rem; font-size: 2rem; }
.sub { color: var(--suave); margin: 0; display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }

/* ---------- panel ---------- */
.saludo { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.saludo h1 { margin: 0; font-size: 2.1rem; }
.saludo-fecha { color: var(--suave); margin: 0 0 .2rem; font-weight: 500; }
.cifras {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio);
  box-shadow: var(--sombra); margin-bottom: 1.5rem; overflow: hidden;
}
.cifra { padding: 1rem 1.2rem; text-decoration: none; color: var(--texto); border-left: 1px solid var(--linea); display: block; }
.cifra:first-child { border-left: 0; }
.cifra:hover { background: var(--superficie-2); }
.cifra b { display: block; font-size: 1.85rem; line-height: 1.1; font-weight: 750; }
.cifra span { color: var(--suave); font-size: .86rem; }
.cifra-rojo b { color: var(--rojo); }
.cifra-ambar b { color: var(--ambar); }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda-dia { display: grid; grid-template-columns: 64px 1fr; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--linea); }
.agenda-dia:first-child { border-top: 0; padding-top: 0; }
.agenda-fecha { text-align: center; border-radius: var(--radio-pequeno); background: var(--superficie-2); border: 1px solid var(--linea); padding: .4rem 0 .45rem; align-self: start; }
.agenda-fecha b { display: block; font-size: 1.45rem; line-height: 1.1; }
.agenda-fecha span { display: block; font-size: .78rem; color: var(--suave); }
.agenda-fecha .agenda-semana { text-transform: capitalize; font-weight: 600; }
.agenda-fecha.hoy { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.agenda-fecha.hoy span { color: inherit; opacity: .85; }
.agenda-dia ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.agenda-dia li { display: grid; grid-template-columns: 52px 1fr auto; gap: .6rem; align-items: start; }
.agenda-dia li strong { display: block; }
.agenda-dia li a { font-size: .9rem; }
.agenda a, .item a, table a { text-decoration: none; }
.agenda a:hover, .item a:hover, table a:hover { text-decoration: underline; }
.agenda-hora { font-weight: 650; color: var(--suave); padding-top: .05rem; }
.agenda-estado { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- reservas y calendario ---------- */
.conmutador { display: inline-flex; border: 1px solid var(--linea); border-radius: 999px; padding: 3px; background: var(--superficie); }
.conmutador a { padding: .4rem .95rem; border-radius: 999px; text-decoration: none; color: var(--suave); font-weight: 600; font-size: .9rem; }
.conmutador a.activo { background: var(--acento); color: var(--acento-texto); }
.filtros-reservas { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: flex-end; padding: 1rem 1.2rem; }
.filtros-reservas label { display: flex; flex-direction: column; gap: .25rem; font-size: .82rem; font-weight: 500; color: var(--suave); }
form.filtros-reservas input, form.filtros-reservas select { width: auto; min-width: 0; flex: none; }
form.filtros-reservas input[name="actividad"] { width: 11rem; }
form.filtros-reservas label.casilla { flex-direction: row; align-items: center; gap: .45rem; padding-bottom: .6rem; color: var(--texto); font-size: .88rem; }
form.filtros-reservas label.casilla input { width: 1.05rem; height: 1.05rem; padding: 0; accent-color: var(--acento); }
.dia-reservas h2 { margin: 0; }
.salida { border-top: 1px solid var(--linea); padding: .8rem 0 .3rem; }
.salida:first-of-type { border-top: 0; }
.salida-cabecera { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .3rem; }
.salida-cabecera small { display: inline; margin-left: .4rem; }
.salida table td { border-bottom: 0; padding: .3rem .5rem .3rem 0; }
.tabla-salida { table-layout: fixed; }
.tabla-salida td { overflow: hidden; text-overflow: ellipsis; }
.calendario-cabecera { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.calendario-cabecera h2 { margin: 0; min-width: 11rem; text-align: center; }
.calendario-cabecera .boton { padding: .35rem .8rem; font-size: 1.1rem; }
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0; overflow: hidden; gap: 0; }
.cal-dia-semana { padding: .5rem .6rem; font-size: .8rem; font-weight: 600; color: var(--suave); background: var(--superficie-2); border-bottom: 1px solid var(--linea); }
.cal-dia { min-height: 118px; padding: .35rem .4rem .5rem; border-right: 1px solid var(--linea); border-bottom: 1px solid var(--linea); display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cal-dia:nth-child(7n) { border-right: 0; }
.cal-dia.fuera { background: var(--superficie-2); }
.cal-dia.fuera .cal-num { color: #a3adb9; }
.cal-num { font-weight: 650; font-size: .85rem; padding: .1rem .2rem; }
.cal-num a { color: inherit; text-decoration: none; }
.cal-dia.hoy .cal-num { color: var(--acento); }
.cal-dia.hoy .cal-num::after { content: " · hoy"; font-weight: 500; font-size: .75rem; }
.cal-act {
  display: block; text-decoration: none; color: var(--texto); font-size: .76rem; line-height: 1.25;
  background: var(--verde-fondo); border-left: 3px solid var(--verde); border-radius: 5px; padding: .2rem .35rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-act span { display: block; color: var(--suave); overflow: hidden; text-overflow: ellipsis; }
.cal-act.cal-solicitud { background: var(--acento-suave); border-left-color: var(--acento); }
.cal-act.sin-pagar { background: var(--ambar-fondo); border-left-color: var(--ambar); }
.cal-act.cal-cancelada { background: var(--superficie-2); border-left-color: #a3adb9; text-decoration: line-through; color: var(--suave); }
.cal-act:hover { filter: brightness(.97); }
.cal-mas { font-size: .76rem; font-weight: 600; padding-left: .3rem; }
.leyenda { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.cal-act.muestra { display: inline-block; }

.acciones-fila { white-space: nowrap; text-align: right; width: 1%; }
td.acciones-fila > * + * { margin-top: .35rem; }
#reservas td.acciones-fila, .tabla-tarjeta td.acciones-fila { vertical-align: middle; }
#reservas .acciones-fila .boton-pago, #reservas .acciones-fila .boton-fila, #reservas .acciones-fila .boton-calendario,
.tabla-tarjeta .acciones-fila .boton-pago { display: flex; width: 100%; justify-content: center; box-sizing: border-box; }
#reservas .acciones-fila .menu-calendario > div { right: 0; }
#reservas td, #reservas th { padding-left: .45rem; padding-right: .45rem; }
#reservas .celda-fecha { white-space: nowrap; }
.boton-fila, .boton-calendario {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-size: .82rem; font-weight: 600; line-height: 1.2; padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid var(--linea); background: var(--superficie); color: var(--texto);
}
.boton-fila:hover { border-color: var(--acento); text-decoration: none; }
.boton-calendario { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); list-style: none; }
.boton-calendario::-webkit-details-marker { display: none; }
.boton-calendario:hover, .menu-calendario[open] > .boton-calendario { background: color-mix(in srgb, var(--acento) 85%, black); }
.boton-calendario svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.boton-calendario:focus-visible, .boton-fila:focus-visible { outline: 3px solid color-mix(in srgb, var(--acento) 45%, transparent); outline-offset: 2px; }
.menu-calendario { position: relative; display: block; }
.menu-calendario > div {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 15rem;
  display: flex; flex-direction: column; background: var(--superficie); border: 1px solid var(--linea);
  border-radius: var(--radio-pequeno); box-shadow: 0 8px 24px rgba(0,30,50,.12); padding: .3rem;
}
.menu-calendario > div a { padding: .5rem .6rem; border-radius: 6px; text-decoration: none; text-align: left; color: var(--texto); }
.menu-calendario > div a:hover { background: var(--superficie-2); color: var(--acento); }
.tabla-desplazable:has(.menu-calendario[open]), .dia-reservas:has(.menu-calendario[open]) { overflow: visible; }
.tabla-salida td.acciones-fila { overflow: visible; }

/* ---------- pagos manuales ---------- */
.boton-pago {
  display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; white-space: nowrap; font: inherit;
  font-size: .82rem; font-weight: 600; line-height: 1.2; padding: .3rem .7rem; border-radius: 999px;
  border: 1px solid var(--verde); background: var(--verde); color: #fff;
}
.boton-pago:hover { background: color-mix(in srgb, var(--verde) 85%, black); border-color: color-mix(in srgb, var(--verde) 85%, black); }
.boton-pago svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dialogo-pago {
  width: min(520px, calc(100vw - 2rem)); border: 0; border-radius: calc(var(--radio) + 2px); padding: 1.3rem 1.4rem;
  background: var(--superficie); color: var(--texto); box-shadow: 0 24px 70px rgba(0, 20, 40, .35); text-align: left; white-space: normal;
}
.dialogo-pago::backdrop { background: rgba(5, 20, 35, .45); }
.dialogo-cabecera { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dialogo-cabecera h2 { margin: 0; }
.cerrar-dialogo { border: 0; background: none; font-size: 1.1rem; padding: .2rem .4rem; color: var(--suave); }
.dialogo-sub { color: var(--suave); margin: .3rem 0 .9rem; }
.resumen-pago { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0 0 1rem; }
.resumen-pago > div { background: var(--superficie-2); border: 1px solid var(--linea); border-radius: var(--radio-pequeno); padding: .5rem .7rem; }
.resumen-pago dt { font-size: .78rem; color: var(--suave); }
.resumen-pago dd { margin: 0; font-weight: 700; font-size: 1.05rem; }
.resumen-pago .pendiente dd { color: var(--rojo); }
.tipo-pago { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tipo-pago legend { margin-bottom: .5rem; }
.opcion-pago { display: flex !important; flex-direction: row !important; gap: .55rem; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--linea); border-radius: var(--radio-pequeno); padding: .65rem .75rem; margin: 0 !important; color: var(--texto) !important; }
.opcion-pago:has(input:checked) { border-color: var(--acento); background: var(--acento-suave); }
.opcion-pago input { width: auto; margin-top: .2rem; accent-color: var(--acento); }
.opcion-pago b { display: block; }
.opcion-pago small { margin: 0; }
.dialogo-pago .acciones { margin-top: .4rem; }
.pagos-anteriores { border-top: 1px solid var(--linea); margin-top: 1rem; padding-top: .8rem; }
.pagos-anteriores h3 { font-size: .95rem; margin: 0 0 .3rem; }
@media (max-width: 520px) { .tipo-pago, .resumen-pago { grid-template-columns: 1fr; } }

/* ---------- tablas ---------- */
table { width: 100%; border-collapse: collapse; }
table.tarjeta { padding: 0; overflow: hidden; display: table; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-size: .82rem; font-weight: 600; color: var(--suave); background: var(--superficie-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--superficie-2); }
tfoot td { font-weight: 650; background: var(--superficie-2); border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.cancelada td { color: #98a2b1; text-decoration: line-through; }
tr.cancelada td a, tr.cancelada td .etiqueta { text-decoration: none; }
table.compacta td { padding: .4rem .5rem; font-size: .9rem; }
.tabla-desplazable { overflow-x: auto; margin: 0 -1.35rem; padding: 0 1.35rem; }
.tabla-desplazable th, .tabla-desplazable td { padding: .6rem .5rem; font-size: .9rem; }
.tabla-desplazable th:first-child, .tabla-desplazable td:first-child { padding-left: 0; }
.tabla-desplazable th:last-child, .tabla-desplazable td:last-child { padding-right: 0; }

/* ---------- etiquetas y marcas ---------- */
.etiqueta {
  display: inline-block; font-size: .78rem; font-weight: 600; padding: .14rem .55rem; border-radius: 999px;
  background: var(--acento-suave); color: var(--acento); white-space: nowrap;
}
.etiqueta.ok { background: var(--verde-fondo); color: var(--verde); }
.etiqueta.gris { background: var(--superficie-2); color: var(--suave); border: 1px solid var(--linea); }
.etiqueta.azul { background: var(--azul-fondo); color: var(--azul); }
.etiqueta.aviso-pago { background: var(--ambar-fondo); color: var(--ambar); }
.importe-pendiente { color: var(--rojo); font-weight: 700; }
.vencido { color: var(--rojo); font-weight: 650; }
.fecha-limite { display: inline-block; font-size: .78rem; font-weight: 600; padding: .08rem .5rem; border-radius: 999px; background: var(--superficie-2); color: var(--suave); border: 1px solid var(--linea); margin-left: .25rem; white-space: nowrap; }
.fecha-limite.hoy { background: var(--ambar-fondo); color: var(--ambar); border-color: transparent; }
.fecha-limite.vencido { background: var(--rojo); color: #fff; border-color: transparent; }
.cambiar-fecha summary { margin-top: .2rem; font-size: .8rem; font-weight: 600; }
.cambiar-fecha form { margin-top: .35rem; }
.cambiar-fecha input { width: auto; padding: .25rem .45rem; font-size: .85rem; }
.campo-fecha { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--suave); flex: 1; }
.campo-fecha input { width: auto; flex: 1; min-width: 0; }
.tabla-tarjeta { padding-top: .4rem; padding-bottom: .4rem; }
.marcas { white-space: nowrap; }
.punto {
  display: inline-block; min-width: 1.45rem; text-align: center; border-radius: 999px;
  color: #fff; font-size: .78rem; font-weight: 700; padding: .05rem .4rem;
}
.punto.rojo { background: var(--rojo); }
.punto.azul { background: var(--azul); }
.no-informado { color: var(--suave); font-style: italic; }
.sin-verificar { color: var(--ambar); font-weight: 650; display: inline; }
.vacio { color: var(--suave); }
.nota { color: var(--suave); font-size: .9rem; }
.total-grande { font-size: 1.1rem; margin: 0; }

/* ---------- elementos de lista ---------- */
.item {
  display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start;
  padding: .7rem 0; border-bottom: 1px solid var(--linea);
}
.item:last-of-type { border-bottom: 0; }
.item p { margin: .15rem 0; }
.item.tachado > div:first-child { text-decoration: line-through; color: var(--suave); }
.botones { display: flex; gap: .35rem; flex-wrap: wrap; }
.botones form { margin: 0; }
.alergias {
  padding: .6rem .75rem; background: var(--azul-fondo); border-radius: var(--radio-pequeno); margin-bottom: .4rem;
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; color: var(--azul);
}
.alergias strong { color: var(--azul); }
.alergias .no-informado { color: var(--azul); opacity: .8; }
.alergias form { margin: 0; }
details summary { cursor: pointer; color: var(--acento); margin-top: .7rem; font-weight: 600; }

/* ---------- datos de la ficha ---------- */
.datos { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1.1rem; margin: 0; }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.notas { background: var(--superficie-2); border: 1px solid var(--linea); border-radius: var(--radio-pequeno); padding: .7rem .85rem; white-space: pre-wrap; }

/* ---------- formularios ---------- */
input, select, textarea {
  font: inherit; padding: .55rem .7rem; border: 1px solid var(--linea); border-radius: var(--radio-pequeno);
  background: var(--superficie); color: var(--texto); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 18%, transparent); }
.formulario label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 500; color: var(--suave); margin-bottom: .9rem; }
.formulario fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; }
.formulario legend { font-weight: 700; color: var(--texto); margin-bottom: .7rem; font-size: 1.02rem; }
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.1rem; }
.campos .ancho { grid-column: 1 / -1; }
.anadir { display: flex; gap: .5rem; margin-top: .9rem; }
.anadir.columna { flex-direction: column; }
.anadir button { white-space: nowrap; width: auto; }
.fila { display: flex; gap: .5rem; align-items: center; }
.fila button { width: auto; white-space: nowrap; }
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.filtros input { flex: 1; min-width: 260px; width: auto; }
.filtros select { width: auto; }
.buscador input { min-width: 280px; }

/* ---------- pantallas sin sesión ---------- */
.caja-centrada { max-width: 440px; margin: 3rem auto; }
.caja-centrada .formulario button { width: 100%; }
body.sin-sesion main { max-width: 480px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 2rem 1rem; }
body.sin-sesion .caja-centrada {
  margin: 0; max-width: none; background: var(--superficie); border-radius: calc(var(--radio) + 4px);
  padding: 2.2rem 2rem; box-shadow: 0 20px 60px rgba(10, 15, 35, .25);
}

/* ---------- móvil ---------- */
@media (max-width: 860px) {
  body.con-sesion { display: block; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .7rem .8rem; }
  .marca { padding: .2rem .4rem; }
  .marca-sub { display: none; }
  .menu { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; }
  .menu a span { font-size: .9rem; }
  .menu-separador { display: none; }
  .sesion { border-top: 0; padding: 0; margin-left: auto; }
  main { padding: 1.2rem 1rem 2rem; }
  .cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendario { display: block; }
  .cal-dia-semana { display: none; }
  .cal-dia { min-height: 0; border-right: 0; }
  .cal-dia:not(:has(.cal-act)) { display: none; }
  .cifra { border-left: 0; border-top: 1px solid var(--linea); }
  .panel-rejilla, .rejilla.dos, .rejilla.tres { grid-template-columns: 1fr; }
  table.tarjeta { display: block; overflow-x: auto; }
  .buscador input { min-width: 0; }
}

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

@media print {
  .lateral, .acciones, form, details, .miga { display: none !important; }
  body { background: #fff; display: block !important; }
  .tarjeta { break-inside: avoid; box-shadow: none; }
}

/* Enlaces a Google Maps (alojamiento y recogida) */
.enlace-mapa { text-decoration: none; overflow-wrap: anywhere; }
.enlace-mapa:hover { text-decoration: underline; }
.enlace-mapa svg { width: 15px; height: 15px; margin-left: .3rem; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media print { .enlace-mapa { color: inherit; } .enlace-mapa svg { display: none; } }

/* Información importante (alergias, preguntas de Bókun) y pendientes */
.marca-importante { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--ambar); color: #fff; font-size: .75rem; font-weight: 800; line-height: 1; text-decoration: none;
  vertical-align: middle; margin-left: .3rem; flex: none; cursor: help; }
.marca-importante.con-pendiente { background: var(--rojo); }
tr.fila-info-importante td { background: var(--ambar-fondo); border-top: 0; padding-top: .45rem; padding-bottom: .55rem; }
tr.fila-info-importante td { display: table-cell; }
tr.fila-info-importante td > .marca-importante { float: left; margin: .15rem .6rem 0 0; }
tr.fila-info-importante ul { margin: .2rem 0 0; padding-left: 1.1rem; }
tr.fila-info-importante strong { font-size: .85rem; }
.etiqueta.rojo-suave { background: var(--rojo-fondo); color: var(--rojo); text-decoration: none; }
.boton-bokun { white-space: nowrap; }
.aviso.info-bokun { background: var(--azul-fondo, var(--superficie-2)); border: 1px solid var(--linea); padding: .8rem 1rem; }
.aviso.info-bokun p { margin: 0 0 .6rem; }
fieldset[disabled] { opacity: .65; }
.cal-act span.marca-importante { display: inline-grid; color: #fff; width: .95rem; height: .95rem; font-size: .65rem;
  margin: 0 .25rem 0 0; vertical-align: -.1rem; overflow: visible; }
.cal-mas .marca-importante { width: .9rem; height: .9rem; font-size: .62rem; margin: 0; }
.leyenda-importante { display: inline-flex; align-items: center; gap: .3rem; margin-left: .6rem; }
.leyenda-importante .marca-importante { margin: 0; }
small.info-lista { display: block; color: var(--ambar); font-weight: 600; margin-top: .15rem; }

/* Pagos pendientes */
.tabla-pagos { width: 100%; table-layout: auto; }
.tabla-pagos col.c-fecha { width: 7.5rem; }
.tabla-pagos col.c-estado { width: 11rem; }
.tabla-pagos col.c-num { width: 6.5rem; }
.tabla-pagos col.c-accion { width: 1%; }
.tabla-pagos td { vertical-align: top; }
.tabla-pagos .celda-cliente { min-width: 14rem; }
.tabla-pagos .celda-cliente a { display: block; text-decoration: none; }
.tabla-pagos .celda-cliente .act { display: block; margin-top: .1rem; }
.tabla-pagos .celda-estado .etiqueta { display: inline-block; margin: 0 .25rem .3rem 0; }
.tabla-pagos td.num { white-space: nowrap; }
.tabla-pagos td.acciones-fila { vertical-align: top; }
.tabla-pagos .acciones-fila .boton-pago { white-space: nowrap; width: auto; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tabla-pagos .solo-estrecho { display: none; }
@media (max-width: 1150px) {
  .tabla-pagos .ancho { display: none; }
  .tabla-pagos .solo-estrecho { display: block; }
  .tabla-pagos col.c-estado { width: 9.5rem; }
  .tabla-pagos col.c-fecha { width: 6.5rem; }
}
.tabla-pagos .estados-estrecho .etiqueta { margin: .35rem .25rem 0 0; display: inline-block; }
@media (max-width: 1000px) {
  .tabla-pagos .acciones-fila .boton-pago span { display: none; }
  .tabla-pagos .acciones-fila .boton-pago { padding: .45rem .55rem; }
}

/* Información importante editable (ficha) */
.info-editable { min-width: 0; }
.info-editable ul { list-style: none; padding: 0; margin: .35rem 0 .5rem; }
.info-editable li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; padding: .25rem 0; border-bottom: 1px dashed color-mix(in srgb, var(--ambar) 30%, transparent); }
.info-editable li:last-child { border-bottom: 0; }
.info-texto { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.origen-info { font-size: .7rem; font-weight: 600; color: var(--suave); text-transform: uppercase; letter-spacing: .03em; }
.icono-info { width: 1.75rem; height: 1.75rem; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent;
  border-radius: 6px; background: none; color: var(--suave); cursor: pointer; }
.icono-info:hover { border-color: var(--ambar); color: var(--texto); background: var(--superficie); }
.icono-info.borrar:hover { color: var(--rojo); border-color: var(--rojo); }
.icono-info svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
form.en-linea { display: inline; margin: 0; }
.form-info { display: flex; gap: .4rem; align-items: center; margin: .3rem 0; flex: 1 1 100%; }
.form-info input[name=texto] { flex: 1; min-width: 0; padding: .35rem .6rem; background: var(--superficie); }
.form-info .boton { width: auto; flex: none; }
.enlace-mini { background: none; border: 0; padding: .15rem 0; font: inherit; font-size: .8rem; font-weight: 600; color: var(--acento); cursor: pointer; display: block; }
.enlace-mini:hover { text-decoration: underline; }
.nota-info { font-size: .75rem; color: var(--suave); margin: .3rem 0 0; }

/* Pendientes del panel: acciones rápidas */
.pendientes-panel .item { display: flex; align-items: flex-start; gap: .6rem; }
.pendientes-panel .item > div:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.acciones-pendiente { display: flex; gap: .3rem; flex: none; }
.acciones-pendiente form { margin: 0; }
.icono-pend { width: 2rem; height: 2rem; display: inline-grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--linea); border-radius: 8px; background: var(--superficie); color: var(--suave); }
.icono-pend svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icono-pend.hecho:hover { border-color: var(--verde); color: var(--verde); background: var(--verde-fondo); }
.icono-pend.borrar:hover { border-color: var(--rojo); color: var(--rojo); background: var(--rojo-fondo); }

/* Buscador del panel */
.buscador-panel { display: flex; gap: .5rem; align-items: stretch; }
.buscador-panel input { flex: 1; }
.buscador-panel .boton { display: inline-flex; align-items: center; gap: .4rem; width: auto; white-space: nowrap; }
.buscador-panel .boton svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* Calendario: un recuadro por tour y ventana con las familias */
button.cal-act { width: 100%; text-align: left; font: inherit; font-size: .76rem; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; }
.cal-salida span { white-space: nowrap; }
.dialogo-salida { width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); padding: 0; border: 1px solid var(--linea);
  border-radius: var(--radio, 14px); background: var(--superficie); color: var(--texto); box-shadow: 0 24px 60px rgba(0, 20, 30, .3); }
.dialogo-salida::backdrop { background: rgba(0, 20, 30, .45); }
.salida-dlg-cab { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem .8rem; border-bottom: 1px solid var(--linea);
  position: sticky; top: 0; background: var(--superficie); }
.salida-dlg-cab h2 { margin: .1rem 0 .2rem; font-size: 1.15rem; }
.salida-dlg-fecha { margin: 0; font-size: .82rem; color: var(--acento); font-weight: 600; }
.salida-dlg-resumen { margin: 0; font-size: .88rem; color: var(--suave); }
.cerrar-dlg { width: 2.2rem; height: 2.2rem; flex: none; border-radius: 50%; border: 1px solid var(--linea); background: var(--superficie);
  color: var(--texto); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.familias { list-style: none; margin: 0; padding: .4rem 1.2rem; }
.familias > li { padding: .75rem 0; border-bottom: 1px solid var(--linea); }
.familias > li:last-child { border-bottom: 0; }
.familias > li.cancelada { opacity: .55; }
.familia-cab { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.familia-cab a { text-decoration: none; }
.familia-pax { font-size: .88rem; color: var(--suave); }
.familia-estado { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .35rem; font-size: .85rem; }
.familia-info { list-style: none; margin: .45rem 0 0; padding: .45rem .6rem; background: var(--ambar-fondo); border-radius: 8px; font-size: .86rem; }
.familia-info li { display: flex; gap: .45rem; align-items: flex-start; padding: .1rem 0; }
.familia-info .marca-importante { margin: .1rem 0 0; width: 1rem; height: 1rem; font-size: .65rem; flex: none; }
.salida-dlg-pie { display: flex; gap: .5rem; flex-wrap: wrap; padding: .8rem 1.2rem 1.1rem; border-top: 1px solid var(--linea);
  position: sticky; bottom: 0; background: var(--superficie); }
.salida-dlg-pie .boton { width: auto; }
.etiqueta-pack { display: inline-block; font-size: .68rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px;
  background: var(--azul-fondo, var(--acento-suave)); color: var(--azul, var(--acento)); vertical-align: middle; letter-spacing: .02em; }
.familia-nombre { display: inline-flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.enlace-bokun { font-size: .78rem; font-weight: 700; color: var(--acento); text-decoration: none; padding: .05rem .5rem;
  border: 1px solid var(--linea); border-radius: 999px; white-space: nowrap; }
.enlace-bokun:hover { border-color: var(--acento); background: var(--acento-suave); }

/* Calendario: color propio por tipo de tour */
.cal-act.cal-salida, .cal-act.muestra[style*="--tono"] {
  background: hsl(var(--tono) 70% 94%); border-left: 4px solid hsl(var(--tono) 55% 40%); color: hsl(var(--tono) 45% 18%);
  border-radius: 6px; padding: .3rem .4rem; box-shadow: inset 0 0 0 1px hsl(var(--tono) 45% 85%); }
.cal-act.cal-salida b { color: hsl(var(--tono) 55% 30%); }
.cal-act.cal-salida span { color: hsl(var(--tono) 25% 35%); }
.cal-act.cal-salida:hover { background: hsl(var(--tono) 70% 89%); filter: none; }
.cal-act.cal-salida.cal-solicitud, .cal-act.muestra.cal-solicitud { border-left-style: dashed; }
.cal-act.cal-salida.cal-cancelada { background: var(--superficie-2); border-left-color: #a3adb9; box-shadow: none; color: var(--suave); }
.cal-dia { gap: .3rem; }
.falta-pago { font-style: normal; font-weight: 700; color: var(--ambar); }
.cal-act.cal-salida span .falta-pago { color: #b15d00; }

/* Lista de reservas: cada tour del día en su propio bloque de color */
.salida.salida-color { border: 1px solid hsl(var(--tono) 45% 85%); border-left: 6px solid hsl(var(--tono) 60% 50%);
  border-radius: 10px; background: hsl(var(--tono) 70% 98.5%); padding: 0; margin: .8rem 0 0; overflow: visible; }
.salida.salida-color:first-of-type { border-top: 1px solid hsl(var(--tono) 45% 85%); }
.salida-color .salida-cabecera { background: hsl(var(--tono) 70% 93%); padding: .55rem .9rem; margin: 0;
  border-radius: 4px 9px 0 0; align-items: center; }
.salida-color .salida-cabecera strong { color: hsl(var(--tono) 55% 24%); }
.salida-color .salida-cabecera small { margin: 0; color: hsl(var(--tono) 25% 35%); font-weight: 600; }
.salida-hora { display: inline-block; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff;
  background: hsl(var(--tono) 60% 42%); border-radius: 6px; padding: .05rem .45rem; margin-right: .35rem; }
.salida-color .tabla-salida { margin: .2rem 0 .3rem; }
.salida-color .tabla-salida td:first-child { padding-left: .9rem; }
.salida-color .tabla-salida tr + tr td { border-top: 1px solid hsl(var(--tono) 40% 91%); }
.salida-color .tabla-salida td { vertical-align: middle; }
.tabla-salida td.acciones-fila { padding-right: .7rem; }
.tabla-salida td.acciones-fila > * { display: inline-block; vertical-align: middle; margin: 0 0 0 .35rem; }
.tabla-salida td.acciones-fila .menu-calendario > div { right: 0; }
.tabla-salida td.acciones-fila .menu-calendario, .tabla-salida td.acciones-fila .boton-calendario { margin-top: 0; margin-bottom: 0; vertical-align: middle; }

/* Panel: próximos días agrupados por tour, como en el calendario */
.agenda-dia ul { gap: .45rem; }
.agenda-dia li:has(> .agenda-tour) { display: block; }
.agenda-tour { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 3.4rem 1fr auto;
  gap: .7rem; align-items: center; padding: .6rem .75rem; border-radius: 10px;
  background: hsl(var(--tono) 70% 97%); border: 1px solid hsl(var(--tono) 45% 88%); border-left: 5px solid hsl(var(--tono) 60% 50%);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.agenda-tour:hover { background: hsl(var(--tono) 70% 94%); box-shadow: 0 3px 10px rgba(0, 40, 60, .08); transform: translateY(-1px); }
.agenda-tour:active { transform: translateY(0); box-shadow: none; }
.agenda-tour:focus-visible { outline: 2px solid hsl(var(--tono) 60% 45%); outline-offset: 2px; }
.agenda-tour.con-pend { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rojo) 35%, transparent); }
.agenda-tour-hora { font-weight: 800; font-variant-numeric: tabular-nums; color: hsl(var(--tono) 55% 32%); }
.agenda-tour-cuerpo { min-width: 0; }
.agenda-tour-cuerpo strong { display: block; color: hsl(var(--tono) 50% 20%); line-height: 1.3; }
.agenda-tour-datos { display: block; font-size: .88rem; color: hsl(var(--tono) 20% 38%); margin-top: .1rem; }
.agenda-tour-marcas { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; align-items: center; max-width: 16rem; }
.chip-pendiente { background: var(--rojo); color: #fff; font-size: .76rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; }
.chip-info { background: var(--ambar); color: #fff; font-size: .76rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.salida-dlg-pend { margin: .3rem 0 0; font-size: .85rem; font-weight: 700; color: var(--rojo); }
.familia-pendiente { display: flex; gap: .4rem; align-items: flex-start; margin-top: .4rem; padding: .35rem .55rem; border-radius: 8px;
  background: color-mix(in srgb, var(--rojo) 9%, transparent); color: var(--rojo); font-size: .86rem; font-weight: 600; text-decoration: none; }
.familia-pendiente:hover { text-decoration: underline; }
.familia-pendiente .marca-importante { margin: .1rem 0 0; width: 1rem; height: 1rem; font-size: .65rem; cursor: pointer; }
@media (max-width: 700px) {
  .agenda-tour { grid-template-columns: 3rem 1fr; }
  .agenda-tour-marcas { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}

/* Barra lateral: botones grandes y táctiles */
.lateral .menu { gap: .2rem; }
.lateral .menu a { position: relative; min-height: 44px; padding: .4rem .55rem .4rem .45rem; gap: .7rem; border-radius: 12px; opacity: .9;
  font-size: .97rem; transition: background .15s ease, transform .15s ease, opacity .15s ease; -webkit-tap-highlight-color: transparent; }
.lateral .menu a:hover { background: var(--lateral-activo); opacity: 1; transform: translateX(2px); }
.lateral .menu a:active { transform: scale(.98); }
.lateral .menu a:focus-visible { outline: 2px solid var(--naranja, #ff8c4a); outline-offset: 1px; }
.menu-icono { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: rgba(255, 255, 255, .09); transition: background .15s ease; }
.lateral .menu a:hover .menu-icono { background: rgba(255, 255, 255, .16); }
.lateral .menu a.activo { box-shadow: 0 4px 14px rgba(0, 20, 30, .25); }
.lateral .menu a.activo .menu-icono { background: color-mix(in srgb, var(--naranja, #ff8c4a) 16%, transparent); }
.menu-texto { flex: 1; min-width: 0; }
.menu-aviso { min-width: 1.45rem; height: 1.45rem; padding: 0 .4rem; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: .75rem; font-weight: 800; background: rgba(255, 255, 255, .18); color: inherit; box-sizing: border-box; }
.menu-aviso.rojo { background: var(--rojo); color: #fff; }
.lateral .menu a.activo .menu-aviso:not(.rojo) { background: var(--superficie-2); }
@media (max-width: 900px) {
  .lateral .menu a { min-height: 40px; }
  .menu-icono { width: 30px; height: 30px; }
}
