/* Filtres — barre compacte + tiroir « Filtres », style Apple (26/10/2026). Le comportement est dans filtres.js.
   Barre : une ligne (recherche, 3-4 filtres rapides, bouton Filtres), puces des filtres actifs en dessous. Détail : tiroir à droite (feuille plein écran sur téléphone). */

:root {
    --ft-champ: #f2f3f5;
    --ft-champ-2: #e9ebee;
    --ft-teinte: rgba(13, 58, 72, 0.09);
    --ft-anneau: 0 0 0 3px rgba(13, 58, 72, 0.16);
    --ft-h: 42px;
    --ft-r: 14px;
    --ft-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236b7876' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ================= barre ================= */
form.ft-actif { display: block; position: relative; background: transparent; box-shadow: none; padding: 0; overflow: visible; }
.card.filters-bar:has(form.ft-actif), .card.filters-inline:has(form.ft-actif) { padding: 12px 14px; }
form.filters.ft-actif { background: #fff; border-radius: 22px; padding: 12px 14px; margin-bottom: 1rem; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 8px 24px -16px rgba(0, 0, 0, 0.16); }
form.ft-actif .field, form.ft-actif .filters-bar-actions { display: contents; }

.ft-barre { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-height: var(--ft-h); }
.ft-recherche {
    position: relative; display: flex; align-items: center; flex: 1 1 280px; max-width: 520px; min-width: 0; margin: 0;
    height: var(--ft-h); border-radius: var(--ft-r); background: var(--ft-champ); color: var(--color-muted); transition: background-color .15s, box-shadow .15s;
}
.ft-recherche > svg { position: absolute; left: 13px; pointer-events: none; }
.ft-recherche:hover { background: var(--ft-champ-2); }
.ft-recherche:focus-within { background: #fff; box-shadow: var(--ft-anneau), inset 0 0 0 1px var(--color-primary); }
.ft-recherche .ft-saisie {
    -webkit-appearance: none; appearance: none; width: 100%; height: 100%; margin: 0; padding: 0 38px 0 40px; border: 0; background: transparent; box-shadow: none; outline: none;
    color: var(--color-text); font: 500 14.5px/1.2 var(--font-sans); max-width: none; min-width: 0;
}
.ft-recherche .ft-saisie::placeholder { color: #8a9490; font-weight: 400; }
.ft-efface { position: absolute; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.08); color: #4b5560; display: none; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ft-recherche.a-du-texte .ft-efface { display: inline-flex; }
.ft-sans-recherche { display: none; }

/* filtres rapides */
.ft-rapides { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.ft-rapide { position: relative; }
.ft-rapide-bouton {
    display: inline-flex; align-items: center; gap: 7px; height: var(--ft-h); padding: 0 12px 0 14px; border: 0; border-radius: var(--ft-r);
    background: var(--ft-champ); color: var(--color-muted); font: 500 14px/1 var(--font-sans); cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s;
}
.ft-rapide-bouton:hover { background: var(--ft-champ-2); }
.ft-rapide-bouton .ft-rapide-val { color: var(--color-primary); font-weight: 650; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.ft-rapide-bouton .ft-rapide-val:empty { display: none; }
.ft-rapide-bouton > svg { color: #8a9490; flex: none; transition: transform .18s; }
.ft-rapide.is-ouvert .ft-rapide-bouton > svg { transform: rotate(180deg); }
.ft-rapide.is-ouvert .ft-rapide-bouton { background: #fff; box-shadow: var(--ft-anneau), inset 0 0 0 1px var(--color-primary); }
.ft-rapide.is-actif .ft-rapide-bouton { background: var(--ft-teinte); color: var(--color-primary); font-weight: 650; }
.ft-rapide.is-actif .ft-rapide-nom::after { content: " :"; }

.ft-menu {
    position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 230px; max-width: min(320px, 92vw); padding: 6px;
    background: rgba(255, 255, 255, 0.98); border-radius: 16px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 22px 44px -14px rgba(0, 0, 0, 0.32);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.ft-menu[hidden] { display: none; }
.ft-menu.ft-menu-droite { left: auto; right: 0; }
.ft-menu-recherche { width: 100%; height: 38px; margin: 2px 0 6px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--ft-champ); font: 400 14px var(--font-sans); outline: none; }
.ft-menu-liste { max-height: min(340px, 52vh); overflow-y: auto; overscroll-behavior: contain; }
.ft-menu-ligne {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent;
    color: var(--color-text); font: 500 14px/1.2 var(--font-sans); text-align: left; cursor: pointer;
}
.ft-menu-ligne[hidden] { display: none; }
.ft-menu-ligne:hover, .ft-menu-ligne:focus-visible { background: var(--ft-champ); outline: none; }
.ft-menu-ligne i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ft-menu-ligne span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-menu-ligne em { width: 16px; color: var(--color-primary); opacity: 0; font-style: normal; display: inline-flex; }
.ft-menu-ligne.is-choisi { font-weight: 650; }
.ft-menu-ligne.is-choisi em { opacity: 1; }
.ft-menu-ligne.est-vide { color: var(--color-muted); }

/* bouton Filtres */
.ft-ouvrir {
    display: inline-flex; align-items: center; gap: 8px; height: var(--ft-h); padding: 0 16px; margin-left: auto; border: 0; border-radius: 999px;
    background: var(--ft-champ); color: var(--color-primary); font: 650 14px/1 var(--font-sans); cursor: pointer; white-space: nowrap; transition: background-color .15s;
}
.ft-ouvrir:hover { background: var(--ft-champ-2); }
.ft-ouvrir.is-actif { background: var(--color-primary); color: #fff; }
.ft-nb { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--color-primary); font: 700 12px/20px var(--font-sans); text-align: center; }
.ft-nb[hidden] { display: none; }
.ft-reset { color: var(--color-muted); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; padding: 0 4px; }
.ft-reset:hover { color: var(--color-primary); text-decoration: underline; }
.ft-reset[hidden] { display: none; }

/* puces des filtres actifs */
.ft-actives { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ft-actives[hidden] { display: none; }
.ft-puce-active {
    display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 11px 0 12px; border: 0; border-radius: 999px; background: var(--ft-teinte);
    color: var(--color-primary); font: 500 13px/1 var(--font-sans); cursor: pointer; transition: background-color .15s;
}
.ft-puce-active b { font-weight: 700; }
.ft-puce-active svg { opacity: .55; }
.ft-puce-active:hover { background: rgba(13, 58, 72, 0.16); }
.ft-puce-active:hover svg { opacity: 1; }

/* ================= tiroir ================= */
body.ft-bloque { overflow: hidden; }
.ft-voile { position: fixed; inset: 0; z-index: 2050; background: rgba(8, 28, 36, 0.36); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
.ft-voile.is-ouvert { opacity: 1; }
.ft-tiroir {
    position: fixed; z-index: 2051; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: #fff;
    border-radius: 26px 0 0 26px; box-shadow: -24px 0 60px -20px rgba(0, 0, 0, 0.35); transform: translateX(104%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
.ft-tiroir.is-ouvert { transform: translateX(0); }
.ft-tiroir[hidden], .ft-voile[hidden] { display: none; }
.ft-tete { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 12px; }
.ft-tete h2 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -0.01em; color: var(--color-text); }
.ft-poignee { display: none; }
.ft-fermer { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--ft-champ); color: #4b5560; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ft-fermer:hover { background: var(--ft-champ-2); }
.ft-corps { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 22px 20px; }
.ft-section { padding: 16px 0 6px; border-top: 1px solid #eef0f2; }
.ft-section:first-child { border-top: 0; padding-top: 6px; }
.ft-section h3 { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-muted); }
.ft-champ { margin-bottom: 16px; }
.ft-etiquette { margin: 0 0 7px 2px; font-size: 13px; font-weight: 650; color: var(--color-text); }
.ft-choix { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-choix-puce {
    display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--ft-champ); color: var(--color-text);
    font: 500 13.5px/1.2 var(--font-sans); cursor: pointer; text-align: left; transition: background-color .15s, color .15s, transform .08s;
}
.ft-choix-puce i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ft-choix-puce:hover { background: var(--ft-champ-2); }
.ft-choix-puce:active { transform: scale(.97); }
.ft-choix-puce.is-choisi { background: var(--color-primary); color: #fff; font-weight: 650; }
.ft-choix-puce.is-choisi i { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.ft-cache { display: none !important; }
.ft-corps select.ft-liste, .ft-corps .ft-saisie-champ {
    -webkit-appearance: none; appearance: none; width: 100%; height: var(--ft-h); padding: 0 34px 0 14px; border: 0; border-radius: var(--ft-r); background-color: var(--ft-champ); color: var(--color-text);
    font: 500 14px/1.2 var(--font-sans); max-width: none;
}
.ft-corps select.ft-liste { background-image: var(--ft-chevron); background-repeat: no-repeat; background-position: right 13px center; background-size: 12px; cursor: pointer; }
.ft-corps .ft-saisie-champ { padding-right: 12px; }
.ft-corps select.ft-liste:focus, .ft-corps .ft-saisie-champ:focus { outline: none; background-color: #fff; box-shadow: var(--ft-anneau), inset 0 0 0 1px var(--color-primary); }
.ft-corps .ft-integre { margin: 0; }
.ft-corps .ft-integre summary { display: flex; align-items: center; justify-content: space-between; height: var(--ft-h); padding: 0 14px; border-radius: var(--ft-r); background: var(--ft-champ); color: var(--color-text); font: 500 14px var(--font-sans); border: 0; list-style: none; cursor: pointer; }
.ft-corps .ft-integre .panneau { position: static; margin-top: 8px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--ft-champ); box-shadow: none; min-width: 0; }

.ft-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #eef0f2; background: rgba(255, 255, 255, 0.96); }
.ft-reset-pied { color: var(--color-muted); font-weight: 600; font-size: 14px; text-decoration: none; padding: 10px 6px; }
.ft-reset-pied:hover { color: var(--color-primary); text-decoration: underline; }
.ft-appliquer { flex: 1 1 auto; max-width: 260px; height: 46px; border: 0; border-radius: 999px; background: var(--color-primary); color: #fff; font: 700 15px var(--font-sans); cursor: pointer; box-shadow: 0 8px 18px -10px rgba(13, 58, 72, 0.7); }
.ft-appliquer:hover { background: var(--color-primary-dark); }

/* ================= responsive ================= */
@media (max-width: 960px) {
    .ft-barre { flex-wrap: wrap; row-gap: 8px; }
    .ft-recherche { flex: 1 1 100%; max-width: none; order: 1; }
    .ft-rapides { order: 3; flex: 1 1 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
    .ft-rapides::-webkit-scrollbar { display: none; }
    .ft-ouvrir { order: 2; margin-left: 0; }
    .ft-reset { order: 4; }
    .ft-rapide-bouton { height: 38px; }
    .ft-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-width: none; border-radius: 22px; padding: 10px; }
    .ft-menu.ft-menu-droite { left: 12px; right: 12px; }
    .ft-menu-ligne { min-height: 46px; font-size: 15.5px; }
    .ft-menu-liste { max-height: 56vh; }
}
@media (max-width: 720px) {
    :root { --ft-h: 46px; }
    .ft-ouvrir { flex: 0 0 auto; }
    .ft-tiroir { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 90vh; max-height: 90vh; border-radius: 26px 26px 0 0; transform: translateY(104%); box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.4); }
    .ft-tiroir.is-ouvert { transform: translateY(0); }
    .ft-tete { padding-top: 12px; position: relative; }
    .ft-poignee { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: #d5d9dd; }
    .ft-tete h2 { margin-top: 10px; }
    .ft-corps, .ft-tete, .ft-pied { padding-left: 16px; padding-right: 16px; }
    .ft-choix-puce { min-height: 42px; font-size: 14.5px; padding: 0 16px; }
    .ft-appliquer { max-width: none; }
    .ft-corps select.ft-liste, .ft-corps .ft-saisie-champ, .ft-recherche .ft-saisie { font-size: 16px; }   /* évite le zoom automatique de Safari */
}
@media (prefers-reduced-motion: reduce) {
    .ft-tiroir, .ft-voile, .ft-rapide-bouton > svg, .ft-choix-puce { transition: none; }
}

/* Mes comptes : affectation en masse (propriétaire) — une pastille « Affecter à… [Affecter 894] » à côté de « Nouveau compte » */
.affectation-rapide { display: inline-flex; align-items: stretch; margin: 0; border: 1px solid rgba(15, 43, 54, 0.2); border-radius: 999px; background: #fff; overflow: hidden; }
.affectation-rapide select { border: 0 !important; background: transparent !important; box-shadow: none !important; outline: 0; margin: 0; padding: 0.55rem 0.4rem 0.55rem 1rem; font: inherit; font-size: 0.9rem; font-weight: 500; color: #0f2b36; max-width: 220px; cursor: pointer; }
.affectation-rapide select:focus-visible { box-shadow: inset 0 0 0 2px var(--color-primary) !important; border-radius: 999px 0 0 999px; }
.affectation-rapide button { border: 0; border-radius: 0; margin: 0; padding: 0 1.05rem; font: inherit; font-size: 0.9rem; font-weight: 600; background: var(--color-primary); color: #fff; cursor: pointer; white-space: nowrap; }
.affectation-rapide button:hover:not(:disabled) { background: #0a2e39; }
.affectation-rapide.is-inactif { opacity: 0.55; }
.affectation-rapide.is-inactif button, .affectation-rapide.is-inactif select { cursor: not-allowed; }
.affectation-rapide button:disabled { background: #8a9aa1; }
@media (max-width: 600px) { .affectation-rapide { flex: 1 1 100%; } .affectation-rapide select { flex: 1 1 auto; max-width: none; } }

/* ===== Mes comptes : répartition en anneau (27/10/2026) ===== */
.repart { display: flex; align-items: center; gap: 1.6rem 2.2rem; flex-wrap: wrap; margin: 0.4rem 0 0.9rem; padding: 1rem 1.4rem; border-radius: 24px; background: #fff; box-shadow: var(--shadow-md); border: 1px solid rgba(15, 43, 54, 0.05); }
.repart-donut { position: relative; width: 150px; height: 150px; flex: none; }
.repart-donut svg { width: 100%; height: 100%; overflow: visible; }
.repart-piste { fill: none; stroke: #eef1f3; stroke-width: 13; }
.repart-arc { fill: none; stroke-width: 13; stroke-linecap: butt; cursor: pointer; transition: stroke-width 0.2s, opacity 0.2s, filter 0.2s; animation: repart-trace 0.9s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.repart-arc:hover { stroke-width: 17; filter: drop-shadow(0 4px 8px rgba(8, 28, 36, 0.3)); }
.repart-arc.est-actif { stroke-width: 18; }
.a-selection .repart-arc:not(.est-actif) { opacity: 0.28; }
@keyframes repart-trace { from { stroke-dasharray: 0 400; } }
.repart-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: #0f2b36; text-align: center; pointer-events: none; }
.repart-centre b { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.repart-centre small { margin-top: 0.15rem; font-size: 0.74rem; font-weight: 600; color: #6b7b82; }
.repart-liste { flex: 1 1 360px; min-width: 0; list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.repart-ligne { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; grid-template-areas: "pt nom nb pc" ". desc desc desc"; align-items: center; gap: 0.1rem 0.7rem; padding: 0.7rem 1rem; border-radius: 16px; background: #f6f8f9; color: #0f2b36; text-decoration: none; transition: background 0.15s, box-shadow 0.15s, transform 0.1s; }
.repart-ligne:hover { background: #eef3f5; }
.repart-ligne:active { transform: scale(0.99); }
.repart-ligne.is-actif { background: #fff; box-shadow: 0 0 0 2px var(--c), 0 8px 20px -10px rgba(8, 28, 36, 0.35); }
.repart-ligne i { grid-area: pt; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.repart-nom { grid-area: nom; font-size: 0.98rem; font-weight: 700; }
.repart-ligne b { grid-area: nb; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.repart-ligne em { grid-area: pc; min-width: 3.4rem; text-align: right; font-style: normal; font-size: 0.8rem; font-weight: 600; color: #6b7b82; font-variant-numeric: tabular-nums; }
.repart-ligne small { grid-area: desc; font-size: 0.78rem; line-height: 1.35; color: #6b7b82; }
.repart-tous a { display: inline-flex; align-items: baseline; gap: 0.5rem; padding: 0.25rem 0.3rem; font-size: 0.84rem; font-weight: 600; color: #4d5d65; text-decoration: none; }
.repart-tous a b { color: #0f2b36; font-variant-numeric: tabular-nums; }
.repart-tous a.is-actif { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .repart { padding: 0.9rem 1rem; justify-content: center; } .repart-liste { flex-basis: 100%; } }
@media (prefers-reduced-motion: reduce) { .repart-arc { animation: none; } }
