/* ============================================
   CIJES Platform — Premium Design System
   Variables, Reset, Components, Animations
   ============================================ */

/* Google Fonts - Barlow & Barlow Condensed */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* Local Font Face - Eras ITC */
@font-face {
    font-family: 'Eras ITC';
    src: url('../fonts/ERAS ITC/ERASMD.TTF') format('truetype');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'Eras ITC';
    src: url('../fonts/ERAS ITC/ERASBD.TTF') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Eras ITC';
    src: url('../fonts/ERAS ITC/ERASDEMI.TTF') format('truetype');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'Eras ITC';
    src: url('../fonts/ERAS ITC/ERASLGHT.TTF') format('truetype');
    font-weight: 300;
    font-style: normal;
}

/* ============================================
   CSS Variables — Design Tokens
   ============================================ */
:root {
    /* Primary palette — CIJES Blue (#354E9C) */
    --primary-900: #0d1633;
    --primary-800: #162453;
    --primary-700: #213370;
    --primary-600: #2b3e82;
    --primary-500: #354E9C;
    --primary-400: #4c63bd;
    --primary-300: #6d82d4;
    --primary-200: #99a9e8;
    --primary-100: #c9d2f8;
    --primary-50: #eef1fe;

    /* Accent — CIJES Orange (#f39200) */
    --accent-500: #f39200;
    --accent-400: #ffa826;
    --accent-300: #ffbe59;
    --accent-200: #ffd58c;
    --accent-600: #d17c00;

    /* Success — Emerald */
    --success-500: #10B981;
    --success-400: #34D399;
    --success-300: #6EE7B7;
    --success-600: #059669;

    /* Danger */
    --danger-500: #EF4444;
    --danger-400: #F87171;

    /* Warning */
    --warning-500: #f39200;

    /* Neutral */
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;

    /* Surfaces */
    --bg-body: #050B18;
    --bg-card: rgba(22, 36, 83, 0.6);
    --bg-card-hover: rgba(33, 51, 112, 0.5);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    --navbar-bg-scrolled: rgba(5, 11, 24, 0.85);
    --footer-bg: rgba(5, 11, 24, 0.8);
    --bg-surface: #0f172a;
    --bg-surface-elevated: #162453;

    /* Text */
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --text-accent: var(--accent-400);

    /* Typography — Barlow (sans) & Eras ITC (display) */
    --font-sans: 'Barlow', 'Arial', sans-serif;
    --font-display: 'Eras ITC', 'Barlow Condensed', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(37, 99, 235, 0.3);
    --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.3);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   Light Theme Override
   ============================================ */
[data-theme="light"] {
    --bg-body: #F4F6F9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-glass-hover: rgba(0, 0, 0, 0.06);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-glass-hover: rgba(0, 0, 0, 0.15);
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;

    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #555E6D;
    --text-accent: #d17c00;

    /* Symmetric high-contrast color system for light mode */
    --primary-900: #eef1fe;
    --primary-800: #c9d2f8;
    --primary-700: #99a9e8;
    --primary-600: #6d82d4;
    --primary-500: #354E9C;
    --primary-400: #2b3e82;
    --primary-300: #213370;
    --primary-200: #162453;
    --primary-100: #0d1633;

    --accent-600: #b56b00;
    --accent-500: #f39200;
    --accent-400: #d17c00;
    --accent-300: #a66200;
    --accent-200: #8c5300;

    --navbar-bg-scrolled: rgba(255, 255, 255, 0.9);
    --footer-bg: rgba(238, 241, 254, 0.9);
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(53, 78, 156, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(243, 146, 0, 0.05), transparent),
        radial-gradient(ellipse 60% 40% at 10% 80%, rgba(16, 185, 129, 0.05), transparent);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 50%, rgba(245, 158, 11, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 10% 80%, rgba(16, 185, 129, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--primary-300);
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-4xl) 0;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header h2 {
    font-size: 2.25rem;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--text-primary), var(--primary-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary-300);
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .container { padding: 0 var(--space-md); }
    .section { padding: var(--space-2xl) 0; }
    .section-header h2 { font-size: 1.75rem; }
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) 0;
    transition: all var(--transition-base);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: var(--navbar-bg-scrolled);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-glass);
    padding: var(--space-sm) 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary) !important;
    text-decoration: none;
}

.navbar-brand .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    font-weight: 800;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.navbar-nav a.active {
    color: var(--primary-400);
}

.navbar-cta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

@media (max-width: 768px) {
    .mobile-toggle { display: flex; }
    .navbar-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        flex-direction: column;
        align-items: stretch;
        background: var(--primary-900);
        border-left: 1px solid var(--border-glass);
        padding: var(--space-4xl) var(--space-lg);
        transition: right var(--transition-slow);
        z-index: 9999;
    }
    .navbar-nav.open { right: 0; }
    .navbar-cta { display: none; }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
    transform: translateY(-1px);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: var(--gray-900);
    box-shadow: var(--shadow-md);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-400), var(--accent-500));
    box-shadow: var(--shadow-lg), var(--shadow-glow-gold);
    transform: translateY(-1px);
    color: var(--gray-900);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-glass-hover);
}

.btn-outline:hover {
    background: var(--bg-glass-hover);
    border-color: var(--primary-400);
    color: var(--primary-400);
}

.btn-ghost {
    background: var(--bg-glass);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.btn-ghost:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ============================================
   Cards — Glassmorphism
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
}

.card-image-placeholder {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.card-image-placeholder.formation { background: linear-gradient(135deg, var(--primary-700), var(--primary-400)); }
.card-image-placeholder.recherche { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.card-image-placeholder.reflect { background: linear-gradient(135deg, #059669, #10b981); }
.card-image-placeholder.bibliotheque { background: linear-gradient(135deg, var(--accent-600), var(--accent-500)); }

.card-body {
    padding: var(--space-lg);
}

.card-body h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.card-body p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.card-tag.blue { color: var(--primary-300); border-color: rgba(37,99,235,0.3); background: rgba(37,99,235,0.1); }
.card-tag.green { color: var(--success-400); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.1); }
.card-tag.gold { color: var(--accent-400); border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); }
.card-tag.purple { color: #a78bfa; border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.1); }

.card-price {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--accent-400);
}

.card-price.free {
    color: var(--success-400);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(37, 99, 235, 0.12), transparent 70%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -10%;
    width: 50%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(245, 158, 11, 0.08), transparent 70%);
    animation: heroGlow 10s ease-in-out 2s infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(5%, -3%); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 750px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-200) 50%, var(--accent-300) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
    margin-top: var(--space-3xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border-glass);
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .hero { min-height: auto; padding: 120px 0 60px; }
    .hero-content h1 { font-size: 2.25rem; }
    .hero-content p { font-size: 1rem; }
    .hero-stats { gap: var(--space-lg); flex-wrap: wrap; }
}

/* ============================================
   Module Cards (4 pillars)
   ============================================ */
.module-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.module-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transition: height var(--transition-base);
}

.module-card.formation::before { background: linear-gradient(90deg, var(--primary-700), var(--primary-400)); }
.module-card.recherche::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.module-card.reflect::before { background: linear-gradient(90deg, #059669, #10b981); }
.module-card.bibliotheque::before { background: linear-gradient(90deg, var(--accent-600), var(--accent-500)); }

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-glass-hover);
}

.module-card:hover::before {
    height: 4px;
}

.module-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.module-card.formation .module-icon { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.module-card.recherche .module-icon { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.module-card.reflect .module-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.module-card.bibliotheque .module-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.module-card h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .module-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .module-cards { grid-template-columns: 1fr; }
}

/* ============================================
   Stat Counters
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.stat-icon.green { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-icon.gold { background: rgba(245,158,11,0.15); color: #fbbf24; }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    transition: all var(--transition-base);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
}

/* Light mode inputs & labels */
[data-theme="light"] .form-group label,
[data-theme="light"] .form-label {
    color: #1e293b;
    font-weight: 600;
}

[data-theme="light"] .form-control {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .form-control:focus {
    background: #ffffff;
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.2);
}

[data-theme="light"] .form-control::placeholder {
    color: #64748b;
}

[data-theme="light"] select.form-control {
    background-color: #ffffff;
    color: #0f172a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23475569' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
}

[data-theme="light"] select.form-control option {
    background: #ffffff;
    color: #0f172a;
}

select.form-control option {
    background: #0f172a;
    color: #f8fafc;
}

/* ============================================
   Alert Messages
   ============================================ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-400);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-400);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-400);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--primary-300);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-glass);
    padding: var(--space-3xl) 0 var(--space-xl);
    background: var(--footer-bg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: var(--space-md);
    line-height: 1.6;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: var(--space-sm);
}

.footer-col ul a {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color var(--transition-base);
}

.footer-col ul a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; gap: var(--space-md); text-align: center; }
}

@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-glass);
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 72px;
}

.sidebar {
    width: 260px;
    min-height: calc(100vh - 72px);
    background: var(--bg-card);
    border-right: 1px solid var(--border-glass);
    padding: 16px 12px;
    position: fixed;
    left: 0;
    top: 72px;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

/* Sleek scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-400);
}

/* User pill in sidebar */
.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 700;
    flex-shrink: 0;
}
.sidebar-user-details {
    overflow: hidden;
}
.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--accent-400);
    text-transform: capitalize;
}

/* Top single links (e.g. Dashboard) */
.sidebar-top-nav {
    margin-bottom: 12px;
}
.sidebar-single-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.sidebar-single-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}
.sidebar-single-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(243, 146, 0, 0.25), rgba(243, 146, 0, 0.08));
    border-color: rgba(243, 146, 0, 0.35);
    font-weight: 700;
}
.sidebar-single-link .link-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--accent-400);
}

/* Section Divider */
.sidebar-section-divider {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 6px 12px 4px 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Accordion Groups */
.sidebar-menu-groups {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-group {
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.sidebar-group-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-group-btn:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.sidebar-group.is-open > .sidebar-group-btn {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-group-btn.active-group {
    border-color: rgba(243, 146, 0, 0.25);
    background: rgba(243, 146, 0, 0.06);
    color: var(--text-primary);
}

.sidebar-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.group-icon-wrapper {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-group-btn:hover .group-icon-wrapper {
    transform: scale(1.08);
}

.group-name {
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-chevron {
    font-size: 0.6875rem;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    margin-left: auto;
}

.sidebar-group.is-open .group-chevron {
    transform: rotate(180deg);
    color: var(--accent-400);
}

/* Collapsible Submenu */
.sidebar-submenu-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.sidebar-group.is-open .sidebar-submenu-wrapper {
    max-height: 500px;
    opacity: 1;
}

.sidebar-submenu {
    list-style: none;
    padding: 3px 0 6px 12px;
    margin: 2px 0 4px 14px;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-submenu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.18s ease;
}

.sidebar-submenu li a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(3px);
}

.sidebar-submenu li a.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(243, 146, 0, 0.25), rgba(243, 146, 0, 0.08));
    border-left: 3px solid var(--accent-400);
    font-weight: 600;
}

.sidebar-submenu li a i {
    font-size: 0.75rem;
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

/* Legacy sidebar-nav support */
.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--space-xs);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.sidebar-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

.sidebar-nav a.active {
    color: var(--primary-400);
    background: rgba(37, 99, 235, 0.1);
}

.sidebar-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-glass);
}

.sidebar-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding: 0 var(--space-md);
}

.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: var(--space-xl);
}

.dashboard-header {
    margin-bottom: var(--space-xl);
}

.dashboard-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.dashboard-header p {
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: block !important;
        box-shadow: none;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    }
    .dashboard-main { margin-left: 0; }
}

/* ============================================
   Badge & Tags
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-green { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-gold { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.badge-red { background: rgba(239,68,68,0.15); color: #f87171; }

/* ============================================
   Page Header
   ============================================ */
.page-header {
    padding: 120px 0 60px;
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--text-primary), var(--primary-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary-400); }

/* ============================================
   Filters
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
}

.filter-bar .form-control {
    flex: 1;
    min-width: 200px;
}

.filter-chips {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-chip {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-chip:hover, .filter-chip.active {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--primary-400);
    color: var(--primary-400);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-secondary);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }
.animate-slideInRight { animation: slideInRight 0.5s ease forwards; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Scroll reveal — initially hidden, JS adds .revealed */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-accent { color: var(--accent-400); }
.text-success { color: var(--success-400); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.mt-1 { margin-top: var(--space-md); }
.mt-2 { margin-top: var(--space-xl); }
.mt-3 { margin-top: var(--space-2xl); }
.mb-1 { margin-bottom: var(--space-md); }
.mb-2 { margin-bottom: var(--space-xl); }
.mb-3 { margin-bottom: var(--space-2xl); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-md); }
.gap-2 { gap: var(--space-xl); }
.w-full { width: 100%; }
.hidden { display: none; }

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--primary-900); }
::-webkit-scrollbar-thumb { background: var(--gray-700); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

/* ============================================
   CIJES Searchable Select Component
   Barre de recherche pour filtrer les listes de sélection
   ============================================ */

.cijes-select-container {
    position: relative;
    display: inline-block;
    width: 100%;
    vertical-align: middle;
    box-sizing: border-box;
}

/* Le bouton déclencheur remplaçant le select natif */
.cijes-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0.65rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-base);
    outline: none;
    user-select: none;
    gap: 8px;
    box-sizing: border-box;
}

.cijes-select-trigger:hover {
    border-color: var(--primary-400);
    background: var(--bg-glass-hover);
}

.cijes-select-trigger:focus,
.cijes-select-container.is-open .cijes-select-trigger {
    border-color: var(--accent-400);
    box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .cijes-select-trigger {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .cijes-select-trigger:hover {
    border-color: var(--accent-400);
    background: #ffffff;
}

[data-theme="light"] .cijes-select-label.is-placeholder {
    color: #64748b;
}

[data-theme="light"] .cijes-select-arrow {
    color: #64748b;
}

[data-theme="light"] .cijes-select-trigger:focus,
[data-theme="light"] .cijes-select-container.is-open .cijes-select-trigger {
    background: #ffffff;
    border-color: var(--accent-500);
    box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.25);
}

.cijes-select-trigger.is-invalid,
.cijes-select-trigger.has-error {
    border-color: var(--danger-400) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.cijes-select-trigger:disabled,
.cijes-select-container.is-disabled .cijes-select-trigger {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.cijes-select-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.cijes-select-label.is-placeholder {
    color: var(--text-muted);
}

.cijes-select-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.cijes-select-container.is-open .cijes-select-arrow {
    transform: rotate(180deg);
    color: var(--accent-400);
}

/* Menu déroulant contenant la barre de recherche et les options */
.cijes-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100050;
    background: #0f172a;
    border: 1px solid var(--border-glass-hover);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: cijesSelectDropIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    min-width: 180px;
}

[data-theme="light"] .cijes-select-dropdown {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.cijes-select-container.is-flipped .cijes-select-dropdown {
    top: auto;
    bottom: calc(100% + 4px);
    animation: cijesSelectDropUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cijesSelectDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cijesSelectDropUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Barre de recherche fixée en haut de la liste de sélection */
.cijes-select-search-wrap {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
}

[data-theme="light"] .cijes-select-search-wrap {
    background: rgba(248, 250, 252, 0.98);
    border-bottom: 1px solid #e2e8f0;
}

.cijes-select-search-icon {
    color: var(--accent-400);
    font-size: 0.8125rem;
    flex-shrink: 0;
    margin-left: 2px;
}

.cijes-select-search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.84rem;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    width: 100%;
}

[data-theme="light"] .cijes-select-search-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.cijes-select-search-input:focus {
    border-color: var(--accent-400);
    box-shadow: 0 0 0 2px rgba(243, 146, 0, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .cijes-select-search-input:focus {
    background: #ffffff;
    border-color: var(--accent-500);
}

.cijes-select-search-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.cijes-select-search-clear:hover {
    color: var(--danger-400);
}

/* Liste des options filtrables avec barre de défilement */
.cijes-select-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
    box-sizing: border-box;
    overscroll-behavior: contain;
}

.cijes-select-options::-webkit-scrollbar {
    width: 6px;
}
.cijes-select-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}
.cijes-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Option individuelle */
.cijes-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    user-select: none;
    box-sizing: border-box;
}

[data-theme="light"] .cijes-select-option {
    color: #334155;
}

.cijes-select-option:hover,
.cijes-select-option.is-highlighted {
    background: rgba(243, 146, 0, 0.15);
    color: var(--accent-300);
}

[data-theme="light"] .cijes-select-option:hover,
[data-theme="light"] .cijes-select-option.is-highlighted {
    background: rgba(243, 146, 0, 0.12);
    color: var(--accent-600);
}

.cijes-select-option.is-selected {
    background: var(--primary-600);
    color: #ffffff !important;
    font-weight: 600;
}

.cijes-select-option.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.cijes-select-option-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cijes-select-check {
    font-size: 0.75rem;
    color: var(--accent-400);
    opacity: 0;
    flex-shrink: 0;
}

.cijes-select-option.is-selected .cijes-select-check {
    opacity: 1;
    color: #ffffff;
}

.cijes-select-optgroup {
    padding: 8px 10px 3px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-400);
    opacity: 0.9;
    user-select: none;
}

/* Message si aucun résultat trouvé */
.cijes-select-no-result {
    padding: 16px 12px;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Surlignage de la correspondance dans le texte */
.cijes-select-highlight {
    background: rgba(243, 146, 0, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

/* Rendre le select natif invisible mais conservant la validation et la soumission */
.cijes-select-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0.0001 !important;
    pointer-events: none !important;
}

