/* Demo textil · estilos propios de los módulos del grupo «soporte» (clases con el prefijo de su módulo).
   sp- = piezas del grupo (historia, tarjetas, pares); tj- tejido · tn- tintorería · co- corte · al- almacén ·
   mt- mantenimiento · fi- fichas técnicas. Todo con minmax(0,1fr) y min-width:0: nada desborda a 360 px. */

/* ── historia de la pantalla: qué pasa, por qué, qué hago ── */
.sp-hist { display: flex; gap: 14px; align-items: flex-start; }
.sp-hist h3 { font-size: 17.5px; letter-spacing: -.015em; line-height: 1.3; margin-top: 2px; }
.sp-eti { font-weight: 650; letter-spacing: .01em; }
.sp-linea { font-size: 14px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; }
.sp-linea b { color: var(--ink); font-weight: 650; }
.sp-acc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 720px) { .sp-hist > .ico { display: none; } .sp-hist h3 { font-size: 16.5px; } }

/* ── piezas comunes ── */
.sp-color { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-2); vertical-align: -2px; flex: 0 0 auto; }
.sp-color.lg { width: 40px; height: 40px; border-radius: 12px; }
.sp-col { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sp-ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sp-mas { width: 100%; margin-top: 10px; }
.sp-fuente { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.sp-fuente a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.sp-nota { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.sp-par { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; min-width: 0; }
.sp-par:first-child { border-top: 0; }
.sp-par > span { color: var(--ink-2); min-width: 0; }
.sp-par > b { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.sp-par.total { border-top: 1px solid var(--line-2); font-size: 15px; }
.sp-par.total > span { color: var(--ink); font-weight: 650; }
.sp-lock { display: flex; gap: 10px; align-items: flex-start; padding: 12px 13px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.sp-lock .i { color: var(--acc); margin-top: 1px; }
.sp-big { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chips .chip { cursor: pointer; }
.sp-sec-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.sp-sec-t h3 { font-size: 15.5px; letter-spacing: -.01em; }
.sp-cero { color: var(--muted); }
.sp-ok { color: var(--ok); } .sp-warn { color: var(--warn); } .sp-bad { color: var(--bad); }

/* tarjetas clicables en rejilla que se acomoda sola (una columna en el teléfono) */
.sp-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.sp-t { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface); min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; width: 100%; transition: border-color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease); }
.sp-t:hover { border-color: var(--line-2); background: var(--surface-2); }
.sp-t:active { transform: scale(.99); }
.sp-t-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-width: 0; }
.sp-t-cab .nom { display: block; font-size: 14.5px; font-weight: 700; }
.sp-mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sp-mini > div { min-width: 0; }
.sp-mini small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.sp-mini b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── tintorería: jets ── */
.tn-jet .sp-color { width: 12px; height: 12px; }
.tn-lib { font-size: 13px; color: var(--muted); }

/* ── corte: plan contra real ── */
.co-comp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; font-size: 13px; }
.co-comp > span { color: var(--ink-2); }
.co-comp > b { font-variant-numeric: tabular-nums; text-align: right; }
.co-comp .barra { grid-column: 1 / -1; margin-bottom: 6px; }
.co-filtro { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ── almacén ── */
.al-lote { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.al-lote:first-child { border-top: 0; }
.al-lote .d { font-size: 12.5px; color: var(--muted); }
.al-lote .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.al-fifo { font-size: 11px; font-weight: 700; color: var(--acc); background: var(--acc-soft); border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }
.al-marca { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ── mantenimiento: mosaico de máquinas ── */
.mt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 8px; }
.mt-tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; background: var(--surface); text-align: left; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mt-tile:hover { background: var(--surface-2); border-color: var(--line-2); }
.mt-tile b { font-size: 13px; line-height: 1.25; display: block; }
.mt-tile .tiny { line-height: 1.3; }
.mt-tile.paro { border-color: var(--bad); background: var(--bad-soft); }
.mt-tile.venc { border-color: var(--warn-dot); }
.mt-ot { border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--surface); }
.mt-ot.paro { border-color: var(--bad); }
.mt-ot .acc { display: flex; gap: 8px; flex-wrap: wrap; }
.mt-cal { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.mt-cal:first-child { border-top: 0; }
.mt-dia { width: 46px; flex: 0 0 auto; text-align: center; border-radius: 10px; background: var(--surface-2); padding: 4px 0; line-height: 1.15; }
.mt-dia b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.mt-dia small { display: block; font-size: 11px; color: var(--muted); font-weight: 650; }
.mt-dia.venc { background: var(--warn-soft); color: var(--warn); }
.mt-dia.venc small { color: var(--warn); }

/* ── fichas técnicas ── */
.fi-cab { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.fi-ver { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.fi-ver .i { width: 14px; height: 14px; }
.fi-maq { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.fi-maq .barra { grid-column: 1 / -1; }

/* app.css usa .top para la barra superior y UI.kpi también usa .top: aquí se anula dentro de las vistas del grupo */
.sp-vista .kpi .top { position: static; min-height: 0; padding: 0; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; z-index: auto; }
@media (max-width: 720px) { .sp-t { padding: 12px 13px; gap: 8px; } .sp-tarjetas { gap: 10px; } }
/* filas clicables dentro de .lista (lotes, cortes, rollos) */
.lista > .sp-itb { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; padding: 11px 4px; border-radius: 0; align-items: flex-start; }
.lista > .sp-itb:first-child { border-top: 0; }
.lista > .sp-itb:hover { background: var(--surface-2); }
.sp-color.md { width: 30px; height: 30px; border-radius: 9px; margin-top: 2px; }
.sp-der { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; text-align: right; }
.sp-der b { font-size: 15px; }
.sp-t.fijo { cursor: default; } .sp-t.fijo:hover { background: var(--surface); border-color: var(--line); } .sp-t.fijo:active { transform: none; }
