/* ════════════════════════════════════════════
   SMART SHELF — MASTER DATA PLATFORM
   Design System & Styles
   ════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── TOKENS — LIGHT (default) ────────────────── */
:root {
  --bg:              #EFF3FB;
  --surface:         #FFFFFF;
  --surface-el:      #E8EDF8;
  --surface-modal:   #FFFFFF;
  --surface-input:   #F4F6FD;
  --border:          #D8DFF0;
  --border-hover:    #B4BEDD;

  --accent:          #4158E8;
  --accent-dim:      rgba(65,88,232,0.1);
  --accent-hover:    #3349D0;
  --teal:            #00967C;

  --text:            #191E2E;
  --text-sec:        #4A5270;
  --text-muted:      #8D97B4;

  --success:         #1A7A34;
  --warning:         #8C6200;
  --danger:          #C42B20;
  --danger-dim:      rgba(196,43,32,0.09);

  --sidebar-w:       240px;
  --radius:          10px;
  --radius-lg:       14px;
  --shadow:          0 2px 12px rgba(60,80,160,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg:       0 8px 40px rgba(60,80,160,0.14);
  --transition:      0.2s ease;
}

/* ── TOKENS — DARK ───────────────────────────── */
html[data-theme="dark"] {
  --bg:              #0D1117;
  --surface:         #161B22;
  --surface-el:      #21262D;
  --surface-modal:   #1A1F2C;
  --surface-input:   #0D1117;
  --border:          #30363D;
  --border-hover:    #484F58;

  --accent:          #4F6EF7;
  --accent-dim:      rgba(79,110,247,0.15);
  --accent-hover:    #6C87F9;
  --teal:            #00D4AA;

  --text:            #E6EDF3;
  --text-sec:        #8B9BB4;
  --text-muted:      #565E6E;

  --success:         #3FB950;
  --warning:         #D29922;
  --danger:          #F85149;
  --danger-dim:      rgba(248,81,73,0.15);

  --shadow:          0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:       0 12px 48px rgba(0,0,0,0.6);
}


/* ── RESET ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.5;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
img { display: block; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── APP SHELL ───────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff; flex-shrink: 0;
  box-shadow: 0 0 14px rgba(79,110,247,0.35);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 13px; font-weight: 700; color: var(--text); }
.brand-sub  { font-size: 10px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

.sidebar-nav { padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px; font-weight: 500; color: var(--text-sec);
  transition: background var(--transition), color var(--transition);
  width: 100%;
}
.nav-item:hover  { background: var(--surface-el); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item svg    { opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.sidebar-filter {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.filter-label {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 6px;
}
#sidebar-retailer-filters, #sidebar-holding-filters { display: flex; flex-direction: column; gap: 2px; }
.sidebar-r-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-sec);
  transition: background var(--transition), color var(--transition);
  width: 100%; text-align: left;
}
.sidebar-r-btn:hover  { background: var(--surface-el); color: var(--text); }
.sidebar-r-btn.active { background: var(--surface-el); color: var(--text); font-weight: 600; }
.r-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reset-btn-small {
  font-size: 11px; color: var(--text-muted);
  padding: 4px 8px; border-radius: 5px;
  transition: color var(--transition), background var(--transition);
}
.reset-btn-small:hover { color: var(--danger); background: var(--danger-dim); }

.dev-credit {
  display: flex; flex-direction: column; gap: 3px;
  padding-top: 10px; margin-top: 4px;
  border-top: 1px solid var(--border);
}
.dev-credit > span {
  font-size: 9px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.09em;
}
.dev-credit-link {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--text-sec);
  transition: color var(--transition);
  text-decoration: none;
}
.dev-credit-link svg { flex-shrink: 0; transition: color var(--transition); }
.dev-credit-link:hover { color: var(--accent); }
.dev-credit-link:hover svg { color: var(--accent); }

/* ── MAIN CONTENT ────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  position: relative;
}

/* ── VIEWS ───────────────────────────────────── */
.view { display: none; animation: fadeIn 0.25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── VIEW HEADER ─────────────────────────────── */
.view-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
}
.view-title { font-size: 22px; font-weight: 700; color: var(--text); }
.view-sub   { font-size: 13px; color: var(--text-sec); margin-top: 2px; }
.view-actions { display: flex; gap: 10px; }

/* ── STATS BAR ───────────────────────────────── */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-hover); }
.stat-card.accent { border-color: rgba(79,110,247,0.3); }
.stat-card.warn   { border-color: rgba(210,153,34,0.3); }
.stat-v { font-size: 26px; font-weight: 700; }
.stat-l { font-size: 12px; color: var(--text-sec); }
.stat-card.accent .stat-v { color: var(--accent); }
.stat-card.warn   .stat-v { color: var(--warning); }

/* ── FILTERS BAR ─────────────────────────────── */
.filters-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 14px; flex-wrap: wrap;
}
.search-wrap {
  position: relative; flex: 1; min-width: 220px;
}
.search-ico {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); pointer-events: none;
}
.search-inp {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px 9px 36px;
  font-size: 13px; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.search-inp:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.filter-sel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 32px 9px 12px;
  font-size: 13px; color: var(--text);
  outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B9BB4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}
.filter-sel:focus { border-color: var(--accent); }
.btn-clear {
  padding: 9px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-sec);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: color var(--transition), border-color var(--transition);
}
.btn-clear:hover { color: var(--danger); border-color: var(--danger); }
.result-count { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }

/* ── PRODUCT GRID ────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

/* ── STAGGERED ANIMATIONS ────────────────────── */
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.stagger-in {
  animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.stagger-in:nth-child(1) { animation-delay: 0.05s; }
.stagger-in:nth-child(2) { animation-delay: 0.10s; }
.stagger-in:nth-child(3) { animation-delay: 0.15s; }
.stagger-in:nth-child(4) { animation-delay: 0.20s; }
.stagger-in:nth-child(5) { animation-delay: 0.25s; }
.stagger-in:nth-child(6) { animation-delay: 0.30s; }
.stagger-in:nth-child(7) { animation-delay: 0.35s; }
.stagger-in:nth-child(8) { animation-delay: 0.40s; }
.stagger-in:nth-child(9) { animation-delay: 0.45s; }
.stagger-in:nth-child(10) { animation-delay: 0.50s; }
.stagger-in:nth-child(11) { animation-delay: 0.55s; }
.stagger-in:nth-child(12) { animation-delay: 0.60s; }
.stagger-in:nth-child(n+13) { animation-delay: 0.65s; }

/* ── PRODUCT CARD ────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(79,110,247,0.18);
}

.card-img-wrap {
  position: relative;
  height: 160px;
  background: var(--surface-el);
  overflow: hidden;
}
/* Placeholder when no image */
.card-img-wrap:has(.no-img) {
  display: flex; align-items: center; justify-content: center;
}
.card-img.no-img { display: none; }
.card-img-wrap:has(.no-img)::after {
  content: 'SKU';
  font-size: 22px; font-weight: 800; font-family: 'Inter', sans-serif;
  color: var(--accent); opacity: 0.35; letter-spacing: 0.12em;
}
.card-img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
  padding: 8px;
}
.product-card:hover .card-img { transform: scale(1.05); }

.card-badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.r-badges { display: flex; gap: 4px; }
.r-badge {
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.source-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 99px; line-height: 1;
}
.source-badge.off { background: rgba(0,212,170,0.2); color: var(--teal); border: 1px solid var(--teal); }
.source-badge.opf { background: rgba(79,110,247,0.2); color: var(--accent); border: 1px solid var(--accent); }
.source-badge.firebase { background: rgba(255,111,0,0.15); color: #ff6f00; border: 1px solid rgba(255,111,0,0.5); }
.source-badge.excel   { background: rgba(33,150,83,0.15);  color: #21a353; border: 1px solid rgba(33,150,83,0.5); }

.card-body {
  padding: 14px 14px 8px;
  flex: 1; display: flex; flex-direction: column; gap: 4px;
}
.card-brand { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }
.card-name  { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-ean   { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-top: 2px; }

.completeness-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.comp-track { flex: 1; height: 4px; background: var(--surface-el); border-radius: 99px; overflow: hidden; }
.comp-fill  { height: 100%; border-radius: 99px; transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1); background-image: linear-gradient(90deg, rgba(255,255,255,0.1), transparent); }
.comp-label { font-size: 11px; font-weight: 700; min-width: 30px; text-align: right; }

.card-footer {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
}
.btn-card-cta {
  width: 100%; padding: 7px 12px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--accent-dim); border-radius: 7px;
  background: var(--accent-dim);
  transition: background var(--transition), border-color var(--transition);
}
.btn-card-cta:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center; padding: 80px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-icon { font-size: 52px; }
.empty-state h3 { font-size: 18px; font-weight: 700; }
.empty-state p  { font-size: 14px; color: var(--text-sec); max-width: 320px; }

/* ── BUTTONS ─────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff;
  border-radius: 8px; padding: 9px 18px;
  font-size: 13px; font-weight: 600;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  border: none;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(79,110,247,0.35);
  transform: translateY(-1px);
}
.btn-outline {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; color: var(--text-sec);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  transition: border-color var(--transition), color var(--transition);
}
.btn-outline:hover { border-color: var(--text-sec); color: var(--text); }
.full-w { width: 100%; justify-content: center; margin-top: 12px; }
.icon-btn {
  padding: 6px; border-radius: 6px; color: var(--text-sec);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface-el); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-dim); color: var(--danger); }
.link-button {
  padding: 0; border: 0; background: transparent;
  color: var(--accent); font: inherit; font-weight: 500;
  cursor: pointer; text-align: left;
}
.link-button:hover { text-decoration: underline; }

/* ── FORM ELEMENTS ───────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.05em; }
.form-input, .form-select {
  background: var(--surface-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder { color: var(--text-muted); }
.readonly-inp { color: var(--text-sec); cursor: default; }
.readonly-inp:focus { border-color: var(--border); box-shadow: none; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B9BB4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.section-lbl {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px;
}

/* ── TOGGLE SWITCH ───────────────────────────── */
.toggle-switch {
  width: 44px; height: 24px;
  background: var(--surface-el);
  border-radius: 99px;
  position: relative; cursor: pointer;
  transition: background 0.25s ease;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.toggle-switch.on { background: var(--accent); border-color: var(--accent); }
.toggle-knob {
  position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle-switch.on .toggle-knob { transform: translateX(20px); }
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row span { font-size: 13px; color: var(--text-sec); }

/* ════════════════════════════════════════════
   TECHNICAL SHEET MODAL
   ════════════════════════════════════════════ */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.28s ease;
  padding: 20px;
}
.sheet-overlay.hidden  { display: none; }
.sheet-overlay.visible { opacity: 1; }

.sheet-modal {
  background: var(--surface-modal);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%; max-width: 1120px;
  height: min(94vh, 900px);
  max-height: 94vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.28s ease;
}
.sheet-overlay.visible .sheet-modal { transform: translateY(0) scale(1); }
.sheet-modal > #sheet-content { height: 100%; min-height: 0; }

.sheet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  height: 100%;
  min-height: 0;
}

/* Left panel */
.sheet-left {
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 18px;
}

.sheet-hdr {
  display: flex; align-items: center; justify-content: space-between;
}
.sheet-hdr-left { display: flex; align-items: center; gap: 10px; }

.badge-master {
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(79,110,247,0.3);
  border-radius: 5px; font-size: 10px; font-weight: 700;
  padding: 3px 7px; letter-spacing: 0.08em;
}
.btn-sync {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-sec);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 10px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.btn-sync:hover { color: var(--teal); border-color: var(--teal); background: rgba(0,212,170,0.07); }
.btn-sync svg { transition: transform 0.5s ease; }
.btn-sync.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-close-sheet {
  color: var(--text-muted); border-radius: 6px; padding: 5px;
  transition: color var(--transition), background var(--transition);
}
.btn-close-sheet:hover { color: var(--text); background: var(--surface-el); }

.sheet-title-inp {
  width: 100%; font-size: 20px; font-weight: 700; color: var(--text);
  background: transparent; border: 1px solid transparent;
  border-radius: 7px; padding: 6px 8px; outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.sheet-title-inp:hover { border-color: var(--border); background: var(--surface-input); }
.sheet-title-inp:focus { border-color: var(--accent); background: var(--surface-input); box-shadow: 0 0 0 3px var(--accent-dim); }

.sheet-body-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start;
}
.sheet-img-col { display: flex; flex-direction: column; gap: 8px; }
.sheet-img-wrap {
  width: 180px; height: 180px;
  background: var(--surface-el); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.sheet-img-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.btn-change-img {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 180px; padding: 7px 12px;
  font-size: 12px; color: var(--text-sec);
  border: 1px dashed var(--border); border-radius: 7px;
  transition: color var(--transition), border-color var(--transition);
}
.btn-change-img:hover { color: var(--accent); border-color: var(--accent); }

.sheet-core-col { display: flex; flex-direction: column; gap: 12px; }

.sheet-dims { display: flex; flex-direction: column; gap: 10px; }
.dims-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.sheet-meta-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 4px; border-top: 1px solid var(--border);
}
.meta-chip {
  font-size: 11px; color: var(--text-sec);
  background: var(--surface-el); border-radius: 5px;
  padding: 4px 8px;
}

/* Right panel */
.sheet-right {
  display: flex; flex-direction: column;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  background: var(--surface);
}
.retailer-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px;
}
.r-tab {
  padding: 7px 14px; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: var(--text-sec);
  border: 1px solid var(--border); background: transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  position: relative;
}
.r-tab:hover { background: var(--surface-el); color: var(--text); }
.r-tab.active { background: var(--surface-el); font-weight: 700; }
.r-tab-dot {
  position: absolute; top: -3px; right: -3px;
  width: 14px; height: 14px;
  background: var(--accent); color: #fff;
  border-radius: 50%; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.retailer-form-area { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.readonly-date {
  font-size: 13px; color: var(--text-sec);
  background: var(--surface-el); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px;
}
.btn-danger-sm {
  font-size: 12px; color: var(--danger); background: var(--danger-dim);
  border: 1px solid rgba(248,81,73,0.3); border-radius: 6px;
  padding: 6px 12px; margin-top: 8px; align-self: flex-start;
  transition: background var(--transition);
}
.btn-danger-sm:hover { background: rgba(248,81,73,0.25); }

.retailer-empty-area {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px;
}
.retailer-empty-icon svg { opacity: 0.5; }
.retailer-empty-area p { font-size: 13px; color: var(--text-sec); }

.sheet-footer {
  margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; bottom: -20px; z-index: 2;
  background: var(--surface);
  padding-bottom: 20px;
}
.btn-save {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 8px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  width: 100%;
}
.btn-save:hover   { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(79,110,247,0.35); transform: translateY(-1px); }
.btn-save.has-changes { animation: pulse-btn 2s ease infinite; }
@keyframes pulse-btn {
  0%,100% { box-shadow: 0 0 0 0 rgba(79,110,247,0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(79,110,247,0); }
}
.btn-discard {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px; width: 100%;
  background: var(--surface-el); color: var(--text-sec);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--border);
  transition: color var(--transition), border-color var(--transition);
}
.btn-discard:hover { color: var(--danger); border-color: var(--danger); }
.btn-teal {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(0,212,170,0.12); color: var(--teal);
  border: 1px solid rgba(0,212,170,0.3); border-radius: 8px;
  padding: 9px 18px; font-size: 13px; font-weight: 600;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn-teal:hover:not(:disabled) { background: rgba(0,212,170,0.22); border-color: var(--teal); box-shadow: 0 4px 14px rgba(0,212,170,0.2); }
.btn-teal:disabled { opacity: 0.6; cursor: not-allowed; }
.spin-ico { display: inline-block; animation: spin 0.8s linear infinite; }

/* ════════════════════════════════════════════
   RETAILERS VIEW
   ════════════════════════════════════════════ */
.retailers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.retailer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color var(--transition);
}
.retailer-card:hover { border-color: var(--border-hover); }
.retailer-card-header { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.retailer-logo-circle {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; flex-shrink: 0;
}
.retailer-card-info { flex: 1; }
.retailer-card-info h3 { font-size: 16px; font-weight: 700; }
.retailer-id-badge { font-size: 11px; color: var(--text-muted); }
.retailer-card-actions { display: flex; gap: 4px; margin-left: auto; }
.retailer-card-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.rstat { display: flex; flex-direction: column; }
.rstat-v { font-size: 20px; font-weight: 700; }
.rstat-l { font-size: 11px; color: var(--text-sec); }
.retailer-comp-bar-track { height: 4px; background: var(--surface-el); border-radius: 99px; overflow: hidden; }
.retailer-comp-bar-fill  { height: 100%; border-radius: 99px; }

.retailer-add-card {
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; min-height: 200px;
  transition: border-color var(--transition), background var(--transition);
}
.retailer-add-card:hover { border-color: var(--accent); background: var(--accent-dim); }
.add-card-inner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.retailer-add-card:hover .add-card-inner { color: var(--accent); }
.add-card-inner p { font-size: 13px; font-weight: 500; }

/* Retailer form overlay */
.form-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(12px);
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.25s ease;
}
.form-overlay.hidden  { display: none; }
.form-overlay.visible { opacity: 1; }
.retailer-form-modal {
  background: var(--surface-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 420px; padding: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.form-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.form-modal-header h2 { font-size: 16px; font-weight: 700; }
.btn-close-sm {
  color: var(--text-muted); padding: 4px; border-radius: 5px;
  transition: color var(--transition), background var(--transition);
}
.btn-close-sm:hover { color: var(--text); background: var(--surface-el); }
.form-modal-body   { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.form-modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

.color-pick-row { display: flex; align-items: center; gap: 10px; }
.color-picker   { width: 44px; height: 36px; border-radius: 7px; border: 1px solid var(--border); background: none; cursor: pointer; padding: 2px; }

/* ════════════════════════════════════════════
   IMPORT WIZARD
   ════════════════════════════════════════════ */
.step-bar {
  display: flex; align-items: center; margin-bottom: 24px;
}
.step-item { display: flex; align-items: center; gap: 8px; }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface-el); color: var(--text-muted);
  border: 2px solid var(--border);
  transition: all var(--transition);
}
.step-item.active .step-circle { background: var(--accent); color: #fff; border-color: var(--accent); }
.step-item.done   .step-circle { background: var(--success); color: #fff; border-color: var(--success); }
.step-label { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.step-item.active .step-label { color: var(--text); }
.step-item.done   .step-label { color: var(--text-sec); }
.step-line {
  flex: 1; height: 2px; background: var(--border); mx: 8px;
  margin: 0 8px; min-width: 20px;
  transition: background var(--transition);
}
.step-line.done { background: var(--success); }

.import-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent); background: var(--accent-dim);
}
.drop-zone.loading { opacity: 0.6; pointer-events: none; }
.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.drop-icon  { color: var(--text-muted); margin-bottom: 4px; }
.drop-inner h3 { font-size: 18px; font-weight: 700; }
.drop-inner p  { font-size: 14px; color: var(--text-sec); }
.drop-hint { font-size: 12px; color: var(--text-muted); }
.file-error { margin-top: 12px; padding: 10px 14px; background: var(--danger-dim); color: var(--danger); border-radius: 7px; font-size: 13px; }
.file-error.hidden { display: none; }

/* Column mapping */
.map-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.map-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; margin-bottom: 16px; color: var(--text);
}
.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.map-label { font-size: 12px; color: var(--text-sec); font-weight: 500; }
.map-label.required::after { content: ' *'; color: var(--danger); }
.map-sel { font-size: 12px; }

.enrich-toggle-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface-el); border: 1px solid var(--border); margin-top: 8px;
}
.enrich-label { font-size: 13px; font-weight: 600; }

/* Preview table */
.preview-header { margin-bottom: 16px; }
.preview-header h3 { font-size: 16px; font-weight: 700; }
.preview-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 12px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview-table th {
  background: var(--surface-el); padding: 9px 12px;
  text-align: left; font-weight: 600; color: var(--text-sec);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.preview-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-sec); }
.preview-table tbody tr:last-child td { border-bottom: none; }
.preview-table tbody tr.row-new:hover    { background: rgba(63,185,80,0.05); }
.preview-table tbody tr.row-update:hover { background: rgba(210,153,34,0.05); }
.mono { font-variant-numeric: tabular-nums; font-family: monospace; font-size: 12px; color: var(--text); }
.status-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
}
.status-badge.new    { background: rgba(63,185,80,0.15); color: var(--success); }
.status-badge.update { background: rgba(210,153,34,0.15); color: var(--warning); }
.preview-more { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* Import progress */
.import-progress {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.import-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
.import-progress h3 { font-size: 18px; font-weight: 700; }
.progress-bar-track { width: 100%; max-width: 400px; height: 8px; background: var(--surface-el); border-radius: 99px; overflow: hidden; }
.progress-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 99px; transition: width 0.4s ease; }
.import-detail { font-size: 13px; color: var(--text-sec); font-variant-numeric: tabular-nums; }
.import-done { display: flex; gap: 10px; margin-top: 8px; }

.import-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}

/* ── Detection summary ────────────────────────── */
.detect-summary { background: var(--surface-el); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.detect-summary-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detect-summary-header strong { font-size: 13px; }
.detect-count { font-size: 12px; color: var(--text-sec); }
.detect-pct-bar { flex: 1; height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; min-width: 80px; }
.detect-pct-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 99px; }
.detect-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.detect-chip { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.detect-chip.ok       { background: rgba(63,185,80,0.12);  color: var(--success); border: 1px solid rgba(63,185,80,0.3); }
.detect-chip.none     { background: var(--surface);        color: var(--text-muted); border: 1px solid var(--border); }
.detect-chip.required { background: rgba(248,81,73,0.12); color: var(--danger); border: 1px solid rgba(248,81,73,0.3); }
.detect-warn { font-size: 12px; color: var(--warning); margin-top: 2px; }
.map-sel-wrap { position: relative; display: flex; align-items: center; gap: 6px; }
.map-sel-wrap .form-select { flex: 1; }
.auto-badge { font-size: 9px; font-weight: 800; color: var(--teal); background: rgba(0,212,170,0.12); border: 1px solid rgba(0,212,170,0.3); border-radius: 4px; padding: 2px 5px; white-space: nowrap; flex-shrink: 0; }
.columns-detail { margin-top: 16px; font-size: 12px; color: var(--text-sec); }
.columns-detail summary { cursor: pointer; padding: 4px 0; }
.columns-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.col-chip { background: var(--surface-el); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; font-size: 11px; color: var(--text-sec); }

/* ── Preview summary bar ──────────────────────── */
.preview-summary-bar { display: flex; align-items: center; background: var(--surface-el); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; margin-bottom: 16px; }
.psb-stat { display: flex; flex-direction: column; align-items: center; flex: 1; }
.psb-v { font-size: 26px; font-weight: 800; }
.psb-v.new { color: var(--success); } .psb-v.warn { color: var(--warning); } .psb-v.ok { color: var(--success); }
.psb-l { font-size: 11px; color: var(--text-sec); }
.psb-divider { width: 1px; height: 40px; background: var(--border); margin: 0 8px; }

/* ── Conflict panel ───────────────────────────── */
.conflict-panel { background: rgba(210,153,34,0.06); border: 1px solid rgba(210,153,34,0.3); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.conflict-panel-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--warning); }
.conflict-panel-header svg { flex-shrink: 0; }
.conflict-eans { font-size: 11px; color: var(--text-muted); font-family: monospace; margin-left: auto; }
.conflict-question { font-size: 13px; color: var(--text-sec); font-weight: 500; }
.mode-btns { display: flex; flex-direction: column; gap: 8px; }
.mode-btn { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 8px; text-align: left; width: 100%; background: var(--surface); border: 1px solid var(--border); transition: border-color var(--transition), background var(--transition); }
.mode-btn:hover  { border-color: var(--border-hover); }
.mode-btn.active { border-color: var(--accent); background: var(--accent-dim); }
.mode-btn strong { font-size: 13px; display: block; margin-bottom: 2px; }
.mode-btn p      { font-size: 11px; color: var(--text-sec); margin: 0; }
.mode-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 1px; border: 2px solid var(--border); background: transparent; transition: border-color var(--transition), background var(--transition); }
.mode-dot.on { border-color: var(--accent); background: var(--accent); }
.row-num { color: var(--text-muted); font-size: 11px; }
.row-conflict td { background: rgba(210,153,34,0.04); }
.row-conflict:hover td { background: rgba(210,153,34,0.09) !important; }
.status-badge.conflict { background: rgba(210,153,34,0.15); color: var(--warning); }
.status-badge.skip     { background: var(--surface-el); color: var(--text-muted); }
.btn-mini { font-size: 11px; font-weight: 600; color: var(--accent); padding: 3px 8px; border-radius: 5px; background: var(--accent-dim); transition: background var(--transition); white-space: nowrap; }
.btn-mini:hover { background: var(--accent); color: #fff; }

/* ── Results step 5 ───────────────────────────── */
.results-header { text-align: center; padding: 24px 0 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.results-icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(63,185,80,0.15); border: 2px solid var(--success); color: var(--success); font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.results-header h2 { font-size: 22px; font-weight: 700; }
.results-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.rstat-big { background: var(--surface-el); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.rstat-big-v { font-size: 32px; font-weight: 800; }
.rstat-big-l { font-size: 12px; color: var(--text-sec); }
.rstat-big.new    { border-color: rgba(63,185,80,0.3); }
.rstat-big.new    .rstat-big-v { color: var(--success); }
.rstat-big.update { border-color: rgba(79,110,247,0.3); }
.rstat-big.update .rstat-big-v { color: var(--accent); }
.rstat-big.skip   .rstat-big-v { color: var(--text-muted); }
.conflict-log { margin: 16px 0; }
.conflict-log-title { font-size: 13px; font-weight: 600; color: var(--text-sec); margin-bottom: 10px; }
.results-actions { display: flex; gap: 10px; justify-content: center; padding-top: 16px; border-top: 1px solid var(--border); }


/* ════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--text);
  background: var(--surface-el); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 360px;
}
.toast.visible { opacity: 1; transform: translateX(0); }
.toast-icon { font-size: 14px; flex-shrink: 0; }
.toast-success { border-color: var(--success); --toast-icon: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-error   { border-color: var(--danger); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-info    .toast-icon { color: var(--accent); }
.toast-warning .toast-icon { color: var(--warning); }

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 900px) {
  .sheet-modal { overflow-y: auto; }
  .sheet-modal > #sheet-content { height: auto; }
  .sheet-layout { grid-template-columns: 1fr; height: auto; }
  .sheet-left, .sheet-right { overflow: visible; }
  .sheet-footer { position: static; padding-bottom: 0; }
  .sheet-right  { border-top: 1px solid var(--border); border-right: none; }
  .map-layout   { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --sidebar-w: 56px; }
  .brand-text, .nav-item span, .sidebar-filter { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { padding: 16px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .sheet-body-row { grid-template-columns: 1fr; }
  .sheet-img-wrap, .btn-change-img { width: 100%; }
}

/* ════════════════════════════════════════════
   BULK EDIT
   ════════════════════════════════════════════ */
.bulk-hint {
  font-size: 12px; color: var(--accent); margin-bottom: 14px;
  padding: 8px 12px; background: var(--accent-dim); border-radius: 6px;
  border: 1px solid rgba(79,110,247,0.2);
}

/* Card in select mode */
.product-card.selectable { cursor: pointer; }
.product-card.selectable:hover { border-color: var(--accent); }
.product-card.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent), 0 8px 24px rgba(79,110,247,0.2);
}
.card-checkbox {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-el); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.card-checkbox.checked { background: var(--accent); border-color: var(--accent); }

/* Sticky bulk bar */
.bulk-bar {
  position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
  background: var(--surface-modal);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  z-index: 800;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bulk-bar-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.bulk-count { font-size: 13px; font-weight: 700; color: var(--accent); }
.bulk-sel-all { font-size: 12px; color: var(--text-sec); text-decoration: underline; text-decoration-color: transparent; transition: color var(--transition), text-decoration-color var(--transition); }
.bulk-sel-all:hover { color: var(--text); text-decoration-color: var(--text-sec); }
.bulk-bar-mid { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.bulk-field-sel { max-width: 220px; }
.bulk-value-inp { max-width: 180px; padding: 7px 10px; font-size: 12px; }
.bulk-close { font-size: 13px; color: var(--text-muted); padding: 6px 10px; border-radius: 6px; transition: color var(--transition), background var(--transition); flex-shrink: 0; }
.bulk-close:hover { color: var(--danger); background: var(--danger-dim); }

/* Bottom padding when bulk bar is showing */
.view.active:has(+ * .bulk-bar) { padding-bottom: 80px; }

/* ════════════════════════════════════════════
   RETAILER CATEGORY MANAGER
   ════════════════════════════════════════════ */
.cats-empty { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* Retailer card categories preview */
.retailer-cats-preview { border-top: 1px solid var(--border); padding: 14px 18px 18px 18px; margin-top: -6px; }
.retailer-cats-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.retailer-cats-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rcat-chip { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--surface-el); color: var(--text-sec); border: 1px solid var(--border); }
.rcat-chip.muted { color: var(--text-muted); }

/* Apply padding adjustments to body elements inside card */
.retailer-card-stats { display: flex; gap: 20px; padding: 0 18px; }
.retailer-comp-bar-track { width: 100%; height: 6px; background: var(--surface-el); border-radius: 3px; overflow: hidden; margin: 0 18px; max-width: calc(100% - 36px); }


/* btn-outline active state (bulk edit toggle) */
.btn-outline.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  margin-top: 28px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.pg-info { font-size: 12px; color: var(--text-sec); }
.pg-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-sec);
  border: 1px solid var(--border); background: var(--surface);
  transition: all var(--transition);
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pg-nums { display: flex; align-items: center; gap: 3px; margin: 0 6px; }
.pg-num {
  min-width: 32px; height: 32px; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-sec);
  border: 1px solid transparent; background: transparent;
  transition: all var(--transition);
}
.pg-num:hover  { background: var(--surface-el); color: var(--text); }
.pg-num.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pg-ellipsis   { font-size: 13px; color: var(--text-muted); padding: 0 4px; }

/* ════════════════════════════════════════════
   LIST VIEW
   ════════════════════════════════════════════ */
.view-toggle-btns { display: flex; gap: 2px; background: var(--surface-el); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.view-toggle-btn { padding: 5px 9px; border-radius: 6px; color: var(--text-muted); transition: background var(--transition), color var(--transition); }
.view-toggle-btn:hover  { color: var(--text); }
.view-toggle-btn.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.product-list { display: flex; flex-direction: column; gap: 6px; }
.product-list-row {
  display: grid;
  grid-template-columns: 56px 130px 1fr 140px 80px 140px 120px;
  align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.product-list-row:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateX(3px); }
.product-list-row.selectable:hover { border-color: var(--accent); }
.product-list-row.selected { border-color: var(--accent); background: var(--accent-dim); }

.product-list-header {
  display: grid;
  grid-template-columns: 56px 130px 1fr 140px 80px 140px 120px;
  gap: 14px; padding: 6px 14px;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px;
}
.pl-img { width: 48px; height: 48px; border-radius: 7px; background: var(--surface-el); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.pl-img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pl-img:has(.no-img)::after, .pl-img:not(:has(img[src]))::after { content: 'SKU'; font-size: 10px; font-weight: 800; color: var(--accent); opacity: 0.4; }
.pl-ean { font-family: monospace; font-size: 12px; color: var(--text-sec); }
.pl-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.pl-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-brand { font-size: 11px; color: var(--text-muted); }
.pl-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.pl-comp { display: flex; flex-direction: column; gap: 4px; }
.pl-comp-bar { height: 4px; background: var(--surface-el); border-radius: 99px; overflow: hidden; }
.pl-comp-fill { height: 100%; border-radius: 99px; }
.pl-comp-lbl { font-size: 11px; font-weight: 700; }
.pl-actions { display: flex; justify-content: flex-end; }
.pl-checkbox {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-el); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.pl-checkbox.checked { background: var(--accent); border-color: var(--accent); }

/* ════════════════════════════════════════════
   THEME TOGGLE
   ════════════════════════════════════════════ */
.theme-toggle-btn {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 7px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.theme-toggle-btn:hover { background: var(--surface-el); color: var(--text); }
.theme-icon { font-size: 14px; }

/* Light mode specific refinements */
:root .sidebar {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F8FF 100%);
  border-right-color: var(--border);
}
:root .brand-icon { box-shadow: 0 0 20px rgba(65,88,232,0.25); }
:root .product-card:hover { box-shadow: 0 8px 28px rgba(65,88,232,0.14); }
:root .stat-card { box-shadow: var(--shadow); }
:root .import-card { box-shadow: var(--shadow); }
html[data-theme="dark"] .sidebar { background: var(--surface); }

/* ═══════════════════════════════════════════
   STATUS PILLS
   ═══════════════════════════════════════════ */
.status-pill {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 20px; border: 1px solid transparent; white-space: nowrap;
}

/* ═══════════════════════════════════════════
   SORT BAR + QUICK FILTER PILLS
   ═══════════════════════════════════════════ */
.sort-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 10px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.sort-btns  { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sort-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-right: 4px; }
.sort-btn {
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
  color: var(--text-sec); border: 1px solid transparent; transition: all var(--transition);
}
.sort-btn:hover  { background: var(--surface-el); color: var(--text); }
.sort-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

.status-filter-pills { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.spill {
  padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  color: var(--text-sec); border: 1px solid var(--border); background: var(--surface);
  transition: all var(--transition); cursor: pointer;
}
.spill:hover  { border-color: var(--accent); color: var(--accent); }
.spill.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ═══════════════════════════════════════════
   UNDO FLOAT BUTTON
   ═══════════════════════════════════════════ */
.undo-float-btn {
  position: fixed; bottom: 88px; right: 24px; z-index: 9000;
  display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 30px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  font-size: 13px; font-weight: 700; color: var(--text);
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.undo-float-btn.visible { transform: translateY(0); opacity: 1; pointer-events: all; }
.undo-float-btn:hover   { border-color: var(--accent); color: var(--accent); }
.undo-time { font-size: 10px; font-weight: 400; color: var(--text-muted); }

/* ═══════════════════════════════════════════
   SIDEBAR BACKUP BUTTONS
   ═══════════════════════════════════════════ */
.sidebar-backup-btns {
  display: flex; gap: 4px; padding-bottom: 8px;
  margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.sidebar-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 8px; border-radius: 7px; font-size: 11px; font-weight: 600;
  color: var(--text-sec); border: 1px solid var(--border); background: var(--surface);
  transition: all var(--transition);
}
.sidebar-action-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ═══════════════════════════════════════════
   BULK DELETE DANGER BUTTON
   ═══════════════════════════════════════════ */
.btn-danger-sm {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 7px; font-size: 12px; font-weight: 600;
  color: var(--danger); border: 1px solid var(--danger); background: transparent;
  transition: all var(--transition);
}
.btn-danger-sm:hover { background: rgba(196,43,32,0.08); }

/* ═══════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════ */
@media print {
  .sidebar, .view-header, .bulk-bar, .pagination,
  .undo-float-btn, #toast-container, .sort-filter-bar,
  .stats-bar, .filters-bar, .sheet-header-actions,
  .btn-primary, .btn-outline, .btn-teal { display: none !important; }
  body, .app-layout, .main-content          { background: white !important; }
  .sheet-modal { position: static !important; width: 100% !important; height: auto !important; box-shadow: none !important; }
  .sheet-body  { grid-template-columns: 180px 1fr 1fr !important; }
  * { color: #111 !important; }
}

/* ═══════════════════════════════════════════
   EXPORT DROPDOWN MENU
   ═══════════════════════════════════════════ */
.export-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 200px;
  display: none;
  flex-direction: column;
  padding: 6px 0;
  animation: dropdownFadeIn 0.15s ease-out;
}
.export-dropdown-menu.show {
  display: flex;
}
.export-dropdown-item {
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.export-dropdown-item:hover {
  background: var(--surface-el);
  color: var(--accent);
}
.export-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.export-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   PHYSICAL STORES & PLANOGRAMS Refinements
   ═══════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.store-form-card {
  background: var(--surface-el);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}



.detect-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  margin: 4px;
  border: 1px solid transparent;
}
.detect-chip.ok {
  background: rgba(26, 122, 52, 0.1);
  color: var(--success);
  border-color: rgba(26, 122, 52, 0.2);
}
.detect-chip.required {
  background: rgba(196, 43, 32, 0.1);
  color: var(--danger);
  border-color: rgba(196, 43, 32, 0.2);
}
.detect-chip.none {
  background: var(--surface-el);
  color: var(--text-muted);
  border-color: var(--border);
}

.detect-summary {
  background: var(--surface-el);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.detect-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.detect-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.detect-summary-left svg {
  color: var(--accent);
}
.detect-count {
  font-size: 12px;
  color: var(--text-sec);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 8px;
  border-radius: 99px;
}
html[data-theme="dark"] .detect-count {
  background: rgba(255, 255, 255, 0.05);
}
.detect-pct-bar {
  width: 120px;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.detect-pct-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.detect-chips {
  display: flex;
  flex-wrap: wrap;
  margin: -4px;
}
.detect-warn {
  font-size: 12px;
  color: var(--warning);
  margin-top: 10px;
  font-weight: 500;
}

/* ── ENRICHMENT BADGE (Technical Sheet) ─────── */
.enrich-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid transparent;
}
.enrich-badge.found {
  background: rgba(26,122,52,0.1);
  color: var(--success);
  border-color: rgba(26,122,52,0.25);
}
html[data-theme="dark"] .enrich-badge.found {
  background: rgba(63,185,80,0.12);
  color: #3fb950;
  border-color: rgba(63,185,80,0.3);
}
.enrich-badge.not-found {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(196,43,32,0.25);
}
.enrich-badge.pending {
  background: var(--surface-el);
  color: var(--text-muted);
  border-color: var(--border);
}

/* ── ENRICH RESULTS PANEL (Import Step 5) ───── */
.enrich-results-panel {
  background: var(--surface-el);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.enrich-results-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-sec);
  margin-bottom: 8px;
}
.enrich-log-detail {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 180px; overflow-y: auto;
  padding: 8px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.enrich-log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 3px 6px; border-radius: 4px;
  font-size: 11px; font-family: monospace;
}
.enrich-log-row.found {
  background: rgba(26,122,52,0.07);
  color: var(--success);
}
.enrich-log-row.not_found {
  color: var(--text-muted);
}
.enrich-log-row .mono {
  min-width: 110px;
  opacity: 0.7;
}

/* ── ACCENT BORDER TOKEN ─────────────────────── */
:root {
  --accent-border: rgba(65,88,232,0.3);
}
html[data-theme="dark"] {
  --accent-border: rgba(79,110,247,0.35);
}

/* ════════════════════════════════════════════
   BULK EDIT VIEW
   ════════════════════════════════════════════ */
.bulk-layout {
  display: flex; gap: 20px; align-items: flex-start;
  height: calc(100vh - 120px);
}

.bulk-main {
  flex: 1; display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 100%; overflow: hidden;
}

.bulk-filters {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}

.bulk-quick-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.bulk-qf-btn {
  padding: 6px 12px; border-radius: 99px;
  font-size: 11px; font-weight: 600; color: var(--text-sec);
  border: 1px solid var(--border); background: var(--surface-el);
  transition: all var(--transition);
}
.bulk-qf-btn:hover { background: var(--border-hover); color: var(--text); }
.bulk-qf-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.bulk-search { width: 260px; }

.bulk-table-container {
  flex: 1; overflow: auto;
  position: relative;
}

.bulk-table {
  width: 100%; border-collapse: collapse; text-align: left;
}
.bulk-table th {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface-el); color: var(--text-sec);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.bulk-table td {
  padding: 6px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle; font-size: 13px;
}
.bulk-table tr:hover td { background: var(--surface-input); }
.bulk-table tr.selected td { background: var(--accent-dim); }

.bulk-img-cell {
  width: 40px; height: 40px; border-radius: 6px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  background-color: var(--surface-el); border: 1px solid var(--border);
}

.td-ean { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 11px; }

.bulk-inline-inp, .bulk-inline-sel {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 4px 6px; border-radius: 4px; color: var(--text); font-size: 13px;
  transition: all 0.15s; outline: none;
}
.bulk-inline-inp:hover, .bulk-inline-sel:hover { border-color: var(--border-hover); background: var(--surface-el); }
.bulk-inline-inp:focus, .bulk-inline-sel:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 2px var(--accent-dim); }

.bulk-score-bar {
  width: 100%; height: 6px; border-radius: 99px; background: var(--surface-el); overflow: hidden;
}
.bulk-score-fill { height: 100%; border-radius: 99px; }

.bulk-side-panel {
  width: 320px; flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  height: 100%; overflow-y: auto;
}

.bulk-panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.bulk-panel-header h3 { font-size: 15px; font-weight: 700; }
.bulk-sel-count { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-dim); padding: 4px 8px; border-radius: 6px; }

.bulk-panel-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bulk-panel-body h4 { font-size: 13px; font-weight: 700; color: var(--text); }
.bulk-hint { font-size: 12px; color: var(--text-sec); line-height: 1.4; }

/* Bulk Selection Banner */
.bulk-select-banner {
  background: var(--accent-dim, rgba(66, 133, 244, 0.12));
  border-bottom: 1px solid var(--accent, #4285f4);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bulk-select-banner-text { font-weight: 500; }
.bulk-select-banner-action {
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
}
.bulk-select-banner-action:hover { opacity: 0.8; }

/* Bulk Safety Modal */
.bulk-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease-out;
}

.bulk-safety-card {
  background: var(--surface, #1e1e1e);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}

.bulk-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bulk-modal-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
}

.bulk-diff-preview {
  background: var(--surface-el, #252525);
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 8px;
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
}

.bulk-diff-item {
  padding: 6px 8px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bulk-diff-item:last-child { border-bottom: none; }
.bulk-diff-ean { font-weight: 700; color: var(--text-muted); font-size: 11px; }
.bulk-diff-change { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bulk-diff-old { text-decoration: line-through; color: var(--danger, #f44336); opacity: 0.8; }
.bulk-diff-arrow { color: var(--text-muted); }
.bulk-diff-new { color: var(--success, #4caf50); font-weight: 600; }

.bulk-confirm-input-wrap {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--danger);
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
}
.bulk-confirm-input-label { font-weight: 600; color: var(--danger); margin-bottom: 6px; display: block; }

.bulk-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-el);
}

/* Panel Sections & Accordion */
.bulk-accordion-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--surface-el);
}
.bulk-accordion-header {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background: var(--surface);
}
.bulk-accordion-header:hover { background: var(--surface-input); }
.bulk-accordion-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.bulk-accordion-item:not(.open) .bulk-accordion-body {
  display: none;
}

.pagination {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.page-info { font-size: 12px; color: var(--text-muted); }
.page-controls { display: flex; gap: 8px; }
.page-btn {
  padding: 6px 12px; font-size: 12px; font-weight: 600; border-radius: 6px;
  background: var(--surface-el); color: var(--text-sec); border: 1px solid var(--border);
}
.page-btn:hover:not(:disabled) { background: var(--border-hover); color: var(--text); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ════════════════════════════════════════════
   NAVIGATION SECTION LABELS & DIVIDERS
   ════════════════════════════════════════════ */
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}
.nav-section-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 4px 20px 6px;
  opacity: 0.7;
}

/* ════════════════════════════════════════════
   VISPERA CATEGORY BADGES
   ════════════════════════════════════════════ */
.vispera-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: color-mix(in srgb, var(--cat-color, #888) 15%, transparent);
  color: var(--cat-color, #888);
  border: 1px solid color-mix(in srgb, var(--cat-color, #888) 30%, transparent);
  white-space: nowrap;
}

/* ════════════════════════════════════════════
   HOLDING BADGES
   ════════════════════════════════════════════ */
.holding-badge-sm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(65,88,232,0.2);
}

/* ════════════════════════════════════════════
   CONFIDENCE BADGES
   ════════════════════════════════════════════ */
.confidence-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  border: 1px solid;
}

/* ════════════════════════════════════════════
   LEVANTAMIENTO VIEW
   ════════════════════════════════════════════ */
.levantamiento-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .levantamiento-layout { grid-template-columns: 1fr; }
}

.lev-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.lev-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.lev-panel-header h3 { margin: 0 0 4px 0; font-size: 15px; font-weight: 700; }
.lev-panel-sub { font-size: 12px; color: var(--text-muted); margin: 0; }

.lev-form { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.lev-form .form-row { display: flex; gap: 12px; }

.lev-raw-table-wrap {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

/* ════════════════════════════════════════════
   PIPELINE VISUAL (4-step flow)
   ════════════════════════════════════════════ */
.pipeline-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.pipeline-visual h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.pipeline-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
}
.pipeline-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface-el);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 180px;
  transition: all var(--transition);
}
.pipeline-step:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.pipeline-step.step-review {
  border-color: var(--teal);
  background: rgba(0,150,124,0.06);
}
.pipeline-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.step-review .pipeline-step-number { background: var(--teal); }
.pipeline-step-content h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.pipeline-step-content p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: var(--text-muted);
}
.pipeline-arrow {
  font-size: 24px;
  font-weight: 300;
  color: var(--text-muted);
  padding: 0 8px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   STAGING VIEW (Tabs, Tables, Batch Cards)
   ════════════════════════════════════════════ */
.staging-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.staging-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.staging-tab:hover { color: var(--text); }
.staging-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.staging-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--surface-el);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}
.staging-tab.active .staging-tab-count {
  background: var(--accent-dim);
  color: var(--accent);
}

.staging-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.staging-info-left {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.staging-info-label {
  font-size: 12px;
  color: var(--text-sec);
}

/* ── Batch Cards ───────────────────── */
.batch-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.batch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.batch-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.batch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.batch-card-body {
  padding: 16px;
}
.batch-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sec);
}
.batch-eans {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.batch-ean-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  background: var(--surface-el);
  border: 1px solid var(--border);
  color: var(--text-sec);
}
.batch-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-el);
}

/* ----------------------------------------------
   DASHBOARD
   ---------------------------------------------- */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.dash-kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s;
}
.dash-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.10); }
.dash-kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-kpi-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.dash-kpi-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.dash-kpi-label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.dash-kpi-bar-track { height: 4px; background: var(--surface-el, #eee); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.dash-kpi-bar-fill { height: 100%; border-radius: 99px; transition: width 0.6s ease; }

.dash-main-grid {
  display: grid;
  grid-template-columns: 300px 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) { .dash-main-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .dash-main-grid { grid-template-columns: 1fr; } }

.dash-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  box-shadow: var(--shadow);
}
.dash-panel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-sec);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-cat-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.dash-cat-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dash-cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dash-cat-name { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-cat-count { font-weight: 700; color: var(--text-muted); font-size: 11px; }

.dash-holding-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 6px;
  padding: 8px;
  margin: 0 -8px;
}
.dash-holding-row:last-child { border-bottom: none; }
.dash-holding-row:hover { background: var(--surface-el, rgba(0,0,0,0.03)); }
.dash-holding-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.dash-holding-count { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: auto; }
.dash-holding-bar-wrap { display: flex; align-items: center; gap: 10px; }
.dash-holding-pct { font-size: 12px; font-weight: 700; min-width: 32px; text-align: right; }

.dash-alert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
}
.dash-alert-item:hover { background: var(--surface-el, rgba(0,0,0,0.04)); }
.dash-alert-icon { font-size: 18px; flex-shrink: 0; }
.dash-alert-label { flex: 1; }

/* -- Server Status Indicator -- */
.server-status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface-el, rgba(0,0,0,0.04));
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.online {
  background: #4ac99b;
  box-shadow: 0 0 0 0 rgba(74,201,155,0.6);
  animation: pulse-online 2s infinite;
}
.status-dot.offline { background: #888; }
@keyframes pulse-online {
  0%   { box-shadow: 0 0 0 0 rgba(74,201,155,0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(74,201,155,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,201,155,0); }
}

/* -- Pipeline Flow Banner -- */
.pipeline-flow-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.pf-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.pf-step.active { opacity: 1; }
.pf-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-dim, rgba(79,110,247,0.12));
  color: var(--accent, #4F6EF7);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.pf-step.active .pf-step-num { background: var(--accent, #4F6EF7); color: #fff; }
.pf-step-info { display: flex; flex-direction: column; }
.pf-step-info strong { font-size: 12px; font-weight: 700; }
.pf-step-info span { font-size: 11px; color: var(--text-muted); }
.pf-arrow { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }

/* ----------------------------------------------
   FIELD DISCOVERY MODAL & STAGING STYLES
   ---------------------------------------------- */
.fd-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.25s;
}
.fd-overlay.visible { opacity: 1; }
.fd-overlay.hidden { display: none; }

.fd-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  width: 100%; max-width: 800px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 40px rgba(0,0,0,0.2);
  transform: translateY(20px); transition: transform 0.25s;
}
.fd-overlay.visible .fd-modal { transform: translateY(0); }

.fd-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
}
.fd-modal-title-wrap { display: flex; gap: 14px; align-items: center; }
.fd-icon-badge {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(74,201,155,0.12); color: #4ac99b;
  display: flex; align-items: center; justify-content: center;
}
.fd-modal-title { font-size: 18px; font-weight: 700; margin: 0 0 4px 0; color: var(--text); }
.fd-modal-sub { font-size: 13px; color: var(--text-muted); margin: 0; }

.fd-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.fd-two-cols {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}
@media (max-width: 768px) {
  .fd-two-cols { grid-template-columns: 1fr; }
}

.fd-section-lbl {
  font-size: 11px; font-weight: 700; color: var(--text-sec);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 0 0 12px 0; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.fd-photo-drop {
  border: 2px dashed var(--border);
  border-radius: 8px;
  height: 280px;
  background: var(--surface-el, rgba(0,0,0,0.02));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 16px; text-align: center;
}
.fd-photo-drop:hover, .fd-photo-drop.drag-over {
  border-color: var(--accent, #4F6EF7);
  background: var(--accent-dim, rgba(79,110,247,0.05));
}
#fd-photo-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text); font-size: 13px; font-weight: 500;
}

.fd-col-meta { display: flex; flex-direction: column; gap: 16px; }
.fd-two-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.fd-alert-notice {
  background: rgba(255,193,7,0.1);
  border-left: 3px solid #FFC107;
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px; color: var(--text);
  display: flex; gap: 12px; align-items: center;
  margin-top: 8px;
}
.fd-alert-notice svg { color: #FFC107; flex-shrink: 0; }

.fd-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 12px;
  background: var(--surface-el, rgba(0,0,0,0.02));
  border-radius: 0 0 12px 12px;
}

/* Staging field discovery row overrides */
.field-discovery-row {
  background: var(--surface-el, rgba(0,0,0,0.02)) !important;
}
.field-discovery-row td {
  border-top: 1px solid rgba(255,193,7,0.3) !important;
  border-bottom: 1px solid rgba(255,193,7,0.3) !important;
}
.staging-thumb {
  width: 36px; height: 36px; border-radius: 6px;
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
}
.staging-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-el); color: var(--text-muted);
}
.tentative-ean-badge {
  display: inline-block; margin-left: 6px;
  font-size: 10px; padding: 2px 4px; border-radius: 4px;
  background: rgba(255,193,7,0.15); color: #B28704; font-weight: 700; text-transform: uppercase;
}

/* ── Stat chips (Levantamiento header) ─────────── */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.stat-chip strong {
  font-size: 16px;
  font-weight: 700;
  margin-right: 3px;
}

/* ── Highlight Text for Revision ─────────── */
.highlight-text {
  background-color: var(--accent-light, #e8f0fe);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 4px solid var(--accent, #1a73e8);
  font-weight: 500;
  color: var(--text-main);
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 13.5px;
}

@media (max-height: 820px) and (min-width: 901px) {
  .sheet-left, .sheet-right { padding: 16px; }
  .sheet-left { gap: 12px; }
  .sheet-core-col { gap: 8px; }
  .sheet-body-row { gap: 16px; }
  .sheet-footer { bottom: -16px; padding-bottom: 16px; }
}
