/* Panel Corvalta. Grises con color solo para estados; naranja únicamente para "tu pedido".
   Paleta y medidas con contraste calculado: ver demo-corvalta/investigacion/03-diseno-tableros.md */
:root {
  --bg: #0e0e0e; --s1: #161616; --s2: #1e1e1e; --s3: #282828;
  --ink: #ededed; --dim: #b4b4b4; --faint: #949494;
  --line: #303030; --borde: #7a7a7a;
  --crit: #ff6b6b; --aviso: #f2c230; --ok: #5ccf8f; --info: #6cb2ff; --neutro: #a8a8a8;
  --sobre-estado: #0e0e0e; --tuyo: #ff7a1c;
  --letra: "Inter", system-ui, sans-serif;
  --r: 8px; --rc: 6px; --ctrl: 32px;
}
@media (pointer: coarse) { :root { --ctrl: 44px; } }
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 14px/20px var(--letra); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid #fafafa; outline-offset: 2px; }
main:focus { outline: 0; }
[hidden] { display: none !important; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Estructura ---------- */
.marco { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100vh; height: 100svh; }
.marco[data-menu="chico"] { grid-template-columns: 56px minmax(0, 1fr); }
.menu { display: flex; flex-direction: column; min-height: 0; background: var(--s1); border-right: 1px solid var(--line); }
.menu__marca { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.menu__marca a { font-size: 16px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.menu__plegar { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--rc); background: none; color: var(--dim); }
.menu__plegar:hover { background: var(--s3); color: var(--ink); }
.menu__lista { flex: 1; overflow-y: auto; padding: 8px; scrollbar-color: var(--s3) transparent; }
.menu__grupo { margin: 16px 8px 4px; color: var(--faint); font-size: 12px; font-weight: 600; }
.menu__item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 36px; padding: 0 8px; border: 0; border-radius: var(--rc); background: none; color: var(--dim); font-size: 14px; font-weight: 500; text-align: left; }
.menu__item:hover { background: var(--s2); color: var(--ink); }
.menu__item[aria-current="page"] { background: var(--s3); color: var(--ink); }
.menu__item[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 2px 2px 0; background: var(--ink); }
.menu__item svg { flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.menu__item .nombre { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu__cuenta { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--s3); color: var(--ink); font-size: 12px; line-height: 20px; text-align: center; }
.menu__item[aria-current="page"] .menu__cuenta { background: var(--bg); }
.marco[data-menu="chico"] .menu__marca a, .marco[data-menu="chico"] .menu__grupo, .marco[data-menu="chico"] .menu__item .nombre, .marco[data-menu="chico"] .menu__cuenta { display: none; }
.marco[data-menu="chico"] .menu__marca { justify-content: center; padding: 0; }
.marco[data-menu="chico"] .menu__item { justify-content: center; padding: 0; }

.contenido { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cabeza { display: flex; flex: 0 0 auto; align-items: center; gap: 12px; height: 56px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.cabeza__titulo { font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cabeza__muestra { color: var(--faint); font-size: 12px; white-space: nowrap; }
.cabeza__der { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: 0 0 auto; }
.cabeza__alertas { display: inline-flex; align-items: center; gap: 6px; height: var(--ctrl); padding: 0 12px; border: 1px solid var(--borde); border-radius: var(--rc); background: none; color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cabeza__alertas:hover { background: var(--s2); }
.cabeza__volver { color: var(--dim); font-size: 12px; font-weight: 500; white-space: nowrap; }
main { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 24px 32px; scrollbar-color: var(--s3) transparent; }
.barra-movil { display: none; }

/* ---------- Bloques ---------- */
.grilla { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.t { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; } .c5 { grid-column: span 5; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; } .c2 { grid-column: span 2; }
.t h2 { font-size: 14px; font-weight: 600; }
.t__cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.t__nota { color: var(--faint); font-size: 12px; line-height: 16px; }
.pagina { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.pagina h1 { font-size: 20px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; }
.pagina p { max-width: 72ch; color: var(--dim); }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.volver { display: inline-flex; margin-bottom: 8px; color: var(--dim); font-size: 12px; }

.saludo { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.saludo h1 { font-size: 20px; line-height: 24px; font-weight: 600; }
.saludo p { color: var(--dim); }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); text-align: left; }
button.kpi:hover { background: var(--s2); border-color: var(--borde); }
.kpi span { display: block; color: var(--dim); font-size: 12px; line-height: 16px; }
.kpi strong { display: block; margin: 4px 0; font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; }
.kpi small { display: block; color: var(--faint); font-size: 12px; line-height: 16px; }
.kpi small.mal { color: var(--crit); } .kpi small.bien { color: var(--ok); }
.seccion { margin: 24px 0 8px; color: var(--dim); font-size: 12px; font-weight: 600; }

.tu-pedido { padding: 16px; border: 1px solid var(--tuyo); border-radius: var(--r); background: var(--s1); margin-bottom: 12px; }
.tu-pedido__cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tu-pedido h2 { font-size: 14px; font-weight: 600; }
.tu-pedido p { color: var(--dim); }
.pasos { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 12px 0 8px; }
.pasos i { height: 4px; border-radius: 2px; background: var(--s3); }
.pasos i.on { background: var(--tuyo); }
.invitar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px dashed var(--borde); border-radius: var(--r); margin-bottom: 12px; }
.invitar p { color: var(--dim); max-width: 74ch; }

.atencion li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.atencion li:first-child { border-top: 0; padding-top: 0; }
.atencion div { flex: 1; min-width: 0; }
.atencion b { display: block; font-weight: 600; }
.atencion small { color: var(--dim); font-size: 12px; line-height: 16px; }

.estado { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; color: var(--ink); font-size: 12px; font-weight: 500; white-space: nowrap; }
.estado svg { flex: none; }
.estado--ok svg { color: var(--ok); } .estado--info svg { color: var(--info); } .estado--neutro svg { color: var(--neutro); }
.estado--aviso { padding: 0 8px 0 4px; border-radius: 4px; background: var(--aviso); color: var(--sobre-estado); font-weight: 600; }
.estado--crit { padding: 0 8px 0 4px; border-radius: 4px; background: var(--crit); color: var(--sobre-estado); font-weight: 600; }
.estado--tuyo { color: var(--tuyo); font-weight: 600; }

.b { display: inline-flex; align-items: center; justify-content: center; min-height: var(--ctrl); padding: 0 12px; border: 1px solid var(--borde); border-radius: var(--rc); background: none; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.b:hover:not(:disabled) { background: var(--s3); }
.b:disabled { opacity: .5; cursor: default; }
.b--fuerte { background: var(--ink); border-color: var(--ink); color: var(--sobre-estado); }
.b--fuerte:hover:not(:disabled) { background: #fff; }
.b--peligro { background: var(--crit); border-color: var(--crit); color: var(--sobre-estado); }
.b--peligro:hover:not(:disabled) { background: #ff8585; }
.b--plano { border-color: transparent; color: var(--dim); }

/* ---------- Listados ---------- */
.herramientas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; min-height: var(--ctrl); }
.herramientas--masiva { padding: 4px 12px; border-radius: var(--rc); background: var(--s3); }
.buscador, .campo { min-height: var(--ctrl); padding: 0 12px; border: 1px solid var(--borde); border-radius: var(--rc); background: var(--bg); font-size: 14px; }
.buscador { width: min(280px, 100%); }
.vistas { display: flex; flex-wrap: wrap; gap: 4px; }
.vista { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctrl); padding: 0 8px; border: 1px solid transparent; border-radius: var(--rc); background: none; color: var(--dim); font-size: 12px; font-weight: 500; }
.vista span { color: var(--faint); }
.vista:hover { background: var(--s2); }
.vista[aria-pressed="true"] { border-color: var(--borde); color: var(--ink); }
.contador { margin-left: auto; color: var(--faint); font-size: 12px; }
.tabla-zona { overflow: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { height: 40px; padding: 4px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; font-weight: 400; }
.tabla thead th { position: sticky; top: 0; z-index: 1; border-top: 0; background: var(--s2); color: var(--dim); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tabla tbody th { font-weight: 600; white-space: nowrap; }
.tabla .num { text-align: right; white-space: nowrap; }
.tabla tr.tocable:hover td, .tabla tr.tocable:hover th { background: var(--s2); }
.tabla tr.tuyo > :first-child { box-shadow: inset 2px 0 0 var(--tuyo); }
.col-marca { width: 40px; }
.orden { padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.enlace-fila { padding: 0; border: 0; background: none; font-weight: 600; text-decoration: underline; text-decoration-color: var(--borde); text-underline-offset: 3px; text-align: left; }
.medida { height: 6px; min-width: 72px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.medida i { display: block; height: 100%; background: var(--neutro); }
.medida--aviso i { background: var(--aviso); } .medida--crit i { background: var(--crit); } .medida--ok i { background: var(--ok); }
.fichas { display: grid; gap: 8px; }
.ficha { border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); }
.ficha.tuyo { border-color: var(--tuyo); }
.ficha__cab { display: block; width: 100%; min-height: 72px; padding: 12px; border: 0; background: none; text-align: left; }
.ficha__fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ficha__sub { display: block; margin-top: 2px; color: var(--ink); }
.ficha__dato { display: block; color: var(--dim); font-size: 12px; }
.ficha__det { padding: 0 12px 12px; }
.ficha__det dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-bottom: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ficha__det dt { color: var(--dim); font-size: 12px; }
.ficha__det dd { min-width: 0; text-align: right; }
.ficha__det .acciones { margin-bottom: 8px; }
.vacio { padding: 32px 16px; text-align: center; color: var(--dim); }
.vacio b { display: block; color: var(--ink); }
.vacio .b { margin-top: 12px; }

.pares { display: grid; gap: 4px; }
.par { display: flex; justify-content: space-between; gap: 16px; min-height: 24px; }
.par > span { color: var(--dim); }
.par b { font-weight: 500; text-align: right; }
.solapas { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.solapa { flex: none; min-height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font-size: 14px; font-weight: 500; }
.solapa[aria-selected="true"] { border-color: var(--ink); color: var(--ink); }

/* ---------- Embudo y tableros ---------- */
.columnas { display: grid; grid-auto-flow: column; grid-auto-columns: 264px; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.columna { min-height: 240px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--s1); }
.columna h2 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.columna h2 span { color: var(--faint); font-weight: 400; }
.columna__nota { margin-bottom: 8px; color: var(--faint); font-size: 12px; line-height: 16px; }
.tarjeta { margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--rc); background: var(--s2); }
.tarjeta.tuyo { border-color: var(--tuyo); }
.tarjeta b { display: block; font-weight: 600; }
.tarjeta p { color: var(--dim); font-size: 12px; line-height: 16px; margin-top: 2px; }
.tarjeta__pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--dim); }
.tarjeta .acciones { margin-top: 8px; }
.tarjeta .acciones .b { flex: 1; }

.maquinas { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.maquina__cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.maquina__cab h3 { font-size: 14px; font-weight: 600; }
.maquina__nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.maquina__nums span { color: var(--faint); font-size: 12px; }
.maquina__nums b { display: block; font-weight: 600; }
.bala { display: grid; grid-template-columns: minmax(96px, 168px) 1fr 72px; align-items: center; gap: 8px; min-height: 24px; font-size: 12px; color: var(--dim); }
.bala b { white-space: nowrap; }
.maquinas .bala { grid-template-columns: 40px 1fr 48px; }
.bala b { color: var(--ink); font-weight: 600; text-align: right; }
.bala__pista { position: relative; height: 8px; border-radius: 2px; background: var(--s3); }
.bala__pista i { display: block; height: 100%; border-radius: 2px; background: var(--neutro); }
.bala__pista u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.matriz { width: 100%; border-collapse: separate; border-spacing: 4px; }
.matriz th { color: var(--dim); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.matriz td { height: 40px; padding: 4px 8px; border-radius: 4px; background: var(--s3); font-size: 12px; text-align: center; }
.matriz td b { display: block; font-size: 14px; font-weight: 600; }
.matriz td.aviso { background: var(--aviso); color: var(--sobre-estado); }
.matriz td.crit { background: var(--crit); color: var(--sobre-estado); }
.cadena { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.eslabon { padding: 12px; border: 1px solid var(--line); border-radius: var(--rc); background: var(--s2); }
.eslabon span { display: block; color: var(--faint); font-size: 12px; }
.eslabon b { display: block; font-weight: 600; overflow-wrap: anywhere; }

.chat-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; gap: 12px; height: 100%; min-height: 480px; }
.chat-grid > * { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }
.chat-lista { overflow-y: auto; }
.chat-lista button { display: block; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.chat-lista button:hover { background: var(--s2); }
.chat-lista button[aria-pressed="true"] { background: var(--s3); }
.chat-lista b { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.chat-lista b small { color: var(--faint); font-size: 12px; font-weight: 400; white-space: nowrap; }
.chat-lista p { color: var(--dim); font-size: 12px; line-height: 16px; margin: 2px 0 4px; }
.chat__cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat__cuerpo { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; overflow-y: auto; }
.m { max-width: 76%; padding: 8px 12px; border-radius: var(--r); overflow-wrap: anywhere; }
.m--in { align-self: flex-start; background: var(--s2); }
.m--out { align-self: flex-end; background: var(--s3); }
.m small { display: block; margin-top: 2px; color: var(--faint); font-size: 12px; line-height: 16px; }
.chat__pie { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.chat__pie input { flex: 1; min-width: 0; }
.chat-detalle { gap: 16px; padding: 16px; overflow-y: auto; }
.chat-detalle h3 { margin-bottom: 4px; color: var(--faint); font-size: 12px; font-weight: 500; }
.preguntas { display: flex; flex-direction: column; gap: 8px; min-height: 220px; max-height: 50vh; margin: 12px 0; overflow-y: auto; }
.fila-form { display: flex; gap: 8px; margin-top: 12px; }
.fila-form input, .fila-form select { flex: 1; min-width: 0; }

.operario { max-width: 560px; }
.cola { display: grid; gap: 8px; }
.cola .b { min-height: 56px; font-size: 14px; }
.grande { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.grande .b { min-height: 72px; font-size: 16px; }
.campo-etiqueta { display: grid; gap: 4px; margin-top: 12px; color: var(--dim); font-size: 12px; }
.campo-etiqueta input, .campo-etiqueta select { font-size: 16px; color: var(--ink); }

/* ---------- Andon ---------- */
.andon { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; gap: 1vh; padding: 2vh; background: #000; color: #fff; }
.andon__cab { display: flex; align-items: center; justify-content: space-between; gap: 2vw; font-size: 3vh; font-weight: 600; }
.andon__grilla { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 1vh; min-height: 0; }
.andon__m { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; padding: 2vh; border-radius: 4px; background: var(--s1); }
.andon__m h2 { font-size: 3.6vh; line-height: 1.1; font-weight: 600; }
.andon__m strong { font-size: min(10vh, 6.4vw); line-height: 1; font-weight: 700; }
.andon__m p { font-size: 2.6vh; line-height: 1.15; }
.andon__m.parada { background: var(--crit); color: var(--sobre-estado); }
.andon__m.prep { background: var(--aviso); color: var(--sobre-estado); }

/* ---------- Diálogos y avisos ---------- */
dialog { color: inherit; }
dialog::backdrop { background: rgb(0 0 0 / .66); }
.dialogo { width: min(480px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--borde); border-radius: var(--r); background: var(--s1); }
.dialogo h2 { font-size: 16px; line-height: 20px; font-weight: 600; }
.dialogo p { margin-top: 8px; color: var(--dim); }
.dialogo__pie { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialogo select { width: 100%; margin-top: 12px; }
.avisos { position: fixed; z-index: 60; left: 50%; bottom: 24px; display: grid; gap: 8px; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); pointer-events: none; }
.aviso-flotante { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--borde); border-radius: var(--r); background: var(--s3); pointer-events: auto; }
.aviso-flotante button { flex: none; padding: 4px; border: 0; background: none; font-weight: 600; text-decoration: underline; }
.mas { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow-y: auto; padding: 8px 16px calc(80px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borde); border-radius: 12px 12px 0 0; background: var(--s1); }


/* ---------- CRM ---------- */
.trabajo { flex: 1; display: flex; min-height: 0; }
.trabajo > main { flex: 1; min-width: 0; }
.lateral { flex: 0 0 400px; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--s1); }
.lateral__barra { flex: none; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.lateral__barra > :first-child { margin-right: auto; }
.lateral__cuerpo { flex: 1; overflow-y: auto; padding: 16px; }
.lateral__cuerpo h2 { font-size: 16px; line-height: 20px; font-weight: 600; outline: 0; }
.lateral .t { padding: 12px; background: var(--s2); }
.pila { display: grid; gap: 12px; align-content: start; min-width: 0; }
.b--mini { min-height: 28px; padding: 0 8px; }
.cabeza__buscar { display: inline-flex; align-items: center; gap: 8px; height: var(--ctrl); padding: 0 8px 0 12px; border: 1px solid var(--borde); border-radius: var(--rc); background: none; color: var(--dim); font-size: 12px; }
.cabeza__buscar:hover { background: var(--s2); }
kbd { padding: 0 4px; border: 1px solid var(--borde); border-radius: 4px; color: var(--dim); font: 500 12px/18px var(--letra); white-space: nowrap; }
.cabeza__rol { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12px; white-space: nowrap; }
.cabeza__rol select { font-size: 12px; color: var(--ink); }
.tira { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, 1fr); gap: 2px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tira__paso { width: 100%; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); background: var(--s1); color: var(--faint); font-size: 12px; font-weight: 500; line-height: 14px; }
.tira__paso:hover:not(:disabled) { border-color: var(--borde); color: var(--ink); }
.tira__paso.hecha { color: var(--dim); background: var(--s2); }
.tira__paso.actual { background: var(--ink); border-color: var(--ink); color: var(--sobre-estado); font-weight: 600; }
.tira li:first-child .tira__paso { border-radius: var(--rc) 0 0 var(--rc); }
.tira li:last-child .tira__paso { border-radius: 0 var(--rc) var(--rc) 0; }
.destacados { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--line); overflow: hidden; }
.destacados div { padding: 8px 12px; background: var(--s1); }
.destacados span { display: block; color: var(--dim); font-size: 12px; line-height: 16px; }
.destacados b { font-weight: 600; }
.ficha-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.puntaje { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid var(--borde); border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.factores li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); }
.factores li:first-child { border-top: 0; }
.factores b { font-weight: 600; }
.requisitos { display: grid; gap: 4px; }
.resumen { display: grid; gap: 4px; }
.sugerencia { padding: 8px 0; border-top: 1px solid var(--line); }
.sugerencia:first-of-type { border-top: 0; padding-top: 0; }
.sugerencia .acciones { margin-top: 8px; }
.nota { display: grid; gap: 8px; justify-items: start; margin-bottom: 12px; }
.nota textarea { width: 100%; padding: 8px 12px; resize: vertical; }
.historia { position: relative; margin-top: 12px; }
.evento { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; padding-bottom: 12px; }
.evento::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: -4px; width: 1px; background: var(--line); }
.evento:last-child::before { display: none; }
.evento__punto { width: 8px; height: 8px; margin: 6px 0 0 4px; border-radius: 50%; background: var(--neutro); }
.evento--nuevo .evento__punto { background: var(--ink); }
.evento b { font-weight: 600; }
.evento small { color: var(--faint); font-size: 12px; }
.evento time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.lateral .evento { grid-template-columns: 16px minmax(0, 1fr); }
.lateral .evento time { grid-column: 2; }
.tarjeta--op { cursor: pointer; }
.tarjeta--op:hover { border-color: var(--borde); }
.tarjeta--op.arrastrando { opacity: .4; }
.tarjeta__fila { display: flex; justify-content: space-between; gap: 8px; }
.tarjeta__importe { flex: none; font-weight: 600; }
.columna.sobre { border-color: var(--ink); }
.bandeja-hoy li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bandeja-hoy li > div:nth-child(2) { flex: 1; min-width: 200px; }
.bandeja-hoy b { display: block; font-weight: 600; }
.bandeja-hoy small { color: var(--dim); font-size: 12px; }
.campo-check { display: flex; align-items: center; gap: 8px; min-height: 32px; color: var(--ink); }
.opciones { position: relative; }
.opciones summary { list-style: none; cursor: pointer; }
.opciones summary::-webkit-details-marker { display: none; }
.opciones__caja { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); width: 280px; padding: 12px; border: 1px solid var(--borde); border-radius: var(--r); background: var(--s2); box-shadow: 0 8px 24px -4px #00000099; }
.tabla th, .tabla td { height: var(--fila, 40px); }
.paleta { width: min(640px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 1px solid var(--borde); border-radius: var(--r); background: var(--s2); }
.paleta__campo { width: 100%; height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); outline: 0; background: none; font-size: 16px; }
.paleta__lista { max-height: 380px; min-height: 112px; overflow-y: auto; padding: 8px; }
.paleta__lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 8px; border-radius: var(--rc); cursor: pointer; }
.paleta__lista li.activa { background: var(--s3); }
.paleta__lista small { color: var(--faint); font-size: 12px; white-space: nowrap; }
.paleta__vacio { color: var(--dim); }
.paleta__pie { padding: 8px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
@media (max-width: 1279px) {
  .lateral { position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: min(400px, 100%); box-shadow: 0 8px 24px -4px #00000099; }
}
@media (max-width: 1100px) { .ficha-grid { grid-template-columns: minmax(0, 1fr); } .cabeza__rol { display: none; } }
@media (max-width: 760px) {
  .lateral { width: 100%; }
  .cabeza__buscar kbd { display: none; }
  .opciones__caja { position: fixed; left: 16px; right: 16px; top: auto; bottom: 72px; width: auto; }
}

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1100px) {
  .p3 { display: none; }
  .c3, .c2 { grid-column: span 6; } .c4, .c5, .c7, .c8 { grid-column: span 12; }
  .chat-grid { grid-template-columns: 240px minmax(0, 1fr); }
  .chat-detalle { display: none; }
  .marco { grid-template-columns: 200px minmax(0, 1fr); }
}
/* ---------- Celular ---------- */
@media (max-width: 760px) {
  .marco, .marco[data-menu="chico"] { display: flex; flex-direction: column; }
  .menu { display: none; }
  .contenido { flex: 1; }
  .cabeza { height: 48px; padding: 0 16px; }
  .cabeza__muestra, .cabeza__volver { display: none; }
  main { padding: 12px 16px 24px; }
  .c6, .c3, .c2 { grid-column: span 12; }
  .p2, .p3 { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-grid { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat-lista { max-height: 216px; }
  .chat { min-height: 420px; }
  .buscador, .campo, .chat__pie input, .fila-form input { font-size: 16px; }
  .columnas { grid-auto-flow: row; grid-auto-columns: auto; }
  .columna { min-height: 0; }
  .contador { margin-left: 0; }
  .barra-movil { position: relative; z-index: 45; display: grid; flex: 0 0 auto; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--s1); }
  .barra-movil button { display: grid; justify-items: center; gap: 2px; min-height: 56px; padding: 8px 2px 4px; border: 0; background: none; color: var(--dim); font-size: 12px; line-height: 16px; }
  .barra-movil button[aria-current="page"] { color: var(--ink); }
  .barra-movil svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .andon__grilla { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(4, 1fr); }
  .andon__m strong { font-size: 6vh; }
  .andon__m h2 { font-size: 2.6vh; }
  .andon__m p { font-size: 1.8vh; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
