/* ==========================================================================
   5 - DEMOS INTERACTIVOS  ·  mini-ERPs reales (inventario, tickets, dashboard)
   Los controla js/3-demos.js. Se ven como apps y guardan en el navegador.
   ========================================================================== */

.demos-lab{max-width:920px;margin:0 auto;display:flex;flex-direction:column;gap:28px}

.lab{background:var(--TARJETA);border:1px solid var(--BORDE);border-radius:var(--REDONDEO-TARJETA);overflow:hidden;box-shadow:var(--SOMBRA)}
.lab-cabeza{display:flex;align-items:center;gap:12px;padding:18px 20px;border-bottom:1px solid var(--BORDE)}
.lab-cabeza .ic{width:42px;height:42px;border-radius:12px;background:var(--AZUL-SUAVE);color:var(--AZUL);display:grid;place-items:center;font-size:20px;flex:none}
.lab-cabeza h3{font-size:18px}
.lab-cabeza p{font-size:13px;color:var(--TEXTO-SUAVE)}
.lab-cabeza .vivo{margin-left:auto;display:flex;align-items:center;gap:6px;font-size:12px;color:var(--TEXTO-TENUE)}
.lab-cabeza .vivo i{width:8px;height:8px;border-radius:50%;background:#28c840;animation:parpadeo 1.6s ease-in-out infinite}

/* --- Controles (formulario del demo) --- */
.lab-controles{display:flex;flex-wrap:wrap;gap:8px;padding:16px 20px;background:var(--FONDO-2)}
.lab-controles input{flex:1;min-width:90px;padding:10px 12px;border:1px solid var(--BORDE-FUERTE);border-radius:var(--REDONDEO-CHICO);background:var(--TARJETA);color:var(--TEXTO);font:inherit;font-size:14px}
.lab-controles input:focus{outline:none;border-color:var(--AZUL);box-shadow:0 0 0 3px var(--AZUL-SUAVE)}
.btn-mini{padding:10px 18px;border-radius:var(--REDONDEO-CHICO);background:var(--AZUL);color:#fff;border:0;font:inherit;font-weight:600;font-size:14px;cursor:pointer;transition:var(--SUAVE)}
.btn-mini:hover{background:var(--AZUL-OSCURO)}

/* --- KPIs --- */
.lab-kpis{display:flex;gap:10px;padding:16px 20px;flex-wrap:wrap}
.kpi{flex:1;min-width:96px;background:var(--AZUL-SUAVE);border-radius:12px;padding:10px 14px}
.kpi small{display:block;font-size:11px;color:var(--TEXTO-SUAVE);text-transform:uppercase;letter-spacing:.04em;margin-bottom:2px}
.kpi b{font-family:var(--LETRA-TITULOS);font-size:20px;font-weight:600;color:var(--TEXTO)}

/* --- Tabla --- */
.tabla-demo{width:100%;border-collapse:collapse;font-size:14px}
.tabla-demo th,.tabla-demo td{text-align:left;padding:11px 20px;border-top:1px solid var(--BORDE)}
.tabla-demo th{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--TEXTO-TENUE);font-weight:600}
.tabla-demo td.num,.tabla-demo th.num{text-align:right;font-variant-numeric:tabular-nums}
.acc{display:inline-flex;gap:5px}
.acc button{width:28px;height:28px;border-radius:8px;border:1px solid var(--BORDE-FUERTE);background:var(--TARJETA);color:var(--TEXTO);cursor:pointer;font-size:15px;line-height:1;transition:var(--SUAVE)}
.acc button:hover{border-color:var(--AZUL);color:var(--AZUL)}
.badge-bajo{font-size:10px;padding:2px 8px;border-radius:100px;background:rgba(229,72,77,.15);color:#e5484d;margin-left:6px;font-weight:600}
.vacio{padding:24px 20px;color:var(--TEXTO-TENUE);font-size:14px;text-align:center}

/* --- Cronómetro tickets --- */
.timer{font-variant-numeric:tabular-nums;font-family:var(--LETRA-TITULOS);font-size:15px}
.timer.corriendo{color:var(--AZUL)}
.pill-estado{font-size:11px;padding:3px 10px;border-radius:100px;font-weight:600}
.pill-estado.abierto{background:rgba(31,154,214,.15);color:var(--AZUL)}
.pill-estado.cerrado{background:rgba(40,200,64,.15);color:#1a8a3a}

/* --- Barras del dashboard --- */
.barra-cc{display:flex;align-items:center;gap:12px;padding:10px 20px;border-top:1px solid var(--BORDE)}
.barra-cc .et{width:120px;font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.barra-cc .tr{flex:1;height:11px;background:var(--BORDE);border-radius:100px;overflow:hidden}
.barra-cc .tr i{display:block;height:100%;background:var(--AZUL);border-radius:100px;transition:width .5s ease}
.barra-cc .tr i.neg{background:#e5484d}
.barra-cc .vl{width:110px;text-align:right;font-size:13px;font-variant-numeric:tabular-nums;font-weight:500}

@media (max-width:600px){
  .lab-controles input{min-width:calc(50% - 4px)}
  .tabla-demo th:nth-child(3),.tabla-demo td:nth-child(3){display:none}
  .barra-cc .et{width:80px}.barra-cc .vl{width:84px}
}
