        :root {
            --bg-dark: #020617;
            --bg-card: #0f172a;
            --accent-primary: #3b82f6;
            --accent-glow: rgba(59, 130, 246, 0.5);
            --accent-success: #10b981;
            --accent-warning: #f59e0b;
            --accent-error: #ef4444;
            --text-main: #f8fafc;
            --text-dim: #94a3b8;
            --border: rgba(255, 255, 255, 0.1);
            --card-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Outfit', sans-serif;
        }

        /* --- Accessibility Utilities --- */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        *:focus-visible {
            outline: 2px solid var(--accent-primary);
            outline-offset: 2px;
        }

        /* Clamp horizontal : empêche tout élément trop large (header, boutons
           admin) d'élargir le viewport logique sur mobile — sinon le navigateur
           dézoome et l'inspection devient inutilisable (éléments hors écran). */
        html, body {
            /* `clip` (et non `hidden`) : clampe l'horizontal SANS faire de html/body
               un conteneur de défilement. Avec `hidden`, overflow-y devient « auto »
               (spec CSS) → body devient un scroller qui ne scrolle pas, et combiné à
               overscroll-behavior:none, la MOLETTE était absorbée dans le vide (la
               barre marchait, pas la molette). `clip` garde le clamp, molette OK. */
            overflow-x: clip;
            max-width: 100%;
            /* iOS : empêche le rubber-band du body (qu'on « tire » et qui laisse
               apparaître une bande blanche déplaçable sous les pages fixes). */
            overscroll-behavior: none;
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-main);
            min-height: 100vh;
            padding: 1.5rem;
            line-height: 1.5;
            background-image:
                radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
        }

        /* --- Header --- */
        header {
            max-width: 1400px;
            margin: 0 auto 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--bg-card);
            padding: 1rem 2rem;
            border-radius: 1rem;
            border: 1px solid var(--border);
            box-shadow: var(--card-shadow);
            gap: 1rem;
        }
        header > .logo { flex: 1; }

        /* Hamburger button */
        .main-menu-btn {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text-primary, #fff);
            width: 44px;
            height: 44px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1.4rem;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: inherit;
            transition: background 0.15s, border-color 0.15s, transform 0.08s;
            flex-shrink: 0;
        }
        .main-menu-btn:hover {
            background: rgba(99, 102, 241, 0.15);
            border-color: rgba(99, 102, 241, 0.5);
        }
        .main-menu-btn:active { transform: scale(0.95); }

        /* Drawer overlay */
        .main-drawer-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.55);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease-out;
            z-index: 950;
        }
        .main-drawer-overlay.is-open {
            opacity: 1;
            pointer-events: auto;
        }

        /* Drawer */
        .main-drawer {
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            width: 320px;
            max-width: 88vw;
            background: var(--bg-card, #0f172a);
            border-right: 1px solid rgba(255, 255, 255, 0.08);
            transform: translateX(-100%);
            transition: transform 0.25s ease-out;
            z-index: 951;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            box-shadow: 6px 0 24px rgba(0, 0, 0, 0.5);
        }
        .main-drawer.is-open { transform: translateX(0); }

        .main-drawer-head {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.1rem 1.25rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }
        .main-drawer-brand {
            font-size: 1.2rem;
            font-weight: 800;
            letter-spacing: -0.5px;
            color: var(--text-primary, #fff);
        }
        .main-drawer-brand span { color: var(--accent-primary, #6366f1); }

        .main-drawer-close {
            background: transparent;
            border: none;
            color: var(--text-dim, #94a3b8);
            font-size: 1.5rem;
            line-height: 1;
            cursor: pointer;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .main-drawer-close:hover {
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-primary, #fff);
        }

        .main-drawer-user {
            padding: 0.85rem 1.25rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            background: rgba(99, 102, 241, 0.05);
        }
        .main-drawer-user:empty { display: none; }
        .main-drawer-user-logo {
            display: block;
            max-width: 170px;
            max-height: 54px;
            width: auto;
            object-fit: contain;
            margin-bottom: 0.55rem;
        }
        .main-drawer-user-name {
            font-weight: 700;
            color: var(--text-primary, #fff);
            font-size: 0.92rem;
            margin-bottom: 0.15rem;
        }
        .main-drawer-user-garage {
            color: var(--text-dim, #94a3b8);
            font-size: 0.78rem;
        }
        .main-drawer-user-role {
            display: inline-block;
            margin-top: 0.35rem;
            padding: 1px 8px;
            border-radius: 5px;
            background: rgba(239, 68, 68, 0.15);
            color: #fca5a5;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        /* ── Compte connecté (« Connecté en tant que … ») ─────────────────
           Identité de l'utilisateur dans le menu mobile, pour éviter de
           travailler par erreur sous le compte d'un autre technicien. */
        .main-drawer-account {
            margin-top: 0.7rem;
            padding-top: 0.7rem;
            border-top: 1px solid rgba(128, 128, 128, 0.18);
        }
        .main-drawer-account-label {
            font-size: 0.62rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-dim, #94a3b8);
            font-weight: 700;
            margin-bottom: 0.2rem;
        }
        .main-drawer-account-name {
            font-weight: 700;
            color: var(--text-primary, #fff);
            font-size: 0.98rem;
        }
        .main-drawer-account-email {
            color: var(--text-dim, #94a3b8);
            font-size: 0.78rem;
            word-break: break-all;
            margin-top: 0.1rem;
        }
        .main-drawer-account-role {
            display: inline-block;
            margin-top: 0.45rem;
            padding: 2px 9px;
            border-radius: 6px;
            background: rgba(99, 102, 241, 0.15);
            color: #6366f1;
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .main-drawer-nav {
            flex: 1;
            padding: 0.5rem 0;
        }

        .main-drawer-section-title {
            padding: 0.85rem 1.25rem 0.4rem;
            font-size: 0.68rem;
            color: var(--text-dim, #94a3b8);
            text-transform: uppercase;
            letter-spacing: 0.07em;
            font-weight: 700;
        }

        .main-drawer-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.7rem 1.25rem;
            color: var(--text-primary, #fff);
            background: transparent;
            border: none;
            width: 100%;
            text-align: left;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.9rem;
            font-weight: 500;
            transition: background 0.12s, color 0.12s;
        }
        .main-drawer-item:hover {
            background: rgba(99, 102, 241, 0.12);
            color: var(--accent-primary, #6366f1);
        }
        .main-drawer-item:active {
            background: rgba(99, 102, 241, 0.2);
        }
        .main-drawer-item-icon {
            width: 24px;
            text-align: center;
            font-size: 1.05rem;
            flex-shrink: 0;
        }
        .main-drawer-item-label { flex: 1; }

        .main-drawer-divider {
            height: 1px;
            background: rgba(255, 255, 255, 0.05);
            margin: 0.4rem 0;
        }
        .main-drawer-divider:last-child { display: none; }

        body.drawer-open { overflow: hidden; }

        /* ═══════════════════════════════════════════════════════════════
           INSPECTION MODAL — plein écran qui héberge le DVIForm
           ═══════════════════════════════════════════════════════════════ */
        .inspection-modal {
            position: fixed;
            inset: 0;
            background: var(--bg-dark, #020617);
            z-index: 10001;  /* au-dessus de .admin-modal (10000) */
            display: flex;
            flex-direction: column;
            animation: inspModalIn 0.18s ease-out;
        }
        @keyframes inspModalIn {
            from { opacity: 0; transform: translateY(8px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        .inspection-modal-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem 1rem;
            background: var(--bg-card, #0f172a);
            border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
            flex-shrink: 0;
        }

        .inspection-modal-back {
            background: rgba(255, 255, 255, 0.06);
            border: 1px solid rgba(255, 255, 255, 0.12);
            color: var(--text-primary, #fff);
            border-radius: 7px;
            padding: 0.5rem 0.9rem;
            cursor: pointer;
            font-family: inherit;
            font-size: 0.85rem;
            font-weight: 600;
            transition: background 0.15s;
            min-height: 40px;
        }
        .inspection-modal-back:hover {
            background: rgba(99, 102, 241, 0.18);
        }

        .inspection-modal-title {
            flex: 1;
            color: var(--text-primary, #fff);
            font-size: 0.92rem;
            font-weight: 700;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .inspection-modal-close {
            background: transparent;
            border: none;
            color: var(--text-dim, #94a3b8);
            font-size: 1.5rem;
            line-height: 1;
            cursor: pointer;
            width: 40px;
            height: 40px;
            border-radius: 6px;
        }
        .inspection-modal-close:hover {
            background: rgba(255, 255, 255, 0.06);
            color: var(--text-primary, #fff);
        }

        .inspection-modal-body {
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            min-height: 0;
        }
        .inspection-modal-body > .dvi-form {
            flex: 1;
            min-height: 0;
        }

        body.inspection-open { overflow: hidden; }

        /* ═══ Mode « pages » (Phase 1) : Atelier & Inspection sous l'en-tête ═══
           Au lieu de pop-ups plein écran qui recouvrent l'en-tête, on les
           affiche comme de vraies pages SOUS l'en-tête habituel (toujours
           visible). L'offset --app-view-top (hauteur de l'en-tête) est calculé
           en JS (app-view.js). */
        body.app-paged header[role="banner"] {
            position: sticky;
            top: 0;
            z-index: 10;          /* au-dessus des vues (z:1), sous drawer/modals/toasts */
        }

        /* ═══ Bandeau « Mode admin » (impersonation de garage) ═══
           Affiché quand un sysadmin « entre » dans un garage. Fixe en haut ;
           l'en-tête sticky et le contenu sont décalés de 42px en dessous. */
        .impersonation-banner {
            position: fixed;
            top: 0; left: 0; right: 0;
            height: 42px;
            z-index: 9000;        /* au-dessus de l'en-tête (10), sous drawer/modals/toasts */
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            padding: 0 1rem;
            background: linear-gradient(90deg, #5a1aa0, #7a3cc0);
            color: #fff;
            font-size: 0.86rem;
            font-weight: 600;
            box-shadow: 0 2px 10px rgba(0,0,0,0.25);
        }
        .impersonation-banner-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .impersonation-banner-exit {
            flex: 0 0 auto;
            background: rgba(255,255,255,0.18);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.55);
            border-radius: 999px;
            padding: 5px 14px;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
        }
        .impersonation-banner-exit:hover { background: rgba(255,255,255,0.32); }
        body.fs-impersonating { padding-top: 42px; }
        body.fs-impersonating header[role="banner"] { top: 42px; }
        body.app-paged #dashboard-modal,
        body.app-paged #inspection-modal,
        body.app-paged #establishment-modal,
        body.app-paged #clients-modal {
            position: fixed;
            top: var(--app-view-top, 96px);
            /* bottom: 0 EN PERMANENCE — la vue colle toujours au bas de l'écran.
               On NE rétrécit PLUS la vue à l'ouverture du clavier : la hauteur du
               clavier estimée via visualViewport surestime (barre Safari + indicateur
               d'accueil), ce qui laissait une bande grise (fond de l'app) entre le
               contenu et le clavier, qui « ne s'enlevait pas ». À la place, on
               replie le chrome supérieur (fs-kb-open ci-dessous) et on fait défiler
               le champ vers le haut : il reste visible SANS jamais découvrir de gris. */
            left: 0; right: 0; bottom: 0;
            z-index: 1;
            background: var(--bg-dark, #020617);
            animation: none;
            /* Coupe tout défilement horizontal parasite (le contenu ne « flotte »
               plus des deux côtés quand un enfant déborde légèrement). */
            overflow-x: hidden;
            /* iOS : pas de chaînage du scroll interne vers le body (évite le
               rubber-band qui laisse voir une bande blanche « qu'on peut bouger »). */
            overscroll-behavior: contain;
        }
        body.app-paged #dashboard-modal.hidden,
        body.app-paged #inspection-modal.hidden,
        body.app-paged #establishment-modal.hidden,
        body.app-paged #clients-modal.hidden { display: none !important; }

        /* Clients (CRM) : même mise en page que l'Atelier — carte pleine hauteur. */
        body.app-paged #clients-modal {
            display: flex;
            justify-content: center;
            padding: 1rem 1.25rem 1.25rem;
        }
        body.app-paged #clients-modal .admin-modal-backdrop { display: none; }
        body.app-paged #clients-modal .clients-modal-content {
            height: 100%; width: 100%; max-width: 1400px; box-shadow: none;
        }

        /* Établissement (Personnel/Inspections/Options/Détails) : même mise en
           page que l'Atelier — carte pleine hauteur sous l'en-tête. */
        body.app-paged #establishment-modal {
            display: flex;
            justify-content: center;
            padding: 1rem 1.25rem 1.25rem;
        }
        body.app-paged #establishment-modal .admin-modal-backdrop { display: none; }
        body.app-paged #establishment-modal .establishment-modal-content {
            height: 100%;
            width: 100%;
            max-width: 1400px;
            box-shadow: none;
        }

        /* Atelier : carte pleine hauteur, sans backdrop ni ombre de pop-up */
        body.app-paged #dashboard-modal {
            display: flex;
            justify-content: center;
            padding: 1rem 1.25rem 1.25rem;
        }
        body.app-paged #dashboard-modal .admin-modal-backdrop { display: none; }
        body.app-paged #dashboard-modal .dashboard-modal-content {
            height: 100%;
            width: 100%;
            max-width: 1400px;
            box-shadow: none;
        }
        /* overflow-y:auto force overflow-x:auto (spec CSS) → un débordement
           horizontal rendait la zone scrollable latéralement. On le coupe. */
        body.app-paged #dashboard-modal .admin-modal-body,
        body.app-paged #establishment-modal .admin-modal-body { overflow-x: hidden; }

        /* Inspection : colonne (sous-barre ← Atelier + corps) qui remplit la zone */
        body.app-paged #inspection-modal {
            display: flex;
            flex-direction: column;
        }

        /* SMS & Tâches restent des FENÊTRES (pratique : ouvrables pendant une
           inspection sans la quitter), mais positionnées SOUS l'en-tête
           (toujours visible) au lieu de le recouvrir. Le fond grisé
           (.admin-modal-backdrop, position:absolute) ne couvre alors que la
           zone sous l'en-tête. */
        body.app-paged #sms-modal,
        body.app-paged #tasks-modal {
            top: var(--app-view-top, 96px);
        }

        /* La barre flottante devient inutile : l'en-tête (SMS/Tâches/Présence)
           est désormais toujours visible. */
        body.app-paged #quick-actions-bar { display: none !important; }

        /* Outils admin flottants (audits, import) = desktop only : sur mobile ils
           chevauchaient l'en-tête. Masqués sur petit écran. */
        @media (max-width: 760px) {
            .admin-orphan-audit-btn,
            .billing-import-btn { display: none !important; }
        }
        /* Et masqués dès qu'une page de travail est active (Atelier / Inspection /
           Établissement) : ils chevauchaient le coin haut-droit et bloquaient le
           bouton de fermeture. Ils restent disponibles sur l'accueil. */
        body.app-paged:not(.view-home) .admin-orphan-audit-btn,
        body.app-paged:not(.view-home) .billing-import-btn { display: none !important; }

        /* Sur téléphone, dans les pages de travail (Atelier / Inspection /
           Établissement), l'en-tête se réduit à ☰ + logo. Les boutons
           (Atelier, SMS, Tâches, Aide, Présence, Connexion) restaient sur 2
           rangées et mangeaient ~40 % de l'écran, rendant l'inspection
           « innavigable » sur mobile. Tout reste accessible via le menu ☰
           (SMS/Tâches y sont ajoutés). L'offset --app-view-top se recalcule
           tout seul (app-view.js) → le contenu remonte d'autant. */
        @media (max-width: 720px) {
            body.app-paged.view-inspection .auth-controls,
            body.app-paged.view-atelier .auth-controls,
            body.app-paged.view-establishment .auth-controls { display: none !important; }

            /* ═══ Mobile : vues en FLUX NORMAL (pas position:fixed) ═══
               C'est LA solution de fond aux bugs iOS du clavier. En position:fixed,
               iOS ne rétrécit pas l'élément à l'ouverture du clavier → champ caché,
               et toute tentative de compensation (mesurer la hauteur du clavier)
               est faussée par la barre d'outils dynamique de Safari → bande grise.
               En flux normal, c'est le DOCUMENT qui défile : iOS gère le clavier
               NATIVEMENT (il remonte le champ focalisé au-dessus du clavier, de
               façon fiable et sans bande grise). L'en-tête reste collé en haut
               (sticky). Le bureau garde position:fixed (aucun clavier → aucun bug). */
            body.app-paged #dashboard-modal,
            body.app-paged #inspection-modal,
            body.app-paged #establishment-modal,
            body.app-paged #clients-modal {
                position: static;
                top: auto; left: auto; right: auto; bottom: auto;
                height: auto;
                min-height: calc(100vh - var(--app-view-top, 56px));
                min-height: calc(100dvh - var(--app-view-top, 56px));
                overscroll-behavior: auto;
                padding: 0;
                /* IMPORTANT : overflow visible. Sinon l'overflow-x:hidden (hérité
                   de la règle desktop) force overflow-y à « auto » (spec CSS) →
                   la vue devient son PROPRE conteneur de scroll → scroll imbriqué
                   + sticky cassé. Le clip horizontal est assuré par html,body. */
                overflow: visible;
            }
            /* L'inspection : le corps ne défile plus en INTERNE ; il pousse le
               document (c'est le document qui défile → clavier natif OK). */
            body.app-paged #inspection-modal .dvi-form-body {
                overflow: visible;
                flex: none;
            }
            body.app-paged #inspection-modal .dvi-form-layout { min-height: 0; }
            /* La barre de catégories reste atteignable : elle colle SOUS l'en-tête. */
            body.app-paged #inspection-modal .dvi-form-sidebar {
                position: sticky;
                top: var(--app-view-top, 56px);
                z-index: 4;
            }
            /* Atelier & Établissement sont en display:flex (RANGÉE) ; align-items
               vaut « stretch » par défaut → la carte était étirée à une hauteur
               FIXE (min-height) et son contenu plus long était COUPÉ (« je ne peux
               pas descendre plus bas »). On aligne en haut : la carte prend sa
               hauteur de contenu et c'est le document qui défile. (L'inspection est
               un flex COLONNE → pas concernée.) */
            body.app-paged #dashboard-modal,
            body.app-paged #establishment-modal,
            body.app-paged #clients-modal { align-items: flex-start; }
            body.app-paged #clients-modal .clients-modal-content {
                height: auto; max-height: none; overflow: visible;
                min-height: calc(100dvh - var(--app-view-top, 56px));
            }
            /* Mobile : la fiche passe SOUS la liste */
            #clients-modal .clients-body { grid-template-columns: 1fr; }
            #clients-modal .clients-list-pane { border-right: none; border-bottom: 1px solid var(--fs-border, #e6e8ec); }
            #clients-modal .clients-coord { grid-template-columns: 1fr; }
            /* Atelier & Établissement : la carte occupe le flux, contenu visible
               (plus de scroll interne → le document défile). */
            body.app-paged #dashboard-modal .dashboard-modal-content,
            body.app-paged #establishment-modal .establishment-modal-content {
                height: auto;
                /* .admin-modal-content (style popup partagé) plafonne à 88vh +
                   overflow:hidden → la carte coupait son contenu (« je ne peux pas
                   descendre »). On lève le plafond et le clip : la carte grandit
                   avec son contenu et le document défile. */
                max-height: none;
                overflow: visible;
                min-height: calc(100vh - var(--app-view-top, 56px));
                min-height: calc(100dvh - var(--app-view-top, 56px));
            }
            body.app-paged #dashboard-modal .admin-modal-body,
            body.app-paged #establishment-modal .admin-modal-body { overflow: visible; }
        }

        /* Sur tablette/téléphone : le header reste compact */
        @media (max-width: 600px) {
            .inspection-modal-header {
                padding: 0.55rem 0.65rem;
                gap: 0.4rem;
                /* Reste visible en haut pendant qu'on fait défiler l'inspection :
                   le technicien peut revenir à l'atelier à tout moment (← Atelier). */
                position: sticky;
                top: 0;
                z-index: 30;
            }
            .inspection-modal-back {
                padding: 0.4rem 0.65rem;
                font-size: 0.78rem;
            }
            .inspection-modal-title {
                font-size: 0.82rem;
            }
        }

        /* Responsive : sur petit écran on cache le badge utilisateur dans le header (visible dans drawer) */
        @media (max-width: 720px) {
            body { padding: 0.75rem; }
            header { padding: 0.85rem 1rem; gap: 0.5rem; flex-wrap: wrap; }
            .logo { font-size: 1.4rem; }
            .user-badge, .garage-badge { display: none !important; }
            /* Les contrôles s'enroulent et ne forcent jamais la largeur de la page */
            .auth-controls { flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; min-width: 0; }
        }

        .logo {
            font-size: 1.8rem;
            font-weight: 800;
            letter-spacing: -1px;
            background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .header-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(16, 185, 129, 0.1);
            padding: 0.4rem 1rem;
            border-radius: 2rem;
            border: 1px solid rgba(16, 185, 129, 0.2);
            color: var(--accent-success);
            font-size: 0.85rem;
            font-weight: 700;
        }

        /* --- Layout --- */
        .container {
            max-width: 1400px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 400px 1fr;
            gap: 2rem;
        }

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

        /* --- Sidebar & Inputs --- */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .card {
            background: var(--bg-card);
            border-radius: 1.25rem;
            padding: 1.75rem;
            border: 1px solid var(--border);
            box-shadow: var(--card-shadow);
            position: relative;
            overflow: hidden;
        }

        .section-title {
            font-size: 0.9rem;
            font-weight: 800;
            color: var(--accent-primary);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 1.25rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .input-group {
            margin-bottom: 1.25rem;
        }

        label {
            display: block;
            margin-bottom: 0.5rem;
            color: var(--text-dim);
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        input,
        select {
            width: 100%;
            background: #020617;
            border: 1px solid var(--border);
            border-radius: 0.75rem;
            padding: 0.8rem 1rem;
            color: white;
            font-size: 0.95rem;
            transition: var(--transition);
        }

        input:focus,
        select:focus {
            outline: none;
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
        }

        input[type="number"]::-webkit-inner-spin-button {
            display: none;
        }

        .api-status {
            padding: 0.75rem;
            border-radius: 0.75rem;
            background: rgba(0, 0, 0, 0.2);
            margin-top: -0.5rem;
            margin-bottom: 1rem;
            font-size: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            border: 1px solid var(--border);
        }

        .loader {
            width: 14px;
            height: 14px;
            border: 2px solid var(--accent-primary);
            border-bottom-color: transparent;
            border-radius: 50%;
            display: none;
            animation: rotate 1s linear infinite;
        }

        @keyframes rotate {
            100% {
                transform: rotate(360deg);
            }
        }

        .btn-group {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-top: 1rem;
        }

        button {
            padding: 0.9rem;
            border-radius: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            font-size: 0.9rem;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--accent-primary), #2563eb);
            color: white;
            box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
        }

        .btn-primary:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 15px 20px -3px rgba(37, 99, 235, 0.4);
        }

        .btn-primary:active:not(:disabled) {
            transform: translateY(0);
        }

        .btn-primary:disabled {
            background: #334155;
            color: #64748b;
            cursor: not-allowed;
            box-shadow: none;
        }

        .btn-secondary {
            background: rgba(148, 163, 184, 0.1);
            color: var(--text-dim);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            background: rgba(148, 163, 184, 0.2);
            color: white;
        }

        /* --- Results Area --- */
        .results-panel {
            min-height: 600px;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .empty-state {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-dim);
            text-align: center;
            padding: 5rem 2rem;
            border: 2px dashed var(--border);
            border-radius: 2rem;
        }

        /* --- Report Design --- */
        .report-header {
            display: grid;
            grid-template-columns: 1fr auto;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .report-title h2 {
            font-size: 2.25rem;
            font-weight: 800;
            letter-spacing: -1px;
            margin-bottom: 0.25rem;
        }

        .report-title p {
            color: var(--accent-primary);
            font-weight: 700;
            font-size: 1rem;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .report-actions {
            display: flex;
            gap: 0.75rem;
        }

        .badge-btn {
            background: var(--bg-card);
            border: 1px solid var(--border);
            color: var(--text-main);
            padding: 0.5rem 1rem;
            font-size: 0.75rem;
            border-radius: 0.5rem;
            font-weight: 700;
            cursor: pointer;
            transition: var(--transition);
        }

        .badge-btn:hover {
            background: var(--accent-primary);
            border-color: var(--accent-primary);
        }

        .specs-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .spec-card {
            background: rgba(2, 6, 23, 0.4);
            padding: 1.25rem;
            border-radius: 1rem;
            border: 1px solid var(--border);
        }

        .spec-label {
            font-size: 0.65rem;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 0.35rem;
            display: block;
        }

        .spec-value {
            font-size: 1.1rem;
            font-weight: 800;
            color: white;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* --- Maintenance Table --- */
        .table-container {
            border-radius: 1rem;
            overflow: hidden;
            border: 1px solid var(--border);
            background: rgba(15, 23, 42, 0.4);
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        th {
            background: rgba(15, 23, 42, 0.8);
            text-align: left;
            padding: 1rem 1.5rem;
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 1px;
            border-bottom: 1px solid var(--border);
        }

        td {
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--border);
            font-size: 0.95rem;
        }

        tr:last-child td {
            border-bottom: none;
        }

        .task-name {
            font-weight: 700;
            display: flex;
            flex-direction: column;
        }

        .task-note {
            font-size: 0.8rem;
            font-weight: 400;
            color: var(--text-dim);
            margin-top: 0.25rem;
        }

        .status-pill {
            display: inline-flex;
            align-items: center;
            padding: 0.35rem 0.85rem;
            border-radius: 2rem;
            font-size: 0.75rem;
            font-weight: 800;
            letter-spacing: 0.5px;
        }

        .status-urgent {
            background: rgba(239, 68, 68, 0.15);
            color: var(--accent-error);
        }

        .status-warning {
            background: rgba(245, 158, 11, 0.15);
            color: var(--accent-warning);
        }

        .status-ok {
            background: rgba(16, 185, 129, 0.15);
            color: var(--accent-success);
        }

        /* --- Expert Notes Section --- */
        .notes-section {
            margin-top: 1rem;
        }

        .note-card {
            background: linear-gradient(to right, rgba(59, 130, 246, 0.1), transparent);
            border-left: 4px solid var(--accent-primary);
            padding: 1.5rem;
            border-radius: 0 1rem 1rem 0;
            font-size: 0.9rem;
        }

        .note-card h4 {
            font-size: 0.8rem;
            font-weight: 800;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
            color: var(--accent-primary);
        }

        .note-list {
            list-style: none;
        }

        .note-list li {
            position: relative;
            padding-left: 1.5rem;
            margin-bottom: 0.5rem;
        }

        .note-list li::before {
            content: "→";
            position: absolute;
            left: 0;
            color: var(--accent-primary);
            font-weight: 800;
        }

        /* --- Auth & Modal --- */
        .auth-controls {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .user-badge {
            color: var(--accent-success);
            font-weight: 700;
            font-size: 0.9rem;
        }

        .garage-badge {
            display: inline-flex;
            align-items: center;
            padding: 0.2rem 0.5rem;
            border-radius: 0.5rem;
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0.3px;
            background: rgba(59, 130, 246, 0.1);
            color: var(--accent-primary);
            border: 1px solid rgba(59, 130, 246, 0.25);
            white-space: nowrap;
            overflow: hidden;
        }

        .garage-badge:has(.garage-logo) {
            background: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 0.15rem 0.4rem;
            border-radius: 0.4rem;
        }

        .garage-logo {
            height: 38px;
            width: auto;
            max-width: 220px;
            object-fit: contain;
            display: block;
        }

        .hidden {
            display: none !important;
        }

        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background-color: var(--bg-card);
            padding: 2rem;
            border-radius: 1rem;
            width: 90%;
            max-width: 500px;
            position: relative;
            border: 1px solid var(--border);
        }

        .close-modal {
            position: absolute;
            right: 1.5rem;
            top: 1rem;
            font-size: 2rem;
            cursor: pointer;
            color: var(--text-dim);
        }

        .close-modal:hover {
            color: white;
        }

        #login-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            background: var(--bg-dark);
            z-index: 900;
            display: none;
            /* Changed to Flex Row for Split Screen */
            flex-direction: row;
            align-items: stretch;
            justify-content: flex-start;
        }

        .login-left {
            width: 40%;
            background: var(--bg-card);
            padding: 4rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: flex-start;
            position: relative;
            box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
            z-index: 2;
            border-right: 1px solid var(--border);
        }

        .login-right {
            width: 60%;
            position: relative;
            background-color: #0f172a;
            /* Placeholder for image - user needs to ensure file exists or update path */
            background-image: url('saas_automotive_background_1768431021755.png');
            background-size: cover;
            background-position: center;
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 4rem;
        }

        .login-right::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, rgba(2, 6, 23, 0.95) 0%, rgba(37, 99, 235, 0.3) 100%);
            z-index: 1;
        }

        .login-content-right {
            position: relative;
            z-index: 2;
            color: white;
            max-width: 700px;
        }

        .marketing-list {
            list-style: none;
            margin-top: 2.5rem;
        }

        .marketing-list li {
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            font-size: 1.1rem;
            color: #e2e8f0;
        }

        .marketing-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: rgba(16, 185, 129, 0.1);
            color: var(--accent-success);
            border-radius: 50%;
            font-size: 1.2rem;
            border: 1px solid rgba(16, 185, 129, 0.2);
        }

        @media (max-width: 1000px) {
            #login-overlay {
                flex-direction: column;
            }

            .login-left {
                width: 100%;
                height: 50%;
                padding: 2rem;
            }

            .login-right {
                width: 100%;
                height: 50%;
                padding: 2rem;
                display: none;
            }

            /* Hide image on mobile for simpler login */
        }

        /* --- Printing --- */
        @media print {
            body {
                background: white;
                color: black;
                padding: 0;
            }

            .sidebar,
            header,
            .badge-btn,
            .header-badge {
                display: none !important;
            }

            .container {
                display: block;
            }

            .card {
                border: none;
                box-shadow: none;
                background: transparent;
                padding: 0;
            }

            .spec-card {
                background: #f1f5f9;
                border: 1px solid #cbd5e1;
            }

            .spec-value {
                color: black;
            }

            .table-container {
                border: 1px solid #cbd5e1;
            }

            th {
                color: #64748b;
                background: #e2e8f0;
                border-bottom: 2px solid #cbd5e1;
            }

            td {
                border-bottom: 1px solid #cbd5e1;
                color: black;
            }

            .note-card {
                border: 1px solid #cbd5e1;
                border-left: 4px solid black;
                background: #f8fafc;
                color: black;
            }

            .status-pill {
                border: 1px solid #cbd5e1;
                color: black !important;
                background: transparent !important;
            }

            /* ── Légende du suivi d'entretien (visible uniquement à l'impression) ── */
            .logbook-print-legend {
                display: block !important;
                margin-top: 1.5rem;
                padding: 12px 16px;
                border: 1px solid #cbd5e1;
                border-radius: 8px;
                background: #f8fafc;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-print-legend-title {
                font-size: 0.75rem;
                font-weight: 800;
                text-transform: uppercase;
                letter-spacing: 1px;
                color: #1e293b;
                margin-bottom: 8px;
            }

            .logbook-print-legend-items {
                display: flex;
                gap: 24px;
                flex-wrap: wrap;
            }

            .logbook-print-legend-item {
                display: flex;
                align-items: center;
                gap: 6px;
                font-size: 0.72rem;
                color: #334155;
            }

            .logbook-print-legend-dot {
                width: 10px;
                height: 10px;
                border-radius: 50%;
                flex-shrink: 0;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }
        }

        /* Légende du carnet — masquée à l'écran */
        .logbook-print-legend {
            display: none;
        }

        /* En-tête garage — masqué à l'écran, visible à l'impression */
        .garage-print-header {
            display: none;
        }

        /* ═══ ADMIN: Alerte enregistrements orphelins ═══ */
        .orphan-alert {
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(245, 158, 11, 0.04));
            border: 1px solid rgba(251, 191, 36, 0.3);
            border-left: 4px solid #f59e0b;
            border-radius: 10px;
            padding: 14px 18px;
            margin-bottom: 16px;
            transition: opacity 0.3s ease;
        }

        .orphan-alert-header {
            display: flex;
            flex-direction: column;
            gap: 2px;
            margin-bottom: 10px;
        }

        .orphan-alert-header span {
            font-weight: 700;
            font-size: 0.85rem;
            color: #f59e0b;
        }

        .orphan-alert-header small {
            font-size: 0.72rem;
            color: #92400e;
            opacity: 0.7;
        }

        .orphan-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .orphan-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(251, 191, 36, 0.06);
            border: 1px solid rgba(251, 191, 36, 0.15);
            border-radius: 8px;
            padding: 8px 12px;
            transition: all 0.3s ease;
        }

        .orphan-info {
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

        .orphan-key {
            font-size: 0.78rem;
            font-weight: 700;
            color: #d97706;
            font-family: 'JetBrains Mono', monospace;
        }

        .orphan-data {
            font-size: 0.7rem;
            color: #92400e;
            opacity: 0.8;
        }

        .orphan-delete-btn {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.2);
            border-radius: 6px;
            padding: 4px 8px;
            cursor: pointer;
            font-size: 0.8rem;
            transition: all 0.2s ease;
        }

        .orphan-delete-btn:hover {
            background: rgba(239, 68, 68, 0.2);
            border-color: #ef4444;
            transform: scale(1.05);
        }

        .orphan-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .orphan-migrate-select {
            background: rgba(59, 130, 246, 0.08);
            border: 1px solid rgba(59, 130, 246, 0.25);
            border-radius: 6px;
            padding: 4px 8px;
            font-size: 0.72rem;
            color: #1e3a8a;
            max-width: 240px;
            cursor: pointer;
            font-family: inherit;
        }

        .orphan-migrate-select:focus {
            outline: none;
            border-color: #3b82f6;
            background: rgba(59, 130, 246, 0.15);
        }

        .orphan-migrate-btn {
            background: rgba(59, 130, 246, 0.1);
            border: 1px solid rgba(59, 130, 246, 0.25);
            border-radius: 6px;
            padding: 4px 10px;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 700;
            color: #1e3a8a;
            transition: all 0.2s ease;
        }

        .orphan-migrate-btn:hover:not(:disabled) {
            background: rgba(59, 130, 246, 0.22);
            border-color: #3b82f6;
            transform: scale(1.05);
        }

        .orphan-migrate-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }

        /* ═══════════════════════════════════════════════════════════════
           ADMIN — Dashboard audit orphelins globaux
        ═══════════════════════════════════════════════════════════════ */
        .admin-orphan-audit-btn {
            position: fixed;
            top: 76px;
            right: 20px;
            z-index: 9000;
            background: linear-gradient(135deg, #1e3a8a, #3b82f6);
            color: #fff;
            border: none;
            padding: 10px 16px;
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
            transition: all 0.2s ease;
            font-family: inherit;
        }
        .admin-orphan-audit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
        }

        .admin-modal {
            position: fixed;
            inset: 0;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        /* Le formulaire « Nouvelle tâche » est un sous-dialogue : il doit s'afficher
           AU-DESSUS de la liste des tâches (sinon il restait caché derrière elle). */
        #task-form-modal { z-index: 11000; }

        /* ─── Bannière statut cloud (mode hors-ligne) ───────── */
        .fs-cloud-banner {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 13000;
            display: none;
            align-items: center;
            gap: 0.85rem;
            padding: 0.75rem 1.2rem;
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: #fff;
            box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
            border-bottom: 2px solid #b45309;
            font-family: 'Outfit', system-ui, -apple-system, sans-serif;
            animation: fs-cloud-slide-in 0.25s ease-out;
        }
        .fs-cloud-banner.is-visible { display: flex; }
        @keyframes fs-cloud-slide-in {
            from { transform: translateY(-100%); }
            to   { transform: translateY(0); }
        }
        .fs-cloud-banner-icon {
            font-size: 1.4rem;
            flex-shrink: 0;
            line-height: 1;
        }
        .fs-cloud-banner-text {
            flex: 1;
            font-size: 0.92rem;
            line-height: 1.35;
            min-width: 0;
        }
        .fs-cloud-banner-text strong {
            color: #fff;
            font-weight: 700;
        }
        .fs-cloud-banner-actions {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-shrink: 0;
        }
        .fs-cloud-banner-dismiss {
            background: transparent;
            color: #fff;
            border: none;
            font-size: 1.6rem;
            line-height: 1;
            padding: 0 0.4rem;
            cursor: pointer;
            opacity: 0.85;
            transition: opacity 0.15s;
        }
        .fs-cloud-banner-dismiss:hover { opacity: 1; }
        /* En mode rapport public, on cache la bannière (le client n'a pas à la voir) */
        html.public-report-mode .fs-cloud-banner { display: none !important; }
        @media (max-width: 600px) {
            .fs-cloud-banner { padding: 0.6rem 0.85rem; gap: 0.6rem; }
            .fs-cloud-banner-text { font-size: 0.85rem; }
        }

        /* ─── Lightbox photo (plein écran) ───────────────────── */
        .fs-lightbox {
            position: fixed;
            inset: 0;
            z-index: 12000;
            background: rgba(0, 0, 0, 0.92);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            animation: fs-lb-fade-in 0.18s ease-out;
        }
        .fs-lightbox.is-visible { display: flex; }
        @keyframes fs-lb-fade-in {
            from { opacity: 0; }
            to   { opacity: 1; }
        }
        .fs-lightbox-stage {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.6rem;
            max-width: 92vw;
            max-height: 92vh;
        }
        .fs-lightbox-img,
        .fs-lightbox-video {
            max-width: 92vw;
            max-height: 78vh;
            object-fit: contain;
            border-radius: 8px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
            background: #1f2937;
        }
        .fs-lightbox-video {
            width: auto;
            height: auto;
        }
        .fs-lightbox-img[hidden],
        .fs-lightbox-video[hidden] { display: none; }
        .fs-lightbox-meta {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 10px;
            padding: 0.6rem 1rem;
            max-width: 92vw;
            color: #f1f5f9;
            backdrop-filter: blur(6px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
        }
        .fs-lightbox-meta-row {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            font-size: 0.92rem;
            line-height: 1.3;
        }
        .fs-lightbox-meta-icon {
            font-size: 1rem;
            flex-shrink: 0;
        }
        .fs-lightbox-meta-text {
            color: #e2e8f0;
            font-weight: 500;
        }
        .fs-lightbox-meta-who { color: #c7d2fe; font-weight: 600; }
        .fs-lightbox-close {
            position: absolute;
            top: 18px;
            right: 22px;
            width: 44px;
            height: 44px;
            background: rgba(0, 0, 0, 0.55);
            color: #fff;
            border: 2px solid rgba(255, 255, 255, 0.4);
            border-radius: 50%;
            font-size: 1.6rem;
            font-weight: 300;
            line-height: 1;
            cursor: pointer;
            transition: background 0.15s, transform 0.15s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .fs-lightbox-close:hover {
            background: rgba(239, 68, 68, 0.85);
            border-color: #fff;
            transform: scale(1.05);
        }
        .fs-lightbox-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 48px;
            height: 48px;
            background: rgba(0, 0, 0, 0.55);
            color: #fff;
            border: 2px solid rgba(255, 255, 255, 0.35);
            border-radius: 50%;
            font-size: 2rem;
            line-height: 1;
            cursor: pointer;
            transition: background 0.15s, transform 0.15s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .fs-lightbox-prev { left: 22px; }
        .fs-lightbox-next { right: 22px; }
        .fs-lightbox-nav:hover {
            background: rgba(99, 102, 241, 0.85);
            border-color: #fff;
            transform: translateY(-50%) scale(1.08);
        }
        .fs-lightbox-counter {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.65);
            color: #fff;
            border-radius: 999px;
            padding: 0.4rem 1rem;
            font-size: 0.9rem;
            font-weight: 600;
            letter-spacing: 0.05em;
        }
        @media (max-width: 600px) {
            .fs-lightbox-close { width: 38px; height: 38px; top: 12px; right: 12px; }
            .fs-lightbox-nav { width: 40px; height: 40px; }
            .fs-lightbox-prev { left: 8px; }
            .fs-lightbox-next { right: 8px; }
        }
        .admin-modal-backdrop {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.55);
            backdrop-filter: blur(4px);
        }
        .admin-modal-content {
            position: relative;
            background: #fff;
            border-radius: 14px;
            max-width: 1100px;
            width: 100%;
            max-height: 88vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
            overflow: hidden;
        }
        .admin-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 24px;
            border-bottom: 1px solid #e5e7eb;
            background: linear-gradient(135deg, #f8fafc, #eef2ff);
        }
        .admin-modal-header h2 {
            margin: 0;
            font-size: 1.15rem;
            color: #1e3a8a;
        }
        .admin-modal-close {
            background: transparent;
            border: none;
            font-size: 1.8rem;
            line-height: 1;
            color: #6b7280;
            cursor: pointer;
            padding: 0 4px;
            transition: color 0.2s;
        }
        .admin-modal-close:hover { color: #ef4444; }
        .admin-modal-body {
            padding: 20px 24px;
            overflow-y: auto;
            flex: 1;
            color: #1f2937;
        }

        /* ═══ Hub Établissement — barre d'onglets et panneaux ═══ */
        .establishment-modal-content {
            max-width: 1200px;
        }
        .establishment-tabs {
            display: flex;
            gap: 4px;
            padding: 0 24px;
            background: #f8fafc;
            border-bottom: 1px solid #e5e7eb;
            overflow-x: auto;
            scrollbar-width: thin;
        }
        .establishment-tab {
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            padding: 14px 18px;
            font-size: 0.92rem;
            font-weight: 600;
            color: #64748b;
            cursor: pointer;
            transition: color 0.15s, border-color 0.15s, background 0.15s;
            white-space: nowrap;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-bottom: -1px; /* recouvre la bordure du conteneur */
        }
        .establishment-tab:hover {
            color: #1e3a8a;
            background: #eef2ff;
        }
        .establishment-tab.is-active {
            color: #1e3a8a;
            border-bottom-color: #6366f1;
            background: #fff;
        }
        .establishment-tab-icon {
            font-size: 1.05rem;
        }
        .establishment-body {
            padding: 0; /* les panneaux gèrent leur propre padding */
        }
        .establishment-panel {
            padding: 20px 24px;
        }
        .establishment-panel[hidden] {
            display: none;
        }
        /* Panneau Détails — formulaire inline */
        #est-details-body .est-details-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 14px 18px;
            max-width: 720px;
        }
        #est-details-body .est-details-grid .full {
            grid-column: 1 / -1;
        }
        #est-details-body label {
            display: flex;
            flex-direction: column;
            gap: 4px;
            font-size: 0.85rem;
            font-weight: 600;
            color: #374151;
        }
        #est-details-body input[type="text"],
        #est-details-body input[type="tel"],
        #est-details-body input[type="email"] {
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            padding: 9px 11px;
            font-size: 0.95rem;
            background: #fff;
            color: #0f172a;
        }
        #est-details-body input:focus {
            outline: none;
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
        }
        #est-details-body .est-details-actions {
            margin-top: 18px;
            display: flex;
            gap: 10px;
        }
        #est-details-body .est-details-logo {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        #est-details-body .est-details-logo img {
            width: 64px;
            height: 64px;
            object-fit: contain;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            background: #fff;
            padding: 4px;
        }
        @media (max-width: 720px) {
            #est-details-body .est-details-grid {
                grid-template-columns: 1fr;
            }
            .establishment-tab {
                padding: 12px 12px;
                font-size: 0.85rem;
            }
        }

        .admin-orphan-intro p {
            margin: 0 0 10px;
            color: #374151;
            line-height: 1.5;
        }
        .admin-orphan-note {
            font-size: 0.85rem;
            color: #6b7280;
            font-style: italic;
        }
        .admin-orphan-scan-btn {
            margin-top: 12px;
            background: linear-gradient(135deg, #10b981, #059669);
            color: #fff;
            border: none;
            padding: 10px 22px;
            border-radius: 8px;
            font-weight: 700;
            font-size: 0.95rem;
            cursor: pointer;
            box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
            transition: transform 0.2s;
            font-family: inherit;
        }
        .admin-orphan-scan-btn:hover { transform: scale(1.03); }

        .admin-orphan-progress-label {
            font-weight: 700;
            color: #1e3a8a;
            margin-bottom: 8px;
        }
        .admin-orphan-progress-bar {
            width: 100%;
            height: 10px;
            background: #e5e7eb;
            border-radius: 6px;
            overflow: hidden;
            margin-bottom: 8px;
        }
        .admin-orphan-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #3b82f6, #10b981);
            width: 0%;
            transition: width 0.3s ease;
        }
        .admin-orphan-progress-detail {
            font-size: 0.85rem;
            color: #6b7280;
            font-family: monospace;
        }

        .admin-orphan-empty {
            padding: 30px;
            text-align: center;
            color: #4b5563;
            font-size: 1.05rem;
            background: #f9fafb;
            border-radius: 10px;
        }
        .admin-orphan-summary {
            padding: 12px 16px;
            background: #fef3c7;
            border-left: 4px solid #f59e0b;
            border-radius: 8px;
            margin-bottom: 16px;
        }
        .admin-orphan-summary strong {
            color: #92400e;
            font-size: 1rem;
        }
        .admin-orphan-chips {
            margin-top: 8px;
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .admin-orphan-chip {
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid #fbbf24;
            padding: 3px 10px;
            border-radius: 12px;
            font-size: 0.8rem;
            color: #78350f;
        }

        .admin-orphan-table-wrap {
            overflow-x: auto;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
        }
        .admin-orphan-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }
        .admin-orphan-table thead {
            background: #f3f4f6;
            position: sticky;
            top: 0;
        }
        .admin-orphan-table th {
            padding: 10px 12px;
            text-align: left;
            font-weight: 700;
            color: #374151;
            border-bottom: 2px solid #d1d5db;
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }
        .admin-orphan-table td {
            padding: 10px 12px;
            border-bottom: 1px solid #f3f4f6;
            color: #1f2937;
            vertical-align: middle;
        }
        .admin-orphan-table tr:hover td { background: #f9fafb; }
        .admin-orphan-table code {
            background: #eef2ff;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.78rem;
            color: #3730a3;
        }
        .admin-orphan-explain {
            margin-top: 10px;
            font-size: 0.82rem;
            color: #78350f;
            line-height: 1.5;
        }
        .admin-orphan-service {
            display: block;
            font-weight: 600;
            color: #1f2937;
            font-size: 0.88rem;
        }
        .admin-orphan-key-small {
            display: block;
            background: #eef2ff;
            padding: 2px 5px;
            border-radius: 4px;
            font-size: 0.72rem;
            color: #6366f1;
            margin-top: 2px;
        }
        .admin-orphan-actions { white-space: nowrap; }
        .admin-orphan-open-btn, .admin-orphan-del-btn {
            background: transparent;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            padding: 4px 8px;
            cursor: pointer;
            font-size: 0.95rem;
            margin-right: 4px;
            transition: all 0.15s;
        }
        .admin-orphan-open-btn:hover {
            background: #dbeafe;
            border-color: #3b82f6;
        }
        .admin-orphan-del-btn:hover {
            background: #fee2e2;
            border-color: #ef4444;
        }

        /* ═══════════════════════════════════════════════════════════════
           QA / AUDIT MODULE - Interface Discrète
        ═══════════════════════════════════════════════════════════════ */

        /* Bouton discret (icône boulon) */
        .qa-trigger-btn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 40px;
            height: 40px;
            background: rgba(30, 41, 59, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0.3;
            transition: all 0.3s ease;
            z-index: 9999;
        }

        .qa-trigger-btn:hover {
            opacity: 1;
            background: rgba(59, 130, 246, 0.2);
            border-color: var(--accent-primary);
            transform: rotate(90deg);
        }

        .qa-trigger-btn svg {
            width: 18px;
            height: 18px;
            fill: #64748b;
        }

        .qa-trigger-btn:hover svg {
            fill: var(--accent-primary);
        }

        /* Modal QA Overlay */
        .qa-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(2, 6, 23, 0.95);
            z-index: 10000;
            overflow-y: auto;
            padding: 2rem;
        }

        .qa-modal.active {
            display: block;
        }

        .qa-modal-content {
            max-width: 1200px;
            margin: 0 auto;
            background: var(--bg-card);
            border-radius: 1.5rem;
            border: 1px solid var(--border);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
            overflow: hidden;
        }

        .qa-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem 2rem;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
            border-bottom: 1px solid var(--border);
        }

        .qa-header h2 {
            font-size: 1.5rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .qa-header h2::before {
            content: "🔧";
        }

        .qa-close-btn {
            width: 36px;
            height: 36px;
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: 50%;
            color: #ef4444;
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .qa-close-btn:hover {
            background: #ef4444;
            color: white;
        }

        .qa-body {
            padding: 2rem;
        }

        /* Zone Drag & Drop */
        .qa-dropzone {
            border: 2px dashed rgba(59, 130, 246, 0.4);
            border-radius: 1rem;
            padding: 3rem;
            text-align: center;
            background: rgba(59, 130, 246, 0.05);
            transition: all 0.3s;
            cursor: pointer;
        }

        .qa-dropzone:hover,
        .qa-dropzone.dragover {
            border-color: var(--accent-primary);
            background: rgba(59, 130, 246, 0.1);
        }

        .qa-dropzone-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        .qa-dropzone h3 {
            font-size: 1.2rem;
            margin-bottom: 0.5rem;
        }

        .qa-dropzone p {
            color: var(--text-dim);
            font-size: 0.9rem;
        }

        .qa-dropzone input[type="file"] {
            display: none;
        }

        .qa-format-hint {
            margin-top: 1.5rem;
            padding: 1rem;
            background: rgba(245, 158, 11, 0.1);
            border: 1px solid rgba(245, 158, 11, 0.3);
            border-radius: 0.75rem;
            font-size: 0.85rem;
            color: #f59e0b;
        }

        .qa-format-hint code {
            background: rgba(0, 0, 0, 0.3);
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            font-family: monospace;
        }

        /* Progress Bar */
        .qa-progress {
            display: none;
            margin-top: 2rem;
        }

        .qa-progress.active {
            display: block;
        }

        .qa-progress-bar {
            height: 8px;
            background: rgba(59, 130, 246, 0.2);
            border-radius: 4px;
            overflow: hidden;
        }

        .qa-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
            border-radius: 4px;
            transition: width 0.3s ease;
            width: 0%;
        }

        .qa-progress-text {
            text-align: center;
            margin-top: 0.75rem;
            font-size: 0.9rem;
            color: var(--text-dim);
        }

        /* Score Badge */
        .qa-score-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border-radius: 2rem;
            font-size: 1.2rem;
            font-weight: 700;
            margin-bottom: 1.5rem;
        }

        .qa-score-badge.excellent {
            background: rgba(16, 185, 129, 0.15);
            border: 2px solid rgba(16, 185, 129, 0.5);
            color: #10b981;
        }

        .qa-score-badge.good {
            background: rgba(59, 130, 246, 0.15);
            border: 2px solid rgba(59, 130, 246, 0.5);
            color: #3b82f6;
        }

        .qa-score-badge.warning {
            background: rgba(245, 158, 11, 0.15);
            border: 2px solid rgba(245, 158, 11, 0.5);
            color: #f59e0b;
        }

        .qa-score-badge.critical {
            background: rgba(239, 68, 68, 0.15);
            border: 2px solid rgba(239, 68, 68, 0.5);
            color: #ef4444;
        }

        /* Results Table */
        .qa-results {
            display: none;
            margin-top: 2rem;
        }

        .qa-results.active {
            display: block;
        }

        .qa-results-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .qa-stats {
            display: flex;
            gap: 1rem;
        }

        .qa-stat {
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            font-size: 0.9rem;
            font-weight: 600;
        }

        .qa-stat.pass {
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }

        .qa-stat.fail {
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
        }

        .qa-stat.critical {
            background: rgba(139, 0, 0, 0.3);
            color: #ff6b6b;
        }

        .qa-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
        }

        .qa-table th {
            background: rgba(30, 41, 59, 0.8);
            padding: 0.75rem 1rem;
            text-align: left;
            font-weight: 600;
            color: var(--text-dim);
            border-bottom: 1px solid var(--border);
        }

        .qa-table td {
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--border);
            vertical-align: top;
        }

        .qa-table tr.pass {
            background: rgba(16, 185, 129, 0.08);
        }

        .qa-table tr.pass td:first-child {
            border-left: 3px solid #10b981;
        }

        .qa-table tr.fail {
            background: rgba(239, 68, 68, 0.08);
        }

        .qa-table tr.fail td:first-child {
            border-left: 3px solid #ef4444;
        }

        .qa-table tr.critical {
            background: rgba(139, 0, 0, 0.15);
        }

        .qa-table tr.critical td:first-child {
            border-left: 3px solid #dc143c;
        }

        .qa-diff {
            font-size: 0.8rem;
            color: #ef4444;
            margin-top: 0.25rem;
        }

        .qa-diff strong {
            color: #ff6b6b;
        }

        .qa-status-icon {
            font-size: 1.2rem;
        }

        /* Export Button */
        .qa-export-btn {
            padding: 0.6rem 1.2rem;
            background: rgba(59, 130, 246, 0.2);
            border: 1px solid rgba(59, 130, 246, 0.4);
            border-radius: 0.5rem;
            color: var(--accent-primary);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .qa-export-btn:hover {
            background: var(--accent-primary);
            color: white;
        }

        /* ========== HELP MODAL STYLES ========== */
        .help-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(8px);
            z-index: 9000;
            justify-content: center;
            align-items: center;
            padding: 2rem;
        }

        .help-modal-overlay.active {
            display: flex;
        }

        .help-modal {
            background: linear-gradient(145deg, #1a1f35 0%, #0d1117 100%);
            border-radius: 1.5rem;
            border: 1px solid rgba(255, 255, 255, 0.1);
            max-width: 600px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        }

        .help-modal-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            width: 36px;
            height: 36px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            color: #94a3b8;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s;
            z-index: 10;
        }

        .help-modal-close:hover {
            background: #ef4444;
            border-color: #ef4444;
            color: white;
        }

        .help-modal-header {
            padding: 2rem 2rem 1rem;
            text-align: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .help-modal-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        .help-modal-title {
            font-size: 1.75rem;
            font-weight: 700;
            color: white;
            margin-bottom: 0.5rem;
        }

        .help-modal-subtitle {
            color: #94a3b8;
            font-size: 0.95rem;
        }

        #help-form-container {
            padding: 0 2rem 2rem;
        }

        #help-form {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            padding-top: 1.5rem;
        }

        .help-form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .help-form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .help-form-label {
            font-size: 0.85rem;
            font-weight: 600;
            color: #cbd5e1;
        }

        .help-form-input {
            padding: 0.875rem 1rem;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 0.75rem;
            color: white;
            font-size: 0.95rem;
            transition: all 0.2s;
        }

        .help-form-input:focus {
            outline: none;
            border-color: var(--accent-primary);
            background: rgba(59, 130, 246, 0.1);
        }

        .help-form-input::placeholder {
            color: #64748b;
        }

        .help-textarea {
            min-height: 120px;
            resize: vertical;
        }

        .help-form-submit {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 1rem 2rem;
            background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
            border: none;
            border-radius: 0.75rem;
            color: white;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            margin-top: 0.5rem;
        }

        .help-form-submit:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
        }

        .help-form-success {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 4rem 2rem;
            text-align: center;
        }

        .help-form-success.active {
            display: flex;
        }

        .help-success-icon {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            color: white;
            margin-bottom: 1.5rem;
        }

        .help-success-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: white;
            margin-bottom: 0.5rem;
        }

        .help-success-text {
            color: #94a3b8;
        }

        @media (max-width: 600px) {
            .help-form-row {
                grid-template-columns: 1fr;
            }

            .help-modal {
                margin: 1rem;
                max-height: calc(100vh - 2rem);
            }
        }

        /* ========== LANDING PAGE STYLES ========== */
        #landing-screen {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #0a0e1a;
            z-index: 9500;
            overflow-y: auto;
        }

        #landing-screen.hidden {
            display: none;
        }

        .landing-bg {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background:
                radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
            pointer-events: none;
        }

        .landing-header {
            position: fixed;
            top: 1rem;
            left: 50%;
            transform: translateX(-50%);
            width: calc(100% - 3rem);
            max-width: 1400px;
            z-index: 100;
            padding: 1rem 2rem;
            background: var(--bg-card);
            border-radius: 1rem;
            border: 1px solid var(--border);
            box-shadow: var(--card-shadow);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .landing-logo {
            font-size: 1.8rem;
            font-weight: 800;
            letter-spacing: -1px;
            background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .landing-logo-fast,
        .landing-logo-services {
            background: inherit;
            -webkit-background-clip: inherit;
            background-clip: inherit;
            -webkit-text-fill-color: inherit;
        }

        .landing-nav {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .landing-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border-radius: 8px;
            font-size: 0.95rem;
            font-weight: 600;
            text-decoration: none;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            font-family: 'Inter', 'Outfit', sans-serif;
        }

        .landing-btn-ghost {
            background: transparent;
            color: #8892a6;
        }

        .landing-btn-ghost:hover {
            color: #ffffff;
        }

        .landing-btn-primary {
            background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
        }

        .landing-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
        }

        .landing-btn-outline {
            background: transparent;
            color: #ffffff;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .landing-btn-outline:hover {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .landing-main {
            position: relative;
            z-index: 1;
            padding-top: 80px;
        }

        .landing-hero {
            max-width: 1200px;
            margin: 0 auto;
            padding: 5rem 2rem 4rem;
            text-align: center;
        }

        .landing-hero-title {
            font-size: clamp(2.5rem, 5vw, 4rem);
            font-weight: 800;
            line-height: 1.1;
            margin-bottom: 1.5rem;
            letter-spacing: -1px;
            color: #ffffff;
        }

        .landing-hero-gradient {
            background: linear-gradient(135deg, #a78bfa 0%, #818cf8 50%, #6366f1 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .landing-hero-subtitle {
            font-size: 1.15rem;
            color: #8892a6;
            max-width: 650px;
            margin: 0 auto 2.5rem;
            line-height: 1.7;
        }

        .landing-hero-cta {
            display: flex;
            justify-content: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .landing-hero-cta .landing-btn {
            padding: 1rem 2rem;
            font-size: 1rem;
        }

        .landing-features {
            max-width: 1000px;
            margin: 3rem auto 5rem;
            padding: 0 2rem;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        .landing-feature-card {
            background: rgba(20, 30, 50, 0.6);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            padding: 2rem;
            transition: all 0.3s ease;
        }

        .landing-feature-card:hover {
            background: rgba(30, 45, 70, 0.7);
            transform: translateY(-4px);
            border-color: rgba(255, 255, 255, 0.15);
        }

        .landing-feature-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-bottom: 1.25rem;
            background: rgba(59, 130, 246, 0.1);
            color: #3b82f6;
        }

        .landing-feature-card:nth-child(2) .landing-feature-icon {
            background: rgba(139, 92, 246, 0.1);
            color: #8b5cf6;
        }

        .landing-feature-card:nth-child(3) .landing-feature-icon {
            background: rgba(34, 197, 94, 0.1);
            color: #22c55e;
        }

        .landing-feature-title {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: #ffffff;
        }

        .landing-feature-desc {
            font-size: 0.95rem;
            color: #8892a6;
            line-height: 1.6;
        }

        .landing-footer {
            text-align: center;
            padding: 2rem;
            color: #5a6478;
            font-size: 0.85rem;
            border-top: 1px solid rgba(255, 255, 255, 0.08);
        }

        /* Contact Modal */
        .contact-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            z-index: 10001;
            justify-content: center;
            align-items: center;
            padding: 2rem;
        }

        .contact-modal-overlay.active {
            display: flex;
        }

        .contact-modal {
            background: linear-gradient(180deg, #141e32 0%, #0d1220 100%);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            max-width: 500px;
            width: 100%;
            padding: 2.5rem;
            position: relative;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
            animation: contactModalSlideIn 0.3s ease;
        }

        @keyframes contactModalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-20px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .contact-modal-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            width: 36px;
            height: 36px;
            border: none;
            background: rgba(255, 255, 255, 0.05);
            color: #8892a6;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .contact-modal-close:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
        }

        .contact-modal-title {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: #ffffff;
        }

        .contact-modal-subtitle {
            color: #8892a6;
            margin-bottom: 2rem;
            font-size: 0.95rem;
        }

        .contact-form-group {
            margin-bottom: 1.25rem;
        }

        .contact-form-label {
            display: block;
            font-size: 0.9rem;
            font-weight: 500;
            margin-bottom: 0.5rem;
            color: #ffffff;
        }

        .contact-form-input {
            width: 100%;
            padding: 0.875rem 1rem;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            color: #ffffff;
            font-size: 1rem;
            font-family: inherit;
            transition: all 0.2s ease;
        }

        .contact-form-input:focus {
            outline: none;
            border-color: #3b82f6;
            background: rgba(255, 255, 255, 0.08);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
        }

        .contact-form-input::placeholder {
            color: #5a6478;
        }

        textarea.contact-form-input {
            resize: vertical;
            min-height: 100px;
        }

        .contact-form-submit {
            width: 100%;
            padding: 1rem;
            margin-top: 0.5rem;
        }

        .contact-form-success {
            display: none;
            text-align: center;
            padding: 2rem 0;
        }

        .contact-form-success.active {
            display: block;
        }

        .contact-form-success-icon {
            width: 64px;
            height: 64px;
            background: rgba(34, 197, 94, 0.1);
            color: #22c55e;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            margin: 0 auto 1rem;
        }

        .contact-form-success-title {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: #ffffff;
        }

        .contact-form-success-text {
            color: #8892a6;
        }

        @media (max-width: 768px) {
            .landing-header {
                padding: 1rem;
            }

            .landing-hero {
                padding: 4rem 1.5rem 3rem;
            }

            .landing-hero-cta {
                flex-direction: column;
                align-items: center;
            }

            .landing-hero-cta .landing-btn {
                width: 100%;
                max-width: 300px;
                justify-content: center;
            }

            .landing-features {
                padding: 0 1.5rem;
            }

            .contact-modal {
                padding: 2rem 1.5rem;
                margin: 1rem;
            }
        }

        /* ========== END LANDING PAGE STYLES ========== */

        /* ========== NOTES D'EXPERT STYLES ========== */
        .notes-section {
            margin-top: 2rem;
        }

        .note-card {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.04) 100%);
            border: 1px solid rgba(245, 158, 11, 0.25);
            border-radius: 1rem;
            padding: 1.5rem 2rem;
        }

        .note-card h4 {
            font-size: 1.1rem;
            font-weight: 700;
            color: #f59e0b;
            margin-bottom: 1rem;
            letter-spacing: 0.3px;
        }

        .note-list {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .note-list li {
            position: relative;
            padding-left: 1.25rem;
            font-size: 0.9rem;
            color: #e2e8f0;
            line-height: 1.6;
        }

        .note-list li::before {
            content: "›";
            position: absolute;
            left: 0;
            color: #f59e0b;
            font-weight: 700;
            font-size: 1.1rem;
        }

        @media print {
            .note-card {
                border: 1px solid #d97706;
                background: #fffbeb;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .note-card h4 {
                color: #92400e;
            }

            .note-list li {
                color: #1e293b;
            }

            .note-list li::before {
                color: #d97706;
            }
        }

        /* ═══════════════════════════════════════════════════════════════
   CARNET D'ENTRETIEN NUMÉRIQUE — Styles (v2 Jauge)
   ═══════════════════════════════════════════════════════════════ */

        /* --- Ligne du tableau avec indicateur de statut --- */
        .logbook-row {
            position: relative;
            transition: border-color 0.4s ease;
        }

        .logbook-status-done {
            border-left: 4px solid var(--accent-success) !important;
        }

        .logbook-status-soon {
            border-left: 4px solid var(--accent-warning) !important;
        }

        .logbook-status-due {
            border-left: 4px solid var(--accent-error) !important;
        }

        /* ═══════════════════════════════════════════════════════════════
   JAUGE HORIZONTALE DE STATUT
   ═══════════════════════════════════════════════════════════════ */
        .logbook-gauge {
            margin-top: 6px;
            margin-bottom: 2px;
        }

        .logbook-gauge-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 3px;
        }

        .logbook-gauge-label {
            font-size: 0.62rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .logbook-gauge-percent {
            font-size: 0.6rem;
            font-weight: 600;
            color: var(--text-dim);
            opacity: 0.7;
        }

        /* Track (fond de la jauge) */
        .logbook-gauge-track {
            width: 100%;
            height: 3px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: 3px;
            overflow: hidden;
            position: relative;
        }

        /* Fill (remplissage animé) */
        .logbook-gauge-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }

        /* Couleurs par statut — FAIT (vert) */
        .logbook-gauge-done .logbook-gauge-label {
            color: var(--accent-success);
        }

        .logbook-gauge-done .logbook-gauge-fill {
            background: linear-gradient(90deg, #059669, #10b981, #34d399);
            box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
        }

        /* Couleurs par statut — BIENTÔT (orange) */
        .logbook-gauge-soon .logbook-gauge-label {
            color: var(--accent-warning);
        }

        .logbook-gauge-soon .logbook-gauge-fill {
            background: linear-gradient(90deg, #d97706, #f59e0b, #fbbf24);
            box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
            animation: logbook-gauge-pulse-soon 2.5s ease-in-out infinite;
        }

        /* Couleurs par statut — À FAIRE (rouge) */
        .logbook-gauge-due .logbook-gauge-label {
            color: var(--accent-error);
        }

        .logbook-gauge-due .logbook-gauge-fill {
            background: linear-gradient(90deg, #dc2626, #ef4444, #f87171);
            box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
            animation: logbook-gauge-pulse-due 2s ease-in-out infinite;
        }

        @keyframes logbook-gauge-pulse-soon {

            0%,
            100% {
                box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
            }

            50% {
                box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
            }
        }

        @keyframes logbook-gauge-pulse-due {

            0%,
            100% {
                box-shadow: 0 0 8px rgba(239, 68, 68, 0.25);
            }

            50% {
                box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
            }
        }

        /* ═══════════════════════════════════════════════════════════════
   PANNEAU DE SAISIE (Carte intégrée, repliable)
   ═══════════════════════════════════════════════════════════════ */
        .logbook-panel {
            margin-top: 6px;
        }

        /* --- Bouton toggle Modifier --- */
        .logbook-toggle-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .logbook-toggle-btn {
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            width: 28px !important;
            height: 28px !important;
            min-width: 28px;
            padding: 0 !important;
            border-radius: 6px !important;
            background: rgba(255, 255, 255, 0.04) !important;
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            color: var(--text-dim) !important;
            cursor: pointer;
            transition: all 0.25s ease;
        }

        .logbook-toggle-btn:hover {
            background: rgba(59, 130, 246, 0.1) !important;
            border-color: rgba(59, 130, 246, 0.25) !important;
            color: var(--accent-primary) !important;
        }

        .logbook-toggle-btn.logbook-toggle-active {
            background: rgba(59, 130, 246, 0.12) !important;
            border-color: rgba(59, 130, 246, 0.3) !important;
            color: var(--accent-primary) !important;
        }

        .logbook-dots {
            font-size: 1.1rem;
            font-weight: 700;
            line-height: 1;
            letter-spacing: 1px;
            transition: transform 0.3s ease;
        }

        .logbook-toggle-active .logbook-dots {
            transform: rotate(90deg);
        }

        /* --- Résumé compact --- */
        .logbook-toggle-summary {
            font-size: 0.68rem;
            font-weight: 500;
            color: var(--text-dim);
            opacity: 0.7;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            transition: all 0.3s ease;
        }

        .logbook-summary-flash {
            color: var(--accent-success) !important;
            opacity: 1 !important;
        }

        /* --- Conteneur repliable --- */
        .logbook-collapse {
            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                margin-top 0.35s ease;
            margin-top: 0;
        }

        .logbook-collapse-open {
            max-height: 200px;
            opacity: 1;
            margin-top: 8px;
            overflow: visible;
        }

        .logbook-entry-card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 10px;
            padding: 10px 14px;
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
        }

        .logbook-entry-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .logbook-entry-icon {
            color: var(--text-dim);
            opacity: 0.4;
            flex-shrink: 0;
        }

        .logbook-entry-divider {
            width: 1px;
            height: 22px;
            background: rgba(255, 255, 255, 0.1);
            flex-shrink: 0;
        }

        .logbook-entry-field {
            display: flex;
            align-items: center;
            position: relative;
        }

        .logbook-entry-field-km {
            position: relative;
        }

        .logbook-field-suffix {
            font-size: 0.7rem;
            color: var(--text-dim);
            margin-left: 6px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            opacity: 0.6;
        }

        /* --- Inputs raffinés --- */
        .logbook-input {
            width: auto !important;
            padding: 7px 12px !important;
            font-size: 0.82rem !important;
            font-weight: 500 !important;
            border-radius: 8px !important;
            background: rgba(2, 6, 23, 0.5) !important;
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            color: var(--text-main) !important;
            transition: all 0.25s ease;
            font-family: 'Outfit', sans-serif !important;
        }

        .logbook-input::placeholder {
            color: rgba(148, 163, 184, 0.4);
            font-weight: 400;
        }

        .logbook-input:hover {
            border-color: rgba(255, 255, 255, 0.15) !important;
            background: rgba(2, 6, 23, 0.6) !important;
        }

        .logbook-input:focus {
            border-color: var(--accent-primary) !important;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
            background: rgba(2, 6, 23, 0.7) !important;
            outline: none !important;
        }

        .logbook-date {
            width: 148px !important;
        }

        .logbook-km {
            width: 110px !important;
        }

        /* --- Bouton sauvegarder --- */
        .logbook-save-btn {
            width: 34px !important;
            height: 34px !important;
            min-width: 34px;
            padding: 0 !important;
            border-radius: 8px !important;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.06)) !important;
            border: 1px solid rgba(59, 130, 246, 0.2) !important;
            color: var(--accent-primary) !important;
            cursor: pointer;
            transition: all 0.25s ease;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .logbook-save-btn:hover {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.15)) !important;
            border-color: var(--accent-primary) !important;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
        }

        .logbook-save-btn:active {
            transform: translateY(0) scale(0.96);
        }

        .logbook-save-btn svg {
            width: 15px;
            height: 15px;
        }

        /* --- Bouton supprimer enregistrement --- */
        .logbook-delete-btn {
            width: 34px !important;
            height: 34px !important;
            min-width: 34px;
            padding: 0 !important;
            border-radius: 8px !important;
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)) !important;
            border: 1px solid rgba(239, 68, 68, 0.2) !important;
            color: #ef4444 !important;
            cursor: pointer;
            transition: all 0.25s ease;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .logbook-delete-btn:hover {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.15)) !important;
            border-color: #ef4444 !important;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
        }

        .logbook-delete-btn:active {
            transform: translateY(0) scale(0.96);
        }

        .logbook-delete-btn svg {
            width: 14px;
            height: 14px;
        }

        /* --- Confirmation de sauvegarde --- */
        .logbook-confirm {
            font-size: 0.72rem;
            font-weight: 700;
            opacity: 0;
            transition: opacity 0.3s ease;
            white-space: nowrap;
        }

        .logbook-confirm-ok {
            color: var(--accent-success);
            opacity: 1;
        }

        .logbook-confirm-err {
            color: var(--accent-error);
            opacity: 1;
        }

        /* ═══════════════════════════════════════════════════════════════
   TERRACLEAN CHECKBOX
   ═══════════════════════════════════════════════════════════════ */
        .logbook-terraclean-row {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }

        .logbook-terraclean-label {
            display: inline-flex !important;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            padding: 4px 0;
            margin-bottom: 0 !important;
        }

        .logbook-terraclean-cb {
            width: 16px !important;
            height: 16px !important;
            accent-color: #06b6d4;
            cursor: pointer;
            border-radius: 4px !important;
            padding: 0 !important;
            flex-shrink: 0;
        }

        .logbook-terraclean-mark {
            display: none;
        }

        .logbook-terraclean-badge {
            display: inline-flex;
            align-items: center;
            padding: 3px 10px;
            border-radius: 4px;
            font-size: 0.68rem;
            font-weight: 800;
            letter-spacing: 1.5px;
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(14, 165, 233, 0.08));
            color: #06b6d4;
            border: 1px solid rgba(6, 182, 212, 0.2);
            transition: all 0.3s ease;
            text-transform: uppercase;
        }

        .logbook-terraclean-cb:checked~.logbook-terraclean-badge {
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(14, 165, 233, 0.2));
            color: #22d3ee;
            border-color: rgba(6, 182, 212, 0.5);
            box-shadow: 0 0 14px rgba(6, 182, 212, 0.15);
        }

        .logbook-terraclean-badge.logbook-flash {
            animation: logbook-flash-anim 0.6s ease;
        }

        @keyframes logbook-flash-anim {
            0% {
                transform: scale(1);
            }

            30% {
                transform: scale(1.08);
                box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
            }

            100% {
                transform: scale(1);
            }
        }

        .logbook-terraclean-text {
            font-size: 0.7rem;
            color: var(--text-dim);
            font-weight: 400;
            text-transform: none;
            letter-spacing: 0;
            opacity: 0.7;
        }

        /* --- Badge TerraClean inline sur la ligne --- */
        .logbook-tc-inline {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 3px;
            font-size: 0.88rem;
            font-weight: 700;
            font-family: 'Outfit', sans-serif;
            letter-spacing: 0.5px;
            padding: 2px 0;
            margin-top: 4px;
            color: var(--tc-color, #ef4444);
            opacity: 0.55;
            transition: all 0.3s ease;
            cursor: default;
        }

        .logbook-tc-inline.logbook-tc-active {
            opacity: 1;
            color: var(--tc-color, #10b981);
        }

        .logbook-tc-check {
            font-size: 0.6rem;
            font-weight: 800;
        }

        /* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
        @media (max-width: 768px) {
            .logbook-entry-row {
                flex-wrap: wrap;
                gap: 8px;
            }

            .logbook-entry-divider {
                display: none;
            }

            .logbook-date,
            .logbook-km {
                width: 100% !important;
            }
        }

        /* ═══════════════════════════════════════════════════════════════
   PRINT: afficher statuts du carnet, masquer contrôles interactifs
   ═══════════════════════════════════════════════════════════════ */
        @media print {

            /* ── En-tête garage (logo + coordonnées) ── */
            .garage-print-header {
                display: flex !important;
                align-items: center;
                gap: 20px;
                padding: 12px 16px;
                margin-bottom: 16px;
                border-bottom: 2px solid #e2e8f0;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .garage-print-logo {
                height: 55px;
                width: auto;
                max-width: 240px;
                object-fit: contain;
            }

            .garage-print-name {
                font-size: 1.3rem;
                font-weight: 800;
                color: #1e293b;
            }

            .garage-print-info {
                display: flex;
                flex-direction: column;
                gap: 2px;
            }

            .garage-print-address {
                font-size: 0.85rem;
                color: #475569;
                font-weight: 500;
            }

            .garage-print-phone {
                font-size: 0.85rem;
                color: #475569;
                font-weight: 600;
            }

            /* ── Masquer les contrôles interactifs (boutons, formulaires) ── */
            .logbook-toggle-btn,
            .logbook-collapse,
            .logbook-save-btn,
            .logbook-delete-btn,
            .logbook-confirm,
            .logbook-terraclean-row,
            .orphan-alert {
                display: none !important;
            }

            /* ── Afficher le panneau carnet (résumé seulement) ── */
            .logbook-panel {
                display: block !important;
                margin-top: 4px;
            }

            .logbook-toggle-row {
                display: flex !important;
                gap: 6px;
                align-items: center;
            }

            /* ── Résumé "Dernier : date · km" ── */
            .logbook-toggle-summary {
                font-size: 0.7rem !important;
                font-weight: 600 !important;
                color: #475569 !important;
                opacity: 1 !important;
                background: #f1f5f9;
                padding: 2px 8px;
                border-radius: 4px;
                border: 1px solid #cbd5e1;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            /* ── Jauge de progression ── */
            .logbook-gauge {
                display: block !important;
                margin-top: 5px;
                margin-bottom: 3px;
            }

            .logbook-gauge-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 2px;
            }

            .logbook-gauge-label {
                font-size: 0.62rem;
                font-weight: 800;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }

            .logbook-gauge-percent {
                font-size: 0.6rem;
                font-weight: 600;
                color: #64748b;
            }

            .logbook-gauge-track {
                width: 100%;
                height: 4px;
                background: #e2e8f0;
                border-radius: 4px;
                overflow: hidden;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-gauge-fill {
                height: 100%;
                border-radius: 4px;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
                box-shadow: none !important;
                animation: none !important;
            }

            /* Couleurs des jauges pour impression */
            .logbook-gauge-done .logbook-gauge-label {
                color: #059669 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-gauge-done .logbook-gauge-fill {
                background: #10b981 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-gauge-soon .logbook-gauge-label {
                color: #d97706 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-gauge-soon .logbook-gauge-fill {
                background: #f59e0b !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-gauge-due .logbook-gauge-label {
                color: #dc2626 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-gauge-due .logbook-gauge-fill {
                background: #ef4444 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            /* ── Indicateurs de statut sur les lignes ── */
            .logbook-status-done {
                border-left: 4px solid #10b981 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-status-soon {
                border-left: 4px solid #f59e0b !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-status-due {
                border-left: 4px solid #ef4444 !important;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            /* ── Badge TerraClean inline ── */
            .logbook-tc-inline {
                font-size: 0.72rem !important;
                color: #64748b !important;
                opacity: 0.7;
                -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
            }

            .logbook-tc-inline.logbook-tc-active {
                color: #059669 !important;
                opacity: 1;
            }
        }

        /* ═══════════════════════════════════════════════════════════════
   FLATPICKR — Overrides thème FAST SERVICES
   ═══════════════════════════════════════════════════════════════ */
        .flatpickr-calendar {
            background: rgba(15, 23, 42, 0.95) !important;
            border: 1px solid rgba(255, 255, 255, 0.1) !important;
            border-radius: 12px !important;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            font-family: 'Outfit', sans-serif !important;
            overflow: hidden;
        }

        .flatpickr-calendar.open {
            z-index: 99999 !important;
        }

        .flatpickr-months {
            background: rgba(255, 255, 255, 0.03);
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            padding: 4px 0;
        }

        .flatpickr-months .flatpickr-month {
            color: var(--text-main) !important;
            fill: var(--text-main) !important;
        }

        .flatpickr-current-month {
            font-weight: 700 !important;
            font-size: 0.95rem !important;
            color: var(--text-main) !important;
        }

        .flatpickr-current-month .flatpickr-monthDropdown-months {
            background: transparent !important;
            color: var(--text-main) !important;
            font-weight: 700 !important;
            appearance: none;
            -webkit-appearance: none;
        }

        .flatpickr-months .flatpickr-prev-month,
        .flatpickr-months .flatpickr-next-month {
            fill: var(--text-dim) !important;
            color: var(--text-dim) !important;
            transition: all 0.2s ease;
            border-radius: 6px;
            padding: 6px !important;
        }

        .flatpickr-months .flatpickr-prev-month:hover,
        .flatpickr-months .flatpickr-next-month:hover {
            fill: var(--accent-primary) !important;
            color: var(--accent-primary) !important;
            background: rgba(59, 130, 246, 0.1);
        }

        .flatpickr-months .flatpickr-prev-month svg,
        .flatpickr-months .flatpickr-next-month svg {
            fill: inherit !important;
        }

        span.flatpickr-weekday {
            color: var(--text-dim) !important;
            font-weight: 600 !important;
            font-size: 0.72rem !important;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .flatpickr-day {
            color: var(--text-main) !important;
            border-radius: 8px !important;
            border: none !important;
            font-weight: 500;
            transition: all 0.15s ease;
            max-width: 36px;
            height: 36px;
            line-height: 36px;
        }

        .flatpickr-day:hover {
            background: rgba(59, 130, 246, 0.15) !important;
            border: none !important;
        }

        .flatpickr-day.today {
            border: 1px solid rgba(59, 130, 246, 0.4) !important;
            color: var(--accent-primary) !important;
            font-weight: 700;
        }

        .flatpickr-day.today:hover {
            background: rgba(59, 130, 246, 0.15) !important;
        }

        .flatpickr-day.selected,
        .flatpickr-day.selected:hover {
            background: var(--accent-primary) !important;
            color: #fff !important;
            border: none !important;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
            font-weight: 700;
        }

        .flatpickr-day.flatpickr-disabled,
        .flatpickr-day.flatpickr-disabled:hover,
        .flatpickr-day.prevMonthDay,
        .flatpickr-day.nextMonthDay {
            color: rgba(148, 163, 184, 0.25) !important;
        }

        .flatpickr-day.prevMonthDay:hover,
        .flatpickr-day.nextMonthDay:hover {
            background: rgba(255, 255, 255, 0.03) !important;
        }

        .numInputWrapper {
            background: transparent !important;
        }

        .numInputWrapper:hover {
            background: rgba(255, 255, 255, 0.03) !important;
        }

        .flatpickr-current-month input.cur-year {
            color: var(--text-main) !important;
            font-weight: 700 !important;
            font-size: 0.95rem !important;
        }

        /* Alt input (affichage formaté) */
        .logbook-entry-field .flatpickr-input.form-control+input.form-control,
        .logbook-entry-field input.flatpickr-input+input {
            padding: 7px 12px !important;
            font-size: 0.82rem !important;
            font-weight: 500 !important;
            border-radius: 8px !important;
            background: rgba(2, 6, 23, 0.5) !important;
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            color: var(--text-main) !important;
            font-family: 'Outfit', sans-serif !important;
            cursor: pointer;
            transition: all 0.25s ease;
            width: 165px !important;
        }

        .logbook-entry-field input.flatpickr-input+input:hover {
            border-color: rgba(255, 255, 255, 0.15) !important;
            background: rgba(2, 6, 23, 0.6) !important;
        }

        .logbook-entry-field input.flatpickr-input+input:focus {
            border-color: var(--accent-primary) !important;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
        }

        /* ═══════════════════════════════════════════════════════════
           BILLING IMPORT — Bouton + Modal
        ═══════════════════════════════════════════════════════════ */
        .billing-import-btn {
            position: fixed;
            top: 120px;
            right: 20px;
            z-index: 9000;
            background: linear-gradient(135deg, #065f46, #10b981);
            color: #fff;
            border: none;
            padding: 10px 16px;
            border-radius: 10px;
            font-size: 0.85rem;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
            transition: all 0.2s ease;
            font-family: inherit;
        }
        .billing-import-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
        }

        .billing-modal-content {
            max-width: 820px !important;
        }

        /* Contexte garage admin — sidebar */
        .admin-garage-ctx {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            margin-bottom: 0.75rem;
            padding: 0.65rem 0.85rem;
            background: rgba(251, 191, 36, 0.08);
            border: 1px solid rgba(251, 191, 36, 0.35);
            border-radius: 8px;
        }
        .admin-garage-ctx-label {
            font-size: 0.72rem;
            font-weight: 700;
            color: #92400e;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .admin-garage-ctx-select {
            width: 100%;
            padding: 0.4rem 0.6rem;
            border: 1px solid rgba(251, 191, 36, 0.5);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-main);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
        }
        .admin-garage-ctx-select option {
            background: #1e293b;
            color: #f8fafc;
        }

        .billing-garage-row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1.25rem;
            padding: 0.75rem 1rem;
            background: #fffbeb;
            border: 1px solid #fbbf24;
            border-radius: 8px;
        }
        .billing-garage-label {
            font-weight: 700;
            color: #92400e;
            font-size: 0.88rem;
            white-space: nowrap;
        }
        .billing-garage-select {
            flex: 1;
            padding: 0.45rem 0.75rem;
            border: 1px solid #fbbf24;
            border-radius: 6px;
            background: #fff;
            font-size: 0.9rem;
            color: #1e3a8a;
            font-weight: 600;
            cursor: pointer;
        }

        .billing-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
            border-bottom: 2px solid #e5e7eb;
            padding-bottom: 0;
        }
        .billing-tab-btn {
            padding: 0.45rem 1rem;
            border: none;
            background: none;
            cursor: pointer;
            font-size: 0.88rem;
            font-weight: 600;
            color: #6b7280;
            border-bottom: 3px solid transparent;
            margin-bottom: -2px;
            transition: color 0.15s, border-color 0.15s;
        }
        .billing-tab-btn.active {
            color: #1e3a8a;
            border-bottom-color: #3b82f6;
        }
        .billing-tab-btn:hover:not(.active) { color: #374151; }

        .billing-paste-hint {
            font-size: 0.82rem;
            color: #6b7280;
            margin: 0 0 0.6rem;
            font-style: italic;
        }
        .billing-paste-area {
            width: 100%;
            min-height: 140px;
            padding: 0.65rem 0.85rem;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            font-size: 0.82rem;
            font-family: 'SFMono-Regular', 'Consolas', monospace;
            resize: vertical;
            margin-bottom: 0.85rem;
            color: #1f2937;
            box-sizing: border-box;
        }
        .billing-paste-area:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
        }

        .billing-intro {
            color: #374151;
            margin: 0 0 1.25rem;
            line-height: 1.6;
            font-size: 0.92rem;
        }

        .billing-upload-area {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 0.6rem;
            margin-bottom: 1.25rem;
        }

        .billing-file-label {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.65rem 1.2rem;
            background: #f8fafc;
            border: 2px dashed #cbd5e1;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            color: #1e3a8a;
            font-size: 0.9rem;
            transition: border-color 0.2s, background 0.2s;
        }
        .billing-file-label:hover {
            border-color: #3b82f6;
            background: #eff6ff;
        }

        .billing-file-icon { font-size: 1.2rem; }

        .billing-file-input { display: none; }

        .billing-file-name {
            font-size: 0.82rem;
            color: #6b7280;
            font-style: italic;
        }

        .billing-analyze-btn {
            padding: 0.65rem 1.5rem;
            background: linear-gradient(135deg, #1e3a8a, #3b82f6);
            color: #fff;
            border: none;
            border-radius: 8px;
            font-weight: 700;
            cursor: pointer;
            font-size: 0.9rem;
            box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
            transition: all 0.2s;
        }
        .billing-analyze-btn:hover { transform: translateY(-1px); }

        .billing-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            padding: 3rem;
            color: #6b7280;
        }

        .billing-spinner {
            width: 38px;
            height: 38px;
            border: 4px solid #e5e7eb;
            border-top-color: #3b82f6;
            border-radius: 50%;
            animation: billing-spin 0.75s linear infinite;
        }
        @keyframes billing-spin { to { transform: rotate(360deg); } }

        .billing-preview-summary {
            margin: 0 0 0.75rem;
            color: #374151;
            font-size: 0.9rem;
        }

        .billing-table-wrap {
            max-height: 380px;
            overflow-y: auto;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            margin-bottom: 1.25rem;
        }

        .billing-preview-tbl {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.82rem;
        }
        .billing-preview-tbl th {
            position: sticky;
            top: 0;
            background: #f1f5f9;
            padding: 0.45rem 0.7rem;
            text-align: left;
            font-weight: 700;
            border-bottom: 1px solid #e5e7eb;
            color: #1e3a8a;
            white-space: nowrap;
        }
        .billing-preview-tbl td {
            padding: 0.35rem 0.7rem;
            border-bottom: 1px solid #f3f4f6;
            vertical-align: middle;
        }
        .billing-preview-tbl tr:last-child td { border-bottom: none; }
        .billing-preview-tbl tr:hover td { background: #f9fafb; }

        .billing-vin {
            font-family: 'SFMono-Regular', 'Consolas', monospace;
            font-size: 0.78rem;
            letter-spacing: 0.02em;
        }
        .billing-code {
            font-family: 'SFMono-Regular', 'Consolas', monospace;
            font-size: 0.78rem;
            color: #9ca3af;
        }

        .billing-preview-actions {
            text-align: right;
        }

        .billing-import-confirm-btn {
            padding: 0.7rem 2rem;
            background: linear-gradient(135deg, #065f46, #10b981);
            color: #fff;
            border: none;
            border-radius: 8px;
            font-weight: 700;
            cursor: pointer;
            font-size: 0.95rem;
            box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
            transition: all 0.2s;
        }
        .billing-import-confirm-btn:hover:not(:disabled) { transform: translateY(-1px); }
        .billing-import-confirm-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .billing-success {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.75rem;
            padding: 2.5rem 1rem;
            text-align: center;
        }
        .billing-success-icon { font-size: 3rem; }
        .billing-success h3 { margin: 0; color: #065f46; font-size: 1.1rem; }

        .billing-errors {
            color: #dc2626;
            font-size: 0.83rem;
            max-width: 540px;
        }

        .billing-new-btn {
            margin-top: 0.5rem;
            padding: 0.55rem 1.2rem;
            background: #f8fafc;
            border: 1px solid #e5e7eb;
            border-radius: 7px;
            cursor: pointer;
            font-size: 0.85rem;
            color: #374151;
            transition: background 0.2s;
        }
        .billing-new-btn:hover { background: #eff6ff; }
/* ═══════════════════════════════════════════════════════════════
   Gestion des Garages (Admin Modal)
   ═══════════════════════════════════════════════════════════════ */
.garage-mgmt-modal-content { max-width: 640px; width: 100%; }

.garage-mgmt-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; gap: 1rem;
}
.garage-mgmt-item-info { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.garage-mgmt-item-name { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.garage-mgmt-item-id { font-size: 0.75rem; color: var(--text-dim); font-family: monospace; }
.garage-mgmt-plan-badge { font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.garage-mgmt-plan-v1 { background: rgba(99,102,241,0.2); color: #a5b4fc; }
.garage-mgmt-plan-v2 { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.garage-mgmt-item-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.garage-mgmt-edit-btn, .garage-mgmt-delete-btn, .garage-mgmt-access-btn {
    padding: 0.3rem 0.75rem; border-radius: 6px; font-size: 0.78rem;
    cursor: pointer; border: 1px solid; transition: opacity 0.15s;
}
.garage-mgmt-edit-btn { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.4); color: #a5b4fc; }
.garage-mgmt-delete-btn { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fca5a5; }
/* « Accéder » = action principale (entrer dans le garage en mode admin) */
.garage-mgmt-access-btn { background: #5a1aa0; border-color: #5a1aa0; color: #fff; font-weight: 700; }
.garage-mgmt-edit-btn:hover, .garage-mgmt-delete-btn:hover, .garage-mgmt-access-btn:hover { opacity: 0.82; }

.garage-mgmt-add-btn {
    margin-top: 0.75rem; padding: 0.55rem 1.2rem;
    background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3);
    border-radius: 8px; color: #6ee7b7; font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: opacity 0.15s;
}
.garage-mgmt-add-btn:hover { opacity: 0.75; }
.garage-mgmt-note { font-size: 0.75rem; color: var(--text-dim); margin-top: 1rem; line-height: 1.5; }
.garage-mgmt-loading, .garage-mgmt-empty { font-size: 0.85rem; color: var(--text-dim); line-height: 1.6; }
.garage-mgmt-error { font-size: 0.85rem; color: #f87171; }

.garage-form-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; }
.garage-form-section-title {
    font-size: 0.78rem; font-weight: 700;
    color: var(--accent-primary, #6366f1);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin: 1.25rem 0 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}
.garage-form-section-title:first-of-type { margin-top: 0.25rem; }
.garage-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}
.garage-form-field { display: flex; flex-direction: column; gap: 0.3rem; }
.garage-form-field--span2 { grid-column: span 2; }
@media (max-width: 600px) {
    .garage-form-field--span2 { grid-column: span 1; }
}

/* ═══════════════════════════════════════════════════════════════
   STAFF MGMT — Étape A3 : Gérer le personnel
   ═══════════════════════════════════════════════════════════════ */

.staff-mgmt-modal-content {
    max-width: 900px;
    width: 95%;
}

#staff-mgmt-list { margin-bottom: 1rem; }

.staff-mgmt-loading,
.staff-mgmt-empty {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    padding: 1rem;
    text-align: center;
}
.staff-mgmt-error {
    font-size: 0.85rem;
    color: #fca5a5;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 7px;
}

/* Tableau du personnel */
.staff-mgmt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}
.staff-mgmt-table thead th {
    background: rgba(255, 255, 255, 0.04);
    text-align: left;
    padding: 0.7rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.staff-th-photo   { width: 60px; }
.staff-th-role    { width: 200px; }
.staff-th-actions { width: 110px; text-align: right !important; }

.staff-mgmt-table tbody td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
}
.staff-mgmt-table tbody tr:last-child td { border-bottom: none; }
.staff-mgmt-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.04);
}
.staff-td-actions { text-align: right; }

.staff-name-line {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.staff-link-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.staff-link-badge--linked { background: #dcfce7; color: #166534; }
.staff-link-badge--pending { background: #fef3c7; color: #92400e; }
.staff-link-badge--kiosk { background: #f4efff; color: #5a1aa0; }
.staff-meta-line {
    font-size: 0.78rem;
    color: var(--text-dim);
}
.staff-title-line {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

/* Avatar miniature dans la liste */
.staff-avatar-mini {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(99, 102, 241, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.staff-avatar-mini.staff-avatar-placeholder {
    color: #a5b4fc;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Badge rôle (couleur par type) */
.staff-role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.staff-role-admin      { background: rgba(239, 68, 68, 0.15);  color: #fca5a5; }
.staff-role-manager    { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.staff-role-technician { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.staff-role-advisor    { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

/* Boutons d'actions ligne */
.staff-mgmt-edit-btn,
.staff-mgmt-delete-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, border-color 0.15s;
    margin-left: 0.25rem;
}
.staff-mgmt-edit-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
}
.staff-mgmt-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
}
/* « Inviter » : action principale (créer l'accès + envoyer l'invitation). */
.staff-mgmt-invite-btn {
    background: #5a1aa0;
    border: 1px solid #5a1aa0;
    color: #fff;
    border-radius: 6px;
    height: 36px;
    padding: 0 0.7rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: opacity 0.15s;
    margin-left: 0.25rem;
}
.staff-mgmt-invite-btn:hover { opacity: 0.85; }
.staff-mgmt-invite-btn:disabled { opacity: 0.6; cursor: default; }

/* Bouton "Ajouter un membre" */
.staff-mgmt-add-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    transition: opacity 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.staff-mgmt-add-btn:hover { opacity: 0.92; }
.staff-mgmt-add-btn:active { transform: scale(0.99); }

/* Photo preview (formulaire) */
.staff-photo-preview {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.staff-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.staff-photo-placeholder {
    color: #a5b4fc;
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Permissions granulaires */
.staff-perm-list {
    margin-top: 0.85rem;
    display: grid;
    gap: 0.5rem;
}
.staff-perm-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.staff-perm-row:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
}
.staff-perm-row input[type="checkbox"] {
    width: 18px; height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--accent-primary, #6366f1);
}
.staff-perm-icon { font-size: 1.1rem; flex-shrink: 0; }
.staff-perm-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   OPTIONS MGMT — Étape A4 : Options de l'établissement
   ═══════════════════════════════════════════════════════════════ */

.options-mgmt-modal-content {
    max-width: 720px;
    width: 95%;
}

.options-form { padding-bottom: 0.5rem; }

.options-toggle-list {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.options-toggle-row {
    /* Hérite de .staff-perm-row, mais labels plus longs → wrap */
    align-items: flex-start;
    line-height: 1.45;
}
.options-toggle-row input[type="checkbox"] { margin-top: 2px; }

.options-section-hint {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin: 0.15rem 0 0.55rem;
    line-height: 1.5;
}

.options-toggle-hint {
    display: block;
    font-size: 0.74rem;
    color: var(--text-dim);
    font-weight: 400;
    margin-top: 0.18rem;
    line-height: 1.4;
}

.options-saved-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.5rem 0.85rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 7px;
    color: #6ee7b7;
    font-size: 0.85rem;
    font-weight: 600;
    animation: optionsFadeIn 0.2s ease-out;
}
@keyframes optionsFadeIn {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   TEMPLATE LIST — Étape A5 : Liste des templates d'inspection
   ═══════════════════════════════════════════════════════════════ */

.template-list-modal-content {
    max-width: 1000px;
    width: 95%;
}

.template-list-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.template-list-actions .garage-form-save-btn {
    background: linear-gradient(135deg, #f97316, #fb923c);
}
.template-list-actions .garage-form-cancel-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.template-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}
.template-list-table thead th {
    background: rgba(255, 255, 255, 0.04);
    text-align: center;
    padding: 0.7rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.template-list-table thead th.tl-th-name { text-align: left; }
.template-list-table tbody td {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
    color: var(--text-primary);
    vertical-align: middle;
    text-align: center;
}
.template-list-table tbody td.tl-td-name { text-align: left; }
.template-list-table tbody tr:last-child td { border-bottom: none; }
.template-list-table tbody tr:hover { background: rgba(99, 102, 241, 0.04); }
.template-list-table tbody tr.tl-row-default {
    background: rgba(16, 185, 129, 0.06);
}
.template-list-table tbody tr.tl-row-default:hover {
    background: rgba(16, 185, 129, 0.1);
}

.tl-th-default,
.tl-th-edit,
.tl-th-copy,
.tl-th-delete { width: 70px; }
.tl-th-enabled { width: 100px; }

.tl-global-badge {
    display: inline-block;
    padding: 1px 6px;
    margin-right: 0.5rem;
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

.tl-default-cb,
.tl-enabled-cb {
    width: 18px; height: 18px;
    cursor: pointer;
    accent-color: var(--accent-primary, #6366f1);
}

.tl-action-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-radius: 6px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.tl-action-btn:hover:not([disabled]) {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
}
.tl-action-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}
.tl-delete-btn:hover:not([disabled]) {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Toggle switch ON/OFF */
.tl-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
}
.tl-switch input { display: none; }
.tl-switch-slider {
    width: 36px; height: 20px;
    background: rgba(148, 163, 184, 0.4);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.tl-switch-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}
.tl-switch input:checked + .tl-switch-slider {
    background: var(--accent-success, #10b981);
}
.tl-switch input:checked + .tl-switch-slider::before {
    transform: translateX(16px);
}
.tl-switch-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 24px;
    text-align: left;
}

/* ═══════════════════════════════════════════════════════════════
   TEMPLATE BUILDER — Étape A6 : 2 colonnes, sections, items
   ═══════════════════════════════════════════════════════════════ */

.template-builder-modal-content {
    max-width: 1280px;
    width: 98%;
    height: 88vh;
    display: flex;
    flex-direction: column;
}

.template-builder-modal-content .admin-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.tb-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    flex: 1;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
@media (max-width: 760px) {
    .tb-layout { grid-template-columns: 1fr; }
}

/* ─── Panel gauche : catégories ─────────────────────────────── */
.tb-cat-panel {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.85rem;
    overflow-y: auto;
}

.tb-add-cat-btn {
    width: 100%;
    padding: 0.65rem;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 7px;
    color: white;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.tb-add-cat-btn:hover { opacity: 0.92; }

.tb-cat-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.55rem;
    margin-bottom: 0.35rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    transition: background 0.15s, border-color 0.15s;
}
.tb-cat-item:hover { background: rgba(99, 102, 241, 0.06); }
.tb-cat-item.is-selected {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.5);
}

.tb-cat-pick {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    padding: 0.15rem 0;
    font-weight: 600;
    font-size: 0.85rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
.tb-cat-icon { flex-shrink: 0; }
.tb-cat-name-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.tb-cat-name-fr {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tb-cat-name-en {
    color: rgba(100, 116, 139, 0.85);
    font-size: 0.72rem;
    font-weight: 500;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.05rem;
}

.tb-cat-controls {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.tb-mini-btn {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.45);
    color: #4338ca;
    border-radius: 5px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.1s;
    padding: 0;
    flex-shrink: 0;
}
.tb-mini-btn:hover:not([disabled]) {
    background: rgba(99, 102, 241, 0.95);
    border-color: #4338ca;
    color: #fff;
    transform: translateY(-1px);
}
.tb-mini-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ─── Panel droite : éditeur ────────────────────────────────── */
.tb-editor-panel {
    overflow-y: auto;
    padding: 1rem 1.25rem 1.5rem;
}

.tb-empty {
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 1rem;
    text-align: center;
    font-style: italic;
}
.tb-empty-small { padding: 0.5rem; font-size: 0.78rem; }

.tb-section-h {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.5rem;
}

.tb-cat-header {
    background: rgba(15, 23, 42, 0.65);
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ─── Bannière propriétés du template (toujours visible) ─── */
/* Nom du modèle (éditable) dans le builder */
.tb-template-name {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}
.tb-template-name .tb-name-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 220px;
    margin: 0;
}
.tb-template-name .tb-name-field span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tb-template-name .tb-name-field input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #1e293b;
}

/* Photos d'arrivée à demander (cases dans l'éditeur) */
.tb-tpl-arrival { margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid #e2e8f0; }
.tb-tpl-arrival-title { font-weight: 700; font-size: 0.85rem; color: #475569; margin-bottom: 0.5rem; text-transform: none; }
.tb-arrival-angles { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; }
.tb-arrival-angle { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; font-size: 0.85rem; text-transform: none; font-weight: 400; margin: 0; color: #1e293b; }
.tb-arrival-angle input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; }
.tb-arrival-angle span { text-transform: none; font-weight: 400; }

.tb-template-props {
    background: #fff;
    border: 2px solid #6366f1;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    margin: 0 0 1.2rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.12);
}
.tb-template-props-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #4338ca;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.tb-template-props-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.7rem;
}
/* Carte-toggle façon interrupteur — clic n'importe où la coche/décoche */
.tb-tpl-toggle {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.tb-tpl-toggle:hover {
    background: #eef2ff;
    border-color: #818cf8;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.15);
}
.tb-tpl-toggle:has(input:checked) {
    background: #f0fdf4;
    border-color: #16a34a;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.18);
}
/* Switch iOS-style — pseudo-interrupteur visuel via la checkbox stylée */
.tb-tpl-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    border-radius: 14px;
    background: #cbd5e1;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.15s;
}
.tb-tpl-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s;
}
.tb-tpl-toggle input[type="checkbox"]:checked {
    background: #16a34a;
}
.tb-tpl-toggle input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}
.tb-tpl-toggle span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.4;
    flex: 1;
}
.tb-tpl-toggle strong {
    color: #1e293b;
    font-weight: 700;
}
.tb-tpl-toggle:has(input:checked) strong {
    color: #15803d;
}
.tb-tpl-toggle small {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 400;
    line-height: 1.45;
}

/* ─── Modal Propriétés ──────────────────────────────────── */
.tb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.tb-modal {
    background: #1f2937;
    color: #f1f5f9;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}
.tb-modal-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tb-modal-header h3 { margin: 0; font-size: 1rem; color: #e0e7ff; }
.tb-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.tb-modal-close:hover { color: #ef4444; }
.tb-modal-body { padding: 1rem 1.2rem; overflow-y: auto; }
.tb-modal-hint {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0 0 1rem;
    line-height: 1.5;
}
.tb-modal-toggle {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: background 0.15s;
}
.tb-modal-toggle:hover { background: rgba(255, 255, 255, 0.05); }
.tb-modal-toggle input[type="checkbox"] {
    margin-top: 0.2rem;
    transform: scale(1.2);
    accent-color: #22c55e;
}
.tb-modal-toggle span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
}
.tb-modal-toggle small {
    font-size: 0.76rem;
    color: #94a3b8;
    font-weight: 400;
}
.tb-modal-actions {
    padding: 0.85rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}
.tb-modal-cancel,
.tb-modal-ok {
    padding: 0.5rem 1.1rem;
    border-radius: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}
.tb-modal-cancel {
    background: transparent;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.12);
}
.tb-modal-cancel:hover { background: rgba(255, 255, 255, 0.05); }
.tb-modal-ok {
    background: #6366f1;
    color: #fff;
}
.tb-modal-ok:hover { background: #4f46e5; }

.tb-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.55rem;
}

.tb-field {
    display: grid;
    gap: 0.2rem;
}
.tb-field > span {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tb-field > span small {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-dim);
    opacity: 0.85;
}

/* ─── Liste de cartes condition/action (1 carte par entrée) ─── */
.tb-rows-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    min-height: 60px;
}
.tb-rows-empty {
    margin: 0;
    padding: 0.85rem 0.6rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
}
.tb-cond-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    transition: border-color 0.12s, background 0.12s;
}
.tb-cond-row:hover {
    border-color: rgba(129, 140, 248, 0.55);
    background: rgba(30, 41, 59, 0.9);
}
.tb-cond-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.tb-cond-inputs {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.tb-cond-lang {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    transition: border-color 0.12s;
}
.tb-cond-lang:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}
.tb-cond-flag { font-size: 0.95rem; flex-shrink: 0; }
.tb-cond-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.35rem 0;
    min-width: 0;
}
.tb-cond-input::placeholder { color: #64748b; }
.tb-suggest-popup {
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    max-height: 260px;
    overflow-y: auto;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: #e2e8f0;
    z-index: 20000;  /* au-dessus du modal builder (10001) */
}
.tb-suggest-item {
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: background 0.1s;
}
.tb-suggest-item:hover {
    background: rgba(99, 102, 241, 0.35);
    color: #fff;
}
.tb-cond-move {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    flex-shrink: 0;
}
.tb-cond-up,
.tb-cond-down {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
    border-radius: 5px;
    padding: 0.05rem 0.4rem;
    font-size: 0.78rem;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.12s, color 0.12s;
}
.tb-cond-up:hover:not(:disabled),
.tb-cond-down:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.18);
    color: #fff;
}
.tb-cond-up:disabled,
.tb-cond-down:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.tb-cond-del {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 6px;
    padding: 0.3rem 0.55rem;
    font-size: 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.tb-cond-del:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fff;
}
.tb-add-row-btn {
    margin-top: 0.5rem;
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
    border: 2px dashed rgba(129, 140, 248, 0.55);
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.12s, border-color 0.12s;
}
.tb-add-row-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: #818cf8;
    color: #fff;
}

/* ─── Indicateur visuel de l'autocomplétion sur les inputs ──
   Petite flèche ▾ ambre dans l'input pour signaler à l'utilisateur
   qu'il y a une liste déroulante (datalist) disponible. */
.tb-cond-input[list] {
    background-image: linear-gradient(45deg, transparent 50%, #fbbf24 50%),
                      linear-gradient(135deg, #fbbf24 50%, transparent 50%);
    background-position: calc(100% - 14px) center, calc(100% - 9px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 22px !important;
}
.tb-cond-input[list]:focus {
    background-image: none;
    padding-right: 0.55rem !important;
}
@media (max-width: 720px) {
    .tb-cond-inputs { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ─── Édition bilingue : 2 colonnes côte à côte ─── */
.tb-field-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.4rem;
}
.tb-field-label small {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.85;
}
/* Éditeur de positions (statut par côté) dans le builder */
.tb-pos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tb-pos-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border: 1.5px solid var(--border, #cbd5e1);
    border-radius: 999px;
    background: var(--card-bg, #fff);
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}
.tb-pos-check input { margin: 0; cursor: pointer; }
.tb-pos-check:has(input:checked) {
    background: var(--accent, #ff6b00);
    border-color: var(--accent, #ff6b00);
    color: #fff;
    font-weight: 600;
}
/* Éditeur de mesure + champ photos dans le builder */
.tb-meas-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 0.2rem;
}
.tb-meas-toggle input { margin: 0; cursor: pointer; }
.tb-meas-config[hidden] { display: none; }
.tb-meas-config { margin-top: 0.5rem; }
.tb-meas-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1.5px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
    /* Couleurs explicites = lisible partout (y compris hors .tb-field,
       ex. champs d'ajout onglet/section). Texte clair sur fond sombre. */
    background: rgba(15, 23, 42, 0.85);
    color: #f1f5f9;
    font-family: inherit;
}
.tb-meas-input::placeholder { color: #94a3b8; font-style: italic; }
.tb-meas-input:focus { outline: none; border-color: #818cf8; }
.tb-pos-custom-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim, #64748b);
    margin-top: 0.25rem;
}
.tb-custompos-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.tb-custompos-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.5rem 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--accent, #ff6b00);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
}
.tb-custompos-rm {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: #fff;
    border-radius: 999px;
    width: 18px;
    height: 18px;
    line-height: 1;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tb-custompos-add {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
/* L'input doit grandir, le bouton garder sa taille naturelle (sinon
   .tb-add-row-btn, pleine largeur par défaut, écrase le champ). */
.tb-custompos-add .tb-meas-input { flex: 1 1 auto; width: auto; min-width: 0; }
/* Le bouton « + Ajouter » : .tb-add-row-btn est pensé pour un fond sombre
   (lavande clair sur clair = illisible ici). On le passe en plein indigo. */
.tb-custompos-add .tb-add-row-btn {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 0.55rem 1.05rem;
}
.tb-custompos-add .tb-add-row-btn:hover { background: #4f46e5; }
/* Préréglages d'emplacements de mesure */
.tb-measfields-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.45rem; }
.tb-preset-btn {
    background: rgba(99, 102, 241, 0.12);
    color: #4338ca;
    border: 1.5px solid rgba(99, 102, 241, 0.4);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.tb-preset-btn:hover { background: rgba(99, 102, 241, 0.22); }
.tb-pos-more { margin-top: 0.45rem; }
.tb-pos-more > summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--accent, #ff6b00);
    font-weight: 600;
    user-select: none;
    list-style: none;
}
.tb-pos-more > summary::-webkit-details-marker { display: none; }
.tb-inline-add {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin: 0.3rem 0;
}
.tb-inline-add .tb-meas-input { flex: 1 1 130px; width: auto; min-width: 0; }
.tb-inline-add .tb-add-btn,
.tb-inline-add .tb-cancel-btn { flex: 0 0 auto; width: auto; }
.tb-bilingual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}
.tb-bilingual-grid .tb-field { gap: 0.15rem; }
.tb-bilingual-sublabel {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    color: #4338ca !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
@media (max-width: 720px) {
    .tb-bilingual-grid {
        grid-template-columns: 1fr;
    }
}
.tb-field input,
.tb-field textarea {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-radius: 7px;
    padding: 0.6rem 0.75rem;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.92rem;
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.tb-field input::placeholder,
.tb-field textarea::placeholder {
    color: #64748b;
    font-style: italic;
}
.tb-field textarea {
    min-height: 110px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.5;
}
.tb-field input:hover,
.tb-field textarea:hover { border-color: rgba(148, 163, 184, 0.6); }
.tb-field input:focus,
.tb-field textarea:focus {
    border-color: #818cf8;
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}
.tb-field > span { color: #475569 !important; }

/* Section actions (boutons + sections points/mesures) */
.tb-section-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.tb-add-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 7px;
    color: white;
    padding: 0.5rem 0.95rem;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.tb-add-btn:hover { opacity: 0.92; }

.tb-add-btn-alt {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
}

.tb-cancel-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    border-radius: 7px;
    padding: 0.5rem 0.95rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
}
.tb-cancel-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* Sections list */
.tb-sections-list { display: grid; gap: 0.85rem; }

.tb-section-block {
    background: rgba(99, 102, 241, 0.10);
    border: 2px solid rgba(99, 102, 241, 0.45);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.tb-section-block.tb-section-meas {
    background: rgba(8, 145, 178, 0.10);
    border-color: rgba(8, 145, 178, 0.50);
}

.tb-section-header {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tb-section-type-badge {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.tb-section-meas .tb-section-type-badge {
    background: rgba(8, 145, 178, 0.25);
    color: #a5f3fc;
}
/* Bloc « Facture pneus » : composant prêt à l'emploi, repérable et non éditable. */
.tb-section-invoice .tb-section-type-badge {
    background: rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
}
.tb-section-invoice { border-color: rgba(16, 185, 129, 0.4); }
.tb-section-invoice .tb-section-name-fr,
.tb-section-invoice .tb-section-name-en { opacity: 0.7; cursor: default; }
.tb-invoice-note {
    margin: 0; padding: 0.7rem 0.9rem; font-size: 0.82rem; line-height: 1.4;
    color: #065f46; background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.45); border-radius: 8px;
}
/* Menu discret « ⋯ » des blocs spéciaux (Facture pneus) — rarement utilisé. */
.tb-special-wrap { position: relative; display: inline-block; }
.tb-special-toggle {
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-dim, #94a3b8); border-radius: 7px; padding: 0.45rem 0.7rem;
    cursor: pointer; font-size: 1rem; line-height: 1;
}
.tb-special-toggle:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.tb-special-menu {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; min-width: 240px;
    background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); padding: 4px;
}
.tb-special-item {
    display: block; width: 100%; text-align: left; background: transparent; border: 0;
    color: #e2e8f0; padding: 0.55rem 0.7rem; border-radius: 6px; cursor: pointer;
    font-size: 0.85rem; font-family: inherit;
}
.tb-special-item:hover { background: rgba(16, 185, 129, 0.18); color: #fff; }

.tb-section-name-fr,
.tb-section-name-en,
.tb-item-name-fr,
.tb-item-name-en {
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 0.9rem;
    flex: 1;
    min-width: 120px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tb-section-name-fr:hover,
.tb-section-name-en:hover,
.tb-item-name-fr:hover,
.tb-item-name-en:hover { border-color: rgba(148, 163, 184, 0.6); }
.tb-section-name-fr:focus,
.tb-section-name-en:focus,
.tb-item-name-fr:focus,
.tb-item-name-en:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
}

/* Items list */
.tb-items-list {
    display: grid;
    gap: 0.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid rgba(99, 102, 241, 0.45);
}

.tb-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.8rem;
    background: rgba(15, 23, 42, 0.85);
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-radius: 7px;
    transition: background 0.12s, border-color 0.12s;
}
.tb-item:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.5);
}
.tb-item-name {
    flex: 1;
    color: #f1f5f9;
    font-size: 0.92rem;
    font-weight: 500;
}

.tb-item.tb-item-editing {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.35);
    padding: 0.85rem 1rem;
    flex-direction: column;
    align-items: stretch;
}
.tb-item-edit-form {
    display: grid;
    gap: 0.85rem;
    width: 100%;
    background: rgba(99, 102, 241, 0.08);
    border: 2px solid rgba(129, 140, 248, 0.45);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.tb-item-edit-form h4 {
    margin: 0 0 0.2rem;
    color: #c7d2fe;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(129, 140, 248, 0.35);
    padding-bottom: 0.45rem;
}
.tb-item-edit-form .tb-field-label {
    color: #fff !important;
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    padding: 0.6rem 0.95rem;
    border-radius: 8px;
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 6px rgba(67, 56, 202, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-left: 5px solid #fbbf24;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tb-item-edit-form .tb-field-label::before {
    content: '▸';
    color: #fbbf24;
    font-size: 1rem;
}
.tb-item-edit-form .tb-field-label small {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.74rem;
    text-transform: none;
    letter-spacing: 0;
}
.tb-item-edit-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tb-add-item-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    border-radius: 6px;
    padding: 0.4rem;
    color: #a5b4fc;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}
.tb-add-item-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.6);
}

/* Footer du builder */
.tb-footer {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD "En atelier" — Étape B2
   ═══════════════════════════════════════════════════════════════ */

.dashboard-modal-content {
    max-width: 1280px;
    width: 98%;
    height: 88vh;
    display: flex;
    flex-direction: column;
}
.dashboard-modal-content .admin-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.dashboard-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.dashboard-toolbar-left { flex: 1; min-width: 240px; }
.dashboard-toolbar-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-search-input {
    width: 100%;
    background: #fff;
    border: 1.5px solid #94a3b8;
    color: #0f172a;
    border-radius: 7px;
    padding: 0.55rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    min-height: 42px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dashboard-search-input::placeholder { color: #94a3b8; }
.dashboard-search-input:hover { border-color: #64748b; }
.dashboard-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.22);
}

.dashboard-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: #fff;
    border: 1.5px solid #94a3b8;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #0f172a;
    font-weight: 600;
    min-height: 42px;
    transition: border-color 0.15s;
}
.dashboard-toggle:hover { border-color: #64748b; }
.dashboard-toggle input { width: 18px; height: 18px; cursor: pointer; accent-color: #6366f1; }

.dashboard-sort-sel {
    background: #fff;
    border: 1.5px solid #94a3b8;
    color: #0f172a;
    border-radius: 7px;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    min-height: 42px;
    transition: border-color 0.15s;
}
.dashboard-sort-sel:hover { border-color: #64748b; }
.dashboard-sort-sel:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.22); }

.dashboard-create-btn {
    background: linear-gradient(135deg, #f97316, #fb923c);
    border: none;
    color: white;
    border-radius: 7px;
    padding: 0.55rem 1.1rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.dashboard-create-btn:hover { opacity: 0.92; }
.dashboard-create-btn:active { transform: scale(0.98); }

.dashboard-stats {
    margin-bottom: 0.85rem;
    padding: 0.4rem 0.85rem;
    background: rgba(99, 102, 241, 0.06);
    border-left: 3px solid var(--accent-primary, #6366f1);
    border-radius: 5px;
}
.dashboard-counter {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c7d2fe;
}

.dashboard-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
}
.dashboard-empty-icon { font-size: 3rem; margin-bottom: 0.85rem; }
.dashboard-empty h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}
.dashboard-empty p { font-size: 0.9rem; margin: 0; }

.dashboard-list { display: grid; gap: 0.55rem; }

/* ─── Ticket card ──────────────────────────────────────────── */
.ticket-card {
    display: grid;
    grid-template-columns: 150px 1fr auto auto auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}
.ticket-card-chevron {
    color: inherit;
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.15s;
    user-select: none;
}
.ticket-card-open-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.7rem 1.1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
    transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ticket-card-open-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.5);
}
.ticket-card-open-btn:hover .ticket-card-chevron {
    transform: translateX(3px);
}
.ticket-card-open-btn:active { transform: scale(0.97); }

.ticket-card-thumb--btn {
    border: 1px solid rgba(255,255,255,0.12);
    padding: 0;
    background: #1e293b;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.ticket-card-thumb--btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ticket-card-thumb--btn:hover {
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.ticket-card-thumb--empty.ticket-card-thumb--btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: rgba(255,255,255,0.25);
}
.ticket-card-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: #1e293b;
}
.ticket-card-thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: rgba(255,255,255,0.25);
}
.ticket-card:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

@media (max-width: 900px) {
    .ticket-card {
        /* minmax(0,1fr) au lieu de 1fr : la piste peut rétrécir SOUS la taille
           min-content d'un enfant (sinon « blowout » de grille → débordement). */
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }
    .ticket-card > * { min-width: 0; }
}

/* position+z-index : garantit que les boutons d'action ET le menu « ⋯ »
   (qui peut déborder vers la colonne client) passent AU-DESSUS du texte
   client/inspection, jamais derrière. */
.ticket-card-left { display: grid; gap: 0.15rem; position: relative; z-index: 2; }
.ticket-ro {
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
}
.ticket-ro strong {
    color: var(--accent-primary, #6366f1);
    font-weight: 700;
    font-size: 0.95rem;
    margin-left: 0.2rem;
}
.ticket-time {
    font-size: 0.7rem;
    color: var(--text-dim);
    opacity: 0.8;
}
.ticket-actions-mini {
    display: flex;
    /* 5 boutons (avec ⋯ « Plus d'actions », inspections non commencées) débordaient
       de la colonne 150px et s'incrustaient sur la plaque → repli sur 2e ligne. */
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
    align-items: center;
}
.ticket-mini-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-dim);
    width: 34px;
    height: 34px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.ticket-mini-btn:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.6);
    color: #fff;
}
.ticket-mini-btn:active { transform: scale(0.94); }
.ticket-mini-btn--primary {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
}

/* Menu ••• (plus d'actions) */
.ticket-actions-more {
    position: relative;
    display: inline-block;
}
.ticket-actions-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    min-width: 160px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    overflow: hidden;
    padding: 4px;
}
.ticket-actions-menu-item {
    width: 100%;
    text-align: left;
    background: transparent;
    color: #fff;
    border: 0;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: 0.85rem;
    border-radius: 5px;
    cursor: pointer;
}
.ticket-actions-menu-item:hover {
    background: rgba(99, 102, 241, 0.22);
}
.ticket-actions-menu-item--danger { color: #fca5a5; }
.ticket-actions-menu-item--danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
}

.ticket-card-customer {
    display: grid;
    gap: 0.15rem;
}
.ticket-customer-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* ─── Client en attente (waiting) : repérage au premier coup d'œil ─── */
.ticket-card--waiting {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.07);
}
.ticket-waiting-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: fit-content;
    margin-bottom: 0.2rem;
    padding: 2px 9px;
    border-radius: 999px;
    background: #f59e0b;
    color: #1f2937;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4);
}
.ticket-vehicle { font-size: 0.85rem; color: var(--text-primary); }
/* Nom du gabarit d'inspection — affiché en entier ici (le chevron ne montre
   plus que « Inspection »). Peut faire plusieurs lignes, jamais coupé. */
.ticket-template-name {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.25;
    margin-top: 0.1rem;
}
.ticket-plate {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
    font-family: ui-monospace, 'SF Mono', monospace;
    letter-spacing: 0.04em;
}

/* ─── Workflow chevrons ────────────────────────────────────── */
.ticket-workflow {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
}
@media (max-width: 900px) {
    .ticket-workflow { width: 100%; }
}

.ticket-chevron {
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-dim);
    border: none;
    padding: 0.55rem 0.85rem 0.55rem 1.1rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
    transition: background 0.15s, color 0.15s, transform 0.08s;
    min-width: 130px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.ticket-chevron:first-child {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
    padding-left: 0.85rem;
}
.ticket-chevron:hover { transform: scale(1.02); }
.ticket-chevron:active { transform: scale(0.98); }

/* Mobile : les 3 chevrons (Atelier → Inspection → Rapport) faisaient 130px
   chacun = ~394px, plus large que l'écran (390px) → la carte débordait et
   « flottait dans le vide ». Ils se partagent désormais la largeur. Placé APRÈS
   la règle de base pour gagner en ordre de cascade (même spécificité). */
@media (max-width: 900px) {
    .ticket-chevron {
        min-width: 0;
        flex: 1 1 0;
        padding-left: 0.6rem;
        padding-right: 0.6rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.ticket-chevron-pending {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-dim);
}
.ticket-chevron-active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}
.ticket-chevron-done {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

/* ─── Right column (advisor + technician) ──────────────────── */
.ticket-card-right {
    display: grid;
    gap: 0.4rem;
    min-width: 180px;
}
.ticket-role-line {
    display: grid;
    gap: 1px;
}
.ticket-role-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ticket-role-value {
    font-size: 0.82rem;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   CREATE TICKET MODAL — Étape B3 : 3 cards Owner / Vehicle / Inspection
   ═══════════════════════════════════════════════════════════════ */

.create-ticket-modal-content {
    max-width: 1380px;
    width: 98%;
    max-height: 92vh;
}
.create-ticket-modal-content .admin-modal-body {
    overflow-y: auto;
    max-height: calc(92vh - 70px);
}

.ct-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1rem;
}
@media (max-width: 1100px) {
    .ct-grid { grid-template-columns: 1fr; }
}

.ct-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    position: relative;
}
.ct-card-num {
    position: absolute;
    top: -14px;
    left: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.ct-card-owner       { border-color: rgba(99, 102, 241, 0.45); }
.ct-card-owner       .ct-card-num { background: linear-gradient(135deg, #6366f1, #818cf8); }
.ct-card-vehicle     { border-color: rgba(16, 185, 129, 0.45); }
.ct-card-vehicle     .ct-card-num { background: linear-gradient(135deg, #10b981, #34d399); }
.ct-card-inspection  { border-color: rgba(249, 115, 22, 0.45); }
.ct-card-inspection  .ct-card-num { background: linear-gradient(135deg, #f97316, #fb923c); }

.ct-card-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.85rem;
    text-align: center;
}
.garage-form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }

.sms-header-unread {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 9px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Tâche en attente : alerte impossible à manquer ──────────
   Dès qu'une tâche assignée non terminée existe, le bouton « Tâches »
   (en-tête ET barre flottante) devient rouge et pulse. (Compteur d'onglet
   + pastille d'icône gérés en JS — cf. tasks-ui.js.) ── */
@keyframes fs-pending-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
@keyframes fs-pending-badge {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
}
/* !important : état d'alerte volontairement prioritaire sur le thème
   (html.fs-theme .badge-btn a une spécificité supérieure) et tout autre style. */
.badge-btn.has-pending {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #fff !important;
    animation: fs-pending-pulse 1.6s ease-in-out infinite;
}
.badge-btn.has-pending:hover { background: #b91c1c !important; border-color: #b91c1c !important; }
.badge-btn.has-pending .sms-header-unread {
    background: #fff !important; color: #dc2626 !important;
    animation: fs-pending-badge 1.6s ease-in-out infinite;
}
.qa-btn.has-pending {
    background: #dc2626 !important;
    color: #fff !important;
    animation: fs-pending-pulse 1.6s ease-in-out infinite;
}
.qa-btn.has-pending:hover { background: #b91c1c !important; color: #fff !important; }
.qa-btn.has-pending .qa-badge {
    background: #fff !important; color: #dc2626 !important;
    animation: fs-pending-badge 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .badge-btn.has-pending, .qa-btn.has-pending,
    .badge-btn.has-pending .sms-header-unread, .qa-btn.has-pending .qa-badge {
        animation: none;
    }
}

/* Tâche en attente sur MOBILE : l'en-tête est réduit au bouton ☰ et les Tâches
   sont un item du menu. Pastille rouge sur le ☰ (visible menu fermé) + compteur
   sur l'item « Tâches » du drawer. */
.main-menu-btn { position: relative; }
.main-menu-btn.has-pending { animation: fs-pending-pulse 1.6s ease-in-out infinite; }
.main-menu-dot {
    position: absolute; top: -3px; right: -3px;
    min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
    background: #dc2626; color: #fff;
    font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
    border-radius: 9px; box-shadow: 0 0 0 2px #fff;
    animation: fs-pending-badge 1.6s ease-in-out infinite;
}
.main-drawer-item.has-pending { background: rgba(220, 38, 38, 0.12); }
.main-drawer-item.has-pending .main-drawer-item-label { color: #dc2626; font-weight: 700; }
.main-drawer-item-badge {
    margin-left: auto;
    background: #dc2626; color: #fff;
    font-size: 12px; font-weight: 800; line-height: 1; padding: 3px 8px; border-radius: 10px;
}
@media (prefers-reduced-motion: reduce) {
    .main-menu-btn.has-pending, .main-menu-dot { animation: none; }
}

/* ── AJOUT 2026-07-17 (GO Thomas) : hiérarchie d'urgence des tâches ──
   Le ROUGE PULSANT (has-pending) est désormais réservé aux tâches URGENTES
   (priorité 🔴 ou échéance du jour/dépassée). Des tâches normales en attente
   → état CALME : badge visible, couleur violette, AUCUNE animation. */
.badge-btn.has-pending-soft {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #fff !important;
}
.badge-btn.has-pending-soft:hover { background: #6d28d9 !important; border-color: #6d28d9 !important; }
.badge-btn.has-pending-soft .sms-header-unread { background: #fff !important; color: #7c3aed !important; }
.main-menu-btn.has-pending-soft .main-menu-dot {
    background: #7c3aed; animation: none;
}

/* Tâches PROGRAMMÉES (sortie au jour J) : visibles grisées pour le créateur/admin. */
.tasks-card--scheduled { opacity: 0.62; border-left-color: #94a3b8; }
.tasks-sched-pill {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    background: #e2e8f0; color: #475569;
    font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* Carte URGENTE (priorité 🔴 ou échéance du jour) : bordure rouge qui pulse doucement. */
@keyframes fs-task-urgent-pulse {
    0%, 100% { box-shadow: inset 4px 0 0 0 #dc2626; }
    50%      { box-shadow: inset 4px 0 0 0 #f87171; }
}
.tasks-card--urgent:not(.tasks-card--done) {
    animation: fs-task-urgent-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .tasks-card--urgent:not(.tasks-card--done) { animation: none; }
}

/* Formulaire : raccourcis d'échéance + case « tâche programmée ». */
.tf-due-shortcuts { display: flex; gap: 6px; margin-top: 6px; }
.tf-due-btn {
    padding: 4px 10px; border-radius: 8px; border: 1px solid #cbd5e1;
    background: #f8fafc; color: #334155; font-size: 12px; font-weight: 600; cursor: pointer;
}
.tf-due-btn:hover { background: #ede9fe; border-color: #7c3aed; color: #6d28d9; }
.tf-sched-label {
    display: flex; align-items: center; gap: 8px; margin-top: 8px;
    font-size: 13px; color: #475569; cursor: pointer; user-select: none;
}
.tf-sched-label input { accent-color: #7c3aed; }

/* ─── Quick Actions — barre flottante toujours visible ─────── */
/* SMS & Tâches sont lancés depuis la barre flottante (toujours visible, même
   pendant une inspection). Or .admin-modal est à 10000, SOUS .inspection-modal
   (10001) → sans ça, cliquer SMS/Tâches dans l'inspection ouvrait le modal
   DERRIÈRE l'inspection (invisible = « la barre ne fonctionne pas »). On les
   place au-dessus de l'inspection, mais sous la barre (15000) et les toasts. */
#sms-modal,
#tasks-modal { z-index: 14000; }

.quick-actions-bar {
    position: fixed;
    /* En bas-droite : zone neutre, jamais d'overlap avec les × des modales,
       pouce naturel sur mobile, ne cache rien du header. */
    bottom: 18px;
    right: 18px;
    z-index: 15000;       /* au-dessus des modals (10000-10010), sous les toasts (30000) */
    display: flex;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.92);
    padding: 0.4rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
}

.qa-btn {
    position: relative;
    background: transparent;
    color: #cbd5e1;
    border: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.qa-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
}
.qa-icon { font-size: 1rem; line-height: 1; }
.qa-label { white-space: nowrap; }
.qa-badge {
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 9px;
    min-width: 18px;
    text-align: center;
}
.qa-btn--presence[data-presence="absent"] { color: #94a3b8; }
.qa-btn--presence[data-presence="available"] { color: #4ade80; }

@media (max-width: 600px) {
    .quick-actions-bar {
        bottom: 14px;
        right: 14px;
        gap: 0.25rem;
        padding: 0.3rem;
    }
    .qa-label { display: none; }
    .qa-btn { padding: 0.5rem; }
    .qa-btn--presence .qa-label { display: none; }
}

/* ─── Toasts (feedback non-bloquant) ──────────────────────────── */
#fs-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 30000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}
.fs-toast {
    pointer-events: auto;
    background: #1e293b;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 260px;
    max-width: 400px;
    font-size: 0.88rem;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.18s, transform 0.18s;
    border-left: 4px solid #6366f1;
}
.fs-toast.is-visible { opacity: 1; transform: translateX(0); }
.fs-toast--success { border-left-color: #16a34a; }
.fs-toast--warn { border-left-color: #f59e0b; }
.fs-toast--error { border-left-color: #ef4444; }
.fs-toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.fs-toast--success .fs-toast-icon { color: #22c55e; }
.fs-toast--warn .fs-toast-icon { color: #fbbf24; }
.fs-toast--error .fs-toast-icon { color: #f87171; }
.fs-toast-msg { flex: 1; line-height: 1.4; }
.fs-toast-action {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 0;
    padding: 0.35rem 0.7rem;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}
.fs-toast-action:hover { background: rgba(255,255,255,0.22); }
.fs-toast-close {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
}
.fs-toast-close:hover { color: #fff; }
@media (max-width: 600px) {
    #fs-toast-container { top: 70px; right: 10px; left: 10px; }
    .fs-toast { min-width: 0; max-width: none; }
}

/* ─── Module Tâches internes ──────────────────────────────────── */
.tasks-modal-content {
    max-width: 980px;
    width: 100%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}
.tasks-unread-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.tasks-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
}
.tasks-toolbar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.tasks-tabs {
    display: flex;
    gap: 0.4rem;
    flex: 1;
    flex-wrap: wrap;
}
.tasks-tab {
    background: transparent;
    border: 1.5px solid transparent;
    color: #475569;
    padding: 0.45rem 0.85rem;
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
}
.tasks-tab:hover { background: #f1f5f9; }
.tasks-tab.is-active {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #c7d2fe;
}
.tasks-tab-count {
    display: inline-block;
    background: rgba(99,102,241,0.2);
    color: #4f46e5;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
    margin-left: 0.3rem;
}
.tasks-tab.is-active .tasks-tab-count { background: #6366f1; color: #fff; }

.tasks-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.tasks-empty {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 3rem 1rem;
}

.tasks-card {
    display: flex;
    gap: 0.75rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-left-width: 4px;
    border-left-color: #94a3b8;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s, background 0.15s;
}
.tasks-card:hover { border-color: #6366f1; }
.tasks-card--in_progress { border-left-color: #f59e0b; background: #fffbeb; }
.tasks-card--done { border-left-color: #16a34a; background: #f0fdf4; opacity: 0.7; }
.tasks-card--done .tasks-card-title { text-decoration: line-through; color: #64748b; }
.tasks-card--urgent { border-left-color: #dc2626; }
.tasks-card--urgent.tasks-card--in_progress { background: #fef2f2; }

.tasks-card-main { flex: 1; min-width: 0; }
.tasks-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}
.tasks-prio-pill {
    background: #fee2e2;
    color: #b91c1c;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tasks-card-title {
    margin: 0;
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 600;
}
.tasks-card-desc {
    margin: 0.25rem 0 0.4rem;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.45;
}
/* 💬 Réponse NON LUE : carte surlignée + badge — impossible à rater (22 juil. 2026) */
.tasks-card--unread-reply { border: 2px solid #7c3aed; box-shadow: 0 0 0 3px #7c3aed22; }
.tasks-reply-pill {
    display: inline-block; background: #7c3aed; color: #fff; font-weight: 800;
    font-size: 0.72rem; letter-spacing: .02em; border-radius: 999px; padding: 0.15rem 0.6rem;
    animation: tasks-reply-pulse 1.4s ease-in-out infinite;
}
@keyframes tasks-reply-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
/* 💬 Fil de réponses sur une tâche (22 juil. 2026) */
.tasks-card-comments { margin: 0.35rem 0 0.45rem; display: flex; flex-direction: column; gap: 0.3rem; }
.tasks-comment { background: #f1f5f9; border-left: 3px solid #7c3aed; border-radius: 0 8px 8px 0;
    padding: 0.4rem 0.6rem; font-size: 0.84rem; }
.tasks-comment-head { color: #64748b; font-size: 0.78rem; display: block; margin-bottom: 0.1rem; }
.tasks-comment-head strong { color: #334155; }
.tasks-comment-text { color: #1e293b; white-space: pre-wrap; word-break: break-word; }
.tasks-reply-form { padding: 0.5rem 0.9rem 0.7rem; border-top: 1px dashed #e2e8f0; }
.tasks-reply-form textarea { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 8px;
    padding: 0.5rem 0.6rem; font-family: inherit; font-size: 0.88rem; resize: vertical; }
.tasks-reply-form textarea:focus { outline: 2px solid #7c3aed33; border-color: #7c3aed; }
.tasks-reply-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.4rem; }
.tasks-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    font-size: 0.78rem;
    color: #64748b;
}
.tasks-card-meta strong { color: #1e293b; }
.tasks-meta-by { font-style: italic; }
.tasks-meta-ticket { color: #4f46e5; font-weight: 500; }
/* Référence ticket cliquable → ouvre l'inspection */
.tasks-meta-ticket--link {
    background: none; border: none; padding: 0;
    font: inherit; color: #4f46e5; font-weight: 600;
    cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.tasks-meta-ticket--link:hover { color: #4338ca; }
.tasks-meta-due { color: #475569; }
.tasks-meta-due.is-overdue { color: #dc2626; font-weight: 700; }

.tasks-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: stretch;
    flex-shrink: 0;
}
.tasks-btn {
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    color: #1e293b;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}
.tasks-btn:hover { border-color: #6366f1; }
.tasks-btn--start { color: #b45309; border-color: #fcd34d; }
.tasks-btn--start:hover { background: #fef3c7; }
.tasks-btn--done { color: #166534; border-color: #86efac; }
.tasks-btn--done:hover { background: #dcfce7; }
.tasks-btn--open { color: #4338ca; border-color: #c7d2fe; font-weight: 600; }
.tasks-btn--open:hover { background: #eef2ff; border-color: #6366f1; }
.tasks-btn--reopen { color: #475569; }
.tasks-btn--delete { color: #b91c1c; padding: 0.35rem 0.5rem; }
.tasks-btn--delete:hover { border-color: #ef4444; background: #fef2f2; }

/* Form de création */
.task-form-modal-content { max-width: 640px; }

@media (max-width: 700px) {
    .tasks-card { flex-direction: column; }
    .tasks-card-actions { flex-direction: row; flex-wrap: wrap; }
}

/* ─── Conversations SMS ──────────────────────────────────────── */
.sms-modal-content {
    max-width: 1100px;
    width: 100%;
    height: 85vh;
    display: flex;
    flex-direction: column;
}
.sms-unread-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.sms-modal-body {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    overflow: hidden;
    background: #f8fafc;
}
.sms-sidebar {
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sms-filter {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.sms-tabs {
    display: flex;
    flex: 1;
    gap: 0.2rem;
    overflow-x: auto;
}
.sms-tab {
    background: transparent;
    border: 1px solid transparent;
    color: #475569;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.sms-tab:hover { background: #f1f5f9; }
.sms-tab.is-active {
    background: #eef2ff;
    color: #4f46e5;
    border-color: #c7d2fe;
}
.sms-tab-count {
    display: inline-block;
    background: rgba(99,102,241,0.18);
    color: #4f46e5;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
}
.sms-tab.is-active .sms-tab-count { background: #6366f1; color: #fff; }
.sms-sim-btn {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 0.25rem 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    color: #475569;
    flex-shrink: 0;
}
.sms-sim-btn:hover { border-color: #6366f1; }
.sms-thread-list {
    flex: 1;
    overflow-y: auto;
}
.sms-thread-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    color: #1e293b;
}
.sms-thread-item:hover { background: #f8fafc; }
.sms-thread-item.is-active { background: #eef2ff; border-left: 3px solid #6366f1; padding-left: calc(0.85rem - 3px); }
.sms-thread-item.has-unread { font-weight: 600; }
.sms-thread-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.4rem;
}
.sms-thread-top strong { font-size: 0.92rem; }
.sms-thread-top span { font-size: 0.72rem; color: #94a3b8; }
.sms-thread-preview {
    font-size: 0.8rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.25rem;
}
.sms-thread-unread {
    position: absolute;
    top: 0.65rem;
    right: 0.85rem;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}
.sms-empty {
    padding: 1.5rem;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

.sms-conversation {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sms-conv-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-style: italic;
}
#sms-conversation-active {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sms-conv-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.sms-conv-name { font-weight: 600; color: #0f172a; }
/* AJOUT 2026-07-17 (GO Thomas) : correction du contact d'un fil SMS mal étiqueté */
.sms-conv-name-row { display: flex; align-items: center; gap: 6px; }
.sms-conv-edit-btn {
    border: none; background: transparent; cursor: pointer;
    font-size: 13px; opacity: 0.45; padding: 2px 4px; border-radius: 6px;
}
.sms-conv-edit-btn:hover { opacity: 1; background: #f1f5f9; }
/* [hidden] AVANT la règle display:grid — sinon le grid écrase l'attribut hidden
   et le panneau reste affiché en permanence (même piège que public-report-band-body). */
.sms-conv-edit-panel[hidden] { display: none !important; }
.sms-conv-edit-panel {
    margin-top: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 10px;
    background: #f8fafc; display: grid; gap: 8px; max-width: 420px;
}
.sms-conv-edit-suggest { display: grid; gap: 6px; }
.sms-conv-suggest-btn {
    text-align: left; padding: 7px 10px; border-radius: 8px; cursor: pointer;
    border: 1px dashed #7c3aed; background: #f5f3ff; color: #4c1d95; font-size: 13px;
}
.sms-conv-suggest-btn:hover { background: #ede9fe; }
.sms-conv-suggest-btn.is-selected { border-style: solid; background: #ede9fe; box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25); }
.sms-conv-edit-actions { display: flex; gap: 8px; }
.sms-conv-phone { font-size: 0.78rem; color: #64748b; font-family: ui-monospace, monospace; }
.sms-assign-select {
    background: #fff;
    border: 1.5px solid #94a3b8;
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    color: #0f172a;
    cursor: pointer;
}

.sms-conv-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sms-msg { display: flex; flex-direction: column; max-width: 70%; }
.sms-msg--in { align-self: flex-start; }
.sms-msg--out { align-self: flex-end; align-items: flex-end; }
.sms-msg-bubble {
    padding: 0.55rem 0.85rem;
    border-radius: 16px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.sms-msg--in .sms-msg-bubble {
    background: #e2e8f0;
    color: #0f172a;
    border-bottom-left-radius: 4px;
}
.sms-msg--out .sms-msg-bubble {
    background: #6366f1;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sms-msg-meta {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-top: 2px;
    padding: 0 0.5rem;
}
.sms-msg-sender { color: #475569; font-weight: 600; }

.sms-conv-composer {
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    background: #fff;
}
.sms-conv-composer textarea {
    flex: 1;
    resize: none;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: #0f172a;
    background: #fff;
    outline: none;
}
.sms-conv-composer textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.22);
}
.sms-send-btn {
    background: #6366f1;
    color: #fff;
    border: 0;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    align-self: stretch;
}
.sms-send-btn:hover { background: #4f46e5; }

@media (max-width: 720px) {
    .sms-modal-body { grid-template-columns: 1fr; }
    .sms-sidebar { display: none; }
    /* mobile : montrer la liste seulement quand pas de conv active.
       Pour MVP on garde le panel actif visible quand on a sélectionné. */
}

/* ─── Écran fallback "compte orphelin" ────────────────────── */
.orphan-screen {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.orphan-screen-card {
    background: #fff;
    color: #0f172a;
    max-width: 500px;
    width: 100%;
    border-radius: 14px;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
}
.orphan-screen-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.orphan-screen-title {
    margin: 0 0 1rem;
    color: #b91c1c;
    font-size: 1.35rem;
}
.orphan-screen-body {
    color: #1e293b;
    line-height: 1.55;
    text-align: left;
    background: #fef2f2;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border-left: 3px solid #ef4444;
    margin-bottom: 0.85rem;
}
.orphan-screen-steps {
    text-align: left;
    color: #334155;
    padding-left: 1.5rem;
    margin: 0.75rem 0;
    line-height: 1.6;
}
.orphan-screen-hint {
    color: #64748b;
    font-size: 0.88rem;
    margin: 0.85rem 0 1.25rem;
}
.orphan-screen-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
}

/* ─── Onboarding wizard ─────────────────────────────────────── */
.onboarding-modal-content {
    max-width: 700px;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.onboarding-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 500;
}
.onboarding-step span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
}
.onboarding-step.is-current span { background: #6366f1; color: #fff; }
.onboarding-step.is-current { color: #1e293b; }
.onboarding-step.is-done span { background: #16a34a; color: #fff; }
.onboarding-step.is-done span::before { content: '✓'; }
.onboarding-step.is-done span > * { display: none; }
.onboarding-step.is-done { color: #16a34a; }
.onboarding-step-title { margin: 0 0 0.4rem; color: #1e293b; font-size: 1.1rem; }
.onboarding-step-hint { color: #64748b; font-size: 0.85rem; margin: 0 0 1rem; line-height: 1.45; }
.onboarding-step-hint code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 0.85em; }
.onboarding-footer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.onboarding-error { color: #dc2626; font-size: 0.85rem; font-weight: 500; }
.onboarding-loading { color: #64748b; font-style: italic; padding: 1rem; text-align: center; }

/* Étape 2 — Templates */
.onboarding-template-list {
    display: grid;
    gap: 0.55rem;
    max-height: 320px;
    overflow-y: auto;
}
.onboarding-template-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.onboarding-template-card:hover { border-color: #6366f1; background: #f8fafc; }
.onboarding-template-card.is-selected {
    border-color: #6366f1;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.onboarding-template-card input[type="radio"] { width: 18px; height: 18px; flex-shrink: 0; }
.onboarding-template-info { display: grid; gap: 0.15rem; }
.onboarding-template-info strong { color: #1e293b; font-size: 0.95rem; }
.onboarding-template-info small { color: #64748b; font-size: 0.78rem; }

/* Étape 3 — Personnel */
.onboarding-staff-list { display: grid; gap: 0.55rem; }
.onboarding-staff-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr 0.9fr auto;
    gap: 0.45rem;
    align-items: center;
}
.onboarding-staff-remove {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    color: #b91c1c;
    cursor: pointer;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    line-height: 1;
}
.onboarding-staff-remove:hover { border-color: #ef4444; background: #fef2f2; }

@media (max-width: 720px) {
    .onboarding-staff-row {
        grid-template-columns: 1fr 1fr;
    }
    .onboarding-staff-row .onboarding-staff-remove {
        grid-column: 2;
        justify-self: end;
    }
}

/* Indicateur de statut du décodage VIN (modale création ticket) */
.ct-vin-status { font-size: 0.7rem; font-weight: 600; margin-left: 0.5rem; vertical-align: middle; }
.ct-vin-status--pending { color: #64748b; }
.ct-vin-status--loading { color: #6366f1; }
.ct-vin-status--ok { color: #16a34a; }
.ct-vin-status--err { color: #dc2626; }

/* Champ VIN + bouton scan OCR */
.ct-vin-row {
    display: flex;
    gap: 0.45rem;
    align-items: stretch;
}
.ct-vin-row .garage-form-input { flex: 1; }
.ct-vin-scan-btn {
    background: #fff;
    color: #1e293b;
    border: 1.5px solid #94a3b8;
    border-radius: 7px;
    padding: 0 0.85rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}
.ct-vin-scan-btn:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

/* ═══ Scanner de VIN en direct (caméra) ═══════════════════════════ */
.vinscan-overlay {
    position: fixed; inset: 0; z-index: 100000;
    background: #000; display: flex; flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.vinscan-topbar {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px; color: #fff; gap: 12px;
}
.vinscan-title { font-weight: 700; font-size: 1rem; }
.vinscan-close {
    background: rgba(255,255,255,0.14); color: #fff; border: none; border-radius: 50%;
    width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer; flex: 0 0 auto;
}
.vinscan-stage { position: relative; flex: 1 1 auto; overflow: hidden; }
.vinscan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vinscan-frame {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 82%; max-width: 520px; height: 30%; max-height: 240px;
    border: 3px solid rgba(255,255,255,0.9); border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.45); overflow: hidden;
}
.vinscan-laser {
    position: absolute; left: 0; right: 0; height: 2px; top: 0;
    background: #34d399; box-shadow: 0 0 8px 1px #34d399;
    animation: vinscan-scan 1.8s ease-in-out infinite;
}
@keyframes vinscan-scan { 0%,100% { top: 4%; } 50% { top: 96%; } }
.vinscan-hint {
    position: absolute; left: 0; right: 0; bottom: 70px; text-align: center;
    color: #fff; font-size: 0.9rem; padding: 0 20px; text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.vinscan-status {
    position: absolute; left: 0; right: 0; bottom: 36px; text-align: center;
    color: #a7f3d0; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.04em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
.vinscan-actions {
    flex: 0 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
    display: flex; justify-content: center; background: #000;
}
.vinscan-photo {
    background: #fff; color: #111827; border: none; border-radius: 12px;
    padding: 0.85rem 1.4rem; font-size: 1rem; font-weight: 700; font-family: inherit; cursor: pointer;
}
.vinscan-hit .vinscan-frame { border-color: #34d399; box-shadow: 0 0 0 9999px rgba(4,120,87,0.45); }
.vinscan-hit .vinscan-laser { display: none; }
.garage-form-input {
    padding: 0.55rem 0.85rem; border-radius: 7px; font-size: 0.9rem;
    background: #fff;
    border: 1.5px solid #94a3b8;            /* slate-400 — bordure visible sur fond blanc */
    color: #0f172a;                          /* slate-900 — texte sombre */
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 42px;
    box-sizing: border-box;
    width: 100%;
    font-family: inherit;
}
.garage-form-input::placeholder { color: #94a3b8; }
.garage-form-input:hover { border-color: #64748b; }
.garage-form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.22);
}
/* Style spécifique textarea pour garage-form-input */
textarea.garage-form-input { resize: vertical; min-height: 72px; padding: 0.7rem 0.85rem; }
.garage-form-hint { font-size: 0.72rem; color: var(--text-dim); line-height: 1.4; }
.garage-form-error {
    margin-top: 0.5rem; padding: 0.5rem 0.85rem; background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3); border-radius: 7px;
    font-size: 0.82rem; color: #fca5a5;
}
.garage-form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
/* Modale « Créer un ticket » : actions alignées à DROITE (Annuler · Créer le ticket). */
.ct-form-actions { justify-content: flex-end; align-items: center; }
.garage-form-save-btn {
    padding: 0.6rem 1.4rem; border-radius: 8px; font-size: 0.875rem; font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white;
    border: none; cursor: pointer; transition: opacity 0.15s;
}
.garage-form-save-btn:hover { opacity: 0.85; }
.garage-form-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.garage-form-cancel-btn {
    padding: 0.6rem 1.2rem; border-radius: 8px; font-size: 0.875rem;
    background: transparent; border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-dim); cursor: pointer; transition: opacity 0.15s;
}
.garage-form-cancel-btn:hover { opacity: 0.75; }

/* Logo upload */
.garage-logo-upload-area { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.garage-logo-preview {
    width: 72px; height: 72px; border-radius: 8px; flex-shrink: 0;
    background: rgba(255,255,255,0.06); border: 1px dashed rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.garage-logo-img { width: 100%; height: 100%; object-fit: contain; }
.garage-logo-placeholder { font-size: 0.65rem; color: var(--text-dim); text-align: center; padding: 4px; }
.garage-logo-upload-controls { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; flex: 1 1 auto; }
.garage-logo-file-btn {
    display: inline-block; align-self: flex-start; padding: 0.4rem 1rem; border-radius: 7px; font-size: 0.8rem;
    background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.35);
    color: #a5b4fc; cursor: pointer; transition: opacity 0.15s; white-space: nowrap;
}
.garage-logo-file-btn:hover { opacity: 0.75; }
/* Nom de fichier tronqué (… ) — un nom long ne doit jamais élargir la cellule
   et déborder sur le champ voisin (Prénom). */
.garage-logo-filename { font-size: 0.72rem; color: var(--text-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ Module Clients (CRM) ═══════════════════════════════════════ */
.clients-modal-content { max-width: 1400px; width: 100%; }
.clients-body {
    display: grid; grid-template-columns: 340px 1fr;
    /* Remplit la carte (flex colonne, overflow:hidden) et AUTORISE les colonnes
       à rétrécir (min-height:0) : chaque colonne défile alors indépendamment.
       Sans ça, la grille gonflait à la hauteur du contenu (6 000 px avec les
       3 000 clients importés) et la carte coupait tout → « je ne peux pas
       descendre ». Les enfants de grid/flex ont min-height:auto par défaut :
       le poser à 0 est OBLIGATOIRE à chaque niveau de la chaîne de scroll. */
    flex: 1 1 auto; min-height: 0;
}
/* Liste (gauche) */
.clients-list-pane {
    border-right: 1px solid var(--fs-border, #e6e8ec);
    padding: 1rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0;
    min-height: 0;
}
.clients-search {
    background: var(--fs-field, #f4f5f7); border: 1px solid var(--fs-border, #e6e8ec);
    border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; font-family: inherit; color: var(--fs-text, #15151a);
}
.clients-list { display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.clients-item {
    text-align: left; border: 1px solid var(--fs-border, #e6e8ec); border-radius: 11px;
    padding: .7rem .85rem; background: #fff; cursor: pointer; font-family: inherit; width: 100%;
    transition: border-color .12s, background .12s;
}
.clients-item:hover { border-color: #b9bdc7; }
.clients-item.active { border-color: var(--fs-violet, #5a1aa0); box-shadow: 0 0 0 2px rgba(90,26,160,.12); background: #faf7ff; }
.clients-item-nm { font-weight: 700; font-size: .95rem; color: var(--fs-text, #15151a); }
.clients-item-sub { font-size: .78rem; color: var(--fs-muted, #6b6d75); margin-top: .15rem; }
.clients-badge-co { display: inline-block; color: var(--fs-violet, #5a1aa0); font-size: .66rem; font-weight: 700;
    background: #f0ebff; border-radius: 6px; padding: .05rem .4rem; margin-left: .3rem; vertical-align: middle; }
.clients-empty, .clients-fiche-empty { color: var(--fs-muted, #6b6d75); text-align: center; padding: 2rem 1rem; font-size: .9rem; }
.clients-muted { color: var(--fs-muted, #6b6d75); font-size: .85rem; }

/* Fiche (droite) */
.clients-fiche-pane { padding: 1.4rem 1.6rem; overflow-y: auto; min-width: 0; min-height: 0;
    display: flex; flex-direction: column; gap: 1.2rem; }
.clients-fiche { display: flex; flex-direction: column; gap: 1.2rem; }
.clients-fiche-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.clients-fiche-name { font-size: 1.5rem; font-weight: 800; margin: 0; color: var(--fs-text, #15151a); }
.clients-fiche-sub { font-size: .85rem; color: var(--fs-muted, #6b6d75); margin-top: .15rem; }
.clients-btn-edit { margin-left: auto; border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff;
    border-radius: 9px; padding: .45rem .8rem; font-weight: 700; font-size: .8rem; color: var(--fs-text, #15151a); cursor: pointer; }
.clients-btn-edit:hover { border-color: var(--fs-violet, #5a1aa0); }
.clients-coord { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1.5rem; font-size: .9rem; margin: .2rem 0 0; }
.clients-coord div { display: flex; gap: .5rem; align-items: baseline; }
.clients-coord .cl-lbl { color: var(--fs-muted, #6b6d75); min-width: 5.5rem; }
.clients-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: .6rem .85rem; font-size: .85rem; }
.clients-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.cl-act { border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff; border-radius: 10px;
    padding: .6rem 1rem; font-weight: 700; font-size: .85rem; cursor: pointer; font-family: inherit; color: var(--fs-text, #15151a); }
.cl-act:hover:not([disabled]) { border-color: var(--fs-violet, #5a1aa0); }
.cl-act[disabled] { opacity: .5; cursor: not-allowed; }
.cl-act--primary { background: var(--fs-violet, #5a1aa0); color: #fff; border-color: var(--fs-violet, #5a1aa0); }
.cl-act--primary:hover { background: #4a1488; }
.clients-sec-title { font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: var(--fs-muted, #6b6d75);
    text-transform: uppercase; margin: 0 0 .6rem; }
.clients-veh { border: 1px solid var(--fs-border, #e6e8ec); border-radius: 11px; padding: .7rem .9rem;
    display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.cl-vmain { font-weight: 700; }
.cl-vsub { font-size: .78rem; color: var(--fs-muted, #6b6d75); }
.cl-vbtn { margin-left: auto; border: 1.5px solid var(--fs-violet, #5a1aa0); color: var(--fs-violet, #5a1aa0);
    background: #faf7ff; border-radius: 8px; padding: .35rem .7rem; font-weight: 700; font-size: .78rem; cursor: pointer;
    white-space: nowrap; font-family: inherit; }
.cl-vbtn:hover { background: #f0ebff; }
.clients-timeline { display: flex; flex-direction: column; }
/* ▶ Écouter (enregistrement d'appel / message vocal) dans la timeline */
.cl-audio { border: 1.5px solid var(--fs-violet, #5a1aa0); color: var(--fs-violet, #5a1aa0);
    background: #faf7ff; border-radius: 999px; padding: .15rem .6rem; font-weight: 700; font-size: .74rem;
    cursor: pointer; white-space: nowrap; font-family: inherit; margin-left: .4rem; vertical-align: 1px; }
.cl-audio:hover { background: #f0ebff; }
.cl-tl { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px dashed var(--fs-border, #e6e8ec); font-size: .88rem; }
.cl-tl:last-child { border-bottom: none; }
.cl-tl-date { color: var(--fs-muted, #6b6d75); width: 6rem; flex-shrink: 0; font-size: .8rem; }
.cl-ok { color: var(--fs-success, #15803d); font-weight: 700; font-size: .82rem; }
.cl-done { color: var(--fs-violet, #5a1aa0); font-weight: 700; font-size: .82rem; }
.cl-muted { color: var(--fs-muted, #6b6d75); font-size: .82rem; }
/* Type d'inspection (nom du gabarit) dans la timeline — pastille discrète. */
.cl-tl-type {
    display: inline-block;
    padding: 0 .4rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    font-weight: 600;
    font-size: .82rem;
}
.client-form-modal-content { max-width: 720px; }
.cl-tl--link { cursor: pointer; }
.cl-tl--link:hover { background: #faf7ff; }

/* Module Clients — doublons (Phase 3) */
.clients-dupes-btn { border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff; color: var(--fs-text, #15151a);
    border-radius: 9px; padding: .5rem .85rem; font-weight: 700; font-size: .82rem; cursor: pointer; font-family: inherit; }
.clients-dupes-btn:hover { border-color: var(--fs-violet, #5a1aa0); }
.clients-dupes-btn--alert { border-color: #f59e0b; color: #b45309; background: #fffbeb; }
.clients-dupe-group { border: 1px solid var(--fs-border, #e6e8ec); border-radius: 12px; padding: .5rem .7rem; margin-bottom: .8rem; background: #fbfbfc; }
.clients-dupe-row { display: flex; align-items: center; gap: .8rem; padding: .55rem .3rem; border-bottom: 1px dashed var(--fs-border, #e6e8ec); }
.clients-dupe-row:last-child { border-bottom: none; }

/* ═══ Annotateur de photo (cercles / flèches / crayon) ═══════════ */
.photo-annot {
    position: fixed; inset: 0; z-index: 12000;
    background: rgba(10, 10, 15, 0.96);
    display: none; flex-direction: column;
}
.photo-annot.is-open { display: flex; }
.photo-annot-bar { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; flex-wrap: wrap; }
.photo-annot-bar--top { justify-content: space-between; background: rgba(0, 0, 0, 0.35); }
.photo-annot-bar--tools { justify-content: center; background: rgba(0, 0, 0, 0.35); }
.pa-title { color: #fff; font-weight: 700; }
.pa-btn { border: 1.5px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff;
    border-radius: 8px; padding: .5rem .9rem; font-weight: 700; cursor: pointer; font-family: inherit; font-size: .9rem; }
.pa-btn--save { background: #15803d; border-color: #15803d; }
.photo-annot-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: .4rem; }
.photo-annot-stage canvas {
    max-width: 100%; max-height: 100%;
    touch-action: none;            /* essentiel : le doigt dessine, ne fait pas défiler */
    background: #fff; cursor: crosshair;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.55);
}
.pa-tool { width: 46px; height: 46px; border: 1.5px solid rgba(255,255,255,.28);
    background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; font-size: 1.25rem; cursor: pointer; }
.pa-tool.is-active { background: rgba(255,255,255,.32); border-color: #fff; }
.pa-color { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5);
    cursor: pointer; padding: 0; }
.pa-color.is-active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.6); transform: scale(1.12); }
.pa-sep { width: 1px; height: 28px; background: rgba(255,255,255,.25); margin: 0 .3rem; }

/* ── Pastille de présence (Disponible / Absent) — discrète dans l'en-tête ── */
.presence-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--bg-card, #fff);
    color: #16a34a;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s, border-color .15s, color .15s;
}
.presence-dot:hover { border-color: #cbd5e1; }
.presence-dot.is-absent { color: #94a3b8; background: #f1f5f9; }

/* ── Onglet « Absences » (redirection tâches/SMS du remplaçant) ── */
/* Neutralise les styles globaux du panneau (label uppercase/block, input width:100%) */
#est-absences-body label { display: flex; margin-bottom: 0; text-transform: none; font-size: inherit; font-weight: inherit; color: inherit; }
#est-absences-body input[type="checkbox"] { width: auto; flex: 0 0 auto; padding: 0; margin: 0; }
#est-absences-body select { width: auto; }
.absence-intro { margin-bottom: 0.5rem; }
.absence-intro .garage-form-section-title { text-transform: none; }
.absence-toggles { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.absence-toggle {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    font-size: 0.85rem; text-transform: none; font-weight: 400;
    color: var(--text-main, #1e293b);
}
.absence-toggle span { text-transform: none; font-weight: 400; }
.absence-list { display: flex; flex-direction: column; gap: 0.5rem; }
.absence-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.65rem; border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px; background: var(--bg-card, #fff);
}
.absence-person { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.absence-person strong { font-size: 0.92rem; }
.absence-role { font-size: 0.7rem; color: #94a3b8; text-transform: none; }
.absence-arrow { font-size: 0.78rem; color: #64748b; white-space: nowrap; }
.absence-sub { max-width: 230px; min-width: 170px; }
.absence-actions { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }
@media (max-width: 600px) {
    .absence-row { flex-wrap: wrap; }
    .absence-sub { max-width: 100%; min-width: 0; flex: 1 1 100%; }
}

/* ── AIDE + DÉCONNEXION : boutons secondaires plus petits / discrets ── */
#msg-btn, #login-btn {
    font-size: 0.62rem;
    padding: 0.4rem 0.62rem;
    letter-spacing: 0.02em;
}

/* ─── Outil de recadrage de photo (carré) ─── */
.imgcrop-overlay {
    position: fixed; inset: 0; z-index: 40000;
    background: rgba(15, 23, 42, 0.75);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.imgcrop-modal {
    background: #fff; border-radius: 14px; padding: 1.1rem; width: min(360px, 92vw);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); display: flex; flex-direction: column; gap: 0.7rem;
}
.imgcrop-title { font-weight: 800; font-size: 1rem; color: #1e293b; }
.imgcrop-hint { font-size: 0.82rem; color: #64748b; margin-top: -0.4rem; }
.imgcrop-stage { display: flex; justify-content: center; }
.imgcrop-viewport {
    position: relative; width: min(280px, 78vw); height: min(280px, 78vw);
    overflow: hidden; border-radius: 16px; background: #ffffff; touch-action: none; cursor: grab;
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.5);
}
.imgcrop-viewport:active { cursor: grabbing; }
.imgcrop-img { position: absolute; user-select: none; -webkit-user-drag: none; pointer-events: none; max-width: none; }
.imgcrop-zoom { width: 100%; accent-color: #6366f1; }
.imgcrop-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }
.imgcrop-cancel {
    background: transparent; border: 1px solid #cbd5e1; color: #475569; border-radius: 8px;
    padding: 0.55rem 1rem; font-family: inherit; font-size: 0.9rem; cursor: pointer;
}
.imgcrop-ok {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); border: 0; color: #fff; border-radius: 8px;
    padding: 0.55rem 1.2rem; font-family: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
}
.imgcrop-ok:hover { opacity: 0.9; }

/* ═══ Tableau de bord statistiques (Établissement → 📊 Statistiques) ═══ */
.stats-controls { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.stats-presets { display: flex; gap: .4rem; }
.stats-preset { border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff; border-radius: 999px;
    padding: .35rem .85rem; font-family: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
    color: var(--fs-muted, #6b6d75); }
.stats-preset:hover { border-color: var(--fs-violet, #5a1aa0); color: var(--fs-violet, #5a1aa0); }
.stats-preset.is-active { border-color: var(--fs-violet, #5a1aa0); background: #f5f3ff; color: var(--fs-violet, #5a1aa0); }
.stats-custom { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .85rem;
    color: var(--fs-muted, #6b6d75); }
.stats-custom input[type="date"] { border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 8px;
    padding: .3rem .5rem; font-family: inherit; font-size: 16px;
    background: #fff; color: var(--fs-ink, #1f2130); color-scheme: light; }
.stats-summary { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.stats-card { border: 2px solid var(--fs-border, #e6e8ec); border-radius: 12px; padding: .55rem 1.1rem;
    display: flex; flex-direction: column; align-items: center; min-width: 92px; background: #fff; }
.stats-card b { font-size: 1.35rem; line-height: 1.2; }
.stats-card span { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--fs-muted, #6b6d75); }
.stats-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.stats-toggle { display: inline-flex; align-items: center; gap: .45rem; border: 1.5px solid var(--fs-border, #e6e8ec);
    background: #fff; border-radius: 999px; padding: .35rem .9rem; font-family: inherit; font-size: .84rem;
    font-weight: 700; cursor: pointer; color: var(--fs-muted, #6b6d75); opacity: .45; }
.stats-toggle.is-on { opacity: 1; color: var(--fs-ink, #1f2130); }
.stats-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.stats-chart-wrap { overflow-x: auto; border: 1px solid var(--fs-border, #e6e8ec); border-radius: 12px;
    background: #fff; padding: .6rem; margin-bottom: 1.1rem; }
.stats-chart-wrap svg { width: 100%; min-width: 620px; height: auto; display: block; }
.stats-table-wrap { overflow-x: auto; border: 1px solid var(--fs-border, #e6e8ec); border-radius: 12px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fff; }
.stats-table th { text-align: left; padding: .55rem .9rem; background: #f7f7fa; font-size: .74rem;
    letter-spacing: .05em; text-transform: uppercase; color: var(--fs-muted, #6b6d75);
    position: sticky; top: 0; }
.stats-table td { padding: .45rem .9rem; border-top: 1px solid var(--fs-border, #e6e8ec); }
.stats-row-zero td { color: #b7b9c2; }

/* ═══ Présence dans la table Personnel (bascule par le gérant) ═══ */
.staff-td-presence { white-space: nowrap; }
.staff-presence-btn { border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff; border-radius: 999px;
    padding: .3rem .7rem; font-family: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.staff-presence-btn:hover { border-color: var(--fs-violet, #5a1aa0); }
.staff-presence-badge { font-size: .8rem; font-weight: 700; }

/* ═══ Poinçon (Time Clock) — écran de pointage mobile-first ═══ */
.timeclock-modal-content { max-width: 560px; }
.tc-screen { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; padding: .5rem 0 1rem; }
.tc-clockhead { text-align: center; }
.tc-live { font-size: 2.6rem; font-weight: 800; letter-spacing: .02em; color: var(--fs-ink, #1f2130);
    font-variant-numeric: tabular-nums; line-height: 1.1; }
.tc-date { font-size: .95rem; color: var(--fs-muted, #6b6d75); text-transform: capitalize; margin-top: .15rem; }
.tc-name { font-size: 1rem; font-weight: 700; color: var(--fs-violet, #5a1aa0); margin-top: .3rem; }
.tc-status { font-size: 1rem; font-weight: 700; padding: .5rem 1rem; border-radius: 999px; }
.tc-status--in  { background: #e7f7ee; color: #15803d; }
.tc-status--out { background: #f1f2f5; color: #6b6d75; }
.tc-punch-btn { width: 100%; max-width: 420px; border: 0; border-radius: 18px; padding: 1.6rem 1rem;
    font-family: inherit; font-size: 1.4rem; font-weight: 800; letter-spacing: .03em; color: #fff;
    cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.14); transition: transform .08s, filter .15s;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.tc-punch-btn:active { transform: scale(.98); }
.tc-punch-btn--in  { background: linear-gradient(135deg, #16a34a, #12813b); }   /* Entrée = vert */
.tc-punch-btn--out { background: linear-gradient(135deg, #e11d48, #b0173a); }   /* Sortie = rouge */
.tc-punch-btn:disabled { filter: grayscale(.3) opacity(.7); cursor: default; }
.tc-today { width: 100%; max-width: 420px; }
.tc-punch-list { display: flex; flex-direction: column; border: 1px solid var(--fs-border, #e6e8ec); border-radius: 12px; overflow: hidden; }
.tc-punch-row { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem;
    border-bottom: 1px solid var(--fs-border, #e6e8ec); font-size: .95rem; }
.tc-punch-row:last-child { border-bottom: 0; }
.tc-punch-dir { font-weight: 700; }
.tc-punch-dir--in  { color: #15803d; }
.tc-punch-dir--out { color: #b0173a; }
.tc-punch-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--fs-ink, #1f2130); }

/* ═══ Poinçon — modal « temps supplémentaire » ═══ */
.tc-ot-overlay { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center;
    justify-content: center; background: rgba(15, 17, 24, .55); padding: 1rem; }
.tc-ot-card { background: #fff; border-radius: 18px; width: 100%; max-width: 420px; padding: 1.6rem 1.4rem;
    box-shadow: 0 12px 40px rgba(0,0,0,.28); text-align: center; }
.tc-ot-q { font-size: 1.15rem; line-height: 1.4; color: var(--fs-ink, #1f2130); margin-bottom: 1.2rem; }
.tc-ot-choices { display: flex; gap: .8rem; }
.tc-ot-no, .tc-ot-yes { flex: 1; border: 0; border-radius: 12px; padding: 1rem; font-family: inherit;
    font-size: 1.05rem; font-weight: 800; cursor: pointer; }
.tc-ot-no  { background: #eef0f4; color: var(--fs-ink, #1f2130); }
.tc-ot-yes { background: linear-gradient(135deg, #e0862f, #c46a12); color: #fff; }
.tc-ot-form { margin-top: 1.1rem; text-align: left; }
.tc-ot-sub { font-size: .9rem; font-weight: 700; color: var(--fs-muted, #6b6d75); margin: 0 0 .5rem; }
.tc-ot-reasons { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .7rem; }
.tc-ot-reason { border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff; border-radius: 999px;
    padding: .5rem .9rem; font-family: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.tc-ot-reason.is-active { border-color: var(--fs-violet, #5a1aa0); background: #f5f3ff; color: var(--fs-violet, #5a1aa0); }
.tc-ot-input { width: 100%; border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 10px;
    padding: .7rem .8rem; font-family: inherit; font-size: 16px; margin-bottom: .6rem; box-sizing: border-box; }
.tc-ot-confirm { width: 100%; border: 0; border-radius: 12px; padding: .95rem; font-family: inherit;
    font-size: 1rem; font-weight: 800; cursor: pointer; background: linear-gradient(135deg, #e0862f, #c46a12); color: #fff; }
.tc-ot-confirm:disabled { filter: grayscale(.4) opacity(.6); cursor: default; }
.tc-ot-cancel { margin-top: .9rem; background: none; border: 0; color: var(--fs-muted, #6b6d75);
    font-family: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; }

/* ═══ Poinçon — dashboard admin (validation de paie) ═══ */
.tca-controls { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.tca-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tca-period { font-size: .9rem; color: var(--fs-muted, #6b6d75); }
.tca-legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .8rem; color: var(--fs-muted, #6b6d75); margin-bottom: .7rem; }
.tca-legend i, .tca-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: .2rem; }
.tca-green  { background: #16a34a; } .tca-orange { background: #e0862f; } .tca-yellow { background: #eab308; }
.tca-grid-wrap { overflow-x: auto; border: 1px solid var(--fs-border, #e6e8ec); border-radius: 12px; }
.tca-grid { border-collapse: collapse; width: 100%; font-size: .86rem; background: #fff; }
.tca-grid th, .tca-grid td { border: 1px solid var(--fs-border, #eef0f3); text-align: center; padding: .35rem .2rem; }
.tca-grid th.tca-name, .tca-grid td.tca-name { text-align: left; padding-left: .7rem; white-space: nowrap; position: sticky; left: 0; background: #f7f7fa; font-weight: 700; z-index: 1; }
.tca-dh span { display: block; font-size: .65rem; color: var(--fs-muted, #9296a1); text-transform: uppercase; }
.tca-cell { min-width: 34px; font-variant-numeric: tabular-nums; }
.tca-cell[data-day] { cursor: pointer; font-weight: 700; }
.tca-cell.tca-green  { background: #eafaf0; color: #15803d; }
.tca-cell.tca-orange { background: #fdeede; color: #b4670f; }
.tca-cell.tca-yellow { background: #fef7dd; color: #92700a; }
.tca-cell.tca-empty  { background: #fff; }
.tca-tot { text-align: right; padding-right: .7rem !important; white-space: nowrap; font-size: .82rem; }
.tca-ot { color: #b4670f; font-weight: 700; }
.tca-badge-o, .tca-badge-y { font-weight: 700; padding: .05rem .4rem; border-radius: 999px; font-size: .74rem; }
.tca-badge-o { background: #fdeede; color: #b4670f; } .tca-badge-y { background: #fef7dd; color: #92700a; }
.tca-detail-card { margin-top: 1rem; border: 1px solid var(--fs-border, #e6e8ec); border-radius: 12px; background: #fff; padding: .3rem 0; }
.tca-detail-head { font-weight: 800; padding: .7rem 1rem; border-bottom: 1px solid var(--fs-border, #e6e8ec); display: flex; align-items: center; justify-content: space-between; }
.tca-drow { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px dashed var(--fs-border, #eef0f3); font-size: .9rem; }
.tca-drow:last-child { border-bottom: 0; }
.tca-ddir { font-weight: 700; min-width: 78px; }
.tca-ddir--in { color: #15803d; } .tca-ddir--out { color: #b0173a; }
.tca-dtime { color: var(--fs-muted, #6b6d75); }
.tca-dreason { flex-basis: 100%; color: #b4670f; font-style: italic; }
.tca-dactions { display: flex; gap: .4rem; margin-left: auto; }
.tca-approve, .tca-refuse { border: 0; border-radius: 8px; padding: .35rem .7rem; font-family: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; color: #fff; }
.tca-approve { background: #16a34a; } .tca-refuse { background: #e11d48; }

/* ═══ Poinçon — vue « Feuille de temps » (détail par employé) ═══ */
.tca-viewtoggle { display: inline-flex; border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 999px; overflow: hidden; }
.tca-vbtn { border: 0; background: #fff; padding: .4rem .9rem; font-family: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; color: var(--fs-muted, #6b6d75); }
.tca-vbtn.is-active { background: var(--fs-violet, #5a1aa0); color: #fff; }
.tca-sheet { border: 1px solid var(--fs-border, #e6e8ec); border-radius: 14px; overflow: hidden; margin-bottom: 1rem; background: #fff; }
.tca-sheet-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between;
    padding: .7rem 1rem; background: linear-gradient(135deg, #f5f3ff, #eef2ff); border-bottom: 1px solid var(--fs-border, #e6e8ec); }
.tca-sheet-name { font-weight: 800; font-size: 1.02rem; color: var(--fs-ink, #1f2130); }
.tca-sheet-tot { font-size: .85rem; color: var(--fs-muted, #55575f); }
.tca-sheet-wrap { overflow-x: auto; }
.tca-sheet-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tca-sheet-table th { text-align: left; padding: .5rem .9rem; background: #f7f7fa; font-size: .72rem;
    letter-spacing: .04em; text-transform: uppercase; color: var(--fs-muted, #6b6d75); white-space: nowrap; }
.tca-sheet-table td { padding: .5rem .9rem; border-top: 1px solid var(--fs-border, #eef0f3); vertical-align: middle; }
.tca-seg .tca-sdate { font-weight: 700; white-space: nowrap; text-transform: capitalize; }
.tca-real { display: block; font-size: .72rem; color: var(--fs-muted, #9296a1); }
.tca-sdur { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.tca-miss { color: #b0173a; font-weight: 700; }
.tca-snote { color: #b4670f; font-style: italic; }
.tca-daytot td { background: #fafbfc; font-weight: 700; color: var(--fs-muted, #55575f); border-top: 1px solid var(--fs-border, #e6e8ec); }
.tca-st { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.tca-st-green  { background: #eafaf0; color: #15803d; }
.tca-st-orange { background: #fdeede; color: #b4670f; }
.tca-st-yellow { background: #fef7dd; color: #92700a; }
.tca-st-grey   { background: #eef0f4; color: #6b6d75; }
.tca-sheet .tca-dactions { display: inline-flex; gap: .3rem; margin-left: .5rem; }
.tca-sheet .tca-approve, .tca-sheet .tca-refuse { padding: .15rem .5rem; font-size: .8rem; }

/* ═══ Poinçon — feuille de temps séparée par semaine ═══ */
.tca-week { border-top: 1px solid var(--fs-border, #e6e8ec); }
.tca-week:first-child { border-top: 0; }
.tca-week-head { font-weight: 800; font-size: .82rem; letter-spacing: .03em; text-transform: uppercase;
    color: var(--fs-violet, #5a1aa0); background: #faf9ff; padding: .5rem .9rem; }
.tca-weektot td { background: #f4f2fb; font-weight: 800; color: var(--fs-ink, #1f2130); border-top: 2px solid var(--fs-border, #ddd6f3); }

/* ═══ Poinçon — correction manuelle des heures (admin) ═══ */
.tca-editday { border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff; border-radius: 8px;
    padding: .25rem .6rem; font-family: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; color: var(--fs-violet, #5a1aa0); }
.tca-editday:hover { background: #f5f3ff; }
.tca-edit-card { background: #fff; border-radius: 18px; width: 100%; max-width: 460px; padding: 1.5rem 1.4rem;
    box-shadow: 0 12px 40px rgba(0,0,0,.28); max-height: 88vh; overflow-y: auto; }
.tca-edit-head { font-weight: 800; font-size: 1.1rem; text-align: center; margin-bottom: 1rem; text-transform: capitalize; }
.tca-edit-head small { font-weight: 500; color: var(--fs-muted, #6b6d75); font-size: .82rem; }
.tca-edit-list { display: flex; flex-direction: column; gap: .5rem; }
.tca-erow { display: flex; align-items: center; gap: .5rem; }
.tca-erow--del { opacity: .45; text-decoration: line-through; }
.tca-edir { border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 8px; padding: .45rem .5rem; font-family: inherit; font-size: 15px; }
.tca-etime { background: #fff; color: #1a1c1f; border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 8px; padding: .45rem .5rem; font-family: inherit; font-size: 16px; }
.tca-ereal { font-size: .74rem; color: var(--fs-muted, #9296a1); flex: 1; }
.tca-edel { border: 0; background: none; cursor: pointer; font-size: 1rem; }
.tca-eadd { margin-top: .7rem; width: 100%; border: 1.5px dashed var(--fs-border, #ccc); background: #fafafa;
    border-radius: 10px; padding: .6rem; font-family: inherit; font-weight: 700; cursor: pointer; color: var(--fs-muted, #55575f); }
.tca-enorm { margin-top: .9rem; width: 100%; border: 1.5px solid #7c3aed; background: #f4efff;
    border-radius: 10px; padding: .6rem; font-family: inherit; font-weight: 700; cursor: pointer; color: #5a1aa0; }
.tca-enorm:hover { background: #ece2ff; }
.tca-edit-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.tca-esave { border: 0; border-radius: 12px; padding: .95rem; font-family: inherit; font-size: 1rem; font-weight: 800;
    cursor: pointer; background: linear-gradient(135deg, #5a1aa0, #7c3aed); color: #fff; }
.tca-esave:disabled { filter: grayscale(.4) opacity(.6); cursor: default; }

/* ═══ Poinçon — sélecteur d'employé ═══ */
.tca-staffsel { border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 10px; padding: .4rem .7rem;
    font-family: inherit; font-size: .88rem; font-weight: 700; background: #fff; color: var(--fs-ink, #1f2130); max-width: 220px; }

/* ═══ Poinçon — éditeur d'horaires de travail ═══ */
.tca-sched-card { background: #fff; border-radius: 18px; width: 100%; max-width: 560px;
    box-shadow: 0 12px 40px rgba(0,0,0,.28); max-height: 92vh; display: flex; flex-direction: column; }
.tca-sched-card .tca-edit-head { padding: 1.1rem 1.3rem .4rem; }
.tca-sched-scope { display: flex; align-items: center; gap: .6rem; padding: 0 1.3rem .8rem; font-weight: 700; font-size: .9rem; flex-wrap: wrap; }
.tca-sched-scope .tca-staffsel { max-width: 100%; flex: 1; }
.tca-sched-grid { display: flex; flex-direction: column; gap: .4rem; padding: 0 1.3rem; overflow-y: auto; flex: 1; }
.tca-swrow { display: flex; align-items: center; gap: .4rem .7rem; padding: .4rem .55rem; flex-wrap: wrap;
    border: 1px solid var(--fs-border, #e6e8ec); border-radius: 10px; }
.tca-swrow.off { opacity: .6; background: #f6f7f9; }
.tca-swday { flex: 0 0 92px; font-weight: 700; font-size: .82rem; display: flex; align-items: center; gap: .4rem; text-transform: capitalize; }
.tca-swday input { flex: 0 0 auto; width: 16px; height: 16px; }
.tca-swsegs { display: flex; flex-wrap: wrap; gap: .35rem .9rem; flex: 1; }
.tca-swseg { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--fs-muted, #55575f); }
.tca-swlbl { min-width: 58px; }
.tca-swdash { color: #9aa0ab; }
.tca-swrow input[type=time] { background: #fff; color: #1a1c1f; border: 1.5px solid var(--fs-border, #e6e8ec);
    border-radius: 7px; padding: .22rem .3rem; font-family: inherit; font-size: 14px; }
.tca-swrow.off input[type=time] { background: #eceef1; color: #9aa0ab; }
.tca-sched-foot { flex: 0 0 auto; padding: .7rem 1.3rem 1.1rem; border-top: 1px solid var(--fs-border, #e6e8ec); background: #fff; border-radius: 0 0 18px 18px; }
.tca-sched-foot .tc-ot-sub { margin: 0 0 .6rem; }
.tca-sched-foot .tca-edit-actions { flex-direction: row; margin-top: 0; }
.tca-sched-foot .tca-esave { flex: 1; }
.tca-sched-foot .tc-ot-cancel { flex: 0 0 auto; padding: .95rem 1.2rem; }

/* ═══ Poinçon — dialogue d'export de période ═══ */
.tca-export-card { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; padding: 1.3rem 1.4rem;
    box-shadow: 0 12px 40px rgba(0,0,0,.28); max-height: 92vh; overflow-y: auto; }
.tca-exp-warn { background: #fff5e6; border: 1px solid #f2c98a; color: #8a5300; border-radius: 10px;
    padding: .6rem .8rem; font-size: .84rem; margin: .3rem 0 .9rem; }
.tca-exp-recap { border: 1px solid var(--fs-border, #e6e8ec); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.tca-exp-recap table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tca-exp-recap th, .tca-exp-recap td { padding: .5rem .7rem; text-align: right; }
.tca-exp-recap th:first-child, .tca-exp-recap td:first-child { text-align: left; }
.tca-exp-recap thead th { background: #f6f7f9; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--fs-muted, #55575f); }
.tca-exp-recap tbody tr { border-top: 1px solid var(--fs-border, #eef0f3); }
.tca-exp-recap tfoot td { border-top: 2px solid var(--fs-border, #d9dce1); font-weight: 800; background: #faf8ff; }
.tca-exp-emaillbl { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 1rem; }
.tca-exp-emaillbl input { margin-top: .35rem; background: #fff; color: #1a1c1f; }
.tca-exp-msg { min-height: 1.2rem; font-size: .86rem; font-weight: 700; margin-bottom: .6rem; }
.tca-exp-actions { display: flex; gap: .6rem; }
.tca-exp-actions .tca-eadd { margin-top: 0; flex: 1; }
.tca-exp-actions .tca-esave { flex: 1; }
.tca-exp-foot .tc-ot-cancel { width: 100%; margin-top: .6rem; }

/* ═══ Poinçon — gestion des NIP kiosque ═══ */
.tca-pinrow { display: flex; align-items: center; gap: .5rem; padding: .45rem .55rem;
    border: 1px solid var(--fs-border, #e6e8ec); border-radius: 10px; }
.tca-pinname { flex: 1; font-weight: 700; font-size: .88rem; display: flex; flex-direction: column; gap: .1rem; }
.tca-pinstate { font-size: .72rem; font-weight: 700; color: var(--fs-muted, #9aa0ab); }
.tca-pinstate.on { color: #1a8a3a; }
.tca-pininput { width: 84px; text-align: center; letter-spacing: .25em; font-size: 16px; font-family: inherit;
    background: #fff; color: #1a1c1f; border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 8px; padding: .35rem .3rem; }
.tca-pinsave { border: 0; border-radius: 8px; padding: .45rem .7rem; font-family: inherit; font-weight: 700;
    cursor: pointer; background: linear-gradient(135deg, #5a1aa0, #7c3aed); color: #fff; font-size: .84rem; }
.tca-pinclear { border: 1.5px solid var(--fs-border, #e6e8ec); background: #fff; border-radius: 8px;
    padding: .4rem .5rem; cursor: pointer; }
.tca-pinclear:disabled { opacity: .35; cursor: default; }
.tca-pinadd { display: flex; gap: .5rem; padding: 0 1.3rem .8rem; flex-wrap: wrap; align-items: center; }
.tca-pinadd input { flex: 1; min-width: 120px; background: #fff; color: #1a1c1f; }
.tca-pinadd .tca-pinsave { flex: 0 0 auto; }
.tca-perlen { display: flex; gap: .6rem; }
.tca-peropt { flex: 1; display: flex; align-items: center; gap: .5rem; justify-content: center; padding: .7rem;
    border: 1.5px solid var(--fs-border, #e6e8ec); border-radius: 12px; font-weight: 700; cursor: pointer; }
.tca-peropt:has(input:checked) { border-color: #7c3aed; background: #f4efff; color: #5a1aa0; }
.tca-peropt input { accent-color: #7c3aed; }
.tca-pintemp { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
    background: #eef; color: #5a1aa0; border-radius: 5px; padding: .05rem .3rem; vertical-align: middle; }

/* ═══ Poinçon — écran KIOSQUE plein écran ═══ */
#kiosk-overlay { position: fixed; inset: 0; z-index: 100000; background: linear-gradient(160deg, #1b1035, #2a1a5e 55%, #3a2170);
    color: #fff; display: flex; flex-direction: column; font-family: inherit; -webkit-user-select: none; user-select: none; overscroll-behavior: contain; }
.kiosk-top { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.6rem; }
.kiosk-brand { font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; }
.kiosk-clock { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; opacity: .95; }
.kiosk-exit { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px; padding: .5rem .9rem;
    font-family: inherit; font-weight: 700; cursor: pointer; }
.kiosk-content { flex: 1; display: flex; min-height: 0; }
.kiosk-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
/* Panneau latéral « En poste » — qui est actuellement poinçonné (22 juil. 2026) */
.kiosk-side { width: 280px; flex-shrink: 0; border-left: 1px solid rgba(255,255,255,.14);
    padding: 1.2rem 1.1rem; overflow-y: auto; background: rgba(0,0,0,.14); }
.kiosk-side-title { font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; margin-bottom: .8rem;
    display: flex; align-items: center; gap: .5rem; opacity: .95; }
.kiosk-side-count { background: rgba(255,255,255,.16); border-radius: 999px; padding: .05rem .55rem;
    font-variant-numeric: tabular-nums; font-size: .95rem; }
.kiosk-side-row { display: flex; align-items: center; gap: .5rem; padding: .45rem .3rem;
    border-bottom: 1px solid rgba(255,255,255,.08); font-size: 1rem; }
.kiosk-side-row:last-child { border-bottom: 0; }
.kiosk-side-dot { font-size: .7rem; }
.kiosk-side-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kiosk-side-since { font-variant-numeric: tabular-nums; opacity: .75; font-size: .9rem; }
.kiosk-side-empty { opacity: .6; font-size: .92rem; padding: .4rem .2rem; }
/* Écran étroit (téléphone / tablette portrait serrée) : panneau masqué, pavé intact */
@media (max-width: 640px) { .kiosk-side { display: none; } }
.kiosk-title { font-size: 1.5rem; font-weight: 700; opacity: .95; }
.kiosk-dots { display: flex; gap: 1rem; margin: .3rem 0; }
.kiosk-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); background: transparent; transition: background .1s; }
.kiosk-dot.on { background: #fff; }
.kiosk-dots.shake { animation: kioskShake .4s; }
@keyframes kioskShake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-10px)} 40%,80%{transform:translateX(10px)} }
.kiosk-msg { min-height: 1.5rem; font-size: 1.05rem; font-weight: 700; color: #ffd9d9; }
.kiosk-pad { display: grid; grid-template-columns: repeat(3, 92px); gap: .8rem; }
.kiosk-key { width: 92px; height: 92px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff;
    font-size: 2rem; font-weight: 700; font-family: inherit; cursor: pointer; transition: background .1s, transform .05s; }
.kiosk-key:active { background: rgba(255,255,255,.32); transform: scale(.94); }
.kiosk-key--fn { font-size: 1.6rem; background: rgba(255,255,255,.06); }
.kiosk-key--ok { background: linear-gradient(135deg, #22b04a, #16913a); font-size: 1.3rem; }
.kiosk-result, .kiosk-lock { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; animation: kioskPop .25s; }
@keyframes kioskPop { from { transform: scale(.85); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.kiosk-check { font-size: 4.5rem; }
.kiosk-rname { font-size: 2rem; font-weight: 800; }
.kiosk-rdir { font-size: 1.5rem; font-weight: 700; opacity: .95; }
.kiosk-rtime { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kiosk-otq { font-size: 1.4rem; font-weight: 700; text-align: center; line-height: 1.5; }
.kiosk-otq small { font-size: .95rem; font-weight: 600; opacity: .8; }
.kiosk-otbtns { display: flex; flex-direction: column; gap: .8rem; width: min(90vw, 380px); }
.kiosk-otyes, .kiosk-otno { border: 0; border-radius: 14px; padding: 1.1rem; font-family: inherit; font-size: 1.15rem; font-weight: 800; cursor: pointer; }
.kiosk-otyes { background: linear-gradient(135deg, #d98a1a, #b8690a); color: #fff; }
.kiosk-otno { background: rgba(255,255,255,.16); color: #fff; }
