/* ==========================================================================
   BAZAAR PRO — Design system (SaaS marketplace) · واجهة عربية RTL
   Primary #2563EB · Secondary #10B981 · Surfaces #F8FAFC · Text #111827
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800&display=swap");

html {
  direction: rtl;
}

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-muted: rgba(37, 99, 235, 0.12);
  --color-secondary: #10b981;
  --color-secondary-hover: #059669;
  --color-bg: #f8fafc;
  --color-bg-elevated: #ffffff;
  --color-surface-glass: rgba(255, 255, 255, 0.72);
  --color-text: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-border-subtle: rgba(17, 24, 39, 0.06);
  --color-whatsapp: #25d366;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --font-sans: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --font-display: "Tajawal", "Segoe UI", Tahoma, system-ui, sans-serif;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.12), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.08), 0 8px 32px -8px rgba(37, 99, 235, 0.25);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --max-w: 1200px;
  --header-h: 4rem;
  --transition: 0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(37, 99, 235, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(16, 185, 129, 0.05), transparent);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--color-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-6);
  }
}

main.main {
  flex: 1;
  padding-top: var(--header-h);
  min-height: 40vh;
}

.section {
  padding: var(--space-10) 0;
}
.section--tight {
  padding: var(--space-8) 0;
}

/* ----- Top navigation ----- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--color-surface-glass);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: var(--space-4);
  flex-wrap: wrap;
}
.nav__toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.24rem;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.brand:hover {
  color: var(--color-text);
  text-decoration: none;
}
.brand__mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 50%, var(--color-secondary) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
  letter-spacing: 0.02em;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav__links a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.nav__links a:hover,
.nav__links a[aria-current="page"] {
  background: var(--color-primary-muted);
  color: var(--color-primary);
}
.nav__cart .badge {
  display: inline-flex;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-1);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  vertical-align: middle;
}
.badge:empty,
.badge--hidden {
  display: none;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:active {
  transform: scale(0.98);
}
.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.5);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 20px -4px rgba(37, 99, 235, 0.45);
}
.btn--secondary {
  background: var(--color-secondary);
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(16, 185, 129, 0.4);
}
.btn--secondary:hover {
  background: var(--color-secondary-hover);
  color: #fff;
  text-decoration: none;
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  text-decoration: none;
}
.btn--outline {
  background: var(--color-bg-elevated);
  color: var(--color-primary);
  border: 1px solid rgba(37, 99, 235, 0.35);
}
.btn--outline:hover {
  background: var(--color-primary-muted);
  text-decoration: none;
}
.btn--wa {
  background: var(--color-whatsapp);
  color: #fff;
}
.btn--wa:hover {
  background: #1ebd57;
  color: #fff;
  text-decoration: none;
}
.btn--lg {
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
}
.btn--block {
  width: 100%;
}

/* ----- Hero (landing) ----- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + var(--space-8)) 0 var(--space-10);
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 45%, #0f172a 100%);
  z-index: 0;
}
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 20%, rgba(37, 99, 235, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(16, 185, 129, 0.2), transparent 50%);
  opacity: 0.9;
}
.hero__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.12;
  color: #fff;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.03em;
}
.hero p {
  line-height: 1.6;
  margin: 0 0 var(--space-6);
}
.hero__tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  align-items: center;
}
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-8);
  opacity: 0.9;
}
.hero__badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* ----- Section titles ----- */
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  text-align: center;
}
@media (min-width: 640px) {
  .section-head--row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    text-align: left;
  }
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.02em;
}
.section-head p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 36rem;
}
.section-head a {
  font-weight: 600;
  white-space: nowrap;
}

/* ----- Product cards (marketplace) ----- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: clamp(1.35rem, 3.2vw, 2rem);
}
#home-grid .product-grid,
#stores-grid .product-grid {
  max-width: 1240px;
  margin-inline: auto;
}
.pcard {
  position: relative;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 8px 24px -4px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
}
.pcard--market {
  min-height: 100%;
}
.pcard:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 32px -8px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
}
.pcard__media {
  position: relative;
  aspect-ratio: 4/3;
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  overflow: hidden;
}
.pcard__img,
.pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.pcard:hover .pcard__media img {
  transform: scale(1.05);
}
.pcard__body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--space-2);
}
.pcard__seller,
.pcard__store {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.pcard__store-name {
  color: var(--color-primary);
  font-weight: 700;
}
.pcard__cat {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.06);
}
.pcard__ph {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e0e7ff, #d1fae5);
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
}
.pcard__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  color: var(--color-text);
}
.pcard__title a {
  color: inherit;
  text-decoration: none;
}
.pcard__title a:hover {
  color: var(--color-primary);
}
.pcard__price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text);
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}
.pcard__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
#home-grid .pcard--store .pcard__actions,
#stores-grid .pcard--store .pcard__actions {
  margin-top: auto;
  padding-top: var(--space-1);
}
.pcard__store--place {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.pcard__tag {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
}

/* ----- Product detail ----- */
.pdetail {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-8) 0 var(--space-10);
}
@media (min-width: 900px) {
  .pdetail {
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
}
.pdetail__gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pdetail__hero-img {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 1;
  max-height: 420px;
}
.pdetail__hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdetail__thumbs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.pdetail__thumb {
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.7;
  transition: border var(--transition), opacity var(--transition);
  padding: 0;
  background: #f1f5f9;
}
.pdetail__thumb:hover,
.pdetail__thumb--active {
  border-color: var(--color-primary);
  opacity: 1;
}
.pdetail__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdetail__info h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.pdetail__meta {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-4);
}
.pdetail__price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  font-variant-numeric: tabular-nums;
}
.pdetail__desc {
  color: var(--color-text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-6);
  white-space: pre-wrap;
}
.pdetail__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 20rem;
}

/* ----- Cart ----- */
.cart-layout {
  display: grid;
  gap: var(--space-6);
}
@media (min-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr 22rem;
    align-items: start;
  }
}
.cart-table-wrap {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.cart-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: #f8fafc;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}
.cart-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.cart-table tr:last-child td {
  border-bottom: none;
}
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}
.qty button {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: #f8fafc;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-text);
  transition: background var(--transition);
}
.qty button:hover {
  background: #e2e8f0;
}
.qty span {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
}
.cart-side {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}
.cart-side h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}
.cart-side__row {
  display: flex;
  justify-content: space-between;
  margin: var(--space-2) 0;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}
.cart-side__total {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-text);
}

/* ----- Dashboard (seller panel) ----- */
.dash-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  color: #fff;
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 80% 50%, rgba(37, 99, 235, 0.35), transparent 70%);
  pointer-events: none;
}
.dash-hero h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 var(--space-2);
  position: relative;
  z-index: 1;
}
.dash-hero p {
  margin: 0;
  opacity: 0.88;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
  max-width: 32rem;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.dash-stat {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.dash-stat:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.2);
}
.dash-stat__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}
.dash-stat__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.dash-stat__hint {
  font-size: 0.8rem;
  color: var(--color-secondary);
  margin: var(--space-2) 0 0;
  font-weight: 500;
}
.dash-table-wrap {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.dash-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: #f8fafc;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--color-border);
}
.dash-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.dash-table tr:hover td {
  background: #fafbfc;
}
.dash-table tr:last-child td {
  border-bottom: none;
}
.dash-table--subscriptions tr.sub-row--warn-yellow td {
  background: rgba(234, 179, 8, 0.14);
  box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.25);
}
.dash-table--subscriptions tr.sub-row--warn-red td {
  background: rgba(220, 38, 38, 0.12);
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.3);
}
.dash-table--subscriptions tr.sub-row--warn-yellow:hover td,
.dash-table--subscriptions tr.sub-row--warn-red:hover td {
  filter: brightness(0.99);
}
.dash-table--subscriptions tr.sub-row--tint-ok td {
  background: rgba(16, 185, 129, 0.08);
  box-shadow: inset 4px 0 0 0 #10b981;
}
.dash-table--subscriptions tr.sub-row--tint-danger td {
  background: rgba(220, 38, 38, 0.07);
  box-shadow: inset 4px 0 0 0 #ef4444;
}
.app-dashboard--admin .sub-dash {
  margin: 0;
}
.app-dashboard--admin .sub-dash__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.app-dashboard--admin .sub-dash__tab {
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s, box-shadow 0.15s;
}
.app-dashboard--admin .sub-dash__tab:hover {
  background: #f8fafc;
}
.app-dashboard--admin .sub-dash__tab[aria-selected="true"] {
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.2);
  background: #fff;
}
.app-dashboard--admin .sub-dash__tab--ok[aria-selected="true"] {
  border-color: #10b981;
  color: #047857;
}
.app-dashboard--admin .sub-dash__tab--warn[aria-selected="true"] {
  border-color: #eab308;
  color: #a16207;
}
.app-dashboard--admin .sub-dash__tab--bad[aria-selected="true"] {
  border-color: #ef4444;
  color: #b91c1c;
}
.app-dashboard--admin .sub-dash__tab--all[aria-selected="true"] {
  border-color: #64748b;
  color: #334155;
}
.app-dashboard--admin .sub-dash__panel--all {
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.25);
}
.app-dashboard--admin .sub-legend {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  margin: 0 0.1rem;
}
.app-dashboard--admin .sub-legend--ok {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}
.app-dashboard--admin .sub-legend--soon {
  background: rgba(234, 179, 8, 0.2);
  color: #a16207;
}
.app-dashboard--admin .sub-legend--no {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
.app-dashboard--admin .sub-legend--lock {
  background: #e2e8f0;
  color: #64748b;
}
.app-dashboard--admin .sub-dash__count {
  font-size: 0.7rem;
  padding: 0.1em 0.4em;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--color-text-muted);
}
.app-dashboard--admin .sub-dash__tab[aria-selected="true"] .sub-dash__count {
  background: rgba(15, 23, 42, 0.08);
  color: var(--color-text);
}
.app-dashboard--admin .sub-dash__panel {
  border-radius: var(--radius-xl);
}
.app-dashboard--admin .sub-dash__panel--ok {
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.2);
}
.app-dashboard--admin .sub-dash__panel--warn {
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.3);
}
.app-dashboard--admin .sub-dash__panel--danger {
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.2);
}
.app-dashboard--admin .sub-bad {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12em 0.4em;
  border-radius: 0.25rem;
}
.app-dashboard--admin .sub-bad--lock {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.app-dashboard--admin .sub-bad--soon {
  background: rgba(250, 204, 21, 0.25);
  color: #854d0e;
  border: 1px solid #eab308;
  font-size: 0.6rem;
  margin-left: 0.2rem;
  margin-right: 0.2rem;
}
.dash-table--subscriptions tr.sub-row--tint-locked td {
  background: rgba(148, 163, 184, 0.1);
  box-shadow: inset 4px 0 0 0 #94a3b8;
}
.dash-table--subscriptions tr.sub-row--tint-inactive td {
  background: rgba(107, 114, 128, 0.12);
  box-shadow: inset 4px 0 0 0 #9ca3af;
  color: var(--color-text);
}
.app-dashboard--admin .sub-legend--inactive {
  background: #e5e7eb;
  color: #4b5563;
  font-weight: 600;
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  margin: 0 0.1rem;
}
.app-dashboard--admin .sub-dash__tab--d7[aria-selected="true"] {
  border-color: #ca8a04;
  color: #854d0e;
  background: #fffbeb;
}
.app-dashboard--admin .sub-dash__tab--d30[aria-selected="true"] {
  border-color: #16a34a;
  color: #166534;
  background: #f0fdf4;
}
.app-dashboard--admin .sub-dash__tab--d1y[aria-selected="true"] {
  border-color: #2563eb;
  color: #1e40af;
  background: #eff6ff;
}
.app-dashboard--admin .sub-dash__tab--na[aria-selected="true"] {
  border-color: #6b7280;
  color: #374151;
  background: #f9fafb;
}
.app-dashboard--admin .sub-dash__panel--d7 {
  box-shadow: inset 0 0 0 1px rgba(234, 179, 8, 0.4);
}
.app-dashboard--admin .sub-dash__panel--d30 {
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.35);
}
.app-dashboard--admin .sub-dash__panel--d1y {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}
.app-dashboard--admin .sub-dash__panel--na {
  box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.4);
}
.app-dashboard--admin .sub-server-clock {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  background: #f8fafc;
  border: 1px solid var(--color-border);
}
.app-dashboard--admin .sub-server-time {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cairo", system-ui, sans-serif;
}
.app-dashboard--admin .sub-countdown-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.app-dashboard--admin .sub-countdown {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cairo", system-ui, sans-serif;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #10b981;
  color: #065f46;
  min-width: 9.5rem;
  line-height: 1.35;
  text-align: center;
}
.app-dashboard--admin .sub-countdown.sub-countdown--ended {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}
.app-dashboard--admin .sub-countdown__hint {
  font-size: 0.75rem;
  opacity: 0.85;
}
.app-dashboard--admin .sub-sec__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  align-items: start;
}
@media (max-width: 72rem) {
  .app-dashboard--admin .sub-sec__grid {
    grid-template-columns: 1fr;
  }
}
.app-dashboard--admin .sub-sec {
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 0.5rem);
  background: #fff;
  padding: 0.75rem;
  min-width: 0;
}
.app-dashboard--admin .sub-sec__head {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  color: #0f172a;
}
.app-dashboard--admin .sub-sec__count {
  display: inline-block;
  margin-inline-start: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
}
.app-dashboard--admin .sub-sec__table .dash-table--sub-sec th,
.app-dashboard--admin .sub-sec__table .dash-table--sub-sec td {
  font-size: 0.75rem;
  padding: 0.35rem 0.4rem;
}
.app-dashboard--admin .sub-plan-pill {
  font-size: 0.7rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}
.app-dashboard--admin .sub-st-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.app-dashboard--admin .sub-st-badge--active {
  background: #d1fae5;
  color: #065f46;
}
.app-dashboard--admin .sub-st-badge--expired {
  background: #fee2e2;
  color: #b91c1c;
}
.app-dashboard--admin .sub-st-badge--inactive {
  background: #e5e7eb;
  color: #374151;
}
.app-dashboard--admin .sub-st-badge--paused {
  background: #fef9c3;
  color: #854d0e;
}
.app-dashboard--admin .sub-st-badge--other {
  background: #fef3c7;
  color: #92400e;
}
.app-dashboard--admin .sub-lc-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  margin-bottom: 0.2rem;
}
.app-dashboard--admin .sub-lc--active {
  background: #d1fae5;
  color: #065f46;
}
.app-dashboard--admin .sub-lc--expired {
  background: #fee2e2;
  color: #b91c1c;
}
.app-dashboard--admin .sub-lc--not_activated {
  background: #e5e7eb;
  color: #4b5563;
}
.app-dashboard--admin .sub-lc--paused {
  background: #fef9c3;
  color: #854d0e;
}
.app-dashboard--admin .sub-count--static {
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, system-ui, sans-serif;
  padding: 0.25rem 0.4rem;
  border-radius: 0.25rem;
  display: inline-block;
}
.app-dashboard--admin .sub-count--static.sub-count--expired {
  background: #fee2e2;
  color: #b91c1c;
}
.app-dashboard--admin .sub-count--static.sub-count--na {
  background: #f3f4f6;
  color: #6b7280;
}

/* ----- States: loading / error / empty ----- */
.state-wrap {
  min-height: 12rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}
.spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.state-error {
  max-width: 28rem;
  margin: 0 auto;
  padding: var(--space-6);
  text-align: center;
  background: var(--color-error-bg);
  border: 1px solid #fecaca;
  border-radius: var(--radius-xl);
  color: #991b1b;
  font-size: 0.9rem;
  line-height: 1.6;
}
.state-error strong {
  display: block;
  font-size: 1rem;
  margin-bottom: var(--space-2);
}
.state-empty {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  max-width: 24rem;
  margin: 0 auto;
  color: var(--color-text-muted);
}
.state-empty__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--color-primary-muted);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

/* ----- Footer ----- */
.site-footer {
  margin-top: auto;
  padding: var(--space-8) 0;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.site-footer code {
  font-size: 0.75em;
  padding: 0.1rem 0.35rem;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
}
.site-footer__copyright {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}
.site-footer .container > .site-footer__copyright:only-child {
  margin: 0;
}
.site-footer--dashboard .site-footer__copyright {
  margin-top: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Page title block */
.page-hero {
  padding: var(--space-6) 0 var(--space-2);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.page-hero p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 40rem;
}

.text-muted {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ----- Auth / registration ----- */
.nav__auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 22rem;
  justify-content: flex-end;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.nav__user {
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--color-text);
}
.nav__inline {
  font-weight: 500;
}
.nav__dot {
  opacity: 0.4;
  user-select: none;
}

/* ----- Unified logout control (all pages) ----- */
.bazaar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border-radius: var(--radius-md);
  border: 1px solid rgba(185, 28, 28, 0.4);
  background: #fff;
  color: #b91c1c;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
  white-space: nowrap;
}
.bazaar-logout__ico {
  flex-shrink: 0;
  opacity: 0.95;
}
.bazaar-logout--nav {
  padding: 0.38rem 0.7rem;
  font-size: 0.8rem;
}
.bazaar-logout--sidebar {
  width: 100%;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
}
.bazaar-logout:hover {
  background: #fef2f2;
  border-color: #b91c1c;
  color: #991b1b;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.12);
}
.bazaar-logout:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.auth-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}
.auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8);
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
}
.auth-card p.lead {
  margin: 0 0 var(--space-6);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}
.form-field {
  margin-bottom: var(--space-4);
}
.form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font: inherit;
  background: #fff;
}
.form-field small {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}
.form-err {
  color: var(--color-error);
  font-size: 0.85rem;
  margin-bottom: var(--space-3);
  min-height: 1.2rem;
}

.order-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.order-card__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: baseline;
  font-size: 0.9rem;
  margin-bottom: var(--space-2);
}
.order-card__head code {
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}
.order-card__items {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}
.pill {
  display: inline-block;
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.admin-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.seller-store-wrap {
  margin-bottom: var(--space-4);
  width: 100%;
}
.seller-store-wrap__h {
  text-align: left;
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  font-weight: 800;
}
.seller-store-wrap__d {
  margin: 0 0 1.25rem;
  max-width: 42rem;
  line-height: 1.5;
}
.seller-bento {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .seller-bento {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1100px) {
  .seller-bento {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1400px) {
  .seller-bento--wide {
    grid-template-columns: repeat(5, 1fr);
  }
}
.seller-bento__card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.seller-bento__card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 var(--space-2);
  color: var(--color-text);
}
.seller-bento__card p {
  margin: 0 0 var(--space-4);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.seller-bento__card .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.35rem;
}

.seller-store-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 8%, #fff) 0%, var(--color-bg-elevated) 55%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow-sm);
}
.seller-store-hero__kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin: 0 0 0.35rem;
}
.seller-store-hero__title {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  line-height: 1.2;
  color: var(--color-text);
}
.seller-store-hero__desc {
  margin: 0 0 1.15rem;
  max-width: 40rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
.seller-store-hero__code {
  font-size: 0.8rem;
  padding: 0.1rem 0.35rem;
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  border-radius: var(--radius-sm);
}
.seller-store-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.seller-store-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
}
.seller-store-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill, 999px);
  background: #fff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.seller-store-pill:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, #fff);
  border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-border));
  color: var(--color-text);
}

/* Seller hub — in-dashboard nav (SaaS-style) */
.seller-hub-toolbar {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-sm);
}
.seller-hub-toolbar__a {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease;
}
.seller-hub-toolbar__a:hover {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-text);
}
.seller-hub-toolbar__a--strong {
  color: var(--color-primary);
  margin-left: auto;
  font-weight: 700;
}
@media (max-width: 600px) {
  .seller-hub-toolbar__a--strong {
    margin-left: 0;
  }
}

/* Full visual builder (iframe) embedded in seller hub */
.seller-vb {
  margin: 1.5rem 0 1.25rem;
  background: #0f172a;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  max-width: 100%;
}
.seller-vb__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.seller-vb__title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.seller-vb__sub {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #94a3b8;
  max-width: 36rem;
}
.seller-vb__head .btn--outline {
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.5);
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}
.seller-vb__head .btn--outline:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: #94a3b8;
  color: #f8fafc;
}
.seller-vb__frame-outer {
  line-height: 0;
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}
.seller-vb__frame {
  width: 100%;
  min-height: min(68vh, 640px);
  height: 640px;
  border: 0;
  display: block;
  background: #0f172a;
}
@media (max-width: 700px) {
  .seller-vb__frame {
    height: 520px;
    min-height: 50vh;
  }
}

/* ==========================================================================
   App dashboards (Shopify-style) — main left, nav rail right (RTL: sidebar first in DOM)
   ========================================================================== */
.app-dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.site-header--dashboard {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg-elevated);
  box-shadow: var(--shadow-sm);
}
.site-header--dashboard-min .nav--dashboard-min {
  justify-content: flex-start;
  min-height: 3.25rem;
  gap: 0.75rem;
}
.dashboard-sidebar-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.24rem;
  cursor: pointer;
}
.dashboard-sidebar-toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}
.site-footer--dashboard {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) 0;
  background: var(--color-bg-elevated);
  font-size: 0.8rem;
}
.site-footer--dashboard p {
  margin: 0;
  color: var(--color-text-muted);
}
.dashboard-layout {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 0;
  max-width: 100%;
}
.dashboard-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-4) 0 var(--space-8);
  background: var(--color-bg);
}
.dashboard-main__inner {
  max-width: 100%;
  padding-inline: var(--space-4);
}
.dashboard-hero,
.dashboard-section {
  margin-bottom: var(--space-2);
}
.dashboard-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
/* Sidebar: first flex item in RTL = physical RIGHT; fixed rail on wide viewports */
.dashboard-sidebar {
  width: 16.25rem;
  max-width: 100%;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: calc(100vh - var(--header-h));
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  z-index: 30;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #f1f5f9;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4);
  gap: var(--space-3);
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.18);
}
@media (min-width: 901px) {
  /* Block layout: fixed sidebar does not reserve flex space (avoids double gutter with padding). */
  .app-dashboard .dashboard-layout {
    display: block;
  }
  .app-dashboard .dashboard-sidebar {
    position: fixed;
    top: var(--header-h);
    inset-inline-start: 0;
    bottom: 0;
    min-height: calc(100vh - var(--header-h));
    max-height: calc(100vh - var(--header-h));
    z-index: 40;
  }
  .app-dashboard .dashboard-main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-inline-start: 16.25rem;
  }
}
.dashboard-sidebar__head {
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-1);
}
.dashboard-sidebar__kicker {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.15rem;
}
.dashboard-sidebar__title {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.dashboard-sidebar__foot {
  color: #94a3b8;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.dashboard-sidebar__stack .dashboard-sidebar__foot {
  margin-top: 0;
}
.dashboard-sidebar a.dashboard-sidebar__out {
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}
.dashboard-sidebar a.dashboard-sidebar__out:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(37, 99, 235, 0.5);
}
.dashboard-sidebar__stack {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.dashboard-sidebar__logout:empty {
  display: none;
}
.dashboard-sidebar .bazaar-logout {
  background: rgba(15, 23, 42, 0.45);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: none;
}
.dashboard-sidebar .bazaar-logout:hover {
  background: rgba(127, 29, 29, 0.55);
  color: #fff;
  border-color: rgba(252, 165, 165, 0.6);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.dashboard-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem;
  margin: 0 0 var(--space-3);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}
.dashboard-sidebar__user[hidden] {
  display: none !important;
}
.dashboard-sidebar__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.dashboard-sidebar__user-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.dashboard-sidebar__user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-sidebar__user-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dashboard-nav__group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
}
.dashboard-nav__group:last-of-type {
  margin-bottom: 0;
}
.dashboard-nav__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin: 0.35rem 0 0.15rem 0.35rem;
}
.dashboard-nav__badge {
  margin-inline-start: auto;
  min-width: 1.1rem;
  text-align: center;
  line-height: 1.1;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}
.dashboard-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.dashboard-nav__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.dashboard-nav__link:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 1px;
}
.dashboard-nav__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  color: #94a3b8;
  flex-shrink: 0;
}
.dashboard-nav__link:hover .dashboard-nav__ico {
  color: #93c5fd;
}
.dashboard-nav__link[aria-current="true"] {
  background: rgba(37, 99, 235, 0.35);
  color: #fff;
}
.dashboard-nav__link[aria-current="true"] .dashboard-nav__ico {
  color: #93c5fd;
}
.app-dashboard--seller .dashboard-nav__link[href="store-settings.html"] {
  margin-top: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
/* زر فتح/معاينة الموقع العام */
.app-dashboard--seller .dashboard-sidebar a.seller-btn-open-store {
  margin-top: 0;
  font-size: 0.8rem;
  font-weight: 600;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.22) 0%, rgba(30, 64, 175, 0.32) 100%);
  color: #f0f9ff;
  border: 1px solid rgba(96, 165, 250, 0.5);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}
.app-dashboard--seller .dashboard-sidebar a.seller-btn-open-store:hover {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.36) 0%, rgba(30, 64, 175, 0.45) 100%);
  color: #fff;
  border-color: rgba(147, 197, 253, 0.65);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
  text-decoration: none;
}
.app-dashboard--seller .dashboard-sidebar a.seller-btn-open-store:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.seller-storefront-identity a.seller-btn-open-store {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fff;
  color: var(--color-primary);
  border: 1px solid rgba(37, 99, 235, 0.42);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.seller-storefront-identity a.seller-btn-open-store:hover {
  background: var(--color-primary-muted);
  color: #1e40af;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.18);
  text-decoration: none;
}
.seller-storefront-identity a.seller-btn-open-store:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.app-dashboard--admin .dashboard-nav__link[href="#adm-section-settings"] {
  margin-top: 0.35rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
@media (max-width: 900px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .dashboard-sidebar {
    position: relative;
    min-height: auto;
    max-height: none;
    width: 100%;
    border-inline-start: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: var(--space-3);
    top: 0;
  }
  .dashboard-sidebar__head {
    width: 100%;
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0.25rem;
  }
  .dashboard-nav {
    flex-direction: row;
    flex: 1;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .dashboard-nav__link {
    font-size: 0.8rem;
    padding: 0.45rem 0.5rem;
  }
  .dashboard-sidebar a.dashboard-sidebar__out {
    width: auto;
    margin-top: 0;
  }
  .dashboard-sidebar__stack {
    margin-top: 0.75rem;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem 0.75rem;
    border-top: 0;
    padding-top: 0.5rem;
  }
  .dashboard-sidebar__stack .dashboard-sidebar__out {
    flex: 1 1 auto;
    min-width: 7rem;
  }
  .dashboard-sidebar .bazaar-logout--sidebar {
    width: auto;
  }
  .dashboard-sidebar__foot {
    display: none;
  }
  .app-dashboard--seller .dashboard-nav__link[href="store-settings.html"] {
    border-top: 0;
    margin-top: 0.25rem;
    padding-top: 0.45rem;
  }
  .app-dashboard--admin .dashboard-nav__link[href="#adm-section-settings"] {
    border-top: 0;
    margin-top: 0.25rem;
    padding-top: 0.45rem;
  }
  .app-dashboard--admin .dashboard-nav__group {
    display: contents;
  }
  .app-dashboard--admin .dashboard-nav__label {
    display: none;
  }
}
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-3);
  }
  .site-header {
    height: auto;
    min-height: var(--header-h);
  }
  .nav {
    flex-wrap: nowrap;
    min-height: var(--header-h);
  }
  .brand {
    font-size: 1rem;
    min-width: 0;
    max-width: calc(100% - 3.2rem);
  }
  .brand__mark {
    width: 2rem;
    height: 2rem;
    font-size: 0.62rem;
  }
  .nav__toggle {
    display: inline-flex;
    margin-inline-start: auto;
  }
  .nav__links[data-collapsible="1"] {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: var(--space-3);
    right: var(--space-3);
    z-index: 1050;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    max-height: min(70vh, 26rem);
    overflow-y: auto;
  }
  .nav.is-open .nav__links[data-collapsible="1"] {
    display: flex;
  }
  .nav__links a {
    width: 100%;
    justify-content: flex-start;
    padding: 0.6rem 0.7rem;
    font-size: 0.9rem;
  }
  .nav__auth {
    max-width: 100%;
    justify-content: flex-start;
  }
  .page-hero h1 {
    font-size: 1.45rem;
  }
  .dash-hero {
    padding: var(--space-6);
  }
  .dash-hero h1 {
    font-size: 1.3rem;
  }
  .auth-page {
    padding: var(--space-6) var(--space-3);
  }
  .auth-card {
    padding: var(--space-6);
  }
  .pdetail__price {
    font-size: 1.6rem;
  }
  .dashboard-sidebar-toggle {
    display: inline-flex;
    margin-inline-start: auto;
  }
  .dashboard-layout {
    position: relative;
  }
  .dashboard-layout .dashboard-sidebar {
    display: none;
  }
  .dashboard-layout.is-sidebar-open .dashboard-sidebar {
    display: flex;
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    z-index: 60;
    overflow-y: auto;
    border-bottom: 0;
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
  .dashboard-main__inner {
    padding-inline: var(--space-3);
  }
  .dashboard-card {
    padding: var(--space-3);
  }
}
@media (max-width: 480px) {
  body {
    font-size: 0.9rem;
  }
  .hero {
    padding-top: calc(var(--header-h) + var(--space-6));
  }
  .hero__actions .btn,
  .seller-store-hero__actions .btn,
  .form-actions .btn {
    width: 100%;
  }
  .auth-card {
    padding: var(--space-4);
  }
  .dash-stat {
    padding: var(--space-4);
  }
  .dash-stat__value {
    font-size: 1.4rem;
  }
  .cart-table,
  .dash-table {
    min-width: 36rem;
  }
}
@media (min-width: 1024px) {
  .nav__links {
    gap: var(--space-2);
  }
}
@media (min-width: 1100px) {
  .dashboard-main__inner {
    padding-inline: var(--space-6);
  }
}
