/* Design tokens — Bioworld design system (source: redesign/assets/css/tokens.css). */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../../fonts/inter/InterVariable.woff2') format('woff2');
}

:root {
  /* ---- Typography ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-page-title: 1.5rem;      /* 24px */
  --fs-section-title: 1.125rem; /* 18px */
  --fs-card-title: 0.9375rem;   /* 15px */
  --fs-body: 0.875rem;          /* 14px */
  --fs-label: 0.8125rem;        /* 13px */
  --fs-caption: 0.75rem;        /* 12px */
  --fs-table: 0.8125rem;        /* 13px */
  --fs-display: 1.75rem;        /* 28px, KPI numbers */

  --lh-tight: 1.25;
  --lh-normal: 1.5;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* ---- Spacing scale ---- */
  --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;

  /* ---- Radius ---- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;

  /* ---- Z-index ---- */
  --z-header: 100;
  --z-sidebar: 90;
  --z-dropdown: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* ---- Layout ---- */
  --sidebar-width: 248px;
  --sidebar-width-collapsed: 72px;
  --tree-panel-width: 280px;
  --header-height: 64px;

  /* ---- Brand palette (raw, theme-independent) ---- */
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;

  --teal-50:  #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-700: #0f766e;

  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;

  --red-50:  #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --cyan-50:  #ecfeff;
  --cyan-100: #cffafe;
  --cyan-500: #06b6d4;
  --cyan-600: #0891b2;
  --cyan-700: #0e7490;

  --slate-25: #fbfcfe;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #0b1220;
}

/* ==========================================================================
   Light theme (default)
   ========================================================================== */
:root,
[data-theme='light'] {
  --color-bg: var(--slate-50);
  --color-bg-canvas: #eef2f7;
  --color-surface: #ffffff;
  --color-surface-secondary: var(--slate-50);
  --color-surface-hover: var(--slate-100);
  --color-border: var(--slate-200);
  --color-border-strong: var(--slate-300);

  --color-text-primary: var(--slate-900);
  --color-text-secondary: var(--slate-600);
  --color-text-tertiary: var(--slate-400);
  --color-text-inverse: #ffffff;

  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-primary-surface: var(--blue-50);
  --color-primary-border: var(--blue-200);
  --color-on-primary: #ffffff;

  --color-secondary: var(--teal-600);
  --color-secondary-surface: var(--teal-50);
  --color-on-secondary: #ffffff;

  --color-success: var(--green-600);
  --color-success-surface: var(--green-50);
  --color-warning: var(--amber-600);
  --color-warning-surface: var(--amber-50);
  --color-error: var(--red-600);
  --color-error-surface: var(--red-50);
  --color-info: var(--cyan-600);
  --color-info-surface: var(--cyan-50);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.16);

  --sidebar-bg: #0e1c33;
  --sidebar-bg-hover: rgba(255, 255, 255, 0.06);
  --sidebar-text: #b9c6dd;
  --sidebar-text-active: #ffffff;
  --sidebar-border: rgba(255, 255, 255, 0.08);

  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);

  color-scheme: light;
}

/* Light-theme sidebar (user-approved deviation from the navy prototype sidebar). */
:root,
[data-theme='light'] {
  --sidebar-bg: #ffffff;
  --sidebar-bg-hover: rgba(15, 23, 42, 0.05);
  --sidebar-text: var(--slate-600);
  --sidebar-text-active: var(--slate-900);
  --sidebar-border: var(--slate-200);
}

/* ==========================================================================
   Dark theme
   ========================================================================== */
[data-theme='dark'] {
  --color-bg: var(--slate-950);
  --color-bg-canvas: #070c17;
  --color-surface: #111a2c;
  --color-surface-secondary: #16213a;
  --color-surface-hover: #1b2740;
  --color-border: #223049;
  --color-border-strong: #2c3c5a;

  --color-text-primary: #eef2f9;
  --color-text-secondary: #9fb0c9;
  --color-text-tertiary: #66779b;
  --color-text-inverse: #0b1220;

  --color-primary: #4f8bf7;
  --color-primary-hover: #6b9cf8;
  --color-primary-surface: rgba(79, 139, 247, 0.14);
  --color-primary-border: rgba(79, 139, 247, 0.35);
  --color-on-primary: #ffffff;

  --color-secondary: #2dd4bf;
  --color-secondary-surface: rgba(45, 212, 191, 0.14);
  --color-on-secondary: #04211d;

  --color-success: #4ade80;
  --color-success-surface: rgba(74, 222, 128, 0.14);
  --color-warning: #fbbf24;
  --color-warning-surface: rgba(251, 191, 36, 0.14);
  --color-error: #f87171;
  --color-error-surface: rgba(248, 113, 113, 0.14);
  --color-info: #22d3ee;
  --color-info-surface: rgba(34, 211, 238, 0.14);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.36), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.48), 0 4px 8px rgba(0, 0, 0, 0.24);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.56);

  --sidebar-bg: #0a1120;
  --sidebar-bg-hover: rgba(255, 255, 255, 0.06);
  --sidebar-text: #8ea0c2;
  --sidebar-text-active: #ffffff;
  --sidebar-border: rgba(255, 255, 255, 0.06);

  --focus-ring: 0 0 0 3px rgba(79, 139, 247, 0.45);

  color-scheme: dark;
}
