/* ================================================================
   Creativewity Barcode & QR Studio — studio.css v2.1
   Brand Colors: Yellow #F5C518 / Dark Grey #3D3D3D / White #FFFFFF
   Default: LIGHT theme. Scoped to #cbs-studio-wrap only.
   ================================================================ */

#cbs-studio-wrap *, #cbs-studio-wrap *::before, #cbs-studio-wrap *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

/* ── LIGHT THEME (default) ─────────────────────────── */
#cbs-studio-wrap {
  --bg:         #F8F8F8;
  --bg2:        #F0F0F0;
  --surface:    #FFFFFF;
  --surface2:   #F5F5F5;
  --surface3:   #ECECEC;
  --border:     #E2E2E2;
  --border2:    #D0D0D0;
  --accent:     #F5C518;
  --accent-h:   #E0B200;
  --accent-dk:  #3D3D3D;
  --accent-bg:  rgba(245,197,24,0.10);
  --accent-bdr: rgba(245,197,24,0.35);
  --text:       #1A1A1A;
  --text2:      #555555;
  --text3:      #888888;
  --text4:      #C8C8C8;
  --red:        #D94040;
  --green:      #27A84A;
  --shadow:     0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.14);
  --radius:     10px;
  --radius-s:   6px;
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── DARK THEME ─────────────────────────────────────── */
#cbs-studio-wrap[data-cbs-theme="dark"] {
  --bg:         #111111;
  --bg2:        #161616;
  --surface:    #1C1C1C;
  --surface2:   #232323;
  --surface3:   #2A2A2A;
  --border:     #2E2E2E;
  --border2:    #3A3A3A;
  --accent:     #F5C518;
  --accent-h:   #FFD740;
  --accent-dk:  #F5C518;
  --accent-bg:  rgba(245,197,24,0.08);
  --accent-bdr: rgba(245,197,24,0.25);
  --text:       #EEEEEE;
  --text2:      #AAAAAA;
  --text3:      #666666;
  --text4:      #3A3A3A;
  --red:        #E05C5C;
  --green:      #4CAE5A;
  --shadow:     0 4px 24px rgba(0,0,0,0.50);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.70);
}

/* ── WRAPPER ─────────────────────────────────────────── */
#cbs-studio-wrap {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0 0 24px 0;   /* no side margins — let WordPress column control width */
  display: flex;
  flex-direction: column;
  min-height: 760px;
  transition: background .2s, color .2s, border-color .2s;
  box-shadow: var(--shadow-lg);
}

/* ── TOP BAR ─────────────────────────────────────────── */
#cbs-studio-wrap .cbs-topbar {
  display: flex;
  align-items: center;
  gap: 0;
  background: #3D3D3D;
  padding: 0 18px 0 0;
  height: 52px;
  flex-shrink: 0;
  border-bottom: 3px solid #F5C518;
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-topbar {
  background: #1A1A1A;
  border-bottom: 3px solid #F5C518;
}

/* Brand */
#cbs-studio-wrap .cbs-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #F5C518;
  height: 100%;
  padding: 0 24px 0 20px;
  margin-right: 8px;
  flex-shrink: 0;
  /* angled right edge matching logo shape */
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
  padding-right: 34px;
}
#cbs-studio-wrap .cbs-brand svg { color: #3D3D3D; flex-shrink: 0; }
#cbs-studio-wrap .cbs-brand span {
  color: #3D3D3D;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  text-transform: uppercase;
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-brand {
  background: #F5C518;
}

/* ── TABS ────────────────────────────────────────────── */
#cbs-studio-wrap .cbs-tabs {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
#cbs-studio-wrap .cbs-tabs::-webkit-scrollbar { display: none; }

#cbs-studio-wrap .cbs-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.50);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  position: relative;
  transition: color .15s;
  flex-shrink: 0;
  letter-spacing: .01em;
}
#cbs-studio-wrap .cbs-tab svg { opacity: .45; transition: opacity .15s; flex-shrink: 0; }
#cbs-studio-wrap .cbs-tab:hover { color: rgba(255,255,255,0.85); }
#cbs-studio-wrap .cbs-tab:hover svg { opacity: .8; }
#cbs-studio-wrap .cbs-tab.active { color: #F5C518; font-weight: 700; }
#cbs-studio-wrap .cbs-tab.active svg { opacity: 1; color: #F5C518; }
#cbs-studio-wrap .cbs-tab.active::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0; right: 0;
  height: 3px;
  background: #F5C518;
  border-radius: 0;
}

/* ── THEME TOGGLE ────────────────────────────────────── */
#cbs-studio-wrap .cbs-theme-btn {
  margin-left: 12px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.65);
  border-radius: 7px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
#cbs-studio-wrap .cbs-theme-btn:hover {
  background: #F5C518;
  border-color: #F5C518;
  color: #3D3D3D;
}

#cbs-studio-wrap .cbs-moon-icon { display: none; }
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-sun-icon  { display: none; }
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-moon-icon { display: block; }

/* ── PANEL ───────────────────────────────────────────── */
#cbs-studio-wrap .cbs-panel { display: none; }
#cbs-studio-wrap .cbs-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ── TWO-COLUMN LAYOUT ───────────────────────────────── */
#cbs-studio-wrap .cbs-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
#cbs-studio-wrap .cbs-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  /* FIX: proper height so it scrolls */
  max-height: calc(100vh - 54px - 80px);
  min-height: 0;
}
#cbs-studio-wrap .cbs-sidebar::-webkit-scrollbar { width: 4px; }
#cbs-studio-wrap .cbs-sidebar::-webkit-scrollbar-track { background: transparent; }
#cbs-studio-wrap .cbs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}
#cbs-studio-wrap .cbs-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ── SECTIONS ────────────────────────────────────────── */
#cbs-studio-wrap .cbs-section {
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
}
#cbs-studio-wrap .cbs-section:last-child { border-bottom: none; }

#cbs-studio-wrap .cbs-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 11px;
}

#cbs-studio-wrap .cbs-badge {
  width: 18px; height: 18px;
  background: var(--accent);
  color: #3D3D3D;
  font-size: 10px;
  font-weight: 800;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#cbs-studio-wrap .cbs-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 7px;
}

/* ── EAN NOTICE ──────────────────────────────────────── */
#cbs-studio-wrap .cbs-ean-info {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-bdr);
  border-radius: var(--radius-s);
  color: #7A6200;
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 10px;
  margin-top: 10px;
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-ean-info { color: #D4A800; }
#cbs-studio-wrap .cbs-ean-info svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }

/* ── CHIPS ───────────────────────────────────────────── */
#cbs-studio-wrap .cbs-chips { display: flex; flex-wrap: wrap; gap: 5px; }

#cbs-studio-wrap .cbs-chip {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text2);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  line-height: 1.5;
  transition: all .12s;
}
#cbs-studio-wrap .cbs-chip:hover {
  border-color: var(--accent);
  color: #7A6200;
  background: var(--accent-bg);
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-chip:hover { color: #D4A800; }
#cbs-studio-wrap .cbs-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #3D3D3D;
  font-weight: 700;
}

/* ── TOGGLES ─────────────────────────────────────────── */
#cbs-studio-wrap .cbs-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text2);
}
#cbs-studio-wrap .cbs-toggle {
  position: relative;
  width: 34px; height: 18px;
  flex-shrink: 0;
}
#cbs-studio-wrap .cbs-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
#cbs-studio-wrap .cbs-knob {
  position: absolute; inset: 0;
  background: var(--surface3);
  border: 1.5px solid var(--border2);
  border-radius: 100px;
  cursor: pointer;
  transition: all .2s;
}
#cbs-studio-wrap .cbs-knob::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  left: 2px; top: 2px;
  background: var(--text3);
  border-radius: 50%;
  transition: all .2s;
}
#cbs-studio-wrap .cbs-toggle input:checked + .cbs-knob { background: var(--accent); border-color: var(--accent); }
#cbs-studio-wrap .cbs-toggle input:checked + .cbs-knob::before { transform: translateX(16px); background: #3D3D3D; }

/* ── FORM FIELDS ─────────────────────────────────────── */
#cbs-studio-wrap .cbs-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}
#cbs-studio-wrap .cbs-label {
  font-size: 12px;
  color: var(--text2);
  min-width: 88px;
  flex-shrink: 0;
}
#cbs-studio-wrap .cbs-val {
  font-size: 10.5px; font-weight: 700;
  color: #7A6200;
  background: var(--accent-bg);
  padding: 1px 7px;
  border-radius: 100px;
  margin-left: 3px;
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-val { color: #D4A800; }

#cbs-studio-wrap .cbs-select {
  flex: 1;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  border-radius: var(--radius-s);
  font-family: var(--font);
  cursor: pointer;
  transition: border-color .15s;
  appearance: auto;
}
#cbs-studio-wrap .cbs-select:focus { outline: none; border-color: var(--accent); }

#cbs-studio-wrap .cbs-range {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

#cbs-studio-wrap .cbs-color {
  width: 32px; height: 28px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  padding: 2px;
  background: var(--surface2);
  cursor: pointer;
  flex-shrink: 0;
}
#cbs-studio-wrap .cbs-hex {
  font-size: 11px;
  font-family: 'Courier New', monospace;
  color: var(--text3);
}

#cbs-studio-wrap .cbs-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: var(--radius-s);
  font-family: var(--font);
  transition: border-color .15s;
}
#cbs-studio-wrap .cbs-input:focus { outline: none; border-color: var(--accent); }

#cbs-studio-wrap .cbs-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  padding: 9px 11px;
  border-radius: var(--radius-s);
  font-family: var(--font);
  resize: vertical;
  line-height: 1.6;
  transition: border-color .15s;
}
#cbs-studio-wrap .cbs-textarea:focus { outline: none; border-color: var(--accent); }
#cbs-studio-wrap .cbs-textarea::placeholder,
#cbs-studio-wrap .cbs-input::placeholder { color: var(--text4); }

/* ── DROPZONE ────────────────────────────────────────── */
#cbs-studio-wrap .cbs-dropzone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
  transition: all .15s;
  background: var(--surface2);
}
#cbs-studio-wrap .cbs-dropzone svg { opacity: .35; }
#cbs-studio-wrap .cbs-dropzone:hover,
#cbs-studio-wrap .cbs-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: #7A6200;
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-dropzone:hover,
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-dropzone.dragover { color: #D4A800; }
#cbs-studio-wrap .cbs-dropzone.dragover svg { opacity: .7; }

/* ── ROW TOOLBAR ─────────────────────────────────────── */
#cbs-studio-wrap .cbs-row-toolbar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
#cbs-studio-wrap .cbs-row-count {
  margin-left: auto; font-size: 11px; color: var(--text3);
}
#cbs-studio-wrap .cbs-ghost-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text2);
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-s);
  cursor: pointer;
  font-family: var(--font);
  transition: all .12s;
}
#cbs-studio-wrap .cbs-ghost-btn:hover { border-color: var(--accent); color: #7A6200; background: var(--accent-bg); }
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-ghost-btn:hover { color: #D4A800; }
#cbs-studio-wrap .cbs-ghost-btn.danger:hover { border-color: var(--red); color: var(--red); background: rgba(217,64,64,.07); }

/* ── DATA TABLE ──────────────────────────────────────── */
#cbs-studio-wrap .cbs-table-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
}
#cbs-studio-wrap .cbs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
#cbs-studio-wrap .cbs-table th {
  background: var(--surface2);
  color: var(--text3);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 7px 8px;
  border-bottom: 1.5px solid var(--border);
  text-align: left;
}
#cbs-studio-wrap .cbs-table th.w-drag,
#cbs-studio-wrap .cbs-table th.w-cb,
#cbs-studio-wrap .cbs-table th.w-del { width: 28px; }
#cbs-studio-wrap .cbs-table td {
  padding: 3px 4px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
#cbs-studio-wrap .cbs-table tr:last-child td { border-bottom: none; }
#cbs-studio-wrap .cbs-table tr:hover td { background: var(--surface2); }

#cbs-studio-wrap .cbs-drag-handle {
  color: var(--text4); cursor: grab; padding: 0 7px; font-size: 13px; text-align: center; user-select: none;
}
#cbs-studio-wrap .cbs-checkbox { accent-color: var(--accent); cursor: pointer; width: 13px; height: 13px; }

#cbs-studio-wrap .cbs-cell-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 11.5px;
  padding: 4px 6px;
  border-radius: 4px;
  width: 100%;
  font-family: var(--font);
  transition: all .12s;
}
#cbs-studio-wrap .cbs-cell-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface2);
}
#cbs-studio-wrap .cbs-cell-input::placeholder { color: var(--text4); }
#cbs-studio-wrap .cbs-cell-input.is-invalid { border-color: var(--red) !important; background: rgba(217,64,64,.06); }
#cbs-studio-wrap .cbs-cell-input.is-valid   { border-color: var(--green) !important; }

/* EAN badge */
#cbs-studio-wrap .cbs-bc-cell { display: flex; align-items: center; gap: 4px; }
#cbs-studio-wrap .cbs-bc-cell .cbs-cell-input { flex: 1; min-width: 0; }
#cbs-studio-wrap .cbs-ean-badge {
  display: none; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 800;
  padding: 2px 6px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0; cursor: default;
}
#cbs-studio-wrap .cbs-ean-badge.show { display: inline-flex; }
#cbs-studio-wrap .cbs-ean-badge.ok   { background: rgba(39,168,74,.12); color: var(--green); }
#cbs-studio-wrap .cbs-ean-badge.auto { background: var(--accent-bg); color: #7A6200; }
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-ean-badge.auto { color: #D4A800; }
#cbs-studio-wrap .cbs-ean-badge.bad  { background: rgba(217,64,64,.12); color: var(--red); cursor: pointer; }
#cbs-studio-wrap .cbs-ean-badge.bad:hover { background: rgba(217,64,64,.24); }

#cbs-studio-wrap .cbs-delete-row {
  background: none; border: none; color: var(--text4);
  cursor: pointer; font-size: 12px;
  width: 24px; height: 24px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
#cbs-studio-wrap .cbs-delete-row:hover { color: var(--red); background: rgba(217,64,64,.09); }

/* ── BUTTONS ─────────────────────────────────────────── */
#cbs-studio-wrap .cbs-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px;
  background: var(--accent);
  color: #3D3D3D;
  border: none;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  letter-spacing: .01em;
  transition: all .15s;
  white-space: nowrap;
}
#cbs-studio-wrap .cbs-btn:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(245,197,24,.35); }
#cbs-studio-wrap .cbs-btn:active { transform: none; box-shadow: none; }

#cbs-studio-wrap .cbs-btn.outline {
  background: var(--surface);
  color: var(--text2);
  border: 1.5px solid var(--border2);
  box-shadow: none;
}
#cbs-studio-wrap .cbs-btn.outline:hover {
  border-color: var(--accent);
  color: #7A6200;
  background: var(--accent-bg);
  transform: none; box-shadow: none;
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-btn.outline:hover { color: #D4A800; }

/* ── PREVIEW MAIN ────────────────────────────────────── */
#cbs-studio-wrap .cbs-main {
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* Preview bar */
#cbs-studio-wrap .cbs-preview-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
#cbs-studio-wrap .cbs-preview-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--text3);
}
#cbs-studio-wrap .cbs-size-tag {
  background: var(--accent-bg);
  border: 1px solid var(--accent-bdr);
  font-size: 11px; font-weight: 600;
  color: #7A6200;
  padding: 2px 10px; border-radius: 100px;
}
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-size-tag { color: #D4A800; }
#cbs-studio-wrap .cbs-flex-1 { flex: 1; }

/* Pager */
#cbs-studio-wrap .cbs-pager { display: flex; align-items: center; gap: 6px; }
#cbs-studio-wrap .cbs-pager-btn {
  width: 28px; height: 28px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-s);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
#cbs-studio-wrap .cbs-pager-btn:hover:not(:disabled) { border-color: var(--accent); color: #7A6200; background: var(--accent-bg); }
#cbs-studio-wrap[data-cbs-theme="dark"] .cbs-pager-btn:hover:not(:disabled) { color: #D4A800; }
#cbs-studio-wrap .cbs-pager-btn:disabled { opacity: .3; cursor: not-allowed; }
#cbs-studio-wrap .cbs-pager-text { font-size: 11.5px; color: var(--text2); min-width: 40px; text-align: center; }

/* Paper stage */
#cbs-studio-wrap .cbs-paper-stage {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; justify-content: center; align-items: flex-start;
  background: var(--bg2);
}

#cbs-studio-wrap .cbs-paper {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  min-height: 280px;
  border: 1px solid #E8E8E8;
}

/* Action bar */
#cbs-studio-wrap .cbs-action-bar {
  padding: 11px 18px;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
#cbs-studio-wrap .cbs-stats { font-size: 11.5px; color: var(--text3); }
#cbs-studio-wrap .cbs-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ── LABEL GRID / CELLS ──────────────────────────────── */
#cbs-studio-wrap .cbs-label-grid { display: grid; gap: 5px; }

#cbs-studio-wrap .cbs-label-cell {
  border: 1px solid #E0E0E0;
  padding: 5px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden; border-radius: 3px;
  background: #fff;
  min-height: 60px;
}
#cbs-studio-wrap .cbs-label-cell .lbl-title {
  font-size: 9px; font-weight: 700; color: #111;
  text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; width: 100%;
}
#cbs-studio-wrap .cbs-label-cell .lbl-bc  { max-width: 100%; height: 42px; display: block; }
#cbs-studio-wrap .cbs-label-cell .lbl-price { font-size: 9px; font-weight: 700; color: #222; }
#cbs-studio-wrap .cbs-label-cell .lbl-empty {
  width: 100%; height: 38px;
  background: #F5F5F5;
  border-radius: 3px; margin: 2px 0;
  border: 1.5px dashed #E0E0E0;
}
/* Invalid barcode placeholder — red dashed, no text */
#cbs-studio-wrap .cbs-label-cell .lbl-empty.lbl-invalid {
  background: rgba(217,64,64,.04);
  border-color: rgba(217,64,64,.25);
}

/* ── BULK GRID ───────────────────────────────────────── */
#cbs-studio-wrap .cbs-bulk-grid {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-wrap: wrap; gap: 10px;
  align-content: flex-start; min-height: 280px;
  background: var(--bg2);
}
#cbs-studio-wrap .cbs-bulk-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; background: #fff;
  padding: 10px 8px 7px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  outline: 2px solid transparent;
  transition: outline-color .15s;
}
#cbs-studio-wrap .cbs-bulk-item.is-invalid { outline-color: var(--red); }
#cbs-studio-wrap .cbs-bulk-item.is-valid   { outline-color: var(--green); }
#cbs-studio-wrap .cbs-bulk-item-lbl {
  font-size: 10px; color: #555; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; font-family: 'Courier New', monospace;
}

/* ── QR STAGE ────────────────────────────────────────── */
#cbs-studio-wrap .cbs-qr-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 30px 20px; background: var(--bg2);
}
#cbs-studio-wrap .cbs-qr-card {
  background: #fff; padding: 22px; border-radius: 12px;
  box-shadow: var(--shadow-lg); border: 1px solid #E8E8E8;
}
#cbs-studio-wrap #qr-canvas { display: block; max-width: 100%; }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  #cbs-studio-wrap { border-radius: 0; margin: 0; min-height: auto; box-shadow: none; }
  #cbs-studio-wrap .cbs-layout { grid-template-columns: 1fr; overflow: visible; }
  #cbs-studio-wrap .cbs-sidebar {
    border-right: none;
    border-bottom: 2px solid var(--border);
    max-height: none;
    overflow: visible;
  }
  #cbs-studio-wrap .cbs-main { min-height: 480px; }
  #cbs-studio-wrap .cbs-brand { clip-path: none; padding-right: 22px; }
  #cbs-studio-wrap .cbs-tab { padding: 0 13px; font-size: 12px; }
  #cbs-studio-wrap .cbs-tab svg { display: none; }
}
@media (max-width: 500px) {
  #cbs-studio-wrap .cbs-topbar { padding: 0 10px 0 0; }
  #cbs-studio-wrap .cbs-brand { padding: 0 18px 0 14px; padding-right: 26px; }
  #cbs-studio-wrap .cbs-brand span { font-size: 11.5px; }
  #cbs-studio-wrap .cbs-section { padding: 13px 13px; }
  #cbs-studio-wrap .cbs-btn { padding: 8px 14px; font-size: 12px; }
  #cbs-studio-wrap .cbs-paper-stage { padding: 12px; }
  #cbs-studio-wrap .cbs-tab { padding: 0 10px; }
}
