/* FORJA · sistema. Blanco y negro. El único color funcional es el rojo de lo que está mal. */
:root {
  --n: #000; --t: #1d1d1f; --t2: #6e6e73; --t3: #8e8e93; --b: #fff; --f: #f5f5f7; --f2: #ececf0; --l: #e3e3e8; --l2: #d2d2d7; --rojo: #c8102e;
  --r: 16px; --r2: 10px; --ease: cubic-bezier(.2, .8, .2, 1);
  --lado: 244px; --franja: 30px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--f); color: var(--t); font: 400 14px/1.45 "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-feature-settings: "tnum"; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .45; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--n); outline-offset: 2px; border-radius: 4px; }
svg { display: block; }

.franja-demo { position: fixed; inset: 0 0 auto 0; height: var(--franja); z-index: 40; background: var(--n); color: #fff; font-size: 12px; letter-spacing: .01em; line-height: var(--franja); text-align: center; padding: 0 12px; white-space: nowrap; overflow: hidden; }
.franja-demo b { font-weight: 600; margin-right: 4px; }

.app { display: flex; min-height: 100vh; padding-top: var(--franja); }
.lado { position: fixed; top: var(--franja); bottom: 0; left: 0; width: var(--lado); background: var(--b); border-right: 1px solid var(--l); display: flex; flex-direction: column; padding: 18px 12px 12px; z-index: 20; }
.marca { display: flex; align-items: center; gap: 10px; padding: 2px 10px 16px; }
.marca svg { width: 40px; height: 15px; fill: var(--n); }
.marca b { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.menu { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; scrollbar-width: none; }
.menu-g { font-size: 11px; color: var(--t3); padding: 14px 10px 5px; }
.menu-g:first-child { padding-top: 0; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-weight: 500; font-size: 13.5px; color: #3a3a3c; transition: background .15s, color .15s; }
.menu a svg { width: 18px; height: 18px; flex: none; }
.menu a span { flex: 1; min-width: 0; }
.menu a:hover { background: var(--f); }
.menu a.on { background: var(--n); color: #fff; }
.menu em { font-style: normal; font-size: 11px; font-weight: 600; background: var(--f2); color: var(--t); border-radius: 20px; padding: 0 7px; line-height: 18px; }
.menu a.on em { background: #fff; color: #000; }
.lado-pie { border-top: 1px solid var(--l); padding-top: 12px; margin-top: 8px; }
.yo { display: flex; gap: 10px; align-items: center; padding: 0 6px 10px; }
.yo-av { width: 32px; height: 32px; border-radius: 50%; background: var(--n); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; flex: none; }
.yo b { display: block; font-weight: 600; font-size: 13px; line-height: 1.2; }
.yo small { color: var(--t2); font-size: 11.5px; }
.lado-acc { display: flex; justify-content: space-between; padding: 0 6px; font-size: 12px; color: var(--t2); }
.lado-acc button:hover, .lado-acc a:hover { color: var(--n); }

.principal { flex: 1; min-width: 0; margin-left: var(--lado); }
.cab { position: sticky; top: var(--franja); z-index: 15; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgb(245 245 247 / .86); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid transparent; }
.cab-t { flex: 1; min-width: 0; }
.migas { display: block; font-size: 12px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reloj { font-size: 12px; color: var(--t2); white-space: nowrap; }
.btn-ia { display: flex; align-items: center; gap: 10px; background: var(--n); color: #fff; padding: 9px 12px 9px 16px; border-radius: 22px; font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: transform .2s var(--ease); }
.btn-ia:hover { transform: translateY(-1px); }
.btn-ia .c { display: none; }
.btn-ia kbd { font: inherit; font-size: 11px; background: rgb(255 255 255 / .16); border-radius: 8px; padding: 1px 7px; }
.vista { padding: 6px 28px 60px; outline: 0; }
.vista-c.entra { animation: entra .42s var(--ease); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

/* Bloques */
.tarjeta { background: var(--b); border-radius: var(--r); padding: 20px 22px; min-width: 0; margin-bottom: 16px; }
.rejilla .tarjeta { margin-bottom: 0; display: flex; flex-direction: column; }
.tj-cab { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.tj-cab > div:first-child { flex: 1 1 200px; min-width: 0; }
.tj-cab h3 { font-size: 16px; font-weight: 600; letter-spacing: -.012em; }
.tj-cab p { color: var(--t2); font-size: 13px; margin-top: 1px; }
.sec-t { font-size: 16px; font-weight: 600; letter-spacing: -.012em; margin: 22px 2px 10px; }
.rejilla { display: grid; gap: 16px; margin-bottom: 16px; }
.rejilla.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla.d-dec { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.kpis { display: grid; gap: 12px; margin-bottom: 16px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { background: var(--b); border-radius: var(--r); padding: 15px 17px; display: flex; flex-direction: column; gap: 2px; min-width: 0; transition: transform .2s var(--ease); }
a.kpi:hover { transform: translateY(-2px); }
.kpi-e { font-size: 12.5px; color: var(--t2); display: flex; align-items: center; gap: 6px; }
.kpi-v { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-n { font-size: 12px; color: var(--t2); line-height: 1.3; }
.kpi.negro { background: var(--n); color: #fff; }
.kpi.negro .kpi-e, .kpi.negro .kpi-n, .kpi.negro > span { color: #a1a1a6; }
.kpi.alerta .kpi-v { color: var(--rojo); }
.kpi.aforo .medidor { background: #333; margin-top: 8px; }
.kpi.aforo .medidor i { background: #fff; }
.kpi.aforo .kpi-v b { font-weight: 700; }
.vivo { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: latir 1.8s infinite; }
@keyframes latir { 50% { opacity: .3; } }

.hola { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; margin: 4px 2px 16px; flex-wrap: wrap; }
.hola > div { flex: 1 1 340px; min-width: 0; }
.hola h2 { font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.08; }
.hola p { color: var(--t2); font-size: 15px; margin-top: 5px; max-width: 58ch; }
.hola-f { flex: 0 1 390px; display: flex; gap: 6px; background: var(--b); border-radius: 26px; padding: 5px 5px 5px 18px; align-items: center; min-width: 0; }
.hola-f input { flex: 1; border: 0; outline: 0; background: none; min-width: 0; font-size: 14.5px; }
.ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .15s; }
.ic svg { width: 18px; height: 18px; }
.ic:hover { background: var(--f); }
.ic.prim { background: var(--n); color: #fff; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: 21px; background: var(--f); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background .15s, transform .2s var(--ease); }
.btn:hover:not(:disabled) { background: var(--f2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.prim { background: var(--n); color: #fff; }
.btn.prim:hover:not(:disabled) { background: #2a2a2c; }
.btn.chico { padding: 6px 12px; font-size: 12.5px; }
.btn.ancho { width: 100%; }
.mas-f { margin-top: 12px; width: 100%; }
.lnk { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 500; border-bottom: 1px solid currentColor; align-self: flex-start; }
.lnk.atras { margin: 0 2px 12px; border: 0; color: var(--t2); }
.lnk.atras::before { content: "← "; }
.chip { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 20px; background: var(--f2); white-space: nowrap; }
.chip.alto { background: var(--rojo); color: #fff; }
.chip.medio { background: var(--n); color: #fff; }
.chip.tenue { background: transparent; box-shadow: inset 0 0 0 1px var(--l2); color: var(--t2); }
.vacio { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 28px 12px; text-align: center; color: var(--t2); }
.vacio b { color: var(--t); font-weight: 600; font-size: 15px; }
.p { color: var(--t2); font-size: 13.5px; }
.sub { display: block; color: var(--t2); font-size: 12px; font-weight: 400; }

.barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.barra-d { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; background: var(--f2); padding: 3px; border-radius: 22px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { padding: 6px 14px; border-radius: 19px; font-size: 13px; font-weight: 500; color: #515154; white-space: nowrap; transition: background .2s, color .2s; flex: none; }
.seg button.on { background: var(--n); color: #fff; }
.seg-sc { margin-bottom: 12px; }
.tarjeta .seg { background: var(--f); }
.inp { border: 1px solid var(--l2); border-radius: 21px; background: var(--b); padding: 8px 15px; outline: 0; min-width: 0; width: 100%; max-width: 280px; transition: border-color .15s; }
.inp:focus { border-color: var(--n); }
.inp.chico { max-width: 180px; padding: 6px 13px; font-size: 13px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--t2); }
.campo .inp, .campo select { max-width: none; color: var(--t); }
.campo select { border: 1px solid var(--l2); border-radius: 12px; padding: 9px 12px; background: var(--b); width: 100%; }

/* Tablas */
.tabla-m { overflow-x: auto; margin: 0 -4px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th { text-align: left; font-weight: 500; color: var(--t2); font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--l); white-space: nowrap; }
.tabla td { padding: 10px 8px; border-bottom: 1px solid var(--f2); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla b { font-weight: 600; }
.tabla .n { text-align: right; white-space: nowrap; }
.tabla .tn { color: var(--t2); }
.tabla tr.click { cursor: pointer; transition: background .12s; }
.tabla tr.click:hover { background: var(--f); }
.tabla.mini { font-size: 12.5px; margin-top: 2px; }
.tabla.mini td { padding: 6px 8px; }

/* Gráficos */
.graf { width: 100%; position: relative; }
.graf svg { overflow: visible; }
.g-rej { stroke: var(--f2); stroke-width: 1; }
.g-t { font-size: 11px; fill: var(--t3); }
.g-t.fuerte { fill: var(--t); font-weight: 500; }
.g-bar { fill: #b9b9c0; transition: fill .12s; }
.g-bar.os { fill: var(--n); }
.g-bar.cl { fill: #dcdce1; }
.g-bar.anim { transform-box: fill-box; transform-origin: bottom; animation: crecer .55s var(--ease) both; }
@keyframes crecer { from { transform: scaleY(0); } }
.g-ref { stroke: var(--n); stroke-width: 1; stroke-dasharray: 3 3; }
.g-lin { fill: none; stroke: var(--n); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.g-lin.gris { stroke: #a1a1a6; }
.g-lin.punt { stroke-dasharray: 2 5; }
.g-lin.anim { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dibujar .9s var(--ease) forwards; }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
.g-banda { fill: rgb(0 0 0 / .085); }
.g-cruz { stroke: var(--l2); stroke-width: 1; pointer-events: none; }
.g-pto { fill: var(--n); stroke: #fff; stroke-width: 2; pointer-events: none; }
.g-pto.gris { fill: #a1a1a6; }
.g-ley { display: flex; gap: 14px; font-size: 12px; color: var(--t2); margin-bottom: 4px; flex-wrap: wrap; }
.g-ley span { display: inline-flex; align-items: center; gap: 6px; }
.g-ley i { width: 14px; height: 2px; background: var(--n); }
.g-ley i.gris { background: #a1a1a6; }
.g-ley i.punt { background: repeating-linear-gradient(90deg, var(--n) 0 2px, transparent 2px 5px); }
.tip { position: fixed; z-index: 90; background: var(--n); color: #fff; border-radius: 10px; padding: 7px 10px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .1s; min-width: 110px; }
.tip.on { opacity: 1; }
.tip-t { color: #a1a1a6; font-size: 11px; margin-bottom: 2px; }
.tip-f { display: flex; justify-content: space-between; gap: 12px; }
.tip-f b { font-weight: 600; }
.medidor { height: 6px; border-radius: 4px; background: var(--f2); overflow: hidden; }
.medidor i { display: block; height: 100%; background: var(--n); border-radius: 4px; transition: width .5s var(--ease); }
.mapa { display: grid; grid-template-columns: 30px repeat(var(--cols), minmax(0, 1fr)); gap: 2px; font-size: 10.5px; color: var(--t3); }
.mapa i { height: 24px; border-radius: 3px; display: block; }
.mapa i.ahora { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--n); position: relative; z-index: 1; }
.mapa-f { align-self: center; }
.mapa-c { text-align: center; }

.cifra-m { display: flex; flex-direction: column; gap: 6px; }
.cifra-m > b { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.cifra-m > span { color: var(--t2); font-size: 13px; }
.cifra-m .medidor { margin: 10px 0 8px; }
.cifra-m small { color: var(--t2); font-size: 12.5px; line-height: 1.4; }

/* Dirección */
.decisiones li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--f2); }
.decisiones li:last-child { border: 0; padding-bottom: 0; }
.dn { width: 22px; height: 22px; border-radius: 50%; background: var(--f2); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; flex: none; }
.dt { flex: 1; min-width: 0; }
.dt b { display: block; font-weight: 600; line-height: 1.25; }
.dt small { color: var(--t2); font-size: 12.5px; }
.dv { font-size: 13px; color: var(--t2); white-space: nowrap; }
.areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.areas a { background: var(--b); border-radius: var(--r); padding: 15px 17px; display: flex; flex-direction: column; transition: transform .22s var(--ease), background .2s, color .2s; }
.areas a:hover { background: var(--n); color: #fff; transform: translateY(-2px); }
.areas a:hover small, .areas a:hover span { color: #c7c7cc; }
.ar-ic svg { width: 20px; height: 20px; margin-bottom: 10px; }
.areas b { font-weight: 600; font-size: 14.5px; margin-bottom: 2px; }
.areas span:not(.ar-ic) { font-size: 13px; }
.areas small { color: var(--t2); font-size: 12px; }

/* Central */
.desc { display: flex; flex-direction: column; gap: 8px; }
.desc > li { background: var(--b); border-radius: 14px; }
.desc-f { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
.desc-t { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; }
.desc-t > span:last-child { min-width: 0; }
.desc-t b { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.desc-t small { color: var(--t2); font-size: 12.5px; }
.desc-d { padding: 0 16px 15px; font-size: 13.5px; color: var(--t2); animation: entra .3s var(--ease); }
.desc-d ul { margin-top: 8px; color: var(--t); }
.desc-d li { padding: 4px 0; border-top: 1px solid var(--f2); font-size: 13px; }

/* Predicciones */
.notas { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 22px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--f2); }
.nota b { display: block; font-weight: 600; font-size: 13px; }
.nota span { color: var(--t2); font-size: 13px; }
.esc { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.pals { display: flex; flex-direction: column; gap: 16px; }
.pal span { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.pal output { font-weight: 600; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--f2); border-radius: 3px; outline-offset: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--n); cursor: grab; border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .3); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--n); border: 3px solid #fff; }
.esc-res { background: var(--n); color: #fff; border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.esc-res span, .esc-res small { color: #a1a1a6; font-size: 12.5px; }
.esc-res b { font-size: 32px; font-weight: 700; letter-spacing: -.03em; }

/* Socios */
.ficha-cab { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ficha-cab > div:first-child { flex: 1 1 320px; min-width: 0; }
.ficha-cab .chip { margin-right: 6px; }
.ficha-cab p { color: var(--t2); margin-top: 6px; }
.acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.fact { margin-top: 12px; }
.fact li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--f2); font-size: 13px; }
.fact b { font-weight: 500; color: var(--t2); white-space: nowrap; }
.fact li.sube b { color: var(--t); font-weight: 600; }
.msj { margin-top: 14px; background: var(--f); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.msj small { color: var(--t2); font-size: 12px; }
.msj p { font-size: 13.5px; }
.dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; font-size: 13.5px; }
.dl dt { color: var(--t2); }
.dl dd { text-align: right; }
.mini-l { margin-top: 10px; font-size: 13px; }
.mini-l li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--f2); }
.mini-l a { border-bottom: 1px solid var(--l2); }
.det summary { cursor: pointer; font-size: 13px; font-weight: 500; }

/* Acceso */
.feed { font-size: 13px; }
.feed li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--f2); animation: entra .35s var(--ease); }
.feed li:last-child { border: 0; }
.feed a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-h { color: var(--t2); }
.torn { margin-top: 14px; background: var(--f); border-radius: 12px; padding: 14px 16px; color: var(--t2); font-size: 13.5px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-height: 62px; }
.torn b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--n); }
.torn b.no { color: var(--rojo); }
.sug-l { display: flex; flex-direction: column; margin-top: 4px; }
.sug-l button { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 8px; text-align: left; font-size: 13px; }
.sug-l button:hover { background: var(--f); }
.sug-l small { color: var(--t2); }
.tarjeta .acc { margin-top: 10px; }
.tarjeta > div > .inp { max-width: none; }

/* Clases */
.cal { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cal-d { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-d h4 { font-size: 12.5px; font-weight: 600; color: var(--t2); padding: 0 2px 2px; }
.cal-m { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cl { text-align: left; background: var(--f); border-radius: 11px; padding: 9px 10px; display: flex; flex-direction: column; min-width: 0; transition: transform .18s var(--ease), background .15s; }
.cl:hover { transform: translateY(-2px); background: var(--f2); }
.cl-h { font-size: 11.5px; color: var(--t2); }
.cl b { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.cl small { color: var(--t2); font-size: 12px; }
.cl-o { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.cl-o .medidor { flex: 1; height: 4px; }
.cl-o em { font-style: normal; font-size: 11px; color: var(--t2); white-space: nowrap; }
.cl.llena { background: var(--n); color: #fff; }
.cl.llena:hover { background: #2a2a2c; }
.cl.llena .cl-h, .cl.llena small, .cl.llena .cl-o em { color: #a1a1a6; }
.cl.llena .medidor { background: #444; }
.cl.llena .medidor i { background: #fff; }
.cl.floja { box-shadow: inset 0 0 0 1px var(--l2); background: var(--b); }
.cl.mal { box-shadow: inset 0 0 0 1.5px var(--rojo); }

/* Caja */
.pos { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pos-g { margin-bottom: 14px; }
.pos-g h4 { font-size: 13px; font-weight: 600; color: var(--t2); margin: 0 2px 7px; }
.pos-p { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pos-p button { background: var(--b); border-radius: 12px; padding: 11px 12px; text-align: left; display: flex; flex-direction: column; transition: transform .18s var(--ease); }
.pos-p button:hover:not(:disabled) { transform: translateY(-2px); }
.pos-p button:active:not(:disabled) { transform: scale(.97); }
.pos-p b { font-weight: 600; font-size: 13px; line-height: 1.25; }
.pos-p span { margin-top: 4px; font-weight: 500; }
.pos-p small { color: var(--t2); font-size: 11.5px; }
.tarjeta.carro-t { position: sticky; top: 100px; }
.carro li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--f2); font-size: 13px; }
.cant { display: inline-flex; align-items: center; gap: 7px; }
.cant button { width: 22px; height: 22px; border-radius: 50%; background: var(--f); line-height: 1; }
.carro .n { min-width: 62px; text-align: right; }
.carro-t { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; }
.carro-t b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.carro .campo { margin-bottom: 10px; }

/* Ventas */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.kb-c { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kb-c h4 { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; padding: 0 2px 2px; }
.kb-c h4 em { font-style: normal; color: var(--t2); font-weight: 500; }
.kb-t { text-align: left; background: var(--f); border-radius: 10px; padding: 9px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; transition: transform .18s var(--ease), background .15s; min-width: 0; }
.kb-t:hover { background: var(--f2); transform: translateY(-1px); }
.kb-t b { font-weight: 600; font-size: 13px; line-height: 1.25; }
.kb-t small { color: var(--t2); font-size: 11.5px; }
.kb-t .chip { margin-top: 4px; }
.kb-t.web { box-shadow: inset 0 0 0 1.5px var(--n); }
.kb-m { color: var(--t2); font-size: 12px; padding: 0 2px; }
.embudo li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 54px 44px; gap: 10px; align-items: center; padding: 8px 0; font-size: 13px; }
.emb-b { background: var(--f); border-radius: 4px; height: 20px; overflow: hidden; }
.emb-b i { display: block; height: 100%; background: var(--n); border-radius: 0 4px 4px 0; animation: abrir .7s var(--ease); transform-origin: left; }
@keyframes abrir { from { transform: scaleX(0); } }
.embudo b { font-weight: 600; text-align: right; }
.embudo small { color: var(--t2); text-align: right; font-size: 12px; }
.tabla.resultado tr:has(b) td { border-top: 1px solid var(--l2); }

/* Modal y cajón */
.veu { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .42); display: grid; place-items: center; padding: 16px; animation: aparece .18s; }
@keyframes aparece { from { opacity: 0; } }
.modal { background: var(--b); border-radius: 20px; width: 100%; max-width: 440px; max-height: 86vh; display: flex; flex-direction: column; animation: subir .3s var(--ease); }
@keyframes subir { from { transform: translateY(14px) scale(.985); opacity: 0; } }
.modal-cab { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 8px 22px; }
.modal-cab h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.modal-c { padding: 4px 22px 16px; overflow-y: auto; }
.modal-pie { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 18px; flex-wrap: wrap; }
.mas-lista { display: flex; flex-direction: column; }
.mas-lista a { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--f2); }
.mas-lista svg { width: 20px; height: 20px; flex: none; }
.mas-lista b { display: block; font-weight: 600; }
.mas-lista small { color: var(--t2); font-size: 12.5px; }
.mas-reset, .mas-web { padding: 12px 2px; color: var(--t2); font-size: 13.5px; text-align: left; border: 0 !important; }
.cajon { position: fixed; top: var(--franja); right: 0; bottom: 0; width: min(440px, 100%); background: var(--b); z-index: 60; display: flex; flex-direction: column; box-shadow: -18px 0 50px rgb(0 0 0 / .12); transform: translateX(102%); transition: transform .34s var(--ease); }
.cajon.on { transform: none; }
.cajon > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--f2); }
.cajon > header b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.cajon > header small { color: var(--t2); font-size: 12px; }
.ia-conv { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ia-conv.completa { background: var(--b); border-radius: var(--r); height: calc(100vh - 160px); height: calc(100dvh - 160px); }
.ia-log { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.ia-tu { align-self: flex-end; background: var(--n); color: #fff; padding: 9px 14px; border-radius: 18px 18px 5px 18px; max-width: 80%; animation: entra .28s var(--ease); }
.ia-b { max-width: 680px; display: flex; flex-direction: column; gap: 8px; animation: entra .34s var(--ease); align-items: flex-start; width: 100%; }
.ia-b p { line-height: 1.5; font-size: 14.5px; }
.ia-b .tabla-m { width: 100%; }
.ia-f { color: var(--t3); font-size: 11.5px; }
.ia-acc { display: flex; flex-wrap: wrap; gap: 6px; }
.ia-pensando { display: flex; gap: 9px; align-items: center; color: var(--t2); font-size: 13.5px; }
.ia-pensando i { width: 9px; height: 9px; border-radius: 50%; background: var(--n); animation: pulso .8s infinite ease-in-out alternate; }
@keyframes pulso { to { transform: scale(.45); opacity: .4; } }
.ia-abajo { padding: 10px 16px 12px; border-top: 1px solid var(--f2); }
.ia-sug { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 9px; scrollbar-width: none; }
.ia-sug::-webkit-scrollbar { display: none; }
.ia-sug button { flex: none; background: var(--f); border-radius: 16px; padding: 6px 12px; font-size: 12.5px; transition: background .15s; }
.ia-sug button:hover { background: var(--f2); }
.ia-form { display: flex; gap: 6px; align-items: center; background: var(--f); border-radius: 24px; padding: 4px 4px 4px 16px; }
.ia-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 5px 0; }
.ia-aviso { display: block; color: var(--t3); font-size: 11px; margin-top: 7px; text-align: center; }
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: 6px; align-items: center; width: calc(100% - 32px); max-width: 480px; pointer-events: none; }
.toast { background: var(--n); color: #fff; padding: 10px 16px; border-radius: 22px; font-size: 13.5px; animation: subir .3s var(--ease); text-align: center; }
.toast.sale { opacity: 0; transition: opacity .28s; }
.abajo { display: none; }

@media (max-width: 1240px) {
  .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 1040px) {
  .rejilla.dos, .rejilla.d-dec, .pos, .esc { grid-template-columns: minmax(0, 1fr); }
  .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tarjeta.carro-t { position: static; }
}
@media (max-width: 760px) {
  :root { --franja: 26px; }
  .franja-demo { font-size: 10.5px; }
  .lado, .reloj, .btn-ia kbd { display: none; }
  .principal { margin: 0; }
  .cab { padding: 10px 16px; gap: 10px; }
  .cab h1 { font-size: 21px; }
  .migas { display: none; }
  .btn-ia { padding: 7px 12px; font-size: 12.5px; }
  .btn-ia .l { display: none; }
  .btn-ia .c { display: inline; }
  .vista { padding: 4px 16px calc(90px + env(safe-area-inset-bottom)); }
  .tarjeta { padding: 16px; margin-bottom: 12px; }
  .rejilla, .kpis { gap: 10px; margin-bottom: 12px; }
  .kpis.k3, .kpis.k4, .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.k3 > :first-child { grid-column: 1 / -1; }
  .kpi { padding: 12px 13px; }
  .kpi-v { font-size: 22px; }
  .hola h2 { font-size: 27px; }
  .hola-f { flex: 1 1 100%; }
  .barra .seg { width: 100%; }
  .barra-d { width: 100%; }
  .barra-d .inp { flex: 1; max-width: none; }
  .desc-f { flex-direction: column; align-items: stretch; gap: 10px; }
  .desc-f .btn { white-space: normal; }
  .decisiones li { flex-wrap: wrap; row-gap: 8px; }
  .dt { flex: 1 1 calc(100% - 34px); }
  .dv { flex: 1; margin-left: 34px; }
  .fd-x { display: none; }
  .areas { gap: 10px; }
  .tarjeta .tj-cab .seg { width: 100%; }
  .cal-m { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-p { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mapa { grid-template-columns: 24px repeat(var(--cols), minmax(0, 1fr)); gap: 1.5px; font-size: 9px; }
  .mapa i { height: 15px; border-radius: 2px; }
  .embudo li { grid-template-columns: 76px minmax(0, 1fr) 46px 36px; gap: 6px; }

  /* Tablas como tarjetas: cada celda lleva su etiqueta */
  .tabla-m { margin: 0; overflow: visible; }
  .tabla:not(.mini) thead { display: none; }
  .tabla:not(.mini), .tabla:not(.mini) tbody { display: block; width: 100%; }
  .tabla:not(.mini) tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 16px; padding: 11px 0; border-bottom: 1px solid var(--f2); }
  .tabla:not(.mini) tbody tr:last-child { border: 0; }
  .tabla:not(.mini) td { border: 0; padding: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: right; font-size: 13px; min-width: 0; white-space: normal; }
  .tabla:not(.mini) td::before { content: attr(data-l); color: var(--t2); font-size: 11.5px; flex: none; text-align: left; }
  .tabla:not(.mini) td:first-child { grid-column: 1 / -1; display: block; text-align: left; font-size: 14.5px; padding-bottom: 3px; }
  .tabla:not(.mini) td:first-child::before { content: none; }
  .tabla:not(.mini) td[data-l=""]::before { content: none; }
  .tabla.resultado tr { grid-template-columns: minmax(0, 1fr) auto; }
  .tabla.resultado td:nth-child(n + 3) { display: none; }
  .tabla.resultado td:first-child { grid-column: 1; padding: 0; font-size: 13.5px; }
  .tabla.resultado td:nth-child(2)::before { content: none; }
  .tabla.mini { font-size: 12px; }
  .tabla.mini th, .tabla.mini td { padding: 5px 4px; }
  .tabla-m:has(.mini) { overflow-x: auto; }
  .ia-conv.completa { height: calc(100dvh - 180px); border-radius: 14px; }
  .cajon { top: var(--franja); width: 100%; }
  .abajo { position: fixed; display: grid; grid-template-columns: repeat(5, 1fr); inset: auto 0 0 0; z-index: 30; background: rgb(255 255 255 / .92); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-top: 1px solid var(--l); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .abajo a, .abajo button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--t2); font-weight: 500; position: relative; padding: 2px 0; }
  .abajo svg { width: 22px; height: 22px; }
  .abajo .on { color: var(--n); }
  .abajo em { position: absolute; top: -2px; left: calc(50% + 6px); font-style: normal; background: var(--n); color: #fff; border-radius: 10px; font-size: 9.5px; line-height: 15px; padding: 0 4.5px; }
  .veu { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 88dvh; padding-bottom: env(safe-area-inset-bottom); }
  #toasts { bottom: 78px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
