/* ============================================================
   Isitrac Design System - Tokens
   ------------------------------------------------------------
   Variables CSS principales + overrides Bootstrap 5
   Source : Charte-graphique/isitrac-design-system.md (section 16)
   ============================================================ */

:root {
    /* ── Couleurs Isitrac ────────────────────────────────── */
    --color-primary: #4F46E5;
    --color-primary-hover: #4338CA;
    --color-primary-pressed: #3730A3;
    --color-primary-light: #EEF2FF;
    --color-primary-ring: rgba(79, 70, 229, 0.15);

    --color-danger: #EF4444;
    --color-danger-hover: #DC2626;
    --color-danger-light: #FEE2E2;
    --color-danger-text: #991B1B;

    --color-success: #10B981;
    --color-success-hover: #059669;
    --color-success-light: #D1FAE5;
    --color-success-text: #065F46;

    --color-warning: #F59E0B;
    --color-warning-hover: #D97706;
    --color-warning-light: #FEF3C7;
    --color-warning-text: #92400E;

    --color-info: #0EA5E9;
    --color-info-light: #DBEAFE;
    --color-info-text: #1E40AF;

    --color-purple: #5B21B6;
    --color-purple-light: #EDE9FE;

    --color-pink-light: #FCE7F3;
    --color-pink-text: #9D174D;

    --color-orange-light: #FED7AA;
    --color-orange-text: #9A3412;

    --color-cyan-light: #CFFAFE;
    --color-cyan-text: #155E75;

    --color-indigo-light: #E0E7FF;
    --color-indigo-text: #3730A3;

    /* ── Texte ────────────────────────────────────────────── */
    --color-text-primary: #1F2937;
    --color-text-secondary: #6B7280;
    --color-text-tertiary: #9CA3AF;
    --color-text-disabled: #D1D5DB;
    --color-text-body: #374151;

    /* ── Fonds ────────────────────────────────────────────── */
    --color-bg-primary: #FFFFFF;
    --color-bg-secondary: #F9FAFB;
    --color-bg-tertiary: #F3F4F6;
    --color-bg-dark: #1F2937;

    /* ── Bordures ─────────────────────────────────────────── */
    --color-border: #E5E7EB;
    --color-border-hover: #D1D5DB;
    --color-border-strong: #9CA3AF;

    /* ── Typographie ──────────────────────────────────────── */
    --font-family-base: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 28px;
    --font-size-4xl: 32px;

    --line-height-base: 1.5;
    --line-height-tight: 1.25;

    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* ── Espacements ──────────────────────────────────────── */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* ── Border radius ────────────────────────────────────── */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ── Shadows ──────────────────────────────────────────── */
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-dropdown: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.15);

    /* ── Layout ───────────────────────────────────────────── */
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --content-padding: 24px;

    /* ── Transitions ──────────────────────────────────────── */
    --transition-fast: 0.12s ease;
    --transition-base: 0.2s ease;

    /* ── Overrides Bootstrap 5 ────────────────────────────── */
    --bs-primary: #4F46E5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-secondary: #6B7280;
    --bs-secondary-rgb: 107, 114, 128;
    --bs-success: #10B981;
    --bs-success-rgb: 16, 185, 129;
    --bs-danger: #EF4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-warning: #F59E0B;
    --bs-warning-rgb: 245, 158, 11;
    --bs-info: #0EA5E9;
    --bs-info-rgb: 14, 165, 233;
    --bs-light: #F9FAFB;
    --bs-light-rgb: 249, 250, 251;
    --bs-dark: #1F2937;
    --bs-dark-rgb: 31, 41, 55;

    --bs-body-bg: #F9FAFB;
    --bs-body-color: #374151;
    --bs-body-font-family: var(--font-family-base);
    --bs-body-font-size: var(--font-size-base);
    --bs-body-line-height: var(--line-height-base);

    --bs-border-color: #E5E7EB;
    --bs-border-radius: 8px;
    --bs-border-radius-sm: 4px;
    --bs-border-radius-lg: 12px;
    --bs-border-radius-xl: 16px;

    --bs-link-color: #4F46E5;
    --bs-link-hover-color: #4338CA;

    --bs-focus-ring-color: rgba(79, 70, 229, 0.25);
    --bs-focus-ring-width: 3px;
}

/* ── Reset typographique ──────────────────────────────────── */
html {
    font-size: 14px;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-body);
    background-color: var(--color-bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

h1, .h1 { font-size: var(--font-size-3xl); }
h2, .h2 { font-size: var(--font-size-2xl); }
h3, .h3 { font-size: var(--font-size-xl); }
h4, .h4 { font-size: var(--font-size-lg); font-weight: var(--font-weight-semibold); }
h5, .h5 { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); }
h6, .h6 { font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); }

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.text-muted {
    color: var(--color-text-secondary) !important;
}

small,
.small {
    font-size: var(--font-size-xs);
}
