/* ═══════════════════════════════════════════
   WMS — INVENTORY PAGE
   ═══════════════════════════════════════════ */

/* ─── STAT CARDS ─── */
.inv-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ─── ZONE MAP ─── */
.inv-zone-section {
  margin-bottom: 24px;
}
.inv-zone-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.inv-zone-head h3 {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-zone-head h3 i {
  color: var(--amber);
}

.inv-zone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.inv-zone-cell {
  position: relative;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  transition: all .25s var(--ease);
  overflow: hidden;
}
.inv-zone-cell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: background .25s;
}
.inv-zone-cell:hover {
  border-color: var(--border3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.inv-zone-cell.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Occupancy color classes */
.inv-zone-cell.occ-empty::before { background: var(--dim); }
.inv-zone-cell.occ-low::before   { background: var(--green); }
.inv-zone-cell.occ-mid::before   { background: var(--amber); }
.inv-zone-cell.occ-high::before  { background: #f97316; }
.inv-zone-cell.occ-full::before  { background: var(--red); }

.inv-zone-code {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--en);
  margin-bottom: 4px;
}
.inv-zone-name {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.inv-zone-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  margin-bottom: 8px;
}
.inv-zone-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .6s var(--ease);
}
.occ-empty .inv-zone-bar-fill { background: var(--dim); }
.occ-low   .inv-zone-bar-fill { background: var(--green); }
.occ-mid   .inv-zone-bar-fill { background: var(--amber); }
.occ-high  .inv-zone-bar-fill { background: #f97316; }
.occ-full  .inv-zone-bar-fill { background: var(--red); }

.inv-zone-meta {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--dim);
}
.inv-zone-pct {
  font-weight: 700;
  font-family: var(--en);
}

/* Legend */
.inv-zone-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
  font-size: .72rem;
  color: var(--muted);
}
.inv-zone-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.inv-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.inv-legend-dot.empty { background: var(--dim); }
.inv-legend-dot.low   { background: var(--green); }
.inv-legend-dot.mid   { background: var(--amber); }
.inv-legend-dot.high  { background: #f97316; }
.inv-legend-dot.full  { background: var(--red); }

/* ─── LOCATION GRID ─── */
.inv-loc-panel,
.inv-locinv-panel {
  margin-bottom: 24px;
}
.inv-loc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.inv-loc-head h3 {
  font-size: .9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.inv-loc-head h3 i {
  color: var(--accent2);
}

.inv-loc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.inv-loc-cell {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all .2s var(--ease);
  position: relative;
}
.inv-loc-cell:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.inv-loc-cell.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.inv-loc-code {
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--en);
  margin-bottom: 4px;
}
.inv-loc-type {
  font-size: .6rem;
  color: var(--dim);
  margin-bottom: 6px;
}
.inv-loc-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  margin-bottom: 4px;
}
.inv-loc-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s var(--ease);
}
.inv-loc-pct {
  font-size: .6rem;
  font-weight: 600;
  font-family: var(--en);
  color: var(--muted);
}

/* Location cell colors */
.inv-loc-cell.occ-empty .inv-loc-bar-fill { background: var(--dim); }
.inv-loc-cell.occ-low   .inv-loc-bar-fill { background: var(--green); }
.inv-loc-cell.occ-mid   .inv-loc-bar-fill { background: var(--amber); }
.inv-loc-cell.occ-high  .inv-loc-bar-fill { background: #f97316; }
.inv-loc-cell.occ-full  .inv-loc-bar-fill { background: var(--red); }

/* ─── AUTOCOMPLETE ─── */
.inv-autocomplete {
  position: absolute;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  width: 100%;
  margin-top: 2px;
}
.inv-autocomplete.open {
  display: block;
}
.inv-autocomplete-item {
  padding: 10px 14px;
  font-size: .8rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.inv-autocomplete-item:hover {
  background: var(--accent-soft);
}
.inv-autocomplete-item:last-child {
  border-bottom: none;
}
.inv-autocomplete-code {
  font-weight: 700;
  font-family: var(--en);
  color: var(--accent);
  margin-right: 8px;
}

/* ─── FORM GROUP RELATIVE ─── */
.e-form-group {
  position: relative;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .inv-stats { grid-template-columns: repeat(2, 1fr); }
  .inv-zone-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .inv-stats { grid-template-columns: repeat(2,1fr); gap:10px; }
  .inv-zone-grid { grid-template-columns: 1fr; }
  .inv-loc-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap:6px; }
}
@media (max-width: 420px){
  .inv-stats { grid-template-columns: 1fr; }
}
