/* ============================================================================
   MAGIC COSMETICS — "MAISON" DESIGN SYSTEM v2
   Luxury beauty storefront + refined ERP dashboard (AR RTL / EN LTR)
   ============================================================================ */
:root {
  /* Surfaces */
  --bg-page: #fbf6f2;
  --bg-store: #fffdfb;
  --bg-surface: #ffffff;
  --bg-subtle: #fbf6f2;
  --bg-muted: #f8efe9;
  --bg-sidebar: #171311;
  --bg-sidebar-card: rgba(255, 255, 255, 0.05);

  /* Ink */
  --ink: #1c1714;
  --text-main: #1c1714;
  --text-secondary: #4a3f38;
  --text-muted: #6a5d55;
  --text-faint: #a79fb1;

  /* Brand */
  --primary: #8a5a34;
  --primary-dark: #6f4626;
  --primary-light: #f8efe9;
  --accent: #8a5a34;
  --accent-dark: #6f4626;
  --accent-light: #f8efe9;
  --plum: #3a2230;
  --champagne: #c8a26b;
  --champagne-light: #f7efe2;
  --grad-brand: linear-gradient(135deg, #b98a5e 0%, #8a5a34 100%);
  --grad-ink: linear-gradient(135deg, #1c1714 0%, #2e2622 100%);

  /* Status */
  --gold: #b7791f;
  --gold-light: #fdf6e7;
  --success: #0f9f6e;
  --success-light: #eafaf3;
  --danger: #d92d3a;
  --danger-light: #fff1f2;
  --info: #0e7cc4;
  --info-light: #eaf5fd;

  /* Lines */
  --border: #eaded6;
  --border-strong: #d8c8bd;
  --border-subtle: #f4ebe5;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(26, 18, 34, 0.05);
  --shadow-sm: 0 1px 3px rgba(26, 18, 34, 0.05), 0 4px 14px -6px rgba(26, 18, 34, 0.08);
  --shadow-md: 0 10px 30px -10px rgba(26, 18, 34, 0.16), 0 4px 10px -4px rgba(26, 18, 34, 0.06);
  --shadow-lg: 0 30px 60px -18px rgba(26, 18, 34, 0.32);
  --shadow-brand: 0 10px 24px -8px rgba(138, 90, 52, 0.45);
  --ring: 0 0 0 4px rgba(138, 90, 52, 0.14);

  /* Shape */
  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* Type */
  --font-sans: 'Cairo', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Cairo', 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[dir="ltr"] {
  --font-sans: 'Plus Jakarta Sans', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Fraunces', 'Cairo', Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-store {
  background-color: var(--bg-store);
}

::selection {
  background: rgba(138, 90, 52, 0.18);
}

code {
  font-family: var(--font-mono);
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Thin, elegant scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #d6cfde transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  background: #d6cfde;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

.hidden {
  display: none !important;
}

.serif {
  font-family: var(--font-display);
}

/* ============================================================================
   PUBLIC STOREFRONT SHELL
   ============================================================================ */
.ecom-container {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

.ecom-promo-bar {
  background: var(--grad-ink);
  color: #f8efe9;
  font-size: 0.76rem;
  padding: 8px 0;
  letter-spacing: 0.01em;
}

.ecom-promo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.ecom-promo-inner #ecom-promo-text {
  opacity: 0.92;
  font-weight: 500;
}

.promo-campaign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #f8efe9;
}

.promo-campaign::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0b48c;
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.2);
  animation: softPulse 2s infinite;
}

.btn-text-light {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 3px 12px;
  border-radius: 99px;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-text-light:hover {
  background: rgba(255, 255, 255, 0.2);
}

.ecom-header {
  background: rgba(251, 248, 246, 0.86);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid rgba(231, 226, 236, 0.9);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ecom-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.ecom-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.ecom-logo img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.ecom-brand-name {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  line-height: 1.05;
}

.ecom-brand-sub {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-top: 3px;
  text-transform: uppercase;
}

.ecom-search-wrap {
  flex: 1;
  max-width: 560px;
  min-width: 220px;
  position: relative;
  display: flex;
  align-items: center;
}

.ecom-search-icon {
  position: absolute;
  inset-inline-start: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.ecom-search-input {
  width: 100%;
  padding: 12px 18px;
  padding-inline-start: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ecom-search-input::placeholder {
  color: var(--text-faint);
}

.ecom-search-input:focus {
  outline: none;
  border-color: #e0b48c;
  box-shadow: var(--ring);
}

.ecom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Icon buttons in store header */
.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow-xs);
  font-size: 1rem;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn .count-dot {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Staff dropdown menu */
.staff-menu {
  position: relative;
}

.staff-menu>summary {
  list-style: none;
}

.staff-menu>summary::-webkit-details-marker {
  display: none;
}

.staff-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 270px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 150;
  animation: popIn 0.18s var(--ease);
}

.staff-menu-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 12px 6px;
}

.staff-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: start;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  transition: background 0.15s;
}

.staff-menu-item:hover {
  background: var(--bg-subtle);
}

.staff-menu-item .smi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.staff-menu-item small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.ecom-cat-bar {
  border-top: 1px solid var(--border-subtle);
}

.ecom-cat-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  padding-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ecom-cat-inner::-webkit-scrollbar {
  display: none;
}

.ecom-cat-pill {
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.ecom-cat-pill:hover {
  background: #fff;
  border-color: var(--border);
  color: var(--text-main);
}

.ecom-cat-pill.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 6px 16px -6px rgba(26, 18, 34, 0.5);
}

.quick-code-inline {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  padding-inline-start: 14px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.quick-code-inline label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.quick-code-inline input {
  width: 90px;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 6px;
  color: var(--ink);
}

.quick-code-inline .btn {
  border-radius: 999px;
}

/* ---------- Store hero ---------- */
.store-hero {
  background:
    radial-gradient(600px 300px at 88% 10%, rgba(224, 69, 123, 0.38), transparent 60%),
    radial-gradient(500px 340px at 10% 110%, rgba(109, 58, 223, 0.35), transparent 60%),
    var(--grad-ink);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 52px 52px;
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.store-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent, #000 70%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%);
  z-index: -1;
  pointer-events: none;
}

.store-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8efe9;
  margin-bottom: 20px;
}

.store-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 3.3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.store-hero-title em {
  font-style: italic;
  background: linear-gradient(90deg, #e0b48c, #d8b4fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.store-hero-sub {
  font-size: 0.98rem;
  color: rgba(245, 238, 250, 0.78);
  max-width: 560px;
  margin-bottom: 26px;
  line-height: 1.7;
}

.hero-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-cta-row .btn {
  padding: 13px 22px;
  font-size: 0.9rem;
  border-radius: 14px;
}

.btn-light {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
}

.btn-light:hover {
  background: #fdf7fb;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}

.hero-stat span {
  font-size: 0.74rem;
  color: rgba(245, 238, 250, 0.6);
  font-weight: 600;
}

.hero-visual {
  position: relative;
  min-height: 380px;
}

.hero-bottle {
  position: absolute;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #2a1838;
}

.hero-bottle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-bottle.b1 {
  width: 46%;
  height: 300px;
  inset-inline-start: 26%;
  top: 0;
  z-index: 3;
}

.hero-bottle.b2 {
  width: 36%;
  height: 230px;
  inset-inline-start: 0;
  top: 50px;
  z-index: 2;
  transform: rotate(-5deg);
  opacity: 0.92;
}

.hero-bottle.b3 {
  width: 36%;
  height: 230px;
  inset-inline-end: 0;
  top: 50px;
  z-index: 2;
  transform: rotate(5deg);
  opacity: 0.92;
}

.hero-ref-card {
  position: absolute;
  bottom: 0;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: min(380px, 100%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 14px 16px;
  z-index: 4;
}

html[dir="rtl"] .hero-ref-card {
  transform: translateX(50%);
}

.hero-ref-label {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f8efe9;
}

.hero-ref-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 2px 0 4px;
}

.hero-ref-name code {
  color: #f8efe9;
  font-size: 0.8rem;
}

.hero-ref-note {
  font-size: 0.72rem;
  color: rgba(245, 238, 250, 0.7);
  line-height: 1.5;
  margin-bottom: 10px;
}

.hero-ref-form {
  display: flex;
  gap: 6px;
}

.hero-ref-form input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}

@media (max-width: 980px) {
  .store-hero {
    grid-template-columns: 1fr;
    padding: 36px 26px;
  }

  .hero-visual {
    min-height: 400px;
  }
}

/* Trust strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
}

.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.trust-item strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}

.trust-item span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .trust-strip {
    grid-template-columns: 1fr 1fr;
  }
}

/* Section heads */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin: 48px 0 22px;
}

.section-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}

.section-title .count {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.section-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.price-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--champagne-light);
  color: #7a5a2a;
  border: 1px solid #ecdcc0;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-state .es-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

/* ---------- Cart drawer ---------- */
#drawer-cart {
  justify-content: flex-end;
  align-items: stretch;
  padding: 14px;
}

.cart-drawer-card {
  background: #ffffff;
  width: 100%;
  max-width: 500px;
  height: 100%;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideInEnd 0.32s var(--ease);
}

.cart-drawer-card .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}

.cart-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 10px;
  transition: all 0.2s var(--ease);
}

.cart-item-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg-subtle);
  overflow: hidden;
  padding: 2px;
}

.qty-stepper-btn {
  background: #fff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
  transition: background 0.15s;
}

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

.qty-stepper-val {
  width: 32px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.checkout-section {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.checkout-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.payment-radio-group {
  display: grid;
  gap: 8px;
}

.payment-option-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.payment-option-card:hover {
  border-color: #e9a8c1;
  background: #fffafc;
}

.payment-option-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(138, 90, 52, 0.1);
}

.shipping-progress-wrap {
  background: linear-gradient(135deg, #fff7fa 0%, #f8f3ff 100%);
  border: 1px solid #f2dce7;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

/* ==========================================================================
   STANDALONE CHECKOUT PAGE & PROMO CODE STYLES
   ========================================================================== */
.checkout-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 0 50px;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.checkout-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.checkout-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.checkout-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.promo-box-container {
  background: linear-gradient(135deg, #fdf4ff 0%, #fef2f2 100%);
  border: 1.5px dashed #e0b48c;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.promo-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.promo-input-group input {
  flex: 1;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.promo-badge-applied {
  background: #ecfdf5;
  border: 1.5px solid #10b981;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.promo-pill-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #e0b48c;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #8a5a34;
  cursor: pointer;
  transition: all 0.2s;
}

.promo-pill-suggestion:hover {
  background: #f8efe9;
  border-color: #8a5a34;
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.ecom-footer {
  background: var(--bg-sidebar);
  color: #cfc6d8;
  padding: 56px 0 28px;
  margin-top: 72px;
  position: relative;
  overflow: hidden;
}

.ecom-footer::before {
  content: '';
  position: absolute;
  top: -200px;
  inset-inline-end: -120px;
  width: 520px;
  height: 420px;
  background: radial-gradient(closest-side, rgba(138, 90, 52, 0.22), transparent);
  pointer-events: none;
}

.ecom-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #eee6f5;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 99px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.footer-brand-row img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  object-fit: cover;
}

.footer-brand-row strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.footer-about {
  font-size: 0.82rem;
  color: #b3a9bf;
  line-height: 1.75;
  margin-bottom: 10px;
}

.footer-contact {
  font-size: 0.8rem;
  color: #b3a9bf;
  line-height: 1.9;
}

.footer-contact a {
  color: #e0b48c;
  text-decoration: none;
}

.footer-contact strong {
  color: #e6ddef;
  font-weight: 600;
}

/* ============================================================================
   DASHBOARD APP SHELL (SIDEBAR + WORKSPACE)
   ============================================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

.sidebar {
  width: 280px;
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(164, 62, 201, 0.28), transparent 70%),
    radial-gradient(360px 260px at 100% 100%, rgba(138, 90, 52, 0.16), transparent 70%),
    var(--bg-sidebar);
  color: #f8efe9;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 90;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 18px;
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.5);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #ffffff;
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.7rem;
  color: #a79fb1;
  font-weight: 500;
}

.sidebar-profile {
  margin: 4px 0 18px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-section-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #7f758c;
  font-weight: 800;
  padding: 8px 14px 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-tab {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: #b3a9bf;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: start;
  position: relative;
  line-height: 1.3;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #ffffff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  inset-inline-start: -14px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--grad-brand);
}

html[dir="rtl"] .nav-tab.active::before {
  border-radius: 4px 0 0 4px;
}

.nav-icon {
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}

.nav-tab.active .nav-icon {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.nav-badge {
  margin-inline-start: auto;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

.badge-cart {
  background: var(--accent);
}

.badge-warn {
  background: #d98a12;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
}

.campaign-box {
  background: linear-gradient(135deg, rgba(138, 90, 52, 0.16) 0%, rgba(138, 90, 52, 0.16) 100%);
  border: 1px solid rgba(138, 90, 52, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
}

.campaign-live-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: ringPulse 1.8s infinite;
}

.campaign-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e0b48c;
}

.campaign-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f1eaf7;
  line-height: 1.35;
}

/* ---------- Workspace & topbar ---------- */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(247, 245, 248, 0.82);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 80;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

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

/* Identity block in topbar */
.id-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.id-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -6px rgba(26, 18, 34, 0.45);
}

.id-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.25;
}

.id-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.id-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}

.id-links {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
  box-shadow: var(--shadow-xs);
}

.id-links button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.id-links button:hover {
  background: var(--bg-muted);
  color: var(--ink);
}

.switcher-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 10px;
}

.switcher-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.role-select {
  background: transparent;
  color: var(--text-main);
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  max-width: 310px;
}

/* Live sync bar */
.live-stream-bar {
  background: #fff;
  color: var(--text-secondary);
  padding: 9px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--border);
}

.live-stream-bar .ls-title {
  font-weight: 700;
  color: var(--ink);
}

.live-stream-bar .ls-detail {
  color: var(--text-muted);
}

.live-stream-bar .ls-hint {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bfeedd;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}

.main-container.split-view-active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  max-width: 100%;
}

.main-container.split-view-active #panel-store,
.main-container.split-view-active #panel-dashboard {
  display: block !important;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  background: #ffffff;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.main-container.split-view-active .store-layout {
  grid-template-columns: 1fr;
}

.main-container.split-view-active .store-bag-sticky {
  position: static;
}

.main-container {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 72px;
}

/* Page heading inside the dashboard */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-head-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-head-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.2;
  margin-top: 2px;
}

.page-head-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-head-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s var(--ease);
}

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

@media (max-width: 1024px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    padding: 10px 14px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    overflow: visible;
    z-index: 95;
  }

  .sidebar-brand {
    padding: 0;
    flex-shrink: 0;
  }

  .sidebar-brand .brand-copy {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    width: auto;
    white-space: nowrap;
    padding: 6px 10px;
  }

  .nav-tab.active::before {
    display: none;
  }

  .nav-icon {
    width: 28px;
    height: 28px;
    padding: 6px;
  }

  .sidebar-profile,
  .sidebar-footer,
  .sidebar-section-label {
    display: none;
  }

  .topbar {
    position: relative;
    padding: 12px 18px;
  }

  .main-container {
    padding: 20px 16px 60px;
  }

  .live-stream-bar {
    padding: 9px 18px;
  }
}

/* ============================================================================
   BUTTONS & PILLS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s, border-color 0.18s, color 0.18s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 6px 14px -6px rgba(26, 18, 34, 0.55);
}

.btn-primary:hover {
  background: #2c1f38;
}

.btn-accent {
  background: var(--grad-brand);
  background-size: 140% 140%;
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}

.btn-accent:hover {
  background-position: 100% 0;
  box-shadow: 0 14px 28px -10px rgba(138, 90, 52, 0.6);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 6px 14px -6px rgba(15, 159, 110, 0.6);
}

.btn-success:hover {
  background: #0b8a5f;
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fbcdd2;
}

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

/* Outline: light by default (dashboard/modals), inverted on dark surfaces */
.btn-outline {
  background: #ffffff;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.sidebar .btn-outline,
.store-hero .btn-outline,
.scanner-bar .btn-outline,
.bol-top .btn-outline {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar .btn-outline:hover,
.store-hero .btn-outline:hover,
.scanner-bar .btn-outline:hover,
.bol-top .btn-outline:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn-ghost {
  background: #ffffff;
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-lang {
  background: #fff;
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 7px 12px;
  font-size: 0.78rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.76rem;
  border-radius: 10px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
}

/* BADGES */
.code-badge {
  background: var(--ink);
  color: #fdf7ff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tier-pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.role-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kyc-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kyc-APPROVED {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid #bfeedd;
}

.kyc-PENDING {
  background: var(--gold-light);
  color: var(--gold);
  border: 1px solid #f3dfae;
}

.kyc-REJECTED {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fbcdd2;
}

/* ============================================================================
   DASHBOARD ROLE SWITCHER / LEGACY STORE LAYOUT
   ============================================================================ */
.store-referral-bar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.store-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 1120px) {
  .store-layout {
    grid-template-columns: 1fr;
  }
}

.store-bag-sticky {
  position: sticky;
  top: 84px;
}

.role-switcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.role-switch-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  position: relative;
}

.role-switch-card>div:first-child {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.3rem !important;
}

.role-switch-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.role-switch-card.active {
  background: linear-gradient(135deg, #fff 0%, #fdf4fa 100%);
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-md);
}

.role-switch-card.active>div:first-child {
  background: var(--grad-brand);
}

/* ============================================================================
   GRIDS, CARDS & KPI STATS
   ============================================================================ */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.005em;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -40px;
  inset-inline-end: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(138, 90, 52, 0.1), transparent);
  pointer-events: none;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 18px;
  inset-inline-start: 0;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--grad-brand);
}

html[dir="rtl"] .stat-card::after {
  border-radius: 3px 0 0 3px;
}

.grid-4>.stat-card:nth-child(4n+2)::after {
  background: linear-gradient(180deg, #8a5a34, #e0b48c);
}

.grid-4>.stat-card:nth-child(4n+3)::after {
  background: linear-gradient(180deg, #0f9f6e, #34d399);
}

.grid-4>.stat-card:nth-child(4n+4)::after {
  background: linear-gradient(180deg, #c8a26b, #e9c98f);
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 8px 0 4px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================================
   PROGRESS METERS
   ============================================================================ */
.progress-wrap {
  margin: 12px 0;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--grad-brand);
  border-radius: 999px;
  transition: width 0.6s var(--ease);
}

.progress-fill.green {
  background: linear-gradient(90deg, #34d399 0%, #0f9f6e 100%);
}

.progress-fill.gold {
  background: linear-gradient(90deg, #f3c56b 0%, #c8a26b 100%);
}

/* ============================================================================
   DATA TABLES
   ============================================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th,
td {
  padding: 13px 16px;
  text-align: start;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

tbody tr {
  transition: background 0.15s;
}

tr:hover td {
  background: #fcfaff;
}

/* ============================================================================
   GENEALOGY TREE
   ============================================================================ */
.tree-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}

.tree-badges-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
  margin-inline-end: 4px;
}

.rank-legend-badge {
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(26, 18, 34, 0.14);
  display: inline-flex;
  align-items: center;
}

.tree-header-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tree-viewport-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.tree-canvas-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 40px 24px 80px;
  background: radial-gradient(#e4dcea 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  background-color: #fcfbfd;
  min-height: 560px;
  display: flex;
  justify-content: center;
  position: relative;
  direction: ltr !important;
  /* Keep connecting lines symmetrically aligned in both RTL and LTR */
}

/* PURE CSS HIERARCHICAL CONNECTING TREE LINES */
.org-tree,
.org-tree ul {
  display: flex;
  justify-content: center;
  padding-top: 32px;
  position: relative;
  transition: all 0.3s ease;
  margin: 0;
  padding-inline-start: 0;
}

.org-tree li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 32px 14px 0 14px;
  transition: all 0.3s ease;
}

.org-tree li::before,
.org-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid #d9cfe3;
  width: 50%;
  height: 32px;
}

.org-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid #d9cfe3;
}

.org-tree li:only-child::after,
.org-tree li:only-child::before {
  display: none;
}

.org-tree li:first-child::before {
  border: 0 none;
}

.org-tree li:last-child::after {
  border: 0 none;
}

.org-tree li:last-child::before {
  border-right: 2px solid #d9cfe3;
  border-radius: 0 12px 0 0;
}

.org-tree li:first-child::after {
  border-radius: 12px 0 0 0;
}

.org-tree ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid #d9cfe3;
  width: 0;
  height: 32px;
  transform: translateX(-50%);
}

.tree-rep-node {
  width: 220px;
  background: #ffffff;
  border: 1.5px solid #f0c7d7;
  border-radius: 18px;
  padding: 12px 10px 0 10px;
  box-shadow: 0 8px 20px -10px rgba(138, 90, 52, 0.35);
  cursor: pointer;
  transition: all 0.25s var(--ease);
  position: relative;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  box-sizing: border-box;
}

.tree-rep-node:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px -12px rgba(138, 90, 52, 0.45);
  border-color: var(--accent);
}

.tree-rep-node.is-root {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(138, 90, 52, 0.1), 0 14px 28px -12px rgba(138, 90, 52, 0.5);
}

.tree-rep-node.is-highlighted {
  border-color: var(--accent);
  outline: 4px solid #f8efe9;
  animation: pulse-node 1.5s infinite;
}

@keyframes pulse-node {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

.rep-rank-pill {
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 12px;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(26, 18, 34, 0.15);
  margin-bottom: 9px;
  white-space: nowrap;
}

.rep-identity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 0 4px;
}

.rep-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f8efe9;
  background: #f8efe9;
  flex-shrink: 0;
}

.rep-info {
  text-align: start;
  min-width: 0;
  flex: 1;
}

.rep-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rep-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 2px;
}

.rep-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: calc(100% + 20px);
  margin: 0 -10px;
  background: linear-gradient(180deg, #fff6f9, #fdf0f5);
  border-top: 1px solid #f8efe9;
  padding: 8px 6px;
  border-radius: 0 0 16px 16px;
}

.rep-metric-col {
  text-align: center;
}

.rep-metric-col:first-child {
  border-inline-end: 1px solid #f8efe9;
}

.metric-lbl {
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric-val {
  font-size: 0.96rem;
  font-weight: 800;
  margin-top: 2px;
  line-height: 1.1;
}

.metric-val.pv {
  color: var(--ink);
}

.metric-val.gv {
  color: var(--accent);
}

.tree-branch-toggle {
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid #d9cfe3;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(26, 18, 34, 0.12);
  z-index: 5;
  transition: all 0.2s ease;
}

.tree-branch-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateX(-50%) scale(1.15);
}

.holding-card {
  background: #ffffff;
  border: 1px solid #f3dfae;
  border-inline-start: 4px solid #e0a429;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-xs);
}

/* ============================================================================
   POS SCANNER, QUICK-ORDER PAD & INPUTS
   ============================================================================ */
.scanner-bar {
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(138, 90, 52, 0.3), transparent 70%),
    var(--grad-ink);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-md);
}

.scanner-input {
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 12px;
  border: 2px solid #34d399;
  min-width: 280px;
  outline: none;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.18);
}

.quick-pad-row {
  display: grid;
  grid-template-columns: 125px 1fr 115px 115px 86px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: all 0.18s;
}

.quick-pad-row:focus-within {
  border-color: #e0b48c;
  background: #ffffff;
  box-shadow: var(--ring);
}

@media (max-width: 768px) {
  .quick-pad-row {
    grid-template-columns: 1fr;
  }
}

.code-input {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  text-align: center;
  color: var(--text-main);
  background: #ffffff;
}

.code-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.input-field,
select.input-field,
textarea.input-field {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  font-family: inherit;
  font-size: 0.86rem;
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.input-field::placeholder {
  color: var(--text-faint);
}

.input-field:hover {
  border-color: #c3b9cf;
}

.input-field:focus {
  outline: none;
  border-color: #e0b48c;
  box-shadow: var(--ring);
}

select.input-field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7086' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-inline-end: 34px;
}

html[dir="rtl"] select.input-field {
  background-position: left 12px center;
}

label {
  color: var(--text-secondary);
}

/* ============================================================================
   PRODUCT CARDS
   ============================================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.product-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.product-visual {
  height: 280px;
  border-radius: 16px;
  background: linear-gradient(160deg, #f8f2f6, #efe8f3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s var(--ease);
}

.product-card:hover .product-img {
  transform: scale(1.06);
}

.product-visual::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(0deg, rgba(26, 18, 34, 0.35), transparent);
  pointer-events: none;
  opacity: 0.8;
}

.gender-badge {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  z-index: 2;
}

.pc-quick-view {
  position: absolute;
  inset-inline: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s var(--ease);
}

.product-card:hover .pc-quick-view,
.product-card:focus-within .pc-quick-view {
  opacity: 1;
  transform: translateY(0);
}

.pc-round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 6px 16px -6px rgba(26, 18, 34, 0.45);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.pc-round-btn:hover {
  transform: scale(1.08);
  background: #fff;
}

.pc-body {
  padding: 4px 8px 6px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.pc-name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  margin: 6px 0 6px;
  line-height: 1.25;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: -0.005em;
}

.pc-name:hover {
  color: var(--accent);
}

.pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}

.pc-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding: 0 4px 4px;
}

.pc-actions .btn-add {
  flex: 1;
  padding: 11px 14px;
  border-radius: 13px;
}

.pc-actions .btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
}

.product-desc-clamp {
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.prod-code-tag {
  background: var(--ink);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 7px;
  display: inline-block;
}

.product-visual .prod-code-tag {
  background: rgba(26, 18, 34, 0.78);
  backdrop-filter: blur(6px);
}

.barcode-box {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: 11px;
  padding: 7px 10px 5px;
  margin: 10px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.barcode-box:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.barcode-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  margin-top: 3px;
}

.stock-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.stock-IN_STOCK {
  background: var(--success-light);
  color: var(--success);
}

.stock-LOW_STOCK {
  background: var(--gold-light);
  color: var(--gold);
}

.stock-OUT_OF_STOCK {
  background: var(--danger-light);
  color: var(--danger);
}

.product-visual .stock-pill {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.price-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0;
}

.member-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.catalog-price {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.bp-tag {
  background: var(--accent-light);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid #f8efe9;
}

/* ============================================================================
   MODALS & TOASTS
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 15, 31, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: fadeOnly 0.2s ease;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.28s var(--ease);
}

.modal-card.modal-xl {
  max-width: 1080px;
}

.modal-card.modal-lg {
  max-width: 860px;
}

.modal-header {
  padding: 20px 26px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.modal-close {
  background: var(--bg-muted);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}

.modal-close:hover {
  background: var(--ink);
  color: #fff;
  transform: rotate(90deg);
}

.modal-body {
  padding: 22px 26px 26px;
}

.id-card-preview {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font-family: var(--font-mono);
}

/* Login modal extras */
.login-hero {
  background:
    radial-gradient(260px 140px at 100% 0%, rgba(224, 69, 123, 0.35), transparent 70%),
    var(--grad-ink);
  color: #fff;
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-hero img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff;
  object-fit: cover;
}

.login-hero strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  display: block;
}

.login-hero span {
  font-size: 0.78rem;
  color: rgba(245, 238, 250, 0.75);
}

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

.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  cursor: pointer;
  text-align: start;
  transition: all 0.18s var(--ease);
}

.demo-account:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.demo-account .da-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-account .da-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}

.demo-account .da-code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* OFFICIAL BILL OF LADING / WAYBILL */
.bol-sheet {
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.bol-top {
  background: var(--ink);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.bol-route-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-bottom: 2px solid var(--ink);
  background: var(--bg-subtle);
}

.bol-route-cell {
  padding: 10px 14px;
  border-inline-end: 1px solid var(--border-strong);
}

.bol-route-cell:last-child {
  border-inline-end: none;
}

.bol-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid var(--ink);
}

.bol-party-box {
  padding: 14px 18px;
  border-inline-end: 1px solid var(--border-strong);
}

.bol-party-box:last-child {
  border-inline-end: none;
}

.bol-cod-banner {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  font-weight: 800;
}

.bol-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-subtle);
  border-top: 1px dashed var(--text-faint);
}

.bol-sig-box {
  padding: 12px 16px;
  border-inline-end: 1px dashed var(--border-strong);
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 68px;
}

.bol-sig-box:last-child {
  border-inline-end: none;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(26, 18, 34, 0.94);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 13px 18px 13px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastIn 0.35s var(--ease);
  pointer-events: auto;
}

.toast::before {
  content: '✓';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ============================================================================
   FOOTER GRID & POLICY PAGES
   ============================================================================ */
.ecom-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.1fr 1.5fr;
  gap: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

@media (max-width: 960px) {
  .ecom-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

.footer-col-title {
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-links-list a {
  color: #b3a9bf;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  transition: color 0.15s;
}

.footer-links-list a:hover {
  color: #e0b48c;
}

.ecom-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 22px;
  font-size: 0.76rem;
  color: #8f859b;
  position: relative;
}

.policy-page-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  margin: 28px 0 36px;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
}

.policy-page-card h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}

.policy-page-card h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 20px 0 8px;
}

.policy-section-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

/* CLICKABLE PRODUCTS ROW */
.clickable-product-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-product-row:hover {
  background-color: #faf6fd;
}

.clickable-product-row:active {
  background-color: var(--bg-muted);
}

/* ============================================================================
   RESPONSIVE STORE HEADER
   ============================================================================ */
@media (max-width: 1100px) {
  .ecom-header-inner {
    flex-wrap: wrap;
  }

  .ecom-search-wrap {
    order: 3;
    max-width: none;
    flex-basis: 100%;
  }

  .btn-label-hide-md {
    display: none;
  }
}

@media (max-width: 640px) {
  .ecom-container {
    padding: 0 16px;
  }

  .ecom-brand-sub {
    display: none;
  }

  .store-hero {
    border-radius: 22px;
    padding: 28px 20px;
  }

  .hero-visual {
    min-height: 340px;
  }

  .hero-bottle.b1 {
    height: 240px;
  }

  .hero-bottle.b2,
  .hero-bottle.b3 {
    height: 180px;
  }

  .quick-code-inline label {
    display: none;
  }

  .product-visual {
    height: 240px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

@keyframes fadeOnly {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInEnd {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir="rtl"] .cart-drawer-card {
  animation-name: slideInStartRtl;
}

@keyframes slideInStartRtl {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes softPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

@keyframes ringPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   NORMAL BUYER DASHBOARD & ORDER TRACKING STYLES
   ============================================================================ */
.buyer-portal-wrap {
  margin: 28px 0 60px;
  animation: fadeIn 0.25s ease-out;
}

.buyer-hero {
  background: linear-gradient(135deg, #1e1035 0%, #3b1344 60%, #581c87 100%);
  color: #fff;
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 14px 35px rgba(30, 16, 53, 0.18);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.buyer-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, rgba(236, 72, 153, 0) 70%);
  pointer-events: none;
}

.buyer-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  color: #fbcfe8;
}

.buyer-hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.25;
}

.buyer-hero-sub {
  font-size: 0.95rem;
  color: #f8efe9;
  max-width: 680px;
  line-height: 1.6;
}

.buyer-lookup-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  margin-bottom: 28px;
}

.buyer-search-bar {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.buyer-search-bar input {
  flex: 1;
  min-width: 260px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid var(--border);
  outline: none;
  transition: all 0.2s ease;
}

.buyer-search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.buyer-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.buyer-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.buyer-chip:hover {
  border-color: var(--primary);
  background: #f8efe9;
  color: var(--primary);
  transform: translateY(-1px);
}

.buyer-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.buyer-kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.buyer-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.buyer-kpi-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
}

.buyer-kpi-lbl {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.buyer-order-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.buyer-order-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.buyer-order-header {
  padding: 20px 24px;
  background: #faf8fc;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.buyer-order-body {
  padding: 24px;
}

.tracking-stepper-wrap {
  margin: 10px 0 28px;
  padding: 22px 16px;
  background: #fbf9fd;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.tracking-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
  gap: 8px;
}

.tracking-stepper::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 12%;
  right: 12%;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

.tracking-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.tracking-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #cbd5e1;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.tracking-step.done .tracking-circle {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.tracking-step.active .tracking-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.2);
  animation: ringPulse 2s infinite;
}

.tracking-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 3px;
}

.tracking-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tracking-step.future .tracking-title {
  color: #94a3b8;
}

.buyer-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  gap: 14px;
}

.buyer-item-thumb {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.buyer-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

@media (max-width: 640px) {
  .tracking-stepper::before {
    display: none;
  }

  .tracking-stepper {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .buyer-hero {
    padding: 24px 20px;
  }
}

/* ============================================================================
   MAGIC COSMETICS — LUXURY CATALOG BOOK & LOOKBOOK MAGAZINE
   ============================================================================ */
.catalog-book-modal {
  max-width: 1240px;
  width: 96vw;
  height: 94vh;
  display: flex;
  flex-direction: column;
  background: #fdfbfd;
  border: 1px solid var(--border);
  box-shadow: 0 30px 90px -20px rgba(22, 15, 31, 0.45);
  border-radius: 24px;
  overflow: hidden;
}

.catalog-book-header {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.catalog-book-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-book-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 36px;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(138, 90, 52, 0.05), transparent 70%),
    #f8f6fa;
}

.catalog-book-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.book-view-switcher {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.book-view-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.book-view-btn.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.book-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.book-page-indicator {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-subtle);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* SPREAD CONTAINER (Magazine Dual-Page Look) */
.book-spread-container {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  max-width: 1140px;
  perspective: 1600px;
}

.book-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 40px -12px rgba(22, 15, 31, 0.18), 0 0 0 1px rgba(22, 15, 31, 0.06);
  overflow: hidden;
  position: relative;
  min-height: 640px;
}

/* Center spine gutter shadow of a real open magazine */
.book-spread::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.04) 100%);
  z-index: 5;
  pointer-events: none;
}

.book-page {
  padding: 34px 38px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #ffffff;
}

.book-page.left-page {
  border-inline-end: 1px solid #f0ecf4;
}

.book-page-running-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #f1edf6;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.book-page-number {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* EDITORIAL PRODUCT SHOWCASE ON PAGE */
.book-product-showcase {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-product-photo-wrap {
  width: 100%;
  height: 290px;
  border-radius: 18px;
  background: linear-gradient(145deg, #fbf7fa, #f4eef7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.book-product-photo-wrap img {
  max-width: 85%;
  max-height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 14px 20px rgba(22, 15, 31, 0.22));
  transition: transform 0.4s var(--ease);
}

.book-product-photo-wrap:hover img {
  transform: scale(1.05);
}

.book-prod-floating-tag {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  background: rgba(22, 15, 31, 0.85);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  z-index: 2;
}

.book-prod-gender-tag {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.book-prod-family-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 4px;
}

.book-prod-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 6px;
}

.book-prod-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* OLFACTORY NOTES PYRAMID BOX */
.olfactory-pyramid {
  background: #fbf9fd;
  border: 1px solid #efe8f4;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
}

.olfactory-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.78rem;
}

.olfactory-lbl {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  width: 78px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.olfactory-val {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.book-bottom-order-strip {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.book-price-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.book-price-main {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-display);
}

.book-barcode-small {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* LUXURY COVER PAGE */
.book-cover {
  grid-column: 1 / -1;
  background:
    radial-gradient(700px 350px at 80% 20%, rgba(138, 90, 52, 0.45), transparent 70%),
    radial-gradient(600px 350px at 20% 90%, rgba(138, 90, 52, 0.4), transparent 70%),
    var(--grad-ink);
  color: #ffffff;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  position: relative;
  min-height: 660px;
  overflow: hidden;
}

.book-cover::after {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  pointer-events: none;
}

.book-cover-logo {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  object-fit: cover;
  background: #ffffff;
  margin: 0 auto 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.book-cover-pretitle {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f8efe9;
  margin-bottom: 12px;
}

.book-cover-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.book-cover-sub {
  font-size: 1.05rem;
  color: rgba(245, 238, 250, 0.85);
  max-width: 620px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.book-cover-badges-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.book-cover-badge {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8efe9;
}

.book-cover-footer {
  font-size: 0.76rem;
  color: rgba(245, 238, 250, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* BACK COVER */
.book-back-cover {
  grid-column: 1 / -1;
  background: var(--bg-sidebar);
  color: #e6dfed;
  padding: 50px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 640px;
  position: relative;
  text-align: center;
}

.book-back-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 36px 0;
  text-align: start;
}

.book-back-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
}

.book-back-card h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.book-back-card p, .book-back-card li {
  font-size: 0.8rem;
  color: #b5abbf;
  line-height: 1.7;
}

/* ALL SPREADS / GRID VIEW */
.book-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .book-spread {
    grid-template-columns: 1fr;
  }
  .book-spread::before {
    display: none;
  }
  .book-page.left-page {
    border-inline-end: none;
    border-bottom: 1px solid #f0ecf4;
  }
  .book-back-grid {
    grid-template-columns: 1fr;
  }
  .catalog-book-modal {
    width: 98vw;
    height: 96vh;
    border-radius: 16px;
  }
  .catalog-book-header {
    padding: 12px 16px;
  }
  .catalog-book-body {
    padding: 14px;
  }
  .book-page {
    padding: 24px 20px;
  }
}

/* ============================================================================
   PRINT / PDF BROCHURE STYLES
   ============================================================================ */
@media print {
  body * {
    visibility: hidden;
  }

  #modal-catalog-book,
  #modal-catalog-book * {
    visibility: visible;
  }

  #modal-catalog-book {
    position: absolute;
    inset: 0;
    width: 100%;
    height: auto;
    background: #ffffff !important;
    padding: 0;
    margin: 0;
    display: block !important;
  }

  .catalog-book-modal {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: #ffffff !important;
  }

  .catalog-book-header,
  .catalog-book-toolbar,
  .modal-close,
  .book-bottom-order-strip button,
  .catalog-book-top-actions {
    display: none !important;
  }

  .catalog-book-body {
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .book-spread {
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always;
    break-after: page;
    min-height: auto;
    border: none !important;
  }

  .book-cover, .book-back-cover {
    page-break-after: always;
    break-after: page;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
/* Control centre */
.cc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 18px; }
.cc-queue { padding: 16px; }
.cc-wide { grid-column: 1 / -1; }
.cc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cc-row { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.cc-main { flex: 1; min-width: 0; }
.cc-main small { display: block; color: var(--text-muted); }
.cc-empty { color: var(--text-muted); padding: 10px 0; font-size: 0.85rem; }

/* Tablet navigation: tabs on their own scrollable row */
@media (max-width: 1024px) {
  .sidebar { flex-wrap: wrap; }
  .sidebar-nav { order: 3; flex: 1 0 100%; min-width: 0; overflow-x: auto; }
  .nav-tab { flex: 0 0 auto; }
}

.role-login-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }

.address-cell { min-width: 220px; max-width: 300px; white-space: normal; font-size: 0.8rem; color: var(--text-secondary); }

/* Phone layout for dashboards */
@media (max-width: 640px) {
  .main-container { padding: 12px !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .cc-grid { grid-template-columns: 1fr; }
  .cc-row { flex-wrap: wrap; }
  .cc-row .btn { flex: 1 1 auto; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-right { flex-wrap: wrap; }
  .modal-card { width: calc(100vw - 24px) !important; max-width: none !important; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .page-head h1, .page-head h2 { font-size: 1.4rem; }
}

/* Store chat assistant */
.mc-chat-btn{position:fixed;bottom:20px;inset-inline-end:20px;z-index:900;width:52px;height:52px;border-radius:50%;border:0;background:var(--primary,#a8505f);color:#fff;box-shadow:0 6px 20px rgba(0,0,0,.18);cursor:pointer;display:flex;align-items:center;justify-content:center}
.mc-chat{position:fixed;bottom:84px;inset-inline-end:20px;z-index:901;width:min(360px,calc(100vw - 32px));height:min(480px,70vh);background:var(--surface,#fff);border:1px solid var(--border,#eadfd9);border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.18);display:flex;flex-direction:column;overflow:hidden}
.mc-chat.hidden{display:none}
.mc-chat-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border,#eadfd9)}
.mc-chat-head strong{flex:1}
.mc-chat-head select{font-size:12px;border-radius:8px;padding:2px 4px}
.mc-chat-log{flex:1;overflow:auto;padding:12px;display:flex;flex-direction:column;gap:8px}
.mc-msg{max-width:85%;padding:8px 11px;border-radius:12px;font-size:14px;line-height:1.45;white-space:pre-wrap}
.mc-msg.bot{background:var(--surface-2,#f7f0ec);align-self:flex-start}
.mc-msg.me{background:var(--primary,#a8505f);color:#fff;align-self:flex-end}
.mc-chat-form{display:flex;gap:6px;padding:10px;border-top:1px solid var(--border,#eadfd9)}
.mc-chat-form input{flex:1}


/* ===================== Dashboard polish (Nov 2026) ===================== */
/* KPI rows: 4 across on desktop, 2 on tablet/phone */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-card .stat-value { color: var(--text-main); font-variant-numeric: tabular-nums; }
.stat-card .stat-label { color: var(--text-muted); }

/* Status badges used across tables and cards */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Buttons that had no style */
.btn-xs { padding: 4px 9px; font-size: 0.7rem; border-radius: 8px; min-height: 28px; }
.btn-secondary { background: var(--bg-muted); color: var(--text-main); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: var(--primary-light); border-color: var(--primary); }

/* Tables: codes and order numbers stay on one line, numbers line up */
td code, td .mono { white-space: nowrap; }
td { font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: #fffaf6; }
.table-wrap { box-shadow: var(--shadow-xs); }

/* Sidebar: every item the same look; badges in one brand colour */
.sidebar-nav .nav-tab .nav-badge:not(.badge-warn):not(.badge-cart) { background: var(--primary); color: #fff; }

/* Cards and page rhythm */
.tab-panel .card { border-radius: var(--radius-md); }
.tab-panel .card + .card { margin-top: 16px; }
.tab-panel .grid-2, .tab-panel .grid-3, .tab-panel .grid-4 { gap: 14px; }

/* Keyboard focus that is easy to see */
.btn:focus-visible, .nav-tab:focus-visible, .input-field:focus-visible, select:focus-visible { outline: none; box-shadow: var(--ring); }

/* Phones: comfortable tap targets, tables scroll inside their box */
@media (max-width: 640px) {
  .btn-sm { min-height: 36px; }
  .btn-xs { min-height: 32px; }
  th, td { padding: 10px 12px; }
}

/* Dashboard queues: each card is only as tall as its content; long lists scroll inside the card */
.cc-grid { align-items: start; }
.cc-queue { max-height: 440px; overflow-y: auto; }
.cc-queue .cc-head { position: sticky; top: 0; background: var(--bg-surface); z-index: 1; }
.sidebar-footer { display: grid; gap: 8px; }
@media (max-width: 1024px) { .sidebar-footer { display: none; } }

/* ===================== Android app shell (only inside the app) ===================== */
.app-tabbar { display: none; }
html.in-app .app-tabbar {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  position: fixed; inset-inline: 0; bottom: 0; z-index: 150; /* below pop-ups (200) */
  background: #ffffff; border-top: 1px solid var(--border);
  padding: 6px 6px calc(10px + env(safe-area-inset-bottom, 0px));
}
html.in-app .app-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; border: 0; background: transparent; cursor: pointer;
  color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 600;
}
html.in-app .app-tab.active { color: var(--primary); font-weight: 800; }
html.in-app .app-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 12px; }
html.in-app .app-tab-badge {
  position: absolute; top: 2px; inset-inline-start: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
html.in-app body { padding-bottom: 76px; }
html.in-app .mc-chat-btn { bottom: 88px; }

/* Phones: a wide table scrolls inside its own box instead of stretching the whole page
   (on Android a stretched page also pushes the app's tab bar off-screen). */
@media (max-width: 768px) {
  .tab-panel table, .policy-page-card table, .modal-card table {
    display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .tab-panel .card, .tab-panel .card-header, .tab-panel .progress-wrap { min-width: 0; max-width: 100%; }
}
@media (max-width: 768px) {
  /* rows of buttons and headings wrap instead of pushing past the screen edge */
  .tab-panel [style*="display:flex"], .tab-panel [style*="display: flex"],
  .policy-page-card [style*="display:flex"], .policy-page-card [style*="display: flex"],
  .modal-card [style*="display:flex"], .modal-card [style*="display: flex"] { flex-wrap: wrap; }
  .btn { white-space: normal; max-width: 100%; }
}
