:root {
  --bg: #07111f;
  --panel: rgba(8, 18, 38, 0.8);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --blue-1: #0e4f90;
  --blue-2: #2477d2;
  --blue-3: #4cb3ff;
  --text: #f5f8ff;
  --muted: #b5c4de;
  --danger: #d74646;
  --success: #28b36d;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(76, 179, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(11, 73, 149, 0.28), transparent 32%),
    linear-gradient(180deg, #050a13 0%, #07111f 48%, #09172b 100%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

button,
input {
  font: inherit;
}

.app {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
}

.screen.active {
  display: block;
}

.login-screen {
  background:
    radial-gradient(circle at 18% 18%, rgba(83, 188, 255, 0.18), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(39, 115, 210, 0.24), transparent 24%),
    linear-gradient(135deg, #08111e 0%, #0b1f3d 48%, #114f96 100%);
  overflow: hidden;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.6;
}

.login-screen::before {
  width: 42vw;
  height: 42vw;
  left: -10vw;
  bottom: -16vw;
}

.login-screen::after {
  width: 36vw;
  height: 36vw;
  right: -8vw;
  top: -14vw;
  border-color: rgba(76, 179, 255, 0.2);
}

.login-layout {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: stretch;
}

.login-brand {
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), transparent 14%),
    linear-gradient(180deg, #1da2ff 0%, #0e58b6 100%);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.brand-mark::after {
  inset: 21px;
  border-width: 4px;
  opacity: 0.85;
}

.brand-copy strong {
  display: block;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
}

.brand-copy span {
  display: block;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.brand-campuses {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: #d8e8ff;
  font-weight: 600;
}

.brand-campuses span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(3rem, 5vw, 5.6rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.brand-hero p {
  max-width: 640px;
  margin: 0;
  color: #d5e6ff;
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-badges {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-badges span {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #eef6ff;
  font-weight: 700;
}

.brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.94rem;
}

.brand-footer strong {
  color: #9fd7ff;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: min(460px, 100%);
  padding: 32px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(76, 179, 255, 0.14);
  color: #bde6ff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h2 {
  margin: 18px 0 10px;
  font-size: 2rem;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: #d9e9ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(5, 11, 22, 0.45);
  color: var(--text);
  outline: none;
}

.field input::placeholder {
  color: #8ea4c8;
}

.login-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.primary-btn,
.ghost-btn,
.lab-card,
.control-btn,
.top-action {
  transition: transform 0.16s ease, filter 0.16s ease;
}

.primary-btn,
.ghost-btn {
  border: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 15px 18px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.primary-btn:hover,
.ghost-btn:hover,
.lab-card:hover,
.control-btn:hover,
.top-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.primary-btn {
  background: linear-gradient(135deg, #1f8eff 0%, #0f58b5 100%);
  color: white;
  box-shadow: 0 16px 28px rgba(20, 94, 190, 0.34);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ebf4ff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-screen {
  background:
    radial-gradient(circle at top left, rgba(71, 177, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #050a12 0%, #07152a 100%);
}

.shell {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 86px minmax(0, 1fr);
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 19, 0.72);
  backdrop-filter: blur(12px);
}

.shell-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.shell-title h3 {
  margin: 0;
  font-size: 1.35rem;
}

.shell-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-action {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}

.dashboard-content {
  padding: 34px 34px 40px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: 38px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.12), transparent 20%),
    linear-gradient(135deg, #0b56a5 0%, #2b87ef 55%, #5db3ff 100%);
  box-shadow: var(--shadow);
}

.hero-panel::before,
.hero-panel::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-panel::before {
  width: 36vw;
  height: 36vw;
  left: -12vw;
  bottom: -24vw;
}

.hero-panel::after {
  width: 22vw;
  height: 22vw;
  right: -6vw;
  top: -8vw;
}

.hero-panel small {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: #d7ebff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.hero-panel h1 {
  margin: 18px 0 12px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  max-width: 720px;
}

.hero-panel p {
  margin: 0;
  max-width: 620px;
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.labs-section {
  margin-top: 28px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.7rem;
}

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 380px));
  gap: 24px;
}

.lab-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: var(--shadow);
  cursor: pointer;
  padding: 0;
  text-align: left;
  color: var(--text);
}

.lab-card-visual {
  height: 190px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.18)),
    linear-gradient(135deg, #08214a 0%, #0b55a3 52%, #48aef9 100%);
  position: relative;
  overflow: hidden;
}

.lab-card-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.lab-card-visual::before,
.lab-card-visual::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.lab-card-visual::before {
  width: 220px;
  height: 220px;
  left: -50px;
  bottom: -140px;
}

.lab-card-visual::after {
  width: 180px;
  height: 180px;
  right: -40px;
  top: -90px;
}

.lab-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
  z-index: 2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lab-mini-room {
  position: absolute;
  inset: auto 18px 18px 18px;
  height: 110px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  overflow: hidden;
}

.lab-mini-room::before {
  content: "";
  position: absolute;
  inset: 0 0 28px 0;
  background:
    linear-gradient(90deg, rgba(115, 88, 63, 0.96) 0 26%, rgba(242, 246, 250, 0.96) 26% 100%);
}

.lab-mini-room::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.26) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #e7e0d2 0%, #d9d0c1 100%);
  background-size: 32px 28px, 100% 28px, 100% 100%;
}

.mini-pared-madera,
.mini-persianas,
.mini-piso,
.mini-fila,
.mini-fila span,
.mini-proyector-card {
  position: absolute;
}

.mini-pared-madera {
  inset: 0 auto 28px 0;
  width: 26%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.08)),
    repeating-linear-gradient(
      12deg,
      #8a6a4b 0 12px,
      #7b5d43 12px 24px,
      #927053 24px 36px
    );
}

.mini-persianas {
  top: 10px;
  right: 14px;
  width: 124px;
  height: 42px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent 0 4%, rgba(255, 255, 255, 0.92) 4% 30%, transparent 30% 34%, rgba(255, 255, 255, 0.92) 34% 60%, transparent 60% 64%, rgba(255, 255, 255, 0.92) 64% 100%);
  opacity: 0.92;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.12);
}

.mini-piso {
  inset: auto 0 0 0;
  height: 28px;
}

.mini-proyector-card {
  top: 12px;
  left: 50%;
  width: 44px;
  height: 8px;
  margin-left: -22px;
  border-radius: 999px;
  background: rgba(210, 214, 219, 0.96);
  box-shadow: 0 12px 0 -4px rgba(255, 255, 255, 0.55);
}

.mini-proyector-card::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2d8fe4;
}

.mini-fila {
  display: flex;
  gap: 12px;
  z-index: 1;
}

.mini-fila span {
  position: relative;
  width: 38px;
  height: 18px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, #dad4ca 0%, #cdc4b8 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 9px 0 0 rgba(15, 19, 26, 0.9),
    0 12px 0 -7px rgba(17, 22, 31, 0.95);
}

.mini-fila span::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 11px;
  width: 16px;
  height: 11px;
  border-radius: 3px;
  background: #162131;
  box-shadow: 0 8px 0 -5px rgba(17, 22, 31, 0.9);
}

.mini-fila span::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 6px;
  width: 26px;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.mini-fila-trasera {
  top: 62px;
  left: 32px;
  gap: 16px;
  transform: scale(0.82);
  opacity: 0.72;
}

.mini-fila-central {
  top: 68px;
  left: 54px;
  gap: 16px;
  transform: scale(0.94);
  opacity: 0.88;
}

.mini-fila-frontal {
  top: 76px;
  left: 88px;
  gap: 18px;
  transform: scale(1.08);
}

.lab-card-content {
  padding: 24px 24px 26px;
}

.lab-card-content h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.lab-card-content p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.65;
}

.lab-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #d9eaff;
  font-weight: 700;
}

.lab-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.86rem;
}

.access-screen {
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 15%, rgba(37, 132, 255, 0.2), transparent 34%),
    linear-gradient(145deg, #020711 0%, #07162a 55%, #02060d 100%);
}

.access-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.access-card {
  width: min(600px, 100%);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid rgba(105, 183, 255, 0.2);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(12, 29, 54, 0.96), rgba(7, 18, 36, 0.96));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
  text-align: center;
}

.access-card h2 {
  margin: 2px 0 0;
  font-size: clamp(1.65rem, 5vw, 2.45rem);
}

.access-icon {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(95, 178, 255, 0.35);
  border-radius: 28px;
  background: linear-gradient(145deg, #187fe7, #0c4d9a);
  color: white;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 16px 38px rgba(20, 117, 222, 0.28);
}

.access-icon[data-state="esperando"],
.access-icon[data-state="comprobando"] {
  animation: access-pulse 1.5s ease-in-out infinite;
}

.access-icon[data-state="autorizado"] {
  background: linear-gradient(145deg, #28b36d, #137348);
  border-color: rgba(82, 231, 154, 0.45);
}

.access-icon[data-state="denegado"],
.access-icon[data-state="vencido"] {
  background: linear-gradient(145deg, #d94c4c, #882727);
  border-color: rgba(255, 126, 126, 0.45);
}

.access-account {
  margin: -8px 0 0;
  color: #91a9c9;
}

.access-status {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(76, 179, 255, 0.09);
  border: 1px solid rgba(76, 179, 255, 0.14);
  color: #cceaff;
  font-weight: 750;
  line-height: 1.45;
}

.access-status[data-state="autorizado"] {
  background: rgba(40, 179, 109, 0.12);
  border-color: rgba(40, 179, 109, 0.25);
  color: #bff7d9;
}

.access-status[data-state="denegado"],
.access-status[data-state="vencido"] {
  background: rgba(215, 70, 70, 0.12);
  border-color: rgba(215, 70, 70, 0.25);
  color: #ffc3c3;
}

.access-help {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.access-actions {
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes access-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 16px 38px rgba(20, 117, 222, 0.24); }
  50% { transform: scale(1.04); box-shadow: 0 18px 52px rgba(48, 151, 255, 0.42); }
}

.lab-screen {
  background: #02060d;
}

.lab-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(180deg, rgba(2, 5, 12, 0.92) 0%, rgba(2, 5, 12, 0.68) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.lab-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.lab-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lab-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.lab-canvas.loading::after {
  content: 'Cargando entorno 3D...';
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(2, 8, 18, 0.82);
  backdrop-filter: blur(8px);
}

.lab-sidebar {
  position: absolute;
  top: 94px;
  left: 18px;
  z-index: 25;
  width: 360px;
  max-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(12, 18, 30, 0.9) 0%, rgba(15, 22, 37, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.05);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(116, 194, 255, 0.35) rgba(255,255,255,0.06);
}

.lab-sidebar::-webkit-scrollbar {
  width: 10px;
}

.lab-sidebar::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}

.lab-sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(91, 176, 255, 0.7), rgba(52, 120, 220, 0.5));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title div {
  display: grid;
  gap: 4px;
}

.sidebar-title strong {
  font-size: 1.28rem;
}

.sidebar-title span {
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(65, 145, 255, 0.14);
  border: 1px solid rgba(76, 179, 255, 0.2);
  color: #bfe5ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-resumen {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.resumen-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resumen-item div {
  display: grid;
  gap: 3px;
}

.resumen-item strong {
  font-size: 0.95rem;
}

.resumen-item small {
  color: var(--muted);
  font-size: 0.8rem;
}

.resumen-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.04);
}

.resumen-dot.activo {
  background: #47d48b;
  box-shadow: 0 0 0 6px rgba(40, 179, 109, 0.12);
}

.panel-seccion {
  display: grid;
  gap: 12px;
}

.panel-seccion-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.panel-seccion-head strong {
  font-size: 0.98rem;
}

.panel-seccion-head span {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
}

.control-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  color: white;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.control-btn:hover {
  border-color: rgba(76, 179, 255, 0.18);
  box-shadow:
    0 10px 26px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.control-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: white;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
}

.control-icon-air {
  background: linear-gradient(135deg, rgba(59, 160, 255, 0.26), rgba(24, 98, 190, 0.18));
}

.control-icon-screen {
  background: linear-gradient(135deg, rgba(160, 168, 255, 0.18), rgba(74, 92, 180, 0.18));
}

.control-icon-projector {
  background: linear-gradient(135deg, rgba(255, 179, 88, 0.22), rgba(171, 97, 28, 0.16));
}

.control-icon-light {
  background: linear-gradient(135deg, rgba(255, 225, 117, 0.2), rgba(176, 143, 20, 0.14));
}

.control-copy {
  display: grid;
  gap: 4px;
  flex: 1;
}

.control-copy strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.control-copy span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.status-pill {
  min-width: 104px;
  text-align: center;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.status-pill.on {
  background: linear-gradient(180deg, rgba(40, 179, 109, 0.26), rgba(40, 179, 109, 0.14));
  color: #bff7d9;
  border-color: rgba(40, 179, 109, 0.35);
  box-shadow: 0 8px 18px rgba(40, 179, 109, 0.14);
}

.status-pill.off {
  background: linear-gradient(180deg, rgba(215, 70, 70, 0.24), rgba(215, 70, 70, 0.12));
  color: #ffc3c3;
  border-color: rgba(215, 70, 70, 0.35);
  box-shadow: 0 8px 18px rgba(215, 70, 70, 0.14);
}

.form-message { min-height: 22px; margin: 0 !important; color: #ffc3c3 !important; font-size: .88rem; }
.connection-chip, .user-chip { padding: 9px 12px; border-radius: 999px; background: rgba(215,70,70,.15); color: #ffc3c3; font-size: .8rem; font-weight: 700; }
.connection-chip.online, .sidebar-badge.online { background: rgba(40,179,109,.18); color: #bff7d9; border-color: rgba(40,179,109,.3); }
.user-chip { background: rgba(76,179,255,.12); color: #cdeaff; }
.empty-state { padding: 24px; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; }
.empty-state[hidden] { display: none; }
.empty-state.compact { padding: 16px; }
.hub-status { display: grid; gap: 5px; padding: 13px 15px; border-radius: 18px; background: rgba(76,179,255,.07); color: var(--muted); font-size: .78rem; }
.hub-status span { display: block; }
.hub-status strong { color: #eaf5ff; }
.action-groups { display: grid; gap: 18px; }
.action-group { display: grid; gap: 10px; }
.control-btn:disabled { cursor: wait; opacity: .68; transform: none; }
.status-pill.listo { background: rgba(76,179,255,.12); color: #bfe5ff; }
.status-pill.pendiente { background: rgba(255,179,88,.17); color: #ffd7a4; }
.status-pill.procesando { background: rgba(160,168,255,.18); color: #d8dcff; }
.status-pill.ok { background: rgba(40,179,109,.2); color: #bff7d9; }
.status-pill.error { background: rgba(215,70,70,.2); color: #ffc3c3; }
.status-pill.agotado { background: rgba(255,179,88,.17); color: #ffd7a4; }
.status-pill.desconectado { background: rgba(130,145,170,.16); color: #c5cfdf; }
.control-btn.reintentar { border-color: rgba(255,179,88,.28); }
.dashboard-version { color: #7890b3; font-size: .72rem; text-align: center; }
.publish-btn { border: 1px solid rgba(40,179,109,.35); background: linear-gradient(135deg, #28b36d, #138251); color: white; border-radius: 14px; padding: 12px 16px; cursor: pointer; font-weight: 800; }
.publish-dialog { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(1,5,12,.78); backdrop-filter: blur(10px); }
.publish-dialog[hidden] { display: none; }
.publish-card { width: min(560px, 100%); padding: 28px; border-radius: 28px; background: #0b1830; border: 1px solid var(--line); box-shadow: var(--shadow); }
.publish-card h2 { margin: 16px 0 8px; }
.publish-card p { color: var(--muted); line-height: 1.5; }
.publish-log { display: none; max-height: 230px; overflow: auto; padding: 14px; border-radius: 14px; background: #030914; color: #bfe5ff; white-space: pre-wrap; font: 12px/1.5 Consolas, monospace; }
.publish-log:not(:empty) { display: block; }

@media (max-width: 760px) {
  .user-chip { display: none; }
  .connection-chip { font-size: .7rem; }
}

.lab-help {
  margin-top: 2px;
  padding: 16px 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(76, 179, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(76, 179, 255, 0.12);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.lab-help strong {
  display: block;
  color: #eef6ff;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.lab-help code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

@media (max-width: 1120px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding-bottom: 8px;
  }
}

@media (max-width: 760px) {
  .shell-header,
  .dashboard-content,
  .login-brand,
  .login-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  html,
  body,
  .app {
    height: 100dvh;
  }

  .login-screen {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .login-layout {
    height: auto;
    min-height: 100dvh;
  }

  .login-brand {
    min-height: auto;
    gap: 36px;
    padding-top: 28px;
  }

  .brand-campuses,
  .brand-footer {
    display: none;
  }

  .brand-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.6rem);
  }

  .shell {
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .shell-header {
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .shell-title {
    min-width: 0;
  }

  .shell-title .brand-mark {
    width: 42px !important;
    height: 42px !important;
  }

  .shell-title h3 {
    font-size: 1rem;
  }

  .shell-title p {
    font-size: 0.78rem;
  }

  .top-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }

  .top-action,
  .publish-btn {
    padding: 9px 11px;
    font-size: 0.76rem;
  }

  .dashboard-content {
    padding-top: 18px;
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
  }

  .hero-panel {
    padding: 26px 22px;
  }

  .hero-panel h1 {
    font-size: 2rem;
  }

  .lab-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lab-header {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  .lab-header > div:first-child {
    width: 100%;
  }

  .lab-header p {
    display: none;
  }

  .lab-header .top-actions {
    justify-content: flex-start;
  }

  .lab-sidebar {
    top: 112px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    max-height: none;
    left: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .control-btn {
    min-height: 72px;
  }

  .status-pill {
    min-width: 86px;
    padding: 9px 8px;
    font-size: 0.68rem;
  }

  .publish-card {
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }

  .access-shell {
    align-items: start;
    padding: max(22px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
  }

  .access-card {
    padding: 28px 18px;
    border-radius: 26px;
  }

  .access-actions > button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .connection-chip {
    display: none;
  }

  .lab-card-content {
    padding: 20px;
  }

  .control-btn {
    gap: 8px;
    padding: 12px;
  }

  .control-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
}

/* Vista del laboratorio en telefonos: la escena y los controles forman una
   sola pagina vertical. De este modo el panel no tapa el entorno 3D y el
   desplazamiento depende del documento, no de un contenedor superpuesto. */
@media (max-width: 760px) {
  .lab-screen.active {
    display: grid;
    grid-template-areas:
      "header"
      "canvas"
      "sidebar";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(320px, 48dvh) auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    background: #07111f;
  }

  .lab-header {
    grid-area: header;
    position: sticky;
    inset: auto;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top)) 14px 12px;
    background: rgba(2, 7, 16, 0.97);
    backdrop-filter: none;
  }

  .lab-header h4 {
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lab-header .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .lab-header .top-action {
    min-height: 42px;
    padding: 9px 10px;
    line-height: 1.15;
    white-space: normal;
  }

  .lab-canvas {
    grid-area: canvas;
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 320px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .lab-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
  }

  .lab-sidebar {
    grid-area: sidebar;
    position: relative;
    inset: auto;
    z-index: 1;
    width: 100%;
    max-height: none;
    min-width: 0;
    gap: 14px;
    padding: 18px 14px calc(28px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, #101a2b 0%, #081322 100%);
    backdrop-filter: none;
    box-shadow: none;
    overflow: visible;
    touch-action: pan-y;
  }

  .sidebar-title,
  .panel-seccion-head {
    align-items: flex-start;
  }

  .sidebar-title strong {
    font-size: 1.12rem;
  }

  .sidebar-badge {
    flex: 0 0 auto;
    max-width: 46%;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .panel-resumen {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .resumen-item {
    align-items: flex-start;
  }

  .resumen-item small {
    line-height: 1.35;
  }

  .hub-status {
    overflow-wrap: anywhere;
  }

  .control-btn {
    min-height: 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    justify-content: initial;
    gap: 7px 12px;
    padding: 14px;
    border-radius: 18px;
  }

  .control-icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .control-copy {
    grid-column: 2;
    min-width: 0;
  }

  .control-copy strong,
  .control-copy span {
    overflow-wrap: anywhere;
  }

  .status-pill {
    grid-column: 2;
    min-width: 0;
    max-width: 100%;
    justify-self: start;
    padding: 7px 10px;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .lab-header .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-resumen {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-seccion-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .panel-seccion-head span {
    text-align: left;
  }
}
