/* ============================================
   LICORNE — Shadcn-inspired design system
   Restrained neutrals, hairline borders, no gradients.
   ============================================ */

:root {
  /* Shadcn tokens — slate/zinc neutral */
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;

  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;

  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;

  --muted: 240 4.8% 96.5%;
  --muted-foreground: 240 3.8% 46.1%;

  --subtle: 240 5% 98.4%;

  --border: 240 5.9% 91%;
  --border-strong: 240 5.9% 84%;
  --input: 240 5.9% 91%;
  --ring: 240 5% 64.9%;

  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;

  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;

  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;

  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 98%;

  --success: 142 71% 36%;
  --warning: 38 92% 40%;

  /* radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;

  /* layout */
  --sidebar-w: 232px;
  --topbar-h: 56px;
  --content-max: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(var(--border-strong)); border-radius: 10px; border: 2px solid hsl(var(--background)); }

/* tabular numbers for data */
.tabular { font-variant-numeric: tabular-nums; }

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

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: hsl(var(--background));
  border-right: 1px solid hsl(var(--border));
  padding: 12px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 16px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.sidebar-logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-section { display: flex; flex-direction: column; gap: 1px; margin-top: 16px; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.1s ease, color 0.1s ease;
}

.nav-item:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.nav-item.active {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-weight: 500;
}

.nav-item svg { color: hsl(var(--muted-foreground)); }
.nav-item.active svg { color: hsl(var(--foreground)); }

.nav-item .badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}

.sidebar-footer-card {
  padding: 10px;
  border-radius: var(--radius);
  background: hsl(var(--subtle));
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(8px);
  z-index: 50;
}

.topbar-search {
  flex: 1;
  max-width: 380px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
  font-size: 13px;
  outline: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.topbar-search input::placeholder { color: hsl(var(--muted-foreground)); }

.topbar-search input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--muted));
}

.topbar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

.kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 5px;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  font-family: ui-monospace, monospace;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: hsl(var(--muted-foreground));
  position: relative;
  transition: background 0.1s ease;
}

.icon-btn:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: hsl(var(--destructive));
  border: 1.5px solid hsl(var(--background));
  border-radius: 50%;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s ease;
}

.profile-chip:hover { background: hsl(var(--muted)); }

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 11px;
  flex-shrink: 0;
}

.avatar.sm { width: 20px; height: 20px; font-size: 10px; }
.avatar.md { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 72px; height: 72px; font-size: 22px; }

.avatar-square {
  border-radius: var(--radius-sm);
}

.profile-chip-name { font-weight: 500; font-size: 13px; }

.content {
  padding: 32px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

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

.page-header { margin-bottom: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 13.5px;
  margin-top: 4px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--muted-foreground));
  font-size: 12.5px;
  margin-bottom: 16px;
}

.breadcrumb a:hover { color: hsl(var(--foreground)); }

.eyebrow {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.1s ease, border-color 0.1s ease, opacity 0.1s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover { background: hsl(var(--primary) / 0.9); }

.btn-secondary {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.btn-secondary:hover { background: hsl(var(--muted)); }

.btn-ghost { color: hsl(var(--muted-foreground)); }
.btn-ghost:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 32px; padding: 0; }

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

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-description {
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

.card-link {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  font-size: 12.5px;
}

.card-link:hover { color: hsl(var(--foreground)); }

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.stat-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 4px;
  color: hsl(var(--muted-foreground));
}

.trend-up { color: hsl(var(--success)); }
.trend-down { color: hsl(var(--destructive)); }

/* ============================================
   CAMPAIGN CARDS — minimal
   ============================================ */

.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.campaign-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.12s ease, background 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.campaign-card:hover { border-color: hsl(var(--border-strong)); background: hsl(var(--subtle)); }

.campaign-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.brand-mark.dark {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.campaign-card-brand-name {
  font-size: 13px;
  font-weight: 500;
}

.campaign-card-category {
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  margin-top: 1px;
}

.campaign-card-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: hsl(var(--success));
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.campaign-card-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: hsl(var(--success));
  border-radius: 50%;
}

.campaign-card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: hsl(var(--foreground));
}

.campaign-card-platforms {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.platform-icon {
  width: 14px;
  height: 14px;
  color: hsl(var(--muted-foreground));
}

.campaign-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid hsl(var(--border));
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

.campaign-card-meta strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}

/* ============================================
   TABLES
   ============================================ */

.table-wrapper {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: 10px 16px;
  background: hsl(var(--subtle));
  border-bottom: 1px solid hsl(var(--border));
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: hsl(var(--subtle)); }

td.tabular, th.tabular { font-variant-numeric: tabular-nums; }

/* ============================================
   STATUS BADGES — text + dot only
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-success { color: hsl(var(--success)); border-color: hsl(var(--success) / 0.2); background: hsl(var(--success) / 0.08); }
.badge-warning { color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.2); background: hsl(var(--warning) / 0.08); }
.badge-destructive { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.2); background: hsl(var(--destructive) / 0.08); }
.badge-info { color: hsl(220 70% 45%); border-color: hsl(220 70% 45% / 0.2); background: hsl(220 70% 45% / 0.08); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

/* ============================================
   PROGRESS
   ============================================ */

.progress {
  width: 100%;
  height: 4px;
  background: hsl(var(--muted));
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: hsl(var(--foreground));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-bar.success { background: hsl(var(--success)); }

/* ============================================
   FORMS
   ============================================ */

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-hint {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-top: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--muted));
}

.form-input::placeholder, .form-textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

.form-textarea { resize: vertical; min-height: 92px; font-family: inherit; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Toggle pills */
.pill-group { display: inline-flex; gap: 4px; padding: 2px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); background: hsl(var(--subtle)); }

.pill-group .pill {
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background 0.12s ease, color 0.12s ease;
}

.pill-group .pill:hover { color: hsl(var(--foreground)); }
.pill-group .pill.active { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

/* Multi-select pills (standalone, not in a segmented group) */
.pill-multi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-multi .pill {
  padding: 5px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
  font-size: 12.5px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: all 0.1s ease;
}

.pill-multi .pill:hover { border-color: hsl(var(--border-strong)); color: hsl(var(--foreground)); }
.pill-multi .pill.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

/* Wizard */
.wizard-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }

.wizard-step { display: flex; align-items: center; gap: 8px; }

.wizard-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 12px;
  flex-shrink: 0;
  border: 1px solid hsl(var(--border));
}

.wizard-step.active .wizard-step-num { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.wizard-step.done .wizard-step-num { background: hsl(var(--background)); color: hsl(var(--foreground)); border-color: hsl(var(--foreground)); }

.wizard-step-label { font-size: 12.5px; font-weight: 500; color: hsl(var(--muted-foreground)); }
.wizard-step.active .wizard-step-label, .wizard-step.done .wizard-step-label { color: hsl(var(--foreground)); }

.wizard-step-line { flex: 1; height: 1px; background: hsl(var(--border)); }
.wizard-step.done + .wizard-step-line { background: hsl(var(--foreground)); }

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .form-select {
  width: auto;
  padding: 6px 28px 6px 10px;
  font-size: 12.5px;
  height: 32px;
}

/* ============================================
   TABS — clean Shadcn style
   ============================================ */

.tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--subtle));
  gap: 1px;
  margin-bottom: 20px;
}

.tab {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover { color: hsl(var(--foreground)); }
.tab.active { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

.tab-count {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

/* underline tabs (alternative) */
.tabs-underline {
  display: flex;
  border-bottom: 1px solid hsl(var(--border));
  gap: 4px;
  margin-bottom: 24px;
}

.tabs-underline .tab {
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  background: none !important;
  box-shadow: none !important;
}

.tabs-underline .tab.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--foreground));
}

/* ============================================
   SPLIT GRID (campaign detail)
   ============================================ */

.split-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1024px) {
  .split-grid { grid-template-columns: 1fr; }
}

/* ============================================
   AI VALIDATION
   ============================================ */

.ai-checks { display: flex; flex-direction: column; gap: 4px; }

.ai-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 8px 0;
  color: hsl(var(--foreground));
}

.check-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.ai-check-row.pass .check-dot { background: hsl(var(--success)); color: white; }
.ai-check-row.fail .check-dot { background: hsl(var(--destructive)); color: white; }
.ai-check-row.pending .check-dot { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.ai-check-row .meta { margin-left: auto; font-size: 12px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }

/* ============================================
   LEADERBOARD
   ============================================ */

.leaderboard-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto auto;
  gap: 20px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 13px;
}

.leaderboard-row:last-child { border-bottom: none; }
.leaderboard-row:hover { background: hsl(var(--subtle)); }

.rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 12px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

.rank.top-1 { background: hsl(var(--foreground)); color: hsl(var(--background)); }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-name { font-weight: 500; font-size: 13px; }
.user-cell-handle { font-size: 12px; color: hsl(var(--muted-foreground)); }

.metric-cell { text-align: right; min-width: 80px; }
.metric-cell-label { font-size: 11px; color: hsl(var(--muted-foreground)); margin-bottom: 1px; }
.metric-cell-value { font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ============================================
   CHARTS
   ============================================ */

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding: 12px 0;
}

.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }

.chart-bar {
  width: 100%;
  background: hsl(var(--foreground));
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: opacity 0.2s ease;
}

.chart-bar:hover { opacity: 0.7; }
.chart-bar.muted { background: hsl(var(--border-strong)); }

.chart-bar-label { font-size: 10.5px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }

/* ============================================
   MODAL
   ============================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: hsl(var(--foreground) / 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-backdrop.open { display: flex; }

.modal {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal-desc { font-size: 13px; color: hsl(var(--muted-foreground)); margin-top: 2px; }

/* ============================================
   ALERTS (callouts)
   ============================================ */

.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--subtle));
  font-size: 13px;
}

.alert-icon { color: hsl(var(--muted-foreground)); flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 500; margin-bottom: 2px; }
.alert-desc { color: hsl(var(--muted-foreground)); font-size: 12.5px; }

.alert-success { background: hsl(var(--success) / 0.05); border-color: hsl(var(--success) / 0.2); }
.alert-success .alert-icon { color: hsl(var(--success)); }

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

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.muted { color: hsl(var(--muted-foreground)); }
.success { color: hsl(var(--success)); }
.danger { color: hsl(var(--destructive)); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.text-base { font-size: 13.5px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 32px; }
.tracking-tight { letter-spacing: -0.02em; }

.divider { height: 1px; background: hsl(var(--border)); margin: 12px 0; }
.divider-vert { width: 1px; background: hsl(var(--border)); align-self: stretch; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.w-full { width: 100%; }
.flex-1 { flex: 1; }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
