/* ========================================
   Design System Tokens
   Single source of truth for all design variables.
   Loaded by ALL base templates (home, admin, user).
   ======================================== */

:root {
    /* ========================================
       Layout
       ======================================== */
    --sidebar-width: 260px;

    /* ========================================
       Brand Colors
       ======================================== */
    --primary-color: #0065A3;
    --primary-dark: #004d7a;
    --primary-light: #338ec9;
    --primary-subtle: rgba(0, 101, 163, 0.08);

    --secondary-color: #e17055;
    --secondary-dark: #c45a3f;
    --secondary-light: #e89580;

    --dark-blue: #003B5C;
    --light-blue: #E8F4FF;

    /* ========================================
       Semantic Colors
       ======================================== */
    --success: #00c853;
    --success-subtle: rgba(0, 200, 83, 0.08);

    --warning: #b47600;  /* WCAG AA compliant */
    --warning-subtle: rgba(180, 118, 0, 0.08);

    --danger: #ff4b4b;
    --danger-subtle: rgba(255, 75, 75, 0.08);

    --info: #0dcaf0;
    --info-subtle: rgba(13, 202, 240, 0.08);

    /* Text-safe semantic colors (WCAG AA 4.5:1 on white) */
    --success-text: #008f3a;
    --danger-text: #d32f2f;
    --info-text: #0a7d96;
    --warning-text: #b47600;

    /* ========================================
       Neutral Palette (Gray Scale)
       ======================================== */
    --gray-50: #fafbfc;
    --gray-100: #f5f7fa;
    --gray-200: #e4e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* ========================================
       Typography Scale
       ======================================== */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 0.9375rem; /* 15px - dashboard default */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */
    --text-6xl: 3.75rem;    /* 60px */

    /* ========================================
       Line Heights
       ======================================== */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* ========================================
       Spacing Scale (8pt Grid)
       ======================================== */
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.5rem;    /* 24px */
    --spacing-6: 2rem;      /* 32px */
    --spacing-8: 3rem;      /* 48px */
    --spacing-10: 4rem;     /* 64px */
    --spacing-12: 6rem;     /* 96px */
    --spacing-16: 8rem;     /* 128px */

    /* ========================================
       Border Radius Scale
       ======================================== */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;

    /* ========================================
       Shadow Scale
       ======================================== */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* ========================================
       Transitions
       ======================================== */
    --transition-fast: 150ms 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.68, -0.55, 0.265, 1.55);

    /* ========================================
       Z-Index Scale
       ======================================== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================
   Skip Link (Accessibility)
   Shared across all layouts.
   ======================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: var(--spacing-3) var(--spacing-5);
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--spacing-4);
    color: white;
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0ms;
        --transition-base: 0ms;
        --transition-slow: 0ms;
        --transition-bounce: 0ms;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
