/* Estándar de procesos de Ensamble (estandar_procesos.js). Todo va bajo #estandar-procesos-page con prefijo ep-
   para no chocar con los estilos globales (tablas con min-width, modales al 90 %, etc.). */
#estandar-procesos-page {
    --ep-ink: #1b2440; --ep-muted: #667085; --ep-line: #e3e7f0; --ep-panel: #ffffff; --ep-soft: #f3f5fa;
    --ep-accent: var(--primary, #4361ee); --ep-accent-soft: #e8ecfd;
    --ep-solv: #a855d6; --ep-heat: #e8590c; --ep-heat-soft: #fdeee3; --ep-cool: #1c7ed6; --ep-cool-soft: #e3f1fc;
    --ep-ok: #1f8f4e; --ep-ok-soft: #e3f6ea; --ep-warn: #a8660c; --ep-warn-soft: #fdf3dc;
    --ep-metal: #c6cddb; --ep-metal-dark: #8a93a6; --ep-rubber: #2b2f3a;
}
#estandar-procesos-page .ep-raiz { color: var(--ep-ink); max-width: 1180px; margin: 0 auto; }
.ep-eyebrow { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ep-muted); font-weight: 600; display: block; }
.ep-h2 { font-size: 26px; font-weight: 700; margin: 0; line-height: 1.15; }
.ep-h3 { font-size: 17px; font-weight: 600; margin: 0; }
.ep-lbl { font-size: 12px; color: var(--ep-muted); }
.ep-valor { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ep-pend { color: var(--ep-warn); font-weight: 600; }
.ep-nota { font-size: 13px; color: var(--ep-muted); margin: 8px 0 0; }
.ep-panel { background: var(--ep-panel); border: 1px solid var(--ep-line); border-radius: 16px; padding: 18px; min-width: 0; }
.ep-pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; align-self: flex-start; }
.ep-p-tipo { background: var(--ep-accent-soft); color: var(--ep-accent); }
.ep-p-ok { background: var(--ep-ok-soft); color: var(--ep-ok); }
.ep-p-warn { background: var(--ep-warn-soft); color: var(--ep-warn); }
.ep-pills { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* Listado */
.ep-filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.ep-filtros input { flex: 1 1 220px; min-width: 0; max-width: 360px; }
.ep-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ep-chip { border: 1px solid var(--ep-line); background: var(--ep-panel); color: var(--ep-ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; }
.ep-chip[aria-pressed="true"] { background: var(--ep-ink); color: #fff; border-color: var(--ep-ink); }
.ep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ep-card { border: 1px solid var(--ep-line); background: var(--ep-panel); color: var(--ep-ink); border-radius: 14px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: border-color .15s; }
.ep-card:hover, .ep-card:focus-visible { border-color: var(--ep-accent); outline: none; }
.ep-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ep-ref { font-size: 20px; font-weight: 700; }
.ep-res { font-size: 13px; color: var(--ep-muted); font-variant-numeric: tabular-nums; }

/* Ficha */
.ep-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ep-ficha { display: flex; flex-direction: column; gap: 14px; }
.ep-ficha-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.ep-buje { display: flex; justify-content: center; }
.ep-buje svg { width: 100%; max-width: 230px; height: auto; }
.ep-metal { fill: var(--ep-metal); stroke: var(--ep-metal-dark); }
.ep-hueco { fill: none; stroke: var(--ep-metal-dark); }
.ep-caucho { fill: var(--ep-rubber); }
.ep-caucho-borde { fill: var(--ep-rubber); stroke: var(--ep-metal-dark); }
.ep-centro { fill: var(--ep-panel); stroke: var(--ep-metal-dark); }
.ep-medida { font: 700 10px system-ui, sans-serif; fill: #1f2a44; }
.ep-c-sin { stroke: #7f9cff; } .ep-c-con { stroke: #d08bf2; } .ep-c-pend { stroke: #f2b84b; }
.ep-leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ep-muted); }
.ep-leyenda i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.ep-l-sin { background: #7f9cff; } .ep-l-con { background: #d08bf2; } .ep-l-pend { background: #f2b84b; }
.ep-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ep-kv > div { background: var(--ep-soft); border-radius: 10px; padding: 9px 11px; min-width: 0; }
.ep-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* Ruta de pasos */
.ep-ruta { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.ep-est { flex: 1 0 122px; min-width: 122px; border: 1px solid var(--ep-line); background: var(--ep-panel); color: var(--ep-ink); border-radius: 12px; padding: 10px 10px 9px; text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.ep-est .ep-n { width: 24px; height: 24px; border-radius: 50%; background: var(--ep-soft); color: var(--ep-muted); font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.ep-est .ep-t { font-size: 13px; font-weight: 600; line-height: 1.25; }
.ep-est .ep-d, .ep-pt .ep-d { font-size: 11.5px; color: var(--ep-muted); font-variant-numeric: tabular-nums; }
.ep-est[aria-current="step"] { border-color: var(--ep-accent); background: var(--ep-accent-soft); }
.ep-est[aria-current="step"] .ep-n { background: var(--ep-accent); color: #fff; }
.ep-est.ep-horno .ep-n { background: var(--ep-heat-soft); color: var(--ep-heat); }
.ep-est.ep-frio .ep-n { background: var(--ep-cool-soft); color: var(--ep-cool); }

/* Paso */
.ep-paso { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; }
.ep-paso-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.ep-paso-num { font-size: 44px; font-weight: 700; line-height: 1; color: var(--ep-accent); font-variant-numeric: tabular-nums; }
.ep-ins { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.ep-params { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.ep-param { background: var(--ep-soft); border-radius: 10px; padding: 8px 12px; min-width: 120px; }
.ep-foto { border: 1.5px dashed var(--ep-line); border-radius: 12px; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ep-muted); font-size: 12.5px; text-align: center; padding: 12px; background: var(--ep-soft); }
.ep-media { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ep-video, .ep-img { width: 100%; height: auto; border-radius: 12px; background: var(--ep-soft); display: block; }
.ep-video { max-height: 72vh; object-fit: contain; background: #000; }
.ep-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Curva de horno */
#ep-curva svg { width: 100%; height: auto; display: block; }
.ep-curva-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.ep-seg { cursor: pointer; }
.ep-eje { stroke: var(--ep-line); stroke-width: 1; }
.ep-ax { font-size: 11px; fill: var(--ep-muted); }
.ep-cl { font-size: 12px; font-weight: 600; fill: var(--ep-heat); }
.ep-calor { stroke: var(--ep-heat); } .ep-frio-l { stroke: var(--ep-cool); } .ep-banda { fill: var(--ep-heat-soft); }

/* Tiempo estimado */
.ep-est-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.ep-est-form input { width: 140px; }
.ep-tira { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.ep-tira > div { border-radius: 10px; padding: 9px 11px; background: var(--ep-soft); min-width: 0; }
.ep-tira > .ep-caja-horno { background: var(--ep-heat-soft); }
.ep-procs { display: flex; flex-direction: column; gap: 6px; }
.ep-proc { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ep-line); border-radius: 12px; padding: 9px 12px; }
.ep-pn { width: 26px; height: 26px; border-radius: 50%; background: var(--ep-soft); color: var(--ep-muted); font-weight: 600; font-size: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.ep-proc-horno .ep-pn { background: var(--ep-heat-soft); color: var(--ep-heat); }
.ep-pt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ep-ptiempo { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 860px) {
    .ep-grid { grid-template-columns: minmax(0, 1fr); }
    .ep-paso { grid-template-columns: minmax(0, 1fr); }
    .ep-h2 { font-size: 22px; }
    .ep-proc { flex-wrap: wrap; }
}

/* Edición e historial (solo administración) */
.ep-admin { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ep-grupo { border: 1px solid var(--ep-line); border-radius: 12px; padding: 10px 12px 12px; margin: 0 0 12px; min-width: 0; }
.ep-grupo legend { float: none; width: auto; font-size: 13px; font-weight: 600; padding: 0 6px; margin: 0; color: var(--ep-ink); }
.ep-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ep-campo { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin: 0; }
.ep-motivo { margin-bottom: 8px; }
.ep-error { color: #c0392b; font-weight: 600; font-size: 13px; margin: 6px 0 0; min-height: 1em; }
.ep-hist { border: 1px solid var(--ep-line); border-radius: 12px; padding: 9px 12px; margin-bottom: 8px; }
.ep-hist-cab { font-size: 13px; margin-bottom: 4px; overflow-wrap: anywhere; }
.ep-hist-fila { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 2px 0; flex-wrap: wrap; }
.ep-hist-fila span:last-child { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
