/* ==========================================
   GESTSTOCK - CUSTOM DESIGN SYSTEM
   Modern, Premium & Professional
   ========================================== */

/* === VARIABLES CSS === */
:root {
    /* Couleurs Primaires */
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --primary-200: #c7d2fe;
    --primary-300: #a5b4fc;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;
    --primary-800: #3730a3;
    --primary-900: #312e81;

    /* Couleurs Secondaires */
    --secondary-500: #8b5cf6;
    --secondary-600: #7c3aed;

    /* Couleurs Status */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #0ba360 0%, #3cba92 100%);
    --gradient-danger: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-ocean: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-purple: linear-gradient(135deg, #c471f5 0%, #fa71cd 100%);
    --primary-gradient: var(--gradient-primary);

    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-primary: 0 10px 20px -5px rgba(99, 102, 241, 0.3);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

[x-cloak] {
    display: none !important;
}

/* === TYPOGRAPHIE GOOGLE FONTS === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
}

/* === CARTES MODERNES === */
.card-modern {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-gradient {
    background: var(--gradient-primary);
    color: white;
}

/* === GLASSMORPHISM === */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === BOUTONS PREMIUM === */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-warning,
.btn-light,
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-600);
    color: white;
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: var(--primary-700);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-light {
    background: white;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.btn-light:hover {
    background: #f8fafc;
}

.btn-success {
    background: #16a34a;
    color: white;
    border: 1px solid transparent;
}

.btn-success:hover {
    background: #15803d;
}

.btn-warning {
    background: #d97706;
    color: white;
    border: 1px solid transparent;
}

.btn-warning:hover {
    background: #b45309;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-premium {
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary);
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-primary);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.4);
}

.btn-premium:active {
    transform: scale(0.98);
}

/* Effet Ripple */
.btn-premium::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-premium:active::before {
    width: 300px;
    height: 300px;
}

/* === INPUTS MODERNES === */
.input-modern {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: white;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.input-modern:hover {
    border-color: var(--primary-300);
}

/* Label flottant */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 0 8px;
    color: #6b7280;
    transition: var(--transition);
    pointer-events: none;
}

.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label {
    top: 0;
    font-size: 13px;
    color: var(--primary-600);
    font-weight: 500;
}

/* === BADGES MODERNES === */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* === STATS CARDS === */
/* === STATS CARDS === */
.stat-card {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 16px;

    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 40px;
    height: 40px;

    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-primary);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-value {
    font-size: 24px;

    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* === TABLE MODERNE === */
.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.table-modern thead th {
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    text-align: left;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.table-modern thead th:first-child {
    border-top-left-radius: 12px;
}

.table-modern thead th:last-child {
    border-top-right-radius: 12px;
}

.table-modern tbody tr {
    transition: var(--transition-fast);
    background: white;
}

.table-modern tbody tr:hover {
    background: #f9fafb;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.table-modern tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* === LOADING === */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === HOVER EFFECTS === */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* === SCROLLBAR MODERNE === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-value {
        font-size: 22px;
    }
}

/* === UTILITIES === */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.shadow-premium {
    box-shadow: var(--shadow-primary);
}

/* === SELECT2 STYLING (ALIGN WITH input-modern) === */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: auto;
    min-height: 48px;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    color: #111827;
    font-size: 15px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 12px;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--single {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.select2-dropdown {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.select2-results__option {
    padding: 8px 12px;
    font-size: 14px;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-500);
}

/* === CUSTOM THIN SCROLLBAR (Dark Mode Friendly) === */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5); /* gray-800/50 */
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #4b5563; /* gray-600 */
    border-radius: 10px;
    border: 1px solid rgba(31, 41, 55, 0.5);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* gray-500 */
}