/* ==========================================================
   TIFFNY Inventory - component styles (cards, forms, tables, module pages).
   Colours are theme tokens defined in theme.css (light + dark).
   ========================================================== */

/* ==========================================================
   BREADCRUMB
   ========================================================== */
.breadcrumb {
  font-size:12px;
  color:var(--muted);
  margin-bottom:14px;
}
.breadcrumb b { color:var(--link); }
.breadcrumb a { color:var(--muted); text-decoration:none; }
.breadcrumb a:hover { color:var(--link); }

/* ==========================================================
   PAGE HEADER
   ========================================================== */
.page-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:18px;
  flex-wrap:wrap;
  gap:12px;
}
.page-header h1 {
  font-size:22px;
  font-weight:700;
  color:var(--text);
  line-height:1.2;
}
.page-header p {
  font-size:13px;
  color:var(--muted);
  margin-top:3px;
}

/* ==========================================================
   DATE TABS
   ========================================================== */
.date-tabs {
  display:flex;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden;
}
.date-tabs button {
  padding:8px 16px;
  background:var(--surface);
  border:none;
  cursor:pointer;
  font-size:12px;
  color:var(--muted);
  border-right:1px solid var(--line);
  font-weight:500;
  transition:all 0.15s;
}
.date-tabs button:last-child { border-right:none; }
.date-tabs button.active { background:var(--primary); color:#fff; }
.date-tabs button:hover:not(.active) { background:var(--surface-2); }

.date-range {
  background:var(--surface);
  border:1px solid var(--line);
  padding:8px 14px;
  border-radius:8px;
  font-size:12px;
  color:var(--text-2);
  margin-left:10px;
}

/* ==========================================================
   STAT CARDS
   ========================================================== */
.stats-row {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:20px;
}
.stat-card {
  background:var(--surface);
  padding:18px 20px;
  border-radius:12px;
  display:flex;
  gap:14px;
  align-items:flex-start;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
  border:1px solid var(--line);
  transition:transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
  transform:translateY(-2px);
  box-shadow:0 4px 12px rgba(0,0,0,0.06);
}
.stat-icon {
  width:46px;
  height:46px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  color:#fff;
  flex-shrink:0;
}
.si-blue { background:linear-gradient(135deg,#3b82f6,#1d4ed8); }
.si-green { background:linear-gradient(135deg,#10b981,#059669); }
.si-orange { background:linear-gradient(135deg,#f59e0b,#d97706); }
.si-purple { background:linear-gradient(135deg,#8b5cf6,#7c3aed); }
.si-red { background:linear-gradient(135deg,#ef4444,#dc2626); }

.stat-body { flex:1; min-width:0; }
.stat-body .label {
  font-size:11.5px;
  color:var(--muted);
  font-weight:500;
  margin-bottom:6px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.stat-body .value {
  font-size:24px;
  font-weight:700;
  color:var(--text);
  line-height:1;
}
.stat-body .delta {
  font-size:11px;
  margin-top:6px;
  font-weight:500;
}
.delta-up { color:var(--ok-fg); }
.delta-down { color:var(--bad-fg); }
.delta small { color:var(--faint); font-weight:400; }

/* ==========================================================
   DASHBOARD GRID
   ========================================================== */
.dash-row {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  margin-bottom:16px;
}
.dash-row-3 {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.panel {
  background:var(--surface);
  border-radius:12px;
  padding:18px 20px;
  border:1px solid var(--line);
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
}
.panel-title {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  font-weight:600;
  color:var(--text);
  margin-bottom:16px;
}
.panel-title .dot { color:var(--link); font-size:16px; }
.panel-title .right {
  margin-left:auto;
  font-size:11px;
  color:var(--link);
  font-weight:500;
  cursor:pointer;
  text-decoration:none;
  display:flex;
  align-items:center;
  gap:4px;
}
.panel-title .right:hover { text-decoration:underline; }

/* ==========================================================
   CHART CONTAINERS
   ========================================================== */
.chart-wrap { position:relative; height:260px; }
.chart-wrap.tall { height:230px; }

/* ==========================================================
   PIE CHART LAYOUT
   ========================================================== */
.pie-layout {
  display:grid;
  grid-template-columns:1fr 1.1fr;
  gap:10px;
  align-items:center;
}
.pie-legend { font-size:12px; }
.pie-legend .row {
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 0;
  border-bottom:1px solid var(--line);
}
.pie-legend .row:last-child { border-bottom:none; }
.pie-legend .bullet {
  width:10px;
  height:10px;
  border-radius:50%;
  flex-shrink:0;
}
.pie-legend .name {
  flex:1;
  color:var(--text-2);
  font-weight:500;
}
.pie-legend .qty {
  color:var(--text);
  font-weight:600;
  margin-right:10px;
}
.pie-legend .pct {
  color:var(--muted);
  font-weight:500;
  min-width:32px;
  text-align:right;
}

/* ==========================================================
   TOP SKU TABLE
   ========================================================== */
.sku-table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
.sku-table th {
  text-align:left;
  padding:8px 10px;
  color:var(--faint);
  font-weight:600;
  font-size:11px;
  border-bottom:1px solid var(--line);
  text-transform:uppercase;
  letter-spacing:0.3px;
}
.sku-table td {
  padding:10px;
  border-bottom:1px solid var(--line);
  color:var(--text-2);
}
.sku-table tr:last-child td { border-bottom:none; }
.sku-table tr:hover td { background:var(--surface-2); }

.sku-thumb {
  width:26px;
  height:26px;
  background:var(--surface-2);
  border-radius:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
}

.brand-pill {
  display:inline-block;
  padding:2px 8px;
  border-radius:4px;
  font-size:10px;
  font-weight:600;
  color:#fff;
}
.brand-nike { background:#111; }
.brand-levis { background:#c8102e; }
.brand-adidas { background:#000; }
.brand-skybags { background:#0ea5e9; }
.brand-fastrack { background:#4f46e5; }
.brand-hm { background:#e11d48; }
.brand-reebok { background:var(--bad); }
.brand-puma { background:var(--ink); }

/* ==========================================================
   PLATFORM SKU ALLOCATION BARS
   ========================================================== */
.alloc-list {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.alloc-item {
  display:grid;
  grid-template-columns:110px 1fr auto;
  gap:12px;
  align-items:center;
}
.alloc-platform {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:600;
  color:var(--text-2);
}
.alloc-platform .ico { font-size:14px; }
.alloc-platform .ico.a { color:#ff9900; }
.alloc-platform .ico.f { color:var(--link); }
.alloc-platform .ico.m { color:var(--accent-2); }
.alloc-platform .ico.my { color:var(--bad-fg); }
.alloc-platform .ico.o { color:var(--link); }

.alloc-bar {
  display:flex;
  height:22px;
  border-radius:6px;
  overflow:hidden;
  background:var(--surface-2);
}
.alloc-bar .seg {
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  color:#fff;
  font-weight:600;
  transition:width 0.5s ease;
}
.seg-green { background:var(--ok); }
.seg-orange { background:var(--warn); }
.seg-red { background:var(--bad); }

.alloc-nums {
  display:flex;
  gap:6px;
  font-size:11px;
  font-weight:600;
  min-width:170px;
  justify-content:flex-end;
}
.alloc-nums .n { min-width:30px; text-align:center; }
.alloc-nums .green { color:var(--ok-fg); }
.alloc-nums .orange { color:var(--warn-fg); }
.alloc-nums .red { color:var(--bad-fg); }
.alloc-nums .total { color:var(--text); font-weight:700; }

/* ==========================================================
   BOTTOM SUMMARY (4-column footer)
   ========================================================== */
.bottom-summary {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:0;
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--line);
}
.bottom-summary .col {
  text-align:center;
  border-right:1px solid var(--line);
  padding:0 8px;
}
.bottom-summary .col:last-child { border-right:none; }
.bottom-summary .lbl {
  font-size:11px;
  color:var(--muted);
  margin-bottom:4px;
}
.bottom-summary .val {
  font-size:18px;
  font-weight:700;
  color:var(--text);
}
.bottom-summary .val.green { color:var(--ok-fg); }
.bottom-summary .val.orange { color:var(--warn-fg); }
.bottom-summary .val.red { color:var(--bad-fg); }
.bottom-summary .pct {
  font-size:11px;
  color:var(--muted);
  font-weight:500;
}

/* ==========================================================
   FORM CARDS
   ========================================================== */
.form-card {
  background:var(--surface);
  border-radius:12px;
  padding:22px 24px;
  margin-bottom:20px;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
  border:1px solid var(--line);
}
.form-head {
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:22px;
  flex-wrap:wrap;
}
.form-head .ico {
  width:48px;
  height:48px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:22px;
  flex-shrink:0;
}
.ico-blue { background:linear-gradient(135deg,#3b82f6,#1d4ed8); }
.ico-green { background:linear-gradient(135deg,#10b981,#059669); }
.form-head h2 {
  font-size:18px;
  font-weight:700;
  color:var(--text);
  line-height:1.2;
}
.form-head p {
  font-size:12.5px;
  color:var(--muted);
  margin-top:2px;
}
.form-head .info {
  margin-left:auto;
  background:var(--info-bg);
  border:1px solid var(--info-line);
  padding:10px 14px;
  border-radius:8px;
  font-size:11.5px;
  color:var(--link);
  max-width:340px;
  line-height:1.5;
}
.form-head .info.green {
  background:var(--ok-bg);
  border-color:var(--ok-line);
  color:var(--ok-fg);
}

/* ==========================================================
   FORM GRID & FIELDS
   ========================================================== */
.form-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:16px;
}
.form-grid.c3 { grid-template-columns:repeat(3,1fr); }
.form-grid.c2 { grid-template-columns:repeat(2,1fr); }
.form-grid.c1 { grid-template-columns:1fr; }

.field label {
  display:block;
  font-size:12px;
  font-weight:600;
  color:var(--text-2);
  margin-bottom:6px;
}
.field label .req { color:var(--bad-fg); }

.field input,
.field select,
.field textarea {
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  font-size:13px;
  outline:none;
  transition:border 0.15s, box-shadow 0.15s;
  background:var(--surface);
  font-family:inherit;
  color:var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(37,99,235,0.1);
}
.field input::placeholder,
.field textarea::placeholder {
  color:var(--faint);
}
.field input:disabled,
.field select:disabled {
  background:var(--surface-2);
  cursor:not-allowed;
}
.field textarea {
  resize:vertical;
  min-height:70px;
}
.field .error {
  color:var(--bad-fg);
  font-size:11px;
  margin-top:4px;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn-row {
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:18px;
}
.btn {
  padding:10px 20px;
  border:none;
  border-radius:8px;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  transition:all 0.15s;
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-family:inherit;
  text-decoration:none;
  white-space:nowrap;
}
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-strong); }
.btn-outline {
  background:var(--surface);
  color:var(--text-2);
  border:1px solid var(--line);
}
.btn-outline:hover { background:var(--surface-2); border-color:var(--line-strong); }
.btn-success { background:var(--ok); color:#fff; }
.btn-success:hover { background:var(--ok); }
.btn-danger { background:var(--bad); color:#fff; }
.btn-danger:hover { background:var(--bad); }
.btn:disabled {
  opacity:0.6;
  cursor:not-allowed;
}

/* ==========================================================
   LIST PAGE STATS
   ========================================================== */
.list-stats {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:18px;
}
.list-stat {
  background:var(--surface);
  padding:16px 18px;
  border-radius:12px;
  border:1px solid var(--line);
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
  display:flex;
  align-items:center;
  gap:12px;
}
.ls-icon {
  width:42px;
  height:42px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex-shrink:0;
}
.ls-icon.blue { background:var(--info-bg); color:var(--link); }
.ls-icon.green { background:var(--ok-bg); color:var(--ok-fg); }
.ls-icon.orange { background:var(--warn-bg); color:var(--warn-fg); }
.ls-icon.red { background:var(--bad-bg); color:var(--bad-fg); }
.list-stat .lbl {
  font-size:11.5px;
  color:var(--muted);
  font-weight:500;
}
.list-stat .val {
  font-size:20px;
  font-weight:700;
  color:var(--text);
  line-height:1.2;
}

/* ==========================================================
   TABLE CARD & DATA TABLE
   ========================================================== */
.table-card {
  background:var(--surface);
  border-radius:12px;
  padding:20px 22px;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
  border:1px solid var(--line);
  margin-bottom:20px;
}
.table-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
  flex-wrap:wrap;
  gap:10px;
}
.table-head h3 {
  font-size:15px;
  font-weight:700;
  color:var(--text);
}
.table-head .actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.data-table {
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}
.data-table th {
  background:var(--surface-2);
  padding:11px 12px;
  text-align:left;
  font-size:11px;
  font-weight:600;
  color:var(--text-2);
  text-transform:uppercase;
  letter-spacing:0.3px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
.data-table td {
  padding:11px 12px;
  border-bottom:1px solid var(--line);
  color:var(--text-2);
  vertical-align:middle;
}
.data-table tr:hover td { background:var(--surface-2); }
.data-table tr:last-child td { border-bottom:none; }

/* ==========================================================
   BADGES
   ========================================================== */
.badge {
  display:inline-block;
  padding:3px 10px;
  border-radius:20px;
  font-size:10.5px;
  font-weight:600;
  white-space:nowrap;
}
.badge-green { background:var(--ok-bg); color:var(--ok-fg); }
.badge-yellow { background:var(--warn-bg); color:var(--warn-fg); }
.badge-red { background:var(--bad-bg); color:var(--bad-fg); }
.badge-blue { background:var(--info-bg); color:var(--link); }
.badge-gray { background:var(--surface-2); color:var(--text-2); }

/* ==========================================================
   ACTION BUTTONS (in tables)
   ========================================================== */
.act-btn {
  background:none;
  border:none;
  cursor:pointer;
  padding:4px 6px;
  font-size:13px;
  border-radius:6px;
  transition:background 0.15s;
  color:var(--muted);
}
.act-btn.edit { color:var(--link); }
.act-btn.del { color:var(--bad-fg); }
.act-btn.view { color:var(--ok-fg); }
.act-btn:hover { background:var(--surface-2); }

/* ==========================================================
   FILTERS
   ========================================================== */
.filter-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:12px;
  padding:14px 16px;
  background:var(--surface-2);
  border-radius:10px;
  margin-bottom:14px;
}
.filter-grid.c5 { grid-template-columns:repeat(5,1fr); }
.filter-grid.c3 { grid-template-columns:repeat(3,1fr); }
.filter-grid.c2 { grid-template-columns:repeat(2,1fr); }
.filter-grid .field label { font-size:11px; }
.filter-grid .field input,
.filter-grid .field select {
  padding:8px 10px;
  font-size:12px;
}

/* ==========================================================
   ALERTS
   ========================================================== */
.alert-success {
  background:var(--ok-bg);
  color:var(--ok-fg);
  padding:12px 16px;
  border-radius:8px;
  margin-bottom:16px;
  font-size:13px;
  border:1px solid var(--ok-line);
  display:flex;
  align-items:center;
  gap:8px;
}
.alert-success::before { content:'✓'; font-weight:700; }

.alert-error {
  background:var(--bad-bg);
  color:var(--bad-fg);
  padding:12px 16px;
  border-radius:8px;
  margin-bottom:16px;
  font-size:13px;
  border:1px solid var(--bad-line);
  display:flex;
  align-items:center;
  gap:8px;
}
.alert-error::before { content:'⚠'; font-weight:700; }

.alert-info {
  background:var(--info-bg);
  color:var(--link);
  padding:12px 16px;
  border-radius:8px;
  margin-bottom:16px;
  font-size:13px;
  border:1px solid var(--info-line);
}

/* ==========================================================
   TOAST NOTIFICATION
   ========================================================== */
#toast {
  position:fixed;
  top:22px;
  right:22px;
  z-index:9999;
  padding:13px 20px;
  background:var(--ink);
  color:#fff;
  border-radius:10px;
  font-size:13px;
  font-weight:500;
  box-shadow:0 8px 24px rgba(0,0,0,0.15);
  opacity:0;
  transform:translateX(100%);
  transition:all 0.3s;
  pointer-events:none;
  max-width:320px;
}
#toast.show { opacity:1; transform:translateX(0); }
#toast.success { background:var(--ok); }
#toast.error { background:var(--bad); }

/* ==========================================================
   PAGINATION
   ========================================================== */
.pagination-wrap {
  margin-top:15px;
  display:flex;
  justify-content:flex-end;
}
.pagination-wrap nav { display:flex; gap:4px; }
.pagination-wrap a,
.pagination-wrap span {
  padding:6px 12px;
  border:1px solid var(--line);
  background:var(--surface);
  border-radius:6px;
  font-size:12px;
  color:var(--text-2);
  text-decoration:none;
  cursor:pointer;
  transition:all 0.15s;
}
.pagination-wrap a:hover { background:var(--surface-2); border-color:var(--line-strong); }
.pagination-wrap .active {
  background:var(--primary);
  color:#fff;
  border-color:var(--accent);
}

/* ==========================================================
   MOBILE RESPONSIVE
   ========================================================== */
@media (max-width:1200px) {
  .stats-row,
  .list-stats { grid-template-columns:repeat(2,1fr); }
  .dash-row,
  .dash-row-3 { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:repeat(2,1fr); }
  .filter-grid { grid-template-columns:repeat(2,1fr); }
  .pie-layout { grid-template-columns:1fr; }
  .bottom-summary { grid-template-columns:repeat(2,1fr); gap:12px; }
  .bottom-summary .col { border-right:none; border-bottom:1px solid var(--line); padding:8px; }
  .bottom-summary .col:nth-last-child(-n+2) { border-bottom:none; }
}

@media (max-width:768px) {
  .stats-row,
  .list-stats,
  .form-grid,
  .filter-grid { grid-template-columns:1fr; }

  .form-head { flex-direction:column; align-items:flex-start; }
  .form-head .info { margin-left:0; max-width:100%; }
  .table-head { flex-direction:column; align-items:flex-start; }

  .alloc-item { grid-template-columns:1fr; gap:6px; }
  .alloc-nums { min-width:auto; justify-content:flex-start; }

  .btn { padding:9px 14px; font-size:12px; }
  .data-table { font-size:11px; }
  .data-table th,
  .data-table td { padding:8px 10px; }
}

/* ==========================================================
   UTILITIES
   ========================================================== */
.text-center { text-align:center; }
.text-right { text-align:right; }
.mt-10 { margin-top:10px; }
.mt-20 { margin-top:20px; }
.mb-10 { margin-bottom:10px; }
.mb-20 { margin-bottom:20px; }
.hidden { display:none; }
.flex { display:flex; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.gap-10 { gap:10px; }



.export-dropdown { position: relative; display: inline-block; }
.export-menu {
  display: none;
  position: absolute;
  top: 100%; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 220px;
  z-index: 100;
  padding: 6px 0;
  margin-top: 4px;
}
.export-menu.show { display: block; }
.export-menu a {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}
.export-menu a:hover { background: var(--surface-2); color: var(--link); }


/* ==========================================================
   IMAGE UPLOAD (Form)
   ========================================================== */
.image-upload-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: center;
  padding: 20px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  margin-bottom: 24px;
}

.image-preview-box {
  position: relative;
  width: 200px;
  height: 200px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-preview-box .image-hint {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 2px 8px;
  border-radius: 4px;
}
.remove-image-label {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239,68,68,0.95);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  gap: 4px;
  align-items: center;
  font-weight: 600;
}
.remove-image-label input { margin: 0; }

.image-upload-info { display: flex; flex-direction: column; gap: 12px; }
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}
.upload-btn:hover { background: var(--primary-strong); }
.upload-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.upload-note strong { color: var(--text-2); }

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.error-msg { color: var(--bad-fg); font-size: 12px; margin-top: 6px; font-weight: 500; }

/* ==========================================================
   SKU CARD GRID (List)
   ========================================================== */
.sku-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.sku-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}
.sku-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--line-strong);
}

/* Image area */
.sku-card-image {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sku-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.sku-card:hover .sku-card-image img { transform: scale(1.05); }
.sku-card-image .no-image {
  font-size: 56px;
  color: var(--faint);
}

.sku-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Body */
.sku-card-body {
  padding: 14px 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sku-card-category {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-transform: capitalize;
}

.sku-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.sku-card-sku {
  font-size: 12px;
  color: var(--text-2);
  border-bottom: 2px dotted var(--accent);
  display: inline-block;
  padding-bottom: 2px;
  width: fit-content;
  margin-top: 2px;
}
.sku-card-sku strong { color: var(--link); }

/* Meta chips */
.sku-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-brand  { background: var(--info-bg); color: var(--link); }
.chip-colour { background: var(--warn-bg); color: var(--warn-fg); }
.chip-size   { background: var(--ok-bg); color: var(--ok-fg); }

/* Footer */
.sku-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.sku-card-mrp {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.sku-card-gst { font-size: 10.5px; color: var(--muted); }
.sku-card-stock { text-align: right; }
.stock-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--ok-fg);
}
.stock-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

/* Actions */
.sku-card-actions {
  display: flex;
  border-top: 1px solid var(--line);
}
.card-btn {
  flex: 1;
  padding: 11px 8px;
  text-align: center;
  border: none;
  background: var(--surface);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s;
  font-family: inherit;
}
.card-btn.edit {
  color: var(--link);
  border-right: 1px solid var(--line);
}
.card-btn.edit:hover { background: var(--info-bg); }
.card-btn.del { color: var(--bad-fg); }
.card-btn.del:hover { background: var(--bad-bg); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-icon {
  font-size: 60px;
  opacity: 0.4;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 18px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.empty-state p { font-size: 13px; margin-bottom: 20px; }

/* Responsive */
@media (max-width: 768px) {
  .image-upload-row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .upload-btn { align-self: center; }
  .sku-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .sku-card-image { height: 160px; }
}

/* ==========================================================
   MASTER SKU TABLE (Proper Row Layout)
   ========================================================== */
.sku-table {
  font-size: 12.5px;
}
.sku-table th {
  white-space: nowrap;
  vertical-align: middle;
}
.sku-table td {
  vertical-align: middle;
  padding: 10px 12px;
}

/* ---------- Image Thumbnail ---------- */
.sku-thumb {
  width: 52px;
  height: 52px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.sku-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.25s;
}
.sku-thumb:hover img { transform: scale(1.15); }
.sku-thumb-empty {
  font-size: 22px;
  color: var(--faint);
}

/* ---------- SKU Code ---------- */
.sku-code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--link);
  background: var(--info-bg);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--info-line);
  white-space: nowrap;
}

/* ---------- Product Cell ---------- */
.product-cell { min-width: 180px; max-width: 260px; }
.product-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-remarks {
  font-size: 11px;
  color: var(--faint);
  margin-top: 2px;
  font-style: italic;
}

/* ---------- Brand Chip ---------- */
.brand-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--info-bg);
  color: var(--link);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Size Chip ---------- */
.size-chip {
  display: inline-block;
  padding: 3px 9px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* ---------- Stock Pill ---------- */
.stock-pill {
  display: inline-block;
  padding: 4px 12px;
  background: var(--surface-2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 40px;
  text-align: center;
}
.alert-threshold {
  font-size: 10px;
  color: var(--faint);
  margin-top: 3px;
}

/* ---------- Actions Group ---------- */
.action-group {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.act-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: transparent;
}
.act-btn.edit {
  color: var(--link);
}
.act-btn.edit:hover {
  background: var(--info-bg);
  transform: scale(1.1);
}
.act-btn.del {
  color: var(--bad-fg);
}
.act-btn.del:hover {
  background: var(--bad-bg);
  transform: scale(1.1);
}

/* ==========================================================
   IMAGE MODAL (Preview)
   ========================================================== */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.image-modal.show { display: flex; }
.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.image-modal-content img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 8px;
  display: block;
}
.image-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-weight: 700;
  color: var(--text-2);
}
.image-modal-close:hover { background: var(--bad); color: #fff; }
.image-modal-caption {
  text-align: center;
  padding: 12px 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 992px) {
  .product-cell { min-width: 140px; }
  .sku-table { font-size: 11.5px; }
  .sku-table td { padding: 8px 10px; }
}

@media (max-width: 768px) {
  .sku-thumb { width: 42px; height: 42px; }
  .sku-table th:nth-child(5),
  .sku-table td:nth-child(5),   /* Category */
  .sku-table th:nth-child(7),
  .sku-table td:nth-child(7),   /* Colour */
  .sku-table th:nth-child(9),
  .sku-table td:nth-child(9),   /* MRP */
  .sku-table th:nth-child(10),
  .sku-table td:nth-child(10) { /* GST */
    display: none;
  }
}


/* ==========================================================
   BULK INACTIVE PREVIEW
   ========================================================== */
.bulk-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.bulk-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.bulk-card.total   { border-left: 4px solid var(--accent); }
.bulk-card.danger  { border-left: 4px solid #dc2626; background:var(--bad-bg); }
.bulk-card.info    { border-left: 4px solid #8b5cf6; background:var(--info-bg); }
.bulk-card.warning { border-left: 4px solid #f59e0b; background:var(--warn-bg); }
.bulk-icon { font-size: 24px; }
.bulk-lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; font-weight: 500; }
.bulk-val { font-size: 22px; font-weight: 700; color: var(--text); }

.bulk-file-info {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--text-2);
}

.bulk-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.bulk-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  font-family: inherit;
}
.bulk-tab.active { color: var(--link); border-bottom-color: var(--accent); }

.bulk-tab-content { display: none; max-height: 320px; overflow-y: auto; padding: 10px 0; }
.bulk-tab-content.active { display: block; }

.sku-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.sku-preview-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.sku-preview-item.inactive { background: var(--surface-2); opacity: 0.7; }
.sku-preview-item img,
.sku-preview-item .no-img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.sku-code-small {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--link);
}
.sku-name-small { font-size: 11px; color: var(--muted); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.missing-tag {
  padding: 4px 10px;
  background: var(--bad-bg);
  color: var(--bad-fg);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.empty-text { text-align: center; color: var(--faint); padding: 20px; font-size: 13px; }

.bulk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.act-btn.warn { color: var(--warn-fg); }
.act-btn.warn:hover { background: var(--warn-bg); transform: scale(1.1); }
.act-btn.success { color: var(--ok-fg); }
.act-btn.success:hover { background: var(--ok-bg); transform: scale(1.1); }

.badge-gray { background: var(--surface-2); color: var(--muted); }

@media (max-width: 768px) {
  .bulk-summary { grid-template-columns: repeat(2, 1fr); }
  .bulk-tabs { overflow-x: auto; }
}




/* ==========================================================
   SKU TABS (Active / Inactive / All)
   ========================================================== */
.sku-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow-x: auto;
}
.sku-tab {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.sku-tab:hover {
  background: var(--surface-2);
  transform: translateY(-1px);
}
.sku-tab.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.sku-tab .tab-icon { font-size: 18px; }
.sku-tab .tab-label { flex: 1; }
.sku-tab .tab-count {
  background: rgba(255,255,255,0.25);
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  min-width: 44px;
  text-align: center;
}
.sku-tab:not(.active) .tab-count {
  background: var(--surface-3);
  color: var(--text-2);
}

/* ==========================================================
   INACTIVE ROW STYLING
   ========================================================== */
.row-inactive {
  background: var(--bad-bg) !important;
  opacity: 0.85;
}
.row-inactive:hover { background: var(--bad-bg) !important; }

.inactive-reason {
  font-size: 11px;
  color: var(--bad-fg);
  margin-top: 3px;
  font-style: italic;
  font-weight: 500;
}

/* ==========================================================
   ACTION BUTTONS
   ========================================================== */
.act-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: transparent;
}
.act-btn.edit { color: var(--link); }
.act-btn.edit:hover { background: var(--info-bg); transform: scale(1.15); }

.act-btn.warn { color: var(--warn-fg); }
.act-btn.warn:hover { background: var(--warn-bg); transform: scale(1.15); }

.act-btn.success { color: var(--ok-fg); }
.act-btn.success:hover { background: var(--ok-bg); transform: scale(1.15); }

.act-btn.del { color: var(--bad-fg); }
.act-btn.del:hover { background: var(--bad-bg); transform: scale(1.15); }

/* ==========================================================
   BADGE COLORS
   ========================================================== */
.badge-gray { background: var(--surface-2); color: var(--muted); }

/* ==========================================================
   RESPONSIVE TABS
   ========================================================== */
@media (max-width: 768px) {
  .sku-tabs {
    flex-direction: column;
    gap: 6px;
  }
  .sku-tab { min-width: 100%; }
  .sku-tab .tab-count { margin-left: auto; }
}


/* ==========================================================
   IMAGE HOVER ZOOM
   ========================================================== */
.sku-thumb-wrap {
  position: relative;
  display: inline-block;
}

/* Hover preview box — hidden by default */
.sku-hover-preview {
  position: absolute;
  top: 50%;
  left: calc(100% + 20px);
  transform: translateY(-50%) scale(0.85);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;

  width: 280px;
  height: 280px;
  background: var(--surface);
  border: 3px solid #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25),
              0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.sku-hover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hover-preview-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.3px;
}

/* Show on hover */
.sku-thumb-wrap:hover .sku-hover-preview {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

/* Thumbnail base */
.sku-thumb {
  width: 52px;
  height: 52px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.sku-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.sku-thumb-wrap:hover .sku-thumb {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.sku-thumb-empty {
  font-size: 22px;
  color: var(--faint);
}

/* ==========================================================
   INLINE STOCK EDITOR
   ========================================================== */
.inline-stock {
  position: relative;
  display: inline-block;
  min-width: 60px;
}

.stock-value {
  display: inline-block;
  padding: 4px 12px;
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  min-width: 46px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.stock-value:hover {
  background: var(--info-bg);
  border-color: var(--accent);
  color: var(--link);
  transform: scale(1.05);
}

.stock-input {
  width: 70px;
  padding: 4px 8px;
  border: 2px solid var(--accent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  outline: none;
  font-family: inherit;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Remove number spinner */
.stock-input::-webkit-outer-spin-button,
.stock-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stock-input[type=number] { -moz-appearance: textfield; }

.stock-save-indicator {
  position: absolute;
  top: -8px;
  right: -14px;
  font-size: 14px;
  font-weight: 700;
  transition: opacity 0.2s;
  pointer-events: none;
}
.stock-save-indicator.saving  { animation: spin 1s linear infinite; }
.stock-save-indicator.success { color: var(--ok-fg); }
.stock-save-indicator.error   { color: var(--bad-fg); }

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ==========================================================
   RESPONSIVE — Hover preview larger screen only
   ========================================================== */
@media (max-width: 1200px) {
  .sku-hover-preview {
    width: 220px;
    height: 220px;
    left: calc(100% + 12px);
  }
}

@media (max-width: 992px) {
  /* Disable hover zoom on tablets/mobile */
  .sku-hover-preview { display: none; }
}

/* ==========================================================
   SHOP CATEGORY SECTIONS
   ========================================================== */
.category-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.category-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.category-section-header h2 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cat-icon { font-size: 24px; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
}
.category-card:hover {
  background: var(--info-bg);
  border-color: var(--accent);
  transform: translateX(4px);
}
.category-card-icon {
  width: 48px;
  height: 48px;
  background: var(--info-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.category-card-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.category-card-body p {
  font-size: 12px;
  color: var(--muted);
}
.category-card-arrow {
  margin-left: auto;
  color: var(--faint);
  font-size: 18px;
  transition: all 0.2s;
}
.category-card:hover .category-card-arrow { color: var(--link); transform: translateX(3px); }

/* ==========================================================
   SUB-CATEGORY CHIPS
   ========================================================== */
.subcat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.subcat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: all 0.15s;
}
.subcat-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--link);
}

/* ==========================================================
   SHOP THUMBNAIL (Table)
   ========================================================== */
.shop-thumb {
  width: 60px;
  height: 60px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-thumb-empty { font-size: 24px; color: var(--faint); }

.product-link {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
  font-size: 13.5px;
}
.product-link:hover { text-decoration: underline; }

/* ==========================================================
   STOCK BADGE (Small inline)
   ========================================================== */
.stock-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}
.stock-badge.in  { background: var(--ok-bg); color: var(--ok-fg); }
.stock-badge.low { background: var(--warn-bg); color: var(--warn-fg); }
.stock-badge.out { background: var(--bad-bg); color: var(--bad-fg); }

/* ==========================================================
   PRODUCT GRID (Card list)
   ========================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 10px 0;
}
.product-grid-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.product-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--line-strong);
}
.product-grid-image {
  height: 220px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-grid-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-grid-card:hover .product-grid-image img { transform: scale(1.05); }
.product-grid-empty { font-size: 48px; color: var(--faint); }

.product-grid-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-grid-cat {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
  font-weight: 500;
}
.product-grid-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-grid-sku {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--link);
  background: var(--info-bg);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}
.product-grid-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.product-grid-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* ==========================================================
   PRODUCT DETAIL PAGE
   ========================================================== */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: var(--surface);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 24px;
}

.product-gallery { display: flex; flex-direction: column; gap: 12px; }
.gallery-main {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty { font-size: 80px; color: var(--faint); }

.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.gallery-thumb {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  border: 2px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.gallery-thumb:hover { border-color: var(--accent); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Right: Product info */
.product-info { display: flex; flex-direction: column; gap: 14px; }

.product-cat-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--info-bg);
  color: var(--link);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  width: fit-content;
}

.product-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.product-sku-line {
  font-size: 13px;
  color: var(--muted);
}
.product-sku-line b {
  color: var(--link);
  font-family: 'Courier New', monospace;
}

.product-price-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.product-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--ok-fg);
}
.product-price-old {
  font-size: 16px;
  color: var(--faint);
  text-decoration: line-through;
}
.product-mrp-note {
  font-size: 11px;
  color: var(--faint);
  margin-left: auto;
}

.product-rating {
  font-size: 13px;
  color: var(--muted);
}
.product-rating a { color: var(--link); text-decoration: none; }

.product-short-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.product-attributes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 10px;
}
.attr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.attr-label {
  color: var(--muted);
  font-weight: 500;
  min-width: 70px;
}
.attr-value { color: var(--text); font-weight: 600; }
.size-pill {
  display: inline-block;
  padding: 3px 12px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.product-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ==========================================================
   PRODUCT TABS
   ========================================================== */
.product-tabs-wrap {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
}
.product-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.ptab {
  padding: 16px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.15s;
  font-family: inherit;
}
.ptab:hover { color: var(--link); background: var(--surface-2); }
.ptab.active {
  color: var(--link);
  border-bottom-color: var(--accent);
}
.ptab-content { display: none; padding: 24px; }
.ptab-content.active { display: block; }
.ptab-content p { line-height: 1.7; color: var(--text-2); }

.spec-table { width: 100%; }
.spec-table tr td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.spec-table tr td:first-child {
  width: 180px;
  color: var(--muted);
}
.spec-table tr td:last-child { color: var(--text); }

/* Related / Variants */
.variants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.variant-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
}
.variant-card:hover { border-color: var(--accent); background: var(--surface-2); }
.variant-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.variant-img img { width: 100%; height: 100%; object-fit: cover; }
.variant-info { display: flex; flex-direction: column; gap: 4px; }
.variant-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.variant-sku { font-size: 10.5px; color: var(--link); font-family: monospace; }
.variant-price { font-size: 13px; font-weight: 700; color: var(--ok-fg); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 992px) {
  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .product-title { font-size: 22px; }
  .product-price { font-size: 26px; }
}
@media (max-width: 768px) {
  .category-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .product-grid-image { height: 160px; }
  .ptab { padding: 14px 16px; font-size: 12.5px; }
  .spec-table tr td:first-child { width: 120px; }
}


/* Badge colors */
.badge-pink   { background: var(--info-bg); color: var(--bad-fg); }
.badge-yellow { background: var(--warn-bg); color: var(--warn-fg); }

/* Category section */
.category-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}
.category-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}
.category-section-header h2 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cat-icon { font-size: 24px; }


/* ==========================================================
   OUTSIDE VENDOR — Dynamic Lists
   ========================================================== */
.dynamic-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.dynamic-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.15s;
}
.dynamic-row:hover { border-color: var(--line-strong); }

.row-icon {
  width: 32px;
  height: 32px;
  background: var(--info-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.dynamic-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  background: var(--surface);
}
.dynamic-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.remove-btn {
  width: 32px;
  height: 32px;
  background: var(--bad-bg);
  color: var(--bad-fg);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s;
}
.remove-btn:hover { background: var(--bad); color: #fff; }

.add-row-btn {
  padding: 10px 20px;
  background: var(--surface);
  color: var(--link);
  border: 2px dashed var(--accent);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
  font-family: inherit;
}
.add-row-btn:hover { background: var(--info-bg); }

/* ==========================================================
   QUANTITY GRID
   ========================================================== */
.colour-grid-block {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.cg-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--info-bg);
  border-bottom: 1px solid var(--line);
}
.cg-colour-icon { font-size: 20px; }
.cg-colour-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--link);
  flex: 1;
}
.cg-colour-total {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
}
.cg-colour-total b { color: var(--ok-fg); font-size: 15px; }

.cg-table-wrap { overflow-x: auto; }

.qty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.qty-table th {
  background: var(--surface-2);
  padding: 10px;
  text-align: center;
  font-weight: 600;
  color: var(--text-2);
  font-size: 11.5px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--line);
}
.qty-table th.row-total-col {
  background: var(--ok-bg);
  color: var(--ok-fg);
  min-width: 90px;
}
.qty-table td {
  padding: 6px 8px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.qty-table td.size-cell {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--link);
  text-align: left;
  padding-left: 16px;
  min-width: 80px;
}

.qty-input {
  width: 62px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  background: var(--surface);
}
.qty-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  background: var(--surface);
}
.qty-input::-webkit-inner-spin-button { opacity: 0.5; }

.row-total-cell {
  background: var(--ok-bg);
  font-weight: 700;
  color: var(--ok-fg);
  font-size: 14px;
  min-width: 70px;
}

/* ==========================================================
   GRAND TOTAL BOX
   ========================================================== */
.grand-total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.25);
}
.gt-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.9;
}
.gt-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ==========================================================
   STICKY ACTIONS
   ========================================================== */
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 16px 0;
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 2px solid var(--line);
  z-index: 100;
}

/* ==========================================================
   EMPTY GRID
   ========================================================== */
.empty-grid {
  text-align: center;
  padding: 60px 20px;
  color: var(--faint);
  background: var(--surface-2);
  border: 2px dashed var(--line);
  border-radius: 12px;
  font-size: 13.5px;
}

/* ==========================================================
   SHOW VIEW — Matrix
   ========================================================== */
.grand-total-hero {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border-radius: 16px;
  margin: 20px 0;
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.25);
}
.gth-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 8px;
}
.gth-value {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.gth-sub {
  font-size: 13px;
  margin-top: 10px;
  opacity: 0.85;
}

.colour-matrix-block {
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.cmb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--info-bg);
  border-bottom: 1px solid var(--line);
}
.cmb-icon { font-size: 20px; }
.cmb-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--link);
  flex: 1;
}
.cmb-total {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
}
.cmb-total b { color: var(--ok-fg); font-size: 15px; }

.num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.size-totals-block {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface-2);
  border-radius: 12px;
}
.size-totals-block h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}
.size-total-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}
.size-total-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stc-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stc-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ok-fg);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .qty-input { width: 48px; padding: 6px 4px; font-size: 12px; }
  .qty-table th, .qty-table td { padding: 5px 4px; font-size: 11px; }
  .gt-value, .gth-value { font-size: 26px; }
}


/* ==========================================================
   COLOUR NAME ROW
   ========================================================== */
.colour-name-row {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 20px;
  padding: 18px;
  background: var(--surface-2);
  border: 2px solid var(--info-line);
  border-radius: 12px;
}

/* ==========================================================
   QUANTITY TABLE — Clean Edit Mode
   ========================================================== */
.qs-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
}

.qty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 700px;
}
.qty-table thead th {
  background: var(--ink);
  color: #fff;
  padding: 12px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}
.qty-table thead th:first-child { text-align: left; padding-left: 18px; }
.qty-table thead th.row-total-col {
  background: var(--ok);
  min-width: 100px;
}

.qty-table tbody tr { border-bottom: 1px solid var(--line); }
.qty-table tbody tr:nth-child(even) { background: var(--surface); }
.qty-table tbody td {
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

.size-name-input {
  font-weight: 700;
  text-align: center !important;
  color: var(--link);
  background: var(--info-bg) !important;
  border-color: var(--info-line) !important;
}

.qty-input {
  width: 68px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.qty-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
  background: var(--surface);
}

.row-total-cell {
  background: var(--ok-bg) !important;
  font-weight: 700;
  color: var(--ok-fg);
  font-size: 15px;
  min-width: 80px;
}

.qty-table tfoot td {
  padding: 14px 12px;
  background: var(--surface-2);
  border-top: 2px solid var(--line);
}
.colour-total-cell {
  background: var(--ok-bg) !important;
  color: var(--ok-fg) !important;
  font-size: 18px !important;
  padding: 14px !important;
  border-radius: 8px;
}

/* ==========================================================
   COLOUR ACTIONS
   ========================================================== */
.colour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ==========================================================
   SAVED COLOURS BLOCK
   ========================================================== */
.saved-colour-block {
  margin-bottom: 20px;
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--info-bg);
  border-bottom: 1px solid var(--line);
}
.scb-icon { font-size: 22px; }
.scb-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--link);
  flex: 1;
  text-transform: capitalize;
}
.scb-total {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface);
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 600;
}
.scb-total b { color: var(--ok-fg); font-size: 16px; }

.saved-colour-block .qty-table thead th {
  background: #475569;
  font-size: 10.5px;
  padding: 8px;
}
.saved-colour-block .qty-table thead th.row-total-col {
  background: var(--ok);
}
.saved-colour-block .qty-table td {
  padding: 8px;
  text-align: center;
  font-size: 12.5px;
}
.saved-colour-block .size-cell {
  background: var(--surface-2);
  text-align: left;
  padding-left: 16px;
  color: var(--link);
  font-weight: 700;
}

/* ==========================================================
   GRAND TOTAL INLINE
   ========================================================== */
.grand-total-inline {
  margin-left: auto;
  padding: 12px 24px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(22,163,74,0.25);
}
.grand-total-inline b {
  font-size: 22px;
  font-weight: 800;
  margin-left: 8px;
}

/* ==========================================================
   TOAST
   ========================================================== */
.beep-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 99999;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  max-width: 420px;
}
.beep-toast.show { transform: translateX(0); }
.beep-toast.success { background: var(--ok); }
.beep-toast.error   { background: var(--bad); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .colour-name-row { flex-direction: column; align-items: stretch; }
  .qty-input { width: 48px; font-size: 12px; padding: 6px 4px; }
  .qty-table { font-size: 11.5px; min-width: 100%; }
  .grand-total-inline { margin-left: 0; margin-top: 10px; width: 100%; text-align: center; }
  .form-head { flex-wrap: wrap; }
}

/* ==========================================================
   LOCATION SECTION (in work view)
   ========================================================== */
.location-section {
  padding: 18px 20px;
  background: var(--warn-bg);
  border: 2px solid var(--warn-line);
  border-radius: 12px;
  margin-bottom: 20px;
}
.location-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--warn-fg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

/* Chips for location/line/box */
.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--info-bg);
  color: var(--link);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.line-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.box-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* SKU full code */
.sku-full-code {
  display: inline-block;
  padding: 5px 12px;
  background: var(--info-bg);
  color: var(--link);
  border: 1px solid var(--info-line);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Saved colour block header SKU */
.scb-sku-code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--link);
  background: var(--info-bg);
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 4px;
}
.scb-location {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

/* OV table row sizing */
.ov-table {
  font-size: 12.5px;
}
.ov-table td {
  vertical-align: middle;
  padding: 10px 12px;
}
.ov-table tr {
  border-bottom: 1px solid var(--line);
}
.ov-table tr:hover {
  background: var(--surface-2);
}


/* Upload zone */
.upload-zone {
  border: 3px dashed var(--line-strong);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--accent);
  background: var(--info-bg);
  transform: scale(1.01);
}
.uz-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.7; }
.uz-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.uz-sub { font-size: 12.5px; color: var(--muted); }
.uz-filename {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ok-fg);
}

/* Format guide */
.file-format-guide {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.file-format-guide h4 {
  font-size: 14px;
  margin-bottom: 14px;
  color: var(--text);
}
.format-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}
.format-table th {
  background: var(--ink);
  color: #fff;
  padding: 10px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
}
.format-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.format-note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
}
.format-note code {
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--link);
}

/* Preview sections */
.preview-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.preview-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}

/* ==========================================================
   PLATFORM CHECKBOX GROUP
   ========================================================== */
.platform-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
  background: var(--surface-2);
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  margin-bottom: 20px;
}

.platform-checkbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.platform-checkbox:hover {
  border-color: var(--pcolor);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.platform-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.platform-checkbox .pc-icon {
  font-size: 22px;
  filter: grayscale(1);
  transition: filter 0.2s;
}
.platform-checkbox .pc-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.platform-checkbox .pc-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
}

/* CHECKED STATE */
.platform-checkbox:has(input:checked) {
  border-color: var(--pcolor);
  background: color-mix(in srgb, var(--pcolor) 8%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pcolor) 15%, transparent);
}
.platform-checkbox:has(input:checked) .pc-icon {
  filter: grayscale(0);
}
.platform-checkbox:has(input:checked) .pc-label {
  color: var(--pcolor);
}
.platform-checkbox:has(input:checked) .pc-check {
  background: var(--pcolor);
  color: #fff;
}

/* Bulk select buttons */
.platform-select-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.platform-select-actions button {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
}
.platform-select-actions button:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--link);
}

.import-platform-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.bulk-platform-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line-strong);
}
.bulk-platform-actions button {
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
}
.bulk-platform-actions button:hover {
  background: var(--info-bg);
  border-color: var(--accent);
  color: var(--link);
}

/* ==========================================================
   PLATFORM CHIPS (List view)
   ========================================================== */
/* ============ PLATFORM CHIPS (VERTICAL STACK) ============ */
.platform-chips {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 34px;
    padding: 2px 0;
}

.platform-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1;
    color: #fff;
    background: var(--pcolor, #64748b);
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.15s ease;
    cursor: default;
}

.platform-chip:hover {
    transform: scale(1.15);
}

/* Table cells — proper vertical alignment */
.sku-table td {
    vertical-align: middle;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Platform column — enough space for 4 stacked icons */
.sku-table td .platform-chips {
    min-height: 30px;
}

/* Continuation rows (2nd, 3rd platform) */
.platform-row-continuation {
    border-top: 1px dashed var(--line);
}

.platform-row-continuation td {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

/* Platform chips column */
.sku-table td[rowspan] {
    vertical-align: middle;
}

/* Remove default hover on continuation rows */
.platform-row-continuation:hover {
    background: inherit;
}

/* Editable qty input */
.qty-input-editable {
    transition: all 0.15s;
}
.qty-input-editable:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    outline: none;
}
.qty-save-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 14px;
}

/* Upload zone (already added earlier) */

/* PDF badge */
.pdf-badge {
    display: inline-block;
    padding: 3px 8px;
    background: var(--bad-bg);
    color: var(--bad-fg);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}


.po-summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.ps-item {
    text-align: center;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 10px;
}
.ps-label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.ps-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.ps-value.green { color: var(--ok-fg); }

@media (max-width: 768px) {
    .po-summary-row { grid-template-columns: repeat(2, 1fr); }
}
