/* =====================================================================
   VALBATER AUDIOVISUAL · PIXEL MAP & CALCULADOR LED PRO
   Diseño de Alta Fidelidad Pro-AV: Desktop, Notebook, Tablet y Smartphone
   ===================================================================== */

:root {
  --bg-main: #0a0d14;
  --bg-surface: #101522;
  --bg-surface-elevated: #161d2d;
  --bg-input: #0b0f18;
  --bg-glass: rgba(16, 21, 34, 0.85);

  --border-subtle: #1e283b;
  --border-focus: #00f0ff;
  --border-active: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #00f0ff;
  --accent-cyan-hover: #00c4d4;
  --accent-cyan-glow: rgba(0, 240, 255, 0.25);

  --accent-gold: #ffcc00;
  --accent-gold-glow: rgba(255, 204, 0, 0.25);

  --accent-purple: #a855f7;
  --color-green: #10b981;
  --color-orange: #f97316;
  --color-red: #ef4444;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --header-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.valbater-theme {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================================
   HEADER BAR
   ===================================================================== */
.top-nav {
  height: var(--header-height);
  background: #080a10;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.nav-back-link:hover {
  color: #fff;
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.nav-sep {
  color: var(--border-subtle);
  font-weight: 700;
}

.brand-titles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-app {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand-badge-pro {
  background: linear-gradient(135deg, #00f0ff, #3b82f6);
  color: #000;
  font-weight: 900;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.8px;
}

/* TABS PARA DISPOSITIVOS MÓVILES (Ocultas en escritorio) */
.mobile-tabs {
  display: none;
  gap: 4px;
}

.m-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.m-tab.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* ACCIONES DE NAVBAR */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-subtle {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, #00f0ff 0%, #0284c7 100%);
  color: #000;
  box-shadow: 0 2px 10px var(--accent-cyan-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #24f4ff 0%, #0294df 100%);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 204, 0, 0.1);
  border-color: rgba(255, 204, 0, 0.4);
  color: var(--accent-gold);
}

.btn-secondary:hover {
  background: rgba(255, 204, 0, 0.2);
  color: #fff;
}

/* DROPDOWN MENU */
.dropdown-wrap {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: #111724;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
}

.dropdown-menu.open {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.dropdown-item:hover {
  background: rgba(0, 240, 255, 0.1);
}

.d-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.d-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.d-info small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* BADGE DE SESIÓN */
.session-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-green);
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 6px var(--color-green);
}

.btn-wa-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.4);
  color: #25d366;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-wa-header:hover {
  background: #25d366;
  color: #000;
}

/* =====================================================================
   APP LAYOUT (3 PANELES PRO)
   ==================================================================== */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr) 390px;
  min-height: 0;
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.panel::-webkit-scrollbar {
  width: 6px;
}

.panel::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

/* PANEL IZQUIERDO */
.panel-left {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 18px;
  gap: 16px;
}

/* PANEL CENTRAL (CANVAS VIEW) */
.panel-center {
  background: #06080d;
  position: relative;
  overflow: hidden;
}

/* PANEL DERECHO */
.panel-right {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  padding: 18px;
  gap: 16px;
}

/* SECCIONES DENTRO DE LOS PANELES */
.panel-section {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.sh-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sh-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #000;
  font-weight: 900;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.sh-title h2 {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sh-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
}

/* CAMPOS DE FORMULARIO */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.sync-divider {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
  margin: -4px 0;
  opacity: 0.85;
}

/* GRUPOS DE BOTONES TOGGLE */
.btn-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.toggle-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.toggle-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 2px 8px var(--accent-cyan-glow);
}

/* CAJA DE ARMADO MIXTO */
.mixed-setup-box {
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mixed-pills-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.m-pill {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
}
.m-pill b {
  color: var(--accent-gold);
}


/* COLOR PICKER ROW */
.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
  transform: scale(1.2);
}

/* PREVIEW LIVE DE LA PANTALLA EN CURSO */
.live-screen-summary {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lss-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lss-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

.lss-aspect {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-gold);
}

.lss-res {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.lss-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid rgba(0, 240, 255, 0.12);
  padding-top: 8px;
}

.lss-item small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.lss-item strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

.btn-add-screen {
  background: linear-gradient(135deg, #00f0ff 0%, #0088cc 100%);
  color: #000;
  font-weight: 900;
  font-size: 14px;
  padding: 13px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px var(--accent-cyan-glow);
  width: 100%;
}

.btn-add-screen:hover {
  background: linear-gradient(135deg, #33f4ff 0%, #00a0f0 100%);
  transform: translateY(-1px);
}

.btn-add-screen.has-draft {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.45) !important;
  animation: pulseAddBtn 2s infinite ease-in-out;
}

.btn-add-screen.has-draft:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6) !important;
}

@keyframes pulseAddBtn {
  0%, 100% {
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 4px 26px rgba(16, 185, 129, 0.75);
  }
}

.panel-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  margin-top: -4px;
}

/* LOGO UPLOAD */
.logo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-preview-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px;
  border-radius: 6px;
}

.logo-preview-badge img {
  height: 24px;
  max-width: 60px;
  object-fit: contain;
}

.logo-preview-badge button {
  background: transparent;
  border: none;
  color: var(--color-red);
  font-size: 16px;
  cursor: pointer;
}

/* =====================================================================
   WORKSPACE / STAGE 2D (CANVAS INTERACTIVO)
   ===================================================================== */
.workspace-toolbar {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.workspace-toolbar.top {
  top: 14px;
  left: 14px;
  right: 14px;
  justify-content: space-between;
}

.workspace-toolbar.bottom {
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 28px);
}

.tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tool-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-red);
  color: #fecaca;
}

.tool-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.tool-btn.highlight-center {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.4);
  color: #fff;
}

.tool-btn.highlight-center:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px var(--accent-cyan-glow);
}

.tool-separator {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
}

.stage-info-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.sib-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

.selected-screen-info {
  display: flex;
  flex-direction: column;
  padding-right: 12px;
  border-right: 1px solid var(--border-subtle);
}

.ssi-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.ssi-coords {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
}

/* VIEWPORT Y STAGE CANVAS */
.workspace-viewport {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  touch-action: none;
  background-color: #06080d;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* MODO NAVEGACIÓN CON TECLA ESPACIO (MANO / PAN) */
.workspace-viewport.space-nav,
.workspace-viewport.space-nav * {
  cursor: grab !important;
  user-select: none !important;
}

.workspace-viewport.space-nav.is-panning,
.workspace-viewport.space-nav.is-panning *,
.workspace-viewport.is-panning,
.workspace-viewport.is-panning * {
  cursor: grabbing !important;
  user-select: none !important;
}

.stage-canvas {
  position: absolute;
  background: #0d121c;
  border: 1px solid #2d3748;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45), 0 20px 50px rgba(0, 0, 0, 0.8);
  transform-origin: center;
  overflow: hidden;
}

.origin-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  z-index: 5;
}

.stage-res-label {
  position: absolute;
  top: 6px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  z-index: 5;
}

/* PANTALLAS EN EL CANVAS */
.screen-element {
  position: absolute;
  border: 2px solid var(--sc-color, #00f0ff);
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.15s;
  overflow: visible;
}

.screen-element.selected {
  box-shadow: 0 0 0 2px #fff, 0 0 24px var(--sc-color, #00f0ff);
  z-index: 10;
}

.screen-element.group-selected {
  box-shadow: 0 0 0 2px var(--accent-purple), 0 0 20px rgba(168, 85, 247, 0.6);
  z-index: 10;
}

.screen-element:active {
  cursor: grabbing;
}

/* CLIPPER INTERNO DE PATRÓN DE MÓDULOS */
.screen-bg-clipper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 1px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

/* ETIQUETA ADAPTATIVA DEL NOMBRE Y RESOLUCIÓN */
.screen-label-badge {
  position: relative;
  z-index: 3;
  background: rgba(10, 13, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 5px;
  padding: 3px 6px;
  font-weight: 800;
  max-width: calc(100% - 6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  transition: all 0.15s;
}

.screen-label-badge strong {
  display: block;
  font-size: 11px;
  color: #fff;
  line-height: 1.15;
  word-break: break-word;
}

.screen-label-badge small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 1px;
  white-space: nowrap;
}

/* PANTALLAS ESTRECHAS (TOTEMS Y BANNERS VERTICALES) */
.screen-element.narrow-screen .screen-label-badge {
  padding: 2px 3px;
  border-radius: 3px;
}
.screen-element.narrow-screen .screen-label-badge strong {
  font-size: 9px;
  line-height: 1.05;
}
.screen-element.narrow-screen .screen-label-badge small {
  font-size: 7.5px;
}

/* PANTALLAS ULTRA ESTRECHAS (< 65px de ancho renderizado) */
.screen-element.micro-screen .screen-label-badge {
  padding: 1.5px 2px;
  max-width: calc(100% - 2px);
}
.screen-element.micro-screen .screen-label-badge strong {
  font-size: 7.5px;
  line-height: 1;
}
.screen-element.micro-screen .screen-label-badge small {
  font-size: 6.5px;
}

/* COORDENADAS: NUNCA SE CORTA X NI Y (STACKED EN PANTALLAS ESTRECHAS) */
.screen-coords-badge {
  position: absolute;
  left: 3px;
  bottom: 3px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 2px 4px;
  border-radius: 3px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  pointer-events: none;
  max-width: calc(100% - 4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.screen-coords-badge.stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  font-size: 8px;
  padding: 1.5px 3px;
  left: 2px;
  bottom: 2px;
  line-height: 1;
}

.screen-coords-badge.stacked .c-val {
  display: block;
  white-space: nowrap;
}
.screen-coords-badge.stacked .c-val.cy {
  color: var(--accent-cyan);
}

/* =====================================================================
   PANEL DERECHO: LISTA DE PANTALLAS
   ===================================================================== */
.screens-empty-state {
  text-align: center;
  padding: 24px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
}

.ses-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.ses-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.ses-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 4px;
}

.screens-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.screen-list-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.screen-list-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
}

.screen-list-card.active {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.06);
  box-shadow: 0 0 14px var(--accent-cyan-glow);
}

.slc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.slc-info {
  flex: 1;
  min-width: 0;
}

.slc-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slc-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.slc-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.icon-btn.trash:hover {
  color: var(--color-red);
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--color-red);
}

/* =====================================================================
   PANEL DERECHO: RESUMEN LOGÍSTICO (VALBATER ENGINE)
   ===================================================================== */
.logistics-card {
  background: rgba(255, 204, 0, 0.03);
  border: 1px solid rgba(255, 204, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 204, 0, 0.15);
  padding-bottom: 8px;
}

.lc-tag {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.8px;
  color: var(--accent-gold);
}

.lc-power-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--color-red);
  padding: 2px 6px;
  border-radius: 4px;
}

.lc-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lcm-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.lcm-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.lcm-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  margin-top: 4px;
}

.lcm-val.gold { color: var(--accent-gold); }
.lcm-val.cyan { color: var(--accent-cyan); }

.lcm-sub {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.lcm-cases-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.case-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  padding: 2.5px 7px;
  border-radius: 4px;
  white-space: nowrap;
  width: fit-content;
}

.case-badge.case-100 {
  background: rgba(0, 240, 255, 0.14);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.case-badge.case-50 {
  background: rgba(255, 204, 0, 0.14);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.4);
}

.lc-cables-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.lcc-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lcc-icon {
  font-size: 16px;
}

.lcc-title {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lcc-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 900;
  color: var(--color-green);
}

.lc-electric-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.lce-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.lce-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lce-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 900;
  margin-top: 2px;
}

.lce-val.orange { color: var(--color-orange); }

.lce-dual-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-weight: 900;
}

.lce-amps-max {
  font-size: 15px;
  color: var(--color-red);
}

.lce-amps-avg {
  font-size: 13px;
  color: var(--accent-gold);
}

.lce-sub {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.logistics-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.full-width {
  width: 100%;
}

/* =====================================================================
   RESPONSIVE DESIGN (TABLET Y SMARTPHONES)
   ===================================================================== */
@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: 320px 1fr 340px;
  }
}

@media (max-width: 992px) {
  body.valbater-theme {
    overflow: auto;
    height: auto;
  }

  .app-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .panel-center {
    height: 60vh;
    min-height: 420px;
  }

  .panel-left, .panel-right {
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .top-nav {
    padding: 0 10px;
  }

  .back-text, .brand-titles {
    display: none;
  }

  .mobile-tabs {
    display: flex;
  }

  .nav-actions .btn-text {
    display: none;
  }

  .btn {
    padding: 8px 10px;
  }

  /* SISTEMA DE PESTAÑAS MÓVILES */
  .panel-left, .panel-right, .panel-center {
    display: none;
  }

  body.tab-canvas .panel-center {
    display: flex;
    height: calc(100vh - var(--header-height));
    min-height: 0;
  }

  body.tab-setup .panel-left {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  body.tab-screens .panel-right {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }
  body.tab-screens .logistics-summary-section {
    display: none;
  }

  body.tab-logistics .panel-right {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }
  body.tab-logistics .panel-section:first-child {
    display: none;
  }

  .workspace-toolbar.top {
    left: 8px;
    right: 8px;
    top: 8px;
    padding: 4px 8px;
  }

  .workspace-toolbar.bottom {
    bottom: 8px;
    padding: 4px 8px;
    width: calc(100% - 16px);
    justify-content: space-between;
  }

  .tool-label {
    display: none;
  }
}

/* ===================================================================
   REPRESENTACIÓN FÍSICA DE MÓDULOS LED (GABINETES 50×100 Y 50×50)
   =================================================================== */

.screen-modules-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.module-cabinet-tile {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 12, 20, 0.92);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

/* Textura interna de gabinete LED pro (sub-paneles de LEDs) */
.module-cabinet-tile::before {
  content: '';
  position: absolute;
  inset: 1px;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.8;
  pointer-events: none;
}

/* Gabinete 50×100: línea divisoria central que separa los 2 semi-bloques */
.module-cabinet-tile.is-100::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

/* Gabinete 50×100 rotado horizontal (100×50) */
.module-cabinet-tile.is-100.is-rotated::after {
  top: 0;
  bottom: 0;
  left: 50%;
  right: auto;
  width: 1px;
  height: auto;
}

/* Etiqueta de tipo de módulo (50×100 o 50×50) */
.cabinet-type-badge {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.15s;
}

.module-cabinet-tile:hover .cabinet-type-badge {
  color: #fff;
}

/* Hover sobre módulo en modo normal */
.module-cabinet-tile:hover {
  border-color: rgba(0, 240, 255, 0.65);
  background: rgba(14, 22, 36, 0.95);
}

/* MODO TRAZADO MANUAL INTERACTIVO */
body.manual-cabling-active .workspace-viewport {
  cursor: crosshair !important;
}

body.manual-cabling-active .module-cabinet-tile {
  cursor: crosshair;
}

body.manual-cabling-active .module-cabinet-tile:hover {
  border-color: var(--active-port-color, #00f0ff) !important;
  box-shadow: 0 0 10px var(--active-port-color, #00f0ff), inset 0 0 8px rgba(0, 240, 255, 0.3);
  z-index: 5;
}

/* ===================================================================
   CAPA SVG DE CABLEADO Y RUTAS DE SEÑAL
   =================================================================== */

.screen-cabling-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  overflow: visible;
}

.cabling-polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px currentColor);
}

/* NODO DE PATCH / CONEXIÓN EN CADA MÓDULO */
.mod-patch-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 7;
}

.patch-number-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #090d16;
  border: 2px solid var(--port-color, #00f0ff);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 8px var(--port-color, #00f0ff);
}

/* BADGE RJ45 IN (PRIMER MÓDULO DE LA CADENA) */
.patch-in-badge {
  position: absolute;
  bottom: 22px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 10px rgba(16, 185, 129, 0.7);
  letter-spacing: 0.4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ===================================================================
   BARRA FLOTANTE DE TRAZADO MANUAL
   =================================================================== */

.manual-cabling-floating-bar {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: rgba(10, 15, 26, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.3);
  backdrop-filter: blur(8px);
}

.mcf-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mcf-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseNeon 1.5s infinite;
}

@keyframes pulseNeon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.mcf-text {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.mcf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-mcf {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-mcf:hover {
  background: var(--border-color);
  color: #fff;
}

.btn-mcf.primary {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #000;
  font-weight: 800;
}

.btn-mcf.primary:hover {
  filter: brightness(1.15);
}

/* ===================================================================
   MODAL DE CABLEADO (ESTILOS COMPLETOS PRO-AV)
   =================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cabling-modal-container {
  background: #0d121f;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 240, 255, 0.15);
  overflow: hidden;
}

.cabling-modal-header {
  padding: 16px 20px;
  background: #111728;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cmh-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.cmh-info h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.cmh-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 3px 0 0 0;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.btn-close-modal:hover {
  color: #fff;
}

.cabling-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.cabling-tabs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.c-tab {
  background: #131b2e;
  border: 1px solid #1e293b;
  color: var(--text-muted);
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.c-tab.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.cabling-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

/* TARJETAS DE PATRONES */
.pattern-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.pattern-card {
  background: #131a2c;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  transition: all 0.15s;
  position: relative;
}

.pattern-card input {
  position: absolute;
  opacity: 0;
}

.pattern-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.pattern-card.active,
.pattern-card:has(input:checked) {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
}

.pc-content {
  display: flex;
  flex-direction: column;
}

.pc-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

.pc-content strong {
  font-size: 12px;
  color: #fff;
  line-height: 1.2;
}

.pc-content small {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ESQUINAS DE ENTRADA */
.corner-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.corner-card {
  background: #131a2c;
  border: 1px solid #1e293b;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s;
  position: relative;
}

.corner-card input {
  position: absolute;
  opacity: 0;
}

.corner-card:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.corner-card.active,
.corner-card:has(input:checked) {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  color: #fff;
}

/* GUÍA MANUAL */
.manual-cabling-guide {
  display: flex;
  gap: 12px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.mcg-icon {
  font-size: 24px;
}

.mcg-text strong {
  display: block;
  font-size: 13px;
  color: var(--accent-cyan);
}

.mcg-text p {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 3px 0 0 0;
  line-height: 1.4;
}

/* PÍLDORAS DE PUERTOS */
.ports-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.port-pill {
  background: #131a2c;
  border: 1px solid #1e293b;
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.port-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--p-color, #00f0ff);
  box-shadow: 0 0 6px var(--p-color, #00f0ff);
}

.port-pill.active {
  border-color: var(--p-color, #00f0ff);
  background: rgba(0, 240, 255, 0.12);
  color: #fff;
}

.manual-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* MONITOR DE PUERTOS */
.ports-monitor-box {
  background: #090e18;
  border: 1px solid #1b2438;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.port-monitor-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pmi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.pmi-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #fff;
}

.pmi-stats {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 11px;
}

.pmi-bar-wrap {
  width: 100%;
  height: 6px;
  background: #161e30;
  border-radius: 3px;
  overflow: hidden;
}

.pmi-bar-fill {
  height: 100%;
  background: var(--p-color, #00f0ff);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.pmi-bar-fill.overload {
  background: #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* FOOTER DEL MODAL */
.cabling-modal-footer {
  padding: 14px 20px;
  background: #111728;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.highlight-cabling {
  border-color: rgba(0, 240, 255, 0.5) !important;
  color: var(--accent-cyan) !important;
}

.highlight-cabling:not(:disabled):hover {
  background: rgba(0, 240, 255, 0.15) !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

@media (max-width: 640px) {
  .cabling-grid-2col {
    grid-template-columns: 1fr;
  }
  .pattern-options-grid {
    grid-template-columns: 1fr;
  }
  .corner-picker-grid {
    grid-template-columns: 1fr;
  }
  .manual-cabling-floating-bar {
    width: calc(100% - 24px);
    flex-direction: column;
    gap: 8px;
    top: 50px;
    padding: 8px 12px;
  }
}

/* =====================================================================
   PRIORIDAD RETORNO A PISO (FLOOR-TO-FLOOR ROUTING / SMARTLCT STYLE)
   ===================================================================== */
.floor-priority-box {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, background 0.2s;
}

.floor-priority-box:hover {
  border-color: rgba(0, 240, 255, 0.6);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(16, 185, 129, 0.09));
}

.floor-priority-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.floor-priority-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.fp-custom-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #090d16;
  border: 2px solid rgba(0, 240, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.floor-priority-toggle input[type="checkbox"]:checked + .fp-custom-checkbox {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.floor-priority-toggle input[type="checkbox"]:checked + .fp-custom-checkbox::after {
  content: '✓';
  color: #060910;
  font-weight: 900;
  font-size: 14px;
}

.fp-text-wrap {
  flex: 1;
}

.fp-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.fp-title-row strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.fp-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.fp-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0;
}
.fp-desc b {
  color: #e2e8f0;
}

/* =====================================================================
   DASHBOARD HARDWARE NOVASTAR (ESTILO SMARTLCT)
   ===================================================================== */
.novastar-hw-dashboard {
  background: #0b101c;
  border: 1px solid #1f2a40;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 14px;
}

.nhd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.nhd-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nhd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.nhd-status-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nhd-model {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.nhd-outputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.nhd-port-card {
  background: rgba(18, 25, 42, 0.85);
  border: 1px solid #23304a;
  border-radius: 6px;
  padding: 8px 10px;
}

.nhd-port-card.active-port {
  border-color: var(--port-c, #00f0ff);
}

.nhd-port-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.nhd-port-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nhd-port-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--port-c, #00f0ff);
}

.nhd-port-percent {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--port-c, #00f0ff);
}

.nhd-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.nhd-bar-fill {
  height: 100%;
  background: var(--port-c, #00f0ff);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.nhd-port-details {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* =====================================================================
   MÓDULOS CON ESTILO SMARTLCT (COLOR DE PUERTO, NÚMERO Y NC)
   ===================================================================== */
.module-cabinet-tile.has-port-cabled {
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.mod-seq-num {
  position: absolute;
  top: 2px;
  left: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 3px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}

.module-cabinet-tile.is-nc {
  background: rgba(14, 20, 32, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.mod-nc-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* SMARTLCT SIGNATURE SHAPES AND IN/OUT BADGES */
.patch-out-badge {
  position: absolute;
  top: 22px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.4px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

/* =====================================================================
   PANTALLA EN BORRADOR / DIBUJO EN TIEMPO REAL EN EL LIENZO
   ===================================================================== */
.screen-element.is-live-draft {
  border: 2px dashed var(--sc-color, #00f0ff) !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.45), inset 0 0 15px rgba(0, 240, 255, 0.18) !important;
  animation: draftBorderGlow 2.5s infinite ease-in-out;
  cursor: grab;
  z-index: 10;
}

.screen-element.is-live-draft:active {
  cursor: grabbing;
}

@keyframes draftBorderGlow {
  0%, 100% {
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), inset 0 0 10px rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.75);
  }
  50% {
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.7), inset 0 0 22px rgba(0, 240, 255, 0.28);
    border-color: #00f0ff;
  }
}

.draft-pill-tag {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  color: #050811;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: 12px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.6);
  pointer-events: none;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 5px;
}

.draft-pill-tag .d-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #050811;
  animation: draftDot 0.8s infinite alternate;
}

@keyframes draftDot {
  from { opacity: 0.3; transform: scale(0.75); }
  to { opacity: 1; transform: scale(1.2); }
}

/* ===================================================================
   SELECTOR INTERACTIVO DE GABINETES LED (SECCIÓN 2 PRO)
   =================================================================== */
.cabinet-visual-selector {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.cvs-step {
  background: rgba(13, 19, 31, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
}

.cvs-step-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cvs-step-label .step-badge {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
}

/* PASO 1: TARJETAS DE TAMAÑO */
.cvs-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 540px) {
  .cvs-cards-grid {
    grid-template-columns: 1fr;
  }
}

.cab-card {
  background: #090e18;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-color);
  font-family: inherit;
  width: 100%;
}

.cab-card:hover {
  border-color: #334155;
  background: #0f1624;
}

.cab-card:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.cab-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.18);
}

.cab-selected-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent-cyan);
  color: #060910;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  display: none;
}

.cab-card.selected .cab-selected-pill {
  display: block;
}

.cab-graphic-box {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.cab-rect-50 {
  width: 50px;
  height: 50px;
  border: 2px solid var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  padding: 2px;
}

.cab-rect-100 {
  width: 50px;
  height: 100px;
  border: 2px solid var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border-radius: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr 1fr;
  gap: 2px;
  padding: 2px;
}

.cab-rect-cell {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
}

.cab-card-size {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 2px;
}

.cab-card-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.cab-card-consumption {
  width: 100%;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  display: flex;
  justify-content: space-around;
  font-size: 11px;
  font-family: var(--font-mono);
}

.val-max { color: var(--accent-gold); font-weight: 700; }
.val-avg { color: var(--accent-green); font-weight: 700; }

/* PASO 2: PITCH CHIPS */
.pitch-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pitch-chip {
  background: #090e18;
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.15s ease;
}

.pitch-chip:hover {
  border-color: #475569;
  color: var(--text-color);
}

.pitch-chip:focus-visible {
  outline: 2px solid var(--accent-cyan);
}

.pitch-chip.active {
  background: var(--accent-cyan);
  color: #060910;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

/* PASO 3: RESOLUCIÓN DEL GABINETE */
.cvs-resolution-card {
  background: #090e18;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cvs-resolution-card .rc-title-block h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 3px;
}

.cvs-resolution-card .rc-meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cvs-resolution-card .rc-res-display {
  text-align: right;
  flex-shrink: 0;
}

.cvs-resolution-card .rc-res-val {
  font-size: 18px;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.cvs-resolution-card .rc-res-sub {
  font-size: 10px;
  color: var(--text-dim);
}

/* PASO 4: CONSUMO ELÉCTRICO */
.power-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 540px) {
  .power-cards-grid {
    grid-template-columns: 1fr;
  }
}

.power-card {
  background: #090e18;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.power-card.max {
  border-left: 3px solid var(--accent-gold);
}

.power-card.avg {
  border-left: 3px solid var(--accent-green);
}

.power-card .pc-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.power-card .pc-amps {
  font-size: 22px;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1.1;
}

.power-card.max .pc-amps { color: var(--accent-gold); }
.power-card.avg .pc-amps { color: var(--accent-green); }

.power-card .pc-watts {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.power-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  background: rgba(15, 23, 42, 0.4);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

@media (max-width: 540px) {
  .power-inputs-grid {
    grid-template-columns: 1fr;
  }
}

/* TARJETA DISPARADORA EN EL PANEL (ESTILO NUBE RESUMIDO) */
.cloud-trigger-card {
  background: linear-gradient(135deg, #0e1626, #121d33);
  border: 1.5px solid #233554;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.cloud-trigger-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
  transform: translateY(-1px);
}

.cloud-trigger-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--accent-cyan);
}

.ct-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ct-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ct-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.ct-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  display: flex;
  gap: 7px;
  align-items: center;
}

.ct-btn {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.ct-btn:hover {
  background: var(--accent-cyan);
  color: #060910;
}

/* OVERLAY Y MODAL FLOTANTE (MODO NUBE) */
.cloud-popover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cloud-modal {
  background: #0d131f;
  border: 1px solid #1e2d42;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.12);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  animation: zoomInCloud 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomInCloud {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cloud-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #1e293b;
}

.cm-title {
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cm-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.cm-close:hover {
  background: #1f293d;
  color: #fff;
}

.cloud-confirm-btn {
  background: linear-gradient(135deg, #00f0ff, #00a8ff);
  color: #060910;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  transition: all 0.2s;
}

.cloud-confirm-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

