:root { --primary: #6c5ce7; --primary-hover: #5b4cc4; --bg-body: #f8f9fa; --bg-surface: #ffffff; --bg-secondary: #dfe6e9; --text-main: #2d3436; --text-muted: #636e72; --border: #dfe6e9; --shadow: 0 4px 12px rgba(0,0,0,0.05); --radius: 16px; --header-height: 70px; --success: #00b894; --warning: #fdcb6e; --danger: #d63031; }
[data-bs-theme="dark"] { --primary: #a29bfe; --primary-hover: #8e84f5; --bg-body: #1e1e1e; --bg-surface: #2d2d2d; --bg-secondary: #3d3d3d; --text-main: #dfe6e9; --text-muted: #b2bec3; --border: #4a4a4a; --shadow: 0 4px 12px rgba(0,0,0,0.3); }
* { box-sizing: border-box; outline: none; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; min-height: 100vh; display: flex; flex-direction: column; transition: background-color 0.3s, color 0.3s; }
.top-nav { position: sticky; top: 0; height: var(--header-height); background: rgba(255, 255, 255, 0.90); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 2rem; z-index: 1000; }
[data-bs-theme="dark"] .top-nav { background: rgba(45, 45, 45, 0.90); }
.nav-left { display: flex; align-items: center; gap: 1rem; }
.nav-logo { display: flex; align-items: center; text-decoration: none; gap: 0.5rem; }
.nav-logo svg { height: 32px; width: 32px; }
.nav-title { font-size: 1.2rem; font-weight: 800; color: var(--primary); margin: 0; letter-spacing: -0.5px; }
.main-container { max-width: 1400px; margin: 0 auto; padding: 3rem 2rem; width: 100%; flex: 1; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.lqm-page-title { font-size: 2rem; font-weight: 800; margin: 0; color: var(--text-main); }
.lqm-page-subtitle { color: var(--text-muted); font-size: 1.1rem; font-weight: 500; margin-top: 0.5rem; }
#db-status { font-size: 0.85rem; padding: 6px 14px; border-radius: 20px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.status-loading { background: rgba(253, 203, 110, 0.1); color: var(--warning); border: 1px solid rgba(253, 203, 110, 0.3); }
.status-success { background: rgba(0, 184, 148, 0.1); color: var(--success); border: 1px solid rgba(0, 184, 148, 0.3); }
.table-container { background: var(--bg-surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); margin-top: 1.5rem; position: relative; overflow: hidden; }
.custom-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.custom-table th { background: var(--bg-body); color: var(--text-main); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); text-align: left; }
.custom-table td { padding: 1.2rem 1.5rem; font-size: 0.95rem; border-bottom: 1px solid var(--border); color: var(--text-main); vertical-align: middle; }
.custom-table th:first-child { border-top-left-radius: var(--radius); }
.custom-table th:last-child { border-top-right-radius: var(--radius); }
.certif-code-badge { font-family: monospace; font-weight: 700; color: var(--primary); background: rgba(108, 92, 231, 0.08); padding: 4px 8px; border-radius: 6px; }
.questions-badge { padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.8rem; font-weight: 700; background: rgba(0, 184, 148, 0.08); color: var(--success); font-family: monospace; }
.title-column { font-weight: 600; }

/* Colonne "Statistiques" (lancements / complétions / taux de réussite) de
   manage-quiz.html : 3 mini-badges compacts, détail complet au survol. */
.stats-badge-group { display: inline-flex; align-items: center; gap: 6px; }
.stats-mini-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); background: var(--bg-body); border: 1px solid var(--border); padding: 3px 7px; border-radius: 10px; }
.stats-mini-badge i { color: var(--primary); font-size: 0.7rem; }
.btn-action { background: var(--primary); color: white; border: none; padding: 0.6rem 1.4rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; transition: 0.2s; height: 42px; }
.btn-action:hover { background: var(--primary-hover); }
.btn-action.btn-sm { padding: 0.4rem 0.8rem; height: 32px; font-size: 0.8rem; border-radius: 6px; }
.icon-btn { background: rgba(108, 92, 231, 0.1); color: var(--primary); border: 1px solid rgba(108, 92, 231, 0.2); border-radius: 50%; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.25s ease-in-out; }
.icon-btn:hover { background: var(--primary); color: #ffffff; transform: scale(1.08); }

/* Classe utilitaire globale pour masquer proprement les éléments */
.hidden { display: none !important; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2000; transition: opacity 0.25s ease; }
.modal-overlay.hidden { display: none !important; }

.modal-wrapper { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px; padding: 2.2rem; width: 100%; box-shadow: var(--shadow); color: var(--text-main); }
.lqm-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.lqm-modal-title { font-size: 1.4rem; font-weight: 800; color: var(--text-main); }
.close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; transition: 0.2s; }
.close-btn:hover { color: var(--danger); }
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.6rem; letter-spacing: 0.3px; }
.form-control-input { width: 100%; background: var(--bg-body); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 1rem; font-size: 0.95rem; color: var(--text-main); font-weight: 500; transition: border-color 0.2s; }
.form-control-input:focus { border-color: var(--primary); }
.form-control-input:disabled { background: rgba(0,0,0,0.02); opacity: 0.7; cursor: not-allowed; }
[data-bs-theme="dark"] .form-control-input:disabled { background: rgba(255,255,255,0.02); }
.lqm-modal-footer { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 2.2rem; border-top: 1px solid var(--border); padding-top: 1.2rem; }
.btn-cancel { background: rgba(0,0,0,0.05); border: 1px solid var(--border); color: var(--text-muted); padding: 0.6rem 1.4rem; border-radius: 8px; font-weight: 600; cursor: pointer; height: 42px; transition: 0.2s; }
[data-bs-theme="dark"] .btn-cancel { background: rgba(255,255,255,0.05); color: var(--text-main); }
.btn-cancel:hover { background: rgba(0,0,0,0.1); color: var(--text-main); }
.btn-danger { background: var(--danger); border: 1px solid var(--danger); color: #ffffff; padding: 0.6rem 1.4rem; border-radius: 8px; font-weight: 600; cursor: pointer; height: 42px; transition: 0.2s; }
.btn-danger:hover { background: #b52a2a; border-color: #b52a2a; }
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.lqm-toast { background: var(--bg-surface); box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 1rem 1.5rem; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.nav-live-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); border-radius: 20px; font-size: 0.85rem; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.nav-live-btn i { color: var(--primary); }
.live-counter { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 50px; color: #ffffff; font-size: 0.75rem; font-weight: 700; }
.btn-toggle { background: var(--bg-secondary); color: var(--text-main); border: 1px solid var(--border); padding: 8px 16px; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 8px; }
.btn-toggle.active { background: var(--primary) !important; color: #ffffff !important; border-color: var(--primary) !important; box-shadow: 0 0 8px rgba(108, 92, 231, 0.4); }
/* "Déplier/Replier tout" : bouton fixe (toujours rendu, jamais masqué) -
   simplement grisé/non cliquable en mode Unique où il n'a pas de sens
   (une seule question affichée, rien à déplier). */
.btn-toggle:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.segmented-toggle { display: inline-flex; gap: 4px; }
.segmented-toggle .btn-toggle { padding: 4px 10px; font-size: 0.85rem; }

/* Commutateur "façon slider" (carrousel de prévisualisation : Unique/Tout
   afficher, Masquées/Affichées) : retour en arrière demandé après l'étape 3
   sur la conversion .btn-toggle-group - toute la zone est cliquable (clic
   n'importe où sur le composant, pas seulement sur l'option inactive, cf.
   listener posé sur le conteneur dans manage.js) ; l'option active masque
   son intitulé pour ne garder que l'icône (information essentielle), tandis
   que l'option inactive reste libellée pour inviter au clic. */
/* Le thumb est positionné/dimensionné en JS (positionSliderThumb), pas en
   CSS pur : les 2 options n'ont PAS la même largeur (l'option active perd
   son libellé, cf. ci-dessous), donc un split 50/50 fixe désaligne le thumb
   par rapport au bouton qu'il est censé surligner. */
.slider-toggle { position: relative; display: inline-flex; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 6px; padding: 3px; cursor: pointer; }
.slider-toggle-thumb { position: absolute; top: 3px; left: 3px; height: calc(100% - 6px); background: var(--primary); border-radius: 4px; box-shadow: 0 0 8px rgba(108, 92, 231, 0.4); transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1); z-index: 0; }
.slider-toggle-option { position: relative; z-index: 1; background: none; border: none; padding: 7px 14px; border-radius: 4px; font-size: 0.85rem; font-weight: 600; color: var(--text-main); display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s ease; }
.slider-toggle-option.active { color: #ffffff; }
.slider-toggle-option.active .slider-toggle-label { display: none; }
/* Coche verte permanente accolée à l'icône "Voir" (hors .slider-toggle-label
   donc jamais masquée par la règle ci-dessus, même quand ce bouton est actif). */
.slider-toggle-check { color: var(--success); font-size: 0.7em; margin-left: -4px; }

/* Barre d'onglets façon navigateur (cf. admin/dashboard.html) : pas de fond
   plein, juste un sous-lignage orange sur l'onglet actif. */
.lqm-tabbar { display: flex; gap: 0.5rem; border-bottom: 1px solid var(--border); }
.lqm-tab { background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 0.75rem 1.25rem; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: color 0.2s ease, border-color 0.2s ease; }
.lqm-tab:hover { color: var(--text-main); }
.lqm-tab.active { color: var(--text-main); border-bottom-color: #ff9f43; }

/* Dashboard Admin (api/public/admin/dashboard.html) : sidebar fixe + zone de
   contenu. Conçue pour rester extensible : de futurs outils (LPM, etc.)
   ajoutent simplement un nouveau .dashboard-sidebar-group, sans toucher au
   reste de la mise en page. */
.dashboard-layout { display: flex; gap: 2rem; align-items: flex-start; }
.dashboard-sidebar { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: calc(var(--header-height) + 24px); }
.dashboard-sidebar-group { display: flex; flex-direction: column; gap: 2px; }
.dashboard-sidebar-group-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 0 0.85rem; margin-bottom: 0.4rem; }
.dashboard-sidebar-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 0.65rem 0.85rem; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.dashboard-sidebar-item:hover { background: var(--bg-secondary); color: var(--text-main); }
.dashboard-sidebar-item.active { background: var(--primary); color: #ffffff; }
.dashboard-content { flex: 1; min-width: 0; }

#preview-modal { position: fixed !important; inset: 0 !important; z-index: 9999 !important; display: flex !important; align-items: center !important; justify-content: center !important; background: rgba(0, 0, 0, 0.7) !important; backdrop-filter: blur(12px) !important; }
/* Règle spécifique pour masquer la modale de preview en surpassant la spécificité de l'ID */
#preview-modal.hidden { display: none !important; }

.modal-wrapper-preview { width: calc(100vw - 40px) !important; height: calc(100vh - 40px) !important; background: var(--bg-surface) !important; border: 1px solid var(--border) !important; border-radius: 16px !important; box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; }
.preview-modal-body { flex: 1 !important; overflow-y: auto !important; padding: 2rem !important; display: flex; flex-direction: column; align-items: center; width: 100%; background: var(--bg-body); }
#view-container-single { width: 100% !important; max-width: 60% !important; margin: 0 auto !important; display: flex; justify-content: center; }
#preview-footer-controls { position: sticky !important; bottom: 0 !important; background: var(--bg-surface) !important; padding: 1.25rem 2rem !important; border-top: 1px solid var(--border) !important; display: flex !important; width: 100% !important; z-index: 10; margin-top: auto; box-sizing: border-box; }
#view-container-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)) !important; gap: 1rem !important; width: 100% !important; }
.question-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 12px; width: 100%; overflow: hidden; margin-bottom: 0.5rem; box-shadow: var(--shadow); }

/* Accordéon de question : styles supportant l'effacement complet lors de la fermeture */
.question-accordion-content { 
    max-height: 2000px; 
    opacity: 1; 
    overflow: hidden; 
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease, opacity 0.35s ease, border-top-color 0.35s ease; 
}
.accordion-closed { 
    max-height: 0px !important; 
    padding-top: 0px !important; 
    padding-bottom: 0px !important; 
    margin-top: 0px !important; 
    margin-bottom: 0px !important; 
    opacity: 0 !important; 
    border-top-color: transparent !important; /* Retire proprement la ligne de séparation */
    pointer-events: none !important; 
}

/* Style de survol et pointillé pour le numéro cliquable du carrousel */
.carousel-clickable-num {
    cursor: pointer;
    border-bottom: 1px dashed var(--primary);
    padding: 0 4px;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.2s, border-color 0.2s;
}
.carousel-clickable-num:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

@keyframes slideFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.slide-fade-in { animation: slideFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.code-block { background: #0f0f16 !important; border: 1px solid var(--border) !important; border-radius: 8px !important; padding: 1rem !important; margin: 0.85rem 0 !important; overflow-x: auto !important; font-family: 'Fira Code', 'Courier New', Courier, monospace !important; font-size: 0.88rem !important; color: #a6accd !important; line-height: 1.5 !important; text-align: left !important; max-width: 100% !important; }
.code-block code { white-space: pre !important; }
.preview-option-item { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 0.4rem; background: rgba(255,255,255,0.02); border: 1px solid var(--border); font-size: 0.9rem; }
.preview-option-item.correct-opt { border-color: var(--success); background: rgba(0, 184, 148, 0.08); }

/* Info-bulle CSS pure (sans librairie), pilotée par l'attribut [data-tooltip] */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    max-width: 260px;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 4000;
}
[data-tooltip]::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) translateY(4px);
    border: 6px solid transparent;
    border-top-color: var(--bg-surface);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 4000;
}
[data-tooltip]:hover::after, [data-tooltip]:focus::after,
[data-tooltip]:hover::before, [data-tooltip]:focus::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Icônes d'action de la table (Voir/Modifier/Supprimer) : icône seule, alignées
   à la suite, description détaillée portée par [data-tooltip] (cf. plus haut) */
.row-action-btn { width: 34px; height: 34px; border-radius: 50%; border: none; display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; cursor: pointer; color: #ffffff; transition: transform 0.2s ease, filter 0.2s ease; }
.row-action-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.row-action-btn.action-view { background: var(--text-muted); }
.row-action-btn.action-tokens { background: #0984e3; }
.row-action-btn.action-edit { background: var(--primary); }
.row-action-btn.action-delete { background: var(--danger); }

/* Icônes des paramètres d'un quiz dans la modale de visualisation (sans bouton
   de regroupement) : même principe, description détaillée et dynamique au survol */
.settings-icon { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.04); border: 1px solid var(--border); font-size: 0.95rem; cursor: help; transition: transform 0.2s ease, border-color 0.2s ease; }
.settings-icon:hover { transform: translateY(-2px); border-color: var(--primary); }
/* Variante pour les icônes quiz_opt qui affichent leur valeur essentielle
   directement dans le tag (temps limite, nb de questions requises) plutôt
   que d'attendre le survol - le cercle fixe devient une pastille élargie. */
.settings-icon.has-value { width: auto; padding: 0 10px; border-radius: 16px; }
.settings-icon-value { font-size: 0.78rem; font-weight: 700; color: var(--text-main); }

/* Recherche dynamique de la modale de visualisation : bouton d'effacement +
   bouton de filtre moderne intégré (icône + badge de filtres actifs) */
.filter-chk-label { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; cursor: pointer; }
.filter-chk-label input[type="checkbox"] { accent-color: var(--primary); }

.search-clear-btn { position: absolute; right: 38px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; padding: 4px; display: flex; }
.search-clear-btn:hover { color: var(--danger); }

.search-filter-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-main); width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.75rem; transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease; }
.search-filter-btn:hover { border-color: var(--primary); background: var(--primary); color: #ffffff; }
.filter-active-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 50%; background: var(--primary); color: #ffffff; font-size: 0.62rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* Panneau de filtres unifié (catégories + type + contenu), ouvert depuis le
   bouton filtre de la barre de recherche via un vrai tabler.Dropdown (classe
   .dropdown-menu, cf. manage-quiz.html) — le positionnement (et la détection
   de collision avec les bords de l'écran) est géré par Popper, plus de
   top/left/transform statiques ici. display:flex scoppé à .show pour ne pas
   écraser le display:none par défaut de .dropdown-menu (cascade : ce fichier
   est chargé après tabler.min.css, donc .filter-mega-dropdown.show gagne sur
   .dropdown-menu.show à spécificité égale).
   Catégories sur sa propre rangée pleine largeur (noms parfois longs),
   Type/Contenu groupés sur une rangée plus compacte en dessous. */
.filter-mega-dropdown { width: 640px; max-width: calc(100vw - 80px); background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 2900; padding: 16px; flex-direction: column; gap: 16px; }
.filter-mega-dropdown.show { display: flex; }
.filter-mega-row { display: flex; gap: 18px; }
.filter-mega-section { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.filter-mega-section-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.filter-mega-section-header button { background: none; border: none; color: var(--primary); font-size: 0.7rem; font-weight: 600; cursor: pointer; text-transform: none; white-space: nowrap; }
.filter-mega-grid-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; max-height: 220px; overflow-y: auto; }
.filter-reset-btn { align-self: center; background: none; border: none; color: var(--danger); font-size: 0.8rem; font-weight: 600; cursor: pointer; padding: 4px 8px; }
.filter-reset-btn:hover { text-decoration: underline; }

/* Sélecteur multi-valeurs façon tag (Chantier 7.6 - filtres Logs Source/
   Catégorie) : un bouton qui ressemble à un champ de formulaire standard,
   ouvrant une grille de cases à cocher ancrée juste dessous. Remplace le
   <select> natif conformément à la modernisation actée au Chantier 7.5. */
.tag-select-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 170px; cursor: pointer; text-align: left; }
.tag-select-btn .tag-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-select-dropdown { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; max-width: 320px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 2900; padding: 12px; }
.tag-select-dropdown .filter-mega-grid-2col { grid-template-columns: 1fr; max-height: 240px; }

/* Message affiché à la place de la carte quand aucune question ne correspond
   aux filtres/recherche actifs */
#preview-empty-state { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 4rem 2rem; text-align: center; color: var(--text-muted); }
#preview-empty-state i { font-size: 2.5rem; opacity: 0.6; }
#preview-empty-state p { margin: 0; font-size: 1rem; font-weight: 500; max-width: 360px; }


/* Piste du footer carrousel : alignée exactement sur la largeur de la carte
   centrale (cf. #view-container-single max-width: 60%), boutons Précédent/Suivant
   débordant de 20px de chaque côté de cette même largeur */
.carousel-footer-track { position: relative; width: 60%; max-width: 60%; margin: 0 auto; display: flex; justify-content: center; }
.carousel-progress-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.carousel-progress-track { width: 100%; height: 6px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; position: relative; }
#carousel-progress-bar { height: 100%; width: 0%; background: var(--primary); transition: width 0.3s ease; }
.carousel-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); height: 42px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.carousel-nav-prev { right: calc(100% + 20px); }
.carousel-nav-next { left: calc(100% + 20px); }

/* Overlay plein écran invitant à agrandir la fenêtre en deçà d'une largeur minimale */
#responsive-warning-overlay { display: none; position: fixed; inset: 0; z-index: 99999; background: var(--bg-body); align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.responsive-warning-box { max-width: 360px; }
.responsive-warning-box i { font-size: 2.5rem; color: var(--primary); margin-bottom: 1rem; }
.responsive-warning-box h2 { font-size: 1.3rem; margin: 0 0 0.75rem 0; color: var(--text-main); }
.responsive-warning-box p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; margin: 0; }
@media (max-width: 1100px) {
    #responsive-warning-overlay { display: flex; }
}

/* Édition inline façon Airtable (Dashboard > Tokens, Chantier 7) */
.token-editable-cell { cursor: pointer; border-radius: 4px; transition: background 0.15s ease; }
.token-editable-cell:hover { background: rgba(108, 92, 231, 0.08); }

/* Flou global derrière toute modale Bootstrap ouverte (ex. tokens-modal
   floute déjà la page de fond derrière elle), pas seulement derrière la
   confirmation de révocation. */
.modal-backdrop { backdrop-filter: blur(10px); background-color: rgba(0, 0, 0, 0.5); }
/* Floute (beaucoup plus fort) la modale Tokens en arrière-plan lorsque la
   confirmation de révocation s'affiche par-dessus (étape 3, ajustement
   demandé après coup, renforcé deux fois suite aux retours visuels - 6px
   puis 20px passaient encore inaperçus). Bootstrap empile un
   .modal-backdrop par modale ouverte ; on cible le dernier (celui juste
   sous la modale de confirmation, donc visuellement au-dessus de la modale
   Tokens) plutôt que la modale Tokens elle-même. */
body.token-delete-confirm-open .modal-backdrop:last-of-type { backdrop-filter: blur(40px); background-color: rgba(0, 0, 0, 0.6); }
/* Bordure noire demandée sur la modale de confirmation de révocation
   elle-même (pas seulement son backdrop), pour bien la détacher visuellement
   de la modale Tokens floutée derrière. */
#token-delete-confirm-modal .modal-content { border: 2px solid #000000; }

/* #preview-modal (carrousel bespoke) force un z-index 9999 !important - sans
   réhaussement, les vraies modales Bootstrap (tokens-modal et ce qui s'empile
   par-dessus) ouvertes depuis l'intérieur de la preview (bouton "Liens
   d'accès") s'affichaient en réalité sous elle, donc invisibles à l'écran. */
.modal { z-index: 10000; }
.modal-backdrop { z-index: 9999; }
/* Même raison : les tooltips Tabler (icônes quiz_opt) sont injectés dans
   <body> (container:'body') mais gardaient le z-index par défaut de
   Bootstrap, donc s'affichaient sous #preview-modal - invisibles à l'écran. */
.tooltip { z-index: 10000; }
/* Titre des tooltips riches (icônes quiz_opt) : classe plutôt que style
   inline - le sanitizer HTML par défaut de Bootstrap (html:true) retire les
   attributs style non whitelistés, mais laisse class= passer. */
.tooltip-rich-title { font-weight: 700; color: #ff9f43; text-decoration: underline; margin-bottom: 4px; }