/* My Lab — mismo lenguaje visual Academy (panel pro) · tablet */

:root {
  --ml-bg: #020810;
  --ml-surface: rgba(4, 14, 28, 0.38);
  --ml-surface-2: rgba(6, 22, 42, 0.42);
  --ml-border: rgba(140, 200, 255, 0.22);
  --ml-border-strong: rgba(0, 136, 255, 0.4);
  --ml-text: #f1f7ff;
  --ml-muted: rgba(186, 210, 235, 0.78);
  --ml-action: #0088ff;
  --ml-action-hover: #33a3ff;
  --ml-ok: #2f9e6a;
  --ml-ok-bg: rgba(47, 158, 106, 0.16);
  --ml-warn: #c9a227;
  --ml-warn-bg: rgba(201, 162, 39, 0.16);
  --ml-bad: #c45c5c;
  --ml-bad-bg: rgba(196, 92, 92, 0.16);
  --ml-orange: #c47a3a;
  --ml-orange-bg: rgba(196, 122, 58, 0.16);
  --ml-radius: 18px;
  --ml-radius-sm: 12px;
  --ml-touch: 48px;
  --ml-shadow: 0 14px 36px rgba(0, 10, 30, 0.28), 0 0 22px rgba(0, 136, 255, 0.08);
  --ml-font: "DM Sans", system-ui, sans-serif;
  --ml-display: "Source Serif 4", Georgia, serif;
  --ml-glass: blur(12px);
}

.ml-page {
  --ml-top-h: 92px;
  --hilab-header-logo-h: 96px;
  --hilab-header-logo-max-w: 360px;
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  color: var(--ml-text);
  font-family: var(--ml-font);
  background: #000;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.ml-page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 6, 16, 0.34) 0%, rgba(0, 8, 20, 0.2) 42%, rgba(0, 6, 16, 0.48) 100%),
    url("./assets/my-lab-bg.jpg") center / cover no-repeat;
  filter: saturate(1.12) contrast(1.05) brightness(0.72);
  transform: scale(1.04);
  animation: ml-bg-drift 48s ease-in-out infinite alternate;
}

/* Capa tecnológica discreta sobre el lab */
.ml-page-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}

.ml-page-fx__grid {
  position: absolute;
  inset: -10%;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(120, 190, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 190, 255, 0.09) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 18%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 18%, transparent 78%);
  animation: ml-fx-grid 36s linear infinite;
}

.ml-page-fx__aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.34;
  mix-blend-mode: screen;
}

.ml-page-fx__aurora--a {
  width: min(52vw, 640px);
  height: min(52vw, 640px);
  left: -8%;
  top: 12%;
  background: radial-gradient(circle, rgba(0, 136, 255, 0.55) 0%, rgba(0, 80, 160, 0.12) 48%, transparent 72%);
  animation: ml-fx-aurora-a 22s ease-in-out infinite alternate;
}

.ml-page-fx__aurora--b {
  width: min(44vw, 520px);
  height: min(44vw, 520px);
  right: -6%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(56, 210, 255, 0.38) 0%, rgba(0, 100, 180, 0.1) 46%, transparent 70%);
  animation: ml-fx-aurora-b 28s ease-in-out infinite alternate;
}

.ml-page-fx__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

@keyframes ml-bg-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.2%, 0.8%, 0); }
}

@keyframes ml-fx-grid {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-72px, -72px, 0); }
}

@keyframes ml-fx-aurora-a {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.28; }
  to { transform: translate3d(6%, 8%, 0) scale(1.12); opacity: 0.4; }
}

@keyframes ml-fx-aurora-b {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.22; }
  to { transform: translate3d(-8%, -5%, 0) scale(1.18); opacity: 0.36; }
}

@media (prefers-reduced-motion: reduce) {
  .ml-page-bg,
  .ml-page-fx__grid,
  .ml-page-fx__aurora,
  .ml-brand--hero .ml-brand__logo {
    animation: none !important;
  }
  .ml-page-fx__canvas { display: none; }
}

.ml-top,
.ml-shell { position: relative; z-index: 1; }

/* Encabezado integrado al fondo (sin barra opaca) */
.ml-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas: "brand center end";
  align-items: center;
  gap: 10px;
  min-height: var(--ml-top-h);
  height: auto;
  padding:
    max(8px, env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    8px
    max(12px, env(safe-area-inset-left, 0px));
  border-bottom: 0;
  background: transparent;
  box-sizing: border-box;
  pointer-events: none;
}

.ml-top > * { pointer-events: auto; }

.ml-brand-wrap {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ml-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
}

.ml-brand img {
  filter: drop-shadow(0 0 12px rgba(0, 136, 255, 0.35));
}

/* Marca hero: logo grande sin recuadro */
.ml-brand--hero {
  position: relative;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.ml-brand--hero .ml-brand__logo {
  position: relative;
  z-index: 1;
  height: var(--hilab-header-logo-h);
  width: auto;
  max-width: var(--hilab-header-logo-max-w);
  object-fit: contain;
  filter:
    drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 16px rgba(0, 136, 255, 0.32));
  animation: ml-brand-breathe 6.5s ease-in-out infinite;
}

@keyframes ml-brand-breathe {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 14px rgba(0, 136, 255, 0.28)); }
  50% { transform: translateY(-1px) scale(1.012); filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 22px rgba(0, 136, 255, 0.42)); }
}

.ml-back--top {
  flex-shrink: 0;
  background: rgba(0, 24, 48, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ml-top__center {
  grid-area: center;
  justify-self: center;
  align-self: center;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  padding: 0 8px;
}

.ml-top__center strong {
  display: block;
  font-size: clamp(0.92rem, 1.6vw, 1.08rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.ml-top__end {
  grid-area: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
  justify-self: end;
}

/* Admin con selector de dispositivo: columna extra para los iconos */
html.ml-has-preview .ml-top {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "brand center tools end";
}

html.ml-has-preview .ml-preview-tools {
  grid-area: tools;
  justify-self: center;
}

.ml-tabs--top {
  margin-left: 0;
  flex-shrink: 1;
}

.ml-tabs--top[hidden] {
  display: none !important;
}

/* Menú móvil (hamburguesa + drawer) — oculto en desktop */
.ml-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(140, 200, 255, 0.28);
  border-radius: 12px;
  background: rgba(0, 16, 36, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.ml-nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #dcefff;
}

.ml-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 4, 12, 0.55);
  backdrop-filter: blur(2px);
}

.ml-nav-backdrop[hidden],
.ml-nav-drawer[hidden] {
  display: none !important;
}

.ml-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(320px, 88vw);
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(20px, env(safe-area-inset-bottom, 0px))
    16px;
  background: linear-gradient(180deg, rgba(4, 18, 40, 0.97), rgba(2, 10, 24, 0.98));
  border-left: 1px solid rgba(140, 200, 255, 0.22);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}

.ml-nav-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ml-nav-drawer__head strong {
  font-size: 1.05rem;
  color: #fff;
}

.ml-nav-drawer__who {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 200, 255, 0.18);
  background: rgba(0, 40, 80, 0.28);
  color: #cfe8ff;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.ml-nav-drawer__links,
.ml-nav-drawer__tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ml-nav-drawer__label {
  margin: 8px 0 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7ec8ff;
}

.ml-nav-drawer__links button,
.ml-nav-drawer__tabs button {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #e8f4ff;
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 0 14px;
  cursor: pointer;
}

.ml-nav-drawer__links button:active,
.ml-nav-drawer__tabs button:active {
  background: rgba(0, 136, 255, 0.18);
}

.ml-nav-drawer__logout {
  margin-top: auto;
  width: 100%;
}

.ml-nav-drawer__tabs[hidden],
.ml-nav-drawer__logout[hidden],
.ml-nav-drawer__who[hidden] {
  display: none !important;
}

/* ——— Preview dispositivo (solo Admin Hi Lab) ——— */
.ml-preview-tools {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(0, 12, 28, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.ml-preview-tools:not([hidden]) {
  display: inline-flex;
}

.ml-preview-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(180, 210, 235, 0.75);
  cursor: pointer;
  padding: 0;
}

.ml-preview-btn:hover,
.ml-preview-btn:focus-visible {
  color: #fff;
  background: rgba(0, 136, 255, 0.18);
  outline: none;
}

.ml-preview-btn.is-active {
  color: #fff;
  background: rgba(0, 136, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 136, 255, 0.45);
}

/* Marco de preview: reduce el ancho útil y fuerza estilos móvil/tablet */
html.ml-preview-phone,
html.ml-preview-tablet {
  background: #01060e;
}

html.ml-preview-phone body.ml-page,
html.ml-preview-tablet body.ml-page {
  display: flex;
  flex-direction: column;
  align-items: center;
}

html.ml-preview-phone .ml-page-bg,
html.ml-preview-phone .ml-page-fx,
html.ml-preview-tablet .ml-page-bg,
html.ml-preview-tablet .ml-page-fx {
  /* fondo a pantalla completa detrás del marco */
}

html.ml-preview-phone .ml-top,
html.ml-preview-phone .ml-shell,
html.ml-preview-tablet .ml-top,
html.ml-preview-tablet .ml-shell {
  width: 100%;
  max-width: var(--ml-preview-w, 390px);
  margin-left: auto;
  margin-right: auto;
}

html.ml-preview-phone {
  --ml-preview-w: 390px;
}

html.ml-preview-tablet {
  --ml-preview-w: 820px;
}

html.ml-preview-phone .ml-top,
html.ml-preview-tablet .ml-top {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(100%, var(--ml-preview-w));
  border-radius: 0 0 14px 14px;
  background: rgba(2, 10, 22, 0.35);
  backdrop-filter: blur(8px);
}

html.ml-preview-phone .ml-shell,
html.ml-preview-tablet .ml-shell {
  border-left: 1px solid rgba(140, 200, 255, 0.16);
  border-right: 1px solid rgba(140, 200, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(0, 0, 0, 0.4);
}

/* Forzar UI de teléfono (media queries no aplican: el viewport real sigue siendo PC) */
html.ml-preview-phone {
  --ml-top-h: 108px;
  --hilab-header-logo-h: 44px;
  --hilab-header-logo-max-w: 150px;
}

html.ml-preview-phone .ml-nav-toggle { display: inline-flex !important; }
html.ml-preview-phone .ml-tabs--top,
html.ml-preview-phone .ml-hub-logout--top { display: none !important; }
html.ml-preview-phone .ml-preview-tools:not([hidden]) { display: inline-flex !important; }

html.ml-preview-phone .ml-top {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand end"
    "tools tools"
    "center center";
  row-gap: 6px;
  padding-bottom: 8px;
}

html.ml-preview-phone .ml-brand-wrap { grid-area: brand; min-width: 0; }
html.ml-preview-phone .ml-top__end { grid-area: end; }
html.ml-preview-phone .ml-preview-tools { grid-area: tools; width: 100%; justify-content: center; }
html.ml-preview-phone .ml-top__center {
  grid-area: center;
  justify-self: stretch;
  text-align: left;
  padding: 0 2px;
}
html.ml-preview-phone .ml-top__center strong {
  white-space: normal;
  font-size: 0.78rem;
  line-height: 1.25;
}

html.ml-preview-phone .ml-back--top {
  padding: 0 10px;
  min-height: 36px;
  font-size: 0.75rem;
}

html.ml-preview-phone .ml-hub--pro {
  padding: 10px;
  align-items: flex-start;
  overflow: auto;
}

html.ml-preview-phone .ml-entry-card,
html.ml-preview-phone .ml-entry-card.ah-lab-card {
  grid-template-columns: 1fr;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  border-radius: 18px;
}

html.ml-preview-phone .ml-entry-card .ah-lab-card__visual {
  order: -1;
  min-height: 100px;
  max-height: 112px;
}

html.ml-preview-phone .ml-entry-card--labs {
  width: 100%;
  height: auto;
  max-height: none;
}

html.ml-preview-phone .ml-split,
html.ml-preview-phone .eq-body,
html.ml-preview-phone .mat-body,
html.ml-preview-phone .ml-split--roles {
  grid-template-columns: 1fr !important;
}

html.ml-preview-phone .mat-cats--chips,
html.ml-preview-tablet .mat-cats--chips { display: none !important; }
html.ml-preview-phone .mat-cats-select-wrap,
html.ml-preview-tablet .mat-cats-select-wrap { display: flex; }

html.ml-preview-phone .mat-panel--list .mat-detail-pane,
html.ml-preview-tablet .mat-panel--list .mat-detail-pane { display: none !important; }
html.ml-preview-phone .mat-panel--detail .mat-list-pane,
html.ml-preview-tablet .mat-panel--detail .mat-list-pane { display: none !important; }

html.ml-preview-phone .mat-kpis .eq-kpi,
html.ml-preview-tablet .mat-kpis .eq-kpi { padding: 8px 6px; }
html.ml-preview-phone .mat-kpis .eq-kpi span,
html.ml-preview-tablet .mat-kpis .eq-kpi span { font-size: 0.58rem; }
html.ml-preview-phone .mat-row.ml-item,
html.ml-preview-tablet .mat-row.ml-item { padding: 8px 10px; min-height: 0; }

html.ml-preview-phone .eq-panel {
  overflow: visible;
  max-height: none;
}

html.ml-preview-phone .eq-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
}

html.ml-preview-phone .eq-list-card,
html.ml-preview-phone .eq-detail-card {
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

html.ml-preview-phone .eq-list-card {
  max-height: 38vh;
  overflow: auto;
}

html.ml-preview-phone .eq-detail-body {
  overflow: visible;
  flex: 0 0 auto;
}

html.ml-preview-phone .eq-ficha {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto auto !important;
  height: auto;
  overflow: visible;
}

html.ml-preview-phone .eq-photo {
  max-height: none;
}

html.ml-preview-phone .eq-photo__frame {
  min-height: 200px;
  max-height: none;
  height: auto;
  aspect-ratio: 4 / 3;
}

html.ml-preview-phone .eq-photo__frame img {
  object-fit: contain;
  background: rgba(0, 8, 20, 0.55);
}

html.ml-preview-phone .eq-kpis,
html.ml-preview-phone .eq-kpis--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.ml-preview-phone .eq-docs {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.ml-preview-phone .ml-detail-grid,
html.ml-preview-phone .ml-form {
  grid-template-columns: 1fr !important;
}

html.ml-preview-phone .ml-pane {
  padding: 10px;
  overflow: auto;
}

html.ml-preview-phone .ml-pick-grid--hojas {
  grid-template-columns: 1fr !important;
}

/* Forzar UI tablet */
html.ml-preview-tablet {
  --ml-top-h: 96px;
  --hilab-header-logo-h: 56px;
  --hilab-header-logo-max-w: 200px;
}

html.ml-preview-tablet .ml-nav-toggle { display: inline-flex !important; }
html.ml-preview-tablet .ml-tabs--top,
html.ml-preview-tablet .ml-hub-logout--top { display: none !important; }
html.ml-preview-tablet .ml-preview-tools:not([hidden]) { display: inline-flex !important; }

html.ml-preview-tablet .ml-top {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand end"
    "center center";
  row-gap: 4px;
}

html.ml-preview-tablet .ml-preview-tools {
  order: -1;
}

html.ml-preview-tablet .ml-entry-card,
html.ml-preview-tablet .ml-entry-card.ah-lab-card {
  grid-template-columns: 1fr;
  width: min(560px, 94%);
  height: auto;
  max-height: none;
}

html.ml-preview-tablet .ml-entry-card .ah-lab-card__visual {
  order: -1;
  min-height: 140px;
  max-height: 160px;
}

html.ml-preview-tablet .ml-entry-card--labs {
  width: min(96%, 960px);
}

html.ml-preview-tablet .ml-split,
html.ml-preview-tablet .eq-body,
html.ml-preview-tablet .mat-body,
html.ml-preview-tablet .ml-split--roles {
  grid-template-columns: 1fr !important;
}

html.ml-preview-tablet .eq-body {
  overflow: auto;
  align-content: start;
}

html.ml-preview-tablet .eq-list-card,
html.ml-preview-tablet .eq-detail-card {
  height: auto;
  max-height: none;
}

html.ml-preview-tablet .eq-kpis,
html.ml-preview-tablet .eq-kpis--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

html.ml-preview-tablet .ml-detail-grid {
  grid-template-columns: 1fr 1fr !important;
}

@media (max-width: 900px) {
  .ml-preview-tools { display: none !important; }
}

.ml-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: rgba(226, 238, 255, 0.9);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
}

.ml-user__role {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 20, 48, 0.45);
  border: 1px solid rgba(0, 136, 255, 0.4);
  color: #7ec8ff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Hub: card centrada exactamente (como la captura de referencia) */
.ml-screen[data-screen="hub"] {
  height: 100%;
  min-height: 100%;
}

.ml-hub--pro {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding:
    max(28px, calc(env(safe-area-inset-top, 0px) + 12px))
    max(28px, env(safe-area-inset-right, 0px))
    max(28px, calc(env(safe-area-inset-bottom, 0px) + 12px))
    max(28px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  min-height: 0;
}

.ml-entry-card {
  /* ~60–68% del viewport, margen claro en los 4 lados */
  width: min(980px, 68vw);
  height: min(500px, 58dvh);
  min-height: 420px;
  max-height: min(520px, calc(100dvh - 96px));
  flex: 0 0 auto;
  border-radius: 26px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 8, 24, 0.28), 0 0 0 1px rgba(140, 200, 255, 0.06) inset;
  background: rgba(2, 10, 24, 0.12);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.ml-entry-card.ah-lab-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.ml-entry-card .ah-lab-card__copy {
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: clamp(22px, 3vw, 34px);
  text-align: center;
  background: linear-gradient(
    105deg,
    rgba(2, 10, 24, 0.22) 0%,
    rgba(4, 18, 40, 0.1) 55%,
    rgba(4, 18, 40, 0.04) 100%
  ) !important;
}

.ml-entry-card .ah-lab-card__visual,
.ml-entry-card .ah-lab-card__visual.ml-viz {
  position: relative;
  min-height: 100%;
  height: 100%;
  opacity: 1;
  filter: saturate(1.15) contrast(1.06) brightness(0.9);
  background-color: #020810 !important;
  /* Matraz + vaso de precipitado */
  background-image:
    linear-gradient(105deg, rgba(2, 10, 24, 0.55) 0%, rgba(2, 10, 24, 0.12) 32%, transparent 58%),
    url("./assets/academy-lab-bg.jpg") !important;
  background-position: 62% 48% !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

.ml-entry-card .ah-lab-card__visual::after {
  background:
    radial-gradient(ellipse 55% 50% at 62% 42%, rgba(0, 136, 255, 0.14), transparent 62%),
    linear-gradient(180deg, transparent 52%, rgba(0, 8, 20, 0.32) 100%);
}

.ml-entry-card .ah-panel__title {
  width: 100%;
  text-align: center;
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.ml-entry-card .ah-shortcuts {
  margin-top: 18px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 0;
  max-width: 26rem;
  width: 100%;
  gap: 10px;
}

.ml-entry-card .ah-action-pill {
  width: 100%;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.ml-entry-card .ah-action-pill:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.ml-hub-login {
  width: 100%;
  max-width: 24rem;
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.ml-hub-login[hidden],
.ah-shortcuts[hidden] {
  display: none !important;
}

.ml-hub-login__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7ec8ff;
}

.ml-hub-login__lead {
  margin: 0 0 4px;
  color: rgba(200, 225, 245, 0.88);
  font-size: 0.9rem;
  line-height: 1.4;
}

.ml-hub-login__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(2, 12, 28, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ml-hub-login__label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 210, 235, 0.78);
}

.ml-hub-login__label input {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-size: 0.98rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}

.ml-hub-login__label input::placeholder {
  color: rgba(180, 210, 235, 0.45);
}

.ml-hub-login__label input:focus {
  outline: none;
  border-color: #33a3ff;
  box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.22);
  background: rgba(0, 40, 80, 0.35);
}

.ml-hub-login__err {
  margin: 0;
  color: #fca5a5;
  font-size: 0.84rem;
}

.ml-hub-login__submit {
  width: 100%;
  margin-top: 2px;
}

.ml-hub-login__admin {
  border: 0;
  background: transparent;
  color: rgba(180, 220, 255, 0.85);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px;
}

.ml-hub-login__admin:hover {
  color: #fff;
}

.ml-hub-logout {
  border: 1px solid rgba(80, 130, 180, 0.28);
  background: rgba(0, 8, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(190, 210, 230, 0.88);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ml-hub-logout:hover,
.ml-hub-logout:focus-visible {
  border-color: rgba(0, 136, 255, 0.55);
  color: #fff;
  outline: none;
}

.ml-hub-logout--top {
  flex-shrink: 0;
}

/* ——— Hub visual: burbujas en el vaso ——— */
.ml-viz {
  isolation: isolate;
  overflow: hidden;
}

.ml-viz__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  pointer-events: none;
}

.ml-viz__hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Columna compacta junto al vaso (centro del panel) */
.ml-viz__stack {
  position: absolute;
  left: 52%;
  top: 28%;
  width: min(118px, 34%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  animation: ml-viz-float 5.5s ease-in-out infinite;
}

.ml-viz__chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0, 168, 255, 0.35);
  background: rgba(2, 12, 28, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 16px rgba(0, 20, 50, 0.32), 0 0 12px rgba(0, 136, 255, 0.1);
  color: #e8f4ff;
}

.ml-viz__chip strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.ml-viz__chip small {
  display: block;
  margin-top: 1px;
  font-size: 0.52rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(186, 210, 235, 0.78);
}

.ml-viz__chip--gauss,
.ml-viz__chip--bars {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 6px 8px 5px;
}

.ml-viz__ring {
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.ml-viz__ring circle {
  fill: none;
  stroke: rgba(0, 136, 255, 0.22);
  stroke-width: 6;
}

.ml-viz__ring-val {
  stroke: #33a3ff !important;
  stroke-linecap: round;
  stroke-dasharray: 72 100;
  filter: drop-shadow(0 0 4px rgba(0, 168, 255, 0.65));
  animation: ml-viz-ring 3.6s ease-in-out infinite;
}

.ml-viz__gauss {
  display: block;
  width: 100%;
  height: auto;
}

.ml-viz__gauss-fill {
  fill: rgba(0, 136, 255, 0.22);
  animation: ml-viz-gauss-pulse 3.2s ease-in-out infinite;
}

.ml-viz__gauss-line {
  fill: none;
  stroke: #7ec8ff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: ml-viz-gauss-draw 4s ease-in-out infinite;
}

.ml-viz__gauss-mean {
  stroke: rgba(198, 232, 74, 0.85);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  animation: ml-viz-mean 2.4s ease-in-out infinite;
}

.ml-viz__bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.ml-viz__bars span {
  flex: 1;
  height: var(--h);
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(180deg, #5ec8ff, #0088ff);
  box-shadow: 0 0 6px rgba(0, 136, 255, 0.35);
  animation: ml-viz-bar 2.8s ease-in-out infinite;
}

.ml-viz__bars span:nth-child(2) { animation-delay: 0.15s; }
.ml-viz__bars span:nth-child(3) { animation-delay: 0.3s; }
.ml-viz__bars span:nth-child(4) { animation-delay: 0.45s; }
.ml-viz__bars span:nth-child(5) { animation-delay: 0.6s; }
.ml-viz__bars span:nth-child(6) { animation-delay: 0.75s; }
.ml-viz__bars span:nth-child(7) { animation-delay: 0.9s; }

@keyframes ml-viz-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes ml-viz-ring {
  0%, 100% { stroke-dasharray: 68 100; }
  50% { stroke-dasharray: 82 100; }
}

@keyframes ml-viz-gauss-draw {
  0% { stroke-dashoffset: 180; opacity: 0.55; }
  35% { stroke-dashoffset: 0; opacity: 1; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -20; opacity: 0.7; }
}

@keyframes ml-viz-gauss-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

@keyframes ml-viz-mean {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes ml-viz-bar {
  0%, 100% { transform: scaleY(1); transform-origin: bottom; filter: brightness(1); }
  50% { transform: scaleY(1.18); transform-origin: bottom; filter: brightness(1.25); }
}

@media (max-width: 900px) {
  .ml-viz__stack {
    left: auto;
    right: 6%;
    top: 18%;
    width: min(108px, 38%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-viz__stack,
  .ml-viz__ring-val,
  .ml-viz__gauss-fill,
  .ml-viz__gauss-line,
  .ml-viz__gauss-mean,
  .ml-viz__bars span {
    animation: none !important;
  }
  .ml-viz__gauss-line { stroke-dashoffset: 0; }
}

.ml-shell {
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.ml-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Subpantallas: dejan hueco bajo el header fijo */
.ml-screen:not([data-screen="hub"]) {
  padding-top: calc(var(--ml-top-h) + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}

.ml-screen[hidden],
.ml-pane[hidden] {
  display: none !important;
}

.ml-kicker {
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ml-action);
}

.ml-title {
  margin: 0;
  font-family: var(--ml-font);
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ml-text);
}

.ml-lead {
  margin: 10px 0 0;
  max-width: 48ch;
  color: var(--ml-muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.ml-hub {
  flex: 1;
  min-height: 0;
}

.ml-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-height: 56px;
  max-height: 56px;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(140, 200, 255, 0.16);
  background: rgba(2, 10, 22, 0.22);
  backdrop-filter: var(--ml-glass);
  -webkit-backdrop-filter: var(--ml-glass);
  overflow: hidden;
}

.ml-bar h2 {
  margin: 0;
  font-family: var(--ml-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.ml-back {
  border: 1px solid var(--ml-border);
  background: rgba(0, 40, 80, 0.35);
  color: #cfe8ff;
  border-radius: 999px;
  padding: 0 16px;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  touch-action: manipulation;
}

.ml-back:hover,
.ml-back:focus-visible {
  border-color: var(--ml-action-hover);
  outline: none;
}

.ml-tabs,
.ml-steps {
  display: flex;
  gap: 6px;
  margin-left: 0;
  flex-wrap: nowrap;
}

.ml-tabs button,
.ml-steps span {
  border: 1px solid rgba(70, 120, 170, 0.32);
  background: rgba(0, 8, 18, 0.72);
  color: rgba(170, 195, 220, 0.82);
  border-radius: 999px;
  padding: 0 14px;
  min-height: 44px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ml-tabs button.is-active,
.ml-steps span.is-active {
  background: rgba(0, 40, 90, 0.78);
  color: #e8f4ff;
  border-color: rgba(0, 120, 220, 0.65);
  box-shadow: 0 0 12px rgba(0, 80, 160, 0.18);
}

.ml-pane {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  padding: 8px 12px 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}

.ml-pane > * {
  min-height: 0;
  max-height: 100%;
}

.ml-split {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.15fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.ml-card {
  border-radius: var(--ml-radius);
  border: 1px solid var(--ml-border);
  background: linear-gradient(145deg, rgba(4, 14, 28, 0.36), rgba(2, 10, 22, 0.28));
  box-shadow: var(--ml-shadow);
  backdrop-filter: var(--ml-glass);
  -webkit-backdrop-filter: var(--ml-glass);
  padding: 12px 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.ml-card h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.ml-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
  align-content: start;
}

.ml-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(160, 200, 235, 0.8);
}

.ml-form label.wide { grid-column: 1 / -1; }

.ml-form input,
.ml-form select,
.ml-form textarea {
  padding: 10px 12px;
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: var(--ml-surface-2);
  color: var(--ml-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  min-height: 44px;
}

.ml-form input:focus,
.ml-form select:focus,
.ml-form textarea:focus {
  outline: none;
  border-color: var(--ml-action);
}

.ml-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  flex-shrink: 0;
}

.ml-btn {
  border: 1px solid var(--ml-border);
  background: var(--ml-surface-2);
  color: var(--ml-text);
  border-radius: var(--ml-radius-sm);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  touch-action: manipulation;
  min-height: var(--ml-touch);
}

.ml-btn:hover,
.ml-btn:focus-visible {
  border-color: var(--ml-action);
  outline: none;
}

.ml-btn--primary {
  background: linear-gradient(120deg, #0066cc 0%, #0088ff 48%, #33a3ff 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 100, 200, 0.35);
}

.ml-btn--primary:hover,
.ml-btn--primary:focus-visible {
  filter: brightness(1.06);
  border-color: transparent;
}

.ml-btn--ok {
  background: var(--ml-ok);
  border-color: var(--ml-ok);
  color: #fff;
}
.ml-btn--warn {
  background: var(--ml-warn);
  border-color: var(--ml-warn);
  color: #1a1a1a;
}
.ml-btn--ghost {
  background: transparent;
}

.ml-list {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ml-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 6px;
}

.ml-pager span {
  font-size: 0.78rem;
  color: rgba(170, 200, 230, 0.75);
}

.ml-pager button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 255, 0.4);
  background: rgba(0, 40, 80, 0.4);
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.ml-pager button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ml-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: var(--ml-surface-2);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  flex: 1 1 0;
  min-height: 48px;
  max-height: 72px;
}

.ml-item small { color: var(--ml-muted); }

.ml-item strong { display: block; }
.ml-item small { color: rgba(170, 200, 230, 0.75); }

.ml-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ml-badge--ok {
  background: var(--ml-ok-bg);
  color: #8fceb0;
  border: 1px solid rgba(61, 155, 110, 0.35);
}
.ml-badge--warn {
  background: var(--ml-warn-bg);
  color: #e0c56a;
  border: 1px solid rgba(201, 162, 39, 0.35);
}
.ml-badge--orange {
  background: var(--ml-orange-bg);
  color: #e0a878;
  border: 1px solid rgba(196, 122, 58, 0.35);
}
.ml-badge--bad {
  background: var(--ml-bad-bg);
  color: #e09a9a;
  border: 1px solid rgba(196, 92, 92, 0.35);
}
.ml-badge--mute {
  background: rgba(167, 181, 197, 0.1);
  color: var(--ml-muted);
  border: 1px solid var(--ml-border);
}

/* ——— Panel equipos estilo Sample-Hi-Lab ——— */
.eq-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

/* Alta / edición equipo: pantalla propia sin scroll */
.eq-form-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 10px;
  box-sizing: border-box;
}

.eq-form-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.eq-form-head h3 {
  margin: 0;
  font-size: 1.15rem;
  flex: 1;
}

.eq-form-steps {
  display: flex;
  gap: 6px;
}

.eq-form-steps span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 136, 255, 0.3);
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(186, 210, 235, 0.7);
}

.eq-form-steps span.is-active {
  background: rgba(0, 136, 255, 0.28);
  border-color: #0088ff;
  color: #fff;
}

.eq-form-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-content: start;
  padding: 4px 2px;
}

.eq-form-body label {
  font-size: 0.68rem;
}

.eq-form-body input,
.eq-form-body select {
  padding: 9px 11px;
  font-size: 0.92rem;
}

.eq-form-actions {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 4px;
  justify-content: flex-end;
}

.ml-pick-grid--hojas {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.ml-pick-grid--hojas .ml-pick {
  height: 100%;
  align-items: center;
}

/* ——— Modal flotante alta material ——— */
.ml-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
  background: rgba(0, 8, 20, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ml-modal__card {
  width: min(520px, 100%);
  max-height: min(92dvh, 720px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(140, 200, 255, 0.3);
  background: rgba(4, 14, 28, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 10, 30, 0.45), 0 0 28px rgba(0, 136, 255, 0.12);
  padding: 16px 16px 14px;
}

.ml-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ml-modal__head h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #fff;
}

.ml-modal__close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.ml-modal__form {
  grid-template-columns: 1fr 1fr;
}

.ml-modal__actions {
  margin-top: 12px;
}

.mat-lote-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.mat-lote-row input {
  flex: 1;
  min-width: 0;
}

.mat-lote-row .ml-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 42px;
  padding: 0 12px;
}

.mat-lote-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(180, 210, 235, 0.72);
}

.mat-scan-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(0, 136, 255, 0.28);
  background: rgba(0, 20, 40, 0.35);
}

.mat-scan-box video {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.mat-scan-status {
  margin: 8px 0;
  font-size: 0.82rem;
  color: rgba(200, 230, 255, 0.9);
}

/* Escáner lote tipo banco: cámara + marco */
.ml-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  background: rgba(0, 4, 14, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ml-scan-sheet {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 22px;
  border: 1px solid rgba(140, 200, 255, 0.32);
  background: rgba(4, 14, 28, 0.88);
  box-shadow: 0 28px 70px rgba(0, 8, 24, 0.55);
  padding: 14px;
}

.ml-scan-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ml-scan-sheet__head h3 {
  margin: 0;
  font-family: var(--ml-display);
  font-size: 1.2rem;
  color: #fff;
}

.ml-scan-view {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: min(58dvh, 520px);
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.ml-scan-view video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ml-scan-frame {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 22%;
  bottom: 28%;
  z-index: 2;
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55);
  border: 1.5px solid rgba(120, 210, 255, 0.85);
  pointer-events: none;
}

/* Marco fino tipo lectura de tarjeta: solo la franja del lote */
.ml-scan-frame--fine {
  left: 8%;
  right: 8%;
  top: 42%;
  bottom: 42%;
  min-height: 56px;
  border-radius: 12px;
}

/* Marco para códigos de barras / QR / texto con símbolos */
.ml-scan-frame--code {
  left: 7%;
  right: 7%;
  top: 28%;
  bottom: 28%;
  min-height: 120px;
  border-radius: 14px;
}

.ml-scan-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid #33a3ff;
  border-radius: 3px;
  pointer-events: none;
}

.ml-scan-corner--tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.ml-scan-corner--tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.ml-scan-corner--bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.ml-scan-corner--br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.ml-scan-laser {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent 0%, #33a3ff 20%, #7ec8ff 50%, #33a3ff 80%, transparent 100%);
  box-shadow:
    0 0 10px rgba(0, 170, 255, 0.95),
    0 0 22px rgba(0, 136, 255, 0.75),
    0 0 36px rgba(51, 163, 255, 0.45);
  animation: ml-scan-laser 1.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

@keyframes ml-scan-laser {
  0%, 100% { transform: translateY(-18px); opacity: 0.35; }
  50% { transform: translateY(18px); opacity: 1; }
}

.ml-scan-frame--fine .ml-scan-laser,
.ml-scan-frame--code .ml-scan-laser {
  left: 6%;
  right: 6%;
}

.ml-scan-frame--code .ml-scan-laser {
  animation-duration: 1.6s;
}

@keyframes ml-scan-laser-wide {
  0%, 100% { transform: translateY(-48px); opacity: 0.35; }
  50% { transform: translateY(48px); opacity: 1; }
}

.ml-scan-frame--code .ml-scan-laser {
  animation-name: ml-scan-laser-wide;
}

@media (prefers-reduced-motion: reduce) {
  .ml-scan-laser { animation: none; opacity: 0.7; }
}

.ml-scan-hint {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.35;
  color: rgba(200, 230, 255, 0.92);
}

.ml-scan-hint strong {
  color: #fff;
}

.ml-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: stretch;
}

.ml-scan-actions .ml-btn {
  flex: 1 1 140px;
  min-height: 46px;
}

.ml-scan-sheet--practical {
  width: min(460px, 100%);
}

.ml-scan-reader {
  width: 100%;
  min-height: 240px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(120, 200, 255, 0.28);
}

.ml-scan-reader video,
.ml-scan-reader img,
.ml-scan-reader canvas {
  border-radius: 16px !important;
}

.ml-scan-reader #qr-shaded-region {
  border-color: rgba(51, 163, 255, 0.9) !important;
}

.ml-scan-manual {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 210, 235, 0.78);
}

.ml-scan-manual .mat-lote-row {
  margin-top: 2px;
}

.ws-consumo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.ws-consumo-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(72px, 0.5fr) minmax(100px, 0.7fr);
  gap: 8px;
  align-items: end;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(140, 200, 255, 0.2);
  background: rgba(0, 20, 40, 0.28);
}

.ws-consumo-row strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
}

.ws-consumo-row small {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: rgba(180, 210, 235, 0.75);
}

.ws-consumo-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(160, 200, 235, 0.8);
}

.ws-consumo-row input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 136, 255, 0.28);
  background: rgba(2, 12, 28, 0.45);
  color: #fff;
  font: inherit;
}

@media (max-width: 700px) {
  .ws-consumo-row {
    grid-template-columns: 1fr 1fr;
  }
  .ws-consumo-row > div {
    grid-column: 1 / -1;
  }
}

/* ——— Materiales: inventario micro / Petrifilm ——— */
.mat-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

.mat-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mat-cats-select-wrap {
  display: none;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(160, 200, 235, 0.75);
}

.mat-cats-select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 255, 0.35);
  background: rgba(2, 12, 28, 0.55);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0 12px;
  text-transform: none;
  letter-spacing: 0;
}

.mat-cats {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex-shrink: 0;
  overflow: hidden;
}

.mat-cats button {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid rgba(0, 136, 255, 0.3);
  background: transparent;
  color: rgba(186, 210, 235, 0.8);
  border-radius: 999px;
  padding: 8px 6px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mat-cats button.is-active {
  background: rgba(0, 136, 255, 0.28);
  border-color: #0088ff;
  color: #fff;
}

.mat-back-list {
  align-self: flex-start;
  min-height: 36px !important;
  margin-bottom: 6px;
  padding: 0 12px !important;
  font-size: 0.8rem !important;
}

.mat-entries-fold {
  border: 1px solid rgba(140, 200, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 16, 36, 0.28);
  padding: 0 10px;
  flex: 0 0 auto;
}

.mat-entries-fold summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 2px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(160, 200, 235, 0.85);
}

.mat-entries-fold summary::-webkit-details-marker { display: none; }

.mat-entries-fold[open] summary {
  border-bottom: 1px solid rgba(140, 200, 255, 0.12);
  margin-bottom: 6px;
}

.mat-actions .ml-btn {
  min-height: 40px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.mat-actions #btnMatDel {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 0 12px;
}

.mat-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 0.38fr) minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.mat-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.mat-spec {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 0 0 auto;
}

.mat-stock-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  flex-shrink: 0;
  margin: 4px 0 8px;
}

.mat-stock-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #10b981;
}

.mat-stock-bar i.ml-badge--warn { background: #eab308; }
.mat-stock-bar i.ml-badge--bad { background: #ef4444; }
.mat-stock-bar i.ml-badge--ok { background: #10b981; }

.mat-entries {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin-top: 6px;
}

.mat-entry-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 136, 255, 0.18);
  background: rgba(0, 24, 48, 0.35);
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.mat-entry-row span {
  color: rgba(170, 200, 230, 0.75);
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .mat-body { grid-template-columns: 1fr; }
  .mat-cats { flex-wrap: wrap; }
  .mat-cats button { flex: 1 1 22%; }
}

.eq-kpis {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
}

.eq-kpi {
  padding: 8px 10px;
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: rgba(4, 16, 32, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.eq-kpi span {
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ml-muted);
  line-height: 1.2;
}

.eq-kpi strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ml-text);
  letter-spacing: -0.02em;
}

.eq-kpi--ok strong { color: #8fceb0; }
.eq-kpi--warn strong { color: #e0c56a; }
.eq-kpi--bad strong { color: #e09a9a; }
.eq-kpi--sky strong { color: #7eb8e0; }

.eq-kpis--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.eq-search {
  width: 100%;
  min-height: 44px;
  margin-bottom: 8px;
  padding: 0 12px;
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: var(--ml-surface-2);
  color: var(--ml-text);
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.eq-search::placeholder { color: var(--ml-muted); }
.eq-search:focus {
  outline: none;
  border-color: var(--ml-action);
}

.eq-more {
  position: relative;
}

.eq-more__btn {
  min-width: var(--ml-touch);
  min-height: var(--ml-touch);
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: var(--ml-surface-2);
  color: var(--ml-text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.eq-more__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  min-width: 160px;
  padding: 6px;
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: var(--ml-surface-2);
  box-shadow: var(--ml-shadow);
  display: none;
  z-index: 20;
}

.eq-more.is-open .eq-more__menu { display: block; }

.eq-more__menu button {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #e09a9a;
  text-align: left;
  padding: 0 12px;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.eq-more__menu button:hover {
  background: var(--ml-bad-bg);
}

.eq-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 14, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.eq-lightbox img {
  max-width: min(920px, 100%);
  max-height: 90dvh;
  border-radius: var(--ml-radius);
  border: 1px solid var(--ml-border);
  object-fit: contain;
}

.eq-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  min-width: var(--ml-touch);
  min-height: var(--ml-touch);
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: var(--ml-surface);
  color: var(--ml-text);
  font-size: 1.4rem;
  cursor: pointer;
}

.eq-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 0.34fr) minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}

.eq-list-card,
.eq-detail-card {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.eq-detail-card {
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
}

.eq-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.eq-list-head h3 { margin: 0; }

.eq-row {
  grid-template-columns: 10px 1fr auto;
  align-items: center;
}

.eq-row.is-selected {
  border-color: rgba(22, 133, 209, 0.55);
  background: rgba(22, 133, 209, 0.12);
}

.eq-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ml-muted);
}
.eq-dot.ml-badge--ok { background: var(--ml-ok); }
.eq-dot.ml-badge--warn { background: var(--ml-warn); }
.eq-dot.ml-badge--orange { background: var(--ml-orange); }
.eq-dot.ml-badge--bad { background: var(--ml-bad); }

.eq-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-shrink: 0;
}

.eq-code {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ml-action);
  font-family: ui-monospace, monospace;
}

.eq-detail-head h3 {
  margin: 2px 0 2px;
  font-family: var(--ml-display);
  font-size: 1.35rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eq-loc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ml-muted);
}

.eq-status-box {
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  text-align: right;
  border: 1px solid transparent;
}

.eq-status-box strong {
  display: block;
  font-size: 0.95rem;
}

.eq-status-box span {
  font-size: 0.72rem;
  opacity: 0.9;
}

.eq-status-box.ml-badge--bad {
  background: var(--ml-bad-bg);
  border-color: rgba(196, 92, 92, 0.4);
  color: #e09a9a;
}

.eq-status-box.ml-badge--warn {
  background: var(--ml-warn-bg);
  border-color: rgba(201, 162, 39, 0.4);
  color: #e0c56a;
}

.eq-status-box.ml-badge--orange {
  background: var(--ml-orange-bg);
  border-color: rgba(196, 122, 58, 0.4);
  color: #e0a878;
}

.eq-status-box.ml-badge--ok {
  background: var(--ml-ok-bg);
  border-color: rgba(61, 155, 110, 0.4);
  color: #8fceb0;
}

.eq-subtabs {
  display: flex;
  gap: 6px;
  margin: 6px 0;
  flex-shrink: 0;
}

.eq-subtabs button {
  border: 1px solid rgba(0, 136, 255, 0.28);
  background: transparent;
  color: rgba(186, 210, 235, 0.75);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.eq-subtabs button.is-active {
  background: rgba(0, 136, 255, 0.28);
  color: #fff;
  border-color: #0088ff;
}

.eq-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.eq-detail-actions {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 6px;
  padding-bottom: 2px;
  position: relative;
  z-index: 2;
  background: rgba(4, 14, 28, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.eq-spec {
  overflow: hidden;
  flex: 1;
  align-content: start;
}

.eq-ficha {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(140px, 0.45fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.eq-ficha .eq-spec {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: auto;
  align-content: start;
}

.eq-ficha .eq-spec > div {
  background: var(--ml-surface-2);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-sm);
}

.eq-ficha .eq-spec span { color: var(--ml-muted); }
.eq-ficha .eq-spec strong { color: var(--ml-text); font-weight: 600; }

.eq-photo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  max-height: 220px;
}

.eq-photo__frame {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 160px;
  border-radius: var(--ml-radius-sm);
  border: 1px solid var(--ml-border);
  background: var(--ml-surface-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.eq-photo__frame.has-img {
  border-style: solid;
  border-color: rgba(0, 136, 255, 0.35);
}

.eq-photo__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eq-photo__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  color: rgba(140, 190, 230, 0.75);
  cursor: pointer;
  touch-action: manipulation;
  width: 100%;
  height: 100%;
}

.eq-photo__placeholder span {
  font-size: 0.82rem;
  font-weight: 700;
  color: #9ecfff;
}

.eq-photo__placeholder small {
  font-size: 0.72rem;
  color: rgba(160, 190, 220, 0.65);
}

.eq-photo__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.eq-photo__btn {
  flex: 1 1 auto;
  text-align: center;
  cursor: pointer;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  padding: 8px 10px;
}

@media (max-width: 900px) {
  .mat-cats--chips { display: none !important; }
  .mat-cats-select-wrap { display: flex; }

  .mat-kpis.eq-kpis,
  .mat-kpis--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px;
  }

  .mat-kpis .eq-kpi {
    padding: 8px 6px;
  }

  .mat-kpis .eq-kpi span {
    font-size: 0.58rem;
  }

  .mat-kpis .eq-kpi strong {
    font-size: 1.05rem;
  }

  .mat-panel--list .mat-detail-pane { display: none !important; }
  .mat-panel--detail .mat-list-pane { display: none !important; }
  .mat-panel--list .mat-body,
  .mat-panel--detail .mat-body {
    grid-template-columns: 1fr !important;
  }

  .mat-panel--detail .mat-detail-pane {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    height: auto;
  }

  .mat-row.ml-item {
    padding: 8px 10px;
    min-height: 0;
    gap: 8px;
  }

  .mat-row.ml-item strong {
    font-size: 0.86rem;
  }

  .mat-row.ml-item small {
    font-size: 0.7rem;
  }

  .mat-spec {
    grid-template-columns: 1fr 1fr !important;
  }

  .eq-panel,
  .eq-body,
  .eq-detail-card {
    overflow: visible;
    max-height: none;
  }

  .eq-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    align-content: start;
  }

  .eq-list-card {
    max-height: 38vh;
    overflow: auto;
  }

  .eq-detail-card {
    height: auto;
    overflow: visible;
  }

  .eq-detail-body {
    overflow: visible;
    flex: 0 0 auto;
    min-height: 0;
  }

  .eq-ficha {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    overflow: visible;
  }

  .eq-photo {
    max-height: none;
  }

  .eq-photo__frame {
    min-height: 200px;
    max-height: none;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .eq-photo__frame img {
    object-fit: contain;
    background: rgba(0, 8, 20, 0.55);
  }

  .eq-detail-actions {
    position: sticky;
    bottom: 0;
  }
}

.eq-metro {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}

.eq-metro-dates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.eq-metro-dates > div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 30, 60, 0.4);
  border: 1px solid rgba(0, 136, 255, 0.18);
}

.eq-metro-dates span {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(140, 190, 230, 0.7);
  margin-bottom: 4px;
}

.eq-cal-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.eq-cal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.eq-cal-table th,
.eq-cal-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 136, 255, 0.15);
  text-align: left;
  vertical-align: top;
}

.eq-cal-table th {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(160, 200, 235, 0.75);
}

.eq-err { color: #fde68a; font-weight: 700; }

.eq-docs-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a78bfa;
}

.eq-docs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.eq-doc {
  aspect-ratio: 1;
  max-height: 110px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.7);
  color: #e8f2ff;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  touch-action: manipulation;
}

.eq-doc strong { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.eq-doc__ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: currentColor;
  opacity: 0.85;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 3h8l4 4v14H7V3zm8 1.5V8h3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 3h8l4 4v14H7V3zm8 1.5V8h3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.eq-doc--violet { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.4); }
.eq-doc--sky { color: #7dd3fc; border-color: rgba(56, 189, 248, 0.4); }
.eq-doc--teal { color: #5eead4; border-color: rgba(45, 212, 191, 0.4); }
.eq-doc--fuchsia { color: #f0abfc; border-color: rgba(232, 121, 249, 0.4); }
.eq-doc--amber { color: #fcd34d; border-color: rgba(251, 191, 36, 0.45); }

.eq-docs-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: rgba(160, 190, 220, 0.65);
}

.eq-gantt {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
}

.eq-gantt-head {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(180, 210, 235, 0.85);
}

.eq-gantt-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  text-align: center;
  font-size: 0.65rem;
  color: rgba(140, 180, 220, 0.65);
}

.eq-gantt-rows {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eq-gantt-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 4px 0;
  cursor: pointer;
  text-align: left;
}

.eq-gantt-row.is-focus .eq-gantt-id { color: #38bdf8; }

.eq-gantt-id {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: ui-monospace, monospace;
}

.eq-gantt-track {
  position: relative;
  height: 18px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eq-gantt-bar {
  position: absolute;
  top: 3px;
  height: 12px;
  border-radius: 4px;
  opacity: 0.85;
}
.eq-gantt-bar.ml-badge--ok { background: #10b981; }
.eq-gantt-bar.ml-badge--warn { background: #eab308; }
.eq-gantt-bar.ml-badge--orange { background: #f97316; }
.eq-gantt-bar.ml-badge--bad { background: #ef4444; }
.eq-gantt-bar.ml-badge--mute { background: #64748b; }

.eq-gantt-mark {
  position: absolute;
  top: 1px;
  width: 4px;
  height: 16px;
  margin-left: -2px;
  background: #fbbf24;
  border-radius: 2px;
}

.eq-gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(56, 189, 248, 0.75);
}

.eq-gantt-legend {
  display: flex;
  gap: 14px;
  font-size: 0.7rem;
  color: rgba(160, 190, 220, 0.75);
}

.eq-gantt-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.eq-gantt-legend i.ml-badge--ok { background: #10b981; }
.eq-gantt-legend i.ml-badge--warn { background: #eab308; }
.eq-today-swatch { background: #38bdf8 !important; border-radius: 1px !important; width: 3px !important; }

@media (max-width: 1100px) {
  .eq-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .eq-docs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .eq-body { grid-template-columns: 1fr; }
  .eq-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .eq-docs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ml-empty {
  margin: auto;
  text-align: center;
  color: rgba(180, 210, 235, 0.7);
  padding: 20px;
}

.ml-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.ml-detail-grid div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 30, 60, 0.35);
  border: 1px solid rgba(0, 136, 255, 0.15);
}

.ml-detail-grid span {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(140, 190, 230, 0.7);
  margin-bottom: 4px;
}

.ml-detail-grid strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.ml-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ml-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 136, 255, 0.3);
  background: rgba(0, 40, 80, 0.35);
  font-size: 0.9rem;
}

.ml-chip button {
  border: 0;
  background: transparent;
  color: #fca5a5;
  font-size: 1.1rem;
  cursor: pointer;
}

.ml-split--roles {
  grid-template-columns: minmax(300px, 1.05fr) minmax(260px, 0.95fr);
  overflow: hidden;
  height: 100%;
  max-height: 100%;
}

.ml-roster-card {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ml-roster-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ml-roster-head h3 {
  margin: 0;
}

.ml-roster-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 255, 0.2);
}

.ml-roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ml-roster-table th,
.ml-roster-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(140, 200, 255, 0.12);
  vertical-align: middle;
}

.ml-roster-table th {
  position: sticky;
  top: 0;
  background: rgba(0, 40, 80, 0.92);
  color: #9fd0ff;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 1;
}

.ml-roster-table td strong {
  display: block;
  color: #fff;
}

.ml-roster-sub {
  display: block;
  margin-top: 2px;
  color: rgba(180, 210, 235, 0.65);
  font-size: 0.75rem;
}

.ml-roster-empty {
  text-align: center;
  color: rgba(180, 210, 235, 0.7);
  padding: 28px 12px !important;
}

.ml-roster-role {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ml-roster-role--analista {
  background: rgba(0, 136, 255, 0.18);
  color: #9fd0ff;
}

.ml-roster-role--supervisor {
  background: rgba(47, 158, 106, 0.2);
  color: #86efac;
}

.ml-roster-status {
  display: block;
  font-size: 0.78rem;
  color: rgba(180, 210, 235, 0.8);
}

.ml-roster-sig {
  display: block;
  margin-top: 6px;
  width: 64px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(140, 200, 255, 0.2);
}

.ml-roster-rm {
  border: 0;
  background: transparent;
  color: #fca5a5;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.ml-pending-invites {
  margin-top: 14px;
}

.ml-pending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ml-pending-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.08);
  font-size: 0.85rem;
}

.ml-pending-list small {
  color: rgba(180, 210, 235, 0.65);
}

.ml-invite-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(47, 158, 106, 0.35);
  background: rgba(47, 158, 106, 0.12);
  color: #d1fae5;
  font-size: 0.88rem;
}

/* Modo selector de labs: tabla a todo el recuadro, cristal transparente */
.ml-entry-card--labs {
  width: min(1180px, 92vw);
  height: min(620px, calc(100dvh - 120px));
  min-height: 460px;
  max-height: calc(100dvh - 110px);
  background: rgba(2, 10, 24, 0.14);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow:
    0 18px 48px rgba(0, 8, 24, 0.22),
    0 0 0 1px rgba(140, 200, 255, 0.1) inset;
}

.ml-entry-card--labs.ah-lab-card {
  grid-template-columns: 1fr;
}

.ml-entry-card--labs .ah-lab-card__visual {
  display: none !important;
}

.ml-entry-card--labs .ah-lab-card__copy {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 12px;
  padding: clamp(18px, 2.2vw, 28px);
  min-height: 0;
  height: 100%;
  background: transparent !important;
}

.ml-entry-card--labs .ah-panel__title {
  text-align: left;
  font-size: clamp(1.55rem, 2.4vw, 2.1rem);
  flex: 0 0 auto;
}

.ml-hub-labs {
  width: 100%;
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ml-hub-labs[hidden] {
  display: none !important;
}

.ml-hub-labs .ml-hub-login__eyebrow {
  text-align: left;
  margin: 0;
}

.ml-labs-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.ml-labs-lead {
  margin: 0;
  color: rgba(200, 225, 245, 0.82);
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 46rem;
}

.ml-labs-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(140, 200, 255, 0.18);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.ml-labs-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: transparent;
}

.ml-labs-table th,
.ml-labs-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(140, 200, 255, 0.1);
  vertical-align: middle;
  background: transparent;
}

.ml-labs-table tbody tr {
  background: transparent;
  transition: background 0.18s ease;
}

.ml-labs-table tbody tr:hover {
  background: rgba(0, 136, 255, 0.08);
}

.ml-labs-table th {
  position: sticky;
  top: 0;
  background: rgba(4, 18, 40, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #9fd0ff;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 1;
  border-bottom-color: rgba(140, 200, 255, 0.22);
}

.ml-labs-table td strong {
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.ml-labs-enter {
  min-height: 36px !important;
  padding: 0 12px !important;
  font-size: 0.8rem !important;
}

.ml-labs-link-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  max-width: none;
}

.ml-labs-link {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #b8dcff;
  font-size: 0.72rem;
  padding: 0 8px;
  box-sizing: border-box;
}

.ml-labs-copy {
  min-height: 32px !important;
  padding: 0 10px !important;
  font-size: 0.75rem !important;
  flex: 0 0 auto;
}

.ml-labs-demo-hint {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: rgba(200, 225, 245, 0.78);
  line-height: 1.4;
}

.ml-labs-demo-hint code {
  color: #9fd0ff;
  font-size: 0.74rem;
}

@media (max-width: 900px) {
  .ml-entry-card--labs {
    width: min(920px, 94vw);
    height: auto;
    max-height: calc(100dvh - 96px);
  }

  .ml-labs-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ml-labs-link-cell {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }
}

.ml-portal-lab-banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 255, 0.4);
  background: rgba(0, 80, 160, 0.28);
  color: #cfe8ff;
  font-size: 0.88rem;
  font-weight: 700;
}

.ml-form-err {
  margin: 8px 0 0;
  color: #fca5a5;
  font-size: 0.88rem;
}

.ml-form-err[hidden],
.ml-pin-err[hidden],
.ml-pin-sig[hidden] {
  display: none !important;
}

.ml-card--fit {
  overflow: hidden;
  min-height: 0;
}

.ml-card--team {
  overflow: auto;
}

.ml-form--roles {
  gap: 8px;
  overflow: hidden;
}

.ml-role-lead {
  margin: 0 0 8px;
  color: rgba(180, 210, 235, 0.8);
  font-size: 0.82rem;
  line-height: 1.35;
}

.ml-sign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(0, 16, 36, 0.35);
}

.ml-sign-row__txt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ml-sign-row__txt strong {
  color: #fff;
  font-size: 0.88rem;
}

.ml-sign-row__txt span {
  font-size: 0.72rem;
  color: rgba(180, 210, 235, 0.7);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.ml-sign-icon-btn {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(0, 136, 255, 0.45);
  background: rgba(0, 80, 160, 0.28);
  color: #7ec8ff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(0, 136, 255, 0.18);
}

.ml-sign-icon-btn:hover,
.ml-sign-icon-btn:focus-visible {
  border-color: #33a3ff;
  color: #fff;
  outline: none;
}

.ml-sign-icon-btn.is-ready {
  border-color: #2f9e6a;
  box-shadow: 0 0 16px rgba(47, 158, 106, 0.28);
}

.ml-sign-icon-btn__preview {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.ml-sign-icon-btn.is-ready .ml-sign-icon-btn__ico {
  display: none;
}

.ml-sign-modal {
  width: min(480px, 100%);
}

.ml-role-lead strong { color: #fff; }

.ml-role-warn {
  margin: 8px 0 0;
  color: #fbbf24;
  font-size: 0.82rem;
}

.ml-role-admin-chip {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 255, 0.35);
  background: rgba(0, 80, 160, 0.22);
  font-size: 0.82rem;
  color: #cfe8ff;
}

.ml-role-sec {
  margin: 12px 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #33a3ff;
}

.ml-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ml-person {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(0, 20, 40, 0.32);
}

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

.ml-person__main strong {
  color: #fff;
  font-size: 0.92rem;
}

.ml-person__main small {
  color: rgba(180, 210, 235, 0.75);
  font-size: 0.78rem;
}

.ml-person__meta { color: rgba(160, 210, 255, 0.85) !important; }

.ml-person__sig {
  width: 72px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(140, 200, 255, 0.2);
}

.ml-person__nosig {
  font-size: 0.72rem;
  color: rgba(180, 210, 235, 0.55);
}

.ml-person__rm {
  position: absolute;
  top: 4px;
  right: 6px;
  border: 0;
  background: transparent;
  color: #fca5a5;
  font-size: 1.1rem;
  cursor: pointer;
}

.ml-sign-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(0, 16, 36, 0.35);
}

.ml-sign-block__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ml-sign-block__head strong {
  color: #fff;
  font-size: 0.9rem;
}

.ml-sign-block__head span {
  font-size: 0.75rem;
  color: rgba(180, 210, 235, 0.72);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.ml-sign-canvas {
  width: 100%;
  height: 160px;
  border-radius: 12px;
  border: 1px dashed rgba(120, 200, 255, 0.45);
  background: rgba(0, 8, 20, 0.55);
  touch-action: none;
  cursor: crosshair;
}

.ml-sign-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ml-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ml-sign-qr {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 30, 60, 0.4);
}

.ml-sign-qr img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  background: #fff;
}

.ml-sign-qr p {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(200, 230, 255, 0.9);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.ml-pin-card { width: min(420px, 100%); }

.ml-pin-sub {
  margin: 0 0 12px;
  color: rgba(180, 210, 235, 0.82);
  font-size: 0.88rem;
  line-height: 1.4;
}

.ml-pin-admin-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 255, 0.35);
  background: rgba(0, 80, 160, 0.22);
  color: #cfe8ff;
  font-size: 0.84rem;
  line-height: 1.35;
}

.ml-pin-err {
  margin: 8px 0 0;
  color: #fca5a5;
  font-size: 0.85rem;
}

.ml-pin-sig {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(140, 200, 255, 0.22);
  background: rgba(0, 20, 40, 0.35);
}

.ml-pin-sig span {
  font-size: 0.75rem;
  color: rgba(180, 210, 235, 0.75);
}

.ml-pin-sig img {
  height: 40px;
  max-width: 140px;
  object-fit: contain;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.ml-sign-remote { width: min(520px, 100%); }

.ml-sign-remote .ml-sign-canvas { height: 200px; }

.ml-pick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-content: stretch;
}

.ml-pick-grid .ml-pick,
.ml-pick-grid .ml-hub-card {
  min-height: 0;
}

.ml-pick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 136, 255, 0.25);
  background: rgba(0, 24, 48, 0.4);
  cursor: pointer;
}

.ml-pick:has(input:checked) {
  border-color: #0088ff;
  background: rgba(0, 100, 200, 0.25);
}

.ml-ws-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ml-ws-table th,
.ml-ws-table td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(0, 136, 255, 0.15);
  text-align: left;
}

.ml-ws-table input {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 136, 255, 0.35);
  background: rgba(0, 20, 40, 0.55);
  color: #fff;
  font: inherit;
  font-size: 1rem;
}

.ml-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ml-sign label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(160, 200, 235, 0.8);
}

.ml-sign input {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(0, 136, 255, 0.45);
  background: rgba(0, 20, 40, 0.4);
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
}

.ml-alert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

/* ——— Responsive: tablet / iPad ——— */
@media (max-width: 1024px) {
  .ml-page {
    --ml-top-h: 64px;
    --hilab-header-logo-h: 72px;
    --hilab-header-logo-max-w: 260px;
  }

  .ml-entry-card {
    width: min(860px, 84vw);
    height: min(460px, 56dvh);
    min-height: 380px;
    max-height: min(480px, calc(100dvh - 88px));
  }

  .ml-roster-table-wrap,
  .ml-labs-table-wrap,
  .eq-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ——— Responsive: tablet angosta + menú ——— */
@media (max-width: 900px) {
  .ml-page {
    --ml-top-h: 64px;
    --hilab-header-logo-h: 64px;
    --hilab-header-logo-max-w: 220px;
  }

  .ml-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand end"
      "center center";
    row-gap: 4px;
  }

  .ml-brand-wrap { grid-area: brand; }
  .ml-top__center { grid-area: center; justify-self: stretch; text-align: left; padding: 0; }
  .ml-top__end { grid-area: end; }
  .ml-preview-tools { display: none !important; }

  .ml-nav-toggle { display: inline-flex; }

  .ml-tabs--top,
  .ml-hub-logout--top {
    display: none !important;
  }

  .ml-split { grid-template-columns: 1fr; }
  .ml-detail-grid { grid-template-columns: 1fr 1fr; }
  .ml-sign { grid-template-columns: 1fr; }

  .ml-hub--pro {
    padding: 12px 14px;
    align-items: flex-start;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ml-screen[data-screen="hub"] {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ml-entry-card,
  .ml-entry-card.ah-lab-card {
    grid-template-columns: 1fr;
    width: min(560px, 94vw);
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .ml-entry-card .ah-lab-card__visual {
    min-height: 140px;
    max-height: 160px;
    order: -1;
  }

  .ml-entry-card .ah-lab-card__copy {
    padding: 18px 18px 20px;
    justify-content: center;
  }

  .ml-entry-card--labs {
    width: min(960px, 96vw);
    height: auto;
    max-height: none;
  }

  .ml-bar {
    flex-wrap: wrap;
    max-height: none;
    min-height: 48px;
    gap: 8px;
  }

  .ml-bar h2 {
    font-size: 1rem;
    flex: 1 1 auto;
  }

  .ml-steps {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
}

/* ——— Responsive: teléfono ——— */
@media (max-width: 640px) {
  .ml-page {
    --ml-top-h: 56px;
    --hilab-header-logo-h: 48px;
    --hilab-header-logo-max-w: 168px;
  }

  .ml-brand span { font-size: 0.95rem; }
  .ml-user__name { display: none; }
  .ml-top__center strong { font-size: 0.82rem; white-space: normal; }

  .ml-page-fx__grid { opacity: 0.14; }
  .ml-page-fx__canvas { opacity: 0.45; }

  .ml-hub--pro {
    padding: 10px 10px 18px;
  }

  .ml-entry-card,
  .ml-entry-card.ah-lab-card {
    width: min(100%, 100%);
    max-width: none;
    border-radius: 18px;
  }

  .ml-entry-card .ah-lab-card__visual {
    min-height: 100px;
    max-height: 112px;
  }

  .ml-entry-card .ah-panel__title {
    font-size: 1.65rem;
  }

  .ml-entry-card .ah-action-pill {
    padding: 12px 12px 12px 10px;
    gap: 10px;
  }

  .ml-entry-card .ah-action-pill__txt small {
    font-size: 0.72rem;
  }

  .ml-hub-login {
    max-width: none;
  }

  .ml-screen:not([data-screen="hub"]) {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow: hidden;
  }

  #screenConfig {
    overflow: hidden;
  }

  #screenConfig .ml-pane,
  #cfgEquipos,
  #cfgMateriales {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    max-height: 100%;
  }

  .ml-pane {
    padding: 12px;
  }

  .eq-panel {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  .eq-photo__frame {
    min-height: 220px;
    aspect-ratio: 1 / 1;
  }

  .ml-modal__card {
    width: min(100%, calc(100vw - 20px));
    max-height: min(92dvh, 720px);
    overflow: auto;
  }

  .ml-labs-link-cell {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }

  .ml-detail-grid { grid-template-columns: 1fr; }
}

/* Landscape phone / tablet corto */
@media (max-height: 520px) and (orientation: landscape) {
  .ml-entry-card.ah-lab-card {
    grid-template-columns: 1fr 1fr;
    width: min(780px, 86vw);
    height: calc(100dvh - 36px);
    min-height: 0;
    max-height: calc(100dvh - 36px);
  }

  .ml-entry-card .ah-lab-card__visual {
    order: 0;
    min-height: 0;
    max-height: none;
  }

  .ml-entry-card .ah-panel__title {
    font-size: 1.35rem;
  }

  .ml-entry-card .ah-shortcuts {
    margin-top: 8px;
    gap: 6px;
  }

  .ml-entry-card .ah-action-pill {
    padding: 8px 10px;
  }
}

@media print {
  .ml-page-bg, .ml-page-fx, .ah-space-bg, .ml-top, .ml-bar, .ml-actions { display: none !important; }
  .ml-page { height: auto; overflow: visible; background: #fff; color: #111; }
}
