/**
 * MasterPlan Design System - Design Tokens
 * Professional Enterprise Dashboard Design
 * Based on Square UI principles and corporate benchmarks
 */

:root {
  /* ============================================
     COLOR SYSTEM
     ============================================ */
  
  /* Base Palette (90% of UI) */
  --color-bg-primary: #F9FAFB;        /* gray-50 - Page background */
  --color-bg-card: #FFFFFF;           /* white - All containers */
  --color-border: #E5E7EB;            /* gray-200 - All separations */
  
  /* Text Colors */
  --color-text-primary: #111827;      /* gray-900 - Titles, important values */
  --color-text-secondary: #6B7280;    /* gray-500 - Labels, descriptions */
  --color-text-tertiary: #9CA3AF;     /* gray-400 - Timestamps, metadata */
  
  /* Accent Colors (10% of UI) */
  --color-primary: #4F46E5;           /* indigo-600 - CTA buttons, links */
  --color-primary-hover: #4338CA;     /* indigo-700 - Hover states */
  --color-primary-light: #EEF2FF;     /* indigo-50 - Subtle backgrounds */
  --color-primary-border: #C7D2FE;    /* indigo-200 - Hover borders */
  
  --color-success: #10B981;           /* emerald-500 - Positive values, surplus */
  --color-success-light: #D1FAE5;     /* emerald-100 - Success backgrounds */
  --color-success-border: #A7F3D0;    /* emerald-200 - Success borders */
  
  --color-warning: #F59E0B;           /* amber-500 - Alerts, comparisons */
  --color-warning-light: #FEF3C7;     /* amber-100 - Warning backgrounds */
  
  --color-danger: #EF4444;            /* red-500 - Funding gaps, errors */
  --color-danger-light: #FEE2E2;      /* red-100 - Error backgrounds */
  --color-danger-border: #FECACA;     /* red-200 - Error borders */
  
  /* Interactive States */
  --color-hover-bg: #F3F4F6;          /* gray-100 - Hover backgrounds */
  --color-focus-ring: rgba(79, 70, 229, 0.1); /* indigo-600 with alpha */
  
  /* ============================================
     SHADOW SYSTEM (3 Levels)
     ============================================ */
  
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 
                 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  
  --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                  0 2px 4px -1px rgba(0, 0, 0, 0.06);
  
  --shadow-elevated: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                     0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* ============================================
     BORDER RADIUS SYSTEM (4 Levels)
     ============================================ */
  
  --radius-sm: 0.375rem;  /* 6px - Badges, small buttons */
  --radius-md: 0.5rem;    /* 8px - Inputs, small cards */
  --radius-lg: 0.75rem;   /* 12px - Cards, buttons */
  --radius-xl: 1rem;      /* 16px - Modals, large containers */
  
  /* ============================================
     SPACING SYSTEM (Compact & Efficient)
     ============================================ */
  
  /* Section Padding Vertical */
  --spacing-section-lg: 2rem;   /* 32px - py-8 */
  --spacing-section-md: 1.5rem; /* 24px - py-6 */
  --spacing-section-sm: 1rem;   /* 16px - py-4 */
  
  /* Margin Bottom Between Elements */
  --spacing-margin-lg: 1.5rem;  /* 24px - mb-6 */
  --spacing-margin-md: 1rem;    /* 16px - mb-4 */
  --spacing-margin-sm: 0.75rem; /* 12px - mb-3 */
  
  /* Card Padding */
  --spacing-card-lg: 1.25rem;   /* 20px - p-5 */
  --spacing-card-md: 1rem;      /* 16px - p-4 */
  --spacing-card-sm: 0.75rem;   /* 12px - p-3 */
  
  /* Grid Gaps */
  --spacing-gap-lg: 1rem;       /* 16px - gap-4 */
  --spacing-gap-md: 0.75rem;    /* 12px - gap-3 */
  --spacing-gap-sm: 0.5rem;     /* 8px - gap-2 */
  
  /* ============================================
     TYPOGRAPHY SYSTEM (6 Levels)
     ============================================ */
  
  /* Display Large */
  --font-size-display: 1.875rem;      /* 30px - text-3xl */
  --font-weight-display: 700;         /* bold */
  --line-height-display: 2.25rem;     /* leading-9 */
  
  /* Heading Large */
  --font-size-heading-lg: 1.5rem;     /* 24px - text-2xl */
  --font-weight-heading-lg: 700;      /* bold */
  --line-height-heading-lg: 2rem;     /* leading-8 */
  
  /* Heading Medium */
  --font-size-heading-md: 1.125rem;   /* 18px - text-lg */
  --font-weight-heading-md: 600;      /* semibold */
  --line-height-heading-md: 1.75rem;  /* leading-7 */
  
  /* Body Large */
  --font-size-body-lg: 1rem;          /* 16px - text-base */
  --font-weight-body-lg: 500;         /* medium */
  --line-height-body-lg: 1.5rem;      /* leading-6 */
  
  /* Body Regular */
  --font-size-body: 0.875rem;         /* 14px - text-sm */
  --font-weight-body: 400;            /* regular */
  --line-height-body: 1.25rem;        /* leading-5 */
  
  /* Label Small */
  --font-size-label: 0.75rem;         /* 12px - text-xs */
  --font-weight-label: 500;           /* medium */
  --line-height-label: 1rem;          /* leading-4 */
  --letter-spacing-label: 0.05em;     /* tracking-wide */
  
  /* ============================================
     TRANSITIONS & ANIMATIONS
     ============================================ */
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ============================================
     GLASSMORPHISM
     ============================================ */
  
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.05);
  --glass-blur: blur(12px) saturate(180%);
  
  /* ============================================
     Z-INDEX SCALE
     ============================================ */
  
  --z-base: 0;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-fixed: 30;
  --z-modal-backdrop: 40;
  --z-modal: 50;
  --z-toast: 60;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Card Styles */
.card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-hover {
  transition: all var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary-border);
}

/* Glassmorphism */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

/* Loading Skeleton */
@keyframes shimmer {
  0% { 
    background-position: -1000px 0; 
  }
  100% { 
    background-position: 1000px 0; 
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #F3F4F6 0%,
    #E5E7EB 50%,
    #F3F4F6 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-lg);
}

/* Focus Ring */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--color-focus-ring);
  border-color: var(--color-primary);
}

/* Smooth Transitions */
.transition-smooth {
  transition: all var(--transition-base);
}

.transition-fast {
  transition: all var(--transition-fast);
}

.transition-slow {
  transition: all var(--transition-slow);
}
