/**
 * Sala de Espera — layout anclado al viewport (sin scroll de página).
 * SOLO activo con body.cn-sala-espera-active (ajax.js).
 * No toca sidebar, colores globales ni otros módulos.
 */
:root {
  --cn-sala-header-h: var(--cn-header-height, 50px);
  --cn-sala-footer-h: 42px;
  --cn-sala-sidebar-w: var(--cn-sidebar-width, 230px);
  --cn-sala-sidebar-mini-w: 50px;
}

html.cn-sala-espera-active,
body.cn-sala-espera-active {
  height: 100% !important;
  overflow: hidden !important;
}

body.cn-sala-espera-active .wrapper {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  /* NO cambiar background del .wrapper: el sidebar de skin-blue
     puede depender de él. El área clara va solo en .content-wrapper. */
}

body.cn-sala-espera-active .content-wrapper {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  min-height: 0 !important;
  height: calc(100vh - var(--cn-sala-header-h) - var(--cn-sala-footer-h)) !important;
  max-height: calc(100vh - var(--cn-sala-header-h) - var(--cn-sala-footer-h)) !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  background: #eff4fa !important;
  box-shadow: none !important;
  border: none !important;
}

body.cn-sala-espera-active .content-wrapper > .content {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  max-height: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

body.cn-sala-espera-active .content-wrapper > .content > .row {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
}

body.cn-sala-espera-active .content-wrapper > .content > .row > .box,
body.cn-sala-espera-active .cn-gestion-host-box {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
  height: 100% !important;
  max-height: 100% !important;
}

body.cn-sala-espera-active #cuerpo {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body.cn-sala-espera-active .main-footer {
  position: fixed !important;
  left: var(--cn-sala-sidebar-w) !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: var(--cn-sala-footer-h) !important;
  margin: 0 !important;
  margin-left: 0 !important;
  padding: 10px 15px !important;
  z-index: 830 !important;
  background: #fff !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
  line-height: 20px !important;
  overflow: hidden !important;
}

body.cn-sala-espera-active.sidebar-mini.sidebar-collapse .main-footer {
  left: var(--cn-sala-sidebar-mini-w) !important;
}

/* Página del módulo */
body.cn-sala-espera-active #cuerpo > .cn-module-page.sala-espera-page {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 6px 10px 8px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.cn-sala-espera-active .sala-espera-page > .cn-module-header {
  flex: 0 0 auto !important;
  margin-bottom: 8px !important;
}

body.cn-sala-espera-active .sala-espera-page > .sala-espera-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

body.cn-sala-espera-active .sala-espera-page .content.sala-espera-content,
body.cn-sala-espera-active .sala-espera-page .content.sala-espera-tabla-section {
  padding: 0 !important;
  margin: 0 0 8px !important;
}

body.cn-sala-espera-active .sala-espera-page .content.sala-espera-tabla-section:last-child {
  margin-bottom: 0 !important;
}

body.cn-sala-espera-active .sala-espera-page .box-sala-espera {
  margin-bottom: 0 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06) !important;
}

body.cn-sala-espera-active .sala-espera-tabla-section:not(.is-visible) {
  display: none !important;
}

/* Compactar filtros/cajas solo en este módulo (menos scroll interno) */
body.cn-sala-espera-active .sala-espera-filters {
  padding: 12px 14px 10px !important;
  gap: 10px 14px !important;
}

body.cn-sala-espera-active .sala-espera-cajas-wrap {
  margin: 10px 12px 12px !important;
  padding: 8px !important;
}

@media (max-width: 767px) {
  body.cn-sala-espera-active .main-footer {
    left: 0 !important;
  }

  body.cn-sala-espera-active #cuerpo > .cn-module-page.sala-espera-page {
    padding: 4px 6px 6px !important;
  }
}
