/* Dashboard del CEDIS y tablero de Pendientes (rediseño). Manual CTI: navy #0B1B4B,
   lima #C4E000, Poppins; sin magenta. Archivo propio para no tocar wms.css. */
.tb-page,
.ef-page {
  --tb-navy: #0b1b4b;
  --tb-navy-2: #1f3e8c;
  --tb-lime: #c4e000;
  --tb-line: #e2e7f0;
  --tb-muted: #6b7a93;
  /* Urgencia por intensidad (sin semáforo): crítica = navy sólido, atención = navy medio, al día = gris. */
  --tb-rojo: #0B1B4B;
  --tb-rojo-bg: #0B1B4B;
  --tb-ambar: #0B1B4B;
  --tb-ambar-bg: #dfe4f0;
  --tb-ok: #5b6b86;
  --tb-ok-bg: #f1f3f7;
  --tb-info: #1f3e8c;
  --tb-info-bg: #eaf0fb;
}
.tb-page { display: grid; gap: 18px; font-family: "Poppins", system-ui, sans-serif; color: var(--tb-navy); }
.tb-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tb-head .page-head { margin: 0; flex: 1 1 420px; }
.tb-toolbar { margin: 0; min-width: 240px; }
.tb-toolbar .field { margin: 0; }
.tb-muted { color: var(--tb-muted); }
.tb-h2 { font-size: 1rem; margin: 4px 0 -6px; letter-spacing: 0.02em; }

/* Alertas con severidad */
.tb-alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.tb-alert b { font-size: 0.9rem; }
.tb-alert {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--tb-line); border-left-width: 5px;
  background: #fff; color: var(--tb-navy); text-decoration: none;
}
.tb-alert .tb-ico { width: 24px; height: 24px; }
.tb-alert b { display: block; font-size: 0.95rem; line-height: 1.25; }
.tb-alert span { font-size: 0.78rem; color: var(--tb-muted); }
.tb-alert .tb-alert-n { font-size: 1.1rem; color: inherit; }
.tb-alert .tb-alert-sev { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.tb-alert .tb-alert-go { font-size: 0.78rem; font-weight: 600; white-space: nowrap; color: var(--tb-navy-2); }
.tb-alert.is-rojo { border-left-color: var(--tb-lime); background: var(--tb-rojo-bg); }
.tb-alert.is-rojo .tb-alert-go { color: var(--tb-lime); }
.tb-alert.is-rojo, .tb-alert.is-rojo b, .tb-alert.is-rojo span { color: #fff; }
.tb-alert.is-rojo .tb-ico, .tb-alert.is-rojo .tb-alert-sev { color: var(--tb-lime); }
.tb-alert.is-ambar { border-left-color: #7d8bb0; background: var(--tb-ambar-bg); }
.tb-alert.is-ambar .tb-ico, .tb-alert.is-ambar .tb-alert-sev { color: var(--tb-ambar); }
.tb-alert.is-info { border-left-color: var(--tb-info); background: var(--tb-info-bg); }
.tb-alert.is-info .tb-ico, .tb-alert.is-info .tb-alert-sev { color: var(--tb-info); }
.tb-alert.is-ok { border-left-color: var(--tb-lime); background: var(--tb-ok-bg); grid-template-columns: 28px 1fr; }
.tb-alert.is-ok .tb-ico { color: var(--tb-ok); }
.tb-alert:hover:not(.is-ok) { box-shadow: 0 4px 14px rgba(11, 27, 75, 0.12); }

/* Paneles por flujo */
.tb-flows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tb-duo { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tb-panel { background: #fff; border: 1px solid var(--tb-line); border-radius: 14px; padding: 14px 16px 16px; box-shadow: 0 1px 2px rgba(11, 27, 75, 0.04); }
.tb-panel-head { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--tb-line); }
.tb-panel-head h2 { font-size: 1.05rem; margin: 0; line-height: 1.2; }
.tb-panel-head p { margin: 2px 0 0; font-size: 0.78rem; color: var(--tb-muted); }
.tb-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tb-ico-lg { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--tb-navy); color: var(--tb-lime); }
.tb-flow-salidas .tb-ico-lg { background: var(--tb-navy-2); }
.tb-flow-almacen .tb-ico-lg { background: var(--tb-lime); color: var(--tb-navy); }
.tb-rows { list-style: none; margin: 0; padding: 0; }
.tb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label num" "meta num"; column-gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--tb-line); }
.tb-row:last-child { border-bottom: 0; }
.tb-row-label { grid-area: label; color: var(--tb-navy); font-weight: 600; font-size: 0.88rem; text-decoration: none; }
.tb-row-meta { grid-area: meta; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 22px; }
.tb-num { grid-area: num; align-self: center; font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--tb-navy); text-decoration: none; font-variant-numeric: tabular-nums; }
.tb-num:hover, .tb-row-label:hover, .tb-qty:hover { color: var(--tb-navy-2); text-decoration: underline; }
.tb-row.is-zero .tb-num { color: #b5c0d3; }
.tb-qty { font-size: 0.8rem; color: var(--tb-navy-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.tb-qty small { color: var(--tb-muted); font-weight: 500; }
.tb-oldest { text-decoration: none; }
.tb-age { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.tb-age.is-ok { background: var(--tb-ok-bg); color: var(--tb-ok); }
.tb-age.is-ambar { background: var(--tb-ambar-bg); color: var(--tb-ambar); }
.tb-age.is-rojo { background: var(--tb-navy); color: #fff; }
.tb-upcoming { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #f6f7f9; font-size: 0.82rem; }
.tb-upcoming p { margin: 0 0 4px; font-weight: 600; }
.tb-upcoming ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.tb-upcoming a { color: var(--tb-navy); text-decoration: none; }

/* Medidor de ocupación */
.tb-gauge { display: grid; grid-template-columns: 116px 1fr; gap: 14px; align-items: center; padding: 12px 0 6px; border-top: 1px dashed var(--tb-line); margin-top: 4px; }
.tb-gauge-svg { position: relative; display: block; width: 116px; height: 116px; }
.tb-gauge-svg svg { width: 100%; height: 100%; }
.tb-gauge-bg { fill: none; stroke: #e9eef6; stroke-width: 12; }
.tb-gauge-fg { fill: none; stroke: var(--tb-navy); stroke-width: 12; stroke-linecap: round; }
.tb-gauge-pct { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--tb-navy); }
.tb-gauge-pct b { font-size: 1.45rem; line-height: 1; }
.tb-gauge-pct small { font-size: 0.68rem; color: var(--tb-muted); }
.tb-gauge-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.84rem; }
.tb-gauge-legend a { color: var(--tb-navy); text-decoration: none; }
.tb-gauge-legend i, .tb-split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.tb-gauge-legend .tb-muted { font-size: 0.72rem; }
i.is-occ { background: var(--tb-navy); }
i.is-free { background: #e9eef6; border: 1px solid #c8d2e3; }
.tb-split { padding-top: 10px; border-top: 1px dashed var(--tb-line); }
.tb-split-title { margin: 0 0 6px; font-weight: 600; font-size: 0.85rem; }
.tb-split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #e9eef6; }
.tb-split-bar a { display: block; height: 100%; }
.tb-split-bar .is-fiscal, i.is-fiscal { background: var(--tb-lime); }
.tb-split-bar .is-nac, i.is-nac { background: var(--tb-navy-2); }
.tb-split-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 0.8rem; }
.tb-split-legend a { color: var(--tb-navy); text-decoration: none; }

/* Tendencia */
.tb-trend-today { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tb-trend-today li { display: grid; grid-template-columns: 12px 1fr; column-gap: 6px; padding: 8px 10px; border-radius: 10px; background: #f6f7f9; font-size: 0.8rem; }
.tb-trend-today li i { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; }
.tb-trend-today li a, .tb-trend-today li small { grid-column: 2; }
.tb-trend-today li a { color: var(--tb-navy); text-decoration: none; font-size: 0.85rem; }
.tb-trend-today li a b { font-size: 1.15rem; }
.tb-delta { color: var(--tb-muted); }
.tb-delta.is-up { color: var(--tb-navy); font-weight: 700; }
.tb-delta.is-down { color: var(--tb-muted); }
i.is-recibido, .tb-bar.is-recibido { background: var(--tb-navy); }
i.is-surtido, .tb-bar.is-surtido { background: var(--tb-navy-2); }
i.is-embarcado, .tb-bar.is-embarcado { background: var(--tb-lime); }
.tb-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 150px; align-items: end; }
.tb-col { display: grid; grid-template-rows: 1fr auto; height: 100%; text-align: center; font-size: 0.7rem; color: var(--tb-muted); }
.tb-col.is-today { color: var(--tb-navy); font-weight: 700; }
.tb-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; border-bottom: 1px solid var(--tb-line); }
.tb-bar { display: block; width: 28%; max-width: 12px; border-radius: 3px 3px 0 0; }
.tb-bar:hover { filter: brightness(1.15); }

/* Devoluciones (panel junto a «Piezas por día»). Navy, lima, blanco y gris del logo #8FA0B8. */
.tb-dev .tb-panel-head p a { color: var(--tb-navy); font-weight: 600; }
.tb-dev-sts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 4px; }
.tb-dev-st { display: grid; gap: 1px; padding: 9px 10px; border-radius: 10px; background: #f6f7f9; border-top: 4px solid #8fa0b8; color: var(--tb-navy); text-decoration: none; }
.tb-dev-st span { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--tb-muted); }
.tb-dev-st b { font-size: 1.55rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tb-dev-st small { font-size: 0.66rem; color: var(--tb-muted); line-height: 1.2; }
.tb-dev-st.is-abiertas { background: var(--tb-navy); border-top-color: var(--tb-lime); color: #fff; }
.tb-dev-st.is-abiertas span, .tb-dev-st.is-abiertas small { color: #dfe4f0; }
.tb-dev-st.is-recibida { border-top-color: var(--tb-navy); }
.tb-dev-st.is-cerrada { border-top-color: var(--tb-lime); }
.tb-dev-st.is-zero b { color: #b5c0d3; }
.tb-dev-st:hover { box-shadow: 0 4px 14px rgba(11, 27, 75, 0.12); }
.tb-dev-h { margin: 12px 0 2px; font-size: 0.8rem; letter-spacing: 0.02em; }
.tb-dev-list { list-style: none; margin: 0; padding: 0; }
.tb-dev-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 58px); align-items: center; column-gap: 6px; padding: 7px 0; border-bottom: 1px dashed var(--tb-line); }
.tb-dev-list .tb-dev-row:last-child { border-bottom: 0; }
.tb-dev-hdr { padding: 4px 0; border-bottom: 1px solid var(--tb-line); font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--tb-muted); }
.tb-dev-hdr b { font-weight: inherit; }
.tb-dev-hdr i { display: none; font-style: normal; }
.tb-dev-hdr span:not(:first-child) { text-align: right; }
.tb-dev-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tb-navy); font-weight: 600; font-size: 0.86rem; text-decoration: none; }
.tb-dev-name small { font-size: 0.68rem; color: var(--tb-muted); font-weight: 700; }
.tb-dev-c { text-align: right; color: var(--tb-navy); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.tb-dev-c.is-zero { color: #b5c0d3; }
.tb-dev-tot { font-size: 1.05rem; font-weight: 700; }
.tb-dev a:hover { text-decoration: underline; }
.tb-ped-dot.is-sin { box-sizing: border-box; background: #fff; border: 2px solid #8fa0b8; width: 9px; height: 9px; }
@media (max-width: 720px) {
  .tb-dev-st b { font-size: 1.3rem; }
  .tb-dev-st small { display: none; }
  .tb-dev-row { grid-template-columns: minmax(0, 1fr) repeat(4, 46px); }
  .tb-dev-hdr b { display: none; }
  .tb-dev-hdr i { display: inline; }
}

/* Pedidos por tipo (E-commerce / Fulfillment) y por cliente. Paleta: navy, lima, blanco y gris del logo #8FA0B8. */
.tb-peds { display: grid; gap: 12px; }
.tb-peds-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tb-peds-head .tb-h2 { margin: 0; }
.tb-segs { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: #fff; border: 1px solid var(--tb-line); }
.tb-seg { padding: 5px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: var(--tb-navy); text-decoration: none; white-space: nowrap; }
.tb-seg:hover { background: #f1f4f9; }
.tb-seg.is-on { background: var(--tb-navy); color: #fff; box-shadow: inset 0 -2px 0 var(--tb-lime); }
.tb-ped-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.25fr); gap: 10px; }
.tb-ped-kpi { display: grid; gap: 2px; padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--tb-line); border-left: 5px solid #8fa0b8; color: var(--tb-navy); text-decoration: none; }
.tb-ped-kpi span { font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tb-muted); }
.tb-ped-kpi b { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tb-ped-kpi.is-vigentes { background: var(--tb-navy); border-color: var(--tb-navy); border-left-color: var(--tb-lime); color: #fff; }
.tb-ped-kpi.is-vigentes span { color: var(--tb-lime); }
.tb-ped-kpi.is-por_surtir { border-left-color: var(--tb-navy); }
.tb-ped-kpi.is-shipped { border-left-color: var(--tb-lime); }
.tb-ped-kpi:hover { box-shadow: 0 4px 14px rgba(11, 27, 75, 0.12); }
.tb-ped-kpi.is-dev { border-left-color: #8fa0b8; }
.tb-ped-kpi.is-dev:hover { box-shadow: none; }
.tb-ped-kpi-main { display: grid; gap: 2px; color: inherit; text-decoration: none; }
.tb-ped-kpi-main:hover b { text-decoration: underline; }
.tb-ped-kpi-sub { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 0.72rem; }
.tb-ped-kpi-sub a { color: var(--tb-muted); text-decoration: none; white-space: nowrap; }
.tb-ped-kpi-sub a b { color: var(--tb-navy); font-size: 0.8rem; line-height: 1.2; }
.tb-ped-kpi-sub a:hover { text-decoration: underline; }
.tb-ped-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.tb-ped-list { list-style: none; margin: 0; padding: 0; }
.tb-ped-row, .tb-ped-hdr { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 74px) 58px 72px; align-items: center; column-gap: 8px; }
.tb-ped-row { padding: 9px 0; border-bottom: 1px dashed var(--tb-line); }
.tb-ped-list:last-child .tb-ped-row:last-child { border-bottom: 0; }
.tb-ped-hdr { padding: 2px 0 6px; border-bottom: 1px solid var(--tb-line); font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--tb-muted); }
.tb-ped-hdr span:not(:first-child) { text-align: right; white-space: nowrap; }
.tb-ped-hdr i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; background: #8fa0b8; }
.tb-ped-hdr .is-por_surtir i { background: var(--tb-navy); }
.tb-ped-hdr .is-shipped i { background: var(--tb-lime); }
.tb-ped-name { display: grid; gap: 5px; min-width: 0; }
.tb-ped-label { grid-area: auto; color: var(--tb-navy); font-weight: 600; font-size: 0.9rem; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-ped-label small { font-weight: 700; font-size: 0.7rem; letter-spacing: 0.04em; color: var(--tb-muted); }
.tb-ped-label:hover { text-decoration: underline; }
.tb-ped-bar { display: block; height: 5px; border-radius: 999px; background: #eef1f6; overflow: hidden; }
.tb-ped-bar span { display: block; height: 100%; border-radius: 999px; background: var(--tb-navy); }
.tb-ped-bar .is-ful { background: var(--tb-lime); }
.tb-ped-bar.is-stack { display: flex; gap: 0; height: 7px; }
.tb-ped-bar.is-stack a { display: block; height: 100%; }
.tb-ped-bar.is-stack a.is-ecom { background: var(--tb-navy); }
.tb-ped-bar.is-stack a.is-ful { background: var(--tb-lime); }
.tb-ped-bar.is-stack a:first-child { border-radius: 999px 0 0 999px; }
.tb-ped-bar.is-stack a:last-child { border-radius: 0 999px 999px 0; }
.tb-ped-bar.is-stack a:only-child { border-radius: 999px; }
.tb-ped-det { font-size: 0.72rem; color: var(--tb-muted); margin-top: -3px; }
.tb-ped-dot, .tb-ped-flujo i, .tb-ped-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }
.tb-ped-dot.is-ecom, .tb-ped-flujo.is-ecom i, .tb-ped-legend i.is-ecom { background: var(--tb-navy); }
.tb-ped-dot.is-ful, .tb-ped-flujo.is-ful i, .tb-ped-legend i.is-ful { background: var(--tb-lime); }
.tb-ped-split { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 0.72rem; }
.tb-ped-split .tb-ped-flujo i { margin-right: 4px; }
.tb-ped-flujo { color: var(--tb-muted); text-decoration: none; white-space: nowrap; letter-spacing: -0.01em; }
.tb-ped-flujo b { color: var(--tb-navy); font-variant-numeric: tabular-nums; }
.tb-ped-flujo.is-zero b { color: #b5c0d3; }
.tb-ped-flujo:hover { text-decoration: underline; }
.tb-ped-legend { margin-left: auto; display: flex; gap: 10px; font-size: 0.72rem; color: var(--tb-muted); white-space: nowrap; }
.tb-ped-tipo .tb-ped-row { padding: 14px 0; }
.tb-ped-tipo .tb-ped-row, .tb-ped-tipo .tb-ped-hdr { grid-template-columns: minmax(0, 1fr) repeat(3, 60px) 62px 78px; column-gap: 6px; }
.tb-ped-tipo .tb-ped-label { white-space: normal; }
.tb-ped-hdr span:not(:first-child) { white-space: normal; line-height: 1.25; }
.tb-ped-tipo .tb-ped-total { font-size: 1.9rem; }
.tb-ped-sts { display: contents; }
.tb-ped-st { display: block; padding: 4px 6px; border-radius: 8px; color: var(--tb-navy); text-decoration: none; text-align: right; }
.tb-ped-st i, .tb-ped-st span { display: none; }
.tb-ped-st b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.tb-ped-st.is-zero b { color: #b5c0d3; }
.tb-ped-st:hover { background: #f1f4f9; text-decoration: underline; }
.tb-ped-total { grid-area: auto; text-align: right; font-size: 1.45rem; }
.tb-ped-hdr .is-dev { border-left: 1px dashed var(--tb-line); }
.tb-ped-dev { display: grid; justify-items: end; gap: 1px; padding-left: 8px; border-left: 1px dashed var(--tb-line); align-self: stretch; align-content: center; }
.tb-ped-dev-n { color: var(--tb-navy); text-decoration: none; }
.tb-ped-dev-n span { display: none; }
.tb-ped-dev-n b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.tb-ped-dev.is-zero .tb-ped-dev-n b { color: #b5c0d3; }
.tb-ped-dev-ab { font-size: 0.68rem; color: var(--tb-muted); text-decoration: none; white-space: nowrap; }
.tb-ped-dev a:hover { text-decoration: underline; }
.tb-ped-sinped { margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--tb-line); font-size: 0.76rem; color: var(--tb-muted); }
.tb-ped-sinped a { color: var(--tb-navy); }
.tb-ped-more summary { cursor: pointer; padding: 8px 0 2px; font-size: 0.8rem; font-weight: 600; color: var(--tb-navy-2); }
.tb-ped-more[open] summary { border-bottom: 1px dashed var(--tb-line); padding-bottom: 8px; }
.tb-ped-empty { margin: 10px 0 0; color: var(--tb-muted); font-size: 0.86rem; }
.tb-ped-note { margin: -2px 0 0; font-size: 0.74rem; color: var(--tb-muted); }
@media (max-width: 1180px) {
  .tb-ped-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tb-ped-kpi.is-dev { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .tb-ped-duo { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tb-ped-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-ped-kpi.is-dev { grid-column: 1 / -1; }
  .tb-ped-hdr { display: none; }
  .tb-ped .tb-panel-head { flex-wrap: wrap; }
  .tb-ped-legend { margin-left: 44px; flex-basis: 100%; }
  .tb-ped-row, .tb-ped-tipo .tb-ped-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name total" "sts sts" "dev dev"; row-gap: 8px; column-gap: 6px; }
  .tb-ped-dev { grid-area: dev; display: flex; align-items: baseline; gap: 10px; padding: 5px 8px; border: 1px dashed #8fa0b8; border-radius: 8px; background: #fff; }
  .tb-ped-dev-n { display: flex; align-items: baseline; gap: 8px; }
  .tb-ped-dev-n span { display: inline; font-size: 0.62rem; font-weight: 600; text-transform: uppercase; color: var(--tb-muted); }
  .tb-ped-name { grid-area: name; }
  .tb-ped-total { grid-area: total; }
  .tb-ped-sts { grid-area: sts; display: flex; gap: 6px; }
  .tb-ped-st { flex: 1 1 0; min-width: 0; display: grid; grid-template-columns: 8px minmax(0, 1fr); grid-template-areas: "dot label" "num num"; column-gap: 5px; padding: 4px 8px; background: #f6f7f9; text-align: left; font-size: 0.62rem; }
  .tb-ped-st i { display: block; grid-area: dot; width: 8px; height: 8px; border-radius: 2px; align-self: center; background: #8fa0b8; }
  .tb-ped-st span { display: block; grid-area: label; color: var(--tb-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-ped-st b { grid-area: num; }
  .tb-ped-st.is-por_surtir i { background: var(--tb-navy); }
  .tb-ped-st.is-shipped i { background: var(--tb-lime); }
  .tb-peds-head { display: grid; }
  .tb-segs { justify-content: space-between; gap: 2px; }
  .tb-seg { padding: 5px 8px; flex: 1 1 auto; text-align: center; }
}

/* Atajos */
.tb-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tb-shortcut { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; background: #fff; border: 1px solid var(--tb-line); color: var(--tb-navy); text-decoration: none; font-size: 0.82rem; font-weight: 600; text-align: center; }
.tb-shortcut .tb-ico { width: 26px; height: 26px; padding: 6px; box-sizing: content-box; border-radius: 10px; background: #f1f4f9; }
.tb-shortcut:hover { border-color: var(--tb-navy); }
.tb-shortcut:hover .tb-ico { background: var(--tb-lime); }

/* Detalle de cifra */
.tb-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.tb-detail { padding: 0; overflow-x: auto; }
.tb-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.tb-docs { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 720px) {
  .tb-detail .tb-table thead { display: none; }
  .tb-detail .tb-table,
  .tb-detail .tb-table tbody,
  .tb-detail .tb-table tr,
  .tb-detail .tb-table td { display: block; width: auto; }
  .tb-detail .tb-table tr { padding: 0.35rem 0 0.7rem; border-bottom: 1px solid #eef1f6; }
  .tb-detail .tb-table td { border: 0; padding: 0.15rem 0.9rem; }
}
.tb-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--tb-muted); padding: 10px 14px; border-bottom: 1px solid var(--tb-line); }
.tb-table td { padding: 9px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.tb-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tb-folio { white-space: nowrap; font-weight: 600; }
.tb-folio a { color: var(--tb-navy); }

@media (max-width: 1100px) {
  .tb-flows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-duo { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .tb-flows { grid-template-columns: 1fr; }
  .tb-toolbar { min-width: 0; width: 100%; }
  .tb-alerts { grid-template-columns: 1fr; }
  .tb-trend-today { grid-template-columns: 1fr; }
  .tb-trend-today li { grid-template-columns: 12px auto 1fr; align-items: baseline; }
  .tb-trend-today li a, .tb-trend-today li small { grid-column: auto; }
  .tb-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tb-num { font-size: 1.5rem; }
}

/* ── Pendientes (Eficiencia) ───────────────────────────── */
.pd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 16px; }
.pd-kpi { position: relative; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--tb-line); border-top: 4px solid #c8d2e3; display: grid; gap: 2px; }
.pd-kpi-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tb-muted); }
.pd-kpi-label i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #c8d2e3; }
.pd-kpi-n .ef-num { font-size: 2rem; font-weight: 700; color: var(--tb-navy); line-height: 1.05; padding: 0; background: none; border: 0; cursor: pointer; text-decoration: none; }
.pd-kpi-n .ef-num:hover { text-decoration: underline; }
.pd-kpi small { font-size: 0.76rem; color: var(--tb-muted); }
.pd-kpi small .ef-num { font: inherit; font-weight: 700; color: var(--tb-navy); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.pd-kpi.is-activo { border-top-color: var(--tb-lime); background: var(--tb-navy); }
.pd-kpi.is-activo .pd-kpi-label, .pd-kpi.is-activo small { color: #c9d3ea; }
.pd-kpi.is-activo .pd-kpi-label i { background: var(--tb-lime); }
.pd-kpi.is-activo .pd-kpi-n .ef-num { color: var(--tb-lime); }
.pd-kpi.is-inactivo { border-top-color: #7d8bb0; }
.pd-kpi.is-inactivo .pd-kpi-label i { background: #7d8bb0; }
.pd-kpi.is-sin .pd-kpi-label i { background: #8fa0b8; }
.pd-kpi.is-tareas { border-top-color: var(--tb-navy-2); }
.pd-kpi.is-tareas .pd-kpi-label i { background: var(--tb-navy-2); }

.pd-h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-h2 small { font-size: 0.78rem; font-weight: 500; color: var(--tb-muted); }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 12px; align-items: start; }
.pd-card { background: #fff; border: 1px solid var(--tb-line); border-left: 5px solid #c8d2e3; border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.pd-card.is-ambar { border-left-color: #7d8bb0; }
.pd-card.is-rojo { border-left-color: var(--tb-rojo); }
.pd-card.is-empty { border-left-color: var(--tb-line); }
.pd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-title { font-weight: 700; font-size: 1.02rem; color: var(--tb-navy); text-decoration: none; }
a.pd-title:hover { text-decoration: underline; }
.pd-count { min-width: 30px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--tb-navy); color: #fff; font-weight: 700; font-size: 0.85rem; display: inline-grid; place-items: center; text-decoration: none; }
.pd-count.is-total { background: var(--tb-lime); color: var(--tb-navy); }
.pd-oldest { display: block; font-size: 0.8rem; padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--tb-navy); }
.pd-oldest span { font-weight: 500; opacity: 0.85; }
.pd-oldest.is-ok { background: var(--tb-ok-bg); color: var(--tb-ok); }
.pd-oldest.is-ambar { background: var(--tb-ambar-bg); color: var(--tb-ambar); }
.pd-oldest.is-rojo { background: var(--tb-navy); color: #fff; }
.pd-oldest.is-rojo::before, .pd-age.is-rojo::before, .tb-age.is-rojo::before { content: "▲ "; color: var(--tb-lime); font-size: 0.8em; }
.pd-list { list-style: none; margin: 0; padding: 0; }
.pd-row {
  display: grid;
  grid-template-columns: max-content minmax(92px, 1fr) minmax(112px, 1.2fr) 52px 60px;
  grid-template-areas: "folio state prog age btn";
  align-items: center; column-gap: 8px; padding: 8px 0; border-top: 1px solid #eef1f6;
}
.pd-folio { grid-area: folio; white-space: nowrap; font-weight: 700; font-size: 0.86rem; color: var(--tb-navy); text-decoration: none; }
.pd-folio:hover { text-decoration: underline; }
.pd-state { grid-area: state; display: grid; min-width: 0; font-size: 0.78rem; line-height: 1.25; }
.pd-state b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-state small { color: var(--tb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-prog { grid-area: prog; display: grid; gap: 3px; min-width: 0; }
.pd-bar { display: block; height: 6px; border-radius: 999px; background: #e9eef6; overflow: hidden; }
.pd-bar i { display: block; height: 100%; background: var(--tb-navy); border-right: 2px solid var(--tb-lime); }
.pd-counts { font-size: 0.72rem; color: var(--tb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-counts b { color: var(--tb-navy); }
.pd-age { grid-area: age; justify-self: start; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.pd-age.is-ok { background: var(--tb-ok-bg); color: var(--tb-ok); }
.pd-age.is-ambar { background: var(--tb-ambar-bg); color: var(--tb-ambar); }
.pd-age.is-rojo { background: var(--tb-navy); color: #fff; }
.pd-lines { grid-area: btn; justify-self: stretch; text-align: center; padding: 5px 0; border-radius: 8px; border: 1px solid var(--tb-navy); background: #fff; color: var(--tb-navy); font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.pd-lines:hover { background: var(--tb-navy); color: #fff; }
.pd-foot { margin: 0; font-size: 0.8rem; text-align: right; }
.pd-foot a { color: var(--tb-navy-2); font-weight: 600; }
.pd-empty-row { margin: 12px 0 0; padding: 9px 14px; border-radius: 10px; background: #fff; border: 1px dashed #c8d2e3; font-size: 0.84rem; color: var(--tb-muted); }
.pd-empty-row span { font-weight: 600; color: var(--tb-navy); margin-right: 4px; }
.pd-empty-row a { color: var(--tb-navy-2); }

@media (max-width: 720px) {
  .pd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-row {
    grid-template-columns: max-content minmax(0, 1fr) 70px;
    grid-template-areas: "folio age btn" "state state btn" "prog prog prog";
    row-gap: 4px;
  }
  .pd-age { justify-self: end; }
}

/* Toque cómodo en celular (≥ 44 px) y esquina libre para el orbe de Don Pepe. */
.pd-lines:focus-visible, .pd-folio:focus-visible, .tb-num:focus-visible, .tb-alert:focus-visible { outline: 3px solid #c4e000; outline-offset: 2px; }
body:has(#don-pepe-fab:not([hidden])) .pd-foot,
body:has(#don-pepe-fab:not([hidden])) .pd-empty-row { padding-right: 4.75rem; }
@media (max-width: 720px) {
  .pd-lines { min-height: 2.75rem; display: grid; place-items: center; padding: 0; }
  .pd-folio { min-height: 2.25rem; display: inline-flex; align-items: center; }
}
