/* ============================================================
   Z-LAND DESIGN SYSTEM — Foundation (D1)
   "Premium Digital Country" — dark, quiet, confident. Not a SaaS
   admin template, not a game HUD. Additive only: loaded alongside
   the existing public/css/style.css, never edits it. Nothing here
   changes on a page unless that page opts in by using these
   classes/tokens.
   ============================================================ */

:root {
  /* ---- Surfaces ---- */
  --zl-bg: #06070b;              /* app background — near-black, cool navy undertone */
  --zl-surface: #101219;          /* cards, panels */
  --zl-surface-elevated: #171a24; /* modals, popovers, anything "above" a card */
  --zl-surface-sunken: #0a0b10;   /* inputs, wells — recessed relative to a card */
  --zl-border: rgba(255, 255, 255, 0.09);
  --zl-border-strong: rgba(255, 255, 255, 0.16);

  /* ---- Text ---- */
  --zl-text: #f3f4f7;
  --zl-text-muted: #9599aa;
  --zl-text-dimmer: #61657a;

  /* ---- Brand ---- */
  --zl-primary: #3d6bf0;          /* electric/royal blue — the one interactive color */
  --zl-primary-strong: #5c85ff;   /* hover/active */
  --zl-primary-soft: rgba(61, 107, 240, 0.14);
  --zl-gold: #c9a961;             /* Z-LAND identity/premium accent — used sparingly */
  --zl-gold-soft: rgba(201, 169, 97, 0.14);

  /* ---- Semantic (separate from brand — never reuse primary for these) ---- */
  --zl-success: #1fc47c;
  --zl-success-soft: rgba(31, 196, 124, 0.14);
  --zl-warning: #f0a93b;
  --zl-warning-soft: rgba(240, 169, 59, 0.14);
  --zl-danger: #ff4457;
  --zl-danger-soft: rgba(255, 68, 87, 0.14);
  --zl-info: #38bdf8;
  --zl-info-soft: rgba(56, 189, 248, 0.14);

  /* ---- Type scale (Tajawal — Arabic-first, already proven across the app;
     no new font family introduced) ---- */
  --zl-font: "Tajawal", "Cairo", "Segoe UI", sans-serif;

  /* ---- Spacing scale (4px base) ---- */
  --zl-space-1: 4px;
  --zl-space-2: 8px;
  --zl-space-3: 12px;
  --zl-space-4: 16px;
  --zl-space-5: 20px;
  --zl-space-6: 24px;
  --zl-space-8: 32px;
  --zl-space-10: 40px;
  --zl-space-12: 48px;
  --zl-space-16: 64px;

  /* ---- Radius ---- */
  --zl-radius-sm: 10px;
  --zl-radius-md: 14px;
  --zl-radius-lg: 20px;
  --zl-radius-pill: 999px;

  /* ---- Elevation ---- */
  --zl-shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --zl-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
  --zl-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);

  /* ---- Motion — short and quiet, never bouncy ---- */
  --zl-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --zl-duration-fast: 0.15s;
  --zl-duration-base: 0.22s;

  /* ---- Touch / control sizing ---- */
  --zl-control-h: 48px;    /* inputs, selects */
  --zl-control-h-sm: 40px;
  --zl-btn-h: 48px;
  --zl-btn-h-sm: 40px;
  --zl-btn-h-lg: 56px;
  --zl-touch-min: 44px;    /* minimum tap target, any element */
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.zl-display {
  font-family: var(--zl-font);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--zl-text);
}

.zl-h1 {
  font-family: var(--zl-font);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--zl-text);
}

.zl-h2 {
  font-family: var(--zl-font);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--zl-text);
}

.zl-h3 {
  font-family: var(--zl-font);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--zl-text);
}

.zl-body {
  font-family: var(--zl-font);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--zl-text);
}

.zl-small {
  font-family: var(--zl-font);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--zl-text-muted);
}

.zl-caption {
  font-family: var(--zl-font);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--zl-text-dimmer);
  text-transform: uppercase;
}

.zl-kpi-number {
  font-family: var(--zl-font);
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--zl-text);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* ============================================================
   LAYOUT PRIMITIVES
   ============================================================ */

.zl-app {
  background: var(--zl-bg);
  color: var(--zl-text);
  font-family: var(--zl-font);
  min-height: 100vh;
}

.zl-container {
  width: min(1100px, 94%);
  margin-inline: auto;
}

.zl-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zl-space-4);
  flex-wrap: wrap;
  margin-bottom: var(--zl-space-6);
}

.zl-page-header .zl-page-title {
  display: flex;
  align-items: center;
  gap: var(--zl-space-3);
}

.zl-page-header .zl-page-actions {
  display: flex;
  align-items: center;
  gap: var(--zl-space-3);
  flex-wrap: wrap;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.zl-nav-desktop {
  display: none;
}

@media (min-width: 860px) {
  .zl-nav-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--zl-space-4);
    padding: var(--zl-space-3) 0;
    border-bottom: 1px solid var(--zl-border);
    margin-bottom: var(--zl-space-8);
  }
}

.zl-nav-brand {
  display: flex;
  align-items: center;
  gap: var(--zl-space-2);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--zl-text);
}

.zl-nav-brand .zl-brand-mark {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.zl-nav-links {
  display: flex;
  align-items: center;
  gap: var(--zl-space-6);
}

.zl-nav-links a {
  color: var(--zl-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color var(--zl-duration-fast) var(--zl-ease);
}

.zl-nav-links a:hover,
.zl-nav-links a.is-active {
  color: var(--zl-text);
}

/* Mobile bottom nav — thumb-reachable, fixed, icon + label */
.zl-nav-mobile {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 80;
  display: flex;
  background: rgba(16, 18, 25, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--zl-border);
  padding: var(--zl-space-2) var(--zl-space-2) max(var(--zl-space-2), env(safe-area-inset-bottom));
}

@media (min-width: 860px) {
  .zl-nav-mobile {
    display: none;
  }
}

.zl-nav-mobile a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--zl-space-2) 0;
  min-height: var(--zl-touch-min);
  color: var(--zl-text-dimmer);
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: var(--zl-radius-sm);
}

.zl-nav-mobile a svg {
  width: 20px;
  height: 20px;
}

.zl-nav-mobile a.is-active {
  color: var(--zl-primary-strong);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.zl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--zl-space-2);
  height: var(--zl-btn-h);
  padding: 0 var(--zl-space-6);
  border-radius: var(--zl-radius-pill);
  font-family: var(--zl-font);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--zl-duration-fast) var(--zl-ease),
              box-shadow var(--zl-duration-base) var(--zl-ease),
              background var(--zl-duration-base) var(--zl-ease),
              border-color var(--zl-duration-base) var(--zl-ease),
              opacity var(--zl-duration-base) var(--zl-ease);
}

.zl-btn:active {
  transform: scale(0.97);
}

.zl-btn:disabled,
.zl-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.zl-btn-sm {
  height: var(--zl-btn-h-sm);
  padding: 0 var(--zl-space-4);
  font-size: 0.85rem;
}

.zl-btn-lg {
  height: var(--zl-btn-h-lg);
  padding: 0 var(--zl-space-8);
  font-size: 1rem;
}

.zl-btn-block {
  width: 100%;
}

.zl-btn-primary {
  background: var(--zl-primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(61, 107, 240, 0.35);
}

.zl-btn-primary:hover {
  background: var(--zl-primary-strong);
  box-shadow: 0 12px 28px rgba(61, 107, 240, 0.45);
}

.zl-btn-secondary {
  background: var(--zl-surface-elevated);
  border-color: var(--zl-border-strong);
  color: var(--zl-text);
}

.zl-btn-secondary:hover {
  background: #1d2130;
  border-color: rgba(255, 255, 255, 0.28);
}

.zl-btn-ghost {
  background: transparent;
  border-color: var(--zl-border);
  color: var(--zl-text-muted);
}

.zl-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--zl-text);
  border-color: var(--zl-border-strong);
}

.zl-btn-danger {
  background: transparent;
  border-color: rgba(255, 68, 87, 0.4);
  color: var(--zl-danger);
}

.zl-btn-danger:hover {
  background: var(--zl-danger-soft);
  border-color: var(--zl-danger);
}

.zl-btn-gold {
  background: linear-gradient(155deg, #dcc07f, var(--zl-gold));
  color: #221b0d;
  box-shadow: 0 8px 22px rgba(201, 169, 97, 0.3);
}

.zl-btn-gold:hover {
  box-shadow: 0 12px 28px rgba(201, 169, 97, 0.4);
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */

.zl-field {
  display: flex;
  flex-direction: column;
  gap: var(--zl-space-2);
  margin-bottom: var(--zl-space-4);
}

.zl-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--zl-text-muted);
}

.zl-input,
.zl-select,
.zl-textarea {
  width: 100%;
  min-height: var(--zl-control-h);
  padding: 0 var(--zl-space-4);
  border-radius: var(--zl-radius-sm);
  background: var(--zl-surface-sunken);
  border: 1px solid var(--zl-border);
  color: var(--zl-text);
  font-family: var(--zl-font);
  font-size: 0.92rem;
  transition: border-color var(--zl-duration-base) var(--zl-ease), background var(--zl-duration-base) var(--zl-ease);
}

.zl-textarea {
  padding: var(--zl-space-3) var(--zl-space-4);
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.zl-input::placeholder,
.zl-textarea::placeholder {
  color: var(--zl-text-dimmer);
}

.zl-input:focus,
.zl-select:focus,
.zl-textarea:focus {
  outline: none;
  border-color: var(--zl-primary);
  background: #0d0f16;
  box-shadow: 0 0 0 3px var(--zl-primary-soft);
}

.zl-field.has-error .zl-input,
.zl-field.has-error .zl-select,
.zl-field.has-error .zl-textarea {
  border-color: var(--zl-danger);
}

.zl-field.has-error .zl-input:focus,
.zl-field.has-error .zl-textarea:focus {
  box-shadow: 0 0 0 3px var(--zl-danger-soft);
}

.zl-error-text {
  font-size: 0.78rem;
  color: var(--zl-danger);
}

.zl-search-field {
  position: relative;
}

.zl-search-field .zl-input {
  padding-inline-start: var(--zl-space-10);
}

.zl-search-field .zl-search-icon {
  position: absolute;
  inset-inline-start: var(--zl-space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--zl-text-dimmer);
  pointer-events: none;
}

/* ============================================================
   CARDS
   ============================================================ */

.zl-card {
  background: var(--zl-surface);
  border: 1px solid var(--zl-border);
  border-radius: var(--zl-radius-md);
  padding: var(--zl-space-6);
}

.zl-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: var(--zl-space-4);
}

.zl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--zl-space-3);
}

@media (min-width: 640px) {
  .zl-kpi-grid.zl-kpi-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.zl-kpi-card {
  background: var(--zl-surface);
  border: 1px solid var(--zl-border);
  border-radius: var(--zl-radius-md);
  padding: var(--zl-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--zl-space-1);
}

.zl-kpi-card .zl-kpi-label {
  font-size: 0.72rem;
  color: var(--zl-text-muted);
  font-weight: 600;
}

.zl-kpi-card.is-accent { border-color: rgba(61, 107, 240, 0.35); }
.zl-kpi-card.is-success .zl-kpi-number { color: var(--zl-success); }
.zl-kpi-card.is-warning .zl-kpi-number { color: var(--zl-warning); }
.zl-kpi-card.is-danger .zl-kpi-number { color: var(--zl-danger); }

.zl-product-card {
  background: var(--zl-surface);
  border: 1px solid var(--zl-border);
  border-radius: var(--zl-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.zl-product-card .zl-product-media {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: var(--zl-surface-sunken);
}

.zl-product-card .zl-product-body {
  padding: var(--zl-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--zl-space-1);
  flex: 1;
}

.zl-product-card .zl-product-price {
  color: var(--zl-gold);
  font-weight: 800;
  font-size: 1rem;
}

.zl-order-card {
  background: var(--zl-surface);
  border: 1px solid var(--zl-border);
  border-radius: var(--zl-radius-md);
  padding: var(--zl-space-4);
}

.zl-order-card .zl-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--zl-space-3);
  margin-bottom: var(--zl-space-3);
}

.zl-order-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--zl-space-3);
  padding: var(--zl-space-2) 0;
  border-top: 1px solid var(--zl-border);
}

.zl-order-line:first-of-type {
  border-top: none;
}

.zl-empty-state {
  text-align: center;
  padding: var(--zl-space-12) var(--zl-space-4);
  color: var(--zl-text-dimmer);
}

.zl-icon-sm {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -3px;
  flex-shrink: 0;
}

.zl-icon-sm svg { width: 100%; height: 100%; display: block; }

/* Store preview row — real duplication across favorites + search (D2.1) */
.zl-store-row {
  display: flex;
  align-items: center;
  gap: var(--zl-space-4);
  padding: var(--zl-space-4);
  border: 1px solid var(--zl-border);
  border-radius: var(--zl-radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--zl-duration-base) var(--zl-ease), background var(--zl-duration-base) var(--zl-ease);
}

.zl-store-row:hover {
  border-color: var(--zl-border-strong);
  background: rgba(255, 255, 255, 0.02);
}

.zl-store-row .zl-store-visuals {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--zl-space-2);
  flex-shrink: 0;
}

.zl-store-row .zl-store-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--zl-primary);
  background: var(--zl-surface-sunken);
  display: block;
}

.zl-store-row .zl-store-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.zl-store-row .zl-store-icon-badge svg { width: 17px; height: 17px; }

.zl-store-row .zl-store-body { flex: 1; min-width: 0; }
.zl-store-row .zl-store-name { font-weight: 700; color: var(--zl-text); overflow-wrap: break-word; }
.zl-store-row .zl-store-meta { color: var(--zl-text-muted); font-size: 0.82rem; margin-top: 2px; }
.zl-store-row .zl-store-line { color: var(--zl-text-muted); font-size: 0.82rem; margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.zl-store-row .zl-store-location { color: var(--zl-text-dimmer); font-size: 0.78rem; margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.zl-store-row .zl-store-rating { color: var(--zl-gold); font-size: 0.82rem; margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* Generic list row — friend rows, group member rows (buyer.friends) */
.zl-list-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--zl-space-2) var(--zl-space-3);
  padding: var(--zl-space-3) var(--zl-space-4);
  border: 1px solid var(--zl-border);
  border-radius: var(--zl-radius-md);
  margin-bottom: var(--zl-space-3);
}

.zl-list-row .zl-list-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--zl-text-dimmer);
}

.zl-list-row .zl-list-dot.is-online {
  background: var(--zl-success);
  box-shadow: 0 0 6px var(--zl-success);
}

.zl-list-row .zl-list-info { flex: 1 1 140px; min-width: 0; }
.zl-list-row .zl-list-name { font-weight: 700; color: var(--zl-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zl-list-row .zl-list-meta { font-size: 0.78rem; color: var(--zl-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zl-list-row .zl-list-actions { display: flex; gap: var(--zl-space-2); flex-wrap: wrap; flex-shrink: 0; }

.zl-empty-state .zl-empty-icon {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto var(--zl-space-4);
  color: var(--zl-text-dimmer);
  opacity: 0.6;
}

.zl-empty-state .zl-empty-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================================================
   BADGES / STATUS PILLS
   ============================================================ */

.zl-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--zl-space-1);
  padding: 3px var(--zl-space-3);
  border-radius: var(--zl-radius-pill);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.zl-badge svg { width: 12px; height: 12px; }

.zl-badge-neutral { background: rgba(255, 255, 255, 0.08); color: var(--zl-text); }
.zl-badge-primary { background: var(--zl-primary-soft); color: var(--zl-primary-strong); }
.zl-badge-success { background: var(--zl-success-soft); color: var(--zl-success); }
.zl-badge-warning { background: var(--zl-warning-soft); color: var(--zl-warning); }
.zl-badge-danger  { background: var(--zl-danger-soft); color: var(--zl-danger); }
.zl-badge-info    { background: var(--zl-info-soft); color: var(--zl-info); }
.zl-badge-gold    { background: var(--zl-gold-soft); color: var(--zl-gold); }

/* Order status language, centralized (was duplicated per-view) */
.zl-status-new        { background: rgba(255, 255, 255, 0.08); color: var(--zl-text); }
.zl-status-processing { background: var(--zl-warning-soft); color: var(--zl-warning); }
.zl-status-shipped    { background: var(--zl-info-soft); color: var(--zl-info); }
.zl-status-completed  { background: var(--zl-success-soft); color: var(--zl-success); }
.zl-status-cancelled  { background: var(--zl-danger-soft); color: var(--zl-danger); }

/* Inventory language */
.zl-stock-in     { background: var(--zl-success-soft); color: var(--zl-success); }
.zl-stock-low    { background: var(--zl-warning-soft); color: var(--zl-warning); }
.zl-stock-out    { background: var(--zl-danger-soft); color: var(--zl-danger); }

/* Business language */
.zl-biz-active    { background: var(--zl-success-soft); color: var(--zl-success); }
.zl-biz-paused    { background: var(--zl-warning-soft); color: var(--zl-warning); }
.zl-biz-suspended { background: var(--zl-danger-soft); color: var(--zl-danger); }

/* ============================================================
   ALERTS
   ============================================================ */

.zl-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--zl-space-3);
  padding: var(--zl-space-4);
  border-radius: var(--zl-radius-sm);
  border: 1px solid var(--zl-border);
  font-size: 0.88rem;
  line-height: 1.6;
}

.zl-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.zl-alert-info    { background: var(--zl-info-soft); border-color: rgba(56, 189, 248, 0.3); color: var(--zl-text); }
.zl-alert-success { background: var(--zl-success-soft); border-color: rgba(31, 196, 124, 0.3); color: var(--zl-text); }
.zl-alert-warning { background: var(--zl-warning-soft); border-color: rgba(240, 169, 59, 0.3); color: var(--zl-text); }
.zl-alert-danger  { background: var(--zl-danger-soft); border-color: rgba(255, 68, 87, 0.3); color: var(--zl-text); }

/* ============================================================
   MODAL / DRAWER (real usage: seller settings modal)
   ============================================================ */

.zl-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 5, 8, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  overflow-y: auto;
  padding: var(--zl-space-6) var(--zl-space-4);
}

.zl-modal-backdrop.is-open { display: block; }

.zl-modal {
  max-width: 480px;
  margin: 0 auto;
  background: var(--zl-surface-elevated);
  border: 1px solid var(--zl-border-strong);
  border-radius: var(--zl-radius-lg);
  padding: var(--zl-space-6);
  box-shadow: var(--zl-shadow-lg);
}

.zl-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--zl-space-5);
}

.zl-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--zl-text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ============================================================
   UTILITIES
   ============================================================ */

.zl-flex { display: flex; }
.zl-flex-col { display: flex; flex-direction: column; }
.zl-items-center { align-items: center; }
.zl-justify-between { justify-content: space-between; }
.zl-gap-2 { gap: var(--zl-space-2); }
.zl-gap-3 { gap: var(--zl-space-3); }
.zl-gap-4 { gap: var(--zl-space-4); }
.zl-mt-2 { margin-top: var(--zl-space-2); }
.zl-mt-3 { margin-top: var(--zl-space-3); }
.zl-mt-4 { margin-top: var(--zl-space-4); }
.zl-mt-6 { margin-top: var(--zl-space-6); }
.zl-mb-2 { margin-bottom: var(--zl-space-2); }
.zl-mb-3 { margin-bottom: var(--zl-space-3); }
.zl-mb-4 { margin-bottom: var(--zl-space-4); }
.zl-mb-6 { margin-bottom: var(--zl-space-6); }
.zl-text-muted { color: var(--zl-text-muted); }
.zl-text-dimmer { color: var(--zl-text-dimmer); }
.zl-text-center { text-align: center; }

@media (max-width: 640px) {
  .zl-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   AUTH SHELL (D3) — shared by all 6 login/register/password pages.
   Subtle world backdrop behind a focused card; the card, not the
   scenery, carries the reading weight.
   ============================================================ */

.zl-auth-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--zl-space-6) var(--zl-space-4);
  overflow: hidden;
}

.zl-auth-bg {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='20' cy='30' r='1' opacity='0.5'/%3E%3Ccircle cx='80' cy='15' r='0.7' opacity='0.3'/%3E%3Ccircle cx='140' cy='60' r='1.1' opacity='0.4'/%3E%3Ccircle cx='200' cy='25' r='0.6' opacity='0.35'/%3E%3Ccircle cx='260' cy='80' r='1' opacity='0.3'/%3E%3Ccircle cx='40' cy='110' r='0.8' opacity='0.25'/%3E%3Ccircle cx='110' cy='140' r='1.2' opacity='0.4'/%3E%3Ccircle cx='180' cy='120' r='0.6' opacity='0.3'/%3E%3Ccircle cx='250' cy='160' r='0.9' opacity='0.35'/%3E%3Ccircle cx='30' cy='200' r='0.7' opacity='0.3'/%3E%3Ccircle cx='90' cy='230' r='1' opacity='0.4'/%3E%3Ccircle cx='160' cy='210' r='0.6' opacity='0.25'/%3E%3Ccircle cx='220' cy='250' r='1.1' opacity='0.35'/%3E%3Ccircle cx='270' cy='220' r='0.7' opacity='0.3'/%3E%3Ccircle cx='60' cy='270' r='0.9' opacity='0.3'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.7;
}

.zl-auth-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 50% 35%, rgba(61, 107, 240, 0.16), transparent 70%),
    var(--zl-bg);
}

.zl-auth-back {
  position: absolute;
  top: var(--zl-space-5);
  inset-inline-start: var(--zl-space-5);
  z-index: 3;
}

.zl-auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background: rgba(16, 18, 25, 0.82);
  backdrop-filter: blur(16px);
  border: 1px solid var(--zl-border-strong);
  border-radius: var(--zl-radius-lg);
  padding: var(--zl-space-8) var(--zl-space-6);
  box-shadow: var(--zl-shadow-lg);
}

.zl-auth-card.is-wide { max-width: 480px; }

.zl-auth-card .zl-nav-brand {
  justify-content: center;
  margin-bottom: var(--zl-space-6);
}

.zl-auth-card .zl-h2 {
  text-align: center;
  margin-bottom: var(--zl-space-2);
}

.zl-auth-card .zl-auth-sub {
  text-align: center;
  color: var(--zl-text-muted);
  font-size: 0.88rem;
  margin-bottom: var(--zl-space-6);
  line-height: 1.6;
}

.zl-auth-divider {
  display: flex;
  align-items: center;
  gap: var(--zl-space-3);
  margin: var(--zl-space-5) 0;
  color: var(--zl-text-dimmer);
  font-size: 0.8rem;
}
.zl-auth-divider::before, .zl-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--zl-border);
}

.zl-auth-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--zl-space-3);
  width: 100%;
  height: var(--zl-btn-h);
  border-radius: var(--zl-radius-pill);
  background: #fff;
  color: #1f1f1f;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  text-decoration: none;
}
.zl-auth-google svg { width: 20px; height: 20px; }

.zl-auth-foot {
  text-align: center;
  margin-top: var(--zl-space-5);
  font-size: 0.88rem;
  color: var(--zl-text-muted);
}
.zl-auth-foot a { color: var(--zl-primary-strong); text-decoration: underline; }

/* ---- Seller: new-order badge and banner (partials/seller-nav) ---- */
.zl-nav-mobile a.zl-nav-has-badge { position: relative; }
.zl-nav-badge {
  position: absolute;
  top: 2px;
  inset-inline-start: calc(50% + 4px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--zl-danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.zl-nav-badge[hidden] { display: none; }
.zl-order-alert {
  position: fixed;
  z-index: 90;
  inset-inline: 16px;
  top: 16px;
  margin: 0 auto;
  max-width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--zl-radius-md);
  background: var(--zl-surface-elevated);
  border: 1px solid rgba(240, 169, 59, 0.6);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  color: var(--zl-text);
  font-weight: 800;
  text-decoration: none;
}
.zl-order-alert svg { width: 20px; height: 20px; color: var(--zl-warning); flex: none; }
.zl-order-alert[hidden] { display: none; }

/* ============================================================
   CRAFT LAYER — the founder's visual pass (2026-11-23)
   Additive polish over every page that uses the system: one clear
   keyboard focus ring, buttons and cards that answer the pointer
   (on pointer devices only), panels with a quiet top light so they
   read as surfaces, thin dark scrollbars, figures that line up.
   ============================================================ */

::selection {
  background: rgba(61, 107, 240, 0.35);
  color: #fff;
}

html {
  scroll-behavior: smooth;
}

/* One clear focus ring for the keyboard, everywhere. */
.zl-btn:focus-visible,
.zl-nav-links a:focus-visible,
.zl-nav-mobile a:focus-visible,
.zl-store-row:focus-visible,
.zl-product-card:focus-visible,
.zl-product-card a:focus-visible,
.zl-card a:focus-visible {
  outline: 2px solid var(--zl-primary-strong);
  outline-offset: 3px;
}

/* Panels: a quiet light along their top edge and a soft drop. */
.zl-card,
.zl-kpi-card,
.zl-product-card,
.zl-order-card {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0) 42%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), var(--zl-shadow-sm);
}

/* Things you can click answer the pointer — never on touch screens,
   where a lift would stick after the tap. */
@media (hover: hover) {
  .zl-btn-primary:hover,
  .zl-btn-gold:hover,
  .zl-btn-secondary:hover {
    transform: translateY(-1px);
  }
  .zl-product-card,
  .zl-store-row {
    transition: transform var(--zl-duration-base) var(--zl-ease),
                border-color var(--zl-duration-base) var(--zl-ease),
                background var(--zl-duration-base) var(--zl-ease),
                box-shadow var(--zl-duration-base) var(--zl-ease);
  }
  .zl-product-card:hover,
  .zl-store-row:hover {
    transform: translateY(-2px);
    border-color: var(--zl-border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--zl-shadow-md);
  }
}

/* Pressing always shows, hover or not. */
.zl-btn:active {
  transform: scale(0.97);
}

/* Prices, counts and figures line up. */
.zl-kpi-number,
.zl-product-price,
.zl-order-line {
  font-variant-numeric: tabular-nums;
}

/* Thin, dark scrollbars that belong to the page. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .zl-btn,
  .zl-product-card,
  .zl-store-row {
    transition: none;
  }
  .zl-btn-primary:hover,
  .zl-btn-gold:hover,
  .zl-btn-secondary:hover,
  .zl-product-card:hover,
  .zl-store-row:hover {
    transform: none;
  }
}

/* ===================================================== the character picker
   (buyer dashboard, seller settings) */
/* Six looks: the boys on the first row, the girls on the second. */
.char-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--zl-space-3); max-width: 330px; margin: 0 auto 4px; }
.char-form { margin: 0; }
.char-card {
    cursor: pointer;
    background: rgba(255,255,255,0.04);
    border: 2px solid transparent;
    border-radius: var(--zl-radius-md);
    padding: var(--zl-space-2) var(--zl-space-1);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--zl-text-muted);
    font: inherit;
    transition: all var(--zl-duration-base) var(--zl-ease);
}
.char-card:hover { background: rgba(255,255,255,0.08); }
.char-card.selected { border-color: var(--zl-primary); background: var(--zl-primary-soft); color: var(--zl-text); }
.char-icon { width: 56px; height: 56px; margin: 0 auto; }
.char-icon svg { width: 100%; height: 100%; display: block; }
.char-icon { display: block; }
