/* Gemelo digital del abasto de medicamentos · © 2026 Gersain Barron · Licencia MIT */
/* CND · entradas y salidas (usa la base de unidad.css) */

.cn-scn-top { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; }
.f-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f-group > label { font-size: 12px; color: var(--muted); }
.f-group > label b { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 4px; }
.cn-time { flex: 1 1 280px; }
.cn-time input[type=range] { width: 100%; accent-color: var(--accent); }
.cn-jumps { display: flex; gap: 6px; }
.cn-jumps button { font-size: 12px; color: var(--muted); padding: 3px 9px; border-radius: 7px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.cn-jumps button:hover { color: var(--text); }
.cn-desc { font-size: 13px; line-height: 1.5; margin: 12px 0 0; }
.cn-params { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.cn-params summary { cursor: pointer; font-size: 13.5px; font-weight: 650; }
.cn-params summary small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.cn-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 18px; margin-top: 12px; }
.cn-p { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.cn-p .row { display: flex; justify-content: space-between; gap: 8px; }
.cn-p b { color: var(--text); font-variant-numeric: tabular-nums; }
.cn-p input[type=range] { width: 100%; accent-color: var(--accent); }
.cn-p select { height: 34px; }
.cn-p.chk { flex-direction: row; align-items: center; gap: 8px; padding-top: 14px; color: var(--text); }
.cn-p.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.cn-pfoot { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; font-size: 12.5px; }
.seg-btn { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.seg-btn.on { color: var(--accent); background: rgba(45,212,191,.16); }

.cn-3dtools { display: flex; gap: 8px; align-items: center; min-width: 0; max-width: 100%; }
.cn-scroll { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.cn-scroll::-webkit-scrollbar { display: none; }
.cn-3d { height: clamp(380px, 62vh, 680px); }
.cn-lg-sep { width: 1px; height: 12px; background: var(--line-strong); }
.c3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.c3-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text);
  background: rgba(13, 17, 23, 0.82); border: 1px solid var(--line-strong); padding: 4px 9px; border-radius: 9px; white-space: nowrap; pointer-events: auto; transition: opacity .2s; }
.c3-label i { width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex: none; }
.c3-label b { font-weight: 650; }
.c3-label span { color: var(--muted); font-variant-numeric: tabular-nums; }
.c3-label[data-sem=crit] { border-color: rgba(248,113,113,.7); }
.c3-label[data-sem=warn] { border-color: rgba(251,191,36,.55); }

.legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); } .dot.idle { background: #475569; }
.legend .mk { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid #e6edf3; display: inline-block; }
.sw.line { height: 3px; border-radius: 2px; }

.cn-flow { display: grid; grid-template-columns: 88px 1fr; gap: 10px; align-items: stretch; margin-bottom: 10px; }
.cn-flow-t { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); font-weight: 650; padding-top: 14px; }
.cn-stages { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.cn-stage { position: relative; flex: 1 0 118px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px 9px 13px; min-width: 0; }
.cn-stage::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: #475569; }
.cn-stage.ok::before { background: var(--ok); } .cn-stage.warn::before { background: var(--warn); } .cn-stage.crit::before { background: var(--crit); }
.cn-stage.crit { border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.07); }
.cn-stage.warn { border-color: rgba(251,191,36,.35); }
.cn-stage .n { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-stage b { display: block; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0 1px; }
.cn-stage b i { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.cn-stage small { display: block; font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.cn-stage.warn small { color: var(--warn); } .cn-stage.crit small { color: var(--crit); }
.cn-stage:hover { border-color: var(--line-strong); }
.cn-stage .arr { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 11px; z-index: 1; }
.cn-h3 { font-size: 14px; font-weight: 650; margin: 14px 0 8px; }
.cn-delays { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.cn-delay { display: grid; grid-template-columns: 10px 1fr auto; gap: 2px 10px; align-items: center; text-align: left; padding: 9px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.cn-delay:hover { border-color: var(--line-strong); }
.cn-delay .dot { grid-row: span 2; width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cn-delay b { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cn-delay em { font-style: normal; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cn-delay.crit em { color: var(--crit); } .cn-delay.warn em { color: var(--warn); }
.cn-delay small { grid-column: 2 / 4; font-size: 12px; color: var(--muted); }

.cn-gantt .row-l { fill: var(--muted); font-size: 11px; }
.cn-gantt .row-l.frio { fill: var(--info); }
.cn-gantt .bar:hover { opacity: .85; }
.cn-gantt .now { stroke: var(--accent); stroke-width: 1.5; }
.cn-gantt .closed { fill: rgba(148,163,184,.06); }
.chart .now { stroke: var(--accent); stroke-width: 1.5; }

.st-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: rgba(148,163,184,.12); }
.st-chip i { width: 7px; height: 7px; border-radius: 50%; }
td .late { color: var(--crit); font-weight: 650; } td .early { color: var(--info); }
tr.cur td { background: rgba(45,212,191,.07); }
.cmp td.best { color: var(--ok); font-weight: 650; } .cmp td.worst { color: var(--crit); font-weight: 650; }

.cn-defs p { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 0 0 8px; }
.cn-defs b { color: var(--text); }
.cn-defs a { color: var(--accent); }

@media (max-width: 1180px) { .cn-flow { grid-template-columns: 1fr; } .cn-flow-t { padding-top: 0; } }
@media (max-width: 760px) { .cn-3d { height: 420px; } .cn-stage { flex-basis: 108px; } }
.u3d-panel .r { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); padding: 3px 0; border-top: 1px solid var(--line); }
.u3d-panel .r:first-child { border-top: 0; }
.u3d-panel .r em { font-style: normal; color: var(--text); font-weight: 600; text-align: right; }
