/* =========================================================
   LUMEN DESIGN SYSTEM — Core Tokens
   Dashboard system for productivity, analytics & team mgmt
   ========================================================= */

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

:root {
  /* ============ COLOR — CORE ACTIONS ============ */
  --primary: #507AE9;
  --primary-hover: #3F66D1;   /* darker shade for hover */
  --primary-active: #2E54BA;  /* deeper for active */
  --primary-soft: #E8EEFC;    /* tinted bg for ghost/soft states */
  --primary-soft-2: #D4DEF8;

  --secondary: #E4E4E4;       /* subtle surfaces, dividers */
  --secondary-hover: #D8D8D8;
  --secondary-active: #C8C8C8;

  /* ============ COLOR — SEMANTIC ============ */
  --success: #22AC6A;
  --success-soft: #E3F5EC;
  --success-text: #167A4A;

  --error: #FF5858;
  --error-soft: #FFE6E6;
  --error-text: #C43838;

  --warning: #FEAC00;
  --warning-soft: #FFF3D9;
  --warning-text: #B47800;

  --info: #507AE9;            /* derived from primary */
  --info-soft: #E8EEFC;
  --info-text: #2E54BA;

  /* ============ COLOR — NEUTRALS ============ */
  --bg: #F7F8FA;              /* page background, very light gray */
  --bg-alt: #F1F3F6;          /* alt surface (nested) */
  --surface: #FFFFFF;         /* cards, widgets */
  --surface-raised: #FFFFFF;

  --border: #EDEEF1;          /* hairline */
  --border-strong: #E4E4E4;   /* default */
  --border-focus: #507AE9;

  /* Text */
  --fg-primary: #111418;      /* near black */
  --fg-secondary: #5C6370;    /* medium gray */
  --fg-tertiary: #8A90A0;     /* muted */
  --fg-disabled: #B8BCC7;     /* low contrast */
  --fg-on-primary: #FFFFFF;
  --fg-inverse: #FFFFFF;

  /* ============ ELEVATION / SHADOWS ============ */
  /* Subtle, soft-spread shadows — low blur, low opacity */
  --shadow-xs: 0 1px 2px rgba(17, 20, 24, 0.04);
  --shadow-sm: 0 1px 3px rgba(17, 20, 24, 0.05), 0 1px 2px rgba(17, 20, 24, 0.03);
  --shadow-md: 0 4px 12px rgba(17, 20, 24, 0.06), 0 2px 4px rgba(17, 20, 24, 0.03);
  --shadow-lg: 0 12px 28px rgba(17, 20, 24, 0.08), 0 4px 10px rgba(17, 20, 24, 0.04);
  --shadow-xl: 0 24px 48px rgba(17, 20, 24, 0.10), 0 8px 16px rgba(17, 20, 24, 0.05);
  --shadow-focus: 0 0 0 3px rgba(80, 122, 233, 0.22);
  --shadow-tooltip: 0 8px 24px rgba(17, 20, 24, 0.18);

  /* ============ RADII ============ */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;     /* default buttons, inputs */
  --radius-lg: 12px;    /* default cards */
  --radius-xl: 16px;    /* large surfaces, modals */
  --radius-2xl: 20px;
  --radius-pill: 999px;

  /* ============ SPACING (8pt grid, with 4pt half-steps) ============ */
  --space-0: 0;
  --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;
  --space-16: 64px;
  --space-20: 80px;

  /* ============ TYPOGRAPHY — FAMILIES ============ */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ============ TYPOGRAPHY — SIZES ============ */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;   /* dashboard default — denser than web */
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 36px;

  /* ============ TYPOGRAPHY — LINE HEIGHTS ============ */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* ============ TYPOGRAPHY — WEIGHTS ============ */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ============ LAYOUT ============ */
  --sidebar-width: 240px;
  --sidebar-collapsed: 72px;
  --topbar-height: 64px;
  --right-panel-width: 320px;

  /* ============ MOTION ============ */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur-med: 200ms;
  --dur-slow: 320ms;
}

/* =========================================================
   SEMANTIC TYPE STYLES
   ========================================================= */

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.h1, h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--fg-primary);
  margin: 0;
}

.h2, h2 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  color: var(--fg-primary);
  margin: 0;
}

.h3, h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  color: var(--fg-primary);
  margin: 0;
}

.h4, h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--fg-primary);
  margin: 0;
}

.subtitle {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--fg-secondary);
  line-height: var(--leading-snug);
}

.body, p {
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--fg-primary);
  margin: 0;
}

.caption {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--fg-tertiary);
  line-height: var(--leading-snug);
  letter-spacing: 0.01em;
}

.overline {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-tertiary);
}

.kpi-number {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg-primary);
  font-variant-numeric: tabular-nums;
}

code, .code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}
