/* ==========================================================================
   Design Tokens — CRM Design System
   All colors, spacing, radii, shadows and typography scales live here.
   Switching theme = swapping the token values under [data-theme].
   ========================================================================== */

:root {
  /* Brand */
  --primary-h: 262;
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --primary-active: #5b21b6;
  --primary-soft: #f3edfe;
  --primary-soft-strong: #e6d9fc;

  /* Semantic */
  --success: #16a34a;
  --success-soft: #eafaf0;
  --warning: #d97706;
  --warning-soft: #fef6e7;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --info: #0891b2;
  --info-soft: #e7f8fb;

  /* Neutral surface stack (light) */
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-hover: #f6f7fb;
  --border: #d7dae4;
  --border-strong: #b9bdd2;

  /* Text — darkened for stronger contrast (low-vision friendly) */
  --text: #12141f;
  --text-muted: #33374a;
  --text-faint: #4a4f66;
  --text-on-primary: #ffffff;

  /* Sidebar (dark by default, both themes) */
  --sidebar-bg: #170f2b;
  --sidebar-bg-elevated: #221741;
  --sidebar-text: #cfc6e8;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #2b1f4d;
  --sidebar-active-bg: linear-gradient(135deg, #7c3aed, #9333ea);
  --sidebar-active-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
  --sidebar-active-border: #a78bfa;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(16, 17, 28, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 17, 28, 0.06), 0 1px 2px rgba(16, 17, 28, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 17, 28, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 17, 28, 0.12);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;

  /* Typography — bumped up a step across the board for readability */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-xs: 13px;
  --fs-sm: 14px;
  --fs-base: 15.5px;
  --fs-md: 17px;
  --fs-lg: 20px;
  --fs-xl: 25px;
  --fs-2xl: 32px;

  /* Layout */
  --sidebar-w: 214px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 64px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  /* z-index */
  --z-topbar: 40;
  --z-sidebar: 50;
  --z-dropdown: 60;
  --z-modal-backdrop: 80;
  --z-modal: 90;
  --z-toast: 100;
}

/* Dark theme */
:root[data-theme="dark"] {
  --bg: #12131c;
  --surface: #1a1c29;
  --surface-2: #20222f;
  --surface-hover: #262838;
  --border: #2c2f42;
  --border-strong: #3a3d54;

  --text: #f8f8fc;
  --text-muted: #d6d8e8;
  --text-faint: #b9bcd4;

  --primary-soft: #2c2149;
  --primary-soft-strong: #372a5c;

  --success-soft: #103123;
  --warning-soft: #352708;
  --danger-soft: #3a1414;
  --info-soft: #0c2c33;

  --sidebar-bg: #0d0819;
  --sidebar-bg-elevated: #171029;
  --sidebar-border: #201835;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.5);
}
