/* Portal · Insumos como la hoja 2026_costeo (13-nov). Solo colores con variables de tokens.css. */
/* v3.2 (17-nov): la hoja con la cara de las tablas de la prueba: tarjeta redonda, encabezado gris claro en MAYÚSCULAS, sin rayas
   verticales. Desde el 18-nov cada grupo lleva su color (abajo). Solo variables. */
.ins { --ins-row-hover: color-mix(in srgb, var(--pt-hover) 55%, var(--pt-raised)); min-width: 0; display: flex; flex: 1; flex-direction: column; gap: var(--sp-3); min-height: 0; }
.ins-top { display: flex; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.ins-tools { display: flex; flex: 1; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ins-tools .isearch { width: 240px; margin-right: auto; }
.ins-tools > [hidden] { display: none; }

.ins-sheet { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.ins .sheet { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--pt-line); border-radius: var(--r-md); background: var(--pt-raised); }
.ins .sheet table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font: 500 var(--fs-md)/1.3 var(--pt-font); color: var(--text); }
.ins .sheet th, .ins .sheet td { padding: 0 14px; border: 0; text-align: left; white-space: nowrap; }
.ins .sheet td { height: 48px; border-top: 1px solid var(--pt-line); font-variant-numeric: tabular-nums; }
.ins .sheet th { background: var(--pt-side); color: var(--muted); font: 600 var(--fs-xs)/1.2 var(--pt-font); letter-spacing: .3px; text-transform: uppercase; }
.ins .sheet thead th { position: sticky; z-index: 2; }
/* The groups row: small gray words over their columns, no band; the column row is the gray header */
.ins .sheet thead tr:first-child th { top: 0; height: 38px; vertical-align: middle; background: var(--pt-side); color: var(--muted); } /* misma altura y letra que el renglón de abajo (Marquito, 19-nov) */
.ins .sheet thead tr:nth-child(2) th { top: 38px; height: 38px; vertical-align: middle; border-top: 1px solid var(--pt-line); }
.ins .sheet .n { text-align: right; }
.ins .sheet .fix { position: sticky; left: 0; z-index: 1; background: var(--pt-raised); font-weight: 700; min-width: 190px; }
.ins .sheet thead .fix { z-index: 3; }
.ins .sheet thead tr:nth-child(2) .fix { background: var(--pt-side); }
.ins .sheet tbody tr:not(.secrow):hover td { background: var(--ins-row-hover); }
.ins .sheet td.ed { cursor: pointer; }
/* Celdas que se editan (kit.js, 17-nov): hover suave y foco azul, por encima del color de su grupo */
.ins .sheet tbody tr td.pt-cell:hover { background: var(--pt-hover); }
.ins .sheet td.pt-cell:focus-visible, .ins .sheet td.pt-cell.is-open { box-shadow: inset 0 0 0 2px var(--pt-blue); }
.ins .sheet td.miss { color: var(--faint); font-style: italic; }

.ins .sheet td.calc { color: var(--faint); font-style: italic; }
/* TIPO DE CONTEO with a number for what sales do not deduct (13-nov): a warning in red, the save goes */
.ins .sheet td.warn { color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
.ins .sheet td.fix .bulk__err { font-weight: 500; font-size: var(--fs-xs); }
.ins .ins-fix { margin-left: 6px; padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--text); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
/* Section row like the prueba: arrow to fold, the name in bold and its count in a gray pill (pt-grp__* in portal-config.css) */
.ins .sheet tr.secrow td { height: 42px; background: var(--pt-hover); cursor: pointer; user-select: none; -webkit-user-select: none; }
.ins .sheet tr.secrow .ins-sec { position: sticky; left: 14px; display: inline-flex; align-items: center; gap: 10px; }
.ins .sheet tr.secrow .pt-grp__name { color: var(--text); font-weight: 700; }
.ins .sheet tr.secrow.is-shut .pt-grp__chev::after { top: 5px; transform: rotate(225deg); }
.ins .sheet tr[hidden] { display: none; }
.ins .sheet .ins-none { color: var(--muted); }

/* Categorías (v3.2, 17-nov): tabla con encabezado en MAYÚSCULAS y el botón de guardar arriba a la derecha */
.cat-order__bar { display: flex; justify-content: flex-end; }
.cat-order__head { min-height: 36px; color: var(--muted); font: 600 var(--fs-xs)/1.2 var(--font-body); letter-spacing: .3px; }
.cat-order__count { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }

/* Proveedores (v3.2): encabezados de la tabla en MAYÚSCULAS */
.pt .pt-prov .t__row--head { text-transform: uppercase; }

/* Pegar varios: the Carga masiva table inside a wide dialog, scrolling on its own */
.ins-bulk-dlg { width: min(96vw, 1400px); }
.ins-bulk { max-height: 70vh; overflow: auto; }

@media (max-width: 760px) {
  .ins-tools { margin-left: 0; width: 100%; }
  .ins-tools .isearch { flex: 1 1 100%; width: 100%; }
  .ins .sheet { max-height: calc(100vh - 160px); }
  .ins .sheet .fix { min-width: 130px; }
}

/* Bloques con color (Marquito, 18-nov; 19-nov: también el renglón de nombres de columna): los dos renglones de títulos llevan el
   color de su grupo (INSUMO azul, COMPRA verde, INVENTARIO morado); las celdas quedan como el resto de las tablas. Solo variables. */
.ins .sheet .gi-h { --b: var(--pt-blue); }
.ins .sheet .gc-h { --b: var(--pt-green); }
.ins .sheet .gv-h { --b: var(--pt-purple); }
.ins .sheet thead tr:first-child th:is(.gi-h, .gc-h, .gv-h):not(.fix) { background: color-mix(in srgb, var(--b) 20%, var(--pt-raised)); color: var(--b); font-weight: 700; }
.ins .sheet thead tr:nth-child(2) th:is(.gi-h, .gc-h, .gv-h):not(.fix) { background: color-mix(in srgb, var(--b) 14%, var(--pt-raised)); box-shadow: inset 0 -2px 0 var(--b); }
.ins .sheet td.ins-initial { color: var(--faint); } /* la tolerancia inicial de Finance (25-nov) */
