:root {
  /* ── Brand ── */
  --teal:           #00d68b;
  --teal-hover:     #0F766E;
  --teal-pressed:   #115E59;
  --teal-soft:      #CCFBF1;
  --teal-xsoft:     #F0FDF9;
  --teal-glow:      rgba(13,148,136,0.15);

  /* ── Amber (stars only — never crossover) ── */
  --amber:          #F59E0B;
  --amber-half:     #FCD34D;
  --amber-empty:    #E8E2D9;
  --amber-soft:     #FEF3C7;

  /* ── Canvas & Surfaces ── */
  --canvas:         #F0EDE5;
  --canvas-mid:     #EAE6DC;
  --card:           #FFFFFF;
  --card-alt:       #FDFCFA;

  /* ── Lines ── */
  --line:           #E8E2D9;
  --line-soft:      #F0ECE3;
  --line-strong:    #D4CCBF;

  /* ── Text ── */
  --ink:            #2C2825;
  --ink-mid:        #44403C;
  --body-color:     #635C54;
  --muted:          #9B9189;
  --muted-soft:     #BFB8AE;

  /* ── Header (dark nav) ── */
  --header-bg:      #1C1917;
  --header-border:  rgba(255,255,255,0.07);
  --header-input:   rgba(255,255,255,0.09);
  --header-text:    #F7F4ED;
  --header-muted:   rgba(247,244,237,0.50);

  /* ── Status ── */
  --open:           #059669;
  --open-soft:      #D1FAE5;
  --closed:         #DC2626;
  --closed-soft:    #FEE2E2;
  --new-badge:      #7C3AED;
  --new-badge-soft: #EDE9FE;
  --ok:             #059669;
  --ok-soft:        #D1FAE5;
  --bad:            #DC2626;
  --bad-soft:       #FEE2E2;

  /* ── Tier surfaces ── */
  --gold-bg:        #FEF3C7;
  --gold-line:      #FDE68A;
  --gold-footer:    #FEF9E7;
  --mint-bg:        #CCFBF1;
  --mint-line:      #99F6E4;
  --mint-footer:    #ECFDF5;

  /* ── Elevation ── */
  --shadow-hero-search: rgba(44,40,37,0.10) 0px 4px 16px -4px;
  --shadow-modal:       rgba(44,40,37,0.18) 0px 16px 48px -8px;
  --shadow-dropdown:    rgba(44,40,37,0.10) 0px 4px 14px -4px;
  --shadow-toast:       rgba(44,40,37,0.10) 0px 6px 20px -4px;

  /* ── Backward-compat aliases (so old var() refs still work) ── */
  --bg:             var(--canvas);
  --surface:        var(--card);
  --border:         var(--line);
  --text-primary:   var(--ink);
  --text-secondary: var(--body-color);
  --accent:         var(--teal);
  --accent-hover:   var(--teal-hover);
}

/* ── Home-page enhancements (non-destructive, opt-in classes) ── */
:root {
  /* Richer, higher-contrast green for headline pop (emerald-600) */
  --teal-rich:      #059669;
  --teal-grad:      linear-gradient(135deg, #059669 0%, #0D9488 100%);
  --amber-grad:     linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
}

/* Trust pill */
.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-rich);
  background: var(--teal-soft);
  border: 1px solid var(--teal-xsoft);
  padding: 5px 12px;
  border-radius: 9999px;
}

/* Stat cards (social proof) */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 1px 2px rgba(44,40,37,0.04);
  transition: transform 180ms ease, box-shadow 180ms ease;
  min-width: 120px;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -8px rgba(44,40,37,0.18);
}
.stat-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-soft);
  color: var(--teal-rich);
}
.stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* Category card hovers */
.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: border-color 200ms cubic-bezier(0.16,1,0.3,1),
              transform 200ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 200ms cubic-bezier(0.16,1,0.3,1);
}
.cat-card:hover {
  border-color: var(--teal);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -10px rgba(44,40,37,0.22);
}
.cat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--teal-soft);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  color: var(--teal-rich);
  transition: background 200ms ease, color 200ms ease;
}
.cat-card:hover .cat-icon {
  background: var(--teal-grad);
  color: #fff;
}

/* Company card depth */
.company-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(44,40,37,0.06);
  transition: border-color 200ms cubic-bezier(0.16,1,0.3,1),
              transform 200ms cubic-bezier(0.16,1,0.3,1),
              box-shadow 200ms cubic-bezier(0.16,1,0.3,1);
}
.company-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -12px rgba(44,40,37,0.24);
}
.avatar-grad {
  background: var(--teal-grad) !important;
  color: #fff;
}
.badge-top {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--amber-grad);
  color: #78350F;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 1px 2px rgba(180,83,9,0.25);
}

/* Chips (Mashhur tags) */
.tag-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--body-color);
  background: var(--canvas-mid);
  padding: 4px 10px;
  border-radius: 9999px;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}
.tag-chip:hover { background: var(--teal-soft); color: var(--teal-rich); }

/* Arrow-link hover */
.arrow-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-rich);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.arrow-link .arw { transition: transform 160ms ease; display: inline-block; }
.arrow-link:hover { text-decoration: underline; }
.arrow-link:hover .arw { transform: translateX(4px); }

/* Search button gradient + hover */
.btn-search {
  background: var(--teal-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}
.btn-search:hover { transform: scale(1.04); box-shadow: 0 8px 18px -6px rgba(5,150,105,0.5); filter: brightness(1.03); }
.btn-search:active { transform: scale(0.98); }

/* ── Base ── */
body {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}

/* ── Focus ring ── */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--teal-glow);
}

/* ── Interactive cards ── */
.card-interactive {
  transition: border-color 180ms cubic-bezier(0.16,1,0.3,1),
              transform 180ms cubic-bezier(0.16,1,0.3,1);
}
.card-interactive:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* ── Skeleton shimmer ── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--canvas-mid) 25%, var(--line) 50%, var(--canvas-mid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--canvas-mid); }
}

/* ── Scrollbar ── */
.scrollbar-thin::-webkit-scrollbar { width: 3px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 9999px; }

/* ── Tab group ── */
.tab-group {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--canvas-mid);
}
.tab-group .tab-item {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  border: none;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.tab-group .tab-item:hover { color: var(--body-color); }
.tab-group .tab-item.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(44,40,37,0.08);
}

/* ── Buttons ── */
.btn-primary {
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  height: 34px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 140ms ease, transform 80ms ease-in;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
}
.btn-primary:hover  { background: var(--teal-hover); }
.btn-primary:active { background: var(--teal-pressed); transform: scale(0.98); }

.btn-dark {
  background: #2C2825;
  color: #F7F4ED;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  height: 34px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  box-shadow: rgba(255,255,255,0.14) 0 0.5px 0 0 inset,
              rgba(0,0,0,0.20) 0 0 0 0.5px inset,
              rgba(0,0,0,0.06) 0 1px 2px 0;
  transition: opacity 80ms ease-in, transform 80ms ease-in;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
}
.btn-dark:hover  { opacity: 0.92; }
.btn-dark:active { opacity: 0.85; transform: scale(0.98); }

.btn-secondary {
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.btn-ghost:hover { background: var(--canvas); color: var(--body-color); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  gap: 3px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.badge-category { background: var(--canvas-mid); color: var(--body-color); }
.badge-open     { background: var(--open-soft);  color: var(--open); }
.badge-closed   { background: var(--closed-soft); color: var(--closed); }
.badge-new      { background: var(--new-badge-soft); color: var(--new-badge); font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.badge-verified { background: var(--teal-pressed); color: #ffffff; font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 9999px; }

/* ── Section header grammar ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-header .eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 2px;
}
.section-header .title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.24;
}
.section-header .action {
  font-size: 12px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  white-space: nowrap;
}
.section-header .action:hover { text-decoration: underline; color: var(--teal-hover); }

/* ── Form inputs ── */
.input-field {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input-field::placeholder { color: var(--muted-soft); }
.input-field:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

/* ── Review body (sacred) ── */
.review-body {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--body-color);
}

/* ── Stars ── */
.star { color: var(--amber); }
.star-empty { color: var(--amber-empty); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  box-shadow: var(--shadow-toast);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  z-index: 9999;
  animation: toast-in 160ms ease-out;
}
@keyframes toast-in {
  from { transform: translateY(5px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* ── Page header (shared atom) ── */
.page-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  height: 44px;
  position: sticky;
  top: 56px;
  z-index: 90;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Pagination ── */
.pagination-btn {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--body-color);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
  text-decoration: none;
}
.pagination-btn:hover   { background: var(--canvas-mid); }
.pagination-btn.active  { background: var(--teal); color: #fff; }
.pagination-btn:disabled { color: var(--muted-soft); cursor: not-allowed; }
