/* hub-merch-inventory.css */
/* Cellador Operations Hub — Merch Inventory & Apparel/Glassware Module */
/* Light Mode Color Scheme matching In-Use Kegs, Beer Library & Salable Kegs */

#view-merch-inventory {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f8fafc;
}

.merch-container {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
}

/* Header */
.merch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.merch-header-left h1,
.merch-header-left h2 {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.merch-header-tag {
  font-size: 12px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.merch-header-left p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  max-width: 840px;
  line-height: 1.5;
}

.merch-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Summary Metrics Cards Grid */
.merch-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.merch-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.merch-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.merch-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #cbd5e1;
}

.merch-stat-card.stat-blue::before { background: #3b82f6; }
.merch-stat-card.stat-sky::before { background: #0284c7; }
.merch-stat-card.stat-emerald::before { background: #10b981; }
.merch-stat-card.stat-purple::before { background: #8b5cf6; }
.merch-stat-card.stat-amber::before { background: #f59e0b; }

.merch-stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
}

.merch-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 4px;
}

.merch-stat-sub {
  font-size: 12.5px;
  color: #64748b;
}

/* Filter Toolbar */
.merch-toolbar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.merch-toolbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.merch-search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 420px;
}

.merch-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.merch-search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  font-size: 13.5px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

.merch-search-input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.merch-view-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.merch-view-select:focus {
  border-color: #3b82f6;
}

.merch-filter-pills-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.merch-filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-right: 4px;
  letter-spacing: 0.5px;
}

.merch-pill-btn {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.merch-pill-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.merch-pill-btn.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.merch-pill-count {
  font-size: 11px;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
}

.merch-pill-btn.active .merch-pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Category Section */
.merch-category-section {
  margin-bottom: 32px;
}

.merch-category-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 16px;
}

.merch-category-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Badges */
.merch-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.merch-badge-clothing {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.merch-badge-glassware {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.merch-badge-syndicate {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.merch-badge-books {
  background: #f4f4f5;
  color: #3f3f46;
  border: 1px solid #e4e4e7;
}

.merch-badge-gender-m {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.merch-badge-gender-w {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.merch-badge-gender-uni {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Merch Item Card */
.merch-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.merch-item-card-header {
  background: #f8fafc;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.merch-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.merch-item-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #64748b;
}

/* Variations Table */
.merch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.merch-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.merch-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.merch-table tr:hover td {
  background: #f8fafc;
}

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

/* Stepper Component */
.merch-stepper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.merch-stepper-btn {
  background: #f8fafc;
  border: none;
  color: #475569;
  width: 28px;
  height: 30px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.merch-stepper-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.merch-stepper-input {
  width: 46px;
  background: transparent;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 700;
  text-align: center;
  font-size: 13.5px;
  font-family: inherit;
  -moz-appearance: textfield;
}

.merch-stepper-input::-webkit-outer-spin-button,
.merch-stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Editable Inputs & Money Wrapper */
.merch-money-wrapper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 6px 0 8px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.merch-money-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.merch-currency-symbol {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  user-select: none;
  margin-right: 2px;
}

.merch-input-money {
  width: 64px;
  background: transparent;
  border: none;
  color: #0f172a;
  padding: 5px 0;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  font-family: inherit;
  -moz-appearance: textfield;
}

.merch-input-money:focus {
  outline: none;
}

.merch-input-money::-webkit-outer-spin-button,
.merch-input-money::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.merch-input-buffer {
  width: 44px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  font-family: inherit;
  transition: all 0.15s ease;
  -moz-appearance: textfield;
}

.merch-input-buffer::-webkit-outer-spin-button,
.merch-input-buffer::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.merch-input-buffer:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.merch-input-note {
  width: 100%;
  max-width: 240px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.merch-input-note:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Available Badges */
.merch-avail-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  text-align: center;
}

.merch-avail-badge.in-stock {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.merch-avail-badge.out-of-stock {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Sticky Dirty / Save Bar */
.merch-dirty-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 10000;
  border: 1px solid #334155;
  animation: merchSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes merchSlideUp {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.merch-dirty-info {
  font-size: 13.5px;
  font-weight: 500;
  color: #f8fafc;
}

.merch-dirty-info strong {
  color: #38bdf8;
}

.merch-dirty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.merch-dirty-bar .merch-btn-primary {
  background: #0284c7;
  color: #ffffff;
}

.merch-dirty-bar .merch-btn-primary:hover {
  background: #0369a1;
}

.merch-dirty-bar .merch-btn-secondary {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
}

.merch-dirty-bar .merch-btn-secondary:hover {
  background: #334155;
}

/* Generic Buttons */
.merch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.merch-btn-primary {
  background: #0f172a;
  color: #ffffff;
}

.merch-btn-primary:hover {
  background: #1e293b;
}

.merch-btn-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.merch-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.merch-btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

/* Empty Notice */
.merch-empty-notice {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
}

.merch-empty-notice h4 {
  font-size: 16px;
  color: #0f172a;
  margin: 0 0 8px 0;
}
