/* Simulador de armado de tableros 3D: usa el vidrio y los tokens de lab-pro.css */
body.lab-pro { margin: 0; background: #000; overflow: hidden; }
.tb-app { background: radial-gradient(90% 90% at 50% 35%, #232326, #0b0b0c 60%, #000); }
.tb-vista { position: absolute; inset: 0; }
.tb-vista canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; }
.tb-vista canvas.colocando { cursor: copy; }
.tb-vista canvas:active { cursor: grabbing; }

.tb-barra { gap: 4px; }
.tb-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0, 0, 0, 0.28); }
.tb-seg a, .tb-seg button { border: 0; background: transparent; color: var(--lp-t2); font: 500 12.5px var(--lp-fuente); padding: 5px 11px; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tb-seg a:hover, .tb-seg button:hover:not([disabled]) { color: #fff; background: var(--lp-fill); }
.tb-seg .on, .tb-seg [aria-current="page"], .tb-seg button.on { background: rgba(255, 255, 255, 0.16); color: #fff; }
.tb-seg button[disabled] { color: var(--lp-t3); cursor: default; }

.tb-izq { top: 70px; left: 12px; width: 296px; bottom: 76px; overflow-y: auto; padding: 14px; scrollbar-width: thin; z-index: 4; }
.tb-der { top: 70px; right: 12px; width: 312px; bottom: 76px; overflow-y: auto; padding: 14px; scrollbar-width: thin; z-index: 4; }
.tb-dock { left: 50%; transform: translateX(-50%); bottom: 12px; height: 50px; display: flex; align-items: center; gap: 6px; padding: 0 8px; white-space: nowrap; max-width: calc(100% - 24px); overflow-x: auto; z-index: 5; }

.tb-izq h2, .tb-der h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tb-sub { margin: 2px 0 0; font-size: 11.5px; color: var(--lp-t2); }
.tb-tit { margin: 14px 0 7px; font-size: 11.5px; font-weight: 600; color: var(--lp-t2); }
.tb-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.tb-chips button { padding: 5px 9px; border-radius: 8px; border: 1px solid transparent; background: var(--lp-fill); color: var(--lp-t); font: 500 11.5px var(--lp-fuente); cursor: pointer; }
.tb-chips button:hover { background: rgba(255, 255, 255, 0.12); }
.tb-chips button.on { background: rgba(255, 176, 32, 0.16); border-color: var(--lp-ac); color: #ffd08a; }

.tb-item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 8px; margin-bottom: 5px; border-radius: 10px; border: 1px solid transparent; background: var(--lp-fill); color: var(--lp-t); text-align: left; cursor: pointer; font: inherit; }
.tb-item:hover { background: rgba(255, 255, 255, 0.11); }
.tb-item.on { border-color: var(--lp-ac); background: rgba(255, 176, 32, 0.13); }
.tb-item b { display: block; font-size: 12px; font-weight: 600; line-height: 1.2; }
.tb-item i { display: block; font-style: normal; font-size: 10.5px; color: var(--lp-t2); margin-top: 1px; }
.tb-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); display: grid; place-items: center; }

.tb-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-top: 10px; }
.tb-cats button { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--lp-t); font: 500 12px var(--lp-fuente); text-align: left; cursor: pointer; }
.tb-cats button span { color: var(--lp-t3); font-size: 11px; }
.tb-cats button.on, .tb-cats button:hover { background: rgba(255, 255, 255, 0.09); }
.tb-buscar { width: 100%; height: 32px; margin-top: 10px; border-radius: 9px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--lp-sep); padding: 0 10px; color: var(--lp-t); font: 12.5px var(--lp-fuente); box-sizing: border-box; }

.tb-fila { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--lp-sep); font-size: 12px; }
.tb-fila span { color: var(--lp-t2); }
.tb-fila:first-of-type { border-top: 0; }
.tb-barrita { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 6px; }
.tb-barrita div { height: 100%; background: var(--lp-ac); }
.tb-campo { display: grid; gap: 4px; margin-top: 8px; font-size: 11.5px; color: var(--lp-t2); }
.tb-campo select, .tb-campo input { height: 30px; border-radius: 8px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--lp-sep); color: var(--lp-t); padding: 0 8px; font: 12.5px var(--lp-fuente); }

.tb-chk { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 11.5px; line-height: 1.35; }
.tb-chk em { flex: none; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 700; margin-top: 1px; }
.tb-chk.ok em { background: #30d158; color: #062; }
.tb-chk.av em { background: #ffb340; color: #3a2300; }
.tb-chk.err em { background: #ff453a; color: #fff; }
.tb-chk.pend em { background: rgba(255, 255, 255, 0.18); color: #fff; }
.tb-chk small { display: block; color: var(--lp-t3); font-size: 10.5px; margin-top: 1px; }
.tb-pie { margin-top: 10px; font-size: 11px; color: var(--lp-t3); line-height: 1.4; }
.tb-acciones { display: flex; gap: 8px; margin-top: 12px; }
.tb-acciones .lp-bt { flex: 1; background: rgba(255, 255, 255, 0.1); }
.tb-acciones .lp-acento { background: var(--lp-ac); }

.tb-aviso { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); padding: 7px 12px; border-radius: 10px; background: rgba(20, 21, 24, 0.88); border: 1px solid rgba(255, 255, 255, 0.14); font-size: 12px; opacity: 0; transition: opacity 0.2s; pointer-events: none; z-index: 8; max-width: 520px; text-align: center; }
.tb-aviso.ver { opacity: 1; }
.tb-etiqueta { position: absolute; padding: 3px 8px; border-radius: 7px; background: rgba(18, 19, 22, 0.86); border: 1px solid rgba(255, 255, 255, 0.14); font-size: 11px; font-weight: 500; white-space: nowrap; pointer-events: none; transform: translate(-50%, -130%); z-index: 3; }
.tb-noscript { position: absolute; inset: 0; display: grid; place-items: center; }

@media (max-width: 980px) {
  .tb-izq { width: 250px; } .tb-der { width: 250px; }
  .tb-barra .lp-nombre, #tbProyectos { display: none; }
}
@media (max-width: 720px) {
  .tb-izq, .tb-der { top: auto; bottom: 70px; height: 38%; width: calc(50% - 18px); }
  .tb-barra { overflow-x: auto; }
}

.tb-uni { left: 322px; right: 336px; bottom: 72px; max-height: 42%; overflow: auto; padding: 10px 12px; z-index: 5; }
.tb-uni-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12.5px; }
.tb-uni-cab span { color: var(--lp-t3); font-size: 11px; flex: 1; }
.tb-tour-luz { position: fixed; border-radius: 16px; box-shadow: 0 0 0 3px var(--lp-ac), 0 0 0 9999px rgba(0, 0, 0, 0.45); pointer-events: none; z-index: 30; transition: all 0.25s ease; }
.tb-tour { position: fixed; width: 320px; padding: 14px; z-index: 31; font: 12.5px var(--lp-fuente); color: var(--lp-t); }
.tb-tour b { font-size: 14px; } .tb-tour p { margin: 6px 0 10px; color: var(--lp-t2); line-height: 1.4; }
.tb-tour div { display: flex; align-items: center; gap: 6px; } .tb-tour div span { flex: 1; color: var(--lp-t3); font-size: 11px; }
.tb-fila .lp-bt { height: 24px; min-width: 24px; padding: 0 6px; }
@media (max-width: 1100px) { .tb-uni { left: 12px; right: 12px; } }

/* paso 3: cablear */
.tb-origen { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); font-size: 12px; line-height: 1.45; color: var(--lp-t2); }
.tb-origen.on { background: rgba(255, 176, 32, 0.12); border: 1px solid rgba(255, 176, 32, 0.35); color: #ffe2a6; }
.tb-origen i { font-style: normal; }
.tb-chips button[disabled] { opacity: 0.3; cursor: not-allowed; }
.tb-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.tb-tabla { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 4px; }
.tb-tabla th { text-align: left; color: var(--lp-t3); font-weight: 600; padding: 4px 4px; border-bottom: 1px solid var(--lp-sep); }
.tb-tabla td { padding: 5px 4px; border-bottom: 1px solid var(--lp-sep); }
.tb-tabla td:last-child, .tb-tabla th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tb-chk[data-vercab]:hover { background: rgba(255, 255, 255, 0.04); border-radius: 8px; }

/* paso 4: energizar */
.tb-energ { width: 100%; height: 44px; margin-top: 12px; border: 0; border-radius: 12px; font: 600 14px var(--lp-fuente); cursor: pointer; background: var(--lp-ac); color: #241500; transition: background 0.2s, transform 0.15s; }
.tb-energ:active { transform: scale(0.98); }
.tb-energ.on { background: #3a1513; color: #ff8a80; box-shadow: inset 0 0 0 1px rgba(255, 69, 58, 0.5); }
.tb-mando { min-width: 96px; box-shadow: inset 3px 0 0 var(--c, transparent); }
.tb-mando.on { background: rgba(255, 69, 58, 0.25); }
.tb-log { display: grid; gap: 4px; max-height: 220px; overflow: auto; font-size: 11.5px; }
.tb-log div { padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); line-height: 1.35; }
.tb-log div.err { background: rgba(255, 69, 58, 0.14); color: #ffb4ad; } .tb-log div.av { background: rgba(255, 176, 32, 0.12); color: #ffe2a6; }
.tb-log small { display: block; color: var(--lp-t3); font-size: 10px; }
.tb-estados { display: inline-flex; gap: 6px; align-items: center; }
.tb-estados .lp-bt { height: 24px; padding: 0 8px; font-size: 11px; }
.tb-est { font-weight: 600; } .tb-est.on { color: #30d158; } .tb-est.disparada { color: #ff453a; } .tb-est.abierta { color: var(--lp-t2); }
.tb-led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #3a3a3c; vertical-align: 0; }
.tb-led.on { background: var(--c); box-shadow: 0 0 8px var(--c); }
.tb-motor { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); margin-bottom: 6px; }
.tb-motor b { display: block; font-size: 12.5px; } .tb-motor span { display: block; color: var(--lp-t2); font-size: 11.5px; margin: 2px 0 6px; }
.tb-motor .lp-bt { height: 24px; font-size: 11px; }
.tb-motor.gira .aspas { transform-origin: 20px 20px; animation: tb-gira 0.5s linear infinite; }
.tb-motor.gira.rev .aspas { animation-direction: reverse; }
@keyframes tb-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tb-motor.gira .aspas { animation-duration: 3s; } }

/* entrega final: hoja tipo documento */
.tb-entrega { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(10px); overflow: auto; font-family: Inter, system-ui, sans-serif; -webkit-user-select: text; user-select: text; }
.tb-entrega[hidden] { display: none; }
.tb-entrega .barra { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: rgba(22, 22, 23, 0.86); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255, 255, 255, 0.1); color: #f5f5f7; font-size: 13px; }
.tb-entrega .barra span { flex: 1; color: #a1a1a6; }
.tb-entrega .papel { max-width: 1060px; margin: 28px auto 60px; background: #fff; color: #1d1d1f; border-radius: 18px; padding: 48px 56px; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5); font-size: 13px; line-height: 1.45; }
.tb-entrega .portada { border-bottom: 2px solid #1d1d1f; padding-bottom: 22px; margin-bottom: 10px; }
.tb-entrega .marca-h { display: inline-flex; align-items: center; font: 600 22px Inter, sans-serif; letter-spacing: -0.045em; }
.tb-entrega .marca-h svg { margin: 0 -0.08em; transform: translateY(0.05em); }
.tb-entrega h1 { font-size: 34px; letter-spacing: -0.035em; margin: 14px 0 4px; } .tb-entrega .portada p { margin: 0; color: #6e6e73; }
.tb-entrega .hoja-t { padding-top: 28px; border-top: 1px solid #e5e5ea; margin-top: 28px; }
.tb-entrega .hoja-t:first-of-type { border-top: 0; }
.tb-entrega .hoja-t header { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.tb-entrega .hoja-t header small { color: #b4651f; font-weight: 600; } .tb-entrega h2 { font-size: 26px; letter-spacing: -0.03em; margin: 2px 0 0; }
.tb-entrega dl { display: grid; grid-template-columns: repeat(2, auto); gap: 4px 22px; margin: 0; font-size: 12px; } .tb-entrega dt { color: #86868b; } .tb-entrega dd { margin: 0; font-weight: 600; }
.tb-entrega h3 { font-size: 15px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.tb-entrega .unif { border: 1px solid #e5e5ea; border-radius: 12px; padding: 12px; overflow-x: auto; background: #fbfbfd; }
.tb-entrega table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tb-entrega th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: #6e6e73; border-bottom: 1.5px solid #1d1d1f; padding: 6px 6px; }
.tb-entrega td { border-bottom: 1px solid #e5e5ea; padding: 6px 6px; vertical-align: top; } .tb-entrega td.vacio { color: #86868b; }
.tb-entrega .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.tb-entrega .nota, .tb-entrega .aviso-h { color: #6e6e73; font-size: 11.5px; } .tb-entrega .aviso-h { margin-top: 30px; border-top: 1px solid #e5e5ea; padding-top: 14px; }
.tb-entrega .rev { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.tb-entrega .rev li { display: flex; gap: 10px; } .tb-entrega .rev b { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; background: #8e8e93; }
.tb-entrega .rev .ok b { background: #248a3d; } .tb-entrega .rev .err b { background: #d70015; } .tb-entrega .rev .av b { background: #c93400; }
.tb-entrega .rev small { display: block; color: #86868b; font-size: 11px; }
@media (max-width: 760px) { .tb-entrega .papel { padding: 26px 18px; margin: 12px; border-radius: 14px; } .tb-entrega table { font-size: 11px; display: block; overflow-x: auto; } }
.tb-mal { color: #ff453a; }
