/* ════════ Simulador v5 · adiciones (usa v3.css + v4.css) ════════ */
/* fixes de layout: nada envuelve, el stepper scrollea si no cabe */
.btn, .vista-toggle button, .est-toggle button, .uni-toggle button, .f-chip, .chip { white-space: nowrap; }
.fases { overflow-x: auto; scrollbar-width: none; }
.fases::-webkit-scrollbar { display: none; }
.fases .fase { flex-shrink: 0; }
.fases .fase .t b, .fases .fase .t span { white-space: nowrap; }
.fases .ctx { flex-shrink: 0; position: sticky; right: 0; background: var(--card); padding-left: 10px; }
@media (max-width: 1240px) {
  .ticker .tk:nth-child(n+4), .ticker .sep:nth-child(n+3) { display: none; }
}
@media (max-width: 1080px) {
  .fases .fase .t span { display: none; }
  .ticker .tk:nth-child(n+2), .ticker .sep { display: none; }
}

/* Ticker de precio en vivo (observación NexaFab: precio siempre visible) */
.ticker { display: flex; align-items: center; gap: 14px; background: #191919; border: 1px solid #2a2a2a; border-radius: 9px; padding: 6px 14px; }
.ticker .tk { text-align: right; }
.ticker .tk .l { font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--txt4); }
.ticker .tk .v { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.ticker .tk .v.dim { color: var(--txt3); font-size: 12px; }
.ticker .sep { width: 1px; height: 24px; background: #2a2a2a; }

/* Comparativa de mercado (réplica ComparativaCompetencia.tsx) */
.comp-row { display: grid; grid-template-columns: 1.4fr 110px 120px 110px 34px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed #262626; }
.comp-row input[type=text] { background: var(--input); border: 1px solid var(--input-line); border-radius: 6px; padding: 7px 9px; font: inherit; font-size: 12px; color: #fff; outline: none; }
.comp-row input:focus { border-color: var(--gold); }
.comp-row .tar { display: flex; align-items: center; gap: 5px; }
.comp-row .tar span { font-size: 10px; color: var(--txt4); }
.comp-row .tar input { width: 100%; background: var(--input); border: 1px solid var(--input-line); border-radius: 6px; padding: 7px 9px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: #fff; text-align: right; outline: none; }
.uni-toggle { display: inline-flex; background: var(--input); border: 1px solid var(--input-line); border-radius: 7px; padding: 2px; gap: 2px; }
.uni-toggle button { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 9px; padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--txt3); cursor: pointer; }
.uni-toggle button.sel { background: var(--gold); color: #1F1F1F; font-weight: 700; }
.comp-bars { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.comp-bar { display: flex; align-items: center; gap: 10px; }
.comp-bar .lbl { font-size: 11px; width: 130px; color: var(--txt2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-bar .lbl.us { color: var(--gold); font-weight: 700; }
.comp-bar .track { flex: 1; height: 22px; background: var(--card2); border-radius: 5px; overflow: hidden; }
.comp-bar .fill { height: 100%; border-radius: 5px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; background: #3a3a3a; min-width: 8%; }
.comp-bar .fill.us { background: var(--gold); }
.comp-bar .fill span { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--txt2); font-variant-numeric: tabular-nums; }
.comp-bar .fill.us span { color: #1F1F1F; font-weight: 700; }
.pos-line { font-size: 11.5px; line-height: 1.7; }
.pos-line.arriba { color: #e8c87a; } .pos-line.abajo { color: #9ee6a8; } .pos-line.nivel { color: var(--txt3); }

/* mini resumen DXF dentro de la partida (paso 2) */
.hoja-nest { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px dashed #2a2a2a; }
.hoja-nest label { font-size: 10px; color: var(--txt4); display: block; margin-bottom: 6px; }
.hoja-nest label .why { color: #666; font-size: 8.5px; margin-left: 5px; }
.hoja-nest .chips .chip input { width: 44px; background: #1a1a1a; border: 1px solid var(--input-line); border-radius: 4px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 10px; text-align: right; padding: 2px 4px; outline: none; }
.hoja-nest .chips .chip input:focus { border-color: var(--gold); }
.hn-params .hn-fields { display: flex; gap: 10px; }
.hn-f { display: inline-flex; align-items: center; gap: 5px; }
.hn-f em { font-style: normal; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt4); text-transform: uppercase; letter-spacing: 0.05em; }
.hn-f input { width: 46px; background: var(--input); border: 1px solid var(--input-line); border-radius: 5px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: right; padding: 4px 6px; outline: none; }
.hn-f input:focus { border-color: var(--gold); }

/* Velocidad: fila de chips (sección A) */
.vel-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px dashed #2a2a2a; }
.vel-row .vl { font-size: 10px; color: var(--txt4); margin-right: 3px; white-space: nowrap; }
.vel-row .chip { font-size: 9.5px; }
.vel-row .chip.vel-man { display: inline-flex; align-items: center; gap: 6px; }
.vel-row .chip.vel-man input { width: 46px; background: #1a1a1a; border: 1px solid var(--input-line); border-radius: 4px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; text-align: right; padding: 2px 5px; outline: none; }
.vel-row .chip.vel-man.sel input { border-color: var(--gold); }

/* Lead card: grupos + análisis IA */
.lead-grp { margin-bottom: 13px; }
.lg-t { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.16em; color: var(--txt4); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.lg-t::after { content: ''; flex: 1; border-top: 1px dashed #262626; }
.ia-box { margin-top: 12px; background: rgba(189,167,108,.05); border: 1px solid rgba(189,167,108,.25); border-radius: 9px; padding: 10px 12px; }
.ia-box .ia-t { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.15em; color: var(--gold); margin-bottom: 6px; }
.ia-box .ia-sec { font-size: 9.5px; color: var(--txt4); margin: 7px 0 3px; font-weight: 600; }
.ia-box .ia-line { font-size: 11px; line-height: 1.55; color: var(--txt3); }
.ia-box .ia-line.ok { color: var(--txt2); }
.ia-box .ia-line.ask { color: var(--amber); }

/* Screenshot del requerimiento (paso 1) */
.nota-img { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 10px; }
.nota-img img { max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }

/* Modalidad + fee + reposición */
.chip.mod { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px 15px; text-align: left; line-height: 1.25; }
.chip.mod b { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; }
.chip.mod small { font-family: 'JetBrains Mono', monospace; font-size: 8px; opacity: .7; }
.fee-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 10px; padding-top: 9px; border-top: 1px dashed #2a2a2a; }
.fee-row .vl { font-size: 10px; color: var(--txt4); white-space: nowrap; }
.fee-row .hn-f input { width: 64px; }
/* Fee card (más visible) */
.fee-card { margin-top: 12px; background: rgba(189,167,108,.05); border: 1px solid rgba(189,167,108,.3); border-radius: 10px; padding: 11px 13px; }
.fee-card .fc-t { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.13em; color: var(--gold); font-weight: 600; margin-bottom: 9px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fee-card .fc-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.fee-card .fc-row .hn-f input { width: 72px; }
.fee-card .fc-nota { flex: 1; min-width: 180px; background: var(--input); border: 1px solid var(--input-line); border-radius: 6px; padding: 7px 10px; font: inherit; font-size: 11.5px; color: #fff; outline: none; }
.fee-card .fc-nota:focus { border-color: var(--gold); }
.fee-card .fc-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed rgba(189,167,108,.18); font-size: 11.5px; }
.fee-card .fc-item .num { font-family: 'JetBrains Mono', monospace; color: var(--gold); font-weight: 600; min-width: 64px; }
.fee-card .fc-item .fc-nota-t { flex: 1; color: var(--txt3); }
.fee-card .fc-tot { margin-top: 8px; font-size: 10.5px; color: var(--txt3); text-align: right; }
.fee-card .fc-tot b { color: var(--gold); font-family: 'JetBrains Mono', monospace; }
.repo-ctl { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 11px; color: var(--txt3); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed #262626; }
.repo-ctl input { width: 52px; background: var(--input); border: 1px solid var(--input-line); border-radius: 5px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: right; padding: 4px 6px; outline: none; }
.repo-ctl input:focus { border-color: var(--gold); }

/* Escalado del diseño (sección A) */
.vel-row .suf, .dxf-scale .suf, .sin-dxf .suf, .hn-fields .suf, .chips .suf, .fee-row .suf, .fee-card .suf, .var-off .suf, .var-h .suf, .var-f .suf, .tf-bar .suf, .tf-cal .suf, .tf-foot .suf { font-size: 9px; color: #666; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em; }
.dxf-scale { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 10px; background: #191919; border: 1px solid #242424; border-radius: 8px; padding: 8px 11px; }
.dxf-scale .vl { font-size: 10px; color: var(--txt3); white-space: nowrap; font-weight: 600; }
.dxf-scale .hn-f input { width: 56px; }

/* Pills 1×4 + análisis del diseño */
.dxf-pills { grid-template-columns: repeat(4, 1fr) !important; }
.dxf-resumen { margin-top: 10px; background: rgba(189,167,108,.04); border: 1px solid rgba(189,167,108,.18); border-radius: 8px; padding: 10px 12px; }
.dxf-resumen .an-t { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.16em; color: var(--gold); margin-bottom: 6px; }
.dxf-resumen .an-line { font-size: 11px; color: var(--txt3); line-height: 1.6; padding: 1.5px 0; }
.dxf-resumen .an-line b { color: var(--txt2); font-weight: 600; }

/* Zoom del diseño */
.dxf-canvas { cursor: zoom-in; }
.dxf-zoomic { position: absolute; top: 8px; right: 10px; font-size: 12px; color: var(--txt4); }
.dxf-canvas:hover .dxf-zoomic { color: var(--gold); }
.dxfzoom { width: min(1000px, 94vw); background: var(--card); border: 1px solid #333; border-radius: 14px; padding: 16px 20px 20px; }
.dxfzoom .dz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; font-family: 'JetBrains Mono', monospace; color: var(--txt2); }
.dxfzoom .dz-meta .dz-fn { display: inline-block; background: rgba(189,167,108,.14); border: 1px solid rgba(189,167,108,.4); border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600; color: var(--gold); margin-bottom: 5px; }
.dxfzoom .dz-meta .dz-ln { font-size: 10px; color: var(--txt3); line-height: 1.55; }
.dxfzoom .dz-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dxfzoom .dz-leg-v { display: flex; flex-direction: column; gap: 4px; font-size: 10px; }
.dxfzoom .dz-leg-v .lg { display: inline-flex; align-items: center; gap: 6px; color: var(--txt3); white-space: nowrap; }
.dxfzoom .dz-leg-v .ln { width: 16px; height: 0; border-top: 2px solid; }
.dxfzoom .dz-leg-v .ln.ext { border-color: #CFCFCF; }
.dxfzoom .dz-leg-v .ln.int { border-color: var(--gold); }
.dxf-alert { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(251,191,36,.09); border: 1px solid rgba(251,191,36,.4); border-radius: 9px; padding: 9px 12px; font-size: 11px; color: var(--amber); line-height: 1.5; margin-bottom: 10px; }
.dxf-alert b { color: #f0d78a; font-weight: 700; }
.dxf-fitbtn { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.03em; padding: 6px 11px; border-radius: 6px; background: var(--gold); color: #1F1F1F; border: 0; cursor: pointer; white-space: nowrap; font-weight: 700; }
.dxf-fitbtn:hover { background: #cbb87e; }
.dxfzoom .dz-canvas { background: radial-gradient(circle at 50% 40%, #1a1a17 0%, #121212 75%); border: 1px solid rgba(189,167,108,.25); border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 20px; background-image: linear-gradient(#ffffff05 1px, transparent 1px), linear-gradient(90deg, #ffffff05 1px, transparent 1px); background-size: 24px 24px; }
.dxfzoom .dz-canvas svg { filter: drop-shadow(0 0 8px rgba(189,167,108,.3)); max-width: 100%; height: auto; }
.dz-viewport { overflow: hidden; border-radius: 10px; touch-action: none; }
.dz-viewport .dz-canvas { transform-origin: center center; transition: transform .04s linear; }
.dz-tip { text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--txt4); margin-top: 8px; letter-spacing: 0.04em; }
.mb-nestwrap { display: flex; flex-direction: column; gap: 6px; }
.nest-nav { display: flex; align-items: center; gap: 8px; }
.nest-arrow { width: 24px; height: 24px; border-radius: 6px; background: var(--input); border: 1px solid var(--input-line); color: var(--txt2); cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.nest-arrow:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.nest-arrow:disabled { opacity: .3; cursor: default; }
.nest-hojas { display: flex; gap: 4px; }
.nest-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--input-line); cursor: pointer; }
.nest-dot.on { background: var(--gold); }
.nest-lbl { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt3); margin-left: auto; }
.mb-cap { display: flex; flex-direction: column; gap: 5px; font-size: 10px; color: var(--txt3); line-height: 1.5; }
.mb-cap .cap-l b { color: var(--txt2); }
.mb-cap .cap-leg { display: flex; gap: 12px; flex-wrap: wrap; }
.mb-cap .lgi { display: inline-flex; align-items: center; gap: 5px; }
.mb-cap .sw { width: 12px; height: 10px; border-radius: 2px; display: inline-block; }
.mb-cap .sw.grey { background: #c9c9c9; } .mb-cap .sw.gold { background: var(--gold); }
.mb-cap .sw.hatch { background: repeating-linear-gradient(45deg, #241d12, #241d12 2px, rgba(251,191,36,.4) 2px, rgba(251,191,36,.4) 4px); }
.mb-cap .sw.dash { background: transparent; border: 1px dashed rgba(251,191,36,.6); }
.nz-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.nz-lbl { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt2); min-width: 160px; text-align: center; }
.nz-canvas { padding: 8px; }
/* Toggle dossier a mitad — armónico bajo la grilla de específicos */
.dossier-split { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding: 9px 11px; border: 1px dashed var(--input-line); border-radius: 8px; cursor: pointer; font-size: 11px; color: var(--txt3); line-height: 1.4; }
.dossier-split:hover { border-color: rgba(189,167,108,.5); }
.dossier-split.on { border-style: solid; border-color: rgba(189,167,108,.5); background: rgba(189,167,108,.06); color: var(--txt2); }
.dossier-split input { accent-color: var(--gold); flex-shrink: 0; }
.dossier-split b { color: var(--gold); }
.esp-sec { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.16em; color: var(--gold); margin: 14px 0 7px; padding-bottom: 4px; border-bottom: 1px solid rgba(189,167,108,.18); }
.esp-sec:first-of-type { margin-top: 8px; }
.pin-fields { align-items: end; }
.pin-fields .fld label { min-height: 30px; display: flex; flex-direction: column; justify-content: flex-end; }
.pin-fields .fld input { width: 100%; }

/* Chips de hoja (sección B) */
.chip-hoja { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 13px; line-height: 1.2; }
.chip-hoja b { font-size: 10.5px; font-weight: 700; }
.chip-hoja small { font-family: 'JetBrains Mono', monospace; font-size: 8px; opacity: .75; display: inline-flex; align-items: center; gap: 3px; }
.chip-hoja.custom small input { width: 40px; background: #1a1a1a; border: 1px solid var(--input-line); border-radius: 4px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 9px; text-align: right; padding: 1px 4px; outline: none; }
.chip-hoja.custom.sel small input { border-color: var(--gold); }

/* Análisis lateral (fila material) como definición */
.mc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3.5px 0; border-bottom: 1px dashed #242424; }
.mc-row:last-child { border-bottom: 0; }
.mc-row .k { font-size: 10px; color: var(--txt4); white-space: nowrap; }
.mc-row .v { font-size: 11.5px; color: var(--txt2); text-align: right; font-variant-numeric: tabular-nums; }
.mc-row .v b { color: #fff; }
.mc-row.hero { margin-top: 3px; padding-top: 6px; border-top: 1px solid #2a2a2a; border-bottom: 0; }
.mc-row.hero .k { color: var(--txt3); font-weight: 600; }
.mc-row.hero .v b { color: var(--gold); font-family: 'JetBrains Mono', monospace; font-size: 13px; }

/* Panel de merma (separado del análisis de costo) */
.merma-box { margin-top: 11px; background: rgba(251,191,36,.04); border: 1px dashed rgba(251,191,36,.3); border-radius: 8px; padding: 9px 11px; }
.merma-box .mb-t { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.16em; color: var(--amber); margin-bottom: 7px; }
.doc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 12px; }
.doc-actions .note { font-size: 9.5px; color: var(--txt4); line-height: 1.5; flex: 1; min-width: 220px; }
/* ── Identificación: origen del requerimiento ── */
.origen-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.origen-row .chip { padding: 9px 12px; }
.nota-chip { position: relative; flex: none; }
.nota-chip img { height: 46px; max-width: 120px; object-fit: cover; border-radius: 7px; border: 1px solid #3a3a3a; display: block; cursor: zoom-in; }
.nota-chip button { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; background: #2a2a2a; border: 1px solid #444; color: var(--txt3); font-size: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.nota-chip button:hover { color: var(--red); border-color: var(--red); }
.ask-box { margin-top: 12px; border-top: 1px dashed #2a2a2a; padding-top: 10px; }
.ask-t { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: 0.14em; color: var(--txt4); margin-bottom: 7px; }
/* Corte láser: línea de velocidad monoespaciada (consistente con su entorno) */
.vel-read { margin: 6px 0 0; font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.04em; line-height: 1.5; color: var(--txt3); }
.vel-read b { color: var(--txt2); }
/* Pintura por partida: reservar altura de etiqueta para que los inputs queden alineados (no escalonados) */
.pin-part .inline-fields .fld label { min-height: 26px; }

/* Origen del requerimiento: "tres cosas" en bullets numerados */
.orig-tres { margin: 8px 0 12px; display: flex; flex-direction: column; gap: 7px; }
.orig-tres .ot-line { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--txt3); line-height: 1.4; }
.orig-tres .ot-n { flex: none; color: var(--gold); font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; min-width: 12px; }
/* Caja "Por preguntar al lead" con contador + viñetas */
.ask-box2 { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.ask-box2 .ask2-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.ask-box2 .ask2-t { font-size: 12.5px; font-weight: 700; color: var(--txt); }
.ask-box2 .ask2-n { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--txt3); background: var(--input, rgba(255,255,255,.05)); border: 1px solid var(--line); border-radius: 50%; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.ask-box2 .ask2-line { font-size: 12px; color: var(--txt3); line-height: 1.5; padding: 3px 0 3px 16px; position: relative; }
.ask-box2 .ask2-line::before { content: '•'; position: absolute; left: 2px; color: var(--gold); }
.ask-box2 .ask2-line.ok { color: var(--green); padding-left: 0; }
.ask-box2 .ask2-line.ok::before { content: ''; }
/* ── Resumen de costos por categoría ── */
.wf-row.grp { margin-top: 8px; }
.wf-row.grp .k { text-transform: uppercase; font-size: 9.5px; letter-spacing: 0.1em; color: var(--txt3); font-weight: 700; }
.wf-row.grp .n { font-weight: 700; }
/* ── Agente CorteClaro (chat) ── */
#cc-fab { position: fixed; right: 20px; bottom: 84px; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: #1F1F1F; border: 0; font-size: 19px; cursor: pointer; z-index: 85; box-shadow: 0 8px 24px -8px rgba(189,167,108,.55); transition: transform .2s ease, box-shadow .25s ease, right .3s cubic-bezier(.22,1,.36,1); }
#cc-fab:hover { transform: scale(1.08); }
/* Panel acoplado a la derecha: EMPUJA el contenido en lugar de taparlo */
#cc-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 85vw; background: var(--card); border-left: 1px solid #333; z-index: 60; display: flex; flex-direction: column; overflow: hidden; box-shadow: -18px 0 48px -28px rgba(0,0,0,.8); animation: ccSlideIn .3s cubic-bezier(.22,1,.36,1); }
#cc-panel[hidden] { display: none; }
@keyframes ccSlideIn { from { transform: translateX(100%); } to { transform: none; } }
body.cc-open { padding-right: 340px; transition: padding-right .3s cubic-bezier(.22,1,.36,1); }
body.cc-open .gatebar { right: 340px; }
/* con el panel abierto, el ✦ no desaparece: se recorre junto al panel y
   sirve para colapsarlo (el mismo botón abre y cierra) */
body.cc-open #cc-fab { right: 360px; z-index: 61; }
body.cc-open .modal-back { right: 340px; }
.cc-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: var(--card2); border-bottom: 1px solid var(--line); }
.cc-head .cc-t { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; color: var(--gold); font-weight: 700; white-space: nowrap; flex: 0 0 auto; }
.cc-head .cc-s { font-size: 9px; color: var(--txt4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cc-ic { background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--txt4); width: 24px; height: 24px; cursor: pointer; font-size: 11px; flex: 0 0 auto; }
.cc-ic:hover { color: var(--gold); border-color: var(--input-line); }
.cc-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.cc-m { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 12px; line-height: 1.55; overflow-wrap: break-word; }
.cc-m.user { align-self: flex-end; background: rgba(189,167,108,.16); border: 1px solid rgba(189,167,108,.3); color: #f0e9d8; border-bottom-right-radius: 4px; }
.cc-m.agent { align-self: flex-start; background: #222; border: 1px solid #2e2e2e; color: var(--txt2); border-bottom-left-radius: 4px; }
.cc-m.typing { display: flex; gap: 4px; padding: 12px 14px; }
.cc-m.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--txt4); animation: ccDot 1.2s ease-in-out infinite; }
.cc-m.typing span:nth-child(2) { animation-delay: .18s; }
.cc-m.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes ccDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.cc-empty { font-size: 11px; color: var(--txt4); line-height: 1.6; padding: 8px; }
.cc-input { display: flex; gap: 8px; padding: 10px 14px 6px; border-top: 1px solid var(--line); }
.cc-input textarea { flex: 1; resize: none; background: var(--input); border: 1px solid var(--input-line); border-radius: 9px; color: #fff; font: inherit; font-size: 12px; padding: 9px 11px; outline: none; max-height: 90px; }
.cc-input textarea:focus { border-color: var(--gold); }
.cc-input .btn { padding: 8px 14px; }
/* biblioteca de preguntas verificadas — dropdown bajo la barra de escritura */
.cc-lib { padding: 0 14px 12px; }
.cc-lib select { width: 100%; background: var(--input); border: 1px solid var(--input-line); border-radius: 9px; color: var(--txt3); font: inherit; font-size: 11px; padding: 7px 10px; outline: none; cursor: pointer; appearance: auto; }
.cc-lib select:hover, .cc-lib select:focus { border-color: var(--gold); color: #f0e9d8; }
.cc-lib select optgroup { font-size: 10px; color: var(--txt4); background: #1c1c1e; font-style: normal; }
.cc-lib select option { color: var(--txt2); background: #1c1c1e; font-size: 12px; }
/* ── 🔒 Puerta de login del ERP ── */
.login-wrap { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.login-card { width: min(400px, 94vw); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.login-logo { height: 36px; align-self: flex-start; }
.login-card h1 { margin: 4px 0 0; font-size: 21px; letter-spacing: -0.01em; }
.login-sub { font-size: 12px; color: var(--txt3); line-height: 1.55; margin-bottom: 4px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--txt3); }
.login-card input { background: var(--input); border: 1px solid var(--input-line); border-radius: 9px; color: #fff; font: inherit; font-size: 13px; padding: 10px 12px; outline: none; }
.login-card input:focus { border-color: var(--gold); }
.login-card .btn { margin-top: 4px; padding: 11px; font-size: 13px; }
.login-status { font-size: 11px; min-height: 15px; }
.login-adv { font-size: 11px; color: var(--txt4); }
.login-adv summary { cursor: pointer; }
.login-adv label { margin-top: 8px; }
.login-adv input { font-size: 11px; font-family: 'JetBrains Mono', monospace; }
.login-local { font-size: 10px; color: var(--txt4); text-align: center; cursor: pointer; margin-top: 2px; }
.login-local:hover { color: var(--gold); }

/* ── 🏠 Inicio · dashboard "Hoy" ── */
.ini-hero { display: flex; align-items: flex-end; gap: 16px; margin: 4px 0 22px; }
.ini-hero .grow, .ini-card .grow, .ini-row .grow, .ini-head .grow { flex: 1; }
.ini-fecha { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.ini-saludo { margin: 3px 0 0; font-size: 27px; font-weight: 700; letter-spacing: -0.02em; color: var(--txt1); }
.ini-sub2 { font-size: 12px; color: var(--txt4); margin-top: 5px; }
.ini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
@media (max-width: 980px) { .ini-grid { grid-template-columns: 1fr; } }
.ini-card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: border-color .15s ease, transform .15s ease; display: flex; flex-direction: column; gap: 8px; min-height: 290px; }
.ini-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--ini-acc, transparent); opacity: .75; }
.ini-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.ini-a-gold { --ini-acc: var(--gold); }
.ini-a-blue { --ini-acc: #7c9fd4; }
.ini-a-teal { --ini-acc: #6ec7b0; }
.ini-a-gold .ini-ico { background: rgba(189,167,108,.13); }
.ini-a-blue .ini-ico { background: rgba(124,159,212,.13); }
.ini-a-teal .ini-ico { background: rgba(110,199,176,.13); }
.ini-head { display: flex; align-items: center; gap: 9px; }
.ini-ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.05); font-size: 15px; flex: 0 0 auto; }
.ini-t { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt3); font-weight: 700; }
.ini-go { color: var(--txt4); font-size: 13px; }
.ini-card:hover .ini-go { color: var(--gold); }
/* métrica hero: MISMO tamaño y ritmo en las 4 tarjetas */
.ini-big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ini-big.gold { color: var(--gold); }
.ini-big.teal { color: var(--teal, #6ec7b0); }
.ini-big.blue { color: #7c9fd4; }
.ini-big.dim2 { color: var(--txt2); }
.ini-sub { font-size: 10px; color: var(--txt4); margin: 0 0 4px; line-height: 1.45; min-height: 15px; }
.ini-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 0; border-top: 1px dashed rgba(255,255,255,.06); min-height: 29px; }
.ini-row .folio { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--txt3); flex: 0 0 auto; min-width: 96px; }
.ini-cli { color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.ini-warn { color: var(--gold); font-size: 11px; }
.ini-bad { color: var(--red); font-size: 11px; font-weight: 600; }
.ini-dim { color: var(--txt4); font-size: 11px; }
.ini-mas { font-size: 10px; color: var(--txt4); padding-top: 4px; }
.ini-vacio { font-size: 11px; color: var(--txt4); line-height: 1.5; padding: 8px 0; }
.ini-link { border-radius: 7px; margin: 0 -6px; padding-left: 6px; padding-right: 6px; }
.ini-link:hover { background: rgba(255,255,255,.045); }
.ini-est { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: .08em; padding: 2px 7px; border-radius: 20px; border: 1px solid var(--c, var(--txt4)); color: var(--c, var(--txt4)); white-space: nowrap; }
.ini-alerta { color: var(--amber, #f59e0b); font-size: 11px; font-weight: 600; }
/* bitácora de seguimiento */
.bit-modal .bit-lista { display: flex; flex-direction: column; gap: 8px; max-height: 44vh; overflow-y: auto; margin-bottom: 12px; }
.bit-item { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 9px; }
.bit-tipo { font-size: 14px; }
.bit-txt { font-size: 12px; color: var(--txt2); line-height: 1.5; }
.bit-meta { font-size: 10px; color: var(--txt4); margin-top: 2px; }
.bit-form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.bit-form select, .bit-form input { background: var(--input); border: 1px solid var(--input-line); border-radius: 8px; color: #fff; font: inherit; font-size: 12px; padding: 8px 10px; outline: none; }
.bit-form select:focus, .bit-form input:focus { border-color: var(--gold); }

/* ── 📋 Debrief de cierre (Producción) ── */
.dbf-modal .dbf-form { display: flex; flex-direction: column; gap: 10px; }
.dbf-modal label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--txt3); }
.dbf-modal .dbf-hint { color: var(--txt4); font-size: 10px; }
.dbf-modal input, .dbf-modal textarea { background: var(--input); border: 1px solid var(--input-line); border-radius: 8px; color: #fff; font: inherit; font-size: 12px; padding: 8px 10px; outline: none; }
.dbf-modal input:focus, .dbf-modal textarea:focus { border-color: var(--gold); }
.dbf-modal .dbf-row2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.dbf-modal .pm-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.otp-debrief { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.otp-debrief .k { color: var(--txt4); font-size: 10px; display: inline-block; min-width: 78px; }
.otp-debrief .dbf-nota { font-size: 11px; color: var(--txt3); line-height: 1.5; padding: 6px 8px; background: rgba(189,167,108,.06); border-radius: 7px; border: 1px dashed rgba(189,167,108,.25); }
.dbf-good { color: var(--green); }
.dbf-bad { color: var(--red); }

/* ── 🩺 Revisión de consistencia (Finanzas) ── */
#fin-audit { margin-bottom: 14px; }
#fin-audit:empty { margin-bottom: 0; }
.aud-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); border-left-width: 3px; font-size: 12px; }
.aud-item b { font-weight: 600; }
.aud-item span { font-size: 11px; color: var(--txt3); line-height: 1.5; }
.aud-item.error { border-left-color: var(--red); background: rgba(220,80,80,.06); }
.aud-item.aviso { border-left-color: var(--gold); background: rgba(189,167,108,.05); }

/* ── Variantes de medidas (matriz → réplicas) ── */
.var-off { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 9px; border-top: 1px dashed #2a2a2a; }
.nota-cot { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.nota-cot .vl { font-size: 10px; color: var(--txt4); white-space: nowrap; }
.nota-cot input { flex: 1; background: var(--input); border: 1px solid var(--input-line); border-radius: 6px; padding: 7px 10px; font: inherit; font-size: 11.5px; color: #fff; outline: none; }
.var-box { margin-top: 10px; border: 1px solid rgba(189,167,108,.28); background: rgba(189,167,108,.04); border-radius: 10px; padding: 10px 12px; }
.var-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.var-h .vt { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.12em; color: var(--gold); font-weight: 700; white-space: nowrap; }
.var-row { display: flex; align-items: center; gap: 7px; padding: 4px 0; border-bottom: 1px dashed rgba(189,167,108,.15); }
.var-row .vid { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt4); width: 20px; flex: none; }
.var-row input { background: var(--input); border: 1px solid var(--input-line); border-radius: 5px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 5px 7px; outline: none; text-align: right; width: 72px; flex: none; }
.var-row input:focus { border-color: var(--gold); }
.var-row .x { color: var(--txt4); font-size: 10px; flex: none; }
.var-row .vc { width: 46px; }
.var-row .va { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--txt3); min-width: 128px; flex: none; }
.var-row .vn { flex: 1; width: auto; min-width: 120px; text-align: left; font-family: 'Manrope', sans-serif; }
.var-f { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.var-f .suf { color: var(--gold); }
/* ── Trazado desde foto ── */
.tf-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tf-stage { overflow: auto; border: 1px solid #3a3a3a; border-radius: 10px; max-height: 55vh; background: #141414; }
.tf-wrap { position: relative; }
.tf-wrap img { width: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.tf-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.tf-hint { font-size: 10.5px; color: var(--txt4); margin-top: 8px; line-height: 1.5; }
.tf-hint.cal { color: #e8c87a; background: rgba(189,167,108,.07); border: 1px solid rgba(189,167,108,.3); border-radius: 8px; padding: 7px 10px; }
.tf-cal { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--txt3); }
.tf-cal input { width: 76px; background: var(--input); border: 1px solid var(--input-line); border-radius: 6px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; text-align: right; padding: 6px 8px; outline: none; }
.tf-cal input:focus { border-color: var(--gold); }
.tf-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.tf-foot .warn-t { font-size: 9.5px; color: var(--txt4); flex: 1; line-height: 1.5; }
.tf-drop { border: 1.5px dashed var(--input-line); border-radius: 12px; padding: 44px 16px; text-align: center; color: var(--txt4); font-size: 12px; cursor: pointer; line-height: 1.8; }
.tf-drop:hover { border-color: var(--gold); color: var(--gold); }
.pa-drop { border: 1.5px dashed var(--input-line); border-radius: 10px; padding: 18px 14px; text-align: center; color: var(--txt4); font-size: 12px; cursor: pointer; }
.pa-drop:hover { border-color: var(--gold); color: var(--gold); }
/* ── Benchmark de mercado (estudio Code) ── */
.bench-ctl { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; margin: 12px 0 16px; padding: 12px 14px; background: var(--card2); border: 1px solid #242424; border-radius: 10px; }
.bench-ctl .grp { display: flex; flex-direction: column; gap: 6px; }
.bench-ctl .grp .gl { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt4); }
.bench-knob { display: flex; align-items: center; gap: 6px; }
.bench-knob em { font-style: normal; font-size: 11px; color: var(--txt4); }
.bench-knob input { width: 64px; background: var(--input); border: 1px solid var(--input-line); border-radius: 6px; padding: 6px 8px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: #fff; text-align: right; outline: none; }
.bench-knob input:focus { border-color: var(--gold); }
.bench .comp-bar .lbl { width: 195px; line-height: 1.3; white-space: normal; }
.bench .comp-bar .lbl .s { display: block; font-family: 'JetBrains Mono', monospace; font-size: 8px; color: var(--txt4); letter-spacing: 0.04em; }
.bench .comp-bar .lbl .bn { color: var(--amber); cursor: help; font-size: 10px; }
.bench .comp-bar .after { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt4); width: 82px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.doc-cliente .dinfo { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 26px; margin: 16px 0 6px; font-size: 12px; color: #2F2F2F; }
.doc-cliente .dinfo .k2 { color: #999; }
/* ── Documento oficial (réplica PropuestaPDF) ── */
.doc-cliente .doc2-head { display: flex; align-items: center; gap: 16px; background: #2F2F2F; border-bottom: 2.5px solid #BDA76C; margin: -34px -38px 18px; padding: 13px 22px; border-radius: 12px 12px 0 0; }
.doc-cliente .doc2-head img { height: 44px; display: block; }
.doc-cliente .doc2-head .mid { flex: 1; }
.doc-cliente .doc2-head .mid .lw2 { color: #BDA76C; font-weight: 700; font-size: 10px; letter-spacing: 0.2em; }
.doc-cliente .doc2-head .mid .tit { color: #fff; font-size: 19px; font-weight: 400; margin-top: 2px; }
.doc-cliente .doc2-head .fol2 { text-align: right; font-size: 10px; color: #cfcfcf; line-height: 1.75; }
.doc-cliente .doc2-head .fol2 b { color: #fff; font-weight: 700; }
.doc-cliente .doc2-titA { font-size: 22px; font-weight: 800; letter-spacing: 0.22em; color: #2F2F2F; margin: 4px 0 0; }
.doc-cliente .doc2-titA::after { content: ''; display: block; width: 90px; border-top: 2.5px solid #BDA76C; margin-top: 7px; }
.doc-cliente .updesc2 { display: block; font-size: 9px; color: #777; margin-top: 3px; letter-spacing: 0.03em; }
.doc-cliente .updesc2 b { color: #2F2F2F; font-weight: 800; }
.doc-cliente .prow2 { display: flex; gap: 10px; align-items: flex-start; }
.doc-cliente .pthumb2 { flex: none; border: 1px solid #e8e4d8; border-radius: 6px; background: #fbfaf6; padding: 4px; }
.doc-cliente .pthumb2 svg { display: block; }
.doc-cliente .dlist2 { list-style: disc; margin: 4px 0 0 15px; padding: 0; }
.doc-cliente .dlist2 li { font-size: 9.5px; color: #888; line-height: 1.6; text-transform: uppercase; }
.doc-cliente .doc2-sec { color: #BDA76C; font-weight: 700; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; margin: 18px 0 6px; }
.doc-cliente td .updesc { display: block; font-size: 10.5px; letter-spacing: 0.01em; color: #1f1f1f; line-height: 1.45; text-transform: uppercase; }
.doc-cliente .ds { text-transform: uppercase; }
.doc-cliente tbody tr:nth-child(even) td { background: #fcfbf7; }
.doc-cliente .doc2-banner { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #2F2F2F; border-radius: 8px; padding: 13px 17px; margin-top: 18px; }
.doc-cliente .doc2-banner .bl .t { color: #BDA76C; font-weight: 700; font-size: 9px; letter-spacing: 0.13em; }
.doc-cliente .doc2-banner .bl .m { color: #cfcfcf; font-size: 10.5px; margin-top: 4px; }
.doc-cliente .doc2-banner .br { text-align: right; white-space: nowrap; }
.doc-cliente .doc2-banner .br .a { color: #fff; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.doc-cliente .doc2-banner .br .b { color: #cfcfcf; font-size: 10.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.doc-cliente .doc2-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.doc-cliente .doc2-boxes .bx { border: 1px solid #e6e6e6; border-radius: 8px; padding: 11px 14px; }
.doc-cliente .doc2-boxes .bx .t { color: #BDA76C; font-weight: 700; font-size: 9px; letter-spacing: 0.13em; margin-bottom: 6px; }
.doc-cliente .doc2-boxes .bx .m { font-size: 10.5px; line-height: 1.55; color: #1f1f1f; white-space: pre-line; }
.doc-cliente .doc2-boxes .bx .m .dim3 { color: #888; }
.doc-cliente .doc2-terms { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.doc-cliente .doc2-terms p { font-size: 10px; line-height: 1.45; color: #444; margin: 0; }
.doc-cliente .doc2-terms p b { color: #2F2F2F; display: block; margin-bottom: 1px; }
.doc-cliente .doc2-foot { background: #2F2F2F; text-align: center; margin: 18px -38px -34px; padding: 11px 16px; border-radius: 0 0 12px 12px; }
.doc-cliente .doc2-foot .l1 { color: #BDA76C; font-weight: 700; font-size: 9px; letter-spacing: 0.2em; }
.doc-cliente .doc2-foot .l2 { color: #cfcfcf; font-size: 8.5px; margin-top: 4px; }

/* ── Documento cliente v3 · formato "INNOVASPORT": 2 páginas, banda oscura full-bleed arriba/abajo ── */
.doc-cliente { padding: 0; background: #fff; border-radius: 14px; overflow: hidden; }
.doc-cliente .doc3-page { position: relative; background: #fff; color: #2F2F2F; display: flex; flex-direction: column; }
.doc-cliente .doc3-head { background: #2F2F2F; border-bottom: 2.5px solid #BDA76C; padding: 19px 46px; display: flex; align-items: center; flex: none; }
.doc-cliente .doc3-logo { height: 38px; display: block; }
.doc-cliente .doc3-main { padding: 32px 46px 26px; flex: 1 1 auto; }
.doc-cliente .doc3-foot { background: #2F2F2F; text-align: center; padding: 15px 46px; flex: none; margin-top: auto; }
.doc-cliente .doc3-foot-brand { color: #BDA76C; font-weight: 700; font-size: 12px; letter-spacing: 0.34em; }
.doc-cliente .doc3-foot-line { color: #b8b8b8; font-size: 8.5px; letter-spacing: 0.03em; margin-top: 5px; }
/* Hero (página 1) */
.doc-cliente .doc3-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.doc-cliente .doc3-eyebrow { color: #BDA76C; font-weight: 700; font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase; }
.doc-cliente .doc3-name { font-size: 29px; font-weight: 800; color: #2F2F2F; margin-top: 8px; line-height: 1.05; text-transform: uppercase; }
.doc-cliente .doc3-company { font-size: 13.5px; color: #6E6E6E; margin-top: 4px; letter-spacing: 0.02em; text-transform: uppercase; }
.doc-cliente .doc3-hero-r { text-align: right; flex: none; padding-top: 3px; }
.doc-cliente .doc3-date { font-size: 13px; font-weight: 700; color: #2F2F2F; }
.doc-cliente .doc3-valid { font-size: 10px; font-style: italic; color: #9a9a9a; margin-top: 3px; }
/* Pastilla de servicio + folio */
.doc-cliente .doc3-pillrow { display: flex; align-items: center; gap: 16px; margin: 22px 0 2px; }
.doc-cliente .doc3-pill { border: 1.5px solid #BDA76C; color: #9E8A52; font-weight: 700; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; padding: 9px 18px; border-radius: 8px; }
.doc-cliente .doc3-folio { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.1em; color: #8a8a8a; }
/* Tabla de partidas */
.doc-cliente .doc3-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.doc-cliente .doc3-table th { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.13em; text-transform: uppercase; color: #BDA76C; font-weight: 700; text-align: left; padding: 0 8px 10px; border-bottom: 1.5px solid #E5E1D6; vertical-align: bottom; }
.doc-cliente .doc3-table th.r { text-align: right; }
.doc-cliente .doc3-table th span { display: block; color: #c2b795; font-weight: 400; margin-top: 1px; }
.doc-cliente .doc3-table td { padding: 14px 8px; font-size: 12.5px; border-bottom: 1px solid #EFEBE0; vertical-align: top; color: #2F2F2F; }
.doc-cliente .doc3-table td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-cliente .doc3-table td.unit { font-weight: 800; }
.doc-cliente .doc3-table tbody tr:nth-child(even) td { background: transparent; }
/* Totales */
.doc-cliente .doc3-tots { margin: 10px 0 0 auto; width: 320px; }
.doc-cliente .doc3-tr { display: flex; justify-content: space-between; padding: 6px 8px; font-size: 12px; color: #6E6E6E; font-variant-numeric: tabular-nums; }
.doc-cliente .doc3-tr.doc3-total { border-top: 1.5px solid #E5E1D6; margin-top: 4px; padding-top: 13px; align-items: center; }
.doc-cliente .doc3-tr.doc3-total span:first-child { color: #9E8A52; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; }
.doc-cliente .doc3-tr.doc3-total span:last-child { color: #9E8A52; font-weight: 800; font-size: 25px; }
/* Continuación (página 2) */
.doc-cliente .doc3-cont { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.doc-cliente .doc3-cont-name { font-size: 18px; font-weight: 800; color: #2F2F2F; margin-top: 6px; text-transform: uppercase; }
.doc-cliente .doc3-cont-r { text-align: right; flex: none; }
.doc-cliente .doc3-cont-folio { font-size: 12px; font-weight: 700; color: #2F2F2F; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.06em; }
.doc-cliente .doc3-cont-date { font-size: 10px; font-style: italic; color: #9a9a9a; margin-top: 3px; }
/* Anticipo (crema + borde dorado) */
.doc-cliente .doc3-anticipo { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #F5F0E4; border: 1.5px solid #D9CBA4; border-radius: 12px; padding: 16px 22px; }
.doc-cliente .doc3-ant-t { color: #9E8A52; font-weight: 700; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }
.doc-cliente .doc3-ant-m { color: #5a5548; font-size: 11px; margin-top: 5px; }
.doc-cliente .doc3-ant-r { text-align: right; white-space: nowrap; }
.doc-cliente .doc3-ant-a { color: #2F2F2F; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.doc-cliente .doc3-ant-b { color: #6E6E6E; font-weight: 700; font-size: 11.5px; margin-top: 4px; font-variant-numeric: tabular-nums; }
/* Cajas pago / entrega */
.doc-cliente .doc3-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.doc-cliente .doc3-box { background: #F5F0E4; border-radius: 12px; padding: 16px 20px; }
.doc-cliente .doc3-box-t { color: #9E8A52; font-weight: 700; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 8px; }
.doc-cliente .doc3-box-m { font-size: 11px; line-height: 1.7; color: #3a3a3a; }
.doc-cliente .doc3-box-ctr { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.doc-cliente .doc3-box-ctr .doc3-box-t { margin-bottom: 9px; }
.doc-cliente .doc3-entrega { font-size: 15px; font-weight: 700; color: #2F2F2F; }
/* Alcance */
.doc-cliente .doc3-sec2 { color: #9E8A52; font-weight: 700; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; margin: 20px 0 8px; }
.doc-cliente .doc3-alcance { background: #F5F0E4; border-radius: 12px; padding: 14px 20px; font-size: 11px; line-height: 1.6; color: #3a3a3a; }
/* Términos (apilados) */
.doc-cliente .doc3-terms { margin-top: 22px; }
.doc-cliente .doc3-terms-h { font-size: 13px; font-weight: 800; color: #2F2F2F; margin-bottom: 11px; }
.doc-cliente .doc3-term { margin-bottom: 10px; }
.doc-cliente .doc3-term b { display: block; font-size: 11px; color: #2F2F2F; font-weight: 700; margin-bottom: 2px; }
.doc-cliente .doc3-term p { font-size: 10px; line-height: 1.5; color: #6E6E6E; margin: 0; }
@media screen { .doc-cliente .doc3-page + .doc3-page { border-top: 6px solid #EAE6DA; } }

/* ── Pipeline de Ventas (ERP F3) · kanban ── */
.pipe-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .pipe-board { grid-template-columns: repeat(2, 1fr); } }
.pipe-col { background: var(--panel, rgba(255,255,255,.02)); border: 1px solid var(--line); border-radius: 12px; min-height: 260px; display: flex; flex-direction: column; transition: border-color .15s ease, background .15s ease; }
.pipe-col.dropok { border-color: var(--gold); background: rgba(189,167,108,.05); }
.pipe-colhead { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.pipe-colhead .pch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--col-accent); flex: none; }
.pipe-colhead .pch-t { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.14em; color: var(--txt2); font-weight: 600; }
.pipe-colhead .pch-n { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--txt4); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.pipe-colhead .pch-sum { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--col-accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.pipe-colbody { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pipe-empty { border: 1px dashed var(--line); border-radius: 9px; padding: 18px 10px; text-align: center; font-size: 10px; color: var(--txt4); }
.pipe-card { background: var(--input, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; cursor: grab; transition: border-color .12s ease, transform .12s ease; }
.pipe-card:hover { border-color: var(--gold); }
.pipe-card.dragging { opacity: .45; cursor: grabbing; }
.pipe-card .pc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pipe-card .pc-monto { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 600; }
.pipe-card .pc-cli { font-size: 12px; font-weight: 600; color: var(--txt); margin-top: 5px; }
.pipe-card .pc-desc { font-size: 10px; color: var(--txt4); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-card .pc-motivo { font-size: 9.5px; color: var(--red); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-card .pc-foot { display: flex; gap: 10px; align-items: center; margin-top: 7px; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt4); }
.pipe-card .pc-foot .pc-sync { margin-left: auto; }
.pipe-card .pc-sync.ok { color: var(--green); }
.pipe-card .pc-sync.err { color: var(--amber); }

/* ── Resumen de cotización (historial en Clientes) ── */
/* Acomodo: resumen fijo a la izquierda · documento con scroll propio a la derecha */
.cotres-grid { display: grid; grid-template-columns: minmax(370px, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
@media (max-width: 1080px) { .cotres-grid { grid-template-columns: 1fr; } .cotres-docpane { position: static !important; } .cotres-docscroll { max-height: none !important; } }
.cotres-sec { color: var(--gold); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.14em; margin: 16px 0 8px; }
.cotres-docpane { position: sticky; top: 14px; }
.cotres-docpane .cotres-sec { margin-top: 0; }
.cotres-docscroll { max-height: calc(100vh - 120px); overflow-y: auto; border-radius: 14px; border: 1px solid var(--line); background: #55524a1a; padding: 14px; scrollbar-width: thin; }
.cotres-doc .doc-cliente { border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.cotres-parts { display: flex; flex-direction: column; gap: 8px; }
.cotres-part { background: var(--input, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; }
.cotres-part .cp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cotres-part .cp-desc { font-size: 12px; font-weight: 600; color: var(--txt); text-transform: uppercase; }
.cotres-part .cp-importe { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cotres-part .cp-meta { font-size: 10.5px; color: var(--txt4); margin-top: 4px; }
.cotres-part .cp-extra { font-size: 10.5px; color: var(--txt3); margin-top: 3px; }

/* ── Producción (ERP F4) ── */
.pipe-board.cols5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1240px) { .pipe-board.cols5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .pipe-board.cols5 { grid-template-columns: repeat(2, 1fr); } }
.pipe-board.cols6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1360px) { .pipe-board.cols6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .pipe-board.cols6 { grid-template-columns: repeat(2, 1fr); } }

/* Anticipo sugerido (Condiciones, paso 6) */
.anti-sug { margin-top: 9px; border: 1px dashed var(--amber); border-radius: 8px; padding: 9px 12px; font-size: 10.5px; line-height: 1.55; color: var(--txt3); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.anti-sug b { color: var(--amber); }
.anti-sug.ok { border-color: rgba(74,222,128,.45); color: var(--txt3); }
.anti-sug.ok b { color: var(--green); }
.anti-sug .chip { flex: none; }
.prod-mats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.prod-mat { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt3); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; cursor: help; }
.prod-fc { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; color: var(--txt4); }
.prod-fc input[type="date"] { background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--txt3); font-family: 'JetBrains Mono', monospace; font-size: 8.5px; padding: 2px 4px; width: 108px; color-scheme: dark; }
.prod-fc input[type="date"]:focus { border-color: var(--gold); outline: none; }
.prod-desv { font-weight: 700; }
.prod-desv.ok { color: var(--green); }
.prod-desv.warn { color: var(--amber); }

/* ── Finanzas (ERP F5) ── */
.fin-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1080px) { .fin-grid { grid-template-columns: 1fr; } }
.fin-col { display: flex; flex-direction: column; gap: 14px; }
.fin-col .aj-card { margin: 0; }
.fin-mini { font-size: 10px; padding: 6px 10px; }
.fin-venta { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-top: 8px; }
.fin-venta .fv-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.fin-venta .fv-cli { font-size: 11.5px; font-weight: 600; color: var(--txt); }
.fin-venta .fv-tot { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.fin-venta .fv-bar { height: 5px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0 6px; }
.fin-venta .fv-bar > div, .fv-bar > div { height: 100%; background: var(--green); border-radius: 4px; transition: width .3s ease; }
.fv-bar { height: 5px; background: var(--line); border-radius: 4px; overflow: hidden; }
.fin-venta .fv-foot { display: flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--txt4); }
.fin-venta .fv-foot b { color: var(--txt2); }
.fin-venta .fv-n { cursor: help; border-bottom: 1px dotted var(--txt4); }
.fin-caja { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px dashed var(--gold); border-radius: 9px; padding: 9px 13px; margin-bottom: 10px; }
.fin-caja label { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--txt2); }
.fin-caja input { width: 110px; background: var(--input, rgba(255,255,255,.04)); border: 1px solid var(--input-line, var(--line)); border-radius: 7px; color: var(--txt); font-family: 'JetBrains Mono', monospace; font-size: 12px; padding: 6px 9px; text-align: right; }
.fin-caja input:focus { border-color: var(--gold); outline: none; }
.fin-caja .fc-fecha { font-size: 8.5px; color: var(--txt4); font-family: 'JetBrains Mono', monospace; }
.fin-caja .fc-res { font-size: 11px; color: var(--txt3); }
.fin-caja .fc-res b { font-variant-numeric: tabular-nums; }
.fin-cf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
@media (max-width: 1300px) { .fin-cf { grid-template-columns: repeat(2, 1fr); } }
.cf-kpi { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.cf-kpi .k { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: .12em; color: var(--txt4); text-transform: uppercase; }
.cf-kpi b { font-size: 13px; color: var(--txt); font-variant-numeric: tabular-nums; }
.cf-kpi .s { font-size: 8.5px; color: var(--txt4); }
.cf-esc { display: flex; align-items: baseline; gap: 10px; padding: 5px 2px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 11px; color: var(--txt3); }
.cf-esc:last-child { border-bottom: 0; }
.cf-esc .n { min-width: 150px; }
.cf-esc .v { font-family: 'JetBrains Mono', monospace; color: var(--txt2); font-variant-numeric: tabular-nums; margin-left: auto; }
.cf-esc .d { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.fin-gform { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.fin-gform input, .fin-gform select { background: var(--input, rgba(255,255,255,.04)); border: 1px solid var(--input-line, var(--line)); border-radius: 7px; color: var(--txt); font-size: 11px; padding: 7px 9px; font-family: inherit; }
.fin-gform input:focus, .fin-gform select:focus { border-color: var(--gold); outline: none; }
.fin-gform #fg-concepto { flex: 1; min-width: 140px; }
.fin-gasto { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid rgba(255,255,255,.04); }
.fin-gasto:last-of-type { border-bottom: 0; }
.fin-gasto .g-con { font-size: 11.5px; color: var(--txt2); }
.fin-gasto .g-monto { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt2); font-variant-numeric: tabular-nums; }
.cxp-row { display: flex; align-items: center; gap: 9px; padding: 7px 2px; border-bottom: 1px solid rgba(255,255,255,.04); }
.cxp-row:last-of-type { border-bottom: 0; }
.cxp-row.pagado { opacity: .5; }
.cxp-row .cxp-txt { display: flex; flex-direction: column; min-width: 0; }
.cxp-row .cxp-prov { font-size: 11.5px; color: var(--txt2); font-weight: 600; }
.cxp-row .cxp-con { font-size: 9.5px; color: var(--txt4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cxp-row .cxp-auto { color: var(--gold); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 7.5px; letter-spacing: .06em; }
.cxp-row .cxp-real { color: var(--green); border-color: var(--green); }
.cxp-row .cxp-venc { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt4); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.cxp-row .cxp-b { border-radius: 4px; padding: 1px 6px; font-size: 8px; letter-spacing: .04em; }
.cxp-row .cxp-b.vencido { color: var(--red); border: 1px solid var(--red); }
.cxp-row .cxp-b.proximo { color: var(--amber); border: 1px solid var(--amber); }
.cxp-row .cxp-b.pagado { color: var(--green); border: 1px solid var(--green); }
.cxp-row .cxp-monto { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cxp-row .cxp-pagar { background: transparent; border: 1px solid var(--line); border-radius: 5px; color: var(--txt3); font-size: 9px; cursor: pointer; padding: 3px 8px; }
.cxp-row .cxp-pagar:hover { border-color: var(--green); color: var(--green); }
.fv-nodesg { font-size: 8.5px; color: var(--txt4); margin-top: 6px; font-style: italic; }
.fv-destino { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 7px; }
.fv-destino summary { cursor: pointer; font-size: 10px; color: var(--gold); font-family: 'JetBrains Mono', monospace; letter-spacing: .06em; list-style: none; }
.fv-destino summary::-webkit-details-marker { display: none; }
.fv-destino[open] summary { margin-bottom: 7px; }
.fvd-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.fvd-row .k { font-size: 10px; color: var(--txt3); min-width: 150px; }
.fvd-row .bar { flex: 1; height: 5px; background: var(--line); border-radius: 4px; overflow: hidden; }
.fvd-row .bar > span { display: block; height: 100%; background: var(--gold); border-radius: 4px; }
.fvd-row .m { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fvd-note { font-size: 8.5px; color: var(--txt4); margin-top: 6px; }

/* ── Pipeline: win-rate por fuente/responsable ── */
.kpi-card.ws-card { padding-bottom: 10px; }
.ws-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 10.5px; color: var(--txt3); padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.ws-row:last-child { border-bottom: 0; }
.ws-row b { color: var(--gold); font-family: 'JetBrains Mono', monospace; }
.ws-row span:last-child { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt4); font-variant-numeric: tabular-nums; }

/* ── Panel de detalle de OT (Producción v2) ── */
#ot-panel-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; }
#ot-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 94vw); background: var(--panel, #232323); border-left: 1px solid var(--line); z-index: 91; padding: 18px 20px 26px; overflow-y: auto; box-shadow: -12px 0 40px rgba(0,0,0,.45); }
#ot-panel .otp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
#ot-panel .otp-progress { height: 5px; background: var(--line); border-radius: 4px; overflow: hidden; }
#ot-panel .otp-bar { height: 100%; background: var(--gold); border-radius: 4px; transition: width .3s ease; }
#ot-panel .otp-steps { display: flex; justify-content: space-between; margin-top: 5px; font-family: 'JetBrains Mono', monospace; font-size: 6.8px; letter-spacing: 0.05em; color: var(--txt4); }
#ot-panel .otp-steps .on { color: var(--gold); }
#ot-panel .otp-sec { color: var(--gold); font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.14em; margin: 18px 0 8px; }
#ot-panel .otp-hint { color: var(--txt4); font-size: 8.5px; letter-spacing: 0.04em; }
#ot-panel .otp-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
#ot-panel .otp-info .k { display: block; font-size: 9px; color: var(--txt4); margin-bottom: 2px; }
#ot-panel .otp-info b { font-size: 11.5px; color: var(--txt); font-weight: 600; }
#ot-panel .otp-acciones { display: flex; flex-direction: column; gap: 8px; }
#ot-panel .otp-btn { width: 100%; justify-content: center; }
#ot-panel .otp-done { text-align: center; color: var(--green); font-size: 11px; padding: 8px; border: 1px dashed var(--green); border-radius: 8px; }
#ot-panel .otp-form label { display: block; font-size: 9.5px; color: var(--txt4); margin-bottom: 8px; }
#ot-panel .otp-form input, #ot-panel .otp-form textarea { display: block; width: 100%; margin-top: 4px; background: var(--input, rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 7px; color: var(--txt); font-size: 11px; padding: 7px 9px; font-family: inherit; }
#ot-panel .otp-form input:focus, #ot-panel .otp-form textarea:focus { border-color: var(--gold); outline: none; }
#ot-panel .otp-switch { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--txt2); cursor: pointer; margin-bottom: 8px; }
#ot-panel .otp-link { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt3); background: var(--input, rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; margin-bottom: 8px; word-break: break-all; }
#ot-panel .otp-mini { font-size: 10px; padding: 6px 10px; }
#ot-panel .otp-eventos { position: relative; }
#ot-panel .otp-ev { display: flex; gap: 10px; padding: 5px 0; }
#ot-panel .otp-ev .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; margin-top: 3px; }
#ot-panel .otp-ev.last .dot { background: var(--gold); }
#ot-panel .otp-ev .t { font-size: 10.5px; color: var(--txt2); }
#ot-panel .otp-ev .m { font-size: 8.5px; color: var(--txt4); font-family: 'JetBrains Mono', monospace; margin-top: 1px; }
.pipe-card .pc-links { display: inline-flex; gap: 6px; align-items: center; font-size: 10px; }
.pipe-card .pc-asig { font-family: 'JetBrains Mono', monospace; font-size: 8px; color: var(--txt4); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* ── Material de proveedor alterno ── */
.matalt-card .matalt-read { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 9px; font-size: 11.5px; color: var(--txt2); line-height: 1.5; }
.matalt-card .matalt-read b { color: var(--txt); font-variant-numeric: tabular-nums; }
.matalt-card .dim3 { color: var(--txt4); font-size: 10px; }

/* ── Candado de Ajustes (solo César) ── */
.aj-lock { margin: 12px 0 0; border: 1px solid var(--amber); background: rgba(212,165,74,.08); border-radius: 9px; padding: 10px 14px; font-size: 11.5px; color: var(--txt2); }
.aj-lock b { color: var(--amber); }
input.locked, select.locked { opacity: .6; cursor: not-allowed; }

/* ── Feedback del equipo ── */
.fb-btn { position: relative; background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--txt3); font-size: 14px; cursor: pointer; padding: 5px 9px; margin-right: 12px; line-height: 1; }
.fb-btn:hover { border-color: var(--gold); }
.fb-btn .fb-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 1.5px solid var(--bg, #1a1a1a); }
#fb-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; }
#fb-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw); background: var(--panel, #232323); border-left: 1px solid var(--line); z-index: 91; padding: 18px 20px 26px; overflow-y: auto; box-shadow: -12px 0 40px rgba(0,0,0,.45); }
#fb-panel .fb-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--txt); margin-bottom: 14px; }
#fb-panel .fb-form { display: flex; flex-direction: column; gap: 8px; }
#fb-panel .fb-pant { font-size: 10px; color: var(--txt4); }
#fb-panel .fb-pant b { color: var(--gold); }
#fb-panel textarea { width: 100%; background: var(--input, rgba(255,255,255,.04)); border: 1px solid var(--line); border-radius: 8px; color: var(--txt); font: inherit; font-size: 12px; padding: 9px; resize: vertical; }
#fb-panel textarea:focus { border-color: var(--gold); outline: none; }
#fb-panel .fb-sec { color: var(--gold); font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .16em; margin: 20px 0 8px; }
#fb-panel .fb-empty { font-size: 10.5px; color: var(--txt4); }
#fb-panel .fb-item { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; margin-bottom: 8px; }
#fb-panel .fb-item.resuelto { opacity: .55; }
#fb-panel .fb-i-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
#fb-panel .fb-pant2 { font-family: 'JetBrains Mono', monospace; font-size: 8px; letter-spacing: .06em; color: var(--gold); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
#fb-panel .fb-autor { font-size: 9px; color: var(--txt3); }
#fb-panel .fb-fecha { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt4); }
#fb-panel .fb-txt { font-size: 12px; color: var(--txt2); line-height: 1.45; }
#fb-panel .fb-toggle { margin-top: 6px; background: transparent; border: 0; color: var(--txt4); font-size: 9.5px; cursor: pointer; padding: 0; }
#fb-panel .fb-toggle:hover { color: var(--gold); }
#fb-panel .fb-item.resuelto .fb-toggle { color: var(--green); }

/* ── Chip de sync ERP (F1) ── */
.erp-chip { display: inline-flex; align-items: center; border: 1px solid var(--line); color: var(--txt4); border-radius: 7px; padding: 7px 11px; font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.08em; cursor: help; }
.erp-chip.ok { border-color: var(--green); color: var(--green); }
.erp-chip.err { border-color: var(--amber); color: var(--amber); }

/* ── Aceptación del cliente (contrato ERP F0) ── */
.doc-actions .btn-aceptar { border-color: var(--green); color: var(--green); }
.bdg-aceptada { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--green); color: var(--green); border-radius: 7px; padding: 7px 13px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.1em; font-weight: 600; }
.wf-row .n .niva { font-style: normal; font-size: 9px; color: var(--txt4); }
/* Desglose en columnas NETO · IVA · TOTAL */
.wf-th, .wf-row.wfg { display: grid; grid-template-columns: 1fr 88px 76px 92px; gap: 8px; align-items: baseline; }
.wf-th { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.14em; color: var(--txt4); padding: 2px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 3px; }
.wf-th .c, .wf-row.wfg .c { text-align: right; }
.wf-row.wfg .c { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.wf-row.wfg .c.dim2 { color: var(--txt4); }
.wf-row.wfg.sub .c { font-size: 9.5px; color: var(--txt4); }
.merma-box .mb-nest { margin-bottom: 7px; }
.merma-box .mb-nest[data-zoom5] { cursor: zoom-in; border-radius: 3px; }
.merma-box .mb-nest[data-zoom5]:hover { outline: 1px solid rgba(189,167,108,.5); outline-offset: 2px; }
.merma-box .mb-nest svg { max-width: 100%; height: auto; }
.merma-box .mb-cap { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--txt4); margin-bottom: 7px; line-height: 1.5; }
.lam-sec { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.16em; color: var(--txt4); padding: 9px 0 3px; border-bottom: 1px solid var(--line); margin-bottom: 3px; }
.merma-box .mb-bar { height: 10px; border-radius: 5px; background: #2b2b2b; overflow: hidden; margin-bottom: 7px; }
.merma-box .mb-bar .prod { display: block; height: 100%; background: var(--gold); border-radius: 5px 0 0 5px; }
.merma-box .mb-line { font-size: 11px; color: var(--txt3); }
.merma-box .mb-line b { color: var(--txt2); }
.merma-box .mb-line b.amb { color: var(--amber); }
.merma-box .mb-sub { font-size: 9px; color: var(--txt4); margin-top: 4px; line-height: 1.5; }

/* B · filas de material por partida */
.mat-row { display: grid; grid-template-columns: 1.9fr 1fr; grid-template-areas: "cfg cfg" "nest calc"; gap: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; align-items: start; }
.mat-cfg { grid-area: cfg; }
.mat-nest { grid-area: nest; }
.mat-nest .mb-nest svg { width: 100%; height: auto; }
.mat-calc { grid-area: calc; }
.mat-row.maquila { opacity: .65; }
.mat-thumb { width: 82px; height: 82px; background: #191919; border: 1px solid #262626; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mat-nm { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.mat-cfg label { font-size: 9.5px; color: var(--txt4); display: block; margin-bottom: 5px; }
.mat-cfg .chips .chip input { width: 44px; background: #1a1a1a; border: 1px solid var(--input-line); border-radius: 4px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 10px; text-align: right; padding: 2px 4px; outline: none; }
.mat-cfg .chips .chip input:focus { border-color: var(--gold); }
.mat-calc { border-left: 1px dashed #2a2a2a; padding-left: 14px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.mc-line { font-size: 11.5px; color: var(--txt2); line-height: 1.5; }
.mc-line b { color: #fff; }
.mc-line.hero { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.mc-line.hero b { color: var(--gold); }
.mc-sub { font-size: 9.5px; color: var(--txt4); line-height: 1.5; }

/* Escenario visual del DXF (paso 2) */
.dxf-stage { display: grid; grid-template-columns: 470px 1fr; gap: 14px; margin-top: 12px; }
.dxf-canvas { position: relative; background: radial-gradient(circle at 50% 40%, #1a1a17 0%, #121212 75%); border: 1px solid rgba(189,167,108,.25); border-radius: 12px; min-height: 340px; display: flex; align-items: center; justify-content: center; padding: 24px 14px 28px; }
.dxf-canvas::before { content: ''; position: absolute; inset: 0; border-radius: 12px; background-image: linear-gradient(#ffffff05 1px, transparent 1px), linear-gradient(90deg, #ffffff05 1px, transparent 1px); background-size: 20px 20px; pointer-events: none; }
.dxf-canvas svg { position: relative; filter: drop-shadow(0 0 6px rgba(189,167,108,.25)); }
.dxf-tag { position: absolute; top: 8px; left: 10px; font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.16em; color: var(--txt4); }
.dxf-side .dxf-head .t { background: rgba(189,167,108,.12); border: 1px solid rgba(189,167,108,.35); border-radius: 6px; padding: 4px 9px; color: var(--gold); font-weight: 600; }
.dxfzoom .dz-leg-v .ln.wn, .dz-leg-v .ln.wn { border-color: #f87171; }
#dz-hl.sel { background: rgba(248,113,113,.15); border-color: #f87171; color: #f87171; }
.dxf-dims { position: absolute; bottom: 8px; right: 10px; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--txt3); background: #12121299; padding: 2px 7px; border-radius: 4px; }
.dxf-dims.warn { color: var(--amber); border: 1px dashed rgba(251,191,36,.4); }
.dxf-side { min-width: 0; }
.dxf-obs { margin-top: 10px; background: #191919; border: 1px solid #242424; border-radius: 8px; padding: 9px 11px; }
.dxf-obs-t { font-family: 'JetBrains Mono', monospace; font-size: 7.5px; letter-spacing: 0.16em; color: var(--txt4); margin-bottom: 6px; }
.dxf-obs .ob { font-size: 10.5px; line-height: 1.5; padding: 2.5px 0; }
.dxf-obs .ob.info { color: var(--txt3); }
.dxf-obs .ob.warn { color: var(--amber); }
.dxf-obs .ob.fee { color: #e8a87a; font-weight: 600; }
.ob-fee { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; padding-top: 7px; border-top: 1px dashed #2e2e2e; font-size: 10.5px; color: var(--txt2); }
.ob-fee b { color: var(--gold); }
.dxf-side .dxf-head { gap: 8px; }
.dxf-side .dxf-head .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.ticker .tk { white-space: nowrap; }
.partida-card .det-row .v { white-space: nowrap; margin-left: 12px; }
.partida-card .det-row .k { min-width: 0; font-size: 10.5px; }
.sin-dxf { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 10.5px; color: var(--txt4); }
.sin-dxf input { width: 64px; background: var(--input); border: 1px solid var(--input-line); border-radius: 5px; color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 11px; text-align: right; padding: 4px 7px; outline: none; }
.sin-dxf input:focus { border-color: var(--gold); }

/* Resumen visto bueno (modal blanco + print) */
.vb-back { z-index: 95; overflow-y: auto; padding: 30px 0; align-items: flex-start; }
.vb-doc { width: 680px; max-width: 94vw; margin: 0 auto; background: #FAFAF7; color: #2F2F2F; border-radius: 12px; padding: 30px 34px; font-family: 'Manrope', sans-serif; }
.vb-item { display: grid; grid-template-columns: 210px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid #e5e5e0; align-items: center; }
.vb-viz { background: #fff; border: 1px solid #ddd; border-radius: 8px; min-height: 140px; display: flex; align-items: center; justify-content: center; padding: 6px; }
.vb-nm { font-size: 13px; font-weight: 800; margin-bottom: 7px; }
.vb-specs table { border-collapse: collapse; width: 100%; }
.vb-specs td { font-size: 11px; padding: 3px 0; color: #444; }
.vb-specs td:first-child { color: #999; width: 130px; font-family: 'JetBrains Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.vb-specs em { color: #9E8A52; font-style: normal; }
.vb-firma { display: flex; justify-content: space-between; gap: 20px; margin-top: 26px; padding-top: 14px; font-size: 11px; color: #555; }
.vb-acts { display: flex; gap: 10px; margin-top: 22px; }
.vb-acts .btn { flex: 1; }
.vb-acts .btn-ghost { border-color: #ccc; color: #555; }
.vb-acts .btn-ghost:hover { border-color: #9E8A52; color: #9E8A52; }
@media print {
  body.print-vb .topbar, body.print-vb #view, body.print-vb #tweaks-root { display: none !important; }
  body.print-vb .vb-back { position: static; background: #fff; padding: 0; }
  body.print-vb .vb-doc { width: 100%; max-width: none; border-radius: 0; padding: 0; }
  body.print-vb .vb-acts { display: none; }
}

.dxf-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.dxf-mini .dm { background: #191919; border: 1px solid #242424; border-radius: 8px; padding: 8px 10px; }
.dxf-mini .dm .l { font-size: 7.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--txt4); }
.dxf-mini .dm .v { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--txt2); margin-top: 2px; }
.dxf-mini .dm .v em { font-style: normal; color: var(--gold); }
.share-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 14px; }
.share-box textarea { width: 100%; min-height: 120px; background: var(--input); border: 1px solid var(--input-line); border-radius: 8px; color: var(--txt2); font-family: 'JetBrains Mono', monospace; font-size: 10.5px; line-height: 1.7; padding: 11px; outline: none; resize: vertical; }

/* ── Aceptación parcial (derivar pedido con partidas seleccionadas) ── */
.pipe-card .pc-parcial { font-size: 9.5px; color: var(--gold); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parcial-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.parcial-modal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; width: min(560px, 94vw); max-height: 84vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.parcial-modal h3 { margin: 0 0 6px; font-size: 15px; color: var(--txt1); }
.parcial-modal .pm-sub { font-size: 11px; color: var(--txt3); line-height: 1.55; margin-bottom: 14px; }
.parcial-modal .pm-sub b { color: var(--gold); }
.parcial-modal .pm-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 6px; cursor: pointer; transition: border-color 0.15s; }
.parcial-modal .pm-row:hover { border-color: var(--gold); }
.parcial-modal .pm-row:has(input:checked) { border-color: var(--gold); background: rgba(189,167,108,0.07); }
.parcial-modal .pm-row input { accent-color: var(--gold); }
.parcial-modal .pm-desc { flex: 1; font-size: 12px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parcial-modal .pm-cant { font-size: 10px; color: var(--txt4); white-space: nowrap; }
.parcial-modal .pm-imp { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--txt1); white-space: nowrap; }
.parcial-modal .pm-nota { font-size: 10px; color: var(--txt4); line-height: 1.5; margin: 8px 2px 0; }
.parcial-modal .pm-total { display: flex; align-items: baseline; gap: 8px; margin: 14px 2px 4px; font-size: 12px; color: var(--txt3); }
.parcial-modal .pm-total b { font-family: 'JetBrains Mono', monospace; font-size: 17px; color: var(--gold); }
.parcial-modal .pm-iva { font-size: 9.5px; color: var(--txt4); }
.parcial-modal .pm-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.q-row .folio-err { color: var(--red); font-size: 10px; margin-left: 6px; cursor: help; }
.matalt-read .mr-b { display: flex; gap: 8px; margin-top: 5px; line-height: 1.55; }
.matalt-read .mr-b .mr-i { flex: 0 0 auto; }

/* ── Comparador de cliente ($/m²) + Destino del dinero (paso 6 interno) ── */
/* comparador: tiles grandes acuerdo→actual + chip de delta + barras a una escala */
.compcli-card .cc-empty { font-size: 11.5px; color: var(--txt4); line-height: 1.6; margin-top: 8px; }
.compcli-card .cc-duo { display: flex; align-items: stretch; gap: 12px; margin-top: 10px; }
.compcli-card .cc-tile { flex: 1; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.compcli-card .cc-tile.cur { border-color: var(--gold); }
.compcli-card .cc-tile .l { font-size: 8.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--txt4); }
.compcli-card .cc-tile .v { font-family: 'JetBrains Mono', monospace; font-size: 19px; color: var(--txt1); margin-top: 3px; }
.compcli-card .cc-tile.cur .v { color: var(--gold); }
.compcli-card .cc-tile .v .u { font-size: 11px; color: var(--txt4); }
.compcli-card .cc-tile .s { font-size: 10px; color: var(--txt4); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compcli-card .cc-arrow { align-self: center; color: var(--txt4); font-size: 15px; }
.compcli-card .cc-chiprow { margin-top: 8px; }
.compcli-card .cc-chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.compcli-card .cc-chip.up { color: var(--gold); background: rgba(189,167,108,0.1); border: 1px solid rgba(189,167,108,0.35); }
.compcli-card .cc-chip.down { color: var(--amber); background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3); }
.compcli-card .cc-bars { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.compcli-card .cc-bar-row { display: grid; grid-template-columns: 170px 1fr 74px; gap: 10px; align-items: center; }
.compcli-card .cc-bar-lbl { min-width: 0; }
.compcli-card .cc-bar-lbl b { display: block; font-size: 10.5px; color: var(--txt3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compcli-card .cc-bar-lbl span { display: block; font-size: 9px; color: var(--txt4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compcli-card .cc-bar-row.cur .cc-bar-lbl b { color: var(--gold); }
.compcli-card .cc-bar-track { background: var(--input); border-radius: 4px; height: 10px; overflow: hidden; }
.compcli-card .cc-bar-fill { height: 100%; border-radius: 4px; background: var(--input-line); }
.compcli-card .cc-bar-row.ref .cc-bar-fill { background: var(--txt4); }
.compcli-card .cc-bar-row.cur .cc-bar-fill { background: var(--gold); }
.compcli-card .cc-bar-val { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--txt3); text-align: right; }
.compcli-card .cc-bar-row.cur .cc-bar-val { color: var(--gold); font-weight: 700; }
.compcli-card .cc-inputs { margin-top: 12px; }

/* destino unificado EN la tabla CONCEPTO: barra de composición + % por fila
   + hora-máquina expandible — mismos colores que los dots de las filas */
.sg-mat { background: var(--gold); } .sg-op { background: var(--blue); } .sg-dir { background: var(--teal); }
.sg-ext { background: #d49a7c; } .sg-sat { background: #6f6f76; } .sg-uti { background: var(--green); }
.wf .ds-bar { display: flex; gap: 2px; height: 13px; border-radius: 5px; overflow: hidden; margin: 2px 0 5px; }
.wf .ds-bar > div { min-width: 3px; }
.wf .ds-caption { font-size: 9px; color: var(--txt4); margin-bottom: 10px; }
.wf-pct { font-size: 9px; color: var(--txt4); font-family: 'JetBrains Mono', monospace; margin-left: 5px; }
.wf-row .k .dot.duti { background: var(--green); }
.wf-row .k .dot.dsat { background: #6f6f76; }
.hm-toggle { cursor: pointer; }
.hm-toggle:hover .k { color: var(--txt2); }
#hm-arrow { color: var(--gold); font-size: 9px; }

/* divisiones visuales de la tabla CONCEPTO + egresos en rojo (pedido César 21-jul) */
.wf .wf-div { display: flex; align-items: center; gap: 8px; font-size: 8px; font-weight: 700; letter-spacing: 0.14em; margin: 10px 0 3px; color: var(--txt4); }
.wf .wf-div::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.wf .wf-div.eg { color: rgba(248, 113, 113, 0.72); }
.wf .wf-div.eg::after { background: rgba(248, 113, 113, 0.16); }
.wf .wf-div.uti { color: var(--green); }
.wf .wf-div.uti::after { background: rgba(74, 222, 128, 0.16); }
.wf-row .c.eg { color: var(--red); }
/* componentes de hora-máquina: filas alineadas a la columna NETO (sin grid aparte) */
.wf-row.sub2 .k { padding-left: 30px; font-size: 10px; color: var(--txt4); }
.wf-row.sub2 .c { font-size: 10px; color: var(--txt4); }
/* tarifas $/m² como chips aireados bajo la tabla */
.wf-m2 { display: flex; gap: 10px; margin-top: 12px; }
.wf-m2 .m2-chip { flex: 1; background: var(--card2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; min-width: 0; }
.wf-m2 .m2-chip .l { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--txt4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-m2 .m2-chip .v { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--gold); margin-top: 3px; }
.wf-m2 .m2-chip .s { font-size: 9px; color: var(--txt4); margin-left: 6px; }

/* utilidad como cards (sección LO QUE QUEDA PARA LATTICE) — v en verde */
.wf-uti { margin-top: 4px; margin-bottom: 4px; }
.wf-uti .m2-chip .l { display: flex; align-items: center; gap: 5px; }
.wf-uti .m2-chip .l .dot { width: 6px; height: 6px; border-radius: 2px; flex: none; }
.wf-uti .m2-chip .v { color: var(--green); }
.wf-uti .m2-chip.main { border-color: rgba(74, 222, 128, 0.32); }
.wf-uti .m2-chip .s { display: block; margin-left: 0; margin-top: 2px; }

/* mini-tabla de medidas (mismo diseño · varias medidas): habla el MISMO
   idioma visual que la tabla del documento — headers dorados en mono con
   su hairline, filas con el mismo separador, montos en mono */
.doc3-table .med-mini { width: 100%; border-collapse: collapse; margin-top: 10px; }
.doc3-table .med-mini th { font-family: 'JetBrains Mono', monospace; font-size: 7px; letter-spacing: 0.13em; text-transform: uppercase; color: #BDA76C; font-weight: 700; text-align: left; padding: 0 8px 6px 0; border-bottom: 1.5px solid #E5E1D6; }
.doc3-table .med-mini th.r { text-align: right; padding-right: 0; }
.doc3-table .med-mini td { font-family: 'Manrope', sans-serif; font-size: 10.5px; color: #2F2F2F; padding: 6px 8px 6px 0; border-bottom: 1px solid #EFEBE0; vertical-align: top; }
.doc3-table .med-mini td.r { text-align: right; padding-right: 0; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; }
.doc3-table .med-mini tr:last-child td { border-bottom: 0; }
.doc3-table .med-mini .med-nota { font-family: 'Manrope', sans-serif; font-size: 8.5px; color: #8a8a8a; margin-top: 2px; }

/* ── 🔒 Contrato (doctrina 28-jul): aceptada = congelada ── */
.contrato-wrap { max-width: 620px; margin: 46px auto; }
.contrato-card { background: var(--card); border: 1px solid var(--gold); border-radius: 14px; padding: 30px 32px; text-align: center; }
.contrato-ico { font-size: 34px; margin-bottom: 6px; }
.contrato-card h2 { margin: 0 0 4px; font-size: 21px; }
.contrato-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--gold); margin-bottom: 14px; }
.contrato-card p { color: var(--txt2); font-size: 13.5px; line-height: 1.6; text-align: left; margin: 0 0 20px; }
.contrato-acciones { display: flex; flex-direction: column; gap: 8px; }
.contrato-acciones .btn { width: 100%; justify-content: center; }
.contrato-editar { opacity: .7; }
.contrato-editar:hover { opacity: 1; border-color: var(--red); color: var(--red); }
.contrato-banner { background: color-mix(in srgb, var(--gold) 12%, var(--card)); border-bottom: 1px solid var(--gold); color: var(--txt2); font-size: 12px; padding: 7px 24px; }
.contrato-banner b { color: var(--gold); }

/* ── Listado de Proyectos homogéneo (pedido César 28-jul): registro parejo ──
   Mayúsculas por CSS (los datos guardados no se tocan), folio en una sola
   línea y truncado con puntos suspensivos para que cada fila mida lo mismo. */
.q-row .folio { white-space: nowrap; }
.q-row .cli-n { text-transform: uppercase; letter-spacing: .015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-row .cli-s { text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── ✏️ Franja "En captura" (rediseño Inicio 28-jul): horizontal, bajo las 3
   verticales, y solo presente cuando hay borradores — cero tarjetas vacías. ── */
.ini-strip { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin-top: 14px; cursor: pointer; transition: border-color .15s ease; }
.ini-strip:hover { border-color: var(--gold); }
.ini-strip:hover .ini-go { color: var(--gold); }
.ini-strip-head { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.ini-strip-n { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; color: var(--txt2); background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.ini-strip-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.ini-chip { font-size: 11px; color: var(--txt2); background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ini-chip b { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 10px; color: var(--txt3); margin-right: 6px; }
.ini-chip-mas { color: var(--txt4); border-style: dashed; }
@media (max-width: 980px) { .ini-strip { flex-direction: column; align-items: flex-start; gap: 8px; } .ini-strip .ini-go { display: none; } }

/* ── Homogeneidad Inicio + columna Empresa (feedback César 28-jul, lote 2) ── */
.ini-row .ini-cli { text-transform: uppercase; font-size: 11.5px; letter-spacing: .01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ini-chip-cli { text-transform: uppercase; }
.ini-cols { display: flex; align-items: center; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--txt4); padding: 8px 0 4px; margin-top: 4px; border-bottom: 1px solid var(--line); }
.ini-cols-folio { min-width: 96px; flex: 0 0 auto; }
.ini-cols + .ini-row { border-top: 0; }
.q-row .cli-emp { text-transform: uppercase; font-size: 11px; color: var(--txt2); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.q-row .cli-emp-no { color: var(--txt4); }

/* ── ⚙☁ Config compartida: línea de estado en Ajustes ── */
.aj-cfg-erp { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--txt3); background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; margin-bottom: 14px; }

/* ── 📣 Avances para el cliente (panel OT · Rastreo 2.0) ── */
.otp-avances { display: flex; flex-direction: column; gap: 8px; }
.otp-av { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.otp-av .t { font-size: 12px; color: var(--txt2); }
.otp-av .m { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--txt4); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.otp-avdel { background: none; border: 0; color: var(--txt4); cursor: pointer; font-size: 10px; padding: 0 2px; }
.otp-avdel:hover { color: var(--red); }
.otp-avform { display: flex; gap: 8px; }
.otp-avform input { flex: 1; background: var(--input); border: 1px solid var(--input-line); border-radius: 8px; color: var(--txt); padding: 8px 10px; font-size: 12px; font-family: 'Manrope', sans-serif; }

/* ── Pipeline CRM ligero (P3 · 28-jul): sub-etapa, seguimiento 1-clic, aging ── */
.pc-crm { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.pc-crm .grow { flex: 1; }
.pc-etapa { -webkit-appearance: none; appearance: none; background: transparent; border: 1px dashed var(--line); color: var(--txt4); border-radius: 999px; font-size: 9.5px; padding: 2px 18px 2px 9px; cursor: pointer; font-family: 'Manrope', sans-serif; transition: border-color .12s ease; max-width: 150px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='7' height='5'><path d='M0 0l3.5 5L7 0z' fill='%238f8f8f'/></svg>"); background-repeat: no-repeat; background-position: right 7px center; }
.pc-etapa option { background: #1B1B1B; color: #CFCFCF; }
.pc-etapa.on { border-style: solid; color: var(--gold); border-color: rgba(189,167,108,.55); }
.pc-etapa:hover { border-color: var(--gold); color: var(--gold); }
.pc-act { background: var(--card2); border: 1px solid var(--line); border-radius: 7px; font-size: 11px; padding: 2px 7px; cursor: pointer; line-height: 1.4; }
.pc-act:hover { border-color: var(--gold); }
.pc-age { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.pc-age.ok { color: var(--txt4); }
.pc-age.warn { color: var(--gold); border-color: rgba(189,167,108,.6); }
.pc-age.bad { color: var(--red); border-color: var(--red); }

/* ── 📊 Contrato vs Realidad (P4 · 28-jul) ── */
.fv-real { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; border-radius: 999px; padding: 2px 8px; cursor: pointer; background: var(--card2); border: 1px solid; }
.fv-real.ok { color: var(--green); border-color: rgba(74,222,128,.5); }
.fv-real.bad { color: var(--red); border-color: var(--red); }
.fv-real-resumen { font-size: 11.5px; color: var(--txt3); background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; margin: 8px 0 10px; }
.fv-real-resumen .ok { color: var(--green); }
.fv-real-resumen .bad { color: var(--red); }
.cvr-modal { max-width: 560px; }
.cvr-head { display: grid; grid-template-columns: 104px 1fr 1.5fr; gap: 8px; font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: .12em; color: var(--txt4); padding: 10px 0 6px; border-bottom: 1px solid var(--line); }
.cvr-row { display: grid; grid-template-columns: 104px 1fr 1.5fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 12.5px; align-items: baseline; }
.cvr-row .k { color: var(--txt4); font-size: 11px; }
.cvr-row .a { color: var(--txt2); }
.cvr-row .b { color: var(--txt); }
.cvr-row i { font-style: normal; font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.cvr-row i.ok { color: var(--green); }
.cvr-row i.bad { color: var(--red); }
.cvr-nota { font-size: 11.5px; color: var(--txt3); background: var(--card2); border-radius: 8px; padding: 8px 10px; margin-top: 10px; }
.cvr-vered { font-size: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid; }
.cvr-vered.ok { color: var(--green); border-color: rgba(74,222,128,.4); background: rgba(74,222,128,.06); }
.cvr-vered.bad { color: var(--red); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.06); }

/* ── 🔍 Guardia v2: modo lectura del contrato ── */
.contrato-banner.lectura { border-bottom-color: #7c9fd4; }
.contrato-banner.lectura b { color: #7c9fd4; }
.paso-lectura input, .paso-lectura textarea, .paso-lectura select, .paso-lectura button { pointer-events: none !important; }
.paso-lectura input, .paso-lectura textarea, .paso-lectura select { opacity: .8; }
.paso-lectura button { opacity: .45; }

/* ── Producción: horas en su renglón + marca de pausa (28-jul) ── */
.prod-horas { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--txt3); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prod-horas b { color: var(--txt2); }
.prod-desv { border: 1px solid; border-radius: 999px; padding: 1px 7px; font-size: 8.5px; white-space: nowrap; }
.prod-desv.ok { color: var(--green); border-color: rgba(74,222,128,.5); }
.prod-desv.warn { color: var(--gold); border-color: rgba(189,167,108,.6); }
.prod-pausa { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; color: var(--gold); border: 1px dashed rgba(189,167,108,.6); border-radius: 6px; padding: 3px 8px; margin-top: 7px; }
/* Inicio: el seguimiento nunca se encima con el cliente */
.ini-row .ini-warn, .ini-row .ini-alerta, .ini-row .ini-dim, .ini-row .ini-est { white-space: nowrap; flex: 0 0 auto; }
