/* ============================================================
   CKP Design System — Color & Typography Tokens
   Stack: shadcn/ui + Tailwind CSS (stone palette), Inter font
   ============================================================ */

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

/* ── Base Tokens ── */
:root {
  /* --- Colors: Neutrals (Stone palette) --- */
  --stone-50:  #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;

  /* --- Colors: Blue accent (Tailwind blue) --- */
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  /* --- Colors: Status --- */
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --red-400:   #f87171;
  --red-500:   #ef4444;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --teal-500:  #14b8a6;
  --teal-600:  #0d9488;

  /* --- Semantic: Surfaces --- */
  --bg-page:       var(--stone-50);
  --bg-surface:    #ffffff;
  --bg-sidebar:    #ffffff;
  --bg-header:     #ffffff;
  --bg-hover:      var(--stone-50);
  --bg-muted:      var(--stone-100);

  /* --- Semantic: Borders --- */
  --border:        var(--stone-200);
  --border-strong: var(--stone-300);

  /* --- Semantic: Text --- */
  --fg-1:     var(--stone-900);   /* primary text */
  --fg-2:     var(--stone-600);   /* secondary text */
  --fg-3:     var(--stone-500);   /* muted / captions */
  --fg-4:     var(--stone-400);   /* placeholder / disabled */
  --fg-link:  var(--blue-600);

  /* --- Semantic: Accent --- */
  --accent:         var(--blue-600);
  --accent-hover:   var(--blue-700);
  --accent-subtle:  var(--blue-50);
  --accent-border:  var(--blue-200);

  /* --- Semantic: Status --- */
  --color-positive:   var(--green-500);
  --color-negative:   var(--red-500);
  --color-warning:    var(--amber-500);
  --color-health:     var(--green-500);

  /* --- Chart Palette --- */
  --chart-1: #1d4ed8;
  --chart-2: #60a5fa;
  --chart-3: #93c5fd;
  --chart-4: #0d9488;
  --chart-5: #5eead4;
  --chart-6: #d97706;
  --chart-7: #f87171;
  --chart-8: #a78bfa;

  /* --- Avatar Palette --- */
  --avatar-teal:   #0d9488;
  --avatar-green:  #16a34a;
  --avatar-amber:  #d97706;
  --avatar-blue:   #2563eb;
  --avatar-rose:   #e11d48;
  --avatar-violet: #7c3aed;
  --avatar-orange: #ea580c;

  /* ── Typography ── */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;

  /* --- Type scale --- */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-stat: 32px;

  /* --- Line heights --- */
  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.5;

  /* --- Font weights --- */
  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

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

  /* ── Layout ── */
  --sidebar-width:    48px;
  --topbar-height:    48px;
  --content-padding:  var(--space-6);
  --card-padding:     var(--space-4);

  /* ── Radii ── */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-none: none;
  /* CKP uses flat card design — no shadows, border only */
}

/* ── Semantic HTML Defaults ── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

h1 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--fg-1);
}

h2 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--fg-1);
}

h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--fg-1);
}

p {
  font-size: var(--text-base);
  color: var(--fg-2);
  line-height: var(--leading-normal);
}

small, .caption {
  font-size: var(--text-xs);
  color: var(--fg-3);
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ── Utility classes ── */
.text-primary   { color: var(--fg-1); }
.text-secondary { color: var(--fg-2); }
.text-muted     { color: var(--fg-3); }
.text-accent    { color: var(--accent); }
.text-positive  { color: var(--color-positive); }
.text-negative  { color: var(--color-negative); }

.bg-surface  { background: var(--bg-surface); }
.bg-page     { background: var(--bg-page); }
.bg-muted    { background: var(--bg-muted); }

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