/* ===== PAC.CO Studio Dashboard ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --bg-body: #F4F6F8;
  --bg-surface: #FFFFFF;
  --bg-hover: #F8F9FA;
  --text-primary: #0A0A0A;
  --text-secondary: #4A4A4A;
  --text-muted: #888888;
  --border-light: #E5E7EB;
  --accent-black: #000000;
  --accent-white: #FFFFFF;

  /* Spacing & Radius */
  --radius: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-pill: 999px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;

  /* Legacy Compat */
  --ink: var(--text-primary);
  --paper: var(--bg-surface);
  --soft: var(--bg-hover);
  --border: var(--border-light);
  --muted: var(--text-muted);
  --sidebar-w: 240px;
  --topbar-h: 44px;
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
  background: var(--bg-body);
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
/* Sidebar */
.ds-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  border-right: 3px solid #111;
}

.ds-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  box-sizing: border-box;
  background: #ffe600;
  margin: 0;
}

.ds-sidebar-brand img {
  height: 22px;
  object-fit: contain;
}

.ds-brand-text {
  font-size: 14px;
  font-weight: 900;
  color: #111;
  letter-spacing: 0.02em;
  line-height: 1;
}

.ds-sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.ds-sidebar-section {
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  padding: 20px 14px 6px;
}

/* Sidebar Navigation — Compact Builder Rows */
.ds-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 0;
  color: #111;
  font-weight: 700;
  font-size: 0.78rem;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
  text-align: left;
  text-decoration: none;
  min-height: 34px;
}

.ds-nav-item:hover {
  background: #f5f5f5;
  color: #111;
}

.ds-nav-item.active {
  background: #111;
  color: #fff;
  font-weight: 800;
  border: none;
  box-shadow: none;
}


.ds-nav-item.active svg {
  stroke: #fff !important;
  fill: none !important;
}

.ds-nav-item svg {
  flex-shrink: 0;
  opacity: 1;
}

.ds-nav-badge {
  margin-left: auto;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #111;
}

.ds-nav-item.active .ds-nav-badge {
  background: #111;
  color: #fff;
  border-color: #111;
}

.ds-sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid #d9d9d9;
}

.ds-sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.ds-sidebar-user:hover {
  background: #f4f3ef;
}

.ds-avatar {
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  border: 2px solid #111;
}

.ds-user-info strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.ds-user-info span {
  font-size: 10.5px;
  color: #888;
}

/* ===== MAIN CONTENT ===== */
/* Main Shell */
.ds-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-body);
}

/* ===== TOPBAR — Compact (nav pills moved to sidebar) ===== */
.ds-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  padding: 6px 12px;
  margin: 0;
  z-index: 100;
  flex-shrink: 0;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  box-sizing: border-box;
  border-bottom: 3px solid #111;
}

/* -- LEFT ZONE: hamburger + logo + badge -- */
.ds-topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ds-topbar-title {
  font-weight: 900;
  font-size: 15px;
  color: #111;
  white-space: nowrap;
  margin-left: 4px;
}

.ds-topbar-left img {
  height: 22px;
  object-fit: contain;
  display: block;
}


/* Hamburger — hidden on desktop, visible on tablet/mobile */
.ds-topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #fff;
  border: 2px solid #111;
  border-radius: 0;
  cursor: pointer;
  color: #111;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s;
}

.ds-topbar-hamburger:hover {
  background: #ffe600;
}

/* -- CENTER ZONE: dashboard quick-nav tabs (in topbar) -- */
.ds-topbar-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-start;
  margin-left: 16px;
  min-width: 0;
}
.ds-topbar-tabs .ds-quick-nav-btn {
  padding: 4px 12px;
  font-size: 0.7rem;
  border-radius: 0;
  white-space: nowrap;
}

/* -- RIGHT ZONE: search + avatar -- */
.ds-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
  padding-right: 24px;
}

.ds-topbar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f4f3ef;
  border: 2px solid #111;
  border-radius: 0;
  padding: 4px 10px;
  min-width: 140px;
  max-width: 220px;
  transition: all 0.15s;
}

.ds-topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 12px;
  width: 100%;
  min-width: 50px;
  color: #111;
  font-weight: 700;
}

.ds-topbar-search svg {
  color: #111;
  flex-shrink: 0;
}

.ds-topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid #111;
  transition: background 0.15s;
}
.ds-topbar-avatar:hover {
  background: #ffe600;
  color: #111;
}

/* Buttons (High Contrast Pill) */
.ds-btn,
.button,
.primary-cta,
.auth-submit,
.ds-icon-btn {
  background: #111;
  color: #fff;
  border: 2px solid #111;
  border-radius: 0;
  padding: 10px 20px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.ds-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
}

.ds-btn:hover,
.button:hover,
.primary-cta:hover,
.auth-submit:hover,
.ds-icon-btn:hover {
  background: #ffe600;
  color: #111;
}

.ds-btn-secondary,
.button.secondary,
.ds-icon-btn-secondary {
  background: #fff;
  border: 2px solid #111;
  color: #111;
  font-weight: 800;
  text-transform: uppercase;
}

.ds-btn-secondary:hover,
.button.secondary:hover,
.ds-icon-btn-secondary:hover {
  background: #ffe600;
  color: #111;
}

.ds-btn-danger {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: #111 !important;
}

.ds-btn-danger:hover {
  background: #b91c1c !important;
  color: #fff !important;
}

.ds-modal-footer-product {
  justify-content: space-between !important;
}

.ds-btn-delete {
  background: #fff !important;
  color: #111 !important;
  border: 2px solid #111 !important;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.ds-btn-delete:hover {
  background: #dc2626 !important;
  color: #fff !important;
}
.ds-btn-delete:active {
  background: #b91c1c !important;
}

/* Flat SFX upload button for blindbox settings — matches ds-btn-sm flat style */
.ds-sfx-upload-btn {
  background: #fff;
  color: #111;
  border: 2px solid #111;
  height: 32px;
  padding: 0 12px;
  font-weight: 800;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.ds-sfx-upload-btn:hover {
  background: #ffe600;
}

.ds-btn-sm {
  padding: 5px 10px;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

.ds-btn-xs {
  padding: 3px 8px;
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  border-radius: 0;
}

.ds-btn-primary {
  background: #111;
  color: #fff;
  border: 2px solid #111;
  border-radius: 0;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ds-btn-primary:hover {
  background: #ffe600;
  color: #111;
}

.ds-full {
  width: 100%;
  flex: 1;
}

.minimal-btn {
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.minimal-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== PAGE CONTENT ===== */
/* Main Content Grid */
.ds-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 0;
  padding: 16px;
}

.ds-page {
  display: none;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Dashboard — tighter gap, less empty space */
#page-dashboard {
  gap: 16px;
}

.ds-page.active,
.ds-page.show {
  display: flex !important;
}

/* Dashboard Specific Grids (Ref 2) */
#page-dashboard .ds-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: 0;
}

#page-dashboard .ds-two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-md);
  margin-bottom: 0;
}

#page-analytics .ds-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: 0;
}

/* ===== STAT CARDS ===== */
/* Neobrutalist Stat Cards — matches panel aesthetic */
.ds-stat-card {
  background: #fff;
  padding: 12px 16px;
  border: 2px solid #111;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 80px;
  justify-content: center;
}

.ds-stat-value {
  font-size: 1.45rem;
  font-weight: 900;
  color: #111;
  letter-spacing: -0.02em;
}

.ds-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  font-weight: 800;
}

.ds-stat-sub {
  font-size: 0.7rem;
  color: #666;
  font-weight: 600;
}

/* ===== PANELS ===== */
/* Floating Panels */
.ds-panel {
  background: var(--bg-surface);
  padding: 12px 16px;
  border: 2px solid #111;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ds-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}

.ds-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ds-panel-body {
  padding: 0;
}

.ds-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.ds-three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ===== PRODUCT GRID ===== */


/* ===== REDESIGNED ORDERS UI ===== */
.ds-orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.ds-order-card {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: var(--paper);
  border: 2px solid #ccc;
  border-radius: 0;
  cursor: pointer;
  gap: 20px;
}

/* Left: Images */
.ds-order-visuals {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 90px;
  position: relative;
}

.ds-order-thumb {
  width: 52px;
  height: 52px;
  border: 1px solid #ddd;
  padding: 2px;
  object-fit: contain;
}

.ds-order-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  font-size: 10px;
  font-weight: 700;
  color: #888;
  padding: 0 4px;
  margin-left: 4px;
}

/* Center: Info */
.ds-order-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-width: 0;
}

.ds-order-main-info h4 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.ds-order-main-info p {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.ds-order-meta-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ds-order-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.ds-order-meta-item svg {
  opacity: 0.6;
}

/* Right: Price & Status */
.ds-order-actions-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.ds-order-price-status {
  text-align: right;
  min-width: 120px;
}

.ds-order-price {
  font-size: 16px;
  font-weight: 900;
  display: block;
  margin-bottom: 6px;
}

/* Status Badges & Tags */
.ds-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.ds-status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.ds-status.new {
  background: #FEF9C3;
  color: #854D0E;
}

.ds-status.awaiting_review {
  background: #FEF9C3;
  color: #854D0E;
}

.ds-status.preparing {
  background: #FFEDD5;
  color: #9A3412;
}

.ds-status.paid {
  background: #DBEAFE;
  color: #1E40AF;
}

.ds-status.shipped {
  background: #F3E8FF;
  color: #6B21A8;
}

.ds-status.done {
  background: #DCFCE7;
  color: #166534;
}

.ds-status.cancelled {
  background: #FEE2E2;
  color: #991B1B;
}

.ds-nav-badge {
  background: var(--accent-black);
  color: var(--accent-white);
}

.ds-review-badge {
  font-size: 10px;
  font-weight: 900;
  background: #fff8e1;
  color: #d97706;
  padding: 2px 6px;
  border: 1px solid #fde68a;
  width: fit-content;
}

.ds-order-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-order-btns .ds-select {
  min-width: 140px;
  height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 0.7rem;
}

.ds-order-btns .ds-btn-sm {
  height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
  display: inline-flex;
  align-items: center;
}

/* ===== RESPONSIVE ORDERS — TABLET (768px–1199px) ===== */
@media (max-width: 1199px) and (min-width: 768px) {
  #page-orders {
    overflow-x: hidden;
  }

  .ds-orders-list {
    gap: 16px;
    padding: 16px;
  }

  .ds-order-card {
    flex-direction: column;
    gap: 0;
    padding: 0;
    min-height: 120px;
    align-items: stretch;
    border-width: 2px;
    overflow: hidden;
  }

  .ds-order-visuals {
    width: auto;
    padding: 16px 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .ds-order-thumb {
    width: 52px;
    height: 52px;
  }

  .ds-order-count-badge {
    display: none;
  }

  .ds-order-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    grid-template-columns: none;
    padding: 8px 16px 12px;
  }

  .ds-order-main-info h4 {
    font-size: 14px;
    margin-bottom: 0;
  }

  .ds-order-main-info p {
    font-size: 12px;
    color: var(--muted);
  }

  .ds-order-meta-info {
    flex-direction: row;
    gap: 16px;
  }

  .ds-order-meta-item {
    font-size: 11px;
  }

  .ds-order-meta-item:last-child {
    display: flex;
  }

  .ds-order-actions-wrap {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid var(--border);
    padding: 12px 16px;
    flex-shrink: 0;
    background: var(--bg-hover);
    gap: 12px;
  }

  .ds-order-price-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-align: left;
    min-width: auto;
  }

  .ds-order-price {
    margin-bottom: 0;
    font-size: 14px;
  }

  .ds-order-btns .ds-btn {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 0.75rem;
  }

  .ds-order-btns .ds-select {
    width: 110px;
    min-height: 38px;
  }
}

/* ===== RESPONSIVE ORDERS — PHONE (<768px) ===== */
@media (max-width: 767px) {
  #page-orders {
    padding: 0 !important;
    overflow-x: hidden;
  }

  #page-orders .ds-widget-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }

  #page-orders .ds-widget-search {
    max-width: 100% !important;
  }

  #page-orders .ds-widget-action-group {
    justify-content: stretch;
  }

  #page-orders .ds-widget-action-group .ds-btn {
    width: 100%;
    justify-content: center;
  }

  #page-orders > .ds-widget-section > div {
    padding: 12px !important;
  }

  .ds-orders-list {
    gap: 12px;
    padding: 12px;
  }

  .ds-order-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 12px;
    align-items: stretch;
    border-width: 2px;
  }

  /* Flatten DOM hierarchy so all card parts become direct flex children,
     allowing us to reorder them independently with `order`. */
  .ds-order-visuals,
  .ds-order-content,
  .ds-order-actions-wrap,
  .ds-order-main-info,
  .ds-order-price-status {
    display: contents;
  }

  /* Hide thumbnail image + count badge on phone */
  .ds-order-thumb,
  .ds-order-count-badge {
    display: none;
  }

  /* ── Row 1: Order ID (left) + Status badge (right) ── */
  .ds-order-main-info h4 {
    order: 1;
    font-size: 13px;
    font-weight: 700;
    margin: 0;
  }

  .ds-status {
    order: 2;
    margin-left: auto;
    align-self: flex-start;
    font-size: 9px;
  }

  /* ── Row 2: Customer name ── */
  .ds-order-main-info p {
    order: 3;
    font-size: 14px;
    font-weight: 800;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* ── Row 3: Metadata (date • location) ── */
  .ds-order-meta-info {
    order: 4;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
  }

  .ds-order-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
  }

  .ds-order-meta-item svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
  }

  .ds-order-meta-item:first-child::after {
    content: "•";
    margin-left: 6px;
    color: var(--muted);
  }

  .ds-review-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    font-size: 10px;
    padding: 4px 8px;
    white-space: nowrap;
  }

  /* ── Row 4: Total amount on its own line ── */
  .ds-order-price {
    order: 5;
    font-size: 17px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 4px 0;
  }

  /* ── Row 5: Action buttons ── */
  .ds-order-btns {
    order: 6;
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 2px solid var(--border);
  }

  .ds-order-btns .ds-btn,
  .ds-order-btns .ds-select {
    flex: 1;
    min-height: 40px;
    font-size: 0.75rem;
  }

  .ds-order-btns .ds-select {
    min-width: 0;
  }

  .ds-order-btns .ds-btn-secondary {
    background: var(--ink);
    color: var(--paper);
    border-width: 2px;
  }
}

/* ===== ORDER DETAILS MODAL ===== */
.ds-details-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.ds-details-section {
  margin-bottom: 24px;
}

.ds-details-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-details-card {
  background: #f9f9fb;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 20px;
}

.ds-customer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1199px) {
  .ds-customer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.ds-order-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ds-order-item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.ds-order-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ds-order-item-img {
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
  object-fit: contain;
}

.ds-order-item-info {
  flex: 1;
}

.ds-order-item-name {
  font-size: 13px;
  font-weight: 700;
  display: block;
}

.ds-order-item-variant {
  font-size: 11px;
  color: var(--muted);
}

.ds-order-item-price {
  font-size: 13px;
  font-weight: 800;
}

.ds-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.ds-summary-row.total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 16px;
  font-weight: 900;
}

.ds-timeline {
  position: relative;
  padding-left: 24px;
}

.ds-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: var(--border);
}

.ds-timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.ds-timeline-item:last-child {
  padding-bottom: 0;
}

.ds-timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  z-index: 2;
}

.ds-timeline-item.active .ds-timeline-dot {
  border-color: var(--ink);
  background: var(--ink);
}

/* Timeline Status Colors Reverted to Black */
.ds-timeline-item.active.new .ds-timeline-dot,
.ds-timeline-item.active.awaiting_review .ds-timeline-dot,
.ds-timeline-item.active.preparing .ds-timeline-dot,
.ds-timeline-item.active.paid .ds-timeline-dot,
.ds-timeline-item.active.shipped .ds-timeline-dot,
.ds-timeline-item.active.done .ds-timeline-dot,
.ds-timeline-item.active.cancelled .ds-timeline-dot {
  border-color: var(--ink);
  background: var(--ink);
}

.ds-timeline-content {
  font-size: 12px;
}

.ds-timeline-label {
  font-weight: 800;
  display: block;
}

.ds-timeline-time {
  color: var(--muted);
  font-size: 11px;
}

/* ===== ORDER DETAILS MODAL — RESPONSIVE ===== */

/* Tablet: single column stack */
@media (max-width: 1199px) and (min-width: 768px) {
  .ds-details-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ds-two-col {
    grid-template-columns: 1fr 1fr;
  }

  .ds-details-section {
    margin-bottom: 20px;
  }

  /* Payment evidence card — larger preview */
  .ds-details-card[style*="align-items:flex-start"] {
    flex-direction: row;
    gap: 20px;
  }

  .ds-details-card[style*="align-items:flex-start"] > img[style*="width:80px"] {
    width: 100px !important;
    height: 100px !important;
  }
}

/* Phone: full-screen mobile sheet */
@media (max-width: 767px) {
  #orderDetailsModal .ds-widget-modal {
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-width: 0;
    border-radius: 0;
  }

  #orderDetailsModal .ds-widget-modal-body {
    padding: 16px;
  }

  #orderDetailsModal .ds-widget-modal-header {
    padding: 14px 16px;
  }

  #orderDetailsModal .ds-widget-modal-header h2 {
    font-size: 0.95rem;
  }

  #orderDetailsModal .ds-widget-modal-footer {
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  #orderDetailsModal .ds-widget-modal-footer .ds-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .ds-details-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ds-two-col {
    grid-template-columns: 1fr;
  }

  .ds-details-section {
    margin-bottom: 16px;
  }

  /* Payment evidence — full-width image */
  .ds-details-card[style*="align-items:flex-start"] {
    flex-direction: column;
  }

  .ds-details-card[style*="align-items:flex-start"] > img[style*="width:80px"] {
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    margin-bottom: 12px;
  }

  .ds-details-card[style*="align-items:flex-start"] > div {
    width: 100%;
  }
}

/* ===== SLIDE CARDS ===== */
.ds-slides-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ds-slide-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 14px 16px;
}

.ds-slide-thumb {
  width: 96px;
  height: 60px;
  background: var(--soft);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds-slide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ds-slide-info {
  flex: 1;
  min-width: 0;
}

.ds-slide-info strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 2px;
}

.ds-slide-info span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.ds-slide-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ds-drag-handle {
  cursor: grab;
  color: var(--muted);
  padding: 4px;
}

.ds-drag-handle:active {
  cursor: grabbing;
}

/* ===== QUICK ACTIONS ===== */
.ds-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}

.ds-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.ds-quick-btn:hover {
  background: var(--soft);
  border-color: var(--ink);
}

.ds-quick-icon {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== MODAL ===== */
/* Floating Modals */
.ds-modal-overlay,
#cartOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.ds-modal-overlay.open {
  display: flex;
}

.ds-modal,
.modal-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: none;
  border: 1px solid var(--border-light);
  width: min(900px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
}

.modal-head,
.ds-modal-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.modal-content,
.ds-modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.modal-foot-sticky,
.ds-modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Drawer */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(400px, 100vw);
  z-index: 300;
  background: var(--bg-surface);
  box-shadow: none;
  border-left: 1px solid var(--border-light);
  padding: 0;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head,
.drawer-foot {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

.drawer-foot {
  border-top: 1px solid var(--border-light);
  border-bottom: none;
}

/* ===== FORM ===== */
/* Inputs & Forms */
.ds-field,
input.field,
.ds-input,
select.ds-field {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  outline: none;
}

.ds-field:focus,
input.field:focus,
.ds-input:focus,
select.ds-field:focus {
  border-color: var(--accent-black);
  background: var(--bg-surface);
}

.ds-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-field.full {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.ds-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 48px !important;
  cursor: pointer;
}

/* Premium Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ededf0;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #000;
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Segmented toggle (OFF / ON) — Studio flat style */
.ds-seg-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 34px;
  width: 72px;
  border: 2px solid #111;
  flex-shrink: 0;
  cursor: pointer;
}
.ds-seg-toggle-btn {
  background: #fff;
  color: #111;
  border: 0;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.ds-seg-toggle-btn.active {
  background: #111;
  color: #fff;
}
.ds-seg-toggle-btn:hover {
  background: #ffd400;
  color: #111;
}

/* ===== DROP ZONE ===== */
.ds-drop-zone {
  border: 2px dashed var(--border);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  color: var(--muted);
}

.ds-drop-zone:hover,
.ds-drop-zone.drag-over {
  border-color: var(--ink);
  background: var(--soft);
  color: var(--ink);
}

.ds-drop-zone p {
  font-size: 12px;
  margin-top: 6px;
}

.ds-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ===== COLOR/VARIANT ROWS ===== */
.ds-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.ds-color-row:last-child {
  border-bottom: none;
}

.ds-color-picker {
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: 1px solid var(--border);
  padding: 2px;
  cursor: pointer;
}

.ds-variant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* ===== EMPTY STATE ===== */
.ds-empty {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ds-empty-icon {
  width: 48px;
  height: 48px;
  background: var(--soft);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.ds-empty strong {
  font-size: 14px;
}

.ds-empty p {
  font-size: 13px;
  color: var(--muted);
}

/* ===== RECENT ACTIVITY ===== */
.ds-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.ds-activity-item:last-child {
  border-bottom: none;
}

.ds-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.ds-activity-dot.new {
  background: var(--success);
}

.ds-activity-dot.warn {
  background: var(--warning);
}

.ds-activity-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ===== UNIFIED NOTIFICATION MODAL ===== */
.ds-notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.ds-notif-overlay.open {
  opacity: 1;
  visibility: visible;
}

.ds-notif {
  width: 420px;
  max-width: calc(100% - 32px);
  background: #fff;
  border: 2px solid #111;
  padding: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ds-notif-overlay.open .ds-notif {
  opacity: 1;
  transform: translateY(0);
}

.ds-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
  min-height: 20px;
}

.ds-notif-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ds-notif-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #111;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.ds-notif-close:hover {
  background: #111;
}

.ds-notif-close:hover svg {
  stroke: #fff;
}

.ds-notif-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
}

.ds-notif-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  flex-shrink: 0;
}

.ds-notif-icon svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

.ds-notif-icon-success { background: #111; }
.ds-notif-icon-error { background: #111; }
.ds-notif-icon-warning { background: #ffe600; }
.ds-notif-icon-warning svg { stroke: #111; }
.ds-notif-icon-info { background: #111; }

.ds-notif-msg {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  line-height: 1.5;
  flex: 1;
}

.ds-notif-actions {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
}

.ds-notif-actions button {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}

.ds-notif-actions button:hover {
  background: #ffe600;
}

.ds-notif-actions .ds-notif-primary {
  background: #111;
  color: #fff;
  border: 2px solid #111;
}

.ds-notif-actions .ds-notif-primary:hover {
  background: #ffe600;
  color: #111;
}

.ds-notif-actions .ds-notif-danger {
  background: #111;
  color: #fff;
  border: 2px solid #111;
}

.ds-notif-actions .ds-notif-danger:hover {
  background: #dc2626;
  color: #fff;
  border-color: #111;
}

/* ===== SEARCH / FILTER BAR ===== */
.ds-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ds-toolbar .ds-topbar-search {
  width: 240px;
}

.ds-toolbar-end {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== RESPONSIVE ===== */


.ds-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 0;
  border: 2px solid #d9d9d9;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ds-add-btn:hover {
  background: #111;
  border-color: #111;
}
.ds-add-btn:hover svg {
  stroke: #fff;
}

/* Search Wrapper */
.ds-search-wrapper {
  position: relative;
  margin: 0 8px;
}

.ds-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
}

.ds-search-input {
  width: 100%;
  background: #fff;
  border: 2px solid #d9d9d9;
  border-radius: 0;
  padding: 8px 10px 8px 34px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.15s ease;
}

.ds-search-input:focus {
  border-color: #111;
  outline: none;
}



/* Collapsible Settings */
.ds-collapsible-section {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 0;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ds-section-trigger {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: background 0.2s;
}

.ds-section-trigger:hover {
  background: var(--bg-hover);
}

.ds-section-trigger svg {
  transition: transform 0.4s ease;
}

.ds-collapsible-section.collapsed .ds-section-trigger svg {
  transform: rotate(-90deg);
}

.ds-collapsible-section.collapsed .ds-section-content {
  display: none;
}

.ds-section-content {
  padding: 0 20px 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.ds-upload-preview-container img {
  width: 100%;
  height: auto;
  display: block;
}

.ds-upload-empty {
  padding: 32px 0;
  text-align: center;
}

.ds-upload-empty p {
  font-size: 13px;
  font-weight: 800;
  margin: 12px 0 4px;
}

.ds-upload-empty span {
  font-size: 10px;
  color: var(--text-muted);
}

/* Field Group */
.ds-field-group {
  margin-top: 16px;
}

.ds-field-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-left: 4px;
}

.ds-field-input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 0;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  transition: all 0.3s ease;
}

.ds-field-input:focus {
  border-color: var(--accent-black);
  outline: none;
}

/* Settings Header */
.ds-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 0 8px;
}

.ds-settings-title-stack h3 {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.ds-live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #10B981;
  margin-top: 4px;
  text-transform: uppercase;
}

.ds-dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.ds-settings-delete-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FEE2E2;
  color: #DC2626;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ds-settings-delete-btn:hover {
  background: #DC2626;
  color: white;
}

/* Floating Footer Buttons */
.ds-premium-sidebar-footer {
  padding: 20px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: auto;
}

.ds-premium-action-btn {
  width: 100%;
  padding: 12px;
  border-radius: 0;
  border: none;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ds-premium-action-btn.delete {
  background: #FEE2E2;
  color: #DC2626;
}

#portfolioViewport {
  background: white;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

@media (max-width: 1024px) {
  .ds-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .ds-sidebar.open {
    transform: translateX(0);
  }

  .ds-main {
    margin-left: 0;
  }

  .ds-two-col {
    grid-template-columns: 1fr !important;
  }

  #page-dashboard .ds-stats-row,
  #page-analytics .ds-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Tablet: show hamburger */
  .ds-topbar-hamburger {
    display: flex;
  }

  .ds-topbar-search {
    min-width: 120px;
    max-width: 200px;
  }

  /* Tablet: topbar tabs shrink */
  .ds-topbar-tabs .ds-quick-nav-btn {
    padding: 3px 8px;
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  .ds-topbar-tabs {
    gap: 3px;
  }
  .ds-topbar-tabs .ds-quick-nav-btn {
    padding: 3px 6px;
    font-size: 0.6rem;
    border-width: 1.5px;
  }
}

@media (max-width: 640px) {
  #page-dashboard .ds-stats-row,
  #page-analytics .ds-stats-row {
    grid-template-columns: 1fr !important;
  }

  .ds-topbar {
    gap: 6px;
    padding: 6px 10px;
    min-height: 40px;
  }

  .ds-topbar-search {
    min-width: 36px;
    max-width: 140px;
    padding: 4px 8px;
    border-width: 2px;
  }

  .ds-topbar-search #globalSearchCatalogName {
    display: none;
  }

  .ds-topbar-avatar {
    width: 28px;
    height: 28px;
  }

  .ds-content {
    padding: 16px;
  }
}

/* ===== STABLE VISUAL BUILDER (FLEX LAYOUT) ===== */
.ds-editor-container {
  display: flex !important;
  flex-direction: row;
  height: calc(100vh - var(--topbar-h));
  background: var(--soft);
  position: relative;
}

#page-homepage-builder .ds-editor-container,
#page-inventory-builder .ds-editor-container {
  border: 3px solid #111;
  overflow: hidden;
}
#page-slides .ds-editor-container {
  border: 2px solid #111 !important;
  border-top: none !important;
  border-left: none !important;
  overflow: hidden;
}

/* Brutalist overrides for #page-slides to match Inventory Builder */
#page-slides .ds-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 2px solid #111;
  background: #faf9f6;
  flex-shrink: 0;
  min-height: 48px;
  box-sizing: border-box;
}

#page-slides .ds-sidebar-header h3 {
  font-size: 0.75rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #111 !important;
}

#page-slides .ds-canvas-header {
  height: 50px;
  background: #faf9f6;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 2px solid #111 !important;
  display: flex;
  align-items: center;
  padding: 0 20px;
  justify-content: space-between;
  flex-shrink: 0;
}

#page-slides .ds-canvas-header .ds-tool-btn {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 2px solid #111 !important;
  border-radius: 0px !important;
  background: #fff !important;
  color: #111 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: background 0.15s !important;
}

#page-slides .ds-canvas-header .ds-tool-btn:hover {
  background: #ffe600 !important;
}

#page-slides .ds-canvas-header .ds-tool-btn.active {
  background: #ffe600 !important;
}

#page-slides .ds-btn {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 2px solid #111 !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  padding: 0 12px !important;
}

#page-slides .ds-btn-primary {
  background: #fff !important;
  color: #111 !important;
  border-color: #111 !important;
}

#page-slides .ds-btn-primary:hover {
  background: #ffe600 !important;
  color: #111 !important;
}

#page-slides .ds-sidebar-toggle-btn {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #111 !important;
  width: 34px !important;
  height: 34px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#page-slides .ds-sidebar-toggle-btn:hover {
  background: #ffe600 !important;
}

#page-slides .ds-editor-sidebar {
  border-top: none !important;
  border-left: none !important;
  border-bottom: none !important;
  border-right: 2px solid #111 !important;
}

#page-slides .ds-editor-sidebar.ds-right,
#page-slides .ds-editor-controls {
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-left: 2px solid #111 !important;
  background: #fff !important;
  overflow: visible !important;
}

#page-slides .slide-tab-bar {
  border-bottom: 2px solid #111 !important;
  background: #f4efe6 !important;
  min-height: 48px;
}

#page-slides .slide-tab {
  border: none !important;
  border-right: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #f4efe6 !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  margin-bottom: 0 !important;
  min-height: 48px;
  color: #6b7280 !important;
}

#page-slides .slide-tab:last-child {
  border-right: none !important;
}

#page-slides .slide-tab.active {
  background: #ffe600 !important;
  color: #111 !important;
}

#page-slides .ds-widget-field {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
}

#page-slides .ds-widget-section-head {
  border-bottom: 2px solid #111 !important;
  min-height: 48px;
  background: #fff !important;
  margin-bottom: 0 !important;
}

#page-slides .slide-tab-body {
  padding: 10px 16px 16px !important;
  background: #fff !important;
  overflow-y: auto !important;
  overflow-x: visible !important;
}

#page-slides .slide-tab-panel {
  gap: 14px !important;
  overflow: visible !important;
}

#page-slides #tab-content,
#page-slides #tab-design {
  background: #fff;
  border: 2px solid #111;
  padding: 16px;
}

#page-slides #tab-style {
  padding-bottom: 8px;
}

#page-slides .slide-tab-panel hr.ds-widget-divider {
  border: 0;
  border-top: 2px dashed #111;
  margin: 2px 0;
}

#page-slides .slide-tab-footer {
  padding: 14px 16px;
  border-top: 2px solid #111;
  background: #fff;
}
#page-slides .ds-widget-field:focus {
  outline: none;
  background: #faf9f6;
}

#page-slides .ds-widget-label {
  font-weight: 900 !important;
  text-transform: uppercase !important;
  color: #111 !important;
}

/* Rework slide navigation item layout to match ref 3 */
#page-slides .ds-slide-nav-item {
  border: 2px solid #111 !important;
  border-radius: 0 !important;
  background: #fff !important;
  padding: 14px 16px !important;
  transition: background 0.15s ease !important;
  margin-bottom: 10px !important;
  min-height: 60px !important;
}

#page-slides .ds-slide-nav-item:hover {
  background: #f5f4f0 !important;
  border-color: #111 !important;
}

#page-slides .ds-slide-nav-item.active {
  background: #fffbe6 !important;
  border: 2px solid #111 !important;
}

#page-slides .ds-slide-nav-item.reorder-ghost {
  opacity: 1 !important;
  border-style: dashed !important;
  border-color: #ffe600 !important;
  background: #fffbe6 !important;
}

#page-slides .ds-slide-nav-item.reorder-chosen {
  background: #ffe600 !important;
  cursor: grabbing !important;
}

.ds-editor-canvas {
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
  flex: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  z-index: 1;
  overflow: hidden;
  transition: padding-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ds-canvas-header {
  height: 50px;
  background: #fff;
  border-bottom: 2px solid #111;
  display: flex;
  align-items: center;
  padding: 0 20px;
  justify-content: space-between;
  flex-shrink: 0;
}

.ds-editor-sidebar,
.ds-editor-controls {
  flex-shrink: 0 !important;
  width: 280px !important;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  background: #fff;
}

.ds-editor-controls {
  width: 320px !important;
}

@media (max-width: 1024px) {
  .ds-editor-sidebar:not(.ds-right),
  .ds-editor-controls:not(.ds-right) {
    width: 200px !important;
  }
  .ds-editor-sidebar.ds-right,
  .ds-editor-controls.ds-right {
    width: 260px !important;
  }
}

@media (max-width: 850px) {
  :where(.ds-editor-sidebar):not(#page-homepage-builder *):not(#page-inventory-builder *):not(.ds-right),
  :where(.ds-editor-controls):not(#page-homepage-builder *):not(#page-inventory-builder *) {
    display: none !important;
  }
}

/* -- LEFT SIDEBAR (Slide List) -- */
/* -- LEFT SIDEBAR (Slide List / Navigator) -- */
.ds-editor-sidebar {
  background: #fff;
  border-right: 2px solid #111;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 280px !important;
  flex-shrink: 0 !important;
}

.ds-editor-sidebar.ds-right {
  border-right: none;
  border-left: 2px solid #111;
}

.ds-sidebar-head {
  padding: 14px 18px;
  border-bottom: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #faf9f6;
}

.ds-sidebar-head h3 {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #111;
  margin: 0;
}

.ds-sidebar-head .ds-btn-group {
  display: flex;
  gap: 6px;
}

.ds-add-slide-btn {
  width: 30px;
  height: 30px;
  border: 2px solid #111;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  box-sizing: border-box;
}

.ds-add-slide-btn:hover {
  background: #111;
}

.ds-add-slide-btn:hover svg {
  stroke: #fff;
}

.ds-add-slide-btn svg {
  display: block;
  stroke: #111;
}

.ds-slide-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ds-slide-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #fff;
  border: 2px solid #111;
  flex-shrink: 0;
  cursor: grab;
  margin-left: auto;
}

.ds-slide-handle:hover {
  background: #ffe600;
}

.ds-slide-handle:active {
  cursor: grabbing;
  background: #111;
}

.ds-slide-handle:active svg {
  fill: #fff;
}

.ds-slide-handle svg {
  display: block;
}

.ds-slide-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid #111;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  margin-bottom: 10px;
  min-height: 60px;
}

.ds-slide-nav-item.active {
  background: #fffbe6;
  border-color: #111;
}

/* Sortable.js drag feedback (matching Inventory Builder) */
#sortableSlides .reorder-ghost {
  opacity: 1 !important;
  background: #fffbe6 !important;
  border-color: #ffe600 !important;
}

#sortableSlides .reorder-chosen {
  cursor: grabbing;
  background: #ffe600 !important;
}

.ds-slide-nav-thumb {
  width: 72px;
  height: 44px;
  background: #f0f0f2;
  border: 2px solid #111;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds-slide-nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ds-slide-nav-thumb svg {
  width: 18px;
  height: 18px;
  stroke: #888;
}

.ds-slide-nav-info {
  font-size: 0.8rem;
  font-weight: 800;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.ds-empty-slides {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* -- SIDEBAR FOOTER (Delete / actions) -- */
.ds-sidebar-footer {
  padding: 14px 18px;
  border-top: 2px solid #111;
  background: #faf9f6;
  flex-shrink: 0;
}

.ds-delete-slide-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #e33;
  border: 2px solid #e33;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s;
  width: fit-content;
}

.ds-delete-slide-btn:hover {
  background: #e33;
  color: #fff;
  transform: none;
}

.ds-delete-slide-btn svg {
  width: 14px;
  height: 14px;
  stroke: #e33;
}

.ds-delete-slide-btn:hover svg {
  stroke: #fff;
}

/* -- CENTER CANVAS (Preview) -- */
/* (consolidated with the primary definition above) */

.ds-canvas-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--soft);
  padding: 0;
  border-radius: 0;
}

.ds-tool-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s;
}

.ds-tool-btn.active {
  background: #fff;
  color: var(--ink);
}

.ds-border-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  cursor: pointer;
}
.ds-border-btn svg {
  display: block;
}
.ds-border-btn.active {
  background: #ffe600;
  color: #111;
}
.ds-border-btn:hover {
  background: #ffe600;
  color: #111;
}
.ds-toolbar-divider {
  width: 2px;
  height: 24px;
  background: #111;
  flex-shrink: 0;
  margin: 0 8px;
}
.ds-viewport.border-sharp { border-radius: 0; }
.ds-viewport.border-small { border-radius: 18px; overflow: hidden; }
.ds-viewport.border-big { border-radius: 32px; overflow: hidden; }
.ds-viewport.border-capsule { border-radius: 40px; overflow: hidden; }

.ds-canvas-info {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.ds-viewport-container {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  position: relative;
  background: #fff;
  min-height: 0;
  padding: 0;
}

.ds-viewport-container.drag-over-canvas .ds-viewport {
  box-shadow: 0 0 0 4px #3b82f6;
}

.ds-viewport-container.drag-over-canvas::after {
  content: "Drop image to upload";
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #3b82f6;
  color: #fff;
  padding: 8px 16px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  z-index: 100;
}

/* Viewport Shell and Scaling Engine Layer Definitions */
.viewport-shell {
  overflow-anchor: none !important;
}

.viewport-scale-wrapper {
  position: relative !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  overflow: visible !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  margin: 0 auto !important;
}

.viewport-scale-layer {
  transform-origin: top center !important;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  pointer-events: auto;
  display: block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.viewport-content {
  image-rendering: auto;
}

.ds-viewport {
  background: transparent;
  border: none !important;
  outline: none !important;
  border-radius: 0;
  box-sizing: border-box;
  overflow: visible !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  max-width: none !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

#heroMount {
  width: 100%;
  min-height: 420px;
  flex-shrink: 0;
  display: block;
  contain: layout paint;
}

.ds-viewport .hero-section {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ds-viewport .hero-frame {
  border: none !important;
  box-sizing: border-box !important;
  border-radius: 0 !important;
}

.ds-viewport .hero-slider {
  position: relative !important;
  width: 100% !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: var(--paper) !important;
  border-radius: var(--hero-radius) !important;
}

.ds-viewport .hero-slider .hero-art-shell,
.ds-viewport .hero-slider .hero-art,
.ds-viewport .hero-slider .hero-art img {
  border-radius: var(--hero-radius) !important;
  overflow: hidden !important;
}

.ds-viewport .hero-slider .hero-art-shell {
  clip-path: inset(0 round var(--hero-radius)) !important;
}

.ds-viewport .hero-inner,
.ds-viewport .hero-content,
.ds-viewport .hero-section {
  border: none !important;
  outline: none !important;
}

/* Desktop viewport mode — size is set by JS, not min-height clamped */
.ds-viewport.mode-desktop {
  width: 1400px !important;
}

.ds-viewport.mode-tablet {
  width: 768px !important;
}

.ds-viewport.mode-mobile {
  width: 390px !important;
}

/* Tablet Overrides for Preview */
.ds-viewport.mode-tablet .hero-frame {
  padding: 40px 60px !important;
  gap: 30px !important;
}

.ds-viewport.mode-tablet .hero-title {
  font-size: 2.8rem !important;
}

/* Portfolio Drag & Drop */
.bento-card {
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.3s ease, box-shadow 0.3s ease;
  cursor: grab;
  user-select: none;
}

.bento-card:active {
  cursor: grabbing;
}

.bento-card.dragging {
  opacity: 0.4;
  transform: none;
  z-index: 100;
}

.bento-card.drag-over {
  transform: none;
  border-color: var(--ink);
}

.portfolio-bento {
  transition: all 0.4s ease;
}



/* Mobile Overrides for Preview */
.ds-viewport.mode-mobile .hero-frame {
  flex-direction: column-reverse !important;
  padding: 40px 24px !important;
  gap: 20px !important;
  text-align: center !important;
  align-items: center !important;
}

.ds-viewport.mode-mobile .hero-copy {
  align-items: center !important;
  text-align: center !important;
  max-width: 100% !important;
}

.ds-viewport.mode-mobile .hero-title {
  font-size: 2.2rem !important;
}

.ds-viewport.mode-mobile .hero-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 200px;
}

.ds-viewport.mode-mobile .hero-art-container {
  flex-shrink: 0;
}

.ds-viewport.mode-mobile .hero-art {
  width: 100% !important;
  max-width: 320px !important;
  height: auto !important;
  object-fit: contain;
}

/* Add Image Placeholder */
.ds-add-img-placeholder {
  width: 200px;
  height: 200px;
  border: 2px dashed var(--border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--soft);
}

.ds-add-img-placeholder:hover {
  border-color: var(--ink);
  background: #fff;
}

.ds-add-img-placeholder svg {
  color: var(--muted);
}

.ds-add-img-placeholder span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Safe Area Guide Overlay */
.ds-safe-area-guide {
  position: absolute;
  inset: 20px;
  border: 1px dashed rgba(59, 130, 246, 0.3);
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.ds-viewport:hover .ds-safe-area-guide {
  opacity: 1;
}

.ds-guide-label {
  background: rgba(59, 130, 246, 0.8);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 0;
  margin-bottom: 10px;
}

/* -- RIGHT SIDEBAR (Controls) -- */
.ds-editor-controls {
  background: var(--paper);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.ds-controls-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

.ds-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: transparent;
  flex-shrink: 0;
}

.ds-delete-slide-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff0f0;
  color: #ff4d4d;
  border: 1px solid #ffcccc;
  padding: 8px 14px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: fit-content;
}

.ds-delete-slide-btn:hover {
  background: #ffe0e0;
  border-color: #ff9999;
}

.ds-delete-slide-btn svg {
  color: #ff4d4d;
}

/* Accordion Component */
.ds-accordion {
  border-bottom: 1px solid var(--border);
}

.ds-accordion-trigger {
  width: 100%;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.15s;
}

.ds-accordion-trigger:hover {
  background: var(--soft);
}

.ds-accordion-trigger svg {
  transition: transform 0.3s;
  color: var(--muted);
}

.ds-accordion.open .ds-accordion-trigger svg {
  transform: rotate(180deg);
}

.ds-accordion-content {
  padding: 0 20px 20px;
  display: none;
}

.ds-accordion.open .ds-accordion-content {
  display: block;
}

/* Control Elements */
.ds-control-group {
  margin-top: 16px;
}

.ds-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ds-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-slider-row input[type="range"] {
  flex: 1;
}

.ds-slider-val {
  font-size: 11px;
  font-family: monospace;
  color: var(--muted);
  width: 24px;
}

.ds-color-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ds-color-input-wrap input[type="color"] {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 2px;
  cursor: pointer;
  background: none;
}

.ds-field-sm {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 12px;
  font-family: monospace;
}

/* Segmented Control */
.ds-segmented-control {
  display: flex;
  background: var(--soft);
  padding: 3px;
  border-radius: 0;
  gap: 2px;
}

.ds-segmented-control button {
  flex: 1;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  cursor: pointer;
}

.ds-segmented-control button.active {
  background: #ffe600;
  color: #111;
}

/* Reset Button — now defined in image-editor section */

.ds-danger-zone {
  margin-top: 32px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

/* -- Visual Polish for Canvas Content -- */
.hero-art-container {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.ds-resize-handle {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: #3b82f6;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: nwse-resize;
  display: none;
}

.hero-art-container:hover .ds-resize-handle {
  display: block;
}

.ds-viewport [contenteditable] {
  outline: none;
  border-radius: 0;
  transition: box-shadow 0.2s;
}

.ds-viewport [contenteditable]:hover {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.ds-viewport [contenteditable]:focus {
  box-shadow: 0 0 0 2px #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

/* ===== SLIDE RIGHT PANEL TABS (Design / Upload / Settings / BG) ===== */
.slide-tab-bar {
  display: flex;
  border-bottom: 2px solid #111;
  background: #faf9f6;
  flex-shrink: 0;
}

.slide-tab {
  flex: 1;
  padding: 10px 4px;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  color: #888;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -2px;
}

.slide-tab:hover { color: #555; }

.slide-tab.active {
  color: #111;
  border-bottom-color: #111;
}

.slide-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.slide-tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.slide-tab-panel.active {
  display: flex;
}

.slide-tab-footer {
  padding: 14px 18px;
  border-top: 1px solid #111;
  background: #faf9f6;
  flex-shrink: 0;
}

.slide-tab-footer .ds-btn {
  width: 100%;
}

/* Upload zone shared style */
.ds-upload-zone {
  border: 2px dashed #111;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: #faf9f6;
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  transition: background 0.15s;
}

.ds-upload-zone:hover {
  background: #f0efe8;
}

.ds-upload-zone-lg {
  padding: 32px 20px;
}

.ds-upload-zone-lg span {
  display: block;
  margin-top: 4px;
}

/* Color input shared style */
.color-input {
  width: 100%;
  height: 36px;
  cursor: pointer;
  border: 2px solid #111;
  padding: 0;
  background: none;
  box-sizing: border-box;
}

.color-label {
  display: block;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  margin-bottom: 4px;
}

/* Style group sections in STYLE tab — HPB card style */
.ds-style-group {
  border: 2px solid #111;
  background: #fff;
  padding: 16px;
  margin-bottom: 14px;
}
.ds-style-group:last-child {
  margin-bottom: 0;
}
.ds-style-group-title {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111;
  margin: 0 0 12px 0;
  padding: 0 0 8px 0;
  border-bottom: 2px solid #111;
}
.ds-style-group > div {
  margin-bottom: 10px;
}
.ds-style-group > div:last-child {
  margin-bottom: 0;
}

/* Color swatch + label row */
.ds-color-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  overflow: visible;
  min-height: 36px;
}
.ds-color-label {
  font-size: 10px;
  font-weight: 700;
  color: #111;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-color-swatch {
  width: 32px;
  height: 32px;
  border: 2px solid #111;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  display: block;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}
.ds-color-swatch:focus {
  outline: none;
}
.ds-color-swatch:hover {
  border-color: #111;
}
.ds-color-hidden {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  z-index: 2;
}

.ds-range {
  width: 100%;
  accent-color: #111;
}

/* ===== HOMEPAGE BUILDER TABS (Create / Saved) ===== */
.builder-tab-nav {
  display: flex;
  border-bottom: 2px solid #111;
  background: #faf9f6;
  flex-shrink: 0;
}

.builder-tab {
  flex: 1;
  text-align: center;
  padding: 10px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -2px;
}

.builder-tab:hover { color: #555; }

#builderSidebar:has(#builder-create-panel:target) .builder-tab[href="#builder-create-panel"],
#builderSidebar:has(#builder-saved-panel:target) .builder-tab[href="#builder-saved-panel"],
#builderSidebar:not(:has(.builder-tab-panel:target)) .builder-tab[href="#builder-create-panel"] {
  color: #111;
  border-bottom-color: #111;
}

.builder-tab-content { display: flex; flex: 1; overflow: hidden; }
.builder-tab-panel { display: none; flex-direction: column; flex: 1; overflow-y: auto; }
.builder-tab-panel:target { display: flex; }
#builderSidebar:not(:has(.builder-tab-panel:target)) #builder-create-panel { display: flex; }


.ds-sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-sidebar-header h3 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8c8c9e;
}

.ds-slide-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ds-slide-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 0;
  background: #fff;
  border: 2px solid #111;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-bottom: 10px;
  min-height: 60px;
}

.ds-slide-nav-item:hover {
  background: #f5f4f0;
  border-color: #111;
}

.ds-slide-nav-item.active {
  background: #fffbe6;
  border-color: #111;
}

.ds-slide-nav-thumb {
  width: 40px;
  height: 40px;
  border-radius: 0;
  background: #ddd;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid #111;
}

.ds-slide-nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ds-slide-nav-thumb svg {
  width: 16px;
  height: 16px;
  opacity: 0.4;
}

.ds-slide-nav-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CENTER CANVAS */
/* (consolidated with the primary definition above) */

.ds-status-indicator {
  font-size: 10px;
  font-weight: 800;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ds-status-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.ds-preview-container {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.ds-preview-container .hero-section {
  width: 100%;
  max-width: 1100px;
  background: #fff;
  padding: 0 !important;
  overflow: hidden;
}

/* SETTINGS PANEL */
.ds-settings-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.ds-form-section {
  margin-bottom: 24px;
}

.ds-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: #8c8c9e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.ds-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e2e8;
  border-radius: 0;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  background: #f9f9fb;
}

.ds-input:focus {
  border-color: var(--ink);
  background: #fff;
}

.ds-upload-zone {
  width: 100%;
  min-height: 120px;
  aspect-ratio: auto;
  border: 2px dashed #e2e2e8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s;
  background: #f9f9fb;
}

.ds-upload-zone:hover {
  border-color: var(--ink);
  background: #fff;
}

.ds-upload-preview {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9c9ca9;
  font-weight: 700;
  font-size: 12px;
}

.ds-color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ds-color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ds-color-item span {
  font-size: 10px;
  font-weight: 700;
  color: #8c8c9e;
}

.ds-color-item input[type="color"] {
  width: 100%;
  height: 38px;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.ds-premium-slot-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.ds-premium-slot-item.active {
  background: white;
}

.ds-premium-slot-item.active::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 14px;
  width: 4px;
  background: var(--accent-black);
}

.ds-divider {
  height: 1px;
  background: #f0f0f4;
  margin: 24px 0;
}

.ds-full {
  width: 100%;
  justify-content: center;
}

.ds-danger-zone {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f0f0f4;
}

.ds-empty-slides {
  padding: 40px;
  text-align: center;
  color: #9c9ca9;
  font-weight: 600;
  font-size: 13px;
}

/* Polished Scrollbars */
.ds-settings-scroll::-webkit-scrollbar,
.ds-slide-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}


/* ===== MODALS ===== */
.ds-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ds-modal-overlay.open {
  display: flex;
}

.ds-modal {
  background: #fff;
  width: min(800px, 100%);
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.ds-modal-sm {
  width: min(400px, 100%);
}

.ds-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ds-modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* Product Editor Modal Overhaul */
.ds-modal-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: start;
}

.ds-modal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ds-modal-main {
  background: #fbfbfd;
  border-radius: 0;
  border: 1px solid var(--border);
  padding: 24px;
}

.ds-modal-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
  overflow: hidden;
  margin-bottom: 0 !important;
}

.ds-modal-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ds-modal-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
}

.ds-add-item-btn {
  background: var(--soft);
  border: 1px solid var(--border);
  width: 24px;
  height: 24px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ds-add-item-btn:hover {
  background: var(--ink);
  color: #fff;
}

.ds-item-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ds-form-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ds-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ds-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.ds-color-row,
.ds-variant-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #f9f9fb;
  padding: 8px;
  border-radius: 0;
  border: 1px solid var(--border);
}

.ds-color-row input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 0;
  cursor: pointer;
  background: none;
}


.ds-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 0;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.ds-drop-zone:hover {
  border-color: var(--ink);
  background: #f9f9fb;
  color: var(--ink);
}

.ds-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .ds-modal-layout {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Improvements */
.ds-activity-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-light);
}

.ds-activity-item:last-child {
  border-bottom: none;
}

.ds-activity-item:hover {
  background: var(--bg-hover);
}

.ds-dash-thumb {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}

.ds-dash-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.ds-activity-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-activity-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ds-activity-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.ds-status-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  min-width: 8px;
}

.ds-status-dot::before {
  display: none;
}

.ds-graph-container {
  min-height: 160px;
  width: 100%;
  margin-top: 10px;
  position: relative;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-md);
  padding: 20px 15px;
}

.ds-graph-container svg {
  display: block;
  width: 100%;
  height: 120px;
}

.ds-graph-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding: 0 10px;
  width: 100%;
}

.ds-graph-labels span {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
  text-align: center;
}

.ds-horizontal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 10px;
}

.ds-low-stock-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.ds-low-stock-card:hover {
  border-color: var(--ink);
}

.ds-low-stock-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border-light);
}

.ds-low-stock-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-low-stock-info strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.ds-empty-sm {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.01);
  border-radius: var(--radius-md);
}

.ds-panel-tools {
  display: flex;
  gap: 8px;
}

@media (max-width: 1200px) {
  #page-dashboard .ds-two-col {
    grid-template-columns: 1fr;
  }
}

/* ===== PREMIUM PORTFOLIO EDITOR REDESIGN ===== */
.portfolio-editor {
  grid-template-columns: 280px 1fr 340px !important;
  background: #F2F4F7 !important;
  height: calc(100vh - 64px - 40px) !important;
  /* Adjust for topbar */
}

.section-manager,
.settings-panel {
  background: #FFFFFF !important;
  display: flex;
  flex-direction: column;
  box-shadow: none !important;
  border: none !important;
}

.section-manager {
  border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.settings-panel {
  border-left: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.portfolio-canvas {
  background: #F2F4F7 !important;
  padding: 0 !important;
}

.premium-header {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px) !important;
  height: 64px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  padding: 0 24px !important;
}

/* scoped to portfolio editor — does NOT affect slides editor */
.portfolio-editor .ds-viewport-container,
.slides-viewport-wrap .ds-viewport-container {
  flex: 1;
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  padding: 40px 0;
  box-sizing: border-box;
}

.ds-storefront-frame {
  background: white;
  width: 100%;
  height: auto;
  min-height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.mock-browser-header {
  background: #fbfbfd;
  border-bottom: 1px solid var(--border);
  padding: 12px 40px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.mock-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
}

.mock-logo {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.mock-links {
  display: flex;
  gap: 24px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.mock-links strong {
  color: var(--ink);
  position: relative;
}

.mock-links strong::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
}

.mock-actions {
  display: flex;
  gap: 16px;
  color: var(--ink);
}

/* ── Mock Browser Footer ── */
.mock-browser-footer {
  background: #fbfbfd;
  border-top: 1px solid var(--border);
  padding: 40px;
  margin-top: 60px;
}

.mock-footer-content {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mock-footer-brand {
  font-weight: 900;
  font-size: 14px;
}

.mock-footer-copy {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}


.ds-storefront-frame::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}



.ds-section-info {
  flex: 1;
}

.ds-section-name {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
}

.ds-section-type {
  font-size: 10px;
  font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Settings UI Refinement */
.ds-settings-scroll {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.ds-collapsible-section {
  background: #F8F9FA;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0;
  margin-bottom: 12px;
  overflow: hidden;
}

.ds-collapsible-section.active {
  background: white;
  border-color: rgba(0, 0, 0, 0.1);
}

.ds-section-trigger {
  padding: 16px;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.ds-section-content {
  padding: 0 16px 16px;
}

/* Compact Actions */
.ds-head-actions {
  display: flex;
  gap: 8px;
}

.ds-icon-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 0;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.ds-icon-btn-sm:hover {
  background: var(--accent-black);
  color: white;
}

.ds-canvas-actions {
  display: flex;
  gap: 8px;
}

.ds-status-indicator {
  font-size: 10px;
  font-weight: 800;
  color: #10B981;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ds-status-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

/* Redesigned Dashboard Classes */
.ds-stats-row-v2 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-md);
}

@media (max-width: 1200px) {
  .ds-stats-row-v2 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (max-width: 768px) {
  .ds-stats-row-v2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .ds-stats-row-v2 {
    grid-template-columns: 1fr !important;
  }
}

.ds-mini-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
@media (max-width: 1024px) {
  .ds-mini-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 640px) {
  .ds-mini-stats-row {
    grid-template-columns: 1fr !important;
  }
}

.ds-btn-group-neobrutal {
  display: flex;
  background: #ffffff;
  border: 3px solid #111111;
  overflow: hidden;
}

.ds-metric-btn {
  background: #ffffff;
  color: #111111;
  border: none;
  border-right: 2px solid #111;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 100ms ease;
}

.ds-metric-btn:last-child {
  border-right: none;
}

.ds-metric-btn.active, .ds-metric-btn:hover {
  background: #ffe600;
  color: #111111;
}

/* Funnel bars */
.funnel-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.funnel-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-bar-label {
  width: 130px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #111;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.funnel-bar-outer {
  flex: 1;
  background: #faf9f6;
  border: 2px solid #111;
  border-radius: 0;
  height: 24px;
  position: relative;
  overflow: hidden;
}

.funnel-bar-fill {
  height: 100%;
  background: #ffd21e;
  border-right: 2px solid #111;
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.funnel-bar-value {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 900;
  color: #111;
}

.funnel-dropoff {
  font-size: 10px;
  font-weight: 700;
  color: #888;
  padding-left: 142px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Event row feed */
.ds-activity-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  border-bottom: 2px solid #111;
  background: #fff;
  color: #111;
  min-height: 28px;
}
.ds-activity-chip:last-child {
  border-bottom: none;
}
.ds-activity-chip svg {
  flex-shrink: 0;
  display: block;
}

.ds-activity-time {
  margin-left: auto;
  font-size: 0.58rem;
  color: #888;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Alerts logger */
.ds-alert-item {
  background: #fff;
  border: 2px solid #111;
  padding: 4px 10px;
  min-height: 36px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
}

.ds-alert-item + .ds-alert-item {
  border-top: 0;
}

.ds-alert-icon {
  width: 4px;
  height: 24px;
  align-self: center;
  background: currentColor;
  flex-shrink: 0;
  display: block;
}

.ds-alert-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ds-alert-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ds-alert-time {
  flex-shrink: 0;
  font-size: 10px;
  color: #888;
  font-weight: 700;
}

/* SVG Chart styles */
.chart-axis-line {
  stroke: #111111;
  stroke-width: 2.5;
}

.chart-grid-line {
  stroke: #ededf0;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.chart-data-path {
  fill: none;
  stroke: #ffd21e;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-data-path-compare {
  fill: none;
  stroke: #18aeea;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 2;
}

.chart-fill-path {
  fill: url(#chartGradient);
  opacity: 0.15;
}

.chart-data-dot {
  fill: #ffffff;
  stroke: #111111;
  stroke-width: 2.5;
  cursor: pointer;
  transition: r 0.1s ease;
}

.chart-data-dot:hover {
  r: 6;
}

.chart-data-dot-compare {
  fill: #ffffff;
  stroke: #18aeea;
  stroke-width: 2.5;
  cursor: pointer;
}

.chart-tooltip {
  position: absolute;
  background: #ffffff;
  border: 2px solid #111;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
}

.ds-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 1024px) {
  .ds-three-col {
    grid-template-columns: 1fr !important;
  }
}

/* ===== REDESIGN STYLE SYSTEM ===== */
.ds-stats-row-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.ds-quick-nav-sticky {
  /* Deprecated — tabs moved to topbar. Kept for fallback. */
  display: flex;
  gap: 8px;
}

.ds-quick-nav-btn {
  background: #fff;
  color: #111;
  border: 2px solid #111;
  border-radius: 0;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ds-quick-nav-btn:hover {
  background: #ffe600;
}

.ds-quick-nav-btn.active {
  background: #ffe600;
  color: #111;
  border: 3px solid #111;
}

/* Collapsible Group */
.ds-collapsible-panel {
  background: #fff;
  border: 3px solid #111;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ds-collapsible-header {
  background: #fff;
  padding: 16px 24px;
  border-bottom: 3px solid #111;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.ds-collapsible-header:hover {
  background: #faf9f6;
}

.ds-collapsible-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ds-collapsible-title {
  font-size: 1.2rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0;
}

.ds-collapsible-summary-grid {
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #666;
  flex-wrap: wrap;
}

.ds-collapsible-summary-item span {
  color: #111;
  font-weight: 900;
}

.ds-collapsible-arrow {
  font-size: 1.2rem;
  font-weight: 900;
  transition: transform 0.2s ease;
}

.ds-collapsible-arrow.open {
  transform: rotate(180deg);
}

.ds-collapsible-content {
  display: none;
  padding: 24px;
  background: #fff;
}

.ds-collapsible-content.open {
  display: block;
}

/* Tabs system */
.ds-tab-header-group {
  display: flex;
  border-bottom: 3px solid #111;
  margin-bottom: 20px;
  gap: 4px;
  overflow-x: auto;
}

.ds-tab-btn {
  background: #fff;
  color: #111;
  border: 3px solid #111;
  padding: 8px 16px;
  font-weight: 900;
  font-size: 0.8rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  bottom: -3px;
  white-space: nowrap;
}

.ds-tab-btn:hover {
  background: #faf9f6;
}

.ds-tab-btn.active {
  background: #ffd21e;
  z-index: 2;
}

.ds-tab-content-panel {
  display: none;
}

.ds-tab-content-panel.active {
  display: block;
}

/* Floating Alerts */
.floating-alert-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
}

.floating-alert-trigger {
  width: 56px;
  height: 56px;
  border-radius: 0;
  background: #ffe600;
  color: #111;
  border: 3px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.floating-alert-trigger:hover {
  background: #111;
  color: #fff;
}

.floating-alert-trigger.active {
  background: #111;
  color: #fff;
}

.floating-alert-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ffd21e;
  color: #111;
  border: 2px solid #111;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-alert-panel {
  display: none;
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  background: #fff;
  border: 3px solid #111;
  flex-direction: column;
  overflow: hidden;
  max-height: 400px;
}

.floating-alert-panel.open {
  display: flex;
}

.floating-alert-header {
  background: #fff0f3;
  padding: 12px 16px;
  border-bottom: 3px solid #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.floating-alert-header h4 {
  font-size: 0.9rem;
  font-weight: 900;
  color: #ff3366;
  text-transform: uppercase;
  margin: 0;
}

.floating-alert-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-alert-item {
  border: 2px solid #111;
  border-radius: 0;
  padding: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.floating-alert-item.danger {
  border-color: #ff3366;
  background: #fff0f3;
}

.floating-alert-item.warning {
  border-color: #ff9f43;
  background: #fffaf0;
}

.floating-alert-item-text {
  font-weight: 700;
  color: #111;
}

.floating-alert-item-time {
  font-size: 9px;
  color: #666;
  font-weight: 700;
  text-align: right;
}

/* Neobrutalist form control styling (applied globally for dashboard select/input) */
.ds-page .ds-field.ds-select,
.ds-neobrutalist-panel .ds-field.ds-select,
.ds-bh-split .ds-field.ds-select {
  border: 2px solid #111;
  font-weight: 800;
}

/* Sidebar neobrutalist styling updates */
.ds-sidebar-section-header {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  padding: 16px 14px 4px;
  border-top: 1px solid #d9d9d9;
  margin-top: 8px;
}

.ds-sidebar-section-header:first-of-type {
  border-top: none;
  margin-top: 0;
}

/* Unified panels */
.ds-neobrutalist-panel {
  background: #fff;
  border: 3px solid #111;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.ds-neobrutalist-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #111;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.ds-neobrutalist-panel-title {
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0;
}

/* Business Health Split layout */
.ds-bh-split {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  margin-top: 4px;
}

.ds-bh-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  height: 100%;
  align-content: start;
}

/* Ensure the fifth card stretches across if needed, or keep it neat */
.ds-bh-stats-grid .ds-stat-card:nth-child(5) {
  grid-column: span 2;
}

/* Operations summary row */
.ds-op-row {
  display: flex;
  justify-content: space-between;
  background: #faf9f6;
  padding: 6px 10px;
  border: 1.5px solid #111;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
}

.ds-op-row strong {
  font-weight: 900;
}

@media (max-width: 1024px) {
  .ds-bh-split {
    grid-template-columns: 1fr;
  }
  .ds-bh-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .ds-bh-stats-grid {
    grid-template-columns: 1fr;
  }
  .ds-bh-stats-grid .ds-stat-card:nth-child(5) {
    grid-column: span 1;
  }
}

/* ===== OVERLAP / LAYOUT FIXES (do not remove) ===== */

/* Scroll margin for anchored sections (targeted by topbar tabs) */
#section-business,
#section-inventory,
#section-blindbox,
#section-alerts,
#section-orders {
  scroll-margin-top: 80px;
}

/* Products grid consistent spacing */
/* Fixed-height panels: prevent content clipping */
.ds-panel-fixed-inventory {
  height: auto;
  min-height: 240px;
  max-height: 380px;
  overflow-y: auto;
}

.ds-panel-fixed-alerts {
  height: auto;
  min-height: 200px;
  max-height: 360px;
  overflow-y: auto;
}

/* ds-panel-body inside fixed panels: ensure scroll doesn't clip */
.ds-panel-fixed-inventory .ds-panel-body,
.ds-panel-fixed-alerts .ds-panel-body {
  overflow: visible;
  min-height: 0;
  flex: 1;
}

/* Prevent ds-bh-split contents from overflowing horizontally */
.ds-bh-split {
  overflow: hidden;
}

/* Prevent grid overflow — all dashboard grids */
#page-dashboard .ds-stats-row,
#page-dashboard .ds-two-col,
#page-analytics .ds-stats-row,
.ds-two-col,
.ds-three-col {
  min-width: 0;
}

/* Panel body overflow safety — prevent content from bleeding */
.ds-panel-body {
  overflow: auto;
  min-width: 0;
}

/* Live feed panel — prevent data from overflowing horizontally */
#dashLiveFeed {
  word-break: break-word;
}

/* Ensure ds-tab-content-panel doesn't clip/hide content */
.ds-tab-content-panel {
  overflow: visible;
}
.ds-tab-content-panel.active {
  overflow: visible;
}

/* Fix ds-two-col at narrow widths */
@media (max-width: 820px) {
  #page-dashboard .ds-two-col {
    grid-template-columns: 1fr;
  }
  .ds-two-col {
    grid-template-columns: 1fr;
  }
}

/* Floating alert: fixed positioning inside dashboard page */
.floating-alert-container {
  z-index: 10000;
}

/* Prevent page-switch flash overlap — only show active page */
.ds-page:not(.active):not(.show) {
  display: none !important;
}

/* ===== UNIFIED WIDGET SETTINGS DESIGN LANGUAGE ===== */
/* Neobrutalist: 2.5px black borders, 3-4px offset shadow, no radius, white bg */

.ds-widget-section {
  background: #fff;
  border: 2px solid #111;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ds-widget-header {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.ds-widget-sub {
  margin: 4px 0 0;
  color: #666;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.4;
}

.ds-widget-label {
  display: block;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #111;
  margin-bottom: 6px;
}

.ds-widget-field {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  outline: none;
  box-sizing: border-box;
}
.ds-widget-field:focus {
  background: #fffbe6;
}

.ds-widget-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ds-widget-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Toggle row: label left, switch right */
.ds-widget-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.ds-widget-toggle-info strong {
  display: block;
  font-size: 1rem;
  font-weight: 900;
  color: #111;
  line-height: 1.2;
}
.ds-widget-toggle-info p {
  margin: 4px 0 0;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Thick divider */
.ds-widget-divider {
  border: 0;
  border-top: 2px solid #111;
  margin: 0;
}

/* Upload dropzone */
.ds-widget-upload {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  border: 2px dashed #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.ds-widget-upload-icon-box {
  width: 36px;
  height: 36px;
  background: #f7f7f8;
  border: 1.5px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}
.ds-widget-upload-title {
  font-weight: 900;
  font-size: 0.8rem;
  color: #111;
  line-height: 1.2;
  margin-bottom: 2px;
}
.ds-widget-upload-sub {
  color: #999;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}
.ds-widget-upload-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ds-widget-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.ds-widget-upload-replace {
  margin-top: 12px;
  width: 100%;
  max-width: 180px;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  padding: 8px 4px;
  font-weight: 800;
  font-size: 0.75rem;
  text-align: center;
  cursor: pointer;
  display: none;
}

/* Slider group */
.ds-widget-slider {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-widget-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ds-widget-slider-val {
  font-size: 0.85rem;
  font-weight: 800;
  color: #111;
}
.ds-widget-slider input[type="range"] {
  width: 100%;
  accent-color: #111;
  cursor: pointer;
  height: 6px;
}

/* Audio card */
.ds-widget-audio-card {
  border: 2px solid #111;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ds-widget-audio-card-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ds-widget-audio-icon {
  width: 40px;
  height: 40px;
  border: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
}
.ds-widget-audio-info {
  flex: 1;
  min-width: 0;
}
.ds-widget-audio-info h5 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #111;
}
.ds-widget-audio-status {
  font-size: 0.7rem;
  font-weight: 800;
  color: #888;
  display: block;
  margin-top: 3px;
}
.ds-widget-audio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1.5px solid #111;
  padding-top: 12px;
  margin-top: 4px;
}

/* Audio card alternate background tints */
.ds-widget-audio-icon.is-pink  { background: #ffeef4; }
.ds-widget-audio-icon.is-amber { background: #fffbeb; }
.ds-widget-audio-icon.is-blue  { background: #eef2ff; }
.ds-widget-audio-icon.is-red   { background: #fef2f2; }
.ds-widget-audio-icon.is-green { background: #f0fdf4; }
.ds-widget-audio-icon.is-violet { background: #faf5ff; }

/* BGM banner card */
.ds-widget-bgm-card {
  border: 2px solid #111;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  position: relative;
  overflow: hidden;
}
.ds-widget-bgm-vinyl {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, #222 30%, #000 70%);
  border: 3px solid #111;
  opacity: 0.04;
  pointer-events: none;
  z-index: 1;
}
.ds-widget-bgm-vinyl-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ff66a3;
  border: 2px solid #111;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.ds-widget-bgm-body {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 2;
}
.ds-widget-bgm-icon {
  width: 48px;
  height: 48px;
  border: 2px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f5f3ff;
}
.ds-widget-bgm-info {
  flex: 1;
  min-width: 0;
}
.ds-widget-bgm-info h5 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ds-widget-bgm-info p {
  margin: 4px 0 0;
  color: #666;
  font-size: 0.8rem;
  font-weight: 600;
}
.ds-widget-bgm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 2px solid #111;
  padding-top: 16px;
  margin-top: 4px;
  position: relative;
  z-index: 2;
}

/* Checkbox label row */
.ds-widget-check {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
  color: #111;
}
.ds-widget-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #111;
  cursor: pointer;
}

/* Flex side-by-side */
.ds-widget-flex {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  width: 100%;
}
.ds-widget-flex-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.ds-widget-flex-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== UNIFIED WIDGET PAGE LAYOUT ===== */
/* Wraps the entire page content in consistent neobrutalist sections */

.ds-widget-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0;
  width: 100%;
}

.ds-widget-page .ds-widget-section {
  background: #fff;
  border: 2px solid #111;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Section header with title + optional end actions */
.ds-widget-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}

.ds-widget-section-head .ds-widget-header {
  margin: 0;
}

/* Tighter panel variant — used inside dashboards */
.ds-widget-panel {
  background: #fff;
  border: 2px solid #111;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ds-widget-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #111;
}

.ds-widget-panel-title {
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #111;
  margin: 0;
}

.ds-widget-panel-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Stat card grid inside widget sections */
.ds-widget-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.ds-widget-stat {
  background: #fff;
  border: 2px solid #111;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-widget-stat:hover {
  background: #fffbe6;
}
.ds-widget-stat-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
}
.ds-widget-stat-value {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #111;
  line-height: 1.1;
}
.ds-widget-stat-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
}

/* Action/filter bar inside widget sections */
.ds-widget-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #faf9f6;
  border: 2px solid #111;
  padding: 10px 16px;
}

.ds-widget-action-bar-label {
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: #111;
  white-space: nowrap;
  margin: 0;
}

.ds-widget-action-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Search bar inside widget pages */
.ds-widget-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 2px solid #111;
  padding: 10px 14px;
  min-width: 200px;
}
.ds-widget-search input {
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  background: none;
  outline: none;
  width: 100%;
  color: #111;
  min-width: 50px;
}
.ds-widget-search input::placeholder {
  color: #999;
  font-weight: 600;
}

/* Two-column inside widget sections */
.ds-widget-two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* Three-column */
.ds-widget-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Responsive stat grid for game analytics etc */
.ds-widget-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

/* Unified modal design system */
.ds-widget-modal-overlay {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10000;
  backdrop-filter: blur(4px);
  padding: 20px;
}
.ds-widget-modal-overlay.open {
  display: flex !important;
}

.ds-widget-modal {
  background: #fff;
  border: 3px solid #111;
  width: min(1100px, 100%);
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ds-widget-modal-sm {
  width: min(440px, 100%);
}

.ds-widget-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 2px solid #111;
  gap: 8px;
}

.ds-widget-modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #111;
}

.ds-widget-modal-header p {
  margin: 4px 0 0;
  color: #666;
  font-weight: 600;
  font-size: 0.9rem;
}

.ds-widget-modal-close {
  width: 36px;
  height: 36px;
  border: 2px solid #111;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.ds-widget-modal-body {
  padding: 8px 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ds-widget-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 14px;
  border-top: 2px solid #111;
}

/* Color & Variant compact rows */
.ds-var-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  border-bottom: 1px solid #ddd;
  min-height: 36px;
}
.ds-var-color-swatch {
  width: 22px;
  height: 22px;
  border: 2px solid #111;
  cursor: pointer;
  padding: 0;
  background: none;
  flex-shrink: 0;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.ds-var-color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}
.ds-var-color-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 0;
}
.ds-var-name-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0;
  outline: none;
}
.ds-var-name-input:focus {
  border-bottom: 1.5px solid #111;
}
.ds-var-price-group {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
}
.ds-var-price-label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #999;
}
.ds-var-price-input {
  width: 42px;
  border: 2px solid #111;
  background: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 1px 3px;
  text-align: right;
  border-radius: 0;
}
.ds-var-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-var-remove-btn:hover svg { stroke: #dc2626; }
.ds-var-empty {
  padding: 6px 0;
  text-align: center;
  font-size: 0.7rem;
  color: #999;
}

/* Product grid inside widget pages — kept for compat */

/* Wizard steps / tab group inside widget settings */
.ds-widget-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 3px solid #111;
  overflow-x: auto;
  padding-bottom: 0;
}
.ds-widget-tab {
  background: #fff;
  border: 3px solid #111;
  border-bottom: none;
  border-radius: 0;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #111;
  cursor: pointer;
  position: relative;
  bottom: -3px;
  transition: background 0.15s;
  white-space: nowrap;
}
.ds-widget-tab.active {
  background: #ffd21e;
  z-index: 2;
}
.ds-widget-tab:hover:not(.active) {
  background: #f5f5f5;
}

/* Collapsible widget section */
.ds-widget-collapse {
  background: #fff;
  border: 2px solid #111;
  display: flex;
  flex-direction: column;
}
.ds-widget-collapse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  gap: 16px;
  user-select: none;
}
.ds-widget-collapse-title {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #111;
  margin: 0;
}
.ds-widget-collapse-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.ds-widget-collapse-summary-item {
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
}
.ds-widget-collapse-summary-item span {
  font-weight: 900;
  color: #111;
}
.ds-widget-collapse-arrow {
  font-size: 0.8rem;
  transition: transform 0.2s;
  color: #111;
}
.ds-widget-collapse.open .ds-widget-collapse-arrow {
  transform: rotate(180deg);
}
.ds-widget-collapse-body {
  padding: 0 20px 20px;
  display: none;
  flex-direction: column;
  gap: 16px;
  border-top: 2px solid #111;
  padding-top: 16px;
}
.ds-widget-collapse.open .ds-widget-collapse-body {
  display: flex;
}

/* Overflow container for tall lists inside widget sections */
.ds-widget-scroll {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 2px solid #111;
  padding: 8px;
  background: #faf9f6;
}

/* Row data inside widget panels */
.ds-widget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 1px solid #eee;
}
.ds-widget-row:last-child {
  border-bottom: none;
}
.ds-widget-row strong {
  font-weight: 900;
}

/* Metric toggle button group inside widget sections */
.ds-widget-metric-group {
  display: flex;
  border: 2px solid #111;
  overflow: hidden;
  background: #fff;
}
.ds-widget-metric-btn {
  background: #fff;
  color: #111;
  border: none;
  padding: 6px 12px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.03em;
}
.ds-widget-metric-btn:not(:last-child) {
  border-right: 2px solid #111;
}
.ds-widget-metric-btn.active {
  background: #ffe600;
}
.ds-widget-metric-btn:hover:not(.active) {
  background: #f5f5f5;
}

/* Status badge inside widget sections */
.ds-widget-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 2px solid #111;
  background: #fff;
}
.ds-widget-badge.live {
  background: #ffe600;
  color: #111;
}
.ds-widget-badge.danger {
  background: #ff3366;
  color: #fff;
  border-color: #111;
}

/* Graph container */
.ds-widget-graph {
  height: 240px;
  position: relative;
  min-height: 200px;
  border: 2px solid #111;
  background: #faf9f6;
  padding: 8px;
}

/* Grid layout helpers */
.ds-widget-main-sidebar {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

.ds-widget-main-sidebar-right {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}

/* Responsive overrides */
@media (max-width: 1024px) {
  .ds-widget-two-col,
  .ds-widget-main-sidebar,
  .ds-widget-main-sidebar-right {
    grid-template-columns: 1fr;
  }
  .ds-widget-three-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .ds-widget-section {
    padding: 20px 16px;
  }
  .ds-widget-modal {
    width: min(100%, 100%);
    border-radius: 0;
  }
  .ds-widget-modal-header {
    padding: 18px 20px 14px;
  }
  .ds-widget-modal-body,
  .ds-widget-modal-footer {
    padding: 16px 20px 20px;
  }
  .ds-widget-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ds-widget-stats-row {
    grid-template-columns: 1fr 1fr;
  }
.ds-widget-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #faf9f6;
  border-bottom: 2px solid #111;
  gap: 12px;
}
  .ds-widget-action-group {
    justify-content: center;
  }
  .ds-widget-collapse-summary {
    display: none;
  }
}

/* ===== HOMEPAGE BUILDER — WIDGET STYLE ===== */
#page-homepage-builder .ds-editor-sidebar {
  border-right: 2px solid #111;
  background: #fff;
}
/* ===== DASHBOARD COMPACT REDESIGN ===== */
#page-dashboard {
  gap: 10px !important;
}

/* Quick Alert Bar */
.ds-dash-alert-bar {
  background: #fff;
  border: 3px solid #111;
  min-height: 36px;
  padding: 0 14px;
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 800;
}
.ds-dash-alert-bar.show { display: flex; }
.ds-dash-alert-bar .ds-dash-alert-dot {
  width: 8px; height: 8px;
  border: 2px solid #111;
  background: #ffe600;
  flex-shrink: 0;
}
.ds-dash-alert-bar .ds-dash-alert-dot.danger { background: #dc2626; }

/* Compact section wrapper */
.ds-dash-section {
  background: #fff;
  border: 3px solid #111;
  padding: 14px;
}
.ds-dash-section.no-pad { padding: 0; }

/* ROW 1: Primary Business Overview */
.ds-dash-primary {
  display: grid;
  grid-template-columns: 305px 1fr;
  gap: 14px;
  align-items: stretch;
}

/* KPI Grid (2 columns x 3 rows) */
.ds-dash-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ds-dash-kpi-card {
  border: 3px solid #111;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ds-dash-kpi-label {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
}
.ds-dash-kpi-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: #111;
  line-height: 1.2;
}
.ds-dash-kpi-sub {
  font-size: 0.6rem;
  font-weight: 600;
  color: #666;
  line-height: 1.3;
}

/* Graph panel */
.ds-dash-graph-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ds-dash-graph-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ds-dash-graph-metrics {
  display: flex;
}
.ds-dash-graph-metrics .ds-metric-btn {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 4px 9px;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ds-dash-graph-metrics .ds-metric-btn + .ds-metric-btn {
  border-left: none;
}
.ds-dash-graph-metrics .ds-metric-btn.active {
  background: #111;
  color: #fff;
}
.ds-dash-graph-toolbar-right {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ds-dash-graph-toolbar-right select {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 4px 6px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  cursor: pointer;
  text-transform: uppercase;
}
.ds-dash-graph-area {
  border: 3px solid #111;
  background: #faf9f6;
  height: 215px;
  position: relative;
  overflow: hidden;
}
.ds-dash-graph-area svg {
  display: block;
}
#chartTooltip {
  position: absolute;
  background: #fff;
  border: 2px solid #111;
  padding: 6px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  pointer-events: none;
  display: none;
  z-index: 50;
  white-space: nowrap;
}

/* ROW 2: Command bar */
.ds-dash-cmd-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ds-dash-cmd-primary {
  display: flex;
  gap: 6px;
}
.ds-dash-cmd-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff;
  color: #111;
  border: none;
  border-bottom: 2px solid #eee;
  cursor: pointer;
}
.ds-dash-cmd-dropdown button:last-child { border-bottom: none; }
.ds-dash-cmd-dropdown button:hover { background: #ffe600; }

/* Inventory Health Cards (3-column) */
.ds-dash-inv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.ds-dash-inv-card {
  border: 2px solid #111;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 52px;
}
.ds-dash-inv-card .ds-dash-kpi-label { display: block; }

/* ROW 4: Operations Board (2-column) */
.ds-dash-ops-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 0;
}
.ds-dash-ops-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ds-dash-ops-title {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #111;
  padding-bottom: 4px;
  border-bottom: 2px solid #111;
  margin-bottom: 4px;
}
.ds-dash-ops-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 0;
  color: #333;
}
.ds-dash-ops-row strong {
  font-weight: 800;
  color: #111;
}
.ds-dash-ops-row .ds-dash-highlight {
  color: #dc2626;
  font-weight: 900;
}
.ds-dash-ops-scroll {
  font-size: 0.68rem;
  font-weight: 600;
  max-height: 84px;
  overflow-y: auto;
}
.ds-dash-ops-scroll div {
  padding: 2px 0;
}
.ds-dash-ops-value-box {
  border: 2px solid #111;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #555;
  margin-top: 4px;
}
.ds-dash-ops-value-box strong {
  font-size: 0.85rem;
  font-weight: 900;
  color: #111;
}

/* ROW 5: Blind Box Analytics (always open) */
.ds-dash-bb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ds-dash-bb-title {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #111;
  flex-shrink: 0;
}
.ds-dash-bb-metrics {
  display: flex;
  gap: 14px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #555;
}
.ds-dash-bb-metrics strong {
  font-weight: 900;
  color: #111;
}
.ds-dash-bb-body {
  border-top: 3px solid #111;
  padding-top: 12px;
  margin-top: 12px;
}
/* --- Blind Box Analytics layout (rebuild) --- */

/* ROW 6: Events panel */
.ds-dash-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}
.ds-dash-events-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}
.ds-dash-events-title {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #111;
  margin-right: 4px;
}
.ds-dash-events-tabs {
  display: flex;
}
.ds-dash-events-tabs button {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 3px 8px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: normal;
}
.ds-dash-events-tabs button + button { border-left: none; }
.ds-dash-events-tabs button.active { background: #111; color: #fff; }
.ds-dash-events-activity {
  margin-left: auto;
  font-size: 0.58rem;
  font-weight: 800;
  color: #888;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ds-dash-events-body {
  border: 2px solid #111;
  background: #faf9f6;
  max-height: 156px;
  overflow-y: auto;
  font-size: 0.68rem;
}
.ds-dash-events-body > div.ds-empty-sm {
  padding: 5px 10px;
  border-bottom: 1px solid #e5e5e5;
}

/* Extra controls row inside BB panel */
.ds-dash-bb-controls {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
}
.ds-dash-bb-controls button {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 5px 10px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ds-dash-bb-controls button + button { border-left: none; }
.ds-dash-bb-controls button.active { background: #111; color: #fff; }

/* Graph placeholder scaling */
.ds-dash-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  font-weight: 800;
  font-size: 0.8rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .ds-dash-primary { grid-template-columns: 1fr; }
  .ds-dash-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .ds-dash-inv-grid { grid-template-columns: 1fr 1fr; }
  .ds-dash-ops-board { grid-template-columns: 1fr 1fr; }

}
@media (max-width: 768px) {
  .ds-dash-kpi-grid { grid-template-columns: 1fr 1fr; }
  .ds-dash-inv-grid { grid-template-columns: 1fr; }
  .ds-dash-ops-board { grid-template-columns: 1fr; }
  .ds-dash-cmd-bar { flex-wrap: wrap; gap: 8px; }
}

/* BB tab pane visibility */
.ds-tab-pane.active { display: block !important; }
.ds-tab-pane:not(.active) { display: none !important; }

/* Scroll margin for dashboard section anchors */
#section-business,
#section-inventory,
#section-blindbox,
#section-alerts {
  scroll-margin-top: 52px;
}

#page-homepage-builder .ds-editor-sidebar .ds-widget-section-head,
#page-inventory-builder .ds-editor-sidebar .ds-widget-section-head {
  border-bottom: 2px solid #111;
  min-height: 48px;
}
#page-homepage-builder .ds-editor-controls,
#page-inventory-builder .ds-editor-controls {
  border-left: 2px solid #111;
  background: #fff;
  overflow: visible !important;
  display: flex !important; /* always visible */
}
#page-homepage-builder .ds-editor-controls[style*="display: flex"],
#page-homepage-builder .ds-editor-controls[style*="display:flex"],
#page-inventory-builder .ds-editor-controls[style*="display: flex"],
#page-inventory-builder .ds-editor-controls[style*="display:flex"] {
  overflow: visible !important;
}
#page-homepage-builder .ds-editor-controls .ds-widget-section-head,
#page-inventory-builder .ds-editor-controls .ds-widget-section-head {
  border-bottom: 2px solid #111;
  min-height: 48px;
}
#page-homepage-builder .ds-widget-action-bar,
#page-inventory-builder .ds-widget-action-bar {
  background: #fff;
  border-bottom: 2px solid #111;
  margin: 0;
}
#page-homepage-builder .ds-viewport-container,
#page-inventory-builder .ds-viewport-container {
  background: #eaeaea;
}

/* Legacy responsive overrides block removed to prevent conflicts with new unified layout system */

@media (max-width: 899px) {
  #page-inventory-builder #inventoryMobileTabs {
    display: flex !important;
  }

  /* Default hide all panels on mobile except what is toggled */
  #page-inventory-builder #inventorySidebar,
  #page-inventory-builder .ds-editor-canvas,
  #page-inventory-builder #inventorySettingsPanel {
    display: none !important;
    width: 100% !important;
    max-width: none !important;
    border: none !important;
  }

  /* Toggled panel visibility */
  #page-inventory-builder.mobile-collections #inventorySidebar {
    display: flex !important;
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
  }
  #page-inventory-builder.mobile-items .ds-editor-canvas {
    display: flex !important;
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
  }
  #page-inventory-builder.mobile-settings #inventorySettingsPanel {
    display: flex !important;
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
  }
}

/* ===== PRODUCTS PAGE — WIDGET STYLE ===== */
#page-products .ds-widget-section {
  border: 2px solid #111;
  background: #fff;
}
#page-products .ds-widget-action-bar {
  background: #fff;
  border-bottom: 2px solid #111;
}
/* ===== PRODUCT PAGE ===== */
#page-products {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#page-products .ds-prod-grid {
  min-height: 60px;
}
#page-products .ds-prod-scroll {
  padding: 16px 20px;
}
.ds-prod-main-frame {
  border: 2px solid #111;
  background: #fff;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ds-prod-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 2px solid #111;
  flex-shrink: 0;
}
.ds-prod-toolbar .ds-search-input {
  width: 200px;
  height: 34px;
  padding: 0 10px;
  border: 2px solid #111;
  font-size: 0.78rem;
  font-weight: 700;
  background: #f7f6f3;
  outline: none;
  flex-shrink: 0;
}
.ds-prod-toolbar .ds-search-input:focus {
  background: #fffbe6;
}
.ds-prod-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 14px;
  border-bottom: 2px solid #111;
  flex-shrink: 0;
  min-height: 34px;
}
.ds-prod-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  position: relative;
}
.ds-prod-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 2px solid #111;
  flex-shrink: 0;
  min-height: 44px;
  gap: 12px;
  background: #fff;
}
.ds-prod-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.ds-prod-toolbar-left svg { flex-shrink: 0; }
.ds-prod-toolbar-left input {
  border: 2px solid #111;
  outline: none;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111;
  height: 34px;
  width: 100%;
  max-width: 260px;
  background: #fff;
  border-radius: 0;
}
.ds-prod-toolbar-left input::placeholder { color: #bbb; font-weight: 600; }
.ds-prod-toolbar-left #productCount {
  font-size: 0.65rem;
  font-weight: 800;
  color: #888;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.ds-prod-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ds-prod-toolbar-right select {
  border: 2px solid #111;
  padding: 5px 10px;
  font-weight: 800;
  font-size: 0.65rem;
  background: #fff;
  text-transform: uppercase;
  height: 34px;
  cursor: pointer;
  border-radius: 0;
}
/* Filter + view mode row */
.ds-prod-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 2px solid #111;
  flex-shrink: 0;
  background: #f7f6f3;
  min-height: 40px;
}
.ds-prod-filter-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.ds-prod-filter-btn {
  background: #fff;
  border: 2px solid #111;
  border-right: none;
  padding: 4px 14px;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: #111;
  margin: 6px 0;
  border-radius: 0;
}
.ds-prod-filter-btn:last-child {
  border-right: 2px solid #111;
}
.ds-prod-filter-btn:hover {
  background: #ffe600;
}
.ds-prod-filter-btn.active {
  background: #ffe600;
  color: #111;
  border-color: #111;
}
.ds-prod-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 16px;
  position: relative;
}

/* Product grid — flat PAC.CO brutalist */
.ds-prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  row-gap: 16px;
  column-gap: 12px;
  align-items: stretch;
}
@media (min-width: 1600px) {
  .ds-prod-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
.ds-prod-card.selected {
  border-color: #111;
  border-width: 2px;
}
.ds-prod-card {
  background: #fff;
  border: 2px solid #111;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* View mode switcher */
.ds-view-mode-group {
  display: flex;
  border: 2px solid #111;
  overflow: hidden;
  flex-shrink: 0;
}
.ds-view-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  background: #fff;
  border: none;
  border-right: 2px solid #111;
  cursor: pointer;
  color: #111;
  padding: 0;
}
.ds-view-mode-btn:last-child { border-right: none; }
.ds-view-mode-btn:hover { background: #ffe600; }
.ds-view-mode-btn.active { background: #ffe600; color: #111; }

/* Product list view */
.ds-prod-grid-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.ds-prod-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid #111;
  padding: 8px 12px;
  min-height: 48px;
}
.ds-prod-row-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 2px solid #111;
  background: #f7f7f8;
  flex-shrink: 0;
}
.ds-prod-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ds-prod-row-name {
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 120px;
}
.ds-prod-row-status {
  font-size: 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border: 2px solid #111;
  white-space: nowrap;
}
.ds-prod-row-status.published {
  background: #fff;
  color: #111;
}
.ds-prod-row-status.draft {
  background: #eee;
  color: #888;
}
.ds-prod-row-cat {
  font-size: 0.6rem;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 80px;
}
.ds-prod-row-price {
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
  min-width: 60px;
}
.ds-prod-row-stock {
  font-size: 0.5rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 2px solid #111;
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
  background: #fff;
  color: #111;
}
.ds-prod-row-stock.low { color: #d97706; }
.ds-prod-row-stock.out { color: #dc2626; }
.ds-prod-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ds-prod-row-actions .ds-btn {
  padding: 4px 10px;
  font-size: 0.6rem;
  font-weight: 800;
}

/* Product details (table) view */
.ds-prod-grid-details {
  display: block;
  width: 100%;
  overflow-x: auto;
}
.ds-prod-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  table-layout: auto;
}

.ds-prod-table thead th {
  background: #fff;
  border: 2px solid #111;
  padding: 7px 8px;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}
.ds-prod-table tbody td {
  background: #fff;
  border: 2px solid #111;
  padding: 5px 8px;
  vertical-align: middle;
}
.ds-prod-table-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border: 2px solid #111;
  display: block;
}
.ds-prod-status-badge {
  font-size: 0.45rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border: 2px solid #111;
  display: inline-block;
  background: #fff;
  color: #111;
  white-space: nowrap;
}
.ds-prod-status-badge.new { background: #dff7f3; }
.ds-prod-status-badge.coming_soon { background: #ffd9a8; }
.ds-prod-status-badge.restocked { background: #fff24a; }
.ds-prod-status-badge.paused { background: #e6e7ec; }
.ds-prod-table-stock {
  font-size: 0.45rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border: 2px solid #111;
  display: inline-block;
  background: #fff;
  color: #111;
  white-space: nowrap;
}
.ds-prod-table-stock.low { color: #d97706; }
.ds-prod-table-stock.out { color: #dc2626; }
.ds-prod-table-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #111;
  margin-right: 4px;
  vertical-align: middle;
}
.ds-prod-table-actions {
  display: flex;
  gap: 4px;
}
.ds-prod-table-actions .ds-btn {
  padding: 3px 8px;
  font-size: 0.55rem;
  font-weight: 800;
}
.ds-prod-table-status {
  font-size: 0.45rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border: 2px solid #111;
  display: inline-block;
  white-space: nowrap;
}
.ds-prod-table-status.published {
  background: #fff;
  color: #111;
}
.ds-prod-table-status.draft {
  background: #eee;
  color: #888;
}

/* 3-column widget grid */
.ds-widget-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* ===== REDESIGNED DASHBOARD NEOBRUTALIST STYLES ===== */

/* Status Strip */


.ds-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ds-status-label {
  color: #666;
}

.ds-status-value {
  color: #111;
  font-weight: 900;
}

.ds-status-badge {
  padding: 2px 8px;
  border: 2px solid #111;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.badge-good {
  background: #2ecc71;
  color: #fff;
}

.badge-warning {
  background: #ff9f43;
  color: #111;
}

.badge-critical {
  background: #ff3366;
  color: #fff;
}

/* Action Row */
.ds-action-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.ds-more-dropdown-container {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.ds-more-dropdown-container .ds-dash-cmd-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 3px solid #111;
  min-width: 180px;
  z-index: 999;
  display: none;
}
.ds-more-dropdown-container .ds-dash-cmd-dropdown.open {
  display: block;
}

/* Row 1 Layout */
.ds-dash-row-1 {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 16px;
  align-items: stretch;
}

.ds-dash-kpi-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.ds-dash-kpi-card-new {
  background: #fff;
  border: 3px solid #111;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: none;
  border-radius: 0;
}

.ds-kpi-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.05em;
}

.ds-kpi-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: #111;
  line-height: 1.1;
  margin: 4px 0;
}

.ds-kpi-sub {
  font-size: 0.62rem;
  font-weight: 700;
  color: #888;
}

/* Chart Panel */
.ds-dash-chart-card {
  background: #fff;
  border: 3px solid #111;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  box-shadow: none;
  border-radius: 0;
}

.ds-dash-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  border-bottom: 2px solid #111;
  padding-bottom: 8px;
}

.ds-dash-chart-tabs {
  display: flex;
  gap: 0;
}

.ds-chart-tab {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border: 2px solid #111;
  background: #fff;
  color: #111;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ds-chart-tab + .ds-chart-tab {
  border-left: none;
}

.ds-chart-tab.active {
  background: #111;
  color: #fff;
}

.ds-dash-chart-timeframe select {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 6px;
  border: 2px solid #111;
  background: #fff;
  text-transform: uppercase;
  cursor: pointer;
}

.ds-dash-graph-container {
  flex: 1;
  position: relative;
  min-height: 130px;
}

/* Row 2: 3-Column Panels */
.ds-dash-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.ds-dash-panel-card {
  background: #fff;
  border: 3px solid #111;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  border-radius: 0;
}

.ds-panel-card-title {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #111;
  border-bottom: 2px solid #111;
  padding-bottom: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.ds-panel-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #111;
  border-bottom: 2px solid #111;
  padding-bottom: 6px;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.ds-panel-card-content {
  flex: 1;
  position: relative;
}

.ds-scroll-y {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scrollbar styles */
.ds-scroll-y::-webkit-scrollbar {
  width: 6px;
}
.ds-scroll-y::-webkit-scrollbar-track {
  background: #faf9f6;
  border-left: 2px solid #111;
}
.ds-scroll-y::-webkit-scrollbar-thumb {
  background: #111;
}

/* Action items list */
.action-item-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border: 2px solid #111;
  margin-bottom: 6px;
  font-size: 0.65rem;
  font-weight: 700;
}
.action-item-card.danger {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}
.action-item-card.warning {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}
.action-item-card.info {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
}

/* Top Product Card today */
.top-product-today-layout {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 100%;
}


.top-product-image-container {
  width: 72px;
  height: 72px;
  border: 2px solid #111;
  background: #faf9f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.top-product-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.top-product-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.top-product-name-new {
  font-size: 0.8rem;
  font-weight: 900;
  color: #111;
  line-height: 1.2;
}
.top-product-stats {
  font-size: 0.68rem;
  font-weight: 800;
  color: #555;
  margin-top: 4px;
}
.top-product-stats strong {
  color: #111;
}

/* Funnel bars */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Compact funnel inside BB KPI card */
.ds-bb-kpi-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ds-bb-kpi-content .funnel-step-bar-outer {
  height: 8px;
}
.ds-bb-kpi-content .funnel-step-header {
  font-size: 0.55rem;
}
.funnel-step-new {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.funnel-step-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  font-weight: 800;
  color: #111;
  text-transform: uppercase;
}
.funnel-step-bar-outer {
  height: 14px;
  border: 2px solid #111;
  background: #faf9f6;
  position: relative;
  overflow: hidden;
}
.funnel-step-bar-inner {
  height: 100%;
  background: #ffe600;
  border-right: 2px solid #111;
}
.funnel-step-bar-value {
  position: absolute;
  right: 6px;
  top: 0;
  font-size: 0.58rem;
  font-weight: 900;
  color: #111;
  line-height: 10px;
}

/* Row 3: Operations Grid */
.ds-dash-ops-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 16px;
  align-items: stretch;
}

.inventory-health-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}
.inventory-health-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 800;
}
.inventory-health-outer {
  height: 10px;
  border: 2px solid #111;
  background: #faf9f6;
  overflow: hidden;
}
.inventory-health-inner {
  height: 100%;
  background: #2ecc71;
  border-right: 2px solid #111;
}

.shipping-status-row-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 6px;
  border-bottom: 1.5px dashed #ccc;
}
.shipping-status-row-new:last-child {
  border-bottom: none;
}
.shipping-status-row-new strong {
  font-weight: 900;
  color: #111;
}
.shipping-status-row-new.highlight {
  background: #fee2e2;
  color: #dc2626;
  border: 1.5px solid #dc2626;
}

.ds-alert-item-new {
  display: flex;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 4px;
  border-bottom: 1px solid #eee;
}

.ds-latest-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.65rem;
  text-align: left;
}

.ds-latest-orders-table th {
  background: #111;
  color: #fff;
  padding: 6px 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.ds-latest-orders-table td {
  padding: 8px;
  border-bottom: 1.5px solid #111;
  font-weight: 700;
  vertical-align: middle;
}

.ds-latest-orders-table tr:hover td {
  background: #fdfcee;
}

.status-badge-new {
  display: inline-block;
  padding: 2px 6px;
  border: 1.5px solid #111;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.58rem;
}
.status-badge-new.paid {
  background: #dcfce7;
  color: #15803d;
}
.status-badge-new.shipped {
  background: #dbeafe;
  color: #1d4ed8;
}
.status-badge-new.pending {
  background: #fef3c7;
  color: #b45309;
}
.status-badge-new.packing {
  background: #f3e8ff;
  color: #6b21a8;
}
.status-badge-new.delivered {
  background: #f0fdf4;
  color: #166534;
}
.status-badge-new.failed {
  background: #fee2e2;
  color: #b91c1c;
}

.ds-dash-bb-grid {
  display: flex;
  flex-direction: column-reverse;
  gap: 16px;
}
@media (min-width: 1201px) {
  .ds-dash-bb-grid {
    height: auto;
  }
}

.ds-dash-bb-grid .ds-dash-panel-card {
  display: flex;
  flex-direction: column;
  height: auto;
}

.ds-dash-bb-grid .ds-panel-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

#dashBlindBoxGraph {
  flex: 1;
  width: 100%;
  position: relative;
  min-height: 250px;
}

.ds-dash-bb-kpi-stack-new {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
}
.ds-dash-bb-kpi-card-real {
  flex: 1;
}

.ds-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 3px solid #111;
  padding: 10px 16px;
  margin-bottom: 8px;
  box-shadow: none;
  border-radius: 0;
}


.ds-dash-bb-kpi-card-real {
  background: #fff;
  border: 3px solid #111;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  box-shadow: none;
  border-radius: 0;
}

.ds-bb-kpi-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.05em;
}

.ds-bb-kpi-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: #111;
  line-height: 1.1;
  margin-top: 4px;
}

/* Combined Category/Action Bar */
.ds-dash-combined-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff;
  border: 3px solid #111;
  padding: 8px 12px;
  margin-bottom: 16px;
  border-radius: 0;
}

.ds-dash-combined-bar .ds-dash-category-bar {
  margin-bottom: 0 !important;
}

.ds-dash-combined-bar .ds-action-row {
  margin-bottom: 0 !important;
}

/* Disable scrolling inside dashboard cards as per auto-height rule */
#page-dashboard .ds-scroll-y {
  max-height: none !important;
  overflow-y: visible !important;
  padding-right: 0 !important;
}

.ds-dash-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.ds-dash-bottom-grid .ds-scroll-y {
  max-height: none;
}

/* Responsive Overrides */
@media (max-width: 1200px) {
  .ds-dash-row-1 {
    grid-template-columns: 1fr;
  }
  .ds-dash-three-col {
    grid-template-columns: 1fr;
  }
  .ds-dash-ops-grid {
    grid-template-columns: 1fr;
  }
  .ds-dash-bb-grid {
    grid-template-columns: 1fr;
  }
  .ds-dash-bb-kpi-stack-new {
    flex-direction: column;
  }
  .ds-dash-bottom-grid {
    grid-template-columns: 1fr;
  }
  .ds-scroll-y {
    max-height: 250px;
  }
}

/* ==========================================
   Dashboard Category Switcher Bar & Grid Switching (Neobrutalist Styling)
   ========================================== */

/* Dashboard Category Switcher Bar */
.ds-dash-category-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.ds-category-tab {
  background: #ffffff;
  color: #111111;
  border: 3px solid #111111;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ds-category-tab:hover {
  background: #f5f5f5;
}

.ds-category-tab.active {
  background: #ffe600 !important;
  color: #111111 !important;
}

/* Widget Toggles */
.ds-widget-hidden {
  display: none !important;
}

.ds-row-empty {
  display: none !important;
}

/* KPI Grid Custom Stretching */
.ds-dash-kpi-grid-2x2.ds-grid-cols-4 {
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr 1fr !important;
}
.ds-dash-kpi-grid-2x2.ds-grid-cols-3 {
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: auto !important;
}
.ds-dash-kpi-grid-2x2.ds-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: auto !important;
}
.ds-dash-kpi-grid-2x2.ds-grid-cols-1 {
  grid-template-columns: 1fr !important;
  grid-template-rows: auto !important;
}

/* Blind Box Stack Custom Horizontal layout */
.ds-dash-bb-kpi-stack-new.ds-bb-stack-horizontal {
  flex-direction: row !important;
  display: grid !important;
  gap: 12px;
  width: 100%;
}
.ds-dash-bb-kpi-stack-new.ds-bb-stack-horizontal.ds-grid-cols-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}
.ds-dash-bb-kpi-stack-new.ds-bb-stack-horizontal.ds-grid-cols-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}
.ds-dash-bb-kpi-stack-new.ds-bb-stack-horizontal.ds-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}
.ds-dash-bb-kpi-stack-new.ds-bb-stack-horizontal.ds-grid-cols-1 {
  grid-template-columns: 1fr !important;
}

/* Grid Layout Stretch Overrides for Desktop */
@media (min-width: 1201px) {
  /* Row 2 overrides */
  .ds-dash-three-col.ds-row-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .ds-dash-three-col.ds-row-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ds-dash-three-col.ds-row-cols-1 {
    grid-template-columns: 1fr !important;
  }

  /* Row 3 overrides */
  .ds-dash-ops-grid.ds-row-cols-2 {
    grid-template-columns: 1fr 1.2fr !important;
  }
  .ds-dash-ops-grid.ds-row-cols-1 {
    grid-template-columns: 1fr !important;
  }

  /* Row 5 overrides */
  .ds-dash-bottom-grid.ds-row-cols-3 {
    grid-template-columns: 1fr 1.2fr 1fr !important;
  }
  .ds-dash-bottom-grid.ds-row-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ds-dash-bottom-grid.ds-row-cols-1 {
    grid-template-columns: 1fr !important;
  }
  
  .ds-dash-row-1.ds-row-stretch-full {
    grid-template-columns: 1fr !important;
  }
  
  .ds-dash-bb-grid.ds-bb-grid-no-chart,
  .ds-dash-bb-grid.ds-bb-grid-no-stack {
    grid-template-columns: 1fr !important;
  }
}

/* Remove all shadows inside Edit Product modal to match flat style */
#productModal,
#productModal * {
  box-shadow: none !important;
}

/* Product Card Actions button styling overrides to match inventory builder */
.ds-prod-card-actions {
  display: flex;
  gap: 2px;
  background: #111;
  border-top: 2px solid #111;
  margin-top: auto;
  flex-shrink: 0;
  height: 30px;
  width: 100%;
  box-sizing: border-box;
}

.ds-prod-card-actions button {
  flex: 1;
  height: 100%;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  border: none !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  letter-spacing: 0.03em;
  box-sizing: border-box;
}

.ds-prod-card-actions button.ds-btn-edit {
  background: #fff !important;
  color: #111 !important;
}
.ds-prod-card-actions button.ds-btn-edit:hover {
  background: #ffd400 !important;
  color: #111 !important;
}

.ds-prod-card-actions button.ds-btn-delete {
  background: #fff !important;
  color: #111 !important;
}
.ds-prod-card-actions button.ds-btn-delete:hover {
  background: #dc2626 !important;
  color: #fff !important;
}

/* ==========================================================================
   UNIFIED STUDIO RESPONSIVE LAYOUT (PRODUCT EDITOR + HOMEPAGE BUILDER + HERO SLIDES)
   ========================================================================== */

/* 2px Solid black borders unified rule & shadow removal */
.ds-editor-container,
.ds-editor-sidebar,
.ds-editor-controls,
.ds-canvas-header,
.builder-frame-toolbar,
.builder-frame-wrapper,
#page-homepage-builder .ds-editor-container,
#page-inventory-builder .ds-editor-container,
#page-slides .ds-editor-container,
.ds-sidebar-toggle-btn,
.ds-tablet-bottom-tabs,
.ds-tablet-bottom-tabs button,
.ds-mobile-bottom-tabs,
.ds-mobile-bottom-tabs button,
.ds-mobile-editor-header,
.ds-alert-chip-real,
.ds-sidebar,
.ds-topbar {
  border-width: 2px !important;
  border-color: #111 !important;
  border-style: solid !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* Sidebar structure defaults */
.ds-editor-container {
  display: flex !important;
  flex-direction: row !important;
  height: calc(100vh - var(--topbar-h)) !important;
  background: var(--soft) !important;
  position: relative !important;
  overflow: hidden !important;
  min-height: 0 !important;
}

/* Hide default mobile elements in desktop */
.ds-mobile-editor-header,
.ds-tablet-bottom-tabs,
.ds-mobile-bottom-tabs,
.ds-sidebar-toggle-btn {
  display: none !important;
}

/* Backdrops */
.ds-editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.left-sidebar-open .ds-editor-backdrop,
.right-sidebar-open .ds-editor-backdrop {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* DESKTOP (1400px+) */
@media (min-width: 1400px) {
  .ds-editor-sidebar:not(.ds-right) {
    width: 280px !important;
    display: flex !important;
    transform: none !important;
    position: static !important;
    height: 100% !important;
  }
  .ds-editor-controls,
  .ds-editor-sidebar.ds-right {
    width: 320px !important;
    display: flex !important;
    transform: none !important;
    position: static !important;
    height: 100% !important;
  }
  .ds-editor-canvas {
    flex: 1 !important;
    min-width: 0 !important;
  }
  /* Hide toggles on desktop */
  .ds-sidebar-toggle-btn {
    display: none !important;
  }
  .ds-tablet-bottom-tabs,
  .ds-mobile-bottom-tabs,
  .ds-mobile-editor-header {
    display: none !important;
  }
}

/* LAPTOP / TABLET (900px - 1399px) */
@media (min-width: 900px) and (max-width: 1399px) {
  /* Left sidebar in flow */
  .ds-editor-sidebar:not(.ds-right) {
    width: 280px !important;
    display: flex !important;
    transform: none !important;
    position: static !important;
    height: 100% !important;
  }

  /* Right sidebar is collapsed drawer overlay */
  .ds-editor-controls,
  .ds-editor-sidebar.ds-right {
    position: fixed !important;
    top: var(--topbar-h) !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 320px !important;
    height: calc(100vh - var(--topbar-h)) !important;
    z-index: 1001 !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    background: #fff !important;
  }

  .right-sidebar-open .ds-editor-controls,
  .right-sidebar-open .ds-editor-sidebar.ds-right {
    transform: translateX(0) !important;
  }

  .ds-editor-canvas {
    flex: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .right-sidebar-open .ds-editor-canvas {
    padding-right: 320px !important;
  }

  /* Show only right toggle btn in the toolbar */
  .ds-sidebar-toggle-btn.ds-right-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #fff;
    cursor: pointer;
    margin: 0 4px;
  }
  .ds-sidebar-toggle-btn.ds-left-toggle {
    display: none !important;
  }
  .ds-sidebar-toggle-btn.ds-right-toggle svg {
    stroke: #111;
  }
  .ds-sidebar-toggle-btn.ds-right-toggle:hover {
  background: #fff3b0;
  }

  /* Hide mobile headers & bottom tabs */
  .ds-tablet-bottom-tabs,
  .ds-mobile-bottom-tabs,
  .ds-mobile-editor-header {
    display: none !important;
  }
}

/* PHONE (under 900px) */
@media (max-width: 899px) {
  /* Hide standard Dashboard menu & top bar */
  body.page-slides-active .ds-sidebar,
  body.page-slides-active .ds-topbar,
  body.page-hpb-active .ds-sidebar,
  body.page-hpb-active .ds-topbar,
  body.inventory-builder-active .ds-sidebar,
  body.inventory-builder-active .ds-topbar {
    display: none !important;
  }

  body.page-slides-active .ds-main,
  body.page-hpb-active .ds-main,
  body.inventory-builder-active .ds-main {
    margin-left: 0 !important;
    padding-top: 0 !important;
    height: 100vh !important;
  }

  body.page-slides-active .ds-content,
  body.page-hpb-active .ds-content,
  body.inventory-builder-active .ds-content {
    padding: 0 !important;
    height: 100vh !important;
  }

  /* Mobile editor header hidden — bottom tabs handle navigation */
  .ds-mobile-editor-header {
    display: none !important;
  }
  .ds-mobile-title {
    font-weight: 900;
    font-size: 13px;
    text-transform: uppercase;
    color: #111;
    letter-spacing: 0.05em;
  }
  .ds-mobile-back-btn,
  .ds-mobile-preview-btn,
  .ds-mobile-toggle-btn,
  .ds-mobile-save-btn {
    border: 2px solid #111 !important;
    background: #fff !important;
    color: #111 !important;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    padding: 5px 10px;
    cursor: pointer;
  }
  .ds-mobile-save-btn {
    background: #ffe600 !important;
  }
  .ds-mobile-preview-btn.active {
    background: #111 !important;
    color: #fff !important;
  }

  /* Active states for toggles when drawers are open */
  .left-sidebar-open .ds-mobile-toggle-btn.ds-left-toggle {
    background: #111 !important;
    color: #fff !important;
  }
  .right-sidebar-open .ds-mobile-toggle-btn.ds-right-toggle {
    background: #111 !important;
    color: #fff !important;
  }

  /* Bottom tabs for phone */
  .ds-mobile-bottom-tabs {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 50px !important;
    background: #fff !important;
    z-index: 1003 !important;
    justify-content: space-around !important;
    align-items: center !important;
    border-top: 2px solid #111 !important;
    padding: 0 !important;
  }
  .ds-mobile-bottom-tabs button {
    flex: 1 !important;
    height: 100% !important;
    border: none !important;
    border-right: 2px solid #111 !important;
    background: #fff !important;
    font-weight: 900 !important;
    font-size: 10px !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
  }
  .ds-mobile-bottom-tabs button:last-child {
    border-right: none !important;
  }
  .ds-mobile-bottom-tabs button:hover,
  .ds-mobile-bottom-tabs button.active {
    background: #ffe600 !important;
  }

  /* Both sidebars collapsed drawers on Mobile */
  .ds-editor-sidebar:not(.ds-right) {
    position: fixed !important;
    top: 0 !important;
    bottom: 50px !important;
    left: 0 !important;
    width: 80% !important;
    max-width: 300px !important;
    height: calc(100vh - 50px) !important;
    z-index: 1002 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    background: #fff !important;
    overflow-y: auto !important;
  }

  .ds-editor-controls,
  .ds-editor-sidebar.ds-right {
    position: fixed !important;
    top: 0 !important;
    bottom: 50px !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 320px !important;
    height: calc(100vh - 50px) !important;
    z-index: 1002 !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    background: #fff !important;
    overflow-y: auto !important;
  }

  /* Drawer open — slide in, keep bottom tabs visible */
  .left-sidebar-open .ds-editor-sidebar:not(.ds-right) {
    transform: translateX(0) !important;
  }
  .right-sidebar-open .ds-editor-controls,
  .right-sidebar-open .ds-editor-sidebar.ds-right {
    transform: translateX(0) !important;
  }

  /* Mobile Preview Mode (hides header and footer, expands preview) */
  body.mobile-preview-active .ds-mobile-editor-header,
  body.mobile-preview-active .ds-mobile-bottom-tabs {
    display: none !important;
  }
  body.mobile-preview-active .ds-viewport-container {
    height: 100vh !important;
    padding: 0 !important;
  }

  /* Clean viewports on mobile scaling: allow scaling down via JS */
  .ds-viewport-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    width: 100% !important;
    height: calc(100vh - 50px) !important;
    padding: 0 !important;
  }

  /* Hide viewport info details on phone */
  .ds-canvas-info,
  #builderViewportInfo,
  #viewportInfo {
    display: none !important;
  }
}

/* ==========================================================================
   STUDIO BORDERS & SHADOWS CLEAN OVERRIDES (FINAL SAFE RULES)
   ========================================================================== */
[id^="page-"] *,
.ds-editor-sidebar,
.ds-editor-controls,
.ds-canvas-header,
.ds-mobile-editor-header,
.ds-mobile-bottom-tabs,
.ds-tablet-bottom-tabs {
  box-shadow: none !important;
  text-shadow: none !important;
}

.ds-editor-sidebar {
  border-right: 2px solid #111 !important;
  border-left: 2px solid #111 !important;
}
.ds-editor-sidebar.ds-right,
.ds-editor-controls {
  border-left: 2px solid #111 !important;
  border-right: 2px solid #111 !important;
}
/* Homepage builder: container provides outer border,
   so remove all redundant outer-facing sidebar/controls borders to avoid 4px visual */
#page-homepage-builder .ds-editor-sidebar {
  border-left: none !important;
  border-top: none !important;
  border-bottom: none !important;
}
#page-homepage-builder .ds-editor-controls {
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
}
/* Homepage builder: viewport has full border. Toolbar inside it strips
   its own top/left/right since viewport provides the outer edge */
#page-homepage-builder #builderViewport {
  border: 2px solid #111 !important;
}
#page-homepage-builder .builder-frame-toolbar {
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}
.ds-canvas-header {
  border-bottom: 2px solid #111 !important;
}
.ds-mobile-editor-header {
  border-bottom: 2px solid #111 !important;
}
.ds-mobile-bottom-tabs,
.ds-tablet-bottom-tabs {
  border-top: 2px solid #111 !important;
}
.ds-mobile-bottom-tabs button,
.ds-tablet-bottom-tabs button {
  border-right-width: 2px !important;
  border-right-style: solid !important;
  border-right-color: #111 !important;
}
.ds-sidebar-toggle-btn {
  border: 2px solid #111 !important;
}
/* ===== End of page-homepage-builder theme block ===== */

/* ==========================================================================
   HERO SLIDER WORKSPACE FIXES (FINAL SAFE VERSION)
   ========================================================================== */
/* Viewport Scale Layer & Rendering Optimizations */
.viewport-scale-layer {
  backface-visibility: hidden !important;
  transform-style: preserve-3d !important;
}

.homepage-preview-sandbox {
  contain: layout paint !important;
}

.viewport-scale-layer,
.ds-viewport,
.preview-sandbox,
.homepage-preview-sandbox {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: geometricPrecision !important;
}

/* Ensure no nested transforms inside viewport slides */
.ds-viewport .hero-slide,
.ds-viewport .hero-frame,
.ds-viewport .hero-copy {
  transform: none !important;
}
/* Allow horizontal sliding transition on the tray only */
.ds-viewport .hero-tray {
  transform: translate3d(var(--slide-translate, 0px), 0, 0);
}

/* Hero height fix */
.ds-viewport .hero-slider {
  position: relative !important;
  width: 100% !important;
  box-shadow: none !important;
}

/* Text safety & protection */
.hero-copy {
  max-width: 100% !important;
  min-width: 320px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
}

@media (max-width: 768px) {
  .hero-copy {
    min-width: 0 !important;
    width: 100% !important;
  }
}

.hero-title,
.hero-text {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  max-width: 100% !important;
}

/* Mobile layout stack order (flex-direction: column-reverse) */
.ds-viewport.mode-mobile .hero-frame {
  display: flex !important;
  flex-direction: column-reverse !important;
  align-items: center !important;
  text-align: center !important;
  padding: 36px 24px !important;
  gap: 16px !important;
}

.ds-viewport.mode-mobile .hero-media {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}

.ds-viewport.mode-mobile .hero-copy {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

/* Nav arrows positioning relative to slider frame */
.ds-viewport .hero-nav-btn {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
}

.ds-viewport .hero-nav-btn.prev {
  left: 24px !important;
  right: auto !important;
}

.ds-viewport .hero-nav-btn.next {
  right: 24px !important;
  left: auto !important;
}

@media (max-width: 767px) {
  body.mobile-preview-active .ds-canvas-header {
    display: none !important;
  }
  .ds-canvas-header {
    padding: 4px 8px !important;
    min-height: 32px !important;
    gap: 4px !important;
  }
  .ds-canvas-header .ds-tool-btn {
    width: 28px !important;
    height: 28px !important;
  }
  .ds-canvas-header .ds-border-btn {
    width: 28px !important;
    height: 28px !important;
  }
}

/* --- Exit Preview button styles --- */
.ds-mobile-exit-preview-btn {
  display: none !important;
}

body.mobile-preview-active .ds-mobile-exit-preview-btn {
  display: block !important;
  position: fixed !important;
  top: 16px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10005 !important;
  background: #ffe600 !important;
  color: #111 !important;
  border: 2px solid #111 !important;
  font-weight: 900 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  padding: 6px 14px !important;
  cursor: pointer !important;
  box-shadow: 3px 3px 0px #111 !important;
  letter-spacing: 0.05em !important;
}

body.mobile-preview-active .ds-mobile-exit-preview-btn:hover {
  background: #111 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: 3px 3px 0px #fff !important;
}

/* --- Canvas Info Text Overlap Protection --- */
.ds-canvas-info {
  white-space: nowrap !important;
  border-left: 2px solid #111 !important;
}

@media (max-width: 1200px) {
  .ds-canvas-info,
  #viewportInfo,
  #builderViewportInfo {
    display: none !important;
  }
}

/* Style Preview Dynamic Radius Presets */
.product-card.radius-sharp,
.product-card.radius-sharp {
  border-radius: 0px !important;
}

.product-card.radius-small {
  border-radius: 8px !important;
}

.product-card.radius-big {
  border-radius: 18px !important;
}

.product-card.radius-capsule {
  border-radius: 40px !important;
}

/* Guarantee Style Preview Sync */
#stylePreviewPanel .product-card {
  border: var(--pacco-card-border, 3px solid #111) !important;
}

#stylePreviewPanel .radius-sharp {
  border-radius: 0px !important;
}

#stylePreviewPanel .radius-small {
  border-radius: 8px !important;
}

#stylePreviewPanel .radius-big {
  border-radius: 18px !important;
}

#stylePreviewPanel .radius-capsule {
  border-radius: 40px !important;
}

/* ==========================================================================
   INVENTORY PRODUCT DRAG AND DROP (TILE VIEW)
   ========================================================================== */
.inventory-product-card.is-dragging,
.ds-prod-card.is-dragging,
.ds-prod-card-wrap.is-dragging {
  opacity: 0.45;
}

.inventory-product-card.drag-target,
.ds-prod-card.drag-target,
.ds-prod-card-wrap.drag-target {
  outline: 2px dashed #111;
  outline-offset: 4px;
}

/* ==========================================================================
   PRODUCT EDIT MODAL — MOBILE TABBED LAYOUT
   ========================================================================== */

/* Mobile tab bar — hidden on desktop */
.product-mobile-tabs {
  display: none;
  border-bottom: 3px solid #111;
  gap: 0;
  background: #fff;
  padding: 0;
  margin: 0 0 8px 0;
}

.product-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: #fff;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.product-tab-btn:hover:not(.active) {
  color: #111;
  background: #f9f9f9;
}

.product-tab-btn.active {
  color: #111;
  border-bottom-color: #ffe600;
  background: #fff;
}

.product-tab-btn svg {
  flex-shrink: 0;
}

/* Tab panels — always visible on desktop */
.product-tab-panel {
  display: contents;
}

/* ---- TABLET: compressed desktop (768px–1024px) ---- */
@media (max-width: 1024px) and (min-width: 601px) {
  #productModal .ds-widget-modal {
    width: min(900px, 95vw);
  }

  #productModal .product-modal-grid {
    grid-template-columns: 280px 1fr !important;
  }

  #productModal .ds-widget-section {
    padding: 6px !important;
  }

  #productModal .ds-widget-field {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
}

/* ---- PHONE: tabbed layout (≤600px) ---- */
@media (max-width: 600px) {
  /* Modal goes full-width, full-height */
  #productModal .ds-widget-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  #productModal .ds-widget-modal {
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border: none;
    border-top: 3px solid #111;
    border-radius: 0;
  }

  /* Header: tighter padding */
  #productModal .ds-widget-modal-header {
    padding: 10px 12px;
    flex-shrink: 0;
  }

  #productModal .ds-widget-modal-header h2 {
    font-size: 0.9rem;
  }

  #productModal .ds-widget-modal-close {
    width: 32px;
    height: 32px;
  }

  /* Show tab bar */
  #productModal .product-mobile-tabs {
    display: flex;
    flex-shrink: 0;
  }

  /* Body: scrollable, no extra padding */
  #productModal .ds-widget-modal-body {
    padding: 0 12px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Collapse grid to single column */
  #productModal .product-modal-grid {
    display: block !important;
  }

  /* Right column wrapper: no flex on mobile */
  #productModal .product-right-column {
    display: block !important;
  }

  /* Tab panels: only active is visible */
  #productModal .product-tab-panel {
    display: none;
  }

  #productModal .product-tab-panel[data-tab-panel="media"].tab-active,
  #productModal .product-tab-panel[data-tab-panel="info"].tab-active,
  #productModal .product-tab-panel[data-tab-panel="org"].tab-active {
    display: block;
  }

  /* Media section adjustments for phone */
  #productModal .product-tab-panel[data-tab-panel="media"] .ds-widget-section {
    padding: 6px !important;
  }

  #productModal .ds-image-preview-v2 {
    min-height: 180px;
  }

  /* Info/Org sections: tighter spacing */
  #productModal .product-tab-panel .ds-widget-section {
    padding: 6px !important;
    margin-bottom: 6px;
  }

  #productModal .ds-widget-field {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  #productModal .ds-widget-label {
    font-size: 0.65rem;
    margin-bottom: 4px;
  }

  /* Compact grid fields on phone: all multi-col grids → 2 columns */
  #productModal .product-tab-panel [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Toggle row (Featured/Visible/Draft): stack to 1 column — needs more width per item */
  #productModal .product-tab-panel [style*="grid-template-columns:1fr 1fr 1fr"][style*="align-items:center"] {
    grid-template-columns: 1fr !important;
  }

  /* Colors & Variants: keep 2 columns (small items) */

  /* Footer: sticky bottom, full-width buttons */
  #productModal .ds-modal-footer-product {
    padding: 10px 12px;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
  }

  #productModal .ds-modal-footer-product .ds-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 8px;
    font-size: 0.75rem;
  }

  #productModal .ds-btn-delete {
    flex: 0 0 auto;
    order: 3;
  }
}

/* Very small phones (≤380px) */
@media (max-width: 380px) {
  #productModal .product-tab-btn {
    font-size: 0.65rem;
    padding: 10px 4px;
    gap: 4px;
  }

  #productModal .product-tab-btn svg {
    width: 14px;
    height: 14px;
  }

  #productModal .ds-image-preview-v2 {
    min-height: 150px;
  }
}

