/* ─── 0. ÉLÉMENTS DE BASE (GLOBAL) ─── */
h1 {
    font-weight: 800;
    text-transform: uppercase;
}

/* ─── 1. PERSONNALISATION TOM SELECT ─── */
.ts-control {
    border-radius: 0.75rem !important;
    background-color: rgb(249, 250, 251) !important;
    border: 1px solid rgb(229, 231, 235) !important;
    padding: 0.625rem 0.75rem !important;
    box-shadow: none !important;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ts-wrapper.focus .ts-control {
    background-color: #ffffff !important;
    border-color: rgb(99, 102, 241) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1) !important;
}

.ts-control .item {
    background-color: rgb(238, 242, 255) !important;
    border: 1px solid rgb(224, 231, 255) !important;
    color: rgb(67, 56, 202) !important;
    border-radius: 0.5rem !important;
    padding: 2px 8px !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.ts-control .item .remove {
    border-left: 1px solid rgb(199, 210, 254) !important;
    margin-left: 6px !important;
    padding-left: 4px !important;
    color: rgb(99, 102, 241) !important;
}

.ts-control .item .remove:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: rgb(67, 56, 202) !important;
}

.ts-dropdown {
    border-radius: 0.75rem !important;
    border: 1px solid rgb(243, 244, 246) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    margin-top: 4px !important;
    z-index: 50 !important;
}

.ts-dropdown .active {
    background-color: rgb(79, 70, 229) !important;
    color: #ffffff !important;
}

/* ─── 2. HARMONISATION FORMULAIRES & BOUTONS THALIA ─── */
.form-card {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgb(243, 244, 246);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgb(156, 163, 175);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-section-header {
    border-bottom: 1px solid rgb(243, 244, 246);
    padding-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgb(107, 114, 128);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgb(229, 231, 235);
    background-color: rgb(249, 250, 251);
    color: rgb(31, 41, 55);
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
    transition: all 150ms ease-in-out;
    outline: none;
}

.form-input:focus {
    border-color: rgb(99, 102, 241);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-input-sm {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgb(229, 231, 235);
    background-color: #ffffff;
    color: rgb(31, 41, 55);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    outline: none;
}

.form-help-text {
    font-size: 11px;
    color: rgb(156, 163, 175);
    margin-top: 0.375rem;
}

.form-file-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background-color: rgb(249, 250, 251);
    border-radius: 0.75rem;
    border: 1px solid rgb(229, 231, 235);
}

@media (min-width: 640px) {
    .form-file-box {
        flex-direction: row;
        align-items: center;
    }
}

.form-file-preview {
    width: 4rem;
    height: 5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: rgb(229, 231, 235);
    flex-shrink: 0;
    border: 1px solid rgb(243, 244, 246);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(156, 163, 175);
}

.form-badge-link {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: rgb(238, 242, 255);
    color: rgb(67, 56, 202);
    border: 1px solid rgb(224, 231, 255);
}

.form-actions {
    border-top: 1px solid rgb(243, 244, 246);
    padding-top: 1rem;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .form-actions {
        flex-direction: row;
        justify-content: space-between;
    }
}

.btn-cancel {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(107, 114, 128);
    padding: 0.5rem 0;
    transition: color 150ms ease-in-out;
}

.btn-cancel:hover {
    color: rgb(55, 65, 81);
}

.btn-submit, .btn-indigo {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: rgb(15, 23, 42);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    transition: background-color 150ms ease-in-out;
    cursor: pointer;
}

@media (min-width: 640px) {
    .btn-cancel, .btn-submit, .btn-indigo {
        width: auto;
    }
}

.btn-submit:hover, .btn-indigo:hover {
    background-color: rgb(30, 41, 59);
}

/* ─── 3. NAVIGATION LATÉRALE ET COMPOSANTS PROFIL ─── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(100, 116, 139);
    transition: all 150ms ease-in-out;
}

.sidebar-link:hover {
    background-color: rgb(248, 250, 252);
    color: rgb(51, 65, 85);
}

.sidebar-link.active {
    background-color: rgb(238, 242, 255);
    color: rgb(79, 70, 229);
    font-weight: 700;
}

.sidebar-link.active i {
    color: rgb(99, 102, 241);
}

.card-thalia {
    background-color: #ffffff;
    border: 1px solid rgb(241, 245, 249);
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}
/* ─── MODALE OVERLAY & COMPOSANTS ─── */

/* Arrière-plan sombre avec effet de flou */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(15, 23, 42, 0.6); /* bg-slate-900/60 */
    backdrop-filter: blur(4px);
    
    /* ⚠️ ALIGNEMENT CORRIGÉ POUR LES LONGS FORMULAIRES */
    display: flex;
    align-items: flex-start; /* Aligne le haut au lieu de centrer verticalement */
    justify-content: center;
    padding: 1.5rem 1rem;
    overflow-y: auto; /* Active le défilement si le formulaire est long */
    font-family: ui-sans-serif, system-ui, sans-serif;
}

/* Boîte blanche de la modale */
.modal-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 36rem;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgb(241, 245, 249);
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Variante plus large pour les formulaires denses (ex: Spectacles) */
.modal-card-lg {
    max-width: 56rem; /* max-w-4xl */
}

/* Bouton de fermeture (Croix en haut à droite) */
.modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    color: rgb(148, 163, 184); /* slate-400 */
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 150ms ease-in-out;
}

.modal-close-btn:hover {
    color: rgb(51, 65, 85); /* slate-700 */
    background-color: rgb(241, 245, 249);
}
/* ─── GESTION DES ERREURS DANS LES FORMULAIRES ─── */

/* 1. Style des champs texte & select génériques en erreur */
.form-group.has-error .form-input,
.form-group.has-error .form-input-sm {
    border-color: #f43f5e !important; /* Tailwind rose-500 */
    background-color: #fff1f2 !important; /* Tailwind rose-50 */
}

/* 2. Style de TomSelect en erreur */
.form-group.has-error .ts-control {
    border-color: #f43f5e !important;
    background-color: #fff1f2 !important;
}

/* 3. Style des boîtes d'upload de fichiers en erreur */
.form-group.has-error .form-file-box {
    border-color: #f43f5e !important;
    background-color: #fff1f2 !important;
}

/* 4. Style du label en erreur */
.form-group.has-error .form-label {
    color: #e11d48 !important; /* Tailwind rose-600 */
}

/* 5. Style des listes et messages d'erreur générés par {{ form_errors() }} */
.form-group .invalid-feedback,
.form-group ul {
    margin-top: 0.375rem;
    padding-left: 0;
    list-style: none;
}

.form-group ul li {
    color: #e11d48; /* Tailwind rose-600 */
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Ajoute automatiquement une mini-croix avant le message d'erreur */
.form-group ul li::before {
    content: "\f057"; /* Code unicode FontAwesome pour fa-circle-xmark */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
    color: #f43f5e;
}

/* ─── 4. COMPOSANTS DE RECHERCHE & FILTRES (LIVE COMPONENTS) ─── */

/* Barre contenant les filtres et le champ de recherche */
.filter-bar {
    background-color: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid rgb(241, 245, 249);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .filter-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Boutons de filtres (Agent, Directeur, Disciplines...) */
.filter-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    color: rgb(100, 116, 139);
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 150ms ease-in-out;
}

.filter-pill:hover {
    background-color: rgb(248, 250, 252);
    color: rgb(51, 65, 85);
}

.filter-pill.active {
    background-color: rgb(79, 70, 229);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 1px 2px 0 rgba(79, 70, 229, 0.2);
}

/* Champ de recherche avec loupe */
.filter-search-group {
    position: relative;
    width: 100%;
}

@media (min-width: 640px) {
    .filter-search-group {
        width: 100%;
    }
}

.filter-search-input {
    width: 100%;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(229, 231, 235);
    background-color: rgba(249, 250, 251, 0.5);
    outline: none;
    transition: all 150ms ease-in-out;
}

.filter-search-input:focus {
    border-color: rgb(99, 102, 241);
    background-color: #ffffff;
}

.filter-search-icon {
    position: absolute;
    left: 0.625rem;
    top: 0.625rem;
    font-size: 0.75rem;
    color: rgb(156, 163, 175);
    pointer-events: none;
}

/* Indicateur de chargement AJAX (Spinner) */
.filter-loader {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(79, 70, 229);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Carte de résultat générique pour la grille */
.search-card {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid rgb(241, 245, 249);
    padding: 1.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    transition: all 200ms ease-in-out;
    position: relative;
}

.search-card:hover {
    border-color: rgb(226, 232, 240);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Etat vide quand il n'y a aucun résultat */
.empty-results {
    grid-column: 1 / -1;
    background-color: #ffffff;
    border: 1px solid rgb(241, 245, 249);
    border-radius: 1rem;
    padding: 2.5rem 1rem;
    text-align: center;
    color: rgb(148, 163, 184);
    font-size: 0.875rem;
}
/* Masquer la barre de défilement */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Éviter le clignotement Alpine.js au chargement */
[x-cloak] {
    display: none !important;
}







