/* ═══════ Warehouse page ═══════ */
.wh-page { max-width: 1200px; margin: 0 auto; padding: 20px; }
.wh-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.wh-title { font-size: 22px; font-weight: 800; color: #1E293B; margin: 0; }
.wh-actions { display: flex; gap: 8px; }
.wh-btn-incoming { background: #2563EB; color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer; font-size: 13px; }
.wh-btn-incoming:hover { background: #1D4ED8; }
.wh-btn-consume { background: #F59E0B; color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 600; cursor: pointer; font-size: 13px; }
.wh-btn-consume:hover { background: #D97706; }
.wh-btn-adjust { background: #8B5CF6; color: #fff; border: none; border-radius: 8px; padding: 6px 14px; font-weight: 600; cursor: pointer; font-size: 12px; }
.wh-btn-adjust:hover { background: #7C3AED; }

.wh-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.wh-search { flex: 1; max-width: 360px; padding: 8px 14px; border: 1px solid #E2E8F0; border-radius: 8px; font-size: 13px; outline: none; }
.wh-search:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.wh-toggle-lbl { font-size: 12px; color: #64748B; display: flex; align-items: center; gap: 6px; cursor: pointer; }

.wh-table-wrap { background: #fff; border-radius: 12px; border: 1px solid #E2E8F0; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.wh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wh-table thead { background: #F8FAFC; }
.wh-table th { padding: 10px 14px; text-align: left; font-weight: 600; color: #64748B; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #E2E8F0; white-space: nowrap; }
.wh-table th.num, .wh-table td.num { text-align: right; }
.wh-table td { padding: 10px 14px; border-bottom: 1px solid #F1F5F9; color: #334155; }
.wh-table tbody tr { cursor: pointer; transition: background .15s; }
.wh-table tbody tr:hover { background: #F8FAFC; }
.wh-table tfoot td { padding: 12px 14px; border-top: 2px solid #E2E8F0; background: #F8FAFC; }
.wh-loading { text-align: center; padding: 32px; color: #94A3B8; }

.wh-row-low { background: #FEF2F2 !important; }
.wh-row-low:hover { background: #FEE2E2 !important; }
.wh-badge-low { display: inline-block; background: #FEE2E2; color: #DC2626; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }

/* History panel */
.wh-history-panel { margin-top: 20px; background: #fff; border-radius: 12px; border: 1px solid #E2E8F0; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.wh-hist-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #E2E8F0; }
.wh-hist-title { font-size: 16px; font-weight: 700; color: #1E293B; margin: 0; }
.wh-hist-close { background: none; border: none; font-size: 22px; color: #94A3B8; cursor: pointer; padding: 0 4px; line-height: 1; }
.wh-hist-close:hover { color: #1E293B; }
.wh-hist-actions { padding: 12px 20px; display: flex; gap: 8px; }
.wh-table-hist { font-size: 12px; }
.wh-badge-in { display: inline-block; background: #DCFCE7; color: #16A34A; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.wh-badge-out { display: inline-block; background: #FEF3C7; color: #D97706; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }

/* Popup overlay */
.wh-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.wh-popup { background: #fff; border-radius: 14px; width: 440px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.wh-popup-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #E2E8F0; }
.wh-popup-title { font-size: 16px; font-weight: 700; margin: 0; }
.wh-popup-close { background: none; border: none; font-size: 22px; color: #94A3B8; cursor: pointer; padding: 0 4px; }
.wh-popup-close:hover { color: #1E293B; }
.wh-popup-body { padding: 20px 24px; }
.wh-popup-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid #E2E8F0; }
.wh-field { margin-bottom: 14px; }
.wh-field label { display: block; font-size: 12px; font-weight: 600; color: #64748B; margin-bottom: 4px; }
.wh-field input, .wh-field select, .wh-field textarea { width: 100%; padding: 8px 12px; border: 1px solid #E2E8F0; border-radius: 8px; font-size: 13px; outline: none; box-sizing: border-box; }
.wh-field input:focus, .wh-field select:focus { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.wh-field textarea { resize: vertical; min-height: 60px; }
.wh-field-row { display: flex; gap: 12px; }
.wh-field-row .wh-field { flex: 1; }
.wh-calc { font-size: 12px; color: #2563EB; font-weight: 600; margin-top: 4px; }

@media (max-width: 768px) {
  .wh-page { padding: 12px; }
  .wh-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .wh-toolbar { flex-direction: column; align-items: stretch; }
  .wh-search { max-width: none; }
  .wh-popup { width: 96vw; }
}
