/* ═══════════════════════════════════════════════════════════════════════════════
   Stock Manager — Precision Inventory Control
   Industrial-utilitarian design: data-dense, purposeful, zero waste
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
.stm {
  --stm-primary: #696cff;
  --stm-primary-rgb: 105, 108, 255;
  --stm-success: #71dd37;
  --stm-warning: #ffab00;
  --stm-danger: #ff3e1d;
  --stm-info: #03c3ec;
  --stm-purple: #8c57ff;
  --stm-surface: var(--bs-card-bg, #fff);
  --stm-border: var(--bs-border-color, #e7e7e8);
  --stm-text: var(--bs-body-color, #697a8d);
  --stm-heading: var(--bs-heading-color, #566a7f);
  --stm-radius: 0.5rem;
  --stm-shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
  --stm-shadow-md: 0 4px 16px rgba(0,0,0,0.07);
  --stm-shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  font-variant-numeric: tabular-nums;
}

/* ── Page Header ── */
.stm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stm-header h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.stm-header h4 .ti {
  font-size: 1.75rem;
  color: var(--stm-primary);
  opacity: 0.85;
}

/* ── Tabs ── */
.stm-tabs {
  border-bottom: 2px solid var(--stm-border);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stm-tabs::-webkit-scrollbar { display: none; }

.stm-tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--stm-text);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.stm-tab-btn:hover {
  color: var(--stm-primary);
}

.stm-tab-btn.active {
  color: var(--stm-primary);
  border-bottom-color: var(--stm-primary);
}

.stm-tab-btn .stm-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 50rem;
  font-size: 0.6875rem;
  font-weight: 700;
  margin-inline-start: 0.375rem;
  background: rgba(var(--stm-primary-rgb), 0.12);
  color: var(--stm-primary);
}

/* ── Tab Panels ── */
.stm-panel {
  display: none;
  animation: stmFadeIn 0.25s ease;
}

.stm-panel.active {
  display: block;
}

@keyframes stmFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Cards Grid ── */
.stm-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ── Location Card ── */
.stm-loc-card {
  background: var(--stm-surface);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  padding: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.stm-loc-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 3px;
  height: 100%;
  background: var(--stm-primary);
  opacity: 0;
  transition: opacity 0.2s;
}

.stm-loc-card:hover {
  box-shadow: var(--stm-shadow-md);
  border-color: rgba(var(--stm-primary-rgb), 0.3);
}

.stm-loc-card:hover::before {
  opacity: 1;
}

.stm-loc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stm-loc-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--stm-heading);
  margin: 0;
}

.stm-loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 50rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stm-loc-badge.branch {
  background: rgba(3, 195, 236, 0.12);
  color: #03c3ec;
}

.stm-loc-badge.warehouse {
  background: rgba(140, 87, 255, 0.12);
  color: #8c57ff;
}

.stm-loc-stats {
  display: flex;
  gap: 1.5rem;
}

.stm-loc-stat {
  display: flex;
  flex-direction: column;
}

.stm-loc-stat-value {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--stm-heading);
  line-height: 1;
}

.stm-loc-stat-label {
  font-size: 0.75rem;
  color: var(--stm-text);
  margin-top: 0.25rem;
}

.stm-loc-stat-alert .stm-loc-stat-value {
  color: var(--stm-danger);
}

/* ── Add Warehouse Card ── */
.stm-add-card {
  background: transparent;
  border: 2px dashed var(--stm-border);
  border-radius: var(--stm-radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--stm-text);
  gap: 0.5rem;
}

.stm-add-card:hover {
  border-color: var(--stm-primary);
  color: var(--stm-primary);
  background: rgba(var(--stm-primary-rgb), 0.04);
}

.stm-add-card .ti {
  font-size: 2rem;
  opacity: 0.6;
}

/* ── Table Wrappers ── */
.stm-table-wrap {
  background: var(--stm-surface);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  overflow: hidden;
}

.stm-table-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--stm-border);
  flex-wrap: wrap;
}

.stm-search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.875rem;
  padding-inline-start: 2.25rem;
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  font-size: 0.875rem;
  background: var(--stm-surface);
  color: var(--stm-heading);
  transition: border-color 0.15s;
}

.stm-search-input:focus {
  outline: none;
  border-color: var(--stm-primary);
  box-shadow: 0 0 0 2px rgba(var(--stm-primary-rgb), 0.15);
}

.stm-search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.stm-search-wrap .ti {
  position: absolute;
  inset-inline-start: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--stm-text);
  pointer-events: none;
}

.stm-filter-select {
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  font-size: 0.8125rem;
  background: var(--stm-surface);
  color: var(--stm-heading);
  min-width: 130px;
}

/* ── Data Tables ── */
.stm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.stm-table thead th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--stm-text);
  background: rgba(var(--stm-primary-rgb), 0.03);
  border-bottom: 1px solid var(--stm-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.stm-table tbody td {
  padding: 0.6875rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--stm-heading);
  vertical-align: middle;
}

.stm-table tbody tr:hover td {
  background: rgba(var(--stm-primary-rgb), 0.03);
}

.stm-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Stock Matrix ── */
.stm-matrix-scroll {
  overflow-x: auto;
  max-height: 65vh;
  -webkit-overflow-scrolling: touch;
}

.stm-matrix-scroll::-webkit-scrollbar {
  height: 6px;
}

.stm-matrix-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

.stm-matrix .stm-table thead th:nth-child(-n+3),
.stm-matrix .stm-table tbody td:nth-child(-n+3) {
  position: sticky;
  z-index: 3;
  background: var(--stm-surface);
}

.stm-matrix .stm-table thead th:nth-child(1),
.stm-matrix .stm-table tbody td:nth-child(1) {
  inset-inline-start: 0;
  min-width: 180px;
}

.stm-matrix .stm-table thead th:nth-child(2),
.stm-matrix .stm-table tbody td:nth-child(2) {
  inset-inline-start: 180px;
  min-width: 100px;
}

.stm-matrix .stm-table thead th:nth-child(3),
.stm-matrix .stm-table tbody td:nth-child(3) {
  inset-inline-start: 280px;
  min-width: 80px;
  border-inline-end: 2px solid var(--stm-border);
}

.stm-matrix .stm-table thead th:nth-child(-n+3) {
  z-index: 5;
}

.stm-matrix .stm-table thead th {
  text-align: center;
}

.stm-matrix .stm-table tbody td {
  text-align: center;
  min-width: 110px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stm-matrix .stm-table tbody td:first-child {
  text-align: start;
  font-weight: 600;
}

.stm-matrix .stm-table tbody td:nth-child(2) {
  text-align: start;
  font-family: monospace;
  font-size: 0.8125rem;
  color: var(--stm-text);
}

/* Stock level cells */
.stm-qty-ok { color: var(--stm-success); }
.stm-qty-low { color: var(--stm-danger); background: rgba(255,62,29,0.06) !important; }
.stm-qty-warn { color: #e08a00; background: rgba(255,171,0,0.06) !important; }
.stm-qty-zero { color: var(--stm-text); opacity: 0.4; }

/* ── Status Badges ── */
.stm-status {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  border-radius: 50rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.stm-status-draft { background: #e9ecef; color: #495057; }
.stm-status-pending_approval { background: #fff3cd; color: #856404; }
.stm-status-approved { background: #cfe2ff; color: #084298; }
.stm-status-shipped { background: #e2d5f1; color: #6f42c1; }
.stm-status-received { background: #d1e7dd; color: #0f5132; }
.stm-status-partial { background: #ffe5d0; color: #984c0c; }
.stm-status-rejected { background: #f8d7da; color: #842029; }
.stm-status-cancelled { background: #f5f5f5; color: #6c757d; }

/* ── Action Buttons ── */
.stm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--stm-radius);
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.stm-btn-primary {
  background: var(--stm-primary);
  color: #fff;
}

.stm-btn-primary:hover {
  background: #5b5eff;
  box-shadow: 0 4px 12px rgba(var(--stm-primary-rgb), 0.35);
}

.stm-btn-outline {
  background: transparent;
  border: 1px solid var(--stm-border);
  color: var(--stm-heading);
}

.stm-btn-outline:hover {
  border-color: var(--stm-primary);
  color: var(--stm-primary);
  background: rgba(var(--stm-primary-rgb), 0.04);
}

.stm-btn-sm {
  padding: 0.3125rem 0.625rem;
  font-size: 0.75rem;
}

.stm-btn-icon {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--stm-text);
  cursor: pointer;
  transition: all 0.15s;
}

.stm-btn-icon:hover {
  background: rgba(var(--stm-primary-rgb), 0.08);
  color: var(--stm-primary);
}

/* ── Pagination ── */
.stm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--stm-border);
  font-size: 0.8125rem;
  color: var(--stm-text);
}

.stm-pagination-btns {
  display: flex;
  gap: 0.25rem;
}

.stm-page-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  background: var(--stm-surface);
  color: var(--stm-heading);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s;
}

.stm-page-btn:hover {
  border-color: var(--stm-primary);
  color: var(--stm-primary);
}

.stm-page-btn.active {
  background: var(--stm-primary);
  border-color: var(--stm-primary);
  color: #fff;
}

/* ── Report Summary Cards ── */
.stm-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stm-summary-card {
  background: var(--stm-surface);
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  padding: 1rem 1.25rem;
  text-align: center;
}

.stm-summary-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--stm-heading);
  line-height: 1;
}

.stm-summary-card-label {
  font-size: 0.75rem;
  color: var(--stm-text);
  margin-top: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Sub-tabs (for Reports) ── */
.stm-subtabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: rgba(var(--stm-primary-rgb), 0.04);
  padding: 0.25rem;
  border-radius: var(--stm-radius);
  width: fit-content;
}

.stm-subtab-btn {
  padding: 0.4375rem 0.875rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--stm-radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--stm-text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.stm-subtab-btn:hover { color: var(--stm-primary); }

.stm-subtab-btn.active {
  background: var(--stm-surface);
  color: var(--stm-primary);
  box-shadow: var(--stm-shadow-sm);
}

.stm-sub-panel {
  display: none;
  animation: stmFadeIn 0.2s ease;
}

.stm-sub-panel.active {
  display: block;
}

/* ── Modal / Dialog ── */
.stm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: stmOverlayIn 0.2s ease;
}

@keyframes stmOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.stm-modal {
  background: var(--stm-surface);
  border-radius: 0.75rem;
  box-shadow: var(--stm-shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: stmModalIn 0.25s ease;
}

.stm-modal-lg { max-width: 780px; }
.stm-modal-xl { max-width: 1000px; }

@keyframes stmModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.stm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--stm-border);
}

.stm-modal-header h5 {
  font-weight: 700;
  font-size: 1.0625rem;
  margin: 0;
  color: var(--stm-heading);
}

.stm-modal-body {
  padding: 1.5rem;
}

.stm-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--stm-border);
}

/* ── Form Fields ── */
.stm-field {
  margin-bottom: 1.25rem;
}

.stm-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--stm-heading);
  margin-bottom: 0.375rem;
}

.stm-field input,
.stm-field select,
.stm-field textarea {
  width: 100%;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  font-size: 0.875rem;
  background: var(--stm-surface);
  color: var(--stm-heading);
  transition: border-color 0.15s;
}

.stm-field input:focus,
.stm-field select:focus,
.stm-field textarea:focus {
  outline: none;
  border-color: var(--stm-primary);
  box-shadow: 0 0 0 2px rgba(var(--stm-primary-rgb), 0.15);
}

.stm-field textarea { resize: vertical; min-height: 80px; }

.stm-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Transfer Wizard Steps ── */
.stm-wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.stm-wizard-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--stm-text);
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0.5;
  transition: all 0.2s;
}

.stm-wizard-step.active {
  opacity: 1;
  color: var(--stm-primary);
}

.stm-wizard-step.done {
  opacity: 1;
  color: var(--stm-success);
}

.stm-wizard-step-num {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
}

.stm-wizard-step.active .stm-wizard-step-num {
  background: var(--stm-primary);
  border-color: var(--stm-primary);
  color: #fff;
}

.stm-wizard-step.done .stm-wizard-step-num {
  background: var(--stm-success);
  border-color: var(--stm-success);
  color: #fff;
}

.stm-wizard-line {
  width: 2rem;
  height: 2px;
  background: var(--stm-border);
  margin: 0 0.25rem;
}

/* ── Transfer Items Table ── */
.stm-items-table {
  width: 100%;
  border-collapse: collapse;
}

.stm-items-table th {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--stm-text);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--stm-border);
}

.stm-items-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.875rem;
}

.stm-items-table input[type="number"] {
  width: 80px;
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--stm-border);
  border-radius: 4px;
  text-align: center;
  font-size: 0.875rem;
}

/* ── Timeline ── */
.stm-timeline {
  padding: 0;
  margin: 0;
  list-style: none;
}

.stm-timeline-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  position: relative;
}

.stm-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  inset-inline-start: 0.6875rem;
  top: 1.75rem;
  bottom: 0;
  width: 2px;
  background: var(--stm-border);
}

.stm-timeline-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  color: #fff;
}

.stm-timeline-body {
  flex: 1;
}

.stm-timeline-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--stm-heading);
}

.stm-timeline-meta {
  font-size: 0.75rem;
  color: var(--stm-text);
  margin-top: 0.125rem;
}

/* ── Empty State ── */
.stm-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--stm-text);
}

.stm-empty .ti {
  font-size: 3rem;
  opacity: 0.25;
  margin-bottom: 1rem;
  display: block;
}

.stm-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--stm-heading);
  margin-bottom: 0.25rem;
}

.stm-empty-desc {
  font-size: 0.8125rem;
  opacity: 0.7;
}

/* ── Skeleton Loading ── */
.stm-skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: stmShimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes stmShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.stm-skeleton-card {
  height: 130px;
  border-radius: var(--stm-radius);
}

.stm-skeleton-row {
  height: 1rem;
  margin-bottom: 0.75rem;
}

.stm-skeleton-row:last-child {
  width: 60%;
}

/* ── Mode Toggle (instant/shipment) ── */
.stm-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stm-mode-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid var(--stm-border);
  border-radius: var(--stm-radius);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.stm-mode-opt:hover {
  border-color: rgba(var(--stm-primary-rgb), 0.4);
}

.stm-mode-opt.active {
  border-color: var(--stm-primary);
  background: rgba(var(--stm-primary-rgb), 0.04);
}

.stm-mode-opt .ti { font-size: 1.5rem; color: var(--stm-primary); }
.stm-mode-opt-title { font-weight: 700; font-size: 0.875rem; color: var(--stm-heading); }
.stm-mode-opt-desc { font-size: 0.75rem; color: var(--stm-text); }

/* ── CSV Export Button ── */
.stm-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  border: 1px solid var(--stm-border);
  border-radius: var(--stm-radius);
  background: var(--stm-surface);
  color: var(--stm-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.stm-export-btn:hover {
  border-color: var(--stm-success);
  color: #0f5132;
  background: rgba(113, 221, 55, 0.06);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .stm-cards-grid {
    grid-template-columns: 1fr;
  }
  .stm-summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .stm-field-row {
    grid-template-columns: 1fr;
  }
  .stm-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .stm-wizard-steps {
    gap: 0;
  }
  .stm-wizard-step span:not(.stm-wizard-step-num) {
    display: none;
  }
}

/* ── RTL adjustments ── */
[dir="rtl"] .stm-matrix .stm-table thead th:nth-child(3),
[dir="rtl"] .stm-matrix .stm-table tbody td:nth-child(3) {
  border-inline-end: 2px solid var(--stm-border);
  border-inline-start: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STOCK SUMMARY & ALERTS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Tab badge danger variant */
.stm-tab-badge-danger {
  background: var(--stm-danger) !important;
  color: #fff !important;
}

/* Stock level row colors */
.stm-summary-table tr.stm-stock-danger {
  background: rgba(234, 84, 85, 0.06);
}
.stm-summary-table tr.stm-stock-danger:hover {
  background: rgba(234, 84, 85, 0.12);
}
.stm-summary-table tr.stm-stock-warning {
  background: rgba(255, 159, 67, 0.06);
}
.stm-summary-table tr.stm-stock-warning:hover {
  background: rgba(255, 159, 67, 0.12);
}
.stm-summary-table tr.stm-stock-high {
  background: rgba(115, 103, 240, 0.06);
}
.stm-summary-table tr.stm-stock-high:hover {
  background: rgba(115, 103, 240, 0.12);
}
.stm-summary-table tr.stm-stock-ok:hover {
  background: rgba(40, 199, 111, 0.04);
}

/* Stock status badges */
.stm-stock-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}
.stm-stock-badge.stm-stock-danger {
  background: rgba(234, 84, 85, 0.12);
  color: #ea5455;
}
.stm-stock-badge.stm-stock-warning {
  background: rgba(255, 159, 67, 0.12);
  color: #ff9f43;
}
.stm-stock-badge.stm-stock-ok {
  background: rgba(40, 199, 111, 0.12);
  color: #28c76f;
}
.stm-stock-badge.stm-stock-high {
  background: rgba(115, 103, 240, 0.12);
  color: #7367f0;
}

/* Alert severity badges */
.stm-stock-badge.stm-severity-critical {
  background: rgba(234, 84, 85, 0.15);
  color: #ea5455;
}
.stm-stock-badge.stm-severity-warning {
  background: rgba(255, 159, 67, 0.15);
  color: #ff9f43;
}
.stm-stock-badge.stm-severity-low {
  background: rgba(255, 159, 67, 0.08);
  color: #e08a30;
}

/* Inline alert threshold inputs */
.stm-alert-input {
  width: 70px;
  padding: 0.25rem 0.375rem;
  border: 1px solid var(--stm-border);
  border-radius: 4px;
  font-size: 0.8125rem;
  text-align: center;
  background: transparent;
  color: inherit;
  transition: border-color 0.15s ease;
}
.stm-alert-input:focus {
  outline: none;
  border-color: var(--stm-primary);
  box-shadow: 0 0 0 2px rgba(var(--stm-primary-rgb), 0.15);
}
.stm-alert-input::placeholder {
  color: var(--stm-text);
  opacity: 0.4;
}

/* Alerts view */
.stm-alerts-view .stm-summary-row {
  justify-content: flex-start;
}
.stm-alerts-view .stm-summary-card {
  min-width: 200px;
}
