:root {
  color-scheme: light;
  --tinta: #23192c;
  --muted: #695d72;
  --fondo: #f7f4f8;
  --papel: #fff;
  --linea: #e5dce9;
  --ciruela: #3b254a;
  --violeta: #65417d;
  --lavanda: #eee4f4;
  --ambar: #f3cf86;
  --verde: #1d6552;
  --rojo: #a02648;
  font: 16px/1.5 "DM Sans", "Segoe UI", sans-serif;
  color: var(--tinta);
  background: var(--fondo);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 3px solid #9b63c0; outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--violeta); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.16; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 690; letter-spacing: -.05em; }
h2 { font-size: 1.2rem; letter-spacing: -.022em; }
h3 { font-size: .98rem; }
small { display: block; }
.inicio, .vacio { padding: 1.4rem; color: var(--muted); }
.vacio.breve { padding: .7rem 0 0; }
.texto-secundario { color: var(--muted); font-size: .9rem; }

.marca { display: flex; align-items: center; gap: .8rem; font-size: 1.4rem; font-weight: 700; line-height: 1.05; letter-spacing: -.035em; }
.marca small { margin-top: .35rem; font-size: .75rem; letter-spacing: .02em; opacity: .78; }
.llave { width: 1.42rem; height: 1.42rem; border: 2px solid var(--ambar); border-radius: 50%; position: relative; flex: none; }
.llave::after { content: ""; position: absolute; width: .85rem; height: .38rem; left: .86rem; top: .99rem; transform: rotate(42deg); border-bottom: 2px solid var(--ambar); border-right: 2px solid var(--ambar); }
.estructura { min-height: 100dvh; display: grid; grid-template-columns: 16rem minmax(0, 1fr); }
.lateral { position: sticky; top: 0; align-self: start; background: var(--ciruela); color: #fff; height: 100dvh; padding: 2.2rem 1.45rem 1.6rem; display: flex; flex-direction: column; gap: .8rem; }
.lateral .marca { margin: 0 .2rem 1.8rem; }
.lateral nav { flex: 1; display: flex; flex-direction: column; gap: .35rem; }
.lateral nav button { border: 0; border-left: 3px solid transparent; border-radius: .35rem; background: transparent; color: #f7edf8; text-align: left; padding: .66rem .8rem; }
.lateral nav button:hover { background: #4e355e; }
.lateral nav button[aria-current] { background: #563767; border-left-color: var(--ambar); }
.sesion { display: flex; align-items: center; gap: .65rem; padding-top: 1rem; border-top: 1px solid #684e73; min-width: 0; }
.sesion span:last-child { min-width: 0; }
.sesion strong, .sesion small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sesion strong { font-size: .9rem; }
.sesion small { color: #e7d9ee; font-size: .75rem; }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; background: var(--ambar); color: var(--ciruela); border-radius: 50%; font-weight: 700; }
.salir { color: #f7edf8; background: transparent; align-self: flex-start; font-size: .87rem; }

.principal { width: 100%; max-width: 90rem; padding: clamp(1.4rem, 4vw, 3.5rem); }
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.encabezado p { color: var(--muted); margin-top: .5rem; }
.superficie { background: var(--papel); border: 1px solid var(--linea); border-radius: .65rem; min-width: 0; }
.titulo-seccion { display: flex; justify-content: space-between; align-items: center; padding: 1.15rem 1.25rem; gap: 1rem; border-bottom: 1px solid var(--linea); }
.titulo-seccion span { color: var(--muted); }
.admin-columnas { display: grid; grid-template-columns: minmax(17rem, .9fr) minmax(21rem, 1.5fr); gap: 1.2rem; align-items: start; }
.fila-distribuidor { width: 100%; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; text-align: left; background: transparent; color: var(--tinta); border: 0; padding: .8rem 1.15rem; }
.fila-distribuidor + .fila-distribuidor { border-top: 1px solid var(--linea); }
.fila-distribuidor:hover, .fila-distribuidor[aria-pressed="true"] { background: #f7f0fa; }
.fila-distribuidor strong { overflow-wrap: anywhere; }
.monograma { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border-radius: .5rem; background: var(--lavanda); color: var(--violeta); font-weight: 700; }
.detalle-cabecera, .fila-titulo, .fila-cuenta { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.detalle-cabecera { padding: 1.25rem; }
.detalle-cabecera .estado { margin-top: .55rem; }
.detalle-bloque { border-top: 1px solid var(--linea); padding: 1.1rem 1.25rem; }
.detalle-bloque p, .fila-titulo p { color: var(--muted); font-size: .88rem; margin-top: .25rem; overflow-wrap: anywhere; }
.fila-cuenta { padding: .65rem 0; margin-top: .55rem; border-bottom: 1px solid var(--linea); overflow-wrap: anywhere; }

.boton { border: 1px solid transparent; border-radius: .4rem; padding: .6rem .85rem; font-weight: 650; line-height: 1.24; min-height: 2.45rem; }
.primario { background: var(--violeta); color: white; }
.primario:hover:enabled { background: #543369; }
.secundario { background: var(--papel); border-color: #d9c9e0; color: var(--ciruela); }
.secundario:hover:enabled { background: var(--lavanda); }
.discreto { background: transparent; color: var(--rojo); }
.discreto:hover:enabled { background: #fae9ef; }
.peligro { background: var(--rojo); color: white; }
.peligro:hover:enabled { background: #82203a; }
.icono { border: 1px solid var(--linea); border-radius: .35rem; background: var(--papel); color: var(--tinta); min-width: 2.25rem; min-height: 2.25rem; font-size: 1.2rem; }
.ancho-completo { width: 100%; }
.estado { display: inline-block; border-radius: .28rem; padding: .16rem .44rem; background: #eee9f0; color: #594963; font-size: .77rem; font-weight: 700; }
.estado.activo, .estado.confirmada { background: #e2f4ec; color: var(--verde); }
.estado.borrador, .estado.retenida { background: #fbecd0; color: #715019; }
.estado.cancelada, .estado.suspendido { background: #f8e4ec; color: #8b2447; }

label { display: grid; gap: .35rem; font-size: .88rem; font-weight: 650; }
input, select { width: 100%; min-width: 0; padding: .55rem .65rem; border: 1px solid #d6c7dc; border-radius: .38rem; background: white; color: var(--tinta); }
.casilla { display: flex; align-items: center; gap: .5rem; align-self: end; min-height: 2.4rem; }
.casilla input { width: auto; accent-color: var(--violeta); }
.error { padding: .65rem .9rem; border-left: 3px solid var(--rojo); background: #faedf1; color: #7d1b38; margin: .65rem 0; }
.filtros { display: grid; grid-template-columns: minmax(11rem, 1.8fr) minmax(8rem, 1fr) minmax(8rem, 1fr) auto; gap: .65rem; align-items: end; margin-bottom: 1.25rem; }
.refresco { color: var(--verde); font-size: .86rem; }
.refresco::before { content: ""; width: .45rem; height: .45rem; background: currentColor; display: inline-block; border-radius: 50%; margin: 0 .42rem .06rem 0; }
.indicadores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.2rem; }
.indicadores section { min-width: 0; background: var(--lavanda); padding: .85rem 1rem; border-radius: .42rem; }
.indicadores span { display: block; color: #5d466b; font-size: .86rem; }
.indicadores strong { font-size: 1.9rem; line-height: 1.1; display: block; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.indicadores .indicador-ocupacion { background: #fbecd0; }
.indicadores progress { display: block; width: 100%; height: .42rem; margin-top: .55rem; accent-color: #7f5316; }
.libro + .libro { margin-top: 1.2rem; }
.tabla-scroll { overflow-x: auto; }
.calendario-filtros { grid-template-columns: minmax(12rem, 1fr) auto; }
.calendario-meses { display: flex; align-items: flex-end; gap: .5rem; }
.calendario-meses .icono { min-height: 2.55rem; min-width: 2.55rem; font-size: 1.45rem; line-height: 1; }
.calendario-meses input { min-width: 10.2rem; }
.calendario-meses .boton { min-height: 2.55rem; white-space: nowrap; }
.calendario-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem 1.5rem; flex-wrap: wrap; padding: 1.15rem 1.25rem; }
.calendario-cabecera p { color: var(--muted); margin-top: .25rem; font-size: .86rem; }
.calendario-leyenda { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .45rem .9rem; color: var(--muted); font-size: .8rem; }
.calendario-leyenda li { display: flex; align-items: center; gap: .35rem; }
.calendario-leyenda span { display: block; width: .85rem; height: .85rem; border: 1px solid currentColor; border-radius: .25rem; }
.calendario-hotel { border-top: 1px solid var(--linea); }
.calendario-hotel-titulo { display: flex; align-items: center; gap: .7rem; padding: .8rem 1.25rem; }
.calendario-scroll { max-height: 26rem; scrollbar-color: #bba5c7 #f4eef7; scroll-padding: 2.5rem 0 0 12rem; }
.calendario-tabla { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.calendario-tabla th, .calendario-tabla td { padding: .35rem; text-align: center; min-width: 2.65rem; border-right: 1px solid #f1ebf3; }
.calendario-tabla thead th { position: sticky; top: 0; z-index: 2; background: #f8f4fa; }
.calendario-tabla thead th small { font-size: .7rem; line-height: 1.2; }
.calendario-tabla thead th strong { font-size: .92rem; }
.calendario-tabla th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; width: 12rem; min-width: 12rem; max-width: 12rem; white-space: normal; overflow-wrap: anywhere; padding: .55rem .8rem; background: white; box-shadow: 1px 0 var(--linea); }
.calendario-tabla thead th:first-child { z-index: 3; background: #f8f4fa; }
.calendario-tabla tbody th small { color: var(--muted); font-size: .73rem; font-weight: 400; }
.calendario-tabla tr:last-child th { border-bottom: 0; }
.calendario-tabla .dia-finde { background: #f7f3fa; }
.calendario-tabla .dia-hoy { background: #f1e6f7; }
.calendario-tabla thead .dia-hoy { box-shadow: inset 0 -2px var(--violeta); color: var(--ciruela); }
.cupo { display: grid; place-items: center; width: 100%; min-height: 1.65rem; padding: 0; border: 0; border-radius: .28rem; font-size: .82rem; font-weight: 700; }
.cupo:hover { box-shadow: inset 0 0 0 1px currentColor; }
.cupo:focus-visible { outline-offset: -2px; }
.cupo-total { background: #e4f3eb; color: #21604d; }
.cupo-parcial { background: #fbecd0; color: #6f4a12; }
.cupo-agotado { background: #f8e4ec; color: #852744; }
.cupo-cerrado { background: #eee9f0; color: #5e5267; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .72rem .95rem; text-align: left; border-bottom: 1px solid var(--linea); }
th { color: var(--muted); font-weight: 650; background: #faf7fb; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td small { color: var(--muted); }
.folio { color: var(--violeta); white-space: nowrap; }
.acciones-tabla { display: flex; gap: .35rem; }
.pie-libro { padding: .8rem 1rem; border-top: 1px solid var(--linea); }

.acceso { min-height: 100dvh; display: grid; grid-template-columns: minmax(13rem, 32%) minmax(0, 1fr); }
.acceso-marca { background: var(--ciruela); color: white; padding: 3rem; }
.acceso-contenido { align-self: center; justify-self: center; width: min(25rem, 100% - 3rem); margin: 2rem; }
.acceso form { display: grid; gap: 1rem; margin-top: 1.65rem; }
.enlace-volver { display: inline-block; margin-top: 1.25rem; }
dialog { width: min(29rem, 100% - 2rem); padding: 0; color: var(--tinta); background: var(--papel); border: 1px solid var(--linea); border-radius: .65rem; }
dialog.ancho { width: min(56rem, 100% - 2rem); }
dialog::backdrop { background: #24152f9c; }
.cabecera-dialogo, .pie-dialogo { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.2rem; }
.cabecera-dialogo { justify-content: space-between; border-bottom: 1px solid var(--linea); }
.pie-dialogo { justify-content: flex-end; border-top: 1px solid var(--linea); }
.cuerpo-dialogo { display: grid; gap: .9rem; padding: 1.2rem; max-height: 67dvh; overflow-y: auto; }
.detalle-noche-fecha { color: var(--muted); font-size: .9rem; }
.detalle-noche-fecha strong { color: var(--ciruela); }
.detalle-noche { min-width: 0; }
.cupo-noche { display: flex; flex-wrap: wrap; gap: .25rem 1.15rem; padding: .7rem .85rem; border-radius: .35rem; background: var(--lavanda); color: var(--ciruela); font-size: .88rem; }
.reservas-noche { margin: .3rem 0 0; padding: 0; list-style: none; }
.reservas-noche li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .35rem .6rem; padding: .8rem 0; border-bottom: 1px solid var(--linea); }
.reservas-noche li:last-child { border-bottom: 0; padding-bottom: 0; }
.reserva-noche-titular { overflow-wrap: anywhere; }
.reservas-noche .estado, .reserva-noche-importe { justify-self: end; }
.reserva-noche-importe { align-self: end; font-size: .9rem; white-space: nowrap; }
.sin-reservas-noche { padding-top: .8rem; color: var(--muted); }
.copiar { justify-self: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.tipos { padding-top: .9rem; border-top: 1px solid var(--linea); }
.tipo-fila { display: grid; grid-template-columns: .8fr 1.3fr .65fr .6fr 1fr auto; gap: .5rem; align-items: end; margin-top: .8rem; }
.quitar-tipo { margin-bottom: .08rem; }
#aviso { position: fixed; z-index: 2; right: 1.2rem; bottom: 1.2rem; max-width: min(24rem, 90vw); background: var(--ciruela); color: white; border: 1px solid #614271; border-radius: .4rem; padding: .7rem 1rem; }

@media (max-width: 900px) {
  .estructura { grid-template-columns: 12rem minmax(0, 1fr); }
  .lateral { padding: 1.5rem 1rem; }
  .admin-columnas { grid-template-columns: 1fr; }
  .filtros { grid-template-columns: 1fr 1fr; }
  .calendario-filtros { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .estructura, .acceso { display: block; }
  .lateral { position: static; height: auto; gap: .6rem; display: grid; grid-template-columns: 1fr auto; padding: .9rem 1.1rem; }
  .lateral .marca { margin: 0; }
  .lateral nav { flex-direction: row; grid-column: 1 / -1; grid-row: 2; }
  .lateral .sesion { display: none; }
  .salir { grid-column: 2; grid-row: 1; align-self: center; }
  .principal { padding: 1.25rem 1rem; }
  .encabezado { margin-bottom: 1.2rem; align-items: flex-start; }
  .acceso-marca { padding: 1.4rem; }
  .acceso-contenido { margin: 2.5rem auto; }
  .indicadores { gap: .35rem; }
  .indicadores section { padding: .65rem .45rem; }
  .indicadores span { font-size: .75rem; }
  .indicadores strong { font-size: 1.45rem; }
  .form-grid, .tipo-fila { grid-template-columns: 1fr 1fr; }
  .tipo-fila { border-top: 1px solid var(--linea); padding-top: .7rem; }
  .calendario-tabla th:first-child { width: 8.75rem; min-width: 8.75rem; max-width: 8.75rem; padding-inline: .5rem; }
  .calendario-scroll { scroll-padding-left: 8.75rem; }
  .calendario-cabecera, .calendario-hotel-titulo { padding-inline: .85rem; }
  .calendario-meses { flex-wrap: wrap; }
  .acciones-tabla { flex-wrap: wrap; }
}
