/* ===========================================================================
   One Reputation — socle d'interface (charte de décembre 2026)

   Aucun framework : des jetons, une grille, et une poignée de composants.
   Fond gris clair, cartes blanches très arrondies sans bordure, barre
   latérale claire, une seule couleur d'accent (bleu vif) et des tuiles
   teintées pour les chiffres clés. Toute la couleur passe par les jetons :
   changer d'accent tient en quatre lignes.
   =========================================================================== */

:root {
    --zebre: rgba(18, 40, 90, .05);
    /* Accent — repris par le logo (dégradé #1257FF → #38B6FF). */
    --brand-900: #08245f;
    --brand-800: #0a3fc2;
    --brand-700: #1257ff;
    --brand-600: #2f6dff;
    --brand-500: #38b6ff;
    --brand-100: #e3ecff;
    --brand-050: #f2f6ff;

    --ink-900: #0f1222;
    --ink-800: #1e2233;
    --ink-700: #353a4d;
    --ink-600: #50566b;
    --ink-500: #6c7287;
    --ink-400: #9298ab;
    --ink-300: #c4c8d4;
    --ink-200: #e3e5ec;
    --ink-100: #eff0f4;
    --ink-050: #f5f6f9;
    --white: #ffffff;
    --surface: #ffffff;

    --canvas: #f4f5f8;

    /* Teintes des tuiles de chiffres clés. */
    --tint-1: #e8efff;  --tint-1-ink: #1257ff;
    --tint-2: #fff0e3;  --tint-2-ink: #c25e12;
    --tint-3: #e5f7ee;  --tint-3-ink: #157a4c;
    --tint-4: #ffeaf3;  --tint-4-ink: #c0266a;

    --star: #f5a623;
    --ok-600: #157a4c;
    --ok-100: #e3f6ec;
    --warn-600: #a35c0e;
    --warn-100: #fff1dc;
    --bad-600: #c2352b;
    --bad-100: #fdebe9;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --shadow-sm: 0 1px 2px rgba(15, 18, 34, .04), 0 1px 1px rgba(15, 18, 34, .02);
    --shadow: 0 1px 3px rgba(15, 18, 34, .05), 0 12px 28px -8px rgba(15, 18, 34, .10);
    --shadow-lg: 0 2px 6px rgba(15, 18, 34, .05), 0 24px 48px -12px rgba(15, 18, 34, .18);
    --ring: 0 0 0 4px rgba(18, 87, 255, .16);

    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

    --space: 1rem;
    --sidebar: 260px;
    --sidebar-mini: 84px;
    --header: 76px;

    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Instrument Sans", "Inter", system-ui, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-800);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4 {
    margin: 0 0 .5em;
    line-height: 1.2;
    font-family: var(--font-display);
    font-weight: 620;
    color: var(--ink-900);
    letter-spacing: -.015em;
}
h1 { font-size: 1.65rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-700); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--brand-800); text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--brand-100); color: var(--brand-900); }

small, .small { font-size: .85rem; }
.muted { color: var(--ink-500); }
.mono { font-family: var(--font-mono); font-size: .85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* --- Structure applicative -------------------------------------------- */

/* minmax(0, 1fr) et non 1fr : sans cela un tableau large élargit la page
   entière au lieu de défiler dans sa carte. */
.shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns .32s var(--ease);
}

.sidebar {
    min-width: 0;
    background: var(--surface);
    color: var(--ink-600);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--ink-100);
    z-index: 40;
}

.sidebar__top { display: flex; align-items: center; gap: .5rem; padding: 1.35rem 1.2rem 1rem; min-height: var(--header); }

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--ink-900);
}

.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand img { display: block; }
.sidebar__brand { flex: 1 1 auto; min-width: 0; }
.sidebar__logo { width: 100%; height: auto; max-height: 52px; object-fit: contain; object-position: left center; }
.sidebar__brand .sidebar__symbol { display: none; height: 30px; width: 30px; }

.sidebar__close { display: none; }

.sidebar__nav {
    padding: .25rem .9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-200) transparent;
}

.sidebar__section {
    padding: 1.15rem .75rem .45rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--ink-400);
    font-weight: 600;
    white-space: nowrap;
}

.sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .62rem .75rem;
    border-radius: 12px;
    color: var(--ink-600);
    font-size: .9rem;
    font-weight: 520;
    white-space: nowrap;
    transition: background .18s var(--ease), color .18s var(--ease);
}

.sidebar__icon {
    width: 19px;
    height: 19px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--ink-400);
    transition: color .18s var(--ease), transform .25s var(--ease-spring);
}

.sidebar__link:hover { background: var(--ink-050); color: var(--ink-900); text-decoration: none; }
.sidebar__link:hover .sidebar__icon { color: var(--ink-700); transform: translateX(1px) scale(1.06); }

.sidebar__link.is-active {
    background: var(--ink-900);
    color: var(--white);
    font-weight: 580;
    box-shadow: 0 6px 16px -6px rgba(15, 18, 34, .45);
}
.sidebar__link.is-active .sidebar__icon { color: var(--brand-500); }

/* Pastille d'accent à droite du lien actif. */
.sidebar__link.is-active::after {
    content: "";
    position: absolute;
    right: .8rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(56, 182, 255, .25);
}

.sidebar__foot { padding: .75rem .9rem 1.1rem; border-top: 1px solid var(--ink-100); }

.sidebar__collapse {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .55rem .75rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink-500);
    font: inherit;
    font-size: .86rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s var(--ease), color .18s var(--ease);
}
.sidebar__collapse:hover { background: var(--ink-050); color: var(--ink-900); }
.sidebar__collapse svg,
.sidebar__close svg,
.iconbtn svg,
.alert__close svg,
.lieu__icon {
    width: 19px; height: 19px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.sidebar__collapse svg { transition: transform .32s var(--ease); }

/* Barre repliée : les pictogrammes seuls, le libellé en info-bulle. */
.barre-repliee .shell { grid-template-columns: var(--sidebar-mini) minmax(0, 1fr); }
.barre-repliee .sidebar__logo,
.barre-repliee .sidebar__label,
.barre-repliee .sidebar__section span { display: none; }
.barre-repliee .sidebar__brand { flex: 0 0 auto; }
.barre-repliee .sidebar__brand .sidebar__symbol { display: block; }
.barre-repliee .sidebar__top { justify-content: center; padding-left: 0; padding-right: 0; }
.barre-repliee .sidebar__section { padding: .9rem 0 .35rem; height: 1.6rem; }
.barre-repliee .sidebar__section::before { content: ""; display: block; height: 1px; margin: 0 1.1rem; background: var(--ink-100); }
.barre-repliee .sidebar__link,
.barre-repliee .sidebar__collapse { justify-content: center; padding: .7rem; }
.barre-repliee .sidebar__link.is-active::after { display: none; }
.barre-repliee .sidebar__collapse svg { transform: scaleX(-1); }
.barre-repliee .sidebar__nav { scrollbar-width: none; }
.barre-repliee .sidebar__nav::-webkit-scrollbar { display: none; }

/* Info-bulle du menu replié : un seul élément en position fixe, posé par
   app.js. Un ::before dans la liste obligeait à la laisser déborder — et elle
   recouvrait alors le bouton « Déplier le menu ». */
.bulle-menu {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateY(-50%);
    padding: .38rem .7rem;
    border-radius: 8px;
    background: var(--ink-900);
    color: var(--white);
    font-size: .8rem;
    font-weight: 540;
    white-space: nowrap;
    box-shadow: var(--shadow);
    pointer-events: none;
    animation: bulle .18s var(--ease);
    z-index: 60;
}
.bulle-menu[hidden] { display: none; }

@keyframes bulle { from { opacity: 0; transform: translate(-4px, -50%); } }

.voile-tiroir { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    min-height: var(--header);
    background: rgba(244, 245, 248, .82);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 2rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__heading { display: flex; flex-direction: column; min-width: 0; }
.topbar__title {
    font-family: var(--font-display);
    font-weight: 640;
    font-size: 1.45rem;
    letter-spacing: -.02em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar__hello { font-size: .86rem; color: var(--ink-500); }
.topbar .select { max-width: 280px; }
.topbar__spacer { margin-left: auto; }
.iconbtn.topbar__burger { display: none; }

/* Bouton rond à pictogramme. */
.iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-700);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .2s var(--ease-spring), box-shadow .2s var(--ease), color .2s var(--ease);
}
.iconbtn:hover { color: var(--brand-700); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.iconbtn:active { transform: scale(.94); }

/* Établissement courant : une pilule, sélecteur ou simple étiquette. */
.lieu {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 44px;
    padding: 0 1rem 0 .9rem;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-size: .88rem;
    font-weight: 540;
    color: var(--ink-800);
    max-width: 320px;
    transition: box-shadow .2s var(--ease);
}
.lieu:hover, .lieu:focus-within { box-shadow: var(--shadow); }
.lieu--seul { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lieu__icon { color: var(--brand-600); width: 17px; height: 17px; }
.topbar .lieu__select {
    border: 0;
    background: transparent;
    padding: 0 1.4rem 0 0;
    height: 100%;
    max-width: 240px;
    box-shadow: none;
    font-weight: 540;
    cursor: pointer;
}
.topbar .lieu__select:focus { box-shadow: none; }

/* --- Menu de l'utilisateur connecté ------------------------------------ */

.usermenu { position: relative; }
.usermenu > summary { list-style: none; }
.usermenu > summary::-webkit-details-marker { display: none; }

.usermenu__button {
    display: flex;
    align-items: center;
    gap: .6rem;
    height: 44px;
    padding: 0 .8rem 0 .3rem;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    user-select: none;
    transition: box-shadow .2s var(--ease);
}

.usermenu__button:hover,
.usermenu[open] .usermenu__button { box-shadow: var(--shadow); }

.usermenu__avatar {
    width: 36px; height: 36px; flex: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
    color: var(--white);
    font-size: .85rem;
    font-weight: 640;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.usermenu__who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }

.usermenu__name {
    font-size: .86rem;
    font-weight: 600;
    color: var(--ink-900);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.usermenu__role { font-size: .74rem; color: var(--ink-500); white-space: nowrap; }

.usermenu__chevron { width: 14px; height: 14px; color: var(--ink-500); flex: none; transition: transform .25s var(--ease); }
.usermenu[open] .usermenu__chevron { transform: rotate(180deg); }

.usermenu__panel {
    position: absolute;
    top: calc(100% + .55rem);
    right: 0;
    min-width: 250px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .4rem;
    z-index: 30;
    transform-origin: top right;
    animation: panneau .22s var(--ease);
}

@keyframes panneau { from { opacity: 0; transform: translateY(-6px) scale(.97); } }

.usermenu__head {
    display: flex;
    flex-direction: column;
    padding: .65rem .8rem .8rem;
    border-bottom: 1px solid var(--ink-100);
    margin-bottom: .35rem;
}

.usermenu__head span { overflow: hidden; text-overflow: ellipsis; }

.usermenu__item {
    display: block;
    padding: .55rem .8rem;
    border-radius: var(--radius-sm);
    color: var(--ink-800);
    font-size: .9rem;
    transition: background .15s var(--ease), padding-left .2s var(--ease);
}

.usermenu__item:hover { background: var(--ink-050); color: var(--ink-900); text-decoration: none; padding-left: 1rem; }
.usermenu__item--quit { color: var(--bad-600); }
.usermenu__item--quit:hover { background: var(--bad-100); color: var(--bad-600); }

.content {
    padding: .5rem 2rem 2.5rem;
    max-width: none;
    width: 100%;
    animation: entree .45s var(--ease) both;
}

@keyframes entree { from { opacity: 0; transform: translateY(8px); } }

/* --- Composants -------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card__head { padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--ink-100); display: flex; align-items: center; gap: 1rem; }
.card__head h2, .card__head h3 { margin: 0; }
.card__body { padding: 1.4rem; }
.card__foot { padding: 1rem 1.4rem; border-top: 1px solid var(--ink-100); background: var(--ink-050); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 1.1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Entrée en cascade des cartes d'une grille. */
.content > .grid > *,
.content > .stack > * { animation: entree .5s var(--ease) both; }
.content > .grid > :nth-child(2), .content > .stack > :nth-child(2) { animation-delay: .04s; }
.content > .grid > :nth-child(3), .content > .stack > :nth-child(3) { animation-delay: .08s; }
.content > .grid > :nth-child(4), .content > .stack > :nth-child(4) { animation-delay: .12s; }
.content > .grid > :nth-child(n+5), .content > .stack > :nth-child(n+5) { animation-delay: .16s; }

.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.row--wrap { flex-wrap: wrap; }

.stat { padding: 1.25rem 1.4rem 1.35rem; position: relative; overflow: hidden; }
.stat__label { font-size: .82rem; color: var(--ink-600); font-weight: 560; }
.stat__value {
    font-family: var(--font-display);
    font-size: 2.15rem;
    font-weight: 660;
    letter-spacing: -.03em;
    color: var(--ink-900);
    line-height: 1.15;
    margin: .3rem 0 .15rem;
    font-variant-numeric: tabular-nums;
}
.stat__hint { font-size: .82rem; color: var(--ink-500); }

/* Rangée de chiffres clés : des tuiles teintées, chacune sa couleur. */
.grid--4 > .card.stat {
    box-shadow: none;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.grid--4 > .card.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.grid--4 > .card.stat:nth-child(4n+1) { background: var(--tint-1); --t: var(--tint-1-ink); }
.grid--4 > .card.stat:nth-child(4n+2) { background: var(--tint-2); --t: var(--tint-2-ink); }
.grid--4 > .card.stat:nth-child(4n+3) { background: var(--tint-3); --t: var(--tint-3-ink); }
.grid--4 > .card.stat:nth-child(4n+4) { background: var(--tint-4); --t: var(--tint-4-ink); }
.grid--4 > .card.stat .stat__label { color: var(--t); }
.grid--4 > .card.stat .stat__hint { color: var(--ink-600); }

/* Une onde légère dans le coin : la tuile vit sans chiffre inventé. */
.grid--4 > .card.stat::after {
    content: "";
    position: absolute;
    right: -38px;
    bottom: -38px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 16px solid var(--t);
    opacity: .07;
    transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.grid--4 > .card.stat:hover::after { transform: scale(1.15); opacity: .12; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .62rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--ink-900);
    color: var(--white);
    font: inherit;
    font-weight: 580;
    font-size: .9rem;
    line-height: 1.3;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 18, 34, .12);
    transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .2s var(--ease), transform .18s var(--ease-spring);
}

.btn:hover { background: var(--brand-700); text-decoration: none; color: var(--white); box-shadow: 0 8px 18px -8px rgba(18, 87, 255, .6); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--ghost { background: var(--surface); border-color: var(--ink-200); color: var(--ink-800); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { background: var(--surface); color: var(--ink-900); border-color: var(--ink-300); box-shadow: var(--shadow); }
.btn--quiet { background: transparent; color: var(--ink-600); box-shadow: none; }
.btn--quiet:hover { background: var(--ink-100); color: var(--ink-900); box-shadow: none; }
.btn--danger { background: var(--bad-600); }
.btn--danger:hover { background: #a32d24; box-shadow: 0 8px 18px -8px rgba(194, 53, 43, .6); }
.btn--sm { padding: .4rem .8rem; font-size: .84rem; border-radius: 10px; }
.btn--block { width: 100%; }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; }
.field > label { font-size: .85rem; font-weight: 580; color: var(--ink-700); }
.field__hint { font-size: .8rem; color: var(--ink-500); }
.field__error { font-size: .82rem; color: var(--bad-600); }

.input, .select, .textarea {
    width: 100%;
    padding: .62rem .85rem;
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    background: var(--surface);
    font: inherit;
    font-size: .93rem;
    color: var(--ink-900);
    transition: border-color .15s var(--ease), box-shadow .2s var(--ease), background .15s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }

.select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%236c7287' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 14px;
    cursor: pointer;
}

/*
 * Sélecteur de couleur.
 *
 * Sans règle propre, il hérite du style des champs texte : le remplissage et
 * la taille de police écrasent la pastille à quelques pixels de haut, et on ne
 * voit plus qu'un trait. Il lui faut une hauteur explicite, aucun remplissage,
 * et la pastille étirée sur toute la surface.
 */
.input[type="color"] {
    height: 2.75rem;
    padding: .3rem;
    cursor: pointer;
}

.input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }

.input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--ink-200);
    border-radius: 8px;
}

.input[type="color"]::-moz-color-swatch {
    border: 1px solid var(--ink-200);
    border-radius: 8px;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: var(--ring);
}

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

input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-700); width: 1rem; height: 1rem; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    text-align: left;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ink-500);
    font-weight: 600;
    padding: .8rem 1rem;
    background: var(--ink-050);
    border-bottom: 1px solid var(--ink-100);
}
.card > .table:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.card > .table:first-child th:last-child { border-top-right-radius: var(--radius-lg); }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:nth-child(even) { background: var(--zebre); }
.table tbody tr:hover { background: var(--brand-050); }

/* Grille de saisie — import d'une liste de clients.
   Un tableau de champs plutôt qu'un tableur : le collage multi-cellules est
   géré à la main, et le clavier reste celui d'un formulaire ordinaire. */
.grille {
    border: 1px solid var(--ink-200);
    border-radius: 14px;
    overflow: auto;
    max-height: 26rem;
    background: var(--surface);
}
.grille .table { font-size: .9rem; }
.grille thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ink-050);
    border-radius: 0;
}
.table--grille td { padding: 0; border-bottom: 1px solid var(--ink-100); }
.table--grille tbody tr:hover { background: transparent; }
.table--grille tbody tr:nth-child(even):hover { background: var(--zebre); }

.grille__num {
    width: 2.4rem;
    text-align: center;
    padding: 0 .35rem;
    user-select: none;
}

.cellule {
    width: 100%;
    border: 0;
    outline: 0;
    padding: .55rem .65rem;
    font: inherit;
    color: var(--ink-800);
    background: transparent;
    border-right: 1px solid var(--ink-100);
    transition: background .12s var(--ease);
}
.cellule::placeholder { color: var(--ink-300); }
/* L'exemple ne s'affiche que sur la première ligne : répété partout, il se
   lirait comme une liste déjà remplie. */
.table--grille tr:not(:first-child) .cellule::placeholder { color: transparent; }
.cellule:focus {
    background: var(--brand-050);
    box-shadow: inset 0 0 0 2px var(--brand-600);
    border-radius: 4px;
}

.grille__suppr {
    border: 0;
    background: transparent;
    color: var(--ink-300);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: .2rem .4rem;
    border-radius: 8px;
    transition: color .15s var(--ease), background .15s var(--ease), transform .2s var(--ease-spring);
}
.grille__suppr:hover { color: var(--bad-600); background: var(--bad-100); transform: scale(1.1); }

/* Vitrine — carte d'une intégration ou d'une page de dépôt, avec son aperçu.
   Le cadre est inerte : un voile transparent capte le clic et mène à
   l'éditeur, sinon le pointeur se perdrait dans le document de l'aperçu. */
.vitrine {
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
.vitrine:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.vitrine--coupee .vitrine__apercu { opacity: .45; filter: grayscale(1); }

.vitrine__apercu {
    position: relative;
    background:
        radial-gradient(circle at 1px 1px, var(--ink-200) 1px, transparent 0) 0 0 / 14px 14px,
        var(--ink-050);
    border-bottom: 1px solid var(--ink-100);
}
.vitrine__apercu iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.vitrine__voile { position: absolute; inset: 0; z-index: 2; }
/* Un aperçu plus haut que son cadre est coupé net : le fondu dit que la suite
   existe, au lieu de laisser croire à un rendu tronqué. */
.vitrine__apercu--fondu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.5rem;
    background: linear-gradient(to bottom, transparent, var(--surface));
    pointer-events: none;
    z-index: 1;
}
/* Un aperçu qui n'a pas pu être composé : on le dit, plutôt que de laisser un cadre gris. */
.vitrine__apercu--muet::after {
    content: "Aperçu indisponible";
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; color: var(--ink-400);
}

.vitrine__corps { padding: 1rem 1.15rem; flex: 1; }
.vitrine__pied {
    padding: .7rem 1.15rem;
    border-top: 1px solid var(--ink-100);
    background: var(--ink-050);
    align-items: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
    background: var(--ink-100);
    color: var(--ink-700);
    white-space: nowrap;
}

/* Un point de couleur devant l'état : lisible même en un coup d'œil. */
.tag--ok::before, .tag--warn::before, .tag--bad::before, .tag--info::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.tag--warn::before { animation: pouls 2s var(--ease) infinite; }

@keyframes pouls { 50% { box-shadow: 0 0 0 4px rgba(163, 92, 14, .18); } }

.tag--ok   { background: var(--ok-100);   color: var(--ok-600); }
.tag--warn { background: var(--warn-100); color: var(--warn-600); }
.tag--bad  { background: var(--bad-100);  color: var(--bad-600); }
.tag--info { background: var(--brand-100); color: var(--brand-700); }

.alert {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem 2.8rem .85rem 1.1rem;
    border-radius: 14px;
    border: 1px solid;
    font-size: .9rem;
    margin-bottom: 1.1rem;
    animation: entree .4s var(--ease) both;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.alert.is-leaving { opacity: 0; transform: translateY(-6px); }

.alert__close {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: .6;
    cursor: pointer;
    transition: opacity .15s var(--ease), background .15s var(--ease);
}
.alert__close svg { width: 16px; height: 16px; }
.alert__close:hover { opacity: 1; background: rgba(15, 18, 34, .06); }

.alert--ok   { background: var(--ok-100);   border-color: #bfe8d2; color: var(--ok-600); }
.alert--warn { background: var(--warn-100); border-color: #f5d8ac; color: var(--warn-600); }
.alert--bad  { background: var(--bad-100);  border-color: #f5c6c0; color: var(--bad-600); }
.alert--info { background: var(--brand-050); border-color: #cfdcff; color: var(--brand-800); }

.stars { color: var(--star); letter-spacing: .06em; font-size: .95rem; }
.stars--muted { color: var(--ink-300); }

.empty { padding: 3.2rem 1.5rem; text-align: center; color: var(--ink-500); }
.empty h3 { color: var(--ink-800); }
.empty::before {
    content: "";
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231257ff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.6l2.5 5.1 5.6.8-4 3.9 1 5.6-5.1-2.7-5 2.7.9-5.6-4-3.9 5.6-.8z'/%3E%3C/svg%3E") center / 26px no-repeat,
        var(--brand-050);
}

/* --- Écrans d'authentification ---------------------------------------- */

.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--canvas);
    padding: 1rem;
    gap: 1rem;
}

.auth__aside {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(56, 182, 255, .55), transparent 60%),
        radial-gradient(90% 70% at 0% 100%, rgba(18, 87, 255, .6), transparent 60%),
        var(--ink-900);
    color: var(--white);
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1.25rem;
}

.auth__aside::before {
    content: "★★★★★";
    position: absolute;
    top: 3rem;
    left: 3.5rem;
    color: var(--star);
    letter-spacing: .25em;
    font-size: 1.1rem;
    animation: entree .8s var(--ease) both;
}

.auth__aside h2 {
    color: var(--white);
    font-size: clamp(1.8rem, 2.6vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -.03em;
    max-width: 16ch;
    animation: entree .7s .05s var(--ease) both;
}
.auth__aside p { color: rgba(255, 255, 255, .78); max-width: 44ch; font-size: 1rem; animation: entree .7s .12s var(--ease) both; }

.auth__panel { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth__box {
    width: 100%;
    max-width: 400px;
    animation: entree .5s var(--ease) both;
}
.auth__brand { margin-bottom: 2.2rem; }
.auth__brand img { display: block; width: 190px; height: auto; }
.auth__box h1 { font-size: 1.7rem; letter-spacing: -.025em; }
.auth__box .btn { padding: .78rem 1.2rem; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; padding: 0; }
    .auth__aside { display: none; }
}

/* --- Tablette et mobile : la barre devient un tiroir ------------------- */

@media (max-width: 1080px) {
    .shell, .barre-repliee .shell { grid-template-columns: minmax(0, 1fr); }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(300px, 86vw);
        height: 100vh;
        transform: translateX(-102%);
        transition: transform .34s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    .tiroir-ouvert .sidebar { transform: none; }

    /* Le tiroir montre toujours la barre complète. */
    .barre-repliee .sidebar__logo,
    .barre-repliee .sidebar__label,
    .barre-repliee .sidebar__section span { display: revert; }
    .barre-repliee .sidebar__brand .sidebar__symbol { display: none; }
    .barre-repliee .sidebar__top { justify-content: flex-start; padding: 1.35rem 1.3rem 1rem; }
    .barre-repliee .sidebar__section { height: auto; padding: 1.15rem .75rem .45rem; }
    .barre-repliee .sidebar__section::before { display: none; }
    .barre-repliee .sidebar__link { justify-content: flex-start; padding: .62rem .75rem; }
    .bulle-menu { display: none; }
    .sidebar__foot { display: none; }

    .sidebar__close {
        display: inline-flex;
        margin-left: auto;
        width: 38px; height: 38px;
        align-items: center; justify-content: center;
        border: 0; border-radius: 50%;
        background: var(--ink-050);
        color: var(--ink-700);
        cursor: pointer;
    }

    .voile-tiroir {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 18, 34, .4);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s var(--ease);
        z-index: 35;
    }
    .tiroir-ouvert .voile-tiroir { opacity: 1; pointer-events: auto; }

    .iconbtn.topbar__burger { display: inline-flex; }
}

@media (max-width: 860px) {
    .usermenu__who { display: none; }
    .usermenu__button { padding: 0 .6rem 0 .3rem; }
    .usermenu__panel { right: -.3rem; }
    .content { padding: .25rem 1rem 2rem; }
    .topbar { padding: .75rem 1rem; gap: .5rem; }
    .topbar__title { font-size: 1.2rem; }
    .topbar__hello { display: none; }
    .topbar .iconbtn:not(.topbar__burger) { display: none; }
    /* L'établissement passe sur sa propre ligne, en pleine largeur. */
    .topbar { flex-wrap: wrap; }
    .topbar__heading { flex: 1; }
    .topbar__spacer { display: none; }
    .lieu { order: 5; flex: 1 1 100%; max-width: none; height: 40px; }
    .topbar .lieu__select { max-width: none; flex: 1; }

    /* Un tableau large défile dans sa carte plutôt que d'élargir la page. */
    .card { overflow-x: auto; }
    .card.stat { overflow: hidden; }
    .table { min-width: 560px; }
}

/* --- Choix exclusif présenté en blocs ---------------------------------- */

.choice {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--ink-200);
    border-radius: 14px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .2s var(--ease);
}

.choice:hover { border-color: var(--ink-300); box-shadow: var(--shadow-sm); }
.choice input { margin-top: .25rem; flex: none; }
.choice:has(input:checked) { border-color: var(--brand-600); background: var(--brand-050); box-shadow: var(--ring); }

/* --- Aperçu d'un message ------------------------------------------------ */

.preview-frame {
    border: 1px solid var(--ink-100);
    border-radius: 14px;
    background: var(--ink-050);
    padding: 1.2rem 1.35rem;
    font-size: .93rem;
    line-height: 1.65;
    max-height: 420px;
    overflow: auto;
}

.preview-frame a { color: var(--brand-700); }
.preview-frame .btn-email {
    display: inline-block;
    background: var(--brand-700);
    color: var(--white);
    padding: .5rem .9rem;
    border-radius: 10px;
    font-weight: 560;
    text-decoration: none;
}

/* Le SMS se lit mieux dans une bulle, à la largeur d'un téléphone. */
.preview-sms {
    max-width: 320px;
    background: var(--brand-100);
    color: var(--ink-900);
    border-radius: 18px 18px 18px 5px;
    padding: .75rem 1rem;
    font-size: .9rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* --- Avis --------------------------------------------------------------- */

/* Barre de répartition des notes, sans image ni script. */
.repartition {
    flex: 1;
    height: 7px;
    border-radius: 99px;
    background: var(--ink-100);
    overflow: hidden;
}

.repartition > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #f7b545, var(--star));
    transform-origin: left;
    animation: jauge .9s .15s var(--ease) both;
}

@keyframes jauge { from { transform: scaleX(0); } }

.reponse-apercu {
    margin-top: .5rem;
    padding: .55rem .8rem;
    border-left: 3px solid var(--brand-500);
    border-radius: 0 10px 10px 0;
    background: var(--brand-050);
    font-size: .87rem;
    color: var(--ink-700);
}

.photo-avis {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 12px;
    border: 0;
    box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease);
}
.photo-avis:hover { transform: scale(1.04); }

/* Réponse type : un bloc cliquable qui reste lisible comme du texte. */
.suggestion {
    display: block;
    width: 100%;
    text-align: left;
    padding: .85rem 1rem;
    border: 1px solid var(--ink-200);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink-700);
    font: inherit;
    font-size: .88rem;
    line-height: 1.5;
    white-space: pre-wrap;
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease), transform .2s var(--ease);
}

.suggestion:hover { border-color: var(--brand-600); background: var(--brand-050); color: var(--ink-900); transform: translateY(-1px); }

.jeton {
    display: inline-block;
    padding: .1rem .4rem;
    margin: 0 .1rem;
    border: 1px solid var(--ink-200);
    border-radius: 6px;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: .75rem;
    color: var(--ink-600);
    cursor: pointer;
    transition: border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease-spring);
}

.jeton:hover { border-color: var(--brand-600); color: var(--brand-700); }
.jeton:active { transform: scale(.94); }

/* Emprunt d'identité : un bandeau qu'on ne peut pas ne pas voir. */
.emprunt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    margin: 0 2rem 1rem;
    padding: .8rem 1.1rem;
    border-radius: 14px;
    background: var(--warn-600, #b45309);
    color: var(--white);
    font-size: .9rem;
    line-height: 1.45;
    box-shadow: 0 10px 24px -12px rgba(163, 92, 14, .7);
}

.emprunt strong { font-weight: 640; }
.emprunt form { margin-left: auto; }

.emprunt .btn {
    background: var(--surface);
    color: var(--warn-600, #b45309);
    border-color: var(--surface);
}

@media (max-width: 860px) { .emprunt { margin: 0 1rem 1rem; } }

/* --- Moins de mouvement, si le système le demande ---------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* --- Pagination --------------------------------------------------------- */

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
    padding: .9rem 1.4rem;
    border-top: 1px solid var(--ink-100);
}

.pager__info { font-size: .85rem; color: var(--ink-500); }
.pager__info strong { color: var(--ink-800); font-weight: 600; font-variant-numeric: tabular-nums; }

.pager__pages { display: flex; align-items: center; gap: .25rem; margin-left: auto; }

.pager__num,
.pager__step,
.pager__gap {
    min-width: 36px;
    height: 36px;
    padding: 0 .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: .86rem;
    font-weight: 560;
    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
    transition: background .15s var(--ease), color .15s var(--ease), transform .18s var(--ease-spring);
}

.pager__num:hover,
.pager__step:hover { background: var(--ink-100); color: var(--ink-900); text-decoration: none; }
.pager__num:active,
.pager__step:active { transform: scale(.92); }

.pager__num.is-current {
    background: var(--brand-700);
    color: var(--white);
    box-shadow: 0 6px 14px -6px rgba(18, 87, 255, .7);
}

.pager__step svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pager__step.is-disabled { color: var(--ink-300); pointer-events: none; }
.pager__gap { min-width: 22px; padding: 0; color: var(--ink-400); }

@media (max-width: 600px) {
    .pager { padding: .8rem 1rem; }
    .pager__pages { margin-left: 0; width: 100%; justify-content: space-between; }
    .pager__num:not(.is-current) { display: none; }
    .pager__gap { display: none; }
}

/* --- Sélecteur d'établissement ------------------------------------------ */

.lieu--bouton { cursor: pointer; color: var(--ink-800); text-decoration: none; }
.lieu--bouton:hover { text-decoration: none; color: var(--ink-900); }
.lieu--bouton:active { transform: scale(.98); }
.lieu__nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lieu__chevron {
    width: 15px; height: 15px; flex: none;
    fill: none; stroke: var(--ink-400); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

kbd, .lieu__touche {
    display: inline-flex;
    align-items: center;
    padding: .05rem .38rem;
    border: 1px solid var(--ink-200);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: var(--ink-050);
    font-family: var(--font);
    font-size: .7rem;
    font-weight: 600;
    color: var(--ink-500);
    white-space: nowrap;
}
.lieu__touche { margin-left: .2rem; }

.selecteur {
    width: min(640px, calc(100vw - 2rem));
    max-height: min(640px, calc(100vh - 4rem));
    margin: 8vh auto auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: var(--surface);
    color: var(--ink-800);
    box-shadow: 0 30px 80px -20px rgba(15, 18, 34, .45), 0 0 0 1px rgba(15, 18, 34, .04);
    overflow: hidden;
}
.selecteur[open] { animation: selecteur .26s var(--ease-spring); }
.selecteur::backdrop {
    background: rgba(15, 18, 34, .38);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fondu .2s var(--ease);
}
.selecteur.is-sending { opacity: .6; pointer-events: none; transition: opacity .2s; }

@keyframes selecteur { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
@keyframes fondu { from { opacity: 0; } }

.selecteur__form { display: flex; flex-direction: column; max-height: inherit; }

.selecteur__recherche {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.05rem 1.3rem;
    border-bottom: 1px solid var(--ink-100);
}
.selecteur__recherche svg {
    width: 20px; height: 20px; flex: none;
    fill: none; stroke: var(--brand-700); stroke-width: 2; stroke-linecap: round;
}
.selecteur__recherche input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 1.05rem;
    color: var(--ink-900);
}
.selecteur__recherche input::placeholder { color: var(--ink-400); }
.selecteur__recherche input::-webkit-search-cancel-button { display: none; }

.selecteur__puces { display: flex; gap: .4rem; padding: .75rem 1.1rem .5rem; flex-wrap: wrap; }
.selecteur__puce {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .38rem .8rem;
    border: 1px solid var(--ink-200);
    border-radius: 999px;
    background: var(--surface);
    font: inherit;
    font-size: .82rem;
    font-weight: 560;
    color: var(--ink-600);
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.selecteur__puce span { font-size: .74rem; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.selecteur__puce:hover { border-color: var(--ink-300); color: var(--ink-900); }
.selecteur__puce.is-active { background: var(--ink-900); border-color: var(--ink-900); color: var(--surface); }
.selecteur__puce.is-active span { color: rgba(255, 255, 255, .6); }

.selecteur__liste { overflow-y: auto; padding: .25rem .6rem .6rem; flex: 1; overscroll-behavior: contain; }

.selecteur__titre {
    padding: .8rem .7rem .35rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-400);
}

.selecteur__ligne {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .55rem .7rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background .12s var(--ease);
}
.selecteur__ligne.is-focus { background: var(--brand-050); }
.selecteur__ligne.is-focus .selecteur__nom { color: var(--brand-800); }
.selecteur__ligne.is-current .selecteur__pastille { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-600); }

.selecteur__pastille {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 660;
    font-size: .9rem;
    color: hsl(var(--h) 55% 32%);
    background: hsl(var(--h) 80% 93%);
}

.selecteur__texte { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.selecteur__nom { font-weight: 580; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selecteur__nom mark { background: rgba(56, 182, 255, .22); color: inherit; border-radius: 3px; padding: 0 1px; }
.selecteur__sous { font-size: .8rem; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.selecteur__attente {
    min-width: 24px;
    height: 22px;
    padding: 0 .45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--warn-100);
    color: var(--warn-600);
    font-size: .74rem;
    font-weight: 660;
    font-variant-numeric: tabular-nums;
}

.selecteur__actuel { font-size: .74rem; font-weight: 600; color: var(--brand-700); }

.selecteur__fav {
    width: 32px;
    height: 32px;
    flex: none;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-300);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .12s var(--ease), color .15s var(--ease), transform .25s var(--ease-spring);
}
.selecteur__fav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.selecteur__ligne:hover .selecteur__fav,
.selecteur__ligne.is-focus .selecteur__fav,
.selecteur__fav.is-on { opacity: 1; }
.selecteur__fav:hover { color: var(--star); transform: scale(1.15); }
.selecteur__fav.is-on { color: var(--star); }
.selecteur__fav.is-on svg { fill: currentColor; }

.selecteur__vide, .selecteur__plus { padding: 2rem 1rem; text-align: center; color: var(--ink-500); font-size: .9rem; }
.selecteur__plus { padding: .9rem; font-size: .82rem; }

.selecteur__pied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem 1.1rem;
    padding: .75rem 1.3rem;
    border-top: 1px solid var(--ink-100);
    background: var(--ink-050);
    font-size: .78rem;
    color: var(--ink-500);
}
.selecteur__pied kbd { margin-right: .2rem; }
.selecteur__pied a { margin-left: auto; font-weight: 560; }

@media (max-width: 860px) {
    .lieu__touche { display: none; }
    .selecteur { margin-top: 1rem; max-height: calc(100vh - 2rem); }
    .selecteur__pied span { display: none; }
    .selecteur__fav { opacity: 1; }
}

/* --- Onglets ------------------------------------------------------------ */

.onglets {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .3rem;
    margin-bottom: 1.1rem;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.onglet {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .95rem;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 560;
    color: var(--ink-600);
    transition: background .15s var(--ease), color .15s var(--ease);
}
.onglet:hover { background: var(--ink-050); color: var(--ink-900); text-decoration: none; }
.onglet.is-active { background: var(--ink-900); color: var(--surface); }

.onglet__compte {
    min-width: 22px;
    padding: .05rem .45rem;
    border-radius: 999px;
    background: var(--ink-100);
    color: var(--ink-600);
    font-size: .74rem;
    font-weight: 640;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.onglet.is-active .onglet__compte { background: rgba(255, 255, 255, .16); color: var(--white); }
.onglet__compte.is-vif { background: var(--brand-700); color: var(--white); }

/* --- Actions groupées --------------------------------------------------- */

.lot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem 1rem;
    padding: .7rem 1.4rem;
    border-bottom: 1px solid var(--ink-100);
    background: var(--ink-050);
}
.lot__tout { display: inline-flex; align-items: center; gap: .55rem; font-size: .86rem; color: var(--ink-600); cursor: pointer; }
.lot__actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; opacity: .45; pointer-events: none; transition: opacity .2s var(--ease); }
.lot.is-armed { background: var(--brand-050); }
.lot.is-armed .lot__tout { color: var(--brand-800); font-weight: 600; }
.lot.is-armed .lot__actions { opacity: 1; pointer-events: auto; }

.table--messages tbody tr.is-checked { background: var(--brand-050); }
.table--messages tbody tr.is-traite { color: var(--ink-500); }
.message__texte { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9.5rem; overflow: hidden; }
.message__raisons { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.message__raisons .tag { font-size: .7rem; padding: .1rem .5rem; background: var(--bad-100); color: var(--bad-600); }
.message__actions { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.message__actions .btn { white-space: nowrap; }

/* ===========================================================================
   Mode sombre — html[data-theme="sombre"]
   Les jetons suffisent : l'échelle d'encre s'inverse, les surfaces passent
   en bleu nuit, l'accent reste le même bleu, éclairci pour les liens.
   =========================================================================== */

.sidebar__logo--clair { display: none; }
.theme-bascule__soleil { display: none; }

html[data-theme="sombre"] {
    --zebre: rgba(255, 255, 255, .065);
    color-scheme: dark;

    --brand-100: #1b2b5e;
    --brand-050: #141f42;
    --brand-800: #a9c4ff;

    --ink-900: #f2f5fc;
    --ink-800: #dfe5f1;
    --ink-700: #c5cddd;
    --ink-600: #a6b0c6;
    --ink-500: #8893ab;
    --ink-400: #69738d;
    --ink-300: #4a536d;
    --ink-200: #2d3550;
    --ink-100: #222941;
    --ink-050: #1a2036;

    --surface: #141a2e;
    --canvas: #0b0f1e;

    --tint-1: #172550;  --tint-1-ink: #8eb0ff;
    --tint-2: #0e2c45;  --tint-2-ink: #7fd0ff;
    --tint-3: #12302a;  --tint-3-ink: #66d6a6;
    --tint-4: #3b1630;  --tint-4-ink: #ff8cbe;

    --ok-600: #66d6a6;
    --ok-100: #10302a;
    --warn-600: #f5b766;
    --warn-100: #3a2a12;
    --bad-600: #ff8a7f;
    --bad-100: #3a1718;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 12px 28px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 24px 48px -12px rgba(0, 0, 0, .6);
    --ring: 0 0 0 4px rgba(56, 182, 255, .22);
}

html[data-theme="sombre"] a:not(.btn):not(.iconbtn):not(.onglet):not([class*="sidebar"]):not([class*="usermenu"]) { color: #7ea6ff; }
html[data-theme="sombre"] a:not(.btn):hover { color: #a9c4ff; }
html[data-theme="sombre"] ::selection { background: #1f3a8a; color: #fff; }

html[data-theme="sombre"] .sidebar__logo--fonce { display: none; }
html[data-theme="sombre"] .sidebar__logo--clair { display: block; }
html[data-theme="sombre"] .barre-repliee .sidebar__logo--clair,
html.barre-repliee[data-theme="sombre"] .sidebar__logo--clair { display: none; }

html[data-theme="sombre"] .theme-bascule__lune { display: none; }
html[data-theme="sombre"] .theme-bascule__soleil { display: block; }

/* Champs : fond légèrement plus clair que la carte pour rester lisibles. */
html[data-theme="sombre"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="sombre"] select,
html[data-theme="sombre"] textarea {
    background-color: #0f1426;
    color: var(--ink-800);
    border-color: var(--ink-200);
}
html[data-theme="sombre"] input::placeholder,
html[data-theme="sombre"] textarea::placeholder { color: var(--ink-400); }

/* Images de capture et logos clients : on n'inverse rien, on adoucit l'éclat. */
html[data-theme="sombre"] .card img:not([src$=".svg"]) { filter: brightness(.92); }

/* La bascule elle-même : passage en douceur des couleurs. */
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease) !important;
}
.theme-bascule svg { transition: transform .5s var(--ease-spring); }
.theme-bascule:hover svg { transform: rotate(-20deg); }
html[data-theme="sombre"] .topbar { background: rgba(11, 15, 30, .82); }
html[data-theme="sombre"] .selecteur__puce.is-active span { color: rgba(20, 26, 46, .6); }
html[data-theme="sombre"] .onglet.is-active .onglet__compte { background: rgba(20, 26, 46, .14); color: var(--surface); }
/* Logos clair / foncé : la règle « .sidebar__brand img » est plus forte que
   les classes seules, d'où ces sélecteurs qualifiés. */
.sidebar__brand .sidebar__logo--clair { display: none; }
html[data-theme="sombre"] .sidebar__brand .sidebar__logo--fonce { display: none; }
html[data-theme="sombre"] .sidebar__brand .sidebar__logo--clair { display: block; }
@media (min-width: 1081px) {
    html.barre-repliee[data-theme="sombre"] .sidebar__brand .sidebar__logo--clair { display: none; }
}

/* Mode sombre : ce qui était « encre foncée + texte blanc » passe en bleu de
   marque, sinon l'encre (devenue claire) rendrait le texte illisible. */
html[data-theme="sombre"] .sidebar__link.is-active {
    background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
    color: #fff;
    box-shadow: 0 8px 20px -8px rgba(18, 87, 255, .7);
}
html[data-theme="sombre"] .sidebar__link.is-active .sidebar__icon { color: #fff; }
html[data-theme="sombre"] .sidebar__link.is-active::after { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }

html[data-theme="sombre"] .btn:not(.btn--ghost):not(.btn--quiet):not(.btn--danger) { background: var(--brand-700); color: #fff; }
html[data-theme="sombre"] .btn:not(.btn--ghost):not(.btn--quiet):not(.btn--danger):hover { background: var(--brand-600); }

html[data-theme="sombre"] .bulle-menu { background: #e9eefb; color: #0b0f1e; }
html[data-theme="sombre"] .emprunt { background: #b45309; color: #fff; }
html[data-theme="sombre"] .btn--danger { background: #c2352b; color: #fff; }

/* Pictogrammes des boutons (posés par app.js d'après le libellé). */
.btn__picto {
    width: 16px;
    height: 16px;
    flex: none;
    margin-left: -.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .25s var(--ease-spring);
}
.btn--sm .btn__picto { width: 14px; height: 14px; }
.btn:hover .btn__picto { transform: scale(1.12); }
a.btn:hover .btn__picto path[d^="M19 12H5"] { transform: translateX(-2px); }
.btn { white-space: nowrap; }
.table td .row { flex-wrap: wrap; row-gap: .35rem; }

/* Détail d'une demande : ce qui a été envoyé */
.envoye { margin-top: 1.25rem; }
.envoye__liste { display: grid; }
.envoye__item + .envoye__item { border-top: 1px solid var(--ink-100); }
.envoye__item summary {
    display: flex; align-items: center; gap: .85rem;
    padding: .95rem 1.35rem; cursor: pointer; list-style: none;
}
.envoye__item summary::-webkit-details-marker { display: none; }
.envoye__item summary::after {
    content: ""; width: .55rem; height: .55rem; margin-left: .25rem;
    border-right: 2px solid var(--ink-400, #8a93a6); border-bottom: 2px solid var(--ink-400, #8a93a6);
    transform: rotate(45deg); transition: transform .2s;
}
.envoye__item[open] summary::after { transform: rotate(-135deg); }
.envoye__item summary:hover { background: var(--ink-050); }
.envoye__titre { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.envoye__titre + .tag { margin-left: auto; }
.envoye__canal {
    flex: 0 0 auto; width: 2.2rem; height: 2.2rem; border-radius: 10px;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #1257ff, #38b6ff);
}
.envoye__canal--sms { background: linear-gradient(135deg, #0f9f6e, #34d399); }
.envoye__canal svg { width: 1.1rem; height: 1.1rem; }
.envoye__corps { padding: 0 1.35rem 1.35rem; }
.envoye__entete {
    display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem;
    margin: 0 0 1rem; padding: .85rem 1rem; border-radius: 12px; background: var(--ink-050);
    font-size: .92rem;
}
.envoye__entete dt { color: var(--ink-500, #6b7280); }
.envoye__entete dd { margin: 0; word-break: break-word; }
.envoye__erreur { color: #c2352b; }
.envoye__mail {
    display: block; width: 100%; height: 560px; border: 1px solid var(--ink-100);
    border-radius: 14px; background: #fff;
}
.envoye__sms {
    max-width: 26rem; padding: .8rem 1rem; border-radius: 18px 18px 18px 4px;
    background: var(--ink-050); border: 1px solid var(--ink-100); line-height: 1.5;
    margin-bottom: .4rem; word-break: break-word;
}
.envoye__texte {
    white-space: pre-wrap; font: inherit; font-size: .92rem; margin: 0;
    padding: 1rem; border-radius: 12px; background: var(--ink-050);
}
.envoye__note {
    margin: 0 0 1rem; padding: .7rem .95rem; border-radius: 12px; font-size: .88rem;
    background: var(--tint-1); color: var(--tint-1-ink);
}

/* Mode sombre : bordures des bandeaux (les teintes claires d'origine brillaient) */
html[data-theme="sombre"] .alert--info { border-color: #2c4386; }
html[data-theme="sombre"] .alert--ok   { border-color: #1f5a41; }
html[data-theme="sombre"] .alert--warn { border-color: #6b4a1c; }
html[data-theme="sombre"] .alert--bad  { border-color: #6e2a25; }
html[data-theme="sombre"] .alert__close:hover { background: rgba(255, 255, 255, .08); }

/* Page Accès API */
.api { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 1.25rem; align-items: start; }
.api__principal, .api__cote { display: grid; gap: 1.25rem; min-width: 0; }
.api .card { margin: 0; }
@media (max-width: 1080px) { .api { grid-template-columns: 1fr; } }
.api__intro { margin: 0 0 1.1rem; color: var(--ink-600); }
.api__pastille {
    flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: 12px;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #1257ff, #38b6ff);
}
.api__pastille svg { width: 1.25rem; height: 1.25rem; }
.api__cle, .api__vide {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: 1rem 1.1rem; border: 1px solid var(--ink-100); border-radius: 14px; background: var(--ink-050);
}
.api__vide h3 { margin: 0 0 .2rem; font-size: 1rem; }
.api__vide p { margin: 0; }
.api__vide form { margin-left: auto; }
.api__cle-texte { display: grid; gap: .15rem; }
.api__etapes { list-style: none; counter-reset: etape; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.api__etapes li { counter-increment: etape; position: relative; padding-left: 2.4rem; }
.api__etapes li::before {
    content: counter(etape); position: absolute; left: 0; top: -.1rem;
    width: 1.65rem; height: 1.65rem; border-radius: 50%; display: grid; place-items: center;
    font-size: .8rem; font-weight: 650; background: var(--brand-050); color: var(--brand-700);
}
.api__ligne {
    display: flex; align-items: center; gap: .6rem; margin-top: .45rem;
    padding: .55rem .6rem .55rem .9rem; border-radius: 10px;
    background: var(--ink-050); border: 1px solid var(--ink-100);
}
.api__ligne code { flex: 1; min-width: 0; font-size: .86rem; overflow-x: auto; white-space: nowrap; background: none; padding: 0; }
.api__ligne--code { background: #0f1424; border-color: #0f1424; }
.api__ligne--code code { color: #cfe0ff; }
.api__ligne--code .btn { color: #cfe0ff; }
.api__points td:first-child { width: 4.2rem; }
.api__verbe {
    display: inline-block; min-width: 3.2rem; text-align: center; padding: .15rem .45rem; border-radius: 6px;
    font: 650 .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--tint-3); color: var(--tint-3-ink);
}
.api__verbe--ecrit { background: var(--tint-1); color: var(--tint-1-ink); }
.api__limites { display: grid; gap: .8rem; }
.api__limite {
    display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border-radius: 14px;
    background: var(--tint-3); line-height: 1.3;
}
.api__limite--ecrit { background: var(--tint-1); }
.api__limite-chiffre { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: var(--tint-3-ink); min-width: 4.2rem; }
.api__limite--ecrit .api__limite-chiffre { color: var(--tint-1-ink); }
.api__cle, .api__vide { max-width: 100%; min-width: 0; box-sizing: border-box; }
.api__cle-texte { flex: 1 1 8rem; min-width: 0; }
.api__cle .row { flex-wrap: wrap; justify-content: flex-end; }
.api__principal, .api__cote { grid-template-columns: minmax(0, 1fr); }
.api__etapes, .api__limites { grid-template-columns: minmax(0, 1fr); }
.api__ligne--code code { white-space: pre-wrap; word-break: break-all; overflow: visible; line-height: 1.5; }

/* Page Expéditeur : blocs propres à un mode */
[data-mode-pour][hidden] { display: none !important; }
[data-mode-pour]:not([hidden]) { animation: apparition-mode .25s ease; }
@keyframes apparition-mode { from { opacity: 0; transform: translateY(-4px); } }

/* Boutons posés à côté de champs étiquetés : même hauteur que le champ,
   alignés sur son bord bas (filtres d'administration, abonnement…). */
.row:has(> .field) { align-items: flex-end; }
.row:has(> .field) > .btn,
.row:has(> .field) > form > .btn {
    min-height: 2.8125rem;
    padding-inline: 1rem;
}
/* Même règle pour les barres de filtres sans étiquette. */
.row:has(> .input, > .select) > .btn,
.row:has(> .input, > .select) > form > .btn {
    min-height: 2.8125rem;
    padding-inline: 1rem;
}
/* Case à cocher dans une barre de filtres : même gabarit qu'un champ. */
.row:has(> .field) > .choice,
.row:has(> .input, > .select) > .choice {
    box-sizing: border-box;
    height: 2.8125rem;
    padding: 0 .95rem;
    align-items: center;
    gap: .55rem;
    border-radius: 12px;
    font-size: .93rem;
    white-space: nowrap;
}
.row:has(> .field) > .choice input,
.row:has(> .input, > .select) > .choice input { margin: 0; }

/* Fiche compte (administration) */
.fiche-compte {
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
    padding: 1.35rem 1.5rem; margin-bottom: 1.25rem;
}
.fiche-compte__identite { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.fiche-compte__identite h2 { margin: 0; font-size: 1.3rem; }
.fiche-compte__avatar {
    flex: 0 0 auto; width: 3.2rem; height: 3.2rem; border-radius: 16px;
    display: grid; place-items: center; color: #fff; font-weight: 700; letter-spacing: .02em;
    background: linear-gradient(135deg, #1257ff, #38b6ff);
}
.fiche-compte__chiffres { display: flex; gap: .6rem; flex-wrap: wrap; }
.fiche-compte__chiffres > div {
    display: grid; justify-items: center; min-width: 6.2rem; padding: .6rem .9rem;
    border-radius: 12px; background: var(--ink-050); border: 1px solid var(--ink-100);
}
.fiche-compte__chiffres strong { font-size: 1.35rem; line-height: 1.2; }
.fiche-compte__chiffres span { font-size: .78rem; color: var(--ink-500); }
.fiche-compte__grille {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.25rem; align-items: start;
}
.fiche-compte__grille > * { min-width: 0; }
.fiche-compte__ville { grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .fiche-compte__grille { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .fiche-compte__ville { grid-template-columns: 1fr; } }
.fiche-compte__duo { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 640px) { .fiche-compte__duo { grid-template-columns: 1fr; } }

/* --- Nouvelle demande : éditeur du message et listes d'exemples ---------- */
.editeur-message {
    min-height: 220px;
    max-height: 520px;
    overflow-y: auto;
    height: auto;
    padding: .8rem .95rem;
    line-height: 1.6;
    white-space: normal;
    cursor: text;
}
.editeur-message:focus { outline: none; }
.editeur-message p { margin: 0 0 .7em; }
.editeur-message p:last-child { margin-bottom: 0; }
.editeur-message a { color: var(--brand-700); }
.editeur-message .btn-email {
    display: inline-block;
    background: var(--brand-700);
    color: var(--white);
    padding: .4rem .8rem;
    border-radius: 9px;
    text-decoration: none;
}
.select--sm { width: auto; max-width: 62%; padding-top: .3rem; padding-bottom: .3rem; font-size: .82rem; }
.apercu-demande { position: sticky; top: 1rem; align-self: start; }
.demande-nouvelle [data-canal][hidden] { display: none !important; }

/* --- Délivrabilité : états de la file d'envoi ---------------------------- */
.file-etats { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.file-etats__ligne {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(60px, 1fr) auto 4.2rem;
    align-items: center;
    gap: .8rem;
    font-size: .92rem;
}
.file-etats__label { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; }
.file-etats__pastille { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ink-300, #9aa3b2); }
.file-etats__pastille--ok { background: var(--ok-600, #1f9d55); }
.file-etats__pastille--info { background: var(--brand-600, #1257ff); }
.file-etats__pastille--warn { background: var(--warn-600, #d97706); }
.file-etats__pastille--bad { background: var(--bad-600, #dc2626); }
.file-etats__barre { height: 6px; border-radius: 3px; background: var(--ink-100, #e6e9ee); overflow: hidden; }
.file-etats__barre-remplie { display: block; height: 100%; border-radius: 3px; width: auto; }
.file-etats__nombre { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.file-etats__part { font-size: .8rem; color: var(--ink-500, #6b7686); text-align: right; font-variant-numeric: tabular-nums; }

/* --- Admin : facturation ------------------------------------------------ */
.facturation-etats { display: grid; gap: .9rem; }
.facturation-etats__groupe { display: grid; gap: .3rem; }
.facturation-etats__formule {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-left: 1.35rem;
    font-size: .84rem;
    color: var(--ink-500, #6b7686);
    font-variant-numeric: tabular-nums;
}
.file-etats__pastille--muted { background: var(--ink-300, #9aa3b2); }

/* --- Admin : envois ----------------------------------------------------- */
.envois td { vertical-align: top; }
.envois__etat { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; font-size: .9rem; }
.envois__objet { margin-top: .25rem; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-600); }
.envois__erreur { margin-top: .25rem; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bad-600, #dc2626); }
.envoi-fiche { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.2rem; margin: 0; font-size: .92rem; }
.envoi-fiche dt { color: var(--ink-500, #6b7686); }
.envoi-fiche dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.envoi-suivi { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .9rem; }
.envoi-suivi li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.envoi-apercu { width: 100%; height: 620px; border: 1px solid var(--ink-100, #e6e9ee); border-radius: 12px; background: #fff; }
.envoi-texte { max-width: 46ch; padding: 1rem 1.1rem; border-radius: 16px; background: var(--ink-050, #f3f5f8); font-size: .95rem; line-height: 1.5; }

/* --- Avis : saisie et import -------------------------------------------- */
[data-si-autre][hidden], [data-si-plateforme][hidden] { display: none !important; }
.import-depot { padding: 1rem 1.1rem; border: 1px dashed var(--ink-200, #d5dae2); border-radius: 14px; }
.import-apercu__texte { max-width: 42ch; color: var(--ink-600); }
.connexions-titre { margin: 1.6rem 0 .8rem; font-size: 1.05rem; }
.connexions-autres .card { display: flex; flex-direction: column; }
.connexions-autres .card__body { flex: 1; }
.connexions-import { margin-top: 1rem; }

/* Avis : réponse à recopier sur une plateforme sans publication directe. */
.recopie { margin-bottom: 1rem; gap: .5rem; align-items: center; }

/* Avis : propositions de réponse en lot (/app/avis/propositions). */
.lot-tete { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; }
.lot-tete > div { flex: 1 1 360px; }
.lot-filtres { gap: .5rem; }
.lot-progression { height: 3px; background: var(--ink-100); border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.lot-progression span { display: block; height: 100%; width: 0; background: var(--brand-500); transition: width .3s var(--ease); }
.lot-liste { display: grid; gap: .75rem; margin-top: 1rem; }
.lot-avis { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.25rem; padding: 1.1rem 1.25rem; transition: box-shadow .2s var(--ease); }
.lot-avis--encours { box-shadow: 0 0 0 2px var(--brand-500); }
.lot-avis__texte { margin: 0; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.lot-avis__reponse .textarea { width: 100%; min-height: 7.5rem; }
.lot-avis__actions { gap: .4rem .6rem; align-items: center; margin-top: .5rem; }
.lot-coche { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; margin-right: auto; cursor: pointer; }
.lot-barre { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; justify-content: flex-end;
    margin-top: 1rem; padding: .75rem 1rem; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.lot-barre #compte-coches { margin-right: auto; }
@media (max-width: 760px) { .lot-avis { grid-template-columns: 1fr; } }
