/* =====================================================================
   RED PEPPER AGENCY TASKS — Style (Flat Design · rouge #FF0000 / noir / blanc)
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&display=swap');

/* Open Sauce Sans (hors Google Fonts) via Fontsource */
@font-face { font-family:'Open Sauce Sans'; font-style:normal; font-weight:400; font-display:swap; src:url('https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-sans@5.2.5/latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Open Sauce Sans'; font-style:normal; font-weight:500; font-display:swap; src:url('https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-sans@5.2.5/latin-500-normal.woff2') format('woff2'); }
@font-face { font-family:'Open Sauce Sans'; font-style:normal; font-weight:600; font-display:swap; src:url('https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-sans@5.2.5/latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'Open Sauce Sans'; font-style:normal; font-weight:700; font-display:swap; src:url('https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-sans@5.2.5/latin-700-normal.woff2') format('woff2'); }
@font-face { font-family:'Open Sauce Sans'; font-style:normal; font-weight:800; font-display:swap; src:url('https://cdn.jsdelivr.net/fontsource/fonts/open-sauce-sans@5.2.5/latin-800-normal.woff2') format('woff2'); }

:root {
  --rp-red: #FF0000;
  --font-head: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Open Sauce Sans", "Avenir Next", "Avenir", -apple-system, "Segoe UI", Roboto, sans-serif;
  --rp-red-dark: #D90000;
  --ink: #111114;
  --ink-soft: #3A3A42;
  --muted: #8A8A95;
  --line: #E8E8EE;
  --line-soft: #F1F1F5;
  --bg: #F6F6F9;
  --card: #FFFFFF;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(17,17,20,.05);
  --shadow: 0 4px 16px rgba(17,17,20,.08);
  --ok: #16A34A; --warn: #E08600; --late: #E11D2E; --info: #1D4ED8;
  --r-a_faire:#94A3B8; --r-en_cours:#1D4ED8; --r-en_revision:#E08600; --r-termine:#16A34A;
  --ico: 18px;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--rp-red); }
.hidden { display: none !important; }
svg { display: block; }
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-thumb { background: #dadae2; border-radius: 10px; border: 2px solid var(--bg); }

/* Accessibilité : focus clavier + réduction du mouvement */
:focus-visible { outline: 3px solid rgba(255,0,0,.45); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Connexion ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(820px 460px at 12% -12%, rgba(255,0,0,.10), transparent 60%),
    radial-gradient(820px 460px at 100% 112%, rgba(17,17,20,.06), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 410px; background: var(--card); border-radius: 22px;
  box-shadow: var(--shadow); padding: 34px 32px; border: 1px solid var(--line);
}
.auth-logo { height: 40px; display: block; margin-bottom: 22px; }
.auth-card h1 { font-size: 23px; margin: 6px 0 4px; letter-spacing: -.3px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field label svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; stroke: var(--muted); }
.field input, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px;
  outline: none; transition: border-color .15s, box-shadow .15s; background: #fff;
}
.field input:focus, .field select:focus { border-color: var(--rp-red); box-shadow: 0 0 0 3px rgba(255,0,0,.10); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 11px; border: 1.5px solid transparent;
  font-weight: 700; transition: transform .05s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: var(--ico); height: var(--ico); }
.btn-primary { background: var(--rp-red); color: #fff; }
.btn-primary:hover { background: var(--rp-red-dark); box-shadow: 0 6px 18px rgba(255,0,0,.26); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.link-row { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.link-row button { background: none; border: none; color: var(--rp-red); font-weight: 700; }
.msg { font-size: 13px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.msg.err { background: #FDECEC; color: #B0121F; }
.msg.ok  { background: #EAF8EF; color: #15803D; }

/* ---------- Mise en page application ---------- */
.app { display: none; min-height: 100vh; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: #fff;
  border-top: 3px solid var(--rp-red); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 62px;
}
.topbar-logo { height: 30px; display: block; }
.topbar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); flex: none;
}
.me-name { font-size: 13px; font-weight: 800; line-height: 1.15; }
.role-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 999px; background: #ECECF1; color: #555; display: inline-block; margin-top: 2px;
}
.role-admin   { background: var(--rp-red); color: #fff; }
.role-manager { background: #1D4ED8; color: #fff; }
.role-collaborateur { background: #ECECF1; color: #555; }
.icon-btn {
  background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line); padding: 8px 12px;
  border-radius: 10px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .15s, color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn svg { width: var(--ico); height: var(--ico); }
.icon-btn.square { padding: 9px; }
.icon-btn.danger { color: var(--late); }

/* Menu déroulant (mobile / actions) */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 190px; z-index: 40; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: none;
  padding: 10px 11px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--ink); text-align: left; }
.menu button:hover { background: var(--bg); }
.menu button svg { width: var(--ico); height: var(--ico); color: var(--muted); }

/* ---------- Barre d'outils ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fff;
}
.toolbar .grow { flex: 1; min-width: 180px; }
.search { position: relative; }
.search input { padding: 10px 12px 10px 38px; border: 1.5px solid var(--line); border-radius: 11px; width: 100%; outline: none; transition: border-color .15s; }
.search input:focus { border-color: var(--rp-red); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.select {
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; outline: none; font-weight: 600; transition: border-color .15s;
}
.select:focus { border-color: var(--rp-red); }
.seg { display: inline-flex; background: var(--bg); border-radius: 11px; padding: 3px; }
.seg button { border: none; background: transparent; padding: 8px 12px; border-radius: 9px; font-weight: 800; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Bandeau de stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 20px 2px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.stat .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat .ic svg { width: 20px; height: 20px; }
.stat .n { font-size: 21px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 600; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 18px 20px; align-items: start; }
.col { background: #ECECF1; border-radius: var(--radius); padding: 8px; min-height: 150px; transition: background .12s; border-top: 3px solid var(--col-accent, #ccc); }
.col.dragover { background: #FFE1E1; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 10px; }
.col-title { font-weight: 800; font-size: 13.5px; display: flex; align-items: center; gap: 8px; letter-spacing: -.2px; }
.col-dot { width: 9px; height: 9px; border-radius: 50%; }
.count { background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; min-width: 24px; text-align: center; }
.quick-add { width: 100%; background: transparent; border: 1.5px dashed #cfcfd8; color: var(--muted); border-radius: 11px;
  padding: 9px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; transition: border-color .15s, color .15s, background .15s; }
.quick-add:hover { border-color: var(--rp-red); color: var(--rp-red); background: #fff; }
.quick-add svg { width: 15px; height: 15px; }

.card {
  background: var(--card); border-radius: 13px; padding: 12px 13px 11px; margin-bottom: 9px;
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--muted); cursor: grab;
  transition: transform .1s, box-shadow .12s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card:active { cursor: grabbing; }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card .title { font-weight: 700; font-size: 14px; line-height: 1.35; flex: 1; }
.client-tag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; padding: 3px 7px; border-radius: 6px; color: #fff; white-space: nowrap; flex: none; }
.card .meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 3px 8px 3px 4px; border-radius: 999px; background: var(--bg); color: var(--ink-soft);
}
.chip.plain { padding: 3px 9px; }
.chip .swatch { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mini-avatar { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 9px; flex: none; }
.due { font-size: 12px; font-weight: 700; display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:999px; }
.due svg { width: 13px; height: 13px; }
.due.soon { background: #FFF4E5; color: var(--warn); }
.due.late { background: #FDECEC; color: var(--late); }
.due.ok   { background: var(--bg); color: var(--muted); }
.prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex:none; }
.prio-basse { background: #94A3B8; } .prio-normale { background: #3B82F6; }
.prio-haute { background: #E08600; } .prio-urgente { background: var(--rp-red); }
.empty-col { text-align:center; color: #aaa; font-size: 12.5px; padding: 18px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-col svg { width: 22px; height: 22px; opacity: .55; }

/* ---------- Vue tableau ---------- */
.table-wrap { padding: 18px 20px; overflow-x: auto; }
table.tasks { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.tasks th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.tasks td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
table.tasks tr:last-child td { border-bottom: none; }
table.tasks tbody tr { transition: background .1s; }
table.tasks tbody tr:hover td { background: #FAFAFB; cursor: pointer; }
.status-pill { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

/* ---------- Vue d'ensemble (dashboard) ---------- */
.dash { padding: 18px 20px; }
.dash-grid { display: grid; grid-template-columns: 290px 1fr; gap: 14px; margin-bottom: 14px; }
.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-card { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:18px; box-shadow:var(--shadow-sm); }
.dash-card h4 { margin:0 0 14px; font-size:14px; letter-spacing:-.2px; display:flex; align-items:center; gap:8px; }
.dash-card h4 svg { width:17px; height:17px; color:var(--rp-red); }
.dash-card h4 .muted { color:var(--muted); font-weight:600; margin-left:auto; font-size:12.5px; }
.ring-card { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; }
.ring { position:relative; width:178px; height:178px; border-radius:50%;
  background: conic-gradient(var(--rp-red) calc(var(--p,0)*1%), #ECECF1 0); }
.ring::after { content:''; position:absolute; inset:15px; background:#fff; border-radius:50%; }
.ring-center { position:absolute; inset:0; display:grid; place-items:center; text-align:center; }
.ring-pct { font-size:40px; font-weight:800; line-height:1; font-variant-numeric:tabular-nums; }
.ring-sub { font-size:12.5px; color:var(--muted); font-weight:700; margin-top:4px; }
.ring-foot { font-size:13.5px; color:var(--ink-soft); font-weight:700; }
.kv { display:flex; align-items:center; gap:12px; margin:11px 0; }
.kv .lbl { width:120px; font-size:13px; font-weight:700; display:flex; align-items:center; gap:8px; flex:none; }
.kv .lbl .dot { width:9px; height:9px; border-radius:50%; flex:none; }
.kv .av { width:24px; height:24px; border-radius:50%; display:grid; place-items:center; color:#fff; font-weight:800; font-size:10px; flex:none; }
.kv .track { flex:1; height:10px; background:#ECECF1; border-radius:999px; overflow:hidden; }
.kv .fill { height:100%; border-radius:999px; transition: width .35s ease; }
.kv .val { width:84px; text-align:right; font-size:13px; font-weight:800; font-variant-numeric:tabular-nums; color:var(--ink-soft); flex:none; }
.dash-empty { text-align:center; color:var(--muted); padding:26px; font-size:13.5px; }
@media (max-width: 920px){ .dash-grid{ grid-template-columns:1fr; } .dash-two{ grid-template-columns:1fr; } }

/* ---------- Dispatching des projets ---------- */
.ds-wrap { padding: 18px 20px; }
.ds-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ds-bar-title { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 9px; letter-spacing: -.2px; }
.ds-bar-title svg { width: 19px; height: 19px; color: var(--rp-red); }
.ds-bar-title .muted { color: var(--muted); font-weight: 600; font-size: 13px; }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.ds-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .12s, border-color .12s; }
.ds-card.clickable { cursor: pointer; }
.ds-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #dcdce4; }
.ds-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line-soft); }
.ds-name { font-weight: 800; font-size: 15.5px; line-height: 1.3; letter-spacing: -.2px; }
.ds-role { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.ds-role:last-child { border-bottom: none; padding-bottom: 0; }
.ds-role-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.ds-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .4px; padding: 2px 6px; border-radius: 6px; color: #fff; background: var(--role-accent, var(--ink)); white-space: nowrap; }
.ds-role-person { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.ds-person { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.ds-person.muted { color: var(--muted); font-weight: 600; }
.mini-avatar.empty { background: #ECECF1 !important; color: var(--muted); }
@media (max-width: 640px){ .ds-wrap { padding: 14px; } .ds-grid { grid-template-columns: 1fr; } }

/* ---------- Modale ---------- */
.overlay { position: fixed; inset: 0; background: rgba(17,17,20,.55); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 18px; animation: fade .14s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); max-height: 92vh; overflow: auto; animation: pop .16s ease; }
@keyframes pop { from { transform: scale(.97); opacity: .6; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background:#fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: -.2px; display: flex; align-items: center; gap: 9px; }
.modal-head h3 svg { width: 19px; height: 19px; color: var(--rp-red); }
.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background:#fff; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.x-btn { background: var(--bg); color: #333; border: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.x-btn svg { width: 17px; height: 17px; }
.x-btn:hover { background: #e8e8ee; }
textarea, .modal .field input, .modal .field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 11px; outline: none; background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
.modal .field select:focus, .modal .field input:focus, textarea:focus { border-color: var(--rp-red); box-shadow: 0 0 0 3px rgba(255,0,0,.08); }
.hint { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; line-height: 1.5; }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 800; margin: 4px 0 10px; }

/* ---------- Panneaux équipe / clients ---------- */
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.row-item:last-child { border-bottom: none; }
/* identité (avatar + nom + email) : prend la place restante, tronque proprement */
.row-id { flex: 1 1 170px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-email { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* groupe de contrôles : couleur / rôle / supervise / activer — passe à la ligne si trop serré */
.row-controls { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.row-controls .select.btn-sm { width: auto; min-width: 132px; }
/* lignes membres avec panneau de supervision déplié */
.row-wrap > .row-item { border-bottom: 1px solid var(--line-soft); }
.row-wrap:last-child > .row-item { border-bottom: none; }
.sup-panel { padding: 4px 0 14px 52px; }
.sup-head { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.sup-head svg { width: 15px; height: 15px; flex: none; }
.icon-btn.active { border-color: var(--rp-red); color: var(--rp-red); background: rgba(255,0,0,.05); }
.color-input { width: 38px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; cursor: pointer; flex: none; }
.add-box { background: var(--bg); border: 1px dashed var(--line); border-radius: 14px; padding: 16px; margin-top: 4px; }

.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 20;
  background: var(--rp-red); color: #fff; border: none; border-radius: 999px;
  padding: 15px 22px; font-weight: 800; box-shadow: 0 10px 26px rgba(255,0,0,.36); font-size: 15px;
  display: none; align-items: center; gap: 8px;
}
.fab svg { width: 18px; height: 18px; }
.fab:hover { background: var(--rp-red-dark); }

.loader { display: grid; place-items: center; padding: 80px; color: var(--muted); }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--rp-red); border-radius: 50%; animation: r 0.8s linear infinite; }
@keyframes r { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) { .board { grid-template-columns: 1fr 1fr; } .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .board { grid-template-columns: 1fr; padding: 14px; }
  .toolbar { padding: 12px; }
  .stats { padding: 12px 14px 0; }
  .grid2 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .topbar { padding: 0 12px; gap: 8px; }
  .fab { display: inline-flex; }
}
@media (min-width: 641px) { .only-mobile { display: none !important; } }


/* =====================================================================
   MESSAGERIE D'ÉQUIPE (chat : canal général + privé 1:1) — design premium
   ===================================================================== */
/* Onglet "Messagerie" mis en avant dans la barre + pastille pulsée */
.seg button[data-view="chat"] { position: relative; }
.seg button[data-view="chat"] svg { color: var(--rp-red); }
.seg button[data-view="chat"].active svg { color: inherit; }
.chat-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 3px; border-radius: 999px; background: var(--rp-red); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 0 rgba(255,0,0,.5);
  animation: chatpulse 1.8s ease-out infinite;
}
@keyframes chatpulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,0,0,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(255,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,0,0,0); }
}

.chat-wrap {
  display: grid; grid-template-columns: 320px 1fr; gap: 14px;
  height: calc(100dvh - 96px); min-height: 460px; padding: 14px 18px;
}

/* ---- Colonne des conversations ---- */
.chat-list {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-y: auto; padding: 8px;
}
.conv-title {
  display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; color: var(--ink); padding: 10px 8px 12px;
}
.conv-title svg { width: 16px; height: 16px; color: var(--rp-red); }
.conv {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px; border: none;
  background: transparent; border-radius: 13px; text-align: left; transition: background .14s, transform .06s;
  position: relative;
}
.conv:hover { background: var(--line-soft); }
.conv:active { transform: scale(.99); }
.conv.active { background: rgba(255,0,0,.07); box-shadow: inset 3px 0 0 var(--rp-red); }
.conv-av {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  color: #fff; font-weight: 800; font-size: 14px; box-shadow: 0 2px 6px rgba(17,17,20,.14);
}
.conv-av.gen { background: linear-gradient(135deg, var(--rp-red), #7a0202); }
.conv-av.gen svg { width: 21px; height: 21px; }
.conv-av.sm { width: 38px; height: 38px; font-size: 13px; box-shadow: none; }
.conv-av.sm svg { width: 19px; height: 19px; }
.conv-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.conv-row { display: flex; align-items: center; gap: 8px; }
.conv-name { flex: 1; font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11px; color: var(--muted); flex-shrink: 0; font-weight: 600; }
.conv-prev { flex: 1; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .conv-name { font-weight: 800; }
.conv.unread .conv-prev { color: var(--ink-soft); font-weight: 600; }
.conv.unread .conv-time { color: var(--rp-red); font-weight: 800; }
.conv-badge {
  flex-shrink: 0; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--rp-red); color: #fff; font-size: 11px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(255,0,0,.35);
}

/* ---- Fil de discussion ---- */
.chat-main {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
.chat-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fcfcfe);
}
.chat-head-txt { min-width: 0; flex: 1; }
.chat-title { font-weight: 800; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.chat-sub .pres { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px rgba(22,163,74,.18); }
.chat-back { display: none; border: none; background: var(--line-soft); border-radius: 10px; padding: 8px; }
.chat-back svg { width: 18px; height: 18px; }

.chat-thread {
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px;
  background:
    radial-gradient(560px 220px at 100% 0%, rgba(255,0,0,.04), transparent 60%),
    radial-gradient(520px 240px at 0% 100%, rgba(17,17,20,.035), transparent 60%),
    var(--bg);
}
.msg-day { text-align: center; margin: 10px 0 6px; }
.msg-day span {
  display: inline-block; background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
  border: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 700;
  padding: 4px 13px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.msg-row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; animation: msgin .22s ease-out; }
@keyframes msgin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-row.me { flex-direction: row-reverse; }
.msg-av {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  color: #fff; font-weight: 800; font-size: 11px; margin-bottom: 2px; box-shadow: 0 2px 5px rgba(17,17,20,.16);
}
.bubble {
  max-width: 72%; padding: 9px 13px; border-radius: 18px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); border-bottom-left-radius: 5px; transition: transform .08s;
}
.msg-row:hover .bubble { transform: translateY(-1px); }
.msg-row.me .bubble {
  background: linear-gradient(135deg, #ff1a1a, var(--rp-red-dark)); color: #fff; border-color: transparent;
  border-bottom-left-radius: 18px; border-bottom-right-radius: 5px; box-shadow: 0 4px 12px rgba(255,0,0,.22);
}
.msg-author { font-size: 12px; font-weight: 800; margin-bottom: 2px; color: var(--info); }
.msg-body { font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
.msg-row.me .msg-time { color: rgba(255,255,255,.85); }
.msg-del {
  align-self: center; border: none; background: transparent; color: var(--muted); padding: 4px;
  border-radius: 8px; opacity: 0; transition: opacity .12s, color .12s;
}
.msg-del svg { width: 15px; height: 15px; }
.msg-row:hover .msg-del { opacity: 1; }
.msg-del:hover { color: var(--late); background: var(--line-soft); }

.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--muted); text-align: center;
}
.chat-empty svg {
  width: 52px; height: 52px; color: var(--rp-red); opacity: .9; padding: 16px; border-radius: 50%;
  background: rgba(255,0,0,.08); box-sizing: content-box;
}
.chat-empty p { margin: 0; font-weight: 700; color: var(--ink-soft); font-size: 15px; }

/* ---- Zone de saisie ---- */
.chat-composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
#chatInput {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 16px;
  outline: none; max-height: 140px; overflow-y: auto; line-height: 1.4; background: var(--bg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
#chatInput:focus { border-color: var(--rp-red); background: #fff; box-shadow: 0 0 0 4px rgba(255,0,0,.10); }
.chat-send {
  width: 46px; height: 46px; padding: 0; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(255,0,0,.3); transition: transform .1s, box-shadow .15s;
}
.chat-send:hover { transform: scale(1.06); box-shadow: 0 6px 16px rgba(255,0,0,.4); }
.chat-send:active { transform: scale(.96); }
.chat-send svg { width: 19px; height: 19px; transform: translateX(1px); }

@media (max-width: 760px) {
  .chat-wrap { grid-template-columns: 1fr; height: calc(100dvh - 150px); padding: 10px; gap: 0; }
  .chat-wrap .chat-main { display: none; }
  .chat-wrap.show-thread .chat-list { display: none; }
  .chat-wrap.show-thread .chat-main { display: flex; }
  .chat-back { display: inline-flex; }
  .bubble { max-width: 82%; }
}

/* ---- Présence (point vert en ligne) ---- */
.conv-av { position: relative; }
.pres-dot {
  position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ok); border: 2.5px solid #fff; box-shadow: 0 0 0 1px rgba(22,163,74,.25);
}
.conv-av.sm .pres-dot { width: 11px; height: 11px; border-width: 2px; }
.pres.off { background: var(--muted); box-shadow: none; }

/* ---- Initiateur de la tâche (créateur) ---- */
.card-foot {
  display: flex; align-items: center; gap: 5px; margin-top: 9px; padding-top: 8px;
  border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--muted);
}
.card-foot svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .8; }
.card-foot b { font-weight: 700; color: var(--ink-soft); }
.hint-meta {
  display: flex; align-items: center; gap: 7px; margin: 0 0 14px; padding: 9px 12px;
  background: var(--line-soft); border-radius: 11px; font-size: 13px; color: var(--ink-soft);
}
.hint-meta svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--rp-red); }
.hint-meta b { font-weight: 800; }

/* =====================================================================
   REFONTE SaaS — sidebar gauche + en-tête de page (Linear/Notion-like)
   ===================================================================== */
.app-shell { display: flex; min-height: 100dvh; }
.scrim { display: none; }

/* ---- Sidebar ---- */
.sidebar {
  width: 248px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; padding: 16px 14px;
  height: 100dvh; position: sticky; top: 0; align-self: flex-start; overflow-y: auto;
}
.side-top { padding: 6px 8px 16px; }
.side-logo { height: 30px; display: block; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); padding: 18px 11px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border: none;
  background: transparent; border-radius: 11px; color: var(--ink-soft); font-weight: 700; font-size: 14px;
  text-align: left; transition: background .14s, color .14s; position: relative;
}
.nav-item:hover { background: var(--line-soft); color: var(--ink); }
.nav-item.active { background: rgba(255,0,0,.08); color: var(--rp-red); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; background: var(--rp-red); border-radius: 0 3px 3px 0;
}
.nav-ic { display: grid; place-items: center; width: 20px; height: 20px; flex-shrink: 0; }
.nav-ic svg { width: 19px; height: 19px; }
.nav-item.active .nav-ic svg { color: var(--rp-red); }
.nav-lbl { flex: 1; }
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--rp-red); color: #fff;
  font-size: 11px; font-weight: 800; display: inline-grid; place-items: center;
  box-shadow: 0 2px 6px rgba(255,0,0,.35); animation: chatpulse 1.8s ease-out infinite;
}
.side-foot {
  margin-top: auto; display: flex; align-items: center; gap: 10px;
  padding-top: 14px; margin-top: auto; border-top: 1px solid var(--line);
}
.side-user-txt { flex: 1; min-width: 0; }
.su-name { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Zone principale + en-tête ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.main-head {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; row-gap: 10px;
  padding: 13px 22px; background: rgba(246,246,249,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-title { flex: 1 1 180px; min-width: 150px; }
.head-title h1 { margin: 0; font-size: 20px; letter-spacing: -.4px; font-weight: 800; line-height: 1.1; }
.head-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.head-actions .select { max-width: 200px; font-size: 13px; font-weight: 600; padding: 9px 30px 9px 12px; }
.hamb { display: none; border: none; background: transparent; color: var(--ink); padding: 6px; border-radius: 9px; }
.hamb:hover { background: var(--line-soft); }
.hamb svg { width: 22px; height: 22px; }

.main-head .search { position: relative; }
.main-head .search input {
  padding: 9px 12px 9px 36px; border: 1.5px solid var(--line); border-radius: 11px; outline: none;
  width: 210px; background: #fff; font-size: 13.5px; transition: border-color .15s, box-shadow .15s;
}
.main-head .search input:focus { border-color: var(--rp-red); box-shadow: 0 0 0 3px rgba(255,0,0,.1); }
.main-head .search .s-ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.main-head .search .s-ic svg { width: 16px; height: 16px; color: var(--muted); }

/* ---- Responsive : sidebar -> tiroir off-canvas ---- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 60; width: 270px; height: 100dvh;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow);
  }
  .app-shell.drawer-open .sidebar { transform: translateX(0); }
  .scrim {
    display: block; position: fixed; inset: 0; background: rgba(17,17,20,.45);
    opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 50;
  }
  .app-shell.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .hamb { display: inline-grid; place-items: center; }
  .main { height: auto; min-height: 100dvh; }
  .main-head .search input { width: 150px; }
}
@media (max-width: 480px) {
  .main-head { padding: 12px 14px; gap: 10px; }
  .head-sub { display: none; }
  .main-head .search input { width: 120px; }
}

/* =====================================================================
   POLICES — Montserrat pour les titres, Open Sauce Sans pour le texte
   ===================================================================== */
.head-title h1, .auth-card h1, .modal-head h3, .col-title, .card .title,
.chat-title, .dash-card h4, .conv-title, .stat .n, .ring-pct,
.ds-bar-title, .ds-name, .section-label, .side-label, .su-name {
  font-family: var(--font-head);
}
.head-title h1 { letter-spacing: -.5px; }

/* =====================================================================
   CARTE DE TÂCHE — refonte (client en exergue, priorité en pastille,
   titre Montserrat, liseré de priorité au survol)
   ===================================================================== */
.card {
  background: #fff; border: 1px solid var(--line); border-left: none; border-radius: 16px;
  padding: 13px 14px 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(17,17,20,.05);
  position: relative; overflow: hidden; cursor: grab;
  transition: transform .12s, box-shadow .14s, border-color .14s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(17,17,20,.10); border-color: #DCDCE4; }
.card:active { cursor: grabbing; }
.card::after {
  content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--pc, #ccc); transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.card:hover::after { transform: scaleX(1); }
.card.pr-basse { --pc: #94A3B8; } .card.pr-normale { --pc: #3B82F6; }
.card.pr-haute { --pc: #E08600; } .card.pr-urgente { --pc: var(--rp-red); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.ctag {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--cc, #888);
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ctag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cc, #888); flex: none; }
.ctag.none { color: var(--muted); }
.ctag.none::before { background: var(--line); }
.pbadge { flex: none; font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 8px; letter-spacing: .2px; }
.p-basse { background: #F1F5F9; color: #64748B; }
.p-normale { background: #EAF1FF; color: #2563EB; }
.p-haute { background: #FFF1E0; color: #C2620A; }
.p-urgente { background: #FDE7E7; color: #D81E2C; }
.card .title { font-weight: 700; font-size: 14.5px; line-height: 1.32; letter-spacing: -.2px; color: var(--ink); margin-bottom: 12px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.who { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.who .mini-avatar { width: 24px; height: 24px; font-size: 10px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(17,17,20,.06); }
.who.none { color: var(--muted); font-weight: 600; }
.who.none svg { width: 14px; height: 14px; }

/* =====================================================================
   MESSAGERIE mise en valeur dans la sidebar
   ===================================================================== */
.nav-item[data-view="chat"] { background: rgba(255,0,0,.05); box-shadow: inset 0 0 0 1px rgba(255,0,0,.14); }
.nav-item[data-view="chat"]:hover { background: rgba(255,0,0,.09); }
.nav-item[data-view="chat"] .nav-ic svg { color: var(--rp-red); }
.nav-item[data-view="chat"].active { background: rgba(255,0,0,.12); box-shadow: inset 0 0 0 1px rgba(255,0,0,.26); }

/* =====================================================================
   AMÉLIORATIONS (juin 2026) — multi-assignés, pièces jointes, déléguées
   ===================================================================== */

/* ---- Avatars empilés (multi-assignés) sur les cartes ---- */
.av-stack { display: inline-flex; align-items: center; }
.mini-avatar.stack { width: 24px; height: 24px; font-size: 10px; box-shadow: 0 0 0 2px #fff; }
.av-stack .mini-avatar.stack + .mini-avatar.stack { margin-left: -8px; }
.mini-avatar.stack.more { background: #ECECF1 !important; color: var(--ink-soft); font-size: 9px; }
.card-meta { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clip-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 800; color: var(--muted); background: var(--line-soft); padding: 3px 8px; border-radius: 999px; }
.clip-badge svg { width: 13px; height: 13px; }
.hint-inline { font-weight: 600; color: var(--muted); font-size: 12px; }

/* ---- Sélecteur de personnes (puces à bascule) ---- */
.asg-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.asg-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.asg-chip:hover:not(:disabled) { border-color: #d3d3dd; }
.asg-chip.on { border-color: var(--rp-red); background: rgba(255,0,0,.06); color: var(--rp-red); box-shadow: inset 0 0 0 1px rgba(255,0,0,.25); }
.asg-chip:disabled { opacity: .55; cursor: default; }
.asg-chip .mini-avatar { width: 22px; height: 22px; font-size: 9px; }

/* ---- Pièces jointes ---- */
.filelist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.file-empty { color: var(--muted); font-size: 12.5px; padding: 4px 2px; }
.fileitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.fileitem.pending { border-style: dashed; background: var(--line-soft); }
.fi-ic { display: inline-grid; place-items: center; color: var(--info); flex: none; }
.fi-ic svg { width: 18px; height: 18px; }
.fi-name { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-size { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.fi-act { display: inline-grid; place-items: center; width: 30px; height: 30px; border: none; background: var(--line-soft); border-radius: 8px; color: var(--ink-soft); cursor: pointer; flex: none; }
.fi-act:hover { background: #e7e7ef; }
.fi-act svg { width: 16px; height: 16px; }
.fi-act.danger { color: var(--late); }
.fi-act.danger:hover { background: #FDECEC; }
.file-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; cursor: pointer; transition: border-color .12s, background .12s; text-align: center; }
.file-drop:hover, .file-drop.over { border-color: var(--rp-red); background: rgba(255,0,0,.04); color: var(--ink-soft); }
.file-drop svg { width: 18px; height: 18px; }
.file-drop b { color: var(--rp-red); }

/* ---- Vue « Tâches déléguées » ---- */
.deleg-wrap { padding-bottom: 30px; }
.dlg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.dlg-group { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.dlg-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px 12px; }
.dlg-av { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.dlg-av.none { background: #ECECF1; color: var(--muted); }
.dlg-av.none svg { width: 18px; height: 18px; }
.dlg-head-txt { flex: 1; min-width: 0; }
.dlg-name { font-family: var(--font-head); font-weight: 800; font-size: 15px; color: var(--ink); }
.dlg-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.dlg-sub .late { color: var(--late); font-weight: 700; }
.dlg-pct { font-family: var(--font-head); font-weight: 800; font-size: 16px; color: var(--ink-soft); }
.dlg-bar { height: 5px; background: var(--line-soft); }
.dlg-bar span { display: block; height: 100%; border-radius: 0 3px 3px 0; transition: width .3s; }
.dlg-tasks { display: flex; flex-direction: column; }
.dlg-task { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 10px 16px; border: none; border-top: 1px solid var(--line-soft); background: #fff; cursor: pointer; font-family: var(--font-body); transition: background .1s; }
.dlg-task:hover { background: var(--line-soft); }
.dlg-title { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-end { display: inline-flex; align-items: center; gap: 7px; flex: none; }
@media (max-width: 560px) { .dlg-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   CENTRE DE NOTIFICATIONS (cloche + liste)
   ===================================================================== */
.bell-btn { position: relative; flex: none; }
.bell-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--rp-red); color: #fff; font-size: 10px; font-weight: 800;
  display: inline-grid; place-items: center; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(255,0,0,.4);
}
.bell-badge.hidden { display: none; }

.notif-wrap { padding-bottom: 30px; }
.notif-list { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.notif-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer;
  font-family: var(--font-body); box-shadow: var(--shadow-sm); transition: border-color .12s, transform .08s, background .12s;
}
.notif-item:hover { border-color: #d6d6de; transform: translateY(-1px); }
.notif-item.unread { background: rgba(255,0,0,.035); border-color: rgba(255,0,0,.22); }
.notif-av { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.notif-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-txt { font-size: 13.5px; color: var(--ink-soft); }
.notif-txt b { color: var(--ink); font-weight: 800; }
.notif-task { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.notif-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rp-red); box-shadow: 0 0 0 3px rgba(255,0,0,.15); }

/* =====================================================================
   ARCHIVAGE — bouton colonne, note dashboard, lignes d'archives
   ===================================================================== */
.col-head-end { display: inline-flex; align-items: center; gap: 6px; }
.col-archive { display: inline-grid; place-items: center; width: 26px; height: 26px; border: none; background: transparent; border-radius: 7px; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.col-archive:hover { background: rgba(255,0,0,.08); color: var(--rp-red); }
.col-archive svg { width: 15px; height: 15px; }

.dash-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); background: var(--line-soft); border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px; margin-bottom: 14px; }
.dash-note svg { width: 15px; height: 15px; stroke: var(--muted); }

.arch-task { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line-soft); }
.arch-task .dlg-task { border-top: none; min-width: 0; }
.arch-restore { flex: none; align-self: center; margin-right: 10px; gap: 5px; }
.arch-restore svg { width: 15px; height: 15px; }

/* =====================================================================
   RAPPELS — toast, bouton rappel (Déléguées), notif de rappel
   ===================================================================== */
#toastHost { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; font-family: var(--font-body); font-weight: 700; font-size: 13.5px; padding: 11px 18px; border-radius: 12px; box-shadow: 0 8px 28px rgba(17,17,20,.28); animation: toastin .28s ease-out; }
.toast.warn { background: var(--warn); }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.dlg-row { display: flex; align-items: center; border-top: 1px solid var(--line-soft); }
.dlg-row .dlg-task { border-top: none; flex: 1; min-width: 0; }
.dlg-remind { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; margin-right: 10px; border: 1px solid var(--line); background: #fff; border-radius: 9px; color: var(--muted); cursor: pointer; transition: border-color .12s, color .12s, background .12s; }
.dlg-remind:hover { border-color: var(--rp-red); color: var(--rp-red); background: rgba(255,0,0,.05); }
.dlg-remind:disabled { opacity: .5; cursor: default; }
.dlg-remind svg { width: 16px; height: 16px; }

.notif-av svg { width: 18px; height: 18px; }
.notif-item.reminder .notif-av { background: var(--rp-red) !important; color: #fff; }

/* Badge "remarque d'avancement" sur les cartes (distinct du trombone) */
.clip-badge.note { background: #EEF1FF; color: var(--info); }
