/* Public/src/modules/horizonte/horizonte-ui.css
   =============================================================================
   HORIZONTE DE DESPACHOS · la identidad de la casa (core/tokens.css), lámina 3
   (docs/horizonte/03-horizonte-prototipo-v2.html: ES la especificación).
   TODO va scopeado bajo `.hz-ui` y con prefijo `hz-`. Cabecera lite: la barra
   la publica el armazón (shellBarraDe); acá viven la secnav, los KPIs, la tira,
   la cinta y los dos modales.
   ============================================================================= */

.hz-ui {
    --hz-ok-050: #eef7f3;   --hz-ok-hair: #c7e4d7;
    --hz-warn-050: #fdf3e5; --hz-warn-hair: #f2ddbb; --hz-warn-bar: #e39a2a;
    --hz-crit-050: #fdecec; --hz-crit-hair: #f3c9c9;
    --hz-navy-100: #c9d8f0;
    --hz-ease: cubic-bezier(.2, .7, .2, 1);
    --hz-pista: #e9edf3;    /* el fondo de toda barra */
    --hz-mut: #c3cad6;
    color: var(--ink);
    font-size: 13.5px;
    line-height: 1.5;
}
/* `#page-horizonte` declara `data-shell="full"`: el armazón da el alto y deja el scroll al módulo. */
.hz-ui.hz-shell { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.hz-ui button { font: inherit; cursor: pointer; }
.hz-ui button:focus-visible, .hz-ui [tabindex]:focus-visible { outline: 2px solid var(--navy-300); outline-offset: 2px; }
.hz-ui .num { font-variant-numeric: tabular-nums; }

/* ── secnav ─────────────────────────────────────────────────────────────── */
.hz-ui .hz-secnav { background: var(--surface); border-bottom: 1px solid var(--hair); display: flex; gap: 2px; padding: 0 var(--gutter, 20px); flex: none; }
.hz-ui .hz-secnav button { position: relative; padding: 11px 15px 10px; font-size: 13px; font-weight: 600; color: var(--muted); border: 0; background: none;
    border-bottom: 2.5px solid transparent; transition: color .18s, background .18s; }
.hz-ui .hz-secnav button.on { color: var(--navy); border-bottom-color: var(--navy); background: var(--navy-050); }
.hz-ui .hz-secnav button .n { font-variant-numeric: tabular-nums; opacity: .65; margin-left: 5px; font-size: 11.5px; }
.hz-ui .hz-secnav button .n.crit { opacity: 1; color: var(--crit); }
.hz-ui .hz-secnav .hz-estado { margin-left: auto; align-self: center; font-size: 11.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.hz-ui .hz-secnav .hz-estado i { width: 8px; height: 8px; border-radius: 50%; background: var(--hz-mut); display: inline-block; }
.hz-ui .hz-secnav .hz-estado.corre i { background: var(--navy-300); animation: hz-late 1s ease-in-out infinite; }
@keyframes hz-late { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ── el cuerpo ───────────────────────────────────────────────────────────── */
.hz-ui .hz-cuerpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px var(--gutter, 20px) 28px; display: flex; flex-direction: column; gap: 12px; }
.hz-ui .hz-vista { animation: hz-ap .28s var(--hz-ease); display: flex; flex-direction: column; gap: 12px; }
@keyframes hz-ap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hz-ui .hz-aviso { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card, 14px); padding: 14px 16px; color: var(--muted); }
.hz-ui .hz-aviso b { color: var(--ink); }
.hz-ui .hz-aviso.crit { border-color: var(--hz-crit-hair); background: var(--hz-crit-050); color: var(--crit); }
.hz-ui .hz-nota { font-size: 12px; color: var(--muted); margin: 0; }
.hz-ui .hz-faltantes { font-size: 11.5px; color: var(--faint); line-height: 1.4; }
.hz-ui .hz-faltantes b { color: var(--warn); font-weight: 600; }

/* ── la tira (ver · filas · interruptores) ───────────────────────────────── */
.hz-ui .hz-tira { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card, 14px); box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 10px; padding: 8px 14px; flex-wrap: wrap; min-height: 48px; }
.hz-ui .hz-tira .cap { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-right: 2px; }
.hz-ui .hz-tira .sep { width: 1px; height: 22px; background: var(--hair-strong); margin: 0 4px; }
.hz-ui .hz-seg { display: inline-flex; border: 1px solid var(--hair-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.hz-ui .hz-seg button { font-size: 12.5px; font-weight: 600; padding: 5px 12px; color: var(--muted); border: 0; background: var(--surface);
    border-right: 1px solid var(--hair-strong); transition: background .16s, color .16s; }
.hz-ui .hz-seg button:last-child { border-right: 0; }
.hz-ui .hz-seg button.on { background: var(--navy-050); color: var(--navy); font-weight: 700; box-shadow: inset 0 -2.5px 0 var(--navy); }
.hz-ui .hz-sw { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 0; }
.hz-ui .hz-sw i { width: 34px; height: 20px; border-radius: 999px; background: #cfd6e2; position: relative; transition: background .2s; flex: none; }
.hz-ui .hz-sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s var(--hz-ease); }
.hz-ui .hz-sw.on i { background: var(--navy); }
.hz-ui .hz-sw.on i::after { transform: translateX(14px); }
.hz-ui .hz-sw.on { color: var(--navy); }

/* ── piezas chicas: chips, estados, barras ───────────────────────────────── */
.hz-ui .hz-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--hair-strong); color: var(--muted); background: var(--surface); white-space: nowrap; }
.hz-ui .hz-chip b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.hz-ui .hz-chip.nav { background: var(--navy-050); border-color: var(--navy-300); color: var(--navy-500); }
.hz-ui .hz-chip.nav b { color: var(--navy); }
.hz-ui .hz-est { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 1px 6px; white-space: nowrap; line-height: 1.5; }
.hz-ui .hz-est.ok { color: var(--ok); background: var(--hz-ok-050); }
.hz-ui .hz-est.warn { color: var(--warn); background: var(--hz-warn-050); }
.hz-ui .hz-est.crit { color: var(--crit); background: var(--hz-crit-050); }
.hz-ui .hz-est.nav { color: var(--navy-500); background: var(--navy-050); }
.hz-ui .hz-est.mut { color: var(--faint); background: #eef0f4; }
.hz-ui .hz-est.link { cursor: pointer; }
.hz-ui .hz-est.link:hover { filter: brightness(.94); }
.hz-ui .hz-sbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--hz-pista); }
.hz-ui .hz-sbar i { display: block; height: 100%; transition: width .55s var(--hz-ease); min-width: 0; }
.hz-ui .hz-sbar i.ok { background: var(--ok); } .hz-ui .hz-sbar i.warn { background: var(--hz-warn-bar); } .hz-ui .hz-sbar i.crit { background: var(--crit); }
.hz-ui .hz-sbar i.nav { background: var(--navy); } .hz-ui .hz-sbar i.nav2 { background: var(--navy-300); } .hz-ui .hz-sbar i.nav3 { background: var(--hz-navy-100); }
.hz-ui .hz-track { position: relative; height: 8px; border-radius: 4px; background: var(--hz-pista); overflow: hidden; }
.hz-ui .hz-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--navy-300); transition: width .55s var(--hz-ease); }
.hz-ui .hz-track i.ok { background: var(--ok); } .hz-ui .hz-track i.warn { background: var(--hz-warn-bar); } .hz-ui .hz-track i.crit { background: var(--crit); }
.hz-ui .hz-track i.nav { background: var(--navy); } .hz-ui .hz-track i.pr { background: var(--ok); }
.hz-ui .hz-track i.out { background: var(--hz-warn-bar); } .hz-ui .hz-track i.out.crit { background: var(--crit); }
.hz-ui .hz-track.tick::after { content: ""; position: absolute; top: -1px; bottom: -1px; width: 2px; background: var(--navy-700); left: var(--tick, 50%); opacity: .55; }
.hz-ui .hz-leg2 { display: flex; gap: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; line-height: 1.3; }
.hz-ui .hz-leg2 i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; vertical-align: 0; background: var(--hz-mut); }
.hz-ui .hz-leg2 i.ok { background: var(--ok); } .hz-ui .hz-leg2 i.warn { background: var(--hz-warn-bar); } .hz-ui .hz-leg2 i.crit { background: var(--crit); }
.hz-ui .hz-leg2 i.nav { background: var(--navy); } .hz-ui .hz-leg2 i.nav2 { background: var(--navy-300); } .hz-ui .hz-leg2 i.nav3 { background: var(--hz-navy-100); }
.hz-ui .hz-leg2 i.hoy { background: var(--navy-050); border: 1px solid var(--hair-strong); }
.hz-ui .hz-leg2 b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── los seis KPIs ───────────────────────────────────────────────────────── */
.hz-ui .hz-kpis { display: grid; grid-template-columns: 1.05fr .95fr 1.3fr .85fr 1fr 1.55fr; gap: 10px; }
.hz-ui .hz-kpi { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card, 14px); box-shadow: var(--shadow);
    padding: 11px 14px 12px; display: flex; flex-direction: column; gap: 7px; min-width: 0; position: relative; }
.hz-ui .hz-kpi .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hz-ui .hz-kpi .v { font-size: 27px; font-weight: 800; letter-spacing: -.025em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); transition: color .3s; }
.hz-ui .hz-kpi .v small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.hz-ui .hz-kpi .v.crit { color: var(--crit); } .hz-ui .hz-kpi .v.ok { color: var(--ok); } .hz-ui .hz-kpi .v.warn { color: var(--warn); }
.hz-ui .hz-kpi .sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.hz-ui .hz-kpi .sub b { color: var(--ink); }
.hz-ui .hz-kpi .chips { display: flex; gap: 4px; flex-wrap: wrap; }
.hz-ui .hz-kpi .chips .hz-est { font-size: 10px; }
.hz-ui .hz-kpi .sub .hz-est { white-space: normal; display: inline-block; line-height: 1.35; }
.hz-ui .hz-kpi .chips .mas { font-size: 10.5px; color: var(--muted); align-self: center; }
.hz-ui .hz-kpi.flash { animation: hz-kf .8s var(--hz-ease); }
@keyframes hz-kf { 0% { box-shadow: 0 0 0 3px var(--navy-300); } 100% { box-shadow: var(--shadow); } }
.hz-ui .hz-covs { display: flex; flex-direction: column; gap: 5px; margin-top: -2px; }
.hz-ui .hz-cov { display: grid; grid-template-columns: 84px 1fr 54px; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); }
.hz-ui .hz-cov b { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hz-ui .hz-cov .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.hz-ui .hz-cov .r.crit { color: var(--crit); } .hz-ui .hz-cov .r.warn { color: var(--warn); } .hz-ui .hz-cov .r.ok { color: var(--ok); }

/* ── la cinta ────────────────────────────────────────────────────────────── */
.hz-ui .hz-tabwrap { overflow: auto; max-height: calc(100vh - 290px); min-height: 280px; border: 1px solid var(--hair); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.hz-ui table.hz-tab { border-collapse: separate; border-spacing: 0; font-size: 11px; width: 100%; color: var(--ink); }
.hz-ui table.hz-tab th, .hz-ui table.hz-tab td { border-bottom: 1px solid var(--hair); border-right: 1px solid #eef1f5; padding: 0 3px; height: 44px; text-align: center;
    vertical-align: middle; font-variant-numeric: tabular-nums; transition: background .18s, box-shadow .18s, opacity .25s; }
.hz-ui table.hz-tab thead th { font-weight: 600; color: var(--muted); background: #f3f6fc; position: sticky; top: 0; z-index: 2; height: 54px; border-bottom: 1px solid var(--hair-strong); }
.hz-ui table.hz-tab th.dia { min-width: 60px; padding: 4px 2px; cursor: pointer; }
.hz-ui table.hz-tab.n28 th.dia { min-width: 42px; }
.hz-ui table.hz-tab th.dia.off { cursor: default; }
.hz-ui .hz-db { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 46px; padding: 4px 5px 3px; border-radius: 9px;
    border: 1px solid var(--hz-navy-100); background: var(--surface); color: var(--navy); font-weight: 800; font-size: 14px; line-height: 1;
    box-shadow: 0 1px 0 rgba(20, 40, 80, .1); transition: background .16s, color .16s, transform .16s, box-shadow .16s; }
.hz-ui .hz-db small { display: block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--navy-500); margin-top: 2px; }
.hz-ui table.hz-tab.n28 .hz-db { min-width: 34px; font-size: 12px; padding: 3px 3px 2px; }
.hz-ui table.hz-tab th.dia:hover .hz-db, .hz-ui table.hz-tab th.dia.hl .hz-db { background: var(--navy); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 43, 107, .28); }
.hz-ui table.hz-tab th.dia:hover .hz-db small, .hz-ui table.hz-tab th.dia.hl .hz-db small { color: var(--hz-navy-100); }
.hz-ui .hz-db.hoy { background: var(--navy); color: #fff; }
.hz-ui .hz-db.hoy small { color: var(--hz-navy-100); }
.hz-ui .hz-db.off { background: transparent; border-color: transparent; box-shadow: none; color: var(--faint); font-weight: 600; }
.hz-ui .hz-db.off small { color: var(--faint); }
.hz-ui .hz-db.fer small { color: var(--warn); }
.hz-ui table.hz-tab th.rec, .hz-ui table.hz-tab td.rec { position: sticky; left: 0; z-index: 3; background: var(--surface); text-align: left; padding: 0 10px; width: 258px; min-width: 258px;
    font-weight: 600; color: var(--ink); white-space: nowrap; border-right: 1px solid var(--hair-strong); }
.hz-ui table.hz-tab th.rec { z-index: 4; background: #f3f6fc; }
.hz-ui table.hz-tab th.rec .hint { display: block; font-size: 10.5px; color: var(--navy-500); font-weight: 600; }
.hz-ui table.hz-tab td.rec .an { display: flex; align-items: center; gap: 6px; justify-content: space-between; line-height: 1.2; }
.hz-ui table.hz-tab td.rec .an span.nm { overflow: hidden; text-overflow: ellipsis; }
.hz-ui table.hz-tab td.rec .cv { display: grid; grid-template-columns: 1fr 78px; gap: 7px; align-items: center; margin-top: 4px; }
.hz-ui table.hz-tab td.rec .cv .hz-track { height: 7px; }
.hz-ui table.hz-tab td.rec .cv .r { font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hz-ui table.hz-tab td.rec .cv .r b { color: var(--ink); }
.hz-ui table.hz-tab td.rec.link { cursor: pointer; }
.hz-ui table.hz-tab td.rec.link:hover .nm { color: var(--navy-500); }
.hz-ui table.hz-tab tr.grp td { background: #fafbfc; height: 24px; font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 0 10px; cursor: pointer; user-select: none; }
.hz-ui table.hz-tab tr.grp td .chev { display: inline-block; transition: transform .2s var(--hz-ease); margin-right: 6px; font-size: 10px; }
.hz-ui table.hz-tab tr.grp.cerrado td .chev { transform: rotate(-90deg); }
.hz-ui table.hz-tab tr.grp td .cnt { margin-left: 8px; color: var(--faint); letter-spacing: 0; text-transform: none; font-weight: 600; }
.hz-ui table.hz-tab tr.grp td .cnt .crit { color: var(--crit); }
.hz-ui table.hz-tab tr.oculta { display: none; }
.hz-ui table.hz-tab td.off { background: #f4f5f8; }
.hz-ui table.hz-tab td.c { position: relative; line-height: 1.15; cursor: pointer; }
.hz-ui table.hz-tab td.c:hover { box-shadow: inset 0 0 0 2px var(--navy-300); z-index: 1; }
.hz-ui table.hz-tab td.c b { display: block; font-size: 12px; }
.hz-ui table.hz-tab td.c small { display: block; font-size: 9.5px; color: var(--muted); }
.hz-ui table.hz-tab td.c small.pr { color: var(--ok); font-weight: 700; }
.hz-ui table.hz-tab td.c small.pr.prop { color: var(--ok); opacity: .75; font-weight: 600; }
.hz-ui table.hz-tab td.c.crit { background: var(--hz-crit-050); box-shadow: inset 0 0 0 1px var(--crit); }
.hz-ui table.hz-tab td.c.crit b { color: var(--crit); }
.hz-ui table.hz-tab td.c.crit:hover { box-shadow: inset 0 0 0 2px var(--crit); }
.hz-ui table.hz-tab td.c.warn { background: var(--hz-warn-050); }
.hz-ui table.hz-tab td.c.warn b { color: var(--warn); }
.hz-ui table.hz-tab td.c.ok b { color: var(--ink); font-weight: 600; }
.hz-ui table.hz-tab td.c.prod { background: var(--hz-ok-050); }
.hz-ui table.hz-tab td.c.prod.prop { background: var(--surface); box-shadow: inset 0 0 0 1px var(--hz-ok-hair);
    background-image: repeating-linear-gradient(135deg, transparent 0 7px, var(--hz-ok-050) 7px 14px); }
.hz-ui table.hz-tab td.c.nav { background: var(--navy-050); }
.hz-ui table.hz-tab td.c.nav b { color: var(--navy); }
.hz-ui table.hz-tab td.c.pron { color: var(--faint); }
.hz-ui table.hz-tab td.c.pron small { color: #9aa5b5; font-style: italic; }
.hz-ui table.hz-tab td.c.pron.crit small { color: var(--crit); }
.hz-ui table.hz-tab td.c.sel { box-shadow: inset 0 0 0 2.5px var(--navy) !important; z-index: 1; }
.hz-ui table.hz-tab td.hl { background-color: #f6f8fc; }
.hz-ui table.hz-tab tr:hover td:not(.rec):not(.off) { background-color: #f6f8fc; }
.hz-ui table.hz-tab tr:hover td.c.crit { background-color: #fbe2e2; }
.hz-ui table.hz-tab tr:hover td.c.prod { background-color: #e3f1ea; }
.hz-ui table.hz-tab tr:hover td.c.nav { background-color: #e2eaf7; }
.hz-ui table.hz-tab td.flash { animation: hz-cf .9s var(--hz-ease); }
@keyframes hz-cf { 0% { box-shadow: inset 0 0 0 3px var(--navy-300); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.hz-ui table.hz-tab tr.cam td { height: 40px; }
.hz-ui table.hz-tab tr.cam td.c b { font-size: 13px; }
.hz-ui table.hz-tab tr.cam td.c.crit { box-shadow: none; }
.hz-ui table.hz-tab tr.cam td.c .hz-sbar { height: 4px; margin: 3px 4px 0; gap: 1px; }
.hz-ui table.hz-tab tr.pla td { height: 34px; background: #fafbfd; font-size: 10.5px; color: var(--muted); }
.hz-ui table.hz-tab tr.pla td.fer { color: var(--warn); font-weight: 700; }
.hz-ui table.hz-tab tr.pla td .lin { display: inline-block; font-weight: 700; color: var(--navy); background: var(--navy-050); border-radius: 6px; padding: 0 6px; }
.hz-ui table.hz-tab tr.pla td .lin.sup { background: transparent; color: var(--faint); border: 1px dashed var(--hair-strong); font-weight: 600; }
.hz-ui .hz-pie { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); padding: 2px 4px; }
.hz-ui .hz-pie i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hz-ui .hz-pie .fin { margin-left: auto; }

/* ── el modal (del día y del artículo) ───────────────────────────────────── */
.hz-ui .hz-velo { position: fixed; inset: 0; background: rgba(10, 25, 55, .38); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 120; backdrop-filter: blur(1.5px); }
.hz-ui .hz-velo.on { opacity: 1; pointer-events: auto; }
.hz-ui .hz-modal { position: fixed; left: 50%; top: 50%; width: 980px; max-width: 95vw; max-height: 92vh; transform: translate(-50%, -50%) scale(.96); opacity: 0;
    background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px rgba(10, 25, 55, .4); z-index: 121; display: flex; flex-direction: column; pointer-events: none;
    transition: opacity .22s, transform .3s var(--hz-ease); overflow: hidden; }
.hz-ui .hz-modal.on { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.hz-ui .hz-modal .mh { padding: 16px 22px 13px; border-bottom: 1px solid var(--hair); display: flex; gap: 14px; align-items: flex-start; background: var(--surface); }
.hz-ui .hz-modal .mh h4 { margin: 0; font-size: 19px; letter-spacing: -.015em; line-height: 1.2; font-weight: 700; }
.hz-ui .hz-modal .mh h4 span { color: var(--muted); font-weight: 600; }
.hz-ui .hz-modal .mh .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hz-ui .hz-modal .mh .x { margin-left: auto; border: 0; background: var(--canvas); font-size: 20px; color: var(--muted); line-height: 1; width: 34px; height: 34px; border-radius: 10px; flex: none; }
.hz-ui .hz-modal .mh .x:hover { background: var(--hair); }
.hz-ui .hz-modal .mh .nav { display: flex; gap: 4px; margin-left: auto; margin-right: 8px; }
.hz-ui .hz-modal .mh .nav + .x { margin-left: 0; }
.hz-ui .hz-modal .mh .nav button { border: 1px solid var(--hair-strong); background: var(--surface); border-radius: 9px; width: 34px; height: 34px; color: var(--navy-500); font-size: 16px; }
.hz-ui .hz-modal .mh .nav button:hover { background: var(--navy-050); }
.hz-ui .hz-modal .mb { padding: 14px 22px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.hz-ui .hz-mtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hz-ui .hz-mt { border: 1px solid var(--hair); border-radius: 12px; padding: 10px 13px 11px; background: #fafbfd; display: flex; flex-direction: column; gap: 6px; min-width: 0; animation: hz-ap .3s var(--hz-ease); }
.hz-ui .hz-mt .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.hz-ui .hz-mt .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.hz-ui .hz-mt .v small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.hz-ui .hz-mt .v.crit { color: var(--crit); } .hz-ui .hz-mt .v.ok { color: var(--ok); } .hz-ui .hz-mt .v.warn { color: var(--warn); } .hz-ui .hz-mt .v.nav { color: var(--navy); }
.hz-ui .hz-mt .sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.hz-ui .hz-m2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
.hz-ui .hz-hc { border: 1px solid var(--hair); border-radius: 12px; padding: 11px 13px 12px; min-width: 0; }
.hz-ui .hz-hc h6 { margin: 0 0 8px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hz-ui .hz-hc h6 span { letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--muted); }
.hz-ui table.hz-lis { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hz-ui table.hz-lis th { text-align: left; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 700; padding: 0 6px 5px; border-bottom: 1px solid var(--hair-strong); }
.hz-ui table.hz-lis th.k { text-align: right; }
.hz-ui table.hz-lis td { padding: 7px 6px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.hz-ui table.hz-lis tr:last-child td { border-bottom: 0; }
.hz-ui table.hz-lis tr.cl { cursor: pointer; }
.hz-ui table.hz-lis tr.cl:hover td { background: #f6f8fc; }
.hz-ui table.hz-lis td.k { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.hz-ui table.hz-lis td.n b { display: block; font-weight: 700; }
.hz-ui table.hz-lis td.n small { display: block; color: var(--muted); }
.hz-ui table.hz-lis td.d { color: var(--muted); white-space: nowrap; width: 56px; }
.hz-ui table.hz-lis td.mut { color: var(--faint); }
.hz-ui table.hz-lis td.fin { text-align: right; }
.hz-ui table.hz-lis td .num { color: var(--muted); }
.hz-ui .hz-sb { display: grid; grid-template-columns: 140px 1fr 196px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 12px; }
.hz-ui .hz-sb:last-child { border-bottom: 0; }
.hz-ui .hz-sb .nm { font-weight: 700; cursor: pointer; line-height: 1.2; }
.hz-ui .hz-sb .nm small { display: block; color: var(--muted); font-weight: 400; }
.hz-ui .hz-sb .nm:hover { color: var(--navy-500); }
.hz-ui .hz-sb .hz-track { height: 10px; }
.hz-ui .hz-sb .nums { display: flex; justify-content: flex-end; gap: 10px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.hz-ui .hz-sb .nums b { color: var(--ink); }
.hz-ui .hz-sb .nums b.crit { color: var(--crit); } .hz-ui .hz-sb .nums b.ok { color: var(--ok); } .hz-ui .hz-sb .nums b.warn { color: var(--warn); }
.hz-ui .hz-cob { background: var(--navy-050); border: 1px solid var(--navy-300); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.hz-ui .hz-cob b { color: var(--navy); }
.hz-ui .hz-cob.ok { background: var(--hz-ok-050); border-color: var(--hz-ok-hair); } .hz-ui .hz-cob.ok b { color: var(--ok); }
.hz-ui .hz-cob.crit { background: var(--hz-crit-050); border-color: var(--hz-crit-hair); } .hz-ui .hz-cob.crit b { color: var(--crit); }
.hz-ui .hz-cob.warn { background: var(--hz-warn-050); border-color: var(--hz-warn-hair); } .hz-ui .hz-cob.warn b { color: var(--warn); }
.hz-ui .hz-cob .hz-nota { margin-top: 6px; }
.hz-ui .hz-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; color: #fff; background: var(--navy); border: 0; border-radius: 8px; padding: 6px 11px; transition: transform .15s, background .15s; }
.hz-ui .hz-btn:hover { background: var(--navy-700); }
.hz-ui .hz-btn:active { transform: scale(.97); }
.hz-ui .hz-btn.sec { background: var(--surface); color: var(--navy-500); border: 1px solid var(--hair-strong); }
.hz-ui .hz-btn.sec:hover { background: var(--navy-050); }
.hz-ui .hz-stepper-nota { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.4; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.hz-ui .hz-stepper-nota b { color: var(--ink); }
/* el gráfico del artículo */
.hz-ui .hz-chart { width: 100%; height: 150px; display: block; }
.hz-ui .hz-chart rect.b { transition: height .4s var(--hz-ease), y .4s var(--hz-ease); }
.hz-ui .hz-chart rect.b.ok { fill: var(--navy-300); } .hz-ui .hz-chart rect.b.crit { fill: var(--crit); } .hz-ui .hz-chart rect.b.sel { stroke: var(--navy-700); stroke-width: 2; }
.hz-ui .hz-chart rect.b.pr { fill: var(--ok); }
.hz-ui .hz-chart text { font-size: 9.5px; fill: var(--muted); font-family: inherit; }
.hz-ui .hz-chart text.v { font-weight: 700; fill: var(--ink); }
.hz-ui .hz-chart line.z { stroke: var(--ink); stroke-width: 1; }
.hz-ui .hz-chart line.res { stroke: var(--navy-700); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.hz-ui .hz-chart line.g { stroke: var(--hair); stroke-width: 1; }
.hz-ui .hz-chart .d { cursor: pointer; }
.hz-ui .hz-chart .d:hover rect.b { opacity: .8; }
.hz-ui .hz-chart rect.hoy { fill: var(--navy-050); }
.hz-ui .hz-chart rect.off { fill: #f4f5f8; }
.hz-ui .hz-wf { display: grid; grid-template-columns: 110px 1fr 76px; gap: 6px 10px; align-items: center; font-size: 12px; }
.hz-ui .hz-wf .l { color: var(--muted); font-weight: 600; }
.hz-ui .hz-wf .l small { display: block; font-weight: 400; font-size: 10.5px; }
.hz-ui .hz-wf .l.tot, .hz-ui .hz-wf .m.tot, .hz-ui .hz-wf .r.tot { border-top: 1px solid var(--hair); padding-top: 6px; }
.hz-ui .hz-wf .l.tot { color: var(--ink); }
.hz-ui .hz-wf .r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.hz-ui .hz-wf .r.crit { color: var(--crit); } .hz-ui .hz-wf .r.ok { color: var(--ok); } .hz-ui .hz-wf .r.pr { color: var(--ok); }
.hz-ui .hz-wf .hz-track { height: 12px; }

/* ── «Qué producir» (etapa 4): la tira, la grilla de líneas y «Con este régimen» ── */
.hz-ui .hz-prog { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.hz-ui .hz-presets { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.hz-ui .hz-presets .hz-chip { cursor: pointer; transition: transform .15s, background .15s; }
.hz-ui .hz-presets .hz-chip:hover:not(:disabled) { background: var(--navy-050); }
.hz-ui .hz-presets .hz-chip:active:not(:disabled) { transform: scale(.97); }
.hz-ui .hz-presets .hz-chip:disabled { cursor: default; opacity: .6; }
.hz-ui .hz-chip.ok { background: var(--hz-ok-050); border-color: var(--hz-ok-hair); color: var(--ok); } .hz-ui .hz-chip.ok b { color: var(--ok); }
.hz-ui .hz-stepper { display: inline-flex; align-items: center; border: 1px solid var(--hair-strong); border-radius: 8px; overflow: hidden; background: var(--surface); vertical-align: middle; }
.hz-ui .hz-stepper button { width: 22px; height: 24px; border: 0; background: var(--surface); color: var(--navy-500); font-weight: 800; font-size: 13px; line-height: 1; padding: 0; transition: background .15s; }
.hz-ui .hz-stepper button:hover:not(:disabled) { background: var(--navy-050); }
.hz-ui .hz-stepper button:disabled { color: var(--hz-mut); cursor: default; }
.hz-ui .hz-stepper b { min-width: 22px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0 2px; }
.hz-ui .hz-stepper.sup b { color: var(--faint); }
.hz-ui .hz-stepper.sup { border-style: dashed; }
.hz-ui .hz-stepper-nota .hz-stepper { margin: 0 4px; }
.hz-ui .hz-stepper-nota span { color: var(--faint); }
.hz-ui .hz-gridwrap { overflow-x: auto; }
.hz-ui table.hz-grid { border-collapse: separate; border-spacing: 0; font-size: 11px; width: 100%; }
.hz-ui table.hz-grid th, .hz-ui table.hz-grid td { border-bottom: 1px solid var(--hair); border-right: 1px solid #eef1f5; height: 30px; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; padding: 0 2px; transition: background .2s; }
.hz-ui table.hz-grid th { font-weight: 600; color: var(--muted); line-height: 1.1; padding: 4px 1px 5px; min-width: 66px; }
.hz-ui table.hz-grid th small { display: block; font-size: 9.5px; color: var(--faint); text-transform: uppercase; margin-bottom: 3px; }
.hz-ui table.hz-grid th small.real { color: var(--navy); font-weight: 700; text-transform: none; font-size: 11px; margin: 4px 0 0; }
.hz-ui table.hz-grid th.hoy { color: var(--navy); box-shadow: inset 0 -3px 0 var(--navy); }
.hz-ui table.hz-grid th.off, .hz-ui table.hz-grid td.off { background: #f4f5f8; color: var(--faint); }
.hz-ui table.hz-grid th .hz-stepper { margin-top: 1px; }
.hz-ui table.hz-grid td.rec, .hz-ui table.hz-grid th.rec { text-align: left; padding: 0 8px; font-weight: 600; white-space: nowrap; width: 120px; min-width: 120px; border-right: 1px solid var(--hair-strong); }
.hz-ui table.hz-grid td.rec small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; }
.hz-ui table.hz-grid td.l span { display: block; margin: 2px; border-radius: 6px; font-size: 10px; font-weight: 700; padding: 3px 2px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: hz-ap .3s var(--hz-ease); cursor: pointer; }
.hz-ui table.hz-grid td.l span:hover { filter: brightness(.94); }
.hz-ui table.hz-grid td.l span.a0, .hz-ui .hz-leg i.a0 { background: var(--navy); color: #fff; }
.hz-ui table.hz-grid td.l span.a1, .hz-ui .hz-leg i.a1 { background: #2f63b5; color: #fff; }
.hz-ui table.hz-grid td.l span.a2, .hz-ui .hz-leg i.a2 { background: #7fa9e8; color: #0b2350; }
.hz-ui table.hz-grid td.l span.a3, .hz-ui .hz-leg i.a3 { background: #b8cff0; color: #0b2350; }
.hz-ui table.hz-grid td.l span.a4, .hz-ui .hz-leg i.a4 { background: #d9e5f7; color: #0b2350; }
.hz-ui table.hz-grid td.l span.a5, .hz-ui .hz-leg i.a5 { background: #eef3fb; color: #154a94; border: 1px solid var(--hz-navy-100); }
.hz-ui table.hz-grid td.l span.hoy, .hz-ui .hz-leg i.hoy { outline: 2px solid var(--navy-700); outline-offset: -2px; }
.hz-ui .hz-leg i.hoy { background: var(--surface); }
.hz-ui table.hz-grid td.l span.anot, .hz-ui .hz-leg i.anot { box-shadow: inset 0 0 0 2px var(--ok); }
.hz-ui .hz-leg i.anot { background: var(--surface); }
.hz-ui table.hz-grid td.l span.stock { opacity: .85; }
.hz-ui .hz-leg i.stock { background: #d9e5f7; opacity: .85; }
.hz-ui table.hz-grid td.l.apag, .hz-ui .hz-leg i.apag { background: repeating-linear-gradient(135deg, #fff 0 6px, #f1f2f5 6px 12px); }
.hz-ui .hz-leg i.apag { background: repeating-linear-gradient(135deg, #fff 0 3px, #dfe3ea 3px 6px); border: 1px solid var(--hair); }
.hz-ui table.hz-grid td.l.sobra, .hz-ui .hz-leg i.sobra { background: var(--hz-ok-050); }
.hz-ui .hz-leg i.sobra { border: 1px dashed var(--hz-ok-hair); }
.hz-ui table.hz-grid td.l.sobra span { background: var(--surface); color: var(--ok); border: 1px dashed var(--hz-ok-hair); font-weight: 600; cursor: default; }
.hz-ui table.hz-grid td.l.sobra span:hover { filter: none; }
.hz-ui table.hz-grid tr.mol td { border-top: 2px solid var(--hair-strong); }
.hz-ui table.hz-grid tr.pie td { background: var(--canvas); font-weight: 600; height: 28px; }
.hz-ui table.hz-grid tr.pie td.crit { color: var(--crit); } .hz-ui table.hz-grid tr.pie td.ok { color: var(--ok); }
.hz-ui table.hz-grid td.hl, .hz-ui table.hz-grid th.hl { background-color: #f6f8fc; }
.hz-ui .hz-leg { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 8px; align-items: center; }
.hz-ui .hz-leg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
.hz-ui .hz-leg .sep { width: 1px; height: 14px; background: var(--hair-strong); }
.hz-ui .hz-cub .it[data-cel] { cursor: pointer; }
.hz-ui .hz-cub .it[data-cel]:hover { box-shadow: inset 0 0 0 2px var(--navy-300); }
.hz-ui .hz-cub .it.warn { border-color: var(--hz-warn-hair); background: var(--hz-warn-050); } .hz-ui .hz-cub .it.warn .r { color: var(--warn); }
.hz-ui .hz-anot { margin-top: 8px; }
.hz-ui .hz-pcard { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card, 14px); box-shadow: var(--shadow); padding: 12px 14px 13px; min-width: 0; }
.hz-ui .hz-pcard .ch { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.hz-ui .hz-pcard .ch h6 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.hz-ui .hz-pcard .ch .sub { font-size: 11px; color: var(--muted); }
.hz-ui .hz-cub { display: flex; flex-direction: column; gap: 6px; }
.hz-ui .hz-cub .it { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2px 10px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--hair); font-size: 12px; align-items: center; animation: hz-ap .3s var(--hz-ease); }
.hz-ui .hz-cub .it.ok { border-color: var(--hz-ok-hair); background: var(--hz-ok-050); }
.hz-ui .hz-cub .it.crit { border-color: var(--hz-crit-hair); background: var(--hz-crit-050); }
.hz-ui .hz-cub .it b { font-size: 12.5px; white-space: nowrap; }
.hz-ui .hz-cub .it small { color: var(--muted); display: block; white-space: normal; }
.hz-ui .hz-cub .it .r { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.hz-ui .hz-cub .it.ok .r { color: var(--ok); } .hz-ui .hz-cub .it.crit .r { color: var(--crit); }
.hz-ui .hz-barra { height: 6px; border-radius: 3px; background: #e6eaf1; overflow: hidden; margin-top: 4px; grid-column: 1 / -1; }
.hz-ui .hz-barra i { display: block; height: 100%; background: var(--navy-300); border-radius: 3px; transition: width .5s var(--hz-ease); }
.hz-ui .hz-barra i.crit { background: var(--crit); } .hz-ui .hz-barra i.ok { background: var(--ok); }

/* ── pantallas angostas (800) y el teléfono ──────────────────────────────── */
@media (max-width: 1180px) {
    .hz-ui .hz-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hz-ui .hz-prog { grid-template-columns: 1fr; }
}
/* El modal mide 95vw: por debajo de 1000 px las dos columnas de adentro se apilan
   (a 800 el stock del día quedaba en tres columnas apretadas, foto 06 de la etapa 3). */
@media (max-width: 1000px) {
    .hz-ui .hz-m2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .hz-ui .hz-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hz-ui .hz-mtiles { grid-template-columns: repeat(2, 1fr); }
    .hz-ui .hz-m2 { grid-template-columns: 1fr; }
    .hz-ui .hz-sb { grid-template-columns: 110px 1fr; }
    .hz-ui .hz-sb .nums { grid-column: 1 / -1; justify-content: flex-start; }
    .hz-ui table.hz-tab th.rec, .hz-ui table.hz-tab td.rec { width: 200px; min-width: 200px; }
    .hz-ui .hz-modal { max-width: 100vw; max-height: 100vh; border-radius: 0; }
    .hz-ui .hz-tabwrap { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hz-ui *, .hz-ui *::after { animation: none !important; transition: none !important; }
}
