/* Torvex Refacciones · app interna de inventario y pedidos (marca ficticia, tema claro). */
body.torvex {
  --fondo: #F6F5F2;
  --superficie: #FFFFFF;
  --superficie-2: #F3F1EC;
  --borde: rgba(28, 25, 23, .09);
  --texto: #1C1917;
  --suave: #57534E;
  --tenue: #A8A29E;
  --acento: #E8590C;
  --acento-2: #2563EB;
  --ok: #16A34A;
  --aviso: #D97706;
  --error: #DC2626;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(28, 25, 23, .05), 0 10px 30px -18px rgba(28, 25, 23, .25);
}

.tv-app { display: grid; grid-template-columns: 248px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; min-height: calc(100vh - var(--barra-alto));
  background: linear-gradient(var(--borde), var(--borde)) 247px 0 / 1px 100% no-repeat; }

/* Lateral */
.tv-lateral {
  position: sticky; top: var(--barra-alto); height: calc(100vh - var(--barra-alto));
  display: flex; flex-direction: column; gap: 18px; padding: 22px 16px;
}
.tv-marca { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.marca-logo { width: 34px; height: 34px; flex: none; }
.tv-marca strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.tv-marca span { display: block; font-size: 12px; color: var(--suave); }
.tv-buscar {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--borde); background: var(--superficie); color: var(--suave); font-size: 13.5px; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.tv-buscar:hover { border-color: color-mix(in srgb, var(--acento) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 10%, transparent); }
.tv-buscar span { flex: 1; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--superficie-2); border: 1px solid var(--borde); color: var(--suave); white-space: nowrap; }
.tv-nav { display: grid; gap: 2px; }
.tv-nav-btn {
  position: relative; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--suave); font-weight: 500; text-align: left;
  transition: background .18s, color .18s;
}
.tv-nav-btn:hover { background: var(--superficie-2); color: var(--texto); }
.tv-nav-btn.activo { background: color-mix(in srgb, var(--acento) 10%, var(--superficie)); color: var(--acento); }
.tv-nav-btn.activo::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--acento); animation: tv-crecer .3s var(--ease); }
.tv-insignia { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--acento); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.tv-insignia:empty { display: none; }
.salta { animation: tv-salto .45s var(--ease); }
.tv-usuario { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--borde); }
.tv-usuario strong { display: block; font-size: 13.5px; }
.tv-usuario span:not(.tv-avatar) { display: block; font-size: 12px; color: var(--suave); }
.tv-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #292524; color: #fff; font-size: 12px; font-weight: 600; flex: none; }

/* Contenido */
.tv-contenido { min-width: 0; padding: 28px 32px 8px; }
.tv-vista { animation: tv-vista .4s var(--ease) both; }
.tv-enc { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.tv-enc h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 600; }
.tv-enc p { color: var(--suave); margin-top: 6px; font-size: 14px; }
.tv-enc p::first-letter { text-transform: uppercase; }
.tv-enc-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-tenue { color: var(--tenue); }
.nowrap { white-space: nowrap; }
.mas { color: var(--ok); font-weight: 600; }
.menos { color: var(--acento); font-weight: 600; }

/* Resumen */
.tv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.tv-kpi { padding: 18px; display: grid; gap: 6px; transition: transform .25s var(--ease), box-shadow .25s; }
.tv-kpi:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 18px 36px -20px rgba(28, 25, 23, .35); }
.tv-kpi-top { display: flex; justify-content: space-between; align-items: center; }
.tv-kpi-ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--acento) 10%, transparent); color: var(--acento); }
.tv-kpi strong { font-size: clamp(24px, 2.6vw, 30px); font-weight: 600; letter-spacing: -.03em; }
.tv-kpi-nota { font-size: 12.5px; color: var(--suave); }
.tv-res-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tv-col { display: grid; gap: 14px; }
.tv-panel { padding: 18px; }
.tv-panel-enc { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tv-panel-enc h2 { font-size: 16px; font-weight: 600; }
.tv-alertas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tv-alertas li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--error) 4%, var(--superficie)); border: 1px solid color-mix(in srgb, var(--error) 14%, transparent); }
.tv-alerta-txt { flex: 1; min-width: 0; }
.tv-alerta-txt strong { display: block; font-size: 14px; font-weight: 500; }
.tv-alerta-txt span { font-size: 12.5px; color: var(--suave); }
.tv-alerta-txt b { color: var(--error); }
.pulso { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--error); flex: none; }
.pulso::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: tv-pulso 1.6s ease-out infinite; }
.pulso.chico { width: 6px; height: 6px; background: currentColor; }
.tv-vacio { display: flex; gap: 8px; align-items: center; color: var(--ok); font-size: 14px; }
.tv-barras { display: grid; gap: 14px; }
.tv-barra-et { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.tv-barra-pista { height: 10px; border-radius: 99px; background: var(--superficie-2); overflow: hidden; }
.tv-barra-relleno { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #F59F00, var(--acento)); transition: width 1s var(--ease) var(--d, 0ms); }
.tv-mini-movs { list-style: none; margin: 0; padding: 0; display: grid; }
.tv-mini-movs li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--borde); }
.tv-mini-movs li:first-child { border-top: 0; padding-top: 0; }
.tv-mini-movs div { flex: 1; min-width: 0; }
.tv-mini-movs strong { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-mini-movs span:not(.tv-mov-ic) { font-size: 12px; color: var(--suave); }
.tv-mov-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }

/* Herramientas, chips y tablas */
.tv-barra-herr { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tv-buscador { position: relative; flex: 1 1 280px; min-width: 0; }
.tv-buscador > .icono { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tenue); pointer-events: none; }
.tv-buscador .entrada { padding-left: 36px; background: var(--superficie); }
.tv-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tv-chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--borde); background: var(--superficie); color: var(--suave); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: all .18s var(--ease); }
.tv-chip:hover { color: var(--texto); }
.tv-chip.activo { background: var(--texto); color: var(--fondo); border-color: transparent; }
.tv-tabla-caja { overflow: hidden; min-height: 200px; }
.tv-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tv-tabla { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.tv-tabla th { text-align: left; font-weight: 500; font-size: 12px; color: var(--suave); padding: 12px 16px; background: var(--superficie-2); border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tv-tabla td { padding: 10px 16px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tv-tabla tbody tr { transition: background .15s; }
.tv-tabla tbody tr:hover { background: color-mix(in srgb, var(--superficie-2) 60%, transparent); }
.tv-tabla tbody tr:last-child td { border-bottom: 0; }
.tv-prod { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.tv-prod-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 11.5px; font-weight: 600; text-transform: uppercase; color: var(--acento); background: color-mix(in srgb, var(--acento) 9%, transparent); }
.tv-prod strong, .tv-prod-mini strong { display: block; font-weight: 500; }
.tv-prod span, .tv-prod-mini span { font-size: 12px; color: var(--tenue); }
.tv-prod-mini { min-width: 200px; }
.tv-vacio-td { text-align: center; color: var(--suave); padding: 36px 16px !important; }
.sk-tabla { display: grid; padding: 8px 16px; }
.sk-fila { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--borde); }
.tv-ayuda { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--suave); margin-top: 10px; }

/* Edición en línea de la existencia */
.tv-cant-td { min-width: 150px; }
.tv-cant {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 8px;
  border: 1px dashed transparent; background: transparent; font-weight: 600; font-size: 14.5px;
  transition: background .15s, border-color .15s, color .3s;
}
.tv-cant:hover { border-color: var(--borde); background: var(--superficie-2); }
.tv-lapiz { width: 13px; height: 13px; color: var(--tenue); opacity: 0; transition: opacity .15s; }
.tv-cant:hover .tv-lapiz, .tv-cant:focus-visible .tv-lapiz { opacity: 1; }
.tv-cant.guardado { color: var(--ok); animation: tv-guardado 1.2s var(--ease); }
.tv-cant.guardado .icono { animation: qa-pop .4s var(--ease); }
.tv-cant-edit { display: flex; align-items: center; gap: 4px; animation: qa-pop .25s var(--ease); }
.tv-cant-input { width: 76px; height: 34px; padding: 0 8px; font-weight: 600; }
.tv-mini-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--borde); background: var(--superficie); color: var(--suave); flex: none; transition: all .15s; }
.tv-mini-btn:hover { color: var(--texto); background: var(--superficie-2); }
.tv-mini-btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.tv-guardando { display: inline-flex; align-items: center; gap: 8px; height: 32px; font-size: 13px; color: var(--suave); }
.giro { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: qa-girar .7s linear infinite; display: inline-block; flex: none; }

/* Escáner */
.tv-dlg { padding: 20px; display: grid; gap: 14px; }
.tv-dlg-enc { display: flex; justify-content: space-between; align-items: center; }
.tv-dlg-enc h2 { font-size: 19px; font-weight: 600; }
.tv-dlg-pie { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.tv-visor { position: relative; height: 190px; border-radius: 14px; background: radial-gradient(circle at 50% 40%, #2A2522, #121010); overflow: hidden; display: grid; place-items: center; }
.tv-codigo {
  width: 64%; height: 84px; border-radius: 4px; background-color: #F5F5F4;
  background-image: repeating-linear-gradient(90deg, #1C1917 0 2px, transparent 2px 4px, #1C1917 4px 7px, transparent 7px 9px, #1C1917 9px 10px, transparent 10px 13px);
  background-clip: content-box; padding: 10px 12px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transform: rotate(-2deg);
}
.tv-laser { position: absolute; left: 12%; right: 12%; height: 2px; top: 30%; background: #FF4D2E; box-shadow: 0 0 12px 2px rgba(255, 77, 46, .8), 0 0 40px 6px rgba(255, 77, 46, .35); opacity: 0; }
.tv-visor.leyendo .tv-laser { opacity: 1; animation: tv-laser 1.1s ease-in-out infinite alternate; }
.tv-visor.leido .tv-laser { opacity: 1; top: 50%; background: #22C55E; box-shadow: 0 0 14px 3px rgba(34, 197, 94, .8); animation: qa-latido .5s 2; }
.tv-visor.leido .tv-codigo { animation: tv-flash .6s ease-out; }
.tv-esq { position: absolute; width: 22px; height: 22px; border: 3px solid rgba(255, 255, 255, .85); }
.tv-esq.a { top: 16px; left: 16px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.tv-esq.b { top: 16px; right: 16px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.tv-esq.c { bottom: 16px; left: 16px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.tv-esq.d { bottom: 16px; right: 16px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.tv-esc-estado { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--suave); }
.tv-visor.leido ~ .tv-esc-estado { color: var(--ok); }
.tv-esc-res:empty { display: none; }
.tv-esc-prod { padding: 14px; border-radius: 12px; background: var(--superficie-2); display: grid; gap: 4px; }
.tv-esc-prod > span { font-size: 12.5px; color: var(--suave); }
.tv-esc-cant { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 18px; }
.tv-esc-cant > span.num { color: var(--tenue); text-decoration: line-through; }
.tv-esc-cant b { color: var(--ok); }
.tv-esc-cant .pastilla { margin-left: auto; }

/* Pedidos */
.tv-tablero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tv-columna { background: color-mix(in srgb, var(--superficie-2) 70%, transparent); border: 1px solid var(--borde); border-radius: 16px; padding: 12px; min-height: 240px; }
.tv-col-enc { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.tv-col-enc h2 { font-size: 14.5px; font-weight: 600; }
.tv-punto { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.tv-cuenta { margin-left: auto; font-size: 12.5px; color: var(--suave); background: var(--superficie); border: 1px solid var(--borde); padding: 1px 9px; border-radius: 99px; display: inline-block; }
.tv-col-lista { display: grid; gap: 10px; }
.tv-pedido { background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; padding: 14px; display: grid; gap: 8px; box-shadow: var(--sombra); transition: transform .3s var(--ease), opacity .3s var(--ease), box-shadow .2s; }
.tv-pedido:hover { box-shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 16px 32px -18px rgba(28, 25, 23, .4); }
.tv-pedido.sale { transform: translateX(24px) scale(.95); opacity: 0; }
.tv-pedido.llega { animation: tv-llega .55s var(--ease) both; }
.tv-ped-top { display: flex; justify-content: space-between; font-size: 12px; }
.tv-folio { color: var(--acento); font-weight: 500; }
.tv-ped-cliente { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.tv-ped-lineas { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--suave); display: grid; gap: 2px; }
.tv-ped-lineas li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-ped-pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--borde); }
.tv-ped-pie small { color: var(--suave); }

/* Nuevo pedido */
.tv-np-res { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 4px; }
.tv-np-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; text-align: left; transition: background .15s, border-color .15s; }
.tv-np-item:hover:not(:disabled) { background: color-mix(in srgb, var(--acento) 7%, transparent); border-color: color-mix(in srgb, var(--acento) 20%, transparent); }
.tv-np-item:disabled { opacity: .45; cursor: not-allowed; }
.tv-np-item div { flex: 1; min-width: 0; }
.tv-np-item strong { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-np-item span.mono { font-size: 11.5px; color: var(--tenue); }
.tv-np-item > .icono { color: var(--acento); }
.tv-np-nada { padding: 8px 10px; font-size: 13px; }
.tv-np-lineas { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 8px; }
.tv-np-lineas li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--superficie-2); }
.tv-np-nom strong { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-np-nom span { font-size: 11.5px; color: var(--tenue); }
.tv-np-sub { min-width: 74px; text-align: right; font-size: 14px; }
.tv-np-lineas li.tv-np-vacio { display: flex; gap: 8px; color: var(--suave); font-size: 13.5px; background: transparent; border: 1px dashed var(--borde); justify-content: center; }
.tv-paso { display: flex; align-items: center; gap: 2px; background: var(--superficie); border: 1px solid var(--borde); border-radius: 9px; padding: 2px; }
.tv-paso button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--suave); }
.tv-paso button:hover:not(:disabled) { background: var(--superficie-2); color: var(--texto); }
.tv-paso button:disabled { opacity: .35; cursor: not-allowed; }
.tv-paso span { min-width: 24px; text-align: center; font-weight: 600; font-size: 14px; }
.tv-np-totales { margin: 0; display: grid; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid var(--borde); }
.tv-np-totales div { display: flex; justify-content: space-between; font-size: 14px; color: var(--suave); }
.tv-np-totales dd { margin: 0; }
.tv-np-totales .total { color: var(--texto); font-size: 18px; padding-top: 8px; border-top: 1px solid var(--borde); }
select.entrada { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--suave) 50%), linear-gradient(135deg, var(--suave) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* Menú de comandos */
.tv-cmd-velo { position: fixed; inset: 0; z-index: 1060; background: rgba(28, 25, 23, .35); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: calc(var(--barra-alto) + 8vh) 16px 16px; animation: qa-aparecer .2s ease both; }
.tv-cmd-velo.sale { animation: qa-desaparecer .15s ease both; }
.tv-cmd { width: min(600px, 100%); background: var(--superficie); border: 1px solid var(--borde); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(28, 25, 23, .45); overflow: hidden; animation: tv-cmd .3s var(--ease) both; }
.tv-cmd-top { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--borde); color: var(--tenue); }
.tv-cmd-input { flex: 1; min-width: 0; height: 54px; border: 0; background: transparent; font-size: 16px; color: var(--texto); }
.tv-cmd-input:focus { outline: none; }
.tv-cmd-lista { list-style: none; margin: 0; padding: 8px; max-height: min(380px, 50vh); overflow-y: auto; }
.tv-cmd-grupo { font-size: 11.5px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--tenue); padding: 10px 10px 6px; }
.tv-cmd-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; font-size: 14.5px; color: var(--suave); }
.tv-cmd-item span { color: var(--texto); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-cmd-item small { font-size: 12px; color: var(--tenue); white-space: nowrap; }
.tv-cmd-item.sel { background: color-mix(in srgb, var(--acento) 10%, transparent); color: var(--acento); }
.tv-cmd-nada { padding: 24px; text-align: center; color: var(--suave); font-size: 14px; }
.tv-cmd-pie { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--borde); font-size: 12px; color: var(--tenue); }
.tv-cmd-pie kbd { margin-right: 2px; }

@keyframes tv-vista { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tv-pulso { from { transform: scale(1); opacity: .6; } to { transform: scale(3.2); opacity: 0; } }
@keyframes tv-crecer { from { transform: scaleY(0); } to { transform: none; } }
@keyframes tv-salto { 40% { transform: scale(1.3); } }
@keyframes tv-guardado { from { background: color-mix(in srgb, var(--ok) 22%, transparent); } to { background: transparent; } }
@keyframes tv-laser { from { top: 22%; } to { top: 76%; } }
@keyframes tv-flash { 0% { filter: brightness(1.6); } 100% { filter: none; } }
@keyframes tv-llega { 0% { opacity: 0; transform: translateY(-10px) scale(.96); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 40%, transparent); } 60% { opacity: 1; transform: none; } 100% { box-shadow: var(--sombra); } }
@keyframes tv-cmd { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 1100px) {
  .tv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-res-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .tv-app { grid-template-columns: minmax(0, 1fr); background: none; }
  .tv-lateral {
    position: sticky; top: var(--barra-alto); z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 10px; padding: 10px 16px 0; border-right: 0; border-bottom: 1px solid var(--borde);
    background: color-mix(in srgb, var(--fondo) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .tv-marca { padding: 0; flex: 1; min-width: 0; }
  .marca-logo { width: 30px; height: 30px; }
  .tv-buscar { width: 40px; padding: 0; justify-content: center; }
  .tv-buscar span, .tv-buscar kbd { display: none; }
  .tv-nav { flex: 1 0 100%; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .tv-nav-btn { height: 42px; flex: none; border-radius: 0; padding: 0 10px; background: transparent !important; }
  .tv-nav-btn.activo::before { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  .tv-usuario { display: none; }
  .tv-contenido { padding: 20px 16px 8px; }
  .tv-tablero { grid-template-columns: minmax(0, 1fr); }
  .tv-columna { min-height: 0; }
}
@media (max-width: 520px) {
  .tv-kpis { gap: 10px; }
  .tv-kpi { padding: 14px; }
  .tv-alertas li { flex-wrap: wrap; }
  .tv-alertas li { align-items: flex-start; }
  .tv-alertas li .pulso { margin-top: 6px; }
  .tv-alerta-txt { flex-basis: calc(100% - 22px); }
  .tv-alertas li .btn { margin-left: 22px; }
  .tv-nav { gap: 0; }
  .tv-nav-btn { flex: 1 0 auto; padding: 0 8px; gap: 6px; font-size: 14px; justify-content: center; }
  .tv-nav-btn .icono { width: 16px; height: 16px; }
  .tv-np-lineas li { grid-template-columns: minmax(0, 1fr) auto; }
  .tv-np-sub { grid-column: 2; text-align: right; }
  .tv-dlg { padding: 16px; }
  .tv-cmd-item small { display: none; }
  .tv-enc-acc { width: 100%; }
  .tv-enc-acc .btn { flex: 1; }
}
