/* ============================================
   Omnistore — Global Stylesheet
   Font: Plus Jakarta Sans (Lemon Squeezy style)
   Dark mode: prefers-color-scheme
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ============================================
   CSS Custom Properties — Light Mode (default)
============================================ */
:root {
  /* Brand */
  --color-primary: #7047EC;
  --color-primary-hover: #5F3AD8;
  --color-primary-light: #EDE9FE;
  --color-accent: #FFC233;
  --color-accent-hover: #F0B429;
  --color-accent-light: #FFF8E1;

  /* Surfaces */
  --color-bg: #FFFFFF;
  --color-bg-secondary: #F8F8F9;
  --color-bg-tertiary: #F1F1F3;
  --color-surface: #FFFFFF;
  --color-surface-raised: #FFFFFF;
  --color-surface-overlay: rgba(0, 0, 0, 0.5);

  /* Text */
  --color-text: #1A1523;
  --color-text-secondary: #6F6E77;
  --color-text-muted: #A09FA6;
  --color-text-inverse: #FFFFFF;

  /* Borders */
  --color-border: #E4E4E7;
  --color-border-hover: #D1D1D6;
  --color-border-focus: #7047EC;

  /* Status */
  --color-success: #22C55E;
  --color-success-light: #F0FDF4;
  --color-error: #EF4444;
  --color-error-light: #FEF2F2;
  --color-warning: #F59E0B;
  --color-warning-light: #FFFBEB;
  --color-info: #3B82F6;
  --color-info-light: #EFF6FF;

  /* Sidebar — light style (Lemon Squeezy) */
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #6F6E77;
  --sidebar-text-active: #7047EC;
  --sidebar-hover: #F5F3FF;
  --sidebar-active: #F5F3FF;
  --sidebar-border: #F1F1F3;
  --sidebar-width: 260px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-focus: 0 0 0 3px rgba(112, 71, 236, 0.25);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
}

/* ============================================
   Dark Mode — System Preference
============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    /* Brand */
    --color-primary: #9179F0;
    --color-primary-hover: #A690F5;
    --color-primary-light: #2D2640;
    --color-accent: #FFC233;
    --color-accent-hover: #FFD060;
    --color-accent-light: #332B1A;

    /* Surfaces */
    --color-bg: #0F0D13;
    --color-bg-secondary: #1A1723;
    --color-bg-tertiary: #23202E;
    --color-surface: #1A1723;
    --color-surface-raised: #23202E;
    --color-surface-overlay: rgba(0, 0, 0, 0.7);

    /* Text */
    --color-text: #EDEDEF;
    --color-text-secondary: #A09FA6;
    --color-text-muted: #6F6E77;
    --color-text-inverse: #1A1523;

    /* Borders */
    --color-border: #2E2B38;
    --color-border-hover: #3D3A48;
    --color-border-focus: #9179F0;

    /* Status */
    --color-success: #34D399;
    --color-success-light: #132A1F;
    --color-error: #F87171;
    --color-error-light: #2D1515;
    --color-warning: #FBBF24;
    --color-warning-light: #2D2410;
    --color-info: #60A5FA;
    --color-info-light: #152040;

    /* Sidebar */
    --sidebar-bg: #0F0D13;
    --sidebar-text: #A09FA6;
    --sidebar-text-active: #A690F5;
    --sidebar-hover: #1A1723;
    --sidebar-active: #1E1A2E;
    --sidebar-border: #23202E;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-focus: 0 0 0 3px rgba(145, 121, 240, 0.3);
  }
}

/* ============================================
   Typography System
   Use these classes instead of writing font
   sizes/weights inline. Single source of truth.
============================================ */

/* Page title — "Products", "Home", "Settings" */
.text-page-title {
  font-size: 26px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* Section title — panel headers, card titles, modal titles */
.text-section-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.2px;
  line-height: 1.3;
}

/* Subsection title — collapsible headers, nav groups */
.text-subsection-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
}

/* Large number — revenue, stat values */
.text-stat-lg {
  font-size: 32px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -1px;
  line-height: 1.2;
}

/* Medium number — card stat values */
.text-stat-md {
  font-size: 28px;
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* Small number — inline stats */
.text-stat-sm {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.2;
}

/* Body text — default paragraphs, descriptions */
.text-body {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.5;
}

/* Body small — hints, captions, timestamps */
.text-body-sm {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* Label — form labels, table headers, badges */
.text-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

/* Label small — nav section titles, overlines */
.text-label-sm {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* Muted — placeholder text, secondary info */
.text-muted {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Hint — form hints, helper text */
.text-hint {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Link */
.text-link {
  color: var(--color-primary);
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

/* ============================================
   Base & Reset
============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================
   Layout
============================================ */
.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  flex: 1;
  padding: 24px 32px;
  max-width: 1200px;
  width: 100%;
  opacity: 0;
  transform: translateY(6px);
  animation: pageFadeIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s forwards;
}

@keyframes pageFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-content {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Skeleton loader — apply .skeleton to a block while data loads */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-border, #e4e4e7);
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.3s infinite;
}
@keyframes skeletonShimmer {
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ============================================
   Sidebar (Lemon Squeezy style — light/clean)
============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
  padding: 24px 24px 20px;
}

.sidebar-logo {
  display: inline-block;
}

.sidebar-logo svg {
  width: 36px;
  height: 36px;
}

/* Nav area */
.sidebar-nav {
  flex: 1;
  padding: 0 16px;
  overflow-y: auto;
}

.nav-group {
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Chevron for dropdown items */
.nav-chevron {
  margin-left: auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--color-text-muted);
  stroke-width: 2;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.nav-item.expanded .nav-chevron {
  transform: rotate(180deg);
}

/* Sub-navigation (dropdown children) */
.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.nav-sub.open {
  max-height: 300px;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 46px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-sub-item:hover {
  background: var(--sidebar-hover);
  color: var(--color-text);
}

.nav-sub-item.active {
  color: var(--sidebar-text-active);
}

/* Progress indicator (for Setup) */
.nav-progress {
  margin-left: auto;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-progress svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

/* ── Sidebar CTA Card ──────────────────────── */
.sidebar-cta {
  margin: 8px 16px 16px;
  padding: 20px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  text-align: center;
}

.sidebar-cta-text {
  font-size: 13px;
  color: var(--sidebar-text);
  line-height: 1.5;
  margin-bottom: 14px;
}

.sidebar-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.sidebar-cta-btn:hover {
  background: var(--color-primary-hover);
}

/* ── Sidebar Footer (user + test mode) ─────── */
.sidebar-footer {
  padding: 16px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-menu {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user-menu:hover {
  color: var(--color-text);
  background: var(--sidebar-hover);
}

.sidebar-user-menu svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Test mode toggle */
.sidebar-test-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-test-label {
  font-size: 13px;
  font-weight: 600;
  color: #F97066;
}

.sidebar-version {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.02em;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.login-version {
  margin-top: 24px;
  font-size: 11px;
  text-align: center;
  opacity: 0.5;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 11px;
  transition: background var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: #FECACA;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #F97066;
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  overflow: hidden;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-section {
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}

.user-dropdown-section:last-child {
  border-bottom: none;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.user-dropdown-item:hover {
  background: var(--color-bg-secondary);
}

.user-dropdown-item.active {
  color: var(--color-primary);
}

.user-dropdown-item .check {
  margin-left: auto;
  color: var(--color-primary);
  font-size: 16px;
}

.user-dropdown-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.user-dropdown-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================
   Topbar (Lemon Squeezy style — minimal)
============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--color-bg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Use .text-page-title class in HTML */
.topbar-title {}

.topbar-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================
   Global Search (expanding from header icon)
============================================ */
.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
}
.topbar-search .topbar-btn {
  z-index: 2;
}
.topbar-search-input {
  width: 0;
  padding: 0;
  border: none;
  outline: none;
  background: var(--color-bg-secondary, #f4f4f5);
  border-radius: var(--radius-full, 9999px);
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  opacity: 0;
  pointer-events: none;
  transition: width 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
              opacity 0.2s ease,
              padding 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
  margin-left: -40px;   /* slides out from under the icon */
  padding-left: 44px;
  padding-right: 14px;
  height: 40px;
}
.topbar-search.expanded .topbar-search-input {
  width: 340px;
  opacity: 1;
  pointer-events: auto;
}
.topbar-search-input::placeholder {
  color: var(--color-text-muted);
}
.topbar-search.expanded .topbar-btn {
  color: var(--color-text);
}

/* Results dropdown */
.topbar-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 440px;
  overflow-y: auto;
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, #e4e4e7);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
  padding: 6px 0;
}
.topbar-search.expanded.has-results .topbar-search-results {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.search-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 10px 16px 4px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.12s ease;
  cursor: pointer;
}
.search-result-item:hover,
.search-result-item.active {
  background: var(--color-bg-secondary, #f4f4f5);
}
.search-result-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-bg-secondary, #f4f4f5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.search-result-item.active .search-result-icon,
.search-result-item:hover .search-result-icon {
  background: var(--color-bg, #fff);
}
.search-result-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.search-result-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.search-result-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-empty {
  padding: 18px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (max-width: 768px) {
  /* The topbar needs a positioning context so the expanded search can
     absolutely fill the row (it floats over the notification + create
     buttons). Sticky already creates a containing block, but adding
     relative makes the intent explicit. */
  .topbar { position: sticky; }

  /* On mobile, the expanded search input takes over the topbar row so it
     doesn't fight the notification + create buttons for space. The
     sibling buttons tuck behind it via z-index until the user collapses
     the search again. */
  .topbar-search.expanded {
    position: absolute;
    right: 12px;
    left: 54px; /* leave room for the menu toggle on the far left */
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
  }
  .topbar-search.expanded .topbar-search-input {
    width: 100%;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    margin-left: 0;
    padding-left: 44px;
  }
  .topbar-search-results {
    width: calc(100vw - 32px);
    max-width: 360px;
    right: 0;
  }
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  color: var(--color-text-muted);
  cursor: pointer;
}

.topbar-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.topbar-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.topbar-create-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.topbar-create-btn:hover {
  background: var(--color-primary-hover);
  transform: scale(1.05);
}

.topbar-create-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Create button dropdown */
.topbar-create-wrapper {
  position: relative;
}

.topbar-create-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  display: none;
  z-index: 200;
  overflow: hidden;
}

.topbar-create-dropdown.open {
  display: block;
}

.topbar-create-dropdown-item {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition-fast);
}

.topbar-create-dropdown-item:hover {
  background: var(--color-bg-secondary);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-error);
  border-radius: 50%;
  display: none;
}

.notification-dot.show {
  display: block;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  padding: 8px;
  cursor: pointer;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ── Info Banner ───────────────────────────── */
.info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  margin: 0 32px 20px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--color-text-secondary);
}

.info-banner-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.info-banner-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.info-banner a {
  color: var(--color-primary);
  font-weight: 600;
}

.info-banner a:hover {
  text-decoration: underline;
}

.info-banner-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.info-banner-dismiss:hover {
  color: var(--color-text);
}

/* ============================================
   Cards
============================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Use .text-subsection-title class in HTML */
.card-title {}

.card-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.purple { background: var(--color-primary-light); color: var(--color-primary); }
.stat-icon.green { background: var(--color-success-light); color: var(--color-success); }
.stat-icon.yellow { background: var(--color-warning-light); color: var(--color-warning); }
.stat-icon.red { background: var(--color-error-light); color: var(--color-error); }
.stat-icon.blue { background: var(--color-info-light); color: var(--color-info); }

.stat-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Use .text-stat-sm class in HTML */
.stat-value {}

/* Use .text-body-sm class in HTML */
.stat-label {
  margin-top: 2px;
}

/* ============================================
   Dashboard — Revenue & Charts
============================================ */
.dash-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.dash-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.dash-filter:hover {
  color: var(--color-text);
}

.dash-filter svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.dash-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.dash-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid;
}

.dash-legend-dot.chosen { border-color: var(--color-primary); }
.dash-legend-dot.last { border-color: #F0ABFC; }

/* Revenue display */
.dash-revenue {
  margin-bottom: 8px;
}

.dash-revenue-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  cursor: pointer;
}

.dash-revenue-header svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Use .text-stat-lg class in HTML */
.dash-revenue-value {}

/* Use .text-muted class in HTML */
.dash-revenue-compare {
  margin-top: 4px;
}

/* Chart area */
.dash-chart {
  height: 280px;
  margin: 20px 0 16px;
  position: relative;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: flex-end;
}

.dash-chart-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-primary);
  opacity: 0.4;
}

.dash-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-muted);
  padding-top: 12px;
}

/* Metric cards row (below chart) */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 24px;
}

.dash-metric {
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
}

.dash-metric:not(:last-child) {
  padding-right: 32px;
  margin-right: 32px;
  border-right: 1px solid var(--color-border);
}

.dash-metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.dash-metric-label svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Use .text-stat-md class in HTML */
.dash-metric-value {}

/* Use .text-hint class in HTML */
.dash-metric-compare {
  margin-top: 4px;
}

/* ============================================
   Dashboard · Recent Orders
============================================ */
.dash-recent {
  margin-top: 40px;
  border-top: 1px solid var(--color-border);
  padding-top: 24px;
}
.dash-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dash-recent-view-all {
  font-size: 13px;
  font-weight: 500;
}
.dash-recent-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  background: var(--color-bg, #fff);
}
.dash-recent-empty {
  padding: 32px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}
.dash-recent-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: background 0.12s ease;
}
.dash-recent-row:last-child {
  border-bottom: none;
}
.dash-recent-row:hover {
  background: var(--color-bg-secondary);
}
.dash-recent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.dash-recent-main {
  min-width: 0;
}
.dash-recent-customer {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-recent-sub {
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-recent-meta {
  text-align: right;
  white-space: nowrap;
}
.dash-recent-total {
  font-size: 14px;
  font-weight: 600;
}
.dash-recent-date {
  margin-top: 2px;
  font-size: 12px;
}
.dash-recent-status {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .dash-recent-row {
    grid-template-columns: 32px 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }
  .dash-recent-status {
    grid-column: 1 / -1;
    margin-top: 2px;
    margin-left: 42px;
  }
  .dash-recent-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* ============================================
   Buttons
============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

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

.btn-accent {
  background: var(--color-accent);
  color: #1A1523;
}

.btn-accent:hover {
  background: var(--color-accent-hover);
}

.btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ============================================
   Forms
============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition-fast);
  outline: none;
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:hover {
  border-color: var(--color-border-hover);
}

.form-input:focus {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-focus);
}

.form-input.error {
  border-color: var(--color-error);
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--color-error);
  margin-top: 4px;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236F6E77' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============================================
   Tables
============================================ */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--color-bg-secondary);
}

/* ============================================
   Badges
============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-error { background: var(--color-error-light); color: var(--color-error); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-info { background: var(--color-info-light); color: var(--color-info); }

/* ============================================
   Alerts / Toast Notifications
============================================ */
.alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: alertSlideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 400px;
}

.alert-success { background: var(--color-success); color: #fff; }
.alert-error { background: var(--color-error); color: #fff; }
.alert-warning { background: var(--color-warning); color: #1A1523; }
.alert-info { background: var(--color-info); color: #fff; }

@keyframes alertSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   Modal / Overlay
============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-surface-overlay);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

/* Use .text-section-title class in HTML */
.modal-title {}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================
   Empty States
============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--color-text-muted);
}

/* Use .text-subsection-title class in HTML */
.empty-state-title {
  margin-bottom: 8px;
}

/* Use .text-body-sm class in HTML */
.empty-state-text {
  max-width: 360px;
  margin: 0 auto;
}

/* ============================================
   Login Page
============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.login-logo-text {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.login-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 32px;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.login-footer a {
  color: var(--color-primary);
  font-weight: 600;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ============================================
   Utility Classes
============================================ */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* ============================================
   Product Grid View
============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0;
  border-top: 1px solid var(--color-border);
}

.product-grid-item {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.product-grid-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  background: var(--color-bg-tertiary);
  object-fit: cover;
  margin-bottom: 14px;
}

.product-grid-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.product-grid-name span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-grid-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.product-grid-dot.published { background: var(--color-success); }
.product-grid-dot.draft { background: var(--color-text-muted); }

.product-grid-price {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.product-grid-stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.product-grid-stat-value {
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 12px;
}

/* ── Autocomplete Dropdown ─────────────────── */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 300;
  display: none;
}

.autocomplete-list.open {
  display: block;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-size: 14px;
}

.autocomplete-item:hover {
  background: var(--color-bg-secondary);
}

.autocomplete-item-sub {
  font-size: 12px;
  color: var(--color-text-muted);
}

.autocomplete-create {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  border-top: 1px solid var(--color-border);
}

.autocomplete-create:hover {
  background: var(--color-bg-secondary);
}

/* ── Order Line Items ─────────────────────── */
.order-items-list {
  margin-bottom: 16px;
}

.order-line-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.order-line-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  background-size: cover;
  flex-shrink: 0;
}

.order-line-info {
  flex: 1;
  min-width: 0;
}

.order-line-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.order-line-variant {
  font-size: 12px;
  color: var(--color-text-muted);
}

.order-line-price {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

.order-line-qty {
  width: 50px;
  padding: 6px 8px;
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
}

.order-line-qty:focus {
  border-color: var(--color-primary);
}

.order-line-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
}

.order-line-remove:hover {
  color: var(--color-error);
}

.order-line-remove svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Order totals */
.order-totals {
  padding-top: 12px;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.order-total-row.final {
  font-weight: 600;
  font-size: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
}

/* Product picker button */
.add-item-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px dashed var(--color-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  text-align: center;
}

.add-item-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-style: solid;
}

/* Variant select chips */
.variant-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.variant-select-chip {
  padding: 6px 14px;
  font-size: 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.variant-select-chip:hover {
  border-color: var(--color-primary);
}

.variant-select-chip.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ============================================
   Design Page — Storefront Customizer
============================================ */
.design-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Tab bar */
.design-tabs {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.design-tab-group {
  display: flex;
  align-items: center;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 4px;
  border: 1px solid var(--color-border);
}

.design-tab {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
}

.design-tab:hover {
  color: var(--color-text);
}

.design-tab.active {
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

/* Dividers between tabs */
.design-tab + .design-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--color-border);
}

.design-tab.active::before,
.design-tab.active + .design-tab::before {
  display: none;
}

.design-tab-publish {
  margin-left: auto;
}

/* Settings panel (left) */
.design-panel {
  width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 20px;
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
}

.design-panel-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.design-panel-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

/* Hover feedback on panel fields */
.design-panel .panel-field,
.design-panel .panel-toggle-row,
.design-panel .upload-thumb-row,
.design-panel .color-swatch-row {
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.design-panel .panel-field:hover,
.design-panel .panel-toggle-row:hover,
.design-panel .upload-thumb-row:hover,
.design-panel .color-swatch-row:hover {
  background: rgba(112, 71, 236, 0.06);
}

/* Preview area (right) */
.design-preview {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--color-bg-secondary);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 960px;
  width: 100%;
  align-self: flex-start;
}

/* Preview card */
.preview-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 3px solid transparent;
}

.preview-card.selected {
  border-color: var(--color-primary);
}

.preview-card-header {
  padding: 16px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.preview-card-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.preview-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card-store-icon {
  width: 24px;
  height: 24px;
}

.preview-card-name {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}

.preview-card-desc {
  font-size: 11px;
  opacity: 0.8;
  line-height: 1.4;
}

.preview-card-body {
  padding: 14px 16px 16px;
  background: #fff;
}

.preview-card-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 11px;
  font-family: inherit;
  margin-bottom: 6px;
  color: #333;
  background: #fff;
}

.preview-card-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: default;
  text-align: center;
}

/* Logo/favicon upload in settings */
.upload-thumb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-thumb-info {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.upload-thumb-preview {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.upload-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-thumb-preview.small {
  width: 40px;
  height: 40px;
}

.upload-thumb-plus {
  font-size: 20px;
  color: var(--color-text-muted);
}

/* Theme selector (custom dropdown with color preview) */
.theme-select-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.theme-select-btn:hover {
  border-color: var(--color-border-hover);
}

.theme-select-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.theme-select-swatch-half {
  display: flex;
  width: 100%;
  height: 100%;
}

.theme-select-swatch-half > span {
  flex: 1;
}

.theme-select-name {
  flex: 1;
  font-weight: 500;
}

.theme-select-chevron {
  width: 16px;
  height: 16px;
  fill: var(--color-text-muted);
  flex-shrink: 0;
}

.theme-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 300;
  display: none;
  padding: 4px;
}

.theme-select-list.open {
  display: block;
}

.theme-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.theme-select-option:hover {
  background: var(--color-bg-secondary);
}

.theme-select-option.selected {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Color swatch */
.color-swatch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.color-swatch input[type="color"] {
  position: absolute;
  inset: -4px;
  width: 40px;
  height: 40px;
  border: none;
  cursor: pointer;
  opacity: 0;
}

.color-swatch-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Reset button */
.reset-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  text-align: center;
  margin-top: 16px;
}

.reset-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

/* Storefront preview (browser mockup) */
.store-preview-browser {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.store-preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.store-preview-dots {
  display: flex;
  gap: 6px;
}

.store-preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.store-preview-dots span:nth-child(1) { background: #EF4444; }
.store-preview-dots span:nth-child(2) { background: #F59E0B; }
.store-preview-dots span:nth-child(3) { background: #22C55E; }

.store-preview-url {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.store-preview-body {
  flex: 1;
  overflow-y: auto;
}

/* Header layouts */
.sf-header-banner {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.sf-header-split {
  display: flex;
  min-height: 200px;
}

.sf-header-split-img {
  width: 50%;
  background-size: cover;
  background-position: center;
}

.sf-header-split-text {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.sf-header-minimal {
  padding: 40px 32px;
  text-align: center;
}

.sf-header-video {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.sf-header-slideshow {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.sf-header-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.sf-header-slideshow img.active {
  opacity: 1;
}

/* Store info below header */
.sf-store-info {
  text-align: center;
  padding: 40px 32px 24px;
  position: relative;
}

.sf-store-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: -36px auto 12px;
  background: var(--color-bg-tertiary);
  background-size: cover;
  background-position: center;
  border: 4px solid #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 2;
}

.sf-store-name {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
}

.sf-store-desc {
  font-size: 14px;
  opacity: 0.7;
  max-width: 400px;
  margin: 0 auto;
}

/* Storefront nav inside preview */
.sf-preview-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid #e4e4e7;
}

.sf-preview-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8f8f9;
  border: 1px solid #e4e4e7;
  border-radius: 100px;
  padding: 6px 12px;
  flex-shrink: 0;
}

.sf-preview-search svg {
  width: 14px;
  height: 14px;
  fill: #a09fa6;
}

.sf-preview-search input {
  border: none;
  background: none;
  font-size: 12px;
  color: inherit;
  outline: none;
  width: 100px;
  font-family: inherit;
}

.sf-preview-search input::placeholder {
  color: #a09fa6;
}

.sf-preview-cats {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}

.sf-preview-cats::-webkit-scrollbar { display: none; }

.sf-preview-cat {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid #e4e4e7;
  border-radius: 100px;
  white-space: nowrap;
  cursor: default;
  background: transparent;
  font-family: inherit;
}

.sf-preview-cat.active {
  border-color: var(--color-primary);
  color: #fff;
}

/* Product grid in preview */
.sf-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px;
}

.sf-product-card {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sf-product-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--color-bg-tertiary);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.sf-product-info {
  padding: 10px 0;
}

.sf-product-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.sf-product-name {
  font-size: 14px;
  font-weight: 500;
}

.sf-product-price {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.sf-product-desc {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sf-product-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  cursor: default;
  font-family: inherit;
}

/* Header layout picker */
.layout-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.layout-option {
  padding: 8px 4px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
  background: var(--color-surface);
}

.layout-option:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.layout-option.selected {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.layout-option-icon {
  width: 100%;
  height: 28px;
  margin-bottom: 4px;
  background: var(--color-bg-secondary);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.layout-option-icon .bar {
  position: absolute;
  background: var(--color-text-muted);
  opacity: 0.3;
}

@media (max-width: 900px) {
  .design-layout { flex-direction: column; height: auto; }
  .design-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--color-border); }
  .preview-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .preview-grid { grid-template-columns: 1fr; }
}

.hidden { display: none; }

/* ============================================
   Page Toolbar (search + actions row)
============================================ */
.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.page-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-search-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.page-search-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.page-search input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--color-text);
  outline: none;
  font-family: inherit;
}

.page-search input::placeholder {
  color: var(--color-text-muted);
}

.page-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle:hover,
.view-toggle.active {
  color: var(--color-text);
  background: var(--color-bg-secondary);
}

.view-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ============================================
   Summary Stats Row (Products page)
============================================ */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  overflow: hidden;
}

.summary-stat {
  padding: 24px;
}

.summary-stat:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

/* Use .text-stat-md class in HTML */
.summary-stat-value {
  margin-bottom: 4px;
}

/* Use .text-body-sm class + color override in HTML */
.summary-stat-label {
  color: var(--color-primary);
}

/* ============================================
   Data Table (Products, Orders, etc.)
============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
}

.data-table th.sortable:hover {
  color: var(--color-text-secondary);
}

.sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
}

.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: var(--color-bg-secondary);
}

.data-table-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}

.data-table-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-bg-tertiary);
  object-fit: cover;
  flex-shrink: 0;
}

.data-table-muted {
  color: var(--color-text-muted);
}

.data-table-footer {
  padding: 16px 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* Status badges inline */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

.status-badge.published {
  background: var(--color-success-light);
  color: var(--color-success);
}

.status-badge.draft {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
}

.status-badge.warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.status-badge.info {
  background: var(--color-info-light);
  color: var(--color-info);
}

.status-badge-dot {
  font-size: 10px;
}

/* Share button */
.share-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.share-btn:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

/* ============================================
   Slide Panel (reusable — Add/Edit overlay)
============================================ */
.slide-panel-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-surface-overlay);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.slide-panel-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 560px;
  max-width: 100%;
  height: 100vh;
  background: var(--color-bg);
  z-index: 501;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.slide-panel.open {
  transform: translateX(0);
}

.slide-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 0;
}

/* Use .text-page-title class in HTML */
.slide-panel-title {}

/* Use .text-body-sm class in HTML */
.slide-panel-subtitle {
  margin-top: 6px;
}

.slide-panel-subtitle a {
  color: var(--color-primary);
  font-weight: 600;
}

.slide-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.slide-panel-close:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.slide-panel-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* Collapsible sections */
.panel-section {
  border: none;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.panel-section-header:hover {
  background: var(--color-bg-tertiary);
}

/* Section header text — smaller than body */
.panel-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.panel-section-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--color-text-muted);
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.panel-section.collapsed .panel-section-chevron {
  transform: rotate(180deg);
}

.panel-section-content {
  padding: 16px 20px 20px;
}

.panel-section.collapsed .panel-section-content {
  display: none;
}

/* Panel form fields */
.panel-field {
  margin-bottom: 20px;
}

.panel-field:last-child {
  margin-bottom: 0;
}

.panel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.panel-label .required {
  color: var(--color-error);
}

.panel-label .char-count {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 13px;
}

.panel-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.panel-input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.panel-input::placeholder {
  color: var(--color-text-muted);
}

textarea.panel-input {
  resize: vertical;
  min-height: 80px;
}

/* Use .text-hint class in HTML */
.panel-hint {
  margin-top: 8px;
}

/* Pricing option cards */
.pricing-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pricing-option {
  padding: 20px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.pricing-option:hover {
  border-color: var(--color-border-hover);
}

.pricing-option.selected {
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}

.pricing-option-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary);
  display: none;
  align-items: center;
  justify-content: center;
}

.pricing-option.selected .pricing-option-check {
  display: flex;
}

/* ============================================
   Product type picker (product panel)
============================================ */
.product-type-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.product-type-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--color-bg);
}
.product-type-option:hover {
  border-color: var(--color-border-hover);
}
.product-type-option.selected {
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}
.product-type-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}
.product-type-info {
  min-width: 0;
}
.product-type-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}
.product-type-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-top: 2px;
}

.pricing-option-check svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

.pricing-option-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.pricing-option-desc {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* Side-by-side fields row */
.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Toggle row (label + desc + switch) */
.panel-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.panel-toggle-row:last-child {
  border-bottom: none;
}

.panel-toggle-info {
  flex: 1;
}

.panel-toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.panel-toggle-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.panel-toggle-desc a {
  color: var(--color-primary);
  font-weight: 600;
}

/* Panel summary text */
.panel-summary {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.panel-summary strong {
  color: var(--color-text);
}

/* ── Dropzone (drag & drop upload) ─────────── */
.dropzone {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.dropzone-icon {
  font-size: 18px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.dropzone-text a {
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Uploaded file/image preview list */
.upload-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.upload-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* File list (non-image) */
.upload-file-list {
  margin-top: 12px;
}

.upload-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.upload-file-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-file-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.upload-file-info {
  flex: 1;
  min-width: 0;
}

.upload-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-file-size {
  font-size: 12px;
  color: var(--color-text-muted);
}

.upload-file-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
}

.upload-file-remove:hover {
  color: var(--color-error);
}

.upload-file-remove svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ── Links rows ────────────────────────────── */
.links-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.links-row input {
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.links-row input::placeholder {
  color: var(--color-text-muted);
}

.links-row input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

/* ── Variants ──────────────────────────────── */
.variant-list {
  margin-bottom: 12px;
}

.variant-item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 90px minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.variant-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 90px minmax(0, 1fr) 32px;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 2px;
}

/* When stock tracking is on, variants table adds a Stock column */
.variant-list.with-stock .variant-item,
.variant-list.with-stock .variant-header {
  grid-template-columns: minmax(0, 1.2fr) 80px minmax(0, 1fr) 70px 32px;
}

/* Prevent inputs from forcing the grid wider than its container */
.variant-item input {
  min-width: 0;
  width: 100%;
}

.variant-header span {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Variant count badge on product table */
/* Category filter bar */
.category-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}

.category-filter-btn {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.category-filter-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

.category-filter-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Category tags inline (table/grid) */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.category-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  padding: 1px 8px;
  border-radius: var(--radius-full);
}

.variant-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
}

.variant-item input {
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.variant-item input::placeholder {
  color: var(--color-text-muted);
}

.variant-item input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.variant-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.variant-remove:hover {
  color: var(--color-error);
  background: var(--color-error-light);
}

.variant-remove svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.add-variant-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg-secondary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.add-variant-btn:hover {
  background: var(--color-bg-tertiary);
}

/* ── Tag Input (categories) ────────────────── */
.tag-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: text;
  min-height: 42px;
  transition: all var(--transition-fast);
}

.tag-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.tag-remove {
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.tag-remove:hover {
  opacity: 1;
}

.tag-input {
  flex: 1;
  min-width: 80px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--color-text);
  outline: none;
  font-family: inherit;
  padding: 2px 0;
}

.tag-input::placeholder {
  color: var(--color-text-muted);
}

/* ── Tag Suggestions (autocomplete from existing categories) ─ */
.tag-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tag-suggestions[hidden] {
  display: none;
}

.tag-suggestion-item {
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
}

.tag-suggestion-item:hover,
.tag-suggestion-item:focus {
  background: var(--color-primary-light);
  color: var(--color-primary);
  outline: none;
}

.tag-suggestion-item strong {
  font-weight: 600;
}

/* ── Rich Text Editor ──────────────────────── */
.rte-wrapper {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.rte-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.rte-btn {
  width: 30px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.rte-btn:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text);
}

.rte-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.rte-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.rte-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 4px;
}

.rte-body {
  min-height: 100px;
  max-height: 300px;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.6;
  outline: none;
  background: var(--color-surface);
}

.rte-body:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
}

.rte-body h1, .rte-body h2, .rte-body h3 {
  font-weight: 600;
  margin: 8px 0 4px;
}

.rte-body h1 { font-size: 20px; }
.rte-body h2 { font-size: 17px; }
.rte-body h3 { font-size: 15px; }

.rte-body ul, .rte-body ol {
  padding-left: 20px;
  margin: 4px 0;
}

.rte-body a {
  color: var(--color-primary);
  text-decoration: underline;
}

.rte-body blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--color-text-secondary);
}

/* Price input with currency prefix */
.price-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.price-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.price-input-prefix {
  padding: 12px 14px;
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  font-size: 14px;
  border-right: 1px solid var(--color-border);
}

.price-input-wrapper input {
  flex: 1;
  padding: 12px 14px;
  font-size: 14px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  outline: none;
  text-align: right;
}

.price-input-wrapper input::placeholder {
  color: var(--color-text-muted);
}

/* Panel footer (sticky) */
.slide-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 32px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.panel-btn-draft {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.panel-btn-draft:hover {
  background: var(--color-bg-secondary);
}

.panel-btn-publish {
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  flex: 1;
}

.panel-btn-publish:hover {
  background: var(--color-primary-hover);
}

/* ============================================
   Sidebar Backdrop (global — only visible on mobile)
============================================ */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Responsive — Mobile (768px and below)
============================================ */
@media (max-width: 768px) {

  /* ── Sidebar ─────────────────────────────── */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* ── Layout ──────────────────────────────── */
  .main-content {
    margin-left: 0;
  }
  .page-content {
    padding: 12px;
  }

  /* ── Topbar ──────────────────────────────── */
  .topbar {
    padding: 10px 12px;
  }
  .topbar-title {
    font-size: 20px;
  }
  .menu-toggle {
    display: flex;
  }
  .topbar-btn {
    width: 34px;
    height: 34px;
  }
  .topbar-btn svg {
    width: 18px;
    height: 18px;
  }
  .topbar-create-btn {
    width: 34px;
    height: 34px;
  }
  .topbar-right {
    gap: 6px;
  }

  /* ── Tables ──────────────────────────────── */
  .data-table th:nth-child(n+3):not(:last-child),
  .data-table td:nth-child(n+3):not(:last-child) {
    display: none;
  }
  .data-table th {
    padding: 8px 10px;
    font-size: 11px;
  }
  .data-table td {
    padding: 10px;
    font-size: 13px;
  }
  .data-table-thumb {
    width: 32px;
    height: 32px;
  }
  .data-table-name {
    gap: 8px;
  }

  /* ── Summary Stats ───────────────────────── */
  .summary-stats {
    grid-template-columns: 1fr;
  }
  .summary-stat:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
  .summary-stat {
    padding: 14px 16px;
  }
  .summary-stat-value {
    font-size: 22px;
  }

  /* ── Dashboard Metrics ───────────────────── */
  .dash-metrics {
    grid-template-columns: 1fr;
  }
  .dash-metric:not(:last-child) {
    padding-right: 0;
    margin-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .dash-chart {
    height: 180px;
  }
  .dash-filters {
    gap: 6px;
  }
  .dash-legend {
    margin-left: 0;
    width: 100%;
  }
  .dash-filter {
    font-size: 12px;
    padding: 4px 8px;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }

  /* ── Page Toolbar ────────────────────────── */
  .page-toolbar {
    flex-direction: column;
    gap: 10px;
  }
  .page-search {
    width: 100%;
  }
  .page-toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* ── Slide Panels ────────────────────────── */
  .slide-panel {
    width: 100% !important;
    max-width: 100vw !important;
  }
  .slide-panel-header {
    padding: 16px 14px 0;
  }
  .slide-panel-body {
    padding: 14px;
  }
  .slide-panel-footer {
    padding: 10px 14px;
  }
  .slide-panel-title {
    font-size: 20px;
  }

  /* ── Modals (bottom sheet on mobile) ────── */
  .modal {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
  }
  .modal-backdrop.active {
    align-items: flex-end;
  }

  /* ── Forms ───────────────────────────────── */
  .panel-row {
    grid-template-columns: 1fr;
  }
  .panel-input,
  .form-input {
    font-size: 16px;
    padding: 12px 14px;
  }
  .btn {
    min-height: 44px;
    padding: 12px 20px;
  }
  .panel-section-content {
    padding: 12px 14px 14px;
  }

  /* ── Product Grid (admin) ────────────────── */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-grid-item {
    padding: 10px;
  }
  .product-grid-name {
    font-size: 12px;
  }
  .product-grid-price {
    font-size: 11px;
  }

  /* ── Cards ───────────────────────────────── */
  .card {
    padding: 16px;
  }

  /* ── Settings ────────────────────────────── */
  .settings-tabs {
    overflow-x: auto;
    padding: 0 12px;
    -webkit-overflow-scrolling: touch;
  }
  .settings-tab {
    padding: 10px 14px;
    font-size: 13px;
  }
  .settings-content {
    padding: 16px 12px;
  }
  .settings-row {
    flex-direction: column;
    gap: 8px;
  }
  .settings-row-label {
    width: auto;
  }

  /* ── Info Banner ─────────────────────────── */
  .info-banner {
    margin: 0 12px 12px;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* ── Category Filters ────────────────────── */
  .category-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Checkout styles ─────────────────────── */
  .pricing-options {
    grid-template-columns: 1fr;
  }
}
