/* =====================================================================
   Design Tokens — Partner Support System
   Preline admin-dashboard look: gray-50 canvas, white rail and cards,
   gray-200 hairlines, gray-800 text and blue-600 primary actions.
   Single source of truth for colour, type, radius, elevation and motion.
   ===================================================================== */

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-display: var(--font-sans);

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;

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

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur: 170ms;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #ffffff;
  --bg-subtle: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --text: #1f2937;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;

  /* The AI's purple - one accent for everything the AI decided or wrote. */
  --ai-fg: #6d28d9;
  --ai-bg: #f1eafe;

  /* primary — Preline blue-600 */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-fg: #ffffff;
  --ring: rgba(37, 99, 235, 0.25);

  /* accent — charts and success */
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-soft: #ccfbf1;
  --accent-tint: #99f6e4;

  /* status pills — fg on soft bg */
  --status-open-fg: #1d4ed8;
  --status-open-bg: #dbeafe;
  --status-progress-fg: #b45309;
  --status-progress-bg: #fef3c7;
  --status-closed-fg: #0f766e;
  --status-closed-bg: #ccfbf1;
  --status-overdue-fg: #b91c1c;
  --status-overdue-bg: #fee2e2;
  --status-muted-fg: #4b5563;
  --status-muted-bg: #f3f4f6;

  --badge-orange: #ea580c;

  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --danger-fg: #dc2626;

  /* sidebar — white rail, gray-100 hover / active */
  --sidebar-bg: #ffffff;
  --sidebar-fg: #1f2937;
  --sidebar-fg-muted: #6b7280;
  --sidebar-hover-bg: #f3f4f6;
  --sidebar-active-bg: #f3f4f6;
  --sidebar-active-fg: #111827;
  --sidebar-border: #e5e7eb;
  --sidebar-brand-fg: #111827;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 4px 12px -4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.15), 0 4px 10px -4px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.2);

  --overlay: rgba(17, 24, 39, 0.5);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #171717;
  --bg-subtle: #171717;
  --surface: #262626;
  --surface-2: #2f2f2f;

  --border: #404040;
  --border-strong: #525252;

  --text: #e5e5e5;
  --text-muted: #a3a3a3;
  --text-subtle: #737373;

  --ai-fg: #c4b5fd;
  --ai-bg: #2a1f45;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-fg: #ffffff;
  --ring: rgba(59, 130, 246, 0.35);

  --accent: #2dd4bf;
  --accent-hover: #14b8a6;
  --accent-soft: #123b37;
  --accent-tint: #115e59;

  --status-open-fg: #93c5fd;
  --status-open-bg: #1e2a44;
  --status-progress-fg: #fcd34d;
  --status-progress-bg: #3a2c0d;
  --status-closed-fg: #5eead4;
  --status-closed-bg: #123b37;
  --status-overdue-fg: #fca5a5;
  --status-overdue-bg: #3f1a1a;
  --status-muted-fg: #d4d4d4;
  --status-muted-bg: #333333;

  --badge-orange: #fb923c;

  --danger: #f87171;
  --danger-soft: #3f1a1a;
  --danger-fg: #fca5a5;

  --sidebar-bg: #262626;
  --sidebar-fg: #d4d4d4;
  --sidebar-fg-muted: #a3a3a3;
  --sidebar-hover-bg: #333333;
  --sidebar-active-bg: #404040;
  --sidebar-active-fg: #ffffff;
  --sidebar-border: #404040;
  --sidebar-brand-fg: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 4px 12px -4px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.65);

  --overlay: rgba(0, 0, 0, 0.6);
}
