/* ============================================================================
 * HDKorp — DA lavande (#C9BCF1) + menthe (#B9E2CE) + blanc & noir
 * ==========================================================================*/
:root {
  --lav: #C9BCF1;
  --lav-soft: #EDE8FB;
  --lav-deep: #8B6FD6;
  --mint: #B9E2CE;
  --mint-soft: #E6F4EC;
  --mint-deep: #45A67C;

  --bg: #F4F2FB;         /* fond, légère teinte lavande */
  --surface: #FFFFFF;    /* cartes */
  --surface-2: #F6F4FC;  /* zones secondaires */
  --line: #E7E3F3;
  --line-2: #D8D2EC;

  --ink: #17151F;        /* noir principal */
  --ink-soft: #2A2733;
  --txt: #24212E;
  --muted: #6B6780;
  --muted-2: #9A96AC;

  --accent: #17151F;     /* actions primaires = encre */
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(23,21,31,.04), 0 8px 24px rgba(23,21,31,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(900px 500px at 88% -8%, var(--mint-soft) 0%, transparent 60%),
    radial-gradient(900px 520px at 8% -6%, var(--lav-soft) 0%, transparent 60%),
    var(--bg);
  color: var(--txt);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* -------------------------------- boutons ------------------------------- */
.btn-primary {
  background: var(--accent); color: #fff; border: 0;
  padding: 11px 18px; border-radius: 12px; font-weight: 600;
  transition: filter .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(23,21,31,.18);
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  padding: 10px 16px; border-radius: 12px; font-weight: 600;
}
.btn-ghost:hover { background: var(--lav-soft); border-color: var(--lav); }

/* ------------------------------- connexion ------------------------------ */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; padding: 30px; box-shadow: 0 30px 70px rgba(23,21,31,.12);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand.small { gap: 9px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(140deg, var(--lav), var(--mint)); color: var(--ink);
  font-weight: 800; letter-spacing: .5px; font-size: 17px;
  box-shadow: 0 8px 22px rgba(201,188,241,.5);
}
.brand.small .brand-mark { width: 30px; height: 30px; font-size: 12px; border-radius: 10px; }
.login-card h1 { font-size: 24px; }
.login-card form, #login-google { margin-top: 22px; display: grid; gap: 8px; }
.login-card label { font-size: 12px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin-top: 6px; }
.login-card input {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  padding: 12px 14px; border-radius: 12px; outline: none;
}
.login-card input:focus { border-color: var(--lav-deep); box-shadow: 0 0 0 3px var(--lav-soft); }
.login-card .btn-primary { margin-top: 10px; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: var(--ink); border: 1px solid var(--line-2);
  padding: 12px; border-radius: 12px; font-weight: 600;
}
.btn-google:hover { background: var(--surface-2); }
.badge-demo {
  justify-self: start; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  color: var(--lav-deep); background: var(--lav-soft); border: 1px solid var(--lav);
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.error { color: #b4304e; background: #fdeef1; border: 1px solid #f4c4cf;
  padding: 10px 12px; border-radius: 10px; margin-top: 14px; font-size: 13px; }

/* -------------------------------- topbar -------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px; padding: 12px 20px;
  background: rgba(255,255,255,.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand strong { font-size: 16px; }
.pill {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); background: var(--surface);
}
.pill.live { color: var(--mint-deep); border-color: var(--mint); background: var(--mint-soft); }
.pill.demo { color: var(--lav-deep); border-color: var(--lav); background: var(--lav-soft); }
/* temps réel interrompu : on le dit plutôt que d'afficher « Live » à tort */
.pill.offline { color: #B54708; border-color: #F3D98B; background: #FFF7E6; }
/* cloche : proposée tant que la permission de notifier n'est pas accordée */
.icon-btn.bell { animation: bell-pulse 2.4s ease-in-out 3; }
.icon-btn.bell.off { opacity: .5; animation: none; }
@keyframes bell-pulse { 0%, 100% { transform: none } 8% { transform: rotate(-12deg) } 16% { transform: rotate(12deg) } 24% { transform: none } }
.tabs { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.tabs button {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 0; color: var(--muted); padding: 8px 14px;
  border-radius: 10px; font-weight: 600;
}
.tabs .ti { font-size: 15px; line-height: 1; }
.tabs button:hover { color: var(--ink); background: var(--lav-soft); }
.tabs button.active { color: var(--ink); background: var(--lav); }
.tab-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  margin-left: 6px; padding: 0 5px; border-radius: 999px; vertical-align: middle;
  background: var(--lav-deep); color: #fff; font-size: 11px; font-weight: 800; line-height: 1;
}
.tab-badge.ping { background: #E5484D; }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* --------------------------------- vues --------------------------------- */
.view { max-width: 1180px; margin: 0 auto; padding: 22px 20px 80px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}

/* ------------------------------- stats --------------------------------- */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px;
}
.stat-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow);
}
.stat-emoji { font-size: 30px; line-height: 1; }
.stat-body { display: flex; flex-direction: column; }
.stat-num { font-size: 30px; font-weight: 800; line-height: 1.05; color: var(--ink); }
.stat-num.mint { color: var(--mint-deep); }
.stat-num.warn { color: #E5484D; }
.stat-label {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2);
  margin-top: 3px;
}
.stat-donut {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: conic-gradient(var(--mint-deep) calc(var(--pct) * 1%), var(--line-2) 0);
  display: grid; place-items: center;
}
.stat-donut::before {
  content: ""; grid-area: 1/1; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface);
}
.stat-donut span { grid-area: 1/1; font-size: 11px; font-weight: 800; color: var(--ink); }
@media (max-width: 720px) {
  .stats-row { grid-template-columns: 1fr; }
}

/* --------------------------- calendrier board -------------------------- */
.cal-embed {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: #fff;
}
.cal-embed iframe { display: block; width: 100%; height: 620px; border: 0; }
#driveOpen { margin-left: auto; }

/* photo de profil (avatar image) */
.avatar-img { background-size: cover; background-position: center; color: transparent; }
.avatar.big { width: 72px; height: 72px; font-size: 26px; }

/* ------------------------------- profil -------------------------------- */
.profile-top { display: flex; align-items: center; gap: 16px; margin: 6px 0 8px; }
.profile-avatar .avatar { border: 2px solid var(--line-2); }
.profile-pic-actions { display: flex; flex-direction: column; gap: 8px; }
.profile-pic-actions .btn-ghost, .pic-label { padding: 7px 12px; font-size: 13px; text-align: center; cursor: pointer; display: inline-block; }
.profile-teams { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }

/* ------------------------------ membres -------------------------------- */
.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-top: 8px; background: var(--surface);
}
.team-badge {
  font-size: 12px; font-weight: 600; color: var(--lav-deep);
  background: var(--lav-soft); border: 1px solid var(--lav);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}

/* multi-sélection (intervenants / équipes) dans la modale */
.multi-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.pick-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  padding: 6px 11px 6px 7px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.pick-chip:hover { border-color: var(--lav); }
.pick-chip.active { background: var(--lav-soft); border-color: var(--lav-deep); color: var(--lav-deep); }
.pick-chip .avatar { width: 22px; height: 22px; font-size: 10px; }

/* pile d'avatars (plusieurs intervenants sur une tâche) */
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar:not(:first-child) { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }

/* ligne de détails d'une tâche */
.task-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 6px; }
.meta-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.meta-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.meta-chip.prio { font-weight: 600; }
.meta-chip.late { color: #E5484D; font-weight: 700; }
/* « ＋ Agenda » : crée l'événement Google depuis l'échéance */
a.meta-chip.cal-add {
  text-decoration: none; color: var(--lav-deep); font-weight: 600;
  border: 1px solid var(--lav); background: var(--lav-soft);
  border-radius: 999px; padding: 2px 9px; line-height: 1.5;
}
a.meta-chip.cal-add:hover { background: var(--lav); color: var(--ink); }
.member-main { display: flex; flex-direction: column; line-height: 1.25; }
.member-pseudo { font-weight: 700; font-size: 14px; color: var(--ink); }
.member-email { font-size: 13px; color: var(--muted); }
#view-membres .add-person { margin-top: 10px; }

/* -------------------------------- chat --------------------------------- */
.chat-layout { display: flex; gap: 16px; align-items: stretch; }
.chat-channels {
  flex: none; width: 210px; display: flex; flex-direction: column; gap: 6px;
  border-right: 1px solid var(--line); padding-right: 14px;
}
.chat-channels .btn-ghost { margin-top: 6px; font-size: 13px; padding: 8px 10px; }
.channel {
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--txt);
}
.channel:hover { background: var(--surface-2); }
.channel.active { background: var(--lav-soft); color: var(--lav-deep); font-weight: 700; }
.channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-x, .channel-cog { color: var(--muted-2); font-size: 15px; line-height: 1; opacity: 0; padding: 0 2px; cursor: pointer; }
.channel:hover .channel-x, .channel:hover .channel-cog { opacity: 1; }
.channel-x:hover { color: #E5484D; }
.channel-cog:hover { color: var(--lav-deep); }
@media (hover: none) { .channel-x, .channel-cog { opacity: .5; } }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-main .chat-messages { flex: 1; }
@media (max-width: 640px) {
  .chat-layout { flex-direction: column; }
  .chat-channels { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; }
}
.chat-messages {
  min-height: 320px; max-height: 60vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding: 6px 2px; margin: 6px 0 14px;
}
.chat-msg { display: flex; align-items: flex-start; gap: 10px; }
.chat-msg .avatar { flex: none; margin-top: 2px; }
.chat-bubble {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px; padding: 8px 12px; max-width: 72%;
}
.chat-msg.mine { flex-direction: row-reverse; }
.chat-msg.mine .chat-bubble {
  background: var(--lav-soft); border-color: var(--lav);
  border-radius: 14px 4px 14px 14px;
}
.chat-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-author { font-weight: 700; font-size: 13px; color: var(--ink); }
.chat-time { font-size: 11px; color: var(--muted-2); }
.chat-body { font-size: 14.5px; color: var(--txt); white-space: pre-wrap; word-break: break-word; }
.chat-link { color: var(--lav-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.chat-link:hover { color: var(--ink); }

/* actions au survol d'un message (répondre / supprimer) */
.chat-actions { align-self: center; display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.chat-msg:hover .chat-actions, .chat-actions:focus-within { opacity: 1; }
.chat-reply:hover { color: var(--lav-deep); }
.chat-del:hover { color: #E5484D; }
@media (hover: none) { .chat-actions { opacity: .55; } }

.chat-msg.mentioned .chat-bubble { background: #FFF7E6; border-color: #F3D98B; }
.chat-msg.flash .chat-bubble { animation: flash 1.4s ease-out; }
@keyframes flash {
  0%, 40% { box-shadow: 0 0 0 3px var(--lav); }
  100% { box-shadow: 0 0 0 3px transparent; }
}

/* citation du message auquel on répond */
.reply-quote {
  display: flex; flex-direction: column; gap: 1px; cursor: pointer;
  border-left: 3px solid var(--lav-deep); padding: 3px 0 3px 8px;
  margin: 2px 0 6px; max-width: 100%;
}
.reply-quote:hover { border-left-color: var(--ink); }
.reply-quote.missing { border-left-color: var(--line-2); cursor: default; font-style: italic; }
.reply-quote-author { font-size: 11.5px; font-weight: 700; color: var(--lav-deep); }
.reply-quote-body {
  font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mention {
  background: var(--lav-soft); color: var(--lav-deep); font-weight: 700;
  border-radius: 5px; padding: 0 3px;
}
.mention.me { background: #FDE9A8; color: #7a5b00; }
.avatar.mini { width: 22px; height: 22px; font-size: 10px; }

.chat-att-img { display: inline-block; margin-top: 6px; }
.chat-att-img img { max-width: 240px; max-height: 200px; border-radius: 10px; display: block; }
.chat-att-file {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 8px 12px; text-decoration: none; color: var(--txt); font-weight: 600; font-size: 13px;
}
.chat-att-file:hover { border-color: var(--lav); }
.chat-att-file .att-ico { font-size: 18px; }
.chat-msg.mine .chat-att-file { background: var(--surface); }

.chat-attach {
  flex: none; width: 42px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 12px; font-size: 18px; cursor: pointer;
}
.chat-attach:hover { background: var(--lav-soft); border-color: var(--lav); }
.chat-attach:disabled { opacity: .6; cursor: default; }

.chat-form { display: flex; gap: 10px; position: relative; }
.mention-box {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 240px; max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(23,21,31,.16); padding: 6px;
}
.mention-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--txt);
}
.mention-item.active, .mention-item:hover { background: var(--lav-soft); color: var(--lav-deep); }
.chat-form input {
  flex: 1; background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  padding: 12px 14px; border-radius: 12px; outline: none;
}
.chat-form input:focus { border-color: var(--lav-deep); box-shadow: 0 0 0 3px var(--lav-soft); }

/* bandeau « Réponse à … » au-dessus du champ (absolu : ne casse pas le flex) */
.reply-bar {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  background: var(--lav-soft); border: 1px solid var(--lav);
  border-radius: 12px; padding: 8px 10px;
}
.reply-ico { font-size: 15px; color: var(--lav-deep); flex: none; }
.reply-info { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.reply-to { font-size: 12px; color: var(--lav-deep); }
.reply-prev { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-note { margin: 10px 2px 0; }
@media (max-width: 720px) {
  .cal-embed iframe { height: 460px; }
}

/* filtres */
.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-row + .filter-row { margin-top: 12px; }
.filter-label { font-size: 11px; letter-spacing: .1em; color: var(--muted-2); min-width: 90px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.chip:hover { border-color: var(--lav); background: var(--lav-soft); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; background: var(--surface-2); }
.clear { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 13px; }
.clear:hover { color: var(--lav-deep); text-decoration: underline; }

/* avatar */
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: var(--ink); flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(23,21,31,.06);
}
.avatar.lg { width: 34px; height: 34px; font-size: 12px; }

.board-actions { margin: 4px 2px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.board-actions .btn-primary { margin-left: auto; }

/* sous-onglets « En cours » / « Terminées » */
.subtabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.subtabs button {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  color: var(--muted); background: transparent; border: 0;
}
.subtabs button:hover { color: var(--ink); }
.subtabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.sub-count {
  min-width: 20px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 800;
  background: var(--line-2); color: var(--muted);
}
.subtabs button.active .sub-count { background: var(--lav-soft); color: var(--lav-deep); }

/* groupes de catégories */
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow); }
.group-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; }
.group-head .cat-dot { width: 12px; height: 12px; border-radius: 4px; }
.group-head h3 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.group-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.group-body { border-top: 1px solid var(--line); }
.group.collapsed .group-body { display: none; }

/* tâche */
.task { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.task + .task { border-top: 1px solid var(--line); }
.task:hover { background: var(--surface-2); }
.task .check {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2);
  background: var(--surface); flex: 0 0 auto;
}
.task.done .check { background: var(--mint-deep); border-color: var(--mint-deep); }
.task .prio-bar { width: 4px; align-self: stretch; border-radius: 3px; min-height: 34px; }
.task .task-main { display: flex; flex-direction: column; min-width: 0; }
.task .t-title { font-weight: 600; color: var(--ink); }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-sub { font-size: 12.5px; color: var(--muted); }
.task .spacer { margin-left: auto; }
.task .task-right { display: flex; align-items: center; gap: 12px; }
.status-pill {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line-2);
}
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted); display: grid; place-items: center;
}
.icon-btn:hover { background: var(--lav-soft); color: var(--ink); }
.empty-group { padding: 16px 18px; color: var(--muted-2); font-size: 13px; }

/* équipes */
.teams h3 { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.teams h4 { color: var(--muted); font-size: 13px; margin-bottom: 8px; font-weight: 600; }
.people-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.person-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 8px 5px 5px;
}
.person-tag .x { color: var(--muted-2); border: 0; background: transparent; padding: 0 3px; font-size: 15px; }
.person-tag .x:hover { color: #b4304e; }
.add-person { display: flex; gap: 8px; }
.add-person input {
  flex: 1; background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  padding: 11px 14px; border-radius: 11px; outline: none;
}
.add-person input:focus { border-color: var(--lav-deep); box-shadow: 0 0 0 3px var(--lav-soft); }
.teams-block { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.team-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.team-item .team-name { font-weight: 700; }
.team-item .team-people { display: flex; gap: 6px; flex-wrap: wrap; }
.team-item select { margin-left: auto; }

/* selects */
select {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  padding: 9px 12px; border-radius: 11px; outline: none;
}
select:focus { border-color: var(--lav-deep); box-shadow: 0 0 0 3px var(--lav-soft); }

/* listes agenda / drive */
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.list-loading { color: var(--muted); }
.g-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); }
.g-item:first-child { border-top: 0; }
.g-item .g-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--lav-soft); display: grid; place-items: center; font-size: 16px; }
.g-item .g-main { display: flex; flex-direction: column; min-width: 0; }
.g-item .g-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.g-item .g-when { font-size: 12.5px; color: var(--muted); }
.g-item .g-act { margin-left: auto; display: flex; gap: 8px; }
.link-btn { color: var(--lav-deep); text-decoration: none; font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.notice {
  background: var(--mint-soft); border: 1px solid var(--mint);
  color: var(--mint-deep); padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 13px;
}

/* intégrations */
.editor-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.editor-tabs button {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  padding: 10px 16px; border-radius: 11px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.editor-tabs button.active { border-color: var(--lav-deep); background: var(--lav-soft); }
.editor-tabs .editor-refresh { margin-left: auto; font-size: 16px; padding: 10px 14px; color: var(--muted); }
.editor-tabs .editor-refresh:hover { color: var(--lav-deep); border-color: var(--lav); }
.editor-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.editor-frame iframe { width: 100%; height: 74vh; border: 0; display: block; background: #fff; }
.editor-open { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); gap: 12px; flex-wrap: wrap; }

/* --------------------------------- modale ------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(23,21,31,.35); backdrop-filter: blur(4px); padding: 20px;
}
.modal {
  width: min(680px, 100%); max-height: 92vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px 28px;
  box-shadow: 0 40px 90px rgba(23,21,31,.22); display: grid; gap: 8px;
}
.modal h2 { font-size: 22px; margin-bottom: 8px; }
.modal label { font-size: 11px; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; margin-top: 8px; }
.modal label.req::after { content: " *"; color: var(--lav-deep); }
.modal input, .modal select { width: 100%;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--txt);
  padding: 12px 14px; border-radius: 11px; outline: none; }
.modal input:focus, .modal select:focus { border-color: var(--lav-deep); box-shadow: 0 0 0 3px var(--lav-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* case à cocher « discussion privée » : une phrase, pas un libellé de champ */
.modal label.switch-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--txt); margin-top: 14px;
}
.modal .switch-row input[type="checkbox"] { width: 18px; height: 18px; flex: none; accent-color: var(--lav-deep); padding: 0; }
.modal .switch-row input[type="checkbox"]:focus { box-shadow: none; }
/* participant non retirable (soi-même) */
.pick-chip.locked { opacity: .75; cursor: default; }

/* ------------------------- bandeau d'installation ----------------------- */
.install-bar {
  display: flex; align-items: center; gap: 12px;
  max-width: 1180px; margin: 14px auto 0; padding: 12px 16px;
  background: var(--lav-soft); border: 1px solid var(--lav); border-radius: 14px;
  font-size: 14px; color: var(--ink);
}
.install-bar span { flex: 1; }
.install-bar .btn-primary { padding: 8px 14px; box-shadow: none; }

/* ============================================================================
 * MOBILE — l'app est installable (PWA) : navigation en bas, comme une app.
 * ==========================================================================*/
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .filter-label { min-width: 100%; }
}

@media (max-width: 820px) {
  /* backdrop-filter crée un bloc conteneur : on le retire pour que la barre
   * d'onglets en position:fixed se cale bien sur le bas de l'écran. */
  .topbar {
    backdrop-filter: none; background: rgba(255, 255, 255, .96);
    gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  }
  .topbar .brand strong { font-size: 15px; }
  .user .small { display: none; }

  /* Barre d'onglets en bas de l'écran */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    margin: 0; gap: 0; flex-wrap: nowrap;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(23, 21, 31, .08);
  }
  .tabs button {
    flex: 1 1 0; min-width: 0; position: relative;
    flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; font-size: 10px; letter-spacing: .01em;
  }
  .tabs button.active { background: transparent; color: var(--lav-deep); }
  .tabs button:hover { background: transparent; }
  .tabs .ti { font-size: 19px; }
  .tabs .tl { overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
  .tab-badge { position: absolute; top: 2px; right: 22%; margin: 0; }

  /* On laisse la place à la barre du bas */
  .view { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .install-bar { margin: 12px 14px 0; }

  .card { padding: 15px 14px; border-radius: 14px; }
  .stats-row { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }

  /* Tâches : titre + détails sur une ligne, actions dessous */
  .task { flex-wrap: wrap; gap: 10px; padding: 13px 14px; }
  .task .task-main { flex: 1 1 60%; }
  .task .task-right { width: 100%; justify-content: flex-end; }
  .task .spacer { display: none; }
  .status-pill { font-size: 11px; padding: 5px 9px; }

  .filter-row { gap: 8px; }
  .clear { margin-left: 0; }
  .board-actions .btn-primary { width: 100%; margin-left: 0; }
  .subtabs { width: 100%; }
  .subtabs button { flex: 1; justify-content: center; padding: 9px 8px; }
  .add-person { flex-direction: column; align-items: stretch; }
  .team-item select { margin-left: 0; width: 100%; }

  /* Iframes Google / éditeurs : hauteur utile sur téléphone */
  .cal-embed iframe { height: 70vh; }
  .editor-frame iframe { height: 68vh; }

  /* Chat plein écran */
  .chat-messages { max-height: none; min-height: 46vh; }
  .chat-bubble { max-width: 88%; }
  .chat-att-img img { max-width: 100%; }
  .chat-form { position: sticky; bottom: 0; background: var(--surface); padding-top: 6px; }
  .mention-box { left: 0; right: 0; min-width: 0; }
  .chat-actions { flex-direction: column; }

  .member-row { flex-wrap: wrap; }

  /* Modales : feuille plein écran, actions toujours atteignables */
  .modal-backdrop { padding: 0; place-items: end stretch; }
  .modal {
    width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  }
  .modal-actions {
    position: sticky; bottom: -1px; z-index: 1; margin-top: 12px;
    background: var(--surface); padding: 12px 0 6px;
    box-shadow: 0 -10px 14px 6px var(--surface);
  }
  .modal-actions button { flex: 1; }

  /* iOS zoome sur les champs < 16px : on force 16px */
  input, select, textarea, .modal input, .modal select,
  .chat-form input, .add-person input, .login-card input { font-size: 16px; }
}

/* En app installée, la barre du bas est plus proche du bord de l'écran */
@media (display-mode: standalone) {
  .install-bar { display: none; }
}
