/* Police Coolvetica pour les titres d'applications */
@font-face {
    font-family: 'Coolvetica';
    font-style: normal;
    font-weight: 400;
    src: local('Coolvetica'), url('/public/assets/vendor/coolvetica.woff') format('woff');
}

/* Hauteur de l'en-tête global : tout ce qui se colle dessous ou remplit l'écran la reprend. */
:root {
    --app-header-h: 3.25rem;
}

/* Empêche Chrome de déclencher « page précédente » sur l'overscroll horizontal */
html,
body {
    overscroll-behavior-x: none;
}

.overflow-x-auto,
.co-carnet-table-wrap,
.ld-mobile-tab-scroll {
    overscroll-behavior-x: contain;
}

/* Titre d'application : Coolvetica, blanc sur fond noir ; le rectangle noir est penché (italique), le texte reste droit */
.app-title {
    font-family: 'Coolvetica', 'Coolvetica Rg', 'Helvetica Neue', Arial, sans-serif !important;
    color: #fff !important;
    padding: 0.375rem 0.75rem;
    display: inline-block;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 0;
}
.app-title::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: #000;
    transform: skewX(-12deg);
    z-index: -1;
}

.app-header-nav,
.app-header-inner {
    height: var(--app-header-h);
}
.app-header-tool-title {
    font-size: 1.0625rem;
    line-height: 1.5rem;
    padding: 0.25rem 0.7rem;
}

@media (max-width: 767px) {
    .app-header-tool-title {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Panneaux de l'en-tête (société, cloche, nouveautés, avatar) : même ancrage
   (bord droit du bloc d'icônes, sous lui), même style. Leurs conteneurs ne sont
   pas positionnés : le panneau se cale sur le bloc d'icônes de l'en-tête. */
.hp-panel {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: 50;
    width: 232px;
    max-width: calc(100vw - 1.5rem);
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(17, 17, 17, 0.12), 0 2px 6px rgba(17, 17, 17, 0.05);
    transform-origin: top right;
    animation: hp-pop 0.12s ease-out;
}
.hp-panel--menu { width: 248px; padding: 0.375rem; overflow: visible; }
.hp-panel--company { width: 288px; padding: 0.375rem 0; }
.hp-panel--wide { width: 380px; }
@keyframes hp-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hp-panel { animation: none; }
}
.hp-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #374151;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.hp-item:hover,
.hp-item:focus-visible { background: #f5f5f3; color: #111; outline: none; }
.hp-item:focus-visible { box-shadow: inset 0 0 0 2px #2563eb; }
.hp-item.is-active { background: #f2f2f0; color: #111; font-weight: 600; }
.hp-ico {
    flex: none;
    width: 1.1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #9a9a94;
}
.hp-item:hover .hp-ico { color: #4b5563; }
.hp-item .hp-trail { margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem; color: #9a9a94; font-size: 0.7rem; }
.hp-item .hp-chev { transition: transform 0.15s ease; }
.hp-item.is-open .hp-chev { transform: rotate(90deg); }
.hp-item--danger,
.hp-item--danger .hp-ico { color: #dc2626; }
.hp-item--danger:hover { background: #fef2f2; color: #b91c1c; }
.hp-item--danger:hover .hp-ico { color: #b91c1c; }
.hp-sub { padding: 0.15rem 0 0.25rem 1.8rem; }
.hp-sub .hp-item { padding: 0.4rem 0.7rem; font-size: 0.84rem; }
.hp-sub .hp-check { margin-left: auto; color: #2563eb; font-size: 0.75rem; }
.hp-sep { height: 1px; margin: 0.375rem 0.25rem; background: #f0f0ed; }
.hp-label {
    padding: 0.4rem 0.7rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a9a94;
}

/* Logo 22D : ratio plus vertical que Velvetica — hauteur légèrement supérieure pour un poids visuel comparable */
.app-header-logo {
    display: block;
    object-fit: contain;
}
.app-header-logo--22d {
    max-height: 2rem;
}
@media (min-width: 768px) {
    .app-header-logo--22d {
        max-height: 2.25rem;
    }
}

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

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Styles pour les champs de date personnalisés */
.date-input-wrapper {
    position: relative;
}

.date-input-custom {
    position: relative;
}

/* Masquer le placeholder natif du navigateur pour les champs date */
.date-input-custom::-webkit-datetime-edit-text,
.date-input-custom::-webkit-datetime-edit-month-field,
.date-input-custom::-webkit-datetime-edit-day-field,
.date-input-custom::-webkit-datetime-edit-year-field {
    color: transparent;
}

.date-input-custom::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Quand le champ est vide et en focus, masquer complètement le texte natif */
.date-input-custom:not([value]):focus::-webkit-datetime-edit-text,
.date-input-custom:not([value]):focus::-webkit-datetime-edit-month-field,
.date-input-custom:not([value]):focus::-webkit-datetime-edit-day-field,
.date-input-custom:not([value]):focus::-webkit-datetime-edit-year-field {
    color: transparent;
    background: transparent;
}

/* Pour Firefox */
.date-input-custom::-moz-placeholder {
    color: transparent;
}

/* Pour les autres navigateurs */
.date-input-custom::placeholder {
    color: transparent;
}

/* Transitions modernes pour Vue.js */
.slide-fade-enter-active {
    transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
    transition: all 0.2s ease-in;
}

.slide-fade-enter-from {
    transform: translateY(-10px);
    opacity: 0;
}

.slide-fade-leave-to {
    transform: translateY(-5px);
    opacity: 0;
}

.slide-down-enter-active {
    transition: all 0.3s ease-out;
}

.slide-down-leave-active {
    transition: all 0.2s ease-in;
}

.slide-down-enter-from {
    transform: translateY(-20px);
    opacity: 0;
}

.slide-down-leave-to {
    transform: translateY(-10px);
    opacity: 0;
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

/* Transition douce pour le bloc Diffusions TV (recherche → en base) */
.tv-diffusions-fade-enter-active,
.tv-diffusions-fade-leave-active {
    transition: opacity 0.2s ease;
}

.tv-diffusions-fade-enter-from,
.tv-diffusions-fade-leave-to {
    opacity: 0;
}

/* Ads Tracker — ligne de filtres de « Mes publicités ».
   Le déclencheur de MultiCombobox se tasse de 1,5 px dès qu'il porte une
   puce : ses chips (text-[10px]) sont plus basses que le texte de substitution
   (text-xs). On l'aligne sur les champs texte plutôt que de retoucher un
   composant partagé avec Task Manager, Pitch Report et Syncs. */
/* Statut global de la sélection (Mes diffusions) : un combobox à la taille et à la facture des boutons voisins. */
.at-bulk-status { width: 13.5rem; }
.at-bulk-status .admin-combo-trigger {
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 0.5rem;
    border-color: #d1d5db;
    background: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.at-bulk-status .admin-combo-trigger:hover:not(:disabled) { border-color: #9ca3af; background: #f9fafb; }
.at-bulk-status .admin-combo-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.at-bulk-status .admin-combo-value.is-placeholder { color: #374151; }

.at-filters-row th > div > button {
    min-height: 30px;
}

/* Mes publicités : compactes mais lisibles, sans débordement entre colonnes. */
table.at-my-ads-table > thead > tr > th,
table.at-my-ads-table > tbody > tr > td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    vertical-align: middle;
    overflow: hidden;
}
table.at-my-ads-table > thead > tr.at-filters-row > th {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    padding-left: 0.375rem;
    padding-right: 0.375rem;
    overflow: visible; /* menus déroulants des filtres */
}
table.at-my-ads-table > tbody > tr > td > * {
    max-width: 100%;
}
/* Badge NEW : ne pas le rogner sur le bord droit de la colonne Code film. */
table.at-my-ads-table > tbody > tr > td.at-repartition-label-cell {
    overflow: visible;
}
table.at-my-ads-table > tbody > tr > td.at-repartition-label-cell > * {
    max-width: none;
}
/* Trait gauche + grip au survol — même logique que l'en-tête partagé TableHeader (+ LD_SharedStyles).
   overflow:visible : le trait est hors boîte (right:100%), sinon il est rogné. */
table.at-my-ads-table > thead > tr.column-drag-row > th {
    position: relative;
    overflow: visible;
}
table.at-my-ads-table th.group:hover > .at-col-left-rule {
    opacity: 1;
}
table.at-my-ads-table th.group:hover + th.group > .at-col-left-rule {
    opacity: 1;
}
table.at-my-ads-table th.group:hover .at-col-grip {
    max-width: 20px !important;
    margin-right: 0.5rem !important;
}
/* Poignée de redimensionnement : zone large à cheval sur la bordure droite. */
table.at-my-ads-table .at-col-resize {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -6px;
    width: 12px;
    z-index: 20;
    cursor: col-resize;
}
table.at-my-ads-table .at-col-resize::after {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 5px;
    width: 2px;
    border-radius: 1px;
    background: transparent;
    transition: background 0.15s ease;
}
table.at-my-ads-table th:hover > .at-col-resize::after,
table.at-my-ads-table .at-col-resize:hover::after {
    background: #9ca3af;
}

/* Indicateur de drop pour le drag & drop des colonnes (Live Dates) */
.column-drop-indicator {
    position: absolute;
    left: -2px;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
    z-index: 20;
    animation: column-drop-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes column-drop-pulse {
    from {
        opacity: 0.8;
        transform: scaleY(0.95);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

/* Transition fluide pour les colonnes en cours de drag */
.column-drag-row th {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
/* Poignée de déplacement de l'en-tête partagé (TableHeader) : posée dans la marge
   gauche, elle apparaît en fondu au survol sans décaler le libellé. Toute la cellule
   se saisit ; la poignée ne fait que le montrer. */
.column-drag-row th .table-header-grip {
    position: absolute;
    top: 50%;
    left: 4px;
    display: flex;
    align-items: center;
    font-size: 9px;
    line-height: 1;
    color: #9ca3af;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.15s ease;
    pointer-events: none;
}
.column-drag-row th:hover .table-header-grip {
    opacity: 1;
}
/* Le libellé s'écarte de la poignée au survol (transform : aucun reflux de la mise en page),
   pour que poignée, titre et filet de colonne ne se touchent pas. */
.column-drag-row th .table-header-label {
    transition: transform 0.2s ease;
}
.column-drag-row th:hover .table-header-label {
    transform: translateX(5px);
    /* Le transform enferme la description (« ? ») dans ce libellé : sans
       z-index, les en-têtes suivants (poignées en z-index 10/11) la couvrent. */
    z-index: 20;
}
/* Bordure à saisir pour élargir : 4 px dessinés, 10 px sous la main. */
.column-drag-row th .table-header-resize::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -3px;
    right: -3px;
}

/* CMO Doc batch : scroll X/Y + hauteur plafonnée ; en-tête collant (thead sticky dans le composant) */
.doc-batch-table-scroll {
    overflow: auto;
    max-height: min(75vh, 42rem);
    -webkit-overflow-scrolling: touch;
}

/*
 * Panneau défilant des tableaux bâtis sur l'en-tête partagé components/shared/TableHeader.js
 * (Live Dates, Syncs) : mêmes contraintes que .doc-batch-table-scroll ci-dessus, pour la même raison.
 * Un tableau large a besoin d'un défilement horizontal propre à son conteneur (colonnes
 * redimensionnables) — mais poser "overflow-x: auto" seul sur ce conteneur, en laissant
 * "overflow-y: visible", ne suffit PAS à garder l'en-tête collé au document : la spec CSS force
 * alors le "visible" de l'axe Y à devenir "auto" lui aussi (dès qu'un axe n'est pas visible, l'autre
 * ne peut plus l'être). Le conteneur devient donc de toute façon un conteneur de défilement 2D, et
 * c'est LUI — pas le document — qui sert de référence au thead sticky. Autant l'assumer explicitement
 * avec une hauteur plafonnée et son propre ascenseur vertical, plutôt que de laisser Y "auto" sans
 * limite de hauteur (le sticky ne colle alors plus à rien de visible).
 */
.table-scroll-panel {
    overflow: auto;
    max-height: min(75vh, 42rem);
    -webkit-overflow-scrolling: touch;
}

/* CMO Doc — modale « sous les seuils » : fond opaque (Tailwind/global ne doit pas la rendre transparente) */
.doc-batch-below-modal {
    background-color: rgba(0, 0, 0, 0.5) !important;
}
.doc-batch-below-modal__card {
    background-color: #ffffff !important;
    opacity: 1 !important;
    isolation: isolate;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.doc-batch-below-modal__header {
    background-color: #ffffff !important;
    opacity: 1 !important;
}
.doc-batch-below-modal__body,
.doc-batch-below-modal__footer {
    background-color: #ffffff !important;
    opacity: 1 !important;
}
.doc-batch-below-modal__amber {
    background-color: #fffbeb !important; /* amber-50 */
    border: 1px solid #fcd34d !important;
}
.doc-batch-below-modal__btn-secondary {
    background-color: #ffffff !important;
}

/* Google Places — PlaceAutocompleteElement (Live Dates, ConcertEditModal, etc.) */
.google-places-autocomplete-host {
    display: block;
    width: 100%;
    min-width: 0;
    position: relative;
    z-index: 200;
}
.google-places-autocomplete-host.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}
.google-places-autocomplete-host--inline {
    z-index: 210;
}
.google-places-widget,
.google-places-autocomplete-host gmp-place-autocomplete {
    display: block;
    width: 100%;
    min-width: 0;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 0 !important;
}
.google-places-widget--inline {
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.google-places-widget--form {
    font-size: 0.875rem;
    line-height: 1.5rem;
}
gmp-place-autocomplete::part(prediction-list) {
    z-index: 9999;
    min-width: 280px;
    max-width: min(800px, 95vw);
}

/* Live Dates — édition inline Salle (Google Places au-dessus des lignes suivantes) */
.ld-concert-row-venue-active {
    position: relative;
    z-index: 40;
}
.ld-concert-row-venue-active td {
    overflow: visible !important;
    background-color: #ffffff !important;
}
.ld-concert-row-venue-active:hover td {
    background-color: #ffffff !important;
}
.ld-concerts-table-venue-open tbody tr:not(.ld-concert-row-venue-active) {
    z-index: 0;
}

/* Live Dates — édition inline texte : rectangle remplissant la cellule */
.ld-concerts-table,
.ld-setlists-table,
.ld-works-table,
.ld-setlist-works-table {
    border-collapse: separate;
    border-spacing: 0;
}
.ld-concerts-table td.ld-concert-cell-editing,
.ld-setlists-table td.ld-inline-cell-editing,
.ld-works-table td.ld-inline-cell-editing,
.ld-setlist-works-table td.ld-inline-cell-editing {
    padding: 0 !important;
    overflow: hidden !important;
    vertical-align: middle;
    min-height: 3rem;
    background: #ffffff !important;
    border: none !important;
    outline: none !important;
    box-shadow: inset 0 0 0 2px #3b82f6;
    position: relative;
    z-index: 1;
}
.ld-concerts-table td.ld-concert-cell-editing.ld-inline-cell-editing--menu-open,
.ld-setlists-table td.ld-inline-cell-editing.ld-inline-cell-editing--menu-open,
.ld-works-table td.ld-inline-cell-editing.ld-inline-cell-editing--menu-open,
.ld-setlist-works-table td.ld-inline-cell-editing.ld-inline-cell-editing--menu-open {
    box-shadow:
        inset 2px 0 0 #3b82f6,
        inset -2px 0 0 #3b82f6,
        inset 0 2px 0 #3b82f6;
}
.ld-concerts-table td.ld-concert-cell-editing .editing-cell-input--cell,
.ld-setlists-table td.ld-inline-cell-editing .editing-cell-input--cell,
.ld-works-table td.ld-inline-cell-editing .editing-cell-input--cell,
.ld-setlist-works-table td.ld-inline-cell-editing .editing-cell-input--cell {
    display: block;
    width: 100%;
    min-height: 3rem;
    height: 100%;
    padding: 0.5rem 0.625rem;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.ld-concerts-table td.ld-concert-cell-editing .editing-cell-input--cell:focus,
.ld-setlists-table td.ld-inline-cell-editing .editing-cell-input--cell:focus,
.ld-works-table td.ld-inline-cell-editing .editing-cell-input--cell:focus,
.ld-setlist-works-table td.ld-inline-cell-editing .editing-cell-input--cell:focus {
    outline: none !important;
    box-shadow: none !important;
}
.ld-concerts-table td.ld-concert-cell-editing select.editing-cell-input--cell,
.ld-setlists-table td.ld-inline-cell-editing select.editing-cell-input--cell,
.ld-works-table td.ld-inline-cell-editing select.editing-cell-input--cell,
.ld-setlist-works-table td.ld-inline-cell-editing select.editing-cell-input--cell {
    appearance: auto;
    cursor: pointer;
}
.ld-concerts-table td.ld-concert-cell-editing .ld-date-input-segmented--cell {
    display: flex !important;
    align-items: center;
    width: 100% !important;
    min-height: 3rem !important;
    height: 100% !important;
    margin: 0;
    padding: 0.5rem 0.625rem !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem;
    color: #111827;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box;
}
.ld-concerts-table td.ld-concert-cell-editing .ld-date-input-segmented--cell:focus-within {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}
.ld-setlist-works-table td.ld-inline-cell-editing .ld-setlist-work-role-editor {
    min-height: 3rem;
    padding: 0.375rem 0.625rem;
    box-sizing: border-box;
}
.ld-setlist-works-table td.ld-inline-cell-editing .setlist-work-tag-input {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    height: auto;
    min-height: 1.75rem;
    padding: 0.25rem 0;
}

/* Live Dates — menus d'autocomplétion inline collés à la cellule éditée */
.ld-inline-autocomplete-dropdown--attached {
    margin: 0 !important;
    padding: 0;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border-top: 1px solid #e5e7eb !important;
    border-right: 2px solid #3b82f6 !important;
    border-bottom: 2px solid #3b82f6 !important;
    border-left: 2px solid #3b82f6 !important;
    box-shadow: none !important;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
.ld-inline-autocomplete-dropdown--attached::after {
    display: none !important;
}
.ld-inline-autocomplete-item {
    position: relative;
    z-index: 1;
    padding: 0.5rem 0.625rem;
    margin: 0;
    cursor: pointer;
}
.ld-inline-autocomplete-item:hover {
    background: #eff6ff;
}
.ld-inline-autocomplete-item--create {
    color: #16a34a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ld-inline-autocomplete-item--create:hover {
    background: #f0fdf4;
}
.ld-concerts-table tbody tr.ld-concert-row-autocomplete-active td.ld-concert-cell-editing,
.admin-tool-root table.admin-tool-table tbody tr.ld-concert-row-autocomplete-active:hover td.ld-concert-cell-editing {
    background: #ffffff !important;
}

/* Live Dates — titre d'œuvre dans setlist : sélection texte + lien */
.ld-setlist-work-name,
.ld-setlist-work-name.select-text {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

.setlist-work-drag-handle {
    touch-action: none;
}

body.dragging-setlist-work,
body.dragging-setlist-work * {
    cursor: grabbing !important;
}

.ld-setlist-works-table tbody tr.ld-setlist-work-row {
    transition: opacity 0.12s ease;
}

.ld-setlist-works-table tbody tr.ld-setlist-work-dragging {
    opacity: 0.4;
    background-color: #eff6ff !important;
}

.ld-setlist-works-table tbody tr.ld-setlist-work-drop-above td {
    box-shadow: 0 -2px 0 0 #3b82f6;
}

.ld-setlist-works-table tbody tr.ld-setlist-work-drop-below td {
    box-shadow: 0 2px 0 0 #3b82f6;
}

/* Live Dates — tableau œuvres dans une setlist dépliée (lignes compactes) */
.ld-setlist-works-table td,
.ld-setlist-works-table th {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    vertical-align: middle;
}

.ld-setlist-works-table thead th {
    padding-top: 0.375rem !important;
    padding-bottom: 0.375rem !important;
}

/* En-tête des œuvres collant sous l'en-tête du tableau des setlists (h-12 = 3rem, z-30).
   Le conteneur du tableau ne doit pas avoir d'overflow propre : il deviendrait la référence du sticky. */
.ld-setlist-works-table thead th {
    position: sticky;
    top: 3rem;
    z-index: 20;
    background-color: #f9fafb;
    box-shadow: 0 1px 0 #e5e7eb;
}

.ld-setlist-works-table tbody td {
    font-size: 0.8125rem;
    line-height: 1.25;
}

.ld-setlist-work-roles {
    line-height: 1.15;
    font-size: 0.6875rem;
}

.ld-setlist-works-add-shortcut {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: transparent;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.ld-setlist-works-add-shortcut:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
}

.ld-setlist-works-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
    padding: 1rem 0;
}

.ld-setlist-works-fade-enter-active {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ld-setlist-works-fade-enter-from {
    opacity: 0;
    transform: translateY(6px);
}

.ld-setlist-works-fade-enter-to {
    opacity: 1;
    transform: translateY(0);
}

.ld-setlist-work-role-line + .ld-setlist-work-role-line {
    margin-top: 1px;
}

.ld-setlist-work-role-line {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    min-height: 0;
}

.ld-setlist-work-role-label {
    flex-shrink: 0;
    min-width: 1.5rem;
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.625rem;
    text-transform: uppercase;
}

.ld-setlist-work-role-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Live Dates — masquer l'autocomplétion inline concerts quand le modal œuvre est ouvert */
body:has(.ld-ld-modal-root) .ld-inline-autocomplete-dropdown--attached {
    display: none !important;
}

/* Live Dates — champs rôles du modal édition œuvre */
.ld-edit-work-role-field {
    width: 100%;
    padding: 0.375rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #ffffff;
    box-sizing: border-box;
}
.ld-edit-work-role-field:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}
.ld-edit-work-role-input {
    display: block;
    width: 100%;
    min-height: 1.5rem;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}
.ld-edit-work-role-dropdown-empty {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #6b7280;
}

/* Live Dates — suggestions ayants droit du modal édition œuvre (au-dessus du modal) */
.ld-edit-work-role-dropdown {
    z-index: 100060 !important;
    position: fixed !important;
    box-sizing: border-box;
    max-height: 10rem;
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
.ld-edit-work-role-dropdown-item {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    cursor: pointer;
}
.ld-edit-work-role-dropdown-item:hover {
    background: #f9fafb;
}

/* Contacts — dédoublonnage */
.co-dedupe-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.co-dedupe-table thead .co-dedupe-sticky-action {
    background-color: #f8fafc !important;
    box-shadow: 1px 0 0 #e2e8f0;
}
.co-dedupe-table .co-dedupe-sticky-action {
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
    box-shadow: 1px 0 0 #e2e8f0;
}
.co-dedupe-table tbody tr.co-dedupe-row td {
    background-color: #ffffff;
    transition: background-color 0.12s ease;
}
.co-dedupe-table tbody tr.co-dedupe-row:hover td {
    background-color: #f8fafc;
}
.co-dedupe-table tbody tr.co-dedupe-row-master td {
    background-color: #f5f5f3 !important;
}
.co-dedupe-table tbody tr.co-dedupe-row-master:hover td {
    background-color: #ebebe8 !important;
}
.co-dedupe-table tbody tr.co-dedupe-row-master .co-dedupe-sticky-action {
    box-shadow: 1px 0 0 #e8e8e5;
}
.co-dedupe-group-leaving {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    border-width: 0 !important;
    overflow: hidden;
    pointer-events: none;
}

/* Contacts — carnet (liste) */
/*
   Le conteneur devient sa propre zone de défilement, verticalement comme
   horizontalement : c'est la seule façon de figer l'en-tête. `position: sticky`
   s'ancre au plus proche ancêtre défilant, et la spec CSS impose déjà
   overflow-y: auto dès lors que overflow-x ne vaut pas `visible` — la hauteur
   n'était simplement jamais contrainte, donc rien ne défilait à l'intérieur et
   l'en-tête ne collait à rien.

   Contrepartie : tout menu ouvert depuis une cellule serait rogné. Les trois
   concernés (suggestions de tags, santé e-mail, Genre/Proximité) sont pour cette
   raison téléportés dans le body et positionnés en `fixed`.
*/
.co-carnet-table-wrap {
    overflow: auto;
    /* Valeur de départ avant le premier calcul : updateCarnetHeight() l'ajuste
       ensuite à ce qui reste réellement sous le tableau. */
    max-height: calc(100vh - 24rem);
    min-height: 15rem;
    overscroll-behavior: contain;
}
/* `position: sticky` avec un z-index sur le `thead` crée un contexte d'empilement :
   les z-index des `th` n'y valent qu'entre eux, et c'est celui du `thead` qui se
   compare aux colonnes collantes du corps (70 pour l'identité, 80 pour les actions).
   Sans ce relèvement, une ligne du tableau se dessinait par-dessus l'en-tête. */
.co-carnet-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}
.co-carnet-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}
/* À l'intérieur de l'en-tête, les colonnes collantes passent devant les autres. */
.co-carnet-table thead th.co-carnet-col-select { z-index: 4; }
.co-carnet-table thead th.co-carnet-col-first { z-index: 3; }
.co-carnet-table thead th.co-carnet-col-actions { z-index: 5; }
.co-carnet-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}
.co-carnet-table td[data-column-key="categories"],
.co-carnet-table td[data-column-key="dispatch"] {
    overflow: visible !important;
    vertical-align: top;
}

/* Chips catégories / dispatch : une seule ligne, fade + bouton + à droite */
.co-carnet-tags-line {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    width: 100%;
    min-height: 1.75rem;
}
.co-carnet-tags-items {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    flex-wrap: nowrap;
    white-space: nowrap;
    /* fade sur la fin */
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 78%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 78%, transparent 100%);
}
.co-carnet-tags-add {
    flex: 0 0 auto;
    z-index: 2;
}
.co-carnet-tag-input {
    height: 1.75rem;
    box-sizing: border-box;
}
.co-carnet-tag-chip {
    flex: 0 0 auto;
    max-width: 14rem;
}

/* Quand le picker est ouvert, l'input prend la largeur de la cellule. */
.co-carnet-tags-line--open {
    gap: 0.25rem;
}
.co-carnet-tags-line--open .co-carnet-tags-items {
    display: none;
}
.co-carnet-tags-line--open .co-carnet-tags-add {
    flex: 1 1 auto;
    min-width: 0;
}
.co-carnet-table tbody tr.co-carnet-row-tag-active {
    position: relative;
    z-index: 30;
}
.co-carnet-table tbody tr.co-carnet-row-tag-active td {
    overflow: visible !important;
    background-color: #ffffff !important;
}
.co-carnet-table tbody tr.co-carnet-row-tag-active:hover td {
    background-color: #ffffff !important;
}
.co-carnet-table tbody tr.co-carnet-row-quickselect-active {
    position: relative;
    z-index: 35;
}
.co-carnet-table tbody tr.co-carnet-row-quickselect-active td {
    overflow: visible !important;
    background-color: #ffffff !important;
}
.co-carnet-table tbody tr.co-carnet-row-quickselect-active:hover td {
    background-color: #ffffff !important;
}
.co-carnet-table-wrap.co-carnet-quickselect-open tbody tr.co-carnet-row:not(.co-carnet-row-quickselect-active):not(.co-carnet-row-tag-active) {
    z-index: 0;
}
.co-carnet-tag-picker {
    position: relative;
    z-index: 40;
}
.co-carnet-tag-suggest-portal {
    z-index: 9999;
}
.co-carnet-table-wrap.co-carnet-tag-menu-open tbody tr.co-carnet-row:not(.co-carnet-row-tag-active) {
    z-index: 0;
}
.co-carnet-table-wrap.co-carnet-tag-menu-open .co-carnet-tag-add-btn {
    position: relative;
    z-index: 0;
}
/*
   Identité épinglée à gauche, symétrique de la colonne Actions épinglée à droite.
   Le tableau fait ~2870 px pour une zone de ~1400 px : sans cela, défiler pour
   atteindre Catégories ou Notes fait sortir le nom de l'écran alors que la
   poubelle, elle, reste sous le curseur. Tant qu'on peut supprimer une ligne,
   on doit pouvoir lire de qui il s'agit.
*/
/* La colonne des cases à cocher occupe le bord gauche ; l'identité se cale juste
   après, les deux restant visibles quel que soit le défilement horizontal. */
.co-carnet-table th.co-carnet-col-select,
.co-carnet-table td.co-carnet-col-select {
    position: sticky;
    left: 0;
    z-index: 72;
    width: 2.5rem !important;
    min-width: 2.5rem !important;
    max-width: 2.5rem !important;
    text-align: center;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
}
.co-carnet-table thead th.co-carnet-col-select {
    z-index: 77;
    background-color: #f9fafb !important;
}
.co-carnet-table tbody tr.co-carnet-row:hover td.co-carnet-col-select {
    background-color: #f8fafc !important;
}
.co-carnet-table tbody tr.co-carnet-row-selected td {
    background-color: #eef2ff !important;
}
.co-carnet-table th.co-carnet-col-first,
.co-carnet-table td.co-carnet-col-first {
    position: sticky;
    left: 2.5rem;
    z-index: 70;
    padding-left: 1rem !important;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
}
.co-carnet-table thead th.co-carnet-col-first {
    z-index: 75;
    background-color: #f9fafb !important;
}
.co-carnet-table tbody tr.co-carnet-row:hover td.co-carnet-col-first {
    background-color: #f8fafc !important;
}
/* L'ombre n'apparaît qu'une fois le tableau défilé : elle dit « du contenu passe
   sous cette colonne », et ne salit pas la vue au repos. En box-shadow et non en
   ::after, car les cellules portent overflow:hidden — qui rognerait le pseudo-élément
   mais pas l'ombre propre de la cellule. */
.co-carnet-table-wrap.co-carnet-scrolled .co-carnet-table th.co-carnet-col-first,
.co-carnet-table-wrap.co-carnet-scrolled .co-carnet-table td.co-carnet-col-first {
    box-shadow: 6px 0 6px -5px rgba(15, 23, 42, 0.22);
}
.co-carnet-table th.co-carnet-col-actions,
.co-carnet-table td.co-carnet-col-actions {
    position: sticky;
    right: 0;
    z-index: 80;
    /* Trois boutons depuis que le drapeau de santé e-mail a rejoint les actions. */
    width: 6.25rem !important;
    min-width: 6.25rem !important;
    max-width: 6.25rem !important;
    padding-left: 0.375rem !important;
    padding-right: 0.5rem !important;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    -webkit-background-clip: padding-box !important;
    box-shadow: none !important;
    cursor: default;
}
.co-carnet-table thead th.co-carnet-col-actions {
    z-index: 90;
    background-color: #f9fafb !important;
    text-align: center;
}
.co-carnet-table thead th.co-carnet-col-actions span {
    justify-content: center;
}
.co-carnet-table td.co-carnet-col-actions {
    text-align: center;
    vertical-align: middle;
}
.co-carnet-table tbody tr.co-carnet-row:hover td.co-carnet-col-actions {
    background-color: #f8fafc !important;
}
.co-carnet-table tbody tr.co-carnet-row td {
    background-color: #ffffff;
    transition: background-color 0.12s ease;
}
.co-carnet-table tbody tr.co-carnet-row:hover td {
    background-color: #f8fafc;
}
.co-carnet-table tbody tr.co-carnet-row:hover .co-carnet-sticky-action {
    background-color: #f8fafc !important;
}
.co-carnet-table th.co-carnet-col-actions {
    cursor: default;
}
.co-inline-input {
    border: 1px solid transparent;
    border-radius: 0.25rem;
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
    background-color: transparent;
}
.co-inline-input:hover {
    border-color: #e2e8f0;
}
.co-inline-input:focus {
    outline: none;
    border-color: #818cf8;
    background-color: #ffffff;
}
.co-carnet-table td.co-carnet-quickselect-cell {
    position: relative;
    user-select: none;
    vertical-align: middle;
}
.co-carnet-quickselect-wrap {
    position: relative;
    min-width: 0;
}
.co-carnet-quickselect-trigger {
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    line-height: inherit;
}
.co-carnet-quickselect-trigger:hover {
    color: #111;
}
.co-carnet-quickselect-trigger:hover .fa-chevron-down {
    color: #555;
}
.co-carnet-quickselect-wrap .co-quick-select-menu {
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.co-carnet-table td.co-carnet-cell-editable {
    cursor: text;
    /* Le texte reste sélectionnable à la souris sans entrer en édition : le
       double-clic ouvre la saisie, mais un simple glissé doit permettre de copier
       une adresse ou un nom, ce que « user-select: none » interdisait. */
    user-select: text;
    -webkit-user-select: text;
}
.co-carnet-table td.co-carnet-cell-editable .co-carnet-cell-display {
    display: block;
    min-height: 1.25rem;
}
.co-carnet-table td input.co-editing-cell-input,
.co-carnet-table td select.co-editing-cell-input,
.co-carnet-table td textarea.co-editing-cell-input {
    user-select: text;
    -webkit-user-select: text;
}
.co-editing-cell-input {
    width: 100%;
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.25rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}
.co-editing-cell-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* Mailchimp compare — sync présents des deux côtés */
.co-btn-mailchimp-push {
    background-color: #111;
    color: #fff;
    border: none;
    cursor: pointer;
}
.co-btn-mailchimp-push:hover:not(:disabled) {
    background-color: #333;
}
.co-btn-mailchimp-push:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}
.co-btn-mailchimp-pull {
    background-color: #d97706;
    color: #fff;
    border: none;
    cursor: pointer;
}
.co-btn-mailchimp-pull:hover:not(:disabled) {
    background-color: #b45309;
}
.co-btn-mailchimp-pull:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Carnet — panneau création / édition contact */
.co-contact-create-panel {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    box-shadow: none;
    margin-bottom: 1rem;
    overflow: hidden;
}
.co-contact-create-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.co-contact-create-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background: #f2f2f0;
    border: 1px solid #e8e8e5;
    color: #111;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}
.co-contact-create-header-text {
    flex: 1;
    min-width: 0;
}
.co-contact-create-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}
.co-contact-create-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}
.co-contact-create-close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.co-contact-create-close:hover {
    background: #f1f5f9;
    color: #475569;
}
.co-contact-create-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.co-contact-create-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
}
.co-contact-create-tab {
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.co-contact-create-tab:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.7);
}
.co-contact-create-tab.is-active {
    background: #111;
    color: #fff;
    font-weight: 600;
}
.co-contact-create-form {
    padding: 1.25rem 1.5rem 1.5rem;
}
.co-contact-create-section {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
}
.co-contact-create-section:last-of-type {
    margin-bottom: 0;
}
.co-contact-create-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 0.75rem;
}
.co-contact-create-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1rem;
}
@media (min-width: 640px) {
    .co-contact-create-grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    .co-contact-create-grid .co-span-4 { grid-column: span 4 / span 4; }
    .co-contact-create-grid .co-span-5 { grid-column: span 5 / span 5; }
    .co-contact-create-grid .co-span-6 { grid-column: span 6 / span 6; }
    .co-contact-create-grid .co-span-3 { grid-column: span 3 / span 3; }
    .co-contact-create-grid .co-span-2 { grid-column: span 2 / span 2; }
    .co-contact-create-grid .co-span-7 { grid-column: span 7 / span 7; }
    .co-contact-create-grid .co-span-8 { grid-column: span 8 / span 8; }
    .co-contact-create-grid .co-span-9 { grid-column: span 9 / span 9; }
    .co-contact-create-grid .co-span-12 { grid-column: span 12 / span 12; }
}
.co-contact-create-field label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.375rem;
}
.co-contact-create-input,
.co-contact-create-field select,
.co-contact-create-field textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #fff;
    font-size: 0.8125rem;
    color: #0f172a;
    padding: 0.5rem 0.75rem;
    min-height: 2.5rem;
    box-sizing: border-box;
}
.co-contact-create-field textarea {
    min-height: auto;
    resize: vertical;
}
.co-contact-create-input:focus,
.co-contact-create-field select:focus,
.co-contact-create-field textarea:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.co-contact-create-vip-wrap {
    display: flex;
    /* Calé sur la première ligne d'adresse : la colonne E-mail s'allonge avec les autres adresses. */
    align-items: flex-start;
    padding-top: calc(0.6875rem * 1.5 + 0.375rem);
}
.co-contact-create-field .co-contact-create-vip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    margin-bottom: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
}
.co-contact-create-vip input {
    border-radius: 0.25rem;
}
.co-contact-create-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}
/* Adresses d'une fiche : une ligne par adresse (principale puis autres) */
.co-email-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.co-email-row { display: flex; align-items: center; gap: 0.4rem; }
.co-email-row .co-contact-create-input { flex: 1 1 auto; min-width: 0; }
.co-email-label { flex: 0 0 6.25rem; min-width: 0; }
.co-email-label .admin-combo-trigger {
    min-height: 2.5rem;
    border-color: #e2e8f0;
    border-radius: 0.625rem;
    background: #fff;
    font-size: 0.8125rem;
}
.co-contact-create-field label.co-email-mailchimp {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    color: #cbd5e1;
    cursor: pointer;
}
.co-email-mailchimp:has(input:checked) { color: #0f172a; }
.co-email-star,
.co-email-remove {
    display: inline-flex;
    flex: 0 0 1.6rem;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    font-size: 0.8rem;
    color: #cbd5e1;
    cursor: pointer;
}
.co-email-star:hover { color: #f59e0b; background: #fffbeb; }
.co-email-star.is-primary { color: #f59e0b; cursor: default; background: none; }
.co-email-remove:hover { color: #dc2626; background: #fef2f2; }
.co-email-remove.is-placeholder { visibility: hidden; }
.co-email-add {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}
.co-email-add i { font-size: 0.6rem; }
.co-email-add:hover { color: #0f172a; }
/* Comparaison Mailchimp : adresse autre que la principale, adresse non cochée */
.co-mc-addr-tag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #eef2ff;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1rem;
    color: #4338ca;
    vertical-align: 1px;
}
.co-mc-addr-tag.is-unchecked { background: #fef3c7; color: #92400e; }
/* Carnet : nombre d'autres adresses à côté de la principale */
.co-email-more {
    flex-shrink: 0;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #eef2ff;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.1rem;
    color: #4338ca;
}
/* Adresse déjà au carnet : alerte sous le champ e-mail du formulaire de fiche */
.co-contact-create-input.has-warning { border-color: #f59e0b; }
.co-email-duplicate {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    background: #fffbeb;
    font-size: 0.75rem;
    color: #92400e;
}
.co-email-duplicate { align-items: center; padding-top: 0.3rem; padding-bottom: 0.3rem; }
/* Message et fiches sur une seule ligne ; elles passent à la suivante seulement s'il y en a plusieurs. */
.co-email-duplicate > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.75rem; }
.co-email-duplicate p { margin: 0; font-weight: 600; }
.co-email-duplicate-link {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: #78350f;
    text-align: left;
    cursor: pointer;
}
.co-email-duplicate-link span { text-decoration: underline; }
.co-email-duplicate-link:hover { color: #111; }
/* Société saisie = nom d'une entité Agreements : proposition de la lier, sous le champ */
.co-org-entity-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid #e3e3df;
    border-radius: 0.5rem;
    background: #fafaf8;
    font-size: 0.75rem;
    color: #55554f;
    cursor: pointer;
    text-align: left;
}
.co-org-entity-hint:hover { border-color: #b9b9b3; background: #fff; }
.co-org-entity-hint strong { color: #111; font-weight: 600; }
.co-entity-links-heading,
.co-entity-link-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.co-entity-links-heading {
    margin-bottom: 0.5rem;
}
.co-entity-links-heading > label {
    margin-bottom: 0;
}
.co-entity-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.co-entity-link-card {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #fff;
}
.co-entity-primary-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    margin: 0 !important;
    white-space: nowrap;
}
.co-entity-link-remove {
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    background: #fff;
    color: #b91c1c;
}
.co-entity-link-remove:hover {
    background: #fef2f2;
}
.co-entity-role-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0.65rem 0;
}
.co-entity-role-label {
    margin-right: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
}
.co-entity-role-chip {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
    /* Les chips sont des <label> (police du champ) ou des <button> (police du navigateur) :
       on fixe la même taille pour que « + Nouveau rôle » ressemble aux autres. */
    font-family: inherit;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.2rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
}
.co-entity-role-chip.is-selected {
    border-color: #a5b4fc;
    background: #eef2ff;
    color: #3730a3;
}
.co-entity-role-chip:hover { border-color: #cbd5e1; }
.co-entity-role-add {
    border-style: dashed;
    color: #64748b;
}
.co-entity-role-add i { font-size: 0.55rem; margin-right: 0.3rem; }
.co-entity-role-draft {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.co-entity-role-draft input {
    height: 1.7rem;
    width: 11rem;
    padding: 0 0.6rem;
    border: 1px solid #a5b4fc;
    border-radius: 999px;
    font-size: 0.75rem;
    outline: none;
}
.co-entity-role-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.5rem;
}
.co-entity-role-hints .co-org-entity-hint { margin-top: 0; }
.co-carnet-entity-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.co-carnet-entity-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.2rem 0.45rem;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.6875rem;
    text-decoration: none;
}
.co-carnet-entity-chip:hover {
    background: #e0e7ff;
}
.co-carnet-entity-role {
    padding-left: 0.25rem;
    border-left: 1px solid #a5b4fc;
    color: #6366f1;
}
@media (max-width: 639px) {
    .co-entity-link-top {
        align-items: stretch;
        flex-direction: column;
    }
}
.co-contact-create-tags {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
}
.co-contact-create-tags summary {
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    list-style: none;
}
.co-contact-create-tags summary::-webkit-details-marker {
    display: none;
}
.co-contact-create-tags-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}
@media (min-width: 640px) {
    .co-contact-create-tags-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.co-contact-create-tag-box {
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    overflow: hidden;
    background: #f8fafc;
}
.co-contact-create-tag-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #475569;
}
.co-contact-create-tag-box-body {
    padding: 0.75rem;
    background: #fff;
}
.co-contact-create-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.co-contact-create-btn-cancel {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    cursor: pointer;
}
.co-contact-create-btn-cancel:hover {
    background: #f8fafc;
}
.co-contact-create-btn-save {
    padding: 0.5rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border: none;
    border-radius: 7px;
    cursor: pointer;
}
.co-contact-create-btn-save:hover:not(:disabled) {
    background: #333;
}
.co-contact-create-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Panneau création entité AG — footer ancré et grilles complètes */
.ag-entity-create-panel.co-contact-create-panel {
    overflow: visible;
}
.ag-entity-create-panel .co-contact-create-form {
    padding-bottom: 0;
}
.ag-entity-create-panel .co-contact-create-section:last-of-type {
    margin-bottom: 0;
}
.ag-entity-create-panel .co-contact-create-footer {
    margin: 1.25rem -1.5rem 0;
    padding: 1rem 1.5rem 1.25rem;
    background: #f7f7f5;
    border-top: 1px solid #e1e1de;
    border-radius: 0 0 10px 10px;
}
.ag-entity-create-panel .co-contact-create-suggest {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    max-height: 14rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.625rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}
.ag-entity-create-panel .co-contact-create-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #191917;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #eeeeeb;
    cursor: pointer;
}
.ag-entity-create-panel .co-contact-create-suggest-item:last-child {
    border-bottom: 0;
}
.ag-entity-create-panel .co-contact-create-suggest-item:hover,
.ag-entity-create-panel .co-contact-create-suggest-item.is-create {
    background: #eef2ff;
}
.ag-entity-create-panel .co-contact-create-suggest-item.is-create {
    color: #4338ca;
    font-weight: 600;
}

.co-contact-create-import {
    margin: 1.25rem 1.5rem 1.5rem;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 2px dashed #cbd5e1;
    border-radius: 0.75rem;
    background: #f8fafc;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.co-contact-create-import.is-dragover {
    border-color: #6366f1;
    background: #eef2ff;
}
.co-contact-create-import.is-preview {
    text-align: left;
    padding: 1.25rem 1.5rem;
}
.co-csv-preview-head,
.co-csv-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.co-csv-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0.85rem 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: #334155;
}
.co-csv-stats strong {
    font-variant-numeric: tabular-nums;
}
.co-csv-policy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.75rem 0;
    font-size: 0.8125rem;
    color: #1e293b;
}
.co-csv-policy label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}
.co-csv-sample {
    margin-top: 0.75rem;
    max-height: 16rem;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
}
.co-csv-sample table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.co-csv-sample th,
.co-csv-sample td {
    text-align: left;
    padding: 0.4rem 0.65rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}
.co-csv-sample th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
}
.co-csv-name {
    display: block;
    color: #0f172a;
}
.co-csv-meta {
    display: block;
    color: #94a3b8;
}
.co-csv-actions {
    margin-top: 1rem;
}

/* Mailchimp sync — zone haute (header, filtres, KPI, onglets, barre liste) */
.co-mailchimp-panel {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    box-shadow: none;
    padding: 1.5rem;
}
.co-mailchimp-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.co-section-badge,
.co-mailchimp-badge,
.co-tags-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background: #f2f2f0;
    border: 1px solid #e8e8e5;
    color: #111;
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}
.co-mailchimp-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}
.co-mailchimp-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
}
.co-mailchimp-filters .co-mailchimp-field label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.375rem;
}
.co-mailchimp-filters select,
.co-mailchimp-filters .co-mailchimp-provenance {
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #fff;
    font-size: 0.8125rem;
}
.co-mailchimp-filters select {
    padding: 0.5rem 0.75rem;
    min-height: 2.5rem;
}
.co-mailchimp-compare-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    min-height: 2.5rem;
    border-radius: 7px;
    background: #111;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.co-mailchimp-compare-btn:hover:not(:disabled) {
    background: #333;
}
.co-mailchimp-compare-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.co-mailchimp-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
    .co-mailchimp-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.co-mailchimp-kpi {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    border: 1px solid #e8e8e5;
}
.co-mailchimp-kpi-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.co-mailchimp-kpi-label::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}
.co-mailchimp-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.co-mailchimp-kpi--local {
    background: #f8fafc;
}
.co-mailchimp-kpi--local .co-mailchimp-kpi-label { color: #475569; }
.co-mailchimp-kpi--local .co-mailchimp-kpi-label::before { background: #64748b; }
.co-mailchimp-kpi--local .co-mailchimp-kpi-value { color: #0f172a; }
.co-mailchimp-kpi--mc {
    background: #fafaf8;
    border-color: #e8e8e5;
}
.co-mailchimp-kpi--mc .co-mailchimp-kpi-label { color: #888; }
.co-mailchimp-kpi--mc .co-mailchimp-kpi-label::before { background: #111; }
.co-mailchimp-kpi--mc .co-mailchimp-kpi-value { color: #111; }
.co-mailchimp-kpi--only-local {
    background: #fffbeb;
    border-color: #fde68a;
}
.co-mailchimp-kpi--only-local .co-mailchimp-kpi-label { color: #b45309; }
.co-mailchimp-kpi--only-local .co-mailchimp-kpi-label::before { background: #b45309; }
.co-mailchimp-kpi--only-local .co-mailchimp-kpi-value { color: #b45309; }
.co-mailchimp-kpi--only-mc {
    background: #f0f9ff;
    border-color: #bae6fd;
}
.co-mailchimp-kpi--only-mc .co-mailchimp-kpi-label { color: #0369a1; }
.co-mailchimp-kpi--only-mc .co-mailchimp-kpi-label::before { background: #0369a1; }
.co-mailchimp-kpi--only-mc .co-mailchimp-kpi-value { color: #0369a1; }
.co-mailchimp-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
    background: #f2f2f0;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
}
.co-mailchimp-tab {
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.co-mailchimp-tab:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.6);
}
.co-mailchimp-tab.is-active {
    background: #111;
    color: #fff;
    font-weight: 600;
}
.co-mailchimp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.co-mailchimp-toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
}
.co-mailchimp-search {
    flex: 1;
    min-width: 12rem;
    max-width: 24rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    background: #fff;
}
.co-mailchimp-search:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}
.co-mailchimp-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: #64748b;
}
.co-mailchimp-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.co-mailchimp-pagination button {
    padding: 0.375rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    background: #fff;
    cursor: pointer;
}
.co-mailchimp-pagination button:hover:not(:disabled) {
    background: #f8fafc;
}
.co-mailchimp-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.co-mailchimp-pagination .co-mailchimp-page-num {
    padding: 0.375rem 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

/* Mailchimp — filtre « uniquement avec différences » */
.co-mailchimp-diff-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.co-mailchimp-diff-toggle:hover {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #b45309;
}
.co-mailchimp-diff-toggle.is-active {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fff7ed 0%, #fde68a 100%);
    color: #92400e;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2), 0 0 0 3px rgba(251, 191, 36, 0.15);
}
.co-mailchimp-diff-toggle.is-active i {
    color: #d97706;
}

/* Modale — choix d'audience Mailchimp (teleport body, fond opaque) */
.co-mailchimp-audience-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(15, 23, 42, 0.55);
}
.co-mailchimp-audience-dialog {
    position: relative;
    z-index: 10051;
    width: 100%;
    max-width: 28rem;
    min-height: 14rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.co-mailchimp-audience-dialog-header,
.co-mailchimp-audience-dialog-body,
.co-mailchimp-audience-dialog-footer {
    background-color: #ffffff;
    flex-shrink: 0;
}
.co-mailchimp-audience-dialog-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}
.co-mailchimp-audience-dialog-body {
    flex: 1 1 auto;
    min-height: 9rem;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.5rem;
}
.co-mailchimp-audience-dialog-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
}
.co-mailchimp-audience-dialog-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}
.co-mailchimp-audience-dialog-intro {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: #64748b;
}
.co-mailchimp-audience-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1e293b;
    background-color: #ffffff;
    cursor: pointer;
}
.co-mailchimp-audience-option:hover:not(:disabled) {
    background-color: #eef2ff;
    color: #3730a3;
}
.co-mailchimp-audience-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.co-mailchimp-audience-option-count {
    font-size: 0.75rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.co-mailchimp-audience-cancel {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
}
.co-mailchimp-audience-cancel:hover {
    background-color: #f8fafc;
}

/* Carnet — balise Mailchimp : le bilan avant d'écrire */
.co-mc-tag-dialog { max-width: 34rem; max-height: calc(100vh - 2rem); }
.co-mc-tag-body { flex: 1 1 auto; min-height: 9rem; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.co-mc-tag-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.25rem; }
.co-mc-tag-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.co-mc-tag-wait, .co-mc-tag-line { margin: 0; font-size: 0.875rem; color: #334155; display: flex; align-items: baseline; gap: 0.5rem; }
.co-mc-tag-wait { color: #64748b; padding: 1.5rem 0; justify-content: center; }
.co-mc-tag-line.is-ok { font-weight: 600; color: #166534; }
.co-mc-tag-line.is-error { color: #b91c1c; }
.co-mc-tag-hint { margin: 0; font-size: 0.8125rem; color: #64748b; }
.co-mc-tag-group { border: 1px solid #e2e8f0; border-radius: 0.5rem; padding: 0.5rem 0.75rem; }
.co-mc-tag-group.is-warn { border-color: #fcd34d; background: #fffbeb; }
.co-mc-tag-group-head { font-size: 0.875rem; font-weight: 600; color: #92400e; cursor: pointer; }
.co-mc-tag-names { margin: 0.4rem 0 0; padding: 0; list-style: none; max-height: 8.5rem; overflow-y: auto; font-size: 0.8125rem; color: #334155; display: flex; flex-direction: column; gap: 0.15rem; }
.co-mc-tag-check { display: flex; align-items: flex-start; gap: 0.5rem; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid #f1f5f9; font-size: 0.8125rem; color: #1e293b; cursor: pointer; }
.co-mc-tag-check input { margin-top: 0.15rem; }
.co-mc-tag-footer { gap: 0.5rem; align-items: center; }
.co-mc-tag-lists { margin: 0; padding: 0 0 0 1.4rem; list-style: none; font-size: 0.8125rem; color: #334155; display: flex; flex-direction: column; gap: 0.2rem; }
.co-mc-tag-lists li { display: flex; justify-content: space-between; gap: 1rem; }
.co-mc-tag-lists li span:last-child { color: #64748b; text-align: right; }
.co-mc-tag-hint.is-warn { color: #92400e; display: flex; align-items: baseline; gap: 0.5rem; }
.co-mc-tag-check.is-note { margin-bottom: 0; color: #64748b; cursor: default; }

/* Carnet — onglet Tags (catégories & dispatch) */
.co-tags-panel {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    box-shadow: none;
    padding: 1.5rem;
}
.co-tags-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.co-tags-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}
.co-tags-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}
.co-tags-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
}
.co-tags-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #f2f2f0;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
}
.co-tags-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
}
.co-tags-tab.is-active {
    background: #111;
    color: #fff;
    font-weight: 600;
}
.co-tags-tab-count {
    font-size: 0.6875rem;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}
.co-tags-search {
    flex: 1;
    min-width: 12rem;
    max-width: 20rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    background: #fff;
}
.co-tags-search:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.co-tags-loading,
.co-tags-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}
.co-tags-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow: visible;
}
.co-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    min-height: 2.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease, background 0.15s ease;
    overflow: visible;
    position: relative;
    z-index: 1;
}
.co-tags-row:has(.co-tags-merge-picker .co-tags-merge-menu) {
    z-index: 20;
}
.co-tags-row:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}
.co-tags-row-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.co-tags-row-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    padding: 0.125rem 0.4rem;
    border-radius: 0.25rem;
}
.co-tags-row-name.is-category {
    background: #eef2ff;
    color: #3730a3;
}
.co-tags-row-name.is-dispatch {
    background: #fffbeb;
    color: #b45309;
}
.co-tags-row-name.is-role {
    background: #ecfeff;
    color: #0e7490;
}
.co-tags-row-count {
    font-size: 0.6875rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.co-tags-rename-input {
    min-width: 12rem;
    max-width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1px solid #818cf8;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.co-tags-merge-picker {
    position: relative;
    min-width: 14rem;
    max-width: 18rem;
    flex: 1 1 14rem;
}
.co-tags-merge-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.co-tags-merge-search-icon {
    position: absolute;
    left: 0.55rem;
    font-size: 0.6875rem;
    color: #94a3b8;
    pointer-events: none;
}
.co-tags-merge-input {
    width: 100%;
    min-width: 0;
    padding: 0.35rem 1.75rem 0.35rem 1.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    background: #fff;
    color: #0f172a;
}
.co-tags-merge-input.is-category:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.co-tags-merge-input.is-dispatch:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.co-tags-merge-clear {
    position: absolute;
    right: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
}
.co-tags-merge-clear:hover {
    background: #e2e8f0;
    color: #334155;
}
.co-tags-merge-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 60;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
.co-tags-merge-options {
    max-height: 14rem;
    overflow-y: auto;
}
.co-tags-merge-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: none;
    border-radius: 0.45rem;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #0f172a;
}
.co-tags-merge-option.is-category:hover,
.co-tags-merge-option.is-category.is-selected {
    background: #eef2ff;
}
.co-tags-merge-option.is-dispatch:hover,
.co-tags-merge-option.is-dispatch.is-selected {
    background: #fffbeb;
}
.co-tags-merge-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.co-tags-merge-option-count {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}
.co-tags-merge-empty {
    margin: 0;
    padding: 0.5rem 0.55rem;
    font-size: 0.75rem;
    color: #64748b;
}
.co-tags-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.co-tags-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
}
.co-tags-btn:hover:not(:disabled) {
    background: #f8fafc;
}
.co-tags-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.co-tags-btn-save {
    background: #111;
    border-color: #111;
    color: #fff;
}
.co-tags-btn-save:hover:not(:disabled) {
    background: #333;
}
.co-tags-btn-carnet {
    border-color: #c7d2fe;
    color: #4338ca;
}
.co-tags-btn-carnet:hover:not(:disabled) {
    background: #eef2ff;
}
.co-tags-btn-merge {
    color: #92400e;
}
.co-tags-btn-merge:hover:not(:disabled) {
    background: #fffbeb;
}
.co-tags-btn-delete {
    border-color: #fecaca;
    color: #b91c1c;
}
.co-tags-btn-delete:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #fca5a5;
}
.co-carddav-platforms {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.2rem;
    margin: 0 0 0.75rem;
    background: #f1f1ee;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
}
.co-carddav-platform {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}
.co-carddav-platform:hover {
    color: #0f172a;
}
.co-carddav-platform.is-active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.co-carddav-warn {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin: 0 0 1rem;
    padding: 0.6rem 0.75rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.8125rem;
    line-height: 1.45;
}
.co-carddav-warn i {
    margin-top: 0.15rem;
}
.co-carddav-note {
    margin: -0.25rem 0 1rem;
    color: #64748b;
    font-size: 0.75rem;
}
.co-carddav-steps {
    margin: 0 0 1rem;
    padding: 0.85rem 0.85rem 0.85rem 1.6rem;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    color: #334155;
    font-size: 0.8125rem;
    line-height: 1.5;
}
.co-carddav-steps li + li {
    margin-top: 0.4rem;
}
.co-carddav-setup {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
}
.co-carddav-setup dt {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 0.2rem;
}
.co-carddav-setup dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.co-carddav-create {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
/* Onglet Infomaniak (miroir vers le webmail) */
.co-imk-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem 1.25rem;
    margin: 0 0 1rem;
}
.co-imk-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}
.co-imk-field .co-tags-search {
    max-width: none;
    width: 100%;
    height: 2.375rem;
}
.co-imk-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
}
.co-imk-hint {
    font-size: 0.75rem;
    line-height: 1.45;
    color: #64748b;
}
.co-imk-link {
    background: none;
    border: 0;
    padding: 0;
    margin-left: 0.25rem;
    font: inherit;
    color: #b91c1c;
    text-decoration: underline;
    cursor: pointer;
}
.co-imk-link:disabled {
    opacity: 0.5;
    cursor: default;
}
.co-imk-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 1rem;
}
.co-imk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.co-imk-status {
    margin: 1.25rem 0;
    padding: 0.875rem 1rem;
    border: 1px solid #e7e5e4;
    border-radius: 0.5rem;
    background: #fafaf9;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}
.co-imk-status-text {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #292524;
}
.co-imk-warn {
    margin: 0 0 1rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    background: #fef2f2;
    color: #991b1b;
    font-size: 0.8125rem;
}
.co-retention-company {
    padding: 1rem 0 1.25rem;
    border-top: 1px solid #e2e8f0;
}
.co-retention-company-name {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}
.co-retention-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.co-retention-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #f8fafc;
    text-align: left;
}
.co-retention-stat.is-link:not(:disabled) {
    cursor: pointer;
    background: #fff;
}
.co-retention-stat.is-link:not(:disabled):hover {
    border-color: #94a3b8;
}
.co-retention-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.co-retention-stat-label {
    font-size: 0.75rem;
    color: #64748b;
}
.co-retention-referents {
    max-width: 32rem;
}
.co-retention-referents .co-imk-warn {
    margin: 0.25rem 0 0;
    background: #fffbeb;
    color: #92400e;
}
.co-retention-names {
    font-size: 0.875rem;
    color: #0f172a;
}
.co-retention-rules {
    margin: 0.5rem 0 0;
    padding: 1rem 0 0 1.1rem;
    border-top: 1px solid #e2e8f0;
    list-style: disc;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #475569;
}
.co-retention-rules li + li {
    margin-top: 0.35rem;
}
/* Droits de la personne, dans le panneau d'édition d'une fiche */
.co-privacy-box {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #f8fafc;
}
.co-privacy-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.co-privacy-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
}
.co-privacy-title i {
    color: #64748b;
}
.co-privacy-badge {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #ecfdf5;
    color: #047857;
}
.co-privacy-badge.is-opposed {
    background: #fff7ed;
    color: #c2410c;
}
.co-privacy-hint {
    margin: 0.4rem 0 0.75rem;
    font-size: 0.8125rem;
    color: #64748b;
}
.co-privacy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.co-privacy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
}
.co-privacy-btn:hover:not(:disabled) {
    background: #f1f5f9;
}
.co-privacy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.co-privacy-btn.is-danger {
    border-color: #fecaca;
    color: #b91c1c;
}
.co-privacy-btn.is-danger:hover:not(:disabled) {
    background: #fef2f2;
}
.co-privacy-btn.is-danger-solid {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff;
}
.co-privacy-btn.is-danger-solid:hover:not(:disabled) {
    background: #991b1b;
}
.co-privacy-erase {
    margin-top: 0.875rem;
    padding: 0.875rem 1rem;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.8125rem;
    color: #334155;
}
.co-privacy-erase-lead {
    margin: 0 0 0.4rem;
    font-weight: 600;
    color: #991b1b;
}
.co-privacy-erase ul {
    margin: 0 0 0.6rem 1.1rem;
    list-style: disc;
    line-height: 1.55;
}
.co-privacy-erase-note {
    margin: 0 0 0.5rem;
    color: #64748b;
}
.co-privacy-erase-label {
    display: block;
    margin: 0.75rem 0 0.6rem;
    font-weight: 600;
}
.co-privacy-erase-input {
    display: block;
    width: 100%;
    max-width: 24rem;
    margin-top: 0.35rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-weight: 400;
}
.co-opposed-mark {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: #c2410c;
}
.co-imk-runs-title {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
}
.co-imk-runs-wrap {
    overflow-x: auto;
}
.co-imk-runs td {
    vertical-align: top;
    font-size: 0.8125rem;
}
.co-imk-nowrap {
    white-space: nowrap;
}
.co-imk-msg {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: #64748b;
    overflow-wrap: anywhere;
}
.co-imk-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.co-imk-badge.is-ok { background: #dcfce7; color: #166534; }
.co-imk-badge.is-error { background: #fee2e2; color: #991b1b; }
.co-imk-badge.is-running { background: #e0e7ff; color: #3730a3; }
.co-carddav-create .co-tags-search {
    max-width: none;
    flex: 1 1 14rem;
}
.co-carddav-secret {
    margin: 0 0 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
}
.co-carddav-secret-warn {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: #92400e;
}
.co-carddav-secret-value {
    display: block;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #f5d08a;
    font-size: 0.8125rem;
    word-break: break-all;
    color: #111;
}
.co-carddav-secret-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}
.co-carddav-meta {
    font-size: 0.75rem;
    color: #64748b;
}
.co-role-catalog {
    padding: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #f8fafc;
}
.co-role-catalog-head,
.co-role-catalog-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.co-role-catalog-head {
    margin-bottom: 1rem;
}
.co-role-catalog-head h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
}
.co-role-catalog-head p {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.75rem;
}
.co-role-catalog-form {
    justify-content: flex-start;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #bae6fd;
    border-radius: 0.625rem;
    background: #fff;
}

/* ══════════════════════════════════════
   Dashboard
══════════════════════════════════════ */
.dash-root {
    min-height: 100vh;
    background: #f5f5f3;
}
.dash-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ── Volets Outils / Le Fil (défilement horizontal aimanté) ── */
.dash-panes-bar {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 0;
}
.dash-panes-nav {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    background: #ebebe8;
    border-radius: 999px;
}
.dash-panes-nav button {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 6.5rem;
    padding: 0.4rem 1rem;
    border: 0;
    background: none;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8a8a84;
    cursor: pointer;
    transition: color 0.2s ease;
}
.dash-panes-nav button.is-active { color: #111; }
.dash-panes-nav button:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.dash-panes-ink {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc(50% - 3px);
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    will-change: transform;
}
.dash-panes-count {
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.15rem;
}
.dash-panes {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.dash-panes::-webkit-scrollbar { display: none; }
/* Réorganiser les cartes : un glisser ne doit pas emporter le volet. */
.dash-panes.is-locked { overflow-x: hidden; }
.dash-pane {
    flex: 0 0 100%;
    min-width: 0;
    /* Assez haut pour qu'un menu ouvert ne soit pas rogné par le défilement. */
    min-height: calc(100vh - 7rem);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
/* Le volet hors champ ne doit pas allonger la page de l'autre. */
.dash-pane.is-away {
    max-height: 100vh;
    overflow: hidden;
}
.dash-pane > .dash-container,
.dash-pane .fil-container { padding-top: 1.5rem; }
/* Les deux volets ont la largeur du sélecteur : il ne bouge pas d'un volet à l'autre. */
.dash-pane > .dash-container { max-width: 1240px; }
.dash-pane .fil-root { min-height: 0; background: transparent; }
@media (max-width: 640px) {
    .dash-panes-bar { padding: 1.25rem 1rem 0; }
    .dash-panes-nav { display: grid; }
    .dash-pane > .dash-container,
    .dash-pane .fil-container { padding-top: 1rem; }
}
.dash-section {
    margin-bottom: 2.5rem;
}
.dash-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin-bottom: 0.875rem;
}

/* ── Grille outils ── */
.dash-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}
@media (min-width: 1100px) {
    .dash-tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .dash-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .dash-tools-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Carte outil ── */
.tool-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.tool-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.07);
    transform: translateY(-2px);
}
.tool-card {
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.tool-card-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.1rem 0.9rem;
    flex: 1;
}

/* ── Réorganisation des cartes (glisser-déposer) ── */
.dash-section-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    min-height: 1.25rem;
}
.dash-section-head .dash-section-label { margin-bottom: 0; }
.dash-reorder-hint {
    font-size: 0.7rem;
    color: #a8a8a2;
    animation: dash-fade-in 0.2s ease;
}
@keyframes dash-fade-in { from { opacity: 0; } to { opacity: 1; } }
.dash-reorder-hint-touch { display: none; }
@media (hover: none) {
    .dash-reorder-hint-pointer { display: none; }
    .dash-reorder-hint-touch { display: inline; }
}
.dash-section-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bascule discrète « Réorganiser les outils » */
.dash-reorder-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #b0b0aa;
    background: none;
    border: 0;
    border-radius: 5px;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    transition: color 0.14s ease, background 0.14s ease;
}
.dash-reorder-toggle:hover { color: #555; background: #ebebe8; }
.dash-reorder-toggle.is-on { color: #111; }
.dash-reorder-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.dash-switch {
    position: relative;
    width: 22px;
    height: 12px;
    border-radius: 999px;
    background: #d6d6d1;
    transition: background 0.18s ease;
}
.dash-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s cubic-bezier(.2, .8, .2, 1);
}
.dash-reorder-toggle.is-on .dash-switch { background: #111; }
.dash-reorder-toggle.is-on .dash-switch::after { transform: translateX(10px); }

.dash-reorder-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #8a8a84;
    background: none;
    border: 0;
    border-radius: 5px;
    padding: 0.15rem 0.4rem;
    cursor: pointer;
    transition: color 0.14s ease, background 0.14s ease;
}
.dash-reorder-reset:hover { color: #111; background: #ebebe8; }
.dash-reorder-reset:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

/* Un seul accès : toute la pastille ouvre l'outil. */
.tool-card.is-clickable { cursor: pointer; }
/* Mode réorganisation : la main indique où l'on peut saisir (les boutons restent inertes). */
.dash-tools-grid.is-reorderable .tool-card,
.dash-tools-grid.is-reorderable .tool-card .tool-btn { cursor: grab; }

/* Poignée : indice visuel au survol, et accès au clavier. */
.tool-card-grip {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 1;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #b8b8b2;
    background: none;
    border: 0;
    border-radius: 5px;
    padding: 0;
    cursor: grab;
    opacity: 0.7;
    transition: opacity 0.16s ease, color 0.14s ease, background 0.14s ease;
}
.tool-card:hover .tool-card-grip,
.tool-card-grip:focus-visible { opacity: 1; }
.tool-card-grip:hover { color: #555; background: #f2f2f0; }
.tool-card-grip:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
/* Pendant le geste : seules les transformations bougent, sans retard ni survol. */
.dash-tools-grid.is-sorting .tool-card { transition: transform 0.24s cubic-bezier(.2, .8, .2, 1); }
.dash-tools-grid.is-sorting .tool-card:hover { transform: none; box-shadow: none; }
.dash-tools-grid.is-sorting .tool-card.is-dragging {
    z-index: 50;
    scale: 1.03;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d6d6d1;
    /* `transform` suit le pointeur sans transition ; seuls l'ombre et l'échelle s'animent. */
    transition: scale 0.16s ease, box-shadow 0.16s ease;
    will-change: transform;
}
.dash-tools-grid.is-sorting .tool-card.is-dragging .tool-card-grip { opacity: 0; }
.dash-tools-grid.is-sorting-reset .tool-card { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    .dash-tools-grid.is-sorting .tool-card { transition: none; }
}
html.is-sort-dragging,
html.is-sort-dragging * {
    cursor: grabbing !important;
    -webkit-user-select: none;
    user-select: none;
}
.tool-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: #f2f2f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tool-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
.tool-icon-fallback {
    font-size: 0.8rem;
    color: #888;
}
.tool-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}
.tool-card-footer {
    display: flex;
    align-items: center;
    border-top: 1px solid #f0f0ed;
    padding: 0.65rem 1.1rem;
}
.tool-card-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
}
.tool-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #374151;
    background: #f8f8f7;
    border: 1px solid #e3e3df;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
    line-height: 1;
}
.tool-btn:hover {
    background: #fff;
    border-color: #c9c9c4;
    color: #111;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.tool-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}
.tool-btn-full {
    width: 100%;
}

/* ── Vide ── */
.dash-empty {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    padding: 2.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #aaa;
}

/* ── Tableau de bord : barre, familles, cartes (refonte du 28/10/2026) ── */
.dash-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}
.dash-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    max-width: 420px;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    color: #9a9a94;
    font-size: 0.84rem;
    cursor: text;
    text-align: left;
    transition: border-color 0.14s ease;
}
.dash-search:hover { border-color: #c9c9c4; }
.dash-search:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.dash-search kbd {
    margin-left: auto;
    font: 600 0.66rem/1 inherit;
    color: #9a9a94;
    background: #f2f2f0;
    border: 1px solid #e8e8e5;
    border-radius: 5px;
    padding: 0.2rem 0.35rem;
}
.dash-layout { flex: 0 0 auto; }
.dash-bar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.dash-mode { display: inline-flex; align-items: center; gap: 0.55rem; margin-right: 0.35rem; }
.dash-mode-label { font-size: 0.74rem; color: #9a9a94; white-space: nowrap; }
/* Contrôle segmenté : « Ouvrir en Admin | Client », et le même dans l'en-tête d'un outil. */
.dash-seg {
    display: inline-flex;
    padding: 3px;
    background: #ebebe8;
    border-radius: 9px;
}
.dash-seg > button,
.dash-seg > a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.75rem;
    border: 0;
    background: none;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #8a8a84;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.14s ease, background 0.14s ease;
}
.dash-seg > button i,
.dash-seg > a i { font-size: 0.68rem; }
.dash-seg > button:hover,
.dash-seg > a:hover { color: #333; }
.dash-seg > .is-on {
    background: #fff;
    color: #111;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.dash-seg > button:focus-visible,
.dash-seg > a:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
/* À gauche, après le logo : le titre de l'outil, centré, garde sa place. */
.app-view-switch { margin-left: 1.25rem; }
.app-view-switch > a { padding: 0.3rem 0.6rem; font-size: 0.72rem; }
/* Plus étroit, le titre centré d'un outil au long nom viendrait dessus. */
@media (max-width: 1023px) {
    .app-view-switch { display: none; }
}
.dash-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #6b6b66;
    background: none;
    border: 0;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.14s ease, background 0.14s ease;
}
.dash-ghost:hover,
.dash-ghost.is-on { background: #ebebe8; color: #111; }
.dash-ghost:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.dash-ghost i { font-size: 0.72rem; }
.dash-primary {
    font-size: 0.76rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border: 0;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
}
.dash-primary:hover { background: #333; }
.dash-primary:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

.dash-welcome {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-left: 3px solid #111;
    border-radius: 10px;
}
.dash-welcome p { flex: 1; font-size: 0.82rem; color: #6b6b66; }
.dash-welcome b { color: #111; }
.dash-welcome .dash-welcome-icon { background: #111; color: #fff; }

.dash-family + .dash-family { margin-top: 1.5rem; }
.dash-family .dash-section-head { margin-bottom: 0.6rem; }
.dash-family-hint { font-size: 0.74rem; color: #9a9a94; }

/* Carte : un clic ouvre l'outil. Trois colonnes (icône | texte | pastille) : la pastille reste au bord. */
.dash-tool {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    min-height: 60px;
    padding: 0.65rem 0.75rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    font: inherit;
    color: #111;
    text-align: left;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}
.dash-tool:hover { border-color: #cfcfca; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); transform: translateY(-1px); }
.dash-tool:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.dash-tool-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f2f2f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #333;
}
.dash-tool-icon img { width: 18px; height: 18px; object-fit: contain; }
.dash-tool-text { min-width: 0; }
.dash-tool-name {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-tool-sub {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.7rem;
    color: #9a9a94;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-tool-sub.is-off { color: #b0b0aa; font-style: italic; }
.dash-tool-sub.is-warn { color: #b45309; font-weight: 500; }
.dash-tool-badge {
    justify-self: end;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-size: 0.64rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Vue client d'un administrateur : l'outil sans vue client s'efface et le dit. */
.dash-tool.is-off {
    background: transparent;
    border-style: dashed;
    cursor: default;
}
.dash-tool.is-off:hover { transform: none; box-shadow: none; border-color: #e8e8e5; }
.dash-tool.is-off .dash-tool-icon,
.dash-tool.is-off .dash-tool-name { opacity: 0.5; }

/* Réorganisation : la carte entière se saisit ; la poignée sert au clavier. */
.dash-tools-grid.is-reorderable .dash-tool { cursor: grab; }
.dash-tool-grip {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #b8b8b2;
    background: none;
    border: 0;
    border-radius: 5px;
    padding: 0;
    cursor: grab;
}
.dash-tool-grip:hover { color: #555; background: #f2f2f0; }
.dash-tool-grip:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.dash-tools-grid.is-sorting .dash-tool { transition: transform 0.24s cubic-bezier(.2, .8, .2, 1); }
.dash-tools-grid.is-sorting .dash-tool:hover { transform: none; box-shadow: none; }
.dash-tools-grid.is-sorting .dash-tool.is-dragging {
    z-index: 50;
    scale: 1.03;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d6d6d1;
    transition: scale 0.16s ease, box-shadow 0.16s ease;
    will-change: transform;
}
.dash-tools-grid.is-sorting .dash-tool.is-dragging .dash-tool-grip { opacity: 0; }
.dash-tools-grid.is-sorting-reset .dash-tool { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
    .dash-tools-grid.is-sorting .dash-tool { transition: none; }
}

/* ── Sélecteur collé : il ne bouge jamais, le contenu défile dessous ── */
.dash-panes-bar {
    position: sticky;
    top: var(--app-header-h);
    z-index: 30;
    padding-bottom: 0.75rem;
    background: #f5f5f3;
    /* Le fond déborde sur toute la largeur, sans élargir la boîte. */
    box-shadow: 0 0 0 100vmax #f5f5f3;
    clip-path: inset(0 -100vmax);
}
.dash-panes-count.is-warn { background: #b45309; }
/* Administrateurs : Outils | Le Fil | Administration, sur une ligne. */
.dash-panes-nav.is-3 { grid-template-columns: repeat(3, 1fr); }
.dash-panes-nav.is-3 .dash-panes-ink { width: calc((100% - 6px) / 3); transition: opacity 0.12s linear; }
@media (max-width: 640px) {
    .dash-panes-nav.is-3 button { min-width: 0; padding: 0.4rem 0.35rem; gap: 0.3rem; }
}

/* ── Volet Administration ── */
.adm-floor { min-height: calc(100vh - 7rem); }
.adm-floor > .dash-container { max-width: 1240px; padding-top: 1.5rem; }
.adm-floor-head { margin-bottom: 0.9rem; }
.adm-todo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.2rem;
    padding: 0.35rem;
    margin-bottom: 1.25rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-left: 3px solid #b45309;
    border-radius: 10px;
}
.adm-todo button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 7px;
    background: none;
    font: inherit;
    font-size: 0.78rem;
    color: #333;
    text-align: left;
    cursor: pointer;
}
.adm-todo button:hover { background: #f5f5f3; }
.adm-todo button:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.adm-todo b {
    min-width: 1.6rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.adm-todo i { margin-left: auto; color: #cfcfca; font-size: 0.65rem; }

/* Rubriques : dans un volet qui défile de côté, elles ne peuvent plus se coller.
   Pas de fond débordant : il peindrait sur le volet voisin pendant le glissement. */
.adm-subbar {
    padding: 0.25rem 0 0.75rem;
    margin-bottom: 0.25rem;
}
.adm-subnav {
    position: relative;
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 3px;
    background: #ebebe8;
    border-radius: 9px;
}
.adm-subnav button {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.38rem 0.85rem;
    border: 0;
    border-radius: 7px;
    background: none;
    font-size: 0.76rem;
    font-weight: 600;
    color: #8a8a84;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}
.adm-subnav button i { font-size: 0.68rem; }
.adm-subnav button.is-on { color: #111; }
.adm-subnav button:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.adm-subnav-ink {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
}
/* Changement de rubrique : un fondu court, jamais de glissement de côté. */
.adm-fade-enter-active,
.adm-fade-leave-active { transition: opacity 0.14s ease, transform 0.14s ease; }
.adm-fade-enter-from { opacity: 0; transform: translateY(4px); }
.adm-fade-leave-to { opacity: 0; transform: translateY(-4px); }

.dash-seg-n { margin-left: 0.15rem; font-weight: 500; color: #b0b0aa; }
.adm-search-field { cursor: text; }
.adm-search-field:focus-within { border-color: #c9c9c4; }
.adm-search-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    color: #111;
}
.adm-focus { margin-bottom: 0.6rem; }
.adm-focus b { color: #111; }

/* Tuile société : un clic ouvre la fiche ; outils et suppression au survol. */
.dash-tool-icon.is-initials { font-size: 0.68rem; font-weight: 700; color: #6b6b66; }
.adm-tile-actions { display: inline-flex; gap: 0.1rem; opacity: 0; transition: opacity 0.14s ease; }
.adm-company-tile:hover .adm-tile-actions,
.adm-company-tile:focus-within .adm-tile-actions { opacity: 1; }
@media (hover: none) { .adm-tile-actions { opacity: 1; } }
.adm-tile-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #9a9a94;
    font-size: 0.72rem;
    cursor: pointer;
}
.adm-tile-btn:hover { background: #f2f2f0; color: #111; }
.adm-tile-btn.is-danger:hover { background: #fef2f2; color: #b91c1c; }
.adm-tile-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

/* Sans accès au portail : des lignes compactes. */
.adm-rows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
}
@media (max-width: 760px) { .adm-rows { grid-template-columns: minmax(0, 1fr); } }
.adm-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.5rem 0.8rem;
    border: 0;
    border-bottom: 1px solid #f2f2f0;
    background: none;
    font: inherit;
    font-size: 0.78rem;
    color: #333;
    text-align: left;
    cursor: pointer;
}
.adm-row:hover { background: #fafaf8; }
.adm-row:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.adm-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-row em { margin-left: auto; font-style: normal; font-size: 0.68rem; color: #b0b0aa; white-space: nowrap; }
.adm-more { margin-top: 0.5rem; }

/* Utilisateurs : deux contrôles segmentés, qui passent à la ligne si la place manque. */
.adm-bar-wrap { flex-wrap: wrap; }
.adm-user-tile-co { font-weight: 400; color: #9a9a94; }
.dash-tool-icon img.adm-user-tile-avatar { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
/* Un compte désactivé ne s'ouvre pas ; seul « Réactiver » répond. */
.adm-user-tile.is-off .adm-tile-actions { opacity: 1; }

/* ── Volet de la fiche : glisse depuis la droite, au-dessus de l'en-tête (z 45),
   sous les confirmations et les messages (z 50), que la fiche doit pouvoir ouvrir. ── */
.adm-scrim { position: fixed; inset: 0; z-index: 48; background: rgba(17, 17, 17, 0.12); }
.adm-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 49;
    width: min(440px, 100vw);
    display: flex;
    background: #fff;
    border-left: 1px solid #e8e8e5;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.06);
    outline: none;
}
.adm-sheet-inner { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.adm-sheet-head { display: flex; align-items: center; gap: 0.75rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid #f2f2f0; }
.adm-sheet-head .dash-tool-icon { flex-shrink: 0; }
.adm-sheet-head .dash-tool-icon img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.adm-sheet-title { min-width: 0; }
.adm-sheet-title h2 { font-size: 1rem; font-weight: 600; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-sheet-title p { font-size: 0.72rem; color: #9a9a94; margin-top: 0.1rem; }
.adm-sheet-close { margin-left: auto; flex-shrink: 0; }
.adm-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.adm-sheet-body .adm-field { margin-bottom: 0; }
.adm-sheet-body .adm-field-row { margin-bottom: 0; }
.adm-field-count { margin-left: 0.35rem; font-weight: 500; color: #b0b0aa; }
.adm-sheet-status { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; }
.adm-sheet-status .dash-tool-sub { font-size: 0.8rem; }
.adm-sheet-note { font-size: 0.75rem; color: #9a9a94; margin-top: 0.4rem; }
.adm-sheet-list { display: flex; flex-direction: column; gap: 0.3rem; }
.adm-sheet-list .adm-membership-row { margin-bottom: 0; }
.adm-sheet-list .adm-membership-row > :first-child { flex: 1; min-width: 0; }
.adm-sheet-list .adm-membership-row > :nth-child(2) { width: 9.5rem; flex-shrink: 0; }
.adm-sheet-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 44px;
    padding: 0.45rem 0.6rem;
    border: 1px solid #f0f0ee;
    border-radius: 9px;
    background: #fff;
    text-align: left;
    color: #333;
    font: inherit;
}
.adm-sheet-row.is-on { border-color: #e4e4e0; background: #fafaf8; }
.adm-sheet-row.is-link { cursor: pointer; }
.adm-sheet-row.is-link:hover:not(:disabled) { background: #fafaf8; border-color: #e4e4e0; }
.adm-sheet-row.is-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.adm-sheet-row.is-off { opacity: 0.55; cursor: default; }
.adm-sheet-row-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f2f2f0;
    color: #777;
    font-size: 0.66rem;
    font-weight: 600;
    overflow: hidden;
}
.adm-sheet-row-icon img { width: 100%; height: 100%; object-fit: cover; }
.adm-sheet-row-text { display: flex; flex-direction: column; min-width: 0; }
.adm-sheet-row-name { font-size: 0.82rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-sheet-row > .adm-sheet-row-name { flex: 1; min-width: 0; }
.adm-sheet-row .switch { margin-left: auto; flex-shrink: 0; }
.adm-sheet-row-chev { margin-left: auto; font-size: 0.62rem; color: #c4c4be; }
.adm-sheet-invite { align-self: flex-start; margin-top: 0.2rem; }
.adm-sheet-foot { display: flex; align-items: center; gap: 0.5rem; padding: 0.9rem 1.25rem; border-top: 1px solid #f2f2f0; }
.adm-sheet-foot-end { margin-left: auto; display: flex; gap: 0.5rem; }
.dash-ghost.is-danger { color: #b91c1c; }
.dash-ghost.is-danger:hover { background: #fef2f2; color: #b91c1c; }

.adm-scrim-enter-active, .adm-scrim-leave-active { transition: opacity 0.22s ease; }
.adm-scrim-enter-from, .adm-scrim-leave-to { opacity: 0; }
.adm-sheet-enter-active, .adm-sheet-leave-active { transition: transform 0.28s cubic-bezier(.2, .8, .2, 1); }
.adm-sheet-enter-from, .adm-sheet-leave-to { transform: translateX(100%); }

@media (max-width: 640px) {
    .adm-subnav button { padding: 0.38rem 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
    .adm-subnav-ink,
    .adm-fade-enter-active,
    .adm-fade-leave-active,
    .adm-scrim-enter-active,
    .adm-scrim-leave-active,
    .adm-sheet-enter-active,
    .adm-sheet-leave-active { transition: none; }
}

/* ── Palette « Aller à un outil » et aide ── */
.dash-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    background: rgba(17, 17, 17, 0.28);
}
.dash-palette-bg { align-items: flex-start; justify-content: center; padding-top: 14vh; }
.dash-palette {
    width: min(560px, 92vw);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
.dash-palette input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f0f0ed;
    padding: 1rem 1.1rem;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
}
.dash-palette ul { list-style: none; margin: 0; max-height: 360px; overflow: auto; padding: 0.35rem; }
.dash-palette li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    font-size: 0.86rem;
    cursor: pointer;
}
.dash-palette li.is-selected { background: #f2f2f0; }
.dash-palette li .dash-tool-icon { width: 26px; height: 26px; font-size: 0.68rem; }
.dash-palette li small { color: #9a9a94; font-size: 0.74rem; }
.dash-palette-hint { margin-left: auto; font-size: 0.68rem; color: #9a9a94; }
.dash-palette li.dash-palette-empty { color: #9a9a94; cursor: default; }

.dash-help-bg { justify-content: flex-end; }
.dash-help {
    width: min(760px, 100vw);
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.12);
}
.dash-help-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid #f0f0ed;
}
.dash-help-head h2 { font-size: 1rem; font-weight: 700; }
.dash-help-head p { margin-top: 0.25rem; max-width: 56ch; font-size: 0.8rem; line-height: 1.5; color: #6b6b66; }
.dash-help-body { flex: 1; overflow: auto; padding: 1.1rem 1.25rem 2rem; }
.dash-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; align-items: start; }
.dash-map-col { background: #f5f5f3; border-radius: 12px; padding: 0.75rem; }
.dash-map-col .dash-section-label { display: block; margin-bottom: 0.2rem; }
.dash-map-hint { font-size: 0.72rem; color: #9a9a94; margin-bottom: 0.6rem; }
.dash-map-node {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.35rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 9px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    color: #111;
    text-align: left;
    cursor: pointer;
    transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.dash-map-node .dash-tool-icon { width: 24px; height: 24px; font-size: 0.62rem; border-radius: 6px; }
.dash-map-node .dash-tool-icon img { width: 14px; height: 14px; }
.dash-map-name { min-width: 0; overflow-wrap: anywhere; }
.dash-map.has-focus .dash-map-node { opacity: 0.3; }
.dash-map.has-focus .dash-map-node.is-me,
.dash-map.has-focus .dash-map-node.is-from,
.dash-map.has-focus .dash-map-node.is-to,
.dash-map.has-focus .dash-map-node.is-both { opacity: 1; }
.dash-map-node.is-me { border-color: #111; box-shadow: 0 0 0 1px #111; }
.dash-map-node.is-from { border-color: #93c5fd; background: #eff6ff; }
.dash-map-node.is-to { border-color: #fcd34d; background: #fffbeb; }
.dash-map-node.is-both { border-color: #93c5fd; background: linear-gradient(90deg, #eff6ff, #fffbeb); }
.dash-map-node:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.dash-map-dir { margin-left: auto; flex-shrink: 0; font-size: 0.9rem; font-weight: 700; line-height: 1; }
.dash-map-node.is-from .dash-map-dir { color: #1d4ed8; }
.dash-map-node.is-to .dash-map-dir { color: #a16207; }
.dash-map-node.is-both .dash-map-dir { color: #1d4ed8; }
.dash-map-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; margin-top: 0.75rem; font-size: 0.72rem; color: #9a9a94; }
.dash-map-legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.35rem;
    border-radius: 3px;
    vertical-align: -1px;
}
.dash-map-legend .is-from::before { background: #eff6ff; border: 1px solid #93c5fd; }
.dash-map-legend .is-to::before { background: #fffbeb; border: 1px solid #fcd34d; }
.dash-map-legend .is-both::before { background: linear-gradient(90deg, #eff6ff, #fffbeb); border: 1px solid #93c5fd; }
.dash-map-detail { margin-top: 1rem; padding: 1rem; border: 1px solid #e8e8e5; border-radius: 12px; min-height: 140px; }
.dash-map-detail h3 { display: flex; align-items: center; gap: 0.55rem; font-size: 0.92rem; font-weight: 700; }
.dash-map-detail > p { margin-top: 0.45rem; font-size: 0.82rem; line-height: 1.5; color: #6b6b66; }
.dash-map-flows { display: grid; gap: 0.35rem; margin: 0.7rem 0 0.8rem; }
.dash-map-flow { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.78rem; }
.dash-map-flow.is-none { color: #9a9a94; }
.dash-map-tag {
    flex-shrink: 0;
    padding: 0.12rem 0.4rem;
    border-radius: 5px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dash-map-tag.is-from { background: #eff6ff; color: #1d4ed8; }
.dash-map-tag.is-to { background: #fffbeb; color: #a16207; }
.dash-map-empty { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: #9a9a94; }

@media (max-width: 760px) {
    .dash-search-text, .dash-search kbd { display: none; }
    .dash-search { flex: 0 0 auto; }
    .dash-bar-end .dash-ghost span, .dash-layout span { display: none; }
    .dash-bar { flex-wrap: wrap; row-gap: 0.5rem; }
    .dash-mode-label { display: none; }
    .dash-family-hint { display: none; }
    .dash-map { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .dash-welcome { flex-wrap: wrap; }
    .dash-welcome p { flex-basis: calc(100% - 3rem); }
    .dash-welcome .dash-primary { flex: 1; text-align: center; }
}

/* ══════════════════════════════════════
   Le Fil — centre de notifications (NotificationFeed.js)
   Même langage que le dashboard : gris chauds, cartes blanches 10 px,
   libellés en capitales #b0b0aa, noir pour l'actif.
══════════════════════════════════════ */
.fil-root {
    min-height: 100vh;
    background: #f5f5f3;
}
.fil-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}
/* Deux colonnes sur grand écran : les outils à gauche, la liste à droite.
   En dessous, les outils passent au-dessus en pastilles qui reviennent à la ligne. */
.fil-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.fil-main { min-width: 0; }
.fil-layout > .fil-head { grid-column: 1 / -1; margin-bottom: 0; }
@media (min-width: 1100px) {
    .fil-layout { grid-template-columns: 216px minmax(0, 1fr); gap: 2.25rem; align-items: start; }
    .fil-side { position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; scrollbar-width: thin; }
}
.fil-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.fil-subtitle {
    font-size: 0.8rem;
    color: #8a8a84;
}
.fil-head-actions { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }
.fil-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    background: none;
    border: 0;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s ease, color 0.14s ease;
}
.fil-link-btn:hover { background: #ebebe8; color: #111; }
.fil-link-btn:disabled { opacity: 0.5; cursor: default; }
.fil-link-btn--quiet { color: #8a8a84; font-weight: 500; }
.fil-link-btn.is-on { background: #111; color: #fff; }
.fil-link-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

/* ── Tuiles d'outils ── */
/* Sur plusieurs lignes, jamais en défilement horizontal : le geste horizontal
   sert à passer des outils au Fil. */
/* ── Outils (colonne ou pastilles) ── */
.fil-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fil-nav-label { display: none; }
.fil-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.28rem 0.6rem 0.28rem 0.3rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.fil-nav-item:hover { border-color: #c9c9c4; }
.fil-nav-item.is-active { background: #111; border-color: #111; color: #fff; }
.fil-nav-item.is-quiet:not(.is-active) { color: #6b6b66; font-weight: 500; }
.fil-nav-item:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.fil-nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f2f2f0;
    font-size: 0.62rem;
    color: #6b6b66;
}
.fil-nav-icon img { width: 13px; height: 13px; object-fit: contain; }
.fil-nav-item.is-active .fil-nav-icon { background: rgba(255, 255, 255, 0.16); color: #fff; }
.fil-nav-item.is-active .fil-nav-icon img { filter: invert(1); }
.fil-nav-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-nav-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
    border-radius: 9px;
    background: #111;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fil-nav-item.is-active .fil-nav-count { background: #fff; color: #111; }
.fil-nav-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.6rem;
    background: none;
    border: 1px dashed #d4d4cf;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #8a8a84;
    cursor: pointer;
}
.fil-nav-more i { font-size: 0.55rem; }
.fil-nav-more:hover { color: #111; border-color: #b0b0aa; }
.fil-nav-more:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
@media (min-width: 1100px) {
    .fil-nav { flex-direction: column; flex-wrap: nowrap; gap: 1px; }
    .fil-nav-label { display: block; padding: 0 0.6rem; margin: 0.15rem 0 0.5rem; }
    .fil-nav-item {
        width: 100%;
        padding: 0.4rem 0.55rem;
        background: none;
        border: 0;
        border-radius: 8px;
        font-size: 0.8rem;
        gap: 0.6rem;
    }
    .fil-nav-item:hover { background: #ebebe8; }
    .fil-nav-item.is-active { background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 0 0 1px #e8e8e5; }
    .fil-nav-item.is-active .fil-nav-icon { background: #111; color: #fff; }
    .fil-nav-item.is-active .fil-nav-count { background: #111; color: #fff; }
    .fil-nav-icon { width: 24px; height: 24px; border-radius: 7px; background: #ebebe8; }
    .fil-nav-item:hover .fil-nav-icon { background: #e2e2de; }
    .fil-nav-more { margin: 0.4rem 0 0.2rem; padding: 0.35rem 0.6rem; border: 0; border-radius: 8px; justify-content: flex-start; }
    .fil-nav-more:hover { background: #ebebe8; }
}

/* ── Barre de filtres ── */
.fil-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.fil-toolbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.fil-segmented {
    display: inline-flex;
    padding: 2px;
    background: #ebebe8;
    border-radius: 8px;
}
.fil-segmented button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b6b66;
    border-radius: 6px;
    background: none;
    border: 0;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}
.fil-segmented button:hover { color: #111; }
.fil-segmented button.is-active { background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.fil-segmented button i { font-size: 0.65rem; }
.fil-menu-wrap { position: relative; }
.fil-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #e3e3df;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.14s ease, background 0.14s ease;
}
.fil-chip:hover { border-color: #c9c9c4; }
.fil-chip i { font-size: 0.6rem; color: #9a9a94; }
.fil-chip.is-set { border-color: #111; color: #111; font-weight: 600; }
.fil-chip--plain { background: none; border-color: transparent; }
.fil-chip--plain:hover { background: #ebebe8; border-color: transparent; }
.fil-chip:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.fil-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    min-width: 200px;
    padding: 0.3rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.fil-menu--right { left: auto; right: 0; }
.fil-menu--scroll { max-height: 320px; overflow-y: auto; }
.fil-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.55rem;
    font-size: 0.78rem;
    color: #374151;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.fil-menu-item:hover { background: #f5f5f3; }
.fil-menu-item.is-active { font-weight: 600; color: #111; background: #f2f2f0; }
.fil-menu-item i { color: #9a9a94; font-size: 0.72rem; }
.fil-menu-item input { accent-color: #111; }
.fil-menu-dates {
    display: grid;
    gap: 0.4rem;
    padding: 0.5rem 0.55rem 0.4rem;
    border-top: 1px solid #f0f0ed;
    margin-top: 0.25rem;
}
.fil-menu-dates label { display: grid; gap: 0.2rem; font-size: 0.68rem; color: #8a8a84; }

/* ── Pastille « nouvelles » ── */
.fil-fresh {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 auto 0.75rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

/* ── Liste ── */
.fil-list.is-refreshing { opacity: 0.55; transition: opacity 0.15s ease; }
.fil-day { margin-bottom: 1.5rem; }
.fil-day-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin-bottom: 0.6rem;
}
.fil-day-label::first-letter { text-transform: uppercase; }
.fil-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    overflow: hidden;
}
.fil-row + .fil-row { border-top: 1px solid #f0f0ed; }
.fil-row-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.12s ease;
}
.fil-row-main:hover { background: #fafaf8; }
.fil-row-main:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.fil-row-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.fil-row-body { min-width: 0; flex: 1; }
/* L'heure à droite, en colonne : on parcourt la journée d'un coup d'œil. */
.fil-row-time {
    flex-shrink: 0;
    max-width: 8rem;
    padding-top: 0.2rem;
    font-size: 0.7rem;
    color: #9a9a94;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.fil-row.is-read .fil-row-time { color: #b0b0aa; }
.fil-row-when { display: none; }
@media (max-width: 640px) {
    .fil-row-time { display: none; }
    .fil-row-when { display: inline-flex; align-items: center; gap: 0.35rem; }
}
.fil-row-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #111;
    font-weight: 500;
}
.fil-row.is-read .fil-row-text { color: #4b4b47; font-weight: 400; }
.fil-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: #9a9a94;
}
/* Avant → après sous la ligne */
.fil-changes {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.35rem;
}
.fil-changes li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #4b4b47;
    min-width: 0;
}
.fil-changes li i { font-size: 0.55rem; color: #b0b0aa; }
.fil-change-name { font-weight: 600; color: #6b6b66; }
.fil-change-from { color: #9a9a94; text-decoration: line-through; text-decoration-color: #d4d4cf; overflow-wrap: anywhere; }
.fil-change-to { color: #111; overflow-wrap: anywhere; }
.fil-change-more { color: #9a9a94; }
.fil-occ-change { display: block; font-size: 0.72rem; color: #8a8a84; overflow-wrap: anywhere; }
.fil-row-tool { display: inline-flex; align-items: center; gap: 0.3rem; color: #6b6b66; font-weight: 500; }
.fil-row-tool img { width: 12px; height: 12px; object-fit: contain; }
.fil-dot { color: #c9c9c4; }
.fil-row-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.05rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #374151;
    background: #f2f2f0;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
.fil-row-count:hover { background: #e8e8e5; }
.fil-row-count i { font-size: 0.55rem; color: #8a8a84; }
.fil-row-muted { display: inline-flex; align-items: center; gap: 0.25rem; color: #9a9a94; }
.fil-row.is-muted .fil-row-icon,
.fil-row.is-muted .fil-row-text { opacity: 0.55; }
.fil-read-toggle {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
.fil-read-toggle span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    transition: background 0.14s ease, border-color 0.14s ease;
}
.fil-read-toggle.is-unread span { background: #2563eb; }
/* Une ligne coupée n'a pas sonné : son « non lu » ne réclame rien. */
.fil-row.is-muted .fil-read-toggle.is-unread span { background: #c9c9c4; }
.fil-read-toggle:hover { background: #f2f2f0; }
.fil-read-toggle:not(.is-unread):hover span { border-color: #9a9a94; }
.fil-read-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

/* ── Détail d'une ligne regroupée ── */
.fil-occ {
    padding: 0 1rem 0.85rem 3.7rem;
}
.fil-occ-list {
    border-left: 2px solid #f0f0ed;
    padding-left: 0.85rem;
    display: grid;
    gap: 0.4rem;
}
.fil-occ-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.78rem;
    color: #4b4b47;
}
.fil-occ-time { flex-shrink: 0; font-size: 0.7rem; color: #9a9a94; }
.fil-occ-more { margin-top: 0.4rem; margin-left: 0.6rem; }
.fil-occ-note {
    margin-top: 0.4rem;
    padding-left: 0.85rem;
    font-size: 0.7rem;
    color: #9a9a94;
}

.fil-empty {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    padding: 2.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #8a8a84;
    display: grid;
    justify-items: center;
    gap: 0.6rem;
}
.fil-empty-icon { font-size: 1.4rem; color: #d4d4cf; }
.fil-sentinel { height: 1px; }
.fil-more { text-align: center; padding: 1rem; color: #b0b0aa; }

/* ── Réglages de la cloche ── */
.fil-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin-bottom: 0.45rem;
}
.fil-settings {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    padding: 1rem 1.1rem 1.1rem;
    margin-bottom: 1.1rem;
}
.fil-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}
.fil-settings-hint { font-size: 0.78rem; color: #6b6b66; line-height: 1.45; }
.fil-settings-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2rem;
}
.fil-icon-btn {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 6px;
    color: #9a9a94;
    cursor: pointer;
}
.fil-icon-btn:hover { background: #f2f2f0; color: #111; }
.fil-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.4rem 0.45rem;
    background: none;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
}
.fil-switch-row:hover { background: #f5f5f3; }
.fil-switch-row:disabled { opacity: 0.6; cursor: progress; }
.fil-switch-row:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.fil-switch-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #374151;
    min-width: 0;
}
.fil-switch-name i { color: #9a9a94; font-size: 0.72rem; }
.fil-switch-name img { width: 14px; height: 14px; object-fit: contain; }
.fil-switch {
    position: relative;
    width: 28px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 999px;
    background: #d4d4cf;
    transition: background 0.16s ease;
}
.fil-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.16s ease;
}
.fil-switch.is-on { background: #111; }
.fil-switch.is-on::after { transform: translateX(12px); }

/* ── À traiter ── */
.fil-todo {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-left: 3px solid #111;
    border-radius: 10px;
    margin-bottom: 1.1rem;
    overflow: hidden;
}
.fil-todo-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
}
.fil-todo-head:hover { background: #fafaf8; }
.fil-todo-head:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.fil-todo-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}
.fil-todo-title i { font-size: 0.7rem; }
.fil-todo-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #111;
    color: #fff;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fil-todo-hint { flex: 1; min-width: 0; font-size: 0.72rem; color: #9a9a94; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-todo-chevron { margin-left: auto; font-size: 0.6rem; color: #9a9a94; }
.fil-todo-list { border-top: 1px solid #f0f0ed; }
.fil-todo-list li + li { border-top: 1px solid #f5f5f3; }
.fil-todo-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 1rem;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
}
.fil-todo-row:hover { background: #fafaf8; }
.fil-todo-row:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.fil-row-icon--sm { width: 24px; height: 24px; font-size: 0.62rem; margin-top: 0; }
.fil-todo-text { min-width: 0; font-size: 0.8rem; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-todo-meta { font-size: 0.68rem; color: #9a9a94; white-space: nowrap; }
.fil-todo-more { margin: 0 0.5rem 0.5rem auto; display: flex; }
.fil-todo-more i { font-size: 0.6rem; }

/* ── Menu d'une ligne ── */
.fil-row-more {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-radius: 6px;
    color: #9a9a94;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
}
.fil-row-main:hover .fil-row-more,
.fil-row-more:focus-visible,
.fil-row-more.is-open { opacity: 1; }
.fil-row-more:hover, .fil-row-more.is-open { background: #f2f2f0; color: #111; }
.fil-row-more:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
@media (hover: none) { .fil-row-more { opacity: 1; } }
.fil-row-menu {
    position: fixed;
    z-index: 60;
    padding: 0.3rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.fil-row-menu-sep { height: 1px; margin: 0.25rem 0.3rem; background: #f0f0ed; }
.fil-chip-count {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Filtres du téléphone : feuille du bas ── */
.fil-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(17, 17, 17, 0.35);
    display: flex;
    align-items: flex-end;
}
.fil-sheet {
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: #f5f5f3;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
    padding-bottom: env(safe-area-inset-bottom);
}
.fil-sheet-grip { width: 36px; height: 4px; margin: 0.6rem auto 0.2rem; border-radius: 2px; background: #d4d4cf; }
.fil-sheet-body { overflow-y: auto; padding: 0.6rem 1rem 1rem; }
.fil-sheet-body .fil-label { margin-top: 0.9rem; }
.fil-sheet-options { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fil-sheet-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: #374151;
    background: #fff;
    border: 1px solid #e3e3df;
    border-radius: 8px;
    cursor: pointer;
}
.fil-sheet-option i { font-size: 0.7rem; color: #9a9a94; }
.fil-sheet-option.is-active { border-color: #111; box-shadow: inset 0 0 0 1px #111; color: #111; font-weight: 600; }
.fil-sheet-dates { border-top: 0; padding: 0.6rem 0 0; grid-template-columns: 1fr 1fr; }
.fil-sheet-select { width: 100%; }
.fil-sheet-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e8e8e5;
}
.fil-sheet-done {
    padding: 0.55rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
/* Le Fil : abonnements (NotificationSubscriptions) */
.fil-settings-hint--tab { margin-bottom: 0.9rem; }
.fil-row-via { display: inline-flex; align-items: center; gap: 0.25rem; color: #6b6b66; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-row-via i, .fil-rules-add i { font-size: 0.65rem; }
.fil-rules .fil-settings-hint { margin-bottom: 0.8rem; }
.fil-rules-note { font-size: 0.8rem; color: #9a9a94; padding: 0.4rem 0; }
.fil-rules-list { list-style: none; margin: 0 0 0.6rem; padding: 0; border-top: 1px solid #f0f0ed; }
.fil-rule {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.2rem;
    border-bottom: 1px solid #f0f0ed;
}
.fil-rule.is-off .fil-rule-name, .fil-rule.is-off .fil-rule-meta { color: #b0b0aa; }
.fil-rule-body { flex: 1; min-width: 0; }
.fil-rule-name {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0;
    background: none;
    border: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
    text-align: left;
    cursor: text;
}
.fil-rule-name i { font-size: 0.6rem; color: #c4c4be; opacity: 0; transition: opacity 0.12s ease; }
.fil-rule-name:hover i, .fil-rule-name:focus-visible i { opacity: 1; }
.fil-rules-views { margin-bottom: 0.8rem; }
.fil-rule.is-editing { background: #fafaf8; }
.fil-rule-owner { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.15rem; font-size: 0.72rem; font-weight: 600; color: #6b6b66; }
.fil-rule-owner i { font-size: 0.6rem; color: #b0b0aa; }
.fil-rule-off { padding: 0.05rem 0.4rem; border-radius: 999px; background: #fdecea; color: #b42318; font-weight: 600; }
.fil-rule-name--fixed { cursor: default; }
.fil-rule-form-title { font-size: 0.8rem; font-weight: 600; color: #111; }
.fil-rule-meta { margin-top: 0.15rem; font-size: 0.74rem; color: #6b6b66; line-height: 1.4; }
.fil-rule-switch { display: inline-flex; padding: 0.3rem; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.fil-rule-switch:disabled { opacity: 0.6; cursor: progress; }
.fil-rule-switch:focus-visible { outline: 2px solid #2563eb; }
.fil-rule-delete { white-space: nowrap; }
.fil-rule-delete.is-confirm { color: #b42318; }
.fil-rule-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem;
    margin-bottom: 0.6rem;
    background: #fafaf8;
    border: 1px solid #ececea;
    border-radius: 9px;
}
.fil-rule-field { display: flex; flex-direction: column; min-width: 0; }
.fil-rule-field .fil-label { margin-bottom: 0.3rem; }
.fil-rule-field .admin-tool-input { width: 100%; font-size: 0.8rem; }
.fil-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1rem; }
.fil-rule-entity-box { position: relative; display: flex; align-items: center; gap: 0.25rem; }
.fil-rule-entity-list { top: calc(100% + 4px); left: 0; right: 0; list-style: none; padding-left: 0; }
.fil-rule-error { font-size: 0.78rem; color: #b42318; }
.fil-rule-actions { display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem; }
.fil-rule-actions .fil-sheet-done:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 640px) {
    .fil-rule-grid { grid-template-columns: 1fr; }
    .fil-rule { flex-wrap: wrap; }
    .fil-rule-body { flex-basis: 100%; }
}
/* ── Réglages : tiroir à droite ── */
.fil-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(17, 17, 17, 0.28);
}
.fil-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(620px, 100vw);
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 0;
    border-left: 1px solid #e8e8e5;
    border-radius: 0;
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.12);
}
.fil-drawer-head {
    flex-shrink: 0;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid #f0f0ed;
}
.fil-drawer-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.fil-drawer-title { font-size: 0.95rem; font-weight: 700; color: #111; }
.fil-drawer-tabs { margin-top: 0.8rem; }
.fil-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.25rem 2rem; }
.fil-drawer .fil-settings-hint--tab { margin-bottom: 1rem; }
.fil-drawer-enter-active, .fil-drawer-leave-active { transition: opacity 0.2s ease; }
.fil-drawer-enter-active .fil-drawer, .fil-drawer-leave-active .fil-drawer { transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fil-drawer-enter-from, .fil-drawer-leave-to { opacity: 0; }
.fil-drawer-enter-from .fil-drawer, .fil-drawer-leave-to .fil-drawer { transform: translateX(100%); }
@media (prefers-reduced-motion: reduce) {
    .fil-drawer-enter-active, .fil-drawer-leave-active,
    .fil-drawer-enter-active .fil-drawer, .fil-drawer-leave-active .fil-drawer { transition: none; }
}
@media (max-width: 640px) {
    .fil-drawer { border-left: 0; }
    .fil-drawer-head { padding: 0.9rem 1rem 0.75rem; }
    .fil-drawer-body { padding: 0.9rem 1rem 2rem; }
}
.fil-sheet-enter-active, .fil-sheet-leave-active { transition: opacity 0.2s ease; }
.fil-sheet-enter-active .fil-sheet, .fil-sheet-leave-active .fil-sheet { transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fil-sheet-enter-from, .fil-sheet-leave-to { opacity: 0; }
.fil-sheet-enter-from .fil-sheet, .fil-sheet-leave-to .fil-sheet { transform: translateY(100%); }
@media (prefers-reduced-motion: reduce) {
    .fil-sheet-enter-active, .fil-sheet-leave-active,
    .fil-sheet-enter-active .fil-sheet, .fil-sheet-leave-active .fil-sheet { transition: none; }
}

@media (max-width: 640px) {
    .fil-container { padding: 1.5rem 1rem 3rem; }
    .fil-head { align-items: flex-start; flex-direction: column; gap: 0.35rem; }
    .fil-head-actions { margin-left: -0.5rem; }
    .fil-settings-cols { grid-template-columns: 1fr; }
    .fil-todo-hint { display: none; }
    .fil-todo-row { grid-template-columns: auto 1fr; }
    .fil-todo-meta { grid-column: 2; margin-top: -0.35rem; }
    /* Pastilles d'outils resserrées : plusieurs outils n'ont pas d'icône propre, le nom reste. */
    .fil-nav { gap: 0.3rem; }
    .fil-nav-item, .fil-nav-more { font-size: 0.72rem; }
    .fil-occ { padding-left: 1rem; }
    .fil-occ-item { flex-direction: column; gap: 0.1rem; }
}

/* ── Grille admin ── */
.dash-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
@media (max-width: 768px) {
    .dash-admin-grid { grid-template-columns: 1fr; }
}

/* ── Carte admin ── */
.admin-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.admin-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.07);
    transform: translateY(-2px);
}
.admin-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.admin-card-text {
    flex: 1;
    min-width: 0;
}
.admin-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}
.admin-card-desc {
    font-size: 0.73rem;
    color: #aaa;
    margin-top: 2px;
}
.admin-card-arrow {
    font-size: 0.7rem;
    color: #d0d0cc;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.admin-card:hover .admin-card-arrow {
    color: #888;
    transform: translateX(3px);
}

/* ══════════════════════════════════════
   Admin panels (Sociétés / Utilisateurs)
══════════════════════════════════════ */
.adm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}
.adm-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    transition: color 0.15s;
    flex-shrink: 0;
}
.adm-back:hover {
    color: #111;
}
.adm-tabs {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.25rem;
    background: #ececea;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}
.adm-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.adm-tab i {
    font-size: 0.72rem;
}
.adm-tab:hover {
    color: #444;
}
.adm-tab--active {
    background: #fff;
    color: #111;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.adm-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}
.adm-search-wrap {
    flex: 1;
    min-width: 180px;
    position: relative;
}
.adm-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: #bbb;
    pointer-events: none;
}
.adm-search {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2rem;
    font-size: 0.82rem;
    color: #111;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 9px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.adm-search:focus {
    border-color: #c5c5c0;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.adm-select {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    color: #333;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 9px;
    outline: none;
    cursor: pointer;
}
.adm-select:focus {
    border-color: #c5c5c0;
}
.adm-sort-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 9px;
    color: #666;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.adm-sort-btn:hover {
    background: #f8f8f6;
    color: #111;
}
.adm-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.12s;
}
.adm-btn-primary:hover {
    background: #333;
}
.adm-btn-primary i {
    font-size: 0.72rem;
}
.adm-count {
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 0.75rem;
}
.adm-count strong {
    color: #666;
    font-weight: 600;
}
.adm-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (max-width: 720px) {
    .adm-card-grid { grid-template-columns: 1fr; }
}
.adm-company-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.adm-company-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}
.adm-company-card-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.75rem;
}
.adm-company-card-body {
    flex: 1;
    min-width: 0;
}
.adm-entity-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    margin-bottom: 0.35rem;
}
.adm-entity-sub {
    font-size: 0.73rem;
    color: #aaa;
    margin-top: 0.15rem;
}
.adm-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.01em;
}
.adm-badge--administrator { background: #f3e8ff; color: #7c3aed; }
.adm-badge--client { background: #eff6ff; color: #2563eb; }
.adm-badge--thirdparty { background: #f0fdf4; color: #16a34a; }
.adm-badge--super_admin { background: #faf5ff; color: #9333ea; }
.adm-badge--company_admin { background: #eff6ff; color: #2563eb; }
.adm-badge--user { background: #f4f4f2; color: #666; }
.adm-company-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f0f0ed;
    padding: 0.55rem 1.1rem;
    min-height: 42px;
}
.adm-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.73rem;
    color: #888;
}
.adm-stat-pill i {
    font-size: 0.68rem;
    color: #bbb;
}
.adm-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.adm-icon-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: #aaa;
    cursor: pointer;
    font-size: 0.78rem;
    transition: background 0.12s, color 0.12s;
}
.adm-icon-btn:hover {
    background: #f4f4f2;
    color: #333;
}
.adm-icon-btn--blue:hover { color: #2563eb; background: #eff6ff; }
.adm-icon-btn--green:hover { color: #16a34a; background: #f0fdf4; }
.adm-icon-btn--red:hover { color: #dc2626; background: #fef2f2; }
.adm-icon-btn:disabled,
.adm-icon-btn--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
.adm-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.adm-user-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.85rem 1.1rem;
    transition: box-shadow 0.18s ease;
}
.adm-user-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}
.adm-user-avatar,
.adm-user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}
.adm-user-avatar-img {
    object-fit: cover;
    border: 1px solid #ececea;
    background: #f8f8f6;
}
.adm-user-avatar {
    background: #f2f2f0;
    color: #555;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
    border: 1px solid #ececea;
}
.adm-user-body {
    flex: 1;
    min-width: 0;
    padding-top: 0.05rem;
}
.adm-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
}
.adm-user-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.adm-user-meta {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: #888;
}
.adm-badge--pending {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #c2410c;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.adm-user-card--pending {
    border-color: #fed7aa;
    background: #fffaf5;
}
.adm-badge--inactive {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #f5f5f5;
    border: 1px solid #d4d4d4;
    color: #525252;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.adm-user-card--inactive {
    border-color: #e5e5e5;
    background: #fafafa;
    opacity: 0.92;
}
.adm-select--filter {
    min-width: 190px;
    max-width: 220px;
}
.adm-user-email {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.adm-user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}
.adm-company-tag {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 100%;
    padding: 0.18rem 0.1rem 0.18rem 0.55rem;
    background: #f4f4f2;
    border: 1px solid #ececea;
    border-radius: 999px;
    font-size: 0.72rem;
    line-height: 1.35;
}
.adm-company-tag-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}
.adm-company-tag-role {
    font-size: 0.65rem;
    font-weight: 500;
    color: #888;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem 0.1rem 0.35rem;
    border-left: 1px solid #ddd;
    white-space: nowrap;
}
.adm-company-tag--super_admin {
    background: #faf5ff;
    border-color: #ede9fe;
}
.adm-company-tag--super_admin .adm-company-tag-role {
    color: #7c3aed;
    border-left-color: #e9d5ff;
}
.adm-company-tag--company_admin {
    background: #eff6ff;
    border-color: #dbeafe;
}
.adm-company-tag--company_admin .adm-company-tag-role {
    color: #2563eb;
    border-left-color: #bfdbfe;
}
.adm-user-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    padding-top: 0.1rem;
}
.adm-text-btn {
    font-size: 0.75rem;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.adm-text-btn--edit {
    color: #555;
}
.adm-text-btn--edit:hover {
    background: #f4f4f2;
    color: #111;
}
.adm-text-btn--delete {
    color: #ccc;
}
.adm-text-btn--delete:hover:not(:disabled) {
    background: #fef2f2;
    color: #dc2626;
}
.adm-text-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.adm-loading {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    padding: 2.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #aaa;
}
@media (max-width: 640px) {
    .adm-user-card {
        flex-wrap: wrap;
    }
    .adm-user-actions {
        width: 100%;
        padding-left: calc(40px + 0.875rem);
        justify-content: flex-end;
    }
}

/* ── Modals admin ── */
.adm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 17, 17, 0.45);
    backdrop-filter: blur(2px);
}
.adm-modal {
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.adm-modal--wide {
    max-width: 36rem;
}
.adm-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem 0;
}
.adm-modal-eyebrow {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin-bottom: 0.25rem;
}
.adm-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.adm-modal-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f4f4f2;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.adm-modal-close:hover {
    background: #ececea;
    color: #333;
}
.adm-modal-body {
    padding: 1.1rem 1.35rem 1.35rem;
}
.adm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0 1.35rem 1.35rem;
}
.adm-field {
    margin-bottom: 0.9rem;
}
.adm-field:last-child {
    margin-bottom: 0;
}
.adm-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}
.adm-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 520px) {
    .adm-field-row { grid-template-columns: 1fr; }
}
.adm-input,
.adm-select-full {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.84rem;
    color: #111;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 9px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.adm-input:focus,
.adm-select-full:focus {
    border-color: #c5c5c0;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}
.adm-input:disabled {
    background: #f8f8f6;
    color: #888;
}
.adm-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin: 1rem 0 0.6rem;
}
.adm-btn-secondary {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.adm-btn-secondary:hover {
    background: #f8f8f6;
    color: #111;
}
.adm-membership-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem;
    background: #fafaf8;
    border: 1px solid #ececea;
    border-radius: 9px;
    margin-bottom: 0.45rem;
}
.adm-membership-row .adm-select-full {
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
}
.adm-membership-row .adm-select-full--role {
    width: 9.5rem;
    flex-shrink: 0;
}
.adm-membership-add {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
}
.adm-readonly-chip {
    padding: 0.6rem 0.75rem;
    font-size: 0.84rem;
    color: #444;
    background: #f4f4f2;
    border: 1px solid #ececea;
    border-radius: 9px;
}
.adm-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    background: #faf5ff;
    border: 1px solid #f3e8ff;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #5b21b6;
    cursor: pointer;
}
.adm-checkbox-row input {
    width: 15px;
    height: 15px;
    accent-color: #7c3aed;
}
.adm-type-picker {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.adm-type-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    width: 100%;
    padding: 0.75rem 0.85rem;
    text-align: left;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.adm-type-option:hover {
    border-color: #d8d8d4;
    background: #fafaf8;
}
.adm-type-option--active {
    border-color: #111;
    background: #fafaf8;
    box-shadow: 0 0 0 1px #111;
}
.adm-type-option-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #111;
}
.adm-type-option-hint {
    font-size: 0.72rem;
    color: #999;
    line-height: 1.35;
}
.adm-type-readonly {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: #f4f4f2;
    border-radius: 9px;
    font-size: 0.82rem;
    color: #444;
}

/* ── Modal outils (permissions) ── */
.adm-modal--tools {
    max-width: 28rem;
}
.adm-tools-summary {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.75rem;
}
.adm-tools-summary strong {
    color: #555;
    font-weight: 600;
}
.adm-tools-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    padding-right: 0.15rem;
}
.adm-tool-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.7rem;
    background: #fafaf8;
    border: 1px solid #ececea;
    border-radius: 9px;
    transition: background 0.12s, border-color 0.12s;
}
.adm-tool-row--on {
    background: #fff;
    border-color: #e0e0dc;
}
.adm-tool-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: #f2f2f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.adm-tool-row--on .adm-tool-row-icon {
    background: #eff6ff;
}
.adm-tool-row-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
.adm-tool-row-icon i {
    font-size: 0.78rem;
    color: #888;
}
.adm-tool-row-body {
    flex: 1;
    min-width: 0;
}
.adm-tool-row-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #111;
    line-height: 1.25;
}
.adm-tool-row .switch {
    flex-shrink: 0;
    transform: scale(0.92);
}

/* ── Page profil ── */
.dash-container--profile {
    max-width: 720px;
}
.adm-header--profile {
    align-items: flex-start;
    margin-bottom: 1.6rem;
}
.adm-header--profile .dash-section-label {
    margin-bottom: 0.35rem;
}
.prof-header-text {
    min-width: 0;
}
.prof-page-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: #111;
    line-height: 1.15;
    margin: 0 0 0.4rem;
}
.prof-page-lead {
    font-size: 0.88rem;
    color: #777;
    line-height: 1.5;
    max-width: 38rem;
    margin: 0;
}
.prof-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.prof-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
}
.prof-card-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin-bottom: 0.9rem;
}
.prof-card-lead {
    font-size: 0.82rem;
    color: #888;
    line-height: 1.45;
    margin: -0.35rem 0 0.9rem;
}
.prof-avatar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.prof-avatar {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #e8e8e5;
    flex-shrink: 0;
}
.prof-avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}
.prof-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}
.prof-avatar-actions {
    flex: 1;
    min-width: 0;
}
.prof-avatar-hint {
    font-size: 0.72rem;
    color: #aaa;
    margin-top: 0.35rem;
}
.prof-affiliations {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.prof-affiliation-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #ececea;
    border-radius: 9px;
    background: #fafaf8;
    font-size: 0.82rem;
}
.prof-affiliation-row--active {
    background: #eff6ff;
    border-color: #dbeafe;
}
.prof-affiliation-name {
    font-weight: 600;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prof-affiliation-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.prof-affiliation-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #2563eb;
}
.prof-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.25rem;
}

.prof-card--signature {
    margin-top: 1.35rem;
}
.prof-sig-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}
.prof-sig-head .prof-card-title {
    margin-bottom: 0.4rem;
}
.prof-sig-lead {
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.4;
    margin: 0;
    max-width: 28rem;
    font-weight: 400;
}
.prof-sig-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: #f4f4f1;
    color: #888;
    white-space: nowrap;
}
.prof-sig-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.prof-sig-status--empty { color: #8a8a84; background: #f4f4f1; }
.prof-sig-status--saved { color: #2d6a4f; background: #eef6f1; }
.prof-sig-status--dirty { color: #8a6414; background: #f8f1de; }

/* Mes données (RGPD) : export, appareils connectés, suppression du compte */
.prof-data-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.prof-data-link { font-size: 0.82rem; font-weight: 500; color: #1a1a1a; text-decoration: underline; }
.prof-data-note { margin-top: 0.75rem; font-size: 0.78rem; color: #8a6414; }
.prof-data-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.prof-sessions { display: flex; flex-direction: column; gap: 0.4rem; }
.prof-session {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #efefec;
    border-radius: 10px;
}
.prof-session-icon { width: 1.25rem; text-align: center; color: #9a9a94; }
.prof-session-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.prof-session-device { font-size: 0.85rem; font-weight: 600; color: #1a1a1a; display: flex; align-items: center; gap: 0.5rem; }
.prof-session-current {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    color: #2d6a4f;
    background: #eef6f1;
}
.prof-session-meta { font-size: 0.75rem; color: #8a8a84; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-card--danger { border-color: #f1dcd8; }
.prof-deletion-pending { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; font-weight: 600; color: #8a6414; margin-bottom: 0.6rem; }

/* Fiche d'un compte, Administration : anonymisation RGPD */
.adm-anonymize {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid #ecebe7;
    border-radius: 12px;
    background: #fafaf8;
}
.adm-anonymize.is-requested { border-color: #f0d9a8; background: #fdf8ec; }
.adm-anonymize-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; color: #1a1a1a; }
.adm-anonymize.is-requested .adm-anonymize-title { color: #8a6414; }
.adm-anonymize-reason { margin-top: 0.4rem; font-size: 0.82rem; color: #4b4b46; font-style: italic; }
.adm-anonymize-lead { margin: 0.45rem 0 0.7rem; font-size: 0.76rem; line-height: 1.45; color: #8a8a84; }
.adm-anonymize-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.adm-anonymize-row .adm-input { flex: 1 0 100%; min-width: 0; }
.prof-sig-pad {
    position: relative;
    height: 176px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.2)),
        repeating-linear-gradient(
            180deg,
            transparent 0,
            transparent 27px,
            rgba(0, 0, 0, 0.035) 27px,
            rgba(0, 0, 0, 0.035) 28px
        ),
        #fafaf6;
    border: 1px solid #e4e4de;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
}
.prof-sig-pad::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 36%;
    border-bottom: 1px dashed #d2d2c8;
    pointer-events: none;
}
.prof-sig-pad canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}
.prof-sig-pad-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: #b5b5ab;
    font-size: 0.82rem;
    font-style: italic;
    pointer-events: none;
    z-index: 0;
}
.prof-sig-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
}
.prof-sig-actions .adm-btn-primary {
    margin-left: auto;
}
.adm-btn-ghost-danger {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #b42318;
    background: #fff;
    border: 1px solid #f0d4d0;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.adm-btn-ghost-danger:hover:not(:disabled) {
    background: #fef4f2;
    color: #912018;
}
.adm-btn-ghost-danger:disabled,
.prof-sig-actions .adm-btn-secondary:disabled,
.prof-sig-actions .adm-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
@media (max-width: 560px) {
    .prof-sig-head {
        flex-direction: column;
    }
    .prof-sig-actions .adm-btn-primary {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* ══════════════════════════════════════
   Updates
══════════════════════════════════════ */
.dash-container--whats-new {
    max-width: 1120px;
}
.wn-toolbar {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 12px;
    padding: 0.9rem 1rem 1rem;
    margin-bottom: 0.85rem;
}
.wn-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.wn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem 0.32rem 0.45rem;
    border: 1px solid #e8e8e5;
    border-radius: 999px;
    background: #fafaf8;
    color: #555;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.wn-chip:hover {
    border-color: #d0d0cb;
    background: #fff;
    color: #111;
}
.wn-chip--active {
    background: #111;
    border-color: #111;
    color: #fff;
}
.wn-chip-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}
.wn-chip--active .wn-chip-icon {
    filter: invert(1);
}
.wn-chip-fa {
    width: 16px;
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.7;
}
.wn-chip--active .wn-chip-fa {
    opacity: 1;
}
.wn-dates {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding-top: 0.8rem;
    border-top: 1px solid #f0f0ed;
}
.wn-dates-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b0b0aa;
    flex-shrink: 0;
}
.wn-dates-fields {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}
.wn-date-field {
    width: 7.6rem !important;
    flex: 0 0 7.6rem;
}
.wn-dates-sep {
    color: #ccc;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.wn-dates-clear {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    background: #fff;
    color: #888;
    cursor: pointer;
}
.wn-dates-clear:hover {
    color: #111;
    border-color: #d0d0cb;
}
.wn-table-wrap {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 12px;
    overflow: hidden;
}
.wn-table-scroll {
    overflow-x: auto;
}
.wn-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.wn-table th {
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b0b0aa;
    background: #fafaf8;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #e8e8e5;
    white-space: nowrap;
}
.wn-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f0f0ed;
    vertical-align: top;
    color: #333;
}
.wn-table tbody tr:last-child td {
    border-bottom: none;
}
.wn-table tbody tr:hover {
    background: #fafaf8;
}
.wn-table-date {
    width: 6.5rem;
    white-space: nowrap;
    color: #888;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
}
.wn-table-tool {
    width: 12rem;
}
.wn-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.18rem 0.55rem 0.18rem 0.35rem;
    border-radius: 999px;
    background: #f4f4f1;
    color: #555;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.wn-tool + .wn-tool {
    margin-left: 0.25rem;
}
.wn-tool-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}
.wn-tool-fa {
    width: 14px;
    text-align: center;
    font-size: 0.65rem;
    color: #999;
}
.wn-table-title {
    font-weight: 600;
    color: #111;
    min-width: 16rem;
    line-height: 1.4;
}
.wn-table-detail {
    color: #666;
    line-height: 1.45;
    min-width: 18rem;
}
.wn-empty {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 12px;
    padding: 2.25rem 1.25rem;
    text-align: center;
    color: #888;
    font-size: 0.88rem;
}
.wn-table-wrap .px-4.py-3 {
    border-top: 1px solid #f0f0ed;
    background: #fafaf8;
}

/* ══════════════════════════════════════
   Auth (login, register, forgot password)
══════════════════════════════════════ */
.auth-root {
    min-height: 100vh;
    background: #f5f5f3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.auth-shell {
    width: 100%;
    max-width: 400px;
}
.auth-shell-wide {
    max-width: 440px;
}
.auth-brand {
    display: block;
    text-align: center;
    margin-bottom: 1.75rem;
    text-decoration: none;
}
.auth-brand:hover {
    opacity: 0.85;
}
.auth-logo {
    height: 28px;
    width: auto;
    display: inline-block;
}
.auth-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    padding: 1.75rem 1.75rem 1.5rem;
}
.auth-card-center {
    text-align: center;
    padding: 2rem 1.75rem 1.75rem;
}
.auth-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin: 0 0 0.35rem;
}
.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    margin: 0 0 1.25rem;
    line-height: 1.25;
}
.auth-card-center .auth-title {
    margin-bottom: 0.65rem;
}
.auth-lead {
    font-size: 0.875rem;
    color: #888;
    line-height: 1.55;
    margin: -0.5rem 0 1.25rem;
}
.auth-lead-center {
    margin: 0 0 1.5rem;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 400px) {
    .auth-row-2 { grid-template-columns: 1fr; }
}
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.auth-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #999;
}
.auth-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    color: #111;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 7px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    box-sizing: border-box;
}
.auth-input:focus {
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.auth-input::placeholder {
    color: #c5c5c0;
}
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    line-height: 1.2;
}
.auth-btn-primary {
    width: 100%;
    background: #111;
    color: #fff;
    margin-top: 0.25rem;
}
.auth-btn-primary:hover:not(:disabled) {
    background: #333;
}
.auth-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.auth-btn-block {
    display: flex;
    width: 100%;
}
.auth-alert {
    font-size: 0.8125rem;
    line-height: 1.45;
    padding: 0.65rem 0.75rem;
    border-radius: 7px;
}
.auth-alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.auth-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid #f0f0ed;
}
.auth-links-single {
    justify-content: center;
}
.auth-legal {
    margin-top: 1rem;
    text-align: center;
}
.auth-legal .auth-link {
    font-size: 0.75rem;
    color: #aaa;
}
.auth-links-sep {
    color: #ddd;
    font-size: 0.75rem;
    user-select: none;
}
.auth-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    transition: color 0.14s;
}
.auth-link:hover {
    color: #111;
}
.auth-link-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.auth-link-back i {
    font-size: 0.7rem;
}
/* Connexion : sélecteur de langue et saisie du code reçu par mail. */
.auth-card-login {
    position: relative;
}
.auth-lang {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: #f5f5f2;
    border: 1px solid #ecece8;
    border-radius: 999px;
}
.auth-lang-btn {
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #999;
    background: transparent;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.auth-lang-btn:hover {
    color: #111;
}
.auth-lang-btn--active {
    background: #111;
    color: #fff;
}
.auth-lang-btn--active:hover {
    color: #fff;
}
.auth-hint {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #888;
    margin: -0.25rem 0 0;
}
.auth-input-code {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-align: center;
    padding-left: calc(0.75rem + 0.5em);
    font-variant-numeric: tabular-nums;
}
.auth-success-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #f0fdf4;
    color: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* ══════════════════════════════════════
   Admin tools — shell partagé (admin-tool-*)
══════════════════════════════════════ */
.admin-tool-root {
    min-height: calc(100vh - var(--app-header-h));
    background: #f5f5f3;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.admin-tool-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2.5rem;
}
.admin-tool-nav {
    margin-bottom: 1.25rem;
}
.admin-tool-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
}
.admin-tool-tabs-divider {
    width: 1px;
    height: 1.35rem;
    margin: 0 0.15rem;
    background: #e8e8e5;
    flex-shrink: 0;
}
.admin-tool-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #888 !important;
    background: transparent !important;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
    white-space: nowrap;
    box-shadow: none;
}
.admin-tool-tab i {
    font-size: 0.75rem;
    opacity: 0.75;
    color: inherit;
}
.admin-tool-tab:hover:not(.is-active):not(.admin-tool-tab-cta) {
    background: #f2f2f0 !important;
    color: #333 !important;
}
.admin-tool-tab.is-active {
    background: #111 !important;
    color: #fff !important;
    font-weight: 600;
}
.admin-tool-tab.is-active i {
    opacity: 1;
}
.admin-tool-tab-cta {
    background: #111 !important;
    color: #fff !important;
    font-weight: 600;
}
.admin-tool-tab-cta i {
    opacity: 1;
}
.admin-tool-tab-cta:hover {
    background: #333 !important;
    color: #fff !important;
}
.admin-tool-subtabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.3rem;
    background: #f2f2f0;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
}
.co-mailchimp-kpis + .admin-tool-subtabs {
    margin-bottom: 1rem;
}
.admin-tool-tab-count {
    font-size: 0.6875rem;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}
.admin-tool-tab.is-active .admin-tool-tab-count {
    opacity: 0.9;
}
.admin-tool-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.14s;
    white-space: nowrap;
}
.admin-tool-btn-primary:hover:not(:disabled) {
    background: #333;
}
.admin-tool-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.admin-tool-btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}
.admin-tool-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #555;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s;
}
.admin-tool-btn-secondary:hover:not(:disabled) {
    background: #fafaf8;
    border-color: #ccc;
    color: #111;
}
.admin-tool-btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.admin-tool-alert {
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.8125rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.admin-tool-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.admin-tool-alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.admin-tool-alert-dismiss {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0.25rem;
}
.admin-tool-alert-dismiss:hover {
    opacity: 1;
}
.admin-tool-card {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
}
.admin-tool-filters {
    position: relative;
    z-index: 2;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    overflow: visible;
}
.co-filter-tag-menu {
    z-index: 60;
}
.admin-tool-table-card {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
    overflow: visible;
}
.admin-tool-table-card .admin-tool-table-toolbar {
    overflow: visible;
}
.admin-tool-table-card .co-carnet-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 0 0 10px 10px;
}
.admin-tool-root .co-filter-tag-menu input:focus {
    outline: none;
    border-color: #ccc !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05) !important;
}
.admin-tool-input {
    border: 1px solid #e8e8e5;
    border-radius: 7px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #111;
    background: #fafaf8;
    outline: none;
    transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.admin-tool-input:focus {
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.admin-tool-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0ed;
    background: #fafaf8;
    font-size: 0.75rem;
    color: #888;
    font-weight: 500;
}
.admin-tool-loading {
    padding: 3rem;
    text-align: center;
    color: #aaa;
    font-size: 0.875rem;
}
.admin-tool-loading i {
    font-size: 1.5rem;
    color: #888;
    display: block;
    margin-bottom: 0.5rem;
}
.admin-tool-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #f0f0ed;
    font-size: 0.8125rem;
    color: #888;
}
.admin-tool-pagination-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.admin-tool-page-num {
    color: #555;
    font-variant-numeric: tabular-nums;
    min-width: 4rem;
    text-align: center;
}
.admin-tool-section {
    padding: 1.25rem 1.5rem;
}
.admin-tool-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.admin-tool-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin: 0 0 0.25rem;
}
.admin-tool-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.3;
}
.admin-tool-section-desc {
    font-size: 0.8125rem;
    color: #888;
    margin: 0.35rem 0 0;
    line-height: 1.5;
}

.admin-tool-root .co-carnet-table thead th {
    background-color: #fafaf8 !important;
}
.admin-tool-root .co-carnet-table tbody tr.co-carnet-row:hover td {
    background-color: #fafaf8;
}
.admin-tool-root .text-indigo-600 {
    color: #111 !important;
}
.admin-tool-root .hover\\:text-indigo-800:hover {
    color: #333 !important;
}
.admin-tool-root .hover\\:bg-indigo-50:hover {
    background-color: #f2f2f0 !important;
}
.admin-tool-root .bg-indigo-600 {
    background-color: #111 !important;
}
.admin-tool-root .hover\\:bg-indigo-700:hover {
    background-color: #333 !important;
}
.admin-tool-root .text-indigo-500,
.admin-tool-root .fa-spin.text-indigo-500 {
    color: #888 !important;
}
.admin-tool-root .co-dedupe-group {
    border-color: #e8e8e5 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
}
.admin-tool-root .co-dedupe-group > div:first-child {
    background: #fafaf8 !important;
    border-color: #e8e8e5 !important;
}
.admin-tool-root .co-mailchimp-title,
.admin-tool-root .co-tags-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.admin-tool-root .admin-tool-tab.bg-indigo-600,
.admin-tool-root button.admin-tool-tab[class*="bg-indigo"],
.admin-tool-root button.admin-tool-tab[class*="bg-blue"] {
    background: transparent !important;
    color: #888 !important;
}
.admin-tool-root .admin-tool-tab.is-active.bg-indigo-600,
.admin-tool-root button.admin-tool-tab.is-active[class*="bg-indigo"] {
    background: #111 !important;
    color: #fff !important;
}
.co-quick-select-menu button:hover {
    background-color: #f2f2f0 !important;
}

/* Pitch Report — composant métier (pr-*) */
.pr-admin-shell {
    padding-top: 0.85rem;
}
.pr-admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.75rem;
}
.pr-admin-nav-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}
.pr-gen-modal.admin-tool-modal-panel {
    max-width: 36rem;
}
.pr-gen-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.pr-gen-lead {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #999;
}
.pr-gen-body {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}
.pr-gen-section > .admin-tool-field-label {
    margin-bottom: 0.55rem;
}
.pr-gen-field {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.35rem 0;
}
.pr-gen-field > span {
    font-size: 0.75rem;
    color: #777;
}
.pr-gen-logos {
    flex-wrap: wrap;
}
.pr-gen-setting {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.7rem 0;
    border-top: 1px solid #f4f4f2;
    cursor: pointer;
}
.pr-gen-setting-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111;
}
.pr-gen-setting-hint {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: #999;
}
.pr-gen-tag {
    padding: 0.75rem 0;
    border-top: 1px solid #f4f4f2;
}
.pr-gen-tag-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}
.pr-gen-tag-id {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}
.pr-gen-tag-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pr-gen-adjust {
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
}
.pr-gen-adjust:hover,
.pr-gen-adjust.is-open {
    color: #111;
}
.pr-gen-overrides {
    margin-top: 0.65rem;
    padding: 0.15rem 0 0.15rem 0.15rem;
}
.pr-gen-progress {
    margin-bottom: 0.75rem;
}
.pr-gen-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    color: #999;
}
.pr-gen-foot-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
@media (max-width: 640px) {
    .pr-gen-field {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    .pr-gen-tag-main {
        grid-template-columns: 1fr;
        align-items: start;
    }
}
.pr-company-select-all {
    gap: 0.4rem;
}
.pr-company-row {
    transition: background 0.14s;
}
.pr-company-row.is-selected {
    background: #fafaf8;
}
.pr-company-row.is-expanded {
    background: #fcfcfb;
}
.pr-company-row-main {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
}
.pr-company-checkbox {
    width: 1rem;
    height: 1rem;
    margin: 0;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
    accent-color: #111;
}
.pr-company-row-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.pr-company-row-toggle:hover .pr-company-name {
    color: #000;
}
.pr-company-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111;
}
.pr-company-chevron {
    font-size: 0.7rem;
    color: #aaa;
    transition: transform 0.2s ease;
}
.pr-company-chevron.is-open {
    transform: rotate(180deg);
}
.pr-company-projects {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    padding-left: calc(1rem + 0.75rem);
    border-top: 1px solid #f0f0ed;
}
.pr-company-project {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f3;
}
.pr-company-project:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Extensions shell admin (status, modal, segmented…) — admin-tool canonique */
.admin-tool-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}
.admin-tool-status-badge.is-ok {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.admin-tool-status-badge.is-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.admin-tool-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #b91c1c;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s;
}
.admin-tool-btn-danger:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #f87171;
}
.admin-tool-btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.admin-tool-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.admin-tool-field > label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b0b0aa;
}
.admin-tool-select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    font-size: 0.8125rem;
    color: #333;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 7px;
    transition: border-color 0.14s, box-shadow 0.14s;
}
.admin-tool-select:focus {
    outline: none;
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.admin-tool-list-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f0f0ed;
}
.admin-tool-list-item:last-child {
    border-bottom: none;
}
.admin-tool-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-radius: 999px;
    background: #f2f2f0;
    color: #555;
}
.admin-tool-count-pill.is-accent {
    background: #111;
    color: #fff;
}
.admin-tool-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #aaa;
}
.admin-tool-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(17, 17, 17, 0.45);
}
.admin-tool-modal-panel {
    width: 100%;
    max-width: 56rem;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.admin-tool-modal-head {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0f0ed;
}
.admin-tool-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}
.admin-tool-modal-foot {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f0ed;
    background: #fafaf8;
}
.admin-tool-modal-panel--dialog {
    max-width: 26rem;
    animation: admin-tool-modal-in 0.18s ease-out;
}
.admin-tool-modal-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.admin-tool-modal-heading-text {
    min-width: 0;
    flex: 1;
}
.admin-tool-modal-message {
    font-size: 0.8125rem;
    color: #555;
    margin: 0.45rem 0 0;
    line-height: 1.55;
    white-space: pre-wrap;
}
.admin-tool-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 8px;
    background: #f2f2f0;
    color: #888;
    font-size: 0.85rem;
}
.admin-tool-modal-icon.is-success {
    background: #f0fdf4;
    color: #15803d;
}
.admin-tool-modal-icon.is-warning {
    background: #fffbeb;
    color: #b45309;
}
.admin-tool-modal-icon.is-error {
    background: #fef2f2;
    color: #b91c1c;
}
#global-modal-container .admin-tool-modal-backdrop {
    z-index: 999999;
    pointer-events: auto;
}
#global-modal-container .admin-tool-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
@keyframes admin-tool-modal-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.admin-tool-progress {
    height: 0.4rem;
    background: #ececea;
    border-radius: 999px;
    overflow: hidden;
}
.admin-tool-progress-bar {
    height: 100%;
    background: #111;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.admin-tool-root .admin-tool-input[type="date"] {
    min-height: 2.25rem;
}
.admin-tool-root table.admin-tool-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.admin-tool-root table.admin-tool-table thead th {
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #b0b0aa;
    background: #fafaf8;
    border-bottom: 1px solid #f0f0ed;
}
.admin-tool-root table.admin-tool-table tbody td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #f5f5f3;
    color: #444;
    vertical-align: middle;
}
.admin-tool-root table.admin-tool-table tbody tr:hover td {
    background: #fafaf8;
}
/* Ligne de total : mêmes marges que le corps, sinon « Total » colle au bord. */
.admin-tool-root table.admin-tool-table tfoot td {
    padding: 0.7rem 0.75rem;
    border-top: 1px solid #ecece9;
    background: #fafaf8;
    font-weight: 700;
    color: #111;
}
.admin-tool-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 20;
}
.admin-tool-tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.65rem;
}
.admin-tool-tag-card {
    text-align: left;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.14s, box-shadow 0.14s;
}
.admin-tool-tag-card:hover {
    border-color: #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.pr-tag-search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.pr-tag-search-field {
    flex: 1 1 14rem;
    min-width: 0;
}
.pr-tag-list {
    margin-top: 0.75rem;
    max-height: 22rem;
    overflow: auto;
    border: 1px solid #f0f0ed;
    border-radius: 8px;
    background: #fff;
}
.pr-tag-list-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b0b0aa;
    background: #fafaf8;
    border-bottom: 1px solid #f0f0ed;
}
.pr-tag-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: 0;
    border-bottom: 1px solid #f4f4f2;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.pr-tag-list-row:last-child {
    border-bottom: 0;
}
.pr-tag-list-row:hover {
    background: #fafaf8;
}
.pr-tag-list-row.is-active {
    background: #f5f5f3;
}
.pr-tag-list-row:disabled {
    cursor: default;
    opacity: 0.55;
}
.pr-tag-list-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111;
}
.pr-tag-list-meta {
    flex: 0 0 auto;
    font-size: 0.6875rem;
    color: #b0b0aa;
}
.admin-tool-field-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b0b0aa;
}
.admin-tool-segmented {
    display: inline-flex;
    border: 1px solid #e8e8e5;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}
.admin-tool-segmented button {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    background: #fff;
    border: none;
    border-right: 1px solid #e8e8e5;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
}
.admin-tool-segmented button:last-child {
    border-right: none;
}
.admin-tool-segmented button.is-active {
    background: #111;
    color: #fff;
}
.admin-tool-segmented button:hover:not(.is-active) {
    background: #f2f2f0;
}
.admin-tool-switch {
    position: relative;
    display: inline-flex;
    width: 2.75rem;
    height: 1.5rem;
    align-items: center;
    border-radius: 999px;
    background: #ececea;
    border: none;
    cursor: pointer;
    transition: background 0.14s;
}
.admin-tool-switch.is-on {
    background: #111;
}
.admin-tool-switch-knob {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: #fff;
    transform: translateX(0.2rem);
    transition: transform 0.14s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.admin-tool-switch.is-on .admin-tool-switch-knob {
    transform: translateX(1.45rem);
}
/* Task Manager — « Grouper par » : un menu par niveau, et les en-têtes d'entité et de « sans … ». */
.tm-group-select {
    height: 28px;
    padding: 0 24px 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
}
.tm-group-select:hover {
    border-color: #d4d4d0;
}
.tm-group-select:focus {
    outline: none;
    border-color: #aaa;
}
.tm-group-add {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    color: #888;
    background: transparent;
    border: 1px dashed #d4d4d0;
    border-radius: 8px;
    transition: color 0.12s, border-color 0.12s;
}
.tm-group-add:hover {
    color: #111;
    border-color: #999;
}
tr.tm-grp-entity {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}
tr.tm-grp-none {
    background: #fafaf9;
    border-top: 1px solid #f0f0ed;
}
/* Task Manager — nom d'un lot, éditable dans l'en-tête de section. */
.tm-lot-name {
    field-sizing: content;
    min-width: 6ch;
    max-width: 100%;
    padding: 1px 6px;
    margin-left: -6px;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    text-overflow: ellipsis;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: text;
    transition: border-color 0.12s, background 0.12s;
}
.tm-lot-name:hover {
    background: #fff;
    border-color: #e8e8e5;
}
.tm-lot-name:focus {
    outline: none;
    background: #fff;
    border-color: #aaa;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
/* Task Manager — couleur du drapeau d'un lot. */
.tm-lot-color {
    position: fixed;
    z-index: 200;
    display: grid;
    grid-template-columns: repeat(5, 24px);
    gap: 8px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.tm-lot-swatch {
    width: 24px;
    height: 24px;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.1s;
}
.tm-lot-swatch:hover {
    transform: scale(1.12);
}
.tm-lot-swatch.is-current {
    box-shadow: 0 0 0 2px #111;
}
/* Task Manager — liste par lots : glisser-déposer d'une tâche vers un lot. */
.tm-lot-ghost {
    position: fixed;
    top: -200px;
    left: -200px;
    max-width: 260px;
    padding: 6px 12px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #111;
    border-radius: 9px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
tr.tm-row-dragging > td {
    opacity: 0.4;
}
tr.tm-lot-target > td {
    background-color: #eef2ff !important;
    transition: background-color 0.12s;
}
tr.tm-row-flash > td {
    animation: tm-row-flash 1.4s ease-out;
}
@keyframes tm-row-flash {
    from { background-color: rgba(99, 102, 241, 0.28); }
    to { background-color: transparent; }
}
.tm-lot-dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    z-index: 190;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 92vw;
    padding: 8px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #e8e8e5;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    transform: translateX(-50%);
    animation: tm-lot-dock-in 0.16s ease-out;
}
@keyframes tm-lot-dock-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.tm-lot-dock-hint {
    padding: 0 6px;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}
.tm-lot-dock-chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    background: #fafaf8;
    border: 1.5px dashed #d4d4d0;
    border-radius: 9px;
    transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
}
.tm-lot-dock-chip i {
    font-size: 10px;
    opacity: 0.55;
}
.tm-lot-dock-chip.is-over {
    color: #fff;
    background: #111;
    border-color: #111;
    border-style: solid;
    transform: scale(1.05);
}
/* Détails d'une coche (réglages du Task Manager) : champs et interrupteur resserrés. */
.tm-cs-compact .admin-tool-input,
.tm-cs-compact .admin-tool-select {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}
.admin-tool-switch.tm-cs-switch {
    width: 2rem;
    height: 1.1rem;
}
.tm-cs-switch .admin-tool-switch-knob {
    width: 0.8rem;
    height: 0.8rem;
    transform: translateX(0.15rem);
}
.admin-tool-switch.tm-cs-switch.is-on .admin-tool-switch-knob {
    transform: translateX(1.05rem);
}
.admin-tool-tab-pane {
    padding-top: 0.75rem;
}

/* =============================================================================
   Combobox à recherche — habillage admin-tool (Combobox variant="admin")
   Le menu est téléporté dans <body> : ces classes sont autoportantes, les
   surcharges de .admin-tool-root ne l'atteignent pas.
   ========================================================================== */
.admin-combo-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.65rem;
    font-family: inherit;
    font-size: 0.8125rem;
    color: #333;
    text-align: left;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 7px;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
/* Combobox en saisie directe (`inline`) : le champ est le déclencheur, sans bordure propre. */
.admin-combo-trigger.is-inline { cursor: text; }
.admin-combo-trigger.is-inline:focus-within {
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.admin-combo-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    outline: none;
}
.admin-combo-input::placeholder { color: #9a9a92; }
/*
 * Syncs — tableau du suivi.
 *
 * L'en-tête partagé (TableHeader) vient avec la hauteur et la police de
 * Live Dates ; ici le tableau est plus dense, l'en-tête suit. La colonne
 * Projet, quand elle ouvre le tableau, reste collée à gauche au défilement
 * horizontal : l'en-tête au-dessus des autres en-têtes, la cellule au-dessus
 * des autres cellules, sous l'en-tête. Le fond vient de la ligne (blanc,
 * survol, sélection), pour que rien ne se voie à travers.
 */
.sy-table thead th {
    height: 2.25rem;
    font-size: 12px;
}
/* Cellules d'une ligne : 4 px en haut et en bas. Deux lignes de 16 px
   (Publishing / Master) tiennent en 40 px sans se toucher. */
.sy-table .sy-cell {
    padding: 0.25rem 0.75rem;
    vertical-align: middle;
}
/* Badges de la seconde ligne du projet : une hauteur, une police. */
.sy-table .sy-badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    height: 1rem;
    padding: 0 0.3rem;
    border-radius: 4px;
    font-size: 10.5px;
    line-height: 1;
    white-space: nowrap;
}
.sy-table .sy-row-check {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    margin: 0;
    border-radius: 3px;
    border-color: #d1d5db;
    color: #1c1c1a;
}
.sy-table .sy-row-check:focus { box-shadow: none; }
/* Filtre actif sur un en-tête : noir, pas le bleu de Live Dates. */
.sy-table .column-filter-button i.text-blue-500 { color: #1c1c1a; }
/* Barre du tableau : boutons carrés et pastilles de filtres. */
/* Onglet Facturation : la ventilation se lit comme un petit tableau. */
.sy-vent-head,
.sy-vent-row {
    display: grid;
    grid-template-columns: 7.5rem repeat(4, minmax(0, 1fr)) minmax(5.5rem, 0.8fr);
    align-items: center;
    gap: 0.4rem;
}
.sy-vent-head {
    /* « Facturation licencié » et « Refacturation client » passent sur deux
       lignes : les en-têtes courts se calent alors en bas, sur les champs. */
    align-items: end;
    line-height: 1.2;
    padding: 0 0 0.3rem;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a3a39d;
}
.sy-vent-row { padding: 0.2rem 0; }
.sy-vent-total {
    margin-top: 0.3rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ecece8;
    font-size: 12px;
    color: #57574f;
}
.sy-tool-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    height: 2rem;
    font-size: 12.5px;
    color: #57574f;
    background: #fff;
    border: 1px solid #d6d6d1;
    border-radius: 8px;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.sy-tool-btn:hover { background: #f5f5f3; color: #1c1c1a; }
.sy-tool-btn.is-open { background: #f0f0ed; border-color: #b9b9b3; color: #1c1c1a; }
.sy-tool-btn.is-on { background: #1c1c1a; border-color: #1c1c1a; color: #fff; }
.sy-filter-chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.3rem;
    height: 1.75rem;
    padding: 0 0.25rem 0 0.55rem;
    font-size: 12px;
    background: #fff;
    border: 1px solid #d6d6d1;
    border-radius: 999px;
    transition: border-color 0.14s;
}
.sy-filter-chip:hover { border-color: #9a9a94; }
.sy-filter-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    font-size: 9px;
    color: #9a9a94;
    border-radius: 999px;
}
.sy-filter-chip-x:hover { background: #f0f0ed; color: #1c1c1a; }
.sy-table-scroll {
    max-height: calc(100vh - 17rem);
    min-height: 20rem;
    /* Sous macOS la barre de défilement horizontale se pose sur le contenu : sans
       cette marge, elle mord sur la dernière ligne du tableau — la pagination du
       dernier groupe — même défilé tout en bas. */
    padding-bottom: 1rem;
}
/* Pied du tableau des synchros : les totaux, ligne du tableau collée en bas du panneau.
   Le collage s'arrête au-dessus du padding-bottom de .sy-table-scroll (la place de la barre
   de défilement de macOS) : le ::after remplit ce jour du gris du pied, sinon les lignes y
   défileraient (une ombre portée ne s'y dessine pas : bordures fusionnées). */
.sy-table .sy-foot-td {
    position: sticky;
    bottom: 0;
    z-index: 25;
    height: 30px;
    padding: 0 0.75rem;
    vertical-align: middle;
    white-space: nowrap;
    background: #fafaf8;
    box-shadow: inset 0 1px 0 #e4e4e0;
}
.sy-table .sy-foot-td::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 1rem;
    background: #fafaf8;
}
.sy-table .is-split .sy-foot-td { height: 42px; }
.sy-table .sy-foot-td.is-frozen {
    left: 0;
    z-index: 26;
    box-shadow: inset 0 1px 0 #e4e4e0, inset -1px 0 0 #e5e7eb;
}
.sy-foot-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b6b66;
}
.sy-foot-amount {
    display: inline-flex;
    max-width: calc(100% + 8px);
    min-width: 0;
    align-items: center;
    gap: 6px;
    margin: 0 -4px;
    padding: 2px 4px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.sy-foot-amount:hover { background: #efefec; }
/* Une cotation en devise reste hors total : le signal se pose dans la marge droite de la cellule. */
.sy-foot-warn {
    position: absolute;
    top: 50%;
    right: 2px;
    transform: translateY(-50%);
    font-size: 9px;
    color: #f59e0b;
}
.sy-table .sy-frozen-th {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: inset -1px 0 0 #e5e7eb;
}
.sy-table .sy-frozen-td {
    position: sticky;
    left: 0;
    z-index: 5;
    background-color: inherit;
    box-shadow: inset -1px 0 0 #e5e7eb;
}
/* Groupe : bandeau neutre, séparé de la ligne du groupe précédent par un
   jour de la couleur de page. Le glisser ouvre un trou (translate) et un
   liseré noir à l'endroit du dépôt, comme la grille Budgets. */
.sy-lane-gap,
.sy-lane-head,
.sy-sync-row {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.sy-lane-gap td {
    height: 14px;
    padding: 0;
    border: 0;
    background: #f3f3f1;
}
.sy-lane-head { cursor: pointer; }
.sy-lane-head td {
    padding: 0.45rem 0.75rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #3f3f3a;
    background: #f7f7f5;
    /* Figé sous l'en-tête tant qu'on défile dans son groupe ; le groupe
       suivant, en arrivant, le recouvre. Filets en ombres : avec des bordures
       fusionnées, une bordure reste à sa place quand la cellule se fige. */
    position: sticky;
    top: var(--sy-thead-h, 35px);
    z-index: 20;
    border: 0;
    box-shadow: inset 0 1px 0 #e4e4e0, inset 0 -1px 0 #e4e4e0;
}
.sy-lane-head:hover td { background: #f1f1ef; }
/* Recherches : le groupe sur lequel la ligne glissée va tomber. */
.sy-lane-head.sr-lane-drop td {
    background: #f0f9ff;
    box-shadow: inset 0 1px 0 #7dd3fc, inset 0 -1px 0 #7dd3fc;
}
/* Recherches : l'échéance, compte à rebours dans la liste, repères dans la fiche. */
.sr-due-cell { display: inline-flex; max-width: 100%; min-width: 0; align-items: center; gap: 6px; }
.sr-due-dot { width: 6px; height: 6px; flex: none; border-radius: 9999px; background: #f59e0b; }
.sr-due-countdown { flex: none; font-variant-numeric: tabular-nums; font-weight: 500; color: #374151; }
.sr-due-countdown.is-soon { color: #b45309; }
.sr-due-countdown.is-late { color: #be123c; }
.sr-due-moon { flex: none; font-size: 9px; color: #b45309; }
.sr-due-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #9ca3af; }
.sr-due-flag {
    margin-left: auto;
    border-radius: 9999px;
    background: #fef3c7;
    padding: 1px 7px;
    font-size: 10.5px;
    font-weight: 500;
    color: #92400e;
}
.sr-due-flag.is-ok { background: #f3f4f6; color: #4b5563; }
.sr-due-understood { margin: 0; font-size: 11.5px; line-height: 1.45; color: #4b5563; }
.sr-due-understood strong { font-weight: 600; color: #111827; }
.sr-due-source { color: #9ca3af; }
.sr-due-notes { margin: 0; padding-left: 14px; list-style: disc; font-size: 11px; line-height: 1.4; color: #92400e; }
.sr-due-marks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0; }
.sr-due-marks > div { min-width: 0; border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px 7px; background: #fafaf8; }
.sr-due-marks dt { font-size: 10px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-due-marks dd { margin: 0; font-size: 11.5px; font-weight: 500; line-height: 1.35; color: #111827; font-variant-numeric: tabular-nums; }
.sr-due-marks > div.is-warn { border-color: #fcd34d; background: #fffbeb; }
.sr-due-warn { margin: 0; font-size: 11px; line-height: 1.4; color: #92400e; }
.sr-due-warn i { margin-right: 4px; font-size: 10px; }
.sr-due-confirm {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 0 8px;
    font-size: 11px;
    color: #111827;
}
.sr-due-confirm:hover { background: #f9fafb; }
.sr-due-confirm i { font-size: 9px; color: #6b7280; }
/* Recherches : les œuvres d'une playlist Bridge, et le choix de celles qui partent au suivi. */
/* Sur deux colonnes, la carte passe sous les autres : elle garde de quoi montrer
   ses œuvres, et l'onglet défile en hauteur pour l'atteindre. */
.sy-card.is-fill.sr-pl-card { min-height: 14rem; }
.sr-pl + .sr-pl { padding-top: 6px; border-top: 1px solid #f0f0ed; }
.sr-pl-note { margin: 2px 0 0 20px; font-size: 11px; line-height: 1.4; color: #9ca3af; }
.sr-pl-note.is-error { color: #b45309; }
.sr-pl-tracks { margin: 3px 0 0 20px; padding: 0; list-style: none; }
.sr-pl-track { display: flex; min-width: 0; align-items: center; gap: 6px; padding: 1px 0; font-size: 11.5px; line-height: 1.35; color: #374151; }
.sr-pl-title { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-pl-artist { color: #9ca3af; }
.sr-pl-dur { flex: none; font-variant-numeric: tabular-nums; font-size: 11px; color: #9ca3af; }
.sr-pl-sync {
    display: inline-flex; flex: none; align-items: center; gap: 4px;
    border-radius: 9999px; background: #111827; padding: 0 6px;
    font-size: 10.5px; line-height: 16px; color: #fff;
}
.sr-pl-sync:hover { background: #374151; }
.sr-pick { display: flex; flex-direction: column; gap: 14px; }
.sr-pick-group { display: flex; flex-direction: column; gap: 1px; }
.sr-pick-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: #6b7280;
}
.sr-pick-all { flex: none; font-size: 11px; font-weight: 500; color: #0369a1; }
.sr-pick-all:hover { text-decoration: underline; }
.sr-pick-row {
    display: flex; min-width: 0; align-items: center; gap: 10px;
    border-radius: 8px; padding: 5px 8px; font-size: 13px; color: #111827; cursor: pointer;
}
.sr-pick-row:hover { background: #f7f7f5; }
.sr-pick-row.is-done { cursor: default; color: #9ca3af; }
.sr-pick-row.is-done:hover { background: transparent; }
.sr-pick-row input { flex: none; border-radius: 4px; border-color: #d1d5db; }
.sr-pick-done { flex: none; font-size: 11px; color: #9ca3af; }
.sr-pick-bare { border: 1px dashed #e5e7eb; }
.sr-pick-empty { margin: 0; font-size: 12.5px; color: #6b7280; }
.sr-pick-empty.is-error { color: #b45309; }
.sr-pick-existing { border-top: 1px solid #f0f0ed; padding-top: 10px; }
.sr-pick-link {
    display: flex; width: 100%; min-width: 0; align-items: center; gap: 8px;
    border-radius: 8px; padding: 4px 8px; text-align: left; font-size: 12.5px; color: #111827;
}
.sr-pick-link:hover { background: #f7f7f5; }
/* Le nom du groupe reste en vue quand le tableau défile vers la droite. */
.sy-lane-toggle {
    position: sticky;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.sy-lane-toggle i {
    font-size: 9px;
    color: #8a8a84;
    transition: transform 0.18s ease;
}
.sy-lane-chevron-closed { transform: rotate(-90deg); }
.sy-lane-name {
    cursor: text;
    border-radius: 4px;
    padding: 0 0.2rem;
    margin: 0 -0.2rem;
}
.sy-lane-name:hover { background: #e7e7e3; }
.sy-lane-input {
    width: 16rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    font: inherit;
    color: #1c1c1a;
    background: #fff;
    border: 1px solid #c9c9c3;
    border-radius: 4px;
    outline: none;
}
.sy-lane-input:focus { border-color: #1c1c1a; }
.sy-lane-empty,
.sy-lane-foot {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.sy-lane-empty td {
    padding: 0.8rem 0.75rem;
    font-size: 12px;
    color: #9a9a94;
    background: #fff;
}
.sy-lane-foot td {
    padding: 0.35rem 0.75rem;
    font-size: 11.5px;
    color: #8a8a84;
    background: #fbfbfa;
}
/* Le compte et les flèches restent en vue quand le tableau défile vers la droite. */
.sy-lane-pager {
    position: sticky;
    left: 0.75rem;
    display: inline-flex;
    align-items: center;
}
.sy-lane-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.25rem;
    font-size: 9px;
    color: #3f3f3a;
    background: #fff;
    border: 1px solid #e4e4e0;
    border-radius: 6px;
}
.sy-lane-page:first-of-type { margin-left: 0.6rem; }
.sy-lane-page:hover:not(:disabled) { background: #f1f1ef; }
.sy-lane-page:disabled { opacity: 0.35; cursor: default; }
.sy-lane-count {
    font-weight: 500;
    color: #9a9a94;
}
.sy-grip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 14px;
    padding: 0;
    color: #c4c4be;
    background: none;
    border: 0;
    cursor: grab;
}
.sy-grip:hover { color: #3f3f3a; }
.sy-row-ghosted { opacity: 0; }
/* Un fichier survole la ligne : elle s'éclaire pour dire où la cue sheet
   tombera. !important : la colonne figée porte son propre fond opaque. */
.sy-cue-drop > td {
    background-color: #f0f9ff !important;
    box-shadow: inset 0 1px 0 #7dd3fc, inset 0 -1px 0 #7dd3fc;
}
.sy-drag-ghost {
    position: fixed;
    z-index: 80;
    pointer-events: none;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(28, 28, 26, 0.14), 0 0 0 1px rgba(28, 28, 26, 0.06);
}
.sy-drag-ghost-table {
    border-collapse: collapse;
    background: #fff;
    font-size: 12px;
    line-height: 1.35;
    color: #111;
}
/* Posé dans un champ à étiquette, le déclencheur n'apporte ni fond ni cadre :
   celui qui l'entoure les porte déjà, et deux bordures imbriquées se voient. */
.sy-combo .admin-combo-trigger {
    height: 100%;
    padding: 0 0.6rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #111827;
}
.sy-combo .admin-combo-trigger:hover:not(:disabled) {
    background: transparent;
}
.sy-combo .admin-combo-trigger:disabled {
    background: #f9fafb;
    color: #9ca3af;
}
/* Dans la fiche, la date n'a pas son propre cadre : elle prend la taille du champ. */
.sy-editor .sy-field-date > div {
    height: 100%;
    min-height: 26px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.75rem;
    line-height: 1.35;
}

/* ---------- Syncs : fiche d'une synchro ----------
   Une seule grammaire pour les cinq onglets : des encarts (.sy-card) au même
   en-tête, des champs à étiquette intérieure (.sy-field) de même hauteur.
   La fiche prend la place laissée sous la ligne ouverte (--sy-editor-h, posé
   par la vue) : chaque onglet la remplit en colonnes, l'encart marqué
   « is-fill » de chaque colonne s'étire jusqu'en bas, et ce qui déborde défile
   dans son encart au lieu de pousser la page.
   Tout est ici et pas en classes Tailwind : la fiche est mesurée et défilée
   dès l'ouverture, avant que le Tailwind du navigateur ait généré une classe
   qu'il voit pour la première fois. */
.sy-editor-frame {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: var(--sy-editor-h, auto);
    padding: 6px 10px 8px;
    background: rgba(249, 250, 251, 0.7);
}
.sy-editor {
    --sy-label-w: 5.25rem;
    box-sizing: border-box;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.sy-editor-bar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-bottom: 1px solid #e5e7eb;
}
/* Les onglets se suivent sur une piste : un geste latéral passe de l'un à
   l'autre. La barre d'onglets suffit à s'y repérer ; pas d'ascenseur en plus. */
.sy-editor-track {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.sy-editor-track::-webkit-scrollbar { display: none; }
.sy-tab {
    box-sizing: border-box;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-align: start;
    scrollbar-width: thin;
}
.sy-tab-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-height: 100%;
}
/* Une seule rangée de colonnes : elle prend toute la hauteur, et c'est dans
   les encarts que l'on défile. */
@media (min-width: 900px) {
    .sy-tab-grid.is-2,
    .sy-tab-grid.is-work,
    .sy-tab-grid.is-scopes,
    .sy-tab-grid.is-mail {
        grid-template-rows: minmax(0, 1fr);
        height: 100%;
    }
    .sy-tab-grid.is-2,
    .sy-tab-grid.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sy-tab-grid.is-work { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
    .sy-tab-grid.is-scopes { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
    .sy-tab-grid.is-mail { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
@media (min-width: 1200px) {
    .sy-tab-grid.is-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr);
        height: 100%;
    }
}
/* Facturation : le calcul à gauche, les factures sur toute la hauteur à droite. */
@media (min-width: 1100px) {
    .sy-tab-grid.is-billing {
        grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: 100%;
    }
}
.sy-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
}

.sy-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 0;
    padding: 8px 10px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.sy-card.is-fill {
    flex: 1 1 0;
    min-height: 3rem;
    overflow: hidden;
}
.sy-tab-grid > .sy-card.is-fill { min-height: 0; }
.sy-card-head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 20px;
    margin-bottom: 6px;
}
.sy-card-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: #374151;
}
.sy-card-count {
    font-weight: 400;
    color: #9ca3af;
}
.sy-card-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
}
.sy-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
    font-size: 11.5px;
    line-height: 1.35;
    color: #0369a1;
    cursor: pointer;
    white-space: nowrap;
}
.sy-card-action:hover { text-decoration: underline; }
.sy-card-action:disabled { color: #d1d5db; cursor: default; text-decoration: none; }
.sy-card-action.is-muted { color: #6b7280; }
.sy-card-action i { font-size: 9px; }
/* Ce qui peut s'allonger (listes, textes) défile dans son encart. */
.sy-card-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.sy-card-empty {
    margin: 0;
    font-size: 11.5px;
    font-style: italic;
    line-height: 1.4;
    color: #9ca3af;
}
.sy-card-note {
    margin: auto 0 0;
    padding-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: #9ca3af;
}

/* Champs : l'étiquette dans le cadre, une hauteur pour tous. */
.sy-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}
.sy-fields > .is-wide { grid-column: 1 / -1; }
.sy-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.sy-card.is-fill > .sy-stack { flex: 1 1 auto; min-height: 0; }
.sy-field {
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    min-width: 0;
    min-height: 28px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s;
}
.sy-field:focus-within {
    border-color: #9ca3af;
    box-shadow: 0 0 0 1px #e5e7eb;
}
.sy-field.is-readonly { background: #f9fafb; }
.sy-field.is-drop { border-color: #38bdf8; background: #f0f9ff; }
/* Un texte libre prend la hauteur qui reste dans son encart. */
.sy-field.is-area { flex: 1 1 auto; min-height: 46px; }
.sy-field.is-area .sy-field-label { align-items: flex-start; padding-top: 6px; }
.sy-field-label {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 var(--sy-label-w);
    align-items: center;
    min-width: 0;
    padding: 0 8px;
    overflow: hidden;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    font-size: 12px;
    line-height: 1.3;
    color: #6b7280;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sy-field-input {
    box-sizing: border-box;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 10px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    font-size: 12px;
    line-height: 1.35;
    color: #111827;
}
.sy-field-input:focus { outline: none; box-shadow: none; border: 0; }
.sy-field-input::placeholder { color: #9ca3af; }
.sy-field-input:disabled { background: #f9fafb; color: #9ca3af; }
.sy-field-input[type="number"] { font-variant-numeric: tabular-nums; }
textarea.sy-field-input {
    padding-top: 6px;
    padding-bottom: 6px;
    resize: none;
}
.sy-field-value {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
    padding: 0 10px;
    font-size: 12px;
    color: #111827;
    font-variant-numeric: tabular-nums;
}
.sy-field > .sy-combo,
.sy-field > .sy-field-date { flex: 1 1 auto; min-width: 0; }
/* Champ composé (durée : genre · valeur · unité) : des morceaux séparés d'un
   filet, dans un seul cadre, sans étiquette répétée entre eux. */
.sy-field > .sy-field-part {
    flex: 0 0 auto;
    border-left: 1px solid #e5e7eb;
}
.sy-field > .sy-field-part.is-num { width: 3.25rem; padding: 0 8px; text-align: right; }
.sy-field > .sy-field-part.is-unit { width: 6.5rem; }
.sy-field > .sy-field-part.is-currency { width: 3.5rem; padding: 0 8px; text-transform: uppercase; }
.sy-field > .sy-field-part.is-date { width: 7.75rem; }
.sy-field-sep {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    padding: 0 2px 0 8px;
    font-size: 11.5px;
    color: #9ca3af;
    border-left: 1px solid #e5e7eb;
}
.sy-field-sep + .sy-field-part { border-left: 0; }
.sy-field-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    padding: 0 8px;
    font-size: 10px;
    color: #9ca3af;
}
a.sy-field-icon:hover,
button.sy-field-icon:hover { color: #111827; }
/* Le sélecteur qui tient lieu d'étiquette (droit d'un détenteur). */
.sy-field > .sy-combo.sy-field-kind {
    flex: 0 0 var(--sy-label-w);
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
}
.sy-field > .sy-combo.sy-field-kind .admin-combo-trigger { padding: 0 6px 0 8px; color: #4b5563; }
.sy-field > .sy-combo.sy-field-kind .admin-combo-trigger:hover:not(:disabled) { background: #f3f4f6; }
/* Cotation : la devise est un menu, collé au montant par un filet. */
.sy-field > .sy-combo.sy-field-part.is-currency-pick {
    flex: 0 0 4.75rem;
    border-left: 1px solid #e5e7eb;
}
.sy-field > .sy-combo.is-currency-pick .admin-combo-trigger { padding: 0 6px 0 8px; font-weight: 600; letter-spacing: 0.02em; }
/* Taux de change : outils dans l'en-tête, marqueur sous chaque ligne. */
.sy-fx-tools { display: flex; align-items: center; gap: 6px; }
.sy-fx-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    font-size: 11px;
    cursor: pointer;
}
.sy-fx-refresh:hover:not(:disabled) { background: #f3f4f6; color: #111827; }
.sy-fx-refresh:disabled { opacity: 0.4; cursor: default; }
.sy-fx-note {
    grid-column: 2 / span 2;
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: -1px 0 3px;
    font-size: 11px;
    line-height: 1.3;
    color: #6b7280;
}
.sy-fx-note i { font-size: 9px; }
.sy-fx-note.is-ok i { color: #16a34a; }
.sy-fx-note.is-stale { color: #b45309; }
.sy-fx-note.is-none { color: #a3a39d; }
/* Cue sheet : le statut, puis le fichier dans le même cadre. */
.sy-field > .sy-combo.sy-cue-status { flex: 0 0 7.75rem; }
.sy-cue-file {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
    padding: 0 8px;
    border-left: 1px dashed #d1d5db;
    font-size: 11.5px;
    color: #9ca3af;
}
.sy-field.is-drop .sy-cue-file { border-left-color: #38bdf8; color: #0369a1; }

/* Ligne d'un montant par droit (Montants, Ventilation). */
.sy-amounts {
    display: grid;
    grid-template-columns: 18px minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 4px 6px;
}
.sy-amounts-head {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a3a39d;
}
/* Régimes : des sous-encarts gris, deux par rangée quand la place le permet. */
.sy-regimes {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}
@media (min-width: 1300px) {
    .sy-regimes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sy-regime {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
}
.sy-regime-head {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sy-regime-index {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #78716c;
}
/* Un mail peut être long : il défile dans son encart. */
.sy-mail-body {
    margin: 0;
    padding: 8px 12px;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f9fafb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.6;
    color: #374151;
}
/* Les sélecteurs et listes de la fiche, à la hauteur des champs. */
.sy-tagfield-bare {
    box-sizing: border-box;
    width: 100%;
    min-height: 26px;
    padding: 2px 4px;
}
.sy-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    padding: 0 6px;
    border-radius: 5px;
    font-size: 11.5px;
    line-height: 1;
    white-space: nowrap;
}
.sy-tag-add {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: auto;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 5px;
}
.sy-tag-add:hover { color: #111827; background: #f9fafb; border-color: #9ca3af; }
.sy-picker {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 2px 4px 2px 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
}
.sy-picker.is-open { border-color: #9ca3af; box-shadow: 0 0 0 1px #e5e7eb; }
.sy-picker.is-bare {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 26px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.admin-combo-trigger:hover:not(:disabled) {
    background: #fff;
    border-color: #ccc;
}
.admin-combo-trigger:focus-visible {
    outline: none;
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.admin-combo-trigger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.admin-combo-trigger.is-compact {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
}
.admin-combo-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-combo-value.is-placeholder {
    color: #b0b0aa;
}
/*
 * Sélection multiple : les valeurs retenues s'accumulent en étiquettes dans le
 * champ, à la suite les unes des autres. Le champ grandit au lieu de tronquer —
 * une ligne assise sur trois cachets doit pouvoir les nommer tous les trois.
 */
.admin-combo-trigger.is-multiple {
    min-height: 2.05rem;
    padding-top: 0.28rem;
    padding-bottom: 0.28rem;
}
.admin-combo-trigger.is-multiple.is-compact {
    min-height: 1.6rem;
    padding-top: 0.18rem;
    padding-bottom: 0.18rem;
}
.admin-combo-tags {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
}
.admin-combo-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    padding: 0.05rem 0.2rem 0.05rem 0.45rem;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: #111;
    background: #ececea;
    border-radius: 999px;
}
.admin-combo-tag-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-combo-tag-remove {
    flex-shrink: 0;
    padding: 0 0.15rem;
    font-size: 0.5625rem;
    color: #787872;
    cursor: pointer;
}
.admin-combo-tag-remove:hover {
    color: #111;
}
.admin-combo-chevron {
    flex-shrink: 0;
    font-size: 0.5rem;
    color: #b0b0aa;
    transition: transform 0.14s;
}
.admin-combo-menu {
    padding: 0.4rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.13);
}
.admin-combo-search-wrap {
    position: relative;
    margin-bottom: 0.35rem;
}
.admin-combo-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.625rem;
    color: #b0b0aa;
}
.admin-combo-search {
    width: 100%;
    padding: 0.45rem 0.6rem 0.45rem 1.8rem;
    font-family: inherit;
    font-size: 0.75rem;
    color: #111;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 7px;
    outline: none;
    transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.admin-combo-search:focus {
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.admin-combo-list {
    max-height: 15rem;
    overflow-y: auto;
}
.admin-combo-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.55rem;
    font-family: inherit;
    color: #333;
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.admin-combo-option:hover {
    background: #f5f5f3;
}
.admin-combo-option.is-selected {
    background: #f2f2f0;
    color: #111;
}
.admin-combo-group {
    margin: 0;
    padding: 0.5rem 0.55rem 0.2rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b0b0aa;
}
.admin-combo-option.is-muted {
    font-size: 0.75rem;
    color: #b0b0aa;
}
.admin-combo-option-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-combo-option-desc {
    display: block;
    font-size: 0.6875rem;
    color: #b0b0aa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-combo-check {
    flex-shrink: 0;
    font-size: 0.625rem;
    color: #111;
}
.admin-combo-noresult {
    margin: 0;
    padding: 1.25rem 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: #b0b0aa;
}

/* =============================================================================
   Pitch Report — import de rapports partenaires (pr-import-*)
   ========================================================================== */
.pr-import-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.pr-import-step {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: #b0b0aa;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 999px;
    cursor: default;
    transition: color 0.14s, background 0.14s, border-color 0.14s;
}
.pr-import-step.is-done {
    color: #555;
    cursor: pointer;
}
.pr-import-step.is-done:hover {
    background: #fafaf8;
    border-color: #ccc;
}
.pr-import-step.is-current {
    color: #fff;
    background: #111;
    border-color: #111;
}
.pr-import-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    font-size: 0.625rem;
    font-weight: 700;
    color: #888;
    background: #f2f2f0;
    border-radius: 999px;
}
.pr-import-step.is-current .pr-import-step-num {
    color: #fff;
    background: rgba(255, 255, 255, 0.22);
}
.pr-import-step.is-done .pr-import-step-num {
    color: #fff;
    background: #111;
}
.pr-import-step-sep {
    width: 1.25rem;
    height: 1px;
    background: #e8e8e5;
}
.pr-import-drop {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fafaf8;
    border: 1px dashed #d8d8d4;
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
}
.pr-import-drop:hover,
.pr-import-drop.is-over {
    background: #f5f5f3;
    border-color: #111;
}
.pr-import-drop.is-filled {
    background: #fff;
    border-style: solid;
    border-color: #e8e8e5;
}
.pr-import-drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    font-size: 0.875rem;
    color: #888;
    background: #f2f2f0;
    border-radius: 8px;
}
.pr-import-drop.is-filled .pr-import-drop-icon {
    color: #fff;
    background: #111;
}
.pr-import-drop-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111;
    overflow-wrap: anywhere;
}
.pr-import-drop-hint {
    margin-top: 0.1rem;
    font-size: 0.75rem;
    color: #888;
}
.pr-import-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.pr-import-kpi {
    min-width: 5.75rem;
    padding: 0.5rem 0.8rem;
    background: #fafaf8;
    border: 1px solid #f0f0ed;
    border-radius: 8px;
}
.pr-import-kpi-value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111;
    font-variant-numeric: tabular-nums;
}
.pr-import-kpi-label {
    margin-top: 0.1rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b0b0aa;
}
.pr-import-kpi.is-warn {
    background: #fffbeb;
    border-color: #fde68a;
}
.pr-import-kpi.is-warn .pr-import-kpi-value {
    color: #b45309;
}
.pr-import-kpi.is-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.pr-import-kpi.is-ok .pr-import-kpi-value {
    color: #15803d;
}
.pr-import-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #666;
    background: #f5f5f3;
    border-radius: 999px;
}
.pr-import-chip i {
    font-size: 0.5625rem;
    color: #b0b0aa;
}
.pr-import-chip.is-ok {
    color: #15803d;
    background: #f0fdf4;
}
.pr-import-chip.is-ok i {
    color: #22c55e;
}
.pr-import-chip.is-warn {
    color: #b45309;
    background: #fffbeb;
}
.pr-import-chip.is-warn i {
    color: #f59e0b;
}
/* Bandeau de bilan de l'aperçu : compteurs à gauche, jauge d'attribution à droite. */
.pr-import-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
}
.pr-import-gauge {
    flex: 1 1 12rem;
    min-width: 10rem;
    max-width: 22rem;
}
.pr-import-gauge-label {
    margin-top: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #888;
    text-align: right;
}
/* Bandeau d'état suivi d'un formulaire : un filet les distingue. */
.pr-import-summary.is-bordered {
    border-bottom: 1px solid #ececea;
}
/* Corps et pied des étapes 1 et 2 : mêmes marges que le bandeau de bilan. */
.pr-import-step-body {
    padding: 1.25rem 1.5rem 0;
}
.pr-import-step-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.25rem;
}
.pr-import-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: 0.75rem;
}
.pr-import-panel {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #fafaf8;
    border: 1px solid #f0f0ed;
    border-radius: 10px;
}
.pr-import-period-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
}
.pr-import-period-fields {
    display: grid;
    grid-template-columns: minmax(8rem, 1.1fr) 10.75rem 10.75rem 10.75rem;
    gap: 0.75rem;
    align-items: start;
}
@media (max-width: 960px) {
    .pr-import-period-fields {
        grid-template-columns: 1fr 1fr;
    }
}
.pr-import-panel-num {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    background: #111;
    border-radius: 999px;
}
.pr-import-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
/* Valeur d'exemple sous un choix de colonne : discrète mais lisible. */
.pr-import-sample {
    margin: 0.3rem 0 0;
    font-size: 0.6875rem;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pr-import-sample.is-empty {
    color: #b0b0aa;
    font-style: italic;
}
/* Actions de correction : deux blocs de même poids, séparés du bilan. */
.pr-import-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.75rem;
    padding: 0 1.5rem 1.25rem;
}
.pr-import-action {
    padding: 0.85rem 1rem;
    background: #fafaf8;
    border: 1px solid #f0f0ed;
    border-radius: 10px;
}
.pr-import-action-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #111;
}
.pr-import-action-title i {
    font-size: 0.6875rem;
    color: #b0b0aa;
}
.pr-import-action-desc {
    margin: 0.3rem 0 0.7rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #888;
}
.pr-import-lookup-result {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}
.pr-import-chip.is-clickable {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}
.pr-import-chip.is-clickable:hover {
    color: #111;
    background: #ececea;
}
/* Détail des pistes trouvées dans Bridge mais sans client déductible. */
.pr-import-unlinked {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid #ececea;
    max-height: 15rem;
    overflow-y: auto;
}
.pr-import-unlinked-row {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f4f4f2;
}
.pr-import-unlinked-row:last-child {
    border-bottom: 0;
}
.pr-import-unlinked-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #111;
}
.pr-import-unlinked-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}
.pr-import-range {
    font-variant-numeric: tabular-nums;
}
/* Rappel discret du sélecteur de client sur les lignes déjà attribuées. */
.pr-import-add-client {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.35rem;
    padding: 0.15rem 0.3rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #b0b0aa;
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease;
}
.pr-import-add-client:hover {
    color: #111;
}
.pr-import-add-client i {
    font-size: 0.5625rem;
}

/* Onglet Création : liste compacte des tags, colonne Source Bridge / imports. */
.pr-creation-star {
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.pr-creation-star-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
}
.pr-creation-star-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
}
.pr-creation-star-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 650;
    color: #111;
}
.pr-creation-star-body {
    padding: 0 0.85rem 0.85rem;
    border-top: 1px solid #f0f0ed;
}
.pr-creation-search-fields {
    display: grid;
    grid-template-columns: 10.75rem 10.75rem minmax(12rem, 1fr) auto;
    gap: 0.75rem 0.85rem;
    align-items: end;
}
.pr-creation-search-query .admin-tool-input {
    width: 100%;
}
.pr-creation-search-submit {
    display: flex;
    align-items: flex-end;
}
.pr-creation-search-submit .admin-tool-btn-secondary,
.pr-creation-search-actions .admin-tool-btn-danger,
.pr-creation-search-actions .admin-tool-btn-primary {
    min-height: 2.25rem;
}
.pr-creation-search-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0ed;
}
.pr-creation-list {
    overflow: hidden;
}
.pr-creation-toolbar {
    padding: 0.55rem 0.85rem;
}
.pr-creation-grid {
    display: grid;
    grid-template-columns: 1.15rem minmax(7rem, 1.5fr) minmax(12.5rem, 1.35fr) 3.75rem 3.75rem 1.15rem;
    gap: 0.65rem;
    align-items: center;
}
.pr-creation-head {
    padding: 0.4rem 0.85rem;
    border-top: 1px solid #f0f0ed;
    background: #fafaf8;
}
.pr-creation-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #b0b0aa;
    text-align: left;
}
.pr-creation-sort.is-num {
    justify-content: center;
}
.pr-creation-row {
    border-top: 1px solid #f4f4f2;
}
.pr-creation-row.is-picked {
    background: #fcfcfb;
}
.pr-creation-row.is-open {
    background: #fafaf8;
}
.pr-creation-row-main {
    padding: 0.4rem 0.85rem;
    cursor: pointer;
}
.pr-creation-row-main:hover {
    background: #fafaf8;
}
.pr-creation-row-main .admin-tool-count-pill {
    justify-self: center;
}
.pr-creation-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
}
.pr-source {
    display: inline-flex;
    align-items: stretch;
    min-width: 0;
    border: 1px solid #ececea;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.pr-source-seg {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: #666;
    white-space: nowrap;
}
.pr-source-seg + .pr-source-seg {
    border-left: 1px solid #ececea;
}
.pr-source-seg strong {
    font-variant-numeric: tabular-nums;
    color: #111;
}
.pr-source-seg.is-empty {
    color: #c8c8c2;
}
.pr-source-seg.is-empty strong {
    color: #c8c8c2;
}
.pr-source-seg.is-import:not(.is-empty) {
    background: #f5f5f3;
}
.pr-creation-chevron {
    width: 1rem;
    height: 1rem;
    color: #c4c4be;
    transition: transform 0.15s ease;
}
.pr-creation-chevron.is-open {
    transform: rotate(180deg);
}
.pr-creation-projects {
    padding: 0 0.85rem 0.55rem 2.65rem;
}
.pr-creation-project + .pr-creation-project {
    border-top: 1px solid #f4f4f2;
}
.pr-creation-project-hit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.75rem 1.15rem;
    gap: 0.65rem;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: left;
}
.pr-creation-project-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.pr-creation-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    font-size: 0.6875rem;
    color: #999;
}
.pr-creation-muted {
    padding: 0.65rem 0;
    font-size: 0.75rem;
    color: #aaa;
}
.pr-creation-tracks {
    margin: 0 0 0.35rem;
}
.pr-creation-tracks-table {
    width: 100%;
}
.pr-creation-track-cols {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 2fr) 8.25rem 5.25rem;
    column-gap: 0.65rem;
    align-items: center;
}
.pr-creation-track-head,
.pr-creation-track-row {
    padding: 0.4rem 0;
}
.pr-creation-track-head {
    border-bottom: 1px solid #f0f0ed;
}
.pr-creation-track-head span {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #b0b0aa;
    line-height: 1.25;
}
.pr-creation-track-row {
    border-bottom: 1px solid #f5f5f3;
    font-size: 0.75rem;
    color: #444;
}
.pr-creation-track-row > span:not(.is-vis) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pr-creation-track-cols .is-vis {
    text-align: center;
}
.pr-creation-track-row.is-hidden {
    opacity: 0.5;
}
.pr-creation-eye {
    padding: 0.15rem;
    background: none;
    border: 0;
    color: #888;
    cursor: pointer;
}
.pr-creation-eye:hover {
    color: #111;
}
.pr-creation-eye .fa-eye-slash {
    color: #c0392b;
}
@media (max-width: 900px) {
    .pr-creation-search-fields {
        grid-template-columns: 1fr 1fr;
    }
    .pr-creation-search-query,
    .pr-creation-search-submit {
        grid-column: 1 / -1;
    }
    .pr-creation-search-submit .admin-tool-btn-secondary {
        width: 100%;
        justify-content: center;
    }
    .pr-creation-grid {
        grid-template-columns: 1.15rem minmax(0, 1fr) minmax(10.5rem, auto);
    }
    .pr-creation-grid > :nth-child(4),
    .pr-creation-grid > :nth-child(5),
    .pr-creation-grid > :nth-child(6) {
        display: none;
    }
    .pr-creation-track-cols {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 6.5rem 3.25rem;
    }
}
.pr-import-client {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.3rem 0.2rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
}
.pr-import-client.is-manual {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}
/* Attribution déduite du catalogue Bridge (titre + artiste), non d'un libellé du fichier. */
.pr-import-client.is-bridge {
    color: #7c3aed;
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.pr-import-client-remove {
    padding: 0 0.15rem;
    font-size: 0.8125rem;
    line-height: 1;
    color: inherit;
    background: none;
    border: none;
    opacity: 0.5;
    cursor: pointer;
}
.pr-import-client-remove:hover {
    opacity: 1;
}
.pr-import-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}
.pr-import-badge.is-ok {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.pr-import-badge.is-muted {
    color: #888;
    background: #f5f5f3;
    border: 1px solid #ececea;
}
.pr-import-label-todo {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 999px;
}
.pr-import-grouping {
    margin-top: 0.3rem;
    font-size: 0.6875rem;
    color: #b0b0aa;
    overflow-wrap: anywhere;
}
.pr-import-table-wrap {
    max-height: 32rem;
    overflow: auto;
}
.pr-import-table-wrap table.admin-tool-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* =============================================================================
   Budgets — barre unique et grille budget (bu-*)
   admin-tool-table ne couvre pas une grille dense : colonne collante, édition
   inline, glisser-déposer, pied de total figé. On suit le précédent ag-* / ld-*.
   ============================================================================= */
.bu-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.65rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
}
.bu-bar-identity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 10rem;
}
.bu-bar-tools {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    margin-left: auto;
}
.bu-bar-tools .admin-tool-tabs {
    flex-wrap: nowrap;
}
.bu-bar-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 22rem;
}
.bu-bar-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.1rem 0.15rem;
    background: #e8e8e5;
    flex-shrink: 0;
}
.bu-bar-spacer {
    flex: 1 1 auto;
    min-width: 0.5rem;
}
/* Sélecteurs de version et de devise : des Combobox, dont seul le bouton porte
   le cadre. L'ancien habillage de <select> natif, posé sur leur conteneur, les
   encadrait une seconde fois et tronquait « EUR » en « E. ». */
.bu-bar-select {
    flex: 0 1 auto;
    max-width: 16rem;
    min-width: 0;
}
.bu-bar-select .admin-combo-trigger {
    padding: 0.35rem 0.6rem;
}
.bu-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: 14rem;
    color: #4b5563;
    font-size: 0.75rem;
    line-height: 1.2;
}
.bu-live-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
    animation: bu-live-pulse 1.8s ease-out infinite;
    flex-shrink: 0;
}
@keyframes bu-live-pulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.bu-live-names {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bu-live-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
@media (max-width: 1100px) {
    .bu-bar {
        flex-wrap: wrap;
    }
    .bu-bar-identity,
    .bu-bar-tools {
        flex: 1 1 100%;
    }
    .bu-bar-tools {
        margin-left: 0;
        justify-content: space-between;
    }
}
.bu-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    white-space: nowrap;
}
.bu-status.is-draft {
    background: #f2f2f0;
    color: #777;
}
.bu-status.is-published {
    background: #111;
    color: #fff;
}
.bu-status.is-archived {
    background: #fff;
    color: #aaa;
    border: 1px solid #e8e8e5;
}
.bu-menu {
    position: relative;
}
.bu-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
    min-width: 14rem;
    padding: 0.3rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 9px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.1);
}
.bu-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.45rem 0.6rem;
    font-size: 0.8125rem;
    color: #444;
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.bu-menu-item i {
    width: 1rem;
    font-size: 0.75rem;
    color: #aaa;
    text-align: center;
}
.bu-menu-item:hover:not(:disabled) {
    background: #f5f5f3;
    color: #111;
}
.bu-menu-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.bu-menu-item.is-danger {
    color: #b91c1c;
}
.bu-menu-item.is-danger i {
    color: #f0a3a3;
}
.bu-menu-item.is-danger:hover {
    background: #fef2f2;
    color: #b91c1c;
}
.bu-menu-sep {
    height: 1px;
    margin: 0.3rem 0.35rem;
    background: #f0f0ed;
}

.bu-grid-wrap {
    position: relative;
    overflow: auto;
    /* Réserve la place du filet de défilement plutôt que de le laisser en
       survol : sans ça, la colonne d'actions collée à droite se retrouvait
       recouverte par la barre — les icônes restaient là, juste inatteignables
       et à moitié invisibles. Sans effet sur les navigateurs qui ne le
       connaissent pas encore : ils gardent leur comportement d'aujourd'hui. */
    scrollbar-gutter: stable;
    max-height: calc(100vh - 12rem);
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
}
/* Barres de défilement classiques, qui prennent leur place : en surimpression
   (réglage par défaut de macOS), le filet horizontal recouvrait la ligne Total
   collée en bas et le filet vertical la colonne d'actions. `scrollbar-gutter`
   n'y change rien, ces barres n'occupant aucune place. Pas de `scrollbar-width`
   ni `scrollbar-color` ici : Chrome ignorerait alors ces règles. */
.bu-grid-wrap::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
.bu-grid-wrap::-webkit-scrollbar-track {
    background: #fafaf8;
}
.bu-grid-wrap::-webkit-scrollbar-thumb {
    background: #cfcfca;
    border-radius: 6px;
    border: 3px solid #fafaf8;
}
.bu-grid-wrap::-webkit-scrollbar-thumb:hover {
    background: #a8a8a2;
}
.bu-grid-wrap::-webkit-scrollbar-corner {
    background: #fafaf8;
}
table.bu-grid {
    /* `100%` est une largeur définie : `table-layout: fixed` s'applique
       vraiment, les colonnes ne suivent plus le min-content d'un <select>.
       Un plancher en rem (140rem) laissait une bande vide à droite une
       fois le défilement au bout. */
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    color: #333;
}
table.bu-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0.5rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #b0b0aa;
    text-align: left;
    white-space: nowrap;
    background: #fafaf8;
    border-bottom: 1px solid #e8e8e5;
}
/* Poignée de redimensionnement des colonnes — `position: sticky` sur le <th>
   fait déjà office de cadre de positionnement pour cet enfant absolu. Zone de
   prise plus large (6px) que le trait visible (à l'état survolé/actif
   seulement) : sinon, viser un pixel de bordure exact est illusoire. */
.bu-col-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    touch-action: none;
    z-index: 1;
}
.bu-col-resize-handle:hover,
.bu-col-resize-handle:active {
    background: rgba(17, 17, 17, 0.15);
}
table.bu-grid thead th.bu-num {
    text-align: right;
}
/* En-tête commun (TableHeader) : il pose h-12 — nos tableaux gardent leur bande
   serrée. Les libellés restent à gauche, contre le trait de leur colonne, comme
   dans les autres outils ; seuls les montants du corps s'alignent à droite.
   La colonne de remplissage (sans largeur) prend la place restante : chaque
   colonne garde exactement la sienne, au lieu d'être étirée par le navigateur. */
table.bu-grid thead th,
table.bu-cols-table thead th {
    height: auto;
}
table.bu-cols-table tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
}
table.bu-grid .bu-col-filler,
table.bu-cols-table .bu-col-filler {
    padding: 0 !important;
}
/* Gouttière gauche des colonnes de données : 1 rem, pour que trait, poignée et
   libellé ne se touchent pas au survol — la poignée s'y centre, autant d'air de
   chaque côté. Le corps suit (textes alignés sur leur en-tête) ; les montants,
   calés à droite, gardent leur marge, comme poste, actions, remplissage et
   bandes d'insertion. */
table.bu-grid thead th[data-column-key],
table.admin-tool-table.bu-cols-table thead th[data-column-key] {
    padding-left: 1rem;
}
table.bu-grid tbody td:not(.bu-num):not(.bu-grid-sticky):not(.bu-grid-sticky-end):not(.bu-col-filler):not(.bu-insert-cell):not(.bu-empty-cell),
table.bu-cols-table tbody td:not(.bu-num):not(.bu-col-filler):not(:last-child),
table.bu-cols-table tfoot td:not(.bu-num):not(.bu-col-filler):not(:last-child),
table.bu-cols-table tfoot tr.bu-expense-foreign td {
    padding-left: 1rem;
}
/* « Poste » et « Total » : alignés sur les postes de premier niveau (12 px). */
table.bu-grid thead th.bu-grid-sticky,
table.bu-grid tfoot td.bu-grid-sticky {
    padding-left: 12px;
}
table.bu-grid .column-drag-row th .table-header-grip,
table.bu-cols-table .column-drag-row th .table-header-grip {
    left: 4px;
    font-size: 8px;
}
/* Devisé au-dessus du budget. */
table.bu-grid td.bu-over-budget,
table.bu-grid td.bu-over-budget .bu-drill {
    color: #b91c1c;
}
table.bu-grid tfoot td.bu-over-budget {
    color: #fca5a5;
}
.bu-over-budget-icon {
    margin-right: 0.3rem;
    font-size: 0.6875rem;
}
/* Menu des colonnes ouvert depuis la barre d'outils d'un tableau : placé en
   position fixe sous son bouton (toggleColumnsMenu), au-dessus du fond qui le ferme. */
.bu-columns-toolbar-menu {
    position: fixed;
    z-index: 50;
}
.bu-expense-filters button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
}
.bu-filter-count {
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.6;
}
.bu-grid-quote-tag {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.6875rem;
    color: #777;
    background: #f2f2f0;
    border-radius: 999px;
}
.bu-expense-foreign td {
    font-size: 0.75rem;
    font-weight: 500 !important;
    color: #92400e !important;
    background: #fffbeb !important;
}
/* Où en est la version affichée par rapport à ce que voient les partenaires. */
.bu-version-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    border-radius: 8px;
    border: 1px solid #ecece9;
    background: #fafaf8;
    color: #666;
}
.bu-version-notice i {
    font-size: 0.75rem;
}
.bu-version-notice.is-info {
    background: #f4f7fb;
    border-color: #dde6f1;
    color: #3b5575;
}
.bu-version-notice.is-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
/* Menu des colonnes : rendu hors du panneau défilant, qui le rognerait. */
.bu-grid-shell {
    position: relative;
}
.bu-columns-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}
.bu-columns-menu-anchor {
    position: absolute;
    top: 2.1rem;
    left: 0;
    z-index: 50;
}
.bu-poste-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}
.bu-columns-btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
    color: #b0b0aa;
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
}
.bu-columns-btn:hover,
.bu-columns-btn.is-open {
    color: #111;
    background: #ececea;
}
table.bu-grid tbody td {
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid #f5f5f3;
    vertical-align: middle;
    /* Une grille budgétaire se lit en colonnes : seul le poste, colonne
       descriptive, s'autorise deux lignes. Le reste déborde en défilement
       horizontal, la colonne poste restant collée à gauche. */
    white-space: nowrap;
    /* Sans ça, un <select> natif (largeur = plus longue option) déborde
       sur les colonnes voisines dès qu'on édite la ligne. */
    overflow: hidden;
}
table.bu-grid tbody td.bu-grid-sticky {
    white-space: normal;
    overflow: hidden;
}
/* Largeur plancher : de quoi loger un montant formaté et son champ d'édition
   sans que la colonne ne saute quand on passe de l'un à l'autre. */
table.bu-grid thead th.bu-num {
    width: 6.5rem;
    min-width: 6.5rem;
}
table.bu-grid thead th.bu-grid-sticky {
    width: 13rem;
    min-width: 13rem;
}
/* La colonne « valeur » loge un montant et son sélecteur € / % en édition. */
table.bu-grid thead th.bu-col-rate {
    width: 9rem;
    min-width: 9rem;
}
/* Ces trois colonnes texte ont un contenu libre (nom, mode, détail, et
   surtout le <select> de ligne de base en %). Sans plafond, elles
   s'élargissent jusqu'à faire défiler la grille et passer sous Poste. */
table.bu-grid thead th.bu-col-party,
table.bu-grid tbody td.bu-col-party {
    width: 11rem;
    max-width: 11rem;
    text-overflow: ellipsis;
}
table.bu-grid thead th.bu-col-pay,
table.bu-grid tbody td.bu-col-pay {
    width: 10.5rem;
    max-width: 10.5rem;
    text-overflow: ellipsis;
}
table.bu-grid thead th.bu-col-subcategory,
table.bu-grid tbody td.bu-col-subcategory {
    width: 14rem;
    max-width: 14rem;
}
table.bu-grid tbody td.bu-col-subcategory {
    /* Le détail et le sélecteur de ligne de base doivent se superposer,
       pas s'aligner en ligne (white-space: nowrap du td les mettrait côte à côte). */
    white-space: normal;
}
table.bu-grid tbody td.bu-col-subcategory .bu-grid-input {
    display: block;
}
/* Seul le combobox de lignes liées, empilé sous le champ détail, a besoin de
   cet écart — les autres (mode de paiement, taux, devise, section parente)
   sont seuls dans leur cellule et ce même écart les décalait vers le bas par
   rapport aux champs voisins de la même ligne. */
table.bu-grid td.bu-col-subcategory .bu-grid-combo {
    margin-top: 0.25rem;
}
table.bu-grid .bu-grid-combo .admin-combo-trigger,
table.bu-grid .bu-grid-combo .admin-combo-trigger.is-compact {
    padding: 0.15rem 0.35rem;
    font-size: 0.8125rem;
    color: #111;
    background: #fff;
    border-color: #d8d8d4;
    border-radius: 5px;
}
table.bu-grid thead th.bu-col-foreign {
    width: 8rem;
    min-width: 8rem;
}
table.bu-grid thead th.bu-col-docs {
    width: 6.5rem;
    max-width: 6.5rem;
}
table.bu-grid thead th.bu-grid-sticky-end,
table.bu-grid tbody td.bu-grid-sticky-end,
table.bu-grid tfoot td.bu-grid-sticky-end {
    /* Une section porte six icônes (déplacer, +ligne, +sous-section, modifier,
       commenter, supprimer) : à 22 px chacune plus les marges, la corbeille
       était rognée à 7,75 rem. */
    width: 10rem;
    max-width: 10rem;
    /* Un peu plus large qu'à droite qu'ailleurs : la corbeille ne doit
       jamais se retrouver à ras du bord, filet de défilement ou pas. */
    padding-right: 0.9rem;
}
table.bu-grid tbody td.bu-col-party > *,
table.bu-grid tbody td.bu-col-pay > *,
table.bu-grid tbody td.bu-col-subcategory > * {
    max-width: 100%;
}
table.bu-grid tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 0.6rem;
    font-weight: 700;
    color: #fff;
    background: #111;
    white-space: nowrap;
}
.bu-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
/* Colonne « poste » collante : garde le contexte au défilement horizontal. */
.bu-grid-sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 #f0f0ed;
}
table.bu-grid thead th.bu-grid-sticky {
    z-index: 4;
    background: #fafaf8;
    box-shadow: 1px 0 0 #e8e8e5;
}
table.bu-grid tfoot td.bu-grid-sticky {
    z-index: 4;
    background: #111;
    box-shadow: none;
}
/* Colonne d'actions collée à droite : le crayon reste cliquable sans
   faire défiler Nom / Paiement / Sous-catégorie sous la colonne Poste. */
.bu-grid-sticky-end {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -1px 0 0 #f0f0ed;
}
table.bu-grid thead th.bu-grid-sticky-end {
    z-index: 4;
    background: #fafaf8;
    box-shadow: -1px 0 0 #e8e8e5;
}
table.bu-grid tfoot td.bu-grid-sticky-end {
    z-index: 4;
    background: #111;
    box-shadow: none;
}
.bu-row-line:hover > td.bu-grid-sticky-end {
    background: #fafaf8;
}
.bu-row-drop > td.bu-grid-sticky-end {
    background: #f0f0ed;
}
.bu-row-draft > td.bu-grid-sticky-end {
    background: #fafaf8;
}
.bu-row-line:hover > td {
    background: #fafaf8;
}
.bu-row-line:hover > td.bu-grid-sticky,
table.bu-grid tbody td.bu-col-party.is-row-hover {
    background: #fafaf8;
}
.bu-row-section0 > td {
    background: #f2f2f0;
    color: #111;
    font-weight: 700;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-top: 1px solid #e8e8e5;
    border-bottom: 1px solid #e8e8e5;
}
.bu-row-section1 > td {
    background: #fafaf8;
    color: #444;
    font-weight: 600;
}
.bu-row-section-session > td {
    background: #f4f4f2;
    color: #333;
    font-weight: 600;
    font-size: 0.75rem;
}
.bu-row-group > td.bu-grid-sticky {
    background: #fcfcfb;
}
.bu-row-drop > td {
    background: #f0f0ed;
    box-shadow: inset 0 0 0 1px #ccc;
}
.bu-row-drop > td.bu-grid-sticky {
    background: #f0f0ed;
}
.bu-row-insert-before > td {
    box-shadow: inset 0 2px 0 #111;
}
.bu-row-insert-after > td {
    box-shadow: inset 0 -2px 0 #111;
}
.bu-row-draft > td {
    background: #fafaf8;
    border-bottom: 1px solid #e8e8e5;
}
/* Budget vide : le bloc « ajouter un poste / une section » reste au centre
   du TABLEAU (pas de l'écran entier — il doit rester à l'intérieur), y
   compris si .bu-grid-wrap vient à défiler en interne (overflow:auto,
   max-height bornée). La cellule reçoit une vraie hauteur pour avoir de la
   place à offrir ; le bloc s'y ancre en sticky plutôt qu'en position
   figée dans le flux, pour rester centré si ce cadre défile. */
table.bu-grid tr.bu-row-empty td.bu-empty-cell {
    height: 50vh;
    padding: 0;
}
.bu-empty-cta {
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #aaa;
}
.bu-row-draft > td.bu-grid-sticky {
    background: #fafaf8;
}
.bu-cell-role {
    max-width: 17rem;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #b0b0aa;
    line-height: 1.3;
}
.bu-cell-code {
    margin-right: 0.4rem;
    font-size: 0.75rem;
    color: #b0b0aa;
    font-variant-numeric: tabular-nums;
}
/* Chevron pour replier une section : pointe vers le bas ouverte, pivote à
   l'horizontale repliée — la sous-arborescence sort alors de `rows`. */
.bu-section-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-right: 0.3rem;
    padding: 0;
    font-size: 0.625rem;
    color: #b0b0aa;
    background: none;
    border: none;
    cursor: pointer;
    vertical-align: -1px;
    transition: transform 0.14s, color 0.14s;
}
.bu-section-toggle:hover {
    color: #111;
}
.bu-section-toggle.is-collapsed {
    transform: rotate(-90deg);
}
/* Pendant un glisser, les fusions se défont et chaque ligne doit loger son propre poste. Sur deux
   lignes (numéro, puis libellé) il épaissit les rangées et décale tout ce qui est dessous, y compris
   le fantôme : on le compacte sur une seule ligne, pour que les rangées gardent leur hauteur de repos. */
table.bu-grid.is-reordering tbody td.bu-grid-sticky,
.bu-drag-ghost td:first-child {
    white-space: nowrap;
}
table.bu-grid.is-reordering .bu-cell-role,
.bu-drag-ghost .bu-cell-role {
    display: none;
}
table.bu-grid.is-reordering .bu-cell-main,
.bu-drag-ghost .bu-cell-main {
    display: inline;
}
.bu-cell-main {
    max-width: 17rem;
    line-height: 1.3;
    color: #111;
}
/* Sous-catégorie : un nom de facture importé peut être très long, il tient sur
   une ligne et se poursuit en infobulle plutôt que d'étirer la colonne. */
.bu-cell-clamp {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bu-muted {
    color: #b0b0aa;
}
.bu-pos {
    color: #15803d;
}
.bu-neg {
    color: #b91c1c;
}
.bu-row-section0 .bu-pos {
    color: #15803d;
}
.bu-row-section0 .bu-neg {
    color: #b91c1c;
}
/* Ligne de crédit dans les dépenses (avoir, remboursement). */
.admin-tool-count-pill.bu-credit-pill {
    background: #e7f4ea;
    color: #15803d;
}
/* Provenance du montant : marqueur discret, formule en infobulle. */
.bu-formula {
    margin-left: 0.3rem;
    font-size: 0.625rem;
    color: #c4c4be;
    cursor: help;
}
.bu-link-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
    margin-top: 0.15rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.6875rem;
    line-height: 1.4;
    color: #777;
    background: #f5f5f3;
    border-radius: 999px;
}
.bu-link-badge i {
    font-size: 0.5625rem;
    color: #b0b0aa;
    flex-shrink: 0;
}
.bu-link-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Texte tronqué : au survol, le badge s'allonge et flotte par-dessus la suite de la ligne.
   La copie flottante est superposée au badge en place, qui garde sa taille : la hauteur de
   la ligne ne bouge pas. Sous l'en-tête collant (z-index 4), au-dessus des colonnes collées. */
.bu-link-badge-slot {
    position: relative;
    display: block;
}
.bu-link-badge-full {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    width: max-content;
    max-width: 32rem;
    margin-top: 0;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px rgba(17, 17, 17, 0.18);
}
.bu-link-badge-full span {
    overflow: visible;
    white-space: normal;
}
.bu-link-badge-slot.is-clipped:hover .bu-link-badge-full {
    display: flex;
}
/* La cellule rogne son contenu (overflow: hidden) : elle le laisse déborder le temps du survol. */
table.bu-grid tbody td:has(.bu-link-badge-slot.is-clipped:hover) {
    overflow: visible;
}
/* Plan de financement : la source porte l'estimation, ses échéances le réel. */
.bu-financing-table td {
    vertical-align: top;
}
.bu-financing-source > td {
    background: #fff;
}
.bu-financing-installment > td {
    background: #fcfcfb;
    font-size: 0.78125rem;
}
.bu-financing-installment.is-cancelled > td {
    color: #9a9a94;
    text-decoration: line-through;
}
.bu-financing-installment.is-received > td:first-child {
    box-shadow: inset 2px 0 0 #111;
}
.bu-financing-table tfoot td {
    background: #fff;
    border-top: 1px solid #111;
    font-weight: 600;
    color: #111;
}
.bu-tree-toggle {
    border: none;
    background: none;
    color: #9a9a94;
    cursor: pointer;
    padding: 0 0.35rem 0 0;
    font-size: 0.6875rem;
}
.bu-tree-toggle:hover {
    color: #111;
}
.bu-tree-branch {
    display: inline-block;
    width: 1.1rem;
    border-bottom: 1px solid #e0e0dd;
    margin: 0 0.4rem 0.2rem 0.35rem;
    vertical-align: middle;
}
.bu-drop-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid #f0f0ed;
    background: #fafaf8;
    color: #787872;
    font-size: 0.75rem;
}
.bu-inline-link {
    border: none;
    background: none;
    padding: 0;
    margin-left: 0.4rem;
    color: #111;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}
/* Bas du plan de financement : deux jauges côte à côte, couverture et encaissement. */
.bu-financing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.75rem;
    padding: 0.9rem 1rem 1rem;
    background: #fafaf8;
    border-top: 1px solid #f0f0ed;
}
.bu-meter {
    padding: 0.8rem 0.9rem 0.75rem;
    background: #fff;
    border: 1px solid #ecece9;
    border-radius: 8px;
}
.bu-meter-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}
.bu-meter-rate {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111;
    font-variant-numeric: tabular-nums;
}
.bu-meter-figures {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0.3rem 0 0.6rem;
    font-size: 0.8125rem;
}
.bu-meter-figures strong {
    font-size: 1.0625rem;
    color: #111;
    font-variant-numeric: tabular-nums;
}
.bu-meter-foot {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.admin-tool-progress-bar.is-collected {
    background: #6b6b64;
}
.bu-clip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.6875rem;
    color: #666;
    background: #f5f5f3;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.bu-clip:hover {
    background: #ececea;
    color: #111;
}
/* Montants Engagé / Réalisé : cliquables vers les dépenses qui les composent. */
.bu-drill {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    border-bottom: 1px dotted #ccc;
}
.bu-drill:hover {
    color: #111;
    border-bottom-color: #111;
}
.bu-grid-inline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    max-width: 100%;
}
.bu-grid-inline > .bu-grid-input:not(.w-11):not(.w-14) {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}
.bu-grid-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.15rem 0.35rem;
    font-size: 0.8125rem;
    color: #111;
    background: #fff;
    border: 1px solid #d8d8d4;
    border-radius: 5px;
    outline: none;
}
table.bu-grid select.bu-grid-input {
    /* WebKit ignore souvent min-width: 0 sur un select : la plus longue
       <option> impose alors la largeur et le contrôle recouvre la grille. */
    max-width: 100%;
}
.bu-grid-input:focus {
    border-color: #111;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}
/* Une aide de saisie s'efface derrière la valeur qu'on tape. */
.bu-grid-input::placeholder {
    color: #c8c8c2;
    font-weight: 400;
}
.bu-grid-input.bu-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
/* Les flèches natives des champs numériques rognent la valeur dans une grille
   dense, et on saisit ici au clavier. */
.bu-grid-input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.bu-grid-input[type='number']::-webkit-outer-spin-button,
.bu-grid-input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* Le rôle est une précision au-dessus du libellé : il reste en retrait plutôt
   que d'ouvrir la ligne d'édition avec un champ criard en capitales. */
.bu-grid-input-role {
    margin-bottom: 0.25rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.6875rem;
    color: #666;
    background: #fafaf8;
    border-color: #ececea;
}
.bu-grid-computed {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.8125rem;
    color: #777;
    background: #f5f5f3;
    border-radius: 5px;
    font-variant-numeric: tabular-nums;
}
.bu-grid-computed i {
    font-size: 0.625rem;
    color: #b0b0aa;
}
.bu-icon-btn {
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
    color: #b0b0aa;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.14s;
}
.bu-icon-btn:hover {
    color: #111;
}
.bu-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.bu-icon-btn:disabled:hover {
    color: #b0b0aa;
}
.bu-icon-btn.is-danger:hover {
    color: #b91c1c;
}
.bu-icon-btn.is-on {
    color: #111;
}
.bu-comment-count {
    margin-left: 0.15rem;
    font-size: 0.625rem;
    font-variant-numeric: tabular-nums;
}
.bu-comments-panel {
    max-width: 28rem;
}
.bu-comments-list {
    min-height: 12rem;
    max-height: min(28rem, 50vh);
}
.bu-comment {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}
.bu-comment:last-child {
    margin-bottom: 0;
}
.bu-comment-avatar {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f3f3f0;
    color: #555;
    font-size: 0.625rem;
    font-weight: 600;
    margin-top: 0.1rem;
}
.bu-comment-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.6875rem;
}
.bu-comment-author {
    font-weight: 600;
    color: #111;
}
.bu-comment-body {
    margin-top: 0.15rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}
.bu-fav-col {
    width: 2rem;
    padding-right: 0 !important;
}
.bu-fav-btn {
    padding: 0.15rem 0.3rem;
    font-size: 0.8125rem;
    color: #d0d0cc;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: color 0.14s;
}
.bu-fav-btn:hover {
    color: #c4a35a;
}
.bu-fav-btn.is-on {
    color: #c4a35a;
}
.bu-fav-filter.is-on {
    color: #8a6a1f;
    border-color: #e8d4a8;
    background: #fbf6ea;
}
.admin-tool-root table.admin-tool-table tbody tr:hover td.bu-fav-col {
    color: inherit;
}
/* Import d'une NDA : les opérations proposées, cochables une à une. */
.bu-nda-ops {
    margin-top: 0.6rem;
    display: grid;
    /* minmax(0, …) : sans cela, le menu d'une ligne cible (texte long, insécable) élargit toute la liste. */
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
    font-size: 0.8125rem;
}
.bu-nda-target {
    box-sizing: border-box;
    margin: 0.25rem 0 0 1.5rem;
    width: calc(100% - 1.5rem);
    max-width: calc(100% - 1.5rem);
    text-overflow: ellipsis;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.75rem;
}
.bu-nda-target-name {
    display: block;
    margin: 0.15rem 0 0 1.5rem;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bu-nda-warning {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #8a6a1f;
}
/* Aperçu d'un classeur (xls, xlsx, csv) dans la visionneuse de documents. */
.bu-sheet-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem 0;
    overflow-x: auto;
    background: #ecece8;
    border-bottom: 1px solid #e0e0dc;
}
.bu-sheet-tab {
    flex: none;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #66665f;
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
}
.bu-sheet-tab:hover {
    color: #111;
}
.bu-sheet-tab.is-on {
    color: #111;
    background: #fff;
    border-color: #e0e0dc;
}
table.bu-sheet-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    font-size: 0.75rem;
    background: #fff;
}
table.bu-sheet-table td,
table.bu-sheet-table th {
    padding: 0.25rem 0.55rem;
    border-right: 1px solid #efefec;
    border-bottom: 1px solid #efefec;
    white-space: pre-wrap;
    max-width: 24rem;
    vertical-align: top;
}
table.bu-sheet-table th {
    position: sticky;
    left: 0;
    min-width: 2.2rem;
    font-weight: 500;
    color: #a0a09a;
    text-align: right;
    background: #fafaf8;
}
table.bu-sheet-table td.is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.bu-sheet-note {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
    color: #8a6a1f;
    background: #fbf6ea;
    border-top: 1px solid #e8d4a8;
}
/* Volets de la liste des projets : bandeau de groupe, nom renommable au double-clic. */
.admin-tool-root table.admin-tool-table tr.bu-group-row > td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    background: #f5f5f2;
    border-top: 1px solid #e8e8e5;
    cursor: pointer;
}
.bu-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.75rem;
}
.bu-group-icon {
    font-size: 0.8125rem;
    color: #b0b0aa;
}
.bu-group-name {
    font-weight: 700;
    color: #111;
    /* Le double-clic renomme : il ne doit pas aussi sélectionner le mot. */
    user-select: none;
    -webkit-user-select: none;
}
.bu-group-name-input {
    width: 20rem;
    max-width: 100%;
    font-weight: 700;
    user-select: text;
    -webkit-user-select: text;
}
.bu-group-delete {
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.14s;
}
tr.bu-group-row:hover .bu-group-delete,
tr.bu-group-row:focus-within .bu-group-delete {
    opacity: 1;
}
tr.bu-group-row.is-dragging,
.admin-tool-table tr.is-dragging {
    opacity: 0.45;
}
.admin-tool-root table.admin-tool-table tr.is-drop > td {
    background: #eef3fb;
    box-shadow: inset 0 2px 0 #111;
}
.admin-tool-root table.admin-tool-table tr.is-drop:not(.bu-group-row) > td {
    box-shadow: none;
}
tr.bu-group-empty > td {
    padding-left: 2.75rem;
    font-size: 0.8125rem;
    font-style: italic;
}
.bu-group-select {
    width: 11rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.8125rem;
}
/* Dépliage de l'arborescence des versions dans la liste des projets. */
.bu-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.35rem;
    padding: 0;
    font-size: 0.625rem;
    color: #b0b0aa;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.14s, color 0.14s;
}
.bu-tree-toggle:hover {
    color: #111;
}
.bu-tree-toggle.is-open {
    transform: rotate(90deg);
}
.bu-version-row {
    background: #fafaf8;
    font-size: 0.8125rem;
}
.bu-version-row:hover {
    background: #f0f0ed;
}
.bu-version-icon {
    margin-right: 0.4rem;
    margin-left: 1.5rem;
    color: #c8c8c2;
    font-size: 0.6875rem;
}
.bu-grip {
    cursor: grab;
    color: #d8d8d4;
    padding: 0.15rem 0.3rem;
    font-size: 0.75rem;
}
.bu-grip:hover {
    color: #888;
}
/*
 * Insertion entre deux lignes. La bande se révèle près d'une jointure entre
 * deux lignes — au bord haut ou bas d'une ligne, à quelques pixels près
 * (BU_BudgetGrid.insertRowNear) — jamais sur le corps d'une ligne : la lire ne
 * doit pas faire surgir un bouton en dessous. Les classes sont posées par le
 * JS, pas par `:hover` : lui seul sait mesurer cette marge, minuter l'attente
 * et l'écourter sur un clic. Le bouton reste dans la colonne Poste — la
 * seule qui ne parte pas quand la grille défile de côté — d'où la première
 * cellule réelle, qui hérite du collage de `.bu-grid-sticky` plutôt que d'un
 * `position: sticky` dans un bloc absolu, qui ne colle pas.
 */
.bu-insert-row td.bu-insert-cell {
    height: 0.4rem;
    padding: 0 !important;
    border: none !important;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    /* Retour au repos : rapide, sans délai, dès que la souris quitte la zone. */
    transition: height 0.18s ease;
}
/*
 * Deux classes, deux temps. `.is-near` : dès la marge franchie, un souffle de
 * 0,4 rem devient un filet gris — discret, il dit seulement qu'on peut
 * insérer ici. `.is-open` : posée par `BU_BudgetGrid.armInsertOpen`, après
 * 2,5 s d'attente ou tout de suite si l'on clique avant — la ligne s'ouvre
 * pour de bon, prend une vraie hauteur, pousse les lignes voisines, et les
 * boutons se posent au centre, sur de l'espace réel plutôt qu'en survol
 * flottant d'une ligne trop fine pour les recevoir. Comme c'est le JS qui
 * décide du moment où `.is-open` apparaît, la transition elle-même n'a plus
 * besoin de délai : un clic anticipé se voit aussi vite qu'une attente allée
 * à son terme.
 */
.bu-insert-row.is-open td.bu-insert-cell {
    height: 2.75rem;
    transition: height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.bu-insert-row td.bu-grid-sticky.bu-insert-cell {
    position: relative;
    z-index: 6;
}
.bu-insert-fill {
    position: relative;
}
/*
 * Un seul trait, pas deux. La bande tient en deux <td> (le collant Poste, puis
 * le remplissage qui porte le reste des colonnes) : donner à chacun son propre
 * `::before` produisait deux balayages indépendants, chacun cadré sur sa
 * propre largeur — visible comme une coupure au niveau de la colonne Poste.
 * Le trait vit uniquement dans la cellule de remplissage, mais déborde vers
 * la gauche exactement de la largeur de la colonne Poste (13rem, la même
 * constante que `table.bu-grid thead th.bu-grid-sticky`) : son origine réelle
 * est donc le bord gauche de la ligne entière, et `scaleX` balaie tout d'un
 * geste. `overflow: visible` sur la cellule (posé plus haut) laisse ce
 * débordement s'afficher ; son fond transparent laisse voir le trait au
 * travers de la colonne collante qui passe par-dessus.
 */
.bu-insert-fill::before {
    content: '';
    position: absolute;
    left: -13rem;
    right: 0;
    top: 50%;
    height: 2px;
    background: #c8c8c2;
    opacity: 0;
    transform: translateY(-50%) scaleX(0);
    transform-origin: left center;
    transition:
        transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.12s,
        height 0.2s ease,
        background-color 0.2s ease;
}
.bu-insert-row.is-near .bu-insert-fill::before {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
}
/*
 * Position fixe, calculée à la main (BU_BudgetGrid.followInsertRow) plutôt que
 * confiée au flux : la cible — l'espace fin entre deux lignes — est trop
 * étroite pour porter un conteneur qui se repositionne tout seul. Le JS pose
 * `left`/`top` en continu pendant le survol pour que la pastille suive la
 * souris le long de la ligne, comme sur un tableur large qui défile.
 * Sans position posée, elle attend hors champ plutôt qu'au coin de l'écran.
 */
.bu-insert-actions {
    position: fixed;
    top: -9999px;
    left: -9999px;
    z-index: 30;
    display: inline-flex;
    align-items: stretch;
    height: 2.125rem;
    overflow: hidden;
    background: #111;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.2), 0 2px 6px rgba(17, 17, 17, 0.13);
    opacity: 0;
    /* `visibility` ne s'interpole pas : elle bascule d'un coup, ce qui suffit
       à empêcher la pastille invisible d'intercepter un clic avant l'heure. */
    visibility: hidden;
    transform: translateY(-50%) scale(0.9);
    transform-origin: left center;
    transition:
        opacity 0.2s ease,
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s,
        left 0.1s ease-out,
        top 0.1s ease-out;
}
.bu-insert-row.is-open .bu-insert-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%);
    transition:
        opacity 0.2s ease,
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0s,
        left 0.1s ease-out,
        top 0.1s ease-out;
}
.bu-insert-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.15rem;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.12s;
}
.bu-insert-btn i {
    font-size: 0.8125rem;
    color: #9a9a94;
    transition: color 0.12s;
}
.bu-insert-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}
.bu-insert-btn:hover i {
    color: #fff;
}
.bu-insert-btn.is-section {
    border-left: 1px solid rgba(255, 255, 255, 0.16);
}
/* Raccourcis rappelés sous la ligne en cours de saisie. */
.bu-draft-hint {
    margin-top: 0.25rem;
    font-size: 0.5625rem;
    line-height: 1.3;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: #9a9a94;
}
/* Section survolée pendant un glisser : la ligne s'y rangera en dernier. */
.bu-row-insert-into > td {
    box-shadow: inset 0 0 0 2px #111;
}
/* Choix de la section, en édition inline d'une ligne. */
.bu-move-picker {
    margin-top: 0.2rem;
    gap: 0.25rem;
    color: #9a9a94;
    font-size: 0.625rem;
}
.bu-move-picker select {
    font-size: 0.6875rem;
}
.bu-drag-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    font-size: 0.8125rem;
}
.bu-suggestion {
    position: fixed;
    right: 1rem;
    top: 6rem;
    z-index: 50;
    width: 20rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}
/* Dépôt d'une facture : les factures PennyLane proposées demandent un peu plus de place. */
.bu-suggestion.is-wide {
    width: 24rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
}
/* Factures fournisseurs PennyLane (BU_PennylanePicker, fiche dépense). */
.bu-pl-picker {
    display: grid;
    gap: 0.5rem;
}
.bu-pl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.bu-pl-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111;
}
.bu-pl-search {
    display: flex;
    gap: 0.4rem;
}
.bu-pl-search .admin-tool-input {
    flex: 1;
    min-width: 0;
}
.bu-pl-caption {
    font-size: 0.75rem;
    color: #777;
}
.bu-pl-link {
    margin-left: 0.35rem;
    padding: 0;
    font-size: 0.75rem;
    color: #111;
    background: none;
    border: none;
    border-bottom: 1px dotted #999;
    cursor: pointer;
}
.bu-pl-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
}
.bu-pl-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    cursor: pointer;
}
.bu-pl-option:hover {
    background: #fafaf8;
}
.bu-pl-option.is-on {
    border-color: #111;
    background: #fafaf8;
}
.bu-pl-option input {
    margin-top: 0.2rem;
}
.bu-pl-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}
.bu-pl-number {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111;
}
.bu-pl-amount {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #444;
}
.bu-pl-view {
    align-self: center;
}
.bu-pl-meta,
.bu-pl-reasons,
.bu-pl-elsewhere {
    display: block;
    font-size: 0.75rem;
    color: #777;
}
.bu-pl-reasons {
    color: #b0b0aa;
}
.bu-pl-elsewhere {
    color: #8a6a1f;
}
.bu-pl-elsewhere i {
    margin-right: 0.25rem;
}
.bu-pl-paid {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0 0.35rem;
    font-size: 0.6875rem;
    color: #777;
    background: #f2f2f0;
    border-radius: 999px;
}
.bu-pl-paid.is-paid {
    color: #15803d;
    background: #e7f4ea;
}
.bu-pl-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #777;
}
.bu-pl-error {
    font-size: 0.75rem;
    color: #b91c1c;
}
.bu-pl-section {
    display: grid;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0ed;
}
.bu-pl-card {
    display: grid;
    gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
}
.bu-pl-discard {
    display: grid;
    gap: 0.25rem;
}
.bu-pl-discard-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    font-size: 0.8125rem;
}
/* La facture PennyLane d'une dépense, parmi ses pièces jointes. */
.bu-clip.bu-clip-pl {
    color: #111;
    background: #ececea;
}
.bu-pl-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.05rem 0.45rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #111;
    background: #f0f0ed;
    border-radius: 999px;
    white-space: nowrap;
}
/* Colonne Comptabilisé : repère des factures reliées, et cible du dépôt d'une facture. */
.bu-pl-mark {
    margin-right: 0.35rem;
    padding: 0;
    font-size: 0.6875rem;
    color: #b0b0aa;
    background: none;
    border: none;
    cursor: pointer;
}
.bu-pl-mark:hover {
    color: #111;
}
.bu-row-drop > td.bu-col-actual {
    background: #fff;
    box-shadow: inset 0 0 0 2px #111;
}
.bu-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
}
.bu-overlay-pill {
    padding: 0.6rem 1rem;
    font-size: 0.8125rem;
    color: #fff;
    background: #111;
    border-radius: 8px;
}

/* =============================================================================
   Live Dates — Vue mobile (<768px, classe .ld-mobile-root sur le conteneur)
   Les <style> injectés dans les templates Vue ne sont pas rendus par Vue 3.
   ============================================================================= */
.ld-mobile-root {
    position: relative;
    z-index: 1;
    padding-bottom: 5.5rem;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}
.ld-mobile-root button,
.ld-mobile-root [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
    cursor: pointer;
}
.ld-mobile-tab-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ld-mobile-tab-scroll::-webkit-scrollbar {
    display: none;
}
.ld-mobile-card-btn {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    text-align: left;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.ld-mobile-card-btn:active {
    background: #f9fafb;
}
.ld-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}
.ld-mobile-drawer-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99990 !important;
    display: flex !important;
    flex-direction: column;
    background: #fff;
    max-height: 100dvh;
    overflow: hidden;
    touch-action: manipulation;
}
.ld-mobile-drawer-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    padding-top: max(0.875rem, env(safe-area-inset-top));
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.ld-mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}
.ld-mobile-drawer-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.ld-mobile-fab-btn {
    position: fixed !important;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    right: 1rem;
    z-index: 99980 !important;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none;
    -webkit-appearance: none;
    appearance: none;
}
body.ld-mobile-drawer-open {
    overflow: hidden;
}

/* Modals Live Dates — au-dessus des drawers mobile (99990+) */
.ld-ld-modal-root {
    z-index: 100002 !important;
}

/* Modal « Ajouter un concert » — un seul gabarit pour tous les champs : 38 px, coins md,
   bordure gray-300, anneau bleu au focus. Le préfixe .ld-ld-modal-root passe devant les
   classes Tailwind du champ date. Le widget Google (Lieu) n'expose pas son cadre : c'est
   son hôte qui le porte, et le widget (≈ 47 px, fond transparent) y est centré. */
.ld-ld-modal-root .ld-modal-field,
.ld-ld-modal-root .ld-modal-field-venue .google-places-autocomplete-host--form {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 2.375rem;
    color: #111827;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: none;
    outline: none;
    transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s;
}
.ld-ld-modal-root .ld-modal-field {
    padding: 0 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.ld-ld-modal-root .ld-modal-field:focus,
.ld-ld-modal-root .ld-modal-field:focus-within,
.ld-ld-modal-root .ld-modal-field-venue .google-places-autocomplete-host--form:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}
.ld-ld-modal-root .ld-modal-field.border-red-500 {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}
.ld-ld-modal-root .ld-modal-field:disabled,
.ld-ld-modal-root .ld-modal-field--disabled,
.ld-ld-modal-root .ld-modal-field-venue .google-places-autocomplete-host--form.is-disabled {
    color: #4b5563;
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    box-shadow: none;
    cursor: not-allowed;
}
.ld-ld-modal-root .ld-modal-field-venue .google-places-autocomplete-host--form {
    display: flex;
    align-items: center;
    padding: 0;
}
.ld-ld-modal-root .ld-modal-field-venue .google-places-autocomplete-host--form.is-disabled {
    opacity: 1;
}
.ld-ld-modal-root .ld-modal-field-venue .google-places-autocomplete-host--form.is-disabled gmp-place-autocomplete {
    opacity: 0.6;
}
.ld-ld-modal-root select.ld-modal-field {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.75rem 0.5rem;
}
/* Artistes : cadre de 38 px qui s'agrandit si les puces passent à la ligne */
.ld-ld-modal-root .ld-modal-field--multi {
    height: auto;
    min-height: 2.375rem;
    padding: 0;
}
.ld-ld-modal-root .ld-modal-field-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
}
.ld-ld-modal-root .ld-modal-field-inner-input {
    flex: 1 1 7.5rem;
    min-width: 7.5rem;
    padding: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: inherit;
    background: transparent;
    border: 0;
    outline: none;
}
.ld-ld-modal-root .ld-modal-field-inner-input:disabled {
    cursor: not-allowed;
}
/* Setlist choisie : même gabarit, teinte bleue */
.ld-ld-modal-root .ld-modal-field--selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #eff6ff;
    border-color: #bfdbfe;
}

/* Modals Live Dates — plein écran + scroll fiable sur mobile */
@media (max-width: 767px) {
    .ld-ld-modal-root .ld-ld-modal-backdrop-wrap {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    .ld-ld-modal-root .ld-ld-modal-panel {
        max-height: 100dvh !important;
        height: 100dvh !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
    }
    .ld-ld-modal-root .ld-ld-modal-scroll {
        flex: 1 1 auto;
        min-height: 0;
        overscroll-behavior: contain;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
    .ld-mobile-work-drawer {
        z-index: 99991 !important;
    }
}

/* ══════════════════════════════════════
   Rights Calculator (RC_User) — rc-user-*
══════════════════════════════════════ */
/* Trame commune des quatre onglets (20/11/2026) : en-tête, champs, résultats.
   Même vocabulaire que les autres outils admin-tool-* (fond #fafaf8, bordures #e8e8e5,
   libellés en petites capitales #999, accent noir). */
.rc-user-root .rc-pane {
    padding: 1.1rem 1.25rem 1.25rem;
}
.rc-user-root .rc-pane-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f0f0ed;
}
.rc-user-root .rc-pane-title {
    min-width: 0;
}
.rc-user-root .rc-pane-title h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    margin: 0;
}
.rc-user-root .rc-pane-title h2 i {
    font-size: 0.85rem;
    color: #b0b0aa;
}
.rc-user-root .rc-pane-title p {
    font-size: 0.76rem;
    color: #8a8a85;
    margin: 0.2rem 0 0;
    line-height: 1.45;
}
.rc-user-root .admin-tool-btn-secondary.rc-is-on {
    background: #111;
    border-color: #111;
    color: #fff;
}
.rc-user-root .rc-pane-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.rc-user-root .rc-fields {
    display: grid;
    grid-template-columns: repeat(var(--rc-cols, 4), minmax(0, 1fr));
    gap: 0.8rem 1rem;
}
.rc-user-root .rc-fields + .rc-fields,
.rc-user-root .rc-fields + .rc-block,
.rc-user-root .rc-block + .rc-fields {
    margin-top: 0.85rem;
}
.rc-user-root .rc-span-2 { grid-column: span 2; }
.rc-user-root .rc-span-3 { grid-column: span 3; }
.rc-user-root .rc-span-all { grid-column: 1 / -1; }
@media (max-width: 960px) {
    .rc-user-root .rc-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rc-user-root .rc-span-3 { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .rc-user-root .rc-fields { grid-template-columns: 1fr; }
    .rc-user-root .rc-span-2 { grid-column: auto; }
}
.rc-user-root .rc-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.3rem;
}
.rc-user-root .rc-label .rc-req { color: #dc2626; }
.rc-user-root .rc-label .rc-opt { color: #b0b0aa; font-weight: 500; }
.rc-user-root .rc-hint {
    font-size: 0.7rem;
    color: #9a9a94;
    margin: 0.4rem 0 0;
    line-height: 1.5;
}
.rc-user-root .rc-hint.is-warn { color: #b45309; }
.rc-user-root .rc-block {
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    background: #fafaf8;
    padding: 0.8rem 0.95rem;
}
.rc-user-root .rc-subhead {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #b0b0aa;
    margin: 1.1rem 0 0.55rem;
}
.rc-user-root .rc-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.45rem;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 0.62rem;
    letter-spacing: 0;
    vertical-align: middle;
}
.rc-user-root .rc-user-upload-zone.rc-upload-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    padding: 0.85rem 1rem;
    border-width: 1px;
}
.rc-user-root .rc-duration {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.rc-user-root .rc-duration input {
    width: 100%;
    min-width: 0;
    text-align: center;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}
.rc-user-root .rc-duration span {
    font-size: 0.72rem;
    color: #999;
    flex-shrink: 0;
}
/* Résultats */
.rc-user-root .rc-result {
    margin-top: 1.1rem;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    background: #fafaf8;
    padding: 0.85rem 1rem;
}
.rc-user-root .rc-result-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
}
.rc-user-root .rc-result-empty {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.8rem;
    color: #9a9a94;
}
.rc-user-root .rc-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.25rem, 1fr));
    gap: 0.6rem 1rem;
}
.rc-user-root .rc-metric-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 0.12rem;
}
.rc-user-root .rc-metric-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 650;
    color: #111;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}
.rc-user-root .rc-controlled {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.6rem 1rem;
    align-items: end;
    margin-top: 0.85rem;
    background: #111;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.rc-user-root .rc-controlled .rc-metric-label { color: rgba(255, 255, 255, 0.6); }
.rc-user-root .rc-controlled .rc-metric-value { color: #fff; }
.rc-user-root .rc-controlled .is-total { text-align: right; }
.rc-user-root .rc-controlled .is-total .rc-metric-value { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em; }
.rc-user-root .rc-result-notes {
    margin-top: 0.65rem;
    font-size: 0.72rem;
    color: #888;
    line-height: 1.45;
}
.rc-user-root .rc-result-notes p { margin: 0; }
.rc-user-root .rc-result-notes p + p { margin-top: 0.2rem; }
.rc-user-root .rc-result-notes .is-warn { color: #b45309; }
.rc-user-root .rc-result-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.85rem;
}
@media (max-width: 640px) {
    .rc-user-root .rc-controlled .is-total { text-align: left; }
}
.rc-user-root .rc-user-form-card {
    padding: 1.25rem 1.5rem 1.5rem;
}
.rc-user-root .rc-user-mode-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}
.rc-user-root .rc-user-section-head-compact {
    margin-bottom: 0.5rem;
}
.rc-user-root .rc-user-table-card {
    padding: 1rem 1.25rem 1.25rem;
}
.rc-user-root .rc-user-table-card input[type="text"] {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
}
.rc-user-root .rc-user-table-card input[type="text"]:focus {
    outline: none;
    background: #fafaf8;
    border-bottom: 2px solid #111;
}
/* Zones de drop : toujours dans le DOM, visibilité via opacity/hauteur (pas display — évite annulation drag HTML5) */
.rc-user-root .rc-user-drop-zone {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    border-width: 0;
}
.rc-user-root.rc-dnd-active .rc-user-drop-zone {
    max-height: 12rem;
    opacity: 1;
    pointer-events: auto;
    padding: 2rem 1.5rem;
    margin: initial;
    border-width: 2px;
}
.rc-user-root .rc-user-empty-table-drop,
.rc-user-root .rc-user-append-drop-row {
    display: table-row;
}
.rc-user-root .rc-user-empty-table-drop td,
.rc-user-root .rc-user-append-drop-row td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    border: none !important;
    line-height: 0;
    font-size: 0;
}
.rc-user-root.rc-dnd-active .rc-user-empty-table-drop td,
.rc-user-root.rc-dnd-active .rc-user-append-drop-row td {
    padding: 0.75rem 1rem !important;
    height: auto;
    max-height: none;
    opacity: 1;
    line-height: normal;
    font-size: inherit;
}
.rc-user-root.rc-dnd-active .rc-user-empty-table-drop td {
    padding: 1.5rem 1rem !important;
}
/* Tableaux vides : masqués au repos, visibles comme cibles pendant un drag */
.rc-user-root .rc-table-empty-shell {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    padding: 0;
}
.rc-user-root.rc-dnd-active .rc-table-empty-shell {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    margin: initial;
    padding: initial;
}
.rc-user-drop-zone {
    border: 2px dashed #c8c8c2;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: #fafaf8;
    transition: border-color 0.14s, background 0.14s;
    cursor: pointer;
}
.rc-user-drop-zone:hover {
    border-color: #111;
    background: #f2f2f0;
}
.rc-user-drop-zone i {
    color: #888 !important;
}
.rc-user-drop-zone p {
    color: #555;
}
.rc-user-drop-row td {
    background: #fafaf8;
    border: 2px dashed #c8c8c2 !important;
}
.rc-user-drop-row:hover td {
    background: #f2f2f0;
    border-color: #111 !important;
}
.rc-user-table-export-btn {
    color: #111;
}
.rc-user-table-export-btn:hover {
    color: #000;
    background: #f2f2f0;
}
.rc-user-table-clear-btn {
    color: #6b7280;
}
.rc-user-table-clear-btn:hover {
    color: #b91c1c;
    background: #fef2f2;
}
.rc-drag-source {
    opacity: 0.35;
    background: #f3f4f6 !important;
}
.rc-drag-target {
    box-shadow: inset 0 4px 0 0 #3b82f6;
    background: #eff6ff !important;
}
.rc-user-modal-panel {
    max-width: 72rem;
    max-height: calc(100vh - 2rem);
    height: min(90vh, calc(100vh - 2rem));
}
.rc-user-root .rc-user-recap-section {
    padding-top: 0.25rem;
}
.rc-user-root .rc-user-recap-section-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-bottom: 0.65rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0ed;
}
.rc-user-root .rc-user-recap-section-head h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #222;
}
.rc-user-root .rc-user-recap-table {
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    overflow: hidden;
}
.rc-user-root .rc-user-recap-table-head {
    padding: 0.65rem 0.85rem;
    background: #fafaf8;
    border-bottom: 1px solid #f0f0ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.rc-user-root .rc-user-recap-table-head span:first-child {
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
}
/* ── Totaux du récapitulatif (20/11/2026) : clair, un accent par type, plus de bloc noir ni de vert plein.
   Chaque type garde sa couleur (--mc) de la pastille du tableau à la tuile de total et à la barre de répartition. */
.rc-user-root [data-medium="tv"]        { --mc: #6366f1; --mb: #eef2ff; --mcd: #3730a3; }
.rc-user-root [data-medium="radio"]     { --mc: #0ea5e9; --mb: #e0f2fe; --mcd: #075985; }
.rc-user-root [data-medium="cinema"]    { --mc: #f59e0b; --mb: #fef3c7; --mcd: #92400e; }
.rc-user-root [data-medium="streaming"] { --mc: #10b981; --mb: #d1fae5; --mcd: #065f46; }
.rc-user-root [data-medium="mechanical"]{ --mc: #f43f5e; --mb: #ffe4e6; --mcd: #9f1239; }
.rc-user-root .rc-totals {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.rc-user-root .rc-totals-hero {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.3rem 1.5rem 1.4rem;
    border: 1px solid #e3e5fb;
    border-radius: 14px;
    background: radial-gradient(120% 150% at 0% 0%, #eceeff 0%, #f6f3ff 55%, #fff 100%);
}
.rc-user-root .rc-totals-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #6366f1;
}
.rc-user-root .rc-totals-hero-label {
    margin-top: 0.55rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #6b6b80;
}
.rc-user-root .rc-totals-hero-value {
    margin-top: 0.1rem;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: #312e81;
    background: linear-gradient(100deg, #3730a3 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.rc-user-root .rc-totals-bar {
    display: flex;
    gap: 3px;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #e6e8f8;
}
.rc-user-root .rc-totals-bar-seg {
    display: block;
    height: 100%;
    min-width: 4px;
    background: var(--mc);
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.rc-user-root .rc-totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.8rem;
}
.rc-user-root .rc-totals-tile {
    padding: 0.95rem 1.05rem 1.05rem;
    border: 1px solid #ececf0;
    border-radius: 12px;
    background: #fff;
    box-shadow: inset 0 3px 0 var(--mc);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.rc-user-root .rc-totals-tile:hover {
    transform: translateY(-2px);
    border-color: var(--mc);
    box-shadow: inset 0 3px 0 var(--mc), 0 8px 20px -10px rgba(30, 27, 75, 0.25);
}
.rc-user-root .rc-totals-tile-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}
.rc-user-root .rc-totals-tile-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #222;
}
.rc-user-root .rc-totals-tile-count {
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--mb);
    color: var(--mcd);
    font-size: 0.7rem;
    font-weight: 700;
}
.rc-user-root .rc-totals-tile-figures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.rc-user-root .rc-totals-tile-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a0a09a;
    margin-bottom: 0.15rem;
}
.rc-user-root .rc-totals-tile-value {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: #222;
}
.rc-user-root .rc-totals-tile-value.is-controlled { color: var(--mcd); }

/* Pastille de type : celle du tableau et celle des tuiles de total. */
.rc-user-root .rc-et-chip,
.rc-user-root .rc-totals-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.6rem;
    background: var(--mb, #eef2ff);
    color: var(--mcd, #4338ca);
    font-size: 0.75rem;
}

/* ── Tableau d'estimation (RC_EstimationTable) : en-tête discret, une seule couleur d'accent (indigo) pour « Contrôlé ». ── */
.rc-user-root table.rc-estimation-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
}
.rc-user-root table.rc-estimation-table thead th {
    padding: 0.65rem 0.85rem;
    text-align: left;
    white-space: nowrap;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8a85;
    background: #fafaf8;
    border-bottom: 1px solid #ececf0;
}
.rc-user-root table.rc-estimation-table thead th.is-num { text-align: right; }
.rc-user-root table.rc-estimation-table thead th.is-center { text-align: center; }
.rc-user-root table.rc-estimation-table thead th.is-controlled {
    color: #4338ca;
    background: #f1f2ff;
    box-shadow: inset 0 -2px 0 #6366f1;
}
.rc-user-root table.rc-estimation-table tbody td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #f1f1ef;
    color: #555;
    vertical-align: middle;
    background: transparent;
    transition: background-color 0.15s ease;
}
.rc-user-root table.rc-estimation-table tbody td.is-num,
.rc-user-root table.rc-estimation-table tbody td.rc-et-controlled {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.rc-user-root table.rc-estimation-table tbody td.is-strong { color: #111; font-weight: 700; }
.rc-user-root table.rc-estimation-table tbody td.rc-et-detail { color: #6b6b66; }
.rc-user-root table.rc-estimation-table tbody td.rc-et-controlled {
    font-weight: 700;
    color: #3730a3;
    background: #f7f7ff;
}
.rc-user-root table.rc-estimation-table tbody tr.rc-et-row:hover td { background: #fafaff; }
.rc-user-root table.rc-estimation-table tbody tr.rc-et-row:hover td.rc-et-controlled { background: #eef0ff; }
.rc-user-root .rc-et-unit { color: #b0b0aa; }
.rc-user-root .rc-et-name { font-weight: 600; color: #1c1c1c; line-height: 1.3; }
.rc-user-root .rc-et-sub { margin-top: 0.1rem; font-size: 0.7rem; color: #8a8a85; line-height: 1.4; }
.rc-user-root .rc-et-grip { margin-top: 0.4rem; color: #d4d4cf; font-size: 0.7rem; }
.rc-user-root .rc-et-row:hover .rc-et-grip { color: #a0a09a; }
.rc-user-root .rc-et-chip { margin-top: 0.05rem; }
/* Regroupement (relevé Soundcharts) */
.rc-user-root table.rc-estimation-table tbody tr.rc-et-group { cursor: pointer; }
.rc-user-root table.rc-estimation-table tbody tr.rc-et-group td {
    background: #f6f6fd;
    border-bottom: 1px solid #e6e7f7;
    color: #2b2a52;
}
.rc-user-root table.rc-estimation-table tbody tr.rc-et-group:hover td { background: #eeeffc; }
.rc-user-root table.rc-estimation-table tbody tr.rc-et-group td.rc-et-controlled { background: #e9ebff; }
.rc-user-root table.rc-estimation-table tbody tr.rc-et-group .rc-et-name { color: #1e1b4b; }
.rc-user-root table.rc-estimation-table tbody tr.rc-et-group .rc-et-sub { color: #6366f1; }
/* Actions : discrètes au repos, colorées au survol */
.rc-user-root .rc-et-actions { width: 1%; white-space: nowrap; }
.rc-user-root .rc-et-act-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}
.rc-user-root tr:hover .rc-et-act-row { opacity: 1; }
.rc-user-root .rc-et-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.95rem;
    height: 1.95rem;
    border-radius: 0.55rem;
    color: #8a8a85;
    font-size: 0.8rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.rc-user-root .rc-et-act.is-edit:hover { background: #eef0ff; color: #4338ca; }
.rc-user-root .rc-et-act.is-dup:hover  { background: #fef3c7; color: #b45309; }
.rc-user-root .rc-et-act.is-del:hover  { background: #ffe4e6; color: #be123c; }
/* Pied : sous-total */
.rc-user-root table.rc-estimation-table tfoot td {
    padding: 0.8rem 0.85rem;
    background: #fff;
    border-top: 1px solid #e4e4e0;
    font-weight: 700;
    color: #111;
}
.rc-user-root table.rc-estimation-table tfoot td.is-num,
.rc-user-root table.rc-estimation-table tfoot td.rc-et-controlled {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.rc-user-root table.rc-estimation-table tfoot td.rc-et-subtotal-label {
    text-align: right;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8a85;
}
.rc-user-root table.rc-estimation-table tfoot td.rc-et-controlled {
    color: #312e81;
    background: #eef0ff;
}

/* Mention BETA : onglets récents (Radio, Reproduction mécanique), logique susceptible d'évoluer. */
.rc-user-root .rc-beta {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.4rem;
    border: 1px solid #c7cbf5;
    border-radius: 999px;
    background: #eef0ff;
    color: #4338ca;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    vertical-align: middle;
    cursor: help;
}
.rc-user-root .admin-tool-tab .rc-beta { margin-left: 0.15rem; }
.rc-user-root .admin-tool-tab.is-active .rc-beta {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}
.rc-user-root .rc-pane-title h2 .rc-beta { margin-left: 0.15rem; }
.rc-user-root .rc-pane-title p.rc-beta-note {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin-top: 0.45rem;
    color: #6b6fb5;
}
.rc-user-root .rc-beta-note i { margin-top: 0.15rem; font-size: 0.7rem; }

/* Mentions sous le formulaire (statut du taux, état de l'enregistrement) : de l'air au-dessus. */
.rc-user-root .rc-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1rem 0 0.35rem;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    background: #f6f6f4;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #77776f;
}
.rc-user-root .rc-note i { margin-top: 0.2rem; color: #10b981; }
.rc-user-root .rc-note.is-warn { background: #fffbeb; color: #b45309; }
.rc-user-root .rc-note.is-warn i { color: #d97706; }
.rc-user-root .rc-sync-line {
    margin-top: 1.1rem;
    margin-bottom: 0.25rem;
    padding: 0 0.25rem;
    color: #8a8a85;
}
.rc-user-root .rc-user-results-panel {
    background: #fafaf8;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}
.rc-user-root .rc-user-sc-block {
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    background: #fafaf8;
    padding: 1rem 1.1rem;
}
.rc-user-root .rc-user-sc-results {
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    list-style: none;
    margin: 0;
    padding: 0;
}
.rc-user-root .rc-user-sc-results li + li {
    border-top: 1px solid #f0f0ed;
}
.rc-user-root .rc-user-sc-results button:hover {
    background: #fafaf8;
}
.rc-user-root .rc-user-sc-song {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    padding: 0.75rem;
}
.rc-user-root .rc-user-sc-apply.is-applied,
.rc-user-root .rc-user-sc-apply.is-applied:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}
.rc-user-root .rc-user-stream-rates {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #666;
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
}
.rc-user-root .rc-user-stream-rates strong {
    color: #222;
    font-weight: 600;
}
.rc-user-root .rc-user-stream-results-title {
    margin: 0 0 0.85rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #222;
}
.rc-user-root .rc-user-stream-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
}
.rc-user-root .rc-user-stream-metric-label,
.rc-user-root .rc-user-stream-controlled-kicker {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.2rem;
}
.rc-user-root .rc-user-stream-metric-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111;
    font-variant-numeric: tabular-nums;
}
.rc-user-root .rc-user-stream-controlled {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
    align-items: end;
    margin-top: 1rem;
    background: #111;
    color: #fff;
    border-radius: 8px;
    padding: 0.9rem 1rem;
}
.rc-user-root .rc-user-stream-controlled-kicker {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.3rem;
}
.rc-user-root .rc-user-stream-controlled-total {
    text-align: right;
}
.rc-user-root .rc-user-stream-controlled-amount {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.rc-user-root .rc-user-stream-controlled-total .rc-user-stream-controlled-amount {
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}
.rc-user-root .rc-user-stream-note {
    margin: 0.85rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #888;
}
@media (max-width: 640px) {
    .rc-user-root .rc-user-stream-metrics,
    .rc-user-root .rc-user-stream-controlled {
        grid-template-columns: 1fr;
    }
    .rc-user-root .rc-user-stream-controlled-total {
        text-align: left;
    }
}
.rc-user-root .rc-user-validated-banner {
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 1rem;
    background: #f0fdf4;
}
.rc-user-root .rc-user-avp-picker {
    border: 1px solid #e8e8e5;
    border-radius: 8px;
    padding: 1rem;
    background: #fafaf8;
}
.rc-user-root .rc-user-upload-zone {
    border: 2px dashed #d4d4cf;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    background: #fff;
    transition: border-color 0.14s, background 0.14s;
}
.rc-user-root .rc-user-upload-zone.is-dragover {
    border-color: #111;
    background: #fafaf8;
}
.rc-user-root .admin-tool-table thead th {
    white-space: nowrap;
}
/* Diffusions INA : case « retenir » ; une diffusion décochée reste visible mais grisée et barrée. */
.rc-user-root .rc-ina-keep-col { width: 2.25rem; padding-left: 0.9rem; padding-right: 0.4rem; }
.rc-user-root .rc-ina-keep { width: 0.95rem; height: 0.95rem; accent-color: #111; cursor: pointer; }
.rc-user-root tr.rc-ina-excluded td { color: #b0b0aa; background: #fafaf8; }
.rc-user-root tr.rc-ina-excluded td:not(.rc-ina-keep-col) { opacity: 0.6; }
.rc-user-root tr.rc-ina-excluded td.font-medium { text-decoration: line-through; }

.rc-user-root .fade-enter-active,
.rc-user-root .fade-leave-active {
    transition: opacity 0.3s ease;
}
.rc-user-root .fade-enter-from,
.rc-user-root .fade-leave-to {
    opacity: 0;
}

/* ══════════════════════════════════════
   AG Wizard — étape 4 (style dashboard)
══════════════════════════════════════ */
.ag-wizard-s4 {
    background: #f5f5f3;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* ── Séparateur vertical redimensionnable (panneau entités) ── */
.ag-panel-splitter {
    position: relative;
    width: 5px;
    min-width: 5px;
    flex-shrink: 0;
    align-self: stretch;
    z-index: 30;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    background: transparent;
}
.ag-panel-splitter::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: #e8e8e5;
    transition: width 0.15s ease, background 0.15s ease;
}
.ag-panel-splitter:hover::before,
.ag-panel-splitter.is-active::before {
    width: 2px;
    background: #a7f3d0;
}
.ag-panel-splitter.is-active::before {
    background: #34d399;
}
.ag-panel-splitter-grip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #ececea;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}
.ag-panel-splitter:hover .ag-panel-splitter-grip,
.ag-panel-splitter.is-active .ag-panel-splitter-grip {
    opacity: 1;
}
.ag-panel-splitter-grip span {
    display: block;
    width: 2px;
    height: 2px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.15s ease;
}
.ag-panel-splitter:hover .ag-panel-splitter-grip span {
    background: #94a3b8;
}
.ag-panel-splitter.is-active .ag-panel-splitter-grip {
    border-color: #6ee7b7;
}
.ag-panel-splitter.is-active .ag-panel-splitter-grip span {
    background: #059669;
}

/* ── Échelle typographique et pastilles (vue Entités + fiche contrat) ──
   Trois tailles, une seule géométrie de pastille. Toute nouvelle pastille
   part du socle commun plus bas : la cohérence tient à ce qu'aucune ne
   redéfinisse ni sa taille, ni son rayon, ni sa graisse. */
:root {
    --ag-fs-strong: 0.8125rem;  /* titres, noms de partie, valeurs fortes */
    --ag-fs-base: 0.6875rem;    /* corps de texte, cellules de tableau */
    --ag-fs-micro: 0.625rem;    /* libellés capitales, pastilles, méta */
    --ag-badge-radius: 0.25rem;
    --ag-badge-pad: 0.1rem 0.35rem;
    --ag-badge-bg: #f2f2ef;
    --ag-badge-fg: #57564f;
    --ag-badge-border: #e2e2de;
}

/* ── Vue Entités (panneau principal + liste latérale) ── */
.ag-entity-header {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #e1e1de;
    padding: 0.75rem 1.1rem;
}
.ag-entity-header-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.ag-entity-header-logo-wrap {
    flex-shrink: 0;
    position: relative;
}
/* Panneau du logo : recherche en ligne (SerpAPI) ou import d'un fichier */
.ag-logo-pop {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 40;
    width: 19rem;
    padding: 0.6rem;
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.6rem;
    box-shadow: 0 12px 32px rgba(25, 25, 23, 0.12);
}
.ag-logo-pop-search {
    display: flex;
    gap: 0.35rem;
}
.ag-logo-pop-search .admin-tool-input {
    flex: 1;
    min-width: 0;
}
.ag-logo-pop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.ag-logo-pop-thumb {
    position: relative;
    aspect-ratio: 1;
    padding: 0.2rem;
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.4rem;
    cursor: pointer;
    overflow: hidden;
}
.ag-logo-pop-thumb:hover:not(:disabled) {
    border-color: #191917;
}
.ag-logo-pop-thumb:disabled {
    cursor: default;
    opacity: 0.5;
}
.ag-logo-pop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.ag-logo-pop-busy {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    color: #191917;
}
.ag-logo-pop-hint,
.ag-logo-pop-error {
    margin-top: 0.5rem;
    font-size: var(--ag-fs-base);
    color: #96958f;
}
.ag-logo-pop-error {
    color: #b42318;
}
.ag-logo-pop-foot {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.55rem;
    padding-top: 0.5rem;
    border-top: 1px solid #efefec;
    font-size: var(--ag-fs-micro);
    color: #96958f;
}
.ag-logo-pop-foot button {
    align-self: flex-start;
    font-size: var(--ag-fs-base);
    font-weight: 500;
    color: #191917;
}
.ag-logo-pop-foot button:hover {
    text-decoration: underline;
}
.ag-entity-header-logo,
.ag-entity-header-logo-placeholder {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.5rem;
}
.ag-entity-header-logo {
    border: 1px solid #e1e1de;
    background: #fff;
    padding: 0.25rem;
    object-fit: contain;
}
.ag-entity-header-logo-placeholder {
    border: 1px dashed #c9c9c4;
    background: #f7f7f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #96958f;
}
.ag-entity-header-info {
    flex: 1;
    min-width: 0;
}
.ag-entity-header-title {
    font-size: var(--ag-fs-strong);
    font-weight: 700;
    color: #191917;
    line-height: 1.25;
}
.ag-entity-header-meta {
    margin-top: 0.2rem;
    font-size: var(--ag-fs-micro);
    color: #6c6c67;
    line-height: 1.45;
}
.ag-entity-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.ag-entity-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    font-size: var(--ag-fs-base);
    font-weight: 500;
    color: #48483f;
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.4375rem;
    transition: background 0.12s, border-color 0.12s;
}
.ag-entity-btn-ghost:hover {
    background: #f7f7f5;
    border-color: #c9c9c4;
}

.ag-contract-detail-header-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ag-entity-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    font-size: var(--ag-fs-base);
    font-weight: 600;
    color: #b91c1c;
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-radius: 0.4375rem;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.ag-entity-btn-danger:hover:not(:disabled) {
    background: #ffe4e6;
    border-color: #fca5a5;
    color: #991b1b;
}

.ag-entity-btn-danger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ag-entity-kpis {
    display: flex;
    flex-wrap: wrap;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid #eeeeeb;
}
.ag-entity-kpi {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 0.8rem;
    border-right: 1px solid #eeeeeb;
    min-width: 0;
}
.ag-entity-kpi:first-child { padding-left: 0; }
.ag-entity-kpi:last-child { border-right: 0; padding-right: 0; }
.ag-entity-kpi-icon {
    width: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--ag-fs-micro);
    color: #96958f;
}
.ag-entity-kpi-val {
    font-size: var(--ag-fs-strong);
    font-weight: 700;
    color: #191917;
    line-height: 1.1;
}
.ag-entity-kpi-lbl {
    font-size: var(--ag-fs-micro);
    color: #96958f;
    line-height: 1.2;
}
/* ── Bande « Contacts liés » ── */
.ag-entity-contacts-band {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #e1e1de;
    padding: 0.5rem 1.1rem;
}
.ag-entity-contacts-sub {
    font-size: var(--ag-fs-micro);
    color: #96958f;
    line-height: 1.3;
}
.ag-entity-contacts-chevron {
    font-size: var(--ag-fs-micro);
    color: #b4b3ac;
    transition: transform 0.15s ease;
}
.ag-entity-btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    font-size: var(--ag-fs-base);
    font-weight: 600;
    color: #fff;
    background: #059669;
    border: 1px solid #047857;
    border-radius: 0.4375rem;
    transition: background 0.12s, border-color 0.12s;
}
.ag-entity-btn-accent:hover {
    background: #047857;
    border-color: #036a4b;
}
.ag-entity-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.45rem 1.1rem;
    background: #fff;
    border-bottom: 1px solid #e1e1de;
}
.ag-entity-role-toggle {
    display: inline-flex;
    padding: 2px;
    background: #eeeeeb;
    border-radius: 0.4375rem;
    flex-shrink: 0;
}
.ag-entity-role-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.6rem;
    font-size: var(--ag-fs-base);
    font-weight: 500;
    color: #6c6c67;
    border-radius: 0.375rem;
    border: none;
    background: transparent;
    transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.ag-entity-role-btn.is-active {
    background: #fff;
    color: #047857;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.ag-entity-role-count {
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: #e1e1de;
    color: #6c6c67;
}
.ag-entity-role-btn.is-active .ag-entity-role-count {
    background: #d1fae5;
    color: #047857;
}
.ag-entity-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0.75rem 1.1rem;
    background: #f7f7f5;
}
.ag-entity-contract-card {
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.625rem;
    padding: 0.75rem 0.9rem;
}
.ag-entity-contract-card + .ag-entity-contract-card {
    margin-top: 0.65rem;
}
.ag-entity-contract-card.is-inactive {
    background: #f7f7f5;
    border-color: #e1e1de;
    border-left: 3px solid #96958f;
}
.ag-entity-contract-card.is-inactive .ag-contract-detail-title {
    color: #6c6c67;
}
.ag-entity-contract-card.is-nego {
    border-left: 3px solid #f59e0b;
}
.ag-entity-contract-card.is-highlighted {
    border-color: #10b981;
    border-left: 4px solid #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
    animation: ag-highlight-pulse 2s ease-out forwards;
}
@keyframes ag-highlight-pulse {
    0%   { box-shadow: 0 0 0 4px rgba(16,185,129,0.35); }
    60%  { box-shadow: 0 0 0 6px rgba(16,185,129,0.15); }
    100% { box-shadow: 0 0 0 0px rgba(16,185,129,0); border-color: #ececea; border-left-color: #ececea; }
}
.ag-contract-inactive-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: -0.85rem -1rem 0.75rem;
    padding: 0.4rem 1rem;
    background: linear-gradient(90deg, #eeeeeb 0%, #f7f7f5 100%);
    border-bottom: 1px solid #e1e1de;
    font-size: var(--ag-fs-micro);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6c6c67;
}
.ag-contract-inactive-banner-date {
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #96958f;
}
.ag-contract-dates-range.is-inactive {
    background: #eeeeeb;
    border-color: #e1e1de;
    color: #6c6c67;
}
.ag-entity-section {
    background: #fbfbf9;
    border: 1px solid #ececea;
    border-radius: 0.4375rem;
    padding: 0.55rem 0.7rem;
}
.ag-entity-section-title {
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #96958f;
    margin-bottom: 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Détail contrat (vue entité) */
.ag-contract-detail { padding: 0.85rem 1rem; }
.ag-contract-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid #ececea;
}
.ag-contract-detail-title {
    font-size: var(--ag-fs-strong);
    font-weight: 700;
    color: #191917;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.ag-contract-detail-ref {
    font-size: var(--ag-fs-micro);
    color: #6c6c67;
    margin-top: 0.2rem;
}
.ag-contract-detail-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.45rem;
}
/* Socle unique des pastilles — en-tête de contrat, tableaux, liste latérale.
   Même rayon, même graisse, même taille : la couleur reste alors le seul
   signal, et un badge neutre ne pèse jamais plus qu'un badge coloré. */
.ag-contract-badge,
.ag-contract-tag,
.ag-contract-chip,
.ag-entity-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: var(--ag-badge-pad);
    border-radius: var(--ag-badge-radius);
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.01em;
    white-space: nowrap;
    background: var(--ag-badge-bg);
    color: var(--ag-badge-fg);
    border: 1px solid var(--ag-badge-border);
}

/* Statut du contrat : la seule pastille « vivante ». Un point coloré sur fond
   neutre — assez pour repérer un contrat terminé sans crier plus fort que le
   titre qu'il accompagne. */
.ag-contract-badge.is-state {
    background: #fff;
    color: #48483f;
    border-color: #dcdcd7;
}
.ag-contract-badge.is-state::before {
    content: '';
    width: 0.3125rem;
    height: 0.3125rem;
    border-radius: 999px;
    background: #96958f;
    flex-shrink: 0;
}
.ag-contract-badge.is-state-active::before { background: #16a34a; }
.ag-contract-badge.is-state-nego::before,
.ag-contract-badge.is-state-pending::before { background: #d97706; }
.ag-contract-badge.is-state-terminated::before { background: #b45309; }
.ag-contract-badge.is-state-inactive::before { background: #a8a79f; }

/* Rôle de l'entité dans le contrat : une flèche, pas un mot. Sortante pour un
   cédant (les droits partent de l'entité), entrante pour un cessionnaire.
   Le mot reste dans title/aria-label. */
.ag-role-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    padding: 0;
    border-radius: var(--ag-badge-radius);
    background: #fff;
    border: 1px solid var(--ag-badge-border);
    color: #7d7c76;
    flex-shrink: 0;
}
.ag-role-arrow i {
    font-size: 0.5625rem;
    line-height: 1;
}
.ag-role-arrow.is-assignor { color: #35507d; border-color: #cfd8e5; background: #f3f6fa; }
.ag-role-arrow.is-assignee { color: #2f6360; border-color: #cbdedc; background: #f2f8f7; }
.ag-contract-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    align-items: start;
}
.ag-contract-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid #ececea;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.65rem;
}
.ag-contract-summary-col {
    padding: 0.7rem 0.85rem;
    min-width: 0;
}
.ag-contract-summary-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}
.ag-contract-summary-icon {
    width: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: var(--ag-fs-micro);
    color: #96958f;
}
.ag-contract-summary-label {
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6c6c67;
}
.ag-contract-parties-flow {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ag-contract-party-card {
    flex: 1;
    min-width: 0;
    padding: 0.05rem 0 0.05rem 0.5rem;
    border: 0;
    border-left: 2px solid var(--ag-badge-border);
    border-radius: 0;
    background: transparent;
}
.ag-contract-party-card.is-assignor { border-left-color: #cfd8e5; }
.ag-contract-party-card.is-assignee { border-left-color: #cbdedc; }
/* Colonne étroite : les cartes s'empilent, la flèche suit. */
.ag-contract-parties-flow-arrow {
    transform: rotate(90deg);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin: 0 auto;
    color: #b4b3ac;
    font-size: var(--ag-fs-base);
    flex-shrink: 0;
}
.ag-contract-party-role {
    display: block;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #96958f;
    margin-bottom: 0.15rem;
}
.ag-contract-party-name {
    display: block;
    font-size: var(--ag-fs-strong);
    font-weight: 700;
    color: #191917;
    line-height: 1.25;
}
.ag-contract-party-signatory {
    margin: 0.22rem 0 0;
    font-size: var(--ag-fs-micro);
    color: #6c6c67;
    line-height: 1.35;
}
.ag-contract-party-extra {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid #eeeeeb;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.ag-contract-party-extra-row {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}
.ag-contract-summary-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.ag-contract-summary-dl--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.2rem 0.9rem;
}
.ag-contract-summary-dl-row {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}
.ag-contract-summary-dl--inline .ag-contract-summary-dl-row {
    flex-direction: row;
    align-items: baseline;
    gap: 0.3rem;
}
.ag-contract-summary-dl dt {
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #96958f;
    margin: 0;
}
.ag-contract-summary-dl--inline dt {
    font-size: var(--ag-fs-micro);
}
.ag-contract-summary-dl dd {
    margin: 0;
    font-size: var(--ag-fs-base);
    font-weight: 500;
    color: #191917;
    line-height: 1.35;
}
.ag-contract-summary-dl--inline dd {
    font-size: var(--ag-fs-base);
    font-weight: 600;
}
.ag-contract-dates-range {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.6rem;
    border-radius: 0.3rem;
    background: #f7f7f5;
    border: 1px solid #e1e1de;
    font-size: var(--ag-fs-base);
    font-weight: 700;
    color: #191917;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.ag-contract-dates-range + .ag-contract-summary-dl {
    margin-top: 0.55rem;
}
.ag-contract-summary-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.55rem;
}
.ag-contract-chip.is-emerald {
    background: #e7f5ee;
    color: #2f6d52;
    border-color: #cbe6d9;
}
@media (min-width: 900px) {
    .ag-contract-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ag-contract-section--full {
        grid-column: 1 / -1;
    }
    .ag-contract-section--dense:not(.ag-contract-section--full) {
        min-width: 0;
    }
    /* Deux sections denses côte à côte : chacune peut scroller horizontalement si besoin */
    .ag-contract-section--dense .ag-contract-table-scroll {
        max-width: 100%;
    }
    .ag-contract-summary {
        grid-template-columns: minmax(14rem, 1.3fr) minmax(9.5rem, 0.8fr) minmax(11rem, 0.9fr);
        align-items: stretch;
    }
    .ag-contract-summary-col + .ag-contract-summary-col {
        border-left: 1px solid #e4e4e1;
    }
    .ag-contract-parties-flow {
        flex-direction: row;
        align-items: stretch;
        gap: 0.4rem;
    }
    .ag-contract-parties-flow-arrow {
        align-self: center;
        margin: 0;
        transform: none;
    }
    .ag-contract-summary-col--dates {
        display: flex;
        flex-direction: column;
    }
    .ag-contract-summary-foot {
        margin-top: auto;
        padding-top: 0.55rem;
    }
}
.ag-contract-section { margin: 0; }
.ag-contract-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.ag-contract-section-head .ag-entity-section-title { margin-bottom: 0; }
.ag-contract-section-meta {
    font-size: var(--ag-fs-micro);
    color: #6c6c67;
    font-weight: 500;
}
.ag-contract-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
}
.ag-contract-kv-grid--compact { gap: 0.25rem 0.5rem; }
.ag-contract-kv {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}
.ag-contract-kv-label {
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #96958f;
}
.ag-contract-kv-value {
    font-size: var(--ag-fs-base);
    font-weight: 500;
    color: #191917;
}
.ag-contract-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
}
.ag-contract-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}
.ag-contract-section-head + .ag-contract-tags,
.ag-contract-kv-grid + .ag-contract-tags {
    margin-top: 0.7rem;
}
.ag-contract-scope-card .ag-contract-kv-grid {
    margin-bottom: 0.15rem;
}
/* Inclus / exclu / réservé : mêmes teintes rabattues que la légende des
   familles, sinon un territoire exclu hurle plus fort qu'un droit master. */
.ag-contract-tag.is-emerald,
.ag-contract-tag.is-granted { background: #e7f5ee; color: #2f6d52; border-color: #cbe6d9; }
.ag-contract-tag.is-rose { background: #f7e9ea; color: #94414f; border-color: #ecd3d6; }
.ag-contract-tag.is-amber { background: #f6efdf; color: #8a6320; border-color: #e8dcc1; }
/* Rôle, exclusivité, scope : des faits, pas des alertes — une seule teinte neutre */
.ag-contract-tag.is-purple,
.ag-contract-tag.is-rights-other,
.ag-contract-tag.is-blue,
.ag-contract-tag.is-muted,
.ag-contract-chip.is-amber,
.ag-contract-chip.is-rose,
.ag-contract-chip.is-muted,
.ag-contract-badge.is-neutral,
.ag-contract-badge.is-rights-other {
    background: var(--ag-badge-bg);
    color: var(--ag-badge-fg);
    border-color: var(--ag-badge-border);
}
/* Famille / type de droits : légende volontairement colorée, une teinte par famille */
.ag-contract-tag.is-publishing,
.ag-contract-badge.is-publishing,
.ag-contract-tag.is-sync-rep-publishing,
.ag-contract-badge.is-sync-rep-publishing {
    background: #e6ebf2;
    color: #35507d;
    border-color: #c9d4e3;
}
.ag-contract-tag.is-master,
.ag-contract-badge.is-master,
.ag-contract-tag.is-sync-rep-master,
.ag-contract-badge.is-sync-rep-master {
    background: #f3e7e1;
    color: #8a4a2e;
    border-color: #e3cdbd;
}
.ag-contract-tag.is-sync-rep-dual,
.ag-contract-badge.is-sync-rep-dual {
    background: #efe6f0;
    color: #6b3f70;
    border-color: #ddc7df;
}
.ag-contract-tag.is-neighbouring,
.ag-contract-badge.is-neighbouring,
.ag-contract-tag.is-neighbouring-av,
.ag-contract-badge.is-neighbouring-av {
    background: #e3edec;
    color: #2f6360;
    border-color: #c7dcda;
}
.ag-contract-empty {
    font-size: var(--ag-fs-base);
    color: #96958f;
    font-style: italic;
    margin: 0;
}
/* Texte vide des encarts contrat : ne pas hériter du panneau 360px du tableau Contrats */
.ag-entity-section .ag-contract-empty {
    min-height: 0;
    display: block;
}
.ag-contract-scopes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ag-contract-scope-card {
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.4rem;
    padding: 0.55rem 0.65rem;
}
.ag-contract-scope-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.ag-contract-scope-head .ag-contract-tag-row {
    margin-top: 0;
    flex-shrink: 0;
}
.ag-contract-scope-title {
    font-size: var(--ag-fs-base);
    font-weight: 600;
    color: #191917;
}
.ag-contract-scope-code {
    display: block;
    font-size: var(--ag-fs-micro);
    color: #96958f;
    margin-top: 0.1rem;
}
.ag-contract-scope-desc {
    font-size: var(--ag-fs-micro);
    color: #6c6c67;
    margin: 0.35rem 0 0;
    line-height: 1.4;
    font-style: italic;
}
.ag-contract-ref-note {
    display: block;
    margin: 0.2rem 0 0;
    padding-left: 0.55rem;
    border-left: 2px solid #c9c9c4;
    font-size: var(--ag-fs-micro);
    color: #6c6c67;
    font-style: italic;
    line-height: 1.45;
    max-width: 52rem;
}
.ag-contract-tag--trigger {
    background: var(--ag-badge-bg);
    color: var(--ag-badge-fg);
    border-color: var(--ag-badge-border);
}
.ag-contract-tag--rights {
    opacity: 0.85;
}
.ag-contract-tag--group {
    margin-left: 0;
    flex-shrink: 0;
}

/* Sections denses : entités couvertes, assets, portées */
.ag-contract-section--dense {
    padding: 0.45rem 0.55rem;
}
.ag-contract-section--dense .ag-entity-section-title {
    margin-bottom: 0;
}
.ag-contract-section-count {
    font-weight: 500;
    opacity: 0.75;
}
.ag-contract-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--ag-fs-base);
    margin-top: 0.35rem;
    table-layout: fixed;
}
.ag-contract-table-scroll {
    overflow-x: auto;
    min-width: 0;
    margin-top: 0.35rem;
    -webkit-overflow-scrolling: touch;
}
.ag-contract-table-scroll .ag-contract-data-table {
    margin-top: 0;
}
.ag-contract-data-table thead th {
    padding: 0.26rem 0.4rem;
    text-align: left;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #96958f;
    border-bottom: 1px solid #e1e1de;
    white-space: nowrap;
}
.ag-contract-data-table thead th:nth-child(1) { width: 5.5rem; }
.ag-contract-data-table--covered thead th:nth-child(3) { width: 6.5rem; }
.ag-contract-data-table--covered thead th:nth-child(4) { width: 38%; }
/* Assets : auto-layout + min-widths — évite l'écrasement vertical du titre en colonne étroite */
.ag-contract-data-table--assets {
    table-layout: auto;
    min-width: 26rem;
}
.ag-contract-data-table--assets thead th:nth-child(1) { width: 5.5rem; min-width: 5.5rem; }
.ag-contract-data-table--assets thead th:nth-child(2) { width: auto; min-width: 7rem; }
.ag-contract-data-table--assets thead th:nth-child(3) { width: 7rem; min-width: 6.5rem; }
.ag-contract-data-table--assets thead th:nth-child(4) { width: 8rem; min-width: 7rem; }
.ag-contract-data-table--assets thead th:nth-child(5) { width: 9rem; min-width: 8rem; }
.ag-contract-data-table--assets .ag-contract-data-primary {
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
}
.ag-contract-data-table--assets .ag-contract-data-mono {
    word-break: break-all;
    white-space: nowrap;
}
.ag-asset-coverage-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}
.ag-asset-coverage-hint {
    font-size: var(--ag-fs-micro);
    color: #94a3b8;
    line-height: 1.2;
}
.ag-contract-tag.is-slate {
    background: var(--ag-badge-bg);
    color: var(--ag-badge-fg);
    border-color: var(--ag-badge-border);
}
.ag-asset-entries-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.24rem 0.5rem;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    color: #4338ca;
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    white-space: nowrap;
}
.ag-asset-entries-open-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}
.ag-asset-entries-open-btn:active {
    transform: translateY(1px);
}
.ag-asset-entries-open-btn i {
    font-size: 0.625rem;
    opacity: 0.85;
}
.ag-asset-entries-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.ag-asset-entries-modal {
    width: min(760px, 100%);
    max-height: min(82vh, 900px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}
.ag-asset-entries-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0.85rem;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
}
.ag-asset-entries-modal-kicker {
    margin: 0 0 0.2rem;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #96958f;
}
.ag-asset-entries-modal-head h2 {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.25;
    color: #0f172a;
}
.ag-asset-entries-modal-sub {
    margin: 0.35rem 0 0;
    font-size: var(--ag-fs-base);
    color: #64748b;
}
.ag-asset-entries-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}
.ag-asset-entries-modal-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}
.ag-asset-entries-modal-search:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #fff;
}
.ag-asset-entries-modal-search i {
    color: #94a3b8;
    font-size: var(--ag-fs-micro);
}
.ag-asset-entries-modal-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 0.8125rem;
    color: #0f172a;
    outline: none;
}
.ag-asset-entries-modal-count {
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}
.ag-asset-entries-modal-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}
.ag-asset-entries-modal-table {
    width: 100%;
    border-collapse: collapse;
}
.ag-asset-entries-modal-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.45rem 0.75rem;
    text-align: left;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid #e8ecf1;
}
.ag-asset-entries-modal-table tbody td {
    padding: 0.42rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.8125rem;
    vertical-align: top;
}
.ag-asset-entries-modal-table tbody tr:hover td {
    background: #fafbff;
}
.ag-asset-entries-modal-num {
    width: 3rem;
    color: #94a3b8;
    font-size: var(--ag-fs-micro);
    font-variant-numeric: tabular-nums;
}
.ag-asset-entries-modal-title {
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}
.ag-asset-entries-modal-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: var(--ag-fs-base);
    color: #475569;
    white-space: nowrap;
}
.ag-asset-entries-modal-empty {
    padding: 2rem 0.75rem !important;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8125rem;
}
.ag-contract-data-table tbody td {
    padding: 0.32rem 0.4rem;
    vertical-align: top;
    border-bottom: 1px solid #eeeeeb;
    line-height: 1.35;
}
.ag-contract-data-table tbody tr:last-child td {
    border-bottom: none;
}
.ag-contract-data-table tbody tr:hover td {
    background: rgba(248, 250, 252, 0.85);
}
.ag-contract-data-primary {
    font-weight: 600;
    color: #191917;
    word-break: break-word;
}
.ag-contract-data-muted {
    color: #6c6c67;
    font-size: var(--ag-fs-base);
}
.ag-contract-data-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: var(--ag-fs-base);
    color: #48483f;
    letter-spacing: -0.01em;
}
.ag-contract-data-note {
    color: #6c6c67;
    font-size: var(--ag-fs-base);
    line-height: 1.4;
    word-break: break-word;
}
.ag-contract-tag--cell {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ag-contract-section--dense .ag-contract-scopes {
    gap: 0.35rem;
    margin-top: 0.35rem;
}
.ag-contract-section--dense .ag-contract-scope-card {
    padding: 0.4rem 0.5rem;
}
.ag-contract-section--dense .ag-contract-scope-head {
    margin-bottom: 0.35rem;
    gap: 0.5rem;
}
.ag-contract-section--dense .ag-contract-scope-desc {
    margin-top: 0.25rem;
    font-size: var(--ag-fs-micro);
}
.ag-contract-rate-groups { display: flex; flex-direction: column; gap: 0; }
.ag-contract-rate-group-title {
    font-size: var(--ag-fs-base);
    font-weight: 600;
    color: #191917;
}
.ag-contract-rates-table {
    width: 100%;
    font-size: var(--ag-fs-base);
    border-collapse: collapse;
    table-layout: fixed;
}
.ag-contract-rates-table--unified {
    border: 1px solid #e1e1de;
    border-radius: 0.4rem;
    overflow: hidden;
    background: #fff;
}
.ag-contract-rates-table--unified th:nth-child(1),
.ag-contract-rates-table--unified td:nth-child(1) { width: 42%; }
.ag-contract-rates-table--unified th:nth-child(2),
.ag-contract-rates-table--unified td:nth-child(2) { width: 18%; }
.ag-contract-rates-table--unified th:nth-child(3),
.ag-contract-rates-table--unified td:nth-child(3) { width: 22%; }
.ag-contract-rates-table--unified th:nth-child(4),
.ag-contract-rates-table--unified td:nth-child(4) { width: 10%; }
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog th:nth-child(1),
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog td:nth-child(1) { width: 30%; }
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog th:nth-child(2),
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog td:nth-child(2) { width: 16%; }
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog th:nth-child(3),
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog td:nth-child(3) { width: 24%; }
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog th:nth-child(4),
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog td:nth-child(4) { width: 18%; }
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog th:nth-child(5),
.ag-contract-rates-table--unified.ag-contract-rates-table--with-catalog td:nth-child(5) { width: 8%; }
.ag-contract-rate-catalog-all {
    font-size: var(--ag-fs-micro);
    color: #96958f;
    font-style: italic;
}
.ag-contract-rate-group-row td {
    background: #f7f7f5;
    border-bottom: 1px solid #e1e1de;
    padding: 0.55rem 0.75rem 0.5rem;
    font-weight: 600;
    vertical-align: top;
}
.ag-contract-rate-group-head-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}
.ag-contract-rate-group-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-width: 0;
}
.ag-contract-rate-group-head-top .ag-contract-rate-group-title {
    min-width: 0;
}
.ag-contract-rates-table--unified .ag-contract-rate-group-body:not(:first-of-type) .ag-contract-rate-group-row td {
    border-top: 2px solid #e1e1de;
    padding-top: 0.7rem;
}
.ag-contract-rates-table--unified .ag-contract-rate-data-row td {
    border-bottom: 1px solid #eeeeeb;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.ag-contract-rates-table--unified .ag-contract-rate-group-body .ag-contract-rate-data-row:last-child td {
    border-bottom: 1px solid #e1e1de;
    padding-bottom: 0.65rem;
}
.ag-contract-rates-table--unified .ag-contract-rate-group-body:last-child .ag-contract-rate-data-row:last-child td {
    border-bottom: none;
    padding-bottom: 0.55rem;
}
.ag-contract-rate-type-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    min-width: 0;
}
.ag-contract-rate-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}
.ag-contract-rate-name {
    font-weight: 600;
    font-size: var(--ag-fs-base);
    color: #191917;
    line-height: 1.3;
}
.ag-contract-rate-method {
    font-size: var(--ag-fs-micro);
    color: #6c6c67;
}
.ag-contract-rate-currency {
    color: #6c6c67;
}
.ag-contract-rates-table th {
    padding: 0.32rem 0.6rem;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #96958f;
    background: #f7f7f5;
    border-bottom: 1px solid #eeeeeb;
}
.ag-contract-rates-table th:not(.text-right) { text-align: left; }
.ag-contract-rates-table td {
    padding: 0.4rem 0.65rem;
    vertical-align: middle;
}
.ag-contract-rates-table:not(.ag-contract-rates-table--unified) td {
    border-bottom: 1px solid #f7f7f5;
}
.ag-contract-rates-table:not(.ag-contract-rates-table--unified) tr:last-child td { border-bottom: none; }
.ag-contract-rate-value {
    font-weight: 700;
    font-size: var(--ag-fs-base);
    color: #059669;
    font-variant-numeric: tabular-nums;
}
.ag-contract-rate-value-cell { vertical-align: middle; }
.ag-contract-rate-value-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}
.ag-contract-rate-cap {
    font-size: var(--ag-fs-micro);
    font-weight: 500;
    color: #96958f;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
}
.ag-contract-finance-list { display: flex; flex-direction: column; gap: 0.35rem; }
.ag-contract-finance-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--ag-fs-base);
}
.ag-contract-finance-label { flex: 1; color: #6c6c67; min-width: 0; }
.ag-contract-finance-amount { font-weight: 600; color: #191917; }
.ag-contract-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    color: #059669;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    transition: background 0.12s;
}
.ag-contract-link-btn:hover { background: #ecfdf5; }
.ag-contract-notes {
    font-size: var(--ag-fs-base);
    color: #302f2a;
    white-space: pre-line;
    line-height: 1.5;
    margin: 0;
}
.ag-contract-detail-footer {
    margin-top: 0.75rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e1e1de;
    font-size: var(--ag-fs-micro);
    color: #96958f;
}

.ag-entity-list-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 2rem;
    padding: 0;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #eeeeeb;
}
.ag-entity-list-item:hover { background: #f7f7f5; }
.ag-entity-list-item.is-selected {
    background: linear-gradient(90deg, #ecfdf5 0%, #f7f7f5 100%);
    border-left-color: #10b981;
}
.ag-entity-list-item.all-inactive:not(.is-selected) {
    opacity: 0.88;
}
.ag-entity-list-item.all-inactive:not(.is-selected) .ag-entity-list-name {
    color: #6c6c67;
}
.ag-entity-list-item.all-inactive.is-selected {
    background: linear-gradient(90deg, #eeeeeb 0%, #f7f7f5 100%);
    border-left-color: #96958f;
}
.ag-entity-list-glyphs-col {
    flex-shrink: 0;
    width: 2.3rem;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    border-right: 1px solid #eef2f6;
    background: #fafaf8;
}
.ag-entity-list-item.is-selected .ag-entity-list-glyphs-col {
    background: #f3fbf7;
    border-right-color: #dcefe6;
}
.ag-entity-glyph-cell {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    min-height: 1rem;
    padding: 0 0.15rem;
    margin: 0;
    border: none;
    border-bottom: 1px solid #eef2f6;
    background: transparent;
    color: #6c6c67;
    line-height: 1;
    font: inherit;
    transition: background 0.12s ease, color 0.12s ease;
}
.ag-entity-glyph-cell:last-child {
    border-bottom: none;
}
.ag-entity-list-glyphs-col.is-single .ag-entity-glyph-direct {
    border-bottom: none;
}
.ag-entity-glyph-cell i {
    flex-shrink: 0;
    font-size: var(--ag-fs-base);
    width: 0.7rem;
    text-align: center;
    opacity: 0.85;
}
.ag-entity-glyph-n {
    flex-shrink: 0;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 0.7rem;
    text-align: center;
    letter-spacing: -0.02em;
}
.ag-entity-glyph-direct.has-active {
    color: #047857;
    background: #f3fbf7;
}
.ag-entity-glyph-direct.has-active i {
    opacity: 1;
}
.ag-entity-glyph-direct.all-inactive {
    color: #6c6c67;
}
.ag-entity-glyph-direct.is-empty {
    color: #c9c9c4;
}
.ag-entity-glyph-direct.is-empty .ag-entity-glyph-n {
    font-weight: 500;
}
.ag-entity-glyph-cascade {
    color: #6366f1;
    background: #f8f9ff;
    cursor: pointer;
}
.ag-entity-glyph-cascade:hover {
    background: #eef2ff;
}
.ag-entity-glyph-cascade.is-active {
    background: #e0e7ff;
    color: #4338ca;
}
.ag-entity-list-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.28rem 0.5rem 0.28rem 0.42rem;
}
.ag-entity-list-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
.ag-entity-list-name {
    font-size: var(--ag-fs-base);
    font-weight: 600;
    color: #191917;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}
.ag-entity-list-country {
    flex-shrink: 0;
    font-size: var(--ag-fs-micro);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7d7c76;
    background: transparent;
    border: 1px solid var(--ag-badge-border);
    padding: 0.02rem 0.28rem;
    border-radius: var(--ag-badge-radius);
    line-height: 1.45;
}
.ag-entity-list-head-meta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
    margin-left: auto;
}
.ag-entity-list-meta-chip {
    flex-shrink: 0;
    font-size: var(--ag-fs-micro);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #7d7c76;
    background: transparent;
    border: 1px solid var(--ag-badge-border);
    padding: 0.02rem 0.3rem;
    border-radius: var(--ag-badge-radius);
    line-height: 1.45;
    white-space: nowrap;
}
.ag-entity-list-meta-chip.is-cat-av,
.ag-entity-list-meta-chip.is-cat-pop,
.ag-entity-list-meta-chip.is-cat-other {
    background: #f7f7f5;
    color: #6c6c67;
    border-color: #e1e1de;
}
.ag-entity-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    margin-top: 0;
    padding-left: 0;
}
.ag-entity-chip {
    padding: 0.02rem 0.3rem;
}
/* Famille / type de droits : même légende colorée que la fiche contrat */
.ag-entity-chip.is-publishing,
.ag-entity-chip.is-sync-rep-publishing {
    background: #e6ebf2;
    color: #35507d;
    border-color: #c9d4e3;
}
.ag-entity-chip.is-master,
.ag-entity-chip.is-sync-rep-master {
    background: #f3e7e1;
    color: #8a4a2e;
    border-color: #e3cdbd;
}
.ag-entity-chip.is-sync-rep-dual {
    background: #efe6f0;
    color: #6b3f70;
    border-color: #ddc7df;
}
.ag-entity-chip.is-inactive-hint {
    background: transparent;
    color: #7d7c76;
    border-color: #cfcec8;
}
.ag-entity-sidebar-tools {
    padding: 0.7rem 0.75rem 0.65rem;
    border-bottom: 1px solid #e4e4e1;
    flex-shrink: 0;
    background: #fafaf8;
}
.ag-entity-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.ag-entity-sidebar-head-main {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}
.ag-entity-sidebar-title {
    font-size: var(--ag-fs-micro);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6c6c67;
    margin: 0;
}
.ag-entity-sidebar-count {
    font-size: var(--ag-fs-micro);
    font-weight: 700;
    color: #2f6d52;
    background: #e7f5ee;
    border: 1px solid #cbe6d9;
    padding: 0.02rem 0.32rem;
    border-radius: var(--ag-badge-radius);
    font-variant-numeric: tabular-nums;
}
.ag-entity-sidebar-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.ag-entity-sidebar-action {
    width: 1.45rem;
    height: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    border: 1px solid #e1e1de;
    background: #fff;
    color: #6c6c67;
    font-size: 0.75rem;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ag-entity-sidebar-action:hover {
    background: #f7f7f5;
    color: #191917;
}
.ag-entity-sidebar-action.is-create { color: #059669; border-color: #bbf7d0; }
.ag-entity-sidebar-action.is-create:hover { background: #ecfdf5; }
.ag-entity-sidebar-action.is-contract { color: #7c3aed; border-color: #ddd6fe; }
.ag-entity-sidebar-action.is-contract:hover { background: #f5f3ff; }
.ag-entity-sidebar-search-wrap {
    position: relative;
    margin-bottom: 0.55rem;
}
.ag-entity-sidebar-search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6875rem;
    color: #96958f;
    pointer-events: none;
}
.ag-entity-sidebar-search {
    width: 100%;
    padding: 0.42rem 0.55rem 0.42rem 1.65rem;
    font-size: 0.75rem;
    border: 1px solid #e1e1de;
    border-radius: 0.5rem;
    background: #fff;
    color: #191917;
}
.ag-entity-sidebar-search:focus {
    outline: none;
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.12);
}
.ag-entity-indirect-filter {
    position: relative;
    margin-bottom: 0.55rem;
}
.ag-entity-indirect-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.35rem;
}
.ag-entity-indirect-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.35rem 0.15rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    max-width: 100%;
}
.ag-entity-indirect-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border: none;
    background: transparent;
    color: #6366f1;
    cursor: pointer;
    border-radius: 999px;
}
.ag-entity-indirect-chip-remove:hover {
    background: rgba(99, 102, 241, 0.12);
}
.ag-entity-indirect-input-wrap {
    position: relative;
}
.ag-entity-indirect-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6875rem;
    color: #818cf8;
    pointer-events: none;
}
.ag-entity-indirect-input {
    width: 100%;
    padding: 0.42rem 1.65rem 0.42rem 1.65rem;
    font-size: 0.75rem;
    border: 1px dashed #c7d2fe;
    border-radius: 0.5rem;
    background: #f7f7f5;
    color: #191917;
}
.ag-entity-indirect-input:focus {
    outline: none;
    border-color: #818cf8;
    border-style: solid;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.15);
}
.ag-entity-indirect-clear {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #96958f;
    cursor: pointer;
    padding: 0.15rem 0.25rem;
}
.ag-entity-indirect-dropdown {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 0.2rem);
    max-height: 11rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ag-entity-indirect-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
    border: none;
    background: #fff;
    color: #191917;
    cursor: pointer;
}
.ag-entity-indirect-dropdown-item:hover {
    background: #f7f7f5;
}
.ag-entity-indirect-dropdown-empty {
    padding: 0.55rem 0.65rem;
    font-size: 0.75rem;
    color: #96958f;
    text-align: center;
}
.ag-entity-chip.is-indirect {
    background: var(--ag-badge-bg);
    color: var(--ag-badge-fg);
    border-color: var(--ag-badge-border);
}
.ag-entity-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ag-entity-filter-menus {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 0.25rem;
}
.ag-entity-filter-menu-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.ag-entity-filter-menu-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.28rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.4375rem;
    border: 1px solid #e1e1de;
    background: #fff;
    color: #6c6c67;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ag-entity-filter-menu-btn i {
    font-size: 0.75rem;
    opacity: 0.55;
    flex-shrink: 0;
}
.ag-entity-filter-menu-btn:hover {
    background: #f7f7f5;
    color: #302f2a;
}
.ag-entity-filter-menu-btn.is-active.is-cat {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}
.ag-entity-filter-menu-btn.is-active.is-role {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.ag-entity-filter-menu-btn.is-active.is-rights {
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ddd6fe;
}
.ag-entity-filter-menu-btn.is-active.is-activity {
    background: #eeeeeb;
    color: #48483f;
    border-color: #c9c9c4;
}
.ag-entity-filter-dropdown {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 60;
    min-width: 100%;
    width: max-content;
    max-width: 11rem;
    padding: 0.25rem;
    background: #fff;
    border: 1px solid #e1e1de;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}
.ag-entity-filter-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #302f2a;
    border-radius: 0.375rem;
    text-align: left;
    transition: background 0.12s;
}
.ag-entity-filter-dropdown-item i {
    width: 0.75rem;
    font-size: 0.75rem;
    opacity: 0;
    color: #059669;
}
.ag-entity-filter-dropdown-item.is-selected {
    background: #f0fdf4;
    color: #047857;
    font-weight: 600;
}
.ag-entity-filter-dropdown-item.is-selected i { opacity: 1; }
.ag-entity-filter-dropdown-item:hover { background: #f7f7f5; }
.ag-entity-filter-dropdown-item.is-selected:hover { background: #ecfdf5; }
.ag-entity-filter-clear-icon {
    flex-shrink: 0;
    width: 1.45rem;
    height: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    border: 1px solid #fecdd3;
    background: #fff1f2;
    color: #be123c;
    font-size: 0.6875rem;
    transition: background 0.12s;
}
.ag-entity-filter-clear-icon:hover { background: #ffe4e6; }

.ag-wizard-s4-section {
    background: #fff;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    overflow: hidden;
}
.ag-wizard-s4-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #f0f0ed;
    background: #fafaf8;
}
.ag-wizard-s4-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #111;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.ag-wizard-s4-section-title i {
    font-size: 0.7rem;
    color: #888;
}
.ag-wizard-s4-section-body { padding: 0.65rem; }
.ag-wizard-s4-empty {
    text-align: center;
    padding: 2.25rem 1rem;
    font-size: 0.8125rem;
    color: #aaa;
    background: #fff;
    border: 1px dashed #e0e0dc;
    border-radius: 10px;
}
.ag-wizard-s4-empty i {
    display: block;
    font-size: 1.5rem;
    color: #d0d0cc;
    margin-bottom: 0.5rem;
}
/* Puces (sociétés de gestion, catalogues proposés) */
.ag-wizard-s4-chip {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #e8e8e5;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: border-color 0.14s, color 0.14s;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ag-wizard-s4-chip:hover { border-color: #ccc; color: #111; }
.ag-wizard-s4-chip.is-on {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}
.ag-wizard-s4-chip--suggestion {
    display: block;
    width: 100%;
    white-space: normal;
    text-align: left;
    line-height: 1.35;
    overflow: visible;
    text-overflow: unset;
    padding: 0.35rem 0.5rem;
}
.ag-wizard-s4-icon-btn {
    font-size: 0.6875rem;
    color: #888;
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
}
.ag-wizard-s4-icon-btn:hover { background: #f2f2f0; color: #111; }
.ag-wizard-s4-icon-btn--danger:hover { background: #fef2f2; color: #b91c1c; }

/* ── Cases à cocher de l'éditeur de catalogues ── */
.ag-wizard-s4-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.75rem;
    color: #444;
}
.ag-wizard-s4-checks label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}
.ag-wizard-s4-details-chevron {
    font-size: 0.5rem;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.15s ease, color 0.14s;
}

/* ── Boutons doux étape 4 ── */
.ag-wizard-s4-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: 1px solid #e8e8e5;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.ag-wizard-s4-btn-ghost:hover {
    background: #fff;
    border-color: #cbd5e1;
    color: #334155;
}

/* ── États vides ── */
.ag-wizard-s4-empty--sm {
    padding: 1.25rem 0.75rem;
    font-size: 0.75rem;
}
.ag-wizard-s4-section {
    border-color: #ececea;
    box-shadow: none;
}
.ag-wizard-s4-section-head {
    background: #fafaf8;
}
.ag-wizard-s4 {
    background: #f8f8f6;
}
.ag-wizard-s4-checks input[type="checkbox"] {
    accent-color: #3b82f6;
}

.ag-wizard-s4 {
    overflow: hidden;
}

/* Refonte assistant contrats — surfaces sobres et synthèse */
.ag-agreement-wizard {
    background: #f7f7f5;
    color: #20201e;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ag-wizard-unsaved-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    color: #94601f;
    font-size: 0.62rem;
    font-weight: 650;
    white-space: nowrap;
}
.ag-wizard-unsaved-badge > span {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: #d89a43;
    box-shadow: 0 0 0 3px #fff3dc;
}
[aria-invalid="true"] {
    border-color: #e3a6a6 !important;
    background: #fffafa;
}
.ag-wizard-review-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(24, 24, 22, 0.38);
    backdrop-filter: blur(3px);
}
.ag-wizard-review-panel {
    width: min(42rem, 100%);
    max-height: min(88vh, 52rem);
    overflow: auto;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(20,20,18,.22);
}
.ag-wizard-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.35rem 1rem;
    border-bottom: 1px solid #ecece8;
}
.ag-wizard-review-head h2 { color: #22221f; font-size: 1rem; font-weight: 750; }
.ag-wizard-review-kicker {
    margin-bottom: 0.2rem;
    color: #8d8d86;
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ag-wizard-review-notice {
    display: flex;
    gap: 0.55rem;
    margin: 1rem 1.25rem 0;
    padding: 0.7rem 0.8rem;
    border: 1px solid #c9e6d7;
    border-radius: 9px;
    background: #f1faf5;
    color: #276044;
    font-size: 0.72rem;
    line-height: 1.45;
}
.ag-wizard-review-list { padding: 0.75rem 1.25rem 1rem; }
.ag-wizard-review-block {
    border-bottom: 1px solid #f0f0ed;
}
.ag-wizard-review-block:last-child { border-bottom: 0; }
.ag-wizard-review-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 0;
}
.ag-wizard-review-row strong,
.ag-wizard-review-row small { display: block; }
.ag-wizard-review-row strong { color: #343430; font-size: 0.75rem; }
.ag-wizard-review-row small { margin-top: 0.08rem; color: #92928b; font-size: 0.63rem; }
.ag-wizard-review-detail {
    padding: 0 0 0.75rem 2.35rem;
}
.ag-wizard-review-detail-section + .ag-wizard-review-detail-section {
    margin-top: 0.65rem;
}
.ag-wizard-review-detail-title {
    margin: 0 0 0.35rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}
.ag-wizard-review-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.6875rem;
    table-layout: fixed;
    border: 1px solid #ececea;
    border-radius: 8px;
    overflow: hidden;
}
.ag-wizard-review-table thead th {
    padding: 0.3rem 0.45rem;
    text-align: left;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #94a3b8;
    background: #fafaf8;
    border-bottom: 1px solid #ececea;
}
.ag-wizard-review-table tbody td {
    padding: 0.32rem 0.45rem;
    vertical-align: middle;
    border-bottom: 1px solid #f3f3f0;
    line-height: 1.35;
}
.ag-wizard-review-table tbody tr:last-child td { border-bottom: none; }
.ag-wizard-review-table .ag-wizard-s4-entity-chip {
    max-width: 100%;
}
.ag-wizard-review-muted {
    color: #64748b;
    font-size: 0.625rem;
    word-break: break-word;
}
.ag-wizard-review-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.625rem;
    color: #475569;
}
.ag-wizard-review-state {
    display: grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 7px;
    font-size: 0.62rem;
}
.ag-wizard-review-state.is-changed { background: #eef2ff; color: #4e5fb3; }
.ag-wizard-review-state.is-untouched { background: #f2f2ef; color: #96968e; }
.ag-wizard-review-count {
    max-width: 9rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #f2f2ef;
    color: #6f6f69;
    text-align: center;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ag-wizard-review-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    border-top: 1px solid #ecece8;
    background: #fafaf8;
}
.ag-wizard-review-secondary,
.ag-wizard-review-primary {
    padding: 0.62rem 0.9rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
}
.ag-wizard-review-secondary { color: #666660; }
.ag-wizard-review-primary { background: #3f56b4; color: #fff; }
.ag-wizard-review-primary:hover { background: #34499f; }
@media (max-width: 767px) {
    .ag-wizard-review-actions { flex-direction: column-reverse; }
    .ag-wizard-review-secondary,
    .ag-wizard-review-primary { width: 100%; }
}

/* ── Assistant accord : onglet Assets compact ── */
.ag-wizard-s4-assets-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: start;
    overflow: visible;
}
@media (min-width: 1180px) {
    .ag-wizard-s4-assets-split {
        grid-template-columns: minmax(22rem, 26rem) minmax(0, 1fr);
    }
}
.ag-wizard-s4-section--covered,
.ag-wizard-s4-section--assets {
    min-width: 0;
}
.ag-wizard-s4-covered-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.5rem;
}
.ag-wizard-s4-covered-card {
    position: relative;
    padding: 0.45rem 0.5rem 0.5rem;
    border: 1px solid #ececea;
    border-radius: 9px;
    background: #fff;
}
.ag-wizard-s4-covered-card:focus-within {
    z-index: 26;
}
.ag-wizard-s4-covered-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0;
}
.ag-wizard-s4-covered-card-head .ag-wizard-s4-entity-chip-wrap,
.ag-wizard-s4-covered-search {
    flex: 1;
    min-width: 0;
}
.ag-wizard-s4-covered-card .ag-wizard-s4-entity-chip {
    width: 100%;
}
.ag-wizard-s4-covered-card .ag-wizard-s4-entity-chip-label {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.3;
}
.ag-wizard-s4-covered-fields {
    display: grid;
    grid-template-columns: minmax(7.25rem, 0.75fr) minmax(0, 1.35fr);
    gap: 0.4rem 0.5rem;
    margin-top: 0.45rem;
}
.ag-wizard-s4-covered-comment {
    grid-column: 1 / -1;
}
.ag-wizard-s4-covered-asset select {
    text-overflow: ellipsis;
}
.ag-wizard-s4-asset-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.55rem;
}
.ag-wizard-s4-asset-card {
    container-type: inline-size;
    position: relative;
    background: #fff;
    border: 1px solid #ececea;
    border-radius: 10px;
    padding: 0.6rem 0.7rem 0.45rem;
    overflow: visible;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.02);
}
.ag-wizard-s4-asset-card:focus-within {
    z-index: 24;
}
.ag-wizard-s4-asset-card:hover {
    border-color: #e2e2de;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.ag-wizard-s4-asset-card-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.ag-wizard-s4-asset-card-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: #f3f3f0;
    color: #78786f;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ag-wizard-s4-asset-card-title {
    flex: 1;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 650;
    color: #171717;
    border: none;
    border-bottom: 1px solid transparent;
    background: transparent;
    padding: 0.15rem 0.1rem;
    line-height: 1.35;
}
.ag-wizard-s4-asset-card-title::placeholder {
    font-weight: 500;
    color: #b0b0aa;
}
.ag-wizard-s4-asset-card-title:hover {
    border-bottom-color: #e8e8e5;
}
.ag-wizard-s4-asset-card-title:focus {
    outline: none;
    border-bottom-color: #3b82f6;
}
.ag-wizard-s4-asset-type {
    width: auto;
    min-width: 8.25rem;
    max-width: 10.5rem;
    flex-shrink: 0;
    font-weight: 650;
    color: #5b21b6;
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.ag-wizard-s4-asset-field > label {
    display: block;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #a8a8a0;
    margin-bottom: 0.22rem;
}
.ag-wizard-s4-asset-field--span {
    grid-column: 1 / -1;
}
.ag-wizard-s4-asset-card-identity {
    display: grid;
    grid-template-columns: minmax(7.25rem, 9.5rem);
    gap: 0.5rem 0.65rem;
    margin-top: 0.55rem;
    padding: 0.5rem 0.55rem 0.55rem;
    background: #f7f7f4;
    border: 1px solid #f0f0ed;
    border-radius: 8px;
}
.ag-wizard-s4-asset-card-identity.has-cmo {
    grid-template-columns: minmax(7.25rem, 8.75rem) minmax(0, 1fr) minmax(0, 1fr);
}
.ag-wizard-s4-asset-card-identity.is-identifier {
    grid-template-columns: minmax(0, 1fr);
}
.ag-wizard-s4-asset-card-coverage {
    display: grid;
    grid-template-columns: minmax(7.5rem, 0.9fr) minmax(9rem, 1.1fr) minmax(0, 1.45fr);
    gap: 0.45rem 0.55rem;
    margin-top: 0.55rem;
}
@media (max-width: 720px) {
    .ag-wizard-s4-asset-card-identity.has-cmo,
    .ag-wizard-s4-asset-card-coverage {
        grid-template-columns: 1fr;
    }
}
@container (max-width: 34rem) {
    .ag-wizard-s4-asset-card-identity.has-cmo,
    .ag-wizard-s4-asset-card-coverage {
        grid-template-columns: 1fr;
    }
    .ag-wizard-s4-asset-card .ag-wizard-s4-asset-cmo-row {
        flex-wrap: wrap;
    }
}
.ag-wizard-s4-asset-card .ag-wizard-s4-chip.is-on button {
    color: #64748b;
}
.ag-wizard-s4-asset-card .ag-wizard-s4-chip.is-on button:hover {
    color: #b91c1c;
}
.ag-wizard-s4-section--compact .ag-wizard-s4-section-head {
    padding: 0.4rem 0.55rem;
}
.ag-wizard-s4-section--compact .ag-wizard-s4-section-title {
    font-size: 0.6875rem;
}
.ag-wizard-s4-section--compact {
    overflow: visible;
}
.ag-wizard-s4-section-body--flush {
    padding: 0;
    overflow: visible;
}
.ag-wizard-s4-id-row {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
    align-items: center;
}
.ag-wizard-s4-id-row--tight {
    margin-top: 0;
}
.ag-wizard-s4-id-row select.ag-wizard-s4-input-compact {
    width: 5.85rem;
    flex-shrink: 0;
    padding-left: 0.3rem;
    padding-right: 0.15rem;
}
.ag-wizard-s4-id-row input.ag-wizard-s4-input-compact {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}
.ag-wizard-s4-asset-cmo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.7rem;
}
.ag-wizard-s4-asset-card .ag-wizard-s4-asset-cmo-row {
    flex-wrap: nowrap;
}
.ag-wizard-s4-asset-card .ag-wizard-s4-chip.is-on {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.ag-wizard-s4-asset-card .ag-wizard-s4-asset-cmo-row .relative {
    min-width: 4.5rem;
}
.ag-wizard-s4-compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.6875rem;
    overflow: visible;
}
.ag-wizard-s4-compact-table tbody tr:has(.ag-wizard-s4-combobox:focus-within) {
    position: relative;
    z-index: 40;
}
.ag-wizard-s4-compact-table thead th {
    padding: 0.35rem 0.45rem;
    text-align: left;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #94a3b8;
    background: #fafaf8;
    border-bottom: 1px solid #ececea;
    white-space: nowrap;
}
.ag-wizard-s4-compact-table tbody td {
    padding: 0.3rem 0.45rem;
    vertical-align: top;
    border-bottom: 1px solid #f3f3f0;
    overflow: visible;
}
.ag-wizard-s4-compact-table tbody tr:last-child td {
    border-bottom: none;
}
.ag-wizard-s4-compact-table tbody tr:hover td {
    background: #fcfcfb;
}
.ag-wizard-s4-asset-entries {
    margin-top: 0.5rem;
    padding-top: 0.15rem;
    border-top: 1px dashed #ececea;
}
.ag-wizard-s4-asset-entries summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 0.35rem 0 0.2rem;
    font-size: 0.6875rem;
    font-weight: 650;
    color: #57534e;
}
.ag-wizard-s4-asset-entries summary::-webkit-details-marker { display: none; }
.ag-wizard-s4-asset-entries[open] > summary .ag-wizard-s4-details-chevron {
    transform: rotate(90deg);
}
.ag-wizard-s4-asset-entries summary i.fa-list-ul {
    font-size: 0.625rem;
    color: #94a3b8;
}
.ag-wizard-s4-asset-entries-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.5625rem;
    font-weight: 700;
}
.ag-wizard-s4-asset-entries.has-entries .ag-wizard-s4-asset-entries-count {
    background: #eef2ff;
    color: #4338ca;
}
.ag-wizard-s4-asset-entries-add {
    margin-left: auto;
    padding: 0.18rem 0.45rem;
    font-size: 0.625rem;
}
.ag-wizard-s4-asset-entries-body {
    margin-top: 0.25rem;
    max-height: 240px;
    overflow: auto;
    border: 1px solid #f0f0ed;
    border-radius: 8px;
    background: #fafaf8;
}
.ag-wizard-s4-compact-table--entries {
    background: #fff;
}
.ag-wizard-s4-compact-table--entries thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.ag-wizard-s4-input-compact {
    width: 100%;
    min-width: 0;
    padding: 0.28rem 0.4rem;
    font-size: 0.6875rem;
    line-height: 1.3;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    background: #fff;
}
.ag-wizard-s4-input-compact:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}
.ag-wizard-s4-checks--inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    font-size: 0.625rem;
    color: #64748b;
}
.ag-wizard-s4-checks--inline label {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
}
.ag-wizard-s4-catalog-picker {
    padding: 0.35rem 0.55rem;
    border-bottom: 1px solid #f0f0ed;
    font-size: 0.6875rem;
}
.ag-wizard-s4-catalog-picker summary {
    cursor: pointer;
    color: #64748b;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ag-wizard-s4-catalog-picker summary::-webkit-details-marker { display: none; }
.ag-wizard-s4-catalog-picker[open] summary {
    color: #334155;
    margin-bottom: 0.25rem;
}

/* Combobox entité couverte */
.ag-wizard-s4-combobox {
    position: relative;
    min-width: 0;
}
.ag-wizard-s4-combobox:focus-within {
    z-index: 45;
}
.ag-wizard-s4-combobox-menu {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-height: 10.5rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}
.ag-wizard-s4-combobox-menu.is-dropup {
    top: auto;
    bottom: calc(100% + 2px);
}
.ag-wizard-s4-combobox-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.42rem 0.55rem;
    text-align: left;
    font-size: 0.6875rem;
    color: #334155;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
}
.ag-wizard-s4-combobox-item:last-child { border-bottom: none; }
.ag-wizard-s4-combobox-item:hover { background: #f8fafc; }
.ag-wizard-s4-combobox-item.is-create {
    color: #1d4ed8;
    background: #eff6ff;
    font-weight: 600;
}
.ag-wizard-s4-combobox-item.is-create:hover { background: #dbeafe; }
.ag-wizard-s4-combobox-item.is-create i { color: #2563eb; }
.ag-wizard-s4-combobox-empty {
    padding: 0.45rem 0.55rem;
    font-size: 0.625rem;
    color: #94a3b8;
    text-align: center;
}

/* Chip entité sélectionnée */
.ag-wizard-s4-entity-chip-wrap {
    min-width: 0;
}
.ag-wizard-s4-entity-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    min-height: 1.65rem;
    padding: 0.15rem 0.35rem 0.15rem 0.45rem;
    border-radius: 6px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    color: #1e3a8a;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.ag-wizard-s4-entity-chip.is-pending {
    border-style: dashed;
    border-color: #93c5fd;
    background: #f8fbff;
    color: #2563eb;
}
.ag-wizard-s4-entity-chip i {
    font-size: 0.625rem;
    opacity: 0.75;
    flex-shrink: 0;
}
.ag-wizard-s4-entity-chip-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ag-wizard-s4-entity-chip-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    margin-left: 0.05rem;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}
.ag-wizard-s4-entity-chip-clear:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}

/* ══════════════════════════════════════════════════════════════════════
   DB_SchemaExplorer — vue pédagogique et en lecture seule du schéma DB
   ══════════════════════════════════════════════════════════════════════ */
.dbx-root {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.dbx-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dbx-header-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.dbx-header-text h2 i { color: #6366f1; }
.dbx-header-text p {
    margin: 0.25rem 0 0;
    color: #64748b;
    font-size: 0.875rem;
}
.dbx-readonly-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    height: fit-content;
}
.dbx-loading, .dbx-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem;
    justify-content: center;
    color: #64748b;
    font-size: 0.9rem;
}
.dbx-error { color: #dc2626; }

.dbx-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.dbx-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.dbx-breadcrumb button {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.dbx-breadcrumb button:hover { background: #f1f5f9; }
.dbx-crumb-sep { color: #cbd5e1; font-size: 0.7rem; }
.dbx-crumb--active {
    color: #0f172a !important;
    font-weight: 700 !important;
}

.dbx-global-search { position: relative; min-width: 260px; }
.dbx-global-search > i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8rem;
}
.dbx-global-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
}
.dbx-global-search input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.dbx-global-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    z-index: 40;
    max-height: 320px;
    overflow-y: auto;
}
.dbx-global-search-results button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.dbx-global-search-results button:last-child { border-bottom: none; }
.dbx-global-search-results button:hover { background: #f8fafc; }

.dbx-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.dbx-stat {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    text-align: center;
}
.dbx-stat-value { font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.dbx-stat-label { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.15rem; }

.dbx-level { display: flex; flex-direction: column; gap: 1.25rem; }

.dbx-diagram-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.15rem;
}
.dbx-hint { color: #94a3b8; font-size: 0.78rem; margin: 0 0 0.75rem; }

.dbx-diagram {
    position: relative;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}
.dbx-diagram-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.dbx-diagram-edge {
    stroke: #cbd5e1;
    stroke-linecap: round;
    transition: stroke 0.15s, opacity 0.15s;
}
.dbx-diagram-edge--thin { stroke: #dbeafe; stroke-width: 1.4; }
.dbx-diagram-edge--dim { opacity: 0.15; }

.dbx-diagram-node {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    width: 108px;
    padding: 0.5rem 0.4rem;
    border-radius: 14px;
    border: 2px solid var(--node-color, #6366f1);
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.dbx-diagram-node:hover {
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
    z-index: 5;
}
.dbx-diagram-node-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--node-color, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}
.dbx-diagram-node-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    line-height: 1.15;
}
.dbx-diagram-node-count { font-size: 0.62rem; color: #94a3b8; }
.dbx-diagram-node-self {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.dbx-module-grid-panel { display: flex; flex-direction: column; gap: 0.75rem; }
.dbx-module-search, .dbx-external-search {
    position: relative;
    max-width: 320px;
}
.dbx-module-search > i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8rem;
}
.dbx-module-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
}

.dbx-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
}
.dbx-module-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #eef2f7;
    border-left: 4px solid var(--card-color, #6366f1);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: box-shadow 0.15s, transform 0.15s;
}
.dbx-module-card:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}
.dbx-module-card-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    background: var(--card-color, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
.dbx-module-card-body { flex: 1; min-width: 0; }
.dbx-module-card-name { font-weight: 700; color: #0f172a; font-size: 0.9rem; }
.dbx-module-card-meta { font-size: 0.75rem; color: #64748b; margin-top: 0.1rem; }
.dbx-module-card-arrow { color: #cbd5e1; font-size: 0.8rem; }

.dbx-module-detail-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    background: #fff;
    border: 1px solid #eef2f7;
    border-left: 4px solid var(--card-color, #6366f1);
    border-radius: 12px;
}

.dbx-module-body {
    display: grid;
    grid-template-columns: minmax(260px, 420px) 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 900px) {
    .dbx-module-body { grid-template-columns: 1fr; }
}

.dbx-diagram--tables { max-width: 420px; }
.dbx-table-dot {
    position: absolute;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid #6366f1;
    background: #eef2ff;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
    padding: 0;
}
.dbx-table-dot:hover {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    z-index: 5;
}
.dbx-table-dot--reference {
    border-color: #16a34a;
    background: #f0fdf4;
}
.dbx-diagram-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: #64748b;
}
.dbx-legend-dot { color: #6366f1; font-size: 0.55rem; }
.dbx-legend-dot--reference { color: #16a34a; }

.dbx-module-list-panel { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.dbx-table-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.dbx-table-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 0.85rem;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.dbx-table-row:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}
.dbx-table-row-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dbx-table-name { font-weight: 700; color: #0f172a; font-size: 0.85rem; font-family: 'SFMono-Regular', Consolas, monospace; }
.dbx-table-comment { font-size: 0.75rem; color: #64748b; }
.dbx-table-row-comment { font-size: 0.75rem; color: #64748b; }
.dbx-table-row-meta {
    display: flex;
    gap: 0.85rem;
    font-size: 0.7rem;
    color: #94a3b8;
}
.dbx-table-row-meta i { margin-right: 0.2rem; }

.dbx-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.dbx-badge--reference { background: #f0fdf4; color: #16a34a; }
.dbx-badge--pk { background: #fef9c3; color: #a16207; }
.dbx-badge--fk { background: #eef2ff; color: #4f46e5; }
.dbx-badge--unique { background: #f1f5f9; color: #475569; }

.dbx-external-relations {
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}
.dbx-external-relations h4 {
    margin: 0 0 0.6rem;
    font-size: 0.8rem;
    color: #475569;
}
.dbx-external-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dbx-external-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--card-color, #6366f1);
    color: var(--card-color, #6366f1);
    background: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.dbx-external-chip:hover { background: color-mix(in srgb, var(--card-color, #6366f1) 8%, #fff); }
.dbx-external-chip-count {
    background: var(--card-color, #6366f1);
    color: #fff;
    border-radius: 999px;
    padding: 0 0.4rem;
    font-size: 0.68rem;
}

.dbx-empty, .dbx-empty-inline {
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
}
.dbx-empty-inline { text-align: left; padding: 0.25rem 0; }

.dbx-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.5rem;
}
.dbx-back-btn:hover { background: #e2e8f0; }

.dbx-table-detail-header {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 1rem 1.15rem;
}
.dbx-table-detail-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.dbx-table-detail-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-family: 'SFMono-Regular', Consolas, monospace;
    color: #0f172a;
}
.dbx-table-detail-comment { color: #64748b; font-size: 0.85rem; margin: 0.4rem 0 0; }
.dbx-table-detail-meta {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.dbx-table-detail-body {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1000px) {
    .dbx-table-detail-body { grid-template-columns: 1fr; }
}

.dbx-columns-panel h4, .dbx-relations-block h4 {
    margin: 0 0 0.3rem;
    font-size: 0.85rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.dbx-columns-table-wrap {
    overflow-x: auto;
    border: 1px solid #eef2f7;
    border-radius: 12px;
}
.dbx-columns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.dbx-columns-table thead th {
    text-align: left;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #eef2f7;
    white-space: nowrap;
}
.dbx-columns-table tbody td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #f5f7fa;
    vertical-align: top;
}
.dbx-columns-table tbody tr:last-child td { border-bottom: none; }
.dbx-col-name { font-family: 'SFMono-Regular', Consolas, monospace; font-weight: 600; color: #0f172a; white-space: nowrap; }
.dbx-not-null-dot { color: #ef4444; margin-left: 0.1rem; }
.dbx-col-type { color: #7c3aed; font-family: 'SFMono-Regular', Consolas, monospace; white-space: nowrap; font-size: 0.74rem; }
.dbx-col-comment { color: #64748b; }

.dbx-fk-link {
    border: none;
    background: transparent;
    color: #4f46e5;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
    font-family: 'SFMono-Regular', Consolas, monospace;
}
.dbx-fk-link:hover { text-decoration: underline; }

.dbx-relations-panel { display: flex; flex-direction: column; gap: 1rem; }
.dbx-relations-block {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}
.dbx-relations-list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
}
.dbx-relations-list li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #475569;
}
.dbx-relations-list li i { color: #cbd5e1; font-size: 0.65rem; }
.dbx-rel-col { font-family: 'SFMono-Regular', Consolas, monospace; color: #64748b; }
.dbx-rel-cols-inline { color: #94a3b8; font-size: 0.72rem; }

.dbx-sample-panel {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
}
.dbx-sample-table-wrap { overflow-x: auto; }
.dbx-sample-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.dbx-sample-table thead th {
    text-align: left;
    background: #f0fdf4;
    color: #16a34a;
    font-weight: 700;
    padding: 0.45rem 0.65rem;
    white-space: nowrap;
    border-bottom: 1px solid #dcfce7;
}
.dbx-sample-table tbody td {
    padding: 0.4rem 0.65rem;
    border-bottom: 1px solid #f5f7fa;
    color: #334155;
    white-space: nowrap;
}
.dbx-no-sample {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.8rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}

/* Base de données dans le volet Administration : les briques et la palette neutre du tableau de bord.
   La couleur d'un module ne reste que dans l'icône de sa tuile et de son nœud. */
.dbx-root { display: block; }
.dbx-root .dash-search { color: #9a9a94; }
.dbx-find { position: relative; }
.dbx-find .dbx-global-search-results { border-color: #e8e8e5; border-radius: 10px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08); }
.dbx-find .dbx-global-search-results button { border-bottom-color: #f2f2f0; }
.dbx-find .dbx-global-search-results button:hover { background: #fafaf8; }
.dbx-crumbs { min-width: 0; max-width: 100%; }
.dbx-crumbs > button { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbx-crumb-table { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 0.74rem; cursor: default; }
.dbx-readonly { gap: 0.35rem; font-size: 0.72rem; color: #9a9a94; white-space: nowrap; }
.dbx-readonly i { font-size: 0.64rem; }
.dbx-tile-icon { background: color-mix(in srgb, var(--card-color, #777) 12%, #fff); color: var(--card-color, #333); }
.dbx-tile-icon.is-reference { background: #f0fdf4; color: #16a34a; }
.dbx-tile.is-table .dash-tool-name { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 0.78rem; }
.dbx-map { background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; padding: 1.5rem 1rem; }
.dbx-root .dbx-diagram-edge { stroke: #e4e4e0; }
.dbx-root .dbx-diagram-edge--thin { stroke: #e4e4e0; }
.dbx-root .dbx-diagram-node { border: 1px solid #e8e8e5; border-radius: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.dbx-root .dbx-diagram-node:hover { border-color: #cfcfca; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); }
.dbx-root .dbx-diagram-node-icon { background: color-mix(in srgb, var(--node-color, #777) 12%, #fff); color: var(--node-color, #333); }
.dbx-root .dbx-diagram-node-label { color: #111; font-weight: 600; }
.dbx-root .dbx-diagram-node-count { color: #9a9a94; }
.dbx-root .dbx-diagram-node-self { background: #fff; color: #9a9a94; border-color: #e8e8e5; }
.dbx-root .dbx-table-dot { border-color: #9a9a94; background: #fff; }
.dbx-root .dbx-table-dot:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12); }
.dbx-root .dbx-legend-dot { color: #9a9a94; }
.dbx-root .dbx-diagram-legend { color: #9a9a94; }
.dbx-external-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.dbx-root .dbx-external-chip { border: 1px solid #e8e8e5; border-radius: 8px; color: #333; background: #fff; padding: 0.35rem 0.6rem; }
.dbx-root .dbx-external-chip i { color: var(--card-color, #9a9a94); }
.dbx-root .dbx-external-chip:hover { background: #fafaf8; }
.dbx-root .dbx-level { gap: 1.25rem; }
.dbx-root .dbx-table-detail-header { background: none; border: 0; padding: 0; }
.dbx-root .dbx-table-detail-title { flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline; }
.dbx-root .dbx-table-detail-title h3 { font-size: 1rem; color: #111; }
.dbx-root .dbx-table-detail-comment { color: #666; font-size: 0.82rem; }
.dbx-root .dbx-columns-panel h4,
.dbx-root .dbx-relations-block h4,
.dbx-root .dbx-sample-panel h4 { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #b0b0aa; margin-bottom: 0.4rem; }
.dbx-root .dbx-columns-panel h4 i,
.dbx-root .dbx-relations-block h4 i,
.dbx-root .dbx-sample-panel h4 i { color: #c4c4be; }
.dbx-root .dbx-hint { color: #9a9a94; font-size: 0.74rem; }
.dbx-root .dbx-columns-table-wrap,
.dbx-root .dbx-relations-block,
.dbx-root .dbx-sample-panel { border-color: #e8e8e5; border-radius: 10px; }
.dbx-root .dbx-columns-table-wrap { background: #fff; }
.dbx-root .dbx-columns-table thead th,
.dbx-root .dbx-sample-table thead th { background: #fafaf8; color: #9a9a94; border-bottom-color: #ececea; font-weight: 600; }
.dbx-root .dbx-columns-table tbody td,
.dbx-root .dbx-sample-table tbody td { border-bottom-color: #f2f2f0; color: #333; }
.dbx-root .dbx-col-name { color: #111; }
.dbx-root .dbx-col-type { color: #9a9a94; }
.dbx-root .dbx-col-comment { color: #666; }
.dbx-root .dbx-fk-link { color: #111; text-decoration: underline; text-decoration-color: #d4d4cf; text-underline-offset: 2px; }
.dbx-root .dbx-fk-link:hover { text-decoration-color: #111; }
.dbx-root .dbx-badge--fk { background: #f2f2f0; color: #555; }
.dbx-root .dbx-badge--unique { background: #f2f2f0; color: #777; }
.dbx-root .dbx-relations-list li { color: #555; }
.dbx-root .dbx-rel-col { color: #9a9a94; }
.dbx-root .dbx-no-sample { background: #fafaf8; border-color: #e8e8e5; border-radius: 10px; color: #9a9a94; }
@media (max-width: 640px) {
    .dbx-readonly { margin-left: 0; }
    .dbx-crumbs > button { max-width: 9rem; }
}

@media (max-width: 640px) {
    .dbx-stats-bar { grid-template-columns: repeat(2, 1fr); }
    .dbx-diagram-node { width: 84px; }
}

/*
 * Catalogue AVP — quand une liste d'etiquettes (plateformes, pays, genres...)
 * depasse la largeur de sa colonne, on prefere un fondu au bord plutot qu'une
 * coupure nette au pixel pres : ca se lit comme « la suite existe » plutot
 * que comme un bug d'affichage.
 */
.avp-cell-fade {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
}

/*
 * Colonnes à pastille + bouton « ajouter » (Dépôts CMO, Entité).
 * Le + est hors du flux des étiquettes : il ne peut plus être clipé
 * ni recouvert. Si la colonne est trop étroite, seul le groupe de
 * pastilles s'estompe (le fondu tombe dans le vide quand elles tiennent).
 */
.avp-chip-add-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}
.avp-chip-add-cell__tags {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent 100%);
}
.avp-chip-add-cell__add {
    flex: 0 0 auto;
}
.avp-reg-chip__extra {
    display: grid;
    grid-template-columns: 0fr;
    min-width: 0;
    transition: grid-template-columns 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.avp-reg-chip:hover .avp-reg-chip__extra,
.avp-reg-chip:focus-within .avp-reg-chip__extra {
    grid-template-columns: 1fr;
}
.avp-reg-chip__extra-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 200ms ease 40ms;
}
.avp-reg-chip:hover .avp-reg-chip__extra-inner,
.avp-reg-chip:focus-within .avp-reg-chip__extra-inner {
    opacity: 1;
}

/* Agreements — cockpit unifié des contrats */
.ag-contracts-cockpit {
    flex: 1;
    min-width: 0;
    overflow: auto;
    padding: 16px 20px 20px;
    color: #172033;
    background: #f7f7f5;
}
.ag-contracts-topbar,
.ag-contract-table-toolbar,
.ag-contract-pagination,
.ag-contract-filterbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ag-contracts-topbar { margin-bottom: 10px; }
.ag-contract-cockpit-alert {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 12px; padding: 10px 13px; border: 1px solid; border-radius: 0.5rem; font-size: 0.75rem; font-weight: 600;
}
.ag-contract-cockpit-alert.is-error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.ag-contract-cockpit-alert button { border: 0; background: transparent; color: inherit; }
.ag-contracts-header-actions { display: flex; gap: 8px; }
.ag-contract-back-button, .ag-contract-more-filters,
.ag-contract-columns-control > button {
    display: inline-flex; align-items: center; gap: 8px; min-height: 38px;
    padding: 8px 13px; border: 1px solid #e1e1de; border-radius: 0.4375rem;
    background: #fff; color: #48483f; font-size: 0.75rem; font-weight: 500;
    flex-shrink: 0; white-space: nowrap; transition: background 0.12s, border-color 0.12s;
}
.ag-contract-back-button:hover, .ag-contract-more-filters:hover,
.ag-contract-columns-control > button:hover {
    background: #f7f7f5; border-color: #c9c9c4;
}
.ag-contract-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.ag-contract-filters, .ag-contract-table-card {
    border: 1px solid #e1e1de; border-radius: 0.625rem; background: #fff;
}
.ag-contract-filterbar { padding: 13px; }
.ag-contract-search { position: relative; flex: 1; min-width: 220px; max-width: 480px; }
.ag-contract-search i { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: #96958f; }
.ag-contract-search input {
    width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid #d9d9d5;
    border-radius: 0.5rem; background: #f7f7f5; font-size: 0.75rem;
}
.ag-contract-right-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ag-contract-filter-chip {
    padding: 7px 10px; border: 1px solid #e1e1de; border-radius: 999px;
    background: #fff; color: #6c6c67; font-size: 0.75rem; font-weight: 500;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ag-contract-filter-chip:hover:not(.is-active) { background: #f7f7f5; color: #302f2a; }
.ag-contract-filter-chip.is-active, .ag-contract-more-filters.is-active {
    border-color: #a7f3d0; background: #ecfdf5; color: #047857;
}
.ag-contract-filter-panel { border-top: 1px solid #e4e4e1; padding: 18px; background: #fafaf8; border-radius: 0 0 0.625rem 0.625rem; }
.ag-contract-filter-section + .ag-contract-filter-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e6ebf1; }
.ag-contract-filter-section h3 { margin: 0 0 12px; color: #302f2a; font-size: 0.6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ag-contract-filter-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 11px; }
.ag-contract-filter-grid label > span, .ag-contract-date-ranges legend {
    display: block; margin-bottom: 5px; color: #6c6c67; font-size: var(--ag-fs-micro); font-weight: 700;
}
.ag-contract-filter-grid select, .ag-contract-table-toolbar select, .ag-contract-pagination select {
    width: 100%; height: 36px; padding: 0 9px; border: 1px solid #d9d9d5;
    border-radius: 8px; background: #fff; color: #302f2a; font-size: var(--ag-fs-base);
}
.ag-contract-filter-grid.is-muted { opacity: .55; }
.ag-contract-filter-hint { margin: -4px 0 10px; color: #96958f; font-size: var(--ag-fs-micro); }
.ag-contract-date-ranges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.ag-contract-date-ranges fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ag-contract-date-ranges legend { grid-column: 1 / -1; }
.ag-contract-filter-panel-footer { display: flex; justify-content: flex-end; margin-top: 16px; }
.ag-contract-filter-panel-footer button, .ag-contract-clear-tags {
    border: 0; background: transparent; color: #6c6c67; font-size: var(--ag-fs-base); font-weight: 500;
}
.ag-contract-active-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 2px 14px; }
.ag-contract-active-tags > span {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.3rem 0.15rem 0.45rem;
    border: 1px solid #cbe6d9; border-radius: var(--ag-badge-radius); background: #e7f5ee; color: #2f6d52;
    font-size: var(--ag-fs-micro); font-weight: 600;
}
.ag-contract-active-tags span button { border: 0; background: none; color: #059669; }
.ag-contract-table-card { margin-top: 10px; overflow: visible; }
.ag-contract-table-toolbar { min-height: 46px; padding: 8px 12px; border-bottom: 1px solid #e1e1de; overflow: visible; }
.ag-contract-table-toolbar p { margin: 0; color: #6c6c67; font-size: var(--ag-fs-base); flex-shrink: 0; }
.ag-contract-toolbar-end {
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
    flex: 1; min-width: 0;
}
.ag-contract-table-toolbar > .ag-contract-toolbar-end .ag-contract-pagination {
    justify-content: flex-end;
    min-height: 0;
    padding: 0;
    flex: 0 1 auto;
}
.ag-contract-table-toolbar select { width: auto; min-width: 64px; }
.ag-contract-columns-control { position: relative; flex-shrink: 0; }
.ag-contract-columns-menu {
    position: absolute; z-index: 30; top: calc(100% + 7px); right: 0; width: 245px; max-height: 430px;
    overflow: auto; padding: 10px; border: 1px solid #d9d9d5; border-radius: 0.625rem;
    background: #fff; box-shadow: 0 18px 45px rgba(15,23,42,.15);
}
.ag-contract-columns-menu label { display: flex; align-items: center; gap: 8px; padding: 6px; color: #48483f; font-size: var(--ag-fs-base); }
.ag-contract-columns-menu label.is-locked { opacity: .55; }
.ag-contract-columns-menu > button { width: 100%; margin-top: 7px; padding: 8px; border: 0; border-top: 1px solid #e4e4e1; background: #fff; color: #6c6c67; font-size: var(--ag-fs-base); }

/* Colonnes de taux par scope (menu Colonnes) */
.ag-contract-rate-columns { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e4e4e1; }
.ag-contract-rate-columns h4 { margin: 0 0 4px; padding: 0 6px; color: #6c6c67; font-size: var(--ag-fs-micro); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ag-contract-rate-column-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-contract-rate-column-row button { flex-shrink: 0; border: 0; background: none; color: #96958f; font-size: var(--ag-fs-micro); }
.ag-contract-rate-column-row button:hover { color: #b91c1c; }
.ag-contract-rate-column-form { display: grid; gap: 6px; padding: 6px; }
.ag-contract-rate-column-form select {
    width: 100%; height: 32px; padding: 0 8px; border: 1px solid #d9d9d5;
    border-radius: 7px; background: #fff; color: #302f2a; font-size: var(--ag-fs-base);
}
.ag-contract-rate-column-form button {
    height: 32px; border: 1px solid #a7f3d0; border-radius: 7px; background: #ecfdf5; color: #047857;
    font-size: var(--ag-fs-base); font-weight: 600;
}
.ag-contract-rate-column-form button:disabled { opacity: .5; }

/*
 * Cockpit Contrats — une seule carte, comme le suivi des Syncs : la barre (recherche,
 * droits, filtres, colonnes), les filtres actifs, le tableau, le pied.
 * L'en-tête est celui de Syncs et de Live Dates (TableHeader) ; « Contrat » reste collé
 * à gauche et les actions à droite, pour ne jamais perdre le nom ni le geste en défilant.
 */
.ag-ct-card {
    position: relative;
    border: 1px solid #e5e7eb; border-radius: 12px; background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.ag-ct-card .ag-contract-filters { border: 0; border-radius: 12px 12px 0 0; background: transparent; }
.ag-ct-card .ag-contract-filterbar {
    justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb; border-radius: 12px 12px 0 0; background: #fafaf8;
}
/* Coquille AG : une grille à trois pistes (onglets | poignée | contenu).
   Le passage Entités ↔ Contrats anime la première colonne : le bandeau
   reste à droite des onglets et ne passe plus dessous pendant le shrink. */
.ag-shell {
    display: grid;
    grid-template-columns: var(--ag-narrow, 224px) 5px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    background: #f5f5f3;
}
.ag-shell.is-wide {
    grid-template-columns: var(--ag-wide, 608px) 5px minmax(0, 1fr);
    background: #fafafa;
}
.ag-shell.is-animated {
    transition:
        grid-template-columns 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        column-gap 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        background 0.32s ease;
}
.ag-shell > aside { grid-column: 1; grid-row: 1 / -1; min-width: 0; }
.ag-shell > .ag-panel-splitter { grid-column: 2; grid-row: 1 / -1; }
.ag-shell > main { grid-column: 3; grid-row: 1 / -1; min-width: 0; }

.ag-view-nav {
    flex-shrink: 0; padding: 0.7rem; margin: 14px 14px 10px;
    border: 1px solid #e5e7eb; border-radius: 12px; background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.ag-shell.is-animated .ag-view-nav { transition: margin 0.32s cubic-bezier(0.22, 1, 0.36, 1); }

.ag-shell.is-contracts {
    padding: 14px;
    column-gap: 12px;
    grid-template-columns: var(--ag-narrow, 224px) 0px minmax(0, 1fr);
    background: #f5f5f3;
}
.ag-shell.is-contracts > aside { grid-column: 1; grid-row: 1; align-self: stretch; background: transparent; }
.ag-shell.is-contracts > .ag-panel-splitter { pointer-events: none; }
.ag-shell.is-contracts > main,
.ag-shell.is-contracts .ag-contracts-cockpit { display: contents; }
.ag-shell.is-contracts .ag-view-nav { margin: 0; height: 100%; box-sizing: border-box; }
.ag-shell.is-contracts .ag-contracts-head {
    grid-column: 3; grid-row: 1;
    display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
    min-width: 0; margin: 0; padding: 0.7rem 0.85rem;
    border: 1px solid #e5e7eb; border-radius: 12px; background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: ag-view-fade 0.28s ease;
}
.ag-shell.is-contracts .ag-contracts-banner {
    border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.ag-shell.is-contracts .ag-contracts-banner .ag-contract-filterbar,
.ag-shell.is-contracts .ag-contracts-banner:has(.ag-contract-active-tags) .ag-contract-filterbar,
.ag-shell.is-contracts .ag-contracts-banner:has(.ag-fp) .ag-contract-filterbar {
    padding: 0; border: 0; border-radius: 0; background: transparent;
}
.ag-shell.is-contracts .ag-contracts-banner .ag-contract-active-tags {
    margin: 0; padding: 8px 0 0; border-bottom: 0; background: transparent;
}
.ag-shell.is-contracts .ag-contracts-board {
    grid-column: 1 / -1; grid-row: 2;
    margin: 0; min-width: 0; min-height: 0;
    animation: ag-view-fade 0.28s ease;
}
@keyframes ag-view-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.ag-contracts-head .ag-contracts-topbar { margin-bottom: 0; }
.ag-contracts-header-actions .ag-sidebar-quiet-link { height: 32px; padding: 0 0.45rem; }
.ag-ct-card .ag-contract-search { flex: 0 1 280px; min-width: 200px; max-width: none; }
.ag-ct-card .ag-contract-search i { left: 10px; font-size: 11px; }
.ag-ct-card .ag-contract-search input {
    height: 32px; padding: 0 8px 0 30px; border: 1px solid #d6d6d1; border-radius: 8px;
    background: #fff; font-size: 12.5px; transition: border-color 0.14s;
}
.ag-ct-card .ag-contract-search input:focus { outline: none; border-color: #9a9a94; box-shadow: none; }
.ag-ct-card .ag-contract-right-chips { gap: 4px; }
.ag-ct-card .ag-contract-filter-chip,
.ag-ct-card .ag-contract-more-filters {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; min-height: 0; padding: 0 10px;
    border: 1px solid #d6d6d1; border-radius: 8px; background: #fff; color: #57574f;
    font-size: 12.5px; font-weight: 400;
}
.ag-ct-card .ag-contract-filter-chip i { font-size: 11px; color: #9a9a94; }
.ag-ct-card .ag-contract-filter-chip:hover:not(.is-active),
.ag-ct-card .ag-contract-more-filters:hover { background: #f5f5f3; border-color: #d6d6d1; color: #1c1c1a; }
.ag-ct-card .ag-contract-filter-chip.is-active { border-color: #1c1c1a; background: #1c1c1a; color: #fff; }
.ag-ct-card .ag-contract-filter-chip.is-active i { color: #d6d6d1; }
.ag-ct-card .ag-contract-more-filters.is-active { border-color: #b9b9b3; background: #f0f0ed; color: #1c1c1a; }
.ag-contract-filterbar-end { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ag-tool-btn {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 32px; height: 32px; padding: 0; font-size: 12px; color: #57574f;
    background: #fff; border: 1px solid #d6d6d1; border-radius: 8px;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.ag-ct-card .ag-contract-columns-control > .ag-tool-btn { min-height: 0; padding: 0; border: 1px solid #d6d6d1; border-radius: 8px; }
.ag-tool-btn:hover { background: #f5f5f3; color: #1c1c1a; }
.ag-tool-btn.is-open { background: #f0f0ed; border-color: #b9b9b3; color: #1c1c1a; }
.ag-ct-card .ag-contract-filter-panel { border-top: 0; border-bottom: 1px solid #e5e7eb; border-radius: 0; }
/* Filtres actifs : même pastille que Syncs, blanche à croix, noir et gris. */
.ag-ct-card .ag-contract-active-tags {
    margin: 0; padding: 6px 8px; gap: 6px; border-bottom: 1px solid #ecece8; background: #fff;
}
.ag-ct-card .ag-contract-active-tags > span {
    gap: 0.3rem; height: 1.75rem; padding: 0 0.25rem 0 0.6rem; border: 1px solid #d6d6d1; border-radius: 999px;
    background: #fff; color: #1c1c1a; font-size: 12px; font-weight: 500;
}
.ag-ct-card .ag-contract-active-tags > span button {
    display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem;
    border-radius: 999px; font-size: 9px; color: #9a9a94;
}
.ag-ct-card .ag-contract-active-tags > span button:hover { background: #f0f0ed; color: #1c1c1a; }
.ag-ct-card .ag-contract-clear-tags { height: 1.75rem; padding: 0 4px; color: #6b6b64; font-size: 12px; }
.ag-ct-card .ag-contract-clear-tags:hover { color: #1c1c1a; }
.ag-ct-card .ag-contract-columns-menu { z-index: 60; top: calc(100% + 6px); width: 270px; border-radius: 12px; border-color: #e5e7eb; box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); }
.ag-ct-card .ag-contract-columns-menu label { padding: 4px 8px; border-radius: 6px; font-size: 13px; color: #374151; cursor: pointer; }
.ag-ct-card .ag-contract-columns-menu label:hover { background: #f9fafb; }
.ag-ct-card .ag-contract-columns-menu label.is-locked { cursor: default; }
.ag-ct-card .ag-contract-columns-menu > button { font-size: 13px; }
.ag-contract-columns-hint { margin: 0 0 4px; padding: 2px 8px 6px; border-bottom: 1px solid #f3f4f6; color: #9ca3af; font-size: 11px; line-height: 1.35; }
.ag-contract-columns-backdrop { position: fixed; inset: 0; z-index: 59; }

.ag-ct-wrap { min-height: 360px; }
.ag-ct-scroll { max-height: calc(100vh - 17rem); min-height: 20rem; }
.ag-ct { border-collapse: separate; border-spacing: 0; font-size: 12px; line-height: 1.35; }
.ag-ct thead th { height: 2.25rem; font-size: 12px; }
.ag-ct thead th.ag-col-filler { padding: 0; }
.ag-ct .ag-frozen-th { position: sticky; left: 0; z-index: 2; box-shadow: inset -1px 0 0 #e5e7eb; }
.ag-ct .ag-frozen-td { position: sticky; left: 0; z-index: 5; background-color: inherit; box-shadow: inset -1px 0 0 #e5e7eb; }
.ag-ct .ag-frozen-right { left: auto; right: 0; box-shadow: inset 1px 0 0 #e5e7eb; }
/* Les en-têtes qui défilent ne doivent pas se lire à travers l'en-tête figé : fond plein, comme celui de TableHeader (gray-50). */
.ag-ct thead th.ag-frozen-th, .ag-ct thead th.ag-col-filler { background-color: #f9fafb; }
.ag-ct thead th.ag-frozen-th { z-index: 6; }
.ag-ct .ag-col-filler { padding: 0; }
.ag-ct tbody tr { background: #fff; cursor: pointer; transition: background 0.1s; }
.ag-ct tbody tr:hover { background: #f8f8f6; }
.ag-ct-cell {
    overflow: hidden; padding: 0.3rem 0.75rem; border-bottom: 1px solid #f0f0ed;
    color: #3f3f3a; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.ag-ct tbody tr:last-child .ag-ct-cell { border-bottom: 0; }
.ag-ct-title, .ag-ct-text, .ag-ct-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ct-title { color: #1c1c1a; font-size: 13px; font-weight: 500; line-height: 18px; }
.ag-ct-sub { min-height: 14px; color: #9a9a94; font-size: 11px; line-height: 14px; }
.ag-ct-party { color: #1c1c1a; }
.ag-ct-date { font-variant-numeric: tabular-nums; }
.ag-ct-date.is-soon { color: #a16207; font-weight: 500; }
.ag-ct-date.is-past { color: #b4414f; font-weight: 500; }
.ag-ct-date i { margin-right: 4px; font-size: 10px; }
.ag-ct-none { color: #c7c7c1; }
.ag-ct-badges { display: flex; gap: 3px; margin-top: 2px; }
.ag-ct-badge {
    display: inline-flex; align-items: center; height: 1rem; padding: 0 0.35rem; border-radius: 4px;
    background: #f3f3f1; color: #6b6b64; font-size: 10.5px; line-height: 1; text-transform: capitalize;
}
/* Statut : pastille arrondie teintée, la même grammaire que les statuts de Syncs. */
.ag-pill {
    display: inline-flex; align-items: center; gap: 0.35rem; height: 20px; padding: 0 0.55rem;
    border: 1px solid #e5e7eb; border-radius: 999px; background: #fff; color: #57574f;
    font-size: 11px; font-weight: 500; white-space: nowrap;
}
.ag-pill i { width: 6px; height: 6px; border-radius: 50%; background: #a8a79f; flex-shrink: 0; }
.ag-pill.is-green { border-color: #bbe5cd; background: #effaf4; color: #1f6b43; }
.ag-pill.is-green i { background: #22a35f; }
.ag-pill.is-amber { border-color: #f0dca6; background: #fdf7e3; color: #8a5a0b; }
.ag-pill.is-amber i { background: #d9930d; }
.ag-pill.is-rose { border-color: #f0c6cb; background: #fdf1f2; color: #a23a47; }
.ag-pill.is-rose i { background: #d4505f; }
.ag-pill.is-gray { background: #f7f7f5; color: #6b6b64; }
.ag-ct-flag { color: #b0b0aa; }
.ag-ct-flag.is-on { color: #1c1c1a; }
.ag-ct-flag i { margin-right: 4px; font-size: 10px; }
.ag-ct-term { margin-left: 2px; color: #6b6b64; font-variant-numeric: tabular-nums; }
.ag-ct-rates { display: flex; flex-direction: column; gap: 1px; }
.ag-ct-rates > span { display: flex; align-items: baseline; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ct-rates small { color: #9a9a94; font-size: 10.5px; }
.ag-ct-rates strong { color: #1c1c1a; font-weight: 500; font-variant-numeric: tabular-nums; }
/* Actions : discrètes au repos, nettes au survol de la ligne. */
.ag-ct-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0.4; transition: opacity 0.12s; }
.ag-ct tbody tr:hover .ag-ct-actions, .ag-ct-actions:focus-within { opacity: 1; }
.ag-ct-actions button {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: 1px solid transparent; border-radius: 7px; background: transparent; color: #6b6b64; font-size: 12px;
}
.ag-ct-actions button:hover { border-color: #e5e7eb; background: #fff; color: #1c1c1a; }
.ag-ct-actions button.is-danger:hover { border-color: #f0c6cb; background: #fdf1f2; color: #b4414f; }
.ag-ct-actions button:disabled { opacity: 0.4; pointer-events: none; }
/* Pied : le compte et la pagination dans la carte, un seul endroit. */
.ag-ct-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 2.25rem; padding: 0 12px;
    border-top: 1px solid #e5e7eb; border-radius: 0 0 12px 12px; background: #fafaf8; color: #6b6b64; font-size: 12px;
}
.ag-ct-count strong { color: #1c1c1a; font-weight: 600; font-variant-numeric: tabular-nums; }
.ag-ct-foot-end { display: flex; align-items: center; gap: 14px; }
.ag-ct-foot label { display: flex; align-items: center; gap: 8px; }
.ag-ct-foot select {
    width: auto; height: 28px; padding: 0 26px 0 8px; border: 1px solid #d6d6d1; border-radius: 6px;
    background-color: #fff; color: #3f3f3a; font-size: 12px;
}
.ag-ct-page { font-variant-numeric: tabular-nums; }
.ag-ct-pager { display: flex; gap: 4px; }
.ag-ct-pager button {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: 1px solid #d6d6d1; border-radius: 6px; background: #fff; color: #57574f; font-size: 10px;
}
.ag-ct-pager button:hover:not(:disabled) { background: #f5f5f3; color: #1c1c1a; }
.ag-ct-pager button:disabled { opacity: 0.4; }
.ag-contract-table-loading,
.ag-ct-wrap > .ag-contract-empty,
.ag-airtable-audit .ag-contract-empty { min-height: 360px; }
.ag-ct-wrap > .ag-contract-empty,
.ag-airtable-audit .ag-contract-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; color: #96958f;
}
.ag-contract-empty-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 999px; background: #eeeeeb; color: #96958f; font-size: 23px; }
.ag-contract-empty h3 { margin: 13px 0 3px; color: #48483f; font-size: var(--ag-fs-strong); }
.ag-contract-empty p { margin: 0; font-size: var(--ag-fs-base); }
.ag-contract-table-loading { padding: 12px; }
.ag-contract-skeleton-row { display: grid; grid-template-columns: 2fr repeat(6, 1fr); gap: 12px; height: 43px; align-items: center; }
.ag-contract-skeleton-row span { height: 11px; border-radius: 5px; background: linear-gradient(90deg,#eef2f6,#f7f7f5,#eef2f6); background-size: 200% 100%; animation: ag-contract-shimmer 1.4s infinite; }
@keyframes ag-contract-shimmer { to { background-position: -200% 0; } }
.ag-contract-pagination { min-height: 46px; padding: 8px 12px; color: #6c6c67; font-size: var(--ag-fs-base); }
.ag-contract-pagination label { display: flex; align-items: center; gap: 8px; }
.ag-contract-pagination select { width: 70px; }
.ag-contract-pagination > div { display: flex; gap: 5px; }
.ag-contract-pagination button { width: 33px; height: 33px; border: 1px solid #e1e1de; border-radius: 0.4375rem; background: #fff; color: #48483f; transition: background 0.12s, border-color 0.12s; }
.ag-contract-pagination button:hover:not(:disabled) { background: #f7f7f5; border-color: #c9c9c4; }
.ag-contract-pagination button:disabled { opacity: .35; }
@media (max-width: 1150px) {
    .ag-contract-filter-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
    .ag-contract-filterbar { align-items: stretch; flex-wrap: wrap; }
}

/* Agreements — contrôle Airtable temporaire */
.ag-airtable-audit {
    flex: 1;
    min-width: 0;
    overflow: auto;
    padding: 16px 20px 20px;
    color: #172033;
    background: #f7f7f5;
}
.ag-airtable-audit-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid #fde68a;
    border-radius: 0.625rem;
    background: #fffbeb;
}
.ag-airtable-audit-intro p { margin: 0; color: #78716c; font-size: var(--ag-fs-base); line-height: 1.45; max-width: 760px; }
.ag-airtable-audit-kicker {
    margin-bottom: 4px !important;
    color: #b45309 !important;
    font-size: var(--ag-fs-micro) !important;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.ag-airtable-audit-meta { margin-top: 6px !important; color: #a8a29e !important; font-size: var(--ag-fs-micro) !important; }
.ag-airtable-audit-run {
    display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
    min-height: 40px; padding: 8px 14px; border: 1px solid #f3d7a3;
    border-radius: 0.4375rem; background: #fff; color: #b45309; font-size: var(--ag-fs-base); font-weight: 600;
    transition: background 0.12s, border-color 0.12s;
}
.ag-airtable-audit-run:hover:not(:disabled) { background: #fffbeb; border-color: #f59e0b; }
.ag-airtable-audit-run:disabled { opacity: .45; }
.ag-airtable-audit-list { display: flex; flex-direction: column; }
.ag-airtable-audit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #e4e4e1;
}
.ag-airtable-audit-row:hover { background: #f8fbfa; }
.ag-airtable-audit-row-main {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 150px auto;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.ag-airtable-audit-badge {
    display: inline-flex; justify-content: center; padding: 4px 8px;
    border-radius: 999px; background: #eeeeeb; color: #6c6c67;
    font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.ag-airtable-audit-badge.is-diff { background: #fff7ed; color: #c2410c; }
.ag-airtable-audit-badge.is-airtable_only { background: #eff6ff; color: #1d4ed8; }
.ag-airtable-audit-badge.is-db_only { background: #f5f3ff; color: #6d28d9; }
.ag-airtable-audit-badge.is-ok { background: #ecfdf5; color: #047857; }
.ag-airtable-audit-names { min-width: 0; }
.ag-airtable-audit-names strong, .ag-airtable-audit-names small {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ag-airtable-audit-names strong { color: #1e293b; font-size: 0.75rem; }
.ag-airtable-audit-names small { margin-top: 2px; color: #96958f; font-size: 0.75rem; }
.ag-airtable-audit-hint { color: #b45309 !important; }
.ag-airtable-audit-source, .ag-airtable-audit-count { color: #6c6c67; font-size: 0.6875rem; font-weight: 500; }
.ag-airtable-audit-row-actions { display: flex; gap: 3px; }
.ag-airtable-audit-row-actions button {
    width: 29px; height: 29px; border: 1px solid transparent; border-radius: 7px;
    background: transparent; color: #96958f;
}
.ag-airtable-audit-row-actions button:hover { border-color: #dbe5ec; background: #fff; color: #059669; }
.ag-airtable-audit-diffs { grid-column: 1 / -1; padding: 4px 0 6px 128px; }
.ag-airtable-audit-diffs table { width: 100%; border-collapse: collapse; }
.ag-airtable-audit-diffs th, .ag-airtable-audit-diffs td {
    padding: 6px 8px; border-bottom: 1px solid #e4e4e1; font-size: 0.6875rem; text-align: left;
}
.ag-airtable-audit-diffs th { color: #96958f; font-size: 0.6875rem; text-transform: uppercase; letter-spacing: .05em; }
.ag-airtable-audit-diffs td:nth-child(2) { color: #1d4ed8; }
.ag-airtable-audit-diffs td:nth-child(3) { color: #047857; }
.co-email-health {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    position: relative;
    /* Le padding vertical de la cellule restait en dehors de ce bloc, et c'était
       le seul endroit où le double-clic atteignait la ligne. Le bloc couvre
       maintenant toute la hauteur cliquable. */
    margin-top: -0.375rem;
    margin-bottom: -0.375rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    min-height: 1.75rem;
}
.co-email-health-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.2;
    padding: 2px 6px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
}
.co-email-health-badge.is-invalid { background: #fef3c7; color: #92400e; }
.co-email-health-badge.is-bounced { background: #fee2e2; color: #991b1b; }
.co-email-health-badge.is-dead { background: #7f1d1d; color: #fff; }
.co-email-health-badge.is-ok { background: #d1fae5; color: #065f46; }
/* Drapeau de santé e-mail, dans la colonne Actions. Il apparaît au survol de la
   ligne, comme les deux autres actions, et garde sa place au repos pour que les
   icônes ne se déplacent pas sous le curseur. */
.co-email-health-mark {
    flex-shrink: 0;
    opacity: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.12s ease, color 0.12s ease, background-color 0.12s ease;
}
.co-email-health-mark.is-empty {
    display: inline-block;
    width: 1.625rem;
    height: 1.625rem;
    pointer-events: none;
}
.co-email-health-mark:hover {
    color: #b45309;
    background-color: #fef3c7;
}
.co-carnet-row:hover .co-email-health-mark,
.co-email-health-mark:focus {
    opacity: 1;
}
.co-email-health-menu {
    position: fixed;
    z-index: 9999;
    min-width: 11rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    padding: 4px 0;
}
.co-email-health-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 12px;
    font-size: 12px;
    color: #334155;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.co-email-health-menu button:hover:not(:disabled) { background: #f8fafc; }
.co-email-health-menu button:disabled { opacity: 0.45; }
@media (max-width: 900px) {
    .ag-airtable-audit-row-main { grid-template-columns: 110px minmax(0, 1fr); }
    .ag-airtable-audit-source, .ag-airtable-audit-count { display: none; }
    .ag-airtable-audit-diffs { padding-left: 0; }
}

/* ═══════════ Contacts — filtres en vigueur, corbeille et journal ═══════════ */

/* Bandeau des filtres actifs : les filtres sont mémorisés d'une session à l'autre,
   sans ce rappel on croit voir tout le carnet alors qu'on en voit un extrait. */
.co-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    padding: 0.4375rem 1rem;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
    border-radius: 10px 10px 0 0;   /* épouse les coins de l'encart du tableau */
    font-size: 0.8125rem;
}
.co-active-filters-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #92400e;
    font-weight: 600;
}
.co-active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.0625rem 0.5rem;
    background: #ffffff;
    border: 1px solid #fcd34d;
    border-radius: 9999px;
    color: #78350f;
    line-height: 1.3;
}
.co-active-filter-chip:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}
.co-active-filter-chip span {
    font-size: 0.875rem;
    opacity: 0.65;
}
.co-active-filter-chip:hover span {
    opacity: 1;
    color: #b91c1c;
}
.co-active-filters-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    padding: 0.125rem 0.625rem;
    color: #92400e;
    font-weight: 600;
    border-radius: 0.375rem;
}
.co-active-filters-reset:hover {
    background: #fef3c7;
}

.co-history-tabs {
    margin-bottom: 1rem;
}
.co-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 3rem 1rem;
    color: #64748b;
    text-align: center;
}
.co-history-empty i {
    font-size: 1.5rem;
    color: #94a3b8;
}
.co-history-empty p {
    margin: 0;
    font-size: 0.875rem;
}
.co-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e2e8f0;
}
.co-history-row {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0.25rem;
    border-bottom: 1px solid #f1f5f9;
}
.co-history-row:hover {
    background: #f8fafc;
}
.co-history-action {
    justify-self: start;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
.co-history-action.is-delete { background: #fee2e2; color: #991b1b; }
.co-history-action.is-merge  { background: #ffedd5; color: #9a3412; }
.co-history-action.is-create { background: #dcfce7; color: #166534; }
.co-history-action.is-restore { background: #e0e7ff; color: #3730a3; }
.co-history-main {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}
.co-history-label {
    font-weight: 500;
    color: #0f172a;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.co-history-changes {
    font-size: 0.75rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.co-history-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}
.co-history-actions {
    display: flex;
    gap: 0.375rem;
}
@media (max-width: 900px) {
    .co-history-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: 'action actions' 'main main' 'meta meta';
    }
    .co-history-action { grid-area: action; }
    .co-history-main { grid-area: main; }
    .co-history-meta { grid-area: meta; }
    .co-history-actions { grid-area: actions; }
}

/* ═══════════ Contacts — sélection multiple et pagination ═══════════ */

/* La barre remplace la barre d'outils dès qu'une fiche est cochée : l'action doit
   visiblement porter sur la sélection, jamais sur le carnet entier. */
.co-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0 0.75rem;
    padding: 0.625rem 0.875rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
}
.co-bulk-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #3730a3;
}
.co-bulk-all {
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    color: #4338ca;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.co-bulk-all:hover { background: #e0e7ff; }
.co-bulk-all-on {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background: #4338ca;
    color: #ffffff;
    font-weight: 600;
}
.co-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-left: auto;
}
.co-bulk-clear {
    padding: 0.125rem 0.5rem;
    color: #4b5563;
    border-radius: 0.375rem;
}
.co-bulk-clear:hover { background: #e0e7ff; color: #1f2937; }
.co-bulk-tag-picker {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #c7d2fe;
}
.co-bulk-tag-picker input { max-width: 20rem; }
.co-bulk-org-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.co-bulk-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-height: 9rem;
    overflow-y: auto;
}
.co-bulk-tag-list button {
    padding: 0.1875rem 0.5rem;
    background: #ffffff;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    color: #3730a3;
    font-size: 0.75rem;
}
.co-bulk-tag-list button:hover { background: #c7d2fe; }
.co-bulk-tag-list .co-bulk-tag-create {
    border-style: dashed;
    color: #4338ca;
    font-weight: 600;
}

.co-per-page {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #64748b;
}
.co-per-page select {
    height: 1.75rem;
    padding: 0 1.5rem 0 0.5rem;
    font-size: 0.75rem;
}
.co-page-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.co-page-jump input {
    width: 3.5rem;
    height: 1.75rem;
    padding: 0 0.375rem;
    text-align: right;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}
.co-page-jump input:focus {
    outline: none;
    border-color: #818cf8;
}

/* Préréglages de colonnes : trois usages réels plutôt qu'une liste de 22 cases. */
.co-preset-group {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}
.co-preset-btn {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}
.co-preset-btn:hover { color: #0f172a; }
.co-preset-btn.is-active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* Dédoublonnage : barre de progression et filtre par score. */
.co-dedupe-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.co-dedupe-progress {
    font-size: 0.8125rem;
    color: #475569;
}
.co-dedupe-progress strong { color: #166534; }
.co-dedupe-score-filter {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}
.co-dedupe-count {
    margin-left: 0.375rem;
    padding: 0 0.3125rem;
    border-radius: 9999px;
    background: #e2e8f0;
    font-size: 0.6875rem;
    font-variant-numeric: tabular-nums;
}
.co-dedupe-provenance {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.co-dedupe-provenance-box {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 16rem;
    max-width: 36rem;
    flex: 1 1 16rem;
    padding: 0.25rem 0.375rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}
.co-dedupe-provenance-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 40;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}
.co-dedupe-provenance-hint {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.75rem;
    color: #94a3b8;
}
.co-preset-btn.is-active .co-dedupe-count { background: #e0e7ff; color: #3730a3; }

/* ═══════════ Contacts — sociétés et rapprochement des noms proches ═══════════ */

.co-tags-suggest-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}
.co-tags-suggest-note {
    flex: 1 1 20rem;
    margin: 0;
    font-size: 0.8125rem;
    color: #64748b;
}
.co-tags-suggest-panel {
    margin-bottom: 1rem;
    padding: 0.875rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
}
.co-tags-suggest-count {
    margin: 0 0 0.625rem;
    font-size: 0.75rem;
    color: #475569;
}
.co-tags-suggest-empty {
    margin: 0;
    padding: 1rem 0;
    text-align: center;
    font-size: 0.8125rem;
    color: #64748b;
}
.co-tags-suggest-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 26rem;
    overflow-y: auto;
}
.co-tags-suggest-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4375rem 0;
    border-bottom: 1px solid #eef2f7;
}
.co-tags-suggest-row:last-child { border-bottom: 0; }
.co-tags-suggest-score {
    flex: 0 0 2.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border-radius: 9999px;
    padding: 0.125rem 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.co-tags-suggest-pair {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    font-size: 0.8125rem;
    color: #475569;
    flex-wrap: wrap;
}
.co-tags-suggest-pair i { color: #94a3b8; font-size: 0.6875rem; }
/* La fiche la plus utilisée absorbe l'autre : on la marque, pour qu'on sache dans
   quel sens la fusion va se faire avant de cliquer. */
.co-tags-suggest-pair .is-winner { font-weight: 600; color: #0f172a; }
.co-tags-suggest-pair em {
    font-style: normal;
    margin-left: 0.25rem;
    padding: 0 0.3125rem;
    border-radius: 9999px;
    background: #e2e8f0;
    font-size: 0.6875rem;
    color: #475569;
}
.co-tags-row-name.is-organization {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* ═══════════ Contacts — encart des filtres ═══════════
   Neuf contrôles se suivaient sans étiquette : « Tous pays » ou « VIP / tous »
   étaient le seul indice de ce que faisait chaque menu. La recherche prend la ligne
   du haut, les huit autres passent dans une grille étiquetée et repliable — ce qui
   rend aussi de la hauteur au tableau, dont l'en-tête est désormais figé. */

.co-filters {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.625rem;
    overflow: visible;
}
.co-filters-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.co-filters-search {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}
.co-filters-search > i {
    position: absolute;
    left: 0.875rem;
    color: #94a3b8;
    font-size: 0.8125rem;
    pointer-events: none;
}
.co-filters-search input {
    width: 100%;
    height: 2.25rem;
    padding: 0 2.25rem 0 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #ffffff;
    font-size: 0.875rem;
    color: #0f172a;
}
.co-filters-search input::placeholder { color: #94a3b8; }
.co-filters-search input:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}
.co-filters-search input::-webkit-search-cancel-button { display: none; }
.co-filters-search-clear {
    position: absolute;
    right: 0.625rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
}
.co-filters-search-clear:hover { background: #f1f5f9; color: #b91c1c; }

.co-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #ffffff;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
}
.co-filters-toggle:hover { background: #f8fafc; color: #0f172a; }
.co-filters-toggle.is-open { background: #f1f5f9; color: #0f172a; }
.co-filters-badge {
    min-width: 1.125rem;
    padding: 0 0.3125rem;
    border-radius: 9999px;
    background: #4338ca;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.125rem;
    text-align: center;
}
.co-filters-chevron {
    font-size: 0.625rem;
    color: #94a3b8;
    transition: transform 0.15s ease;
}
.co-filters-toggle.is-open .co-filters-chevron { transform: rotate(180deg); }

/* Cinq colonnes sur grand écran : les neuf filtres tiennent en deux lignes.
   `minmax(0, 1fr)` — et non `auto` — empêche un menu long comme la liste des pays
   d'élargir sa colonne et de faire déborder la grille. */
.co-filters-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem 0.875rem;
    padding-top: 0.625rem;
    border-top: 1px solid #eef2f7;
}
@media (max-width: 1500px) {
    .co-filters-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .co-filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .co-filters-grid { grid-template-columns: minmax(0, 1fr); }
}
.co-filter-field {
    position: relative;   /* ancre les menus déroulants des sélecteurs à puces */
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    min-width: 0;
}
/* Libellé et, le cas échéant, un interrupteur qui le précise : sur une seule ligne. */
.co-filter-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    height: 1rem;   /* la même que les libellés voisins : l'interrupteur déborde sans pousser le menu */
}
/* Les trois sélecteurs à puces prennent la hauteur des menus voisins. */
.co-filters-grid .co-filter-tags {
    min-height: 2.25rem;
    padding: 0.1875rem 0.375rem;
}
.co-filters-grid .co-filter-tags > button {
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1;
}
.co-filter-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    color: #94a3b8;
}
.co-filter-select {
    width: 100%;
    height: 2.25rem;
    padding: 0 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background-color: #ffffff;
    font-size: 0.8125rem;
    color: #0f172a;
}
.co-filter-select:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}
/* « Avec e-mail » précise le filtre de santé, il vit donc dans le même champ, sous
   son sélecteur. Une case à cocher nue au milieu de menus déroulants jurait : un
   état oui/non se lit mieux en interrupteur. */
.co-filter-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    cursor: pointer;
}
.co-filter-switch:hover { color: #0f172a; }
.co-filter-switch-track {
    position: relative;
    flex-shrink: 0;
    width: 1.875rem;
    height: 1.0625rem;
    border-radius: 9999px;
    background: #e2e8f0;
    transition: background-color 0.16s ease;
}
.co-filter-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 0.8125rem;
    height: 0.8125rem;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    transition: transform 0.16s ease;
}
.co-filter-switch.is-on { color: #3730a3; font-weight: 500; }
.co-filter-switch.is-on .co-filter-switch-track { background: #4f46e5; }
.co-filter-switch.is-on .co-filter-switch-knob { transform: translateX(0.8125rem); }
.co-filter-switch:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; border-radius: 0.375rem; }
@media (prefers-reduced-motion: reduce) {
    .co-filter-switch-track,
    .co-filter-switch-knob { transition: none; }
}
/* Le champ entité est une saisie libre : même gabarit que les sélecteurs. */
.co-filter-field > input[type="search"] {
    width: 100%;
    height: 2.25rem;
    padding: 0 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
}
.co-filter-field > input[type="search"]:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.18);
}
@media (max-width: 640px) {
    .co-filters-head { flex-wrap: wrap; }
    .co-filters-toggle { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════
   Shipment — admin (sh-admin-*)
   Sur la coquille partagée admin-tool-* : ici seulement ce que la coquille
   n'a pas — la grille de l'étape Contenu avec sa colonne collante, la zone de
   dépôt des pièces jointes, les numéros d'étape, les lignes de la liste.
══════════════════════════════════════ */
.admin-tool-root table.admin-tool-table tbody tr.sh-admin-row {
    cursor: pointer;
}
.admin-tool-root table.admin-tool-table tbody tr.sh-admin-row:hover td {
    background: #f7f7f5;
}
.sh-admin-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: #e8e8e5;
    color: #666;
}
.admin-tool-tab.is-active .sh-admin-step-num {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}
.sh-admin-step-done {
    font-size: 0.6rem !important;
    color: #10b981 !important;
    opacity: 1 !important;
}
.sh-admin-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 0.75rem;
    align-items: start;
}
.sh-admin-message-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 0.75rem;
    align-items: start;
}
@media (max-width: 1023px) {
    .sh-admin-content-layout,
    .sh-admin-message-layout {
        grid-template-columns: 1fr;
    }
}
/* L'en-tête global reste collé : la colonne s'arrête juste dessous. */
.sh-admin-attached {
    position: sticky;
    top: calc(var(--app-header-h) + 0.75rem);
    overflow: hidden;
}
.sh-admin-attached-list {
    max-height: calc(100vh - 14rem);
    overflow-y: auto;
}
.sh-admin-attached-list > li {
    border-bottom: 1px solid #f5f5f3;
}
.sh-admin-attached-list > li:last-child {
    border-bottom: 0;
}
/* Titres longs (synchros importées) : défiler plutôt que rogner Date / Détenteurs. */
.sh-admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sh-admin-table-wrap table.admin-tool-table {
    min-width: 760px;
}
/* Rechargement : le tableau reste en place, voilé, plutôt que remplacé par un chargeur. */
.sh-admin-table-wrap.is-refreshing {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.14s ease;
}
/* Filtres du tableau : une pastille avec bascule, noire quand elle est active. */
.sh-admin-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 26px;
    padding: 0 0.6rem 0 0.45rem;
    font-size: 12px;
    font-weight: 500;
    color: #6b6b66;
    background: #fff;
    border: 1px solid #e4e4e0;
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.sh-admin-filter-toggle:hover { color: #111; background: #f7f7f5; }
.sh-admin-filter-toggle.is-on { color: #111; border-color: #111; }
.sh-admin-filter-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.sh-admin-filter-switch {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 12px;
    border-radius: 999px;
    background: #d6d6d1;
    transition: background 0.18s ease;
}
.sh-admin-filter-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.18s cubic-bezier(.2, .8, .2, 1);
}
.sh-admin-filter-toggle.is-on .sh-admin-filter-switch { background: #111; }
.sh-admin-filter-toggle.is-on .sh-admin-filter-switch::after { transform: translateX(10px); }
/* Sélection en cours : une barre sombre qui colle au bas de l'écran. */
.sh-admin-selection-bar {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.4rem 0.4rem 1rem;
    font-size: 13px;
    color: #fff;
    background: #111;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.sh-admin-selection-bar .admin-tool-count-pill { background: #fff; color: #111; }
.sh-admin-selection-clear {
    font-size: 12px;
    color: #b0b0aa;
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.14s ease;
}
.sh-admin-selection-clear:hover { color: #fff; }
.sh-admin-selection-attach {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 30px;
    padding: 0 0.9rem;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    background: #fff;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.14s ease;
}
.sh-admin-selection-attach:hover { background: #ebebe8; }
.sh-admin-selection-bar button:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.sh-admin-table-wrap .sh-col-date {
    width: 6.75rem;
    min-width: 6.75rem;
}
.sh-admin-table-wrap .sh-col-title {
    min-width: 16rem;
}
.sh-admin-table-wrap .sh-col-holders {
    min-width: 11rem;
}
.sh-admin-table-wrap .sh-col-sub {
    min-width: 10rem;
}
/* Ingestion de programmes : repliée par défaut, sous le tableau AVP. */
.sh-ingest {
    border: 1px dashed #e4e4e0;
    border-radius: 8px;
    background: transparent;
}
.sh-ingest.is-open {
    border-style: solid;
    border-color: #ecece8;
    background: #fcfcfb;
}
.sh-ingest-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.4rem 0.65rem;
    border: 0;
    background: transparent;
    color: #9a9a94;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.sh-ingest-toggle:hover {
    color: #555;
}
.sh-ingest-pill {
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
}
.sh-ingest-body {
    border-top: 1px solid #f0f0ed;
}
.sh-admin-dropzone {
    padding: 1.4rem 1rem;
    text-align: center;
    border: 2px dashed #dcdcd8;
    border-radius: 10px;
    background: #fafaf8;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sh-admin-dropzone:hover {
    border-color: #bbb;
}
.sh-admin-dropzone.is-dragover {
    border-color: #111;
    background: #f2f2f0;
}
.sh-admin-dropzone.is-compact {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    text-align: left;
}

/* ── Étape Message : la composition ────────────────────────────────────
   Une carte, l'ordre de lecture ; les champs n'ont pas de bordure au repos,
   le texte se lit comme dans le mail, la bordure vient au survol et au focus. */
.sh-admin-composer {
    padding: 1.1rem 1.25rem 1.25rem;
}
.sh-admin-plain-textarea,
.sh-focus-title,
.sh-focus-body {
    display: block;
    width: 100%;
    padding: 0.4rem 0.55rem;
    margin-left: -0.55rem;
    width: calc(100% + 1.1rem);
    font: inherit;
    color: #111;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    resize: none;
    overflow: hidden;
    transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.sh-admin-plain-textarea {
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: 120px;
}
.sh-admin-plain-textarea:hover,
.sh-focus-title:hover,
.sh-focus-body:hover {
    border-color: #e8e8e5;
}
.sh-admin-plain-textarea:focus,
.sh-focus-title:focus,
.sh-focus-body:focus {
    outline: none;
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.sh-admin-plain-textarea::placeholder,
.sh-focus-title::placeholder,
.sh-focus-body::placeholder {
    color: #b0b0aa;
}

/* ── Un point d'attention : carte numérotée, zone de dépôt à elle seule */
.sh-focus-block {
    position: relative;
    padding: 0.85rem 1rem 0.9rem;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.14s, box-shadow 0.14s;
}
.sh-focus-block:hover {
    border-color: #dcdcd8;
}
.sh-focus-block.is-dragover {
    border: 2px dashed #111;
    background: #fafaf8;
}
.sh-focus-block.is-dragover > * {
    visibility: hidden;
}
.sh-focus-drop-hint {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111;
    pointer-events: none;
}
.sh-focus-block.is-dragover .sh-focus-drop-hint {
    display: flex;
    visibility: visible;
}
.sh-focus-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.sh-focus-title {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
    width: auto;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.sh-focus-body {
    margin-top: 0.15rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #333;
}
.sh-focus-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
    opacity: 0;
    transition: opacity 0.14s;
}
.sh-focus-block:hover .sh-focus-actions,
.sh-focus-block:focus-within .sh-focus-actions {
    opacity: 1;
}
.sh-focus-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.25rem 0.35rem 0.25rem 0.6rem;
    border: 1px solid #e8e8e5;
    border-radius: 999px;
    background: #fafaf8;
    font-size: 0.75rem;
    color: #333;
}
.sh-focus-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #b0b0aa;
    font-size: 0.6rem;
    cursor: pointer;
    transition: background 0.14s, color 0.14s;
}
.sh-focus-chip-x:hover {
    background: #fee2e2;
    color: #b91c1c;
}
.sh-focus-add {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border: 1px dashed #dcdcd8;
    border-radius: 999px;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.sh-focus-add i {
    font-size: 0.6rem;
    color: #b0b0aa;
}
.sh-focus-add:hover:not(:disabled) {
    border-color: #111;
    color: #111;
    background: #fafaf8;
}
.sh-focus-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Ce que le lecteur verra : la structure du mail */
.sh-admin-outline {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sh-admin-outline > li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    border-top: 1px solid #f5f5f3;
}
.sh-admin-outline > li:first-child {
    border-top: 0;
}
.sh-admin-outline > li.is-empty > span > span:first-child {
    color: #888;
}
.sh-admin-outline-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: #f2f2f0;
    color: #666;
    font-size: 0.65rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.sh-admin-outline > li.is-empty .sh-admin-outline-num {
    background: #fafaf8;
    color: #b0b0aa;
}
.sh-admin-outline-move {
    display: inline-flex;
    gap: 0.1rem;
    opacity: 0;
    transition: opacity 0.14s;
}
.sh-admin-outline > li:hover .sh-admin-outline-move,
.sh-admin-outline > li:focus-within .sh-admin-outline-move {
    opacity: 1;
}
.sh-admin-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: background 0.14s, color 0.14s, border-color 0.14s, opacity 0.14s;
}
.sh-admin-icon-btn:hover {
    background: #f2f2f0;
    border-color: #e8e8e5;
    color: #111;
}
.sh-admin-title-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
}
.sh-admin-title-input:hover {
    border-color: #e8e8e5;
}
.sh-admin-title-input:focus {
    outline: none;
    background: #fff;
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}
.admin-tool-root table.admin-tool-table tbody tr.sh-admin-row-selected td {
    background: #f2f2f0;
}
.admin-tool-root table.admin-tool-table tbody tr.sh-admin-row-attached td {
    background: #fcfcfb;
}
.admin-tool-root table.admin-tool-table tbody tr.sh-admin-row-attached:hover td {
    background: #fcfcfb;
}

/* ── Dossiers copyright (SH_Folders) : aperçu, tableau, arborescence ──
   Pas d'overflow: hidden sur les panneaux : le sélecteur d'entité en déborde. */
.sh-folders-panel {
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    background: #fff;
}
.sh-folders-drop-compact {
    margin-top: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-width: 1px;
}
.admin-tool-root table.admin-tool-table.sh-folders-table tbody td {
    padding: 0.45rem 0.75rem;
}
.admin-tool-root table.admin-tool-table.sh-folders-table tbody tr:last-child td {
    border-bottom: 0;
}
.sh-folders.is-compact table.admin-tool-table.sh-folders-table tbody td {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}
.admin-tool-root table.admin-tool-table tbody tr.sh-folders-row-off td {
    opacity: 0.45;
}
.admin-tool-root table.admin-tool-table tbody tr.sh-folders-tree-row td,
.admin-tool-root table.admin-tool-table tbody tr.sh-folders-tree-row:hover td {
    padding-top: 0;
    padding-bottom: 0.4rem;
    background: #fcfcfb;
}
.sh-folders-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}
.sh-folders-entity {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 16rem;
    padding: 0.15rem 0.55rem;
    border: 1px solid #e8e8e5;
    border-radius: 999px;
    background: #fafaf8;
    font-size: 0.75rem;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
}
.sh-folders-entity:hover:not(:disabled) {
    border-color: #111;
    background: #fff;
}
.sh-folders-suggestion {
    display: inline-flex;
    align-items: center;
    max-width: 14rem;
    padding: 0.1rem 0.5rem;
    border: 1px dashed #dcdcd8;
    border-radius: 999px;
    background: transparent;
    font-size: 0.72rem;
    color: #444;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color 0.14s, color 0.14s;
}
.sh-folders-suggestion:hover:not(:disabled) {
    border-color: #111;
    color: #111;
}
.sh-folders-seg {
    display: inline-flex;
    padding: 2px;
    border-radius: 7px;
    background: #f2f2f0;
}
.sh-folders-seg > button {
    padding: 0.15rem 0.55rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #777;
    transition: background 0.14s, color 0.14s;
}
.sh-folders-seg > button:hover:not(:disabled) {
    color: #111;
}
.sh-folders-seg > button.is-active {
    background: #fff;
    color: #111;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.sh-folders-picker {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    width: 19rem;
    padding: 0.4rem;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
}
.sh-folders-picker-list {
    max-height: 15rem;
    margin-top: 0.3rem;
    overflow-y: auto;
}
.sh-folders-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    text-align: left;
    color: #333;
}
.sh-folders-picker-item.is-active {
    background: #f2f2f0;
    color: #111;
}
.sh-folders-progress {
    height: 6px;
    border-radius: 999px;
    background: #f2f2f0;
    overflow: hidden;
}
.sh-folders-progress > span {
    display: block;
    height: 100%;
    background: #111;
    transition: width 0.2s ease;
}
.sh-folders-tree {
    list-style: none;
    margin: 0;
    padding: 0.2rem 0 0 1.1rem;
}
.sh-folders-tree button {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    font-size: 0.75rem;
    color: #333;
    text-align: left;
}
.sh-folders-tree button:hover {
    background: #f2f2f0;
    color: #111;
}

/*
 * Task Manager — tableau des tâches bâti sur l'en-tête partagé (TableHeader). L'en-tête
 * garde la voix du tableau : capitales de 10 px, gris, 36 px de haut. Gouttière gauche
 * de 1 rem, comme Budgets et Syncs : trait, poignée et libellé ne se touchent pas au survol,
 * la poignée s'y centre. Les cellules suivent, pour que libellés et valeurs s'alignent.
 */
.tm-table thead th[data-column-key] {
    height: 2.25rem;
    padding-left: 1rem;
    padding-right: 0.625rem;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
}
/* « Titre » à l'aplomb des titres de tâches : 9 px, chevron 20 px, écart 8 px, icône 16 px, écart 8 px. */
.tm-table thead th.tm-th-title {
    padding-left: 61px;
}
/* Cellules modifiables sur place : un liseré au survol et pendant l'édition dit « cliquable ». */
.tm-table .tm-cell-editable,
.tm-props .tm-cell-editable {
    cursor: pointer;
    border-radius: 9999px;
    transition: box-shadow 0.12s ease, background-color 0.12s ease;
}
.tm-table .tm-cell-editable:hover,
.tm-table .tm-cell-editable.is-editing,
.tm-props .tm-cell-editable:hover,
.tm-props .tm-cell-editable.is-editing {
    box-shadow: 0 0 0 1px #d1d5db, 0 1px 2px rgba(0, 0, 0, 0.06);
}
/* Texte simple (Entité) : fond gris au survol plutôt qu'un liseré de pastille. */
.tm-table .tm-cell-editable--text,
.tm-props .tm-cell-editable--text {
    margin-left: -4px;
    padding: 1px 4px;
    border-radius: 6px;
}
.tm-table .tm-cell-editable--text:hover,
.tm-table .tm-cell-editable--text.is-editing,
.tm-props .tm-cell-editable--text:hover,
.tm-props .tm-cell-editable--text.is-editing {
    box-shadow: none;
    background-color: #f3f4f6;
}
/* Liste à plat (onglets de catégorie) : pas de chevron, le titre suit l'icône — 10 px, icône 16 px, écart 8 px. */
.tm-table thead th.tm-th-title.tm-th-title--flat {
    padding-left: 34px;
}
.tm-table .column-drag-row th .table-header-grip {
    left: 4px;
    font-size: 8px;
}
/* Le titre, toujours en tête, garde son retrait propre (chevron, icône) : seules les
   colonnes suivantes prennent la gouttière, hors remplissage et actions. */
.tm-table tbody td:not(:first-child):not(.tm-col-filler):not(:last-child) {
    padding-left: 1rem;
}
/* Colonne de remplissage : prend la place laissée par les autres, qui gardent ainsi leur largeur. */
.tm-table .tm-col-filler {
    padding: 0 !important;
}
.tm-table tbody td {
    overflow: hidden;
}
/* Grille (« Mise en ligne », une colonne par case) : le tableau défile en largeur ; le titre
   reste à gauche pour qu'on sache toujours de quelle BO on lit la ligne. Fond opaque, sinon
   les pastilles passent dessous. */
.tm-table--grid thead th.tm-th-title,
.tm-table--grid tbody td.tm-td-title {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: inset -1px 0 0 #e8e8e5;
}
.tm-table--grid thead th.tm-th-title {
    background: #f9fafb;
    z-index: 3;
}
.tm-table--grid tbody td.tm-td-title {
    background: #fff;
}
.tm-table--grid tbody tr:hover > td.tm-td-title {
    background: #fafbff;
}
.tm-table tbody tr.tm-row-subtask > td {
    border-top: none;
}
/* Coches dépliées : bloc inline sous la ligne tâche (pas de sticky global). */
.tm-row-subtask-wrap > td {
    background: rgb(248 250 252 / 0.95);
}
/* Sans ça, le td (overflow hidden) devient le repère du sticky et le panneau ne colle plus. */
.tm-table tbody tr.tm-row-subtask-wrap > td {
    overflow: visible;
}
/* Collé à gauche du conteneur défilant et large de sa partie visible (style inline) :
   le dépliant suit la page au scroll horizontal, sans scroll propre. */
.tm-subtask-inline-panel {
    position: sticky;
    left: 0;
    width: 100%;
    isolation: isolate;
}
.tm-subtask-inline-panel .tm-subtask-table {
    table-layout: fixed;
    width: 100%;
}
.tm-subtask-table tbody tr.tm-row-subtask {
    cursor: default;
}
.tm-subtask-table .tm-subtask-step-pill {
    cursor: pointer;
    border-radius: 9999px;
    transition: box-shadow 0.12s ease;
}
.tm-subtask-table .tm-subtask-step-pill:hover,
.tm-subtask-table .tm-subtask-step-pill.is-editing {
    box-shadow: 0 0 0 1px #d1d5db, 0 1px 2px rgba(0, 0, 0, 0.06);
}
/* Pastille de statut d'une ligne (liste et fiche) : un liseré au survol, jamais de filtre (brightness) — un filtre promeut
   la pastille en calque et fait osciller le curseur entre main et flèche. */
.tm-pill-hover {
    cursor: pointer;
    transition: box-shadow 0.12s ease;
}
.tm-pill-hover:hover {
    box-shadow: 0 0 0 1px #d1d5db, 0 1px 2px rgba(0, 0, 0, 0.06);
}
/* Commandes d'une sous-tâche révélées au survol : invisibles, elles ne captent pas non plus le curseur
   (sinon une main apparaît sur du vide, puis disparaît quand la ligne perd le survol). */
[data-checklist-item-id] button.opacity-0:not(:focus-visible) {
    pointer-events: none;
}
[data-checklist-item-id]:hover button.opacity-0 {
    pointer-events: auto;
}
.tm-table tbody tr.tm-row-checklist-expanded > td {
    background: rgb(238 242 255 / 0.35);
}
.tm-table tbody tr.tm-row-checklist-expanded:hover > td {
    background: rgb(238 242 255 / 0.5);
}
.tm-table--grid tbody tr.tm-row-subtask:hover > td.tm-td-title,
.tm-table--grid tbody tr.tm-row-subtask.tm-row-open > td.tm-td-title {
    background: rgb(248 250 252 / 0.9);
}
.tm-table--grid tbody tr.tm-row-open > td.tm-td-title {
    background: #f8faff;
}

/* ══════════════════════════════════════
   Assistant contrat (ag-wz-*) — coquille admin-tool : noir, gris chauds,
   parcours Départ → Parties → Accord → Barème → Vérifier
   ══════════════════════════════════════ */
.ag-wz { background: #f5f5f3; color: #111; }
.ag-wz .ag-wizard-s4 { background: transparent; }
.ag-wz .ag-wz-table-card { background: #fff; }
.ag-wz-header { background: #fff; border-bottom: 1px solid #e8e8e5; }
.ag-wz-header-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.25rem 0.55rem; min-height: 3.25rem; }
.ag-wz-header-title { display: flex; align-items: center; gap: 0.5rem; min-width: 0; font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; }
.ag-wz-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0 1.25rem 0.7rem; }
.ag-wz-recap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.45rem; min-width: 0; font-size: 0.75rem; color: #999; }
.ag-wz-recap-item { color: #555; font-weight: 500; background: none; white-space: nowrap; }
.ag-wz-recap-item:hover { color: #111; text-decoration: underline; }
.ag-wz-recap-item.is-missing { color: #b45309; }
.ag-wz-recap-sep { color: #ccc; }
.ag-wz-steps .admin-tool-tab:disabled { cursor: default; }
.ag-wz-steps .admin-tool-tab.is-done:not(.is-active) { color: #333 !important; }
.ag-wz-step-num { display: inline-flex; align-items: center; justify-content: center; width: 1.15rem; height: 1.15rem; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; background: #f0f0ed; color: #888; }
.ag-wz-step-num i { font-size: 0.5rem; }
.admin-tool-tab.is-active .ag-wz-step-num { background: #fff; color: #111; }
.ag-wz-step-num.is-done { background: #e7f5ec; color: #15803d; }
.ag-wz-error { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 1.25rem; background: #fef2f2; border-bottom: 1px solid #fecaca; color: #b91c1c; font-size: 0.8125rem; }
.ag-wz-main { background: #f5f5f3; }
.ag-wz-shell { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1.25rem 2.5rem; }
.ag-wz-section { display: flex; flex-direction: column; gap: 1rem; }
.ag-wz-h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; color: #111; }
.ag-wz-lead { margin-top: -0.65rem; font-size: 0.875rem; color: #666; }
.ag-wz-kicker { display: block; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #b0b0aa; }
.ag-wz-label { display: block; margin-bottom: 0.3rem; font-size: 0.75rem; font-weight: 600; color: #555; }
.ag-wz-muted { color: #999; font-weight: 400; }
.ag-wz-help { font-size: 0.75rem; color: #888; line-height: 1.45; }
.ag-wz-help--indent { margin-left: 2.75rem; margin-top: 0.15rem; }
.ag-wz-field-error { margin-top: 0.35rem; font-size: 0.75rem; color: #b45309; }
.ag-wz-card { padding: 1.15rem 1.25rem; }
.ag-wz-stack { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.ag-wz-stack > * { width: 100%; }
.ag-wz-stack > .ag-wz-link { width: auto; }
.ag-wz-link { font-size: 0.75rem; font-weight: 600; color: #888; white-space: nowrap; background: none; border: none; padding: 0; cursor: pointer; }
.ag-wz-link:hover { color: #111; text-decoration: underline; }
.ag-wz-link i { font-size: 0.65rem; margin-right: 0.15rem; }
.ag-wz-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; border-radius: 6px; background: #f0f0ed; color: #333; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.ag-wz-chip i { font-size: 0.625rem; color: #999; }
.ag-wz-chip b { font-weight: 700; color: #111; }
.ag-wz-chip.is-missing, .ag-wz-chip.is-missing b { background: #fffbeb; color: #b45309; }
.ag-wz-chip.is-excluded { background: #fef2f2; color: #b91c1c; }
.ag-wz-chip button { color: inherit; opacity: 0.6; }
.ag-wz-chip button:hover { opacity: 1; }
.ag-wz-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.6rem; font-size: 0.75rem; }
.ag-wz-note { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8125rem; color: #555; }
.ag-wz-note i { color: #999; }
.ag-wz-note.is-warning { color: #92400e; }
.ag-wz-note.is-warning i { color: #d97706; }
.ag-wz-empty { padding: 1.5rem; text-align: center; font-size: 0.8125rem; color: #999; }
.ag-wz-field { margin-top: 1rem; }
.ag-wz-field .ag-wz-help { margin-top: 0.35rem; }
.ag-wz-card-desc { margin: 0.3rem 0 0.85rem; }
.ag-wz-subsection { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid #f0f0ed; }
.ag-wz-subsection .ag-wz-toggle { margin-top: 0; }
.ag-wz-kicker--section { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid #f0f0ed; }
.ag-wz-grid-4-flush { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.ag-wz .ag-wz-date > div { background-color: #fafaf8 !important; }
.ag-wz .ag-wz-date > div:focus-within { background-color: #fff !important; }

/* Départ */
.ag-wz-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.ag-wz-option { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem; text-align: left; background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; transition: border-color 0.14s, box-shadow 0.14s; }
.ag-wz-option:hover { border-color: #c9c9c4; }
.ag-wz-option.is-active { border-color: #111; box-shadow: 0 0 0 1px #111; }
.ag-wz-option-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 700; color: #111; }
.ag-wz-option-title i { font-size: 0.8rem; }
.ag-wz-option-desc { font-size: 0.75rem; line-height: 1.45; color: #666; }
.ag-wz-copy { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.ag-wz-list { overflow: hidden; }
.ag-wz-search { position: relative; padding: 0.75rem; border-bottom: 1px solid #f0f0ed; }
.ag-wz-search > i:first-child { position: absolute; left: 1.5rem; top: 50%; transform: translateY(-50%); font-size: 0.7rem; color: #999; }
.ag-wz-search .admin-tool-input { width: 100%; padding-left: 2rem; }
.ag-wz-search-spin { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); font-size: 0.75rem; color: #999; }
.ag-wz-group-label { padding: 0.5rem 0.9rem; background: #fafaf8; border-bottom: 1px solid #f0f0ed; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #b0b0aa; }
.ag-wz-row { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.65rem 0.9rem; text-align: left; border-bottom: 1px solid #f0f0ed; background: #fff; }
.ag-wz-row:hover:not(:disabled) { background: #fafaf8; }
.ag-wz-row.is-active { background: #f5f5f3; box-shadow: inset 3px 0 0 #111; }
.ag-wz-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ag-wz-row-title { font-size: 0.8125rem; font-weight: 600; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-wz-row-meta { display: block; font-size: 0.75rem; color: #999; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-wz-row-chevron { font-size: 0.625rem; color: #c9c9c4; }
.ag-wz-copy-preview { position: sticky; top: 0; }
.ag-wz-preview { padding: 1rem 1.1rem; }
.ag-wz-preview-title { margin-top: 0.2rem; font-size: 0.875rem; font-weight: 700; color: #111; }
.ag-wz-preview-lines { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.85rem 0 1rem; }
.ag-wz-preview-line { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; font-size: 0.8125rem; color: #555; }
.ag-wz-preview-line b { font-variant-numeric: tabular-nums; color: #111; white-space: nowrap; }
.ag-wz-keep { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; padding-top: 0.85rem; border-top: 1px solid #f0f0ed; font-size: 0.75rem; color: #555; }
.ag-wz-keep ul { display: flex; flex-direction: column; gap: 0.2rem; }
.ag-wz-keep-title { margin-bottom: 0.35rem; font-weight: 700; }
.ag-wz-keep-title.is-kept { color: #15803d; }
.ag-wz-keep-title.is-todo { color: #b45309; }
.ag-wz-models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.ag-wz-model-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ag-wz-model-lines { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.4rem; padding-top: 0.6rem; border-top: 1px solid #f0f0ed; }
.ag-wz-model-foot { margin-top: 0.35rem; font-size: 0.6875rem; color: #999; }
.ag-wz-blank { font-size: 0.875rem; color: #555; }
/* Import du contrat signé */
.ag-wz-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; min-height: 11rem; padding: 1.5rem; text-align: center; border: 1.5px dashed #d4d4cf; cursor: pointer; transition: border-color 0.14s, background 0.14s; }
.ag-wz-drop:hover, .ag-wz-drop.is-over { border-color: #111; background: #fafaf8; }
.ag-wz-drop.is-busy { cursor: progress; }
.ag-wz-drop > i { font-size: 1.6rem; color: #b0b0aa; }
.ag-wz-drop-title { font-size: 0.875rem; font-weight: 700; color: #111; }
.ag-wz-drop-desc { font-size: 0.75rem; color: #999; }
.ag-wz-reliability { margin-top: 0.6rem; padding: 0.45rem 0.6rem; border-radius: 6px; font-size: 0.75rem; line-height: 1.4; background: #fffbeb; color: #92400e; }
.ag-wz-reliability.is-good { background: #f0fdf4; color: #166534; }
.ag-wz-import-notes { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.7rem 0.9rem; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; }
.ag-wz-verify { display: inline-flex; align-items: center; gap: 0.25rem; margin-left: 0.35rem; padding: 0.05rem 0.4rem; border-radius: 5px; background: #fef3c7; color: #92400e; font-size: 0.6875rem; font-weight: 600; white-space: nowrap; vertical-align: middle; cursor: pointer; }
.ag-wz-verify:hover { background: #fde68a; }
.ag-wz-verify i { font-size: 0.625rem; }

/* Parties */
.ag-wz-parties { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 0.75rem; align-items: stretch; }
.ag-wz-party { display: flex; flex-direction: column; gap: 0.85rem; }
.ag-wz-party-entity { display: flex; align-items: center; gap: 0.75rem; }
.ag-wz-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2.25rem; height: 2.25rem; border-radius: 8px; background: #f0f0ed; font-size: 0.875rem; font-weight: 700; color: #333; }
.ag-wz-party-name { display: block; font-size: 1rem; font-weight: 700; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-wz-signer { display: flex; flex-direction: column; gap: 0.45rem; padding-top: 0.85rem; border-top: 1px solid #f0f0ed; }
.ag-wz-swap { display: flex; align-items: center; justify-content: center; }
.ag-wz-details summary { font-size: 0.75rem; font-weight: 600; color: #888; cursor: pointer; }
.ag-wz-details summary:hover { color: #111; }
.ag-wz-details[open] summary { margin-bottom: 0.5rem; }
.ag-wz-dropdown { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 15rem; overflow-y: auto; padding: 0.3rem; background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
.ag-wz-dropdown button { display: flex; align-items: center; gap: 0.45rem; width: 100%; padding: 0.4rem 0.55rem; border-radius: 6px; text-align: left; font-size: 0.8125rem; color: #333; }
.ag-wz-dropdown button:hover { background: #f5f5f3; }
.ag-wz-dropdown button i { font-size: 0.65rem; color: #b0b0aa; }
.ag-wz-dropdown button.is-action { font-weight: 600; color: #111; border-bottom: 1px solid #f0f0ed; border-radius: 6px 6px 0 0; }

/* Accord */
.ag-wz-input-lg { font-size: 0.9375rem; }
.ag-wz-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.45rem; font-size: 0.6875rem; color: #999; }
.ag-wz-hint { padding: 0.1rem 0.5rem; border-radius: 999px; background: #f0f0ed; color: #444; font-size: 0.6875rem; font-weight: 600; cursor: pointer; }
.ag-wz-hint:hover { background: #111; color: #fff; }
.ag-wz-seg { display: inline-flex; flex-wrap: wrap; gap: 0.15rem; padding: 0.2rem; background: #f2f2f0; border: 1px solid #e8e8e5; border-radius: 8px; }
.ag-wz-seg button { padding: 0.32rem 0.7rem; border-radius: 6px; font-size: 0.75rem; font-weight: 500; color: #777; }
.ag-wz-seg button i { font-size: 0.65rem; margin-right: 0.2rem; }
.ag-wz-seg button:hover:not(.is-active) { color: #111; }
.ag-wz-seg button.is-active { background: #fff; color: #111; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.ag-wz-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ag-wz-grid-2-tight { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.75rem; }
.ag-wz-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.ag-wz-toggle { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; font-size: 0.8125rem; color: #111; cursor: pointer; }
.ag-wz-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ag-wz-switch { position: relative; flex-shrink: 0; width: 2.1rem; height: 1.2rem; border-radius: 99px; background: #d9d9d4; transition: background 0.14s; }
.ag-wz-switch::after { content: ''; position: absolute; top: 0.15rem; left: 0.15rem; width: 0.9rem; height: 0.9rem; border-radius: 99px; background: #fff; transition: transform 0.14s; }
.ag-wz-toggle input:checked + .ag-wz-switch { background: #111; }
.ag-wz-toggle input:checked + .ag-wz-switch::after { transform: translateX(0.9rem); }
.ag-wz-toggle input:focus-visible + .ag-wz-switch { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }
.ag-wz-inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.5rem 0 0 2.75rem; font-size: 0.8125rem; color: #555; }
.ag-wz-num { width: 4rem; text-align: right; }

/* Barème */
.ag-wz-titlebar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem; }
.ag-wz-titlebar .ag-wz-lead { margin-top: 0.25rem; }
.ag-wz-titlebar-actions { display: flex; align-items: center; gap: 0.5rem; }
.ag-wz-menu-backdrop { position: fixed; inset: 0; z-index: 35; }
.ag-wz-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 17rem; max-height: 22rem; overflow-y: auto; padding: 0.3rem; background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
.ag-wz-menu button { display: block; width: 100%; padding: 0.42rem 0.6rem; border-radius: 6px; text-align: left; font-size: 0.8125rem; color: #333; }
.ag-wz-menu button:hover { background: #f5f5f3; }
.ag-wz-menu-sep { display: block; height: 1px; margin: 0.3rem 0; background: #f0f0ed; }
.ag-wz-catalog { padding: 0.6rem 1rem; background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; font-size: 0.8125rem; }
.ag-wz-catalog-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.ag-wz-catalog-line > i { font-size: 0.7rem; color: #b0b0aa; }
.ag-wz-catalog-ids { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) minmax(0, 1fr); gap: 0.75rem 1rem; margin: 0.7rem 0 0.25rem; padding-top: 0.75rem; border-top: 1px solid #f0f0ed; }
.ag-wz-cmo-field { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.ag-wz-assets { padding: 0.25rem 0; }
.ag-wz-assets-lead { margin-bottom: 0.6rem; }
.ag-wz-catalog-ids.is-ipi-only { grid-template-columns: minmax(0, 12rem); }
.ag-wz-cat { margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid #f0f0ed; }
.ag-wz-cat:first-of-type { margin-top: 0.55rem; }
.ag-wz-cat-head { display: flex; align-items: center; gap: 0.5rem; }
.ag-wz-cat-title { flex: 1; min-width: 0; padding: 0.2rem 0.35rem; margin-left: -0.35rem; border: 1px solid transparent; border-radius: 6px; background: transparent; font-size: 0.9375rem; font-weight: 700; color: #111; }
.ag-wz-cat-title::placeholder { color: #111; opacity: 0.55; }
.ag-wz-cat-title:hover { border-color: #e8e8e5; }
.ag-wz-cat-title:focus { outline: none; border-color: #bbb; background: #fff; }
.ag-wz-cat-remove { flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 6px; color: #b0b0aa; font-size: 0.75rem; }
.ag-wz-cat-remove:hover { background: #fef2f2; color: #b91c1c; }
.ag-wz-cat .ag-wz-catalog-ids { margin-top: 0.5rem; padding-top: 0; border-top: none; }
.ag-wz-cat-ident { margin-top: 0.5rem; }
.ag-wz-cat-ident-row { display: flex; align-items: center; gap: 0.4rem; }
.ag-wz-cat-ident-row .ag-wz-cat-scheme { flex: 0 0 9.5rem; }
.ag-wz-cat-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.6rem; font-size: 0.8125rem; }
.ag-wz-cat-scope > i { font-size: 0.65rem; color: #b0b0aa; }
.ag-wz-cat-scope b.is-restricted { color: #b45309; }
.ag-wz-cat-options { margin-top: 0.6rem; padding: 0.7rem 0.8rem; background: #f7f7f4; border: 1px solid #f0f0ed; border-radius: 8px; }
.ag-wz-cat-options-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem 0.85rem; }
.ag-wz-cat-options-wide { grid-column: 1 / -1; }
.ag-wz-cat-options .ag-wizard-s4-asset-entries { margin-top: 0.7rem; }
.ag-wz-cat-empty { margin: 0.6rem 0 0; color: #999; }
.ag-wz-cat-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid #f0f0ed; }
.ag-wz-covered { margin-bottom: 0.75rem; }
.ag-wz-fold { display: flex; align-items: center; gap: 0.45rem; width: 100%; padding: 0; background: none; border: none; text-align: left; font-size: 0.8125rem; cursor: pointer; }
.ag-wz-fold > i:first-child { font-size: 0.7rem; color: #b0b0aa; }
.ag-wz-fold-chevron { margin-left: auto; font-size: 0.6rem; color: #b0b0aa; transition: transform 0.15s; }
.ag-wz-fold-chevron.is-open { transform: rotate(180deg); }
.ag-wz-covered .ag-wz-assets { margin-top: 0.7rem; padding: 0.7rem 0 0; border-top: 1px solid #f0f0ed; background: transparent; }
.ag-wz-kind { display: inline-flex; padding: 2px; background: #f0f0ed; border-radius: 8px; }
.ag-wz-kind button { padding: 0.25rem 0.7rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; color: #777; }
.ag-wz-kind button.is-on { background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.ag-wz-cat-known { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: 0.6rem; font-size: 0.75rem; }
@media (max-width: 720px) { .ag-wz-cat-options-grid { grid-template-columns: minmax(0, 1fr); } }
.ag-wz-table-card { overflow: visible; }
.ag-wz-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ag-wz-table th { padding: 0.6rem 0.9rem; background: #fafaf8; border-bottom: 1px solid #f0f0ed; text-align: left; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #b0b0aa; white-space: nowrap; }
.ag-wz-table th:first-child { border-top-left-radius: 10px; }
.ag-wz-table th:last-child { border-top-right-radius: 10px; }
.ag-wz-table td { padding: 0.9rem 1rem; border-bottom: 1px solid #f0f0ed; vertical-align: middle; }
.ag-wz-table th { padding-left: 1rem; padding-right: 1rem; }
.ag-wz-line:not(.is-open):hover > td { background: #fcfcfb; }
.ag-wz-table tbody tr:last-child td { border-bottom: none; }
.ag-wz-col-what { width: 27%; }
/* Où / Encaissé par restent étroits : la colonne des taux a besoin de place pour tenir sur une ligne. */
.ag-wz-table thead th:nth-child(2) { width: 13%; }
.ag-wz-table thead th:nth-child(3) { width: 14%; }
.ag-wz-rate-label { white-space: nowrap; }
.ag-wz-col-actions { width: 1%; }
.ag-wz-line.is-open > td { background: #fcfcfb; border-bottom-color: transparent; }
.ag-wz-line.is-muted .ag-wz-line-name { color: #777; }
.ag-wz-line-title { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; text-align: left; background: none; }
.ag-wz-line-name { font-size: 0.8125rem; font-weight: 600; color: #111; }
.ag-wz-line-title:hover .ag-wz-line-name { text-decoration: underline; }
.ag-wz-line-sub { font-size: 0.75rem; color: #999; }
.ag-wz-cell-text { font-size: 0.8125rem; color: #55554f; line-height: 1.35; }
.ag-wz-rates { display: flex; flex-direction: column; gap: 0.55rem; }
/* Cellule de taux : la case (et son unité) dans une colonne de largeur fixe, le texte à sa droite —
   toutes les cases tombent ainsi à la même verticale, quelle que soit la ligne. */
.ag-wz-rate { display: grid; grid-template-columns: 6rem minmax(0, 1fr); align-items: center; column-gap: 0.6rem; row-gap: 0.3rem; }
.ag-wz-rate-input { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8125rem; font-weight: 600; color: #111; }
.ag-wz-rate > .ag-wz-rate-input { width: 6rem; }
.ag-wz-rate > .ag-wz-rate-input > span { min-width: 1.5rem; color: #8a8a84; }
.ag-wz-rate-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.65rem; min-width: 0; }
.ag-wz-rate-label { font-size: 0.75rem; font-weight: 600; color: #4a4a46; }
.ag-wz-pct { width: 3.9rem; padding: 0.3rem 0.5rem; text-align: right; font-size: 0.9375rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #111; background: #fafaf8; border: 1px solid #e6e6e1; border-radius: 8px; transition: background-color .12s, border-color .12s; }
.ag-wz-pct:hover { border-color: #d3d3cd; }
.ag-wz-pct:focus { outline: none; background: #fff; border-color: #111; box-shadow: 0 0 0 1px #111; }
.ag-wz-pct.is-empty { background: #fffbeb; border-color: #fcd34d; }
.ag-wz-rate-cond { font-size: 0.75rem; color: #96958f; }
.ag-wz-rate .ag-wz-hints { grid-column: 1 / -1; margin-top: 0.1rem; }
.ag-wz-actions { white-space: nowrap; text-align: right; }
.ag-wz-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 7px; color: #999; background: none; }
.ag-wz-icon-btn i { font-size: 0.75rem; }
.ag-wz-icon-btn:hover { background: #f0f0ed; color: #111; }
.ag-wz-icon-btn.is-danger:hover { background: #fef2f2; color: #dc2626; }
.ag-wz-icon-btn.is-bordered { width: 2.25rem; height: 2.25rem; background: #fff; border: 1px solid #e8e8e5; border-radius: 999px; }
.ag-wz-chevron { font-size: 0.625rem !important; transition: transform 0.15s; }
.ag-wz-chevron.is-open { transform: rotate(180deg); }
.ag-wz-line-detail > td { padding: 0.8rem 0.9rem 0.9rem 1.25rem; background: #fcfcfb; }
.ag-wz-table-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.65rem 0.9rem; border-bottom: 1px solid #f0f0ed; }
.ag-wz-ld-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.4rem; }
.ag-wz-ld-where { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0.75rem 1.5rem; align-items: start; }
@media (max-width: 960px) { .ag-wz-ld-where { grid-template-columns: minmax(0, 1fr); } }
.ag-wz-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.75rem; }

/* Barème · détail d'une ligne */
.ag-wz-ld { display: flex; flex-direction: column; gap: 0.8rem; }
.ag-wz-ld-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.75rem 1rem; align-items: end; }
.ag-wz-ld-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ag-wz-ld-grid.has-tor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ag-wz-phrase .ag-wz-cb-basis { min-width: 15rem; }
.ag-wz-phrase .ag-wz-cb-op { min-width: 8rem; }
.ag-wz-phrase .ag-wz-cb-cur { min-width: 4.5rem; }
.ag-wz-phrase .ag-wz-cb-period { min-width: 11rem; }
.ag-wz-ld-note { margin-top: 0.4rem; }
.ag-wz-ld-countries { max-width: 36rem; margin-top: 0.6rem; }
.ag-wz-ld-toggles { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; }
.ag-wz-ld-toggles .ag-wz-toggle { margin-top: 0; }
.ag-wz-ld-rates { margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid #f0f0ed; }
.ag-wz-ld-rates.is-flush { margin-top: 0.35rem; padding-top: 0; border-top: none; }
.ag-wz-ld-rates-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.15rem; }
.ag-wz-rl { display: grid; grid-template-columns: minmax(10rem, 1.1fr) auto minmax(10rem, 1.3fr) auto auto; gap: 0.5rem 0.75rem; align-items: center; padding: 0.6rem 0; border-top: 1px solid #f0f0ed; }
.ag-wz-ld-rates-head + .ag-wz-rl { border-top: none; }
.ag-wz-rl > .admin-tool-input, .ag-wz-more-body .admin-tool-input, .ag-wz-phrase .admin-tool-input { padding: 0.4rem 0.6rem; }
.ag-wz-rl-value { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.ag-wz-rl-value .ag-wz-hints { flex-basis: 100%; margin-top: 0.1rem; }
.ag-wz-rl-unit { font-size: 0.8125rem; font-weight: 600; color: #111; }
.ag-wz-rl-actions { display: flex; justify-content: flex-end; }
.ag-wz-rl-more { grid-column: 1 / -1; }
.ag-wz-rl.is-simple { grid-template-columns: minmax(10rem, 1.3fr) auto minmax(0, 1fr) auto; }
.ag-wz-unit { display: inline-flex; padding: 0.15rem; background: #f2f2f0; border: 1px solid #e8e8e5; border-radius: 7px; }
.ag-wz-unit button { min-width: 1.6rem; padding: 0.12rem 0.35rem; border-radius: 5px; font-size: 0.75rem; font-weight: 600; color: #999; }
.ag-wz-unit button:hover:not(.is-active) { color: #111; }
.ag-wz-unit button.is-active { background: #fff; color: #111; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.ag-wz-seg--sm button { padding: 0.25rem 0.55rem; }
.ag-wz-toggle--sm { margin-top: 0.55rem; gap: 0.5rem; font-size: 0.75rem; color: #444; }
.ag-wz-more summary { display: flex; align-items: center; gap: 0.4rem; min-width: 0; list-style: none; cursor: pointer; font-size: 0.75rem; font-weight: 600; color: #888; }
.ag-wz-more summary::-webkit-details-marker { display: none; }
.ag-wz-more summary:hover { color: #111; }
.ag-wz-more-chevron { flex-shrink: 0; font-size: 0.55rem; transition: transform 0.15s; }
.ag-wz-more[open] .ag-wz-more-chevron { transform: rotate(90deg); }
.ag-wz-more-label { flex-shrink: 0; white-space: nowrap; }
.ag-wz-more-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; color: #999; }
.ag-wz-more-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem 1.25rem; margin-top: 0.6rem; padding: 0.9rem 1rem; background: #fff; border: 1px solid #f0f0ed; border-radius: 8px; }
.ag-wz-more-body .ag-wz-help { margin-top: 0.3rem; }
.ag-wz-more-wide { grid-column: 1 / -1; }
.ag-wz-more--card { padding: 0.95rem 1.25rem; }
.ag-wz-more--card > summary { font-size: 0.8125rem; color: #555; }
.ag-wz-phrase { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.8125rem; color: #444; }
.ag-wz-phrase select.admin-tool-input { width: auto; }
.ag-wz-phrase-group { display: inline-flex; align-items: center; gap: inherit; }
.ag-wz-phrase--lg { margin-top: 0.7rem; gap: 0.45rem; font-size: 0.9375rem; color: #333; }
.ag-wz-num-lg { width: 6.5rem; text-align: right; }

/* Vérifier */
.ag-wz-h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: #111; }
.ag-wz-section-gap { margin-top: 0.75rem; }
.ag-wz-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.4rem; }
.ag-wz-sub-head .ag-wz-kicker, .ag-wz-sub-head .ag-wz-label { margin-bottom: 0; }
.ag-wz-ob-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: 0.75rem; }
.ag-wz-ob-title { margin-bottom: 0.35rem; font-size: 0.8125rem; font-weight: 700; color: #111; }
.ag-wz-ob-list { display: flex; flex-direction: column; }
.ag-wz-ob-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.25rem; }
.ag-wz-ob-check { display: flex; align-items: center; gap: 0.6rem; min-width: 0; margin-left: -0.4rem; padding: 0.3rem 0.4rem; border-radius: 6px; text-align: left; font-size: 0.8125rem; color: #222; background: none; }
.ag-wz-ob-check:hover { background: #f5f5f3; }
.ag-wz-ob-text.is-off { color: #888; }
.ag-wz-ob-detail { flex-basis: 100%; margin: -0.15rem 0 0.2rem; padding-left: 1.6rem; font-size: 0.75rem; color: #999; }
.ag-wz-ob-edit-btn { padding: 0.2rem 0.3rem; font-size: 0.625rem; color: #b0b0aa; background: none; opacity: 0; }
.ag-wz-ob-item:hover .ag-wz-ob-edit-btn, .ag-wz-ob-edit-btn:focus-visible { opacity: 1; }
.ag-wz-ob-edit-btn:hover { color: #111; }
.ag-wz-ob-edit { margin: 0.15rem 0 0.35rem 1.6rem; width: calc(100% - 1.6rem); padding: 0.35rem 0.55rem; }
.ag-wz-ob-add { margin-top: 0.5rem; }
.ag-wz-pt { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; padding: 0.7rem 0; border-top: 1px solid #f0f0ed; }
.ag-wz-sub-head + .ag-wz-pt { border-top: none; }
.ag-wz-pt > div { flex: 1 1 10rem; min-width: 0; }
.ag-wz-pt > .ag-wz-pt-note { flex: 2 1 14rem; }
.ag-wz-pt .admin-tool-input, .ag-wz-adv .admin-tool-input, .ag-wz-note-row .admin-tool-input { padding: 0.4rem 0.6rem; }
.ag-wz-pt-remove { flex-shrink: 0; }
.ag-wz-adv { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.5rem 0; border-top: 1px solid #f0f0ed; }
.ag-wz-adv .ag-wz-toggle { margin-top: 0; }
.ag-wz-adv-note { flex: 1 1 12rem; min-width: 0; }
.ag-wz-notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 0.9rem; }
.ag-wz-note-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.ag-wz-note-type { width: 6rem; }
.ag-wz-note-date { width: 8.5rem; flex-shrink: 0; }
.ag-wz-missing { padding: 0.75rem 1rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 0.8125rem; color: #92400e; }
.ag-wz-missing-title { margin-bottom: 0.3rem; font-weight: 700; }
.ag-wz-missing ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.ag-wz-missing button { text-decoration: underline; color: inherit; background: none; }
.ag-wz-missing .ag-wz-missing-fix { margin-left: 0.45rem; padding: 0.05rem 0.55rem; font-weight: 600; text-decoration: none; background: #fff; border: 1px solid #fcd34d; border-radius: 999px; }
.ag-wz-missing .ag-wz-missing-fix:hover { background: #fef3c7; }
.ag-wz-checks { padding: 0.75rem 1rem; background: #fff; border: 1px solid #e8e8e5; border-left: 3px solid #d97706; border-radius: 10px; font-size: 0.8125rem; color: #444; }
.ag-wz-checks-title { margin-bottom: 0.4rem; font-weight: 700; color: #111; }
.ag-wz-checks-title i { margin-right: 0.15rem; color: #d97706; }
.ag-wz-checks-title span { font-weight: 400; color: #999; }
.ag-wz-checks ul { display: flex; flex-direction: column; gap: 0.45rem; }
.ag-wz-checks li { display: flex; align-items: baseline; gap: 1rem; line-height: 1.45; }
.ag-wz-review-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.ag-wz-review-grid > :only-child { grid-column: 1 / -1; }
.ag-wz-doc { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.4rem 1.5rem; font-size: 0.9375rem; line-height: 1.65; color: #333; }
.ag-wz-doc b { color: #111; }
.ag-wz-doc-block { display: flex; align-items: flex-start; gap: 1rem; }
.ag-wz-doc-lines { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.4rem; }
.ag-wz-doc-lines li { display: flex; align-items: baseline; gap: 0.85rem; font-size: 0.875rem; line-height: 1.45; }
.ag-wz-doc-value { flex-shrink: 0; min-width: 6.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.ag-wz-doc-detail { display: block; font-size: 0.75rem; color: #999; }
.ag-wz-review-section { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; font-size: 0.8125rem; border-bottom: 1px solid #f5f5f3; }
.ag-wz-review-section i { width: 1rem; font-size: 0.7rem; color: #b0b0aa; }

/* Terminé */
.ag-wz-done { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; padding: 4rem 1rem; text-align: center; }
.ag-wz-done .ag-wz-lead { margin-top: 0; }
.ag-wz-done-icon { display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 4rem; border-radius: 999px; background: #e7f5ec; color: #15803d; font-size: 1.5rem; }
.ag-wz-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.5rem; }

/* Reprise de lignes */
.ag-wz-modal-backdrop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem; background: rgba(17, 17, 17, 0.35); }
.ag-wz-modal { display: flex; flex-direction: column; width: 100%; max-width: 720px; max-height: 84vh; overflow: hidden; background: #fff; border-radius: 12px; }
.ag-wz-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem 0.5rem; }
.ag-wz-modal-title { font-size: 0.9375rem; font-weight: 700; color: #111; }
.ag-wz-modal-search { padding: 0.25rem 1.1rem 0.8rem; border-bottom: 1px solid #f0f0ed; }
.ag-wz-modal-body { flex: 1; overflow-y: auto; }
.ag-wz-modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0.75rem 1.1rem; border-top: 1px solid #f0f0ed; }
.ag-wz-lp-lines { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.35rem 1rem 0.75rem 1.4rem; border-bottom: 1px solid #f0f0ed; background: #fcfcfb; }
.ag-wz-lp-line { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.4rem 0.5rem; border-radius: 6px; text-align: left; font-size: 0.8125rem; color: #333; }
.ag-wz-lp-line:hover { background: #f5f5f3; }
.ag-wz-lp-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-wz-check { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 1rem; height: 1rem; border: 1.5px solid #c9c9c4; border-radius: 4px; color: #fff; font-size: 0.55rem; }
.ag-wz-check.is-on { background: #111; border-color: #111; }

/* Pied */
.ag-wz-footer { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.25rem; background: #fff; border-top: 1px solid #e8e8e5; }
.ag-wz-footer-step { font-size: 0.75rem; color: #999; }
.ag-wz-footer-actions { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }

@media (max-width: 1100px) {
    .ag-wz-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .ag-wz-options, .ag-wz-copy, .ag-wz-models, .ag-wz-grid-2, .ag-wz-grid-3, .ag-wz-review-grid { grid-template-columns: minmax(0, 1fr); }
    .ag-wz-grid-4-flush { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ag-wz-parties { grid-template-columns: minmax(0, 1fr); }
    .ag-wz-swap { padding: 0.25rem 0; }
    .ag-wz-copy-preview { position: static; }
    .ag-wz-table-card { overflow-x: auto; }
    .ag-wz-ld-head, .ag-wz-ld-grid, .ag-wz-ob-groups, .ag-wz-notes-grid, .ag-wz-catalog-ids, .ag-wz-more-body { grid-template-columns: minmax(0, 1fr); }
    .ag-wz-rl { grid-template-columns: minmax(0, 1fr) auto; }
    .ag-wz-rl.is-simple { grid-template-columns: minmax(0, 1fr) auto; }
    .ag-wz-rl-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .ag-wz-header-bar, .ag-wz-steps, .ag-wz-shell { padding-left: 1rem; padding-right: 1rem; }
    .ag-wz-footer { padding: 0.6rem 1rem; gap: 0.5rem; }
    .ag-wz-footer-step, .ag-wz-footer-actions > .ag-wz-link { display: none; }
    .ag-wz-footer-actions { gap: 0.4rem; }
    .ag-wz-titlebar-actions { flex-wrap: wrap; }
    .ag-wz-grid-4-flush { grid-template-columns: minmax(0, 1fr); }
}

/* =============================================================================
   Fiche contrat (vue Entités) — même grammaire que l'assistant et le tableau
   des contrats : fond blanc, filets #e8e8e5, cartes de 10 px, bandeau gris chaud
   en tête de section, pastilles neutres, noir pour l'accent. Tout est scopé sur
   .ag-contract-detail : la liste latérale garde sa propre échelle.
   ========================================================================== */
.ag-contract-detail {
    --ag-fs-strong: 0.875rem;
    --ag-fs-base: 0.75rem;
    --ag-fs-micro: 0.6875rem;
    --ag-badge-radius: 6px;
    --ag-badge-pad: 0.15rem 0.5rem;
    --ag-badge-bg: #f0f0ed;
    --ag-badge-fg: #333;
    --ag-badge-border: transparent;
    padding: 1.1rem 1.25rem;
    border: 1px solid #e8e8e5;
    border-radius: 10px;
    color: #111;
}
.ag-contract-detail.ag-entity-contract-card + .ag-entity-contract-card { margin-top: 0.85rem; }
.ag-contract-detail-header { margin-bottom: 1rem; padding-bottom: 0.9rem; border-bottom-color: #f0f0ed; }
.ag-contract-detail-title { font-size: 1rem; font-weight: 700; color: #111; letter-spacing: -0.01em; }
.ag-contract-detail-ref { margin-top: 0.15rem; font-size: 0.75rem; color: #888; }
.ag-contract-detail-badges { gap: 0.35rem; margin-top: 0.6rem; }

/* Pastilles : puces grises de l'assistant. La famille de droits garde sa teinte en simple point. */
.ag-contract-detail .ag-contract-badge,
.ag-contract-detail .ag-contract-tag,
.ag-contract-detail .ag-contract-chip { font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.ag-contract-detail .ag-contract-badge.is-state {
    height: 1.4rem; padding: 0 0.6rem; border: 1px solid #e5e7eb; border-radius: 999px; background: #fff; color: #333;
}
.ag-contract-detail .ag-contract-badge.is-state::before { width: 0.375rem; height: 0.375rem; }
.ag-contract-detail .ag-contract-tag.is-publishing,    .ag-contract-detail .ag-contract-badge.is-publishing,
.ag-contract-detail .ag-contract-tag.is-sync-rep-publishing, .ag-contract-detail .ag-contract-badge.is-sync-rep-publishing,
.ag-contract-detail .ag-contract-tag.is-master,        .ag-contract-detail .ag-contract-badge.is-master,
.ag-contract-detail .ag-contract-tag.is-sync-rep-master, .ag-contract-detail .ag-contract-badge.is-sync-rep-master,
.ag-contract-detail .ag-contract-tag.is-sync-rep-dual, .ag-contract-detail .ag-contract-badge.is-sync-rep-dual,
.ag-contract-detail .ag-contract-tag.is-neighbouring,  .ag-contract-detail .ag-contract-badge.is-neighbouring,
.ag-contract-detail .ag-contract-tag.is-neighbouring-av, .ag-contract-detail .ag-contract-badge.is-neighbouring-av {
    background: var(--ag-badge-bg); color: var(--ag-badge-fg); border-color: var(--ag-badge-border);
}
.ag-contract-detail .is-publishing::before, .ag-contract-detail .is-sync-rep-publishing::before,
.ag-contract-detail .is-master::before, .ag-contract-detail .is-sync-rep-master::before,
.ag-contract-detail .is-sync-rep-dual::before, .ag-contract-detail .is-neighbouring::before,
.ag-contract-detail .is-neighbouring-av::before {
    content: ''; width: 0.375rem; height: 0.375rem; border-radius: 999px; flex-shrink: 0;
}
.ag-contract-detail .is-publishing::before, .ag-contract-detail .is-sync-rep-publishing::before { background: #4a6ca3; }
.ag-contract-detail .is-master::before, .ag-contract-detail .is-sync-rep-master::before { background: #b86a43; }
.ag-contract-detail .is-sync-rep-dual::before { background: #8b5a91; }
.ag-contract-detail .is-neighbouring::before, .ag-contract-detail .is-neighbouring-av::before { background: #3f8a86; }
.ag-contract-detail .ag-contract-tag.is-emerald, .ag-contract-detail .ag-contract-tag.is-granted,
.ag-contract-detail .ag-contract-chip.is-emerald { background: #effaf4; color: #1f6b43; border-color: #bbe5cd; }
.ag-contract-detail .ag-contract-tag.is-rose { background: #fdf1f2; color: #a23a47; border-color: #f0c6cb; }
.ag-contract-detail .ag-contract-tag.is-amber, .ag-contract-detail .ag-contract-chip.is-amber { background: #fdf7e3; color: #8a5a0b; border-color: #f0dca6; }
.ag-contract-detail .ag-contract-chip.is-rose { background: #fdf1f2; color: #a23a47; border-color: #f0c6cb; }
/* Famille du contrat (la nature) : pastille pleine, un cran plus sombre. Portées (ce qu'il contient) : pastille claire à point coloré. */
.ag-contract-detail .ag-contract-badge.is-family {
    background: #ecebe6; border-color: #d3d2ca; color: #1f1f1d; font-weight: 700;
}
.ag-contract-detail .ag-contract-badge.is-scope {
    background: #fff; border-color: #e5e7eb; color: #4a4a46; font-weight: 500;
}
.ag-contract-detail .ag-role-arrow { width: 1.4rem; height: 1.4rem; border: 1px solid #e5e7eb; background: #fff; color: #666; border-radius: 6px; }
.ag-contract-detail .ag-role-arrow.is-assignor, .ag-contract-detail .ag-role-arrow.is-assignee { border-color: #e5e7eb; background: #fff; color: #666; }
.ag-contract-detail .ag-role-arrow i { font-size: 0.625rem; }

/* Synthèse : trois colonnes dans un encadré blanc, libellés en petites capitales grises. */
.ag-contract-summary { border-color: #e8e8e5; border-radius: 10px; margin-bottom: 0.85rem; }
.ag-contract-summary-col { padding: 0.9rem 1rem; }
.ag-contract-summary-col + .ag-contract-summary-col { border-left-color: #f0f0ed; }
.ag-contract-summary-head { margin-bottom: 0.7rem; }
.ag-contract-summary-icon { color: #b0b0aa; }
.ag-contract-summary-label,
.ag-contract-party-role,
.ag-contract-summary-dl dt,
.ag-contract-kv-label,
.ag-contract-detail .ag-contract-data-table thead th,
.ag-contract-detail .ag-contract-rates-table th {
    font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #b0b0aa;
}
.ag-contract-party-name { font-size: 0.9375rem; font-weight: 600; color: #111; }
.ag-contract-party-signatory { margin-top: 0.2rem; font-size: 0.75rem; color: #888; }
.ag-contract-party-card, .ag-contract-party-card.is-assignor, .ag-contract-party-card.is-assignee { border-left: 2px solid #e8e8e5; padding-left: 0.65rem; }
.ag-contract-party-card.is-assignee { border-left-color: #111; }
.ag-contract-parties-flow-arrow { color: #c9c9c4; }
.ag-contract-party-extra { border-top-color: #f0f0ed; }
.ag-contract-summary-dl { gap: 0.6rem; }
.ag-contract-summary-dl dd { font-size: 0.8125rem; font-weight: 500; color: #111; }
.ag-contract-summary-dl--inline dd { font-weight: 600; }
.ag-contract-dates-range {
    padding: 0.45rem 0.75rem; border: 1px solid #e8e8e5; border-radius: 8px; background: #fafaf8;
    font-size: 0.8125rem; font-weight: 600; color: #111;
}
.ag-contract-dates-range.is-inactive { background: #f5f5f3; border-color: #e8e8e5; color: #888; }

/* Sections : carte blanche, bandeau gris chaud en tête (comme .ag-wizard-s4-section). */
.ag-contract-detail-grid { gap: 0.85rem; }
.ag-contract-detail .ag-entity-section {
    padding: 0 0.85rem 0.85rem; border: 1px solid #e8e8e5; border-radius: 10px; background: #fff; overflow: hidden;
}
.ag-contract-detail .ag-contract-section--dense { padding: 0 0.85rem 0.85rem; }
.ag-contract-detail .ag-entity-section-title {
    margin: 0 -0.85rem 0.75rem; padding: 0.6rem 0.85rem; gap: 0.4rem;
    border-bottom: 1px solid #f0f0ed; background: #fafaf8;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: #111;
}
.ag-contract-detail .ag-entity-section-title > i { font-size: 0.7rem; color: #888; }
.ag-contract-detail .ag-contract-section--dense .ag-entity-section-title { margin-bottom: 0.5rem; }
.ag-contract-detail .ag-contract-section-head {
    margin: 0 -0.85rem 0.75rem; padding: 0.6rem 0.85rem; border-bottom: 1px solid #f0f0ed; background: #fafaf8;
}
.ag-contract-detail .ag-contract-section-head .ag-entity-section-title { margin: 0; padding: 0; border: 0; background: none; }
.ag-contract-section-count { color: #888; font-weight: 500; opacity: 1; }
.ag-contract-section-meta { color: #888; }
.ag-contract-detail .ag-contract-empty { font-size: 0.8125rem; color: #aaa; }
.ag-contract-kv-value { font-size: 0.8125rem; font-weight: 500; color: #111; }
.ag-contract-notes { font-size: 0.8125rem; color: #333; }
.ag-contract-link-btn { color: #555; font-weight: 600; }
.ag-contract-link-btn:hover { background: #f0f0ed; color: #111; }

/* Portées, tableaux, taux. */
.ag-contract-scope-card { border-color: #e8e8e5; border-radius: 8px; background: #fafaf8; padding: 0.7rem 0.8rem; }
.ag-contract-scope-title { font-size: 0.8125rem; font-weight: 600; color: #111; }
.ag-contract-scope-code { color: #aaa; }
.ag-contract-detail .ag-contract-data-table { font-size: 0.8125rem; }
.ag-contract-detail .ag-contract-data-table thead th { padding: 0.35rem 0.5rem; border-bottom-color: #f0f0ed; }
.ag-contract-detail .ag-contract-data-table tbody td { padding: 0.45rem 0.5rem; border-bottom-color: #f0f0ed; }
.ag-contract-detail .ag-contract-data-table tbody tr:hover td { background: #fafaf8; }
.ag-contract-detail .ag-contract-data-primary { font-weight: 600; color: #111; }
.ag-contract-rates-table { font-size: 0.8125rem; }
.ag-contract-rates-table--unified { border-color: #e8e8e5; border-radius: 8px; }
.ag-contract-rates-table th { padding: 0.4rem 0.75rem; background: #fafaf8; border-bottom-color: #f0f0ed; }
.ag-contract-rate-group-row td { background: #fafaf8; border-bottom-color: #f0f0ed; }
.ag-contract-rates-table--unified .ag-contract-rate-group-body:not(:first-of-type) .ag-contract-rate-group-row td { border-top: 1px solid #e8e8e5; }
.ag-contract-rates-table--unified .ag-contract-rate-data-row td,
.ag-contract-rates-table--unified .ag-contract-rate-group-body .ag-contract-rate-data-row:last-child td { border-bottom-color: #f0f0ed; }
.ag-contract-rate-name { font-size: 0.8125rem; font-weight: 600; color: #111; }
.ag-contract-rate-group-title { font-size: 0.8125rem; font-weight: 600; color: #111; }
.ag-contract-rate-value { font-size: 0.875rem; font-weight: 600; color: #111; }
.ag-contract-rate-method, .ag-contract-rate-currency, .ag-contract-finance-label { color: #888; }
.ag-contract-finance-amount { font-weight: 600; color: #111; }
.ag-contract-detail-footer { border-top-color: #f0f0ed; font-size: 0.75rem; color: #aaa; }

/* États de la carte : filet gauche discret, bandeau gris, mise en avant noire. */
.ag-entity-contract-card.ag-contract-detail.is-inactive { background: #fafaf8; border-color: #e8e8e5; border-left: 3px solid #b0b0aa; }
.ag-entity-contract-card.ag-contract-detail.is-nego { border-left: 3px solid #d9930d; }
.ag-contract-inactive-banner { margin: -1.1rem -1.25rem 0.9rem; padding: 0.5rem 1.25rem; background: #f5f5f3; border-bottom-color: #e8e8e5; color: #888; letter-spacing: 0.06em; }
.ag-entity-contract-card.ag-contract-detail.is-highlighted {
    border-color: #111; border-left: 1px solid #111; box-shadow: 0 0 0 1px #111;
    animation: ag-highlight-fade 2s ease-out forwards;
}
@keyframes ag-highlight-fade {
    0%, 60% { box-shadow: 0 0 0 1px #111, 0 0 0 5px rgba(17, 17, 17, 0.08); }
    100% { box-shadow: 0 0 0 0 transparent; border-color: #e8e8e5; border-left-color: #e8e8e5; }
}

/* =============================================================================
   Vue Entités — navigation, liste latérale, bandeau société, contacts, onglets
   Même coquille que le wizard, le tableau et la fiche contrat : gris chauds,
   noir pour l'actif, vert/indigo/violet réservés aux seuls états métier.
   ========================================================================== */
.ag-nav-btn {
    display: flex; align-items: center; gap: 0.65rem; width: 100%; min-width: 0; padding: 0.5rem 0.75rem;
    border: 1px solid transparent; border-radius: 8px; background: transparent; color: #555;
    font-size: 0.8125rem; font-weight: 500; text-align: left; overflow: hidden;
    transition: background 0.2s ease, color 0.2s ease;
}
.ag-nav-btn i { color: #9a9a94; text-align: center; }
.ag-nav-btn:hover { background: #f5f5f3; color: #111; }
.ag-nav-btn.is-active { background: #111; color: #fff; }
.ag-nav-btn.is-active i { color: #d6d6d1; }
.ag-sidebar-footer-link { margin-top: auto; padding: 0.5rem 1rem 0.75rem; flex-shrink: 0; }
.ag-sidebar-quiet-link { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.4rem; border: 0; background: none; border-radius: 6px; font-size: 0.6875rem; color: #9a9a94; cursor: pointer; }
.ag-sidebar-quiet-link:hover { color: #111; background: #f5f5f3; }
.ag-sidebar-quiet-link.is-active { color: #111; font-weight: 600; }
.ag-panel-splitter.is-active .ag-panel-splitter-grip { border-color: #111; }
.ag-panel-splitter.is-active .ag-panel-splitter-grip span { background: #111; }

/* Boutons de l'écran : ceux de la coquille admin-tool (secondaire / noir). */
.ag-entity-btn-ghost, .ag-entity-btn-accent, .ag-entity-btn-danger {
    gap: 0.4rem; padding: 0.35rem 0.75rem; font-size: 0.75rem; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.ag-entity-btn-ghost { color: #555; border-color: #e8e8e5; font-weight: 500; }
.ag-entity-btn-ghost:hover { background: #fafaf8; border-color: #ccc; color: #111; }
.ag-entity-btn-accent { color: #fff; background: #111; border-color: #111; }
.ag-entity-btn-accent:hover { background: #333; border-color: #333; }
.ag-entity-btn-danger { border-color: #fecaca; background: #fff; }
.ag-entity-btn-danger:hover:not(:disabled) { background: #fef2f2; }

/* Liste latérale : outils. */
.ag-entity-sidebar-tools, .ag-entity-list-item {
    --ag-fs-strong: 0.875rem; --ag-fs-base: 0.78125rem; --ag-fs-micro: 0.6875rem;
    --ag-badge-radius: 6px; --ag-badge-pad: 0.1rem 0.4rem;
    --ag-badge-bg: #f0f0ed; --ag-badge-fg: #333; --ag-badge-border: transparent;
}
.ag-entity-sidebar-tools { padding: 0.75rem 0.85rem; border-bottom-color: #e8e8e5; background: #fafaf8; }
.ag-entity-sidebar-title { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; color: #b0b0aa; }
.ag-entity-sidebar-count { background: #f0f0ed; border-color: transparent; color: #333; font-weight: 600; }
.ag-entity-sidebar-action,
.ag-entity-sidebar-action.is-create, .ag-entity-sidebar-action.is-contract {
    width: 1.75rem; height: 1.75rem; border: 1px solid #e5e7eb; border-radius: 7px; background: #fff; color: #555; font-size: 0.75rem;
}
.ag-entity-sidebar-action:hover,
.ag-entity-sidebar-action.is-create:hover, .ag-entity-sidebar-action.is-contract:hover { background: #f5f5f3; color: #111; border-color: #d6d6d1; }
.ag-entity-sidebar-search { padding: 0 0.6rem 0 1.85rem; height: 2rem; border-color: #d6d6d1; border-radius: 8px; font-size: 0.78125rem; }
.ag-entity-sidebar-search:focus { border-color: #9a9a94; box-shadow: none; }
.ag-entity-sidebar-search-icon, .ag-entity-indirect-icon { color: #9a9a94; left: 0.65rem; }
.ag-entity-indirect-input {
    padding: 0 1.75rem; height: 2rem; border: 1px dashed #d6d6d1; border-radius: 8px; background: transparent; font-size: 0.78125rem;
}
.ag-entity-indirect-input:focus { border-color: #9a9a94; border-style: solid; background: #fff; box-shadow: none; }
.ag-entity-indirect-chip { height: 1.75rem; padding: 0 0.3rem 0 0.6rem; border: 1px solid #d6d6d1; background: #fff; color: #111; font-size: 0.75rem; font-weight: 500; }
.ag-entity-indirect-chip-remove { color: #9a9a94; }
.ag-entity-indirect-chip-remove:hover { background: #f0f0ed; color: #111; }
.ag-entity-indirect-dropdown, .ag-entity-filter-dropdown {
    border-color: #e8e8e5; border-radius: 10px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 10px -6px rgba(0, 0, 0, 0.1);
}
.ag-entity-indirect-dropdown-item:hover { background: #fafaf8; }
.ag-entity-filter-menu-btn {
    height: 2rem; padding: 0 0.55rem; border-color: #d6d6d1; border-radius: 8px; color: #555; font-size: 0.75rem; font-weight: 500;
}
.ag-entity-filter-menu-btn:hover { background: #f5f5f3; color: #111; }
.ag-entity-filter-menu-btn.is-active.is-cat, .ag-entity-filter-menu-btn.is-active.is-role,
.ag-entity-filter-menu-btn.is-active.is-rights, .ag-entity-filter-menu-btn.is-active.is-activity {
    background: #111; border-color: #111; color: #fff;
}
.ag-entity-filter-dropdown-item { border-radius: 6px; color: #333; }
.ag-entity-filter-dropdown-item i { color: #111; }
.ag-entity-filter-dropdown-item.is-selected, .ag-entity-filter-dropdown-item.is-selected:hover { background: #f5f5f3; color: #111; }
.ag-entity-filter-dropdown-item:hover { background: #fafaf8; }

/* Liste latérale : lignes. */
.ag-entity-list-item { min-height: 2.6rem; border-bottom-color: #f0f0ed; }
.ag-entity-list-item:hover { background: #fafaf8; }
.ag-entity-list-item.is-selected { background: #f5f5f3; border-left-color: #111; }
.ag-entity-list-item.all-inactive.is-selected { background: #f0f0ed; border-left-color: #b0b0aa; }
.ag-entity-list-glyphs-col { width: 2.5rem; border-right-color: #f0f0ed; background: #fafaf8; }
.ag-entity-list-item.is-selected .ag-entity-list-glyphs-col { background: #f0f0ed; border-right-color: #e8e8e5; }
.ag-entity-glyph-cell { border-bottom-color: #f0f0ed; }
.ag-entity-glyph-direct.has-active { color: #1f6b43; background: transparent; }
.ag-entity-glyph-cascade { color: #666; background: transparent; }
.ag-entity-glyph-cascade:hover { background: #f0f0ed; color: #111; }
.ag-entity-glyph-cascade.is-active { background: #111; color: #fff; }
.ag-entity-list-main { padding: 0.4rem 0.7rem 0.4rem 0.6rem; gap: 0.25rem; }
.ag-entity-list-name { font-size: 0.78125rem; font-weight: 600; color: #111; }
.ag-entity-list-country { color: #888; border-color: #e5e7eb; font-weight: 600; }
.ag-entity-list-meta-chip { color: #888; }
.ag-entity-list-meta-chip.is-cat-av, .ag-entity-list-meta-chip.is-cat-pop, .ag-entity-list-meta-chip.is-cat-other {
    background: #f5f5f3; color: #666; border-color: transparent;
}
.ag-entity-list-tags { gap: 0.25rem; }
.ag-entity-chip { padding: 0.05rem 0.4rem; font-weight: 600; }
.ag-entity-chip.is-publishing, .ag-entity-chip.is-sync-rep-publishing,
.ag-entity-chip.is-master, .ag-entity-chip.is-sync-rep-master, .ag-entity-chip.is-sync-rep-dual, .ag-entity-chip.is-family-music {
    background: var(--ag-badge-bg); color: var(--ag-badge-fg); border-color: var(--ag-badge-border);
}
.ag-entity-chip.is-publishing::before, .ag-entity-chip.is-sync-rep-publishing::before,
.ag-entity-chip.is-master::before, .ag-entity-chip.is-sync-rep-master::before, .ag-entity-chip.is-sync-rep-dual::before, .ag-entity-chip.is-family-music::before {
    content: ''; width: 0.375rem; height: 0.375rem; border-radius: 999px; flex-shrink: 0;
}
.ag-entity-chip.is-publishing::before, .ag-entity-chip.is-sync-rep-publishing::before { background: #4a6ca3; }
.ag-entity-chip.is-master::before, .ag-entity-chip.is-sync-rep-master::before { background: #b86a43; }
.ag-entity-chip.is-sync-rep-dual::before { background: #8b5a91; }
.ag-entity-chip.is-family-music::before { background: #4f8a6a; }
/* Famille du contrat (la nature) : pastille pleine, un cran plus sombre. Portées sync rep (ce qu'il contient) : pastille claire. */
.ag-entity-chip.is-family { background: #ecebe6; border-color: #d3d2ca; color: #1f1f1d; font-weight: 700; }
.ag-entity-chip.is-scope { background: #fff; border-color: #e5e7eb; color: #4a4a46; font-weight: 500; }
.ag-entity-chip.is-inactive-hint { color: #888; border-color: #d6d6d1; }

/* Bandeau société. */
.ag-entity-header { padding: 1rem 1.25rem 0.85rem; border-bottom-color: #e8e8e5; }
.ag-entity-header-main { margin-top: 0; gap: 0.9rem; }
.ag-entity-header-logo, .ag-entity-header-logo-placeholder { width: 3.5rem; height: 3.5rem; border-radius: 10px; }
.ag-entity-header-logo { border-color: #e8e8e5; }
.ag-entity-header-logo-placeholder { border-color: #d6d6d1; background: #fafaf8; color: #b0b0aa; }
.ag-entity-header-title { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; color: #111; }
.ag-entity-header-meta { margin-top: 0.25rem; font-size: 0.75rem; color: #888; }
.ag-entity-kpis { margin-top: 0.85rem; padding-top: 0.85rem; border-top-color: #f0f0ed; }
.ag-entity-kpi { gap: 0.55rem; padding: 0 1.1rem; border-right-color: #f0f0ed; }
.ag-entity-kpi-icon { width: 1.5rem; height: 1.5rem; border-radius: 6px; background: #f5f5f3; color: #888; font-size: 0.6875rem; }
.ag-entity-kpi-val { font-size: 1rem; font-weight: 700; color: #111; font-variant-numeric: tabular-nums; }
.ag-entity-kpi-lbl { font-size: 0.6875rem; color: #888; }

/* Contacts liés. */
.ag-entity-contacts-band { padding: 0.65rem 1.25rem; border-bottom-color: #e8e8e5; }
.ag-entity-contacts-sub { font-size: 0.6875rem; color: #888; }

/* Onglets Tous / Assignor / Assignee / Couverte : le sélecteur de vues de Syncs. */
.ag-entity-toolbar { padding: 0.55rem 1.25rem; border-bottom-color: #e8e8e5; background: #fafaf8; }
.ag-entity-role-toggle { padding: 2px; background: rgba(229, 231, 235, 0.7); border-radius: 8px; }
.ag-entity-role-btn { height: 1.75rem; padding: 0 0.7rem; border-radius: 6px; font-size: 0.78125rem; color: #6b7280; }
.ag-entity-role-btn:hover:not(.is-active) { color: #111; }
.ag-entity-role-btn.is-active { background: #fff; color: #111; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.ag-entity-role-count { background: #e5e7eb; color: #6b7280; font-size: 0.6875rem; }
.ag-entity-role-btn.is-active .ag-entity-role-count { background: #f0f0ed; color: #333; }
.ag-entity-body { padding: 1rem 1.25rem; background: #f5f5f3; }
.ag-entity-filter-clear-icon { width: 2rem; height: 2rem; border-color: #e5e7eb; border-radius: 7px; background: #fff; color: #888; }
.ag-entity-filter-clear-icon:hover { background: #f5f5f3; color: #111; }

/* =============================================================================
   Contrôle Airtable, modales d'import / synchronisation / aperçu d'en-tête :
   même coquille (gris chauds, noir pour l'action), états métier en teintes
   douces. Les modales sont en utilitaires Tailwind : on les cadre par data-modal.
   ========================================================================== */
.ag-contract-back-button { min-height: 0; padding: 0.4rem 0.75rem; border-color: #e8e8e5; border-radius: 7px; color: #555; font-size: 0.75rem; }
.ag-contract-back-button:hover { background: #fafaf8; border-color: #ccc; color: #111; }

.ag-airtable-audit { background: #f5f5f3; }
.ag-airtable-audit .ag-contract-filters,
.ag-airtable-audit .ag-contract-table-card { border-color: #e5e7eb; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.ag-airtable-audit .ag-contract-filters { margin-bottom: 0.75rem; }
.ag-airtable-audit .ag-contract-filterbar { justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding: 6px 8px; background: #fafaf8; border-radius: 12px; }
.ag-airtable-audit .ag-contract-search { flex: 0 1 280px; min-width: 200px; }
.ag-airtable-audit .ag-contract-search i { left: 10px; font-size: 11px; }
.ag-airtable-audit .ag-contract-search input { height: 32px; padding: 0 8px 0 30px; border-color: #d6d6d1; border-radius: 8px; background: #fff; font-size: 12.5px; }
.ag-airtable-audit .ag-contract-search input:focus { outline: none; border-color: #9a9a94; }
.ag-airtable-audit .ag-contract-filter-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid #d6d6d1; border-radius: 8px;
    background: #fff; color: #57574f; font-size: 12.5px; font-weight: 400;
}
.ag-airtable-audit .ag-contract-filter-chip strong { font-weight: 600; color: #888; font-variant-numeric: tabular-nums; }
.ag-airtable-audit .ag-contract-filter-chip:hover:not(.is-active) { background: #f5f5f3; color: #111; }
.ag-airtable-audit .ag-contract-filter-chip.is-active { border-color: #1c1c1a; background: #1c1c1a; color: #fff; }
.ag-airtable-audit .ag-contract-filter-chip.is-active strong { color: #d6d6d1; }
.ag-airtable-audit .ag-contract-table-toolbar { min-height: 0; padding: 0 12px; height: 2.25rem; border-bottom-color: #e5e7eb; background: #fafaf8; border-radius: 12px 12px 0 0; font-size: 12px; }
.ag-airtable-audit-intro { padding: 0.9rem 1.1rem; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.ag-airtable-audit-intro p { color: #666; font-size: 0.8125rem; }
.ag-airtable-audit-kicker { color: #b0b0aa !important; font-size: 0.6875rem !important; font-weight: 600; }
.ag-airtable-audit-meta { color: #aaa !important; font-size: 0.75rem !important; }
.ag-airtable-audit-run { min-height: 0; padding: 0.5rem 1rem; border: 0; border-radius: 7px; background: #111; color: #fff; font-size: 0.8125rem; font-weight: 600; }
.ag-airtable-audit-run:hover:not(:disabled) { background: #333; border-color: transparent; }
.ag-airtable-audit-row { padding: 0.55rem 0.9rem; border-bottom-color: #f0f0ed; }
.ag-airtable-audit-row:hover { background: #fafaf8; }
.ag-airtable-audit-badge {
    padding: 0 0.6rem; height: 20px; align-items: center; border: 1px solid #e5e7eb; background: #f7f7f5; color: #6b6b64;
    font-size: 0.6875rem; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.ag-airtable-audit-badge.is-diff { background: #fdf7e3; border-color: #f0dca6; color: #8a5a0b; }
.ag-airtable-audit-badge.is-airtable_only, .ag-airtable-audit-badge.is-db_only { background: #f0f0ed; border-color: transparent; color: #333; }
.ag-airtable-audit-badge.is-ok { background: #effaf4; border-color: #bbe5cd; color: #1f6b43; }
.ag-airtable-audit-names strong { color: #111; font-size: 0.8125rem; font-weight: 600; }
.ag-airtable-audit-names small { color: #888; }
.ag-airtable-audit-row-actions button:hover { border-color: #e5e7eb; color: #111; }
.ag-airtable-audit-diffs th { color: #b0b0aa; letter-spacing: 0.06em; font-weight: 600; }
.ag-airtable-audit-diffs th, .ag-airtable-audit-diffs td { border-bottom-color: #f0f0ed; }
.ag-airtable-audit-diffs td:nth-child(2) { color: #888; }
.ag-airtable-audit-diffs td:nth-child(3) { color: #111; font-weight: 600; }

[data-modal="airtable"] > div, [data-modal="sync"] > div, [data-modal="header-preview"] > div {
    border: 1px solid #e8e8e5; border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
[data-modal="airtable"] h2, [data-modal="sync"] h2, [data-modal="header-preview"] h2 {
    font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; color: #111;
}
/* =============================================================================
   Fiche société (Agreements) : panneau compact. Les classes co-contact-create-*
   sont partagées avec le Carnet : tout ce qui suit est limité à .ag-entity-create-panel.
   ============================================================================= */
/* La fiche occupe toute la zone de droite, comme une page. */
.ag-entity-create-panel.co-contact-create-panel {
    width: 100%;
    max-width: none;
    align-self: stretch;
    flex: 1 0 auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* En-tête : le logo est la poignée de la fiche */
.ag-ef-head { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.5rem; border-bottom: 1px solid #eeeeeb; background: linear-gradient(180deg, #fbfbfa 0%, #fff 100%); }
.ag-ef-logo { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; border: 1px solid #e3e3df; border-radius: 12px; background: #fff; overflow: hidden; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.ag-ef-logo img { width: 100%; height: 100%; object-fit: contain; padding: 0.3rem; }
.ag-ef-logo:hover { border-color: #b9b9b3; box-shadow: 0 2px 8px rgba(17, 17, 17, 0.08); }
.ag-ef-logo.is-drag { border-color: #111; border-style: dashed; }
.ag-ef-logo.is-new { cursor: default; color: #a3a29c; background: #f5f5f3; }
.ag-ef-logo-empty { font-size: 1.15rem; color: #b4b3ac; }
.ag-ef-logo-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(17, 17, 17, 0.55); color: #fff; font-size: 0.9rem; opacity: 0; transition: opacity 0.15s ease; }
.ag-ef-logo:hover .ag-ef-logo-hover { opacity: 1; }
.ag-ef-logo-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.8); color: #111; }
.ag-ef-head-text { flex: 1; min-width: 0; }
.ag-ef-kicker { margin: 0; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #9a9a93; }
.ag-ef-title { margin: 0.1rem 0 0; font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ef-head-actions { display: flex; align-items: center; gap: 0.9rem; margin-top: 0.3rem; }
.ag-ef-link { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0; border: 0; background: none; font-size: 0.75rem; font-weight: 500; color: #55554f; cursor: pointer; }
.ag-ef-link i { font-size: 0.65rem; color: #a3a29c; }
.ag-ef-link:hover:not(:disabled) { color: #111; text-decoration: underline; text-underline-offset: 2px; }
.ag-ef-link.is-quiet { color: #9a9a93; }
.ag-ef-link:disabled { opacity: 0.5; cursor: default; }

/* Corps : titre de section à gauche, champs à droite, séparés par un filet */
.ag-ef-form { padding: 0 1.5rem; }
.ag-ef-section { display: grid; grid-template-columns: 1fr; gap: 0.75rem 1.75rem; padding: 1.1rem 0; border-top: 1px solid #f0f0ed; }
.ag-ef-section:first-child { border-top: 0; }
@media (min-width: 900px) { .ag-ef-section { grid-template-columns: 12rem minmax(0, 1fr); gap: 0.75rem 2.5rem; } }
.ag-ef-aside h3 { margin: 0; font-size: 0.8125rem; font-weight: 650; color: #191917; }
.ag-ef-aside p { margin: 0.25rem 0 0; font-size: 0.6875rem; line-height: 1.45; color: #9a9a93; }
.ag-entity-create-panel .ag-ef-fields { gap: 0.6rem 0.75rem; }
.ag-entity-create-panel .co-contact-create-field label { margin-bottom: 0.25rem; font-size: 0.6875rem; font-weight: 500; color: #77776f; }
.ag-entity-create-panel .co-contact-create-input,
.ag-entity-create-panel .co-contact-create-field textarea { min-height: 2.125rem; padding: 0.35rem 0.65rem; border-color: #e3e3df; border-radius: 8px; font-size: 0.8125rem; background: #fff; transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.ag-entity-create-panel .co-contact-create-field textarea { min-height: 3.1rem; line-height: 1.4; }
.ag-entity-create-panel .co-contact-create-input:hover,
.ag-entity-create-panel .co-contact-create-field textarea:hover { border-color: #cfcfca; }
.ag-entity-create-panel .co-contact-create-input:focus,
.ag-entity-create-panel .co-contact-create-field textarea:focus { border-color: #111; box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06); }
.ag-entity-create-panel .co-contact-create-input::placeholder,
.ag-entity-create-panel .co-contact-create-field textarea::placeholder { color: #b8b8b2; }
.ag-entity-create-panel .co-contact-create-hint { margin-top: 0.25rem; font-size: 0.6875rem; color: #a8a8a1; }
.ag-entity-create-panel .co-contact-create-input.has-clear { padding-right: 1.9rem; }
.ag-ef-input-clear { position: absolute; right: 0.35rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; border: 0; border-radius: 999px; background: transparent; font-size: 0.6rem; color: #a3a29c; cursor: pointer; }
.ag-ef-input-clear:hover { background: #f0f0ed; color: #111; }

/* Catégories : pastilles, avec la création dans la même rangée */
.ag-ef-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.ag-entity-create-panel .co-contact-create-field label.ag-ef-chip { display: inline-flex; align-items: center; height: 1.65rem; margin: 0; padding: 0 0.7rem; border: 1px solid #e3e3df; border-radius: 999px; background: #fff; font-size: 0.75rem; font-weight: 500; color: #55554f; cursor: pointer; user-select: none; transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease; }
.ag-entity-create-panel .co-contact-create-field label.ag-ef-chip:hover { border-color: #b9b9b3; }
.ag-entity-create-panel .co-contact-create-field label.ag-ef-chip.is-on { border-color: #111; background: #111; color: #fff; }
.ag-ef-chip-new { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.65rem; padding: 0 0.65rem; border: 1px dashed #d4d4d0; border-radius: 999px; color: #a3a29c; font-size: 0.65rem; }
.ag-ef-chip-new:focus-within { border-color: #111; border-style: solid; color: #111; }
.ag-ef-chip-new input { width: 7.5rem; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 0.75rem; color: #111; }
.ag-ef-chip-new input::placeholder { color: #a3a29c; }

/* Alias : sur une ligne, sans cadre */
.ag-entity-create-panel .ag-ef-aliases .ag-entity-aliases { padding: 0; border: 0; background: transparent; }
.ag-entity-create-panel .ag-ef-aliases .ag-entity-typebar-label { margin-right: 0.25rem; }

/* Société associée du portail */
.ag-ef-pill-row { display: flex; align-items: center; min-height: 2.125rem; }
.ag-ef-pill { display: inline-flex; align-items: center; gap: 0.4rem; height: 1.75rem; padding: 0 0.3rem 0 0.7rem; border: 1px solid #e3e3df; border-radius: 999px; background: #f7f7f5; font-size: 0.8125rem; font-weight: 500; color: #191917; }
.ag-ef-pill button { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem; border: 0; border-radius: 999px; background: transparent; font-size: 0.6rem; color: #9a9a93; cursor: pointer; }
.ag-ef-pill button:hover { background: #e8e8e5; color: #111; }

/* Recherche d'entreprise : sélecteur de source en deux segments + champ */
.ag-ef-search-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; }
.ag-ef-seg { display: inline-flex; flex: none; padding: 2px; border: 1px solid #e3e3df; border-radius: 8px; background: #f5f5f3; }
.ag-ef-seg button { padding: 0 0.7rem; border: 0; border-radius: 6px; background: transparent; font-size: 0.75rem; font-weight: 500; color: #77776f; cursor: pointer; white-space: nowrap; }
.ag-ef-seg button.is-on { background: #fff; color: #111; box-shadow: 0 1px 2px rgba(17, 17, 17, 0.1); }

/* Pied : barre ancrée en bas de la zone qui défile */
.ag-entity-create-panel .co-contact-create-footer { position: sticky; bottom: 0; z-index: 20; margin: 0 -1.5rem; padding: 0.65rem 1.5rem; gap: 0.5rem; border-top: 1px solid #eeeeeb; border-radius: 0; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); }
.ag-entity-create-panel .co-contact-create-btn-cancel { padding: 0.4rem 0.9rem; border-color: #e3e3df; border-radius: 8px; }
.ag-entity-create-panel .co-contact-create-btn-save { padding: 0.4rem 1.1rem; border-radius: 8px; }
.ag-entity-create-panel .co-contact-create-close { width: 1.85rem; height: 1.85rem; align-self: flex-start; }
@media (max-width: 639px) {
    .ag-ef-head, .ag-ef-form { padding-left: 0.9rem; padding-right: 0.9rem; }
    .ag-entity-create-panel .co-contact-create-footer { margin: 0 -0.9rem; padding: 0.65rem 0.9rem; }
}

/* Catégories du formulaire d'entité : la pastille cochée est noire, texte blanc (la feuille du panneau imposait un gris). */
.ag-entity-create-panel label.bg-gray-900 { color: #fff; }

/* =============================================================================
   Cockpit Contrats — filtres avancés condensés : une rangée de contrôles à un
   clic (segments, pastilles, listes à cases) au lieu de quatre sections de
   listes déroulantes. Les critères métier ne s'affichent que s'ils ont un sens.
   ========================================================================== */
.ag-contract-more-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 1.1rem; height: 1.1rem; padding: 0 0.3rem;
    border-radius: 999px; background: #111; color: #fff; font-size: 0.6875rem; font-weight: 600; line-height: 1;
}
.ag-ct-card .ag-contract-filter-panel.ag-fp { padding: 0.7rem 0.85rem 0.6rem; border-bottom: 1px solid #e5e7eb; background: #fafaf8; }
.ag-fp-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.7rem 1.15rem; }
.ag-fp-grid--specific { margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid #ecece8; }
.ag-fp-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.ag-fp-field--wide { width: 14rem; }
.ag-fp .admin-combo-trigger { min-height: 2rem; border-radius: 8px; border-color: #d6d6d1; background: #fff; }
.ag-fp .admin-combo-trigger.is-multiple.is-compact { min-height: 2rem; }
.ag-fp-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #b0b0aa; }
.ag-fp-seg { display: inline-flex; align-self: flex-start; height: 2rem; padding: 2px; border-radius: 8px; background: rgba(229, 231, 235, 0.7); }
.ag-fp-seg button {
    height: 1.75rem; padding: 0 0.6rem; border-radius: 6px; background: transparent; color: #6b7280;
    font-size: 0.75rem; white-space: nowrap; transition: background 0.12s, color 0.12s;
}
.ag-fp-seg button:hover:not(.is-on):not(:disabled) { color: #111; }
.ag-fp-seg button.is-on { background: #fff; color: #111; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.ag-fp-seg button:disabled { opacity: 0.45; cursor: default; }
.ag-fp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ag-fp-chip {
    height: 2rem; padding: 0 0.65rem; border: 1px solid #d6d6d1; border-radius: 8px; background: #fff; color: #57574f;
    font-size: 0.75rem; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ag-fp-chip:hover:not(.is-on) { background: #f5f5f3; color: #111; }
.ag-fp-chip.is-on { border-color: #1c1c1a; background: #1c1c1a; color: #fff; }
.ag-fp-range { display: flex; align-items: center; gap: 0.35rem; }
.ag-fp-range > i { font-size: 0.625rem; color: #b0b0aa; }
.ag-fp-range > div { width: 8.5rem; }
.ag-fp-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.55rem; }
.ag-fp-hint { color: #9a9a94; font-size: 0.6875rem; }
.ag-fp-hint i { margin-right: 0.25rem; }
.ag-fp-reset { margin-left: auto; background: none; border: 0; color: #6b6b64; font-size: 0.75rem; font-weight: 500; }
.ag-fp-reset:hover { color: #111; }

/* ═══════════════════════════════════════════════════════════════════
   AG — vue Entité, passe « respiration » (08/10/2026)
   En-tête sur une ligne, KPI en ligne, contacts repliés dans la barre
   d'outils, index numéroté des contrats, sections repliables.
   ═══════════════════════════════════════════════════════════════════ */
.ag-entity-header { padding: 0.6rem 1.25rem; }
.ag-entity-header-main { align-items: center; flex-wrap: wrap; gap: 0.5rem 0.9rem; }
.ag-entity-header-logo, .ag-entity-header-logo-placeholder { width: 2.5rem; height: 2.5rem; border-radius: 8px; }
.ag-entity-header-info { flex: 1 1 14rem; }
.ag-entity-header-title { font-size: 1rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-entity-header-meta {
    margin-top: 0.1rem; font-size: 0.71875rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ag-entity-header .ag-entity-kpis {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
    margin: 0; padding: 0; border-top: 0;
}
.ag-entity-header .ag-entity-kpi {
    display: inline-flex; align-items: baseline; gap: 0.3rem;
    padding: 0.2rem 0.55rem; border: 1px solid #ececea; border-radius: 999px; background: #fafaf8;
}
.ag-entity-header .ag-entity-kpi:first-child, .ag-entity-header .ag-entity-kpi:last-child { padding: 0.2rem 0.55rem; border-right: 1px solid #ececea; }
.ag-entity-header .ag-entity-kpi-val { font-size: 0.8125rem; font-weight: 700; color: #111; font-variant-numeric: tabular-nums; }
.ag-entity-header .ag-entity-kpi-lbl { font-size: 0.6875rem; color: #888; }
.ag-entity-header .ag-entity-kpi.is-zero .ag-entity-kpi-val { color: #b0b0aa; font-weight: 600; }
.ag-entity-header .ag-entity-kpi.is-zero { background: transparent; }

/* Barre d'outils : onglets à gauche, contacts et repli à droite */
.ag-entity-toolbar { padding: 0.4rem 1.25rem; gap: 0.5rem 0.75rem; }
.ag-entity-toolbar-end { margin-left: auto; display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.ag-entity-toolbar-btn {
    display: inline-flex; align-items: center; gap: 0.35rem; height: 1.75rem; padding: 0 0.6rem;
    border: 1px solid #e8e8e5; border-radius: 7px; background: #fff; color: #555;
    font-size: 0.75rem; font-weight: 500; cursor: pointer; flex-shrink: 0;
}
.ag-entity-toolbar-btn:hover { background: #fafaf8; border-color: #ccc; color: #111; }
.ag-entity-toolbar-btn.is-icon { width: 1.75rem; padding: 0; justify-content: center; }
.ag-entity-contacts-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; height: 1.75rem; padding: 0 0.6rem;
    max-width: 22rem; min-width: 0;
    border: 1px solid #e8e8e5; border-radius: 7px; background: #fff; color: #333;
    font-size: 0.75rem; font-weight: 500; cursor: pointer;
}
.ag-entity-contacts-chip:hover, .ag-entity-contacts-chip.is-open { background: #fafaf8; border-color: #ccc; color: #111; }
.ag-entity-contacts-chip > i:first-child { color: #9a9a94; font-size: 0.6875rem; }
.ag-entity-contacts-chip-title { font-weight: 600; flex-shrink: 0; }
.ag-entity-contacts-chip-count {
    flex-shrink: 0; padding: 0 0.35rem; border-radius: 999px; background: #f0f0ed; color: #666;
    font-size: 0.6875rem; font-weight: 600;
}
.ag-entity-contacts-chip-names { min-width: 0; color: #888; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-entity-contacts-chip .ag-entity-contacts-chevron { flex-shrink: 0; color: #b0b0aa; font-size: 0.5625rem; }
.ag-entity-contacts-band { padding: 0.55rem 1.25rem 0.65rem; }
.ag-entity-contacts-panel-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem;
}
@media (max-width: 1100px) {
    .ag-entity-toolbar-btn-label, .ag-entity-contacts-chip-names { display: none; }
}

/* Corps : défilement vertical, geste horizontal réservé au changement d'onglet */
.ag-entity-body { overscroll-behavior-x: contain; padding: 0.75rem 1.25rem 1.25rem; }
.ag-entity-contracts { display: flex; align-items: flex-start; gap: 0.7rem; }
.ag-contract-stack { flex: 1 1 0; min-width: 0; }
/* Piste d'onglets : un panneau par onglet, le geste latéral les fait défiler en continu
   (même mécanique que .sy-editor-track du suivi des synchros). */
.ag-entity-track {
    flex: 1 1 auto; min-height: 0; display: flex;
    overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.ag-entity-track::-webkit-scrollbar { display: none; }
.ag-entity-panel { flex: 0 0 100%; min-width: 0; box-sizing: border-box; scroll-snap-align: start; scroll-snap-stop: always; }

/* Index numéroté des contrats */
.ag-contract-rail {
    position: sticky; top: 0; z-index: 2; flex: 0 0 auto;
    display: flex; flex-direction: column; gap: 0.3rem;
    max-height: calc(100vh - 11rem); overflow-y: auto; scrollbar-width: none;
    /* marge intérieure : l'agrandissement au survol et le bord de la puce courante ne sont plus rognés */
    padding: 0.25rem; margin: -0.25rem;
}
.ag-contract-rail::-webkit-scrollbar { display: none; }
.ag-contract-rail-dot {
    width: 1.6rem; height: 1.6rem; flex-shrink: 0; padding: 0;
    border: 1px solid #d6d6d1; border-radius: 50%; background: #fff; color: #555;
    font-size: 0.6875rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.12s;
}
.ag-contract-rail-dot:hover { border-color: #111; color: #111; background: #f0f0ed; }
.ag-contract-rail-dot.is-active { border-color: #bbe5cd; background: #effaf4; color: #1f6b43; }
.ag-contract-rail-dot.is-nego { border-color: #e9c46a; background: #fdf7e3; color: #8a5a0b; }
.ag-contract-rail-dot.is-inactive { background: #f5f5f3; color: #9a9a94; }
.ag-contract-rail-dot.is-current, .ag-contract-rail-dot.is-current:hover { background: #111; border-color: #111; color: #fff; transform: none; }

/* Carte contrat : en-tête compact, repli */
.ag-contract-detail-titlebar { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.ag-contract-detail-titlebar .ag-contract-detail-title { cursor: pointer; margin: 0; min-width: 0; }
.ag-contract-collapse-btn {
    width: 1.4rem; height: 1.4rem; flex-shrink: 0; padding: 0;
    border: 0; border-radius: 6px; background: transparent; color: #9a9a94; font-size: 0.625rem; cursor: pointer;
}
.ag-contract-collapse-btn:hover { background: #f0f0ed; color: #111; }
.ag-contract-ordinal {
    flex-shrink: 0; min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: #f0f0ed; color: #666;
    font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ag-contract-detail-header-actions .ag-btn-label-wide { display: none; }
.ag-entity-contract-card.is-collapsed .ag-contract-detail-header { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

/* Sections repliables */
.ag-contract-detail .ag-entity-section-title.is-toggle { cursor: pointer; user-select: none; margin-bottom: 0; }
.ag-contract-detail .ag-entity-section-title.is-toggle:hover { color: #111; }
.ag-contract-section-chevron { font-size: 0.5rem; color: #b0b0aa; transition: transform 0.15s; flex-shrink: 0; }
.ag-contract-section-chevron.is-closed { transform: rotate(-90deg); }
.ag-contract-section-body { margin-top: 0.5rem; }
.ag-contract-detail .ag-contract-section-head { align-items: center; }

/* Résumé du contrat plus serré */
.ag-contract-summary { margin-bottom: 0.6rem; }
.ag-contract-summary-col { padding: 0.65rem 0.85rem; }
.ag-contract-summary-head { margin-bottom: 0.45rem; }
.ag-contract-detail-grid { gap: 0.6rem; }

/* ── AG : bloc Contacts liés, version condensée (08/10/2026) ── */
.ag-entity-contacts-band { padding: 0.5rem 1.25rem 0.6rem; }
.ag-entity-contacts-panel-head { margin-bottom: 0.4rem; }
.ag-entity-contacts-panel-actions { display: flex; align-items: center; gap: 0.35rem; }
.ag-entity-contacts-panel-head .ag-entity-btn-ghost { height: 1.75rem; padding: 0 0.6rem; font-size: 0.75rem; }
.ag-entity-btn-ghost.is-square { width: 1.75rem; padding: 0; justify-content: center; }

.ag-contact-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(23rem, 1fr)); gap: 0.35rem;
}
.ag-contact-row {
    display: flex; align-items: center; gap: 0.55rem; min-width: 0;
    padding: 0.35rem 0.5rem; border: 1px solid #ececea; border-radius: 8px; background: #fff;
    transition: border-color 0.12s;
}
.ag-contact-row:hover { border-color: #cfcfca; }
.ag-contact-avatar {
    width: 1.5rem; height: 1.5rem; flex-shrink: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #f0f0ed; color: #9a9a94; font-size: 0.625rem;
}
.ag-contact-main { flex: 1 1 0; min-width: 0; }
.ag-contact-name { font-size: 0.75rem; font-weight: 600; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-contact-sub { font-size: 0.6875rem; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.ag-contact-roles { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.2rem; max-width: 45%; flex-shrink: 0; }
.ag-contact-role { padding: 0 0.4rem; border-radius: 999px; background: #f0f0ed; color: #555; font-size: 0.625rem; line-height: 1.25rem; }
.ag-contact-actions { display: flex; align-items: center; gap: 0.1rem; flex-shrink: 0; opacity: 0; transition: opacity 0.12s; }
.ag-contact-row:hover .ag-contact-actions, .ag-contact-row:focus-within .ag-contact-actions { opacity: 1; }
.ag-contact-action { width: 1.5rem; height: 1.5rem; border: 0; border-radius: 6px; background: transparent; color: #9a9a94; cursor: pointer; }
.ag-contact-action:hover { background: #f0f0ed; color: #111; }
.ag-contact-action.is-danger:hover { background: #fef2f2; color: #dc2626; }

/* Éditeur (lier un contact existant / en créer un) */
.ag-contact-editor {
    margin-bottom: 0.5rem; padding: 0.55rem 0.7rem;
    border: 1px solid #e8e8e5; border-radius: 10px; background: #fafaf8;
}
.ag-contact-editor-grid {
    display: grid; grid-template-columns: 1fr; gap: 0.5rem 0.8rem; align-items: start;
}
@media (min-width: 1024px) {
    .ag-contact-editor-grid { grid-template-columns: minmax(12rem, 1fr) minmax(16rem, 1.8fr) auto; }
}
.ag-contact-editor label.block { margin-bottom: 0.2rem; }
.ag-contact-editor-extra { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.4rem; }

/* Crayon de renommage d'une version dans la liste : discret jusqu'au survol de la ligne. */
.bu-version-rename {
    margin-left: 0.5rem;
    padding: 0.1rem 0.3rem;
    color: #b8b8b2;
    opacity: 0;
    transition: opacity 0.12s, color 0.12s;
}
.bu-version-row:hover .bu-version-rename,
.bu-version-rename:focus-visible {
    opacity: 1;
}
.bu-version-rename:hover {
    color: #111;
}

/* ── Music Recordings — admin ────────────────────────────────────────────────
   Même vocabulaire que le catalogue Audiovisual Programs : contrôles h-9, gris
   neutres, pastilles slate. Classes propres (pas de dépendance au Tailwind du
   navigateur, qui ne génère une règle qu'après avoir vu la classe). */
.mr-input {
    height: 2.25rem; border: 1px solid #d1d5db; border-radius: 0.5rem; background: #fff;
    padding: 0 0.75rem; font-size: 0.8125rem; color: #111827; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s;
}
.mr-input:focus { outline: none; border-color: #9ca3af; box-shadow: 0 0 0 1px #9ca3af; }
textarea.mr-input { height: auto; padding: 0.5rem 0.75rem; }
/* Filtres de la barre d'outils : le Combobox mutualisé (habillage admin) à la taille des autres champs Music Recordings. */
.mr-combo { min-width: 0; }
.mr-combo .admin-combo-trigger {
    height: 2.25rem; padding: 0 0.75rem; background: #fff; border: 1px solid #d1d5db; border-radius: 0.5rem;
    font-size: 0.8125rem; color: #111827; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.mr-combo .admin-combo-trigger:hover:not(:disabled) { background: #fff; border-color: #9ca3af; }
.mr-combo .admin-combo-trigger:focus-visible { background: #fff; border-color: #9ca3af; box-shadow: 0 0 0 1px #9ca3af; }
.mr-btn {
    display: inline-flex; height: 2.25rem; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap;
    border: 1px solid #d1d5db; border-radius: 0.5rem; background: #fff; padding: 0 0.75rem;
    font-size: 13px; font-weight: 500; color: #374151; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s, border-color 0.15s; cursor: pointer;
}
.mr-btn:hover { border-color: #9ca3af; background: #f9fafb; }
.mr-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mr-btn-primary { background: #334155; border-color: #334155; color: #fff; }
.mr-btn-primary:hover { background: #1e293b; border-color: #1e293b; }
.mr-btn-sm { height: 1.75rem; padding: 0 0.5rem; font-size: 11px; border-radius: 0.375rem; gap: 0.375rem; }
.mr-btn-danger { color: #b91c1c; }
.mr-btn-danger:hover { background: #fef2f2; border-color: #fecaca; }
.mr-icon-btn {
    display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center;
    border-radius: 0.375rem; color: #6b7280; transition: background-color 0.15s, color 0.15s; cursor: pointer;
}
.mr-icon-btn:hover { background: #eff6ff; color: #2563eb; }
.mr-icon-btn.is-danger:hover { background: #fef2f2; color: #dc2626; }
.mr-chip {
    display: inline-flex; height: 18px; max-width: 100%; flex-shrink: 0; align-items: center; gap: 0.25rem;
    border: 1px solid #e2e8f0; border-radius: 0.25rem; background: #fff; padding: 0 0.375rem;
    font-size: 11px; line-height: 1; color: #475569; white-space: nowrap;
}
.mr-chip-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 9999px; }
.mr-entity-required.is-required > :first-child { border-radius: 0.5rem; box-shadow: 0 0 0 1px #f59e0b; }
.mr-view-tab {
    border-radius: 0.5rem; padding: 0.375rem 0.75rem; font-size: 13px; font-weight: 500; color: #4b5563;
    transition: background-color 0.15s, color 0.15s; cursor: pointer;
}
.mr-view-tab:hover { background: #f3f4f6; color: #111827; }
.mr-view-tab.is-active { background: #334155; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.mr-panel-tab {
    position: relative; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 0.375rem; white-space: nowrap;
    border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 0.5rem 0.75rem;
    font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #64748b;
    transition: color 0.15s, border-color 0.15s; cursor: pointer;
}
.mr-panel-tab:hover { border-bottom-color: #cbd5e1; color: #334155; }
.mr-panel-tab.is-active { border-bottom-color: #64748b; color: #1e293b; }
.mr-panel-tab-count {
    border-radius: 9999px; background: #f1f5f9; padding: 0 0.375rem; font-size: 10px; font-weight: 600;
    line-height: 1.4; color: #64748b; font-variant-numeric: tabular-nums;
}
.mr-th { position: sticky; top: 0; z-index: 30; height: 2.75rem; background: #f9fafb; padding: 0 0.75rem; text-align: left; font-weight: 500; color: #6b7280; box-shadow: inset 0 -1px 0 #e5e7eb; }
.mr-th-handle { position: absolute; top: 0; bottom: 0; right: -3px; width: 6px; cursor: col-resize; z-index: 11; }
.mr-th-handle::after { content: ''; position: absolute; top: 0.5rem; bottom: 0.5rem; right: 2px; width: 1px; background: #9ca3af; opacity: 0; transition: opacity 0.15s; }
.mr-th:hover .mr-th-handle::after { opacity: 1; }
.mr-th-grip { position: absolute; left: 0; z-index: 10; cursor: move; opacity: 0; transition: opacity 0.2s; color: #9ca3af; font-size: 12px; }
.mr-th:hover .mr-th-grip { opacity: 1; }
.mr-th.is-drop-target { box-shadow: inset 2px 0 0 #334155, inset 0 -1px 0 #e5e7eb; }
.mr-row { height: 3.5rem; border-bottom: 1px solid #f3f4f6; transition: background-color 0.15s; }
.mr-row:hover { background: rgba(249, 250, 251, 0.8); }
.mr-row.is-open { background: #fff; }
.mr-cell-fade { display: flex; min-width: 0; align-items: center; gap: 0.25rem; overflow: hidden; }
.mr-cell-tags {
    display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 4px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent 100%);
}
.mr-chip-tag { position: relative; max-width: 130px; }
.mr-chip-x { display: none; flex-shrink: 0; color: #94a3b8; font-size: 12px; line-height: 1; cursor: pointer; }
.mr-chip-tag:hover .mr-chip-x { display: inline; }
.mr-chip-x:hover { color: #dc2626; }
.mr-chip-add {
    display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; align-items: center; justify-content: center;
    border: 1px dashed #cbd5e1; border-radius: 0.25rem; font-size: 11px; line-height: 1; color: #94a3b8;
    transition: border-color 0.15s, color 0.15s; cursor: pointer; background: transparent;
}
.mr-chip-add:hover { border-color: #94a3b8; color: #475569; }
.mr-chip-btn { cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.mr-chip-btn:hover, .mr-chip-btn.is-open { border-color: #94a3b8; background: #f8fafc; }
.mr-cell-text { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; color: #4b5563; cursor: text; border-radius: 0.25rem; padding: 2px 4px; margin: 0 -4px; }
.mr-cell-text:hover { background: #f3f4f6; }
.mr-cell-input { width: 100%; height: 1.75rem; border: 1px solid #94a3b8; border-radius: 0.375rem; padding: 0 0.5rem; font-size: 0.875rem; background: #fff; }
.mr-cell-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.25); }
.mr-popover {
    position: fixed; z-index: 130; border: 1px solid #e2e8f0; border-radius: 0.75rem; background: #fff; padding: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}
.mr-popover-title { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #64748b; }
.mr-popover-item { display: flex; width: 100%; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; text-align: left; font-size: 0.8125rem; color: #334155; cursor: pointer; background: transparent; border: 0; }
.mr-popover-item:hover { background: #f1f5f9; }
.mr-popover-item.is-current { font-weight: 600; color: #0f172a; }
/* La poignée de glisser-déposer se pose dans la marge gauche de l'en-tête : le libellé s'écarte au survol. */
.mr-th-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: padding-left 0.2s; }
.mr-th:hover .mr-th-label { padding-left: 16px; }

/* =============================================================================
   Panneau des entités : recherche, filtres et menus (refonte du 15/10/2026)
   Quatre filtres sur une ligne (libellés courts, jamais coupés), menus assez larges pour une ligne,
   coche à droite, menus des deux derniers filtres ouverts vers la gauche.
   ============================================================================= */
.ag-entity-sidebar-search-wrap { margin-bottom: 0.5rem; }
.ag-entity-sidebar-search {
    height: 2.125rem; padding: 0 0.7rem 0 2rem; border: 1px solid #e3e3df; border-radius: 10px; background: #fff;
    font-size: 0.8125rem; color: #191917; transition: border-color .12s, box-shadow .12s;
}
.ag-entity-sidebar-search::placeholder, .ag-entity-indirect-input::placeholder { color: #a8a8a2; }
.ag-entity-sidebar-search:hover { border-color: #d0d0ca; }
.ag-entity-sidebar-search:focus { border-color: #9a9a94; box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.05); }
.ag-entity-sidebar-search-icon, .ag-entity-indirect-icon { left: 0.75rem; font-size: 0.75rem; color: #a8a8a2; }
/* « Explorer le 2e degré » : une ligne discrète, pas un second champ de recherche */
.ag-entity-indirect-filter { margin-bottom: 0.5rem; }
.ag-entity-indirect-input {
    height: 1.75rem; padding: 0 1.75rem 0 2rem; border: 1px dashed #e0e0da; border-radius: 8px; background: transparent;
    font-size: 0.75rem; color: #6c6c67; transition: border-color .12s, background-color .12s;
}
.ag-entity-indirect-input:hover { border-color: #c9c9c3; }
.ag-entity-indirect-input:focus { border: 1px solid #9a9a94; background: #fff; box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.05); }
.ag-entity-filter-bar { gap: 0.4rem; }
.ag-entity-filter-menus { gap: 0.3rem; }
.ag-entity-sidebar-tools { container-type: inline-size; }
/* Chaque filtre prend la largeur de son libellé (jamais « Sect… »), le reste se répartit ; sur un panneau étroit, plus de chevrons. */
.ag-entity-filter-menu-wrap { flex: 1 0 auto; }
.ag-entity-filter-menu-wrap:has(.is-active) { flex: 1 1 5rem; min-width: 0; }
.ag-entity-filter-btn-label { max-width: 10rem; }
@container (max-width: 400px) {
    .ag-entity-filter-menu-btn { padding: 0 0.5rem; }
    .ag-entity-filter-menu-btn i { display: none; }
}
.ag-entity-filter-menu-btn {
    height: 1.875rem; padding: 0 0.5rem 0 0.6rem; border: 1px solid #e3e3df; border-radius: 8px; background: #fff;
    color: #55554f; font-size: 0.75rem; font-weight: 500; gap: 0.3rem;
}
.ag-entity-filter-btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-entity-filter-menu-btn i { font-size: 0.625rem; opacity: 0.5; }
.ag-entity-filter-menu-btn:hover { background: #f7f7f5; border-color: #d0d0ca; }
.ag-entity-filter-menu-btn.is-active i { opacity: 0.8; }
.ag-entity-filter-dropdown {
    min-width: 14.5rem; width: max-content; max-width: 19rem; max-height: 20rem; overflow-y: auto; padding: 0.3rem;
    border: 1px solid #e8e8e5; border-radius: 12px; box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.14), 0 4px 10px -6px rgba(0, 0, 0, 0.08);
}
.ag-entity-filter-menu-wrap:nth-child(n+3) .ag-entity-filter-dropdown { left: auto; right: 0; }
.ag-entity-filter-dropdown-item {
    gap: 0.5rem; padding: 0.42rem 0.6rem; border-radius: 8px; font-size: 0.78125rem; font-weight: 500; color: #302f2a; white-space: nowrap;
}
.ag-entity-filter-dropdown-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ag-entity-filter-dropdown-item i { order: 2; margin-left: auto; width: auto; font-size: 0.6875rem; color: #111; }
.ag-entity-filter-dropdown-item.is-selected, .ag-entity-filter-dropdown-item.is-selected:hover { background: #f3f3f0; color: #111; font-weight: 600; }
.ag-entity-filter-dropdown-item:hover { background: #f8f8f6; }
.ag-entity-filter-clear-icon { width: 1.875rem; height: 1.875rem; border-radius: 8px; }

/* Live Dates : pastille « ? » dans le badge « Annulée » (motif d'annulation au clic) */
/* vertical-align: top + 1px : centre exact dans la ligne de 16px du badge, sans agrandir celui-ci */
.ld-hint { display: inline-flex; vertical-align: top; margin: 1px 0 0 0.25rem; }
.ld-hint-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; padding: 0;
    border: 1px solid currentColor; border-radius: 9999px; background: transparent; color: inherit;
    font-size: 9px; font-weight: 700; line-height: 1; opacity: 0.45; cursor: pointer; text-decoration: none;
    transition: opacity .12s, background-color .12s;
}
.ld-hint-btn:hover, .ld-hint-btn.is-open { opacity: 0.9; background: rgba(0, 0, 0, 0.06); }
.ld-hint-btn:focus-visible { outline: 2px solid #94a3b8; outline-offset: 1px; opacity: 0.9; }
.ld-hint-pop {
    position: fixed; z-index: 400; padding: 0.7rem 0.85rem; border: 1px solid #e3e3df; border-radius: 10px; background: #fff;
    box-shadow: 0 12px 24px -6px rgba(25, 25, 23, 0.14), 0 4px 8px -4px rgba(25, 25, 23, 0.08);
}
.ld-hint-pop-title { margin-bottom: 0.3rem; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8a8a83; }
.ld-hint-pop-text { margin: 0; font-size: 0.8125rem; line-height: 1.45; color: #191917; white-space: pre-line; }

/* ---------- Ads Tracker : le détail d'une publicité ----------
   Même mécanique que la fiche d'une synchro (.sy-editor) : un encart collé à gauche du
   tableau (`position: sticky`, sur la largeur visible). Des onglets se suivent sur une piste
   (défilement horizontal qui s'accroche).
   Sa hauteur est celle du CONTENU de l'onglet affiché (--at-track-h, mesurée par la vue et
   animée), plafonnée à ce qui reste d'écran sous la ligne ouverte (--at-detail-max) : une
   fiche courte ne s'étire pas sur tout l'écran. Au-delà du plafond, l'onglet défile.
   Tout est ici et non en classes Tailwind : l'encart est mesuré et défilé dès l'ouverture,
   avant que le Tailwind du navigateur n'ait généré une classe vue pour la première fois. */
.at-detail-frame {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: var(--at-detail-max, none);
    padding: 6px 10px 8px;
    background: rgba(249, 250, 251, 0.7);
}
.at-detail {
    box-sizing: border-box;
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.at-detail-bar {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-bottom: 1px solid #e5e7eb;
}
.at-detail-track {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    height: var(--at-track-h, auto);
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    transition: height 0.16s ease;
}
.at-detail-track::-webkit-scrollbar { display: none; }
/* Le détail est repeint à chaque cran de défilement : on le garde isolé du reste du tableau. */
.at-detail { contain: layout paint; }
.at-tab {
    box-sizing: border-box;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    max-height: 100%;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: auto;
    scroll-snap-align: start;
    scrollbar-width: thin;
}
/* Les encarts d'une rangée ont la hauteur du plus haut ; chacun grandit selon son contenu. */
.at-tab-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}
@media (min-width: 900px) {
    .at-tab-grid.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .at-tab-grid.is-3 { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1.2fr); }
}
.at-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
}
.at-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 0;
    padding: 8px 10px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.at-card.is-fill { overflow: hidden; }
.at-card-head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 20px;
    margin-bottom: 6px;
}
.at-card-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: #374151;
}
.at-card-meta { font-size: 11px; color: #9ca3af; white-space: nowrap; }
.at-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
    font-size: 11.5px;
    line-height: 1.35;
    color: #0369a1;
    cursor: pointer;
    white-space: nowrap;
}
.at-card-action:hover { text-decoration: underline; }
.at-card-action i { font-size: 9px; }
/* Ce qui peut s'allonger (listes, textes, fil d'échanges) défile dans son encart — à la verticale
   seulement, et le geste n'y reste pas prisonnier : arrivé en haut ou en bas, c'est la page qui
   prend le relais (`overscroll-behavior: auto` des deux côtés — `contain` aurait retenu le geste).
   Pas de défilement latéral propre (`overflow-x: hidden`) : un balayage posé sur un encart passe à
   la piste d'onglets. */
.at-card-scroll {
    flex: 1 1 auto;
    min-height: 0;
    /* Un fil d'échanges ou une liste très longue défile dans son encart plutôt que d'allonger l'onglet. */
    max-height: calc(var(--at-detail-max, 640px) - 110px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: auto;
    scrollbar-width: thin;
}
.at-card-foot { flex-shrink: 0; padding-top: 6px; }
.at-card-empty {
    margin: 0;
    font-size: 11.5px;
    font-style: italic;
    line-height: 1.4;
    color: #9ca3af;
}
/* L'aperçu : la vidéo prend la largeur de l'encart, en 16/9, sans padding-top hérité d'une hauteur. */
.at-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}
.at-media > iframe, .at-media > video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Ads Tracker : colonnes gelées du tableau (case, chevron) ----------
   `position: sticky; left` : elles restent à l'écran quand le tableau défile à l'horizontale.
   Un fond opaque, sans quoi les colonnes qui passent dessous se liraient à travers. */
.at-frozen { position: sticky; z-index: 4; background-color: #fff; }
.at-frozen-head { z-index: 31; background-color: #f9fafb; }
tr.at-campaign-row > .at-frozen { background-color: #f5f6f8; }
tr:hover > .at-frozen:not(.at-frozen-head) { background-color: #fafafa; }
tr.at-campaign-row:hover > .at-frozen { background-color: #f1f2f5; }
/* La colonne Publicité est gelée après la case et le chevron : son `left` vient de la table (--at-frozen-left).
   `!important` : l'en-tête de TableHeader porte `relative`, qui sans cela l'emporterait sur `sticky`. */
.at-frozen-col { position: sticky !important; left: var(--at-frozen-left, 74px); z-index: 4; }
th.at-frozen-col { z-index: 31 !important; }
/* Une séparation très discrète à droite de la dernière colonne gelée : un filet clair en permanence, et —
   dès que le tableau a glissé dessous — un dégradé d'ombre de quelques pixels (`.at-scrolled`, posé par la vue). */
.at-frozen-last { box-shadow: 1px 0 0 #eceef1; }
.at-frozen-last::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: -7px;
    width: 7px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0));
    opacity: 0;
    transition: opacity 0.15s ease;
}
.at-scrolled .at-frozen-last::after { opacity: 1; }

/* ══════════════════════════════════════
   GenDoc — éditeur de contrats (gd-*)
   Sur la coquille admin-tool-* : gris chauds, noir pour l'actif.
══════════════════════════════════════ */
.gd-root .gd-muted { color: #9a9a94; font-size: 0.78rem; }
.gd-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.15rem; height: 1.15rem; border-radius: 999px; font-size: 0.65rem; font-weight: 700;
    background: rgba(0, 0, 0, 0.08); color: inherit;
}
.admin-tool-tab.is-active .gd-step-num { background: rgba(255, 255, 255, 0.2); }
.gd-step-badge {
    min-width: 1.1rem; padding: 0 0.3rem; border-radius: 999px; font-size: 0.65rem; font-weight: 700;
    background: #f59e0b; color: #fff; text-align: center;
}
.gd-step-done { color: #10b981 !important; opacity: 1 !important; }

/* La coquille d'un écran de détail : la barre colle au bandeau, l'éditeur au bas de la fenêtre */
.gd-root > .admin-tool-shell { padding-top: 1rem; }
.gd-root > .admin-tool-shell.gd-shell-detail { padding-top: 0.625rem; }
.gd-root > .admin-tool-shell.gd-shell-editor { padding-bottom: 0.625rem; }

/* La barre d'un contrat, d'une matrice, d'un récapitulatif ou d'un bloc : une seule ligne */
.gd-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; padding: 0.3rem 0.4rem;
    background: #fff; border: 1px solid #e8e8e5; border-radius: 10px;
}
.gd-bar .admin-tool-btn-secondary, .gd-bar .admin-tool-btn-primary { padding-top: 0.35rem; padding-bottom: 0.35rem; white-space: nowrap; }
.gd-bar-back { flex: none; }
.gd-bar-title { display: flex; align-items: center; gap: 0.4rem; flex: 1 1 14rem; min-width: 0; }
.gd-bar-title > .gd-tag, .gd-bar-title > .gd-pill, .gd-bar-title > .gd-bar-pen { flex: none; }
.gd-bar-pen { font-size: 0.6rem; color: #c4c4c0; opacity: 0; transition: opacity 0.14s; }
.gd-bar-title:hover .gd-bar-pen { opacity: 1; }
.gd-bar-nav, .gd-bar-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.gd-bar .admin-tool-tabs { flex-wrap: nowrap; gap: 0.15rem; padding: 0.15rem; background: #f5f5f3; border-color: transparent; }
.gd-bar .admin-tool-tab { padding: 0.3rem 0.7rem; }
/* Le champ du titre prend la largeur de son texte (le pseudo-élément la mesure), coupé par « … » faute de place */
.gd-bar-name { display: inline-grid; grid-template-columns: minmax(0, max-content); flex: 0 1 auto; min-width: 0; }
.gd-bar-name::after {
    content: attr(data-value) ' '; grid-area: 1 / 1; visibility: hidden; white-space: pre; overflow: hidden;
    padding: 0 calc(0.4rem + 1px); font-size: 0.95rem; font-weight: 700;
}
.gd-bar-name > .gd-title-input { grid-area: 1 / 1; margin-left: 0; padding: 0.2rem 0.4rem; font-size: 0.95rem; text-overflow: ellipsis; }
.gd-bar-static { min-width: 0; padding: 0.2rem 0.4rem; font-size: 0.95rem; font-weight: 700; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-bar-info { position: relative; flex: none; }
.gd-bar-info > .gd-icon-btn { color: #b0b0aa; }
.gd-bar-info > .gd-icon-btn.is-on { background: #f2f2f0; color: #111; }
.gd-bar-pop { width: 22rem; padding: 0.7rem 0.8rem; font-size: 0.78rem; color: #555; cursor: default; }
.gd-bar-desc { margin-bottom: 0.55rem; line-height: 1.4; color: #333; }
.gd-bar-desc.is-empty { color: #b0b0aa; font-style: italic; }
.gd-bar-facts { display: flex; flex-direction: column; gap: 0.25rem; color: #777; }
.gd-bar-pop-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.65rem; padding-top: 0.6rem; border-top: 1px solid #f0f0ed; }
.gd-bar-combo { flex: 0 1 16rem; min-width: 9rem; }
@media (max-width: 1520px) { .gd-bar-actions .gd-bar-label { display: none; } }
@media (max-width: 1360px) { .gd-tpl .gd-bar .admin-tool-tab:not(.is-active) .gd-bar-label { display: none; } }
@media (max-width: 1100px) { .gd-bar-back .gd-bar-label { display: none; } }

.gd-title-input {
    width: 100%; min-width: 0; padding: 0.15rem 0.5rem; margin-left: -0.5rem; font-size: 1.05rem; font-weight: 700;
    color: #111; background: transparent; border: 1px solid transparent; border-radius: 6px; outline: none;
}
.gd-title-input:hover { border-color: #e8e8e5; }
.gd-title-input:focus { border-color: #ccc; background: #fff; }
.gd-tag {
    display: inline-flex; align-items: center; padding: 0.05rem 0.4rem; border-radius: 5px; font-size: 0.66rem; font-weight: 600;
    background: #f0f0ed; color: #666;
}
.gd-tag.is-warn { background: #fef3c7; color: #92400e; }
.gd-pill {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border-radius: 999px;
    font-size: 0.7rem; font-weight: 600; white-space: nowrap;
}
.gd-pill i { font-size: 0.6rem; }
.gd-pill-draft { background: #f2f2f0; color: #555; }
.gd-pill-ready { background: #e0f2fe; color: #075985; }
.gd-pill-sent { background: #fef3c7; color: #92400e; }
.gd-pill-signed { background: #dcfce7; color: #166534; }
.gd-pill-cancelled { background: #fee2e2; color: #991b1b; }
.gd-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 1.85rem; height: 1.85rem;
    border-radius: 6px; border: 1px solid transparent; background: transparent; color: #777; cursor: pointer; font-size: 0.75rem;
}
.gd-icon-btn:hover:not(:disabled) { background: #f2f2f0; border-color: #e8e8e5; color: #111; }
.gd-icon-btn:disabled { opacity: 0.3; cursor: default; }
.gd-icon-btn.is-danger:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.gd-menu {
    position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 12rem; padding: 0.3rem;
    background: #fff; border: 1px solid #e8e8e5; border-radius: 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.gd-menu-right { left: auto; right: 0; }
.gd-menu > button {
    display: flex; align-items: center; gap: 0.5rem; width: 100%; padding: 0.45rem 0.6rem; border: none; border-radius: 6px;
    background: transparent; font-size: 0.8rem; color: #333; text-align: left; cursor: pointer;
}
.gd-menu > button i { width: 1rem; color: #999; }
.gd-menu > button:hover { background: #f5f5f3; }
.gd-menu > button.is-on { background: #f2f2f0; color: #111; font-weight: 600; }
.gd-menu > button.is-on i { color: #111; }
.gd-menu > button.is-danger { color: #b91c1c; }
.gd-menu > button.is-danger i { color: #ef4444; }
.gd-link-btn { color: #111; font-weight: 600; text-decoration: underline; background: none; border: none; padding: 0; cursor: pointer; }
.gd-seg button i { margin-right: 0.25rem; font-size: 0.7rem; }

/* ── L'éditeur ── */
.gd-editor {
    position: relative; display: flex; flex-direction: column; height: var(--gd-fit-h, calc(100vh - 215px)); min-height: 420px;
    background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; overflow: hidden;
}
.gd-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; padding: 0.4rem 0.5rem;
    background: #fafaf8; border-bottom: 1px solid #ececea; z-index: 5;
}
.gd-tb-group { position: relative; display: flex; align-items: center; gap: 0.1rem; padding-right: 0.35rem; margin-right: 0.15rem; border-right: 1px solid #e8e8e5; }
.gd-tb-group:last-child, .gd-tb-end { border-right: none; }
.gd-tb-end { margin-left: auto; }
.gd-tb-btn {
    display: inline-flex; align-items: center; gap: 0.35rem; height: 1.9rem; min-width: 1.9rem; padding: 0 0.45rem;
    border: 1px solid transparent; border-radius: 6px; background: transparent; color: #444; font-size: 0.78rem; cursor: pointer;
}
.gd-tb-btn i { font-size: 0.78rem; }
.gd-tb-btn:hover:not(:disabled) { background: #efefec; }
.gd-tb-btn.is-on { background: #111; color: #fff; }
.gd-tb-btn.is-on:hover:not(:disabled) { background: #111; }
.gd-tb-count { font-size: 0.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.gd-tb-btn:disabled { opacity: 0.3; cursor: default; }
.gd-tb-btn.is-danger:hover { background: #fef2f2; color: #b91c1c; }
.gd-tb-accent { border-color: #e2e2de; background: #fff; font-weight: 600; }
.gd-tb-accent:hover:not(:disabled) { border-color: #ccc; background: #fff; }
.gd-tb-select {
    height: 1.9rem; padding: 0 0.4rem; border: 1px solid #e2e2de; border-radius: 6px; background: #fff;
    font-size: 0.78rem; color: #333; cursor: pointer;
}
.gd-tb-style { width: 9.5rem; }
.gd-tb-size { width: 5.6rem; }
/* La barre d'outils tient sur une ligne : les libellés s'effacent quand la fenêtre rétrécit */
@media (max-width: 1400px) {
    .gd-toolbar { gap: 0.15rem; }
    .gd-tb-style { width: 7.25rem; }
    .gd-tb-size { width: 5.3rem; }
    .gd-tb-accent.gd-tb-minor > span { display: none; }
}
@media (max-width: 1200px) { .gd-tb-accent > span { display: none; } }
.gd-tb-drop { position: relative; display: inline-flex; }
.gd-tb-caret { gap: 0.25rem; }
.gd-tb-caret i:last-child { font-size: 0.5rem; color: #999; }
.gd-tb-color { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.gd-tb-color span { display: block; width: 0.9rem; height: 0.18rem; margin-top: 0.12rem; border-radius: 2px; }
.gd-swatches { display: flex; flex-wrap: wrap; gap: 0.3rem; width: 11rem; min-width: 0; padding: 0.5rem; }
.gd-swatch { width: 1.5rem; height: 1.5rem; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.12); cursor: pointer; }
.gd-swatch:hover { transform: scale(1.1); }
.gd-swatch-reset { width: 100%; margin-top: 0.2rem; padding: 0.3rem; border: 1px solid #e8e8e5; border-radius: 6px; background: #fff; font-size: 0.72rem; cursor: pointer; }
.gd-grid-picker { min-width: 0; padding: 0.5rem; }
.gd-grid { display: grid; grid-template-columns: repeat(6, 1rem); gap: 3px; }
.gd-grid-cell { width: 1rem; height: 1rem; border: 1px solid #ddd; border-radius: 2px; background: #fff; cursor: pointer; }
.gd-grid-cell.is-on { background: #111; border-color: #111; }
.gd-grid-label { margin-top: 0.35rem; font-size: 0.7rem; color: #888; text-align: center; }
.gd-findbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; padding: 0.3rem 0.5rem;
    background: #f5f5f3; border-bottom: 1px solid #ececea; font-size: 0.75rem;
}
.gd-tablebar {
    position: absolute; z-index: 4; transform: translateX(-50%); display: flex; flex-wrap: nowrap; align-items: center; gap: 0.2rem;
    width: max-content; max-width: calc(100% - 1rem); padding: 0.2rem 0.4rem; overflow-x: auto; white-space: nowrap;
    background: #fff; border: 1px solid #e2e2df; border-radius: 9px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); font-size: 0.75rem;
}
.gd-tablebar-label { margin-right: 0.35rem; font-weight: 600; color: #666; }
.gd-tablebar-sep { width: 1px; height: 1.2rem; margin: 0 0.25rem; background: #e2e2de; }
.gd-find-input { height: 1.8rem; width: 12rem; padding: 0 0.5rem; border: 1px solid #e2e2de; border-radius: 6px; font-size: 0.78rem; outline: none; }
.gd-find-input:focus { border-color: #bbb; }
.gd-find-count { min-width: 3rem; color: #888; font-variant-numeric: tabular-nums; }
.gd-find-case { display: inline-flex; align-items: center; gap: 0.2rem; margin-right: 0.4rem; color: #666; }
.gd-canvas { flex: 1; overflow: auto; padding: 1.25rem 1rem 3rem; background: #ebebe8; }
.gd-page {
    box-sizing: border-box; width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; color: #111;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
}
.gd-page-host, .gd-page-host .ProseMirror { min-height: calc(297mm - 36mm); outline: none; }
.gd-statusbar {
    display: flex; align-items: center; gap: 1rem; padding: 0.3rem 0.75rem; font-size: 0.72rem; color: #888; white-space: nowrap;
    background: #fafaf8; border-top: 1px solid #ececea;
}
.gd-status-missing { color: #b45309; font-weight: 600; cursor: pointer; }
.gd-status-saving { color: #666; }
.gd-status-meta { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #a8a8a2; }
.gd-status-end { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; flex: none; }
.gd-status-end .gd-strip-label { color: #888; }
.gd-status-end .admin-tool-segmented button { padding: 0.1rem 0.5rem; font-size: 0.7rem; }
.gd-status-end .gd-chip-static { max-width: 10rem; }
.gd-status-end .gd-search-inline { min-width: 11rem; }
.gd-status-end .gd-search-inline > input { height: 1.5rem; font-size: 0.72rem; }
.gd-status-end .gd-search-results { top: auto; bottom: calc(100% + 4px); left: auto; width: 24rem; white-space: normal; }
.gd-status-zoom { display: inline-flex; align-items: center; gap: 0.35rem; flex: none; }
.gd-status-zoom button { width: 1.3rem; height: 1.3rem; border: 1px solid #e2e2de; border-radius: 4px; background: #fff; font-size: 0.6rem; cursor: pointer; }

/* Le texte (éditeur, aperçu) : au plus près du Word produit. */
.gd-prose { word-wrap: break-word; }
.gd-prose p { margin: 0 0 var(--gd-p-after, 0); min-height: 1em; }
.gd-prose h1, .gd-prose h2, .gd-prose h3 {
    margin: calc(var(--gd-p-after, 0) * 2) 0 var(--gd-p-after, 0); font-size: 1em; font-weight: 700; line-height: inherit;
}
.gd-prose h1 { font-size: 1.36em; }
.gd-prose h2 { text-decoration: underline; }
.gd-prose ul, .gd-prose ol { margin: 0 0 var(--gd-p-after, 0); padding-left: 0.65cm; }
.gd-prose ul { list-style: none; }
.gd-prose ul > li { position: relative; }
.gd-prose ul > li::before { content: '–'; position: absolute; left: -0.55cm; }
.gd-prose ul ul > li::before { content: '•'; }
.gd-prose ul ul ul > li::before { content: '◦'; }
.gd-prose ol { list-style: decimal; }
.gd-prose ol ol { list-style: lower-alpha; }
.gd-prose ol ol ol { list-style: lower-roman; }
.gd-prose li > p { margin: 0; }
.gd-prose table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0; }
.gd-prose td, .gd-prose th { position: relative; border: 1px solid #000; padding: 1mm 1.9mm; vertical-align: top; box-sizing: border-box; }
.gd-prose th { font-weight: 700; text-align: left; }
.gd-prose td p, .gd-prose th p { margin: 0; }
.gd-prose table[data-borders="none"] td, .gd-prose table[data-borders="none"] th { border-color: transparent; }
.ProseMirror.gd-prose table[data-borders="none"] td, .ProseMirror.gd-prose table[data-borders="none"] th { border: 1px dashed #e2e2de; }
.gd-prose .tableWrapper { overflow-x: auto; }
.gd-prose .selectedCell::after { content: ''; position: absolute; inset: 0; background: rgba(59, 130, 246, 0.12); pointer-events: none; }
.gd-prose .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: -2px; width: 4px; background: #3b82f6; pointer-events: none; }
.gd-prose.resize-cursor { cursor: col-resize; }
.gd-prose mark { border-radius: 1px; padding: 0 1px; color: inherit; }
.gd-prose hr { border: none; border-top: 1px solid #999; margin: 0.5em 0; }
.gd-prose .gd-pagebreak, .gd-prose div[data-gd-pagebreak] {
    position: relative; height: 1.4em; margin: 0.4em 0; border-top: 1px dashed #bbb;
}
.ProseMirror .gd-pagebreak::after {
    content: 'Saut de page'; position: absolute; top: -0.65em; left: 50%; transform: translateX(-50%);
    padding: 0 0.5em; background: #fff; color: #aaa; font: 600 0.62rem/1.2 Inter, sans-serif; letter-spacing: 0.05em; text-transform: uppercase;
}
.ProseMirror .gd-pagebreak.ProseMirror-selectednode { border-top-color: #111; }
.gd-page-static .gd-pagebreak { border-top-style: dotted; }
.gd-prose p.is-editor-empty:first-child::before {
    content: attr(data-placeholder); float: left; height: 0; color: #b5b5b0; pointer-events: none;
}
.gd-prose [data-gd-missing] { background: #fde047; }

/* Pastilles de champ */
.gd-chip {
    display: inline; padding: 0.05em 0.2em; margin: 0; border-radius: 4px; cursor: pointer;
    background: #eef2ff; color: #3730a3; box-shadow: inset 0 0 0 1px #c7d2fe; font-size: 0.92em;
    white-space: pre-wrap; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.gd-chip:hover { box-shadow: inset 0 0 0 1px #818cf8; }
.gd-chip.is-value { background: #f0fdf4; color: inherit; box-shadow: inset 0 0 0 1px #bbf7d0; font-size: 1em; }
.gd-chip.is-value:hover { box-shadow: inset 0 0 0 1px #4ade80; }
.gd-chip.is-missing { background: #fef3c7; color: #92400e; box-shadow: inset 0 0 0 1px #fbbf24; }
.gd-chip.is-missing::before { content: '⚠ '; }
.gd-chip.is-unknown { background: #fee2e2; color: #991b1b; box-shadow: inset 0 0 0 1px #fca5a5; }
.gd-chip.is-selected { box-shadow: inset 0 0 0 2px #111; }
.gd-chip.is-flash, .gd-field.is-flash { animation: gd-flash 1.2s ease; }
@keyframes gd-flash { 0%, 60% { outline: 3px solid #f59e0b; outline-offset: 2px; } 100% { outline: 3px solid transparent; } }

/* Blocs : clause conditionnelle, répétition par œuvre */
.gd-block { position: relative; margin: 0.35em 0 0.35em -0.6em; padding: 0 0 0.15em 0.55em; border-left: 3px solid #a78bfa; border-radius: 2px; }
.gd-block-repeat { border-left-color: #38bdf8; }
.gd-block-head {
    display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.15em; padding: 0.1rem 0.25rem; user-select: none;
    font: 500 0.66rem/1.4 Inter, -apple-system, sans-serif; color: #6d28d9; background: #f5f3ff; border-radius: 4px; width: fit-content; max-width: 100%;
}
.gd-block-repeat > .gd-block-head { color: #0369a1; background: #f0f9ff; }
.gd-block-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-block-sub { color: #8b8b85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-block-btn { border: none; background: transparent; color: inherit; opacity: 0.55; cursor: pointer; padding: 0 0.15rem; font-size: 0.62rem; }
.gd-block-btn:hover { opacity: 1; }
/* Masquée par défaut ; le bouton de la barre d'outils les montre en grisé. */
.gd-editor:not(.show-discarded) .gd-block.is-hidden-on-export { display: none; }
.gd-block.is-hidden-on-export { border-left-color: #d6d3d1; }
.gd-block.is-hidden-on-export > .gd-block-head { color: #a8a29e; background: #f5f5f4; }
.gd-block.is-hidden-on-export > .gd-block-body { opacity: 0.4; background: repeating-linear-gradient(-45deg, transparent 0 6px, rgba(0, 0, 0, 0.03) 6px 12px); }
.gd-page-static .gd-block { border: none; margin: 0; padding: 0; }
.gd-search-hit { background: #fde68a; border-radius: 2px; }
.gd-search-hit.is-current { background: #f59e0b; color: #fff; }

/* Fenêtres flottantes de l'éditeur */
.gd-pop {
    position: absolute; z-index: 70; width: 330px; max-width: calc(100% - 16px); padding: 0.75rem;
    background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
    font-family: Inter, -apple-system, sans-serif; font-size: 0.8rem;
}
.gd-pop-search { width: 100%; height: 2rem; padding: 0 0.6rem; border: 1px solid #e2e2de; border-radius: 7px; outline: none; font-size: 0.8rem; }
.gd-pop-search:focus { border-color: #bbb; }
.gd-picker-list { max-height: 320px; margin-top: 0.4rem; overflow-y: auto; }
.gd-picker-group { margin: 0.5rem 0 0.15rem; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b0b0aa; }
.gd-picker-item {
    display: flex; align-items: baseline; gap: 0.5rem; width: 100%; padding: 0.3rem 0.45rem; border: none; border-radius: 6px;
    background: transparent; text-align: left; cursor: pointer; font-size: 0.8rem; color: #222;
}
.gd-picker-item.is-active { background: #f2f2f0; }
.gd-picker-label { flex-shrink: 0; }
.gd-picker-value { min-width: 0; margin-left: auto; overflow: hidden; color: #9a9a94; font-size: 0.72rem; white-space: nowrap; text-overflow: ellipsis; }
.gd-picker-value.is-missing { color: #d97706; }
.gd-picker-empty { padding: 0.75rem 0.4rem; color: #999; }
.gd-pop-title { font-weight: 700; color: #111; }
.gd-pop-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.2rem 0 0.6rem; }
.gd-pop-meta code { padding: 0.05rem 0.3rem; border-radius: 4px; background: #f5f5f3; font-size: 0.68rem; color: #666; }
.gd-pop-label { display: block; margin-bottom: 0.25rem; font-size: 0.7rem; font-weight: 600; color: #777; }
.gd-pop-hint { font-size: 0.72rem; color: #8b8b85; line-height: 1.4; }
.gd-pop-field { margin-bottom: 0.6rem; }
.gd-pop-value { margin-bottom: 0.6rem; white-space: pre-wrap; }
.gd-pop-actions { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem; }
.gd-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.4rem 0; }
.gd-pop-row .gd-pop-label { margin: 0; }
.gd-pop-links { display: flex; flex-direction: column; gap: 0.1rem; margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid #f0f0ed; }
.gd-pop-links button { display: flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.35rem; border: none; border-radius: 6px; background: transparent; text-align: left; color: #444; cursor: pointer; font-size: 0.78rem; }
.gd-pop-links button:hover { background: #f5f5f3; }
.gd-pop-links button i { width: 0.9rem; color: #999; }
.gd-pop-links button.is-danger { color: #b91c1c; }
.gd-source {
    display: inline-flex; align-items: center; padding: 0 0.35rem; border-radius: 4px; font-size: 0.62rem; font-weight: 600;
    background: #f2f2f0; color: #777; letter-spacing: 0.01em;
}
.gd-source.is-syncs { background: #e0f2fe; color: #075985; }
.gd-source.is-ag { background: #ede9fe; color: #5b21b6; }
.gd-source.is-manual { background: #fef3c7; color: #92400e; }
.gd-source.is-manual-set { background: #111; color: #fff; }
.gd-source.is-computed { background: #f0fdf4; color: #166534; }

/* ── Étape Données ── */
.gd-data { display: flex; flex-direction: column; gap: 0.75rem; }
.gd-data-summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding: 0.6rem 0.9rem; border-radius: 10px; font-size: 0.8rem;
}
.gd-data-summary.is-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.gd-data-summary.is-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.gd-data-jump {
    margin: 0 0.15rem; padding: 0.05rem 0.4rem; border: 1px solid #fcd34d; border-radius: 5px; background: #fff;
    font-size: 0.72rem; color: #92400e; cursor: pointer;
}
.gd-data-jump:hover { background: #fef3c7; }
.gd-data-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0.75rem; }
@media (max-width: 1100px) { .gd-data-grid { grid-template-columns: minmax(0, 1fr); } }
.gd-card { padding: 0.9rem 1rem; }
.gd-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.65rem; }
.gd-card-head h3 { display: flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 0.88rem; font-weight: 700; color: #111; }
.gd-card-head h3 i { font-size: 0.75rem; color: #a3a39d; }
.gd-links { display: flex; flex-direction: column; gap: 0.3rem; }
.gd-link { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.55rem; border: 1px solid #f0f0ed; border-radius: 8px; background: #fafaf8; }
.gd-link-num { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 999px; background: #111; color: #fff; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }
.gd-link-title { font-weight: 600; font-size: 0.82rem; color: #111; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-link-sub { display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.7rem; color: #9a9a94; }
.gd-suggest { margin-top: 0.6rem; }
.gd-suggest-title { font-size: 0.7rem; font-weight: 700; color: #b45309; margin-bottom: 0.25rem; }
.gd-suggest-item {
    display: inline-flex; align-items: center; gap: 0.35rem; margin: 0 0.3rem 0.3rem 0; padding: 0.25rem 0.55rem; border: 1px dashed #e2e2de;
    border-radius: 7px; background: #fff; font-size: 0.75rem; color: #333; cursor: pointer;
}
.gd-suggest-item:hover { border-color: #111; }
.gd-search { position: relative; display: flex; align-items: center; margin-top: 0.6rem; }
.gd-search > i { position: absolute; left: 0.65rem; font-size: 0.72rem; color: #aaa; pointer-events: none; }
.gd-search > input { width: 100%; padding-left: 1.9rem; }
.gd-search-inline { margin-top: 0; min-width: 16rem; }
.gd-search-results {
    position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto; padding: 0.25rem;
    background: #fff; border: 1px solid #e8e8e5; border-radius: 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.gd-search-item {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; width: 100%; padding: 0.4rem 0.55rem; border: none; border-radius: 6px;
    background: transparent; text-align: left; font-size: 0.8rem; color: #222; cursor: pointer;
}
.gd-search-item:hover:not(:disabled) { background: #f5f5f3; }
.gd-search-item:disabled { opacity: 0.5; cursor: default; }
.gd-callout {
    display: flex; gap: 0.6rem; margin-top: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 8px;
    background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; font-size: 0.78rem;
}
.gd-callout > i { margin-top: 0.15rem; }
.gd-callout.is-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.gd-party { padding: 0.5rem 0; border-bottom: 1px solid #f2f2f0; }
.gd-party:last-child { border-bottom: none; }
.gd-party-role { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b0b0aa; }
.gd-party-name { font-size: 0.92rem; font-weight: 600; color: #111; }
.gd-candidate {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.6rem; border: 1px solid #e2e2de; border-radius: 7px;
    background: #fff; font-size: 0.76rem; cursor: pointer;
}
.gd-candidate:hover { border-color: #111; }
.gd-candidate i { font-size: 0.65rem; color: #999; }
.gd-badge-missing { padding: 0.05rem 0.45rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 0.68rem; font-weight: 700; }
.gd-subtitle { margin: 0.6rem 0 0.4rem; font-size: 0.78rem; font-weight: 700; color: #444; }
.gd-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.65rem 0.9rem; }
.gd-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.15rem; border-radius: 7px; }
.gd-field.is-wide { grid-column: 1 / -1; }
.gd-field.is-missing .admin-tool-input { border-color: #fbbf24; background: #fffbeb; }
.gd-field.is-unused { opacity: 0.6; }
.gd-field-label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.72rem; font-weight: 600; color: #666; }
.gd-field-computed { padding: 0.45rem 0.6rem; border-radius: 7px; background: #f5f5f3; font-size: 0.8rem; color: #333; white-space: pre-wrap; }
.gd-field-computed.is-empty { color: #bbb; }
.gd-field-preview { font-size: 0.72rem; color: #166534; }
.gd-field-hint { font-size: 0.68rem; color: #a3a39d; }
.gd-field-reset { align-self: flex-start; border: none; background: none; padding: 0; font-size: 0.68rem; color: #777; cursor: pointer; text-align: left; }
.gd-field-reset:hover { color: #111; text-decoration: underline; }
.gd-address { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.gd-address .gd-field-preview { width: 100%; }
.gd-more { margin-top: 0.6rem; border: none; background: none; padding: 0; font-size: 0.74rem; color: #666; text-decoration: underline; cursor: pointer; }

/* ── Étape Export et suivi ── */
.gd-export { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.gd-export > section:first-child, .gd-export > section:nth-child(4), .gd-export > section:nth-child(5) { grid-column: 1 / -1; }
@media (max-width: 1000px) { .gd-export { grid-template-columns: minmax(0, 1fr); } }
.gd-export-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.gd-export-btn {
    display: flex; align-items: center; gap: 0.75rem; min-width: 12rem; padding: 0.75rem 1rem; border: 1px solid #e8e8e5; border-radius: 10px;
    background: #fff; text-align: left; cursor: pointer; transition: border-color 0.14s, box-shadow 0.14s;
}
.gd-export-btn:hover:not(:disabled) { border-color: #111; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06); }
.gd-export-btn:disabled { opacity: 0.5; cursor: wait; }
.gd-export-btn > i { font-size: 1.5rem; }
.gd-export-btn span { display: flex; flex-direction: column; }
.gd-export-btn strong { font-size: 0.88rem; color: #111; }
.gd-export-btn small { font-size: 0.7rem; color: #999; }
.gd-status-seg { flex-wrap: wrap; }
.gd-status-seg button { padding: 0.45rem 0.8rem; }
.gd-esign { background: repeating-linear-gradient(-45deg, #fff 0 10px, #fbfbfa 10px 20px); }
.gd-format { display: inline-flex; padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.65rem; font-weight: 700; color: #fff; }
.gd-format.is-docx { background: #2b579a; }
.gd-format.is-pdf { background: #c2410c; }
.gd-events { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.78rem; }
.gd-events li { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.gd-event-when { width: 9.5rem; flex-shrink: 0; color: #9a9a94; font-variant-numeric: tabular-nums; }
.gd-event-what { flex: 1; min-width: 0; color: #333; }

/* Aperçu */
.gd-preview-backdrop { z-index: 80; }
.gd-preview {
    display: flex; flex-direction: column; width: min(1000px, calc(100vw - 2rem)); height: calc(100vh - 3rem); margin: 1.5rem auto;
    background: #ebebe8; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.gd-preview-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; background: #fff; border-bottom: 1px solid #e8e8e5; font-size: 0.85rem; }
.gd-preview-body { flex: 1; overflow: auto; padding: 1.25rem; }
.gd-preview-body .gd-editor { height: 100%; }
.gd-page-static { min-height: 0; }

/* Matrices */
.gd-chip-static {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem; border-radius: 6px;
    background: #f2f2f0; color: #444; font-size: 0.72rem; white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis;
}
.gd-chip-static button { border: none; background: none; padding: 0; color: #999; cursor: pointer; font-size: 0.65rem; }
.gd-dirty { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: #b45309; }
.gd-dirty i { font-size: 0.45rem; }
.gd-settings { display: flex; flex-direction: column; gap: 0.75rem; }
.gd-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid #f2f2f0; }
.gd-custom-key { padding: 0.15rem 0.4rem; border-radius: 4px; background: #f5f5f3; font-size: 0.7rem; color: #666; }

/* Listes */
.admin-tool-root table.admin-tool-table tbody tr.gd-row { cursor: pointer; }
.gd-templates { display: flex; flex-direction: column; gap: 0.5rem; }
.gd-tpl-card { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1rem; cursor: pointer; transition: border-color 0.14s; }
.gd-tpl-card:hover { border-color: #ccc; }
.gd-tpl-card.is-archived { opacity: 0.6; }
.gd-tpl-icon {
    display: flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 9px;
    background: #f2f2f0; color: #555; flex-shrink: 0;
}
.gd-tpl-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-weight: 700; color: #111; }
.gd-archived-toggle { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; font-size: 0.75rem; color: #888; cursor: pointer; }

/* Fenêtres de création */
.gd-modal { width: min(620px, calc(100vw - 2rem)); }
.gd-start-options { display: flex; flex-direction: column; gap: 0.4rem; }
.gd-start {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid #e8e8e5; border-radius: 9px; cursor: pointer;
}
.gd-start input { display: none; }
.gd-start > i { width: 1.2rem; color: #999; text-align: center; }
.gd-start span { display: flex; flex-direction: column; font-size: 0.82rem; }
.gd-start small { color: #999; font-size: 0.72rem; }
.gd-start.is-active { border-color: #111; background: #fafaf8; }
.gd-start.is-active > i { color: #111; }
.gd-drop {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1.4rem; border: 2px dashed #e2e2de; border-radius: 10px;
    color: #777; font-size: 0.82rem; text-align: center;
}
.gd-drop > i { font-size: 1.5rem; color: #bbb; }
.gd-drop.is-over { border-color: #111; background: #fafaf8; }

/* GenDoc dans la fiche Syncs */
.sy-gendoc { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.15rem 0; }
.sy-gendoc-row {
    display: flex; align-items: center; gap: 0.45rem; min-width: 0; padding: 0.25rem 0.4rem; border-radius: 6px;
    font-size: 12px; color: #222; text-decoration: none;
}
.sy-gendoc-row:hover { background: #f5f5f3; }
.sy-gendoc-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-gendoc-files { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 11px; color: #999; }
.sy-gendoc-files i { font-size: 9px; }
.sy-gendoc-go { font-size: 9px; color: #ccc; }
.sy-gendoc-new {
    display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start; padding: 0.25rem 0.55rem; border: 1px dashed #d6d6d1;
    border-radius: 6px; font-size: 12px; font-weight: 500; color: #333; text-decoration: none;
}
.sy-gendoc-new:hover { border-color: #111; color: #111; }
.sy-gendoc-new i { font-size: 10px; color: #888; }

/* GenDoc — obligatoires, facultatifs vides, registre */
.gd-req { margin-left: 0.15rem; color: #dc2626; font-weight: 700; }
.gd-legend { margin-left: 0.5rem; font-size: 0.72rem; color: #8b8b85; }
.gd-chip.is-optional { background: transparent; color: #a8a29e; box-shadow: inset 0 0 0 1px #e7e5e4; font-style: italic; }
.gd-chip.is-optional::after { content: ' · facultatif'; font-size: 0.85em; }
.gd-results-group { margin: 0.4rem 0.4rem 0.15rem; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #b0b0aa; }
.gd-results-empty { padding: 0.3rem 0.55rem; font-size: 0.75rem; color: #a3a39d; }
.gd-date { max-width: 14rem; }

/* GenDoc — éditeur plein écran, notes de champ */
.gd-editor.is-fullscreen { position: fixed; inset: 0; z-index: 95; height: 100vh; min-height: 0; border-radius: 0; border: none; }
.gd-field-note { font-size: 0.68rem; color: #0369a1; }
.gd-field-note i { font-size: 0.6rem; }

/* GenDoc — volet de l'éditeur : palette des champs, variantes (banc d'essai), contrôle */
.gd-body { flex: 1; display: flex; min-height: 0; }
.gd-body > .gd-canvas { min-width: 0; }
.gd-aside { display: flex; flex-direction: column; width: 300px; flex-shrink: 0; min-height: 0; background: #fff; border-left: 1px solid #ececea; }
.gd-aside-head { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem 0.4rem 0.85rem; border-bottom: 1px solid #ececea; font-size: 0.8rem; color: #111; }
.gd-aside-body { flex: 1; overflow-y: auto; padding: 0.6rem 0.75rem 1rem; font-size: 0.78rem; }
.gd-aside-hint { margin: 0.45rem 0 0.5rem; font-size: 0.72rem; line-height: 1.4; color: #9a9a94; }
.gd-aside-search { position: relative; }
.gd-aside-search i { position: absolute; left: 0.6rem; top: 50%; transform: translateY(-50%); font-size: 0.7rem; color: #aaa; }
.gd-aside-search input { width: 100%; padding-left: 1.8rem; }
.gd-palette-filter { display: flex; margin-top: 0.45rem; }
.gd-palette-filter button { flex: 1; }
.gd-pal-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.4rem; border-radius: 6px; cursor: grab; }
.gd-pal-item:hover { background: #f5f5f3; }
.gd-pal-item:active { cursor: grabbing; }
.gd-pal-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.gd-pal-label { color: #222; }
.gd-pal-item.is-unused .gd-pal-label { color: #a8a8a2; }
.gd-pal-value { overflow: hidden; font-size: 0.68rem; color: #15803d; white-space: nowrap; text-overflow: ellipsis; }
.gd-pal-uses {
    display: inline-flex; align-items: center; gap: 0.25rem; flex-shrink: 0; padding: 0.05rem 0.4rem; border: 1px solid #e8e8e5; border-radius: 999px;
    background: #fff; font-size: 0.66rem; font-weight: 600; color: #555; cursor: pointer; font-variant-numeric: tabular-nums;
}
.gd-pal-uses i { font-size: 0.58rem; color: #aaa; }
.gd-pal-uses:hover { border-color: #111; color: #111; }
.gd-pal-manage {
    display: flex; align-items: center; gap: 0.4rem; margin-top: 0.75rem; padding: 0.35rem 0.55rem; border: 1px dashed #d6d6d1; border-radius: 6px;
    background: none; font-size: 0.75rem; color: #333; cursor: pointer;
}
.gd-pal-manage:hover { border-color: #111; }
.gd-pal-manage i { font-size: 0.65rem; color: #888; }
.gd-tb-badge { min-width: 1rem; padding: 0 0.3rem; border-radius: 999px; font-size: 0.62rem; font-weight: 700; line-height: 1rem; text-align: center; background: #e5e5e2; color: #444; }
.gd-tb-badge.is-error { background: #dc2626; color: #fff; }
.gd-tb-badge.is-warn { background: #f59e0b; color: #fff; }
.gd-tb-btn.is-on .gd-tb-badge:not(.is-error):not(.is-warn) { background: rgba(255, 255, 255, 0.2); color: #fff; }
.gd-block-head.is-flash { animation: gd-flash 1.2s ease; }
.gd-strip-label { font-weight: 600; color: #333; }
.gd-tag-btn { border: none; cursor: pointer; }

.gd-bench-off { padding: 0.6rem; margin-bottom: 0.6rem; border: 1px solid #ececea; border-radius: 8px; background: #fafaf8; color: #555; }
.gd-bench-off p { margin-bottom: 0.45rem; }
.gd-bench-row { padding: 0.5rem 0; border-bottom: 1px solid #f2f2f0; }
.gd-bench-row.is-changed .gd-bench-label::before {
    content: ''; display: inline-block; width: 0.4rem; height: 0.4rem; margin-right: 0.35rem; border-radius: 999px; background: #f59e0b; vertical-align: middle;
}
.gd-bench-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem; }
.gd-bench-label { flex: 1; min-width: 0; font-weight: 600; color: #222; }
.gd-bench-count { flex-shrink: 0; padding: 0; border: none; background: none; font-size: 0.68rem; color: #9a9a94; cursor: pointer; }
.gd-bench-count:hover { color: #111; }
.gd-bench-count i { font-size: 0.58rem; }
.gd-bench-ro { color: #555; }
.gd-bench-input { display: flex; gap: 0.25rem; }
.gd-bench-input input { flex: 1; min-width: 0; }
.gd-icon-btn.is-on, .gd-icon-btn.is-on:hover { background: #111; border-color: #111; color: #fff; }
.gd-bench-note { margin-top: 0.25rem; font-size: 0.68rem; color: #9a9a94; }
.gd-bench-foot { display: flex; align-items: center; gap: 0.5rem; padding-top: 0.6rem; font-size: 0.72rem; color: #777; }

.gd-health-ok { display: flex; gap: 0.5rem; padding: 0.6rem; margin-bottom: 0.4rem; border-radius: 8px; background: #f0fdf4; color: #166534; }
.gd-health-ok > i { margin-top: 0.15rem; }
.gd-health-ok small { display: block; color: #4d7c5f; }
.gd-health-item {
    display: flex; align-items: flex-start; gap: 0.5rem; width: 100%; padding: 0.45rem 0.5rem; margin-bottom: 0.25rem;
    border: 1px solid #ececea; border-radius: 8px; background: #fff; text-align: left; cursor: pointer;
}
.gd-health-item:hover { border-color: #ccc; }
.gd-health-item > i:first-child { margin-top: 0.15rem; font-size: 0.75rem; }
.gd-health-item.is-error > i:first-child { color: #dc2626; }
.gd-health-item.is-warning > i:first-child { color: #d97706; }
.gd-health-item.is-info > i:first-child { color: #9a9a94; }
.gd-health-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.gd-health-text strong { font-weight: 600; color: #222; }
.gd-health-text small { font-size: 0.7rem; line-height: 1.35; color: #8b8b85; }
.gd-health-go { margin-top: 0.2rem; font-size: 0.6rem; color: #ccc; }
.gd-health-item:hover .gd-health-go { color: #111; }

/* GenDoc — conditions composées, champs de la matrice, société, trous à remplir */
.gd-block-pop { width: 340px; }
.gd-cond-join { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.4rem; font-size: 0.75rem; color: #555; }
.gd-cond-row { margin-top: 0.35rem; }
.gd-cond-sep { margin: 0.35rem 0 0.25rem; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9a9a94; }
.gd-custom { display: block; }
.gd-custom-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.gd-custom-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.4rem 0 0.1rem; }
.gd-company-pick { margin-bottom: 0.6rem; display: flex; flex-direction: column; gap: 0.4rem; }
.gd-holes-btn { margin-bottom: 0.5rem; }
.gd-holes-modal { width: min(760px, calc(100vw - 2rem)); }
.gd-holes { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; border: 1px solid #ececea; border-radius: 9px; }
.gd-hole { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0.75rem; align-items: start; padding: 0.55rem 0.7rem; border-bottom: 1px solid #f2f2f0; }
.gd-hole:last-child { border-bottom: none; }
.gd-hole.is-kept .gd-hole-mark { background: #f2f2f0; color: #9a9a94; }
.gd-hole-text { min-width: 0; font-size: 0.8rem; }
.gd-hole-mark { display: inline-block; max-width: 100%; padding: 0.05rem 0.35rem; border-radius: 4px; background: #fef3c7; color: #92400e; font-weight: 600; overflow-wrap: anywhere; }
.gd-hole-before { margin-top: 0.2rem; font-size: 0.7rem; color: #9a9a94; overflow-wrap: anywhere; }
.gd-hole-before strong { color: #666; font-weight: 600; }
@media (max-width: 640px) { .gd-hole { grid-template-columns: 1fr; } }

/* GenDoc — publication, blocs partagés */
.gd-tag.is-ok { background: #dcfce7; color: #166534; }
.gd-block-shared { border-left-color: #14b8a6; }
.gd-block-shared > .gd-block-head { background: #f0fdfa; color: #0f766e; }
.gd-block-shared.is-selected { box-shadow: 0 0 0 2px #14b8a6; }
.gd-block-shared.is-missing { border-left-color: #dc2626; }
.gd-block-shared.is-missing > .gd-block-head { background: #fef2f2; color: #b91c1c; }
.gd-shared-body { cursor: default; opacity: 0.92; }
.gd-block-size { border: 1px solid #99f6e4; border-radius: 4px; background: #fff; color: inherit; font: inherit; font-size: 0.62rem; padding: 0 0.15rem; cursor: pointer; }
.gd-block-menu { width: 300px; padding: 0.5rem; }
.gd-block-menu .gd-swatch-reset { display: flex; align-items: center; justify-content: center; gap: 0.35rem; }
.gd-block-menu .gd-swatch-reset:disabled { opacity: 0.45; cursor: default; }
.gd-usage {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; width: 100%; padding: 0.45rem 0.55rem; margin-bottom: 0.25rem;
    border: 1px solid #ececea; border-radius: 8px; background: #fff; font-size: 0.8rem; text-align: left; cursor: pointer;
}
.gd-usage:hover { border-color: #ccc; }
.gd-usage-go { margin-left: auto; font-size: 0.6rem; color: #ccc; }

@media (max-width: 1100px) { .gd-aside { width: 260px; } }
@media (max-width: 760px) {
    .gd-body { flex-direction: column; }
    .gd-aside { width: auto; max-height: 45%; border-left: none; border-top: 1px solid #ececea; }
}


/* Menus contextuels et menus d'action : même habillage que les menus de l'assistant et du Combobox admin */
.ag-ctx-backdrop { position: fixed; inset: 0; z-index: 35; }
.ag-ctx-menu { min-width: 15rem; max-width: 22rem; padding: 0.3rem; background: #fff; border: 1px solid #e8e8e5; border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); font-family: inherit; }
.ag-ctx-menu.is-floating { position: fixed; z-index: 99998; }
.ag-ctx-menu > button { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.45rem 0.6rem; border-radius: 6px; text-align: left; background: none; border: none; font-size: 0.8125rem; color: #333; cursor: pointer; }
.ag-ctx-menu > button:hover, .ag-ctx-menu > button:focus-visible { background: #f5f5f3; outline: none; }
.ag-ctx-menu > button > i { flex-shrink: 0; width: 1rem; text-align: center; font-size: 0.75rem; color: #9a9a94; }
.ag-ctx-text { display: flex; flex-direction: column; min-width: 0; }
.ag-ctx-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ctx-sub { font-size: 0.6875rem; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ctx-sep { display: block; height: 1px; margin: 0.3rem 0; background: #f0f0ed; }
.ag-ctx-menu > button.is-danger { color: #b91c1c; }
.ag-ctx-menu > button.is-danger > i { color: #dc2626; }
.ag-ctx-menu > button.is-danger:hover { background: #fef2f2; }

/* Fiche entité : bouton « Nouvel accord » (principal + choix du rôle) */
.ag-entity-new { position: relative; display: inline-flex; }
.ag-entity-new-main { border-top-right-radius: 0; border-bottom-right-radius: 0; font-weight: 600; }
.ag-entity-new-caret { padding: 0.35rem 0.5rem; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-color: rgba(255, 255, 255, 0.25); }
.ag-entity-new-caret i { font-size: 0.55rem; }
.ag-entity-new-menu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: max-content; }

/* Fiche entité : bandeau des types de contrat */
.ag-entity-typebar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.45rem 1.25rem; border-bottom: 1px solid #e8e8e5; background: #fafaf8; }
.ag-entity-typebar-label { margin-right: 0.25rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #b0b0aa; }
.ag-entity-type-chip { display: inline-flex; align-items: center; gap: 0.4rem; height: 1.625rem; padding: 0 0.65rem; border: 1px solid #e8e8e5; border-radius: 999px; background: #fff; color: #555; font-size: 0.75rem; font-weight: 500; cursor: pointer; white-space: nowrap; }
.ag-entity-type-chip:hover { border-color: #ccc; color: #111; }
.ag-entity-type-chip.is-empty:not(.is-active) { color: #b0b0aa; }
.ag-entity-type-chip.is-active { background: #111; border-color: #111; color: #fff; font-weight: 600; }
.ag-entity-type-count { padding: 0 0.35rem; border-radius: 999px; background: #f0f0ed; color: #666; font-size: 0.6875rem; font-weight: 600; }
.ag-entity-type-chip.is-active .ag-entity-type-count { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ==========================================================================
   Sandbox (SB_ToolAdmin, SB_Editor, SB_QuickNote) — docs/doc_tools/SB_DOC.md
   Sobre : des icônes avec infobulle, pas de texte d'aide.
   ========================================================================== */
.sb-root {
    display: flex;
    height: calc(100vh - var(--app-header-h));
    background: #fff;
    color: #1f2328;
}
.sb-side {
    width: 18rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ececea;
    background: #fafaf9;
}
.sb-side-head { display: flex; gap: 0.5rem; padding: 0.75rem; }
.sb-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.625rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    background: #f0f0ee;
    color: #8a8a85;
    font-size: 0.8125rem;
}
.sb-search:focus-within { background: #fff; box-shadow: 0 0 0 1px #d6d6d2; }
.sb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #1f2328; font-size: 0.875rem; }
.sb-scope-label { display: flex; align-items: center; gap: 0.5rem; padding: 0 1rem 0.5rem; font-size: 0.75rem; font-weight: 600; color: #6b6b66; }
.sb-list { flex: 1; overflow-y: auto; padding: 0 0.5rem 0.5rem; }
.sb-list-sep { height: 1px; margin: 0.375rem 0.5rem; background: #e6e6e3; }
.sb-list-empty { display: flex; justify-content: center; padding: 3rem 0; font-size: 1.5rem; color: #d4d4d0; }
.sb-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    text-align: left;
    transition: background-color 0.12s;
}
.sb-item:hover { background: #f0f0ee; }
.sb-item.is-active { background: #e9e9e6; }
.sb-item-title { font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item-title.is-empty { color: #a3a39e; font-weight: 500; }
.sb-item-snippet { font-size: 0.8125rem; color: #6b6b66; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item-meta { display: flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; color: #9b9b96; }
.sb-item-owner { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item-icons { margin-left: auto; display: flex; gap: 0.375rem; }
.sb-pin { color: #6b6b66; }
.sb-side-foot { display: flex; gap: 0.25rem; padding: 0.5rem 0.75rem; border-top: 1px solid #ececea; }

.sb-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    color: #6b6b66;
    flex-shrink: 0;
    transition: background-color 0.12s, color 0.12s;
}
.sb-icon-btn:hover { background: #ececea; color: #1f2328; }
.sb-icon-btn.is-on { color: #1f2328; background: #e6e6e3; }
.sb-icon-btn.is-primary { background: #1f2328; color: #fff; }
.sb-icon-btn.is-primary:hover { background: #3a3f45; }
.sb-icon-btn.is-danger:hover { background: #fdecec; color: #b42318; }
.sb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.125rem;
    padding: 0 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    background: #f0f0ee;
    color: #1f2328;
    white-space: nowrap;
}
.sb-btn:hover { background: #e6e6e3; }
.sb-btn.is-primary { background: #1f2328; color: #fff; }
.sb-btn.is-primary:hover { background: #3a3f45; }
.sb-btn.is-quiet { background: transparent; }
.sb-btn:disabled { opacity: 0.4; cursor: default; }

.sb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-note-bar { display: flex; align-items: center; gap: 0.5rem; height: 3rem; padding: 0 1rem 0 1.25rem; flex-shrink: 0; }
.sb-save-state { font-size: 0.6875rem; color: #a3a39e; width: 1rem; text-align: center; }
.sb-save-state.is-dirty { color: #d4a72c; font-size: 0.5rem; }
.sb-save-state.is-error { color: #b42318; }
.sb-save-state.is-offline { color: #d4a72c; }
.sb-note-by { font-size: 0.75rem; color: #9b9b96; }
/* Écriture à plusieurs (lot 7) : les autres personnes sur la note, leurs curseurs. */
.sb-presence { display: inline-flex; align-items: center; }
.sb-presence-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.375rem; height: 1.375rem; margin-left: -0.25rem; border-radius: 999px; border: 2px solid #fff;
    font-size: 0.5625rem; font-weight: 700; color: #fff; letter-spacing: 0.02em; cursor: default;
}
.sb-presence-dot:first-child { margin-left: 0; }
.sb-prose .collaboration-cursor__caret {
    position: relative; margin-left: -1px; margin-right: -1px; border-left: 1px solid; border-right: 1px solid;
    word-break: normal; pointer-events: none;
}
.sb-prose .collaboration-cursor__label {
    position: absolute; top: -1.35em; left: -1px; padding: 0.05rem 0.3rem; border-radius: 3px 3px 3px 0;
    font-size: 0.6875rem; font-weight: 600; line-height: normal; color: #fff; white-space: nowrap; user-select: none;
}
.sb-collab-wait { position: absolute; top: 1.25rem; left: 50%; color: #c4c4bf; font-size: 0.875rem; }
.sb-note-actions { margin-left: auto; display: flex; align-items: center; gap: 0.25rem; }
.sb-share { position: relative; }
.sb-share-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 0.375rem);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 19rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 15, 15, 0.12), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-seg { display: flex; gap: 0.25rem; padding: 0.1875rem; border-radius: 0.5rem; background: #f0f0ee; }
.sb-seg button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 1.875rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b6b66;
}
.sb-seg button.is-on { background: #fff; color: #1f2328; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.sb-conflict {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 1.25rem 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    background: #fff8e6;
    color: #7a5a00;
    font-size: 0.8125rem;
}
.sb-conflict span { flex: 1; }
.sb-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; }
.sb-empty-art { width: 6rem; height: 6rem; opacity: 0.12; }

/* Suivi de réunion (lot 8) */
.sb-note-body, .sb-version { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sb-series { display: flex; align-items: center; gap: 0.25rem; }
.sb-series-chip-btn {
    display: inline-flex; align-items: center; gap: 0.375rem; height: 1.875rem; padding: 0 0.625rem;
    border-radius: 9999px; background: #f0f0ee; color: #45453f; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.sb-series-chip-btn:hover, .sb-series-chip-btn.is-on { background: #e6e6e3; color: #1f2328; }
.sb-series-chip-btn i { font-size: 0.6875rem; color: #8a8a85; }
.sb-series-pop {
    position: absolute; right: 0; top: calc(100% + 0.375rem); z-index: 30;
    display: flex; flex-direction: column; gap: 0.5rem; width: min(24rem, calc(100vw - 2rem));
    padding: 0.625rem; border-radius: 0.75rem; background: #fff;
    box-shadow: 0 10px 30px rgba(15, 15, 15, 0.12), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-series-row { display: flex; align-items: center; gap: 0.625rem; }
.sb-series-row.is-top { align-items: flex-start; }
.sb-series-row.is-top > i { margin-top: 0.4375rem; }
.sb-series-row > i { width: 1rem; text-align: center; color: #9b9b96; font-size: 0.8125rem; flex-shrink: 0; }
.sb-series-row > :not(i) { flex: 1; min-width: 0; }
.sb-series-input {
    width: 100%; height: 2rem; padding: 0 0.625rem; border-radius: 0.75rem; border: 1px solid #e5e7eb;
    font-size: 0.8125rem; font-weight: 600; color: #1f2328; background: #fff;
}
.sb-series-input:focus { outline: none; border-color: #a5b4fc; }
.sb-series-rec { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 0.375rem; }
.sb-series-upcoming { margin: -0.25rem 0 0 1.625rem; font-size: 0.6875rem; color: #9b9b96; }
.sb-series-contacts { display: flex; flex-wrap: wrap; gap: 0.25rem; position: relative; }
.sb-series-chip {
    display: inline-flex; align-items: center; gap: 0.25rem; height: 1.625rem; padding: 0 0.5rem;
    border-radius: 9999px; background: #f0f0ee; color: #1f2328; font-size: 0.75rem;
}
.sb-series-chip button { color: #9b9b96; font-size: 0.625rem; }
.sb-series-chip button:hover { color: #b42318; }
.sb-series-chip.is-suggested { background: transparent; border: 1px dashed #d6d6d2; color: #6b6b66; }
.sb-series-chip.is-suggested:hover { border-color: #a3a39e; color: #1f2328; }
.sb-series-chip.is-suggested i { font-size: 0.5625rem; }
.sb-series-search { width: 100%; margin-top: 0.125rem; }
.sb-series-results { width: 100%; max-height: 12rem; overflow-y: auto; }
.sb-versions-pop { width: 17rem; gap: 0; max-height: 20rem; overflow-y: auto; }
.sb-version-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0 1.25rem 0.75rem; color: #6b6b66; font-size: 0.8125rem; }
.sb-version-title { font-weight: 700; color: #1f2328; }
.sb-version-cmp { margin-left: auto; display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: #8a8a85; }
.sb-fresh-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #f5c542; }
.sb-prose .sb-fresh { background: #fff6d6; box-shadow: -0.5rem 0 0 #fff6d6, 0.5rem 0 0 #fff6d6; border-radius: 0.125rem; }
.sb-prose tr.sb-fresh td { background: #fff6d6; }

/* Lignes d'action d'un suivi de réunion (lot 9) : orange de notre côté, bleu côté client. */
.sb-action {
    display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; position: relative; top: -0.09375rem;
    width: 0.9375rem; height: 0.9375rem; margin-right: 0.4375rem; border-radius: 9999px;
    border: 2px solid var(--sb-side, #e8890c); color: #fff; font-size: 0.5rem; user-select: none;
}
.sb-action.is-team { --sb-side: #e8890c; }
.sb-action.is-client { --sb-side: #2f6fdb; }
.sb-action.is-done { background: var(--sb-side); }
.sb-editor:not(.is-readonly) .sb-action { cursor: pointer; }
.sb-editor:not(.is-readonly) .sb-action:hover { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06); }
.sb-prose [data-sb-done="true"] { color: #9b9b96; }
.sb-prose [data-sb-internal="true"] {
    background: #f4f1fa; border-radius: 0.25rem; box-shadow: -0.5rem 0 0 #f4f1fa, 0.5rem 0 0 #f4f1fa;
}
.sb-prose table[data-sb-internal="true"] { box-shadow: 0 0 0 0.375rem #f4f1fa; }
.sb-tool.is-side-team i { color: #e8890c; font-size: 0.625rem; }
.sb-tool.is-side-client i { color: #2f6fdb; font-size: 0.625rem; }
.sb-actions-btn {
    display: inline-flex; align-items: center; gap: 0.1875rem; height: 1.875rem; padding: 0 0.375rem; border-radius: 0.5rem;
}
.sb-actions-btn:hover, .sb-actions-btn.is-on { background: #f0f0ee; }
.sb-actions-count {
    min-width: 1.25rem; height: 1.25rem; padding: 0 0.3125rem; border-radius: 9999px; color: #fff;
    font-size: 0.6875rem; font-weight: 700; line-height: 1.25rem; text-align: center;
}
.sb-actions-count.is-team { background: #e8890c; }
.sb-actions-count.is-client { background: #2f6fdb; }
.sb-actions-pop { width: 22rem; gap: 0; max-height: 24rem; overflow-y: auto; }
.sb-actions-head { display: flex; align-items: center; padding: 0.375rem 0.5rem 0.25rem; font-size: 0.6875rem; font-weight: 700; color: #6b6b66; text-transform: uppercase; letter-spacing: 0.03em; }
.sb-actions-head .sb-action { width: 0.625rem; height: 0.625rem; margin-right: 0.375rem; border-width: 0; background: var(--sb-side); }
.sb-series-next { flex: 0 0 auto !important; }

/* Lecture des CR par le client (lot 10) */
.sb-series-access { color: #c4c4bf !important; font-size: 0.6875rem !important; }
.sb-series-access.is-open { color: #2f6fdb !important; }
.sb-series-access.is-open.is-used { color: #15803d !important; }
.sb-minutes-series {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.875rem 0.75rem 0.375rem;
    font-size: 0.75rem; font-weight: 700; color: #45453f; text-transform: uppercase; letter-spacing: 0.03em;
}
.sb-minutes-series i { color: #9b9b96; font-size: 0.6875rem; }
.sb-minutes-icon { margin-right: 0.5rem; color: #9b9b96; font-size: 0.75rem; }
.sb-series-chip-btn.is-static { cursor: default; }
.sb-series-chip-btn.is-static:hover { background: #f0f0ee; color: #45453f; }

/* Créer dans AVP depuis @ (19/11/2026) */
.sb-mention-item.is-create { color: #45453f; border-top: 1px dashed #ececea; }
.sb-mention-item.is-create .sb-mention-label::before { content: '+ '; font-weight: 700; }
.sb-mention-pending { margin-left: 0.375rem; color: #d4a72c; font-size: 0.6875rem; }
.sb-avp-input {
    flex: 1; min-width: 0; height: 2rem; padding: 0 0.625rem; border-radius: 0.75rem; border: 1px solid #e5e7eb;
    font-size: 0.8125rem; color: #1f2328; background: #fff;
}
.sb-avp-input.is-short { flex: 0 0 5rem; }
.sb-avp-input:focus { outline: none; border-color: #a5b4fc; }
.sb-avp-program { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; color: #1f2328; }
.sb-avp-program i { color: #9b9b96; font-size: 0.75rem; }
.sb-avp-pending { margin-right: auto; display: inline-flex; align-items: center; gap: 0.3125rem; font-size: 0.6875rem; color: #a3a39e; }
.sb-avp-pending i { color: #d4a72c; }
.sb-avp-search-btn { margin-left: auto; font-size: 0.75rem; }
.sb-avp-search-btn i { margin-right: 0.375rem; }
.sb-avp-results { max-height: 15rem; overflow-y: auto; margin: 0 -0.25rem; }
.sb-avp-result {
    display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.3125rem 0.375rem; border-radius: 0.625rem;
    text-align: left; color: #1f2328;
}
.sb-avp-result:hover:not(:disabled) { background: #f5f5f3; }
.sb-avp-result:disabled { opacity: 0.6; }
.sb-avp-result img, .sb-avp-noposter { flex: 0 0 1.75rem; height: 2.5rem; border-radius: 0.25rem; object-fit: cover; background: #f0f0ee; }
.sb-avp-noposter { display: flex; align-items: center; justify-content: center; color: #b5b5b0; font-size: 0.75rem; }
.sb-avp-result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-avp-result-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; font-weight: 600; }
.sb-avp-result-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6875rem; color: #8a8a85; }
.sb-avp-result > i { color: #b5b5b0; font-size: 0.6875rem; }
.sb-avp-owner > :first-child { flex: 1; min-width: 0; }
.sb-avp-owner.is-required > :first-child { border-radius: 0.625rem; box-shadow: 0 0 0 1px #f59e0b; }
.sb-avp-music {
    flex: none; display: inline-flex; align-items: center; gap: 0.3125rem; height: 1.75rem; padding: 0 0.625rem; border-radius: 0.75rem;
    border: 1px solid #e5e7eb; font-size: 0.75rem; color: #a3a39e; background: #fff; white-space: nowrap;
}
.sb-avp-music span { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: #e5e5e2; }
.sb-avp-music.is-on { color: #1f2328; border-color: #d4d4d0; }
.sb-avp-music.is-original.is-on span { background: #10b981; }
.sb-avp-music.is-preexisting.is-on span { background: #0ea5e9; }
.sb-avp-empty { padding: 0.5rem; text-align: center; color: #c5c5c0; font-size: 0.8125rem; }
.sb-avp-manual { margin-right: auto; font-size: 0.75rem; }
.sb-avp-manual i { margin-right: 0.375rem; color: #d4a72c; }

/* Éditeur */
.sb-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sb-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.125rem;
    padding: 0 1rem 0.5rem 1.125rem;
    flex-shrink: 0;
}
.sb-toolbar-sep { width: 1px; height: 1.125rem; margin: 0 0.375rem; background: #e6e6e3; }
.sb-tool {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #6b6b66;
}
.sb-tool:hover { background: #f0f0ee; color: #1f2328; }
.sb-tool.is-on { background: #e9e9e6; color: #1f2328; }
.sb-tool.is-small i { font-size: 0.625rem; }
.sb-tool.is-danger:hover { background: #fdecec; color: #b42318; }
.sb-tool-sign { position: absolute; right: 0.1875rem; bottom: 0.1875rem; font-size: 0.5rem; }
.sb-editor-content { flex: 1; min-height: 0; overflow-y: auto; }
.sb-editor:not(.is-compact) .sb-editor-content { padding: 0.5rem 1.25rem 4rem; }
.sb-editor:not(.is-compact) .sb-toolbar { width: 100%; max-width: 52.5rem; margin: 0 auto; padding: 0 0.875rem 0.5rem; }
.sb-editor:not(.is-compact) .sb-prose { max-width: 50rem; margin: 0 auto; min-height: 100%; }
.sb-prose { outline: none; font-size: 0.9375rem; line-height: 1.6; color: #1f2328; }
.sb-prose > * + * { margin-top: 0.5rem; }
.sb-prose h1 { font-size: 1.625rem; font-weight: 700; line-height: 1.25; margin-top: 1.25rem; }
.sb-prose h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin-top: 1rem; }
.sb-prose h3 { font-size: 1.0625rem; font-weight: 700; margin-top: 0.875rem; }
.sb-prose > :first-child { margin-top: 0; }
.sb-prose ul { list-style: disc; padding-left: 1.5rem; }
.sb-prose ol { list-style: decimal; padding-left: 1.5rem; }
.sb-prose li > p { margin: 0; }
.sb-prose blockquote { border-left: 3px solid #e2e2de; padding-left: 0.875rem; color: #55554f; }
.sb-prose code { background: #f0f0ee; border-radius: 0.25rem; padding: 0.0625rem 0.3125rem; font-size: 0.85em; }
.sb-prose pre { background: #f6f6f4; border-radius: 0.5rem; padding: 0.75rem 1rem; font-size: 0.8125rem; overflow-x: auto; }
.sb-prose pre code { background: none; padding: 0; }
.sb-prose hr { border: 0; border-top: 1px solid #e6e6e3; margin: 1.25rem 0; }
.sb-prose mark { background: #fdf3b5; border-radius: 0.125rem; padding: 0 0.0625rem; }
.sb-prose .tableWrapper { overflow-x: auto; margin: 0.75rem 0; }
.sb-prose table { border-collapse: collapse; table-layout: auto; min-width: 50%; font-size: 0.875rem; }
.sb-prose td, .sb-prose th { border: 1px solid #e2e2de; padding: 0.3125rem 0.625rem; vertical-align: top; min-width: 4rem; position: relative; }
.sb-prose th { background: #f6f6f4; font-weight: 600; text-align: left; }
.sb-prose td > p, .sb-prose th > p { margin: 0; }
.sb-prose .selectedCell::after { content: ''; position: absolute; inset: 0; background: rgba(59, 130, 246, 0.12); pointer-events: none; }
.sb-prose p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    height: 0;
    color: #b5b5b0;
    pointer-events: none;
}
.sb-editor.is-readonly .sb-prose { color: #55554f; }

/* Note rapide (en-tête) */
.sb-quick { position: relative; display: flex; align-items: center; }
.sb-quick-btn { position: relative; display: inline-flex; padding: 0.5rem; border-radius: 0.5rem; opacity: 0.6; transition: opacity 0.12s; }
.sb-quick-btn:hover, .sb-quick-btn.is-on { opacity: 1; }
.sb-quick-btn img { width: 1.125rem; height: 1.125rem; }
.sb-quick-dot { position: absolute; top: 0.375rem; right: 0.375rem; width: 0.4375rem; height: 0.4375rem; border-radius: 9999px; background: #d4a72c; }
.sb-quick-pop {
    position: absolute;
    right: -0.5rem;
    top: calc(100% + 0.625rem);
    z-index: 60;
    width: min(26rem, calc(100vw - 2rem));
    padding: 0.75rem;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 15, 15, 0.16), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-quick-pop .sb-editor-content { max-height: 18rem; min-height: 6rem; padding: 0.25rem 0.25rem 0.5rem; }
.sb-quick-pop .sb-prose { min-height: 5.5rem; }
.sb-quick-foot { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; padding-top: 0.5rem; border-top: 1px solid #f0f0ee; }

.sb-back { display: none; }
@media (max-width: 767px) {
    .sb-back { display: inline-flex; }
    .sb-quick { display: none; }
    .sb-side { width: 100%; display: none; }
    .sb-root:not(:has(.sb-note-bar)) .sb-side { display: flex; }
    .sb-root:not(:has(.sb-note-bar)) .sb-main { display: none; }
}

/* Sandbox, lot 2 : mentions, liens d'une note, encart « Notes » des autres outils */
.sb-prose .sb-mention {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0 0.3125rem;
    border-radius: 0.3125rem;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 500;
    white-space: nowrap;
}
.sb-prose .sb-mention.is-object { background: #f0f0ee; color: #1f2328; cursor: pointer; }
.sb-prose .sb-mention.is-object:hover { background: #e6e6e3; }
.sb-prose .sb-mention i { font-size: 0.75em; color: #6b6b66; }
.sb-mention-menu {
    position: fixed;
    z-index: 130;
    width: 20rem;
    max-height: 20rem;
    overflow-y: auto;
    padding: 0.25rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 15, 15, 0.16), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-mention-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    text-align: left;
    font-size: 0.8125rem;
    color: #1f2328;
}
.sb-mention-item > i:first-child { width: 1rem; text-align: center; color: #8a8a85; flex-shrink: 0; }
.sb-mention-item.is-on, .sb-mention-item:hover { background: #f0f0ee; }
.sb-mention-avatar { width: 1.125rem; height: 1.125rem; border-radius: 9999px; object-fit: cover; flex-shrink: 0; }
.sb-mention-label { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-mention-sub { color: #8a8a85; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.sb-mention-date { margin-left: auto; color: #8a8a85; font-size: 0.6875rem; white-space: nowrap; flex-shrink: 0; }
.sb-mention-loading { display: flex; justify-content: center; padding: 0.625rem; color: #b5b5b0; }

.sb-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; padding: 0 1.25rem 0.5rem; max-width: 52.5rem; width: 100%; margin: 0 auto; }
.sb-link {
    display: inline-flex;
    align-items: center;
    max-width: 18rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: #f0f0ee;
    font-size: 0.75rem;
    color: #1f2328;
}
.sb-link.is-missing { opacity: 0.5; text-decoration: line-through; }
.sb-link-open { display: inline-flex; align-items: center; gap: 0.375rem; min-width: 0; height: 100%; padding: 0 0.25rem 0 0.625rem; border-radius: 9999px; }
.sb-link-open:hover .sb-link-label { text-decoration: underline; }
.sb-link-open i { color: #6b6b66; font-size: 0.6875rem; }
.sb-link-date { color: #6b6b66; white-space: nowrap; }
.sb-link-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-link-x { width: 1.5rem; height: 100%; padding-right: 0.25rem; color: #a3a39e; font-size: 0.625rem; visibility: hidden; }
.sb-link:hover .sb-link-x { visibility: visible; }
.sb-link-x:hover { color: #b42318; }
@media (hover: none) { .sb-link-x { visibility: visible; } }
.sb-linker-wrap { position: relative; }
.sb-link-add {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    border-radius: 9999px;
    border: 1px dashed #d6d6d2;
    color: #8a8a85;
    font-size: 0.75rem;
}
.sb-link-add:hover, .sb-link-add.is-on { border-color: #a3a39e; color: #1f2328; }
.sb-link-add-plus { font-size: 0.5625rem; }
.sb-linker {
    position: absolute;
    left: 0;
    top: calc(100% + 0.375rem);
    z-index: 30;
    width: min(26rem, calc(100vw - 2rem));
    padding: 0.5rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 15, 15, 0.14), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-linker-results { max-height: 20rem; overflow-y: auto; margin-top: 0.375rem; }
.sb-linker-results:empty { display: none; }
.sb-linker-check { margin-left: 0.25rem; width: 1rem; text-align: center; color: #c4c4bf; flex-shrink: 0; }
.sb-mention-item.is-linked .sb-linker-check { color: #15803d; }
.sb-mention-item.is-linked .sb-mention-date + .sb-linker-check, .sb-mention-date + .sb-linker-check { margin-left: 0.5rem; }

.sb-linked-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.sb-linked-add {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    height: 1.5rem;
    padding: 0 0.375rem;
    border-radius: 0.375rem;
    color: #8a8a85;
    font-size: 0.5625rem;
    opacity: 0.7;
}
.sb-linked-add:hover { background: #f3f4f6; opacity: 1; color: #1f2328; }
.sb-linked-add img { width: 0.875rem; height: 0.875rem; }
.sb-linked-list { display: flex; flex-direction: column; border: 1px solid #f3f4f6; border-radius: 0.5rem; }
.sb-linked-item { display: flex; flex-direction: column; gap: 0.0625rem; padding: 0.375rem 0.625rem; text-align: left; }
.sb-linked-item + .sb-linked-item { border-top: 1px solid #f3f4f6; }
.sb-linked-item:hover { background: #fafaf9; }
.sb-linked-title { font-size: 0.8125rem; font-weight: 500; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-linked-title.is-empty { color: #9ca3af; }
.sb-linked-snippet { font-size: 0.75rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-linked-meta { display: flex; align-items: center; gap: 0.25rem; font-size: 0.6875rem; color: #9ca3af; }
.sb-linked-meta i { font-size: 0.5625rem; }

.sb-quick-foot { flex-wrap: wrap; }
.sb-quick-ctx {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    height: 1.75rem;
    padding: 0 0.625rem;
    border-radius: 0.5rem;
    background: #f0f0ee;
    font-size: 0.75rem;
    color: #1f2328;
    min-width: 0;
}
.sb-quick-ctx span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-quick-ctx i { color: #6b6b66; font-size: 0.6875rem; }
.sb-quick-ctx.is-off { background: transparent; color: #a3a39e; text-decoration: line-through; }

/* Sandbox, lot 3 : ligne → tâche (poignée, sélection, encart, puce vivante) */
.sb-editor-content { position: relative; }
.sb-line-handle {
    position: absolute;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.375rem;
    color: #a3a39e;
    font-size: 0.8125rem;
}
.sb-line-handle:hover { background: #f0f0ee; color: #1f2328; }
.sb-selection-tasks {
    position: fixed;
    z-index: 120;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 1.75rem;
    padding: 0 0.625rem;
    border-radius: 9999px;
    background: #1f2328;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(15, 15, 15, 0.18);
}
.sb-selection-tasks:hover { background: #3a3f45; }
.sb-task-dialog {
    position: fixed;
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.875rem;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 15, 15, 0.16), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-task-dialog-title, .sb-task-dialog-lines input {
    width: 100%;
    border: 0;
    outline: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2328;
    background: transparent;
}
.sb-task-dialog-title { padding: 0.25rem 0.125rem; }
.sb-task-dialog-lines { display: flex; flex-direction: column; gap: 0.125rem; max-height: 11rem; overflow-y: auto; }
.sb-task-dialog-lines li { display: flex; align-items: center; gap: 0.5rem; padding: 0.125rem 0.125rem; }
.sb-task-dialog-lines li > i { color: #a3a39e; font-size: 0.75rem; }
.sb-task-dialog-lines input { font-size: 0.8125rem; font-weight: 500; min-width: 0; flex: 1; }
.sb-task-dialog-lines button { color: #c4c4bf; font-size: 0.6875rem; padding: 0 0.25rem; }
.sb-task-dialog-lines button:hover { color: #b42318; }
.sb-task-dialog-row { display: flex; align-items: center; gap: 0.5rem; }
.sb-task-dialog-row > * { min-width: 0; flex: 1; }
.sb-task-dialog-row > .sb-task-dialog-cal { flex: 0 0 auto; color: #8a8a85; font-size: 0.8125rem; padding-left: 0.25rem; }
.sb-task-dialog-links { display: flex; flex-direction: column; gap: 0.25rem; }
.sb-task-dialog-foot { display: flex; justify-content: flex-end; gap: 0.375rem; padding-top: 0.25rem; }

.sb-prose .sb-task {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    max-width: 100%;
    padding: 0.0625rem 0.5rem 0.0625rem 0.4375rem;
    border: 1px solid #e6e6e3;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1.5;
}
.sb-prose .sb-task:hover { border-color: #c4c4bf; background: #fafaf9; }
.sb-task-icon { font-size: 0.75rem; }
.sb-task-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sb-task-status { flex-shrink: 0; padding: 0 0.4375rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 600; line-height: 1.25rem; }
.sb-task-status:empty { display: none; }
.sb-task-status.is-gray { background: #f1f1ef; color: #55554f; }
.sb-task-status.is-red { background: #fdecec; color: #b42318; }
.sb-task-status.is-amber { background: #fef3c7; color: #92400e; }
.sb-task-status.is-orange { background: #ffedd5; color: #9a3412; }
.sb-task-status.is-blue { background: #dbeafe; color: #1d4ed8; }
.sb-task-status.is-violet { background: #ede9fe; color: #6d28d9; }
.sb-task-status.is-green { background: #dcfce7; color: #15803d; }
.sb-prose .sb-task.is-done .sb-task-title { color: #8a8a85; text-decoration: line-through; }
.sb-prose .sb-task.is-missing { opacity: 0.5; }
.sb-prose .sb-task.is-missing .sb-task-title { text-decoration: line-through; }
.sb-prose .sb-task.is-loading .sb-task-title { color: #8a8a85; }

/* Sandbox, lot 4 : tableau → concerts */
.sb-tool.is-accent { color: #0369a1; }
.sb-tool.is-accent:hover { background: #e0f2fe; color: #075985; }
.sb-table-chip {
    position: absolute;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 9999px;
    background: #fff;
    color: #0369a1;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(15, 15, 15, 0.12), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-table-chip:hover { background: #e0f2fe; }
.sb-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.18);
}
.sb-concerts {
    display: flex;
    flex-direction: column;
    width: min(70rem, 100%);
    max-height: calc(100vh - 3rem);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 15, 15, 0.22);
}
.sb-concerts-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; border-bottom: 1px solid #f0f0ee; }
.sb-concerts-icon { color: #0369a1; }
.sb-concerts-title { font-weight: 700; font-size: 0.9375rem; color: #1f2328; white-space: nowrap; }
.sb-concerts-artist { max-width: 16rem; }
.sb-concerts-entity { margin-left: auto; width: 18rem; }
.sb-concerts-spin { color: #a3a39e; }
.sb-concerts-scroll { overflow: auto; flex: 1; min-height: 8rem; }
.sb-concerts-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.sb-concerts-table th { position: sticky; top: 0; z-index: 1; background: #fafaf9; padding: 0.5rem; text-align: left; vertical-align: bottom; border-bottom: 1px solid #ececea; font-weight: 600; color: #6b6b66; font-size: 0.75rem; }
.sb-concerts-colname { margin-bottom: 0.25rem; font-weight: 500; color: #8a8a85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12rem; }
.sb-concerts-table td { padding: 0.375rem 0.5rem; border-bottom: 1px solid #f3f3f1; color: #1f2328; white-space: nowrap; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
.sb-concerts-table td.is-ignored { color: #c4c4bf; }
.sb-concerts-table tr.is-off td:not(.sb-concerts-state) { color: #b5b5b0; }
.sb-concerts-table tr.is-invalid td { color: #b5b5b0; }
.sb-concerts-state { width: 2.25rem; }
.sb-concerts-state button { width: 1.75rem; height: 1.75rem; border-radius: 9999px; font-size: 0.75rem; }
.is-link .sb-concerts-state button { background: #dcfce7; color: #15803d; }
.is-create .sb-concerts-state button { background: #e0f2fe; color: #0369a1; }
.is-no-entity .sb-concerts-state button { background: #fef3c7; color: #92400e; }
.is-invalid .sb-concerts-state button { background: #f1f1ef; color: #a3a39e; }
tr.is-off .sb-concerts-state button { background: #f1f1ef; color: #a3a39e; }
.sb-concerts-bad { color: #b42318; text-decoration: underline wavy #f3b4b0; }
.sb-concerts-entity-cell { width: 16rem; min-width: 14rem; overflow: visible !important; }
.sb-concerts-existing { color: #15803d; font-weight: 500; }
.sb-concerts-foot { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid #f0f0ee; }
.sb-concerts-sum { margin-right: auto; display: flex; gap: 0.875rem; font-size: 0.8125rem; color: #6b6b66; }
.sb-concerts-sum i { margin-right: 0.3125rem; font-size: 0.6875rem; }
@media (max-width: 767px) {
    .sb-concerts-head { flex-wrap: wrap; }
    .sb-concerts-entity { width: 100%; margin-left: 0; }
}
.sb-concerts-cell { width: 100%; min-width: 4rem; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; padding: 0.125rem 0.25rem; border-radius: 0.25rem; }
.sb-concerts-cell:hover { background: #f6f6f4; }
.sb-concerts-cell:focus { background: #fff; box-shadow: 0 0 0 1px #d6d6d2; }

/* Sandbox, lot 5 : setlist */
.sb-table-chips { position: absolute; z-index: 5; display: flex; gap: 0.25rem; transform: translateX(-50%); }
.sb-table-chips .sb-table-chip { position: static; }
.sb-table-chip.is-second { opacity: 0.55; }
.sb-table-chip.is-second:hover { opacity: 1; }
.sb-selection-bar { position: fixed; z-index: 120; display: flex; gap: 0.25rem; }
.sb-selection-bar .sb-selection-tasks { position: static; }
.sb-selection-tasks.is-second { background: #fff; color: #0369a1; box-shadow: 0 6px 18px rgba(15, 15, 15, 0.14), 0 0 0 1px rgba(15, 15, 15, 0.06); }
.sb-selection-tasks.is-second:hover { background: #e0f2fe; }
.sb-setlist-name { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 0.9375rem; font-weight: 700; color: #1f2328; background: transparent; }
.sb-setlist-body { display: flex; min-height: 0; flex: 1; overflow: hidden; }
.sb-setlist-concerts { width: 21rem; flex-shrink: 0; overflow-y: auto; padding: 0.75rem; border-right: 1px solid #f0f0ee; display: flex; flex-direction: column; gap: 0.375rem; }
.sb-setlist-concert { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 0.625rem; background: #f6f6f4; cursor: pointer; font-size: 0.8125rem; }
.sb-setlist-concert.is-off { opacity: 0.5; }
.sb-setlist-concert input { margin-top: 0.1875rem; }
.sb-setlist-concert-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-setlist-concert-date { font-weight: 600; color: #1f2328; white-space: nowrap; }
.sb-setlist-concert-what { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-setlist-concert-where { color: #6b6b66; font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-setlist-replace { margin-top: 0.125rem; color: #92400e; font-size: 0.6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-setlist-replace i { margin-right: 0.25rem; }
.sb-setlist-src { color: #a3a39e; font-size: 0.625rem; margin-top: 0.25rem; }
.sb-setlist-sentence { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 0.625rem; border: 1px dashed #d6d6d2; text-align: left; font-size: 0.8125rem; color: #55554f; }
.sb-setlist-sentence:hover { border-color: #0369a1; color: #0369a1; }
.sb-setlist-sentence i { color: #0369a1; }
.sb-setlist-sentence-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-setlist-search { margin-top: 0.25rem; }
.sb-setlist-works { flex: 1; min-width: 0; overflow-y: auto; padding: 0.75rem 1rem; }
.sb-setlist-map { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.sb-setlist-map-col { display: flex; flex-direction: column; width: 9.5rem; }
.sb-setlist-list { display: flex; flex-direction: column; }
.sb-setlist-list li { display: flex; align-items: center; gap: 0.625rem; padding: 0.3125rem 0; border-bottom: 1px solid #f3f3f1; font-size: 0.8125rem; }
.sb-setlist-n { width: 1.25rem; text-align: right; color: #a3a39e; font-variant-numeric: tabular-nums; }
.sb-setlist-kind { width: 1rem; text-align: center; font-size: 0.75rem; color: #a3a39e; }
.is-base .sb-setlist-kind { color: #15803d; }
.is-sacem .sb-setlist-kind { color: #1d4ed8; }
.is-draft .sb-setlist-kind { color: #b45309; }
.sb-setlist-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-setlist-title-text { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-setlist-composer { color: #8a8a85; font-size: 0.75rem; }
.sb-setlist-dur { width: 3.5rem; border: 0; outline: 0; background: transparent; text-align: right; font-variant-numeric: tabular-nums; color: #55554f; border-radius: 0.25rem; padding: 0.125rem 0.25rem; }
.sb-setlist-dur:focus { background: #fff; box-shadow: 0 0 0 1px #d6d6d2; }
.sb-setlist-choice { width: 15rem; flex-shrink: 0; }
@media (max-width: 767px) {
    .sb-setlist-body { flex-direction: column; overflow-y: auto; }
    .sb-setlist-concerts { width: auto; border-right: 0; border-bottom: 1px solid #f0f0ee; }
    .sb-setlist-choice { width: 9rem; }
}

/* Sandbox, lot 6 : « Notes » compact dans les barres des autres outils */
.sb-linked-compact { display: inline-flex; }
.sb-linked-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 1.5rem;
    padding: 0 0.4375rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #4b5563;
    opacity: 0.55;
    transition: opacity 0.12s, background-color 0.12s;
}
.sb-linked-btn img { width: 0.875rem; height: 0.875rem; }
.sb-linked-btn:hover, .sb-linked-btn.is-on, .sb-linked-btn.has-notes { opacity: 1; }
.sb-linked-btn:hover, .sb-linked-btn.is-on { background: #f3f4f6; }
.sb-linked-menu {
    position: fixed;
    /* Au-dessus des modales des outils (celle d'un concert Live Dates est à 100002). */
    z-index: 100100;
    display: flex;
    flex-direction: column;
    max-height: 22rem;
    overflow-y: auto;
    padding: 0.25rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 15, 15, 0.16), 0 0 0 1px rgba(15, 15, 15, 0.06);
}
.sb-linked-menu .sb-linked-item { border-radius: 0.5rem; }
.sb-linked-menu .sb-linked-item + .sb-linked-item { border-top: 0; }
.sb-linked-new { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 0.5rem; font-size: 0.8125rem; color: #4b5563; text-align: left; }
.sb-linked-new:hover { background: #f3f4f6; color: #111827; }
.sb-linked-new i { font-size: 0.6875rem; }

/* Alias de l'entité : une ligne sous la barre d'outils, sous le même régime que la barre des types. */
.ag-entity-aliases { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.45rem 1.25rem; border-bottom: 1px solid #e8e8e5; background: #fff; }
.ag-entity-alias-chip { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; height: 1.5rem; padding: 0 0.2rem 0 0.55rem; border: 1px solid #e1e1de; border-radius: 999px; background: #fafaf8; font-size: 0.75rem; color: #333; }
.ag-entity-alias-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-entity-alias-chip-x, .ag-entity-alias-add, .ag-entity-alias-ok, .ag-entity-alias-cancel { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; border: 0; border-radius: 999px; background: transparent; font-size: 0.6rem; color: #b4b3ac; cursor: pointer; transition: background 0.12s ease, color 0.12s ease; }
.ag-entity-alias-chip-x:hover, .ag-entity-alias-cancel:hover { background: #ececea; color: #111; }
.ag-entity-alias-add { width: 1.5rem; height: 1.5rem; border: 1px dashed #d4d4d0; }
.ag-entity-alias-add:hover { border-color: #888; color: #111; }
.ag-entity-alias-ok { color: #15803d; }
.ag-entity-alias-ok:hover:not(:disabled) { background: #dcfce7; }
.ag-entity-alias-ok:disabled { opacity: 0.4; cursor: default; }
.ag-entity-alias-form { display: inline-flex; align-items: center; gap: 0.15rem; }
.ag-entity-alias-input { height: 1.5rem; width: 14rem; max-width: 100%; padding: 0 0.55rem; border: 1px solid #d4d4d0; border-radius: 999px; font-size: 0.75rem; }
.ag-entity-alias-input:focus { outline: none; border-color: #888; box-shadow: none; }
.ag-entity-aliases-empty { font-size: 0.6875rem; color: #b0b0aa; }

/* Alias qui a fait trouver l'entité dans la recherche : à la suite du nom, sur la même ligne, en retrait. */
/* « Moi » : une rangée de pastilles au-dessus des contreparties, pas des lignes de liste */
.ag-own-entities { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; padding: 0.45rem 0.75rem; border-bottom: 1px solid #eeece8; }
.ag-own-entities-label { margin-right: 0.15rem; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #a8a79f; }
.ag-own-chip { display: inline-flex; align-items: center; max-width: 100%; height: 1.45rem; padding: 0 0.55rem; border: 1px solid #e6e5e0; border-radius: 999px; background: #fff; font-size: 0.6875rem; font-weight: 500; color: #55554f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease; }
.ag-own-chip:hover { border-color: #bdbcb5; color: #111; }
.ag-own-chip.is-selected { border-color: #111; background: #111; color: #fff; }
.ag-entity-list-alias { margin-left: 0.4rem; font-size: 0.6875rem; font-weight: 400; color: #a3a29c; }
.ag-entity-list-alias i { margin-right: 0.25rem; font-size: 0.5rem; color: #c4c3bd; }

/* CMO Doc — Combobox alignés sur les champs de la recherche simple (h-10, coins xl). */
.doc-combo .admin-combo-trigger {
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    color: #111827;
    background: #fff;
    border-color: #e5e7eb;
    border-radius: 0.75rem;
}
.doc-combo .admin-combo-trigger:hover:not(:disabled) { border-color: #d1d5db; }
