/* Készlet, Cikktörzs, Mozgások: low stock highlighting, occupancy, product page.
   Same tokens as app.css; nothing here changes shared components. */

/* Low and out of stock rows: a coloured bar at the row start, the status chip says the rest. */
.table tr.stk-row--low td:first-child { box-shadow: inset 5px 0 0 var(--warn); }
.table tr.stk-row--out td:first-child { box-shadow: inset 5px 0 0 var(--danger); }
.table tr.stk-row--out td { background: color-mix(in oklab, var(--danger-bg) 45%, var(--panel)); }

.stk-code { white-space: nowrap; }
.table .stk-name { min-width: 13rem; }
.table.stk-wide { min-width: 64rem; }
.table.stk-mid { min-width: 46rem; }
.table.stk-xwide { min-width: 84rem; }
.table .stk-notecol { min-width: 16rem; }

.stk-occ { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.stk-occ > .table-wrap { border: 0; border-top: 1px solid var(--line); }
.stk-occ > .table-wrap + .table-wrap { border-left: 1px solid var(--line); }
@media (max-width: 899.98px) { .stk-occ > .table-wrap + .table-wrap { border-left: 0; } }
.stk-usage { display: flex; align-items: center; gap: 0.5rem; min-width: 8rem; }
.stk-usage .progress { flex: 1; }

.stk-product { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 2fr) minmax(min(100%, 20rem), 1fr); align-items: start; }
@media (max-width: 1099.98px) { .stk-product { grid-template-columns: minmax(0, 1fr); } }

.stk-warn { display: inline-flex; gap: 0.375rem; align-items: flex-start; color: var(--warn); font-size: 0.8125rem; font-weight: 600; }
.stk-warn[hidden], .stk-warn:empty { display: none; }
dd .stk-warn { display: flex; margin-top: 0.25rem; }
.stk-tags { display: inline-flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.stk-row-actions { display: inline-flex; gap: 0.25rem; justify-content: flex-end; }
.stk-exp--past { color: var(--danger); font-weight: 700; }
.stk-exp--soon { color: var(--warn); font-weight: 700; }
.stk-note { display: inline-block; max-width: 22rem; font-size: 0.8125rem; color: var(--ink-2); overflow-wrap: anywhere; }
.stk-sums { margin-bottom: -0.5rem; }
.stk-filter-chip { text-decoration: none; text-transform: none; letter-spacing: 0; font-size: 0.75rem; }
.stk-filter-chip:hover { text-decoration: underline; }
.stk-filter-chip .icon { width: 0.875rem; height: 0.875rem; }

.stk-newrow { display: grid; gap: 0.875rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); padding: 0.875rem; border: 1px dashed var(--line-strong); }
.stk-newrow[hidden] { display: none; }

/* ---------- warehouse map (#/keszlet/terkep) ----------
   Cells by state: occupied (filled, client code), empty (outline), dedicated but empty (dashed),
   inactive (hatched), quarantine (red inner ring), the highlighted client (hi-vis). Filters dim. */
.map-legend { display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; align-items: center; font-size: 0.8125rem; color: var(--ink-2); }
.map-legend > span { display: inline-flex; align-items: center; gap: 0.375rem; }
.map-swatch { display: inline-block; width: 1.125rem; height: 1.125rem; }
.map-focus:empty { display: none; }
.map-focus { font-weight: 700; }
.map-zones { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.map-zone { display: grid; gap: 0.5rem; flex: 0 1 auto; min-width: min(100%, 16rem); max-width: 100%; }
.map-zone[hidden] { display: none; }
.map-zone__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.map-zone__head h2 { font-size: 1.0625rem; }
.map-zone__racks {
  display: flex; align-items: flex-end; gap: 0.875rem; min-width: 0; overflow-x: auto; padding: 0.875rem;
  background: var(--panel); border: 1px solid var(--line); scrollbar-width: thin;
}
.map-zone__racks--flat { flex-wrap: wrap; align-items: flex-start; gap: 0.375rem; }
.map-rack { display: grid; gap: 3px; flex: none; }
.map-level { display: flex; gap: 3px; }
.map-rack__label { padding-top: 0.25rem; font: 600 0.75rem/1 var(--font-mono); text-align: center; color: var(--ink-2); border-top: 3px solid var(--ink); }
.map-cell, .map-swatch {
  color: var(--ink-3); background: var(--panel); border: 1px solid var(--line-strong);
}
.map-cell {
  position: relative; display: grid; align-content: space-between; width: 3.25rem; height: 2.5rem; padding: 0.125rem 0.25rem;
  font: 500 0.625rem/1.15 var(--font-mono); text-align: left; cursor: pointer; overflow: hidden;
  transition: opacity 0.15s var(--ease);
}
.map-cell--wide { width: auto; min-width: 5.5rem; }
.map-cell__who { font-weight: 700; font-size: 0.6875rem; white-space: nowrap; overflow: hidden; }
.map-cell[data-state="occupied"], .map-swatch[data-state="occupied"] { color: var(--panel); background: var(--ink-2); border-color: var(--ink-2); }
.map-cell[data-state="dedicated"], .map-swatch[data-state="dedicated"] { border: 2px dashed var(--ink-2); }
.map-cell[data-state="inactive"], .map-swatch[data-state="inactive"] {
  background: repeating-linear-gradient(45deg, var(--panel-alt) 0 3px, var(--panel) 3px 7px); border-style: dotted;
}
.map-cell[data-kind="quarantine"], .map-swatch[data-kind="quarantine"] { box-shadow: inset 0 0 0 2px var(--danger); }
.map-cell[data-hl="true"], .map-swatch[data-hl="true"] { color: var(--on-hi-vis); background: var(--hi-vis); border-color: var(--ink-fixed); }
.map-cell[data-hl="true"][data-state="dedicated"] { background: color-mix(in oklab, var(--hi-vis) 35%, var(--panel)); color: var(--ink); }
.map-cell[data-dim="true"] { opacity: 0.22; }
.map-cell:hover, .map-cell:focus-visible { z-index: 1; outline: 3px solid var(--hi-vis); outline-offset: 1px; opacity: 1; }
.map-tip {
  position: fixed; z-index: 70; max-width: min(20rem, calc(100vw - 1rem)); padding: 0.375rem 0.5rem;
  font-size: 0.75rem; line-height: 1.35; color: var(--paper-fixed); background: var(--ink-fixed); pointer-events: none;
}
.map-tip[hidden] { display: none; }
@media (max-width: 640px) {
  .map-cell { width: 3rem; height: 3rem; }
  .map-zones { gap: 1rem; }
  .map-zone { flex-basis: 100%; }
  .map-zone__racks { margin: 0 calc(var(--pad) * -1); padding: 0.75rem var(--pad); border-left: 0; border-right: 0; }
}

@media print {
  .stk-row-actions { display: none !important; }
}
