/* ==========================================================================
   AC Store Mall - Shared Design Tokens
   One palette, one scale, one radius language for every surface.
   Pages load this file and use the variables below; legacy per-page :root
   blocks still work because these names intentionally overlap.
   ========================================================================== */

:root {
  /* Brand */
  --brand-900: #0b1f3a;
  --brand-800: #0f2a4a;
  --brand-700: #12416f;
  --brand-600: #17549b;
  --brand-500: #1f6fd0;
  --brand-400: #3d8ae8;
  --brand-100: #e8f1ff;
  --brand-050: #f4f8ff;

  /* Accent (Ghana gold) */
  --gold-600: #b8860b;
  --gold-500: #d9a520;
  --gold-300: #ffe08a;
  --gold-100: #fff7e0;

  /* Semantic */
  --success-600: #166534;
  --success-500: #1f7a4d;
  --success-400: #34b26f;
  --success-100: #e3f5ea;
  --danger-600: #b42318;
  --danger-500: #d64545;
  --danger-100: #fdecec;
  --warning-600: #b25e00;
  --warning-500: #fa8c16;
  --warning-100: #fff1e0;
  --info-500: #0b5fff;
  --info-100: #e8f1ff;

  /* Neutrals */
  --ink-900: #16202b;
  --ink-800: #1f2d3d;
  --ink-700: #33404d;
  --ink-600: #41505f;
  --ink-500: #5b6b7c;
  --ink-400: #6b7785;
  --ink-300: #8296ad;
  --ink-200: #c9d3df;
  --ink-100: #e3e9f0;
  --ink-050: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f6f8fb;
  --surface-sunken: #fbfcfe;

  /* Legacy aliases kept so existing rules keep working */
  --primary: var(--brand-500);
  --primary-dark: var(--brand-700);
  --success: var(--success-500);
  --danger: var(--danger-500);
  --warning: var(--warning-500);
  --dark: var(--ink-800);
  --bg: var(--surface-alt);
  --gray: var(--ink-500);
  --muted: var(--ink-500);
  --line: var(--ink-100);
  --navy: var(--brand-800);
  --ink: var(--ink-800);
  --brand: var(--brand-500);
  --ok: var(--success-500);
  --warn: var(--warning-500);

  /* Radii */
  --r-xs: 5px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;

  /* Elevation */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 2px 6px rgba(16, 24, 40, .07);
  --sh-md: 0 8px 20px rgba(16, 24, 40, .09);
  --sh-lg: 0 14px 34px rgba(16, 24, 40, .13);

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Type */
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Semibold", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: .18s;
}

/* ==========================================================================
   Shared components (used by every surface)
   ========================================================================== */

/* --- Verified / KYC badge --------------------------------------------- */
.ac-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .2px;
  padding: 3px 8px; border-radius: var(--r-pill);
  white-space: nowrap; line-height: 1.3;
}
.ac-badge.is-verified { background: var(--success-100); color: var(--success-600); border: 1px solid #b7e4c7; }
.ac-badge.is-reg { background: var(--info-100); color: var(--brand-700); border: 1px solid #c3dcff; }
.ac-badge.is-neutral { background: var(--ink-050); color: var(--ink-500); border: 1px solid var(--ink-100); }
.ac-badge.is-gold { background: var(--gold-100); color: var(--gold-600); border: 1px solid #ffe0a3; }
.ac-badge svg { flex: 0 0 auto; }

/* --- Star rating -------------------------------------------------------- */
.ac-stars { display: inline-flex; align-items: center; gap: 2px; color: var(--gold-500); }
.ac-stars .ac-star { width: 13px; height: 13px; fill: currentColor; }
.ac-stars .ac-star.is-empty { color: var(--ink-200); }
.ac-stars-text { font-size: 12px; color: var(--ink-500); font-weight: 600; }

/* --- Stats rail (homepage) --------------------------------------------- */
.ac-stats-rail {
  max-width: 1200px; margin: 0 auto 18px; padding: 0 20px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
}
.ac-stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 14px 16px; text-align: center; box-shadow: var(--sh-xs);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ac-stat:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.ac-stat .ac-stat-value { font-size: 22px; font-weight: 800; color: var(--brand-700); line-height: 1.2; font-variant-numeric: tabular-nums; }
.ac-stat .ac-stat-label { font-size: 11.5px; color: var(--ink-500); font-weight: 600; margin-top: 3px; letter-spacing: .2px; }

/* --- Section heading ---------------------------------------------------- */
.ac-section-head { max-width: 1200px; margin: 0 auto 12px; padding: 0 20px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ac-section-head h3 { margin: 0; font-size: 17px; color: var(--ink-800); font-weight: 800; }
.ac-section-head p { margin: 0; font-size: 12.5px; color: var(--ink-500); }
.ac-section-head a { font-size: 12.5px; font-weight: 700; color: var(--brand-500); text-decoration: none; }
.ac-section-head a:hover { text-decoration: underline; }

/* --- Empty state -------------------------------------------------------- */
.ac-empty {
  grid-column: 1 / -1; text-align: center; padding: 38px 20px;
  background: var(--surface); border: 1px dashed var(--ink-200); border-radius: var(--r-lg);
}
.ac-empty .ac-empty-icon {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--brand-100); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
}
.ac-empty h4 { margin: 0 0 5px; font-size: 15px; color: var(--ink-800); }
.ac-empty p { margin: 0 0 14px; font-size: 13px; color: var(--ink-500); }
.ac-empty .ac-empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ac-btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: 13px; font-weight: 700; padding: 9px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--ink-200); background: var(--surface); color: var(--ink-700);
  cursor: pointer; transition: all var(--dur) var(--ease);
}
.ac-btn:hover { border-color: var(--brand-500); color: var(--brand-600); }
.ac-btn.is-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.ac-btn.is-primary:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }

/* --- KPI card row (admin / portal / staff) ----------------------------- */
.ac-kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.ac-kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-xs);
  overflow: hidden;
}
.ac-kpi::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--brand-500);
}
.ac-kpi.is-success::before { background: var(--success-400); }
.ac-kpi.is-warning::before { background: var(--warning-500); }
.ac-kpi.is-danger::before { background: var(--danger-500); }
.ac-kpi.is-gold::before { background: var(--gold-500); }
.ac-kpi .ac-kpi-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-400); display: flex; align-items: center; gap: 6px;
}
.ac-kpi .ac-kpi-value {
  font-size: 26px; font-weight: 800; color: var(--ink-900); line-height: 1.15; margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.ac-kpi .ac-kpi-sub { font-size: 12px; color: var(--ink-500); margin-top: 3px; }
.ac-kpi .ac-kpi-delta { font-size: 11.5px; font-weight: 700; margin-top: 5px; display: inline-flex; align-items: center; gap: 3px; }
.ac-kpi-delta.up { color: var(--success-600); }
.ac-kpi-delta.down { color: var(--danger-600); }
.ac-kpi-delta.flat { color: var(--ink-400); }
.ac-kpi .ac-kpi-icon {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--brand-100); color: var(--brand-600);
  display: flex; align-items: center; justify-content: center;
}

/* --- Table polish ------------------------------------------------------- */
.ac-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ac-table thead th {
  text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: var(--ink-400); padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: var(--surface-sunken);
  position: sticky; top: 0; z-index: 1;
}
.ac-table tbody td { padding: 11px 12px; border-bottom: 1px solid var(--ink-050); color: var(--ink-700); vertical-align: middle; }
.ac-table tbody tr:hover { background: var(--surface-sunken); }
.ac-table tbody tr:last-child td { border-bottom: none; }
.ac-table .ac-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.ac-table .ac-strong { font-weight: 700; color: var(--ink-900); }

/* --- Page header band --------------------------------------------------- */
.ac-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.ac-page-head h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; color: var(--ink-900); }
.ac-page-head p { margin: 0; font-size: 13px; color: var(--ink-500); max-width: 720px; }
.ac-page-head .ac-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-stamp { font-size: 11.5px; color: var(--ink-400); display: inline-flex; align-items: center; gap: 5px; }

/* --- Vendor profile card (storefront) ----------------------------------- */
.ac-store-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--sh-xs); margin-bottom: 18px;
}
.ac-store-card .ac-store-top { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ac-store-card .ac-store-logo {
  width: 66px; height: 66px; border-radius: var(--r-md); object-fit: cover;
  border: 1px solid var(--ink-100); background: var(--surface-sunken); flex: 0 0 auto;
}
.ac-store-card .ac-store-meta { flex: 1; min-width: 210px; }
.ac-store-card h2 { margin: 0 0 3px; font-size: 19px; font-weight: 800; color: var(--ink-900); }
.ac-store-card .ac-store-sub { font-size: 12.5px; color: var(--ink-500); margin-bottom: 8px; }
.ac-store-card .ac-store-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ac-store-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ink-050);
}
.ac-store-facts .ac-fact-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-400); font-weight: 800; }
.ac-store-facts .ac-fact-value { font-size: 13.5px; font-weight: 700; color: var(--ink-800); margin-top: 2px; word-break: break-word; }
.ac-store-policies { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ac-store-policies a {
  font-size: 12px; font-weight: 700; text-decoration: none; color: var(--brand-600);
  background: var(--brand-050); border: 1px solid #d6e6ff; padding: 7px 12px; border-radius: var(--r-sm);
}
.ac-store-policies a:hover { background: var(--brand-100); }

/* --- Compliance banner -------------------------------------------------- */
.ac-compliance {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-700));
  color: #fff; border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 18px;
}
.ac-compliance .ac-compliance-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex: 0 0 auto;
  background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center;
}
.ac-compliance .ac-compliance-text { flex: 1; min-width: 200px; font-size: 12.5px; line-height: 1.5; }
.ac-compliance .ac-compliance-text b { display: block; font-size: 13.5px; margin-bottom: 1px; }
.ac-compliance .ac-compliance-text span { opacity: .82; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 720px) {
  .ac-kpi-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .ac-kpi { padding: 13px 14px; }
  .ac-kpi .ac-kpi-value { font-size: 21px; }
  .ac-store-card { padding: 15px 16px; }
  .ac-stats-rail { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-stat, .ac-btn, .ac-kpi { transition: none; }
  .ac-stat:hover { transform: none; }
}
