
/* ═══════════════════════════════════════════════════════
   SOUK — MARKETPLACE DESIGN SYSTEM v3
   RTL Arabic E-Commerce · Clean Modern UI
   ═══════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ───────────────────────────── */
:root {
  /* === Primary — Teal === */
  --primary:        #0d9488;
  --primary-dark:   #0f766e;
  --primary-light:  #5eead4;
  --primary-ghost:  rgba(13,148,136,.10);
  --primary-ghost2: rgba(13,148,136,.18);

  /* === CTA — Amber (Conversion Buttons) === */
  --cta:            #f59e0b;
  --cta-dark:       #d97706;
  --cta-light:      #fcd34d;
  --cta-ghost:      rgba(245,158,11,.12);

  /* === Accent — Indigo accent for variety === */
  --accent:         #6366f1;
  --accent-dark:    #4f46e5;

  /* === Status === */
  --success:        #16a34a;
  --success-light:  #22c55e;
  --success-ghost:  rgba(22,163,74,.10);
  --warning:        #d97706;
  --warning-ghost:  rgba(217,119,6,.10);
  --danger:         #dc2626;
  --danger-light:   #ef4444;
  --danger-ghost:   rgba(220,38,38,.10);
  --info:           #0284c7;
  --info-ghost:     rgba(2,132,199,.10);

  /* === Surfaces — Light Mode === */
  --bg:             #f1f5f9;
  --bg-card:        #ffffff;
  --bg-surface:     #f8fafc;
  --bg-surface-2:   #e2e8f0;
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;
  --border-focus:   var(--primary);

  /* === Text === */
  --text:           #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --text-inverse:   #ffffff;

  /* === Sidebar (dark nav areas) === */
  --sidebar-bg:           #0a1628;
  --sidebar-bg-solid:     #0a1628;
  --sidebar-surface:      #111f36;
  --sidebar-text:         rgba(255,255,255,.55);
  --sidebar-text-hover:   #ffffff;
  --sidebar-active-bg:    rgba(13,148,136,.22);
  --sidebar-active:       #5eead4;
  --sidebar-border:       rgba(255,255,255,.07);
  --sidebar-width:        268px;

  /* === Shadows === */
  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-sm: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 4px 6px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --shadow-md: 0 10px 15px rgba(15,23,42,.07), 0 4px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 20px 25px rgba(15,23,42,.07), 0 8px 10px rgba(15,23,42,.04);
  --shadow-xl: 0 25px 50px rgba(15,23,42,.10);
  --shadow-primary: 0 4px 16px rgba(13,148,136,.30);
  --shadow-cta:     0 4px 16px rgba(245,158,11,.35);

  /* === Radius === */
  --radius-xs:  3px;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --radius-2xl: 30px;
  --radius-full:9999px;

  /* === Transitions === */
  --ease:        cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --ease-out:    cubic-bezier(0,0,.2,1);
  --t-fast: .1s var(--ease);
  --t:      .2s var(--ease);
  --t-slow: .35s var(--ease);

  /* === Layout === */
  --navbar-h: 66px;
}

/* ── Dark Theme ───────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #060d1a;
  --bg-card:      #0d1b2e;
  --bg-surface:   #112038;
  --bg-surface-2: #1a2f4a;
  --border:       #1a2f4a;
  --border-strong:#2a3f5a;
  --text:         #f1f5f9;
  --text-secondary:#cbd5e1;
  --text-muted:   #7a91b0;
  --text-light:   #3a5070;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.35);
  --shadow:       0 4px 6px rgba(0,0,0,.45);
  --shadow-md:    0 10px 15px rgba(0,0,0,.5);
  --shadow-lg:    0 20px 25px rgba(0,0,0,.55);
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box }
html { scroll-behavior: smooth }
body {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .3s var(--ease), color .3s var(--ease);
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════════════════ */
@keyframes fadeIn       { from{opacity:0}              to{opacity:1} }
@keyframes slideUp      { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:none} }
@keyframes slideDown    { from{opacity:0;transform:translateY(-18px)} to{opacity:1;transform:none} }
@keyframes scaleIn      { from{opacity:0;transform:scale(.92)}        to{opacity:1;transform:none} }
@keyframes float        { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes gradientFlow { 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }
@keyframes shimmer      { from{background-position:-200% 0} to{background-position:200% 0} }
@keyframes glowPulse    { 0%,100%{box-shadow:0 0 10px rgba(13,148,136,.25)} 50%{box-shadow:0 0 26px rgba(13,148,136,.55)} }
@keyframes notifyBadge  { 0%{transform:scale(1)} 35%{transform:scale(1.3)} 65%{transform:scale(.9)} 100%{transform:scale(1)} }
@keyframes countUp      { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }
@keyframes cardReveal   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }
@keyframes sidebarIn    { from{opacity:0;transform:translateX(10px)} to{opacity:1;transform:none} }
@keyframes pulse        { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Button animations ───────────────────────────────── */
@keyframes btnPress {
  0%   { transform: scale(1) }
  40%  { transform: scale(.95) }
  70%  { transform: scale(1.03) }
  100% { transform: scale(1) }
}
@keyframes rippleOut {
  0%   { transform: scale(0); opacity: .5 }
  100% { transform: scale(2.5); opacity: 0 }
}

/* Scroll reveal helpers */
.reveal {
  opacity:0; transform:translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.reveal.visible { opacity:1; transform:none }

.animate-fade-in    { animation: fadeIn    .45s var(--ease) both }
.animate-slide-up   { animation: slideUp   .45s var(--ease) both }
.animate-slide-down { animation: slideDown .35s var(--ease) both }
.animate-scale-in   { animation: scaleIn   .35s var(--ease) both }
.animate-float      { animation: float      3s  ease-in-out infinite }
.delay-100 { animation-delay:.1s } .delay-200 { animation-delay:.2s }
.delay-300 { animation-delay:.3s } .delay-400 { animation-delay:.4s }
.delay-500 { animation-delay:.5s }

/* ══════════════════════════════════════════════════════
   BUTTONS — New Hierarchy
   ══════════════════════════════════════════════════════ */

/* ── Base ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .01em;
  line-height: 1.2;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  padding: .6rem 1.35rem;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background   .18s var(--ease),
    color        .18s var(--ease),
    border-color .18s var(--ease),
    box-shadow   .18s var(--ease),
    transform    .16s var(--ease-spring);
}
.btn:disabled, .btn.disabled {
  opacity: .5;
  pointer-events: none;
}

/* Ripple */
.btn .btn-ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: rippleOut .5s var(--ease) forwards;
  pointer-events: none;
}

/* Active: subtle press */
.btn:active:not(:disabled) {
  transform: scale(.96);
  transition-duration: .08s;
}

/* Focus ring */
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.btn:focus:not(:focus-visible) { outline: none }

/* ─────────────────────────────────────────────────────
   PRIMARY — Teal solid
   ───────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(13,148,136,.40);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary .btn-ripple-wave { background: rgba(255,255,255,.3) }

/* ─────────────────────────────────────────────────────
   CTA — Amber (Add to Cart / Checkout / Confirm)
   Use for the most important conversion actions
   ───────────────────────────────────────────────────── */
.btn-cta {
  background: var(--cta);
  color: #1c1917;
  border-color: var(--cta);
  box-shadow: var(--shadow-cta);
  font-weight: 800;
}
.btn-cta:hover:not(:disabled) {
  background: var(--cta-dark);
  border-color: var(--cta-dark);
  box-shadow: 0 6px 22px rgba(245,158,11,.45);
  transform: translateY(-1px);
  color: #1c1917;
}
.btn-cta .btn-ripple-wave { background: rgba(255,255,255,.4) }

/* ─────────────────────────────────────────────────────
   OUTLINE PRIMARY
   ───────────────────────────────────────────────────── */
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}
.btn-outline-primary .btn-ripple-wave { background: rgba(13,148,136,.2) }

/* ─────────────────────────────────────────────────────
   GHOST — minimal, no border
   ───────────────────────────────────────────────────── */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  box-shadow: none;
  padding: .5rem .85rem;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-surface-2);
  color: var(--text);
  border-color: transparent;
}
.btn-ghost .btn-ripple-wave { background: rgba(15,23,42,.1) }
[data-theme="dark"] .btn-ghost .btn-ripple-wave { background: rgba(255,255,255,.08) }

/* ─────────────────────────────────────────────────────
   SUCCESS
   ───────────────────────────────────────────────────── */
.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 4px 14px rgba(22,163,74,.30);
}
.btn-success:hover:not(:disabled) {
  background: #15803d;
  border-color: #15803d;
  box-shadow: 0 6px 20px rgba(22,163,74,.40);
  transform: translateY(-1px);
  color: #fff;
}

/* ─────────────────────────────────────────────────────
   DANGER
   ───────────────────────────────────────────────────── */
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 4px 14px rgba(220,38,38,.25);
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
  box-shadow: 0 6px 20px rgba(220,38,38,.38);
  transform: translateY(-1px);
  color: #fff;
}
.btn-danger .btn-ripple-wave { background: rgba(255,255,255,.3) }

/* ─────────────────────────────────────────────────────
   OUTLINE DANGER
   ───────────────────────────────────────────────────── */
.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

/* ─────────────────────────────────────────────────────
   WARNING
   ───────────────────────────────────────────────────── */
.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
  box-shadow: 0 4px 14px rgba(217,119,6,.25);
}
.btn-warning:hover:not(:disabled) {
  background: #b45309;
  border-color: #b45309;
  transform: translateY(-1px);
  color: #fff;
}

/* ─────────────────────────────────────────────────────
   DARK
   ───────────────────────────────────────────────────── */
.btn-dark {
  background: var(--text);
  color: var(--text-inverse);
  border-color: var(--text);
  box-shadow: var(--shadow-md);
}
.btn-dark:hover:not(:disabled) {
  opacity: .88;
  transform: translateY(-1px);
  color: var(--text-inverse);
}

/* ─────────────────────────────────────────────────────
   OUTLINE SECONDARY (Bootstrap compat)
   ───────────────────────────────────────────────────── */
.btn-outline-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-strong);
}
.btn-outline-secondary:hover:not(:disabled) {
  background: var(--bg-surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ─────────────────────────────────────────────────────
   SIZES
   ───────────────────────────────────────────────────── */
.btn-xs  { padding: .22rem .6rem  !important; font-size: .72rem; border-radius: var(--radius-sm); gap:.25rem }
.btn-sm  { padding: .35rem .8rem  !important; font-size: .8rem;  border-radius: var(--radius-sm) }
.btn-lg  { padding: .72rem 1.65rem!important; font-size: .95rem; border-radius: var(--radius-md) }
.btn-xl  { padding: .9rem 2.2rem  !important; font-size: 1rem;   border-radius: var(--radius-md); letter-spacing:.02em }

/* ─────────────────────────────────────────────────────
   SHAPES
   ───────────────────────────────────────────────────── */
.btn-pill    { border-radius: var(--radius-full) !important }
.btn-square  { border-radius: var(--radius-sm) !important }
.btn-icon {
  width: 40px; height: 40px;
  padding: 0 !important;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.btn-icon.btn-sm { width: 32px; height: 32px; font-size: .82rem; border-radius: var(--radius-sm) }
.btn-icon.btn-lg { width: 48px; height: 48px; font-size: 1.1rem  }
.btn-circle  { border-radius: 50% !important }

/* ── Loading state ───────────────────────────────────── */
.btn-loading { pointer-events: none; opacity: .8 }
.btn-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: .4rem;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}
.card-hover:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(13,148,136,.2);
  transform: translateY(-4px);
}

/* Glass card */
.card-glass {
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.5);
}
[data-theme="dark"] .card-glass {
  background: rgba(13,27,46,.75);
  border-color: rgba(255,255,255,.08);
}

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  position: relative; overflow: hidden;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
  animation: cardReveal .45s var(--ease) both;
}
.stat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--c1, var(--primary)), var(--c2, var(--primary-dark)));
  opacity: .04; pointer-events: none;
  transition: opacity var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: rgba(13,148,136,.18) }
.stat-card:hover::before { opacity: .08 }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--c1, var(--primary)), var(--c2, var(--primary-dark)));
  color: #fff;
  box-shadow: 0 4px 14px rgba(13,148,136,.30);
  flex-shrink: 0;
  transition: transform var(--t), box-shadow var(--t);
}
.stat-card:hover .stat-icon { transform: scale(1.08) rotate(-3deg) }
.stat-value {
  font-size: 1.9rem; font-weight: 900; color: var(--text); line-height: 1;
  letter-spacing: -1px; animation: countUp .55s var(--ease) both;
}
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; letter-spacing: .03em; text-transform: uppercase }
.stat-trend {
  font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: var(--radius-full);
}
.stat-trend.up   { background: var(--success-ghost); color: var(--success) }
.stat-trend.down { background: var(--danger-ghost);  color: var(--danger) }

/* ═══════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: .2rem .6rem; border-radius: var(--radius-full);
  text-transform: uppercase;
}
.badge-primary { background: var(--primary-ghost2); color: var(--primary) }
.badge-cta     { background: var(--cta-ghost);       color: var(--cta-dark) }
.badge-success { background: var(--success-ghost);   color: var(--success) }
.badge-warning { background: var(--warning-ghost);   color: var(--warning) }
.badge-danger  { background: var(--danger-ghost);    color: var(--danger) }
.badge-info    { background: var(--info-ghost);      color: var(--info) }
.badge-neutral { background: var(--bg-surface-2);    color: var(--text-muted) }
.badge-dot::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor; display: inline-block;
}
/* Bootstrap compat */
.bg-success { background: var(--success) !important }
.bg-danger  { background: var(--danger)  !important }
.bg-warning { background: var(--warning) !important }
.bg-info    { background: var(--info)    !important }
.bg-primary { background: var(--primary) !important }

/* ═══════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════ */
.form-control, .form-select {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: .62rem 1.05rem;
  font-size: .9rem;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  width: 100%;
  font-family: inherit;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ghost);
  background: var(--bg-card);
  color: var(--text);
}
.form-control::placeholder { color: var(--text-light) }
.form-label {
  font-size: .78rem; font-weight: 700;
  color: var(--text-muted);
  margin-bottom: .4rem; display: block;
  text-transform: uppercase; letter-spacing: .05em;
}
.form-text { font-size: .77rem; color: var(--text-light) }
.invalid-feedback { font-size: .77rem; color: var(--danger) }

/* Input icon wrapper */
.input-icon-wrap { position: relative }
.input-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: .95rem; pointer-events: none;
}
[dir="rtl"] .input-icon { right: 1rem }
[dir="ltr"] .input-icon { left: 1rem }
[dir="rtl"] .input-icon-wrap .form-control { padding-right: 2.75rem }
[dir="ltr"] .input-icon-wrap .form-control { padding-left:  2.75rem }

.input-group { position: relative; display: flex }
.input-group .input-group-text {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: .6rem .9rem;
  font-size: .88rem;
}
.input-group > .form-control,
.input-group > .form-select { border-radius: 0 var(--radius) var(--radius) 0; flex: 1 }
[dir="rtl"] .input-group > .form-control { border-radius: var(--radius) 0 0 var(--radius) }
[dir="rtl"] .input-group > .input-group-text:first-child { border-radius: 0 var(--radius) var(--radius) 0 }
[dir="ltr"] .input-group > .input-group-text:first-child { border-radius: var(--radius) 0 0 var(--radius) }

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */
.table-modern {
  width: 100%; border-collapse: separate; border-spacing: 0;
}
.table-modern thead th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: .85rem 1.2rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table-modern thead th:first-child { border-radius: var(--radius-sm) 0 0 0 }
.table-modern thead th:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 }
.table-modern tbody td {
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--text); font-size: .875rem;
  vertical-align: middle;
  transition: background .12s var(--ease);
}
.table-modern tbody tr:hover td { background: var(--primary-ghost) }
.table-modern tbody tr:last-child td { border-bottom: none }

/* ═══════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════ */
.sidebar-modern {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed; top: 0;
  background: var(--sidebar-bg-solid);
  display: flex; flex-direction: column;
  z-index: 1000;
  transition: width var(--t);
  overflow: hidden;
  box-shadow: 2px 0 20px rgba(0,0,0,.15);
}
.sidebar-modern::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 240px;
  background: radial-gradient(ellipse at 50% -10%, rgba(13,148,136,.28) 0%, transparent 70%);
  pointer-events: none;
}
[dir="rtl"] .sidebar-modern { right: 0 }
[dir="ltr"] .sidebar-modern { left:  0 }

.sidebar-brand {
  display: flex; align-items: center; gap: .8rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none; color: #fff;
  flex-shrink: 0; position: relative;
  transition: opacity var(--t);
}
.sidebar-brand:hover { opacity: .9 }
.sidebar-brand-icon {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(13,148,136,.4);
  animation: glowPulse 3.5s ease-in-out infinite;
}
.sidebar-brand-text { font-weight: 800; font-size: .9rem; color: #fff; line-height: 1.2 }
.sidebar-brand-sub  { font-size: .67rem; color: rgba(255,255,255,.38); font-weight: 400 }

.sidebar-section-title {
  font-size: .6rem; font-weight: 900; letter-spacing: .13em;
  text-transform: uppercase; color: rgba(255,255,255,.2);
  padding: 1.2rem 1.4rem .3rem; user-select: none;
}

.sidebar-nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem 1.2rem .65rem 1.4rem;
  margin: 1px .65rem;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: all .16s var(--ease);
  position: relative; cursor: pointer;
  border: none; background: transparent;
  width: calc(100% - 1.3rem); text-align: right;
  overflow: hidden;
}
.sidebar-nav-item:hover { background: rgba(255,255,255,.07); color: var(--sidebar-text-hover) }
.sidebar-nav-item i {
  width: 20px; font-size: 1rem; flex-shrink: 0;
  transition: transform .2s var(--ease-spring), color var(--t);
}
.sidebar-nav-item:hover i { transform: scale(1.15); color: var(--sidebar-active) }
.sidebar-nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
  font-weight: 700;
}
.sidebar-nav-item.active::after {
  content: '';
  position: absolute; top: 22%; bottom: 22%;
  width: 3px; border-radius: 2px;
  background: var(--primary-light);
  box-shadow: 0 0 8px rgba(94,234,212,.5);
}
[dir="rtl"] .sidebar-nav-item.active::after { right: -.65rem }
[dir="ltr"] .sidebar-nav-item.active::after { left:  -.65rem }
.sidebar-nav-item.active i { color: var(--sidebar-active) }

.sidebar-badge {
  margin-right: auto; margin-left: 0;
  background: var(--danger);
  color: #fff; font-size: .6rem; font-weight: 800;
  padding: .08rem .42rem; border-radius: var(--radius-full);
  animation: notifyBadge .4s var(--ease-spring);
}

.main-with-sidebar {
  min-height: 100vh;
  background: var(--bg);
  transition: margin var(--t);
}
[dir="rtl"] .main-with-sidebar { margin-right: var(--sidebar-width) }
[dir="ltr"] .main-with-sidebar { margin-left:  var(--sidebar-width) }

/* ── Top Bar ─────────────────────────────────────────── */
.topbar {
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.6rem;
  position: sticky; top: 0; z-index: 99;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-weight: 800; font-size: 1.05rem; color: var(--text) }
.topbar-actions { display: flex; align-items: center; gap: .4rem }

/* ═══════════════════════════════════════════════════════
   NAVBAR (PUBLIC)
   ═══════════════════════════════════════════════════════ */
.navbar-modern {
  height: var(--navbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background var(--t), box-shadow var(--t);
}
.navbar-modern::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--cta), var(--primary));
  background-size: 200%;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.navbar-modern.scrolled { box-shadow: var(--shadow) }
.navbar-modern.scrolled::after { opacity: 1 }
[data-theme="dark"] .navbar-modern.scrolled { background: rgba(13,27,46,.95) }

/* ═══════════════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════════════ */
.search-wrap { position: relative; max-width: 380px; width: 100% }
.search-input {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-full);
  padding: .52rem 1rem .52rem 3rem;
  font-size: .875rem; width: 100%;
  font-family: inherit;
  transition: all var(--t);
}
[dir="rtl"] .search-input { padding: .52rem 3rem .52rem 1rem }
.search-input:focus {
  outline: none; background: var(--bg-card);
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ghost);
}
.search-input::placeholder { color: var(--text-light) }
.search-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: .9rem; pointer-events: none;
}
[dir="rtl"] .search-icon { right: 1rem }
[dir="ltr"] .search-icon { left: 1rem }

/* ═══════════════════════════════════════════════════════
   PRODUCT CARDS
   ═══════════════════════════════════════════════════════ */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  position: relative; display: flex; flex-direction: column; height: 100%;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13,148,136,.22);
}
.product-card-img-wrap {
  position: relative; overflow: hidden;
  aspect-ratio: 4/3; background: var(--bg-surface);
}
.product-card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease);
}
.product-card:hover .product-card-img-wrap img { transform: scale(1.07) }
.product-card-badge {
  position: absolute; top: .7rem;
  font-size: .68rem; font-weight: 800;
  padding: .18rem .6rem; border-radius: var(--radius-full);
  letter-spacing: .03em;
}
[dir="rtl"] .product-card-badge { right: .7rem }
[dir="ltr"] .product-card-badge { left:  .7rem }
.product-card-discount { background: var(--danger); color: #fff }
.product-card-body {
  padding: 1rem 1.05rem .75rem;
  flex: 1; display: flex; flex-direction: column;
}
.product-card-vendor {
  font-size: .7rem; color: var(--primary); font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem;
}
.product-card-title {
  font-weight: 700; font-size: .9rem; line-height: 1.3; color: var(--text);
  margin-bottom: auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card-price-wrap { margin-top: .7rem }
.product-card-price {
  font-size: 1.1rem; font-weight: 900;
  color: var(--primary);
}
.product-card-price-old {
  font-size: .78rem; color: var(--text-light);
  text-decoration: line-through;
}
[dir="rtl"] .product-card-price-old { margin-right: .35rem }
[dir="ltr"] .product-card-price-old { margin-left:  .35rem }
.product-card-footer { padding: .65rem .9rem; border-top: 1px solid var(--border) }

/* Product "Add to Cart" button — uses CTA style */
.product-card-add-btn {
  width: 100%;
  background: var(--cta);
  color: #1c1917;
  border: none;
  border-radius: var(--radius-sm);
  padding: .52rem 1rem;
  font-weight: 800; font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--t), box-shadow var(--t), transform .15s var(--ease-spring);
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.product-card-add-btn:hover {
  background: var(--cta-dark);
  box-shadow: var(--shadow-cta);
  transform: translateY(-1px);
}
.product-card-add-btn:active { transform: scale(.96) }
.product-card-add-btn.added { background: var(--success); color: #fff }

/* ═══════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════ */
.hero {
  background: #0a1628;
  background-image:
    radial-gradient(ellipse at 30% 50%, rgba(13,148,136,.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(245,158,11,.08) 0%, transparent 45%);
  padding: 5rem 0 4.5rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%230d9488' fill-opacity='0.06'%3E%3Cpath d='M24 24v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM4 4V0H2v4H-2v2h4v4h2V6h4V4H4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; color: #fff }
.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 900; line-height: 1.1; margin-bottom: 1rem;
}
.hero-title span {
  color: var(--cta-light);
}
.hero-subtitle { color: rgba(255,255,255,.65); font-size: 1.05rem; margin-bottom: 2rem; line-height: 1.7 }

/* Hero search */
.hero-search-wrap {
  display: flex; gap: .6rem; max-width: 480px; margin: 0 auto;
  position: relative;
}
.hero-search-input {
  flex: 1;
  background: rgba(255,255,255,.10);
  border: 1.5px solid rgba(255,255,255,.18);
  color: #fff;
  border-radius: var(--radius-full);
  padding: .75rem 1.1rem .75rem 3.2rem;
  font-size: .95rem;
  font-family: inherit;
  transition: all var(--t);
  backdrop-filter: blur(8px);
}
[dir="rtl"] .hero-search-input { padding: .75rem 3.2rem .75rem 1.1rem }
.hero-search-input::placeholder { color: rgba(255,255,255,.4) }
.hero-search-input:focus {
  outline: none;
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.38);
  box-shadow: 0 0 0 3px rgba(13,148,136,.25);
}
.hero-search-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.45); font-size: 1rem; pointer-events: none;
}
[dir="rtl"] .hero-search-icon { right: 1.1rem }
[dir="ltr"] .hero-search-icon { left:  1.1rem }

/* ═══════════════════════════════════════════════════════
   ALERTS / TOAST
   ═══════════════════════════════════════════════════════ */
.alert-modern {
  border-radius: var(--radius-md);
  border: none;
  padding: .85rem 1.2rem;
  display: flex; align-items: center; gap: .75rem;
  font-size: .875rem; font-weight: 600;
  animation: slideDown .3s var(--ease) both;
  box-shadow: var(--shadow-sm);
}
.alert-success-modern {
  background: var(--success-ghost);
  color: var(--success);
  border-right: 3px solid var(--success);
}
.alert-danger-modern {
  background: var(--danger-ghost);
  color: var(--danger);
  border-right: 3px solid var(--danger);
}

/* Notification dot */
.notif-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  position: absolute; top: 5px;
  border: 2px solid var(--bg-card);
  animation: notifyBadge .4s var(--ease-spring);
}
[dir="rtl"] .notif-dot { left: 5px }
[dir="ltr"] .notif-dot { right: 5px }

/* ═══════════════════════════════════════════════════════
   SKELETON
   ═══════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-2) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius);
}

/* ═══════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════ */
.page-content { padding: 1.6rem }

.breadcrumb-modern {
  display: flex; align-items: center; gap: .45rem;
  flex-wrap: wrap; list-style: none; padding: 0; margin: 0;
  font-size: .8rem; color: var(--text-muted);
}
.breadcrumb-modern li { display: flex; align-items: center; gap: .45rem }
.breadcrumb-modern a { color: var(--primary); text-decoration: none; font-weight: 600 }
.breadcrumb-modern a:hover { text-decoration: underline }

/* Cart float button */
.cart-float {
  position: fixed; bottom: 2rem;
  width: 56px; height: 56px;
  background: var(--primary);
  color: #fff; border: none; border-radius: var(--radius-full);
  font-size: 1.25rem; cursor: pointer;
  box-shadow: var(--shadow-primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  transition: transform var(--t), box-shadow var(--t);
  animation: float 3.5s ease-in-out infinite;
}
[dir="rtl"] .cart-float { left: 2rem }
[dir="ltr"] .cart-float { right: 2rem }
.cart-float:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 28px rgba(13,148,136,.5);
  animation: none;
}
.cart-float:active { transform: scale(.95) }
.cart-float-count {
  position: absolute; top: -4px;
  background: var(--cta); color: #1c1917;
  font-size: .62rem; font-weight: 800;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
[dir="rtl"] .cart-float-count { left: -4px }
[dir="ltr"] .cart-float-count { right: -4px }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 1.5rem }
.empty-state-icon {
  width: 80px; height: 80px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--text-light);
  margin: 0 auto 1.25rem;
}

/* Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 800; font-size: .8rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem }

/* ═══════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px }
::-webkit-scrollbar-thumb:hover { background: var(--text-light) }

/* ═══════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════ */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--cta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-primary  { color: var(--primary)  !important }
.text-cta      { color: var(--cta)      !important }
.text-success  { color: var(--success)  !important }
.text-danger   { color: var(--danger)   !important }
.text-warning  { color: var(--warning)  !important }
.text-muted    { color: var(--text-muted) !important }

.bg-gradient-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)) }
.bg-gradient-cta     { background: linear-gradient(135deg, var(--cta), var(--cta-dark)) }

.glass {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
}

.cursor-pointer { cursor: pointer }
.no-select      { user-select: none }
.page-enter     { animation: fadeIn .3s var(--ease) both }
.fw-600  { font-weight: 600 !important }
.fw-700  { font-weight: 700 !important }
.fw-800  { font-weight: 800 !important }
.fw-900  { font-weight: 900 !important }

/* ── Theme Toggle ────────────────────────────────────── */
.theme-toggle {
  width: 46px; height: 26px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-full);
  position: relative; cursor: pointer;
  border: none; padding: 0;
  transition: background var(--t);
  flex-shrink: 0;
}
.theme-toggle::before {
  content: '';
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary);
  position: absolute; top: 3px;
  transition: transform .3s var(--ease), background var(--t);
  box-shadow: 0 2px 5px rgba(0,0,0,.22);
}
[dir="rtl"] .theme-toggle::before { right: 3px }
[dir="ltr"] .theme-toggle::before { left:  3px }
[data-theme="dark"] .theme-toggle::before { transform: translateX(20px) }
[data-theme="dark"] [dir="rtl"] .theme-toggle::before { transform: translateX(-20px) }
[data-theme="dark"] .theme-toggle { background: var(--primary-dark) }

/* ── Dropdown polish ─────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--bg-card) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: .5rem !important;
  animation: scaleIn .18s var(--ease) both;
  transform-origin: top right;
}
.dropdown-item {
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--t-fast) !important;
}
.dropdown-item:hover {
  background: var(--bg-surface) !important;
  color: var(--text) !important;
}
.dropdown-divider { border-color: var(--border) !important }

/* ── Qty stepper ─────────────────────────────────────── */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.qty-stepper button {
  width: 34px; height: 34px;
  background: transparent; border: none;
  color: var(--text-muted); font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
  font-family: inherit;
}
.qty-stepper button:hover { background: var(--bg-surface); color: var(--text) }
.qty-stepper span {
  min-width: 36px; text-align: center;
  font-weight: 800; font-size: .9rem; color: var(--text);
}

/* ── Payment card selector ───────────────────────────── */
.payment-card {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.payment-card:hover { border-color: var(--primary); background: var(--primary-ghost) }
.payment-card.selected {
  border-color: var(--primary);
  background: var(--primary-ghost);
  box-shadow: 0 0 0 1px var(--primary);
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px }
  .sidebar-modern { transform: translateX(100%) }
  [dir="ltr"] .sidebar-modern { transform: translateX(-100%) }
  .sidebar-modern.open { transform: none }
  .main-with-sidebar { margin-right: 0 !important; margin-left: 0 !important }
  .page-content { padding: 1rem }
  .hero { padding: 3rem 0 2.5rem }
  .hero-title { font-size: 1.7rem }
  .hero-search-wrap { max-width: 100% }
}
@media (max-width: 576px) {
  .stat-card { padding: 1rem 1.1rem }
  .stat-value { font-size: 1.5rem }
  .btn-xl { padding: .75rem 1.5rem !important }
}
