/* Dark theme */
:root{
  --bg:#20272c; --panel:#252d33; --panel-lite:#2a333a; --border:#2f3941;
  --ink:#e6edf3; --muted:#94a3b8; --accent:#8BC34A; --accent-ink:#0f2610;
  --chip:#33424d; --ok:#10b981; --warn:#ef4444; --shadow:0 1px 0 rgba(0,0,0,.15), 0 10px 20px rgba(0,0,0,.15);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--ink);font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Arial}
.hero{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;padding:14px 20px;background:#20262b;border-bottom:1px solid var(--border)}
.brand{display:flex;align-items:center;gap:12px;margin:0 auto;font-weight:800}
.brand .the,.brand .game{font-size:22px;opacity:.9}
.brand .logo{width:28px;height:28px;filter:drop-shadow(0 2px 4px rgba(0,0,0,.4))}
.actions{position:absolute; right:20px; display:flex; gap:10px; align-items:center; color:var(--muted); font-size:14px}
.inline{display:inline-flex; gap:8px; align-items:center}

.container{max-width:1200px;margin:18px auto;padding:0 16px;display:grid;grid-template-columns:320px 1fr 1fr;gap:16px}
.panel{background:var(--panel);border:1px solid var(--border);border-radius:16px;padding:14px;box-shadow:var(--shadow)}
.panel-lite{background:var(--panel-lite);border:1px dashed var(--border);border-radius:14px;padding:10px}
.panel.span2{grid-column:span 2}
.section-title{font-size:14px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:0 0 8px}

.orderBox{display:flex;flex-direction:column;gap:12px;align-items:stretch}
.orderInput{width:100%;border:none;border-bottom:2px solid var(--border);background:transparent;color:var(--ink);font-size:68px;font-weight:700;padding:8px 4px;text-align:center;outline:none}
.orderInput::-webkit-outer-spin-button,.orderInput::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.btn{border:1px solid var(--border);background:transparent;color:var(--ink);padding:10px 14px;border-radius:12px;cursor:pointer}
.btn.ghost:hover{background:#293238}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:transparent;font-weight:800}
.btn.big{font-size:18px;padding:14px 16px;border-radius:14px}

.divider{height:1px;background:var(--border);margin:14px 0}
.meta{color:var(--muted);font-size:14px}
.sub{font-size:14px;color:var(--muted);margin:10px 0 8px}
.grid.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grid.two.slim input{margin-top:6px}
.grid.six{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.mt-6{margin-top:6px}
.mt-8{margin-top:16px}
.mt{margin-top:16px}
.center{text-align:center}
.small{font-size:12px}
.muted{color:var(--muted)}
input[type=number]{width:100%;padding:10px;border-radius:12px;border:1px solid var(--border);background:#1d2328;color:var(--ink)}

.pipeline.eight{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
@media (max-width:1024px){.container{grid-template-columns:1fr}.panel.span2{grid-column:span 1}.pipeline.eight{grid-template-columns:1fr 1fr}}

.pipe-col{display:flex;flex-direction:column;gap:8px}
.pipe-title{color:var(--muted);font-size:13px;font-weight:600;margin:0}
.numBox{background:linear-gradient(180deg,#2c343b,#22292f);border:1px solid var(--border);border-radius:10px;padding:10px 12px;width:100%;display:flex;align-items:center;justify-content:center}
.numBox span{font-size:36px;font-weight:800;color:#e8eef5;text-shadow:0 1px 0 rgba(0,0,0,.3)}
.numGhost{background:linear-gradient(180deg,#2a3137,#232a30);border:1px dashed var(--border);border-radius:10px;padding:10px 12px;width:100%;display:flex;align-items:center;justify-content:center}
.numGhost span{font-size:28px;font-weight:700;color:#c6d0da}

.tablewrap{overflow:auto;border:1px solid var(--border);border-radius:14px;background:var(--panel-lite)}
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{padding:10px 12px;border-top:1px solid var(--border);text-align:left}
th{color:var(--muted);font-weight:600}

.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.kpiBox{background:var(--panel-lite);border:1px solid var(--border);border-radius:12px;padding:10px}
.kpiBox .label{color:var(--muted);font-size:12px}
.kpiBox .value{font-size:22px;font-weight:800}

.charts{display:grid;grid-template-columns:2fr 1fr;gap:16px}
.panel.chart{background:#ffffff;color:#0f172a}
.panel.chart h3{margin:0 0 8px;font-size:16px}

.message{min-height:22px;color:#e5ffef}

/* Flow overlay */
.flow-ctx{position:relative}
#flowOverlay{position:absolute; inset:0; width:100%; height:100%; pointer-events:none}
.flow-tip{position:absolute; background:#111827; color:#e5e7eb; border:1px solid #374151; border-radius:8px; padding:6px 8px; font-size:12px; box-shadow:0 6px 16px rgba(0,0,0,.3); max-width:240px; z-index:4}
.flow-arrow{stroke:#9FB3C8; stroke-width:2; fill:none; transition:stroke .15s ease}
.flow-arrow.dashed{stroke-dasharray:6 4}
.flow-arrow.glow{stroke:#8BC34A}
.flow-hit{stroke:transparent; stroke-width:14; fill:none; pointer-events:stroke}
.pipe-col .numBox, .pipe-col .numGhost{transition:box-shadow .15s ease, transform .05s ease}
.pipe-col .numBox.glow, .pipe-col .numGhost.glow{box-shadow:0 0 0 2px #8BC34A inset, 0 0 0 2px rgba(139,195,74,.35)}

/* --- Hide arrow visuals, keep interactions (hit paths + tooltips) --- */
.flow-arrow{display:none !important;}


/* === Rediseño y alineación de las 8 secciones (pipeline.eight) === */
.pipeline.eight{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px;
  align-items:stretch;
}
@media (max-width:1280px){
  .pipeline.eight{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (max-width:980px){
  .pipeline.eight{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width:560px){
  .pipeline.eight{ grid-template-columns:1fr; }
}

.pipe-col{
  background: var(--panel-lite);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height: 140px;
}

.pipe-title{
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  min-height: 36px;
  display:flex;
  align-items:center;
  line-height:1.2;
}

.numBox, .numGhost{
  height: 72px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
}

.numBox span, .numGhost span{
  font-variant-numeric: tabular-nums;
}


/* === Toast/Modal Equilibrio === */
.toast{ position: fixed; inset: 0; display:flex; align-items:center; justify-content:center; background: rgba(0,0,0,.55); z-index: 9999; }
.toast.hidden{ display:none; }
.toast-card{ width:min(680px, 92vw); background: var(--surface, #0e0f12); color: var(--text, #e8e8e8);
  border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 20px 20px 16px; border: 1px solid rgba(255,255,255,.08); }
.toast-title{ margin:12px 0 4px; font-size: clamp(1.1rem, 2vw, 1.5rem); text-align:center; }
.toast-msg{ margin:0 0 12px; text-align:center; opacity:.9; }
.toast-img{ display:block; width:100%; height:auto; border-radius: 12px; }
.toast-actions{ display:flex; gap:12px; justify-content:center; margin-top: 8px; }
.toast-close{ position:absolute; right: 16px; top: 10px; background: transparent; border:0; color:inherit; font-size: 28px; cursor:pointer; }
.btn{ padding:.6rem 1rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); cursor:pointer; }
.btn-primary{ background: #2b8a3e; border-color: #2b8a3e; }

/* Emoji grande para el anuncio */
.toast-emoji{ font-size: clamp(48px, 9vw, 120px); text-align:center; line-height:1; margin-top: 4px; }


/* Canvas de confeti */
.confetti-canvas{ position: fixed; inset: 0; pointer-events:none; z-index: 10000; }
