/* ═══════════════════════════════════════════════════════════════
   SAFO — Unified Commerce Design System
   Single source of truth for density, color, radius, shadow,
   typography, surface treatment, product feed hierarchy, and
   admin/seller/public UI consistency.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ds-font-sans: 'Tajawal', 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ds-font-display: 'Tajawal', 'Cairo', system-ui, sans-serif;

  --ds-space-0: 0;
  --ds-space-1: 4px;
  --ds-space-2: 8px;
  --ds-space-3: 12px;
  --ds-space-4: 16px;
  --ds-space-5: 20px;
  --ds-space-6: 24px;
  --ds-space-7: 32px;
  --ds-space-8: 40px;

  --ds-text-xs: 11px;
  --ds-text-sm: 12px;
  --ds-text-md: 14px;
  --ds-text-lg: 16px;
  --ds-text-xl: 18px;
  --ds-text-2xl: 22px;

  --ds-radius-xs: 8px;
  --ds-radius-sm: 12px;
  --ds-radius-md: 16px;
  --ds-radius-lg: 20px;
  --ds-radius-xl: 24px;
  --ds-radius-pill: 999px;

  --ds-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --ds-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --ds-shadow-md: 0 14px 38px rgba(15, 23, 42, 0.09);
  --ds-shadow-lg: 0 22px 56px rgba(15, 23, 42, 0.14);

  --ds-color-bg: #f4f5f7;
  --ds-color-surface: #ffffff;
  --ds-color-surface-2: #f8fafc;
  --ds-color-surface-3: #eef2f7;
  --ds-color-text: #111827;
  --ds-color-text-soft: #475569;
  --ds-color-text-muted: #64748b;
  --ds-color-line: #e2e8f0;
  --ds-color-line-strong: #cbd5e1;
  --ds-color-accent: #ff6a00;
  --ds-color-accent-strong: #ea580c;
  --ds-color-accent-soft: #fff1e8;
  --ds-color-brand-dark: #111827;
  --ds-color-brand-dark-soft: #1f2937;
  --ds-color-sale: #d92d20;
  --ds-color-sale-soft: #fff1f0;
  --ds-color-success: #149f5c;
  --ds-color-success-soft: #ecfdf3;
  --ds-color-warning: #d97706;
  --ds-color-warning-soft: #fff7ed;
  --ds-color-info: #2563eb;
  --ds-color-info-soft: #eff6ff;

  --primary: var(--ds-color-accent);
  --primary-dark: var(--ds-color-accent-strong);
  --primary-soft: var(--ds-color-accent-soft);
  --bg: var(--ds-color-bg);
  --white: var(--ds-color-surface);
  --text: var(--ds-color-text);
  --text-secondary: var(--ds-color-text-soft);
  --muted: var(--ds-color-text-muted);
  --border: var(--ds-color-line);
  --danger: var(--ds-color-sale);
  --success: var(--ds-color-success);
  --warning: var(--ds-color-warning);
  --bottom-nav-height: 64px;
}

html {
  background: var(--ds-color-bg);
}

body {
  font-family: var(--ds-font-sans) !important;
  background: var(--ds-color-bg) !important;
  color: var(--ds-color-text) !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
}

body,
button,
input,
select,
textarea {
  font-family: var(--ds-font-sans) !important;
}

#app-content {
  width: 100%;
  min-height: 100vh;
}

a {
  color: inherit;
}

img {
  image-rendering: auto;
}

/* ── Global page density ───────────────────────────────────────────── */
.promo-banner,
.section-block,
.premium-section,
.page-card,
.profile-card,
.settings-card,
.admin-stat-card,
.admin-table-wrap,
.seller-card,
.tier-card,
.dashboard-card,
.detail-section,
.payment-card,
.order-card,
.message-card,
.chat-card,
.category-section,
.mx-search-shell,
.mx-feed-shell,
.mx-hero-card,
.mx-inline-rail,
.mx-kpi-card,
.modal-content,
.modal-card,
.confirm-card {
  background: var(--ds-color-surface) !important;
  border: 1px solid var(--ds-color-line) !important;
  border-radius: var(--ds-radius-lg) !important;
  box-shadow: var(--ds-shadow-sm) !important;
}

.section-block,
.premium-section {
  padding: var(--ds-space-4) !important;
  margin: 0 0 var(--ds-space-4) !important;
}

.section-header-inline,
.page-header,
.admin-toolbar,
.dashboard-header,
.seller-toolbar,
.mx-feed-shell__header,
.mx-inline-rail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  margin-bottom: var(--ds-space-3) !important;
}

.section-header-inline h2,
.section-header-inline h3,
.page-header h1,
.page-header h2,
.dashboard-header h2,
.admin-topbar h1,
.mx-feed-shell__header h2,
.mx-inline-rail__header h3 {
  margin: 0 !important;
  color: var(--ds-color-text) !important;
  font-size: var(--ds-text-xl) !important;
  line-height: 1.3 !important;
  font-weight: 800 !important;
}

.section-header-inline p,
.page-header p,
.dashboard-header p,
.mx-feed-shell__header p,
.mx-inline-rail__header p,
.smart-home-cluster__caption,
.empty-text,
.help-text {
  color: var(--ds-color-text-muted) !important;
  font-size: var(--ds-text-sm) !important;
  line-height: 1.5 !important;
}

.view-all,
.text-link {
  color: var(--ds-color-accent-strong) !important;
  font-weight: 700 !important;
}

/* ── Unified buttons ───────────────────────────────────────────────── */
.btn,
button.btn,
.product-card-cta,
.action-btn,
.mx-sheet-btn,
.mx-cart-cta,
.mx-filter-btn,
.hero-slider-arrow,
.safo-home-chip,
.top-tab,
.admin-nav-item,
.bottom-nav-item,
.category-chip {
  border-radius: var(--ds-radius-sm) !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease !important;
}

.btn,
button.btn,
.product-card-cta,
.action-btn,
.mx-sheet-btn,
.mx-cart-cta,
.mx-filter-btn {
  min-height: 40px;
  padding: 0 var(--ds-space-4) !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  font-size: var(--ds-text-md) !important;
  font-weight: 800 !important;
}

.btn-primary,
.product-card-cta--primary,
.action-btn-primary,
.mx-sheet-btn--primary,
.mx-cart-cta,
.mx-hero-cta {
  background: linear-gradient(180deg, #ff7f2f 0%, #ff6a00 100%) !important;
  color: #fff !important;
  border-color: #ff6a00 !important;
}

.btn-secondary,
.btn-outline,
.product-card-cta--ghost,
.product-card-cta--soft,
.action-btn-secondary,
.mx-sheet-btn--ghost,
.mx-filter-btn,
.top-tab,
.safo-home-chip,
.mx-chip,
.category-chip {
  background: var(--ds-color-surface-2) !important;
  color: var(--ds-color-text) !important;
  border-color: var(--ds-color-line) !important;
}

.btn-success { background: var(--ds-color-success) !important; color: #fff !important; }
.btn-warning { background: #f59e0b !important; color: #fff !important; }
.btn-danger, .btn-error { background: var(--ds-color-sale) !important; color: #fff !important; }

.btn:hover,
button.btn:hover,
.product-card-cta:hover,
.action-btn:hover,
.mx-sheet-btn:hover,
.mx-cart-cta:hover,
.mx-filter-btn:hover,
.mx-hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--ds-shadow-sm) !important;
}

.top-tab.active,
.safo-home-chip--accent,
.mx-chip.is-active,
.category-chip.active,
.admin-nav-item.active,
.bottom-nav-item.active {
  background: var(--ds-color-accent-soft) !important;
  color: var(--ds-color-accent-strong) !important;
  border-color: rgba(255, 106, 0, 0.2) !important;
}

/* ── Unified form controls ─────────────────────────────────────────── */
.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  min-height: 42px !important;
  border-radius: var(--ds-radius-sm) !important;
  border: 1px solid var(--ds-color-line) !important;
  background: var(--ds-color-surface) !important;
  color: var(--ds-color-text) !important;
  box-shadow: none !important;
  padding: 0 var(--ds-space-3) !important;
}

textarea,
.form-textarea {
  min-height: 110px !important;
  padding-top: var(--ds-space-3) !important;
  padding-bottom: var(--ds-space-3) !important;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 106, 0, 0.5) !important;
  box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.12) !important;
  outline: none !important;
  transform: none !important;
}

.form-label,
label {
  display: block;
  margin-bottom: var(--ds-space-2) !important;
  color: var(--ds-color-text-soft) !important;
  font-size: var(--ds-text-sm) !important;
  font-weight: 700 !important;
}

.form-group {
  margin-bottom: var(--ds-space-3) !important;
}

/* ── Unified chips, badges, pills ─────────────────────────────────── */
.badge,
.product-card-pill,
.product-card-discount-badge,
.product-badge,
.mx-badge,
.smart-home-stat,
.admin-user-badge,
.admin-nav-badge,
.safo-notif-dot,
.mx-header-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  min-height: 24px;
  padding: 0 10px !important;
  border-radius: var(--ds-radius-pill) !important;
  font-size: var(--ds-text-xs) !important;
  font-weight: 800 !important;
  border: 1px solid transparent !important;
}

.badge,
.product-card-pill,
.product-badge,
.smart-home-stat,
.admin-user-badge {
  background: var(--ds-color-surface-3) !important;
  color: var(--ds-color-text-soft) !important;
}

.badge-success,
.product-card-pill--success,
.mx-badge--success {
  background: var(--ds-color-success-soft) !important;
  color: var(--ds-color-success) !important;
}

.badge-warning,
.product-card-pill--accent,
.product-card-discount-badge,
.badge-discount,
.mx-badge--sale,
.safo-notif-dot,
.mx-header-badge {
  background: var(--ds-color-sale-soft) !important;
  color: var(--ds-color-sale) !important;
  border-color: rgba(217, 45, 32, 0.12) !important;
}

.badge-primary,
.badge-info {
  background: var(--ds-color-info-soft) !important;
  color: var(--ds-color-info) !important;
}

.badge-error,
.badge-danger {
  background: var(--ds-color-sale-soft) !important;
  color: var(--ds-color-sale) !important;
}

/* ── Bottom navigation ─────────────────────────────────────────────── */
.bottom-nav {
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06) !important;
}

.bottom-nav-item {
  gap: 4px !important;
  min-width: 64px;
  color: var(--ds-color-text-muted) !important;
  font-size: var(--ds-text-xs) !important;
  font-weight: 700 !important;
}

.bottom-nav-item.active {
  color: var(--ds-color-accent-strong) !important;
}

.bottom-nav-item.active::after {
  display: none !important;
}

/* ── Public product feed and cards ────────────────────────────────── */
.products-grid,
.premium-products-grid,
.subcat-products-grid,
.subcat-trending-grid,
.seller-products-grid,
.mx-feed-grid,
.smart-home-grid {
  gap: var(--ds-space-3) !important;
}

.product-card,
.product-card--pro,
.product-card-seller,
.mx-product-card {
  border-radius: var(--ds-radius-md) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: var(--ds-shadow-xs) !important;
  background: var(--ds-color-surface) !important;
}

.product-card:hover,
.product-card--pro:hover,
.product-card-seller:hover,
.mx-product-card:hover {
  border-color: rgba(255, 106, 0, 0.18) !important;
  box-shadow: var(--ds-shadow-md) !important;
}

.product-card-media,
.product-card-img-wrap,
.mx-product-thumb {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
}

.product-card-body,
.product-card-body--pro,
.mx-product-body,
.mx-product-body--dense {
  padding: var(--ds-space-3) !important;
  gap: var(--ds-space-2) !important;
}

.product-card-title,
.product-card-title--pro,
.mx-product-title {
  color: var(--ds-color-text) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-weight: 700 !important;
}

.product-card-price,
.mx-product-price {
  color: var(--ds-color-sale) !important;
  font-size: 16px !important;
  font-weight: 900 !important;
}

.old-price,
.mx-product-old-price {
  color: var(--ds-color-text-muted) !important;
}

.product-card-meta-grid,
.mx-product-meta-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--ds-space-2) !important;
}

.product-card-meta-box,
.mx-mini-meta {
  min-height: 44px;
  padding: 8px 10px !important;
  border-radius: var(--ds-radius-sm) !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  background: var(--ds-color-surface-2) !important;
}

.product-card-meta-box strong,
.product-card-meta-box span,
.mx-mini-meta strong,
.mx-mini-meta span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-meta-box strong,
.mx-mini-meta strong {
  color: var(--ds-color-text-muted) !important;
  font-size: var(--ds-text-xs) !important;
  font-weight: 800 !important;
}

.product-card-meta-box span,
.mx-mini-meta span,
.product-card-supplier-main span {
  color: var(--ds-color-text) !important;
  font-size: var(--ds-text-sm) !important;
  font-weight: 700 !important;
}

.product-card-service-row,
.mx-product-flags,
.product-card-action-row,
.mx-product-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--ds-space-2) !important;
}

.product-card-action-row .product-card-cta,
.mx-product-actions .action-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
}

.product-card-supplier-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--ds-space-2) !important;
}

.product-card-supplier-main strong,
.product-card-seller,
.mx-product-seller {
  color: var(--ds-color-text-soft) !important;
  font-size: var(--ds-text-sm) !important;
}

/* ── Mobile-next dense commerce home ──────────────────────────────── */
#app-content .mx-home-shell {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--ds-space-3) calc(var(--bottom-nav-height) + var(--ds-space-5));
  background: linear-gradient(180deg, #f6f7f9 0%, #f4f5f7 100%);
}

.mx-home-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3);
  border-radius: var(--ds-radius-lg);
  background: rgba(17, 24, 39, 0.94) !important;
  color: #fff !important;
  box-shadow: var(--ds-shadow-md) !important;
}

.mx-home-brand {
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  min-width: 0;
}

.mx-home-brand__logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  padding: 5px;
}

.mx-home-brand strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.mx-home-brand span {
  display: block;
  font-size: var(--ds-text-xs);
  color: rgba(255,255,255,0.72);
}

.mx-home-header__actions {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
}

.mx-header-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.mx-header-btn--mini {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255,255,255,0.92);
  color: var(--ds-color-text);
}

.mx-header-btn--mini.active {
  color: var(--ds-color-sale);
  background: var(--ds-color-sale-soft);
  border-color: rgba(217, 45, 32, 0.16);
}

.mx-search-shell {
  padding: var(--ds-space-3) !important;
}

.mx-search-box {
  width: 100%;
  min-height: 46px;
  padding: 0 var(--ds-space-3);
  display: flex;
  align-items: center;
  gap: var(--ds-space-3);
  border-radius: 14px;
  border: 1px solid var(--ds-color-line);
  background: var(--ds-color-surface-2);
  color: var(--ds-color-text-soft);
}

.mx-search-copy {
  flex: 1;
  min-width: 0;
  text-align: start;
  font-size: var(--ds-text-md);
  font-weight: 700;
}

.mx-search-shortcuts {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  color: var(--ds-color-text-muted);
}

.mx-chip-row {
  display: flex;
  gap: var(--ds-space-2);
  overflow-x: auto;
  padding-top: var(--ds-space-3);
  scrollbar-width: none;
}

.mx-chip-row::-webkit-scrollbar { display: none; }

.mx-chip {
  white-space: nowrap;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ds-color-line);
  background: var(--ds-color-surface);
  font-size: var(--ds-text-sm);
  font-weight: 800;
}

.mx-hero-strip {
  display: grid;
  gap: var(--ds-space-3);
}

.mx-hero-card {
  display: grid;
  gap: var(--ds-space-3);
  padding: var(--ds-space-4) !important;
  background: linear-gradient(145deg, #151b28 0%, #1f2937 40%, #ff6a00 180%) !important;
  color: #fff !important;
  overflow: hidden;
}

.mx-hero-card span,
.mx-hero-card p {
  color: rgba(255,255,255,0.84) !important;
}

.mx-hero-card h1 {
  margin: 0 !important;
  font-size: 24px !important;
  line-height: 1.18 !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em;
}

.mx-hero-cta {
  width: fit-content;
  min-width: 140px;
  min-height: 42px;
  padding: 0 16px !important;
  border-radius: 14px;
}

.mx-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ds-space-2);
}

.mx-kpi-card {
  padding: 10px 12px !important;
  min-height: 72px;
  text-align: start;
}

.mx-kpi-card strong {
  display: block;
  color: var(--ds-color-text) !important;
  font-size: 18px;
  font-weight: 900;
}

.mx-kpi-card span {
  display: block;
  color: var(--ds-color-text-muted) !important;
  font-size: var(--ds-text-xs);
  line-height: 1.45;
}

.mx-feed-shell {
  padding: var(--ds-space-3) !important;
}

.mx-feed-shell__header p {
  margin: 0 0 4px !important;
  color: var(--ds-color-accent-strong) !important;
  font-weight: 800 !important;
}

.mx-feed-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--ds-space-3) !important;
}

.mx-product-topbar {
  position: absolute;
  inset: 10px 10px auto 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-2);
  z-index: 2;
}

.mx-inline-rail {
  padding: var(--ds-space-3) !important;
  margin-bottom: var(--ds-space-3);
}

.mx-inline-rail__scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 92px;
  gap: var(--ds-space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.mx-inline-rail__scroll::-webkit-scrollbar { display: none; }

.mx-mini-card {
  display: grid;
  gap: var(--ds-space-2);
  padding: var(--ds-space-2);
  border-radius: 14px;
  border: 1px solid var(--ds-color-line);
  background: var(--ds-color-surface-2);
  text-align: start;
}

.mx-mini-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--ds-color-surface);
}

.mx-mini-card span {
  font-size: var(--ds-text-xs);
  line-height: 1.4;
  color: var(--ds-color-text-soft);
  font-weight: 700;
}

.mx-feed-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--ds-space-3);
  color: var(--ds-color-text-muted);
}

.mx-inline-loader {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ds-color-line);
  border-top-color: var(--ds-color-accent);
  animation: ds-spin 0.7s linear infinite;
}

.mx-product-seller {
  color: var(--ds-color-text-soft) !important;
  font-size: var(--ds-text-sm) !important;
  font-weight: 700 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ── Product quick sheet and cart drawer ──────────────────────────── */
.mx-sheet-overlay,
.mx-cart-overlay {
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(3px);
}

.mx-sheet,
.mx-cart-drawer {
  background: var(--ds-color-surface) !important;
  border-radius: 24px 24px 0 0 !important;
  box-shadow: var(--ds-shadow-lg) !important;
}

.mx-sheet-header,
.mx-cart-header,
.mx-cart-footer {
  padding: var(--ds-space-4) !important;
  border-color: var(--ds-color-line) !important;
}

.mx-sheet-content,
.mx-cart-body {
  padding: 0 var(--ds-space-4) var(--ds-space-4) !important;
}

.mx-cart-row,
.order-item,
.cart-item {
  border-bottom: 1px solid var(--ds-color-line) !important;
}

/* ── Tables and admin data views ─────────────────────────────────── */
.admin-layout,
.seller-layout {
  background: var(--ds-color-bg) !important;
}

.admin-sidebar,
.seller-sidebar {
  background: #065F46 !important;
  color: #ffffff !important;
  border-inline-end: 1px solid rgba(255,255,255,0.12) !important;
}

.admin-sidebar-header,
.seller-sidebar-header,
.admin-topbar,
.seller-topbar {
  border-color: rgba(15, 23, 42, 0.08) !important;
}

.admin-topbar,
.seller-topbar,
.admin-content,
.seller-content {
  background: transparent !important;
}

.admin-topbar,
.seller-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: var(--ds-space-4) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(244, 245, 247, 0.86) !important;
}

.admin-main,
.seller-main {
  min-width: 0;
}

.admin-content,
.seller-content {
  padding: var(--ds-space-4) !important;
}

.admin-nav,
.seller-nav {
  display: grid;
  gap: 6px;
}

.admin-nav-item,
.seller-nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  color: rgba(255,255,255,0.76) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
}

.admin-nav-item:hover,
.seller-nav-item:hover,
.admin-nav-item.active,
.seller-nav-item.active {
  color: #fff !important;
  background: rgba(255,255,255,0.09) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

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

.admin-table th,
.admin-table td {
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--ds-color-line) !important;
  text-align: start !important;
  font-size: var(--ds-text-sm) !important;
}

.admin-table th {
  color: var(--ds-color-text-soft) !important;
  font-weight: 800 !important;
  background: var(--ds-color-surface-2) !important;
}

.admin-stat-card,
.stat-card,
.metric-card {
  padding: var(--ds-space-4) !important;
}

.stat-value {
  color: var(--ds-color-text) !important;
  font-size: 24px !important;
  font-weight: 900 !important;
}

.stat-label {
  color: var(--ds-color-text-muted) !important;
  font-size: var(--ds-text-sm) !important;
  font-weight: 700 !important;
}

.admin-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  padding: var(--ds-space-4) !important;
  border-radius: var(--ds-radius-md) !important;
  background: var(--ds-color-surface) !important;
  border: 1px solid var(--ds-color-line) !important;
  box-shadow: var(--ds-shadow-xs) !important;
}

/* ── Modals and utility surfaces ──────────────────────────────────── */
.modal-header,
.modal-footer {
  padding: var(--ds-space-4) !important;
  border-color: var(--ds-color-line) !important;
}

.modal-body {
  padding: var(--ds-space-4) !important;
}

.toast,
.admin-toast {
  border-radius: 14px !important;
  box-shadow: var(--ds-shadow-md) !important;
}

/* ── Responsive tuning ────────────────────────────────────────────── */
@media (max-width: 991px) {
  .admin-content,
  .seller-content,
  .section-block,
  .premium-section {
    padding: var(--ds-space-3) !important;
  }

  .admin-topbar,
  .seller-topbar {
    padding: var(--ds-space-3) !important;
  }
}

@media (max-width: 767px) {
  .products-grid,
  .premium-products-grid,
  .subcat-products-grid,
  .subcat-trending-grid,
  .seller-products-grid,
  .smart-home-grid,
  .mx-feed-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .product-card-action-row .product-card-cta,
  .mx-product-actions .action-btn {
    flex-basis: calc(50% - 4px);
  }

  .admin-table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .mx-home-shell {
    padding-inline: 10px !important;
  }

  .mx-home-header,
  .mx-search-shell,
  .mx-hero-card,
  .mx-feed-shell,
  .mx-inline-rail,
  .section-block,
  .premium-section {
    border-radius: 18px !important;
  }

  .mx-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mx-kpi-card strong {
    font-size: 16px;
  }
}


/* ── Admin Hubs: consolidated operations UI ───────────────────────── */
.admin-nav-label {
  margin: 18px 10px 5px;
  color: rgba(255,255,255,.48);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-nav-label:first-child { margin-top: 4px; }

.admin-nav-item {
  position: relative;
  min-height: 44px;
  border-radius: 12px !important;
  text-decoration: none;
  cursor: pointer;
}

.admin-nav-item .admin-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  color: currentColor;
}

.admin-nav-item .admin-nav-icon svg,
.admin-sidebar-header svg {
  display: block;
  width: 18px;
  height: 18px;
}

.admin-nav-item > span:nth-child(2) { flex: 1; min-width: 0; }
.admin-nav-meta {
  color: rgba(255,255,255,.42);
  font-size: 10px;
  white-space: nowrap;
}

.admin-nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-badge {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 800;
}

.admin-hub {
  max-width: 1180px;
  margin: 0 auto;
}

.admin-hub-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 18px;
  border: 1px solid var(--ds-color-line);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ds-color-surface), var(--ds-color-surface-2));
  box-shadow: var(--ds-shadow-xs);
}

.admin-hub-hero-icon,
.admin-hub-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-color-accent-strong);
  background: var(--ds-color-accent-soft);
  border-radius: 14px;
}

.admin-hub-hero-icon { width: 52px; height: 52px; }
.admin-hub-hero h3 { margin: 2px 0 5px; color: var(--ds-color-text); font-size: clamp(18px, 2vw, 24px); }
.admin-hub-hero p { margin: 0; color: var(--ds-color-text-soft); font-size: 13px; line-height: 1.7; }
.admin-eyebrow { color: var(--ds-color-accent-strong); font-size: 10px; font-weight: 800; letter-spacing: .08em; }

.admin-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ds-color-line);
  border-radius: 11px;
  background: var(--ds-color-surface);
  color: var(--ds-color-text-soft);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease;
}
.admin-icon-button:hover,
.admin-icon-button:focus-visible {
  color: var(--ds-color-accent-strong);
  border-color: var(--ds-color-accent);
  background: var(--ds-color-accent-soft);
  transform: translateY(-1px);
}

.admin-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-hub-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  width: 100%;
  padding: 17px;
  text-align: start;
  border: 1px solid var(--ds-color-line);
  border-radius: 16px;
  background: var(--ds-color-surface);
  color: var(--ds-color-text);
  box-shadow: var(--ds-shadow-xs);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.admin-hub-card:hover,
.admin-hub-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255,106,0,.35);
  box-shadow: var(--ds-shadow-sm);
  background: var(--ds-color-surface-2);
  outline: none;
}
.admin-hub-card-icon { width: 42px; height: 42px; border-radius: 12px; }
.admin-hub-card-copy { display: grid; gap: 5px; min-width: 0; }
.admin-hub-card-copy strong { color: var(--ds-color-text); font-size: 14px; }
.admin-hub-card-copy small { color: var(--ds-color-text-soft); font-size: 11px; line-height: 1.65; }
.admin-hub-card-arrow { display: inline-flex; color: var(--ds-color-text-muted); transition: transform .18s ease, color .18s ease; }
.admin-hub-card:hover .admin-hub-card-arrow { color: var(--ds-color-accent-strong); transform: translateX(-3px); }

@media (max-width: 900px) {
  .admin-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .admin-nav-label { margin-inline: 6px; }
  .admin-nav-meta { display: none; }
  .admin-topbar { gap: 9px; }
  .admin-topbar h2 { font-size: 17px; }
  .admin-user-badge { padding: 6px 9px; font-size: 10px; }
  .admin-hub-hero { grid-template-columns: auto 1fr auto; gap: 10px; padding: 16px; border-radius: 15px; }
  .admin-hub-hero-icon { width: 44px; height: 44px; }
  .admin-hub-hero p { font-size: 11px; }
  .admin-hub-grid { grid-template-columns: 1fr; gap: 10px; }
  .admin-hub-card { min-height: 92px; padding: 14px; }
  .admin-hub-card-copy small { font-size: 10px; }
  .admin-table-wrap { margin-inline: -4px; border-radius: 12px; }
  .admin-table { min-width: 680px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-hub-card,
  .admin-icon-button,
  .admin-hub-card-arrow { transition: none; }
}
