/* Panel — Sistema Plata, estructura de encargado-app (sidebar colapsable,
   titlebar, dock móvil y launchpad). El acento del panel es fijo: no depende
   del color de marca del hotel, que es del sitio público. */

:root {
  --ap-brand: #072AC8;
  --ap-brand-hover: #0620a0;
  --ap-brand-bg: color-mix(in srgb, var(--ap-brand) 8%, transparent);
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 70px;
  --titlebar-h: 54px;
  --topbar-h: 64px;
}

[data-theme="dark"] {
  --ap-brand: #4c6ef5;
  --ap-brand-hover: #3b5bdb;
}

/* ============================================================
   ACCESIBILIDAD: FOCO VISIBLE
   El personal del hotel usa este panel a diario y muchas veces con
   teclado (rejillas de reservas, formularios largos); sin un contorno
   de foco, tabular por la interfaz es navegar a ciegas. Se usa
   --ap-brand porque es el único acento que el panel fija por tema
   (no depende de la marca del hotel del sitio público) y por eso
   mantiene contraste tanto en modo claro como oscuro. Mismo enfoque
   que app/web/assets/css/main.css, adaptado a las variables del panel.
   ============================================================ */
.btn:focus-visible,
.ap-input:focus-visible,
.sidebar-item:focus-visible,
.ap-dock__btn:focus-visible,
.ap-launchpad__app:focus-visible,
.ap-modal__cerrar:focus-visible,
select:focus-visible,
textarea:focus-visible,
.admin-tabla button:focus-visible,
.admin-tabla a:focus-visible,
.hab-gal__controls button:focus-visible,
.rev-ed__controls button:focus-visible {
  outline: 2px solid var(--ap-brand);
  outline-offset: 2px;
  border-radius: var(--ap-radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* ============================================================
   SHELL
   ============================================================ */
.admin-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--ap-bg);
  font-family: var(--font-sans);
}

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.admin-body-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

.admin-body-content > .admin-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.panel-tab.oculto {
  display: none !important;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ap-sidebar);
  border-right: 1px solid var(--ap-border);
  box-shadow: var(--ap-shadow-sm);
  overflow-x: hidden;
  transition: width 0.3s ease;
  z-index: 100;
}

.is-collapsed .admin-sidebar {
  width: var(--sidebar-w-collapsed);
}

/* --- Marca --- */
.sidebar-brand {
  height: 58px;
  flex-shrink: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--ap-border-light);
}

.is-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.sidebar-brand__id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.panel-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--ap-radius-sm);
  object-fit: contain;
}

.is-collapsed .panel-mark {
  width: 32px;
  height: 32px;
  box-shadow: var(--ap-shadow-sm);
}

.sidebar-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-brand__eyebrow {
  font-size: 9px;
  font-weight: 700;
  color: var(--ap-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.4;
}

.sidebar-brand__name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ap-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.is-collapsed .sidebar-brand__text,
.is-collapsed .sidebar-collapse,
.is-collapsed .sidebar-search,
.is-collapsed .sidebar-group__label,
.is-collapsed .sidebar-item span,
.is-collapsed .sidebar-profile__info,
.is-collapsed .sidebar-logout span {
  display: none;
}

.sidebar-collapse {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--ap-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-collapse:hover {
  background: var(--ap-bg);
  color: var(--ap-primary);
}

.sidebar-collapse svg {
  width: 15px;
  height: 15px;
}

/* Botón de expandir cuando está colapsado */
.sidebar-expand {
  display: none;
  margin: 8px auto 0;
  width: 32px;
  height: 32px;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: var(--ap-radius-sm);
  color: var(--ap-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.is-collapsed .sidebar-expand {
  display: grid;
}

.sidebar-expand:hover {
  background: var(--ap-bg);
  color: var(--ap-primary);
}

.sidebar-expand svg {
  width: 15px;
  height: 15px;
}

/* --- Buscador --- */
.sidebar-search {
  flex-shrink: 0;
  padding: 10px 12px 4px;
}

.sidebar-search__box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  color: var(--ap-muted);
  transition: border-color 0.2s;
}

.sidebar-search__box:focus-within {
  border-color: color-mix(in srgb, var(--ap-brand) 40%, transparent);
}

.sidebar-search__box svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.sidebar-search__box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--ap-primary);
}

/* --- Navegación --- */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-group.is-empty {
  display: none;
}

.sidebar-group__label {
  padding: 8px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ap-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.sidebar-group + .sidebar-group .sidebar-group__label {
  margin-top: 4px;
  border-top: 1px solid var(--ap-border-light);
  padding-top: 10px;
}

.is-collapsed .sidebar-group + .sidebar-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--ap-border-light);
}

.sidebar-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--ap-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.is-collapsed .sidebar-item {
  justify-content: center;
  padding: 8px;
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background: var(--ap-bg);
  color: var(--ap-primary);
}

.sidebar-item--activo,
.sidebar-item--activo:hover {
  background: var(--ap-brand);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ap-brand) 22%, transparent);
}

.sidebar-item.is-hidden {
  display: none;
}

/* Tooltip al estar colapsado */
.sidebar-item__tip {
  display: none;
  position: absolute;
  left: 100%;
  margin-left: 12px;
  padding: 6px 12px;
  background: var(--ap-secondary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  border-radius: 8px;
  box-shadow: var(--ap-shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
}

.is-collapsed .sidebar-item__tip {
  display: block;
}

.is-collapsed .sidebar-item:hover .sidebar-item__tip {
  opacity: 1;
}

/* --- Pie del sidebar --- */
.sidebar-footer {
  flex-shrink: 0;
  padding: 10px;
  border-top: 1px solid var(--ap-border-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 10px;
}

.is-collapsed .sidebar-profile {
  justify-content: center;
}

.sidebar-profile__avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  color: var(--ap-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-profile__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-profile__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ap-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile__rol {
  font-size: 10.5px;
  color: var(--ap-muted);
}

.sidebar-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 10px;
  color: var(--ap-red);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.is-collapsed .sidebar-logout {
  justify-content: center;
}

.sidebar-logout:hover {
  background: var(--ap-red-bg);
}

.sidebar-logout svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ============================================================
   TITLEBAR (escritorio)
   ============================================================ */
.admin-titlebar {
  height: var(--titlebar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--ap-sidebar);
  border-bottom: 1px solid var(--ap-border);
  box-shadow: var(--ap-shadow-sm);
  position: relative;
  z-index: 20;
}

.titlebar__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ap-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.titlebar__spacer {
  flex: 1;
}

.titlebar__chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.titlebar__chips::-webkit-scrollbar {
  display: none;
}

.titlebar__status {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.titlebar__status::-webkit-scrollbar {
  display: none;
}

.titlebar-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ap-secondary);
  font-family: inherit;
}

button.titlebar-status-chip {
  cursor: pointer;
}

button.titlebar-status-chip:hover {
  background: var(--ap-surface-hover, #f4f5f7);
}

.titlebar-status-chip--warn {
  background: color-mix(in srgb, var(--ap-amber) 12%, var(--ap-surface));
  border-color: color-mix(in srgb, var(--ap-amber) 20%, var(--ap-border));
  color: var(--ap-amber);
}

.titlebar-status-chip--muted {
  color: var(--ap-muted);
}

.titlebar-status-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.titlebar-status-chip--warn .titlebar-status-chip__dot {
  animation: dash-ping 1.5s ease infinite;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.panel-savebar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--ap-border-light);
  background: color-mix(in srgb, var(--ap-bg) 40%, var(--ap-surface));
}

.admin-panel--flush .panel-savebar {
  border-top: 1px solid var(--ap-border-light);
}

/* Modal reserva (estilo landing, tokens del panel) */
.ap-modal__panel--booking {
  max-width: 920px;
  width: 100%;
}

.bk-modal__body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  padding: 0 !important;
  overflow: hidden;
}

.bk-summary {
  padding: 18px 16px;
  background: color-mix(in srgb, var(--ap-bg) 55%, var(--ap-surface));
  border-right: 1px solid var(--ap-border-light);
}

.bk-summary__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ap-muted);
  margin-bottom: 12px;
}

.bk-summary__img {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  aspect-ratio: 16 / 10;
  background: var(--ap-bg);
}

.bk-summary__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bk-summary__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.bk-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.bk-summary__row dt {
  color: var(--ap-muted);
  font-weight: 600;
}

.bk-summary__row dd {
  font-weight: 700;
  color: var(--ap-primary, var(--ap-secondary));
  text-align: right;
}

.bk-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid var(--ap-border-light);
  font-size: 12px;
  color: var(--ap-muted);
  font-weight: 600;
}

.bk-summary__total strong {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ap-brand, var(--ap-primary));
}

.bk-form {
  padding: 18px 20px;
  overflow-y: auto;
  max-height: min(68vh, 620px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bk-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bk-fieldset legend {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ap-muted);
  margin-bottom: 2px;
}

.bk-rsel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bk-rsel__opt {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ap-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ap-surface);
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.bk-rsel__opt:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--ap-brand, #072ac8) 35%, var(--ap-border));
  transform: translateY(-1px);
}

.bk-rsel__opt.is-selected {
  border-color: var(--ap-brand, #072ac8);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ap-brand, #072ac8) 18%, transparent);
}

.bk-rsel__opt:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bk-rsel__img {
  aspect-ratio: 16 / 10;
  background: var(--ap-bg);
  overflow: hidden;
}

.bk-rsel__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bk-rsel__txt {
  padding: 8px 10px;
}

.bk-rsel__name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ap-primary, var(--ap-secondary));
  line-height: 1.25;
}

.bk-rsel__meta {
  font-size: 10px;
  color: var(--ap-muted);
  margin-top: 2px;
}

.bk-rsel__price {
  font-size: 13px;
  font-weight: 700;
  color: var(--ap-brand, var(--ap-primary));
  margin-top: 4px;
}

body.is-modal-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .bk-modal__body {
    grid-template-columns: 1fr;
  }

  .bk-summary {
    border-right: none;
    border-bottom: 1px solid var(--ap-border-light);
  }

  .bk-rsel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Chips de estado (reservas activas/pausadas, WhatsApp) */
.ap-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface);
  border-radius: var(--ap-radius-sm);
  color: var(--ap-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.ap-chip:hover {
  background: var(--ap-surface-hover);
}

.ap-chip__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ap-muted);
}

.ap-chip--on {
  background: var(--ap-success-bg);
  border-color: color-mix(in srgb, var(--ap-success) 18%, transparent);
  color: var(--ap-success);
}

.ap-chip--on .ap-chip__dot {
  background: var(--ap-success);
}

.ap-chip--off {
  background: var(--ap-bg);
  border-color: var(--ap-border);
  color: var(--ap-muted);
}

.ap-chip--warn {
  background: var(--ap-amber-bg);
  border-color: color-mix(in srgb, var(--ap-amber) 18%, transparent);
  color: var(--ap-amber);
}

.ap-chip--warn .ap-chip__dot {
  background: var(--ap-amber);
}

.ap-chip:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Botones redondos del titlebar */
.titlebar__btn {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface);
  border-radius: var(--ap-radius-sm);
  color: var(--ap-secondary);
  cursor: pointer;
  box-shadow: var(--ap-shadow-sm);
  transition: all 0.2s;
}

.titlebar__btn:hover {
  background: var(--ap-surface-hover);
  color: var(--ap-primary);
}

.titlebar__btn:active {
  transform: scale(0.95);
}

.titlebar__btn svg {
  width: 17px;
  height: 17px;
}

.titlebar__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--ap-red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.titlebar__badge.is-shown {
  display: flex;
}

/* --- Popovers --- */
.ap-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: 280px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-md);
  overflow: hidden;
  z-index: 60;
}

.ap-popover[hidden] {
  display: none;
}

.ap-popover__head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ap-border-light);
  background: color-mix(in srgb, var(--ap-bg) 40%, transparent);
  font-size: 11px;
  font-weight: 700;
  color: var(--ap-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ap-popover__body {
  padding: 12px;
}

.ap-popover__empty {
  padding: 20px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ap-muted);
}

.ap-popover__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.ap-popover__item:hover {
  background: var(--ap-bg);
}

.ap-popover__item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ap-primary);
}

.ap-popover__item-sub {
  font-size: 10.5px;
  color: var(--ap-muted);
}

/* Selector de tema */
.tema-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  border-radius: 10px;
}

.tema-switch__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--ap-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tema-switch__btn svg {
  width: 14px;
  height: 14px;
}

.tema-switch__btn:hover {
  color: var(--ap-primary);
}

.tema-switch__btn.is-activo {
  background: var(--ap-brand);
  color: #fff;
  box-shadow: var(--ap-shadow-sm);
}

/* ============================================================
   MÓVIL: topbar, drawer, dock y launchpad
   ============================================================ */
.admin-topbar {
  display: none;
  height: var(--topbar-h);
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--ap-sidebar);
  border-bottom: 1px solid var(--ap-border);
  box-shadow: var(--ap-shadow-sm);
}

.topbar__burger {
  width: 40px;
  height: 40px;
  margin-left: -8px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--ap-secondary);
  cursor: pointer;
}

.topbar__burger svg {
  width: 24px;
  height: 24px;
}

.topbar__title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ap-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drawer */
.ap-drawer {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
}

.ap-drawer[hidden] {
  display: none;
}

.ap-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(3px);
}

.ap-drawer__panel {
  position: relative;
  width: 280px;
  height: 100%;
  background: var(--ap-sidebar);
  border-right: 1px solid var(--ap-border);
  box-shadow: var(--ap-shadow-md);
  animation: ap-slide-right 0.22s ease;
  display: flex;
  flex-direction: column;
}

@keyframes ap-slide-right {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* Dock inferior */
.ap-dock {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--ap-sidebar);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-lg);
  box-shadow: var(--ap-shadow-md);
  z-index: 90;
}

.ap-dock__btn {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  color: var(--ap-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.ap-dock__btn svg {
  width: 20px;
  height: 20px;
}

.ap-dock__btn--activo {
  background: var(--ap-brand);
  color: #fff;
  box-shadow: var(--ap-shadow-sm);
}

.ap-dock__btn--launch {
  background: var(--ap-brand-bg);
  border: 1px solid color-mix(in srgb, var(--ap-brand) 14%, transparent);
  color: var(--ap-brand);
}

.ap-dock__btn:active {
  transform: scale(0.9);
}

/* Launchpad */
.ap-launchpad {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
}

.ap-launchpad[hidden] {
  display: none;
}

.ap-launchpad__sheet {
  background: var(--ap-sidebar);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--ap-shadow-md);
  padding-bottom: 24px;
  animation: ap-slide-up 0.25s ease;
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
}

@keyframes ap-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ap-launchpad__handle {
  width: 36px;
  height: 4px;
  margin: 12px auto 4px;
  border-radius: 999px;
  background: var(--ap-border);
  flex-shrink: 0;
}

.ap-launchpad__head {
  padding: 8px 24px;
  margin: 0 auto 8px;
  width: 100%;
  max-width: 480px;
  border-bottom: 1px solid var(--ap-border-light);
  font-size: 11px;
  font-weight: 700;
  color: var(--ap-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.ap-launchpad__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 4px 12px;
  overflow-y: auto;
}

.ap-launchpad__app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border: none;
  background: transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s;
}

.ap-launchpad__app:active {
  transform: scale(0.88);
}

.ap-launchpad__icon {
  position: relative;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  box-shadow: var(--ap-shadow-sm);
}

.ap-launchpad__icon svg {
  width: 22px;
  height: 22px;
}

.ap-launchpad__app.is-activo .ap-launchpad__icon::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ap-success);
}

.ap-launchpad__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ap-secondary);
  line-height: 1.2;
  text-align: center;
  max-width: 74px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   CONTENIDO
   ============================================================ */
.panel-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ap-border-light);
}

.admin-panel--flush .panel-toolbar {
  padding-top: 4px;
}

/* Resumen — dashboard estilo encargado-app */
.dash-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-page--loading .dash-kpis,
.dash-page--loading .dash-grid {
  opacity: 0.55;
  pointer-events: none;
}

.dash-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--ap-border);
  background: var(--ap-surface);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ap-secondary);
  text-decoration: none;
  cursor: default;
}

button.dash-chip {
  cursor: pointer;
  font-family: inherit;
}

button.dash-chip:hover {
  background: var(--ap-surface-hover, #f4f5f7);
}

.dash-chip--ok {
  background: color-mix(in srgb, var(--ap-success) 10%, var(--ap-surface));
  border-color: color-mix(in srgb, var(--ap-success) 18%, var(--ap-border));
  color: var(--ap-success);
}

.dash-chip--warn {
  background: color-mix(in srgb, var(--ap-amber) 12%, var(--ap-surface));
  border-color: color-mix(in srgb, var(--ap-amber) 20%, var(--ap-border));
  color: var(--ap-amber);
  cursor: pointer;
}

.dash-chip--muted {
  color: var(--ap-muted);
}

.dash-chip--link {
  cursor: pointer;
}

.dash-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.dash-chip--warn .dash-chip__dot {
  animation: dash-ping 1.5s ease infinite;
}

@keyframes dash-ping {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.dash-status .btn {
  margin-left: auto;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 900px) {
  .dash-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .dash-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.dash-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: 12px;
  box-shadow: var(--ap-shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
}

.dash-kpi:hover {
  box-shadow: var(--ap-shadow-md, 0 4px 14px rgba(0, 0, 0, 0.08));
  border-color: color-mix(in srgb, var(--ap-brand, #072ac8) 20%, var(--ap-border));
}

.dash-kpi__main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dash-kpi__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-kpi__icon svg {
  width: 18px;
  height: 18px;
}

.dash-kpi__icon--green { background: color-mix(in srgb, var(--ap-success) 12%, transparent); color: var(--ap-success); }
.dash-kpi__icon--amber { background: color-mix(in srgb, var(--ap-amber) 12%, transparent); color: var(--ap-amber); }
.dash-kpi__icon--accent { background: color-mix(in srgb, var(--ap-chart) 12%, transparent); color: var(--ap-chart); }
.dash-kpi__icon--slate { background: var(--ap-bg); color: var(--ap-secondary); }

.dash-kpi__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ap-muted);
  line-height: 1.2;
  margin-bottom: 4px;
}

.dash-kpi__value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ap-primary, var(--ap-secondary));
  line-height: 1;
  letter-spacing: -0.02em;
}

.dash-kpi__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}

.dash-kpi__trend {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  line-height: 1.2;
}

.dash-kpi__trend--up {
  background: color-mix(in srgb, var(--ap-success) 12%, var(--ap-surface));
  border-color: color-mix(in srgb, var(--ap-success) 15%, transparent);
  color: var(--ap-success);
}

.dash-kpi__trend--down {
  background: color-mix(in srgb, var(--ap-red, #ef4444) 10%, var(--ap-surface));
  border-color: color-mix(in srgb, var(--ap-red, #ef4444) 15%, transparent);
  color: var(--ap-red, #ef4444);
}

.dash-kpi__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ap-amber);
  animation: dash-ping 1.5s ease infinite;
}

.dash-kpi__hint {
  font-size: 10px;
  font-weight: 600;
  color: var(--ap-muted);
  margin-top: 6px;
  max-width: 84px;
  line-height: 1.2;
}

.dash-kpi__hint--up { color: var(--ap-success); }
.dash-kpi__hint--down { color: var(--ap-red, #ef4444); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 1024px) {
  .dash-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.dash-panel {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: 16px;
  box-shadow: var(--ap-shadow-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
}

.dash-panel--table {
  padding: 0;
  overflow: hidden;
}

.dash-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ap-border-light, rgba(0, 0, 0, 0.05));
}

.dash-panel--table .dash-panel__head {
  padding: 12px 16px;
  margin: 0;
  background: color-mix(in srgb, var(--ap-bg) 50%, var(--ap-surface));
}

.dash-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dash-panel__title svg {
  width: 16px;
  height: 16px;
  color: var(--ap-chart);
  flex-shrink: 0;
}

.dash-panel__title h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ap-primary, var(--ap-secondary));
}

.dash-panel__meta {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ap-muted);
}

.dash-panel__link {
  border: none;
  background: none;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--ap-brand, var(--ap-primary));
  cursor: pointer;
  font-family: inherit;
}

.dash-panel__link:hover {
  text-decoration: underline;
}

.dash-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 220px;
  padding-top: 8px;
}

.dash-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
  position: relative;
}

.dash-chart__tip {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ap-primary, #111);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 2;
}

.dash-chart__col:hover .dash-chart__tip {
  opacity: 1;
}

.dash-chart__bar {
  width: 100%;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ap-chart) 88%, #fff), var(--ap-chart));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: height 0.8s ease, filter 0.15s;
}

.dash-chart__col:hover .dash-chart__bar {
  filter: brightness(1.08);
}

.dash-chart__day {
  font-size: 10px;
  font-weight: 700;
  color: var(--ap-muted);
}

.dash-table-wrap {
  overflow-x: auto;
  flex: 1;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dash-table thead tr {
  background: color-mix(in srgb, var(--ap-bg) 55%, var(--ap-surface));
  border-bottom: 1px solid var(--ap-border-light);
}

.dash-table th {
  padding: 8px 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ap-muted);
  text-align: left;
}

.dash-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ap-border-light);
  color: var(--ap-secondary);
}

.dash-table tbody tr:hover {
  background: color-mix(in srgb, var(--ap-bg) 35%, transparent);
}

.dash-table__muted {
  color: var(--ap-muted);
  font-weight: 500;
}

.dash-table__empty {
  text-align: center;
  color: var(--ap-muted);
  padding: 28px 12px !important;
  font-weight: 600;
}

.dash-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  flex: 1;
}

.dash-bars__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-bars__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}

.dash-bars__name {
  color: var(--ap-primary, var(--ap-secondary));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-bars__count {
  color: var(--ap-chart);
  flex-shrink: 0;
}

.dash-bars__track {
  height: 6px;
  background: var(--ap-bg);
  border: 1px solid var(--ap-border-light);
  border-radius: 999px;
  overflow: hidden;
}

.dash-bars__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ap-chart) 80%, #fff), var(--ap-chart));
  transition: width 0.8s ease;
}

.dash-bars__empty {
  text-align: center;
  color: var(--ap-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 24px 0;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-stat {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  padding: 16px 18px;
  box-shadow: var(--ap-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-stat__valor {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ap-primary);
  line-height: 1.1;
}

.admin-stat__label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ap-muted);
}

.admin-stat--brand .admin-stat__valor { color: var(--ap-brand); }
.admin-stat--warn .admin-stat__valor { color: var(--ap-amber); }
.admin-stat--ok .admin-stat__valor { color: var(--ap-success); }

/* Paneles y tablas */
.admin-panel {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow-sm);
  overflow: hidden;
}

.admin-panel__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ap-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-panel__body {
  padding: 20px;
}

.ap-panel-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ap-primary);
}

.ap-panel-hint {
  font-size: 11.5px;
  color: var(--ap-muted);
  margin-top: 2px;
}

.panel-pill {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ap-muted);
  background: var(--ap-bg);
  border: 1px solid var(--ap-border-light);
  border-radius: 999px;
}

.admin-tabla-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.panel-aside-sticky {
  position: sticky;
  top: 0;
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hab-pricing-tiers {
  margin-top: -4px;
  padding-bottom: 4px;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-section__title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--ap-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ap-border-light);
}

.panel-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--ap-border-light);
}

/* El hint de estilos.css solo aplica dentro de <label>; aquí también se usa
   dentro de contenedores. */
.ap-field__hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ap-muted);
}

/* Galería de fotos de habitación (panel) */
.hab-gal__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 0;
  margin-bottom: 10px;
}

.hab-gal__item {
  position: relative;
  width: 88px;
  flex-shrink: 0;
}

.hab-gal__thumb {
  display: block;
  width: 88px;
  height: 66px;
  border-radius: var(--ap-radius-sm);
  border: 1px solid var(--ap-border);
  object-fit: cover;
  background: var(--ap-bg);
}

.hab-gal__item.is-cover .hab-gal__thumb {
  border-color: var(--ap-brand);
  box-shadow: 0 0 0 1px var(--ap-brand);
}

.hab-gal__badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fff;
  background: var(--ap-brand);
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.2;
}

.hab-gal__controls {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  justify-content: center;
}

.hab-gal__controls button {
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--ap-border);
  border-radius: 4px;
  background: var(--ap-surface);
  color: var(--ap-muted);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.hab-gal__controls button:hover:not(:disabled) {
  border-color: var(--ap-brand);
  color: var(--ap-brand);
}

.hab-gal__controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hab-gal__controls button[data-remove] {
  color: var(--ap-red);
}

.hab-gal__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hab-gal__count {
  font-size: 11px;
  color: var(--ap-muted);
}

.hab-gal__empty {
  font-size: 11.5px;
  color: var(--ap-muted);
  padding: 10px 0 4px;
}

/* Editor de reseñas (panel) */
.rev-ed__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.rev-ed__item {
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-bg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rev-ed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rev-ed__idx {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ap-muted);
}

.rev-ed__controls {
  display: flex;
  gap: 4px;
}

.rev-ed__controls button {
  width: 26px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--ap-border);
  border-radius: 4px;
  background: var(--ap-surface);
  color: var(--ap-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.rev-ed__controls button:hover:not(:disabled) {
  border-color: var(--ap-brand);
  color: var(--ap-brand);
}

.rev-ed__controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.rev-ed__controls button[data-remove] {
  color: var(--ap-red);
}

.rev-ed__row {
  display: grid;
  grid-template-columns: 1fr 1fr 88px;
  gap: 10px;
}

.rev-ed__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.rev-ed__count {
  font-size: 11px;
  color: var(--ap-muted);
}

.rev-ed__empty {
  font-size: 11.5px;
  color: var(--ap-muted);
  padding: 8px 0 2px;
}

@media (max-width: 720px) {
  .rev-ed__row {
    grid-template-columns: 1fr;
  }
}

/* Sitio web — layout tipo Mi Negocio (encargado-app) */
.admin-panel--flush .admin-panel__body {
  padding: 20px;
}

.admin-form.sitio-settings {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
}

.sitio-settings__nav {
  width: 260px;
  flex-shrink: 0;
}

.sitio-nav-card {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: 14px;
  box-shadow: var(--ap-shadow-sm);
  padding: 10px;
}

.sitio-nav-card__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ap-muted);
  padding: 8px 10px 6px;
}

.sitio-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ap-secondary);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.sitio-nav-btn:hover {
  background: var(--ap-surface-hover, #f4f5f7);
}

.sitio-nav-btn.is-active {
  background: var(--ap-brand, #072ac8);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--ap-shadow-sm);
}

.sitio-nav-btn__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sitio-nav-btn__icon svg {
  width: 16px;
  height: 16px;
}

.sitio-nav-btn__icon--emerald { background: #10b981; color: #fff; }
.sitio-nav-btn__icon--blue { background: #3b82f6; color: #fff; }
.sitio-nav-btn__icon--purple { background: #8b5cf6; color: #fff; }
.sitio-nav-btn__icon--amber { background: #f59e0b; color: #fff; }
.sitio-nav-btn__icon--teal { background: #14b8a6; color: #fff; }
.sitio-nav-btn__icon--rose { background: #f43f5e; color: #fff; }

.sitio-nav-btn.is-active .sitio-nav-btn__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.sitio-nav-btn__text {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.sitio-nav-btn__chev {
  font-size: 14px;
  opacity: 0.45;
}

.sitio-nav-btn.is-active .sitio-nav-btn__chev {
  opacity: 0.7;
}

.sitio-settings__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sitio-settings__back {
  display: none;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 8px 12px;
  border: 1px solid var(--ap-border);
  border-radius: 10px;
  background: var(--ap-surface);
  color: var(--ap-primary, var(--ap-secondary));
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--ap-shadow-sm);
}

.sitio-panel[hidden] {
  display: none !important;
}

.sitio-card {
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: 12px;
  box-shadow: var(--ap-shadow-sm);
  padding: 16px 18px;
}

.sitio-card--spaced {
  margin-bottom: 16px;
}

.sitio-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ap-border-light, rgba(0, 0, 0, 0.04));
}

.sitio-card__head svg {
  width: 18px;
  height: 18px;
  color: var(--ap-muted);
  flex-shrink: 0;
}

.sitio-card__head h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ap-primary, var(--ap-secondary));
}

.sitio-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sitio-card__full {
  grid-column: 1 / -1;
}

.sitio-card__stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sitio-color-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sitio-color-swatch {
  width: 48px;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--ap-border);
  border-radius: 8px;
  background: var(--ap-surface);
  flex-shrink: 0;
}

.sitio-callout {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ap-brand, #072ac8) 18%, transparent);
  background: color-mix(in srgb, var(--ap-brand, #072ac8) 6%, var(--ap-surface));
}

.sitio-callout__title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ap-primary, var(--ap-secondary));
  margin-bottom: 4px;
}

.sitio-callout__text {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ap-muted);
}

.sitio-toggle-list {
  display: flex;
  flex-direction: column;
}

.sitio-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ap-border-light, rgba(0, 0, 0, 0.04));
}

.sitio-toggle-row:first-child {
  padding-top: 0;
}

.sitio-toggle-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sitio-toggle-row__title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ap-primary, var(--ap-secondary));
}

.sitio-toggle-row__hint {
  font-size: 11.5px;
  color: var(--ap-muted);
  margin-top: 4px;
  line-height: 1.45;
  max-width: 36ch;
}

@media (max-width: 767px) {
  .admin-form.sitio-settings {
    flex-direction: column;
    gap: 0;
    min-height: 0;
  }

  .sitio-settings:not(.sitio-settings--detail) .sitio-settings__main {
    display: none;
  }

  .sitio-settings--detail .sitio-settings__nav {
    display: none;
  }

  .sitio-settings--detail .sitio-settings__back {
    display: inline-flex;
  }

  .sitio-settings__nav,
  .sitio-settings__main {
    width: 100%;
  }

  .sitio-card__grid {
    grid-template-columns: 1fr;
  }
}

/* Subida de imagen de habitación (legado) */
.hab-img {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hab-img__preview {
  width: 72px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--ap-radius-sm);
  border: 1px solid var(--ap-border);
  background: var(--ap-bg);
  object-fit: cover;
}

.hab-img__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hab-img__name {
  font-size: 10.5px;
  color: var(--ap-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Interruptor */
.ap-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ap-border);
  background: var(--ap-bg);
  border-radius: var(--ap-radius-sm);
}

.ap-switch__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ap-switch__label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ap-primary);
}

.ap-switch__hint {
  font-size: 11px;
  color: var(--ap-muted);
}

/* WhatsApp */
.wa-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ap-border);
  background: var(--ap-bg);
  border-radius: var(--ap-radius);
  padding: 16px;
  min-height: 220px;
}

.wa-qr-placeholder {
  text-align: center;
  font-size: 12px;
  color: var(--ap-muted);
  padding: 24px;
}

.wa-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  box-shadow: var(--ap-shadow-sm);
}

.wa-estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
}

.wa-estado__punto {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ap-muted);
}

.wa-estado__punto--on {
  background: var(--ap-success);
  box-shadow: 0 0 8px var(--ap-success);
}

/* Badges de reserva */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge--pending { color: var(--ap-amber); background: var(--ap-amber-bg); }
.badge--confirmed { color: var(--ap-success); background: var(--ap-success-bg); }
.badge--cancelled { color: var(--ap-red); background: var(--ap-red-bg); }

/* Control segmentado de estado de reserva: los tres estados a la vista, el actual
   resaltado por color; un clic sobre otro lo cambia (reemplaza al antiguo <select>). */
.estado-seg {
  display: inline-flex;
  border: 1px solid var(--ap-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--ap-surface);
}
.estado-seg__btn {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border: none;
  border-right: 1px solid var(--ap-border);
  background: transparent;
  color: var(--ap-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.estado-seg__btn:last-child { border-right: none; }
.estado-seg__btn:hover:not(.is-active):not(:disabled) {
  background: var(--ap-surface-hover, #f4f5f7);
  color: var(--ap-secondary);
}
.estado-seg__btn:disabled { cursor: default; opacity: 0.7; }
.estado-seg__btn.is-active { color: #fff; cursor: default; }
.estado-seg__btn--pending.is-active { background: var(--ap-amber, #f59e0b); }
.estado-seg__btn--confirmed.is-active { background: var(--ap-success, #16a34a); }
.estado-seg__btn--cancelled.is-active { background: var(--ap-red, #dc2626); }

/* Pestañas de la sección Notificaciones (WhatsApp / Email). */
.notif-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--ap-surface-hover, #f4f5f7);
  border: 1px solid var(--ap-border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.notif-tab {
  padding: 8px 20px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--ap-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.notif-tab:hover:not(.is-active) { color: var(--ap-primary); }
.notif-tab.is-active {
  background: var(--ap-surface);
  color: var(--ap-brand, #072ac8);
  box-shadow: var(--ap-shadow-sm);
}
.notif-panel { max-width: 640px; }

/* Sección Reseñas: encabezado explicativo + tarjetas compactas (edición en modal). */
.rev-ed-head {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--ap-border-light, var(--ap-border));
}
.rev-ed-head__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--ap-primary);
}
.rev-ed-head__hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ap-muted);
  margin-top: 4px;
}
.rev-ed__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.rev-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--ap-border);
  border-radius: 12px;
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow-sm);
}
.rev-card__body { flex: 1; min-width: 0; }
.rev-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rev-card__stars { color: #f5b301; font-size: 13px; letter-spacing: 1px; }
.rev-card__author { font-weight: 700; font-size: 13px; color: var(--ap-primary); }
.rev-card__date { font-size: 12px; color: var(--ap-muted); }
.rev-card__text {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ap-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rev-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.rev-card__icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ap-border);
  border-radius: 8px;
  background: var(--ap-surface);
  color: var(--ap-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.rev-card__icon:hover:not(:disabled) { background: var(--ap-surface-hover, #f4f5f7); }
.rev-card__icon:disabled { opacity: 0.4; cursor: default; }
.rev-card__icon--danger:hover:not(:disabled) { color: var(--ap-red, #dc2626); border-color: var(--ap-red, #dc2626); }
.rev-ed__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rev-ed__count { font-size: 12px; color: var(--ap-muted); }
.rev-ed__empty {
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ap-muted);
  border: 1px dashed var(--ap-border);
  border-radius: 12px;
}

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

.row-actions select {
  font-size: 11.5px !important;
  padding: 4px 6px !important;
  height: auto !important;
  min-height: auto !important;
}

.row-actions .btn--xs {
  font-size: 10.5px;
  padding: 3px 6px;
}

/* ============================================================
   CALENDARIO GANTT
   ============================================================ */
.gantt-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius-sm);
  background: var(--ap-surface);
  overflow-x: auto;
  min-width: 800px;
}

.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--ap-border-light);
  min-height: 48px;
  position: relative;
}

.gantt-row--header {
  background: var(--ap-surface-hover);
  font-weight: 600;
  border-bottom: 2px solid var(--ap-border);
  min-height: 38px;
}

.gantt-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--ap-border-light);
  flex-shrink: 0;
}

.gantt-cell--room {
  width: 160px;
  justify-content: flex-start;
  padding: 0 14px;
  font-weight: 600;
  color: var(--ap-primary);
  background: var(--ap-surface);
  position: sticky;
  left: 0;
  z-index: 10;
  border-right: 2px solid var(--ap-border);
}

.gantt-row--header .gantt-cell--room {
  background: var(--ap-surface-hover);
}

.gantt-cell--day {
  width: 38px;
  font-size: 11px;
  color: var(--ap-muted);
  user-select: none;
}

.gantt-row--header .gantt-cell--day {
  flex-direction: column;
  padding: 4px 0;
  line-height: 1.2;
}

.gantt-cell--day-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--ap-primary);
}

.gantt-cell--day.is-weekend {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .gantt-cell--day.is-weekend {
  background: rgba(255, 255, 255, 0.01);
}

.gantt-cell--day.is-today {
  background: var(--ap-brand-bg);
  box-shadow: inset 0 0 0 1px var(--ap-brand);
}

.gantt-booking {
  position: absolute;
  height: 34px;
  top: 7px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
  transition: transform 0.15s;
}

.gantt-booking:hover {
  transform: scale(1.02);
  z-index: 8;
}

.gantt-booking--confirmed {
  background: linear-gradient(135deg, var(--ap-success), #047857);
}

.gantt-booking--pending {
  background: linear-gradient(135deg, var(--ap-amber), #b45309);
}

/* Solape: no reemplaza el color de estado (confirmada/pendiente), solo lo remarca
   con un contorno de advertencia para que no pase inadvertido en el Gantt. */
.gantt-booking--solape {
  outline: 2px solid var(--ap-red);
  outline-offset: 1px;
}

.gantt-solape-aviso {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ap-red) 30%, transparent);
  background: var(--ap-red-bg);
  color: var(--ap-red);
  font-size: 12.5px;
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .admin-layout,
  .panel-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .admin-sidebar,
  .admin-titlebar {
    display: none;
  }

  .admin-topbar {
    display: flex;
  }

  .ap-dock {
    display: flex;
  }

  /* Espacio para que el dock no tape el contenido */
  .admin-body-content {
    padding: 16px 16px 100px;
  }

  .ap-popover {
    right: 12px;
    left: 12px;
    width: auto;
  }

  .panel-field-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MOVIMIENTO REDUCIDO
   Igual que en app/web/assets/css/main.css: quien activa esta
   preferencia del sistema operativo puede marearse con las
   transiciones y animaciones (drawer, launchpad, indicadores
   pulsantes), así que se anulan casi por completo en vez de
   suavizarse.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .ap-drawer__panel,
  .ap-launchpad__sheet,
  .dash-chip__dot {
    animation: none;
  }
  .ap-dock__btn:active,
  .ap-launchpad__app:active {
    transform: none;
  }
}
