/* =============================================================================
   EL PLAN DEL MES — identidad visual de la pestaña Plan de Control de Producción
   =============================================================================
   Etapa 3b.2b del RUNBOOK-PLAN-SIMULADOR. Scope `.plan-ui`, que vive ADENTRO de
   `.prod-ui` (el hub ya dibuja la barra y la secnav). Tratamiento plano, los
   tokens de tokens.css y nada más: el azul de marca hace un solo trabajo por
   pantalla (el foco y lo elegido), y el estado se dice con los semánticos.

   La base tipográfica se declara acá, sobre la raíz del scope, porque el hub
   no la declara en `.prod-ui` (sus otras pantallas siguen en Tailwind).

   TRAMPAS QUE ESTE ARCHIVO YA PAGÓ EN OTROS
   · Un `flex` parte la oración: los textos con negritas son un `<p>` o un
     `<span>` entero; las cajas de texto llevan `min-width: 0`.
   · Un ítem flex no se encoge: `min-width: 0` en las columnas y las cards.
   · La tabla ancha (el tablero) scrollea ADENTRO de `.tab-wrap`; el body no.
   · Las 8 familias tienen un color fijo en toda la pantalla; ok/warn/crit
     son otra cosa y no se mezclan con ellos.
   ========================================================================== */

.prod-ui .plan-ui {
    font-family: 'Segoe UI', -apple-system, system-ui, Roboto, Arial, sans-serif;
    font-size: 13.5px; line-height: 1.5; color: var(--ink);
    -webkit-font-smoothing: antialiased;
    display: flex; flex-direction: column; gap: 13px; min-width: 0;
    /* los colores de las familias: fijos, no semánticos */
    --pl-lin: #4d82c8; --pl-b25: #7a5c99; --pl-bb: #4f7a8c; --pl-imp: #9a8a5c;
    --pl-e200: #c26b2c; --pl-e500: #d99a5e; --pl-sob: #b8a07a; --pl-jug: #2f8f86;
    --pl-off: repeating-linear-gradient(135deg, #f3f4f7 0 4px, #e6e9ee 4px 6px);
}
.prod-ui .plan-ui *, .prod-ui .plan-ui *::before, .prod-ui .plan-ui *::after { box-sizing: border-box; }
.prod-ui .plan-ui p { margin: 0; }
.prod-ui .plan-ui h6 { margin: 0; }
.prod-ui .plan-ui :focus-visible { outline: 2px solid var(--navy-300); outline-offset: 2px; }
.prod-ui .plan-ui .tbl-wrap { overflow-x: auto; min-width: 0; }
/* El atributo `hidden` pierde contra un `display` de autor (trampa §7 del
   manual): la tira de avisos del reparto es flex y se dibujaba vacía. */
.prod-ui .plan-ui [hidden] { display: none !important; }

/* ---- los controles ---- */
.prod-ui .plan-ui select, .prod-ui .plan-ui input[type=number], .prod-ui .plan-ui input[type=text] {
    font: inherit; font-size: 12.5px; color: var(--ink); background: var(--surface);
    border: 1px solid var(--hair-strong); border-radius: 8px; padding: 4px 8px; height: 30px;
}
.prod-ui .plan-ui input[type=number] { width: 74px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.prod-ui .plan-ui input[type=range] { width: 100%; accent-color: var(--navy); margin: 0; }
.prod-ui .plan-ui .chk { display: grid; grid-template-columns: 15px 1fr; gap: 7px; align-items: start; font-size: 12.5px; cursor: pointer; }
.prod-ui .plan-ui .chk input { width: 15px; height: 15px; accent-color: var(--navy); margin-top: 2px; }
.prod-ui .plan-ui .chk small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }
.prod-ui .plan-ui .plan-btn {
    font: inherit; font-size: 12px; font-weight: 700; height: 30px; padding: 0 12px; border-radius: 9px;
    border: 1px solid var(--hair-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.prod-ui .plan-ui .plan-btn.primario { background: var(--navy); color: #fff; border-color: transparent; }
.prod-ui .plan-ui .plan-btn.sutil { border-color: transparent; color: var(--navy-500); background: var(--navy-050); }

/* ---- la cabecera: modo · vista · mes ---- */
.prod-ui .plan-ui .plan-modo {
    background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 12px; padding: 9px 16px; flex-wrap: wrap;
}
.prod-ui .plan-ui .plan-modo .cap, .prod-ui .plan-ui .prod-tira .cap { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.prod-ui .plan-ui .plan-seg { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.prod-ui .plan-ui .plan-seg button {
    font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 14px; border: 0; background: var(--surface); color: var(--muted);
    cursor: pointer; border-right: 1px solid var(--hair-strong);
}
.prod-ui .plan-ui .plan-seg button:last-child { border-right: 0; }
.prod-ui .plan-ui .plan-seg button[aria-pressed="true"] { background: var(--navy-050); color: var(--navy); font-weight: 700; box-shadow: inset 0 -2.5px 0 var(--navy); }
.prod-ui .plan-ui .plan-seg button:disabled { color: var(--faint); cursor: default; }
.prod-ui .plan-ui .plan-seg button:focus-visible { outline-offset: -2px; }
.prod-ui .plan-ui .plan-modo .expl { font-size: 12px; color: var(--muted); max-width: 62ch; min-width: 0; }
.prod-ui .plan-ui .plan-modo .expl b { color: var(--ink); }
.prod-ui .plan-ui .prod-chip.nav { background: var(--navy-050); border-color: var(--navy-300); color: var(--navy-500); }
.prod-ui .plan-ui .prod-chip.nav b { color: var(--navy); }
.prod-ui .plan-ui .prod-tira.sin { box-shadow: none; padding: 6px 10px; margin-top: 8px; }

/* ---- las cards y la grilla de tres ---- */
.prod-ui .plan-ui .plan-3 { display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; gap: 13px; align-items: start; }
.prod-ui .plan-ui .plan-col { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.prod-ui .plan-ui .plan-card {
    background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card); box-shadow: var(--shadow);
    padding: 13px 15px 14px; min-width: 0;
}
.prod-ui .plan-ui .plan-card .ch { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.prod-ui .plan-ui .plan-card .ch h6 { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.prod-ui .plan-ui .plan-card .ch .sub { font-size: 11px; color: var(--muted); min-width: 0; }
.prod-ui .plan-ui .plan-card .ch .der { margin-left: auto; font-size: 11px; color: var(--navy-500); font-weight: 700; cursor: pointer; background: none; border: 0; font-family: inherit; }
.prod-ui .plan-ui .plan-card.destacada { border: 1.5px solid var(--navy-300); box-shadow: 0 1px 2px rgba(20,40,80,.06), 0 10px 28px rgba(0,43,107,.12); container-type: inline-size; }
.prod-ui .plan-ui .plan-card.destacada .ch h6 { font-size: 15px; }
.prod-ui .plan-ui .plan-espera { padding: 40px 16px; text-align: center; color: var(--muted); font-style: italic; }
.prod-ui .plan-ui .plan-error h6 { font-size: 15px; margin-bottom: 6px; }
.prod-ui .plan-ui .plan-error ul { margin: 6px 0 10px; padding-left: 20px; color: var(--muted); }
.prod-ui .plan-ui .plan-error .plan-btn { margin-top: 8px; }
@media (max-width: 1100px) { .prod-ui .plan-ui .plan-3 { grid-template-columns: 1fr 1fr; } .prod-ui .plan-ui .plan-3 > .plan-col:nth-child(2) { grid-column: 1 / -1; grid-row: 1; } }
@media (max-width: 720px)  { .prod-ui .plan-ui .plan-3 { grid-template-columns: 1fr; } .prod-ui .plan-ui .plan-3 > .plan-col:nth-child(2) { grid-column: auto; grid-row: auto; } }

/* ---- las palancas ---- */
.prod-ui .plan-ui .grupo { border-top: 1px solid var(--hair); padding-top: 9px; margin-top: 9px; }
.prod-ui .plan-ui .grupo:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prod-ui .plan-ui .grupo .gt { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.prod-ui .plan-ui .grupo .gt .orig { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 10.5px; text-align: right; min-width: 0; }
.prod-ui .plan-ui .fila { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 0; font-size: 12.5px; }
.prod-ui .plan-ui .fila label { color: var(--ink); font-weight: 500; min-width: 0; }
.prod-ui .plan-ui .fila label small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; line-height: 1.3; }
.prod-ui .plan-ui .fila .val { font-weight: 700; font-variant-numeric: tabular-nums; padding-right: 8px; }
.prod-ui .plan-ui .fila.range { grid-template-columns: 1fr; gap: 2px; }
.prod-ui .plan-ui .fila.range .rl { display: flex; justify-content: space-between; font-size: 12.5px; }
.prod-ui .plan-ui .fila.range .rl b { font-variant-numeric: tabular-nums; }
.prod-ui .plan-ui .rrhh { background: var(--canvas); border: 1px solid var(--hair); border-radius: 9px; padding: 8px 10px; font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-bottom: 7px; }
.prod-ui .plan-ui .rrhh b { color: var(--ink); }
.prod-ui .plan-ui .rrhh .fer { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy-500); }
.prod-ui .plan-ui .puestos { display: grid; grid-template-columns: minmax(0, 1fr) 44px 58px; gap: 3px 6px; font-size: 12px; align-items: center; }
.prod-ui .plan-ui .puestos .ph { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: right; }
.prod-ui .plan-ui .puestos .ph:first-child { text-align: left; }
.prod-ui .plan-ui .puestos input { width: 58px; height: 26px; padding: 2px 6px; }
.prod-ui .plan-ui .puestos .pn { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prod-ui .plan-ui .puestos .base { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.prod-ui .plan-ui .puestos .base.sup { font-style: italic; color: var(--faint); }
.prod-ui .plan-ui .puestos input.dif { border-color: var(--navy-300); background: var(--navy-050); }
.prod-ui .plan-ui .aviso { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 10px; line-height: 1.45; }
.prod-ui .plan-ui .aviso b { color: var(--ink); }
.prod-ui .plan-ui .aviso.sin { border-top: 0; margin-top: 2px; padding-top: 0; }
.prod-ui .plan-ui .aviso.crit { color: var(--crit); }
.prod-ui .plan-ui .aviso.crit b { color: var(--crit); }

/* ---- el objetivo por familia ---- */
.prod-ui .plan-ui .obj-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.prod-ui .plan-ui .oh { background: var(--canvas); border: 1px solid var(--hair); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.prod-ui .plan-ui .oh .l { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.prod-ui .plan-ui .oh .v { font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.prod-ui .plan-ui .oh .v small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.prod-ui .plan-ui .oh .v.warn { color: var(--warn); } .prod-ui .plan-ui .oh .v.crit { color: var(--crit); } .prod-ui .plan-ui .oh .v.ok { color: var(--ok); }
.prod-ui .plan-ui .oh .s { font-size: 11px; color: var(--muted); margin-top: 1px; }
.prod-ui .plan-ui .obj-grupo { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 8px 0 2px; border-bottom: 1px solid var(--hair); }
.prod-ui .plan-ui .of { display: grid; grid-template-columns: 150px minmax(0, 1fr) 100px auto minmax(0, 1.15fr); gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.prod-ui .plan-ui .of:last-child { border-bottom: 0; }
.prod-ui .plan-ui .of .fn { font-size: 12.5px; font-weight: 600; line-height: 1.25; min-width: 0; }
.prod-ui .plan-ui .of .fn .nm { display: block; }
.prod-ui .plan-ui .of .fn small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }
.prod-ui .plan-ui .of .fn .fam { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-500); margin-bottom: 1px; }
.prod-ui .plan-ui .of .sl { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.prod-ui .plan-ui .of .sl .sc { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.prod-ui .plan-ui .of input[type=number] { width: 100px; height: 28px; }
.prod-ui .plan-ui .of .qk { display: flex; gap: 3px; }
.prod-ui .plan-ui .of .qk button { font: inherit; font-size: 10.5px; font-weight: 700; padding: 3px 6px; border: 1px solid var(--hair-strong); background: var(--surface); border-radius: 6px; color: var(--muted); cursor: pointer; line-height: 1; white-space: nowrap; }
.prod-ui .plan-ui .of .qk button:hover { color: var(--navy); border-color: var(--navy-300); }
.prod-ui .plan-ui .of .res { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; align-items: center; min-width: 0; }
.prod-ui .plan-ui .of .bt { height: 12px; border-radius: 6px; background: var(--canvas); border: 1px solid var(--hair); position: relative; }
.prod-ui .plan-ui .of .bt i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy-300); border-radius: 5px 0 0 5px; }
.prod-ui .plan-ui .of .bt i.warn { background: var(--warn); } .prod-ui .plan-ui .of .bt i.crit { background: var(--crit); }
.prod-ui .plan-ui .of .bt em { position: absolute; top: -4px; bottom: -4px; width: 2.5px; background: var(--ink); border-radius: 1px; }
.prod-ui .plan-ui .of .fv { font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.2; }
.prod-ui .plan-ui .of .fv small { display: block; font-weight: 600; font-size: 10.5px; color: var(--muted); white-space: normal; line-height: 1.25; }
.prod-ui .plan-ui .of .fv.warn { color: var(--warn); } .prod-ui .plan-ui .of .fv.crit { color: var(--crit); } .prod-ui .plan-ui .of .fv.ok { color: var(--ok); }
/* Las filas se acomodan al ancho de LA TARJETA (container query), no al de la
   ventana: con el rail abierto en una laptop la tarjeta mide 530 px aunque la
   ventana mida 1.366, y en una fila de cinco columnas el deslizador quedaba en
   67 px, los atajos partidos y el resultado cortado. Lo vio Chrome, no el banco.
   · < 820 px (una tarjeta de 1.440 mide ~750): dos renglones — nombre | deslizador | número / nombre | atajos | resultado
   · < 430 px (el celular): apilado. */
@container (max-width: 820px) {
    .prod-ui .plan-ui .obj-head { grid-template-columns: 1fr 1fr; }
    .prod-ui .plan-ui .of { grid-template-columns: 150px auto minmax(0, 1fr) 100px; grid-template-areas: "fn sl sl num" "fn qk res res"; row-gap: 6px; }
    .prod-ui .plan-ui .of .fn { grid-area: fn; } .prod-ui .plan-ui .of .sl { grid-area: sl; } .prod-ui .plan-ui .of input[type=number] { grid-area: num; justify-self: end; }
    .prod-ui .plan-ui .of .qk { grid-area: qk; } .prod-ui .plan-ui .of .res { grid-area: res; }
}
@container (max-width: 430px) {
    .prod-ui .plan-ui .obj-head { grid-template-columns: 1fr 1fr; }
    .prod-ui .plan-ui .of { grid-template-columns: minmax(0, 1fr) 100px; grid-template-areas: "fn num" "sl sl" "qk res"; }
    .prod-ui .plan-ui .of .res { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ---- la planta que resulta ---- */
.prod-ui .plan-ui .chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.prod-ui .plan-ui .chain + .chain { margin-top: 8px; }
.prod-ui .plan-ui .cn { background: var(--canvas); border: 1px solid var(--hair); border-radius: 10px; padding: 9px 12px; position: relative; min-width: 0; }
.prod-ui .plan-ui .cn .l { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.prod-ui .plan-ui .cn .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.prod-ui .plan-ui .cn .v small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.prod-ui .plan-ui .cn .s { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.prod-ui .plan-ui .cn.warn { border-color: var(--warn-hair); background: var(--warn-050); } .prod-ui .plan-ui .cn.warn .v, .prod-ui .plan-ui .cn.warn .s { color: var(--warn); }
.prod-ui .plan-ui .cn.crit { border-color: var(--crit-hair); background: var(--crit-050); } .prod-ui .plan-ui .cn.crit .v, .prod-ui .plan-ui .cn.crit .s { color: var(--crit); }
.prod-ui .plan-ui .cn:not(:last-child)::after { content: ""; position: absolute; right: -7px; top: 50%; width: 6px; height: 6px; border-right: 2px solid var(--hair-strong); border-bottom: 2px solid var(--hair-strong); transform: translateY(-50%) rotate(-45deg); }
@media (max-width: 900px) { .prod-ui .plan-ui .chain { grid-template-columns: 1fr 1fr; } .prod-ui .plan-ui .cn::after { display: none; } }
.prod-ui .plan-ui .restr { border-radius: 10px; padding: 11px 14px; border: 1px solid var(--hair); background: var(--canvas); margin-top: 10px; }
.prod-ui .plan-ui .restr .l { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.prod-ui .plan-ui .restr .t { font-size: 14px; font-weight: 700; margin-top: 3px; letter-spacing: -.01em; }
.prod-ui .plan-ui .restr .s { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.prod-ui .plan-ui .restr .avs .av { display: inline; }
.prod-ui .plan-ui .restr .avs .av + .av::before { content: " · "; }
.prod-ui .plan-ui .restr.warn { background: var(--warn-050); border-color: var(--warn-hair); } .prod-ui .plan-ui .restr.warn .t { color: var(--warn); }
.prod-ui .plan-ui .restr.crit { background: var(--crit-050); border-color: var(--crit-hair); } .prod-ui .plan-ui .restr.crit .t { color: var(--crit); }
.prod-ui .plan-ui .restr.ok { background: var(--ok-050); border-color: var(--ok-hair); } .prod-ui .plan-ui .restr.ok .t { color: var(--ok); }

/* ---- lo que hace falta ---- */
.prod-ui .plan-ui .nec { width: 100%; border-collapse: collapse; font-size: 12px; }
.prod-ui .plan-ui .nec th { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: right; padding: 4px 5px; border-bottom: 1.5px solid var(--hair-strong); }
.prod-ui .plan-ui .nec th:first-child { text-align: left; }
.prod-ui .plan-ui .nec td { padding: 4px 5px; border-bottom: 1px solid var(--hair); text-align: right; font-variant-numeric: tabular-nums; }
.prod-ui .plan-ui .nec td:first-child { text-align: left; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.prod-ui .plan-ui .nec td.d { color: var(--crit); font-weight: 700; }
.prod-ui .plan-ui .nec td.s { color: var(--navy-500); font-weight: 700; }
.prod-ui .plan-ui .nec td.sobra { color: var(--faint); }
.prod-ui .plan-ui .nec tr.tot td { font-weight: 700; border-top: 1.5px solid var(--hair-strong); border-bottom: 0; }
.prod-ui .plan-ui .inf { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.prod-ui .plan-ui .inf .it { position: relative; font-size: 12px; line-height: 1.4; padding: 6px 9px 6px 24px; border-radius: 8px; border: 1px solid var(--hair); background: var(--canvas); }
.prod-ui .plan-ui .inf .it::before { content: ""; position: absolute; left: 9px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.prod-ui .plan-ui .inf .it.crit { background: var(--crit-050); border-color: var(--crit-hair); color: var(--crit); } .prod-ui .plan-ui .inf .it.crit::before { background: var(--crit); }
.prod-ui .plan-ui .inf .it.nav { background: var(--navy-050); border-color: var(--navy-300); color: var(--navy-500); } .prod-ui .plan-ui .inf .it.nav::before { background: var(--navy-500); }
.prod-ui .plan-ui .inf .it.ok { background: var(--ok-050); border-color: var(--ok-hair); color: var(--ok); } .prod-ui .plan-ui .inf .it.ok::before { background: var(--ok); }
.prod-ui .plan-ui .big { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.prod-ui .plan-ui .big small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.prod-ui .plan-ui .big.warn { color: var(--warn); }
.prod-ui .plan-ui .r-mini { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.prod-ui .plan-ui .r-mini .rw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; padding: 2px 0; border-bottom: 1px solid var(--hair); }
.prod-ui .plan-ui .r-mini .rw:last-child { border-bottom: 0; }
.prod-ui .plan-ui .r-mini .rw .nm { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-ui .plan-ui .r-mini .rw .dd { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod-ui .plan-ui .r-mini .rw .dd .cr { color: var(--crit); }

/* ---- insumos ---- */
.prod-ui .plan-ui .ins { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.prod-ui .plan-ui .ins th { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: right; padding: 6px 8px; border-bottom: 1.5px solid var(--hair-strong); white-space: nowrap; }
.prod-ui .plan-ui .ins th:first-child, .prod-ui .plan-ui .ins th:nth-child(2) { text-align: left; }
.prod-ui .plan-ui .ins td { padding: 5px 8px; border-bottom: 1px solid var(--hair); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod-ui .plan-ui .ins td:first-child, .prod-ui .plan-ui .ins td:nth-child(2) { text-align: left; }
.prod-ui .plan-ui .ins td:first-child { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-500); }
.prod-ui .plan-ui .ins td:nth-child(2) { font-weight: 600; white-space: normal; }
/* El detalle de una celda va DEBAJO del dato, en cualquier columna: en la del
   stock, «al guardar el plan» pegado al número se leía «124 kgal guardar el
   plan» (visto en Insumos el 30/08/2026). Antes esto valía sólo para la
   segunda columna, la del nombre. */
.prod-ui .plan-ui .ins td small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }
/* 3b.5 · lo que está EN CAMINO. Va DEBAJO del dato, nunca mezclado con él: la
   columna de stock sigue diciendo lo que HAY y esto es una promesa, no un kilo
   en el depósito. Por eso no hereda el color del veredicto de la celda (la
   cobertura crítica pinta su td en rojo) y se planta en su propio tono. */
.prod-ui .plan-ui .ins td small.cam { color: var(--navy-500); font-weight: 600; font-style: normal; }
/* El encabezado de la columna lleva su aclaración en dos renglones. */
.prod-ui .plan-ui .ins th small { display: block; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--faint); font-size: 9.5px; }
.prod-ui .plan-ui .ins td.cr { color: var(--crit); font-weight: 700; } .prod-ui .plan-ui .ins td.wr { color: var(--warn); font-weight: 700; } .prod-ui .plan-ui .ins td.okk { color: var(--ok); font-weight: 700; }
.prod-ui .plan-ui .ins td.aus { color: var(--faint); font-style: italic; text-align: left; }
.prod-ui .plan-ui .ins .cob { display: inline-flex; align-items: center; gap: 6px; }
.prod-ui .plan-ui .ins .cob .bt { width: 70px; height: 7px; border-radius: 4px; background: var(--canvas); border: 1px solid var(--hair); position: relative; overflow: hidden; }
.prod-ui .plan-ui .ins .cob .bt i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy-300); }
.prod-ui .plan-ui .ins .cob .bt i.cr { background: var(--crit); } .prod-ui .plan-ui .ins .cob .bt i.wr { background: var(--warn); }

/* ---- el tablero: el reparto ---- */
.prod-ui .plan-ui .reparto { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
@media (max-width: 1100px) { .prod-ui .plan-ui .reparto { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px)  { .prod-ui .plan-ui .reparto { grid-template-columns: 1fr; } }
.prod-ui .plan-ui .rp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 7px 10px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface); border-left-width: 4px; min-width: 0; }
.prod-ui .plan-ui .rp .n { font-size: 12px; font-weight: 700; letter-spacing: -.01em; min-width: 0; }
.prod-ui .plan-ui .rp .n small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; line-height: 1.3; }
.prod-ui .plan-ui .rp .ctl { display: flex; align-items: center; gap: 4px; justify-self: end; }
.prod-ui .plan-ui .rp .ctl input[type=number] { width: 52px; height: 26px; padding: 2px 5px; font-size: 12px; }
.prod-ui .plan-ui .rp .ctl select { height: 26px; padding: 1px 4px; font-size: 11.5px; }
.prod-ui .plan-ui .rp .ctl .u { font-size: 10.5px; color: var(--muted); }
.prod-ui .plan-ui .rp .da { grid-column: 1 / -1; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.prod-ui .plan-ui .rp .da b { color: var(--ink); }
.prod-ui .plan-ui .rp .da .warn { color: var(--warn); font-weight: 700; } .prod-ui .plan-ui .rp .da .crit { color: var(--crit); font-weight: 700; } .prod-ui .plan-ui .rp .da .ok { color: var(--ok); font-weight: 700; }
.prod-ui .plan-ui .rp.lin { border-left-color: var(--pl-lin); } .prod-ui .plan-ui .rp.b25 { border-left-color: var(--pl-b25); } .prod-ui .plan-ui .rp.bb { border-left-color: var(--pl-bb); } .prod-ui .plan-ui .rp.imp { border-left-color: var(--pl-imp); }
.prod-ui .plan-ui .rp.e200 { border-left-color: var(--pl-e200); } .prod-ui .plan-ui .rp.e500 { border-left-color: var(--pl-e500); } .prod-ui .plan-ui .rp.sob { border-left-color: var(--pl-sob); } .prod-ui .plan-ui .rp.jug { border-left-color: var(--pl-jug); }
.prod-ui .plan-ui .rp-acts { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* ---- el tablero: la leyenda y la tabla ---- */
.prod-ui .plan-ui .leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; color: var(--muted); align-items: center; margin-left: auto; }
.prod-ui .plan-ui .leyenda i, .prod-ui .plan-ui .tab td.rec i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.08); }
.prod-ui .plan-ui .tab td.rec i { width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.prod-ui .plan-ui i.lin { background: var(--pl-lin); } .prod-ui .plan-ui i.b25 { background: var(--pl-b25); } .prod-ui .plan-ui i.bb { background: var(--pl-bb); } .prod-ui .plan-ui i.imp { background: var(--pl-imp); }
.prod-ui .plan-ui i.e200 { background: var(--pl-e200); } .prod-ui .plan-ui i.e500 { background: var(--pl-e500); } .prod-ui .plan-ui i.sob { background: var(--pl-sob); } .prod-ui .plan-ui i.jug { background: var(--pl-jug); }
.prod-ui .plan-ui .leyenda .off i { background: var(--pl-off); }
.prod-ui .plan-ui .leyenda .apag i { background: var(--surface); border: 1px dashed var(--hair-strong); }
.prod-ui .plan-ui .leyenda .falta i { background: var(--crit-050); border: 1px dashed var(--crit); }
.prod-ui .plan-ui .tab-wrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface); min-width: 0; }
.prod-ui .plan-ui table.tab { border-collapse: separate; border-spacing: 0; font-size: 11px; width: 100%; min-width: 1180px; }
.prod-ui .plan-ui table.tab th, .prod-ui .plan-ui table.tab td { border-bottom: 1px solid var(--hair); border-right: 1px solid #eef1f5; padding: 0; height: 30px; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; }
.prod-ui .plan-ui table.tab th { font-weight: 600; color: var(--muted); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.prod-ui .plan-ui table.tab th.dia { width: 34px; line-height: 1.1; padding: 4px 0; }
.prod-ui .plan-ui table.tab th.dia small { display: block; font-size: 9.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; }
.prod-ui .plan-ui table.tab th.dia.sab { color: var(--navy-500); }
.prod-ui .plan-ui table.tab th.dia.off { background: var(--pl-off); color: var(--faint); }
.prod-ui .plan-ui table.tab th.rec, .prod-ui .plan-ui table.tab td.rec { position: sticky; left: 0; z-index: 3; background: var(--surface); text-align: left; padding: 0 10px; width: 172px; min-width: 172px; font-weight: 600; color: var(--ink); white-space: nowrap; border-right: 1px solid var(--hair-strong); }
.prod-ui .plan-ui table.tab td.rec small { color: var(--muted); font-weight: 400; margin-left: 5px; font-size: 10px; }
.prod-ui .plan-ui table.tab th.tot, .prod-ui .plan-ui table.tab td.tot { position: sticky; right: 0; z-index: 3; background: var(--canvas); width: 88px; min-width: 88px; font-weight: 700; border-left: 1px solid var(--hair-strong); text-align: right; padding: 0 10px; }
.prod-ui .plan-ui table.tab td.tot small { display: block; font-weight: 500; color: var(--muted); font-size: 10px; line-height: 1.1; }
.prod-ui .plan-ui table.tab tr.grp td { background: #fafbfc; height: 20px; }
.prod-ui .plan-ui table.tab tr.grp td.rec { font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); background: #fafbfc; }
.prod-ui .plan-ui table.tab td.c { cursor: pointer; background: var(--surface); position: relative; }
.prod-ui .plan-ui table.tab td.c:hover { box-shadow: inset 0 0 0 2px var(--navy-300); z-index: 1; }
.prod-ui .plan-ui table.tab td.c.off { background: var(--pl-off); cursor: default; }
.prod-ui .plan-ui table.tab td.c.off:hover { box-shadow: none; }
.prod-ui .plan-ui table.tab td.c.falta { background: var(--crit-050); box-shadow: inset 0 0 0 1px var(--crit); }
.prod-ui .plan-ui table.tab td.c.on { color: #fff; font-weight: 700; }
.prod-ui .plan-ui table.tab td.c.on.lin { background: var(--pl-lin); }
.prod-ui .plan-ui table.tab td.c.on.b25 { background: var(--pl-b25); }
.prod-ui .plan-ui table.tab td.c.on.bb { background: var(--pl-bb); }
.prod-ui .plan-ui table.tab td.c.on.imp { background: var(--pl-imp); }
.prod-ui .plan-ui table.tab td.c.on.e200 { background: var(--pl-e200); }
.prod-ui .plan-ui table.tab td.c.on.e500 { background: var(--pl-e500); }
.prod-ui .plan-ui table.tab td.c.on.sob { background: var(--pl-sob); color: var(--ink); }
.prod-ui .plan-ui table.tab td.c.on.jug { background: var(--pl-jug); }
.prod-ui .plan-ui table.tab td.c.presta::after { content: ""; position: absolute; right: 3px; top: 3px; width: 5px; height: 5px; border-radius: 50%; background: #fff; opacity: .85; }
.prod-ui .plan-ui table.tab tr.pie td { background: var(--canvas); font-weight: 600; color: var(--ink); height: 26px; }
.prod-ui .plan-ui table.tab tr.pie td.rec { background: var(--canvas); }
.prod-ui .plan-ui table.tab tr.pie td.off { background: var(--pl-off); color: var(--faint); }
.prod-ui .plan-ui table.tab tr.pie td.falta { color: var(--crit); background: var(--crit-050); font-weight: 700; }
.prod-ui .plan-ui table.tab tr.pie td.sobra { color: var(--ok); }
.prod-ui .plan-ui table.tab tr.kg td { height: 44px; vertical-align: bottom; }
.prod-ui .plan-ui table.tab tr.kg td span.v { display: block; font-size: 9.5px; color: var(--muted); font-weight: 600; line-height: 1; }
.prod-ui .plan-ui .kgbar { display: block; margin: 0 5px 3px; background: var(--pl-lin); border-radius: 2px 2px 0 0; opacity: .85; min-height: 2px; }
.prod-ui .plan-ui .kgbar.men { background: var(--navy-300); opacity: .55; }

/* A 390 las dos columnas fijas se comen los días: la de recursos se angosta y
   pierde el subtítulo, y la de totales deja de ser fija (queda al final del
   scroll, como una columna más). */
@media (max-width: 720px) {
    .prod-ui .plan-ui table.tab th.rec, .prod-ui .plan-ui table.tab td.rec { width: 118px; min-width: 118px; padding: 0 6px; font-size: 10.5px; }
    .prod-ui .plan-ui table.tab td.rec small { display: none; }
    .prod-ui .plan-ui table.tab th.tot, .prod-ui .plan-ui table.tab td.tot { position: static; }
}

/* ---- lo que el mes da ---- */
.prod-ui .plan-ui .da-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 1100px) { .prod-ui .plan-ui .da-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .prod-ui .plan-ui .da-grid { grid-template-columns: 1fr 1fr; } }
.prod-ui .plan-ui .dg { border: 1px solid var(--hair); border-radius: 9px; padding: 7px 9px; background: var(--surface); border-top-width: 3px; min-width: 0; }
.prod-ui .plan-ui .dg .l { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-ui .plan-ui .dg .v { font-size: 15px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.prod-ui .plan-ui .dg .s { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-ui .plan-ui .dg .bt { height: 5px; border-radius: 3px; background: var(--canvas); margin-top: 5px; overflow: hidden; }
.prod-ui .plan-ui .dg .bt i { display: block; height: 100%; background: var(--navy-300); }
.prod-ui .plan-ui .dg.warn .v { color: var(--warn); } .prod-ui .plan-ui .dg.warn .bt i { background: var(--warn); }
.prod-ui .plan-ui .dg.crit .v { color: var(--crit); } .prod-ui .plan-ui .dg.crit .bt i { background: var(--crit); }
.prod-ui .plan-ui .dg.ok .v { color: var(--ok); } .prod-ui .plan-ui .dg.ok .bt i { background: var(--ok); }
.prod-ui .plan-ui .dg.lin { border-top-color: var(--pl-lin); } .prod-ui .plan-ui .dg.b25 { border-top-color: var(--pl-b25); } .prod-ui .plan-ui .dg.bb { border-top-color: var(--pl-bb); } .prod-ui .plan-ui .dg.imp { border-top-color: var(--pl-imp); }
.prod-ui .plan-ui .dg.e200 { border-top-color: var(--pl-e200); } .prod-ui .plan-ui .dg.e500 { border-top-color: var(--pl-e500); } .prod-ui .plan-ui .dg.sob { border-top-color: var(--pl-sob); } .prod-ui .plan-ui .dg.jug { border-top-color: var(--pl-jug); }

@media (prefers-reduced-motion: reduce) { .prod-ui .plan-ui * { animation: none !important; transition: none !important; } }

/* ---- 3b.3: las paradas del plan (días de no producción además de los de RRHH) ---- */
.prod-ui .plan-ui .paradas { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.prod-ui .plan-ui .paradas:empty { display: none; }
.prod-ui .plan-ui .paradas .pa { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink); background: var(--warn-050); border: 1px solid var(--warn-hair); border-radius: 999px; padding: 2px 4px 2px 9px; min-width: 0; }
.prod-ui .plan-ui .paradas .pa b { font-variant-numeric: tabular-nums; }
.prod-ui .plan-ui .paradas .pa button { font: inherit; font-size: 13px; line-height: 1; width: 18px; height: 18px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.prod-ui .plan-ui .paradas .pa button:hover { background: var(--surface); color: var(--crit); }
.prod-ui .plan-ui .parada-add { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; align-items: center; }
.prod-ui .plan-ui .parada-add input[type=date] { height: 28px; padding: 2px 6px; font: inherit; font-size: 12px; border: 1px solid var(--hair-strong); border-radius: 7px; background: var(--surface); color: var(--ink); min-width: 0; }
.prod-ui .plan-ui .parada-add input[type=text] { min-width: 0; width: 100%; }
.prod-ui .plan-ui .parada-add .plan-btn { grid-column: 1 / -1; justify-self: start; height: 26px; font-size: 11.5px; }

/* ---- 3b.3: la escalera ---- */
.prod-ui .plan-ui .esc { width: 100%; border-collapse: collapse; font-size: 12px; }
.prod-ui .plan-ui .esc th { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 4px 6px; border-bottom: 1.5px solid var(--hair-strong); white-space: nowrap; }
.prod-ui .plan-ui .esc th.n { text-align: right; }
.prod-ui .plan-ui .esc td { padding: 6px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.prod-ui .plan-ui .esc td:first-child { white-space: nowrap; }
.prod-ui .plan-ui .esc td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod-ui .plan-ui .esc td.n small { color: var(--muted); font-size: 11px; }
.prod-ui .plan-ui .esc td.st-td { white-space: nowrap; text-align: right; }
.prod-ui .plan-ui .esc td.st-td .plan-btn { margin-left: 6px; height: 24px; font-size: 11px; padding: 0 8px; }
.prod-ui .plan-ui .esc .paso { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--navy-050); color: var(--navy-500); font-weight: 700; font-size: 11px; margin-right: 7px; vertical-align: middle; }
.prod-ui .plan-ui .esc .que { display: inline-block; min-width: 0; font-weight: 600; }
.prod-ui .plan-ui .esc .que small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; line-height: 1.35; }
.prod-ui .plan-ui .esc tr.na td, .prod-ui .plan-ui .esc tr.na .que, .prod-ui .plan-ui .esc tr.na .que small { color: var(--faint); }
.prod-ui .plan-ui .esc tr.na .paso { background: var(--canvas); color: var(--faint); }
.prod-ui .plan-ui .esc tr.llega td { background: var(--ok-050); }
.prod-ui .plan-ui .esc tr.llega .paso { background: var(--ok); color: #fff; }
.prod-ui .plan-ui .st { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--hair); color: var(--muted); background: var(--canvas); vertical-align: middle; }
.prod-ui .plan-ui .st.ok { color: var(--ok); background: var(--ok-050); border-color: var(--ok-hair); }
.prod-ui .plan-ui .st.wr { color: var(--warn); background: var(--warn-050); border-color: var(--warn-hair); }
.prod-ui .plan-ui .st.mut { color: var(--faint); }

/* ---- 3b.3: los escenarios ---- */
.prod-ui .plan-ui .guardar-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; padding: 9px 10px; border: 1px dashed var(--navy-300); border-radius: 10px; background: var(--navy-050); }
.prod-ui .plan-ui .guardar-form input[type=text] { flex: 1 1 260px; min-width: 0; height: 30px; }
.prod-ui .plan-ui .escs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.prod-ui .plan-ui .escn { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 5px 7px 5px 11px; border-radius: 10px; border: 1px solid var(--hair-strong); background: var(--surface); color: var(--ink); cursor: pointer; min-width: 0; max-width: 100%; }
.prod-ui .plan-ui .escn:hover { border-color: var(--navy-300); }
.prod-ui .plan-ui .escn:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 1px; }
.prod-ui .plan-ui .escn b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.prod-ui .plan-ui .escn .k { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }
.prod-ui .plan-ui .escn.on { border-color: var(--navy-500); box-shadow: 0 0 0 2px var(--navy-050); }
.prod-ui .plan-ui .escn.vig { background: var(--ok-050); border-color: var(--ok-hair); }
.prod-ui .plan-ui .escn.vacio { border-style: dashed; color: var(--faint); cursor: default; }
.prod-ui .plan-ui .escn .x { font: inherit; font-size: 14px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.prod-ui .plan-ui .escn .x:hover { background: var(--crit-050); color: var(--crit); }
.prod-ui .plan-ui .tag { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); background: var(--ok-050); border: 1px solid var(--ok-hair); border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
.prod-ui .plan-ui .esc-acts { display: flex; gap: 8px; margin-bottom: 10px; }
.prod-ui .plan-ui .cmp { width: 100%; border-collapse: collapse; font-size: 12px; }
.prod-ui .plan-ui .cmp th { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: right; padding: 5px 7px; border-bottom: 1.5px solid var(--hair-strong); white-space: nowrap; }
.prod-ui .plan-ui .cmp th:first-child, .prod-ui .plan-ui .cmp th:nth-child(2) { text-align: left; }
.prod-ui .plan-ui .cmp td { padding: 5px 7px; border-bottom: 1px solid var(--hair); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prod-ui .plan-ui .cmp td:first-child, .prod-ui .plan-ui .cmp td:nth-child(2) { text-align: left; }
.prod-ui .plan-ui .cmp td:first-child { font-weight: 600; }
.prod-ui .plan-ui .cmp td:first-child small { font-weight: 400; color: var(--muted); }
.prod-ui .plan-ui .cmp td.okk { color: var(--ok); font-weight: 700; }
.prod-ui .plan-ui .cmp td.wr { color: var(--warn); font-weight: 700; }
.prod-ui .plan-ui .cmp td.cr { color: var(--crit); font-weight: 700; }
.prod-ui .plan-ui .cmp td.quien { color: var(--muted); font-size: 11px; }
.prod-ui .plan-ui .cmp tr.on td { background: var(--navy-050); }
