/* ==========================================================================
   Orbite — Personal Relationship Manager
   Style « Aurora » : nuit indigo, halos lumineux, cartes claires très arrondies.
   Palette : 4 couleurs (indigo, menthe, corail, soleil) + violet d'accent + neutres.
   Typo : Outfit (titres) + Plus Jakarta Sans (texte).
   ========================================================================== */

:root {
  --prm-blue: #5B5BF0;
  --prm-violet: #8B5CF6;
  --prm-mint: #10B981;
  --prm-coral: #FF5C7A;
  --prm-sun: #F59E0B;

  --prm-blue-soft: rgba(91, 91, 240, .11);
  --prm-mint-soft: rgba(16, 185, 129, .13);
  --prm-coral-soft: rgba(255, 92, 122, .13);
  --prm-sun-soft: rgba(245, 158, 11, .15);

  --prm-night: #0B0F2A;
  --prm-night-2: #151A3D;
  --prm-grad: linear-gradient(135deg, #6366F1 0%, #8B5CF6 55%, #C062F0 100%);
  --prm-aurora:
    radial-gradient(60% 60% at 12% 8%, rgba(99, 102, 241, .55), transparent 70%),
    radial-gradient(50% 55% at 88% 18%, rgba(192, 98, 240, .45), transparent 70%),
    radial-gradient(55% 60% at 70% 95%, rgba(16, 185, 129, .35), transparent 70%),
    radial-gradient(45% 50% at 10% 90%, rgba(255, 92, 122, .30), transparent 70%);

  --prm-bg: #F4F5FB;
  --prm-surface: #FFFFFF;
  --prm-text: #12142B;
  --prm-muted: #5F6380;
  --prm-line: rgba(18, 20, 43, .08);
  --prm-radius: 20px;
  --prm-shadow: 0 1px 2px rgba(18, 20, 43, .04), 0 8px 24px -6px rgba(18, 20, 43, .08);
  --prm-shadow-lg: 0 24px 60px -16px rgba(40, 30, 120, .35);
  --prm-font-display: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
  --prm-ease: cubic-bezier(.2, .8, .2, 1);

  --bs-primary: var(--prm-blue);
  --bs-primary-rgb: 91, 91, 240;
  --bs-body-font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: var(--prm-bg);
  --bs-body-color: var(--prm-text);
  --bs-border-color: var(--prm-line);
  --bs-link-color: var(--prm-blue);
  --bs-link-color-rgb: 91, 91, 240;
  --bs-border-radius: 12px;
  --bs-border-radius-lg: 14px;
}

html, body { height: 100%; }
body {
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-size: 15.5px;
}
h1, h2, h3, .h4, .h5, .modal-title { font-family: var(--prm-font-display); letter-spacing: -.01em; }

.btn-primary {
  --bs-btn-bg: var(--prm-blue); --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: #4B4BE0; --bs-btn-hover-border-color: transparent;
  --bs-btn-active-bg: #4040CC; --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-bg: var(--prm-blue); --bs-btn-disabled-border-color: transparent;
  background-image: var(--prm-grad); font-weight: 600;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .7);
}
.btn-primary:hover { box-shadow: 0 12px 26px -8px rgba(99, 102, 241, .8); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn { border-radius: 12px; transition: transform .18s var(--prm-ease), box-shadow .18s var(--prm-ease), background-color .18s; }
.btn-soft { background: var(--prm-blue-soft); color: var(--prm-blue); border: 0; font-weight: 600; }
.btn-soft:hover, .btn-soft:focus-visible { background: rgba(91, 91, 240, .18); color: #4040CC; }
.btn-soft-danger { background: var(--prm-coral-soft); color: #D6264A; border: 0; font-weight: 600; }
.btn-soft-danger:hover { background: rgba(255, 92, 122, .22); color: #B81E3E; }
.btn-coral { background: #D6264A; color: #fff; border: 0; font-weight: 600; box-shadow: 0 8px 20px -8px rgba(214, 38, 74, .7); }
.btn-coral:hover, .btn-coral:focus-visible { background: #B81E3E; color: #fff; }
.form-control, .form-select { border-radius: 12px; background-color: #fff; border-color: rgba(18, 20, 43, .12); }
.form-control:focus, .form-select:focus, .btn:focus-visible {
  border-color: var(--prm-blue);
  box-shadow: 0 0 0 .2rem var(--prm-blue-soft);
}
.form-label { font-size: .82rem; font-weight: 500; color: var(--prm-muted); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--prm-blue); border-color: var(--prm-blue); }

/* ---- Connexion ----------------------------------------------------------- */
.auth-screen {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100%;
  display: grid; place-items: center; padding: 24px;
  background: var(--prm-night); color: #fff;
}
/* Aurores qui dérivent lentement + orbites concentriques */
.auth-screen::before {
  content: ""; position: absolute; inset: -20%; z-index: -2;
  background: var(--prm-aurora); filter: blur(30px); opacity: .85;
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
.auth-screen::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 1500px; height: 1500px; left: 30%; top: 50%; transform: translate(-50%, -50%);
  background: repeating-radial-gradient(circle, transparent 0 139px, rgba(255, 255, 255, .08) 139px 140px);
  -webkit-mask-image: radial-gradient(circle, #000 25%, transparent 70%); mask-image: radial-gradient(circle, #000 25%, transparent 70%);
}
@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(3%, -2%, 0) rotate(6deg) scale(1.06); }
  100% { transform: translate3d(-3%, 2%, 0) rotate(-4deg) scale(1.02); }
}
.auth-card {
  position: relative; color: var(--prm-text);
  width: 100%; max-width: 380px; text-align: center;
  background: rgba(255, 255, 255, .94); border-radius: 28px; padding: 40px 30px 30px;
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55), 0 0 0 8px rgba(255, 255, 255, .06);
  backdrop-filter: blur(24px) saturate(160%);
  animation: rise .6s var(--prm-ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: 1.75rem; font-weight: 700; }
.auth-card .form-floating { text-align: left; }
.auth-card .form-floating > .form-control { background: #F6F7FC; border-color: transparent; }
.auth-card .form-floating > .form-control:focus { background: #fff; border-color: var(--prm-blue); }
.auth-card .form-floating > label { color: var(--prm-muted); }
.auth-card .form-floating > label::after { background: transparent !important; }
.auth-card .btn-lg { padding: .8rem 1rem; font-size: 1rem; }
.auth-sep { display: flex; align-items: center; gap: 10px; color: var(--prm-muted); font-size: .82rem; margin: 18px 0 14px; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; border-top: 1px solid var(--prm-line); }
.auth-card .btn-link { font-weight: 500; text-decoration: none; padding: 0; vertical-align: baseline; }

.side-user {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px;
  color: inherit; text-decoration: none;
}
.side-user:hover { background: rgba(255, 255, 255, .08); color: inherit; }
.side-user .text-secondary { color: rgba(255, 255, 255, .55) !important; }
.side-user .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: .75rem; }
.scope-select { font-size: .88rem; font-weight: 500; background-color: rgba(118, 118, 128, .1); border: 0; }
.sidebar .scope-select {
  background-color: rgba(255, 255, 255, .08); color: #fff;
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.sidebar .scope-select option { color: var(--prm-text); }
.space-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: rgba(118, 118, 128, .12); color: var(--prm-muted); white-space: nowrap;
}
.invite-banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; flex-wrap: wrap; }
.rel-row { display: grid; grid-template-columns: 150px 1fr 38px; gap: 6px; margin-bottom: 6px; }
@media (max-width: 575.98px) { .rel-row { grid-template-columns: 1fr 1fr 38px; } }
.cat-toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cat-toggle label {
  border: 1px solid var(--prm-line); border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 500; cursor: pointer; background: #fff;
}
.cat-toggle input:checked + label { background: var(--prm-blue); border-color: var(--prm-blue); color: #fff; }
.cat-toggle input:focus-visible + label { box-shadow: 0 0 0 .2rem var(--prm-blue-soft); }
.member-row .form-select { width: auto; }

.auth-logo { width: 68px; height: 68px; display: block; margin: 0 auto 16px; border-radius: 18px; filter: drop-shadow(0 10px 22px rgba(99, 102, 241, .45)); }

/* Mise en page connexion : illustration + carte */
.auth-layout {
  width: 100%; max-width: 1080px; display: grid; gap: 24px; align-items: center;
  grid-template-columns: 1fr;
  justify-items: center;
}
.auth-showcase { text-align: center; }
.auth-art { width: 100%; max-width: 250px; height: auto; margin-bottom: -24px; }
.auth-art { filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .35)); }
.auth-pitch h2 {
  font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.08; margin: 8px 0 22px; color: #fff;
  background: linear-gradient(100deg, #fff 30%, #C7C9FF 65%, #F5B6FF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; text-align: left; }
.auth-pitch li {
  display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .82); font-size: 1rem;
  padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(8px);
}
.auth-pitch .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
@media (min-width: 992px) {
  .auth-layout { grid-template-columns: 1.15fr .85fr; gap: 56px; }
  .auth-showcase { text-align: left; }
  .auth-art { max-width: 460px; margin: 0 0 4px -20px; }
  .auth-card { justify-self: start; }
}
@media (max-width: 991.98px) {
  .auth-screen { align-content: start; padding-top: 8px; }
  .auth-screen::after { left: 50%; top: 140px; }
}

/* Bandeau de bienvenue (accueil connecté) */
.hero-welcome {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; color: #fff; margin-bottom: 20px;
  padding: 26px 26px 24px; min-height: 170px;
  background: var(--prm-aurora), linear-gradient(125deg, #1B1E52 0%, #3F3AB8 45%, #7A3FD8 100%);
  box-shadow: var(--prm-shadow-lg);
}
.hero-welcome::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; width: 900px; height: 900px; right: -300px; top: 50%;
  transform: translateY(-50%);
  background: repeating-radial-gradient(circle, transparent 0 89px, rgba(255, 255, 255, .08) 89px 90px);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%);
}
.hero-welcome .art { position: absolute; right: -10px; bottom: -6px; width: 300px; max-width: 55%; opacity: .95; pointer-events: none; }
.hero-welcome .who { display: flex; align-items: center; gap: 14px; position: relative; }
.hero-welcome .who .avatar { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.2rem; box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.hero-welcome h1 { font-size: 1.9rem; font-weight: 700; margin: 0; letter-spacing: -.01em; color: #fff; }
.hero-welcome .date { opacity: .85; text-transform: capitalize; }
.hero-welcome .stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; max-width: 62%; }
.hero-welcome .stat {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: #fff;
  border-radius: 999px; padding: 7px 14px; transition: background-color .18s; font-size: .85rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  backdrop-filter: blur(6px);
}
.hero-welcome .stat:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.hero-welcome .settings-btn { position: absolute; top: 14px; right: 14px; color: #fff; background: rgba(255,255,255,.18); border: 0; }
@media (max-width: 575.98px) {
  .hero-welcome .art { width: 190px; right: -40px; top: -22px; bottom: auto; opacity: .28; }
  .hero-welcome .stats { max-width: 100%; }
  .hero-welcome h1 { font-size: 1.4rem; }
}
.brand-icon { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 16px -4px rgba(139, 92, 246, .7); }

/* Avatars avec photo */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- Structure ----------------------------------------------------------- */
.app { display: flex; min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 256px; flex: 0 0 256px;
  flex-direction: column; padding: 22px 14px; color: #fff; overflow: hidden; isolation: isolate;
  background: var(--prm-night);
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .55; pointer-events: none;
  background:
    radial-gradient(80% 35% at 0% 0%, rgba(99, 102, 241, .55), transparent 70%),
    radial-gradient(70% 30% at 100% 100%, rgba(192, 98, 240, .40), transparent 70%);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 24px;
  font-family: var(--prm-font-display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em;
}
.brand-dot {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 15px;
  background: linear-gradient(135deg, var(--prm-blue), var(--prm-mint));
}
.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, .72);
  padding: 10px 12px; border-radius: 12px; font-weight: 500; margin-bottom: 3px;
  transition: background-color .18s, color .18s;
}
.sidebar .nav-link i { font-size: 1.1rem; color: rgba(255, 255, 255, .6); width: 20px; text-align: center; transition: color .18s; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link:focus-visible { outline: 2px solid #C7C9FF; outline-offset: 2px; }
.sidebar .nav-link.active {
  background: var(--prm-grad); color: #fff; font-weight: 600;
  box-shadow: 0 10px 24px -8px rgba(139, 92, 246, .8), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.sidebar .nav-link.active i { color: #fff; }
.sidebar .nav-link .badge { margin-left: auto; }

.main {
  flex: 1; min-width: 0; padding: 32px 36px 56px; outline: none;
  background:
    radial-gradient(900px 400px at 100% -10%, rgba(139, 92, 246, .10), transparent 70%),
    radial-gradient(700px 400px at 0% 0%, rgba(99, 102, 241, .08), transparent 70%);
}
.page { max-width: 1100px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 1030;
  display: flex; justify-content: space-around; gap: 2px;
  padding: 6px; border-radius: 24px;
  background: rgba(11, 15, 42, .88); border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 16px 40px -12px rgba(11, 15, 42, .6);
  backdrop-filter: saturate(180%) blur(20px);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; justify-content: center;
  color: rgba(255, 255, 255, .62); text-decoration: none; font-size: .68rem; font-weight: 600; padding: 4px 0;
  border-radius: 18px; transition: background-color .2s, color .2s;
}
.tabbar a i { font-size: 1.3rem; line-height: 1; }
.tabbar a.active { color: #fff; background: var(--prm-grad); box-shadow: 0 8px 18px -8px rgba(139, 92, 246, .9); }

@media (max-width: 991.98px) {
  .main { padding: calc(14px + env(safe-area-inset-top)) 16px calc(100px + env(safe-area-inset-bottom)); }
}

/* ---- En-têtes de page ---------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 2.3rem; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.page-head .sub { color: var(--prm-muted); font-size: .95rem; text-transform: capitalize; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.btn-round {
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  display: inline-grid; place-items: center; font-size: 1.15rem;
}
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--prm-blue); text-decoration: none; font-weight: 500; margin-bottom: 8px; }

/* ---- Cartes & listes groupées (style iOS) ----------------------------------- */
.card-g {
  background: var(--prm-surface); border-radius: var(--prm-radius); border: 1px solid var(--prm-line);
  box-shadow: var(--prm-shadow); overflow: hidden; margin-bottom: 18px;
}
.card-g-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px 8px;
  font-family: var(--prm-font-display); font-weight: 600; font-size: 1.05rem;
}
.card-g-head .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: .95rem; }
.card-g-head .more { margin-left: auto; font-family: var(--bs-body-font-family); font-weight: 600; font-size: .85rem; text-decoration: none; }
.card-g-body { padding: 6px 16px 16px; }
.section-label {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--prm-muted);
  font-weight: 600; margin: 22px 4px 8px;
}

.list-g { list-style: none; margin: 0; padding: 0; }
.list-g > li { position: relative; }
.list-g > li + li::before {
  content: ""; position: absolute; top: 0; right: 0; left: 60px; border-top: 1px solid var(--prm-line);
}
.list-g.flat > li + li::before { left: 16px; }
.row-g {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 52px;
  color: inherit; text-decoration: none; background: none; border: 0; width: 100%; text-align: left;
}
button.row-g, a.row-g { transition: background-color .15s; }
button.row-g:hover, a.row-g:hover { background: rgba(91, 91, 240, .045); }
.row-g .main-txt { flex: 1; min-width: 0; }
.row-g .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-g .s { color: var(--prm-muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-g .end { color: var(--prm-muted); font-size: .85rem; text-align: right; flex-shrink: 0; }
.row-g .chev { color: #C7C7CC; }

.icon-tile {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.05rem;
}
.c-blue  { color: var(--prm-blue);  background: var(--prm-blue-soft); }
.c-mint  { color: var(--prm-mint);  background: var(--prm-mint-soft); }
.c-coral { color: var(--prm-coral); background: var(--prm-coral-soft); }
.c-sun   { color: var(--prm-sun);   background: var(--prm-sun-soft); }

.avatar {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: .9rem; color: #fff;
}
.avatar.lg { width: 96px; height: 96px; flex-basis: 96px; font-size: 2.1rem; box-shadow: 0 0 0 5px #fff, 0 0 0 7px rgba(139, 92, 246, .35), 0 18px 40px -12px rgba(91, 91, 240, .6); }
.av-0 { background: linear-gradient(135deg, #818CF8, #6D28D9); }
.av-1 { background: linear-gradient(135deg, #34D399, #0E9F6E); }
.av-2 { background: linear-gradient(135deg, #FF8FA3, #E11D48); }
.av-3 { background: linear-gradient(135deg, #FCD34D, #EA7A0B); }

.empty {
  text-align: center; color: var(--prm-muted); padding: 28px 16px; font-size: .92rem;
}
.empty i { display: block; font-size: 2rem; margin-bottom: 6px; opacity: .45; }

/* ---- Pastilles / chips ---------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: .85rem; font-weight: 500; border: 0; line-height: 1.3;
}
.chip .x { background: none; border: 0; padding: 0; color: inherit; opacity: .6; line-height: 1; }
.chip .x:hover { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.seg {
  display: inline-flex; background: rgba(118, 118, 128, .12); border-radius: 10px; padding: 2px;
}
.seg button {
  border: 0; background: none; padding: 6px 14px; border-radius: 8px;
  font-size: .88rem; font-weight: 500; color: var(--prm-text); white-space: nowrap;
}
.seg button.active { background: #fff; color: var(--prm-blue); font-weight: 600; box-shadow: 0 2px 8px rgba(18, 20, 43, .12); }

.filter-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips button {
  border: 1px solid var(--prm-line); background: #fff; border-radius: 999px; padding: 5px 13px;
  font-size: .85rem; font-weight: 500; white-space: nowrap; color: var(--prm-text);
}
.filter-chips button { transition: background-color .15s, border-color .15s; }
.filter-chips button:hover { border-color: rgba(91, 91, 240, .4); }
.filter-chips button.active { background: var(--prm-night); color: #fff; border-color: var(--prm-night); }

.searchbar { position: relative; }
.searchbar i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #8E8E93; }
.searchbar input { padding-left: 36px; background: #fff; border: 1px solid var(--prm-line); box-shadow: var(--prm-shadow); }
.searchbar input:focus { background: #fff; }

/* ---- Accueil ---------------------------------------------------------------- */
.quick-add { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.quick-add button {
  border: 1px solid var(--prm-line); border-radius: var(--prm-radius); padding: 16px 8px; background: var(--prm-surface);
  box-shadow: var(--prm-shadow); display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-weight: 600; font-size: .85rem; color: var(--prm-text);
  transition: transform .2s var(--prm-ease), box-shadow .2s var(--prm-ease);
}
.quick-add button:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -12px rgba(60, 50, 160, .3); }
.quick-add .icon-tile { width: 46px; height: 46px; border-radius: 14px; font-size: 1.3rem; }

.date-badge {
  width: 46px; flex: 0 0 46px; text-align: center; border-radius: 12px; padding: 5px 0;
  background: linear-gradient(180deg, #fff, #F6F6FD); border: 1px solid var(--prm-line); line-height: 1.1;
}
.date-badge .m { font-size: .62rem; text-transform: uppercase; font-weight: 700; color: var(--prm-coral); }
.date-badge .d { font-family: var(--prm-font-display); font-size: 1.2rem; font-weight: 700; }

.pill-when {
  font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}

/* ---- Agenda ---------------------------------------------------------------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { font-size: 1.35rem; font-weight: 700; margin: 0; text-transform: capitalize; white-space: nowrap; }
@media (max-width: 575.98px) { .cal-head h2 { font-size: 1.15rem; } .cal-head .btn-sm { padding: 4px 8px; } }
h1, h2, h3, .modal-title { color: var(--prm-text); }
.cal-head .nav-btns { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow {
  text-align: center; font-size: .72rem; font-weight: 600; color: var(--prm-muted);
  text-transform: uppercase; padding: 10px 0 6px;
}
.cal-day {
  min-height: 92px; border-top: 1px solid var(--prm-line); padding: 4px; cursor: pointer;
  background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.cal-day:hover { background: rgba(0, 0, 0, .02); }
.cal-day .num {
  align-self: flex-end; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; font-size: .9rem; font-weight: 500;
}
.cal-day.out .num { color: #C7C7CC; }
.cal-day.today .num { background: var(--prm-coral); color: #fff; font-weight: 600; }
.cal-day.sel .num { background: var(--prm-text); color: #fff; }
.cal-day.today.sel .num { background: var(--prm-coral); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--prm-coral); }
.cal-ev {
  font-size: .72rem; border-radius: 5px; padding: 1px 5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-weight: 500;
}
.cal-more { font-size: .7rem; color: var(--prm-muted); padding-left: 4px; }
.cal-dots { display: none; justify-content: center; gap: 3px; }
.cal-dots span { width: 6px; height: 6px; border-radius: 50%; }
.dot-blue { background: var(--prm-blue); } .dot-mint { background: var(--prm-mint); }
.dot-coral { background: var(--prm-coral); } .dot-sun { background: var(--prm-sun); }

@media (max-width: 767.98px) {
  .cal-day { min-height: 52px; align-items: center; padding: 4px 0; border-top-color: transparent; }
  .cal-day .num { align-self: center; }
  .cal-ev, .cal-more { display: none; }
  .cal-dots { display: flex; }
}

.day-group { margin-bottom: 14px; }
.day-label {
  position: sticky; top: 0; z-index: 2; background: var(--prm-bg);
  font-size: .82rem; font-weight: 600; color: var(--prm-muted); padding: 8px 4px 6px; text-transform: capitalize;
}
.day-label.is-today { color: var(--prm-coral); }
.time-col { width: 52px; flex: 0 0 52px; font-size: .82rem; color: var(--prm-muted); font-variant-numeric: tabular-nums; }
.kind-bar { width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 4px; }

/* ---- Fiche personne ------------------------------------------------------- */
.hero { text-align: center; padding: 8px 0 18px; }
.hero h1 { font-size: 2rem; font-weight: 700; margin: 12px 0 2px; letter-spacing: -.01em; }
.hero .meta { color: var(--prm-muted); }
.hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-actions .ha {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 74px;
  padding: 10px 8px; border-radius: 16px; background: var(--prm-surface); box-shadow: var(--prm-shadow);
  border: 1px solid var(--prm-line); color: var(--prm-blue); font-size: .75rem; font-weight: 600; text-decoration: none;
  transition: transform .2s var(--prm-ease), box-shadow .2s var(--prm-ease);
}
.hero-actions .ha:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -12px rgba(60, 50, 160, .35); }
.hero-actions .ha i { font-size: 1.25rem; }
@media (max-width: 575.98px) { .hero-actions { gap: 6px; } .hero-actions .ha { min-width: 0; flex: 1 1 0; padding: 8px 2px; font-size: .7rem; } }
.turn-banner { display: flex; gap: 14px; align-items: center; padding: 16px; }
.turn-banner .big { font-weight: 600; font-size: 1.05rem; }
.kv { display: flex; padding: 11px 16px; gap: 12px; }
.kv .k { width: 110px; flex: 0 0 110px; color: var(--prm-muted); font-size: .88rem; }
.kv .v { flex: 1; min-width: 0; word-break: break-word; }
.allergy-alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: var(--prm-coral-soft); color: #C92A2A; font-weight: 500; margin-bottom: 16px;
}

.contacts-index .letter {
  font-size: .78rem; font-weight: 700; color: var(--prm-muted); padding: 10px 16px 4px;
  background: #F8F8FD; border-top: 1px solid var(--prm-line); color: var(--prm-blue);
}
.contacts-index .list-g > li:first-child::before { display: none; }
.person-pane { position: sticky; top: 20px; }
.row-g.active { background: var(--prm-blue-soft); }

/* ---- Formulaires ----------------------------------------------------------- */
.kind-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.kind-picker label {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; cursor: pointer;
  border-radius: 12px; border: 1.5px solid var(--prm-line); font-size: .78rem; font-weight: 500; text-align: center;
}
.kind-picker input { position: absolute; opacity: 0; pointer-events: none; }
.kind-picker input:checked + label { border-color: var(--prm-blue); background: var(--prm-blue-soft); }
.kind-picker input:focus-visible + label { box-shadow: 0 0 0 .2rem var(--prm-blue-soft); }
.kind-picker i { font-size: 1.3rem; }

.picker { position: relative; }
.picker .box {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px;
  border: 1px solid var(--prm-line); border-radius: 10px; padding: 6px 8px; background: #fff;
}
.picker .box:focus-within { border-color: var(--prm-blue); box-shadow: 0 0 0 .2rem var(--prm-blue-soft); }
.picker .box input { border: 0; outline: 0; flex: 1; min-width: 120px; padding: 4px; background: transparent; }
.picker .menu {
  position: absolute; z-index: 1060; left: 0; right: 0; top: calc(100% + 4px); max-height: 220px; overflow: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15); padding: 4px;
}
.picker .menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none;
  padding: 7px 10px; border-radius: 8px; text-align: left;
}
.picker .menu button:hover, .picker .menu button.hl { background: var(--prm-blue-soft); }
.picker .menu .avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: .7rem; }

.dish-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.dish-row .form-select { max-width: 130px; }
.dish-warn { font-size: .8rem; color: #C92A2A; margin: -2px 0 8px 2px; }
.dish-warn i { margin-right: 4px; }

.form-section {
  background: #F9F9FB; border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.form-section-title { font-weight: 600; font-size: .9rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

.modal-content { border: 0; border-radius: 24px; box-shadow: var(--prm-shadow-lg); }
.modal-backdrop.show { opacity: .55; }
.modal-backdrop { background: var(--prm-night); }
.modal-header, .modal-footer { border-color: var(--prm-line); }
@media (max-width: 575.98px) { .modal-content { border-radius: 0; } }

.toast { border: 0; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15); }

.ics-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem;
  background: #F2F2F7; border-radius: 8px; padding: 10px; word-break: break-all;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Confidentialité ------------------------------------------------------- */
.auth-legal { font-size: .78rem; color: var(--prm-muted); margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--prm-line); line-height: 1.45; }
.auth-legal a { display: block; font-weight: 500; text-decoration: none; margin-top: 2px; }
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 10; max-width: 560px; margin: 0 auto;
  background: #fff; color: var(--prm-ink, #1a1a2e); border-radius: 16px; padding: 14px 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.side-legal { display: block; font-size: .75rem; color: var(--prm-muted); text-decoration: none; padding: 6px 10px 0; }
.side-legal:hover { color: var(--prm-blue); }
.sidebar .side-legal { color: rgba(255, 255, 255, .45); }
.sidebar .side-legal:hover { color: #fff; }

/* ---- Compte en attente de confirmation ---------------------------------------- */
.pending-banner {
  display: flex; gap: 12px; align-items: center; margin-bottom: 16px;
  padding: 14px 16px; border-radius: var(--prm-radius); background: #FFF8E6; border: 1px solid rgba(245, 159, 0, .35);
}
.status-chip { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-active { background: var(--prm-mint-soft); color: #0C8F68; }
.st-pending { background: var(--prm-sun-soft); color: #B86E00; }
.st-blocked { background: var(--prm-coral-soft); color: #C92A2A; }

/* ---- Console plateforme ------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--prm-surface); border-radius: var(--prm-radius); border: 1px solid var(--prm-line); box-shadow: var(--prm-shadow); padding: 16px 18px; }
.kpi .v { font-family: var(--prm-font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--prm-muted); font-size: .82rem; font-weight: 500; }
.kpi .d { font-size: .75rem; color: var(--prm-muted); margin-top: 4px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 6px 0 0; }
.spark .bar { flex: 1; background: linear-gradient(180deg, var(--prm-violet), var(--prm-blue)); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; position: relative; }
.spark .bar:hover { opacity: 1; }
.spark .bar.zero { background: var(--prm-line); }
.spark-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--prm-muted); margin-top: 4px; }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--prm-line); }
.stack span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .82rem; color: var(--prm-muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.users-table { width: 100%; font-size: .88rem; }
.users-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--prm-muted); font-weight: 600; padding: 8px 10px; white-space: nowrap; }
.users-table td { padding: 10px; border-top: 1px solid var(--prm-line); vertical-align: middle; }
.users-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.users-table .who { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.users-table .who .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: .72rem; }
@media (max-width: 767.98px) {
  .users-table .hide-sm { display: none; }
}
@media (max-width: 575.98px) { .pending-banner { flex-wrap: wrap; } }

/* ---- Choix de la langue ---------------------------------------------------------- */
.auth-lang {
  position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 4px;
  color: var(--prm-muted); font-size: .85rem;
}
.auth-lang .form-select {
  width: auto; border: 0; background-color: transparent; padding: 2px 26px 2px 4px;
  font-size: .82rem; color: var(--prm-muted); box-shadow: none; cursor: pointer;
  padding-right: 28px; background-position: right 4px center;
}
.auth-lang .form-select:hover, .auth-lang .form-select:focus { color: var(--prm-text, #1D1D1F); }

/* ==========================================================================
   Stratégie « Pro Max » : navigation 3 espaces + commande rapide, accessibilité,
   micro-interactions (squelettes, transitions de page, validations)
   ========================================================================== */

/* ---- Accessibilité --------------------------------------------------------- */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 2000; transform: translateY(-150%);
  padding: 10px 16px; border: 0; border-radius: 12px; background: var(--prm-night); color: #fff; font-weight: 600;
  transition: transform .2s var(--prm-ease);
}
.skip-link:focus { transform: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, .row-g:focus-visible {
  outline: 2px solid var(--prm-blue); outline-offset: 2px;
}
.main:focus-visible { outline: none; }
/* Le champ actif n'est jamais caché sous la barre flottante */
@media (max-width: 991.98px) { html { scroll-padding-bottom: 110px; } }
/* Zone tactile de 48 px autour des petites croix des puces */
.chip .x { position: relative; }
.chip .x::after { content: ""; position: absolute; inset: -16px; }

/* ---- Barre latérale : actions + séparateur de collections ------------------- */
.side-actions { display: grid; gap: 8px; }
.side-actions .btn { min-height: 44px; }
.side-search {
  display: flex; align-items: center; gap: 10px; min-height: 44px; width: 100%; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .7); font-size: .9rem; text-align: left; transition: background-color .18s, color .18s;
}
.side-search:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side-search span { flex: 1; }
.side-search kbd, .palette-search kbd {
  font-family: inherit; font-size: .72rem; font-weight: 600; padding: 2px 6px; border-radius: 6px;
  background: rgba(255, 255, 255, .12); color: inherit; box-shadow: none;
}
.sidebar .nav-sep {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .4); padding: 18px 12px 6px;
}

/* ---- Barre mobile : bouton central ------------------------------------------- */
.tabbar { align-items: center; }
.tabbar .tab-add {
  flex: 0 0 56px; width: 56px; height: 56px; margin: -22px 4px 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 1.5rem;
  background: var(--prm-grad); box-shadow: 0 10px 24px -6px rgba(139, 92, 246, .8), 0 0 0 4px var(--prm-bg);
  transition: transform .18s var(--prm-ease);
}
.tabbar .tab-add:active { transform: scale(.94); }
.tabbar .avatar.xs { width: 26px; height: 26px; flex-basis: 26px; font-size: .62rem; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.tabbar a.active .avatar.xs { box-shadow: 0 0 0 2px #fff; }

/* ---- Commande rapide -------------------------------------------------------------- */
.palette {
  width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 120px)); margin: 12vh auto auto;
  padding: 0; border: 0; border-radius: 24px; background: var(--prm-surface); color: var(--prm-text);
  box-shadow: var(--prm-shadow-lg), 0 0 0 1px var(--prm-line); overflow: hidden;
}
.palette[open] { display: flex; flex-direction: column; animation: palette-in .22s var(--prm-ease); }
.palette::backdrop { background: rgba(11, 15, 42, .55); backdrop-filter: blur(4px); }
@keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.palette-search {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--prm-line);
  color: var(--prm-muted); font-size: 1.1rem;
}
.palette-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 1.05rem; color: var(--prm-text); }
.palette-search kbd { background: rgba(18, 20, 43, .06); color: var(--prm-muted); }
.palette-list { overflow-y: auto; padding: 6px 8px 10px; }
.palette-group {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--prm-muted);
  padding: 12px 10px 6px;
}
.palette-item {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px; border-radius: 14px; cursor: pointer;
}
.palette-item .main-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .s { font-size: .82rem; color: var(--prm-muted); }
.palette-item .icon-tile, .palette-item .avatar { width: 36px; height: 36px; flex: 0 0 36px; }
.palette-item .palette-enter { opacity: 0; color: var(--prm-blue); }
.palette-item:hover { background: rgba(91, 91, 240, .06); }
.palette-item.active { background: var(--prm-blue-soft); }
.palette-item.active .palette-enter { opacity: 1; }
.palette-empty { padding: 32px 16px; text-align: center; color: var(--prm-muted); }
@media (max-width: 575.98px) {
  .palette { margin: auto auto 0; width: 100vw; max-width: 100vw; max-height: 85dvh; border-radius: 24px 24px 0 0; }
  .palette[open] { animation-name: sheet-in; }
  .palette-list { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Squelettes de chargement ------------------------------------------------------- */
.sk-card { padding: 18px; }
.sk {
  display: block; height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, rgba(18, 20, 43, .06) 25%, rgba(18, 20, 43, .11) 50%, rgba(18, 20, 43, .06) 75%);
  background-size: 200% 100%; animation: sk-shimmer 1.2s linear infinite;
}
.sk-title { width: 40%; height: 16px; margin-bottom: 18px; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.sk-av { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
.sk-lines .sk { width: 60%; }
.sk-lines .sk-short { width: 35%; }
@keyframes sk-shimmer { to { background-position: -200% 0; } }

/* ---- Transitions de page (View Transitions API) ---------------------------------------- */
.main { view-transition-name: main; }
::view-transition-old(main) { animation: vt-out .12s ease-out both; }
::view-transition-new(main) { animation: vt-in .26s var(--prm-ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- Validations : l'icône du message confirme l'action -------------------------------- */
.toast .bi-check-circle-fill { animation: pop .3s var(--prm-ease) both; }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Fiche contact : onglets et infos manquantes */
.person-tabs{display:flex;gap:4px;padding:4px;margin:0 0 16px;background:rgba(91,91,240,.07);border-radius:16px;overflow-x:auto;scrollbar-width:none}
.person-tabs [role=tab]{flex:1 0 auto;min-height:48px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 14px;border:0;border-radius:12px;background:transparent;color:var(--bs-secondary-color);font-weight:600;white-space:nowrap;transition:background .2s var(--prm-ease),color .2s var(--prm-ease)}
.person-tabs [role=tab]:hover{color:var(--bs-body-color)}
.person-tabs [role=tab][aria-selected=true]{background:var(--prm-surface);color:var(--prm-blue);box-shadow:0 2px 10px rgba(11,15,42,.08)}
[role=tabpanel]:focus-visible{outline-offset:6px}
.missing-info{display:flex;align-items:center;gap:10px;margin:-4px 0 16px;padding:10px 14px;border-radius:14px;background:rgba(91,91,240,.08);color:var(--bs-body-color);font-size:.9rem}
.missing-info .bi{color:var(--prm-violet)}
@media (max-width:575.98px){.person-tabs [role=tab]{flex:1 1 0;padding:0 6px;font-size:.9rem}.person-tabs [role=tab] .bi{display:none}}

/* ---- Champs : croix d'effacement et œil du mot de passe ------------------- */
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.input-clear, .pw-toggle {
  border: 0; background: none; color: #AEAEB2; padding: 0; width: 36px; height: 36px;
  display: grid; place-items: center; flex-shrink: 0; border-radius: 50%;
}
.input-clear:hover, .pw-toggle:hover { color: var(--prm-muted); }
.searchbar .input-clear, .pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 5; }
.searchbar .input-clear i { position: static; transform: none; color: inherit; }
.searchbar input { padding-right: 40px; }
input:placeholder-shown + .input-clear { display: none; }
.pw-wrap { position: relative; }
.pw-wrap input, .form-floating > input[data-enh] { padding-right: 44px; }
.pw-toggle { font-size: 1.1rem; }

/* ---- Liste des personnes : index A-Z ------------------------------------- */
.contacts-wrap { display: flex; gap: 2px; align-items: flex-start; }
.contacts-wrap > .contacts-index { flex: 1; min-width: 0; overflow: clip; }
.contacts-index .letter { scroll-margin-top: var(--cbar, 0px); }
.az-index {
  position: sticky; top: calc(var(--cbar, 0px) + 8px); flex: 0 0 22px;
  height: min(560px, calc(100dvh - var(--cbar, 0px) - 120px - env(safe-area-inset-bottom)));
  display: flex; flex-direction: column; justify-content: space-between; touch-action: none; user-select: none;
}
.az-index button {
  flex: 1; border: 0; background: none; padding: 0; font-size: .68rem; font-weight: 700; line-height: 1;
  color: var(--prm-blue); border-radius: 6px;
}
.az-index button.off { color: #C7C7CC; }
.az-index button:hover:not(.off) { background: var(--prm-blue-soft); }

/* ---- Glisser vers la gauche pour supprimer ------------------------------- */
.contacts-index .list-g > li { overflow: hidden; }
.contacts-index .row-g { position: relative; z-index: 1; background: var(--prm-surface); transition: transform .2s ease; touch-action: pan-y; }
.contacts-index .row-g:hover { background: #F7F7FE; }
.contacts-index .row-g.active { background: #EAEAFD; }
.swipe-del {
  position: absolute; top: 0; right: 0; bottom: 0; width: 96px; border: 0;
  background: var(--prm-coral); color: #fff; font-size: .78rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.swipe-del i { font-size: 1.15rem; }

/* ---- Sélection multiple --------------------------------------------------- */
.pick-box { font-size: 1.25rem; color: #C7C7CC; }
.pick-box::before { content: "\F28A"; } /* bi-circle */
.row-g.picked .pick-box { color: var(--prm-blue); }
.row-g.picked .pick-box::before { content: "\F26A"; } /* bi-check-circle-fill */
.contacts-index .row-g.picked { background: #EEEEFD; }
.pick-bar {
  position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 18px; background: var(--prm-surface); border: 1px solid var(--prm-line);
  box-shadow: 0 16px 40px -12px rgba(11, 15, 42, .35);
}
.pick-bar .n { font-weight: 600; flex: 1 0 100%; }
.pick-bar [data-act=pickToggle] { margin-left: auto; }
@media (max-width: 991.98px) { .pick-bar { bottom: calc(92px + env(safe-area-inset-bottom)); } }
.contacts-index .list-g > li + li::before { z-index: 2; }
.bulk-del-list {
  margin: 12px 0 0; padding: 8px 12px 8px 30px; max-height: 45vh; overflow-y: auto;
  background: var(--prm-coral-soft); border-radius: 12px; font-weight: 500;
}

/* ---- Barre d'outils des personnes, fixée en haut pendant le défilement ---- */
.contacts-bar {
  position: sticky; top: 0; z-index: 15; padding-top: 16px; margin-top: -16px;
  background: rgba(244, 245, 251, .9); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.contacts-bar .page-head { margin-bottom: 12px; }
.contacts-bar .filter-chips { margin-bottom: 0; padding-bottom: 10px; }
@media (max-width: 991.98px) {
  .contacts-bar { padding-top: calc(8px + env(safe-area-inset-top)); margin-top: calc(-8px - env(safe-area-inset-top)); }
  .contacts-bar .page-head h1 { font-size: 1.8rem; }
}
