/* static/css/hotel_bento_theme.css - Sistema de diseno Bento para DespeQ Hoteleria.
   Requiere core-design.css (fuentes autoalojadas Plus Jakarta Sans y JetBrains Mono).
   Se activa con .hb-theme en <body> (lobby, acceso) o en un contenedor (admin: #sec-hospedaje y
   #hotel-dashboard); las vistas que no lo declaran no cambian.
   Colores como tripletas RGB ("r g b") para componer transparencias: rgb(var(--hb-free) / .15). */

.hb-theme {
  --hb-font-ui: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --hb-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --hb-radius-card: 1rem;
  --hb-radius-control: 0.75rem;
  --hb-dur: 150ms;
  --hb-ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Estados de habitacion */
  --hb-free: 16 185 129;      /* Disponible / pagado */
  --hb-reserved: 245 158 11;  /* Reservada / pendiente */
  --hb-occupied: 239 68 68;   /* Ocupada */
  --hb-cleaning: 251 113 133; /* En limpieza (rosa: distinto de ocupada) */
  --hb-maint: 100 116 139;    /* Mantenimiento */

  /* Superficies - modo claro */
  --hb-bg: #f1f5f9;
  --hb-surface: rgb(255 255 255 / 0.92);
  --hb-surface-raised: #ffffff;
  --hb-border: rgb(15 23 42 / 0.1);
  --hb-text: #0f172a;
  --hb-muted: #334155;       /* Slate-700: >= 9.4:1 sobre #f1f5f9 y 10.3:1 sobre blanco */
  --hb-btn-bg: rgb(15 23 42 / 0.05);
  --hb-btn-bg-hover: rgb(15 23 42 / 0.09);
  --hb-shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 10px 24px -14px rgb(15 23 42 / 0.2);
  --hb-ambient: none;

  /* Tintas de estado sobre fondos pastel: texto saturado de alta densidad (>= 7.3:1) */
  --hb-ink-free: #064e3b;
  --hb-ink-reserved: #78350f;
  --hb-ink-occupied: #7f1d1d;
  --hb-ink-cleaning: #881337;
  --hb-ink-maint: #1e293b;
}

/* Superficies - modo oscuro: capas de grafito, nunca negro plano */
html.dark .hb-theme,
.hb-theme[data-hb-mode="dark"] {
  --hb-bg: #0b0f19;
  --hb-surface: rgb(24 24 27 / 0.72);
  --hb-surface-raised: rgb(39 39 42 / 0.55);
  --hb-border: rgb(255 255 255 / 0.1);
  --hb-text: #f4f4f5;
  --hb-muted: #a1a1aa;
  --hb-btn-bg: rgb(255 255 255 / 0.06);
  --hb-btn-bg-hover: rgb(255 255 255 / 0.11);
  --hb-shadow: inset 0 1px 0 rgb(255 255 255 / 0.04), 0 14px 32px -18px rgb(0 0 0 / 0.65);
  --hb-ink-free: #6ee7b7;
  --hb-ink-reserved: #fcd34d;
  --hb-ink-occupied: #fca5a5;
  --hb-ink-cleaning: #fda4af;
  --hb-ink-maint: #cbd5e1;
  --hb-ambient:
    radial-gradient(900px 480px at 88% -8%, rgb(16 185 129 / 0.07), transparent 62%),
    radial-gradient(760px 420px at -8% 108%, rgb(245 158 11 / 0.06), transparent 60%);
}

/* ---------- Base y tipografia ---------- */
body.hb-theme.hotel-app {
  background: var(--hb-ambient), var(--hb-bg);
  color: var(--hb-text);
  font-family: var(--hb-font-ui);
}

.hb-theme .hb-num,
.hb-theme .font-mono {
  font-family: var(--hb-font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- Paneles y cabecera (vidrio esmerilado) ---------- */
.hb-theme .hb-panel,
body.hb-theme #lobby-rack,
body.hb-theme #lobby-ticket {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-card);
  box-shadow: var(--hb-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

body.hb-theme #lobby-topbar,
body.hb-theme #hotel-status-bar {
  background: var(--hb-surface);
  border-color: var(--hb-border);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

body.hb-theme #hotel-status-bar [data-status] {
  background: var(--hb-btn-bg);
  border: 1px solid var(--hb-border);
  border-radius: 999px;
  font-size: 11px;
  padding: 0.35rem 0.7rem;
}

/* Ancho reservado: el texto de red/sesion cambia al perder la conexion sin que la barra se reacomode */
#hotel-status-bar > :is(#hotel-status-backend, #hotel-status-session) { min-width: 9.5rem; }

/* Respuesta tactil uniforme en la cabecera y el cobro */
body.hb-theme #lobby-header-actions > :is(button, a),
body.hb-theme #btn-cobro-mostrador,
body.hb-theme #btn-asignar-habitacion {
  transition: transform var(--hb-dur) var(--hb-ease), background-color var(--hb-dur) var(--hb-ease),
    box-shadow var(--hb-dur) var(--hb-ease);
}

body.hb-theme #lobby-header-actions > :is(button, a):active,
body.hb-theme #btn-cobro-mostrador:active,
body.hb-theme #btn-asignar-habitacion:active {
  transform: scale(0.95);
}

/* ---------- Boton base ---------- */
.hb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-control);
  background: var(--hb-btn-bg);
  color: var(--hb-text);
  font: 700 12px/1.1 var(--hb-font-ui);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform var(--hb-dur) var(--hb-ease), background-color var(--hb-dur) var(--hb-ease),
    border-color var(--hb-dur) var(--hb-ease), box-shadow var(--hb-dur) var(--hb-ease);
}

.hb-btn:active { transform: scale(0.95); }
.hb-btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

.hb-btn--success {
  background: rgb(var(--hb-free) / 0.16);
  border-color: rgb(var(--hb-free) / 0.4);
  color: color-mix(in srgb, rgb(var(--hb-free)) 70%, var(--hb-text));
}

.hb-btn--danger {
  background: rgb(var(--hb-occupied) / 0.14);
  border-color: rgb(var(--hb-occupied) / 0.4);
  color: color-mix(in srgb, rgb(var(--hb-occupied)) 62%, var(--hb-text));
}

.hb-btn--primary {
  background: rgb(var(--hb-free));
  border-color: transparent;
  color: #04130d;
  box-shadow: 0 8px 20px -10px rgb(var(--hb-free) / 0.75);
}

/* Variante no interactiva: el contenedor padre recibe el toque */
.hb-btn--static { pointer-events: none; }

@media (hover: hover) {
  .hb-btn:hover { background: var(--hb-btn-bg-hover); }
  .hb-btn--success:hover { background: rgb(var(--hb-free) / 0.26); }
  .hb-btn--danger:hover { background: rgb(var(--hb-occupied) / 0.24); }
  .hb-btn--primary:hover { background: rgb(var(--hb-free) / 0.88); }
}

/* ---------- Pildora de estado con glow ---------- */
.hb-pill {
  --hb-tone: 148 163 184;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgb(var(--hb-tone) / 0.38);
  border-radius: 999px;
  background: rgb(var(--hb-tone) / 0.14);
  color: rgb(var(--hb-tone));
  color: color-mix(in srgb, rgb(var(--hb-tone)) 62%, var(--hb-text));
  font: 700 11px/1 var(--hb-font-ui);
  letter-spacing: 0.02em;
  text-transform: capitalize;
  white-space: nowrap;
  box-shadow: 0 0 14px -2px rgb(var(--hb-tone) / 0.45);
}

.hb-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--hb-tone));
  box-shadow: 0 0 8px rgb(var(--hb-tone) / 0.9);
}

/* ---------- Filtros de estado (chips tactiles) ---------- */
.hb-chip {
  --hb-tone: 148 163 184;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.95rem;
  border: 1px solid var(--hb-border);
  border-radius: 999px;
  background: transparent;
  color: var(--hb-muted);
  font: 700 12px/1 var(--hb-font-ui);
  cursor: pointer;
  transition: transform var(--hb-dur) var(--hb-ease), background-color var(--hb-dur) var(--hb-ease),
    border-color var(--hb-dur) var(--hb-ease), color var(--hb-dur) var(--hb-ease);
}

.hb-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--hb-tone));
  box-shadow: 0 0 8px rgb(var(--hb-tone) / 0.6);
}

.hb-chip:active { transform: scale(0.95); }
.hb-chip[data-tone="free"] { --hb-tone: var(--hb-free); }
.hb-chip[data-tone="occupied"] { --hb-tone: var(--hb-occupied); }
.hb-chip[data-tone="cleaning"] { --hb-tone: var(--hb-cleaning); }
.hb-chip[data-tone="reserved"] { --hb-tone: var(--hb-reserved); }

.hb-chip[aria-pressed="true"] {
  background: rgb(var(--hb-tone) / 0.14);
  border-color: rgb(var(--hb-tone) / 0.55);
  color: var(--hb-text);
  outline: none;
}

@media (hover: hover) {
  .hb-chip:hover { border-color: rgb(var(--hb-tone) / 0.45); color: var(--hb-text); }
}

/* ---------- Rejilla Bento de habitaciones (la tienda conserva su rejilla) ---------- */
body.hb-theme:not([data-lobby-mode="tienda"]):not([data-hotel-terminal="tienda"]) #grid-pos {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr));
  gap: 0.875rem;
}

/* ---------- Tarjeta Bento de habitacion ---------- */
.hb-room {
  --hb-tone: 148 163 184;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 15rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--hb-border);
  border-top: 3px solid rgb(var(--hb-tone));
  border-radius: var(--hb-radius-card);
  background: var(--hb-surface-raised);
  color: var(--hb-text);
  box-shadow: var(--hb-shadow);
  transition: transform var(--hb-dur) var(--hb-ease), border-color var(--hb-dur) var(--hb-ease),
    box-shadow var(--hb-dur) var(--hb-ease);
}

.hb-room[data-room-state="DISPONIBLE"] { --hb-tone: var(--hb-free); }
.hb-room[data-room-state="OCUPADA"] { --hb-tone: var(--hb-occupied); }
.hb-room[data-room-state="RESERVADA"] { --hb-tone: var(--hb-reserved); }
.hb-room:is([data-room-state="LIMPIEZA"], [data-room-state="POR_LIMPIAR"], [data-room-state="SALIDA_RECIENTE"]) {
  --hb-tone: var(--hb-cleaning);
}
.hb-room:is([data-room-state="MANTENIMIENTO"], [data-room-state="FUERA_SERVICIO"]) { --hb-tone: var(--hb-maint); }

/* Halo de estado en la parte superior */
.hb-room::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6rem;
  background: radial-gradient(120% 100% at 50% 0%, rgb(var(--hb-tone) / 0.16), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Foto opcional como textura de fondo; el texto siempre usa tonos claros sobre ella */
.hb-room[data-has-photo="true"] {
  --hb-text: #f4f4f5;
  --hb-muted: #d4d4d8;
  --hb-btn-bg: rgb(255 255 255 / 0.1);
  --hb-btn-bg-hover: rgb(255 255 255 / 0.16);
  --hb-border: rgb(255 255 255 / 0.14);
}

.hb-room[data-has-photo="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(9 13 22 / 0.74), rgb(9 13 22 / 0.95)), var(--hb-photo, none);
  background-size: cover;
  background-position: center;
  z-index: -2;
}

@media (hover: hover) {
  .hb-room:hover {
    transform: translateY(-2px);
    border-color: rgb(var(--hb-tone) / 0.5);
    border-top-color: rgb(var(--hb-tone));
    box-shadow: var(--hb-shadow), 0 18px 36px -22px rgb(var(--hb-tone) / 0.6);
  }
}

.hb-room__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.hb-room__eyebrow {
  display: block;
  color: var(--hb-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hb-room__number {
  margin: 0;
  font-family: var(--hb-font-mono);
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
}

.hb-room__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.75rem;
  min-width: 0;
  margin: 0;
  color: var(--hb-muted);
  font-size: 12px;
  font-weight: 600;
}

.hb-room__meta > span { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.hb-room__meta > span:first-child { flex: 0 1 auto; }
.hb-room__type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-room__meta i { font-size: 11px; opacity: 0.8; }

/* La accion principal se ancla al pie: todas las tarjetas de una fila quedan alineadas */
.hb-room > .hotel-room-action { margin-top: auto; }

/* Boton visible del showroom: ancho completo y area tactil de 44px+, con icono ambar como en la version original */
.hb-btn--photos {
  width: 100%;
  min-height: 44px;
  border-color: rgb(var(--hb-reserved) / 0.3);
}

.hb-btn--photos i { color: rgb(var(--hb-reserved)); }

@media (hover: hover) {
  .hb-btn--photos:hover { border-color: rgb(var(--hb-reserved) / 0.55); }
}

.hb-tap { transition: transform var(--hb-dur) var(--hb-ease); }
.hb-tap:active { transform: scale(0.97); }

.hb-room__stay { display: grid; gap: 0.4rem; margin-bottom: 0.65rem; }

.hb-room__guest {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hb-room__guest i { color: var(--hb-muted); font-size: 11px; }

.hb-room__balance {
  --hb-balance: var(--hb-reserved);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgb(var(--hb-balance) / 0.3);
  border-radius: var(--hb-radius-control);
  background: rgb(var(--hb-balance) / 0.1);
}

.hb-room__balance[data-balance="paid"] { --hb-balance: var(--hb-free); }

.hb-room__balance-label {
  color: var(--hb-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hb-room__balance strong {
  color: color-mix(in srgb, rgb(var(--hb-balance)) 75%, var(--hb-text));
  font-size: 1.25rem;
  font-weight: 800;
}

.hb-room__deposit { color: var(--hb-muted); font-size: 11px; font-weight: 600; }

.hb-room__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.hb-room__rate { display: flex; align-items: baseline; gap: 0.35rem; margin-bottom: 0.65rem; }
.hb-room__price { font-size: 1.5rem; font-weight: 800; }
.hb-room__rate small { color: var(--hb-muted); font-size: 11px; font-weight: 600; }
.hb-room__note { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.65rem; color: var(--hb-muted); font-size: 12px; font-weight: 600; }

/* ---------- Panel administrativo (admin_hotel.html): rack y catalogo visual de habitaciones ----------
   Rejilla 1 / 2 (640px) / 3 (1024px) / 4 (1280px) columnas con filas de altura identica (grid-auto-rows: 1fr):
   ninguna tarjeta crece mas que otra por texto, fotos o etiquetas. Cada tarjeta es flex columna con
   justify-content: space-between: cuerpo arriba y pie (acciones operativas + Editar/Fotos/Estado) abajo, asi la
   barra de administracion comparte linea base en toda la fila. La portada tiene alto fijo y el texto nunca va
   sobre la foto. Superficie opaca por token: --bg-surface en oscuro, --bg-sunken en claro (nunca blanco puro).
   Tintas medidas (WCAG AAA >= 7:1) sobre superficie, pildoras y controles en reposo, hover y activo. */
.hb-theme #grid-habitaciones-admin {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) { .hb-theme #grid-habitaciones-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .hb-theme #grid-habitaciones-admin { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .hb-theme #grid-habitaciones-admin { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.hb-room__meta > span:not(:first-child) { flex: none; white-space: nowrap; }

/* Tokens de la tarjeta: modo oscuro (base del Admin) */
#grid-habitaciones-admin .hb-room--admin {
  --rk-bg: var(--bg-surface, #111620);
  --rk-control: var(--bg-elevated, #171d29);
  --rk-control-hover: #1f2737;
  --rk-control-active: #283246;
  --rk-border: var(--border-subtle, rgb(255 255 255 / 0.08));
  --rk-border-control: rgb(255 255 255 / 0.16);
  --rk-text: var(--text-primary, #eceff4);  /* 15.7:1 sin blanco puro */
  --rk-muted: #b4bdcb;                       /* 9.6:1 en superficie, 7.9:1 en hover */
  --rk-gold: #d4b373;                        /* oro viejo legible: 9.1:1 */
  --rk-ink: var(--hb-ink-maint);
  /* Tintes opacos precalculados (tono 12-22% sobre --rk-bg): sin color-mix para que el fondo sea un color
     solido medible. Pildora 14%; saldo y botones 12% reposo, 18% hover, 22% activo. */
  --rk-tint-free: #112d2e;
  --rk-tint-reserved: #31291d;
  --rk-tint-occupied: #301c25;
  --rk-tint-cleaning: #32232e;
  --rk-tint-maint: #1d232f;
  --rk-pill-bg: var(--rk-tint-maint);
  --rk-balance-due: #2c261d;
  --rk-balance-paid: #112a2c;
  --rk-success: #112a2c;
  --rk-success-hover: #113331;
  --rk-success-active: #113a35;
  --rk-danger: #2c1c24;
  --rk-danger-hover: #391e26;
  --rk-danger-active: #422028;
  --rk-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23cbd5e1' stroke-width='2'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E");
  --hb-text: var(--rk-text);
  --hb-muted: var(--rk-muted);
  --hb-border: var(--rk-border);
  --hb-btn-bg: var(--rk-control);
  --hb-btn-bg-hover: var(--rk-control-hover);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.875rem;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--rk-border);
  border-top: 4px solid rgb(var(--hb-tone));
  background: var(--rk-bg);
  color: var(--rk-text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 12px 28px -20px rgb(0 0 0 / 0.7);
  overflow-wrap: anywhere;
}

/* Tarjeta no interactiva: sin halo ni elevacion, solo el borde de estado se intensifica */
#grid-habitaciones-admin .hb-room--admin::after { content: none; }
@media (hover: hover) {
  #grid-habitaciones-admin .hb-room--admin:hover {
    transform: none;
    border-color: rgb(var(--hb-tone) / 0.45);
    border-top-color: rgb(var(--hb-tone));
  }
}

#grid-habitaciones-admin .hb-room--admin[data-room-state="DISPONIBLE"] { --rk-ink: var(--hb-ink-free); --rk-pill-bg: var(--rk-tint-free); }
#grid-habitaciones-admin .hb-room--admin[data-room-state="OCUPADA"] { --rk-ink: var(--hb-ink-occupied); --rk-pill-bg: var(--rk-tint-occupied); }
#grid-habitaciones-admin .hb-room--admin[data-room-state="RESERVADA"] { --rk-ink: var(--hb-ink-reserved); --rk-pill-bg: var(--rk-tint-reserved); }
#grid-habitaciones-admin .hb-room--admin:is([data-room-state="LIMPIEZA"], [data-room-state="POR_LIMPIAR"], [data-room-state="SALIDA_RECIENTE"]) {
  --rk-ink: var(--hb-ink-cleaning);
  --rk-pill-bg: var(--rk-tint-cleaning);
}

#grid-habitaciones-admin .hb-room--admin .hb-room__body { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
#grid-habitaciones-admin .hb-room--admin .hb-room__foot { display: grid; gap: 0.5rem; min-width: 0; }

/* Portada de alto fijo; sin foto (o si falla la carga) se muestra el marcador */
#grid-habitaciones-admin .hb-room--admin .hb-room__cover {
  position: relative;
  height: 6rem;
  margin: -1rem -1rem 0;
  overflow: hidden;
  border-bottom: 1px solid var(--rk-border);
  background: var(--rk-control);
}
#grid-habitaciones-admin .hb-room--admin .hb-room__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#grid-habitaciones-admin .hb-room--admin .hb-room__cover-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--rk-muted);
  font: 600 12px/1.2 var(--hb-font-ui);
}
#grid-habitaciones-admin .hb-room--admin .hb-room__cover:not([data-empty="true"]) .hb-room__cover-empty { display: none; }

/* Jerarquia: numero destacado, estado, ficha, tarifa */
#grid-habitaciones-admin .hb-room--admin .hb-room__eyebrow { color: var(--rk-gold); font-size: 11px; }
#grid-habitaciones-admin .hb-room--admin .hb-room__number {
  color: var(--rk-text);
  font-size: clamp(2rem, 1.6rem + 1vw, 2.5rem);
  overflow-wrap: anywhere;
}

#grid-habitaciones-admin .hb-room--admin .hb-pill {
  --hb-tone: inherit;
  flex: none;
  border-color: rgb(var(--hb-tone) / 0.55);
  background: var(--rk-pill-bg);
  color: var(--rk-ink);
  box-shadow: none;
}

#grid-habitaciones-admin .hb-room--admin .hb-room__meta { flex-wrap: wrap; row-gap: 0.3rem; color: var(--rk-muted); }
#grid-habitaciones-admin .hb-room--admin .hb-room__meta i { opacity: 1; }
#grid-habitaciones-admin .hb-room--admin .hb-room__type-wrap { flex: 1 1 100%; align-items: flex-start; color: var(--rk-text); }
#grid-habitaciones-admin .hb-room--admin .hb-room__type-wrap i { margin-top: 0.15em; color: var(--rk-muted); }
#grid-habitaciones-admin .hb-room--admin .hb-room__type { overflow: visible; text-overflow: clip; white-space: normal; }

#grid-habitaciones-admin .hb-room--admin .hb-room__rate { flex-wrap: wrap; gap: 0.125rem 0.4rem; margin: 0; }
#grid-habitaciones-admin .hb-room--admin .hb-room__price { color: var(--rk-text); font-size: 1.5rem; line-height: 1.15; }
#grid-habitaciones-admin .hb-room--admin .hb-room__rate small { color: var(--rk-muted); font-size: 12px; }

#grid-habitaciones-admin .hb-room--admin .hb-room__stay { margin: 0; }
#grid-habitaciones-admin .hb-room--admin .hb-room__guest {
  align-items: flex-start;
  overflow: visible;
  color: var(--rk-text);
  text-overflow: clip;
  white-space: normal;
}
#grid-habitaciones-admin .hb-room--admin .hb-room__guest i { margin-top: 0.2em; color: var(--rk-muted); }
#grid-habitaciones-admin .hb-room--admin .hb-room__balance {
  flex-wrap: wrap;
  border-color: rgb(var(--hb-balance) / 0.5);
  background: var(--rk-balance-due);
}
#grid-habitaciones-admin .hb-room--admin .hb-room__balance[data-balance="paid"] { background: var(--rk-balance-paid); }
#grid-habitaciones-admin .hb-room--admin .hb-room__balance-label { color: var(--rk-text); }
#grid-habitaciones-admin .hb-room--admin .hb-room__balance strong { color: var(--hb-ink-reserved); }
#grid-habitaciones-admin .hb-room--admin .hb-room__balance[data-balance="paid"] strong { color: var(--hb-ink-free); }
#grid-habitaciones-admin .hb-room--admin .hb-room__deposit { color: var(--rk-muted); font-size: 12px; }

/* Controles: superficie de control opaca y tinta principal en reposo, hover, foco y activo */
#grid-habitaciones-admin .hb-room--admin .hb-btn {
  min-width: 0;
  border: 1px solid var(--rk-border-control);
  background-color: var(--rk-control);
  color: var(--rk-text);
  font-size: 12px;
}
#grid-habitaciones-admin .hb-room--admin .hb-btn:focus-visible { outline: 2px solid var(--rk-gold); outline-offset: 2px; }
#grid-habitaciones-admin .hb-room--admin .hb-btn:active { background-color: var(--rk-control-active); }

#grid-habitaciones-admin .hb-room--admin :is(.hb-btn--success, .hb-btn--danger) {
  border-color: rgb(var(--rk-btn-tone) / 0.55);
  background-color: var(--rk-btn-bg);
  color: var(--rk-btn-ink);
}
#grid-habitaciones-admin .hb-room--admin .hb-btn--success {
  --rk-btn-tone: var(--hb-free);
  --rk-btn-ink: var(--hb-ink-free);
  --rk-btn-bg: var(--rk-success);
  --rk-btn-bg-hover: var(--rk-success-hover);
  --rk-btn-bg-active: var(--rk-success-active);
}
#grid-habitaciones-admin .hb-room--admin .hb-btn--danger {
  --rk-btn-tone: var(--hb-occupied);
  --rk-btn-ink: var(--hb-ink-occupied);
  --rk-btn-bg: var(--rk-danger);
  --rk-btn-bg-hover: var(--rk-danger-hover);
  --rk-btn-bg-active: var(--rk-danger-active);
}
#grid-habitaciones-admin .hb-room--admin :is(.hb-btn--success, .hb-btn--danger):active { background-color: var(--rk-btn-bg-active); }

#grid-habitaciones-admin .hb-room--admin .hb-btn--photos i { color: var(--rk-gold); }

@media (hover: hover) {
  #grid-habitaciones-admin .hb-room--admin .hb-btn:hover { background-color: var(--rk-control-hover); border-color: var(--rk-gold); }
  #grid-habitaciones-admin .hb-room--admin .hb-btn:active { background-color: var(--rk-control-active); }
  #grid-habitaciones-admin .hb-room--admin :is(.hb-btn--success, .hb-btn--danger):hover {
    border-color: rgb(var(--rk-btn-tone) / 0.8);
    background-color: var(--rk-btn-bg-hover);
  }
  #grid-habitaciones-admin .hb-room--admin :is(.hb-btn--success, .hb-btn--danger):active { background-color: var(--rk-btn-bg-active); }
}

/* Lista nativa del selector: fondo de control y tinta AAA, incluido el marcador deshabilitado "Estado" */
#grid-habitaciones-admin .hb-room--admin select option {
  background-color: var(--rk-control);
  color: var(--rk-text);
}
#grid-habitaciones-admin .hb-room--admin select option:disabled { color: var(--rk-muted); }

/* Editar / Fotos / Estado: tres controles de 44px en el pie, misma linea base en toda la fila */
#grid-habitaciones-admin .hb-admin-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
#grid-habitaciones-admin .hb-admin-actions > .hb-btn { padding-inline: 0.4rem; white-space: nowrap; }
#grid-habitaciones-admin .hb-room--admin .hb-room__actions > .hb-btn { padding-inline: 0.5rem; white-space: nowrap; }

/* El selector de estado conserva su picker nativo con el aspecto de los demas botones */
#grid-habitaciones-admin .hb-room--admin select.hb-btn--select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 0 1.5rem 0 0.5rem;
  text-align: center;
  text-align-last: center;
  background-image: var(--rk-chevron);
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.85rem;
}

/* Cabecera y estados vacios de la seccion */
#sec-hospedaje .hb-rack-toolbar {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
}
#sec-hospedaje .hb-rack-toolbar h2 { color: var(--text-primary); }
#sec-hospedaje .hb-rack-toolbar p { color: #b4bdcb; }
#sec-hospedaje .hb-rack-toolbar .hb-rack-toolbar__icon { color: #d4b373; }
#sec-hospedaje .hb-rack-empty { color: #b4bdcb; }

/* Modo claro: gris suave opaco (--bg-sunken), tintas -900 y oro viejo oscuro */
:is(html:not(.dark), [data-theme="light"]) #grid-habitaciones-admin .hb-room--admin {
  --rk-bg: var(--bg-sunken, #f8fafc);
  --rk-control: var(--bg-elevated, #f1f5f9);
  --rk-control-hover: #e2e8f0;
  --rk-control-active: #cbd5e1;
  --rk-border: #e2e8f0;
  --rk-border-control: #8794a8;
  --rk-text: #0f172a;   /* 17.1:1 */
  --rk-muted: #334155;  /* 9.9:1 en superficie, 8.4:1 en hover */
  --rk-gold: #5c4419;   /* 8.7:1 */
  --rk-tint-free: #d8f1eb;
  --rk-tint-reserved: #f8edda;
  --rk-tint-occupied: #f7e1e2;
  --rk-tint-cleaning: #f8e7eb;
  --rk-tint-maint: #e3e7ec;
  --rk-balance-due: #f8efdf;
  --rk-balance-paid: #dcf2ed;
  --rk-success: #dcf2ed;
  --rk-success-hover: #ceeee6;
  --rk-success-active: #c5ece1;
  --rk-danger: #f7e4e6;
  --rk-danger-hover: #f6d9db;
  --rk-danger-active: #f6d2d4;
  --rk-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23334155' stroke-width='2'%3E%3Cpath d='m5 7.5 5 5 5-5'/%3E%3C/svg%3E");
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 10px 24px -18px rgb(15 23 42 / 0.25);
}
:is(html:not(.dark), [data-theme="light"]) #sec-hospedaje .hb-rack-toolbar { background: var(--bg-sunken, #f8fafc); }
:is(html:not(.dark), [data-theme="light"]) #sec-hospedaje .hb-rack-toolbar p,
:is(html:not(.dark), [data-theme="light"]) #sec-hospedaje .hb-rack-empty { color: #334155; }
:is(html:not(.dark), [data-theme="light"]) #sec-hospedaje .hb-rack-toolbar .hb-rack-toolbar__icon { color: #5c4419; }

/* ---------- Dashboard administrativo (#hotel-dashboard): tarjetas Bento sobre la rejilla original ----------
   No se toca .hotel-dashboard-grid (1/2/3 columnas, gap 24px): solo la superficie de cada tarjeta.
   El prefijo #hotel-dashboard.hb-theme gana en especificidad a las reglas .core-app[...] de core-design.css. */
#hotel-dashboard.hb-theme { font-family: var(--hb-font-ui); }

/* Superficies del sistema de tokens (DESIGN.md 2.2): pizarra mate en oscuro, gris suave en claro. */
#hotel-dashboard.hb-theme {
  --hb-surface: var(--bg-surface);
  --hb-border: var(--border-subtle);
  --hb-btn-bg: var(--bg-elevated);
}

#hotel-dashboard.hb-theme .hb-dash-card {
  position: relative;
  gap: 0.875rem;
  border: 1px solid var(--hb-border);
  border-radius: var(--radius-card);
  background:
    radial-gradient(360px 160px at 100% 0%, rgb(var(--hb-free) / 0.07), transparent 70%),
    var(--hb-surface);
  box-shadow: var(--hb-shadow);
  color: var(--hb-text);
  transition: transform var(--hb-dur) var(--hb-ease), border-color var(--hb-dur) var(--hb-ease),
    box-shadow var(--hb-dur) var(--hb-ease);
}

#hotel-dashboard.hb-theme .hb-dash-card[data-hotel-focus-tab]:active { transform: scale(0.985); }
#hotel-dashboard.hb-theme .hb-dash-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

@media (hover: hover) {
  #hotel-dashboard.hb-theme .hb-dash-card:hover { border-color: var(--border-accent); }
}

#hotel-dashboard.hb-theme .hotel-dashboard-heading h2 {
  color: var(--hb-text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* El icono hereda el color de acento (text-*-400) y lo proyecta como resplandor suave */
#hotel-dashboard.hb-theme .hotel-dashboard-icon {
  border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
  background: color-mix(in srgb, currentColor 12%, transparent);
  box-shadow: 0 0 22px -6px color-mix(in srgb, currentColor 55%, transparent);
}

#hotel-dashboard.hb-theme :is(.hotel-dashboard-description, .hotel-dashboard-note) { color: var(--hb-muted); }

#hotel-dashboard.hb-theme .hotel-dashboard-note {
  border: 1px solid var(--hb-border);
  background: var(--hb-btn-bg);
}

/* Leyenda de estados: mismas pildoras y tonos que las tarjetas de habitacion */
#hotel-dashboard.hb-theme .hotel-dashboard-states { gap: 0.5rem; }

#hotel-dashboard.hb-theme .hb-dash-state {
  --hb-tone: var(--hb-free);
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 0.65rem;
  border: 1px solid rgb(var(--hb-tone) / 0.4);
  border-radius: 999px;
  background: rgb(var(--hb-tone) / 0.12);
  box-shadow: 0 0 14px -4px rgb(var(--hb-tone) / 0.45);
  color: rgb(var(--hb-tone));
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#hotel-dashboard.hb-theme .hb-dash-state--occupied { --hb-tone: var(--hb-occupied); }
#hotel-dashboard.hb-theme .hb-dash-state--cleaning { --hb-tone: var(--hb-cleaning); }

/* Enlaces y botones de accion: 44px tactiles con respuesta de 150ms.
   justify-content/text-align fijos: .diag-trigger (station_diagnostics.css) los centraba en esta rejilla. */
#hotel-dashboard.hb-theme .hotel-dashboard-action {
  min-height: 44px;
  justify-content: space-between;
  text-align: left;
  border: 1px solid var(--hb-border);
  border-radius: var(--hb-radius-control);
  background: var(--hb-btn-bg);
  color: var(--hb-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform var(--hb-dur) var(--hb-ease), background-color var(--hb-dur) var(--hb-ease),
    border-color var(--hb-dur) var(--hb-ease);
}

#hotel-dashboard.hb-theme .hotel-dashboard-action:active { transform: scale(0.95); }
#hotel-dashboard.hb-theme .hotel-dashboard-action:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

@media (hover: hover) {
  #hotel-dashboard.hb-theme .hotel-dashboard-action:hover {
    background: var(--hb-btn-bg-hover);
    border-color: var(--border-accent);
  }
}

/* ---------- Dashboard en modo claro: gris suave sin deslumbramiento, contraste AAA ----------
   Los tokens se redefinen solo en #hotel-dashboard (no en el lobby ni en #sec-hospedaje).
   Superficie opaca --bg-sunken (#F8FAFC) sobre el lienzo #F1F5F9: --hb-text 17.1:1, --hb-muted 9.9:1. */
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme {
  --hb-surface: var(--bg-sunken);
  --hb-border: var(--border-subtle);
  --hb-text: #0f172a;
  --hb-muted: #334155;
  --hb-btn-bg: var(--bg-elevated);
  --hb-btn-bg-hover: #e2e8f0;
  --hb-shadow:
    0 1px 2px rgb(15 23 42 / 0.05),
    0 8px 20px -14px rgb(15 23 42 / 0.18);
}

:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-card {
  --hb-dash-accent: 14 165 233;
  background:
    radial-gradient(420px 200px at 100% 0%, rgb(var(--hb-dash-accent) / 0.08), transparent 72%),
    var(--hb-surface);
}

/* Cada tarjeta toma el tinte de su icono (el color de acento sigue viniendo de las clases text-*-400) */
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-card:has(.hotel-dashboard-icon.text-amber-400) { --hb-dash-accent: 245 158 11; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-card:has(.hotel-dashboard-icon.text-emerald-400) { --hb-dash-accent: 16 185 129; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-card:has(.hotel-dashboard-icon.text-cyan-400) { --hb-dash-accent: 6 182 212; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-card:has(.hotel-dashboard-icon.text-indigo-400) { --hb-dash-accent: 99 102 241; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-card:has(.hotel-dashboard-icon.text-rose-400) { --hb-dash-accent: 244 63 94; }

@media (hover: hover) {
  :is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-card:hover {
    border-color: rgb(var(--hb-dash-accent) / 0.5);
  }
}

/* Los acentos -400 pierden contraste sobre blanco: en claro se usan sus tonos -700 */
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-icon {
  border-color: rgb(var(--hb-dash-accent) / 0.35);
  background: rgb(var(--hb-dash-accent) / 0.14);
  box-shadow: 0 6px 16px -8px rgb(var(--hb-dash-accent) / 0.55), inset 0 1px 0 rgb(255 255 255 / 0.7);
}
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-icon.text-amber-400 { color: #b45309; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-icon.text-emerald-400 { color: #047857; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-icon.text-cyan-400 { color: #0e7490; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-icon.text-sky-400 { color: #0369a1; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-icon.text-indigo-400 { color: #4338ca; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-icon.text-rose-400 { color: #be123c; }

:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-note {
  border-color: rgb(226 232 240 / 0.9);
  background: rgb(241 245 249 / 0.75);
}

/* Pildoras: pastel translucido con tinta oscura saturada (>= 7:1) */
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-state {
  border-color: rgb(var(--hb-tone) / 0.45);
  background: rgb(var(--hb-tone) / 0.14);
  box-shadow: none;
  color: #064e3b;
}
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-state--occupied { color: #7f1d1d; }
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-state--cleaning { color: #881337; }

:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-action {
  border-color: rgb(226 232 240 / 0.9);
  color: #1e293b;
  box-shadow: 0 1px 1px rgb(15 23 42 / 0.04);
}
/* core-theme.css fuerza .diag-trigger en claro con !important; dentro del dashboard se iguala al resto de acciones. */
:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hotel-dashboard-action.diag-trigger {
  background: var(--hb-btn-bg) !important;
  border-color: rgb(226 232 240 / 0.9) !important;
  color: #1e293b !important;
}

/* ---------- Indicador de turno Lobby (solo lectura) ----------
   Colores solidos para garantizar contraste AAA (>= 7:1) en ambos temas; el estado se comunica tambien
   con icono y texto, nunca solo con color. El tema oscuro es la base y el claro la sobrescribe. */
#hotel-dashboard.hb-theme .hb-dash-turno {
  --turno-caja: #111827;
  --turno-borde: #334155;
  --turno-dt: #d4d4d8;
  --turno-dd: #f4f4f5;
  --turno-badge-fg: #d1fae5;
  --turno-badge-bg: #064e3b;
  --turno-badge-borde: #34d399;
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--turno-borde);
  border-radius: 1rem;
  background: var(--turno-caja);
  color: var(--turno-dd);
}

#hotel-dashboard.hb-theme .hb-dash-turno[data-estado="cerrado"] {
  --turno-badge-fg: #fde68a;
  --turno-badge-bg: #451a03;
  --turno-badge-borde: #fbbf24;
}

#hotel-dashboard.hb-theme .hb-dash-turno:is([data-estado="sin-verificar"], [data-estado="verificando"]) {
  --turno-badge-fg: #e2e8f0;
  --turno-badge-bg: #1e293b;
  --turno-badge-borde: #94a3b8;
}

#hotel-dashboard.hb-theme .hb-dash-turno__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
#hotel-dashboard.hb-theme .hb-dash-turno__label { color: var(--turno-dt); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

#hotel-dashboard.hb-theme .hb-dash-turno__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 28px;
  padding: 0 0.7rem;
  border: 1px solid var(--turno-badge-borde);
  border-radius: 999px;
  background: var(--turno-badge-bg);
  color: var(--turno-badge-fg);
  font-size: 12px;
  font-weight: 800;
}

#hotel-dashboard.hb-theme .hb-dash-turno__datos { display: grid; gap: 0.5rem; margin: 0; }
#hotel-dashboard.hb-theme .hb-dash-turno__datos > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem; }
#hotel-dashboard.hb-theme .hb-dash-turno dt { color: var(--turno-dt); font-size: 12px; font-weight: 600; }
#hotel-dashboard.hb-theme .hb-dash-turno dd { margin: 0; color: var(--turno-dd); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; text-align: right; }
#hotel-dashboard.hb-theme .hb-dash-turno__detalle { margin: 0; color: var(--turno-dt); font-size: 12px; }
#hotel-dashboard.hb-theme .hb-dash-turno__detalle:empty { display: none; }

:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-turno {
  --turno-caja: #f1f5f9;
  --turno-borde: #cbd5e1;
  --turno-dt: #334155;
  --turno-dd: #0f172a;
  --turno-badge-fg: #064e3b;
  --turno-badge-bg: #d1fae5;
  --turno-badge-borde: #047857;
}

:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-turno[data-estado="cerrado"] {
  --turno-badge-fg: #78350f;
  --turno-badge-bg: #fef3c7;
  --turno-badge-borde: #b45309;
}

:is(html:not(.dark), [data-theme="light"]) #hotel-dashboard.hb-theme .hb-dash-turno:is([data-estado="sin-verificar"], [data-estado="verificando"]) {
  --turno-badge-fg: #1e293b;
  --turno-badge-bg: #e2e8f0;
  --turno-badge-borde: #64748b;
}

/* ---------- Gift cards / vouchers digitales (.hb-giftcard) ----------
   Tarjeta 1.586:1 (ISO/IEC 7810 ID-1). Sigue el tema (html.dark) y se puede forzar con
   .hb-giftcard--dark (obsidiana con halo dorado/esmeralda) o .hb-giftcard--light (blanco perlado).
   Estructura: __mark (isotipo en marca de agua), __head (marca + estado), __chip, __label, __amount, __foot (__code, __valid). */
.hb-giftcard,
.hb-giftcard--light {
  --gc-bg: linear-gradient(135deg, #ffffff 0%, #f4f6fa 52%, #e6ebf3 100%);
  --gc-sheen: radial-gradient(120% 90% at 0% 0%, rgb(255 255 255 / 0.95) 0%, rgb(255 255 255 / 0) 55%);
  --gc-halo: radial-gradient(60% 70% at 100% 100%, rgb(16 185 129 / 0.1), transparent 70%);
  --gc-border: rgb(203 213 225 / 0.9);
  --gc-shadow:
    inset 0 1px 0 #ffffff,
    inset 0 -1px 0 rgb(15 23 42 / 0.07),
    0 1px 2px rgb(15 23 42 / 0.08),
    0 20px 36px -18px rgb(15 23 42 / 0.28);
  --gc-text: #0f172a;
  --gc-muted: #334155;
  --gc-mark: rgb(15 23 42 / 0.045);
  --gc-chip: linear-gradient(135deg, #f1d98a, #c9a24a 55%, #e8cf85);
  --gc-chip-line: rgb(120 82 12 / 0.35);
  --gc-ok-ink: #064e3b;
  --gc-ok-bg: rgb(16 185 129 / 0.14);
  --gc-ok-line: rgb(16 185 129 / 0.45);
  --gc-used-ink: #1e293b;
  --gc-used-bg: rgb(100 116 139 / 0.14);
  --gc-used-line: rgb(100 116 139 / 0.4);
  --gc-amount-shadow: none;
}

.hb-giftcard--dark,
html.dark .hb-giftcard:not(.hb-giftcard--light) {
  --gc-bg: linear-gradient(135deg, #131a2b 0%, #0b0f19 55%, #070a12 100%);
  --gc-sheen: radial-gradient(120% 90% at 0% 0%, rgb(255 255 255 / 0.13) 0%, rgb(255 255 255 / 0) 52%);
  --gc-halo:
    radial-gradient(70% 80% at 100% 100%, rgb(245 158 11 / 0.2), transparent 68%),
    radial-gradient(55% 60% at 0% 100%, rgb(16 185 129 / 0.14), transparent 70%);
  --gc-border: rgb(255 255 255 / 0.12);
  --gc-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.08),
    0 0 44px -14px rgb(245 158 11 / 0.38),
    0 24px 44px -22px rgb(0 0 0 / 0.8);
  --gc-text: #f4f4f5;
  --gc-muted: #cbd5e1;
  --gc-mark: rgb(255 255 255 / 0.05);
  --gc-ok-ink: #6ee7b7;
  --gc-ok-bg: rgb(16 185 129 / 0.16);
  --gc-ok-line: rgb(16 185 129 / 0.5);
  --gc-used-ink: #cbd5e1;
  --gc-used-bg: rgb(148 163 184 / 0.14);
  --gc-used-line: rgb(148 163 184 / 0.35);
  --gc-amount-shadow: 0 0 26px rgb(245 158 11 / 0.35);
}

.hb-giftcard {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  box-sizing: border-box;
  width: 100%;
  min-width: 16rem;
  max-width: 26rem;
  aspect-ratio: 1.586;
  padding: 1.25rem 1.375rem;
  container-type: inline-size;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--gc-border);
  border-radius: 1.25rem;
  background: var(--gc-sheen), var(--gc-halo), var(--gc-bg);
  box-shadow: var(--gc-shadow);
  color: var(--gc-text);
  font-family: var(--hb-font-ui, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif);
  transition: transform 150ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Brillo metalico en diagonal desde la esquina superior izquierda */
.hb-giftcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, rgb(255 255 255 / 0.32) 0%, rgb(255 255 255 / 0) 34%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* Isotipo en marca de agua (rombo con facetas), recortado como mascara para heredar el tono del tema */
.hb-giftcard__mark {
  position: absolute;
  right: -9%;
  bottom: -22%;
  z-index: -1;
  width: 62%;
  aspect-ratio: 1;
  background: var(--gc-mark);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 96 50 50 96 4 50Z M50 18 82 50 50 82 18 50Z M50 32 68 50 50 68 32 50Z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 96 50 50 96 4 50Z M50 18 82 50 50 82 18 50Z M50 32 68 50 50 68 32 50Z' fill-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

.hb-giftcard__head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.hb-giftcard__brand { font-size: clamp(0.7rem, 3.6cqi, 0.9rem); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }

/* Chip de seguridad */
.hb-giftcard__chip {
  width: 11cqi;
  max-width: 2.75rem;
  aspect-ratio: 1.25;
  border-radius: 0.4rem;
  background:
    linear-gradient(90deg, transparent 32%, var(--gc-chip-line) 32% 34%, transparent 34% 66%, var(--gc-chip-line) 66% 68%, transparent 68%),
    linear-gradient(0deg, transparent 46%, var(--gc-chip-line) 46% 54%, transparent 54%),
    var(--gc-chip, linear-gradient(135deg, #f1d98a, #c9a24a 55%, #e8cf85));
  box-shadow: inset 0 0 0 1px rgb(120 82 12 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.5);
}

.hb-giftcard__label { margin: 0 0 0.4rem; color: var(--gc-muted); font-size: clamp(0.62rem, 3cqi, 0.75rem); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.hb-giftcard__amount {
  margin: 0;
  font-family: var(--hb-font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(1.6rem, 11cqi, 2.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: var(--gc-amount-shadow);
}

.hb-giftcard__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; }

.hb-giftcard__code {
  margin: 0;
  font-family: var(--hb-font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(0.72rem, 4.1cqi, 1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}

.hb-giftcard__valid { margin: 0; color: var(--gc-muted); font-size: clamp(0.62rem, 3cqi, 0.75rem); font-weight: 600; white-space: nowrap; text-align: right; }
.hb-giftcard__valid time { font-family: var(--hb-font-mono, "JetBrains Mono", ui-monospace, monospace); font-variant-numeric: tabular-nums; color: var(--gc-text); font-weight: 700; }

/* Estado: Activa (esmeralda) / Canjeada (neutra, la tarjeta se apaga) */
.hb-giftcard__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  padding: 0 0.7rem;
  border: 1px solid var(--gc-ok-line);
  border-radius: 999px;
  background: var(--gc-ok-bg);
  color: var(--gc-ok-ink);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.hb-giftcard__status::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

.hb-giftcard--canjeada { filter: saturate(0.55); }
.hb-giftcard--canjeada .hb-giftcard__status { border-color: var(--gc-used-line); background: var(--gc-used-bg); color: var(--gc-used-ink); }
.hb-giftcard--canjeada .hb-giftcard__status::before { box-shadow: none; }
.hb-giftcard--canjeada .hb-giftcard__amount { opacity: 0.7; text-decoration: line-through; text-decoration-thickness: 2px; }

@media (hover: hover) {
  .hb-giftcard:hover { transform: translateY(-2px); }
}

/* ---------- Galeria de fotos de habitacion (modal admin): acciones por foto sin depender del hover ---------- */
#grid-fotos-hab .hb-foto-acciones:focus-within { opacity: 1; }

@media (hover: none), (pointer: coarse) {
  #grid-fotos-hab .hb-foto-acciones {
    opacity: 1;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0.4rem;
    background: linear-gradient(to top, rgb(0 0 0 / 0.7), transparent 60%);
  }

  #grid-fotos-hab .hb-foto-acciones button { min-width: 44px; min-height: 44px; }
}

/* ---------- Ticket y Cierre Z: cifras legibles a distancia ---------- */
body.hb-theme #carrito-total { font-size: 1.875rem; font-weight: 800; letter-spacing: -0.02em; }
body.hb-theme #carrito-subtotal,
body.hb-theme #carrito-total-bs { font-variant-numeric: tabular-nums lining-nums; }

body.hb-theme #modal-cierre-z-lobby :is(#cz-total-ventas, #cz-esperado-usd, #cz-esperado-bs) {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.hb-theme #modal-cierre-z-lobby :is(#cz-abonos, #cz-egresos, #cz-diferencia) {
  font-size: 1.125rem;
  font-weight: 800;
}

body.hb-theme #modal-cierre-z-lobby #cz-abonos { color: var(--hb-ink-free); }
body.hb-theme #modal-cierre-z-lobby #cz-egresos { color: var(--hb-ink-occupied); }

/* ---------- Acceso por PIN del lobby (terminal_pin.js inyecta #lobby-lock en runtime) ---------- */
html.dark .hb-theme #lobby-lock {
  --ll-bg: #090d16;
  --ll-card: rgb(24 24 27 / 0.78);
  --ll-border: rgb(255 255 255 / 0.1);
  --ll-text: #f4f4f5;
  --ll-muted: #a1a1aa;
  --ll-key: rgb(39 39 42 / 0.6);
  --ll-key-hover: rgb(63 63 70 / 0.7);
  --ll-accent: #10b981;
  --ll-danger: #ef4444;
}

.hb-theme #lobby-lock .ll-card {
  border-radius: 1.5rem;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.hb-theme #lobby-lock .ll-pin,
.hb-theme #lobby-lock .ll-keypad button:not(.ll-ok):not(.ll-del) {
  font-family: var(--hb-font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

.hb-theme #lobby-lock .ll-keypad button {
  transition-duration: var(--hb-dur);
  transition-property: transform, background-color, filter;
}

.hb-theme #lobby-lock .ll-keypad button:active { transform: scale(0.95); }

/* ---------- Acceso (login_hotel.html) ---------- */
.hotel-login.hb-theme {
  background: var(--hb-ambient), var(--hb-bg);
  font-family: var(--hb-font-ui);
}

.hotel-login.hb-theme .hb-login-card {
  background: var(--hb-surface);
  border-color: var(--hb-border);
  border-radius: 1.5rem;
  box-shadow: var(--hb-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.hotel-login.hb-theme button {
  transition: transform var(--hb-dur) var(--hb-ease), background-color var(--hb-dur) var(--hb-ease);
}

.hotel-login.hb-theme button:active { transform: scale(0.95); }

.hotel-login.hb-theme #hotel-pin {
  font-family: var(--hb-font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- Showroom: restaura el morado del boton IA ----------
   El bundle Tailwind purgado no incluye bg-purple-600/80 ni border-purple-400/50 (preexistente),
   por lo que el boton "Realzar Iluminacion IA" salia sin fondo. Solo afecta a ese boton. */
#btn-showroom-iluminacion-ia {
  background-color: rgb(147 51 234 / 0.8);
  border-color: rgb(192 132 252 / 0.5);
}

#btn-showroom-iluminacion-ia:hover:not(:disabled) { background-color: rgb(147 51 234); }

/* Solo componentes del tema: no se tocan transiciones de modales ni de componentes heredados */
@media (prefers-reduced-motion: reduce) {
  :is(.hb-btn, .hb-chip, .hb-tap, .hb-pill, .hb-room, .hb-panel, .hb-dash-card, .hb-giftcard, #hotel-dashboard .hotel-dashboard-action,
      #lobby-lock .ll-keypad button) {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .hb-giftcard:hover { transform: none; }
  .hb-btn:active, .hb-chip:active, .hb-tap:active, .hb-room:hover { transform: none; }
  #hotel-dashboard.hb-theme :is(.hb-dash-card, .hotel-dashboard-action):active { transform: none; }
}

/* =====================================================================================================
   MODO CLARO AAA (Administracion y Lobby)
   Alcance: html sin .dark (o [data-theme="light"]) + body.hotel-app. No toca ids, data-* ni logica.
   Reglas de contraste (WCAG 1.4.6, 7:1 en texto normal y 4.5:1 en texto grande):
     - Titulos  Slate-900 #0f172a  |  texto secundario Slate-700 #334155 (>= 9.4:1 sobre #f1f5f9).
     - Acentos de texto: tonos -900 de cada matiz (>= 7.3:1 sobre blanco, #f1f5f9, #e2e8f0 y pasteles).
     - Rellenos solidos con texto blanco: tonos -800 (>= 7:1); hover -900.
   Las clases text-*-400/500/600 y bg-*-500/600 siguen siendo las del markup; aqui solo se recalibran en claro.
   ===================================================================================================== */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app {
  --core-text-muted: #334155;
  --hb-muted: #334155;
}

/* Fondo calido con vidrio esmerilado detras de los paneles */
:is(html:not(.dark), [data-theme="light"]) body.hb-theme.hotel-app {
  --hb-surface: rgb(255 255 255 / 0.82);
  --hb-border: rgb(226 232 240 / 0.8);
  --hb-btn-bg: #f1f5f9;
  --hb-btn-bg-hover: #e2e8f0;
  --hb-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    0 1px 2px rgb(15 23 42 / 0.06),
    0 4px 8px -2px rgb(15 23 42 / 0.07),
    0 18px 32px -16px rgb(15 23 42 / 0.16);
  --hb-ambient:
    radial-gradient(900px 480px at 88% -8%, rgb(16 185 129 / 0.07), transparent 62%),
    radial-gradient(760px 420px at -8% 108%, rgb(245 158 11 / 0.08), transparent 60%);
}

/* --- Texto secundario: Slate-700 en toda la escala gris claro --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-slate-300, .text-slate-400, .text-slate-500, .text-slate-600, .text-gray-400, .text-gray-500) {
  color: #334155;
}

/* Superficies oscuras remapeadas a claro por core-theme: su texto claro heredado pasa a Slate-900 */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-slate-900, .bg-slate-800, .bg-slate-950):is(.text-white, .text-slate-50, .text-slate-100, .text-slate-200, .text-slate-300):not(button):not(a) {
  color: #0f172a;
}

/* --- Acentos de texto: tono -900 por matiz --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-emerald-300, .text-emerald-400, .text-emerald-500, .text-emerald-600, .text-emerald-700, .text-emerald-800) { color: #064e3b; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-green-300, .text-green-400, .text-green-500, .text-green-600, .text-green-700, .text-green-800) { color: #14532d; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-teal-300, .text-teal-400, .text-teal-500, .text-teal-600, .text-teal-700, .text-teal-800) { color: #134e4a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-cyan-300, .text-cyan-400, .text-cyan-500, .text-cyan-600, .text-cyan-700, .text-cyan-800) { color: #164e63; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-sky-300, .text-sky-400, .text-sky-500, .text-sky-600, .text-sky-700, .text-sky-800) { color: #0c4a6e; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-blue-300, .text-blue-400, .text-blue-500, .text-blue-600, .text-blue-700, .text-blue-800) { color: #1e3a8a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-indigo-300, .text-indigo-400, .text-indigo-500, .text-indigo-600, .text-indigo-700, .text-indigo-800) { color: #312e81; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-violet-300, .text-violet-400, .text-violet-500, .text-violet-600, .text-violet-700, .text-violet-800) { color: #4c1d95; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-purple-300, .text-purple-400, .text-purple-500, .text-purple-600, .text-purple-700, .text-purple-800) { color: #581c87; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-fuchsia-300, .text-fuchsia-400, .text-fuchsia-500, .text-fuchsia-600, .text-fuchsia-700, .text-fuchsia-800) { color: #701a75; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-pink-300, .text-pink-400, .text-pink-500, .text-pink-600, .text-pink-700, .text-pink-800) { color: #831843; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-rose-300, .text-rose-400, .text-rose-500, .text-rose-600, .text-rose-700, .text-rose-800) { color: #881337; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-red-300, .text-red-400, .text-red-500, .text-red-600, .text-red-700, .text-red-800) { color: #7f1d1d; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-orange-300, .text-orange-400, .text-orange-500, .text-orange-600, .text-orange-700, .text-orange-800) { color: #7c2d12; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-amber-300, .text-amber-400, .text-amber-500, .text-amber-600, .text-amber-700, .text-amber-800) { color: #78350f; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.text-yellow-300, .text-yellow-400, .text-yellow-500, .text-yellow-600, .text-yellow-700, .text-yellow-800) { color: #713f12; }

/* --- Botones y chips solidos con texto claro: relleno -800 (blanco >= 7:1), hover -900 --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-emerald-500, .bg-emerald-600, .bg-emerald-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #065f46; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-green-500, .bg-green-600, .bg-green-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #166534; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-teal-500, .bg-teal-600, .bg-teal-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #115e59; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-cyan-500, .bg-cyan-600, .bg-cyan-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #155e75; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-sky-500, .bg-sky-600, .bg-sky-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #075985; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-blue-500, .bg-blue-600, .bg-blue-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #1e40af; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-indigo-500, .bg-indigo-600, .bg-indigo-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #3730a3; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-violet-500, .bg-violet-600, .bg-violet-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #5b21b6; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-purple-500, .bg-purple-600, .bg-purple-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #6b21a8; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-rose-500, .bg-rose-600, .bg-rose-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #9f1239; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-red-500, .bg-red-600, .bg-red-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #991b1b; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-orange-500, .bg-orange-600, .bg-orange-700):not([class*="text-slate-9"]):not(.text-black) { background-color: #9a3412; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-amber-500, .bg-amber-600, .bg-amber-700).text-white { background-color: #92400e; }

:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-emerald-500, .bg-emerald-600, .bg-emerald-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #064e3b; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-green-500, .bg-green-600, .bg-green-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #14532d; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-teal-500, .bg-teal-600, .bg-teal-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #134e4a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-cyan-500, .bg-cyan-600, .bg-cyan-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #164e63; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-sky-500, .bg-sky-600, .bg-sky-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #0c4a6e; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-blue-500, .bg-blue-600, .bg-blue-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #1e3a8a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-indigo-500, .bg-indigo-600, .bg-indigo-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #312e81; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-violet-500, .bg-violet-600, .bg-violet-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #4c1d95; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-purple-500, .bg-purple-600, .bg-purple-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #581c87; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-rose-500, .bg-rose-600, .bg-rose-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #881337; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-red-500, .bg-red-600, .bg-red-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #7f1d1d; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-orange-500, .bg-orange-600, .bg-orange-700):not([class*="text-slate-9"]):not(.text-black):hover { background-color: #7c2d12; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.bg-amber-500, .bg-amber-600, .bg-amber-700).text-white:hover { background-color: #78350f; }

/* Superficies translucidas oscuras por matiz (bg-*-900/NN, bg-*-950/NN): en claro pasan a pastel -100, hover -200 */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-emerald-950/"], [class*="bg-emerald-900/"]) { background-color: #d1fae5; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-green-950/"], [class*="bg-green-900/"]) { background-color: #dcfce7; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-teal-950/"], [class*="bg-teal-900/"]) { background-color: #ccfbf1; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-cyan-950/"], [class*="bg-cyan-900/"]) { background-color: #cffafe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-sky-950/"], [class*="bg-sky-900/"]) { background-color: #e0f2fe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-blue-950/"], [class*="bg-blue-900/"]) { background-color: #dbeafe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-indigo-950/"], [class*="bg-indigo-900/"]) { background-color: #e0e7ff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-violet-950/"], [class*="bg-violet-900/"]) { background-color: #ede9fe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-purple-950/"], [class*="bg-purple-900/"]) { background-color: #f3e8ff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-fuchsia-950/"], [class*="bg-fuchsia-900/"]) { background-color: #fae8ff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-pink-950/"], [class*="bg-pink-900/"]) { background-color: #fce7f3; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-rose-950/"], [class*="bg-rose-900/"]) { background-color: #ffe4e6; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-red-950/"], [class*="bg-red-900/"]) { background-color: #fee2e2; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-orange-950/"], [class*="bg-orange-900/"]) { background-color: #ffedd5; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-amber-950/"], [class*="bg-amber-900/"]) { background-color: #fef3c7; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-yellow-950/"], [class*="bg-yellow-900/"]) { background-color: #fef9c3; }

:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-emerald-950/"], [class*="bg-emerald-900/"]):hover { background-color: #a7f3d0; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-green-950/"], [class*="bg-green-900/"]):hover { background-color: #bbf7d0; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-teal-950/"], [class*="bg-teal-900/"]):hover { background-color: #99f6e4; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-cyan-950/"], [class*="bg-cyan-900/"]):hover { background-color: #a5f3fc; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-sky-950/"], [class*="bg-sky-900/"]):hover { background-color: #bae6fd; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-blue-950/"], [class*="bg-blue-900/"]):hover { background-color: #bfdbfe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-indigo-950/"], [class*="bg-indigo-900/"]):hover { background-color: #c7d2fe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-violet-950/"], [class*="bg-violet-900/"]):hover { background-color: #ddd6fe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-purple-950/"], [class*="bg-purple-900/"]):hover { background-color: #e9d5ff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-fuchsia-950/"], [class*="bg-fuchsia-900/"]):hover { background-color: #f5d0fe; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-pink-950/"], [class*="bg-pink-900/"]):hover { background-color: #fbcfe8; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-rose-950/"], [class*="bg-rose-900/"]):hover { background-color: #fecdd3; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-red-950/"], [class*="bg-red-900/"]):hover { background-color: #fecaca; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-orange-950/"], [class*="bg-orange-900/"]):hover { background-color: #fed7aa; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-amber-950/"], [class*="bg-amber-900/"]):hover { background-color: #fde68a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is([class*="bg-yellow-950/"], [class*="bg-yellow-900/"]):hover { background-color: #fef08a; }

/* Bloque de tasa de mercado: sus colores por id (core-design) se llevan a tonos -900 */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app #bloque-tasa-mercado #tasa-mercado-bcv { color: #78350f; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app #bloque-tasa-mercado :is(#tasa-mercado-vigente, #tasa-mercado-estado[data-estado="ok"]) { color: #064e3b; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app #bloque-tasa-mercado #tasa-mercado-binance { color: #0c4a6e; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app #bloque-tasa-mercado #tasa-mercado-estado[data-estado="error"] { color: #881337; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app #bloque-tasa-mercado #tasa-mercado-estado[data-estado="info"] { color: #334155; }

/* Rosa con texto oscuro (autorizar cupo): un tono mas claro mantiene el texto Slate-950 sobre 7:1 */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .bg-rose-500[class*="text-slate-9"] { background-color: #fb7185; }

/* Insignias translucidas sobre rellenos de color: pastilla oscura para que el texto blanco conserve contraste */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .bg-white\/20 { background-color: rgb(2 6 23 / 0.32); }

/* Botones nativos del hotel con relleno propio */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hotel-installation-button { background: #075985; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hotel-installation-button.hotel-installation-delete { background: #9f1239; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hotel-area-badge-active { background: #065f46; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hotel-area-badge-inactive { background: #991b1b; color: #ffffff; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .diag-btn-remoto:not(.diag-destacado) { background: #075985; color: #ffffff; }

/* Instalaciones dentro de Habitaciones (tema oscuro): mismos rellenos AAA que en claro y tinta secundaria legible. */
html.dark body.hotel-app #sec-instalaciones .hotel-installation-button { background: #075985; color: #ffffff; }
html.dark body.hotel-app #sec-instalaciones .hotel-installation-button.hotel-installation-delete { background: #9f1239; }
html.dark body.hotel-app #sec-instalaciones .hotel-area-badge-active { background: #065f46; color: #ffffff; }
html.dark body.hotel-app #sec-instalaciones .hotel-area-badge-inactive { background: #991b1b; color: #ffffff; }
html.dark body.hotel-app #sec-instalaciones .text-slate-500 { color: #cbd5e1; }

/* --- Campos de formulario: texto Slate-900, borde Slate-300 visible y foco accesible --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]) {
  border-color: #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.05);
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(input, textarea)::placeholder {
  color: #3b4a5f;
  opacity: 1;
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]):hover:not(:focus-visible) {
  border-color: #94a3b8;
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(input, select, textarea, button, a, summary, [role="button"]):focus-visible {
  outline: 2px solid #075985;
  outline-offset: 2px;
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(input, select, textarea):focus-visible {
  border-color: #075985;
  box-shadow: 0 0 0 3px rgb(7 89 133 / 0.18);
}

/* Cifras de montos: mono tabular en tinta oscura */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(input[type="number"], input[inputmode="decimal"], input[data-region-monto]) {
  font-variant-numeric: tabular-nums lining-nums;
}

/* --- Tablas de datos (huespedes, reservas, auditoria, tarifas): cabecera Slate-700 sobre Slate-200 --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .core-app table thead,
:is(html:not(.dark), [data-theme="light"]) body.hotel-app table thead {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app table thead :is(th, td) { color: #1e293b; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app table tbody tr:hover { background: #f1f5f9; }

/* --- Pildoras de estado de habitacion: pastel translucido + texto saturado --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room { --hb-ink: var(--hb-ink-maint); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room[data-room-state="DISPONIBLE"] { --hb-ink: var(--hb-ink-free); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room[data-room-state="OCUPADA"] { --hb-ink: var(--hb-ink-occupied); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room[data-room-state="RESERVADA"] { --hb-ink: var(--hb-ink-reserved); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room:is([data-room-state="LIMPIEZA"], [data-room-state="POR_LIMPIAR"], [data-room-state="SALIDA_RECIENTE"]) { --hb-ink: var(--hb-ink-cleaning); }

:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room .hb-pill {
  --hb-tone: inherit;
  border-color: rgb(var(--hb-tone) / 0.5);
  background: rgb(var(--hb-tone) / 0.16);
  color: var(--hb-ink);
  box-shadow: none;
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room__balance strong { color: var(--hb-ink-reserved); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room__balance[data-balance="paid"] strong { color: var(--hb-ink-free); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-btn--success { color: var(--hb-ink-free); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-btn--danger { color: var(--hb-ink-occupied); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-chip[aria-pressed="true"] { background: rgb(var(--hb-tone) / 0.18); color: #0f172a; }

/* --- Tarjeta de habitacion del rack: jerarquia nitida --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room:not([data-has-photo="true"]) .hb-room__number { color: #0f172a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room:not([data-has-photo="true"]) .hb-room__meta,
:is(html:not(.dark), [data-theme="light"]) body.hotel-app .hb-room:not([data-has-photo="true"]) .hb-room__eyebrow { color: #334155; }

/* --- Modales y dialogos: velo con blur suave y tarjeta elevada --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app [data-ui-overlay]:not(#modal-showroom-hab) {
  background-color: rgb(15 23 42 / 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app [data-ui-overlay]:not(#modal-showroom-hab) > :is(div, section, form) {
  border: 1px solid rgb(226 232 240 / 0.9);
  box-shadow:
    0 1px 2px rgb(15 23 42 / 0.08),
    0 12px 24px -8px rgb(15 23 42 / 0.18),
    0 32px 64px -24px rgb(15 23 42 / 0.28);
}

/* --- Teclado numerico y acceso por PIN del Lobby --- */
:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock {
  --ll-bg: #f1f5f9;
  --ll-card: rgb(255 255 255 / 0.88);
  --ll-border: #cbd5e1;
  --ll-text: #0f172a;
  --ll-muted: #334155;
  --ll-key: #f1f5f9;
  --ll-key-hover: #e2e8f0;
  --ll-accent: #0ea5e9;
  --ll-danger: #9f1239;
  background:
    radial-gradient(900px 480px at 88% -8%, rgb(16 185 129 / 0.07), transparent 62%),
    radial-gradient(760px 420px at -8% 108%, rgb(245 158 11 / 0.08), transparent 60%),
    #f1f5f9;
}

:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock .ll-card {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 18px 40px -18px rgb(15 23 42 / 0.28);
}

:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock .ll-pin {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.06);
}

:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock .ll-keypad button:not(.ll-ok) {
  min-height: 60px;
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 0 rgb(15 23 42 / 0.08);
}

:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock .ll-keypad button:not(.ll-ok):hover { background: #e2e8f0; }
:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock .ll-keypad button:not(.ll-ok):active { background: #cbd5e1; box-shadow: none; }
:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock .ll-keypad .ll-ok { background: #0ea5e9; color: #020617; }
:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock .ll-keypad .ll-ok:active { background: #0284c7; transform: scale(0.95); }
:is(html:not(.dark), [data-theme="light"]) .hb-theme #lobby-lock button:focus-visible { outline: 3px solid #075985; outline-offset: 2px; }

/* --- Tiendita (POS de consumos): tarjetas de producto con jerarquia nitida y agotados legibles --- */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) { color: #0f172a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) span:not([class]),
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) :is(.core-pos-product-reference, .core-pos-product-bs) { color: #334155; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) .core-pos-product-name { color: #0f172a; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) .core-pos-product-usd { color: #064e3b; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) .core-pos-product-action { color: #064e3b; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) .core-pos-product-stock { color: #064e3b; background: #d1fae5; border-color: #34d399; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) :is(.core-pos-product-stock.is-low, [data-stock-state="bajo"] .core-pos-product-stock) { color: #713f12; background: #fef9c3; border-color: #facc15; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card) :is(.core-pos-product-stock.is-empty, [data-stock-state="agotado"] .core-pos-product-stock) { color: #881337; background: #ffe4e6; border-color: #fb7185; }

/* Agotado: mismo contraste, estado comunicado por fondo apagado, foto en grises y texto "Agotado" */
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card):disabled { opacity: 1; background: #e2e8f0; border-color: #cbd5e1; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card):disabled :is(img.core-product-thumb, .core-pos-product-placeholder svg) { filter: grayscale(1); }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card):disabled :is(.core-pos-product-usd, .core-pos-product-action, .core-pos-product-name) { color: #1e293b; }
:is(html:not(.dark), [data-theme="light"]) body.hotel-app :is(.core-product-card, .core-pos-product-card):disabled .core-pos-product-action { background: #f1f5f9; border-color: #94a3b8; }

/* ---------- Desplegables nativos (select) en todas las vistas del hotel ----------
   Las <option> heredaban fondo transparente: la lista nativa usaba el fondo del sistema operativo con el
   color de texto del tema (texto claro sobre lista blanca en oscuro). Fondo y tinta explicitos por token:
   claro #0F172A sobre #F1F5F9 (16.3:1), oscuro #ECEFF4 sobre #171D29 (14.6:1). */
:is(.hb-theme, .hotel-app, .core-app[data-core-view="hotel-admin"]) :is(option, optgroup) {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}
:is(.hb-theme, .hotel-app, .core-app[data-core-view="hotel-admin"]) option:disabled { color: var(--ink-muted); }

/* =====================================================================================================
   OPERACION DE HABITACION Y KPIs (Lobby + Admin) - mismo estandar que el rack (DESIGN.md)
   Tokens --op-*: superficie opaca --bg-surface (oscuro) / --bg-sunken (claro, nunca blanco puro), tinta
   principal #ECEFF4 / #0F172A, secundaria #B4BDCB / #334155 y tintas de estado AAA. Sin color-mix: todos los
   fondos son colores solidos medibles (tests/test_hotel_operaciones_kpis_browser.py).
   ===================================================================================================== */
body.hotel-app {
  --op-surface: var(--bg-surface, #111620);
  --op-sunken: var(--bg-sunken, #0d1117);
  --op-control: var(--bg-elevated, #171d29);
  --op-control-hover: #1f2737;
  --op-control-active: #283246;
  --op-border: var(--border-subtle, rgb(255 255 255 / 0.08));
  --op-border-control: rgb(255 255 255 / 0.16);
  --op-text: #eceff4;    /* 15.7:1 */
  --op-muted: #b4bdcb;   /* 9.6:1 en superficie, 7.9:1 en hover */
  --op-gold: #d4b373;    /* 9.1:1 */
  --op-ink-free: #6ee7b7;
  --op-ink-reserved: #fcd34d;
  --op-ink-occupied: #fca5a5;
  --op-ink-cleaning: #fda4af;
  --op-ink-info: #7dd3fc;
  --op-gold-surface: #212426; /* oro viejo 10% sobre --bg-surface */
}

:is(html:not(.dark), [data-theme="light"]) body.hotel-app {
  --op-surface: var(--bg-sunken, #f8fafc);
  --op-sunken: var(--bg-elevated, #f1f5f9);
  --op-control: #f1f5f9;
  --op-control-hover: #e2e8f0;
  --op-control-active: #cbd5e1;
  --op-border: #e2e8f0;
  --op-border-control: #8794a8;
  --op-text: #0f172a;    /* 17.1:1 */
  --op-muted: #334155;   /* 9.9:1 */
  --op-gold: #5c4419;    /* 8.7:1 */
  --op-ink-free: #064e3b;
  --op-ink-reserved: #78350f;
  --op-ink-occupied: #7f1d1d;
  --op-ink-cleaning: #881337;
  --op-ink-info: #0c4a6e;
  --op-gold-surface: #f3f1ec;
}

/* ---------- Cuenta de habitacion (Cuenta / Check-out) ---------- */
body.hotel-app #modal-cuenta-hab .hb-op-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 28rem;
  min-width: 0;
  max-height: 90vh;
  max-height: 90dvh;
  padding: 1.25rem;
  border: 1px solid var(--op-border);
  border-radius: 1.5rem;
  background: var(--op-surface);
  color: var(--op-text);
  font: 500 13px/1.4 var(--hb-font-ui);
  box-shadow: 0 24px 48px -16px rgb(0 0 0 / 0.55);
}

#modal-cuenta-hab .hb-op-head {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--op-border);
}
#modal-cuenta-hab .hb-op-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--op-text);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#modal-cuenta-hab .hb-op-title i { color: var(--op-ink-free); }
#modal-cuenta-hab .hb-op-subtitle { margin: 0.25rem 0 0; color: var(--op-gold); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }

#modal-cuenta-hab .hb-op-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#modal-cuenta-hab .hb-op-card {
  padding: 0.875rem;
  border: 1px solid var(--op-border);
  border-radius: 1rem;
  background: var(--op-sunken);
}
#modal-cuenta-hab .hb-op-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--op-border);
}
#modal-cuenta-hab .hb-op-card__title {
  margin: 0;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#modal-cuenta-hab .hb-op-card > .hb-op-card__title { margin-bottom: 0.25rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--op-border); }

#modal-cuenta-hab .hb-op-rows { display: grid; margin: 0; }
#modal-cuenta-hab .hb-op-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.25rem; }
#modal-cuenta-hab .hb-op-row dt { min-width: 0; color: var(--op-muted); font-weight: 600; }
#modal-cuenta-hab .hb-op-row dd { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--op-text); font-weight: 700; white-space: nowrap; }
#modal-cuenta-hab .hb-op-row[data-tone="reserved"] dd { color: var(--op-ink-reserved); }
#modal-cuenta-hab .hb-op-row--total { margin-top: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--op-border); font-size: 15px; }
#modal-cuenta-hab .hb-op-row--total dt { color: var(--op-text); font-weight: 800; }
#modal-cuenta-hab .hb-op-row--total dd { color: var(--op-ink-free); font-weight: 800; }

#modal-cuenta-hab .hb-op-amount { color: var(--op-ink-info); font-weight: 800; white-space: nowrap; }
#modal-cuenta-hab .hb-op-lines { margin: 0; padding: 0; list-style: none; }
#modal-cuenta-hab .hb-op-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--op-border);
}
#modal-cuenta-hab .hb-op-line:last-child { border-bottom: 0; }
#modal-cuenta-hab .hb-op-line__name { flex: 1 1 auto; min-width: 0; color: var(--op-text); font-weight: 600; overflow-wrap: anywhere; }
#modal-cuenta-hab .hb-op-line__amount { flex: none; color: var(--op-ink-free); font-weight: 800; white-space: nowrap; }
#modal-cuenta-hab .hb-op-lines__empty { padding: 0.5rem 0; color: var(--op-muted); text-align: center; }

#modal-cuenta-hab .hb-op-foot { display: grid; flex-shrink: 0; gap: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--op-border); }
#modal-cuenta-hab .hb-op-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; }
#modal-cuenta-hab .hb-op-total span { color: var(--op-text); font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
#modal-cuenta-hab .hb-op-total strong { color: var(--op-ink-free); font-size: 1.625rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
#modal-cuenta-hab .hb-op-actions { display: grid; gap: 0.5rem; }

/* Botones operativos: control opaco con tinta principal; primario/informativo con relleno vivo y tinta oscura */
body.hotel-app :is(#modal-cuenta-hab .hb-op-btn, #modal-cuenta-hab .hb-op-close, #modal-cuenta-hab .hb-op-icon-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  border: 1px solid var(--op-border-control);
  border-radius: 0.875rem;
  background-color: var(--op-control);
  color: var(--op-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body.hotel-app #modal-cuenta-hab .hb-op-btn { width: 100%; padding: 0.5rem 1rem; font: 800 13px/1.25 var(--hb-font-ui); text-align: center; }
body.hotel-app :is(#modal-cuenta-hab .hb-op-close, #modal-cuenta-hab .hb-op-icon-btn) { flex: none; width: 2.75rem; padding: 0; }
body.hotel-app #modal-cuenta-hab .hb-op-btn.hidden { display: none; }
body.hotel-app :is(#modal-cuenta-hab .hb-op-btn, #modal-cuenta-hab .hb-op-close, #modal-cuenta-hab .hb-op-icon-btn):hover { background-color: var(--op-control-hover); border-color: var(--op-gold); }
body.hotel-app :is(#modal-cuenta-hab .hb-op-btn, #modal-cuenta-hab .hb-op-close, #modal-cuenta-hab .hb-op-icon-btn):active { background-color: var(--op-control-active); }
body.hotel-app :is(#modal-cuenta-hab .hb-op-btn, #modal-cuenta-hab .hb-op-close, #modal-cuenta-hab .hb-op-icon-btn):focus-visible { outline: 2px solid var(--op-gold); outline-offset: 2px; }
body.hotel-app #modal-cuenta-hab .hb-op-btn--primary { border-color: transparent; background-color: #10b981; color: #020617; }  /* 7.9:1 */
body.hotel-app #modal-cuenta-hab .hb-op-btn--primary:hover { border-color: transparent; background-color: #34d399; }   /* 10.5:1 */
body.hotel-app #modal-cuenta-hab .hb-op-btn--primary:active { background-color: #6ee7b7; }
body.hotel-app #modal-cuenta-hab .hb-op-btn--info { border-color: transparent; background-color: #38bdf8; color: #020617; }     /* 9.4:1 */
body.hotel-app #modal-cuenta-hab .hb-op-btn--info:hover { border-color: transparent; background-color: #7dd3fc; }
body.hotel-app #modal-cuenta-hab .hb-op-btn--info:active { background-color: #bae6fd; }

@media (max-width: 639px) {
  body.hotel-app #modal-cuenta-hab { padding: 0.75rem; }
  body.hotel-app #modal-cuenta-hab .hb-op-panel { padding: 1rem; border-radius: 1.25rem; }
}

/* ---------- Consumos: aviso de carga al folio en la tienda del Lobby ---------- */
body.hotel-app #contexto-consumos-habitacion.hb-op-context {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  max-width: 100%;
  padding: 0 0.875rem;
  border: 0;
  border-radius: 0.75rem;
  background-color: #075985;  /* blanco 7.6:1 */
  color: #ffffff;
  font: 800 12px/1.2 var(--hb-font-ui);
  text-align: left;
  cursor: pointer;
}
body.hotel-app #contexto-consumos-habitacion.hb-op-context.hidden { display: none; }
body.hotel-app #contexto-consumos-habitacion.hb-op-context:hover { background-color: #0c4a6e; }  /* 9.5:1 */
body.hotel-app #contexto-consumos-habitacion.hb-op-context:active { background-color: #082f49; }
body.hotel-app #contexto-consumos-habitacion.hb-op-context:focus-visible { outline: 2px solid var(--op-gold); outline-offset: 2px; }

/* ---------- Pago / Check-out (_modal_cobro.html compartido): solo dentro del hotel ----------
   Correcciones AAA en oscuro y compactacion para que en 1280x844 no aparezca scroll interno. */
body.hotel-app #modal-cobro #btn-tab-pago-normal.bg-emerald-600 { background-color: #10b981; color: #020617; }
html.dark body.hotel-app #modal-cobro #checkout-btn-doc-nota.bg-sky-600 { background-color: #075985; }
html.dark body.hotel-app #modal-cobro .text-purple-400 { color: #d8b4fe; }
html.dark body.hotel-app #modal-cobro :is(.text-slate-400, .text-slate-500) { color: var(--op-muted); }
html.dark body.hotel-app #modal-cobro #pm-btn-validar { background-color: #5b21b6; }
html.dark body.hotel-app #modal-cobro #pm-btn-validar:hover { background-color: #4c1d95; }

body.hotel-app #modal-cobro :is(.cobro-body, .cobro-col, .cobro-totales) { gap: 0.5rem; }
body.hotel-app #modal-cobro .core-cobro-resumen { padding-block: 0.5rem; }
body.hotel-app #modal-cobro :is(#modal-total-txt, #modal-total-local-txt) {
  display: block;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem);
  line-height: 1.15;
  white-space: nowrap;
  overflow-wrap: normal;
}
body.hotel-app #modal-cobro [data-metodo-rapido] { min-height: 2.75rem; padding-block: 0.375rem; }
body.hotel-app #modal-cobro #details-descuento-cobro { padding: 0.5rem 0.75rem; }
body.hotel-app #modal-cobro :is(.core-cobro-select, .core-cobro-monto) { height: 3rem; }
body.hotel-app #modal-cobro #seccion-pago-normal > .grid.items-end { gap: 0.5rem 0.75rem; padding: 0.625rem 0.75rem; }
body.hotel-app #modal-cobro #seccion-pago-normal > .grid.font-mono > div { padding: 0.5rem 0.75rem; }

/* Movil: total y bolivares en filas (etiqueta | monto) para que ningun monto se parta */
@media (max-width: 639px) {
  body.hotel-app #modal-cobro .core-cobro-resumen { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; padding: 0.5rem 0.75rem; text-align: left; }
  body.hotel-app #modal-cobro .core-cobro-resumen > div:not([hidden]) { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
  body.hotel-app #modal-cobro .core-cobro-resumen > div > span:first-child { min-width: 0; font-size: 11px; }
  body.hotel-app #modal-cobro :is(#modal-total-txt, #modal-total-local-txt) { font-size: 1.375rem; }
}

/* ---------- KPIs Bento (cabecera del rack y Auditoria del Admin) ----------
   .core-kpi conserva la geometria compartida con HQ (padding 1.5rem, radio 1rem); .hb-kpi aporta superficie,
   jerarquia y tintas. Especificidad (0,4,1) para ganar a core-design en ambos temas. */
body.core-app.hotel-app .core-kpi.hb-kpi {
  --kpi-ink: var(--op-text);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  border: 1px solid var(--op-border);
  background: var(--op-surface);
  color: var(--op-text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25), 0 10px 24px -18px rgb(0 0 0 / 0.6);
}
:is(html:not(.dark), [data-theme="light"]) body.core-app.hotel-app .core-kpi.hb-kpi {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 10px 24px -18px rgb(15 23 42 / 0.25);
}
body.core-app.hotel-app .core-kpi.hb-kpi[data-tone="free"] { --kpi-ink: var(--op-ink-free); }
body.core-app.hotel-app .core-kpi.hb-kpi[data-tone="occupied"] { --kpi-ink: var(--op-ink-occupied); }
body.core-app.hotel-app .core-kpi.hb-kpi[data-tone="cleaning"] { --kpi-ink: var(--op-ink-cleaning); }
body.core-app.hotel-app .core-kpi.hb-kpi[data-tone="info"] { --kpi-ink: var(--op-ink-info); }
body.core-app.hotel-app .core-kpi.hb-kpi[data-tone="gold"] { --kpi-ink: var(--op-gold); }
body.core-app.hotel-app .core-kpi.hb-kpi.hb-kpi--destacado { border-color: var(--border-accent, rgb(197 160 89 / 0.45)); background: var(--op-gold-surface); }

body.hotel-app .hb-kpi .hb-kpi__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--op-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}
body.hotel-app .hb-kpi .hb-kpi__label i { color: var(--kpi-ink); font-size: 12px; }
body.hotel-app .hb-kpi .hb-kpi__value {
  margin: 0;
  color: var(--kpi-ink);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
body.hotel-app .hb-kpi .hb-kpi__value[data-tone="free"] { color: var(--op-ink-free); }
body.hotel-app .hb-kpi .hb-kpi__value[data-tone="occupied"] { color: var(--op-ink-occupied); }
body.hotel-app .hb-kpi .hb-kpi__hint { margin: 0; color: var(--op-muted); font-size: 12px; font-weight: 600; }

/* Rack: 3 contadores + ingresos a todo el ancho en movil/tablet; 4 en fila desde 1024px */
#sec-hospedaje .hb-kpi-grid--rack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 0.75rem; }
#sec-hospedaje .hb-kpi-grid--rack .hb-kpi--destacado { grid-column: 1 / -1; }
body.core-app.hotel-app #sec-hospedaje .hb-kpi-grid--rack .core-kpi.hb-kpi { padding: 1rem; }
@media (max-width: 639px) {
  #sec-hospedaje .hb-kpi-grid--rack { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  #sec-hospedaje .hb-kpi-grid--rack .hb-kpi--destacado { grid-column: auto; }
  body.core-app.hotel-app #sec-hospedaje .hb-kpi-grid--rack .core-kpi.hb-kpi { padding: 0.75rem; }
  #sec-hospedaje .hb-kpi-grid--rack .hb-kpi__value { font-size: 1.25rem; }
  /* Solo montos extremos (Bs. 1.234.567,89) pueden saltar de linea; nunca se recortan */
  #sec-hospedaje .hb-kpi-grid--rack .hb-kpi--destacado .hb-kpi__value { white-space: normal; overflow-wrap: anywhere; }
}
@media (min-width: 1024px) {
  #sec-hospedaje .hb-kpi-grid--rack { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #sec-hospedaje .hb-kpi-grid--rack .hb-kpi--destacado { grid-column: auto; }
}

/* Panel de Auditoria de Turnos (Cierres Z): misma superficie que los KPIs */
body.hotel-app #sec-auditoria .hb-audit-panel { border-color: var(--op-border); background-color: var(--op-surface); }

/* Auditoria en oscuro: textos secundarios con tinta AAA */
html.dark body.hotel-app #sec-auditoria :is(.text-slate-400, .text-slate-500) { color: var(--op-muted); }

/* ---------- Sprint 1B: migas de pan, tablas financieras accesibles y enlace a Finanzas (solo tokens) ---------- */
body.hotel-app .hb-migas { margin: 0 0 0.75rem; }
body.hotel-app .hb-migas ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--op-muted);
}
body.hotel-app .hb-migas li { display: inline-flex; align-items: center; gap: 0.375rem; min-width: 0; }
body.hotel-app .hb-migas li + li::before { content: "/"; color: var(--op-muted); }
body.hotel-app .hb-migas a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--op-gold);
  font-weight: 700;
  text-decoration: none;
}
body.hotel-app .hb-migas a:hover,
body.hotel-app .hb-migas a:focus-visible { text-decoration: underline; }
body.hotel-app .hb-migas a:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 4px; }
body.hotel-app .hb-migas [aria-current="page"] { color: var(--op-text); font-weight: 700; }
body.hotel-app .hb-enlace-finanzas { color: var(--op-gold); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.hb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
body.hotel-app .hb-tabla-financiera :is(td.text-right, th.text-right) { font-variant-numeric: tabular-nums lining-nums; }
body.hotel-app .hb-tabla-total tr { border-top: 2px solid var(--op-border-control); }
body.hotel-app .hb-tabla-total :is(th, td) {
  color: var(--op-text);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: none;
  white-space: nowrap;
}
body.hotel-app .hb-tabla-total td {
  font-family: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  font-variant-numeric: tabular-nums lining-nums;
}
@media print {
  body.hotel-app .hb-tabla-financiera { width: 100%; border-collapse: collapse; color: #000; }
  body.hotel-app .hb-tabla-financiera :is(th, td) { color: #000; background: transparent; border-bottom: 1px solid #999; }
  body.hotel-app .hb-tabla-total tr { border-top: 2px solid #000; }
}
