/* static/css/style.css */

/* ================= VARIABLES & GLOBAL ================= */
:root {
    --primary-red: #cf142b;
    /* Rouge CSD */
    --dark-text: #333;
    --light-gray-bg: #f4f6f9;
    --input-border: #ccc;
    --border-color: #bbb;
    /* Couleur de la ligne des onglets */
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-gray-bg);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================= PAGE DE CONNEXION (Login) ================= */
.login-container {
    background-color: #fff;
    padding: 40px 50px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: auto;
}

.logo-img {
    max-width: 180px;
    margin-bottom: 20px;
}

h2 {
    color: var(--dark-text);
    font-weight: 600;
    margin-bottom: 35px;
}

/* --- Floating Labels --- */
.input-group {
    position: relative;
    margin-bottom: 25px;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.input-group label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    transition: 0.3s ease all;
    background-color: #fff;
    padding: 0 5px;
}

.input-group input:focus,
.input-group input:not(:placeholder-shown) {
    border-color: var(--primary-red);
}

.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label {
    top: 0;
    font-size: 13px;
    color: var(--primary-red);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background-color: var(--primary-red);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: #b01023;
}

.forgot-password {
    display: block;
    margin-top: 20px;
    color: #888;
    text-decoration: none;
    font-size: 14px;
}

/* ================= DASHBOARD (Structure) ================= */
.navbar {
    background-color: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.nav-title {
    font-weight: bold;
    color: var(--primary-red);
    font-size: 20px;
    display: flex;
    align-items: center;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ================= PROFIL & DROPDOWN ================= */
.profile-container {
    position: relative;
    display: inline-block;
}

.profile-bubble {
    width: 40px;
    height: 40px;
    background-color: var(--primary-red);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
}

.profile-bubble:hover {
    transform: scale(1.1);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 55px;
    background-color: #fff;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    z-index: 1000;
    border: 1px solid #eee;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.email-text {
    font-size: 12px;
    color: #666;
}

.dropdown-item {
    padding: 10px 15px;
    font-size: 14px;
    color: var(--dark-text);
}

.dropdown-link {
    display: block;
    width: 100%;
    padding: 12px 15px;
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    border: none;
    background: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s;
}

.admin-link {
    color: var(--dark-text);
    font-weight: 600;
}

.admin-link:hover {
    background-color: #f0f0f0;
}

.logout-btn {
    color: #d32f2f;
    border-top: 1px solid #eee;
}

.logout-btn:hover {
    background-color: #ffebee;
}

hr {
    margin: 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* ================= KPIs (Indicateurs) ================= */
.kpi-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    flex: 1;
    text-align: center;
}

.kpi-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-red);
    margin: 10px 0;
}

.kpi-label {
    color: #888;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* ================= ONGLETS (Style OneNote) ================= */
.tabs {
    display: flex;
    align-items: center;
    padding-left: 10px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;

    /* Activation du scroll horizontal */
    overflow-x: auto;
    /* Défilement fluide */
    scroll-behavior: smooth;
    /* Empêche les onglets de passer à la ligne */
    white-space: nowrap;

    /* --- Configuration FIREFOX --- */
    scrollbar-width: thin;
    /* Barre fine */
    scrollbar-color: transparent transparent;
    /* Invisible par défaut */
    transition: scrollbar-color 0.3s;
    /* Transition douce */

    touch-action: pan-y;
    /* Permet le scroll horizontal sur les écrans tactiles */

}

/* Apparition au survol (Firefox) */
.tabs:hover {
    scrollbar-color: #ccc transparent;
    /* Gris clair au survol */
}

/* --- Configuration CHROME / EDGE / SAFARI (Webkit) --- */

/* 1. La taille de la barre */
.tabs::-webkit-scrollbar {
    height: 4px;
    /* Hauteur très fine (4px) */
    background: transparent;
    /* Fond transparent */
}

/* 2. Le rail (le fond de la barre) */
.tabs::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px;
    /* Petite marge sur les côtés */
}

/* 3. La poignée (le truc qui bouge) */
.tabs::-webkit-scrollbar-thumb {
    background-color: transparent;
    /* Invisible par défaut */
    border-radius: 10px;
    /* Bords bien arrondis (Pill) */
    transition: background-color 0.3s;
}

/* 4. Apparition quand on survole la zone des onglets */
.tabs:hover::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    /* Gris clair discret */
}

/* 5. Changement de couleur quand on attrape la barre */
.tabs::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-red);
    /* Rouge quand on interagit avec */
}

.tab-btn {
    padding: 12px 25px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 10px 10px 0 0;
    position: relative;
    white-space: nowrap;
    margin-right: 2px;
}

.tab-btn:hover {
    color: var(--primary-red);
    background-color: #f5f5f5;
}

.tab-btn.active {
    background: transparent;
    color: var(--primary-red);
    font-weight: 700;
    z-index: 2;
    box-shadow: inset 0 -3px 0 0 var(--primary-red);
}

/* Bouton "+" pour créer un inventaire (Style Discret) */
.add-inventory-btn {
    margin-left: 5px;
    margin-bottom: 2px;
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #888;
    font-size: 20px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-out;
}

.add-inventory-btn:hover {
    color: var(--primary-red);
    font-weight: 700;
    background: transparent;
    border-color: transparent;
}

/* ================= TABLEAUX (Contenu) ================= */
.table-container {
    border: none;
    background: white;
    padding: 20px;
    margin-top: 0;
    border-radius: 10px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s;
}

.tab-content.active {
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

thead th {
    text-align: left;
    padding: 15px 20px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    /* Un peu plus petit pour les titres */
    border-bottom: 2px solid #eee;
    letter-spacing: 0.5px;
}

tbody td {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Police standard */
    font-size: 14px;
    color: var(--dark-text);
    /* Couleur unique (#333) */
    font-weight: 400;
    /* Poids normal */
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
    cursor: pointer;
}

tbody tr td:first-child {
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

tbody tr:hover {
    background-color: #e3f2fd !important;
    /* Bleu très pâle au survol */
    transform: scale(1.005);
    /* (Optionnel) Effet de "zoom" imperceptible pour la réactivité */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* (Optionnel) Légère ombre */
}

.table-action-link {
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s;
}

.table-action-link:hover {
    color: var(--primary-red);
    text-decoration: underline;
}

.table-link-plain {
    color: #333 !important;
    /* Force la couleur sombre */
    text-decoration: none !important;
    /* Force la suppression du soulignement */
    font-weight: 600;
    cursor: pointer;
    display: block;
    /* Occupe l'espace */
}

.table-link-plain:hover {
    color: var(--primary-red);
    /* Devient rouge uniquement au survol */
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* 🟢 Actif = Fond Vert pâle / Texte Vert foncé */
.status-active {
    background-color: #e8f5e9 !important;
    color: #2e7d32 !important;
}

/* 🟠 Suspendu = Fond Orange pâle / Texte Orange foncé */
.status-suspended {
    background-color: #fff3e0 !important;
    color: #ef6c00 !important;
}

/* 🔴 Désactivé = Fond Rouge pâle / Texte Rouge foncé */
.status-disabled {
    background-color: #ffebee !important;
    color: #c62828 !important;
}

/* Bouton "+" (Pill Style) */
.content-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-red);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(207, 20, 43, 0.2);
    transition: all 0.2s ease-in-out;
}

.content-add-btn span {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    display: block;
    margin-top: -2px;
}

.content-add-btn:hover {
    background-color: #b01023;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(207, 20, 43, 0.3);
}

h3 {
    color: var(--dark-text);
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 30px;
    font-size: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

/* ================= FORMULAIRES & MODALE ================= */
.form-page-body {
    background-color: var(--light-gray-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* La carte générique */
.form-card {
    background: white;
    width: 100%;
    padding: 60px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* ⚠️ IMPORTANT : Pas d'overflow hidden ici pour les menus */
}

.form-header h2 {
    color: var(--primary-red);
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: all 0.2s;
    background-color: #fcfcfc;
}

.form-control:focus {
    border-color: var(--primary-red);
    background-color: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(207, 20, 43, 0.1);
}

/* Boutons Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 15px;
}

.btn-save,
.btn-cancel,
.btn-add-secondary {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: 0.2s;
    border: none;
}

.btn-save {
    background-color: var(--primary-red);
    color: white;
}

.btn-save:hover {
    background-color: #b01023;
}

.btn-cancel,
.btn-add-secondary {
    background-color: #eee;
    color: #666;
}

.btn-cancel:hover,
.btn-add-secondary:hover {
    background-color: #ddd;
    color: #333;
}

/* Ajustement spécifique pour le bouton "Ajouter un champ" (taille auto) */
.btn-add-secondary {
    width: auto;
    margin-top: 10px;
    display: inline-block;
    flex: initial;
}

.required-field::after {
    content: " *";
    color: var(--primary-red);
    font-weight: bold;
    margin-left: 4px;
}

/* ================= TOM SELECT (Personnalisation Flat) ================= */
/* Reset complet du style par défaut pour l'intégrer au design plat */
.ts-wrapper {
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ts-control {
    box-shadow: none !important;
    background-image: none !important;
    background-color: #fcfcfc !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 12px !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    color: var(--dark-text) !important;
    min-height: auto !important;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    cursor: text !important;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary-red) !important;
    background-color: white !important;
    box-shadow: 0 0 0 3px rgba(207, 20, 43, 0.1) !important;
    outline: none !important;
}

.ts-control input {
    font-size: 15px !important;
    color: var(--dark-text) !important;
    font-family: inherit;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: text !important;
}

.ts-control .item {
    color: var(--dark-text);
    vertical-align: middle;
    cursor: text !important;
}

.ts-wrapper .ts-control div.item[data-value=""] {
    color: #757575;
}

/* Le menu déroulant */
.ts-dropdown {
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    margin-top: 5px !important;
    padding: 0 !important;
    background: white;
    overflow: hidden;
    /* ⚠️ Z-INDEX CRITIQUE POUR PASSER AU DESSUS DE LA MODALE */
    z-index: 999999 !important;
}

.ts-dropdown .option {
    padding: 12px 15px !important;
    font-size: 15px !important;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
}

.ts-dropdown .option.active {
    background-color: #fff0f0 !important;
    color: var(--primary-red) !important;
    font-weight: 600;
}

.ts-wrapper.single .ts-control:after {
    display: none !important;
}

/* Effet Hover */
.ts-wrapper:not(.focus) .ts-control:hover {
    border-color: var(--primary-red) !important;
    background-color: white !important;
    box-shadow: 0 0 0 1px rgba(207, 20, 43, 0.1);
}

/* Correctifs curseur */
.ts-control .ts-input,
.ts-control .ts-input:focus {
    cursor: text !important;
}

.ts-control .item,
.ts-control .ts-placeholder {
    cursor: text !important;
}

#id_assigned_to-ts-control {
    cursor: text !important;
}

/* ================= DOCUMENTS TAB ================= */
.documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 5px;
}

.doc-card {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #eef0f2;
    padding: 16px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 15px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.doc-card:hover {
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(207, 20, 43, 0.08);
    transform: translateY(-4px);
    background: linear-gradient(145deg, #ffffff 0%, #fffafa 100%);
}

.doc-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background: var(--primary-red);
    border-radius: 10px 10px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.doc-card:hover::after {
    opacity: 1;
}

.doc-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    color: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: inset 0 -2px 0 rgba(207, 20, 43, 0.1);
}

.doc-info {
    flex: 1;
    min-width: 0;
    /* Pour l'ellipsis si besoin */
}

.doc-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--dark-text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-desc {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.doc-action {
    color: #cbd5e1;
    font-size: 16px;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8fafc;
}

.doc-card:hover .doc-action {
    color: #fff;
    background: var(--primary-red);
    transform: rotate(-10deg);
}

/* ================= CHOICE MODAL ================= */
.choice-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    gap: 12px;
    background: #fff;
    font-weight: 600;
    color: #475569;
}

.choice-item:hover {
    background: #fff1f2;
    border-color: #fecaca;
    color: var(--primary-red);
    transform: translateX(5px);
}

.choice-item i {
    color: #94a3b8;
    font-size: 18px;
    transition: color 0.2s;
}

.choice-item:hover i {
    color: var(--primary-red);
}

/* ================= MODALE (Overlay) ================= */
.modal-overlay {
    display: none !important;
    pointer-events: none;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;

    /* 👇 NOUVEAU : Centrage vertical/horizontal */
    align-items: center !important;
    justify-content: center !important;

    /* 👇 CRITIQUE : Retire le scroll de l'overlay */
    overflow-y: hidden !important;
    padding: 0;
    /* On retire le padding externe qui gênait le centrage */

    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex !important;
    pointer-events: auto;
    opacity: 1;
}

/* La carte dans la modale */
.modal-overlay .form-card {
    /* Largeur et Padding inchangés */
    width: 700px;
    max-width: 90vw;
    padding: 60px;

    /* 👇 3. TAILLE MAXIMALE ET SCROLL INTERNE */
    max-height: 60vh !important;
    /* Taille fixe relative à l'écran */
    overflow-y: auto !important;
    /* Le scroll est DANS la carte */

    /* 👇 4. Règle pour les coins arrondis (fixe le bug du scrollbar) */
    overflow: hidden;

    /* Design et Animation */
    margin: 0;
    /* Pas de marge, on compte sur le padding de l'overlay */
    border-radius: 16px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .form-card {
    transform: scale(1);
}

/* Scrollbar Webkit */
.modal-overlay .form-card::-webkit-scrollbar {
    width: 0px;
}

.modal-overlay .form-card::-webkit-scrollbar-thumb {
    background-color: rgba(207, 20, 43, 0.3);
    border-radius: 10px;
    border: 3px solid white;
}

.modal-overlay .form-card::-webkit-scrollbar-track {
    background: transparent;
}

/* ================= CASES A COCHER (Grid Box) ================= */
.special-checkbox-style {
    list-style-type: none;
    padding: 0;
    margin: 15px 0 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.special-checkbox-style li {
    margin: 0;
    display: flex;
}

.special-checkbox-style label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background-color: #f4f6f9;
    border: 1px solid #e0e0e0;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 100%;
    box-sizing: border-box;
    color: var(--dark-text);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}

.special-checkbox-style input[type="checkbox"] {
    margin: 0 15px 0 0;
    padding: 0;
    width: 20px;
    height: 20px;
    accent-color: var(--primary-red);
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.special-checkbox-style label:hover {
    background-color: #fff;
    border-color: var(--primary-red);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* --- BARRE DE FILTRES & RECHERCHE (Design "Floating") --- */
.filter-bar {
    display: flex;
    gap: 15px;
    /* On retire le fond gris et les bordures pour fondre dans la page */
    background-color: transparent;
    padding: 0;
    border: none;

    margin-bottom: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    padding: 12px 20px;
    /* Plus d'espace interne */
    border: 1px solid #e0e0e0;
    /* Bordure très subtile */
    border-radius: 30px;
    /* Forme de pilule très arrondie */
    font-size: 14px;
    outline: none;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Fond blanc et petite ombre pour détacher du fond gris de la page */
    background-color: white;
    color: var(--dark-text);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.filter-input {
    flex: 1;
    /* Prend tout l'espace disponible */
    min-width: 250px;
}

.filter-select {
    cursor: pointer;
    min-width: 180px;
    /* Apparence custom pour la flèche (optionnel, dépend du navigateur) */
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 10px auto;
    padding-right: 40px;
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--primary-red);
    box-shadow: 0 4px 12px rgba(207, 20, 43, 0.15);
    /* Ombre rouge légère au focus */
    transform: translateY(-1px);
}

.filter-input::placeholder {
    color: #aaa;
}

/* ===========================================================
   DESIGN MODALE DÉTAILS (Uniquement pour la consultation)
   =========================================================== */

.modal-overlay .form-card.details-card {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden !important;
    background-color: #fff;
}

/* En-tête */
.details-header {
    padding: 20px 30px;
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.details-header h2 {
    margin: 0;
    padding: 0;
    font-size: 20px;
    color: var(--dark-text);
    border: none;
}

.close-btn {
    font-size: 18px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--primary-red);
}

/* Onglets du Modal */
.modal-tabs {
    padding: 0 30px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    display: flex;
    gap: 30px;
    flex-shrink: 0;
}

.modal-tabs .tab-btn {
    background: none;
    border: none;
    padding: 16px 0;
    font-size: 14px;
    color: #888;
    cursor: pointer;
    position: relative;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0;
    margin: 0;
}

.modal-tabs .tab-btn i {
    font-size: 15px;
    opacity: 0.7;
}

.modal-tabs .tab-btn:hover {
    color: #333;
    background: none;
}

.modal-tabs .tab-btn.active {
    color: var(--primary-red);
    box-shadow: none;
    /* Reset shadow from global tab-btn */
}

.modal-tabs .tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-red);
    border-radius: 3px 3px 0 0;
}

.modal-tabs .tab-btn .badge-count {
    background: #f0f0f0;
    color: #666;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.modal-tabs .tab-btn.active .badge-count {
    background: #ffebee;
    color: var(--primary-red);
}

/* --- MINI FILTER BAR (Pour les modaux) --- */
.modal-filter-bar {
    padding: 12px 25px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-filter-input {
    flex: 1;
    min-width: 140px;
    border: 1px solid #ddd;
    border-radius: 30px;
    padding: 7px 15px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.modal-filter-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(207, 20, 43, 0.05);
}

.modal-filter-date {
    width: 135px;
}

/* Corps du Modal */
.details-body {
    padding: 0;
    /* On gère le padding dans les contenus de tab */
    overflow-y: auto;
    flex-grow: 1;
    background-color: #fff;
}

.tab-content-modal {
    padding: 30px;
}

/* --- COMMENTAIRES (DESIGN PREMIUM) --- */
.comments-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.comment-bubble {
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.comment-bubble:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: center;
}

.comment-user {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.comment-user strong {
    color: #334155;
    font-weight: 700;
}

.comment-trash {
    cursor: pointer;
    color: #e2e8f0;
    /* Très discret par défaut */
    transition: all 0.2s ease;
    font-size: 13px;
    padding: 5px;
    margin-right: -5px;
}

/* La poubelle devient un peu plus visible au hover de la bulle */
.comment-bubble:hover .comment-trash {
    color: #94a3b8;
}

.comment-trash:hover {
    color: #ef4444 !important;
    /* Rouge au hover direct */
    background: #fee2e2;
    border-radius: 4px;
}

.comment-content {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    white-space: pre-wrap;
}

.comment-add-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 25px;
}

/* --- ACTIVITÉ (LISTING PROPRE) --- */
.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px 30px;
    border-bottom: 1px solid #f9f9f9;
    transition: background 0.2s;
}

.activity-item:hover {
    background: #fafafa;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-date {
    width: 45px;
    flex-shrink: 0;
    text-align: right;
    padding-top: 4px;
    line-height: 1.2;
}

.date-day {
    display: block;
    font-weight: 700;
    color: #444;
    font-size: 12px;
}

.date-hour {
    display: block;
    color: #999;
    font-size: 11px;
}

.activity-content {
    flex-grow: 1;
    min-width: 0;
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.badge-log {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-create {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-delete {
    background: #ffebee;
    color: #c62828;
}

.badge-update {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-move {
    background: #f3e5f5;
    color: #7b1fa2;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.activity-details {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.log-row {
    margin-bottom: 3px;
}

.log-row.in {
    color: #2e7d32;
}

.log-row.out {
    color: #c62828;
}

.log-row.transfer {
    color: #ef6c00;
}

.target-name {
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    font-size: 13px;
}

.field-label {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    margin-right: 5px;
}

.old-val {
    text-decoration: line-through;
    color: #ccc;
}

.new-val {
    font-weight: 600;
    color: #333;
}

.fa-caret-right {
    color: #ccc;
    margin: 0 5px;
    font-size: 10px;
}

/* Empty States */
.empty-state {
    text-align: center;
    color: #ccc;
    padding: 60px 0;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 15px;
    opacity: 0.4;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Grille d'infos (Top) */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 20px;
    margin-bottom: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item.full-width {
    grid-column: span 2;
}

/* TYPOGRAPHIE UNIFIÉE (Labels) */
.info-item label,
.specs-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    font-family: inherit;
}

/* TYPOGRAPHIE UNIFIÉE (Valeurs) */
.info-item .value {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    line-height: 1.4;
}

.info-item .value a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
}

.value.badge-style {
    font-family: monospace;
    font-size: 15px;
    background: #f4f6f9;
    color: #333;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #eee;
    width: fit-content;
}

/* --- NOUVEAU BLOC CARACTÉRISTIQUES (Tableau Full Width) --- */
.specs-wrapper {
    margin-top: 30px;
    width: 100%;
    display: block;
}

.specs-title {
    margin-bottom: 12px;
    display: block;
    border-bottom: none;
    color: var(--primary-red);
}

.specs-box {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    /* Arrondis respectés */
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f7f7f7;
    background-color: #fff;
    transition: background 0.1s;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-row:hover {
    background-color: #fafafa;
}

/* Alignement parfait des polices dans le tableau */
.spec-key {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.spec-value {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    text-align: right;
}

/* Footer & Boutons Modernes */
.details-footer {
    padding: 15px 30px;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.left-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    border: 1px solid #e0e0e0;
    background: white;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.icon-btn i {
    font-size: 14px;
}

/* Taille icône */

.edit-btn:hover {
    border-color: #ccc;
    color: #333;
    background: #f9f9f9;
    transform: translateY(-1px);
}

.delete-btn {
    color: #c62828;
    border-color: #ffcdd2;
    background: #fff5f5;
}

.delete-btn:hover {
    background: #ffebee;
    border-color: #ef9a9a;
    transform: translateY(-1px);
}

.btn-close-main {
    background: #e0e0e0;
    color: #555;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-close-main:hover {
    background: #d0d0d0;
    color: #333;
}

/* --- ETIQUETTE UTILISATEUR (Style de base) --- */
.user-badge {
    background-color: #f0f7ff;
    /* Bleu très pâle */
    color: #0066cc;
    /* Bleu pro */
    border: 1px solid rgba(0, 102, 204, 0.15);

    padding: 4px 12px;
    border-radius: 20px;
    /* Pill shape */

    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.user-badge i {
    font-size: 11px;
}

/* --- VERSION CLIQUABLE (Uniquement pour le modal) --- */
.user-badge-link {
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-badge-link:hover {
    background-color: #e0efff;
    box-shadow: 0 2px 5px rgba(0, 102, 204, 0.15);
    transform: translateY(-1px);
    color: #0056b3;
    border-color: rgba(0, 102, 204, 0.3);
}

/* Effet visuel quand on drag & drop */
.sortable-ghost {
    background-color: #e0f7fa !important;
    border: 1px dashed #00bcd4 !important;
    opacity: 0.8;
}

#sortable-list li:hover {
    background-color: #fff;
    border-color: #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- STYLE SLIDERS / TOGGLES (Droits Utilisateurs) --- */
.toggle-checkbox-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.toggle-checkbox-list li {
    margin-bottom: 12px;
    background: #fff;
    /* Suppression de la bordure pour un look plus épuré si désiré, sinon garder border: 1px solid #eee; */
    padding: 5px 0;
}

/* Le Label sert de conteneur Flex pour aligner Texte et Switch */
.toggle-checkbox-list label {
    display: flex;
    justify-content: space-between;
    /* Texte à gauche, Switch à droite */
    align-items: center;
    width: 100%;
    cursor: pointer;
    font-size: 15px;
    color: var(--dark-text);
    font-weight: 500;
    margin: 0;
    /* Reset marge */
}

/* --- STYLE SWITCHS MODERNE (Droits Utilisateurs) --- */

/* 1. Le Conteneur Global des options */
#id_roles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Espace entre chaque ligne */
    margin-top: 15px;
}

/* 2. Chaque ligne (Conteneur Label) */
/* Django génère : <div><label><input> Texte</label></div> */
#id_roles div {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: 0.2s;
}

#id_roles div:hover {
    border-color: #ddd;
    background: #fafafa;
}

/* 3. Le Label (Flexbox pour l'alignement) */
#id_roles label {
    display: flex;
    justify-content: space-between;
    /* 👉 Texte à Gauche, Switch à Droite */
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    margin: 0;
    cursor: pointer;
    font-size: 15px;
    color: var(--dark-text);
    font-weight: 500;
    box-sizing: border-box;
    /* Important */
}

/* 4. La Case transformée en Switch (Input) */
#id_roles input[type="checkbox"] {
    order: 2;
    /* 👉 On force le bouton à passer APRÈS le texte */
    appearance: none;
    -webkit-appearance: none;

    width: 44px;
    height: 24px;
    background: #e0e0e0;
    /* Gris éteint */
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

/* 5. Le Rond du Switch */
#id_roles input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 6. État Activé (Vert/Rouge) */
#id_roles input[type="checkbox"]:checked {
    background: var(--primary-red);
}

#id_roles input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

/* --- CROIX ROUGE (Désassigner Tom Select) --- */
.ts-wrapper.single .clear-button {
    color: #c62828 !important;
    /* Rouge visible */
    font-size: 20px !important;
    /* Taille confortable */
    font-weight: 700 !important;
    /* Gras */
    opacity: 1 !important;
    /* Toujours visible */

    /* Positionnement parfait à droite */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);

    cursor: pointer;
    transition: color 0.2s;
}

.ts-wrapper.single .clear-button:hover {
    color: #ff0000 !important;
    /* Rouge vif au survol */
}

/* On décale un peu le texte pour pas qu'il touche la croix */
.ts-wrapper.single.has-items .ts-control {
    padding-right: 40px !important;
}

/* --- BOUTON IMPORTER (Style Secondaire Discret) --- */
.btn-import-secondary {
    /* Hérite de la forme Pilule et de la police de .content-add-btn */

    background-color: white !important;
    /* Fond blanc */
    color: #555 !important;
    /* Texte gris foncé */
    border: 1px solid #ccc !important;
    /* Contour gris subtil */
    box-shadow: none !important;
    /* On retire l'ombre rouge */

    /* Le bouton Importer est plus petit que le bouton Ajouter */
    padding: 8px 16px !important;
    /* Padding réduit */
    font-size: 13px !important;
}

.btn-import-secondary:hover {
    background-color: #f0f0f0 !important;
    border-color: var(--primary-red) !important;
    /* Contour devient rouge au survol */
    color: var(--primary-red) !important;
    transform: none !important;
    /* Supprime l'effet de levée du bouton primaire */
    box-shadow: none !important;
}

/* --- BOUTON RETOUR (Style Pilule Outline) --- */
.btn-back-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    background-color: white;
    color: #555;
    border: 1px solid #ccc;

    padding: 8px 20px;
    border-radius: 30px;
    /* Forme Pilule comme les autres boutons */

    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;

    cursor: pointer !important;
}

.btn-back-outline:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
    color: #333;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* --- TRI TABLEAUX --- */
th.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    /* Empêche de sélectionner le texte en cliquant vite */
    transition: color 0.2s;
}

th.sortable:hover {
    color: var(--primary-red);
    background-color: #f9f9f9;
}

/* Petite icône de tri (flèche) */
th.sortable i {
    margin-left: 5px;
    font-size: 11px;
    color: #ccc;
}

th.sortable:hover i {
    color: var(--primary-red);
}

/* ================= CONFIGURATION COLONNES (Stylehérité) ================= */

/* 1. Le Bouton Engrenage (Basé sur .btn-import-secondary mais circulaire) */
.btn-config-trigger {
    /* Style de base (fond blanc, bordure grise) */
    background-color: white;
    color: #555;
    border: 1px solid #ccc;

    /* Dimensions pour un cercle parfait */
    width: 42px;
    height: 42px;
    border-radius: 50%;

    /* Centrage de l'icône */
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);

    /* Marge pour le décoller des filtres */
    margin-left: 10px;
}

.btn-config-trigger:hover {
    background-color: #f0f0f0;
    border-color: var(--primary-red);
    /* Rouge au survol */
    color: var(--primary-red);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* 2. Liste des colonnes (Basé sur le style #id_roles div) */
#columns-sortable {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
    /* Pour éviter que la scrollbar colle */
}

/* Scrollbar fine pour la liste (Webkit) */
#columns-sortable::-webkit-scrollbar {
    width: 4px;
}

#columns-sortable::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 4px;
}

.col-config-item {
    display: flex;
    justify-content: space-between;
    /* Texte à gauche, Switch à droite */
    align-items: center;

    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.col-config-item:hover {
    border-color: #ddd;
    background: #fafafa;
}

/* Zone de texte et poignée */
.col-info-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.col-drag-handle {
    color: #ccc;
    cursor: grab;
    font-size: 14px;
    padding: 5px;
}

.col-drag-handle:hover {
    color: var(--primary-red);
}

.col-label {
    font-weight: 600;
    color: var(--dark-text);
    font-size: 14px;
}

/* 3. Checkbox style "Switch" (Copie conforme de ton style #id_roles) */
.col-checkbox {
    appearance: none;
    -webkit-appearance: none;

    width: 40px;
    /* Un tout petit peu plus compact que les roles (44px) */
    height: 22px;
    background: #e0e0e0;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

/* Le rond du switch */
.col-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* État coché (Rouge CSD) */
.col-checkbox:checked {
    background: var(--primary-red);
}

.col-checkbox:checked::after {
    transform: translateX(18px);
}

/* --- STYLE SWITCHS GÉNÉRIQUE --- */

.switch-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.switch-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: 0.2s;
    overflow: hidden;
    /* Sécurité pour que rien ne dépasse des bords */
}

.switch-item:hover {
    border-color: #ddd;
    background: #fafafa;
}

/* Le Label : Flexbox gère l'alignement vertical */
.switch-item label {
    display: flex;
    justify-content: space-between;
    /* Texte à Gauche, Switch à Droite */
    align-items: center;
    /* C'est lui qui centre verticalement ! */
    width: 100%;
    padding: 12px 15px;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: var(--dark-text, #333);
    /* Fallback couleur si la var n'existe pas */
    font-weight: 500;
    line-height: 1.2;
    /* Évite que le texte ne soit trop haut */
}

/* L'Input transformé en Switch */
.switch-input {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    background: #e0e0e0;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease;

    flex-shrink: 0;
    display: block;

    /* On force les marges à 0 sauf à droite où on met 10px pour décoller du bord */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 30px !important;
}

/* Le Rond (Le mécanisme) */
.switch-input::after {
    content: '';
    position: absolute;
    top: 2px;
    /* (24px hauteur - 20px rond) / 2 = 2px -> Centrage parfait */
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* État Activé */
.switch-input:checked {
    background: var(--primary-red, #d32f2f);
    /* Fallback rouge */
}

.switch-input:checked::after {
    transform: translateX(20px);
    /* 44px width - 20px rond - 2px left - 2px right = 20px move */
}

.btn-add-dashed {
    width: 100%;
    border: 2px dashed #ddd;
    background: #fafafa;
    color: #888;
    font-weight: 600;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.btn-add-dashed:hover {
    border-color: #bbb;
    background: #f0f0f0;
    color: #555;
}

/* Bouton Sauvegarder */
.btn-save-order {
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-save-order:hover {
    background-color: #b01023;
}

.form-buttons {
    display: flex;
    /* Active l'alignement flexible */
    gap: 15px;
    /* Espace entre les deux boutons */
    align-items: center;
    /* Aligne verticalement au centre */
    justify-content: flex-start;
    /* Aligne le tout à gauche (ou utilise flex-end pour mettre à droite) */
    margin-top: 20px;
    /* Un peu d'espace au-dessus des boutons */
}

/* --- HERO SECTION --- */
.portal-hero {
    background: white;
    padding: 40px 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;

    display: flex;
    /* Active le mode Flexbox */
    flex-direction: column;
    /* Met les éléments les uns sous les autres (Titre, puis P, puis Barre) */
    align-items: center;
    /* FORCE le centrage horizontal parfait de tous les enfants */
    text-align: center;
    /* Garde le texte centré (pour le h1 et le p) */
}

.portal-hero h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
}

.portal-hero p {
    color: #7f8c8d;
    margin-top: 10px;
    font-size: 16px;
}

/* --- BARRE DE RECHERCHE --- */
.search-container {
    width: 100%;
    /* Prend toute la largeur disponible... */
    max-width: 600px;
    /* ...mais s'arrête à 600px max */
    margin-top: 25px;
    /* Espace au-dessus seulement */
    position: relative;
    /* Nécessaire pour l'icône à l'intérieur */
    /* Plus besoin de margin: auto ici car le parent (portal-hero) s'occupe du centrage via align-items */
}

.search-input {
    width: 100%;
    padding: 15px 50px;
    border-radius: 50px;
    border: 2px solid #eee;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

/* --- GRILLE --- */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 50px 20px;
    width: 100%;
    box-sizing: border-box;

    /* AJOUT POUR CENTRER LES CARTES SI ELLES SONT PEU NOMBREUSES 👇 */
    justify-content: center;
}