/* ═══════════════════════════════════════════════════════════════════════════
   IGrep — thème clair « blanc / bleu / orange »
   Reprend exactement la structure de igrep2.css (verre liquide, mise en page,
   icônes Lucide, police JetBrains Mono) — seules les couleurs changent.
   Bleu = actions principales / navigation. Orange = accents ponctuels.
   ═══════════════════════════════════════════════════════════════════════════ */

:root{
  /* Fond & surfaces */
  --bg:#F3F5F9;
  --card:#FFFFFF;                       /* opaque, pour les usages inline background:var(--card) */
  --surface-1:rgba(255,255,255,.72);
  --surface-2:rgba(255,255,255,.85);
  --surface-3:rgba(238,241,247,.92);
  --glass:rgba(255,255,255,.60);
  --glass-strong:rgba(255,255,255,.78);
  --inset:rgba(15,23,42,.035);          /* surface légèrement creusée (champs, encarts) */

  /* Bordures / lumière */
  --border:rgba(15,23,42,.09);
  --border-strong:rgba(15,23,42,.16);
  --edge:rgba(255,255,255,.85);
  --blur:22px;

  /* Texte */
  --text:#101828;
  --text-primary:#101828;
  --text-secondary:#57606F;
  --muted:#57606F;
  --text-3:#8A93A3;

  /* Accent — bleu (principal) */
  --primary:#3E63DD;
  --primary-strong:#2F4FC0;
  --primary-light:rgba(62,99,221,.10);
  --sidebar:#FFFFFF;
  --sidebar-hover:rgba(43,76,140,.06);
  --sidebar-active:rgba(62,99,221,.10);
  --sidebar-accent:#3E63DD;

  /* Accent — orange (touches, badges, highlights) */
  --accent-orange:#EA580C;
  --accent-orange-strong:#C2410C;
  --accent-orange-bg:rgba(234,88,12,.12);

  /* Sémantique — alignée sur les couleurs des points de statut déjà utilisées
     sur la carte (js/legacy.js, ST_COLOR) pour rester cohérent avec les marqueurs */
  --gray:#64748B;   --gray-bg:rgba(100,116,139,.10);
  --blue:#2563EB;   --blue-bg:rgba(37,99,235,.10);
  --green:#16A34A;  --green-bg:rgba(22,163,74,.10);
  --red:#DC2626;    --red-bg:rgba(220,38,38,.09);
  --amber:#D97706;  --amber-bg:rgba(217,119,6,.10);
  --purple:#7C3AED; --purple-bg:rgba(124,58,237,.10);
  --orange:#EA580C; --orange-bg:rgba(234,88,12,.10);

  --r-sm:10px; --r:14px; --r-lg:18px; --r-pill:999px;
  --shadow:0 1px 3px rgba(15,23,42,.06), 0 14px 34px rgba(15,23,42,.08);
  --sidebar-w:248px;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{ color-scheme:light; }
html{height:100%}
body{
  height:100vh;
  font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px; line-height:1.55; letter-spacing:-.01em;
  background:var(--bg); color:var(--text);
  -webkit-font-smoothing:antialiased;
  display:flex; overflow:hidden;
}
/* Aurore claire : touches bleu + orange très douces qui traversent le verre.
   IMMOBILE et SANS filtre de flou (2026-10-14) : animée et floutée, elle obligeait le navigateur
   à recalculer à chaque image le flou de tout ce qui était posé dessus — inutilisable sur
   certains Mac (écran Retina). Les dégradés radiaux sont déjà doux : le rendu ne change pas. */
body::before{
  content:""; position:fixed; inset:-25%; z-index:0; pointer-events:none;
  background:
    radial-gradient(38% 44% at 16% 12%,  rgba(62,99,221,.13),  transparent 78%),
    radial-gradient(34% 40% at 82% 4%,   rgba(234,88,12,.09),  transparent 76%),
    radial-gradient(42% 48% at 66% 88%,  rgba(62,99,221,.10),  transparent 80%),
    radial-gradient(30% 36% at 8% 92%,   rgba(234,88,12,.07),  transparent 80%);
}
body::after{
  content:""; position:fixed; inset:0; z-index:0; pointer-events:none; opacity:.3;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.025'/></svg>");
}

a{color:inherit;text-decoration:none}
img{max-width:100%}
::selection{background:rgba(62,99,221,.22)}

/* Scrollbars discrètes */
*::-webkit-scrollbar{width:9px;height:9px}
*::-webkit-scrollbar-track{background:transparent}
*::-webkit-scrollbar-thumb{background:rgba(15,23,42,.14);border-radius:10px}
*::-webkit-scrollbar-thumb:hover{background:rgba(15,23,42,.24)}

/* Icônes Lucide (hydratées par js/icons.js) */
.ico{width:16px;height:16px;flex:0 0 auto;stroke:currentColor;stroke-width:1.85;fill:none;
  stroke-linecap:round;stroke-linejoin:round;vertical-align:-2px}
.ico-sm{width:13px;height:13px}
.ico-lg{width:20px;height:20px}

/* ─── Sidebar ─────────────────────────────────────────────── */
#sidebar{
  width:var(--sidebar-w); flex-shrink:0; z-index:3;
  background:var(--glass-strong);
  border-right:1px solid var(--border);
  box-shadow:inset -1px 0 0 rgba(15,23,42,.03);
  display:flex; flex-direction:column; padding:14px 12px; overflow-y:auto;
}
.sidebar-brand{ padding:8px 8px 14px; border-bottom:1px solid var(--border); }

/* ─── Logo ASCII : panneau LED (reste sombre — un panneau LED est un écran
     noir qui brille, quel que soit le thème du reste du site) ─────────────── */
.sidebar-brand .brand-ascii{
  position:relative; overflow:hidden;
  border:1px solid var(--border-strong); border-radius:var(--r-sm);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.10'/></svg>"),
    linear-gradient(180deg, rgba(3,4,6,.94), rgba(1,1,2,.96));
  box-shadow:0 1px 3px rgba(15,23,42,.08);
  padding:9px 0;
}
.brand-ascii-track{
  display:flex; width:max-content; will-change:transform;
  animation: ig-led-scroll 18s linear infinite;
}
.brand-ascii-track pre{
  flex:0 0 auto;
  font-family:'JetBrains Mono',monospace; font-size:5.5px; line-height:1.25;
  color:#8FB0E8; white-space:pre; margin:0; padding:0 22px;
  text-shadow:0 0 6px rgba(62,99,221,.4), 0 0 16px rgba(62,99,221,.18);
  animation: ig-led-flicker 4.4s ease-in-out infinite; will-change:opacity;
}
@keyframes ig-led-scroll{
  from{ transform:translateX(0); }
  to{ transform:translateX(-50%); }
}
@keyframes ig-led-flicker{
  0%, 5%, 9%, 16%, 100%{ opacity:1; }
  6%{ opacity:.35; }
  8%{ opacity:.85; }
  17%{ opacity:.5; }
  18%{ opacity:1; }
}
@media (prefers-reduced-motion:reduce){
  .brand-ascii-track{ animation:none; }
  .brand-ascii-track pre{ animation:none; }
}

.sidebar-brand p{ font-size:10px; color:var(--text-3); margin-top:8px; letter-spacing:.03em; }

.sidebar-section-label{
  font-size:9px; font-weight:600; letter-spacing:.16em; text-transform:uppercase;
  color:var(--text-3); padding:16px 10px 6px;
}
nav ul{ list-style:none; padding:0; }
nav ul li{
  display:flex; align-items:center; gap:11px;
  padding:9px 10px; border-radius:var(--r-sm); cursor:pointer;
  color:var(--text-secondary); font-size:12px; font-weight:500;
  transition:background .15s,color .15s; margin-bottom:2px; user-select:none;
}
nav ul li:hover{ background:var(--sidebar-hover); color:var(--text); }
nav ul li.active{
  background:linear-gradient(90deg,var(--sidebar-active),rgba(62,99,221,.03));
  color:var(--primary-strong); box-shadow:inset 2px 0 0 var(--sidebar-accent);
}
nav ul li .nav-icon{ font-size:15px; flex-shrink:0; display:inline-flex; }
nav ul li .nav-badge{
  margin-left:auto; background:var(--surface-3); border:1px solid var(--border);
  color:var(--text-secondary); font-size:10px; font-weight:700;
  border-radius:var(--r-pill); padding:0 7px; min-width:20px; text-align:center;
}
nav ul li.active .nav-badge{ background:rgba(62,99,221,.16); border-color:transparent; color:var(--primary-strong); }

.sidebar-footer{
  margin-top:auto; padding:14px 10px 4px; border-top:1px solid var(--border);
  font-size:10px; color:var(--text-3); letter-spacing:.05em;
}

/* ─── Zone principale ─────────────────────────────────────── */
#main{ flex:1; min-width:0; overflow-y:auto; display:flex; flex-direction:column; z-index:1; position:relative; }
.view{ display:none; flex:1; flex-direction:column; }
.view.active{ display:flex; }

.view-header{
  padding:22px 28px 0; display:flex; align-items:flex-start; justify-content:space-between;
  flex-shrink:0; gap:16px;
}
.view-header h2{ font-size:18px; font-weight:700; letter-spacing:-.02em; color:var(--text);
  display:flex; align-items:center; gap:10px; }
.view-header h2 .ico{ color:var(--text-secondary); }
.view-header p{ color:var(--text-3); font-size:11.5px; margin-top:4px; }
.view-body{ padding:18px 28px 40px; flex:1; }
.view-body-home{ padding-top:26px; }

/* ─── Panneaux / cartes (verre) ──────────────────────────── */
.panel,.stat-card,.prog-table,.mairies-list-panel,.create-action-bar{
  position:relative; overflow:hidden;
  background:var(--surface-1); border:1px solid var(--border); border-radius:var(--r-lg);
  box-shadow:var(--shadow);
}
.panel::before,.stat-card::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.5),transparent 42%);
  box-shadow:inset 0 1px 0 var(--edge);
}
.panel > *,.stat-card > *{ position:relative; }
.panel{ padding:18px 20px; margin-bottom:16px; }
.panel-title{
  font-size:12px; font-weight:700; letter-spacing:.02em; color:var(--text);
  margin-bottom:16px; display:flex; align-items:center; gap:9px;
}
.panel-title .step-num{
  width:22px; height:22px; border-radius:50%; background:var(--primary-light);
  border:1px solid rgba(62,99,221,.35); color:var(--primary-strong);
  font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center;
}

/* ─── Boutons ────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; gap:7px; padding:8px 15px; border-radius:var(--r-pill);
  border:1px solid var(--border); font-size:12px; font-weight:600; cursor:pointer;
  font-family:inherit; color:var(--text); background:var(--surface-2);
  transition:border-color .15s,background .15s,opacity .15s,transform .1s;
}
.btn:hover:not(:disabled){ border-color:var(--border-strong); transform:translateY(-1px); }
.btn:active:not(:disabled){ transform:translateY(0); }
.btn:disabled{ opacity:.45; cursor:default; }
.btn-primary{ background:var(--primary); border-color:transparent; color:#fff; }
.btn-primary:hover:not(:disabled){ background:var(--primary-strong); }
.btn-green{ background:var(--green-bg); border-color:rgba(22,163,74,.3); color:var(--green); }
.btn-danger{ background:var(--red-bg); border-color:rgba(220,38,38,.3); color:var(--red); }
.btn-amber{ background:var(--amber-bg); border-color:rgba(217,119,6,.3); color:var(--amber); }
.btn-ghost{ background:transparent; }
.btn-sm{ padding:5px 11px; font-size:11px; }
.btn-row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.btn-copy-anim{ transition:background .2s; }
.btn-copy-anim.copied{ background:var(--green-bg)!important; border-color:transparent!important; color:var(--green)!important; }

/* ─── Pastilles de statut ────────────────────────────────── */
.chip{ display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:var(--r-pill);
  font-size:11px; font-weight:600; }
.chip-gray  { background:var(--gray-bg);  color:var(--gray); }
.chip-blue  { background:var(--blue-bg);  color:var(--blue); }
.chip-green { background:var(--green-bg); color:var(--green); }
.chip-red   { background:var(--red-bg);   color:var(--red); }
.chip-purple{ background:var(--purple-bg);color:var(--purple); }
.chip-orange{ background:var(--orange-bg);color:var(--orange); }
.chip-amber { background:var(--amber-bg); color:var(--amber); }

/* ─── Vue « Ajouter un séjour » ──────────────────────────── */
.create-name-bar{ display:grid; grid-template-columns:1fr auto auto; gap:12px; align-items:end; margin-bottom:8px; }
.input-group{ display:flex; flex-direction:column; gap:5px; }
.input-group label{ font-size:11px; font-weight:600; color:var(--text-3); letter-spacing:.03em; }
.input-group input,.input-group select{
  padding:10px 13px; border:1.5px solid var(--border); border-radius:var(--r-sm); font-size:13px;
  font-family:inherit; color:var(--text); background:var(--inset); transition:border-color .2s,box-shadow .2s;
}
.input-group input:focus,.input-group select:focus{
  outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light);
}
.input-group input.big{ font-size:15px; font-weight:600; padding:12px 15px; }

#map{ width:100%; height:380px; border-radius:var(--r); border:1px solid var(--border); cursor:crosshair; }
.map-hint{ font-size:12px; color:var(--text-3); margin-bottom:10px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.pts-dots{ display:flex; gap:6px; }
.dot{ width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:800; color:#fff; flex-shrink:0; transition:background .2s; }
.dot-empty{ background:var(--surface-3); color:var(--text-3); }

.points-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-top:12px; }
@media(max-width:800px){ .points-grid{ grid-template-columns:1fr 1fr; } }
.point-box{ border:1.5px solid var(--border); border-radius:var(--r-sm); padding:10px; background:var(--inset);
  transition:border-color .2s,background .2s; }
.point-box.set{ border-color:rgba(22,163,74,.4); background:var(--green-bg); }
.pt-label{ font-size:10px; font-weight:700; color:var(--text-3); margin-bottom:6px; display:flex; justify-content:space-between; align-items:center; }
.pt-num{ width:18px; height:18px; border-radius:50%; color:#fff; font-size:10px; font-weight:800; display:flex; align-items:center; justify-content:center; }
.pt-inputs{ display:flex; gap:6px; }
.pt-inputs input{ flex:1; min-width:0; padding:6px 8px; border:1px solid var(--border); border-radius:7px; font-size:12px; background:var(--inset); color:var(--text); font-family:inherit; }
.pt-inputs input:focus{ outline:1.5px solid var(--primary); border-color:transparent; }
.pt-sub{ font-size:9px; color:var(--text-3); display:flex; gap:6px; margin-top:3px; }
.pt-sub span{ flex:1; text-align:center; }

.csv-row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.csv-row:last-child{ margin-bottom:0; }
.csv-label{ font-size:12.5px; font-weight:600; min-width:200px; }
.csv-ico{ display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px;
  border-radius:8px; background:var(--primary-light); color:var(--primary-strong); flex-shrink:0; }
.status-txt{ font-size:12px; color:var(--text-3); }

#logBox{ background:var(--inset); border:1px solid var(--border); border-radius:var(--r-sm);
  padding:10px 14px; font-size:11.5px; max-height:120px; overflow-y:auto; margin-top:12px; }
.log-info{ color:var(--blue); } .log-warn{ color:var(--amber); } .log-err{ color:var(--red); }

.create-action-bar{ padding:16px 20px; display:flex; align-items:center; gap:16px; margin-bottom:16px; }
.create-action-bar .ca-info{ flex:1; }
.create-action-bar .ca-info h3{ font-size:13px; font-weight:700; }
.create-action-bar .ca-info p{ font-size:12px; color:var(--text-3); margin-top:2px; }

#resultsCount{ font-size:12px; color:var(--text-3); padding:8px 0; }
.preview-card{ background:var(--surface-1); border:1px solid var(--border); border-radius:var(--r-sm);
  padding:10px 14px; margin-bottom:8px; display:flex; align-items:center; gap:12px; }
.preview-card .pc-name{ font-weight:600; font-size:13px; }
.preview-card .pc-meta{ font-size:11px; color:var(--text-3); margin-top:1px; }
#results{ max-height:360px; overflow-y:auto; }

/* ─── Liste des séjours ──────────────────────────────────── */
.sejours-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:16px; }
.sejour-card{
  position:relative; overflow:hidden;
  background:var(--surface-1); border:1px solid var(--border); border-radius:var(--r-lg);
  padding:18px; cursor:pointer; transition:transform .18s,box-shadow .18s,border-color .18s;
  box-shadow:var(--shadow);
  display:flex; flex-direction:column; gap:12px;
}
.sejour-card::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.45),transparent 45%);
  box-shadow:inset 0 1px 0 var(--edge);
}
.sejour-card > *{ position:relative; }
.sejour-card:hover{ transform:translateY(-3px); border-color:var(--border-strong);
  box-shadow:0 2px 8px rgba(15,23,42,.07), 0 20px 45px rgba(15,23,42,.10); }
.sejour-card-locked{ opacity:.78; }
.sejour-card-locked:hover{ transform:none; }
.sc-header{ display:flex; justify-content:space-between; align-items:flex-start; }
.sc-header h3{ font-size:14px; font-weight:700; line-height:1.3; letter-spacing:-.01em; }
.sc-meta{ font-size:11px; color:var(--text-3); }
.sc-stats{ display:flex; gap:7px; flex-wrap:wrap; }
.mini-stat{ display:flex; align-items:center; gap:4px; font-size:11px; font-weight:600; padding:2px 8px; border-radius:var(--r-pill); }
.sc-progress{ height:5px; background:var(--surface-3); border-radius:var(--r-pill); overflow:hidden; display:flex; }
.sc-progress-bar{ height:100%; transition:width .3s; }
.sc-footer{ display:flex; justify-content:flex-end; }

/* Barre de recherche séjours */
.sejour-search{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; width:100%; }
.sejour-search input{
  flex:1 1 180px; min-width:150px; padding:8px 12px; border:1.5px solid var(--border);
  border-radius:var(--r-sm); font-size:12px; font-family:inherit; color:var(--text); background:var(--inset);
}
.sejour-search input:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }

/* ─── Détail d'un séjour ─────────────────────────────────── */
.detail-header-bar{ display:flex; align-items:center; gap:12px; margin-bottom:18px; flex-wrap:wrap; }
.back-btn{ display:flex; align-items:center; gap:6px; cursor:pointer; color:var(--text-3); font-size:12px; font-weight:600; transition:color .2s; user-select:none; }
.back-btn:hover{ color:var(--text); }
.detail-name{ font-size:19px; font-weight:800; letter-spacing:-.02em; }
.detail-layout{ display:grid; grid-template-columns:1fr 380px; gap:16px; align-items:start; }
@media(max-width:900px){ .detail-layout{ grid-template-columns:1fr; } }
#detail-map{ height:480px; border-radius:var(--r-lg); border:1px solid var(--border); }
.mairies-list-panel{ overflow:hidden; }
.mlp-header{ padding:14px 16px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.mlp-header h4{ font-size:12px; font-weight:700; }
.mlp-body{ max-height:460px; overflow-y:auto; }
.mairie-ticket{ padding:12px 16px; border-bottom:1px solid var(--border); cursor:pointer; transition:background .15s; display:flex; align-items:center; gap:10px; }
.mairie-ticket:last-child{ border-bottom:0; }
.mairie-ticket:hover{ background:var(--primary-light); }
.mt-dot{ width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.mt-info{ flex:1; min-width:0; }
.mt-name{ font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mt-cp{ font-size:11px; color:var(--text-3); }
.filter-bar{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; align-items:center; }
.filter-btn{ padding:5px 12px; border-radius:var(--r-pill); font-size:11px; font-weight:600; border:1px solid var(--border);
  background:var(--surface-2); cursor:pointer; transition:all .15s; color:var(--text-3); font-family:inherit; }
.filter-btn:hover{ color:var(--text); border-color:var(--border-strong); }
.filter-btn.active{ border-color:var(--primary); color:var(--primary-strong); background:var(--primary-light); }
.filter-bar-label{ font-size:11px; font-weight:600; color:var(--text-3); margin-right:2px; }
.ouverture-badge,.repasser-badge{ font-size:12px; flex-shrink:0; margin-right:2px; }

/* ─── Modales (verre fort) ───────────────────────────────── */
.modal-overlay{
  position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center;
  background:rgba(15,23,42,.45); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  /* Fermée = invisible ET masquée : sinon chaque fenêtre fermée restait posée sur tout l'écran
     avec ses flous, que le navigateur continuait de calculer (une douzaine de fenêtres). */
  opacity:0; visibility:hidden; pointer-events:none; transition:opacity .25s, visibility 0s linear .25s;
}
.modal-overlay.open{ opacity:1; visibility:visible; pointer-events:all; transition:opacity .25s, visibility 0s; }
.modal{
  position:relative;
  background:rgba(255,255,255,.88); border:1px solid var(--border-strong); border-radius:20px;
  width:80vw; max-width:1200px; max-height:86vh; overflow:hidden; display:flex; flex-direction:column;
  box-shadow:0 30px 90px rgba(15,23,42,.20), inset 0 1px 0 var(--edge);
  backdrop-filter:blur(40px) saturate(1.7); -webkit-backdrop-filter:blur(40px) saturate(1.7);
  transform:translateY(20px) scale(.98); transition:transform .3s cubic-bezier(.2,.9,.3,1.1);
}
.modal-overlay.open .modal{ transform:translateY(0) scale(1); }
.modal-header{ padding:22px 28px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.modal-header h3{ font-size:18px; font-weight:800; letter-spacing:-.02em; color:var(--text); }
.modal-header .sub{ font-size:11px; color:var(--text-3); margin-top:4px; text-transform:uppercase; letter-spacing:.06em; }
.modal-close{ background:var(--surface-2); border:1px solid var(--border); border-radius:10px; cursor:pointer;
  font-size:15px; color:var(--text-3); width:32px; height:32px; display:flex; align-items:center; justify-content:center; transition:all .2s; }
.modal-close:hover{ background:var(--red-bg); color:var(--red); border-color:transparent; }
.modal-body{ padding:26px 28px; overflow-y:auto; }
.modal-footer{ padding:18px 28px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:12px; }
.modal-cols{ display:flex; gap:32px; align-items:flex-start; }
.modal-col-left{ flex:3; display:flex; flex-direction:column; gap:20px; }
.modal-col-right{ flex:2; display:flex; flex-direction:column; gap:18px; position:sticky; top:0; }

/* ─── Note importante ────────────────────────────────────── */
.important-box{ background:rgba(220,38,38,.05); border:1.5px solid rgba(220,38,38,.25); border-radius:var(--r); padding:14px 16px; }
.important-box-header{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.important-box-header span{ font-size:15px; }
.important-box-header strong{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:var(--red); }
.important-textarea{ width:100%; min-height:90px; padding:10px 12px; border:1.5px solid rgba(220,38,38,.25);
  border-radius:9px; font-size:13px; font-family:inherit; color:#7F1D1D; background:#fff; resize:vertical; line-height:1.55; transition:border-color .2s; }
.important-textarea::placeholder{ color:rgba(220,38,38,.45); }
.important-textarea:focus{ outline:none; border-color:var(--red); box-shadow:0 0 0 3px rgba(220,38,38,.12); }

/* ─── Annuaire ───────────────────────────────────────────── */
.annuaire-box{ background:var(--inset); border:1px solid var(--border); border-radius:var(--r); padding:16px 18px; margin-top:4px; }
.annuaire-row{ display:flex; align-items:flex-start; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); font-size:12.5px; }
.annuaire-row:last-child{ border-bottom:0; padding-bottom:0; }
.annuaire-row:first-child{ padding-top:0; }
.annuaire-icon{ font-size:15px; flex-shrink:0; width:22px; margin-top:1px;
  display:inline-flex; align-items:center; justify-content:center; color:var(--text-secondary); }
.annuaire-label{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--text-3); min-width:110px; flex-shrink:0; margin-top:2px; }
.annuaire-val{ color:var(--text); flex:1; word-break:break-word; line-height:1.5; }
.annuaire-val a{ color:var(--blue); }
.annuaire-val a:hover{ text-decoration:underline; }
.annuaire-val .tag-pill{ display:inline-flex; align-items:center; gap:4px; background:var(--primary-light); color:var(--primary-strong);
  border-radius:var(--r-pill); padding:2px 10px; font-size:11px; font-weight:600; margin:2px 3px 2px 0; }
.annuaire-loading{ display:flex; align-items:center; gap:10px; padding:14px 0; font-size:12px; color:var(--text-3); }
.spinner{ width:16px; height:16px; border:2px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .7s linear infinite; flex-shrink:0; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.horaires-grid{ display:grid; grid-template-columns:auto 1fr; gap:3px 12px; font-size:12px; }
.horaires-grid .h-day{ font-weight:600; color:var(--text); white-space:nowrap; }
.horaires-grid .h-time{ color:var(--text-3); }
.annuaire-link-bar{ margin-top:14px; padding-top:12px; border-top:1px dashed var(--border); display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-3); flex-wrap:wrap; }
.annuaire-link-bar a{ color:var(--blue); font-weight:600; }
.annuaire-missing{ background:var(--amber-bg); border:1px solid rgba(217,119,6,.3); border-radius:var(--r-sm); padding:10px 14px; font-size:12px; color:#92400E; margin-top:4px; }
.annuaire-copy{ background:none; border:1px solid var(--border); border-radius:7px; padding:2px 9px; font-size:11px; font-weight:600; cursor:pointer; color:var(--text-3); margin-left:8px; transition:all .15s; font-family:inherit; }
.annuaire-copy:hover{ background:var(--primary); color:#fff; border-color:transparent; }

/* ─── Sélecteur de statut (modale) ───────────────────────── */
.status-selector{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.status-btn{ padding:7px 13px; border-radius:var(--r-sm); border:1.5px solid var(--border); font-size:12px; font-weight:600;
  cursor:pointer; transition:all .15s; background:var(--surface-2); color:var(--text-secondary); font-family:inherit; }
.status-btn:hover{ color:var(--text); border-color:var(--border-strong); }
.status-btn.active-gray  { background:var(--gray-bg);   color:var(--gray);   border-color:var(--gray); }
.status-btn.active-blue  { background:var(--blue-bg);   color:var(--blue);   border-color:var(--blue); }
.status-btn.active-purple{ background:var(--purple-bg); color:var(--purple); border-color:var(--purple); }
.status-btn.active-orange{ background:var(--orange-bg); color:var(--orange); border-color:var(--orange); }
.status-btn.active-amber { background:var(--amber-bg);  color:var(--amber);  border-color:var(--amber); }
.status-btn.active-green { background:var(--green-bg);  color:var(--green);  border-color:var(--green); }
.status-btn.active-red   { background:var(--red-bg);    color:var(--red);    border-color:var(--red); }

.repasser-toggle{ display:flex; align-items:center; gap:8px; margin-top:-6px; margin-bottom:4px; padding:9px 12px;
  background:var(--inset); border:1px solid var(--border); border-radius:var(--r-sm);
  font-size:12px; font-weight:600; color:var(--text); cursor:pointer; user-select:none; }
.repasser-toggle input[type=checkbox]{ width:15px; height:15px; accent-color:var(--purple); flex-shrink:0; }
.repasser-hint{ font-weight:400; color:var(--text-3); font-size:11px; }

.data-section{ margin-bottom:20px; }
.data-section h4{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--text-3);
  margin-bottom:10px; display:flex; align-items:center; gap:7px; }
.data-grid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
@media(max-width:500px){ .data-grid{ grid-template-columns:1fr; } }
.data-field{ display:flex; flex-direction:column; gap:3px; }
.data-field label{ font-size:10px; font-weight:600; color:var(--text-3); letter-spacing:.03em; }
.data-field .dv{ font-size:13px; color:var(--text); }
.data-field input,.data-field textarea,.data-field select{
  padding:8px 12px; border:1.5px solid var(--border); border-radius:9px; font-size:13px; font-family:inherit;
  color:var(--text); background:var(--inset); transition:border-color .2s; }
.data-field input:focus,.data-field textarea:focus,.data-field select:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }
.data-field textarea{ resize:vertical; min-height:80px; }
.data-full{ grid-column:1/-1; }
.tel-input-row{ display:flex; align-items:center; gap:6px; }
.tel-input-row input{ flex:1; min-width:0; }
.tel-call-btn{ flex-shrink:0; display:flex; align-items:center; justify-content:center; width:32px; height:32px;
  border-radius:9px; background:var(--green-bg); color:var(--green); font-size:14px; text-decoration:none; transition:transform .12s; }
.tel-call-btn:hover{ transform:scale(1.08); }

/* ─── Fil de discussion ──────────────────────────────────── */
.thread-wrap{ display:flex; flex-direction:column; }
.thread-messages{ background:var(--inset); border:1px solid var(--border); border-radius:var(--r) var(--r) 0 0;
  max-height:300px; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:12px; }
.thread-empty-msg{ text-align:center; color:var(--text-3); font-size:12px; padding:20px 0; }
.thread-msg{ display:flex; flex-direction:column; gap:2px; }
.thread-msg-header{ display:flex; align-items:baseline; gap:8px; }
.thread-msg-author{ font-size:11px; font-weight:700; color:var(--primary-strong); }
.thread-msg-date{ font-size:10px; color:var(--text-3); }
.thread-msg-body{ font-size:12.5px; color:var(--text); line-height:1.55; background:#fff;
  border-radius:0 10px 10px 10px; padding:8px 12px; border:1px solid var(--border); white-space:pre-wrap; word-break:break-word; }
.thread-input-area{ background:var(--inset); border:1px solid var(--border); border-top:0; border-radius:0 0 var(--r) var(--r); padding:12px 14px; display:flex; flex-direction:column; gap:8px; }
.thread-input-row{ display:flex; gap:8px; align-items:flex-end; }
.thread-input-row input[type=text]{ width:150px; padding:8px 12px; border:1.5px solid var(--border); border-radius:9px; font-size:12px; font-family:inherit; flex-shrink:0; background:#fff; color:var(--text); }
.thread-input-row textarea{ flex:1; padding:8px 12px; border:1.5px solid var(--border); border-radius:9px; font-size:13px; font-family:inherit; resize:none; min-height:56px; background:#fff; color:var(--text); transition:border-color .2s; }
.thread-input-row textarea:focus,.thread-input-row input:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }

/* ─── Mails CCI ──────────────────────────────────────────── */
.cci-warning{ display:flex; gap:12px; align-items:flex-start; background:var(--amber-bg); border:1px solid rgba(217,119,6,.3); border-radius:var(--r); padding:14px 16px; margin-bottom:18px; }
.cci-warning-icon{ font-size:20px; flex-shrink:0; line-height:1; }
.cci-warning-text{ font-size:12px; color:#92400E; line-height:1.5; }
.cci-warning-text strong{ display:block; font-weight:700; margin-bottom:3px; font-size:13px; }
.cci-count{ font-size:12px; color:var(--text-3); margin-bottom:10px; }
.cci-box{ width:100%; min-height:90px; padding:12px 14px; border:1.5px solid var(--border); border-radius:var(--r-sm);
  font-family:inherit; font-size:12.5px; color:var(--text); background:#fff; resize:vertical; line-height:1.6; }
.cci-box:focus{ outline:none; border-color:var(--primary); }
.cci-empty{ text-align:center; padding:28px 16px; color:var(--text-3); font-size:13px; background:var(--inset); border-radius:var(--r-sm); border:1.5px dashed var(--border); }

/* ─── Avancement général ─────────────────────────────────── */
.stats-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:24px; }
@media(max-width:900px){ .stats-grid{ grid-template-columns:1fr 1fr; } }
.stat-card{ padding:16px 18px; }
.stat-card .sv{ font-size:28px; font-weight:800; letter-spacing:-.03em; color:var(--text); font-variant-numeric:tabular-nums; }
.stat-card .sl{ font-size:11px; color:var(--text-3); margin-top:2px; }
.stat-card.c-green .sv{ color:var(--green); } .stat-card.c-blue .sv{ color:var(--blue); } .stat-card.c-red .sv{ color:var(--red); }
.global-bar-wrap{ background:var(--surface-3); border-radius:var(--r-pill); height:9px; overflow:hidden; display:flex; margin-bottom:24px; }
.global-bar-seg{ height:100%; transition:width .4s; }
.prog-table table{ width:100%; border-collapse:collapse; font-size:12.5px; }
.prog-table th{ background:var(--inset); padding:11px 14px; text-align:left; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--text-3); border-bottom:1px solid var(--border); }
.prog-table td{ padding:11px 14px; border-bottom:1px solid var(--border); }
.prog-table tr:last-child td{ border-bottom:0; }
.prog-table tbody tr{ cursor:pointer; transition:background .12s; }
.prog-table tbody tr:hover td{ background:var(--primary-light); }

/* ─── États vides ───────────────────────────────────────── */
.empty-state{ text-align:center; padding:56px 20px; color:var(--text-3); }
.empty-state .es-icon{ font-size:40px; margin-bottom:12px; opacity:.7; }
.empty-state h3{ font-size:15px; font-weight:700; color:var(--text); margin-bottom:6px; }
.empty-state p{ font-size:13px; }

/* ─── Divers ────────────────────────────────────────────── */
.divider{ height:1px; background:var(--border); margin:16px 0; }
.success-toast{
  position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(80px);
  background:rgba(255,255,255,.96); border:1px solid var(--border-strong); color:var(--text);
  padding:12px 22px; border-radius:var(--r); font-weight:600; font-size:13px; z-index:2000;
  transition:transform .3s; box-shadow:0 16px 40px rgba(15,23,42,.16), inset 0 1px 0 var(--edge);
}
.success-toast.show{ transform:translateX(-50%) translateY(0); }

/* ─── Accueil (tableau de bord) ──────────────────────────── */
.home-grid{ display:flex; gap:16px; align-items:stretch; min-height:calc(100vh - 90px); }
.home-col-left{ flex:1.6; display:flex; flex-direction:column; gap:16px; min-width:0; }
.home-col-right{ flex:1; display:flex; flex-direction:column; gap:16px; min-width:0; }
.home-recent{ flex:0 0 auto; } .home-changelog{ flex:0 0 auto; } .home-calendar{ flex:1; display:flex; flex-direction:column; }
.home-profile{ flex:1; } .home-support{ flex:0 0 auto; }
@media(max-width:900px){ .home-grid{ flex-direction:column; min-height:0; } .home-calendar{ min-height:300px; } }
.home-calendar-placeholder{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;
  color:var(--text-3); font-size:13px; border:1px dashed var(--border-strong); border-radius:var(--r); gap:10px; padding:30px; }
.home-recent-item{ display:flex; align-items:center; gap:12px; padding:11px 6px; border-bottom:1px solid var(--border); cursor:pointer; transition:background .12s; }
.home-recent-item:last-child{ border-bottom:0; }
.home-recent-item:hover{ background:var(--primary-light); }
.home-recent-item .hri-name{ font-weight:600; font-size:13px; }
.home-recent-item .hri-meta{ font-size:11px; color:var(--text-3); margin-top:1px; }
.home-recent-item .hri-when{ margin-left:auto; font-size:11px; color:var(--text-3); white-space:nowrap; display:flex; align-items:center; gap:4px; }
.home-profile-head{ display:flex; align-items:center; gap:13px; margin-bottom:14px; }
.home-avatar{ width:52px; height:52px; border-radius:14px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:18px; color:#fff; object-fit:cover; background:linear-gradient(135deg,#2B4C8C,#3E63DD); }
.home-profile-name{ font-weight:800; font-size:16px; letter-spacing:-.01em; }
.home-profile-line{ display:flex; align-items:center; gap:9px; font-size:12.5px; color:var(--text-secondary); padding:5px 0; }
.home-profile-line .hpl-ico{ width:16px; text-align:center; color:var(--text-3); }
.home-profile-actions{ display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }

.hp-section{ margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.hp-section-title{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--text-3); margin-bottom:8px; }
.hp-badge{ background:var(--accent-orange); color:#fff; font-size:10px; font-weight:800; border-radius:var(--r-pill); padding:1px 7px; margin-left:4px; }
.hp-sejour-list{ display:flex; flex-direction:column; }
.hp-sejour{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 6px; border-bottom:1px solid var(--border); cursor:pointer; transition:background .12s; }
.hp-sejour:last-child{ border-bottom:0; }
.hp-sejour:hover{ background:var(--primary-light); }
.hp-sejour-name{ font-weight:600; font-size:12.5px; }
.hp-sejour-meta{ font-size:11px; color:var(--text-3); white-space:nowrap; }
.hp-req{ display:flex; align-items:flex-start; gap:10px; justify-content:space-between; padding:11px;
  border:1px solid rgba(217,119,6,.22); background:var(--amber-bg); border-radius:var(--r); margin-bottom:8px; }
.hp-req-txt{ font-size:12px; line-height:1.5; }
.hp-req-sub{ font-size:11px; color:var(--text-3); margin-top:2px; }
.hp-req-actions{ display:flex; flex-direction:column; gap:6px; flex-shrink:0; }

/* KPI row (Accueil) */
.kpi-row{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:18px; }
.kpi{ position:relative; overflow:hidden; background:var(--surface-1); border:1px solid var(--border); border-radius:var(--r);
  padding:15px 16px; box-shadow:var(--shadow); }
.kpi::before{ content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background:linear-gradient(135deg,rgba(255,255,255,.5),transparent 42%); box-shadow:inset 0 1px 0 var(--edge); }
.kpi > *{ position:relative; }
.kpi .k-top{ display:flex; align-items:center; justify-content:space-between; color:var(--text-3); }
.kpi .k-label{ font-size:10px; letter-spacing:.08em; text-transform:uppercase; }
.kpi .k-val{ font-size:32px; font-weight:800; letter-spacing:-.035em; margin-top:10px; font-variant-numeric:tabular-nums; color:var(--text); }
.kpi .k-foot{ display:flex; align-items:center; gap:7px; margin-top:6px; font-size:10.5px; color:var(--text-3); }
.delta{ display:inline-flex; align-items:center; gap:3px; padding:1px 6px; border-radius:var(--r-pill); font-size:10px; font-weight:700; }
.delta.up{ background:var(--green-bg); color:var(--green); } .delta.down{ background:var(--red-bg); color:var(--red); }

@media(max-width:1100px){ .kpi-row{ grid-template-columns:1fr 1fr; } }

/* ═══════════════════════════════════════════════════════════
   Icônes en contexte, points d'ouverture, toast, mobile
   ═══════════════════════════════════════════════════════════ */

/* Icônes injectées dans les rendus JS */
.mini-stat .ico{ width:12px; height:12px; }
.empty-state .es-icon{ display:flex; align-items:center; justify-content:center; opacity:.85; }
.empty-state .es-icon .ico{ width:40px; height:40px; stroke-width:1.5; color:var(--text-secondary); }
.hpl-ico{ display:inline-flex; align-items:center; justify-content:center; }
.hpl-ico .ico{ width:15px; height:15px; }
.hp-section-title .ico,.hri-when .ico,.sc-meta .ico{ width:12px; height:12px; vertical-align:-2px; }
.annuaire-copy{ display:inline-flex; align-items:center; justify-content:center; }
.annuaire-copy .ico{ width:12px; height:12px; }
.annuaire-link-bar .ico{ width:13px; height:13px; vertical-align:-2px; }
.tag-pill .ico{ width:12px; height:12px; }
.data-field .dv a .ico{ width:13px; height:13px; vertical-align:-2px; }
.repasser-badge .ico{ width:13px; height:13px; color:var(--purple); }
.filter-btn .ico{ width:12px; height:12px; vertical-align:-2px; }
.back-btn .ico{ width:14px; height:14px; }
.mlp-header h4 .ico{ width:13px; height:13px; vertical-align:-2px; }

/* Point d'ouverture (remplace 🟢🔴⚪) */
.ov-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; vertical-align:1px;
  margin-right:3px; flex-shrink:0; }
.ov-ouvert{ background:var(--green); box-shadow:0 0 6px rgba(22,163,74,.5); }
.ov-ferme{ background:var(--red); }
.ov-incertain{ background:var(--gray); }
.ouverture-badge{ display:inline-flex; align-items:center; }

/* Toast : icône + texte */
.success-toast{ display:flex; align-items:center; gap:9px; }
.success-toast .ico{ width:15px; height:15px; flex-shrink:0; }
.success-toast.toast-ok .ico{ color:var(--green); }
.success-toast.toast-warn .ico{ color:var(--amber); }
.success-toast.toast-lock .ico{ color:var(--blue); }
.success-toast.toast-info .ico{ color:var(--text-secondary); }

/* ─── Burger + tiroir (mobile) ─────────────────────────────── */
#sidebar-toggle{
  display:none; position:fixed; top:12px; left:12px; z-index:40;
  width:40px; height:40px; align-items:center; justify-content:center;
  border-radius:12px; border:1px solid var(--border-strong); cursor:pointer;
  background:var(--glass-strong); color:var(--text);
  backdrop-filter:blur(20px) saturate(1.5); -webkit-backdrop-filter:blur(20px) saturate(1.5);
  box-shadow:var(--shadow); transition:opacity .2s;
}
#sidebar-toggle .ico{ width:20px; height:20px; }
#sidebar-toggle.is-hidden{ opacity:0; pointer-events:none; }
#sidebar-backdrop{
  display:none; position:fixed; inset:0; z-index:30;
  background:rgba(15,23,42,.35); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px);
  opacity:0; transition:opacity .25s;
}
#sidebar-backdrop.show{ display:block; opacity:1; }

@media (max-width:860px){
  #sidebar-toggle{ display:flex; }
  #main{ padding-top:56px; }                  /* dégage le burger fixe */
  #sidebar{
    position:fixed; top:0; bottom:0; left:0; z-index:45;
    transform:translateX(-100%); transition:transform .28s cubic-bezier(.2,.8,.2,1);
    width:min(84vw,300px);
  }
  #sidebar.open{ transform:translateX(0); box-shadow:0 0 50px rgba(15,23,42,.18); }
  .view-header{ padding:18px 16px 0; }
  .view-body{ padding:16px 16px 40px; }
  .view-body-home{ padding-top:16px; }
  .detail-layout{ grid-template-columns:1fr; }
  #detail-map{ height:300px; }
  #map{ height:300px; }
  .mlp-body{ max-height:none; }
  .home-grid{ flex-direction:column; min-height:0; }
  .modal{ width:calc(100vw - 20px); max-height:92vh; }
  .modal-cols{ flex-direction:column; gap:20px; }
  .modal-col-right{ position:static; }
  .modal-header,.modal-body,.modal-footer{ padding-left:18px; padding-right:18px; }
  .kpi-row{ grid-template-columns:1fr 1fr; }
  .stats-grid{ grid-template-columns:1fr 1fr; }
  .create-name-bar{ grid-template-columns:1fr; }
  .ticket-2col{ flex-direction:column; gap:12px; }
  .sejour-search input{ flex:1 1 100%; }
  .prog-table{ overflow-x:auto; }
  .prog-table table{ min-width:560px; }
  .detail-header-bar{ gap:8px; }
  .btn{ padding:9px 14px; }        /* cibles tactiles */
  .filter-btn{ padding:7px 13px; }
}
@media (max-width:480px){
  .kpi-row{ grid-template-columns:1fr; }
  .stats-grid{ grid-template-columns:1fr; }
  .sejours-grid{ grid-template-columns:1fr; }
}

/* ─── Anti-doublon d'appels : conflits entre séjours ─────────────────────── */
.info-tag-list{ display:flex; flex-direction:column; gap:6px; }
.info-tag-row{ display:flex; align-items:center; gap:8px; font-size:12px; padding:7px 10px;
  background:var(--blue-bg); border:1px solid rgba(37,99,235,.2); border-radius:var(--r-sm); color:var(--text-secondary); }
.info-tag-row .ico{ color:var(--blue); flex-shrink:0; }
.info-tag-row b{ color:var(--text); }

.conflict-card{ position:relative; border:1.5px solid var(--border); border-radius:var(--r);
  padding:14px 16px; margin-bottom:10px; background:var(--surface-1); }
.conflict-card:last-child{ margin-bottom:0; }
.conflict-head{ display:flex; align-items:center; gap:12px; }
.conflict-pct{ font-size:18px; font-weight:800; min-width:54px; text-align:center; padding:5px 0;
  border-radius:var(--r-sm); flex-shrink:0; font-variant-numeric:tabular-nums; }
.conflict-title{ font-weight:700; font-size:13px; }
.conflict-sub{ font-size:11.5px; color:var(--text-3); margin-top:2px; }
.conflict-note{ font-size:12px; color:var(--text-secondary); margin-top:10px; line-height:1.5; }
.conflict-actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.conflict-band-merge{ border-color:rgba(220,38,38,.3); }
.conflict-band-merge .conflict-pct{ background:var(--red-bg); color:var(--red); }
.conflict-band-choice{ border-color:rgba(217,119,6,.3); }
.conflict-band-choice .conflict-pct{ background:var(--amber-bg); color:var(--amber); }
.conflict-band-auto{ opacity:.75; }
.conflict-band-auto .conflict-pct{ background:var(--gray-bg); color:var(--gray); }
.conflict-resolved{ opacity:.55; }
.conflict-resolved .conflict-actions{ display:none; }
.conflict-status-tag{ font-size:11px; font-weight:700; padding:2px 9px; border-radius:var(--r-pill);
  background:var(--green-bg); color:var(--green); }

/* Fusions en attente sur le profil (accueil) */
.mf-req{ display:flex; gap:11px; justify-content:space-between; align-items:flex-start;
  padding:11px; border:1px solid rgba(217,119,6,.22); background:var(--amber-bg);
  border-radius:var(--r); margin-bottom:8px; }
.mf-req:last-child{ margin-bottom:0; }
.mf-req-txt{ font-size:12px; line-height:1.5; }
.mf-req-sub{ font-size:11px; color:var(--text-3); margin-top:2px; }
.mf-req-actions{ display:flex; flex-direction:column; gap:6px; flex-shrink:0; }
.mf-batch{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 6px; border-bottom:1px solid var(--border); font-size:12px; }
.mf-batch:last-child{ border-bottom:0; }
.mf-batch .m{ color:var(--text-3); font-size:11px; }

/* ─── Tickets (bug / idée) ────────────────────────────────────────────── */
.ticket-type-tabs{ display:flex; gap:8px; }
.ticket-type-tab{
  flex:1; display:flex; align-items:center; justify-content:center; gap:7px;
  padding:10px; border-radius:var(--r-sm); border:1.5px solid var(--border);
  background:var(--surface-2); color:var(--text-secondary); font-family:inherit;
  font-size:13px; font-weight:600; cursor:pointer; transition:all .15s;
}
.ticket-type-tab:hover{ color:var(--text); border-color:var(--border-strong); }
.ticket-type-tab.active{ background:var(--primary-light); border-color:var(--primary); color:var(--primary-strong); }

.ticket-slider{
  -webkit-appearance:none; appearance:none; width:100%; height:5px; border-radius:var(--r-pill);
  background:var(--surface-3); outline:none; cursor:pointer; margin-top:4px;
}
.ticket-slider::-webkit-slider-thumb{
  -webkit-appearance:none; width:17px; height:17px; border-radius:50%;
  background:var(--primary); border:2px solid #fff; box-shadow:0 2px 6px rgba(15,23,42,.25); cursor:pointer;
}
.ticket-slider::-moz-range-thumb{
  width:17px; height:17px; border-radius:50%; background:var(--primary);
  border:2px solid #fff; box-shadow:0 2px 6px rgba(15,23,42,.25); cursor:pointer;
}
.ticket-2col{ display:flex; gap:12px; margin-top:12px; }

.ticket-mini-list{ display:flex; flex-direction:column; }
.ticket-mini{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 6px; border-bottom:1px solid var(--border); font-size:12px; }
.ticket-mini:last-child{ border-bottom:0; }
.ticket-mini .tm-title{ display:flex; align-items:center; gap:7px; min-width:0; }
.ticket-mini .tm-title span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ticket-mini .ico{ flex-shrink:0; color:var(--text-3); }

/* Journal des mises à jour (Accueil + admin) */
.changelog-list{ display:flex; flex-direction:column; gap:12px; max-height:320px; overflow-y:auto; }
.changelog-item{ padding-bottom:12px; border-bottom:1px solid var(--border); }
.changelog-item:last-child{ border-bottom:0; padding-bottom:0; }
.changelog-item-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.changelog-item-title{ font-weight:700; font-size:12.5px; }
.changelog-item-date{ font-size:10.5px; color:var(--text-3); white-space:nowrap; }
.changelog-item-desc{ font-size:12px; color:var(--text-secondary); margin-top:3px; line-height:1.5; }
.changelog-item-author{ font-size:10.5px; color:var(--text-3); margin-top:4px; }
.changelog-empty{ text-align:center; color:var(--text-3); font-size:12px; padding:20px 0; }

/* Panel Tickets (admin) */
.ticket-row-desc{ font-size:11.5px; color:var(--text-3); max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ticket-detail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px 16px; margin-bottom:16px; }
.ticket-detail-field{ display:flex; flex-direction:column; gap:2px; }
.ticket-detail-field label{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); }
.ticket-detail-field .v{ font-size:13px; color:var(--text); }
.ticket-detail-desc{ background:var(--inset); border:1px solid var(--border); border-radius:var(--r-sm);
  padding:12px 14px; font-size:13px; line-height:1.6; white-space:pre-wrap; word-break:break-word; }
.ticket-scale{ display:flex; align-items:center; gap:8px; }
.ticket-scale-bar{ flex:1; height:6px; border-radius:var(--r-pill); background:var(--surface-3); overflow:hidden; }
.ticket-scale-bar i{ display:block; height:100%; }

/* ─── Leaflet (thème clair) ─────────────────────────────── */
.leaflet-container{ background:#E9EDF3; }
.leaflet-control-zoom a{ background:var(--glass-strong)!important; color:var(--text)!important; border-color:var(--border)!important; }
.leaflet-control-zoom a:hover{ background:var(--surface-2)!important; }
.leaflet-bar{ border-color:var(--border)!important; box-shadow:0 4px 14px rgba(15,23,42,.12)!important; }
.leaflet-popup-content-wrapper,.leaflet-tooltip{ background:var(--glass-strong)!important; color:var(--text)!important;
  border:1px solid var(--border-strong)!important; backdrop-filter:blur(12px); }
.leaflet-tooltip{ box-shadow:0 6px 18px rgba(15,23,42,.12)!important; }
.leaflet-tooltip-top::before{ border-top-color:var(--border-strong)!important; }
.leaflet-popup-tip{ background:var(--glass-strong)!important; }

/* ── Calendrier (Accueil) ─────────────────────────────────────────────────── */
.cal-nav{ display:flex; align-items:center; gap:6px; margin-bottom:10px; }
.cal-month{ font-weight:700; font-size:14px; min-width:130px; text-align:center; text-transform:capitalize; color:var(--text); }
.cal-grid{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:4px; }
.cal-dow{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-3); text-align:center; padding:2px 0 4px; }
.cal-day{ min-height:62px; padding:4px 5px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2);
  display:flex; flex-direction:column; gap:2px; overflow:hidden; cursor:pointer; transition:border-color .15s, box-shadow .15s; }
.cal-day:hover{ border-color:var(--primary); }
.cal-day.other{ opacity:.45; }
.cal-day.selected{ border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-light); }
.cal-num{ width:20px; height:20px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:600; color:var(--text-secondary); flex:none; }
.cal-day.today .cal-num{ background:var(--primary); color:#fff; }
.cal-evt{ font-size:10px; line-height:1.35; padding:1px 5px; border-radius:5px; background:var(--primary-light); color:var(--primary-strong);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-evt.past{ background:var(--inset); color:var(--text-3); }
.cal-more{ font-size:10px; color:var(--text-3); padding-left:4px; }
.cal-list{ margin-top:14px; display:flex; flex-direction:column; gap:6px; }
.cal-list .hp-section-title{ margin-bottom:2px; }
.cal-reset{ text-transform:none; letter-spacing:0; font-weight:600; }
.cal-item{ display:flex; align-items:center; gap:12px; padding:8px 10px; border:1px solid var(--border); border-radius:10px;
  background:var(--surface-2); cursor:pointer; transition:border-color .15s; }
.cal-item:hover{ border-color:var(--primary); }
.cal-item.past{ opacity:.6; }
.cal-item-date{ flex:none; width:44px; padding:4px 0; border-radius:8px; text-align:center; line-height:1.1;
  background:var(--primary-light); color:var(--primary-strong); }
.cal-item-date b{ display:block; font-size:16px; }
.cal-item-date span{ font-size:10px; text-transform:uppercase; }
.cal-item-title{ font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-item-meta{ font-size:11.5px; color:var(--text-secondary); }
.cal-item-meta .ico{ width:12px; height:12px; vertical-align:-2px; }
.cal-empty{ font-size:13px; color:var(--muted); padding:6px 0; }
@media (max-width:600px){
  .cal-month{ min-width:0; flex:1; }
  .cal-day{ min-height:42px; align-items:center; }
  .cal-evt,.cal-more{ display:none; }
  .cal-day.has::after{ content:''; width:6px; height:6px; border-radius:50%; background:var(--accent-orange); }
}

/* Modale RDV : invités */
.rdv-quick{ display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 8px; }
.rdv-quick select{ padding:5px 10px; font-size:11px; font-family:inherit; border-radius:8px; border:1px solid var(--border);
  background:var(--surface-2); color:var(--text); max-width:220px; }
.rdv-search{ width:100%; margin-bottom:6px; padding:7px 10px; border-radius:9px; border:1.5px solid var(--border);
  font-family:inherit; font-size:13px; background:var(--surface-2); color:var(--text); }
.rdv-people{ max-height:220px; overflow:auto; padding:4px; border:1px solid var(--border); border-radius:10px; background:var(--inset); }
.rdv-person{ display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:7px; font-size:13px; cursor:pointer; }
.rdv-person:hover{ background:var(--surface-2); }
.rdv-person input{ width:15px; height:15px; flex:none; }
.rdv-person .role{ margin-left:auto; font-size:11px; color:var(--text-3); }
.rdv-org{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--accent-orange); }
.rdv-invites{ display:flex; flex-wrap:wrap; gap:5px; margin-top:2px; }

/* ── Calendrier : compléments communs ───────────────────────────────────── */
.btn-orange{ background:var(--accent-orange); border-color:transparent; color:#fff; }
.btn-orange:hover:not(:disabled){ background:var(--accent-orange-strong); }
.cal-live{ display:inline-block; padding:1px 6px; border-radius:999px; font-size:9.5px; font-weight:700; letter-spacing:.04em;
  text-transform:uppercase; background:var(--accent-orange); color:#fff; vertical-align:1px; }
.cal-item.live{ border-color:var(--accent-orange); box-shadow:0 0 0 3px var(--accent-orange-bg); }
.cal-open-page{ display:inline-flex; align-items:center; gap:6px; margin-top:6px; font-size:12px; font-weight:600; }
.cal-open-page .ico{ width:13px; height:13px; }

/* ── Page « Calendrier » ────────────────────────────────────────────────── */
.calp{ display:grid; grid-template-columns:270px minmax(0, 1fr); gap:16px; align-items:start; }
.calp-side{ display:flex; flex-direction:column; gap:14px; position:sticky; top:0; }
.calp-side .panel{ margin:0; }
.calp-new{ justify-content:center; padding:11px 14px; font-size:13px; }
.calp-actions{ display:flex; flex-direction:column; gap:8px; }

.calp-mini-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.calp-mini-head b{ font-size:14px; text-transform:capitalize; color:var(--text); }
.calp-mini-head .btn{ padding:3px 9px; }
.calp-mini-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:3px 0; text-align:center; }
.calp-mini-dow{ font-size:10px; font-weight:700; color:var(--text-3); padding-bottom:4px; }
.calp-mini-d{ position:relative; height:30px; display:flex; align-items:center; justify-content:center; font-size:12px;
  color:var(--text-secondary); cursor:pointer; border-radius:9px; transition:background .12s; }
.calp-mini-d:hover{ background:var(--inset); }
.calp-mini-d.other{ opacity:.4; }
.calp-mini-d.sel{ background:var(--primary-light); color:var(--primary-strong); font-weight:600; }
.calp-mini-d.today{ background:var(--accent-orange); color:#fff; font-weight:700; border-radius:50%; width:30px; justify-self:center; }
.calp-mini-d.has::after{ content:''; position:absolute; bottom:3px; width:4px; height:4px; border-radius:50%; background:var(--primary); }
.calp-mini-d.today.has::after{ background:#fff; }

.calp-type{ display:flex; align-items:center; gap:9px; padding:5px 0; font-size:13px; color:var(--text); cursor:pointer; }
.calp-type input{ width:15px; height:15px; }
.calp-swatch{ width:12px; height:12px; border-radius:4px; flex:none; }
.calp-type-n{ margin-left:auto; font-size:11px; color:var(--text-3); }
.calp-upcoming .cal-item-date{ width:40px; }

.calp-main{ margin:0; padding:0; overflow:hidden; display:flex; flex-direction:column; }
.calp-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:18px 20px;
  background:linear-gradient(115deg, rgba(62,99,221,.14), rgba(62,99,221,.04) 45%, rgba(37,99,235,.16));
  border-bottom:1px solid var(--border); }
.calp-title{ margin:0; font-size:21px; font-weight:700; color:var(--text); text-transform:capitalize; letter-spacing:-.01em; }
.calp-arrows{ display:inline-flex; gap:4px; }
.calp-head-right{ margin-left:auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.calp-seg{ display:inline-flex; padding:3px; border-radius:12px; background:var(--inset); border:1px solid var(--border); }
.calp-seg button{ border:0; background:none; padding:6px 14px; border-radius:9px; font:inherit; font-size:12px;
  color:var(--text-secondary); cursor:pointer; transition:background .15s, color .15s; }
.calp-seg button.active{ background:var(--card); color:var(--text); font-weight:600; box-shadow:0 1px 3px rgba(15,23,42,.12); }

/* Semaine / jour : grille horaire */
.calp-scroll{ overflow:auto; max-height:calc(100vh - 190px); }
.calp-inner{ padding:0 14px 14px; }
.calp-days, .calp-grid{ display:grid; grid-template-columns:52px repeat(var(--cols), minmax(0, 1fr)); gap:0 6px; }
.calp-days{ position:sticky; top:0; z-index:6; padding:12px 0 10px; background:var(--card); }
.calp-tz{ align-self:center; justify-self:center; writing-mode:vertical-rl; transform:rotate(180deg);
  font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-3); }
.calp-dayhead{ display:flex; flex-wrap:wrap; align-items:baseline; justify-content:center; gap:0 6px; padding:10px 4px;
  border-radius:14px; background:var(--surface-2); border:1px solid var(--border); overflow:hidden; text-align:center; }
.calp-week .calp-dayhead{ cursor:pointer; }
.calp-week .calp-dayhead:hover{ border-color:var(--primary); }
.calp-dayhead .dw{ font-size:12px; color:var(--text-3); }
.calp-dayhead .dn{ font-size:24px; font-weight:700; color:var(--text); line-height:1; }
.calp-dayhead.today{ background:var(--primary); border-color:var(--primary); box-shadow:0 6px 16px rgba(62,99,221,.25); }
.calp-dayhead.today .dw, .calp-dayhead.today .dn{ color:#fff; }
.calp-gutter{ position:relative; height:calc(var(--hours) * var(--hpx)); }
.calp-hour{ position:absolute; right:8px; transform:translateY(-50%); font-size:10.5px; color:var(--text-3); white-space:nowrap; }
.calp-col{ position:relative; height:calc(var(--hours) * var(--hpx)); border-radius:12px;
  background:repeating-linear-gradient(to bottom, var(--inset) 0, var(--inset) calc(var(--hpx) - 1px),
    var(--border) calc(var(--hpx) - 1px), var(--border) var(--hpx)); }
.calp-col.today{ background-color:rgba(62,99,221,.05); }
.calp-col.can-add{ cursor:copy; }

.calp-evt{ position:absolute; z-index:2; padding:6px 8px; border-radius:11px; overflow:hidden; cursor:pointer; font-size:11.5px;
  border:1px solid transparent; box-shadow:0 1px 2px rgba(15,23,42,.06); transition:box-shadow .15s, transform .15s; }
.calp-evt:hover{ z-index:5; box-shadow:var(--shadow); transform:translateY(-1px); }
.calp-evt .t{ font-weight:700; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calp-evt .h{ font-size:10.5px; color:var(--text-secondary); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calp-evt .d{ font-size:11px; color:var(--text-secondary); margin-top:4px; white-space:pre-wrap; max-height:4.2em; overflow:hidden; }
.calp-evt.tiny{ padding:3px 8px; display:flex; gap:6px; align-items:baseline; }
.calp-evt.tiny .h{ margin:0; }
.calp-evt.past{ opacity:.5; filter:saturate(.5); }
.calp-evt.live{ border-color:var(--accent-orange); box-shadow:0 0 0 3px var(--accent-orange-bg); }
.calp-avs{ display:flex; margin-top:6px; }
.calp-av{ width:22px; height:22px; margin-left:-6px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:9px; font-weight:700; background:var(--card); color:var(--primary-strong); border:1.5px solid var(--primary-light); }
.calp-av:first-child{ margin-left:0; }
.calp-av.more{ color:var(--text-3); }
.calp-now{ position:absolute; left:-3px; right:0; z-index:4; height:2px; background:var(--accent-orange); pointer-events:none; }
.calp-now::before{ content:''; position:absolute; left:-3px; top:-4px; width:10px; height:10px; border-radius:50%; background:var(--accent-orange); }

/* Couleurs par type d'événement */
.type-reunion.calp-evt{ background:linear-gradient(180deg, rgba(62,99,221,.18), rgba(62,99,221,.10)); border-color:rgba(62,99,221,.28); }
.type-reunion.calp-swatch{ background:var(--primary); }
.type-reunion.calp-mchip{ background:var(--primary-light); color:var(--primary-strong); }

/* Vue mois */
.calp-month{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:6px; padding:14px; }
.calp-mcell{ min-height:108px; padding:6px; border-radius:12px; border:1px solid var(--border); background:var(--surface-2);
  display:flex; flex-direction:column; gap:3px; overflow:hidden; cursor:pointer; transition:border-color .15s; }
.calp-mcell:hover{ border-color:var(--primary); }
.calp-mcell.other{ opacity:.45; }
.calp-mcell.today .cal-num{ background:var(--primary); color:#fff; }
.calp-mchip{ padding:2px 6px; border-radius:6px; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calp-mchip.past{ opacity:.55; }
.calp-mmore{ font-size:10.5px; color:var(--text-3); padding-left:4px; }

/* Écran moyen : la colonne de gauche passe au-dessus, le calendrier prend toute la largeur. */
@media (max-width:1200px){
  .calp{ grid-template-columns:1fr; }
  .calp-side{ position:static; display:grid; grid-template-columns:minmax(240px, 300px) minmax(0, 1fr); grid-auto-flow:dense; align-items:start; }
  .calp-mini{ grid-row:span 2; }
  .calp-new{ align-self:start; justify-self:start; }
  .calp-actions{ align-self:start; align-items:flex-start; }
  .calp-upcoming{ display:none; }
}
@media (max-width:860px){
  .calp-side{ grid-template-columns:1fr; }
  .calp-mini{ grid-row:auto; }
  .calp-new{ justify-self:stretch; }
  .calp-actions{ align-items:stretch; }
  .calp-scroll{ max-height:70vh; }
}
@media (max-width:700px){
  .calp-week .calp-days, .calp-week .calp-grid{ min-width:640px; }   /* semaine : défilement horizontal */
  .calp-head{ padding:14px; }
  .calp-head-right{ margin-left:0; width:100%; justify-content:space-between; }
  .calp-mcell{ min-height:56px; }
  .calp-mchip{ font-size:0; height:6px; padding:0; }   /* mois sur mobile : un trait par réunion */
  .calp-moffs .calp-off{ font-size:0; height:6px; width:100%; padding:0; border-width:1px; }
  .calp-month{ padding:10px; gap:4px; }
}

/* ── RDV en mairie : couleur du type (orange) ──────────────────────────── */
.type-mairie.calp-evt{ background:linear-gradient(180deg, rgba(234,88,12,.18), rgba(234,88,12,.09)); border-color:rgba(234,88,12,.32); }
.type-mairie.calp-swatch{ background:var(--accent-orange); }
.type-mairie.calp-mchip, .cal-evt.type-mairie{ background:var(--accent-orange-bg); color:var(--accent-orange-strong); }
.cal-item.type-mairie .cal-item-date{ background:var(--accent-orange-bg); color:var(--accent-orange-strong); }
.type-mairie.calp-evt .calp-av{ color:var(--accent-orange-strong); border-color:var(--accent-orange-bg); }
.calp-evt.pending{ border-style:dashed; border-width:1.5px; }

/* Fiche mairie : encart du RDV */
.rdvm-card{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:10px 12px;
  border-radius:12px; border:1px solid rgba(234,88,12,.28); background:var(--accent-orange-bg); font-size:13px; color:var(--text); }
.rdvm-who{ display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.rdvm-who .ico, .rdvm-assignee .ico{ width:12px; height:12px; vertical-align:-2px; }

/* Fiche d'un RDV en mairie */
.rdvm-detail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.rdvm-assignees{ display:flex; flex-direction:column; gap:6px; margin-top:2px; }
.rdvm-assignee{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:13px; }

/* Fenêtre de planification (grande) */
.modal.rdvm-modal{ width:min(1320px, 96vw); max-width:none; height:min(900px, 94vh); display:flex; flex-direction:column; }
.rdvm-body{ flex:1; min-height:0; display:grid; grid-template-columns:300px minmax(0, 1fr); gap:16px; padding-top:14px; padding-bottom:14px; overflow:hidden; }
.rdvm-side{ overflow:auto; display:flex; flex-direction:column; gap:14px; padding-right:4px; }
.rdvm-mairie{ padding:12px 14px; border-radius:14px; border:1px solid rgba(234,88,12,.28); background:var(--accent-orange-bg); }
.rdvm-mairie-name{ font-weight:700; font-size:14px; color:var(--text); margin-bottom:4px; }
.rdvm-line{ font-size:12.5px; color:var(--text-secondary); padding:2px 0; }
.rdvm-mairie .ico{ width:13px; height:13px; vertical-align:-2px; }
.rdvm-block{ display:flex; flex-direction:column; gap:6px; }
.rdvm-label{ font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }
.rdvm-sub{ font-size:11px; font-weight:600; color:var(--text-secondary); margin:6px 0 2px; }
.rdvm-mode{ align-self:flex-start; }
.rdvm-terrain{ margin-left:auto; padding:1px 7px; border-radius:999px; font-size:10px; font-weight:700; letter-spacing:.04em;
  text-transform:uppercase; background:var(--accent-orange-bg); color:var(--accent-orange-strong); }
.rdvm-others{ margin-top:4px; font-size:12.5px; }
.rdvm-others summary{ cursor:pointer; color:var(--text-secondary); padding:4px 0; }
.rdvm-hint{ font-size:11.5px; color:var(--muted); }
.rdvm-cal{ min-width:0; min-height:0; display:flex; flex-direction:column; border:1px solid var(--border); border-radius:16px;
  background:var(--card); overflow:hidden; }
.rdvm-nav{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:10px 12px; border-bottom:1px solid var(--border);
  background:linear-gradient(115deg, rgba(62,99,221,.10), rgba(37,99,235,.05)); }
.rdvm-period{ font-size:14px; text-transform:capitalize; margin-left:6px; color:var(--text); }
.rdvm-legend{ margin-left:auto; display:flex; flex-wrap:wrap; gap:10px; font-size:11.5px; color:var(--text-secondary); }
.rdvm-leg{ display:inline-flex; align-items:center; gap:5px; }
.rdvm-dot{ width:10px; height:10px; border-radius:3px; }
.rdvm-grid{ flex:1; min-height:0; }
.rdvm-scroll{ max-height:none; height:100%; }
/* Colonnes des jours : blanches, lignes d'heures, heures de RDV (9 h – 18 h) mises en valeur */
.rdvm-col{ cursor:copy; border-radius:0 0 10px 10px; border:1px solid var(--border); border-top:0;
  background-color:#fff;
  background-image:
    linear-gradient(to bottom, rgba(15,23,42,.045) 0 calc(2 * var(--hpx)), transparent calc(2 * var(--hpx)) calc(11 * var(--hpx)), rgba(15,23,42,.045) calc(11 * var(--hpx))),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--hpx) - 1px), rgba(15,23,42,.08) calc(var(--hpx) - 1px) var(--hpx)); }
.rdvm-col.we{ background-color:#F8FAFC; }
.rdvm-col.today{ background-color:#F5F8FF; }
.rdvm-scroll .calp-days{ padding-bottom:0; }

/* En-tête du jour : vert = tout le monde libre, orange = une partie, rouge = personne */
.rdvm-scroll .calp-dayhead{ border-radius:12px 12px 4px 4px; }
.calp-dayhead.av-all{ box-shadow:inset 0 -4px 0 #16A34A; }
.calp-dayhead.av-some{ box-shadow:inset 0 -4px 0 #F59E0B; }
.calp-dayhead.av-none{ box-shadow:inset 0 -4px 0 #DC2626; }
.calp-dayhead.av-all:not(.today){ background:rgba(22,163,74,.08); border-color:rgba(22,163,74,.30); }
.calp-dayhead.av-some:not(.today){ background:rgba(245,158,11,.10); border-color:rgba(245,158,11,.35); }
.calp-dayhead.av-none:not(.today){ background:rgba(220,38,38,.07); border-color:rgba(220,38,38,.28); }
.calp-dayhead.av-past:not(.today){ opacity:.55; }

/* Bandeau au-dessus des colonnes : séjour (gris) + onglets des personnes indisponibles */
.rdvm-ad{ margin-top:6px; display:flex; flex-direction:column; gap:5px; min-width:0; }
.rdvm-lieux{ display:flex; flex-direction:column; gap:3px; }
.rdvm-lieu{ min-width:0; padding:2px 6px; border-radius:7px; background:rgba(100,116,139,.14); color:var(--text-secondary);
  font-size:10.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rdvm-lieu.far{ background:var(--accent-orange-bg); color:var(--accent-orange-strong); }
.rdvm-tabs{ margin-top:auto; display:grid; grid-template-columns:repeat(var(--lanes), minmax(0, 1fr)); gap:0 2px; padding:0 1px; }
.rdvm-tab{ display:block; min-width:0; padding:4px 3px 3px; border-radius:8px 8px 0 0; background:rgb(var(--lane));
  font-size:10.5px; font-weight:700; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Jours indisponibles : rayures de la couleur de la personne, dans le prolongement de son onglet */
.rdvm-off-lane{ position:absolute; z-index:1; pointer-events:none; border:2px solid rgb(var(--lane)); border-radius:8px;
  background:repeating-linear-gradient(135deg, rgba(var(--lane), .40) 0 7px, rgba(var(--lane), .12) 7px 14px); }
.rdvm-off-lane.top{ border-top:0; border-radius:0 0 8px 8px; }

/* RDV et réunions déjà prévus, à la couleur de la personne */
.rdvm-busy{ position:absolute; z-index:2; padding:3px 5px 3px 6px; border-radius:8px; overflow:hidden; font-size:10.5px; line-height:1.25;
  background:rgba(var(--lane), .24); border:1px solid rgba(var(--lane), .55); border-left:3px solid rgb(var(--lane));
  color:var(--text); pointer-events:none; }
.rdvm-busy b{ display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rdvm-busy span{ color:var(--text-secondary); }
.rdvm-busy.reunion{ background:rgba(var(--lane), .10); border-style:dashed; border-left-style:solid; }
.rdvm-buffer{ position:absolute; z-index:1; border-radius:8px; pointer-events:none;
  background:repeating-linear-gradient(45deg, rgba(100,116,139,.22) 0 5px, transparent 5px 10px); }

/* Légende */
.rdvm-dot{ flex:none; }
.rdvm-dot.hatch{ background:repeating-linear-gradient(45deg, rgba(100,116,139,.55) 0 2px, transparent 2px 4px); border:1px solid rgba(100,116,139,.4); }
.rdvm-dot.off{ background:repeating-linear-gradient(135deg, rgba(100,116,139,.75) 0 2px, rgba(100,116,139,.2) 2px 4px); border:1px solid #64748B; }
.rdvm-dot.lieu{ background:rgba(100,116,139,.30); }
.rdvm-pdot{ width:9px; height:9px; border-radius:50%; flex:none; margin-left:2px; }

/* Créneau placé : se glisse (déplacer) et s'allonge (poignée du bas) */
.rdvm-slot{ position:absolute; left:2px; right:2px; z-index:4; padding:4px 7px; border-radius:9px; font-size:11px;
  cursor:grab; touch-action:none; user-select:none; box-shadow:0 8px 20px rgba(15,23,42,.18); }
.rdvm-slot.dragging{ cursor:grabbing; opacity:.92; box-shadow:0 14px 30px rgba(15,23,42,.28); }
.rdvm-slot b, .rdvm-slot span{ display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rdvm-slot span{ font-size:10.5px; }
.rdvm-slot.ok{ background:rgba(240,253,244,.97); border:2px solid var(--green); color:#14532D; }
.rdvm-slot.ko{ background:rgba(254,242,242,.97); border:2px solid var(--red); color:#7F1D1D; }
.rdvm-slot-h{ position:absolute; left:0; right:0; bottom:-4px; height:12px; cursor:ns-resize; touch-action:none; }
.rdvm-slot-h::after{ content:''; position:absolute; left:50%; bottom:5px; width:22px; height:3px; margin-left:-11px; border-radius:3px;
  background:currentColor; opacity:.45; }
/* Aperçu au survol (avant de cliquer) */
.rdvm-ghost{ position:absolute; left:2px; right:2px; z-index:3; pointer-events:none; padding:3px 6px; border-radius:9px;
  border:2px dashed; font-size:10.5px; line-height:1.3; overflow:hidden; }
.rdvm-ghost b, .rdvm-ghost span{ display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rdvm-ghost.ok{ border-color:rgba(22,163,74,.75); background:rgba(22,163,74,.10); color:#14532D; }
.rdvm-ghost.ko{ border-color:rgba(220,38,38,.65); background:rgba(220,38,38,.08); color:#7F1D1D; }

/* Colonne de gauche : créneaux à proposer, mini-calendrier */
.rdvm-label-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.rdvm-label-row .btn{ padding:3px 8px; font-size:11px; letter-spacing:0; text-transform:none; }
.rdvm-sugg-list{ display:flex; flex-direction:column; gap:5px; }
.rdvm-sugg{ display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; width:100%; padding:7px 10px; border-radius:10px; border:1px solid var(--border);
  background:var(--card); color:var(--text); font:inherit; font-size:12.5px; text-align:left; cursor:pointer; transition:border-color .15s, background .15s; }
.rdvm-sugg:hover{ border-color:var(--primary); background:var(--primary-light); }
.rdvm-sugg.on{ border-color:var(--green); background:rgba(22,163,74,.08); }
.rdvm-sugg b{ display:inline-block; min-width:88px; white-space:nowrap; }
.rdvm-sugg b::first-letter{ text-transform:uppercase; }
.rdvm-sugg span{ white-space:nowrap; }
.rdvm-sugg em{ flex-basis:100%; font-style:normal; font-size:10.5px; color:var(--text-3);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rdvm-mini{ padding:10px; border:1px solid var(--border); border-radius:14px; background:var(--card); }
.rdvm-mini-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; font-size:13px; text-transform:capitalize; }
.rdvm-mini-head .btn{ padding:2px 8px; }
.rdvm-mini-grid{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:3px; }
.rdvm-mini-grid > span{ text-align:center; font-size:10px; font-weight:700; color:var(--text-3); padding-bottom:2px; }
.rdvm-mini-d{ height:34px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:0;
  border:0; border-radius:8px; background:transparent; color:var(--text); font:inherit; font-size:12px; cursor:pointer; }
.rdvm-mini-d i{ display:flex; gap:2px; height:5px; }
.rdvm-mini-d u{ display:block; width:5px; height:5px; border-radius:50%; }
.rdvm-mini-d.av-all, .rdvm-mini-leg .av-all{ background:rgba(22,163,74,.13); color:#14532D; }
.rdvm-mini-d.av-some, .rdvm-mini-leg .av-some{ background:rgba(245,158,11,.18); color:#78350F; }
.rdvm-mini-d.av-none, .rdvm-mini-leg .av-none{ background:rgba(220,38,38,.13); color:#7F1D1D; }
.rdvm-mini-d.av-past, .rdvm-mini-d.other{ opacity:.45; }
.rdvm-mini-d.sel{ box-shadow:inset 0 -3px 0 var(--primary); }
.rdvm-mini-d.today{ font-weight:800; box-shadow:inset 0 0 0 2px var(--primary); }
.rdvm-mini-d:hover{ filter:brightness(.95); }
.rdvm-mini-leg{ display:flex; gap:6px; margin-top:8px; font-size:10.5px; }
.rdvm-mini-leg span{ padding:2px 7px; border-radius:6px; }

.rdvm-agenda{ display:inline-flex; color:var(--text-3); }
.rdvm-agenda .ico{ width:12px; height:12px; }
.rdvm-card-btns{ display:flex; gap:6px; flex-wrap:wrap; }
.rdvm-card-soft{ background:var(--surface-2); border-color:var(--border); }

/* Page Calendrier : RDV en mairie aux couleurs de qui y va, calque des indisponibilités, vue Liste */
.calp-evt.percolor, .calp-mchip.percolor, .cal-evt.percolor{ background:rgba(var(--evc), .17); border-color:rgba(var(--evc), .45); color:var(--text); }
.calp-evt.percolor{ padding-left:12px; }
.calp-evt.percolor::before{ content:''; position:absolute; left:0; top:0; bottom:0; width:5px; background:var(--evs); }
.calp-mchip.percolor, .cal-evt.percolor{ box-shadow:inset 3px 0 0 rgb(var(--evc)); }
.cal-item.percolor .cal-item-date{ background:rgba(var(--evc), .18); color:var(--text); box-shadow:inset 0 -3px 0 rgb(var(--evc)); }
.calp-off{ display:inline-block; max-width:100%; padding:2px 7px; border-radius:7px; font-size:10.5px; font-weight:700;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; border:1.5px solid rgb(var(--lane)); color:var(--text) !important;
  background:repeating-linear-gradient(135deg, rgba(var(--lane), .42) 0 6px, rgba(var(--lane), .14) 6px 12px); }
.calp-offrow{ display:flex; flex-wrap:wrap; align-items:flex-start; align-content:flex-start; gap:3px; margin-top:6px; min-width:0; }
.calp-moffs{ display:flex; flex-wrap:wrap; gap:2px; margin-bottom:2px; }
.calp-moffs .calp-off{ font-size:9.5px; padding:1px 5px; }
.type-dispo.calp-swatch{ background:repeating-linear-gradient(135deg, rgba(100,116,139,.75) 0 2px, rgba(100,116,139,.2) 2px 4px); border:1px solid #64748B; }
.calp-list{ padding:6px 18px 18px; }
.calp-lday{ padding:12px 0 4px; border-bottom:1px solid var(--border); }
.calp-lday:last-child{ border-bottom:0; }
.calp-lhead{ display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:8px; font-size:13px; color:var(--text); }
.calp-lhead b{ display:inline-block; }
.calp-lhead b::first-letter{ text-transform:uppercase; }
.calp-lday.today .calp-lhead b{ color:var(--primary); }
.calp-ltoday{ padding:1px 8px; border-radius:999px; background:var(--primary); color:#fff; font-size:10.5px; font-weight:700; text-transform:none; }
.calp-loffs{ display:flex; flex-wrap:wrap; gap:4px; margin-left:auto; text-transform:none; }
.calp-litem{ position:relative; display:flex; align-items:center; gap:12px; padding:9px 12px; margin-bottom:6px; border-radius:12px;
  border:1px solid var(--border); background:var(--card); cursor:pointer; transition:border-color .15s, box-shadow .15s; }
.calp-litem:hover{ border-color:var(--primary); box-shadow:var(--shadow); }
.calp-litem.past{ opacity:.55; }
.calp-litem.live{ border-color:var(--accent-orange); box-shadow:0 0 0 3px var(--accent-orange-bg); }
.calp-ltime{ flex:none; width:58px; display:flex; flex-direction:column; font-size:13px; color:var(--text); }
.calp-ltime span{ font-size:11px; color:var(--text-3); }
.calp-lbar{ flex:none; align-self:stretch; width:5px; border-radius:5px; background:var(--primary); }
.calp-litem.type-mairie .calp-lbar{ background:var(--accent-orange); }
.calp-litem.percolor .calp-lbar{ background:var(--evs); }
.calp-lmain{ flex:1; min-width:0; }
.calp-ltitle{ font-weight:700; font-size:13.5px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calp-lmeta{ margin-top:2px; font-size:11.5px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calp-lmeta .ico{ width:12px; height:12px; vertical-align:-2px; }
.calp-lpending{ color:var(--accent-orange-strong); font-weight:600; }
.calp-litem .calp-avs{ margin:0; flex:none; }
.calp-lempty{ padding:40px 0; text-align:center; }

/* Administration : couleur de chaque personne (pastille → fenêtre de choix) */
.adm-color{ width:26px; height:26px; padding:0; border:3px solid #fff; border-radius:50%; cursor:pointer; vertical-align:middle;
  box-shadow:0 0 0 1.5px var(--border-strong); transition:transform .15s; }
.adm-color:hover{ transform:scale(1.12); }
.adm-color-auto{ margin-left:6px; font-size:10.5px; color:var(--text-3); vertical-align:middle; }
.col-preview{ display:flex; gap:16px; align-items:stretch; padding:14px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.col-prev-col{ width:84px; flex:none; display:flex; flex-direction:column; }
.col-prev-off{ flex:1; min-height:70px; border:2px solid rgb(var(--lane)); border-top:0; border-radius:0 0 8px 8px;
  background:repeating-linear-gradient(135deg, rgba(var(--lane), .40) 0 7px, rgba(var(--lane), .12) 7px 14px); }
.col-prev-side{ flex:1; min-width:0; display:flex; flex-direction:column; gap:10px; justify-content:center; }
.col-prev-evt{ padding:8px 10px; border-radius:10px; font-size:12px; color:var(--text); background:rgba(var(--evc), .17);
  border:1px solid rgba(var(--evc), .45); box-shadow:inset 4px 0 0 rgb(var(--evc)); }
.col-prev-row{ display:flex; align-items:center; gap:8px; }
.col-prev-row .calp-av{ margin:0; }
.col-palette{ display:grid; grid-template-columns:repeat(8, 1fr); gap:8px; }
.col-sw{ aspect-ratio:1; width:100%; border:3px solid #fff; border-radius:50%; cursor:pointer; box-shadow:0 0 0 1px var(--border-strong);
  transition:transform .12s; }
.col-sw:hover{ transform:scale(1.1); }
.col-sw.on{ box-shadow:0 0 0 2.5px var(--text); transform:scale(1.1); }
.col-custom{ display:flex; align-items:center; gap:10px; margin-top:14px; font-size:13px; color:var(--text-secondary); }
.col-custom input[type=color]{ width:44px; height:32px; padding:2px; border:1px solid var(--border-strong); border-radius:8px; background:#fff; cursor:pointer; }
.col-custom code{ font-size:12px; color:var(--text); }

.rdvm-footer{ align-items:center; flex-wrap:wrap; }
.rdvm-status{ margin-right:auto; font-size:12.5px; max-width:640px; line-height:1.45; }
.rdvm-status .ico{ width:14px; height:14px; vertical-align:-2px; }
.rdvm-status.ok{ color:var(--green); }
.rdvm-status.ko{ color:var(--red); }
.rdvm-warn{ color:var(--amber); margin-top:2px; }
.rdvm-status:not(.ok):not(.ko){ color:var(--text-secondary); }

/* Affichage allégé (Mon profil → « Affichage sur cet appareil ») : ni flou, ni animation,
   ni fond décoratif — pour les machines où IGrep est lent ou saccadé. */
html.lite *, html.lite *::before, html.lite *::after{ backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
html.lite body::before, html.lite body::after{ display:none; }
html.lite .brand-ascii-track, html.lite .brand-ascii-track pre{ animation:none !important; }
html.lite .modal{ background:#fff; }
html.lite .modal-overlay{ background:rgba(15,23,42,.55); }
html.lite .btn:hover:not(:disabled){ transform:none; }

/* Fenêtre « Disponibilités » ouverte à part (?dispo=1) : le calendrier seul, sur toute la fenêtre */
html.igrep-dispo #sidebar, html.igrep-dispo #sidebar-toggle, html.igrep-dispo #sidebar-backdrop, html.igrep-dispo #main{ display:none !important; }
html.igrep-dispo #rdvm-overlay{ background:var(--bg); backdrop-filter:none; -webkit-backdrop-filter:none; transition:none; }
html.igrep-dispo .modal.rdvm-modal{ width:100vw; height:100vh; height:100dvh; max-height:none; border-radius:0; border:0; transform:none; }

/* Administration : agenda Google d'une personne de l'équipe terrain */
.ag-btn{ margin-left:6px; padding:3px 8px; font-size:11px; }
.ag-btn.ok{ color:var(--green); }
.ag-btn.err{ color:var(--red); }
.ag-steps{ margin:6px 0 0 18px; font-size:13px; color:var(--text-secondary); line-height:1.6; }
.ag-state{ padding:10px 12px; border-radius:12px; font-size:13px; margin-bottom:12px; border:1px solid var(--border); background:var(--surface-2); }
.ag-state.ok{ border-color:rgba(22,163,74,.3); background:rgba(22,163,74,.08); color:#14532D; }
.ag-state.err{ border-color:rgba(220,38,38,.3); background:rgba(220,38,38,.07); color:#7F1D1D; }

@media (max-width:860px){
  .modal.rdvm-modal{ width:100vw; height:100dvh; max-height:none; border-radius:0; }
  .rdvm-body{ grid-template-columns:1fr; grid-template-rows:auto minmax(420px, 1fr); overflow:auto; }
  .rdvm-side{ overflow:visible; }
  .rdvm-detail-grid{ grid-template-columns:1fr; }
}
