/* ── Google Font: Inter ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:         #7C3AED;
  --primary-hover:   #6D28D9;
  --primary-light:   #EDE9FE;
  --primary-50:      #F5F3FF;
  --accent:          #EC4899;
  --accent-light:    #FCE7F3;

  /* Neutrals */
  --bg:              #F7F8FA;
  --surface:         #FFFFFF;
  --surface-2:       #F9FAFB;
  --border:          #E5E7EB;
  --border-soft:     #F3F4F6;

  /* Text */
  --text-900:        #0F172A;
  --text-700:        #374151;
  --text-500:        #6B7280;
  --text-300:        #9CA3AF;

  /* Semantic */
  --green:           #10B981;
  --green-bg:        #ECFDF5;
  --green-text:      #065F46;
  --blue:            #3B82F6;
  --blue-bg:         #EFF6FF;
  --blue-text:       #1E40AF;
  --orange:          #F59E0B;
  --orange-bg:       #FFFBEB;
  --orange-text:     #92400E;
  --red:             #EF4444;
  --red-bg:          #FEF2F2;
  --red-text:        #991B1B;

  /* Layout */
  --sidebar-w:       320px;
  --header-h:        75px;
  --radius-sm:       6px;
  --radius:          10px;
  --radius-lg:       14px;
  --radius-xl:       18px;

  /* Shadows */
  --shadow-xs:       0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:          0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md:       0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg:       0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
  --shadow-primary:  0 4px 14px rgba(124,58,237,0.25);

  /* Transitions */
  --t:               150ms ease;
  --t-slow:          250ms ease;

  /* ── Typography Scale ─────────────────────────────────────────────────────
   * Root: 16px (browser standard, WCAG-aligned, matches Material / Apple HIG).
   * Rule: NEVER hardcode font-size in px. Use these variables or rem only.
   *
   *  Token      │  rem       │  px@16px  │  Intended use
   * ────────────┼────────────┼───────────┼───────────────────────────────────
   *  --fs-2xs   │  0.625rem  │  10px     │  Tiny badges, inline counters
   *  --fs-xs    │  0.6875rem │  11px     │  Timestamps, metadata, tag text
   *  --fs-sm    │  0.75rem   │  12px     │  Sub-labels, hints, breadcrumbs
   *  --fs-base  │  0.8125rem │  13px     │  Body text, table cells, nav sub
   *  --fs-md    │  0.875rem  │  14px     │  Primary body, nav items, inputs
   *  --fs-lg    │  1rem      │  16px     │  Card titles, section headings
   *  --fs-xl    │  1.125rem  │  18px     │  Module headings, prominent labels
   *  --fs-2xl   │  1.375rem  │  22px     │  Page titles, dashboard headings
   *  --fs-3xl   │  1.75rem   │  28px     │  KPI values, large stat numbers
   * ──────────────────────────────────────────────────────────────────────── */
  --fs-2xs:    0.625rem;
  --fs-xs:     0.6875rem;
  --fs-sm:     0.75rem;
  --fs-base:   0.8125rem;
  --fs-md:     0.875rem;
  --fs-lg:     1rem;
  --fs-xl:     1.125rem;
  --fs-2xl:    1.375rem;
  --fs-3xl:    1.75rem;

  /* Font Weights */
  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;

  /* Line Heights */
  --lh-tight:   1.1;
  --lh-snug:    1.3;
  --lh-normal:  1.5;
  --lh-relaxed: 1.6;
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-900);
  height: 100vh;
  overflow: hidden;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { display: block; }

/* ── App Shell ────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex-shrink: 0;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 10;
  text-decoration: none;
}

.logo-icon {
  width: 48px; height: 48px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.logo-text .name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-900);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.logo-text .sub {
  font-size: 0.7rem;
  color: var(--text-300);
  font-weight: 500;
  margin-top: 1px;
}

/* Nav */
.sidebar-nav { padding: 14px 0 28px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-500);
  transition: background var(--t), color var(--t);
  cursor: pointer;
  user-select: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text-700); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-item .nav-icon { font-size: 0.9rem; width: 22px; text-align: center; flex-shrink: 0; }

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-300);
  padding: 19px 30px 7px;
}

/* Collapsible category */
.nav-category-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-500);
  background: none;
  border: none;
  width: calc(100% - 20px);
  text-align: left;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  user-select: none;
}
.nav-category-toggle:hover { background: var(--surface-2); color: var(--text-700); }
.nav-category-toggle.open { color: var(--text-700); }
.nav-category-toggle .nav-icon { font-size: 0.9rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-category-toggle .chevron {
  margin-left: auto;
  font-size: 0.55rem;
  transition: transform var(--t-slow);
  opacity: 0.6;
}
.nav-category-toggle.open .chevron { transform: rotate(180deg); }

.nav-sub-items { display: none; }
.nav-category.open .nav-sub-items { display: block; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 18px 8px 50px;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-500);
  transition: background var(--t), color var(--t);
  cursor: pointer;
}
.nav-sub-item:hover { background: var(--surface-2); color: var(--text-700); }
.nav-sub-item.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-divider { height: 1px; background: var(--border-soft); margin: 11px 24px; }

/* ── Main content ─────────────────────────────────────────────── */
.main-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}

/* Topbar */
.topbar {
  height: var(--header-h);
  min-height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  gap: 22px;
  flex-shrink: 0;
}

.topbar-left { display: flex; align-items: center; gap: 11px; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-300); }
.topbar-breadcrumb .sep { opacity: 0.5; }
.topbar-breadcrumb .current { color: var(--text-700); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: 16px; }

.topbar-icon-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.08rem;
  color: var(--text-500);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.topbar-icon-btn:hover { background: var(--surface-2); color: var(--text-700); }

.topbar-user {
  display: flex; align-items: center; gap: 14px;
  padding: 7px 14px 7px 7px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--t);
}
.topbar-user:hover { background: var(--surface-2); }

.user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700;
  flex-shrink: 0;
}
.user-info .user-name { font-size: 0.94rem; font-weight: 600; color: var(--text-700); }
.user-info .user-plan { font-size: 0.82rem; color: var(--text-300); }

.logout-link {
  font-size: 0.865rem;
  color: var(--text-300);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}
.logout-link:hover { color: var(--red); background: var(--red-bg); }

/* Page scroll area */
.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 40px 44px 56px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Page title row ───────────────────────────────────────────── */
.page-title-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px; gap: 22px;
}
.page-title {
  font-size: var(--fs-2xl); font-weight: var(--fw-bold);
  color: var(--text-900); letter-spacing: -0.02em;
  line-height: var(--lh-tight);
}
.page-subtitle { font-size: var(--fs-base); color: var(--text-500); margin-top: 6px; }

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; color: var(--text-300);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-300); transition: color var(--t); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { font-size: 0.84rem; opacity: 0.5; }
.breadcrumb .current { color: var(--text-700); font-weight: 500; }

/* ── Stat Cards ───────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 28px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-slow), transform var(--t-slow);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.stat-label {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-300);
  margin-bottom: 11px;
}
.stat-value {
  font-size: var(--fs-3xl); font-weight: var(--fw-extrabold);
  color: var(--text-900);
  letter-spacing: -0.03em; line-height: var(--lh-tight);
}
.stat-sub {
  font-size: var(--fs-sm); color: var(--text-300);
  margin-top: 8px; display: flex; align-items: center; gap: 5px;
}
.stat-sub.up { color: var(--green); }
.stat-sub.up::before { content: '↑'; }

.stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--blue-bg); }
.stat-icon.green  { background: var(--green-bg); }
.stat-icon.purple { background: var(--primary-light); }
.stat-icon.orange { background: var(--orange-bg); }

/* ── Quick Actions ────────────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 19px; margin-bottom: 28px; }

.quick-btn {
  padding: 22px 28px;
  border-radius: var(--radius-lg);
  border: none;
  font-size: 1.05rem; font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  text-decoration: none;
  transition: filter var(--t), transform var(--t);
  box-shadow: var(--shadow-sm);
}
.quick-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.quick-btn:active { transform: translateY(0); }
.quick-btn.purple { background: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%); }
.quick-btn.teal   { background: linear-gradient(135deg, #0284C7 0%, #06B6D4 100%); }
.quick-btn.green  { background: linear-gradient(135deg, #059669 0%, #10B981 100%); }
.quick-btn-label { display: flex; flex-direction: column; gap: 3px; }
.quick-btn-sub { font-size: 0.82rem; font-weight: 400; opacity: 0.8; }
.quick-btn-arrow {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.96rem; flex-shrink: 0;
}

/* ── Card ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 22px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.card-title  { font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-900); letter-spacing: -0.01em; }
.card-subtitle { font-size: var(--fs-sm); color: var(--text-300); margin-top: 3px; }

/* ── Activity List ────────────────────────────────────────────── */
.activity-list { }

.activity-item {
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-soft);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 48px; height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.activity-dot.blue   { background: var(--blue-bg); }
.activity-dot.green  { background: var(--green-bg); }
.activity-dot.orange { background: var(--orange-bg); }
.activity-dot.purple { background: var(--primary-light); }

.activity-info { flex: 1; min-width: 0; }
.activity-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-sub   { font-size: var(--fs-sm); color: var(--text-300); margin-top: 2px; }

.progress-bar-wrap { margin-top: 10px; height: 5px; background: var(--border-soft); border-radius: 99px; overflow: hidden; }
.progress-bar      { height: 100%; border-radius: 99px; transition: width 0.8s cubic-bezier(.4,0,.2,1); }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  white-space: nowrap; letter-spacing: 0.01em;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; }

.badge-green  { background: var(--green-bg);  color: var(--green-text); }
.badge-green .badge-dot  { background: var(--green); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue-text); }
.badge-blue .badge-dot   { background: var(--blue); }
.badge-orange { background: var(--orange-bg); color: var(--orange-text); }
.badge-orange .badge-dot { background: var(--orange); }
.badge-gray   { background: var(--surface-2); color: var(--text-500); }
.badge-gray .badge-dot   { background: var(--text-300); }
.badge-red    { background: var(--red-bg);    color: var(--red-text); }
.badge-red .badge-dot    { background: var(--red); }

/* ── Marketplace ──────────────────────────────────────────────── */
.marketplace-hero {
  background: linear-gradient(130deg, #5B21B6 0%, #7C3AED 40%, #EC4899 100%);
  border-radius: var(--radius-xl);
  padding: 56px 60px;
  margin-bottom: 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.marketplace-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.marketplace-hero::after {
  content: '';
  position: absolute;
  bottom: -80px; right: 120px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.marketplace-hero-inner { display: flex; align-items: flex-start; gap: 24px; position: relative; z-index: 1; }

.hero-icon-wrap {
  width: 78px; height: 78px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 19px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
  backdrop-filter: blur(10px);
}

.hero-content { flex: 1; }
.hero-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; margin-bottom: 6px; }
.marketplace-hero h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; line-height: 1.15; }
.marketplace-hero p  { font-size: 0.85rem; opacity: 0.85; line-height: 1.6; max-width: 520px; }

.hero-stats {
  display: flex; gap: 0; margin-top: 32px;
  background: rgba(0,0,0,0.15);
  border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  width: fit-content;
}
.hero-stat {
  padding: 16px 30px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.hero-stat:last-child { border-right: none; }
.hero-stat .val { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.hero-stat .lbl { font-size: 0.65rem; opacity: 0.7; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.05em; }

.hero-search-wrap { margin-left: auto; flex-shrink: 0; position: relative; z-index: 1; }
.hero-search {
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 14px 22px;
  backdrop-filter: blur(10px);
}
.hero-search input {
  background: none; border: none; outline: none;
  color: #fff; font-size: 0.825rem; width: 260px;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.55); }
.hero-search-icon { opacity: 0.7; font-size: 0.85rem; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.filter-tab {
  padding: 8px 19px;
  border-radius: 99px;
  font-size: 0.78rem; font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-500);
  cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.filter-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.filter-count {
  background: rgba(255,255,255,0.25);
  padding: 2px 8px; border-radius: 99px;
  font-size: 0.65rem; font-weight: 700;
}
.filter-tab:not(.active) .filter-count { background: var(--border-soft); color: var(--text-300); }

/* Service Grid */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex; flex-direction: column;
  transition: box-shadow var(--t-slow), border-color var(--t-slow), transform var(--t-slow);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #C4B5FD;
  transform: translateY(-2px);
}

.popular-badge {
  position: absolute; top: 19px; right: 19px;
  background: linear-gradient(135deg, #FF6B2B, #FF3B6B);
  color: #fff; font-size: 0.63rem; font-weight: 700;
  padding: 4px 12px; border-radius: 99px;
  display: flex; align-items: center; gap: 4px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(255,59,107,0.35);
}

.service-card-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 19px; }

.svc-icon {
  width: 58px; height: 58px;
  border-radius: 14px;
  background: var(--primary-50);
  border: 1px solid var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
}

.svc-name  { font-size: 0.9rem; font-weight: 700; color: var(--text-900); line-height: 1.3; letter-spacing: -0.01em; }
.svc-cat   { font-size: 0.65rem; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.svc-desc  { font-size: 0.75rem; color: var(--text-300); margin-top: 3px; line-height: 1.5; }

.svc-features { list-style: none; margin: 16px 0; flex: 1; display: flex; flex-direction: column; gap: 7px; }
.svc-features li {
  font-size: 0.75rem; color: var(--text-500);
  display: flex; align-items: center; gap: 10px;
}
.svc-features li::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  opacity: 0.6;
}

.svc-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 22px; padding-top: 19px;
  border-top: 1px solid var(--border-soft);
}
.svc-price .from  { font-size: 0.65rem; color: var(--text-300); text-transform: uppercase; letter-spacing: 0.04em; }
.svc-price .amount { font-size: 0.95rem; font-weight: 700; color: var(--text-900); letter-spacing: -0.01em; }

.svc-link {
  font-size: 0.75rem; color: var(--primary); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  background: var(--primary-50);
  transition: background var(--t), color var(--t);
}
.svc-link:hover { background: var(--primary-light); }

/* ── Service Detail ───────────────────────────────────────────── */
.service-header {
  display: flex; align-items: center; gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 38px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-xs);
}
.svc-icon-lg {
  width: 80px; height: 80px;
  border-radius: 19px;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-light));
  border: 1px solid var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; flex-shrink: 0;
}
.service-header-info h1 {
  font-size: 1.25rem; font-weight: 700;
  color: var(--text-900); letter-spacing: -0.02em;
}
.service-header-info p { font-size: 0.8rem; color: var(--text-300); margin-top: 4px; }
.service-header-info .svc-cat { margin-bottom: 4px; }
.header-actions { margin-left: auto; display: flex; gap: 10px; }

/* Tabs */
.tabs {
  display: flex; gap: 3px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.tab-btn {
  padding: 14px 22px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-300);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: color var(--t), border-color var(--t);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-700); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Mini stat cards */
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 19px; margin-bottom: 28px; }
.mini-stat-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform var(--t-slow);
}
.mini-stat-card:hover { transform: translateY(-1px); }

.mini-stat-card.blue   { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); border: 1px solid #BFDBFE; }
.mini-stat-card.green  { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); border: 1px solid #A7F3D0; }
.mini-stat-card.purple { background: linear-gradient(135deg, #F5F3FF, #EDE9FE); border: 1px solid #DDD6FE; }
.mini-stat-card.orange { background: linear-gradient(135deg, #FFFBEB, #FEF3C7); border: 1px solid #FDE68A; }

.ms-label {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px;
}
.mini-stat-card.blue .ms-label   { color: var(--blue-text); }
.mini-stat-card.green .ms-label  { color: var(--green-text); }
.mini-stat-card.purple .ms-label { color: var(--primary-hover); }
.mini-stat-card.orange .ms-label { color: var(--orange-text); }

.ms-value {
  font-size: 1.6rem; font-weight: 800;
  line-height: 1; letter-spacing: -0.03em;
}
.mini-stat-card.blue .ms-value   { color: #1D4ED8; }
.mini-stat-card.green .ms-value  { color: #059669; }
.mini-stat-card.purple .ms-value { color: var(--primary); }
.mini-stat-card.orange .ms-value { color: #B45309; }
.ms-sub { font-size: 0.7rem; color: var(--text-300); margin-top: 7px; }

/* Campaign row */
.campaign-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--border-soft);
  gap: 22px;
}
.campaign-row:last-child { border-bottom: none; }
.campaign-name { font-size: 0.825rem; font-weight: 600; color: var(--text-900); }
.campaign-meta { font-size: 0.72rem; color: var(--text-300); margin-top: 3px; }

/* Chart */
.chart-wrap {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  min-height: 244px;
  display: flex; align-items: center; justify-content: center;
}
.chart-svg { width: 100%; overflow: visible; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 22px; }
.form-label {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--text-700); display: block; margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-md); color: var(--text-900);
  background: var(--surface);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  line-height: 1.6;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.form-input::placeholder { color: var(--text-300); }
.form-textarea { resize: vertical; min-height: 136px; }
.form-select { cursor: pointer; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base); font-weight: var(--fw-semibold);
  border: none; cursor: pointer;
  transition: all var(--t);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 14px rgba(124,58,237,0.35); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-700);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.btn-ghost { background: transparent; color: var(--text-500); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-700); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 7px 14px; font-size: var(--fs-sm); }
.btn-lg { padding: 15px 30px; font-size: var(--fs-lg); }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }

table.data-table thead th {
  background: var(--surface-2);
  padding: 14px 19px; text-align: left;
  font-weight: var(--fw-semibold); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-300);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 15px 19px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-700);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: var(--surface-2); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ── Support ──────────────────────────────────────────────────── */
.support-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }

.ticket-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--border-soft);
}
.ticket-item:last-child { border-bottom: none; }

.ticket-status-dot {
  width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; flex-shrink: 0;
}
.ticket-status-dot.open        { background: var(--orange); }
.ticket-status-dot.in_progress { background: var(--blue); }
.ticket-status-dot.resolved    { background: var(--green); }
.ticket-status-dot.closed      { background: var(--text-300); }

/* ── Reports Grid ─────────────────────────────────────────────── */
.reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }

/* ── Login ────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 20%, #EDE9FE 0%, #FCE7F3 40%, #F7F8FA 80%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 60px 54px;
  width: 100%; max-width: 520px;
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 44px;
}
.login-logo .logo-icon { width: 54px; height: 54px; border-radius: 13px; font-size: 1.1rem; }
.login-logo .name { font-size: 1rem; font-weight: 800; color: var(--text-900); letter-spacing: -0.02em; }
.login-logo .sub  { font-size: 0.7rem; color: var(--text-300); margin-top: 1px; }

.login-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.login-sub   { font-size: 0.8rem; color: var(--text-300); margin-bottom: 38px; line-height: 1.6; }

.error-msg {
  background: var(--red-bg);
  color: var(--red-text);
  border: 1px solid #FCA5A5;
  padding: 14px 19px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 500;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 11px;
}

.login-submit {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--primary), #9333EA);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: var(--shadow-primary);
  transition: opacity var(--t), transform var(--t);
  letter-spacing: 0.01em;
}
.login-submit:hover { opacity: 0.92; transform: translateY(-1px); }

.login-demo {
  text-align: center; margin-top: 28px;
  padding: 14px 19px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  font-size: 0.72rem; color: var(--text-300);
}
.login-demo code { color: var(--primary); font-weight: 600; }

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 66px 28px;
  color: var(--text-300); font-size: 0.8rem;
}
.empty-icon { font-size: 2.2rem; margin-bottom: 14px; opacity: 0.6; }
.empty-state p { max-width: 356px; margin: 0 auto; line-height: 1.6; }

/* ── Misc Utils ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-soft); border: none; margin: 22px 0; }
.text-muted   { color: var(--text-300); }
.text-primary { color: var(--primary); }
.fw-700 { font-weight: 700; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 11px; }
.justify-between { justify-content: space-between; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-300); }

/* ── Animations ───────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-body { animation: fadeIn 0.25s ease; }

/* ── Responsive ───────────────────────────────────────────────── */
/* Root font-size steps — all rem-based components scale automatically */
@media (max-width: 1400px) {
  html { font-size: 15px; }
}
@media (max-width: 1100px) {
  html { font-size: 14px; }
}
/* Below 768px the sidebar is hidden — restore 15px for comfortable reading */
@media (max-width: 768px) {
  html { font-size: 15px; }
}

@media (max-width: 1200px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .reports-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
  .page-body { padding: 28px 22px; }
}

/* ── Sidebar nested sub-category (Loyalty sub-menu) ──────────── */
.nav-sub-category { margin: 2px 0; }
.nav-sub-category-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 50px;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-500);
  background: none;
  border: none;
  width: calc(100% - 20px);
  text-align: left;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.nav-sub-category-toggle:hover { background: var(--surface-2); color: var(--text-700); }
.nav-sub-category-toggle .chevron-sm { margin-left: auto; font-size: 0.55rem; opacity: 0.6; transition: transform var(--t-slow); }
.nav-sub-category-toggle.open .chevron-sm { transform: rotate(90deg); }
.nav-sub-sub-items { display: none; }
.nav-sub-category-toggle.open + .nav-sub-sub-items { display: block; }
.nav-deep-item { padding-left: 74px !important; font-size: 0.775rem !important; }

/* ── Loyalty & Reward color accents ──────────────────────────── */
.loyalty-earn  { color: #059669; }
.loyalty-redeem { color: #dc2626; }
.loyalty-purple { color: #7c3aed; }

/* ── Typography Utility Classes ──────────────────────────────── */
/* Font size scale — mirrors the --fs-* design tokens above.     */
/* Use these in templates instead of inline font-size styles.    */
.text-2xs  { font-size: var(--fs-2xs) !important; }   /* 10px — tiny badges */
.text-xs   { font-size: var(--fs-xs)  !important; }   /* 11px — meta / timestamps */
.text-sm   { font-size: var(--fs-sm)  !important; }   /* 12px — sub-labels */
.text-base { font-size: var(--fs-base)!important; }   /* 13px — body text */
.text-md   { font-size: var(--fs-md)  !important; }   /* 14px — inputs / nav */
.text-lg   { font-size: var(--fs-lg)  !important; }   /* 16px — card titles */
.text-xl   { font-size: var(--fs-xl)  !important; }   /* 18px — module headings */
.text-2xl  { font-size: var(--fs-2xl) !important; }   /* 22px — page titles */
.text-3xl  { font-size: var(--fs-3xl) !important; }   /* 28px — KPI values */

/* Font weight utilities */
.fw-regular   { font-weight: var(--fw-regular); }
.fw-medium    { font-weight: var(--fw-medium); }
.fw-semibold  { font-weight: var(--fw-semibold); }
.fw-bold      { font-weight: var(--fw-bold); }
.fw-extrabold { font-weight: var(--fw-extrabold); }

/* Line height utilities */
.lh-tight   { line-height: var(--lh-tight); }
.lh-snug    { line-height: var(--lh-snug); }
.lh-normal  { line-height: var(--lh-normal); }
.lh-relaxed { line-height: var(--lh-relaxed); }

/* Semantic text helpers (combine size + color + weight) */
.text-meta     { font-size: var(--fs-xs);  color: var(--text-300); }
.text-label    { font-size: var(--fs-sm);  font-weight: var(--fw-semibold); color: var(--text-700); }
.text-label-upper { font-size: var(--fs-xs); font-weight: var(--fw-bold);
                    text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-300); }
.text-body     { font-size: var(--fs-base); color: var(--text-700); line-height: var(--lh-relaxed); }
.text-heading  { font-size: var(--fs-lg);  font-weight: var(--fw-bold); color: var(--text-900); }
.text-kpi      { font-size: var(--fs-3xl); font-weight: var(--fw-extrabold);
                 letter-spacing: -0.03em; line-height: var(--lh-tight); color: var(--text-900); }
