/* ============================================
   BuildMate Design Tokens (Aesthetic Light Theme)
   ============================================ */
:root {
  /* ---- Primary Palette (Vibrant Blue) ---- */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #2563eb; /* Vibrant core blue */
  --primary-600: #1d4ed8;
  --primary-700: #1e3a8a;
  --primary-800: #1e40af;
  --primary-900: #0f172a; /* Deepest blue/black */

  /* ---- Page Background (Subtle ambient glow) ---- */
  --page-bg: #f4f6f8; /* Soft cool gray for contrast with white cards */
  
  /* ---- Sidebar ---- */
  --sidebar-bg: rgba(255, 255, 255, 0.85); /* Glassmorphism */
  --sidebar-text: #64748b;
  --sidebar-text-hover: #0f172a;
  --sidebar-active-bg: #eff6ff;
  --sidebar-active-text: #2563eb;
  --sidebar-active-border: #2563eb;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --sidebar-border: rgba(226, 232, 240, 0.8);

  /* ---- Cards / Glassmorphism ---- */
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: rgba(226, 232, 240, 0.8);
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --card-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --card-radius: 16px;

  /* ---- Text ---- */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #2563eb;

  /* ---- Status / Semantic (Refined) ---- */
  --success: #059669;
  --success-light: #d1fae5;
  --success-dark: #065f46;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-dark: #92400e;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-dark: #991b1b;
  --info: #2563eb;
  --info-light: #dbeafe;
  --info-dark: #1e40af;

  /* ---- Incoming / Outgoing ---- */
  --incoming-color: #059669;
  --incoming-bg: #d1fae5;
  --outgoing-color: #d97706;
  --outgoing-bg: #fef3c7;

  /* ---- Borders & Dividers ---- */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --divider: #e2e8f0;

  /* ---- Input / Form ---- */
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-border-focus: #2563eb;
  --input-placeholder: #94a3b8;
  --input-radius: 10px;
  --input-height: 42px; /* Slightly taller for better UX */

  /* ---- Table Header & Row Hover ---- */
  --table-header-bg: rgba(241, 245, 249, 0.8);
  --table-row-hover: rgba(241, 245, 249, 0.5);

  /* ---- Select dropdown arrow ---- */
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  /* ---- Modal Background ---- */
  --modal-bg: #ffffff;

  /* ---- Typography ---- */
  --font-family-heading: 'Outfit', -apple-system, sans-serif;
  --font-family-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --font-size-xs: 0.75rem;     /* 12px */
  --font-size-sm: 0.8125rem;   /* 13px */
  --font-size-base: 0.875rem;  /* 14px */
  --font-size-md: 0.9375rem;   /* 15px */
  --font-size-lg: 1.125rem;    /* 18px */
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-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;

  /* ---- Transitions ---- */
  --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* ---- Z-index ---- */
  --z-sidebar: 100;
  --z-topbar: 90;
  --z-modal-backdrop: 200;
  --z-modal: 210;
  --z-dropdown: 150;
  --z-tooltip: 300;
  /* ---- Aliases for theme compatibility ---- */
  --bg-card: var(--card-bg);
  --bg-body: var(--page-bg);
}

/* ============================================
   Dark Theme Overrides
   ============================================ */
[data-theme="dark"] {
  --page-bg: #0f172a;
  
  --sidebar-bg: rgba(30, 41, 59, 0.95);
  --sidebar-text: #94a3b8;
  --sidebar-text-hover: #f8fafc;
  --sidebar-active-bg: rgba(37, 99, 235, 0.2);
  --sidebar-active-text: #60a5fa;
  --sidebar-border: rgba(51, 65, 85, 0.8);

  --card-bg: rgba(30, 41, 59, 0.95);
  --card-border: rgba(51, 65, 85, 0.8);
  --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);

  --bg-card: var(--card-bg);
  --bg-body: var(--page-bg);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0f172a;

  --border-color: #334155;
  --border-light: #1e293b;
  --divider: #334155;

  --input-bg: #1e293b;
  --input-border: #475569;
  --input-placeholder: #64748b;
  
  --success-light: rgba(6, 78, 59, 0.6);
  --success-dark: #6ee7b7;
  --warning-light: rgba(120, 53, 15, 0.6);
  --warning-dark: #fcd34d;
  --danger-light: rgba(127, 29, 29, 0.6);
  --danger-dark: #fca5a5;
  --info-light: rgba(30, 58, 138, 0.6);
  --info-dark: #93c5fd;

  /* ---- Table Header & Row Hover ---- */
  --table-header-bg: rgba(30, 41, 59, 0.85);
  --table-row-hover: rgba(51, 65, 85, 0.4);

  /* ---- Select dropdown arrow ---- */
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  /* ---- Modal Background ---- */
  --modal-bg: #1e293b;

  color-scheme: dark;
}
