:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #efebe2;
  --text: #1c2526;
  --muted: #5d6a6b;
  --line: #e2ddd1;
  --brand: #0b5c7b;
  --brand-ink: #ffffff;
  --free-bg: #dcf1e6;
  --free-ink: #14532d;
  --partial-bg: #fcecc8;
  --partial-ink: #7a4b00;
  --full-bg: #f6dcd8;
  --full-ink: #8a2419;
  --past-ink: #b3b8b4;
  --focus: #0b5c7b;
  --range-bg: #b2d6e0;
  --cell-full: #ebe6dc;
  --chart: #0b8f86;
  --chart-soft: #b9e3df;
  --chart-track: #e3efed;
  --grid: #ece8de;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1a20;
    --surface: #11252d;
    --surface-2: #1a3135;
    --text: #e7eeec;
    --muted: #9fb0ae;
    --line: #24403f;
    --brand: #6fb2c0;
    --brand-ink: #04222c;
    --free-bg: #173f2e;
    --free-ink: #a7e8c3;
    --partial-bg: #4a3712;
    --partial-ink: #fbd88a;
    --full-bg: #4a1f1b;
    --full-ink: #f5b3a9;
    --past-ink: #4f6363;
    --focus: #8fcad6;
    --range-bg: #285c6b;
    --cell-full: #3a4c50;
    --chart: #24a69a;
    --chart-soft: #1a4a46;
    --chart-track: #1d3a3c;
    --grid: #1f3a3d;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1a20;
  --surface: #11252d;
  --surface-2: #1a3135;
  --text: #e7eeec;
  --muted: #9fb0ae;
  --line: #24403f;
  --brand: #6fb2c0;
  --brand-ink: #04222c;
  --free-bg: #173f2e;
  --free-ink: #a7e8c3;
  --partial-bg: #4a3712;
  --partial-ink: #fbd88a;
  --full-bg: #4a1f1b;
  --full-ink: #f5b3a9;
  --past-ink: #4f6363;
  --focus: #8fcad6;
  --range-bg: #285c6b;
  --cell-full: #3a4c50;
  --chart: #24a69a;
  --chart-soft: #1a4a46;
  --chart-track: #1d3a3c;
  --grid: #1f3a3d;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Encabezado */
.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 5;
}
.top-in {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.brand picture { display: block; line-height: 0; }
.brand-logo { height: 36px; width: auto; max-width: 100%; display: block; }
.sub { font-size: .75rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
@media (max-width: 380px) { .brand-logo { height: 32px; } }

.status {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--free-ink);
}
.status.offline::before { background: var(--partial-ink); }
.status:empty::before { display: none; }

.banner {
  background: var(--partial-bg);
  color: var(--partial-ink);
  text-align: center;
  font-size: .85rem;
  padding: 8px 16px;
}

/* Estructura */
.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 360px minmax(0, 1fr); align-items: start; padding-top: 24px; }
  .rooms { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
}
/* En celular, como en la app de anfitriones: primero la lista y al tocar, el calendario. */
@media (max-width: 899px) {
  .layout.show-list .calendar-panel { display: none; }
  .layout.show-room .rooms { display: none; }
}
@media (min-width: 900px) {
  .back-link { display: none !important; }
}

.section-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Lista de habitaciones: tarjetas con foto, datos y mini calendario de puntos */
.rooms-title { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.rooms-sub { color: var(--muted); font-size: .88rem; margin: 4px 0 14px; }
@media (min-width: 900px) {
  .rooms-title { font-size: 1.35rem; }
  .rooms-sub { margin-bottom: 10px; }
}
.room-list { display: grid; gap: 10px; }

.room-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px 10px 10px;
  transition: border-color .15s, box-shadow .15s;
}
.room-card:hover { border-color: var(--muted); }
.room-card[aria-current="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.room-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.room-info { min-width: 0; display: grid; gap: 1px; }
.room-info .name {
  font-weight: 650;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-info .type, .room-info .price { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mini calendario del mes: un punto por día, barras para noches ocupadas, hoy en coral. */
.mini-cal {
  display: grid;
  grid-template-columns: repeat(7, 11px);
  grid-auto-rows: 11px;
  align-items: center;
}
.mini-cal span { position: relative; height: 11px; }
.mini-cal .dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: var(--text);
}
.mini-cal .past::before { background: var(--line); }
.mini-cal .today::before { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #d4541f; }
.mini-cal .occ::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  margin-top: -2.5px;
  background: var(--text);
}
.mini-cal .occ.run-start::before { left: 2px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; }
.mini-cal .occ.run-end::before { right: 2px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; }
.mini-cal .occ.past::before { background: var(--line); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 600;
  font-size: .9rem;
  padding: 0 0 10px;
}

/* Panel del calendario */
.calendar-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
@media (min-width: 600px) { .calendar-panel { padding: 24px; } }

.room-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.room-head h2 { font-size: 1.3rem; font-weight: 650; line-height: 1.25; }
.room-summary { color: var(--muted); font-size: .9rem; margin-top: 2px; }

/* Movimiento de campanita del botón "Reserva aquí": se balancea desde arriba, cada vez con
   menos fuerza, y descansa antes de volver a sonar. */
/* Misma campanita, con menos ángulo para una tarjeta grande. */
@keyframes book-ring-card {
  0% { transform: rotate(0); }
  4% { transform: rotate(4deg); }
  8% { transform: rotate(-3.5deg); }
  12% { transform: rotate(3deg); }
  16% { transform: rotate(-2.5deg); }
  20% { transform: rotate(1.5deg); }
  24% { transform: rotate(-1deg); }
  28%, 100% { transform: rotate(0); }
}
@keyframes book-ring {
  0% { transform: rotate(0); }
  4% { transform: rotate(9deg); }
  8% { transform: rotate(-8deg); }
  12% { transform: rotate(7deg); }
  16% { transform: rotate(-6deg); }
  20% { transform: rotate(4deg); }
  24% { transform: rotate(-3deg); }
  28% { transform: rotate(1deg); }
  32%, 100% { transform: rotate(0); }
}
.icon-btn, .text-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  height: 36px;
}
.icon-btn { width: 36px; display: grid; place-items: center; }
.text-btn { padding: 0 14px; font-size: .85rem; font-weight: 500; }
.icon-btn:hover:not(:disabled), .text-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled, .text-btn:disabled { opacity: .35; cursor: default; }

/* Calendario al estilo de la app de anfitriones: meses uno debajo de otro,
   cada día con su precio, ocupados en gris y tachados, fechas elegidas en oscuro. */
.months {
  display: grid;
  gap: 30px;
  margin-top: 18px;
}
@media (min-width: 900px) { .day { min-height: 70px; } }

.month h3 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.dow {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding-bottom: 2px;
}
.day {
  min-height: 62px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 7px 6px 6px 8px;
  font-size: .92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  position: relative;
  min-width: 0;
  text-align: left;
}
.d-num { line-height: 1.1; }
.d-price { font-size: .72rem; font-weight: 600; opacity: .75; white-space: nowrap; }
.d-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: .55rem;
  font-weight: 700;
  color: var(--partial-ink);
  background: var(--partial-bg);
  border-radius: 999px;
  padding: 1px 4px;
}
.day.s-free { background: var(--free-bg); color: var(--free-ink); border: 1px solid transparent; }
.day.s-partial { background: var(--partial-bg); color: var(--partial-ink); border: 1px solid transparent; }
.day.s-full { background: var(--full-bg); border: 1px solid transparent; color: var(--full-ink); }
.day.s-full .d-num { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.day.s-past, .day.s-unknown { color: var(--past-ink); font-weight: 400; border: 1px solid transparent; }
.day.is-today { box-shadow: inset 0 0 0 2px var(--text); }

/* Días que se pueden tocar para elegir llegada y salida */
button.day {
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
button.day:hover { border-color: var(--brand); }
/* Tus fechas: llegada y salida en el color principal; las noches de en medio, más claras. */
.day.is-picked { background: var(--range-bg); border-color: transparent; color: var(--text); }
.day.is-picked.is-edge { background: var(--brand); color: var(--brand-ink); }
.day.is-picked .d-price { color: inherit; opacity: .85; }
.day.is-picked .d-num { text-decoration: none; }
@media (max-width: 380px) {
  .day { min-height: 54px; padding: 5px 4px 4px 5px; }
  .d-price { font-size: .64rem; }
}

/* Ayuda arriba, antes de elegir fechas */
.stay {
  margin-top: 12px;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
}
.stay p { margin: 0; }
.stay-hint { font-size: .88rem; color: var(--muted); }

/* Panel flotante con la estancia elegida */
body.has-stay-bar .layout { padding-bottom: 240px; }
.stay-bar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  z-index: 20;
  display: grid;
  gap: 8px;
  justify-items: center;
}
/* En computadora, centrado sobre el calendario (a la derecha de la lista de 360 px). */
@media (min-width: 900px) {
  .stay-bar { left: calc(50% + 188px); width: min(560px, calc(min(1100px, 100vw - 32px) - 410px)); }
}
.stay-msg {
  justify-self: stretch;
  background: var(--full-bg);
  color: var(--full-ink);
  font-size: .85rem;
  font-weight: 600;
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .45);
}
.stay-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  font-weight: 700;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .55);
}
.stay-pill button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: color-mix(in srgb, currentColor 18%, transparent);
  color: inherit;
  display: grid;
  place-items: center;
}
.stay-cards {
  justify-self: stretch;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
}
.stay-cards.no-book { grid-template-columns: 1fr; }
.stay-card {
  border-radius: 18px;
  padding: 12px 16px;
  background: var(--brand);
  color: var(--brand-ink);
  border: 0;
  text-decoration: none;
  display: grid;
  align-content: center;
  gap: 2px;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .55);
  text-align: left;
  font: inherit;
}
.stay-card-label { font-size: .78rem; opacity: .8; font-weight: 600; }
.stay-card-sub { font-size: .8rem; opacity: .85; }
/* 1: "Reserva aquí", en coral y con el movimiento de campanita. */
.stay-book {
  grid-row: 1 / 3;
  background: linear-gradient(135deg, #b83d1c, #d4541f);
  color: #fff;
  align-content: space-between;
  min-height: 132px;
  transform-origin: 50% 0;
  animation: book-ring-card 3.2s ease-in-out infinite;
}
.stay-book strong { font-size: 1.35rem; line-height: 1.15; }
.stay-book .stay-card-label { color: rgba(255, 255, 255, .85); }
.stay-book:hover, .stay-book:focus-visible { animation: none; filter: brightness(1.06); }
.stay-price strong { font-size: 1.6rem; line-height: 1.1; }
.stay-price strong.is-range { font-size: 1.15rem; }
/* 2: "Cambiar fechas" */
.stay-change { font-weight: 700; font-size: .95rem; cursor: pointer; }
.stay-change:hover { filter: brightness(1.1); }

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: .82rem;
  color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.swatch.s-free { background: var(--free-bg); box-shadow: inset 0 0 0 1px var(--free-ink); }
.swatch.s-partial { background: var(--partial-bg); box-shadow: inset 0 0 0 1px var(--partial-ink); }
.swatch.s-full { background: var(--full-bg); box-shadow: inset 0 0 0 1px var(--full-ink); }
.swatch.s-picked { background: var(--brand); }
.note { font-size: .8rem; color: var(--muted); margin-top: 16px; }


.error {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  background: var(--full-bg);
  color: var(--full-ink);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: .9rem;
}

/* Encabezado: acciones y pestañas */
.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.text-btn.small { height: 30px; padding: 0 12px; font-size: .8rem; }
.staff-access {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.staff-access:hover { color: var(--text); background: var(--surface-2); }
.tabs {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 8px 10px 10px;
  border-bottom: 2.5px solid transparent;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Llegadas y salidas */
.day-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}
@media (min-width: 900px) { .day-view { padding-top: 24px; } }

.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.day-nav { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 280px; }
.day-title { min-width: 0; flex: 1; }
.day-rel {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brand);
  min-height: 1.1em;
}
.day-title h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.25; }
.day-tools { display: flex; align-items: center; gap: 8px; }
.date-pick input {
  font: inherit;
  font-size: .85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 36px;
  padding: 0 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}
.stat strong { font-size: 1.35rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }
.day-note {
  font-size: .85rem;
  background: var(--partial-bg);
  color: var(--partial-ink);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

.lists { display: grid; gap: 20px; }
@media (min-width: 800px) { .lists { grid-template-columns: 1fr 1fr; align-items: start; } }
.list-panel h3 {
  font-size: 1rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.count {
  font-size: .75rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 1px 8px;
}
.cards { display: grid; gap: 10px; }
.empty {
  color: var(--muted);
  font-size: .9rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.guest-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}
.guest-card.is-done { opacity: .72; }
.gc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.gc-top h4 { font-size: 1.02rem; font-weight: 650; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.gc-rooms { list-style: none; font-size: .9rem; }
.gc-rooms strong { font-weight: 600; }
.gc-rooms span { color: var(--muted); }
.gc-meta { font-size: .82rem; color: var(--muted); }
.gc-money {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .85rem;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 2px;
}
.gc-money strong { font-variant-numeric: tabular-nums; }
.gc-money.is-due { color: var(--partial-ink); }
.gc-money.is-due strong { font-size: 1rem; }
.gc-money.is-paid { color: var(--free-ink); }

.pill {
  flex: none;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill-ok { background: var(--free-bg); color: var(--free-ink); }
.pill-warn { background: var(--partial-bg); color: var(--partial-ink); }

/* Acceso */
.login-view {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 10px;
}
.login-card h2 { font-size: 1.2rem; }
.login-card label { font-size: .85rem; font-weight: 600; margin-top: 4px; }
.login-card input {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 44px;
  padding: 0 12px;
}
.muted { color: var(--muted); font-size: .9rem; }
.login-error { color: var(--full-ink); font-size: .85rem; }
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  border: 0;
  border-radius: 10px;
  height: 44px;
  font-weight: 600;
  margin-top: 4px;
}
.btn-primary:disabled { opacity: .6; }
.link { color: var(--brand); font-size: .85rem; text-align: center; margin-top: 4px; }

@media (max-width: 480px) {
  .status { display: none; }
}

/* Elegir perfil */
.choose-view {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px 40px;
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.choose-view h2 { font-size: 1.35rem; font-weight: 650; text-align: center; }
.choose-options { display: grid; gap: 12px; }
.choose-btn {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 88px;
  transition: border-color .15s, background .15s;
}
.choose-btn:hover, .choose-btn:active { border-color: var(--brand); background: var(--surface-2); }
.choose-btn svg { grid-row: 1 / 3; color: var(--brand); }
.choose-title { font-weight: 650; font-size: 1.05rem; }
.choose-desc { font-size: .85rem; color: var(--muted); }

.staff-link { grid-column: 1 / -1; justify-self: center; }

/* Fotos de la habitación */
.room-media {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}
.media-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.media-tile:hover img { transform: scale(1.04); }
.media-tile.is-pano img { object-position: center; }
.tile-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
}
.tile-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}

/* Visor (siempre oscuro, como cualquier visor de fotos) */
.viewer {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(1100px, 100vw);
  height: min(820px, 100dvh);
  max-width: 100vw;
  max-height: 100dvh;
  background: #0b0f10;
  color: #f2f5f4;
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.viewer[open] { display: flex; }
.viewer::backdrop { background: rgba(0, 0, 0, .75); }
@media (max-width: 700px) {
  .viewer { width: 100vw; height: 100dvh; border-radius: 0; }
}
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
}
.viewer-bar h2 { font-size: 1rem; font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-tabs { display: flex; gap: 4px; background: rgba(255, 255, 255, .08); border-radius: 999px; padding: 3px; }
.viewer-tab {
  border: 0;
  background: none;
  color: #c5cfcd;
  font-size: .82rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.viewer-tab[aria-selected="true"] { background: #f2f5f4; color: #0b0f10; }
.viewer-close {
  border: 0;
  background: rgba(255, 255, 255, .08);
  color: #f2f5f4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.viewer-close:hover { background: rgba(255, 255, 255, .16); }
.viewer :focus-visible { outline-color: #7fd6cf; }

.viewer-stage { position: relative; flex: 1; min-height: 0; }
.photo-stage, .pano-stage { position: absolute; inset: 0; margin: 0; }
/* touch-action: none → los gestos (deslizar, pellizcar, arrastrar) los maneja viewer.js. */
.photo-stage { touch-action: none; user-select: none; overflow: hidden; cursor: zoom-in; }
.photo-stage.is-zoomed { cursor: grab; }
.photo-stage.is-zoomed:active { cursor: grabbing; }
/* La foto ocupa todo el espacio del visor y se ajusta sin recortarse (vertical u horizontal).
   Con max-height dentro de una cuadrícula, las fotos verticales se salían en pantallas anchas. */
.photo-stage img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transform-origin: 50% 50%;
  will-change: transform;
}
.photo-stage img.is-animating { transition: transform .22s ease; }
.zoom-ctrl {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, .5);
  border-radius: 999px;
  padding: 3px;
  z-index: 1;
}
.zoom-ctrl button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  display: grid;
  place-items: center;
}
.zoom-ctrl button:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }
.zoom-ctrl button:disabled { opacity: .35; cursor: default; }
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  display: grid;
  place-items: center;
}
.viewer-nav:hover { background: rgba(0, 0, 0, .7); }
.viewer-nav.prev { left: 10px; }
.viewer-nav.next { right: 10px; }
.viewer-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 16px 12px;
  font-size: .88rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.viewer-count { color: #c5cfcd; font-variant-numeric: tabular-nums; }

#pano { width: 100%; height: 100%; }
.pano-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .9rem;
  color: #c5cfcd;
  pointer-events: none;
}
.pano-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .8rem;
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
  pointer-events: none;
}

.viewer-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  scrollbar-width: thin;
}
.viewer-thumb {
  flex: none;
  width: 76px;
  height: 54px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #1b2224;
  opacity: .6;
}
.viewer-thumb[aria-current="true"] { border-color: #f2f5f4; opacity: 1; }
.viewer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Administración: fotos de las habitaciones */
.media-admin summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
}
.media-admin summary::-webkit-details-marker { display: none; }
.media-admin summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .15s;
  align-self: center;
}
.media-admin[open] summary::before { transform: rotate(45deg); }
.media-warning {
  background: var(--full-bg);
  color: var(--full-ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .85rem;
  font-weight: 600;
}
.media-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.btn-upload.media-zip {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.btn-upload.media-zip:hover { background: var(--brand); color: var(--brand-ink); }
.media-zip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.media-zip[hidden] { display: none; }
.media-room { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); max-width: 320px; }
.media-room select {
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 40px;
  padding: 0 10px;
}
.media-group { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.media-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.media-group-head .adm-sub { margin: 0; }
.btn-upload {
  position: relative;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  font-size: .85rem;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.btn-upload:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.media-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 8px;
  padding-bottom: 8px;
  background: var(--bg);
}
.media-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.media-card.is-pano img { aspect-ratio: 2 / 1; }
.media-caption {
  font: inherit;
  font-size: .82rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 34px;
  padding: 0 8px;
  margin: 0 8px;
  width: calc(100% - 16px);
  min-width: 0;
}
.media-actions { display: flex; gap: 6px; padding: 0 8px; }
.media-actions .danger { margin-left: auto; color: var(--full-ink); }
.media-card.is-folder { opacity: .8; }
.media-folder-note { font-size: .78rem; color: var(--muted); padding: 0 8px; }
.media-status { font-size: .85rem; color: var(--muted); min-height: 1.3em; }
.media-status.is-error { color: var(--full-ink); font-weight: 600; }

/* Administración */
.admin-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.adm-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
}
.adm-filters label {
  display: grid;
  gap: 4px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}
.adm-filters input {
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 36px;
  padding: 0 10px;
}
.adm-status { font-size: .85rem; color: var(--muted); align-self: center; }
.adm-note { font-size: .8rem; color: var(--muted); }

.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .kpis:not(.kpis-2) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  min-width: 0;
}
.kpi-label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.35rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.kpi-sub { font-size: .75rem; color: var(--muted); }

.adm-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.adm-card h3 { font-size: 1rem; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.adm-sub { font-size: .85rem; font-weight: 600; color: var(--muted); margin-top: 4px; }

/* Gráfica de columnas (una serie) */
.chart-host { position: relative; }
.colchart {
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: 200px auto;
  column-gap: 8px;
}
.colchart-axis {
  grid-row: 1;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  transform: translateY(-.45em);
  height: calc(100% + .9em);
}
.colchart-grid, .colchart-bars { grid-row: 1; grid-column: 2; }
.colchart-grid { display: flex; flex-direction: column; justify-content: space-between; }
.colchart-grid span { border-top: 1px solid var(--grid); }
.colchart-bars {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  align-items: end;
  position: relative;
  border-bottom: 1px solid var(--muted);
}
.colchart-col {
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: default;
}
.colchart-col:hover, .colchart-col:focus-visible { background: var(--surface-2); }
.colchart-bar {
  width: min(24px, 70%);
  background: var(--chart);
  border-radius: 4px 4px 0 0;
  min-height: 1px;
}
.colchart-col.is-future .colchart-bar {
  background: repeating-linear-gradient(135deg, var(--chart) 0 4px, var(--chart-soft) 4px 7px);
}
.colchart-labels {
  grid-row: 2;
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  font-size: .68rem;
  color: var(--muted);
  text-align: center;
  padding-top: 6px;
  white-space: nowrap;
}
.chart-tip {
  position: absolute;
  z-index: 2;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .75rem;
  display: grid;
  gap: 1px;
  pointer-events: none;
  min-width: 150px;
}
.chart-tip strong { font-size: 1rem; }
.chart-tip .tip-title { font-weight: 600; }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th, .data-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.data-table thead th { font-size: .75rem; color: var(--muted); font-weight: 600; }
.data-table th:first-child, .data-table td:first-child { text-align: left; padding-left: 0; }
.data-table tbody th { font-weight: 600; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.empty-cell { text-align: center !important; color: var(--muted); }

.meter-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.meter {
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: var(--chart-track);
  overflow: hidden;
  display: inline-block;
}
.meter-fill { display: block; height: 100%; background: var(--chart); border-radius: 999px; }
.meter-value { min-width: 4.2em; }

/* Barras horizontales (anticipación) */
.hbars { display: grid; gap: 8px; }
.hbar {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
}
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 1px; }
.hbar-value { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Alertas */
.alerts { display: grid; gap: 8px; }
.alert-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--partial-ink);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}
.alert-card h4 { font-size: .92rem; font-weight: 650; }
.alert-detail { font-size: .82rem; overflow-wrap: anywhere; }
.alert-hint { font-size: .78rem; color: var(--muted); }

/* Modo incrustado (?embed=1) para ponerlo dentro de la página del hotel */
.embed .top, .embed .banner { display: none; }
.embed .layout { padding: 0; }

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