/* Nadwa : bleu nuit pour la navigation, cobalt pour l'action, soleil pour ce qui est en cours. */
:root {
  --nuit: #111A33;
  --nuit-texte: #A9B3CC;
  --fond: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #F0F2F7;
  --encre: #101828;
  --encre-2: #5B6478;
  --encre-3: #3B4357;
  --ligne: #E6E8EF;
  --ligne-2: #D6DAE5;
  --accent: #2F5BEA;
  --accent-fonce: #1E40B8;
  --accent-pale: #E8EEFE;
  --sur-accent: #FFFFFF;
  --soleil: #F2A93B;
  --soleil-pale: #FEF3DD;
  --soleil-encre: #6B4E16;
  --sur-soleil: #2A1A00;
  --succes: #1F9D6B;
  --danger: #D92D20;
  --maintenant: #E5484D;
  --ombre: 0 1px 2px rgba(16, 24, 40, .06);
  --ombre-haute: 0 12px 32px rgba(16, 24, 40, .16);
  --r-petit: 8px;
  --r: 10px;
  --r-moyen: 14px;
  --r-grand: 18px;
  --police: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --police-ar: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --nuit: #0A0F1F;
    --fond: #0E1424;
    --surface: #161E33;
    --surface-2: #1E2740;
    --encre: #E8ECF5;
    --encre-2: #9AA5BD;
    --encre-3: #C4CBDA;
    --ligne: #26304A;
    --ligne-2: #33405F;
    --accent: #6D8BFF;
    --accent-fonce: #9DB1FF;
    --accent-pale: #22305C;
    --sur-accent: #0A1230;
    --soleil-pale: #3A2E12;
    --soleil-encre: #F2C46D;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3);
    --ombre-haute: 0 12px 32px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--police); font-size: 14px; line-height: 1.5; color: var(--encre); background: var(--fond); -webkit-font-smoothing: antialiased; }
:lang(ar) body, [lang="ar"] body, html[lang="ar"] body { font-family: var(--police-ar); font-size: 15px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.marque-ar { font-family: var(--police-ar); font-weight: 700; color: var(--soleil); }
.marque-sombre { color: var(--nuit); font-size: 22px; }
@media (prefers-color-scheme: dark) { .marque-sombre { color: var(--soleil); } }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r); border: 0;
  font-weight: 700; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, filter .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-accent { background: var(--accent); color: var(--sur-accent); }
.btn-accent:hover { background: var(--accent-fonce); }
.btn-soleil { background: var(--soleil); color: var(--sur-soleil); font-weight: 800; }
.btn-soleil:hover { filter: brightness(.96); }
.btn-contour { background: var(--surface); color: var(--encre); border: 1.5px solid var(--ligne-2); }
.btn-contour:hover { background: var(--surface-2); }
.btn-grand { height: 50px; font-size: 16px; border-radius: 12px; }
.btn-plein { width: 100%; }
.btn-lien { background: none; border: 0; padding: 4px; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-lien:hover { text-decoration: underline; }
.btn-discret { background: none; border: 0; padding: 4px 6px; color: var(--encre-2); font-weight: 600; font-size: 13px; cursor: pointer; border-radius: 6px; }
.btn-discret:hover { color: var(--danger); background: var(--surface-2); }
.btn-icone {
  width: 38px; height: 38px; border-radius: var(--r); border: 0; background: var(--surface-2);
  color: var(--encre); display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
.btn-icone:hover { background: var(--ligne); }
.btn-icone.contour { background: var(--surface); border: 1.5px solid var(--ligne-2); width: 42px; height: 42px; }

label { display: grid; gap: 6px; font-weight: 600; min-width: 0; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; min-width: 0; height: 44px; padding: 0 12px; border-radius: var(--r);
  border: 1.5px solid var(--ligne-2); background: var(--surface); font-weight: 500;
}
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.champ-code { font-size: 20px; letter-spacing: .15em; text-transform: uppercase; font-weight: 700; }
.erreur { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.erreur:empty { display: none; }
.note { margin: 0; font-size: 13px; color: var(--encre-2); }
label.case { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
label.case input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.choix-langue { width: auto !important; height: 36px !important; padding: 0 10px !important; border-radius: 9px; font-weight: 600; }

/* ---------- Avatars ---------- */
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #FFFFFF; background: hsl(var(--teinte, 225) 58% 46%);
  position: relative;
}
.avatar.carre { border-radius: 10px; }
.avatar.grand { width: 42px; height: 42px; font-size: 13px; }
.avatar.petit { width: 28px; height: 28px; font-size: 10px; }
.avatar .presence { position: absolute; inset-inline-end: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--succes); border: 2px solid var(--surface); }
.pile-avatars { display: flex; }
.pile-avatars .avatar { border: 2px solid var(--surface); }
.pile-avatars .avatar + .avatar { margin-inline-start: -9px; }

/* ---------- Connexion ---------- */
.auth { min-height: 100%; display: flex; flex-wrap: wrap; background: var(--surface); }
.auth-marque {
  flex: 1 1 520px; background: var(--nuit); color: #FFFFFF; padding: clamp(28px, 5vw, 56px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.marque { display: flex; align-items: baseline; gap: 10px; }
.marque .marque-ar { font-size: 28px; }
.marque-lat { font-weight: 800; font-size: 20px; }
.auth-accroche { max-width: 470px; }
.auth-accroche h1 { font-size: clamp(32px, 4vw, 46px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.auth-accroche p { margin: 18px 0 0; font-size: 17px; line-height: 1.6; color: #C3CBE0; }
.auth-puces { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-puces span { padding: 8px 14px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-weight: 600; font-size: 13px; }
.auth-panneau { flex: 1 1 440px; display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 56px) 40px; }
.auth-haut { display: flex; justify-content: flex-end; }
.langue-libelle { display: flex; align-items: center; gap: 8px; color: var(--encre-2); }
.auth-formulaire { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; max-width: 380px; width: 100%; margin: 24px auto 0; }
.auth-formulaire h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.auth-sous-titre { margin: 6px 0 0; color: var(--encre-2); }
#form-auth { display: grid; gap: 16px; }
#form-auth input { height: 48px; border-radius: 12px; }
.auth-bascule { margin: 0; text-align: center; color: var(--encre-2); }
.separateur { display: flex; align-items: center; gap: 12px; color: var(--encre-2); font-size: 13px; }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--ligne); }

/* ---------- Structure de l'application ---------- */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 82px minmax(0, 1fr); }
.rail { background: var(--nuit); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0; z-index: 2; }
.rail-logo { font-family: var(--police-ar); font-weight: 700; font-size: 22px; color: var(--soleil); margin-bottom: 12px; }
.rail-btn {
  position: relative; width: 74px; height: 58px; border-radius: 12px; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--nuit-texte); font-size: 11px; font-weight: 600;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn:hover { color: #FFFFFF; background: rgba(255, 255, 255, .06); }
.rail-btn[aria-current="page"] { color: #FFFFFF; background: rgba(255, 255, 255, .12); font-weight: 700; }
.rail-badge { position: absolute; top: 6px; inset-inline-end: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--maintenant); color: #FFFFFF; font-size: 10px; display: grid; place-items: center; }
.rail-espace { flex: 1; }
.rail-moi {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--soleil); cursor: pointer;
  background: hsl(var(--teinte, 225) 58% 46%); color: #FFFFFF; font-weight: 700; font-size: 13px;
}
.vue { min-width: 0; min-height: 0; }
.vue-deux { display: grid; grid-template-columns: 310px minmax(0, 1fr); height: 100%; }

/* Volet de liste (équipes, conversations) */
.volet { background: var(--surface); border-inline-end: 1px solid var(--ligne); display: flex; flex-direction: column; min-height: 0; }
.volet-haut { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 18px 12px; }
.volet-haut h1 { font-size: 20px; font-weight: 800; }
.volet-titre { min-width: 0; }
.choix-org { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; border: 0; background: none; padding: 0; color: var(--encre-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.choix-org span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-org svg { width: 14px; height: 14px; }
.recherche { display: flex; align-items: center; gap: 8px; height: 40px; margin: 0 18px 12px; padding: 0 12px; border-radius: var(--r); background: var(--surface-2); color: var(--encre-2); font-weight: 500; }
.recherche svg { width: 16px; height: 16px; }
.recherche input { height: auto !important; border: 0 !important; background: transparent !important; padding: 0 !important; color: var(--encre); }
.liste { flex: 1; list-style: none; margin: 0; padding: 2px 10px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.liste-vide { padding: 16px 8px; color: var(--encre-2); font-size: 13px; }
.volet-bas { padding: 14px 18px; border-top: 1px solid var(--ligne); }

.item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px;
  border: 0; background: none; color: var(--encre); text-align: start; cursor: pointer;
}
.item:hover { background: var(--surface-2); }
.item[aria-current="true"] { background: var(--accent-pale); }
.item-texte { flex: 1; min-width: 0; display: grid; }
.item-ligne { display: flex; justify-content: space-between; gap: 8px; }
.item-texte strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: match-parent; }
.item-texte small { font-size: 13px; color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: match-parent; }
.item-texte .heure { font-size: 12px; color: var(--encre-2); flex: none; }
.item.non-lu small { color: var(--encre); font-weight: 600; }
.compteur { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--sur-accent); font-size: 11px; font-weight: 800; display: grid; place-items: center; flex: none; }
.point-en-cours { width: 10px; height: 10px; border-radius: 50%; background: var(--soleil); box-shadow: 0 0 0 3px var(--soleil-pale); flex: none; }

.canaux { list-style: none; margin: 0 0 6px; padding: 0; padding-inline-start: 52px; display: grid; gap: 2px; }
.canal {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 0;
  background: none; color: var(--encre-3); text-align: start; cursor: pointer;
}
.canal:hover { background: var(--surface-2); }
.canal[aria-current="true"] { background: var(--accent-pale); color: var(--encre); font-weight: 700; }
.canal-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: match-parent; }
.canal-tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--soleil-pale); color: var(--soleil-encre); flex: none; }
.non-lu-point { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.canal-ajout { color: var(--accent); font-weight: 700; }

/* Zone de détail */
.detail { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.detail-haut { background: var(--surface); border-bottom: 1px solid var(--ligne); padding: 14px 28px 0; }
.detail-haut.sans-onglets { padding-bottom: 14px; }
.detail-ligne { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-titre { flex: 1; min-width: 0; }
.detail-titre h1 { font-size: 18px; font-weight: 800; unicode-bidi: plaintext; text-align: match-parent; }
.detail-titre p { margin: 0; font-size: 13px; color: var(--encre-2); unicode-bidi: plaintext; text-align: match-parent; }
.detail-titre .en-ligne { color: var(--succes); font-weight: 600; }
.retour { display: none; }
.onglets { display: flex; gap: 26px; margin-top: 10px; }
.onglets button { border: 0; background: none; padding: 10px 0; border-bottom: 3px solid transparent; color: var(--encre-2); font-weight: 600; cursor: pointer; }
.onglets button[aria-selected="true"] { color: var(--encre); font-weight: 700; border-bottom-color: var(--accent); }
.fil { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px; display: flex; flex-direction: column; gap: 14px; }
.fil-vide { margin: auto; text-align: center; color: var(--encre-2); max-width: 44ch; }
.fil-vide strong { display: block; color: var(--encre); font-size: 16px; margin-bottom: 4px; }
.chargement { margin: auto; color: var(--encre-2); }
.compose { padding: 0 28px 22px; }
.compose form {
  display: flex; align-items: flex-end; gap: 10px; min-height: 52px; padding: 6px 8px 6px 16px; padding-inline: 16px 8px;
  border-radius: var(--r-moyen); background: var(--surface); border: 1.5px solid var(--ligne-2);
}
.compose form:focus-within { border-color: var(--accent); }
.compose textarea { flex: 1; border: 0 !important; padding: 9px 0 !important; resize: none; max-height: 160px; background: transparent !important; }
.compose .btn-envoyer { width: 38px; height: 38px; border-radius: var(--r); border: 0; background: var(--accent); color: var(--sur-accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.lecture-seule { margin: 0 28px 22px; padding: 14px; border-radius: var(--r-moyen); background: var(--surface-2); color: var(--encre-2); text-align: center; font-size: 13px; }

/* Bandeau « réunion en cours » */
.en-cours {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-moyen);
  background: var(--soleil-pale);
}
.en-cours-icone { width: 40px; height: 40px; border-radius: 50%; background: var(--soleil); color: var(--sur-soleil); display: grid; place-items: center; flex: none; }
.en-cours-texte { flex: 1; min-width: 0; }
.en-cours-texte strong { display: block; font-weight: 800; unicode-bidi: plaintext; text-align: match-parent; }
.en-cours-texte span { font-size: 13px; color: var(--soleil-encre); }

/* Publications (cartes) */
.publication { background: var(--surface); border-radius: var(--r-moyen); padding: 16px 18px; box-shadow: var(--ombre); display: flex; gap: 12px; }
.publication-corps { flex: 1; min-width: 0; }
.publication-tete { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.publication-tete time { font-size: 12px; color: var(--encre-2); }
.publication p { margin: 6px 0 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: match-parent; }
.badge { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--accent-pale); color: var(--accent-fonce); }
.carte-reunion { align-items: center; }
.carte-reunion .icone-cal { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-pale); color: var(--accent); display: grid; place-items: center; flex: none; }
.carte-reunion small { display: block; font-size: 12px; font-weight: 700; color: var(--encre-2); }
.carte-reunion strong { display: block; font-weight: 800; unicode-bidi: plaintext; text-align: match-parent; }
.carte-reunion span { font-size: 13px; color: var(--encre-3); }

/* Messages directs (bulles) */
.jour { align-self: center; font-size: 12px; font-weight: 700; color: var(--encre-2); background: var(--surface-2); padding: 4px 12px; border-radius: 99px; }
.bulle-ligne { display: flex; gap: 10px; max-width: 72%; }
.bulle-ligne.moi { align-self: flex-end; flex-direction: row-reverse; }
.bulle { background: var(--surface); padding: 10px 14px; border-radius: 16px; border-start-start-radius: 4px; box-shadow: var(--ombre); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: match-parent; }
.bulle-ligne.moi .bulle { background: var(--accent); color: var(--sur-accent); border-radius: 16px; border-start-end-radius: 4px; }
.bulle-meta { font-size: 11px; color: var(--encre-2); margin-top: 4px; }
.bulle-ligne.moi .bulle-meta { text-align: end; }
.carte-appel { align-self: center; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-moyen); background: var(--surface); border: 1px solid var(--ligne); }
.carte-appel .icone { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-pale); color: var(--accent); display: grid; place-items: center; }

/* Membres */
.panneau { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px; }
.invitation { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; padding: 16px 18px; border-radius: var(--r-moyen); background: var(--surface); box-shadow: var(--ombre); max-width: 860px; margin-bottom: 22px; }
.invitation p { flex: 1; min-width: 220px; margin: 0; color: var(--encre-2); font-size: 13px; }
.invitation-libelle { display: block; font-size: 12px; font-weight: 700; color: var(--encre-2); }
.code { font-size: 26px; font-weight: 800; letter-spacing: .14em; color: var(--accent); direction: ltr; unicode-bidi: isolate; }
.sous-titre { margin: 22px 0 8px; font-size: 13px; font-weight: 700; color: var(--encre-2); }
.membres { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-width: 860px; }
.membre { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; }
.membre:hover { background: var(--surface); }
.membre > div { flex: 1; min-width: 0; display: grid; }
.membre small { color: var(--encre-2); font-size: 13px; }

/* ---------- Menus ---------- */
.menu {
  position: fixed; z-index: 20; min-width: 240px; max-width: calc(100vw - 24px); padding: 6px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r-moyen); box-shadow: var(--ombre-haute);
}
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 9px; background: none; color: var(--encre); font-weight: 600; text-align: start; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu svg { width: 18px; height: 18px; color: var(--encre-2); }
.menu hr { border: 0; border-top: 1px solid var(--ligne); margin: 6px 4px; }
.menu-tete { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px; }
.menu-tete div { min-width: 0; }
.menu-tete strong { display: block; }
.menu-tete small { color: var(--encre-2); font-size: 12px; }
.menu-section { padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--encre-2); }
.menu .actif { background: var(--accent-pale); }
.menu-langue { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; font-weight: 600; }

/* ---------- Calendrier ---------- */
.vue-cal { display: flex; flex-direction: column; min-height: 0; }
.calendrier { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cal-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--ligne); }
.cal-barre h1 { font-size: 20px; font-weight: 800; margin-inline-end: 8px; }
.cal-periode { font-weight: 700; font-size: 16px; }
.cal-fleche { width: 38px; height: 38px; border: 0; border-radius: var(--r); background: none; color: var(--encre-3); display: grid; place-items: center; cursor: pointer; }
.cal-fleche:hover { background: var(--surface-2); }
[dir="rtl"] .cal-fleche svg { transform: scaleX(-1); }
.cal-espace { flex: 1; }
.cal-vues { display: flex; padding: 3px; border-radius: var(--r); background: var(--surface-2); }
.cal-vues button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--encre-2); cursor: pointer; }
.cal-vues button[aria-pressed="true"] { background: var(--surface); color: var(--encre); box-shadow: var(--ombre); }
.cal-corps { flex: 1; min-height: 0; padding: 18px 28px 24px; display: flex; flex-direction: column; }
.cal-carte { flex: 1; min-height: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--ombre); overflow: hidden; display: flex; flex-direction: column; }
.cal-semaine { --h: 56px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cal-entetes, .cal-grille-heures { display: grid; grid-template-columns: 64px repeat(var(--jours, 7), minmax(0, 1fr)); }
.cal-entetes { border-bottom: 1px solid var(--ligne); }
.cal-jour-entete { padding: 10px 14px; border: 0; background: none; text-align: start; cursor: pointer; color: var(--encre); }
.cal-jour-entete span { display: block; font-size: 12px; color: var(--encre-2); font-weight: 600; }
.cal-jour-entete strong { display: grid; place-items: center; width: 36px; height: 36px; margin-inline-start: -6px; border-radius: 50%; font-size: 20px; font-weight: 800; }
.cal-jour-entete.aujourdhui span { color: var(--accent); font-weight: 700; }
.cal-jour-entete.aujourdhui strong { background: var(--accent); color: var(--sur-accent); font-size: 17px; }
.cal-defilement { flex: 1; min-height: 0; overflow-y: auto; }
.cal-heures { display: grid; grid-auto-rows: var(--h); }
.cal-heures span { font-size: 12px; color: var(--encre-2); text-align: end; padding-inline-end: 10px; transform: translateY(-.6em); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-heures span:first-child { visibility: hidden; }
.cal-colonne { position: relative; height: calc(24 * var(--h)); border-inline-start: 1px solid var(--ligne); background-image: linear-gradient(var(--ligne) 1px, transparent 1px); background-size: 100% var(--h); cursor: cell; }
.cal-colonne.aujourdhui { background-color: color-mix(in srgb, var(--accent-pale) 40%, transparent); }
.cal-colonne:hover { background-color: color-mix(in srgb, var(--accent-pale) 55%, transparent); }
.cal-evt {
  position: absolute; margin-inline-start: 4px; overflow: hidden; display: flex; flex-direction: column;
  padding: 6px 10px; border: 0; border-radius: var(--r); text-align: start; cursor: pointer; color: var(--encre);
  background: color-mix(in srgb, hsl(var(--teinte, 225) 70% 55%) 16%, var(--surface));
}
.cal-evt:hover { filter: brightness(.97); z-index: 2; }
.cal-evt strong { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: match-parent; }
.cal-evt span { font-size: 12px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-evt.en_direct { background: var(--soleil-pale); box-shadow: inset 0 0 0 2px var(--soleil); }
.cal-evt.en_direct span { color: var(--soleil-encre); font-weight: 700; }
.cal-evt.terminee { opacity: .55; }
.cal-maintenant { position: absolute; inset-inline: 0; height: 2px; background: var(--maintenant); z-index: 3; pointer-events: none; }
.cal-maintenant::before { content: ""; position: absolute; inset-inline-start: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--maintenant); }
.cal-mois { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(92px, 1fr)); overflow-y: auto; }
.cal-mois-entete { padding: 10px; font-size: 12px; font-weight: 700; color: var(--encre-2); text-align: center; border-bottom: 1px solid var(--ligne); }
.cal-case { display: flex; flex-direction: column; gap: 3px; padding: 6px; min-width: 0; border-inline-start: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); cursor: cell; }
.cal-case.hors-mois { background: var(--surface-2); }
.cal-case.hors-mois .cal-num { color: var(--encre-2); }
.cal-num { align-self: flex-start; min-width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; font-weight: 700; cursor: pointer; }
.cal-case.aujourdhui .cal-num { background: var(--accent); color: var(--sur-accent); }
.cal-puce { width: 100%; padding: 3px 7px; border: 0; border-radius: 6px; text-align: start; cursor: pointer; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--encre); background: color-mix(in srgb, hsl(var(--teinte, 225) 70% 55%) 16%, var(--surface)); }
.cal-puce b { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-plus { align-self: flex-start; border: 0; background: none; padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer; }

/* ---------- Avant d'entrer dans une réunion ---------- */
.avant-reunion { min-height: 100%; display: flex; flex-direction: column; background: var(--fond); }
.avant-haut { display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: var(--surface); border-bottom: 1px solid var(--ligne); }
.avant-haut-droite { margin-inline-start: auto; display: flex; align-items: center; gap: 16px; }
.avant-contenu { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px clamp(16px, 4vw, 32px); }
.avant-cadre { width: 100%; max-width: 1080px; display: flex; flex-direction: column; gap: 22px; }
.avant-equipe { font-size: 13px; font-weight: 700; color: var(--accent); }
.avant-cadre h1 { margin-top: 4px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; unicode-bidi: plaintext; text-align: match-parent; }
.avant-quand { margin: 4px 0 0; color: var(--encre-3); }
.avant-grille { display: flex; gap: 24px; flex-wrap: wrap; }
.avant-video { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.apercu { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-grand); background: var(--nuit); display: grid; place-items: center; overflow: hidden; }
.apercu video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.apercu .avatar { width: 96px; height: 96px; font-size: 32px; }
.apercu-etiquette { position: absolute; inset-inline-start: 16px; bottom: 14px; padding: 4px 10px; border-radius: 8px; background: rgba(0, 0, 0, .5); color: #FFFFFF; font-size: 13px; font-weight: 600; }
.reglages { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.reglage { height: 48px; padding: 0 18px; border-radius: 24px; border: 0; background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--encre); }
.reglage[aria-pressed="false"] { background: var(--encre); color: var(--surface); }
.avant-cote { flex: 1 1 340px; display: flex; flex-direction: column; gap: 16px; }
.carte { background: var(--surface); border-radius: var(--r-grand); padding: 22px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 14px; }
.carte h2 { font-size: 16px; font-weight: 800; }
.carte-ligne { display: flex; align-items: center; gap: 10px; color: var(--encre-3); }
.lien-ligne { display: flex; gap: 8px; }
.lien-ligne input { flex: 1; height: 42px; font-size: 13px; color: var(--encre-3); background: var(--surface-2); }
.message-info { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--soleil-pale); color: var(--encre); }

/* ---------- Pages Gestion et Plateforme ---------- */
.vue-page { overflow-y: auto; padding: 28px clamp(16px, 4vw, 40px); }
.page-entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 960px; margin-bottom: 22px; }
.page-entete h1 { font-size: 24px; font-weight: 800; }
.page-entete p { margin: 4px 0 0; color: var(--encre-2); }
.stats { display: flex; flex-wrap: wrap; gap: 14px; max-width: 960px; margin-bottom: 22px; }
.stat { flex: 1 1 160px; background: var(--surface); border-radius: var(--r-moyen); padding: 16px 18px; box-shadow: var(--ombre); }
.stat strong { display: block; font-size: 26px; font-weight: 800; }
.stat span { color: var(--encre-2); font-size: 13px; }
.tableau { max-width: 960px; overflow-x: auto; background: var(--surface); border-radius: var(--r-moyen); box-shadow: var(--ombre); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: start; white-space: nowrap; border-bottom: 1px solid var(--ligne); }
th { font-size: 12px; font-weight: 700; color: var(--encre-2); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td select { height: 36px !important; width: auto !important; }

/* ---------- Dialogues ---------- */
dialog { width: min(460px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: var(--r-grand); background: var(--surface); color: var(--encre); box-shadow: var(--ombre-haute); }
dialog.dlg-large { width: min(560px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 15, 31, .5); }
dialog form, .dlg-corps { display: grid; gap: 16px; padding: 24px; }
dialog h2 { font-size: 20px; font-weight: 800; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.dlg-fermer { justify-self: center; }
.champs-ligne { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
fieldset.participants { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
fieldset.participants legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.choix-personnes { display: grid; gap: 8px; }
.choix-selection { display: flex; flex-wrap: wrap; gap: 6px; }
.choix-selection:empty { display: none; }
.puce-personne { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; padding-inline: 10px 4px; border-radius: 99px; background: var(--accent-pale); font-size: 13px; font-weight: 600; unicode-bidi: plaintext; }
.puce-personne button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--encre-2); font-size: 16px; line-height: 1; }
.puce-personne button:hover { background: rgba(0, 0, 0, .08); color: var(--encre); }
.choix-resultats { list-style: none; margin: 0; padding: 4px; max-height: 220px; overflow-y: auto; border: 1.5px solid var(--ligne-2); border-radius: var(--r); }
.choix-resultats:empty { display: none; }
.choix-resultats button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: start; cursor: pointer; color: var(--encre); }
.choix-resultats button:hover { background: var(--surface-2); }
.choix-resultats span { display: grid; min-width: 0; }
.choix-resultats strong { font-size: 14px; unicode-bidi: plaintext; text-align: match-parent; }
.choix-resultats small { font-size: 12px; color: var(--encre-2); }
.choix-vide { padding: 8px; color: var(--encre-2); font-size: 13px; }
.reunion-entete { display: flex; align-items: center; gap: 12px; }
.reunion-entete h2 { unicode-bidi: plaintext; text-align: match-parent; }
.reunion-entete p { margin: 2px 0 0; color: var(--encre-2); font-size: 13px; }
.infos { margin: 0; display: grid; gap: 8px; }
.infos div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 10px; }
.infos dt { color: var(--encre-2); font-size: 13px; }
.infos dd { margin: 0; font-weight: 600; }
.etat { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--surface-2); color: var(--encre-2); }
.etat.a_venir { background: var(--accent-pale); color: var(--accent-fonce); }
.etat.en_direct { background: var(--soleil-pale); color: var(--soleil-encre); }
.bloc { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--ligne); }
.bloc h3 { font-size: 14px; font-weight: 800; }

#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 12px; background: var(--encre); color: var(--surface); font-weight: 600;
  opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { margin-inline-start: 12px; color: var(--soleil); background: none; border: 0; font-weight: 800; cursor: pointer; }

/* ---------- Téléphone ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .rail-logo, .rail-espace { display: none; }
  .rail-btn { height: 52px; }
  .vue-deux { grid-template-columns: 1fr; }
  .vue-deux .detail { display: none; }
  body.detail-ouvert .vue-deux .detail { display: flex; }
  body.detail-ouvert .vue-deux .volet { display: none; }
  .retour { display: grid; }
  .detail-haut, .fil, .panneau { padding-left: 16px; padding-right: 16px; }
  .compose { padding: 0 12px 12px; }
  .lecture-seule { margin: 0 12px 12px; }
  .bulle-ligne { max-width: 88%; }
  .cal-barre, .cal-corps { padding-left: 12px; padding-right: 12px; }
  .champs-ligne { grid-template-columns: 1fr; }
  .detail-ligne .btn span { display: none; }
}
[dir="rtl"] .retour svg { transform: scaleX(-1); }

/* Nom de la plateforme : « ندوة » en arabe, « Nadwa » en français et en anglais */
.logo-nom { font-family: var(--police-ar); font-weight: 700; font-size: 30px; line-height: 1.1; color: var(--soleil); }
.logo-nom.latin { font-family: var(--police); font-weight: 800; letter-spacing: -.02em; }
.marque-sombre { font-size: 24px; }
.rail-logo.latin { font-family: var(--police); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }

/* ---------- Fichiers (bibliothèque de documents) ---------- */
.lien-oubli { justify-self: end; font-size: 13px; margin-top: -8px; }
.fichiers { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 18px 28px 28px; }
.fichiers.depot::after {
  content: attr(data-depot); position: absolute; inset: 10px; display: grid; place-items: center; z-index: 5;
  border: 2px dashed var(--accent); border-radius: var(--r-grand); background: color-mix(in srgb, var(--accent-pale) 85%, transparent);
  color: var(--accent-fonce); font-weight: 800; font-size: 16px; pointer-events: none;
}
.fichiers-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ariane { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-weight: 700; }
.ariane button { border: 0; background: none; padding: 4px 6px; border-radius: 6px; font-weight: 700; color: var(--accent); cursor: pointer; unicode-bidi: plaintext; }
.ariane button:hover { background: var(--surface-2); }
.ariane span[aria-current] { padding: 4px 6px; color: var(--encre); unicode-bidi: plaintext; }
.ariane .sep { color: var(--encre-2); }
[dir="rtl"] .ariane .sep { transform: scaleX(-1); display: inline-block; }
.table-fichiers { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-moyen); box-shadow: var(--ombre); overflow: hidden; }
.table-fichiers td { white-space: normal; vertical-align: middle; }
.table-fichiers .nom-fichier { display: flex; align-items: center; gap: 12px; min-width: 0; }
.table-fichiers .nom-fichier a, .table-fichiers .nom-fichier button { border: 0; background: none; padding: 0; color: var(--encre); font-weight: 600; text-decoration: none; cursor: pointer; text-align: start; unicode-bidi: plaintext; overflow-wrap: anywhere; }
.table-fichiers .nom-fichier a:hover, .table-fichiers .nom-fichier button:hover { color: var(--accent); text-decoration: underline; }
.table-fichiers .discret { color: var(--encre-2); font-size: 13px; white-space: nowrap; }
.table-fichiers .actions { white-space: nowrap; text-align: end; }
.ext {
  flex: none; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .02em; background: var(--surface-2); color: var(--encre-3);
}
.ext.pdf { background: #FDECEC; color: #B42318; }
.ext.doc { background: #E8EEFE; color: #1E40B8; }
.ext.xls { background: #E7F6EF; color: #17734F; }
.ext.ppt { background: #FDEBDD; color: #B54708; }
.ext.img { background: #F3EEFE; color: #6D28D9; }
.ext.dossier { background: var(--soleil-pale); color: var(--soleil-encre); }
.ext.dossier svg { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) {
  .ext.pdf, .ext.doc, .ext.xls, .ext.ppt, .ext.img { background: var(--surface-2); }
}
.piece-jointe { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--surface); max-width: 420px; color: var(--encre); }
.piece-jointe div { flex: 1; min-width: 0; display: grid; }
.piece-jointe strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: match-parent; }
.piece-jointe small { color: var(--encre-2); font-size: 12px; }
.piece-jointe a.btn-icone { text-decoration: none; }
.apercu-image { display: block; margin-top: 8px; max-width: min(360px, 100%); max-height: 260px; border-radius: 12px; border: 1px solid var(--ligne); }
.bulle-ligne.moi .piece-jointe { margin-inline-start: auto; }
.btn-joindre { width: 38px; height: 38px; border: 0; border-radius: var(--r); background: none; color: var(--encre-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.btn-joindre:hover { background: var(--surface-2); color: var(--encre); }
.compose form { padding-inline-start: 8px; }
@media (max-width: 860px) { .fichiers { padding: 14px 12px; } .table-fichiers .col-option { display: none; } }

.form-rejoindre { display: grid; gap: 12px; }
.a-gauche { justify-self: start; }
.fichiers-vide { margin-top: 48px; }
.fichiers-vide svg { width: 36px; height: 36px; color: var(--encre-2); }
