/* Ligne d'un ticket ultra-compacte */
.ticket-item-compact {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-left: 3px solid #ced4da;
    border-radius: 4px;
    padding: 6px 10px;
    transition: all 0.15s ease;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    gap:2px;
    margin-bottom: 6px;
}

.ticket-item-compact:hover {
    background-color: #f8f9fa;
    border-left-color: #033e4a; /* La bordure devient bleue au survol */
}

.ticket-item-id {
    font-size: 11px;
    color: #8898aa;
    font-weight: 700;
    min-width: 65px;
}

.ticket-item-subject {
    flex-grow: 1;
    min-width: 0;
    margin-right: 12px;
}

.ticket-item-subject a {
    font-size: 13px;
    font-weight: 600;
    color: #32325d;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Étend la zone cliquable du lien à toute la ligne */
.ticket-item-subject a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.ticket-item-status {
    flex-shrink: 0;
    margin-right: 12px;
}

.ticket-item-status span {
    border: none !important;
    background-color: transparent !important;
}

.ticket-item-status .status-label {
    font-size: 9px !important;
    padding: 2px 6px !important;
}

.ticket-item-date {
    flex-shrink: 0;
    font-size: 10px;
    color: #adb5bd;
    white-space: nowrap;
}

/* --- NOUVEAU : Overlay d'action au survol --- */
.ticket-hover-action {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, transparent, #f8f9fa 25%, #f8f9fa 100%);
    padding: 0 12px 0 40px;
    font-size: 11px;
    font-weight: 700;
    color: #033e4a;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
    z-index: 2; /* Passe au-dessus du lien étendu */
    pointer-events: none; /* Laisse le clic passer à travers vers le lien <a> */
}

.ticket-item-compact:hover .ticket-hover-action {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   INLINE FORM CONTAINER (Style SaaS)
   ========================================================================== */

#inline-form-wrapper {
    margin-top: 32px;
    margin-bottom: 48px;
    max-width: 800px; /* Limite la largeur pour une meilleure lisibilité */
    margin-left: auto;
    margin-right: auto;
}

#inline-form-wrapper .card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05) !important;
}

#inline-form-wrapper .card-header {
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
}

#inline-form-wrapper .btn-close {
    background-size: 0.8em;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

#inline-form-wrapper .btn-close:hover {
    opacity: 1;
}

/* ==========================================================================
   FORM WIZARD STEPPER (SaaS Style)
   ========================================================================== */

.form-wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background-color: #044a56;
    color: #ffffff;
    border-color: #044a56;
    box-shadow: 0 0 0 4px rgba(4, 74, 86, 0.1);
}

.step-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.step.active .step-label {
    color: #044a56;
}

.step-divider {
    flex-grow: 1;
    height: 2px;
    background-color: #e2e8f0;
    margin: 0 16px;
    position: relative;
    top: -12px;
    z-index: 1;
}

/* Carte du formulaire étape 2 */
.wizard-form-card {
    border-radius: 16px !important;
    max-width: 850px;
    margin: 0 auto;
}

/* Transitions douces */
.wizard-content-section {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SAAS CARDS (Alertes & Choix de formulaire)
   ========================================================================== */

/* 1. Alertes d'information (En haut) */
.saas-alert {
    border-radius: 16px;
    border: 1px solid transparent;
}

.saas-alert-info {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}
.saas-alert-info .saas-alert-icon { color: #475569; font-size: 1.5rem; }
.saas-alert-info h6 { color: #334155; }

.saas-alert-warning {
    background-color: #fff1f2;
    border-color: #ffe4e6;
}
.saas-alert-warning .saas-alert-icon { color: #9f1239; font-size: 1.5rem; }
.saas-alert-warning h6 { color: #881337; }
.saas-alert-warning .alert-link { color: #881337; }

/* 2. En-têtes de catégories (Les titres) */
.category-pill-icon {
    width: 48px;
    height: 48px;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* 3. Les Cartes d'action cliquables */
.saas-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.saas-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    transform: translateY(-3px); /* Soulèvement de la carte */
}

/* Les icônes dans les cartes (Bulles colorées) */
.saas-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.25s ease;
}

.saas-card.request-card:hover .saas-card-icon {
    transform: scale(1.05); /* L'icône grossit légèrement au survol */
}

/* Couleurs spécifiques par type de demande */
.icon-blue { 
    background-color: #f8fafc; 
    color: #475569; 
}
.icon-orange { 
    background-color: #fff1f2; 
    color: #9f1239; 
}
.icon-teal { 
    background-color: rgba(4, 74, 86, 0.08); 
    color: #044a56; 
}

/* La flèche à droite */
.saas-card-arrow {
    color: #cbd5e1;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.saas-card.request-card:hover .saas-card-arrow {
    color: #044a56; /* Prend votre couleur principale au survol */
    transform: translateX(4px); /* Glisse légèrement vers la droite */
}

/* ==========================================================================
   VALIDATION DES CHAMPS (Erreurs & Select2)
   ========================================================================== */

/* Bordure rouge et halo pour Select2 si invalide */
.is-invalid + .select2-container--bootstrap-5 .select2-selection {
    border-color: #ef4444 !important; /* Rouge doux */
    background-color: #fef2f2 !important; /* Fond légèrement rouge */
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Style du texte d'erreur injecté */
.custom-invalid-feedback {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 4px;
    animation: fadeIn 0.2s ease-in-out;
}

/* ==========================================================================
   INDICATEUR DE CHAMPS REQUIS (Astérisque Rouge)
   ========================================================================== */

/* 1. Cible le label associé à un champ requis (input ou select classique) */
label:has(+ [required]).form-label,
label:has(+ .select2-container + [required]).form-label, /* Pour les select masqués */
.label-required { /* Classe de secours si l'imbrication HTML change */
    display: flex;
    align-items: center;
}

/* 2. Ajout de l'astérisque rouge après le texte du label via pseudo-élément */
label:has(+ [required]).form-label::after,
label:has(+ .select2-container + [required]).form-label::after,
.label-required::after {
    content: "*";
    color: #ef4444; /* Rouge doux (le même que pour les erreurs) */
    margin-left: 4px; /* Petit espace */
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1; /* Aligne verticalement */
}


#new-request-form .form-control {
    background-color: #ffffff;
    border: 1px solid #cbd5e1 !important; /* Bordure grise (Slate 300) bien visible */
    border-radius: 8px !important; /* Même arrondi que Select2 */
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #334155;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); /* Légère profondeur */
    transition: all 0.2s ease;
}

/* Le placeholder (texte fantôme) */
#new-request-form .form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* État Focus (Quand on clique dedans) - Correspond au Select2 */
#new-request-form .form-control:focus {
    background-color: #ffffff;
    border-color: #044a56 !important; /* Votre couleur principale */
    box-shadow: 0 0 0 4px rgba(4, 74, 86, 0.15) !important; /* Halo de focus */
    outline: none;
}

/* Ajustement spécifique pour la zone de texte (Description) pour qu'elle respire */
#new-request-form textarea.form-control {
    min-height: 140px;
    line-height: 1.5;
    resize: vertical; /* Permet à l'utilisateur de l'agrandir de haut en bas uniquement */
}

/* Style légèrement distinct pour le bouton d'upload de fichiers pour qu'il ressorte */
#new-request-form input[type="file"].form-control {
    background-color: #f8fafc; /* Fond très légèrement grisé */
    padding: 10px 16px;
    cursor: pointer;
}

/* Pour uniformiser avec le rouge des erreurs de validation si le champ est vide */
#new-request-form .form-control.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* Rend les étapes actives cliquables */
.form-wizard-stepper .step.active {
    cursor: pointer;
}

/* Effet de survol sur les étapes actives (sauf si c'est désactivé) */
.form-wizard-stepper .step.active:hover .step-icon {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(4, 74, 86, 0.15);
}

/* ==========================================================================
   PENDING ONBOARDING COMPONENT (SaaS UI)
   ========================================================================== */

.onboarding-pending-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08), 0 4px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 3.5rem 2.5rem;
    max-width: 650px;
    margin: 3rem auto;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.pending-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #f0f7f9; /* Soft tint of primary brand color */
    color: #044a56;
    border-radius: 50%;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.pending-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
}

.pending-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* Modern Button */
.btn-modern-primary {
    background-color: #044a56;
    color: #ffffff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(4, 74, 86, 0.25);
    display: inline-flex;
    align-items: center;
}

.btn-modern-primary:hover {
    background-color: #033842;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(4, 74, 86, 0.35);
}

.btn-modern-primary:disabled {
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

/* Animations */
.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pulse-animation {
    animation: subtlePulse 2.5s infinite ease-in-out;
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtlePulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}