:root{
  --bg:#0b1220; --panel:#0f172a; --panel-2:#111a31;
  --muted:#8ea0c8; --txt:#e6ecff; --acc:#6ba7ff; --acc-2:#94f0ff;
  --ok:#22c55e; --warn:#f59e0b; --bad:#ef4444; --border:#213152;
  --chip:#1b2848; --radius:16px; --radius-sm:12px;
  --shadow:0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.02);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,"Helvetica Neue",Arial;
  color:var(--txt);
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(9,94,255,.12), transparent 40%),
    radial-gradient(1000px 700px at -10% 110%, rgba(148,240,255,.15), transparent 40%),
    var(--bg);
}

/* Layout */
.app{display:grid; grid-template-rows:auto 1fr; height:100%}
.header{
  display:flex; align-items:center; gap:16px; padding:16px 20px; border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  backdrop-filter: blur(8px); position:sticky; top:0; z-index:3
}
.brand{display:flex; align-items:center; gap:12px}
.logo{width:36px;height:36px;border-radius:12px;background:linear-gradient(135deg,var(--acc),var(--acc-2)); box-shadow:0 8px 24px rgba(107,167,255,.35)}
.brand h1{font-size:18px; margin:0}
.tag{padding:2px 8px; border:1px solid var(--border); border-radius:999px; font-size:12px; color:#a9b8dd}
.muted{color:var(--muted)}
.muted.sm{font-size:12px}
.grow{flex:1}
.header-controls{display:flex; gap:10px; align-items:center}

main{ display:grid; grid-template-columns:600px 1fr; height:calc(100vh - 70px); }
.left{border-right:1px solid var(--border); padding:18px; overflow:auto}
.content{padding:18px; overflow:auto}
.spacer{height:14px}

/* UI atoms */
.btn{
  appearance:none; border:1px solid var(--border);
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  color:var(--txt); padding:10px 14px; border-radius:12px; font-weight:600;
  cursor:pointer; box-shadow:var(--shadow); transition:.2s transform, .2s border-color, .2s opacity
}
.btn:hover{transform:translateY(-1px); border-color:#2a3b63}
.btn.primary{background:linear-gradient(180deg,#2f6df6,#3f83f8); border-color:#3a6bf0}
.btn.ghost{background:transparent}
.btn.small{padding:8px 12px; font-size:13px}
.btn:disabled{opacity:.5; cursor:not-allowed}

.icon-btn{
  appearance:none; background:transparent; border:1px solid var(--border); color:var(--txt);
  border-radius:10px; padding:6px 10px; cursor:pointer;
}
.icon-btn:hover{border-color:#2a3b63}

.input, select, textarea{
  width:100%; padding:11px 12px; background:rgba(255,255,255,.02);
  border:1px solid var(--border); border-radius:12px; color:var(--txt); outline:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.02)
}
.input:focus, select:focus, textarea:focus{border-color:#3058a6}

.panel{background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow)}
.section{padding:16px}
.section h3{margin:0 0 12px 0; font-size:14px; color:#a9b8dd; text-transform:uppercase; letter-spacing:.08em}

.grid{display:grid; gap:10px}
.grid.two{grid-template-columns:1fr 1fr}
.grid.three{grid-template-columns:1fr 1fr 1fr}
.search{flex:1; position:relative}
.search .icon{position:absolute; left:10px; top:50%; transform:translateY(-50%); opacity:.6}
.search input{padding-left:36px}
.filter{width:240px}
.list{display:grid; gap:12px}
.card{border:1px solid var(--border); border-radius:var(--radius-sm); background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)); padding:12px}
.row{display:flex; gap:10px; align-items:center}
.row .grow{flex:1}
.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{background:var(--chip); padding:6px 10px; border:1px solid var(--border); color:#cdd7ff; border-radius:999px; font-size:12px}

.status{font-size:12px; padding:4px 8px; border-radius:999px; border:1px solid var(--border)}
.status.wait{color:#f5dfa3; background:rgba(245,222,179,.06)}
.status.ok{color:#b6f5c6; background:rgba(34,197,94,.08)}
.status.warn{color:#ffd5a3; background:rgba(245,158,11,.08)}

.toolbar{display:flex; gap:10px; align-items:center; margin-bottom:12px}
.empty{text-align:center; opacity:.7; padding:32px}
.empty-title{font-size:22px; margin-bottom:6px}
.hide{display:none!important}

@media (max-width:1100px){ main{grid-template-columns:1fr} .left{order:2} }

/* Modals (custom) */
.modal-root{position:fixed; inset:0; pointer-events:none; z-index:50}
.modal{position:fixed; inset:0; display:none; align-items:center; justify-content:center; pointer-events:none}
.modal.show{display:flex; pointer-events:auto}
.modal::before{
  content:''; position:absolute; inset:0; background:rgba(2,8,20,.6); backdrop-filter: blur(6px);
  opacity:0; animation:fadeIn .15s ease forwards;
}
.modal-card{
  position:relative; width:min(520px, 92vw);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border); border-radius:20px; box-shadow:0 30px 80px rgba(0,0,0,.55);
  transform:translateY(6px) scale(.98); opacity:0; animation:popIn .18s ease forwards;
}
.modal-card.large{width:min(800px, 94vw)}
.modal-card.xlarge{width:min(1000px, 96vw)}
.modal-head{display:flex; align-items:center; gap:10px; padding:16px 18px; border-bottom:1px solid var(--border)}
.modal-title{font-size:18px; font-weight:700}
.modal-body{padding:16px 18px}
.modal-foot{display:flex; align-items:center; gap:10px; padding:14px 18px; border-top:1px solid var(--border)}

@keyframes popIn{
  to{opacity:1; transform:translateY(0) scale(1)}
}
@keyframes fadeIn{to{opacity:1}}

/* =========================================================
   Correctifs : limiter la portée des nouveaux styles
   ========================================================= */

/* 1) Landing : styles strictement SCOPÉS à #landing */
#landing{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:calc(100vh - 70px);
  padding:40px 16px;
}
#landing .landing-card{
  box-sizing:border-box;
  width:100%;
  max-width:480px;               /* largeur limitée du formulaire */
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:var(--shadow);
  padding:22px;
  text-align:center;
  margin:0 auto;
}
#landing .landing-card .logo{
  width:48px; height:48px; border-radius:14px;
  margin:0 auto 10px;
  background:linear-gradient(135deg,var(--acc),var(--acc-2));
}
#landing h2{ margin:4px 0 6px 0; }
#landing form.grid{ display:grid; grid-auto-flow:row; gap:12px; margin-top:10px; }
#landing .input, #landing .btn{ width:100%; }

/* 2) Masquage landing après connexion (sans toucher au reste) */
.hide{ display:none !important; }              /* utilitaire, ok partout */
body.authed #landing{ display:none !important; }
/* #appMain garde son affichage habituel géré par ton layout */

/* 3) RÉTABLIR l'apparence globale (on annule les overrides trop larges) */
.app a{ color: inherit; }                      /* liens redeviennent comme avant */
.app a:hover{ text-decoration: underline; }

/* Lisibilité du téléphone uniquement dans la liste clients (au lieu d'un global sur tous les liens) */
#clientList a{ color:#8ecaff; }
#clientList .muted a{ color:#a7d5ff; }

/* 4) Espace sous la barre de stats uniquement sur l'app (pas global) */
#appMain .chips{ margin-bottom:12px; }

/* =========================
   Lisibilité des <select>
   ========================= */

/* Tous les selects qui ont la classe .input */
select.input {
  color: #e9eef6;                 /* texte clair lisible */
  background: rgba(255,255,255,0.06); /* fond non blanc */
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 36px 10px 12px;   /* espace + place pour la flèche */
  appearance: none;               /* supprime le style natif */
  -webkit-appearance: none;
  -moz-appearance: none;
  line-height: 1.2;
}

/* Variante filtre (si tu utilises .filter sur des selects) */
select.input.filter {
  background: rgba(255,255,255,0.08);
  color: #f3f7ff;
}

/* Icône de flèche personnalisée (simple ▼) */
select.input {
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 14px,
    calc(100% - 12px) 14px,
    calc(100% - 36px) center;
  background-size: 6px 6px, 6px 6px, 1px 100%;
  background-repeat: no-repeat;
}

/* Focus visible bien contrasté */
select.input:focus,
select.input:focus-visible {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(100, 150, 255, 0.25);
}

/* Désactivé */
select.input:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* Options dans la “liste ouverte” (le support varie selon navigateurs) */
select.input option {
  color: #0e1525;                 /* texte foncé dans la liste */
  background: #ffffff;            /* fond clair dans la liste */
}

/* iOS/Safari : demande un thème sombre pour éviter le texte gris sur blanc */
@supports (color-scheme: light dark) {
  select.input { color-scheme: dark; }
}

/* Placeholders d’inputs (au cas où certaines listes sont remplacées par input+list) */
.input::placeholder { color: #b7c2d6; }

/* =========================
   Thèmes : Dark (défaut) / Light
   ========================= */

/* =========================
   CONTRASTE — THEME CLAIR
   ========================= */
:root[data-theme="light"]{
  --bg: #F7F9FC;
  --panel: #FFFFFF;
  --text: #0E1525;              /* texte principal plus foncé */
  --muted: #485872;             /* texte secondaire + foncé */
  --border: #D6DEEA;            /* bordure plus visible */
  --acc: #2563EB;               /* bleu plus dense */
  --acc-2: #3B82F6;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

/* Corps & panneaux */
:root[data-theme="light"] body{ color: var(--text); background: var(--bg); }
:root[data-theme="light"] .panel,
:root[data-theme="light"] .card,
:root[data-theme="light"] .modal-card{
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Labels, textes atténués, placeholders */
:root[data-theme="light"] .muted{ color: var(--muted); }
:root[data-theme="light"] .input::placeholder{ color: #6B7B93; }   /* plus lisible */

/* Inputs (text/number/email) */
:root[data-theme="light"] .input{
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text);
}
:root[data-theme="light"] .input:focus{
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .2);
}

/* Selects (fermés) */
:root[data-theme="light"] select.input{
  background: #FFFFFF;
  color: var(--text);
  border: 1px solid var(--border);
}
/* Options dans la liste ouverte (quand supporté) */
:root[data-theme="light"] select.input option{
  color:#0E1525;
  background:#FFFFFF;
}

/* Boutons */
:root[data-theme="light"] .btn{
  color:#0E1525;
  background: linear-gradient(#F3F6FB, #E7EDF7);
  border:1px solid #CBD6E6;
}
:root[data-theme="light"] .btn:hover{
  filter: brightness(0.98);
}
:root[data-theme="light"] .btn.primary{
  color:#FFFFFF;
  background: linear-gradient(#3B82F6, #2563EB);
  border:1px solid #1D4ED8;
}
:root[data-theme="light"] .btn.ghost{
  background: #FFFFFF;
  border:1px solid var(--border);
  color:#0E1525;
}

/* Chips / Badges (compteurs & statuts) */
:root[data-theme="light"] .chip{
  background: #EFF4FF;           /* bleu très clair */
  color: #0E3A8A;                /* bleu foncé lisible */
  border:1px solid #C7D7FE;
}
:root[data-theme="light"] .chip[data-statut="en_attente_docs"]{ background:#FFF8E6; color:#7A4E00; border-color:#F3D8A6; }
:root[data-theme="light"] .chip[data-statut="incomplet"]{ background:#F3F4F6; color:#374151; border-color:#E5E7EB; }
:root[data-theme="light"] .chip[data-statut="rdv"]{ background:#E6F4FF; color:#0B5394; border-color:#BDD7FE; }
:root[data-theme="light"] .chip[data-statut="qualifie"]{ background:#E7F6EC; color:#1F6F3D; border-color:#C3E7CE; }
:root[data-theme="light"] .chip[data-statut="refuse"]{ background:#FDE8E8; color:#8A1C1C; border-color:#F5C2C0; }

/* Liste clients : ligne + bouton Ouvrir */
:root[data-theme="light"] #clientList .card{
  background:#FFFFFF;
  border:1px solid var(--border);
}
:root[data-theme="light"] #clientList .btn.small{
  background: linear-gradient(#F3F6FB, #E7EDF7);
  border:1px solid #CBD6E6;
  color:#0E1525;
}

/* Liens (numéro/email) en clair : assez foncés & accessibles */
:root[data-theme="light"] #clientList a,
:root[data-theme="light"] .modal-card a{
  color:#0B5DD7;
}
:root[data-theme="light"] #clientList a:hover,
:root[data-theme="light"] .modal-card a:hover{
  text-decoration: underline;
}

/* Modale : cadre visible + overlay un peu plus foncé (meilleur contraste) */
:root[data-theme="light"] .modal .modal-card{
  background:#FFFFFF;
  border:1px solid var(--border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
}
:root[data-theme="light"] .modal::before{
  background: rgba(15, 23, 42, .45);  /* overlay plus sombre */
}

/* Boutons d'action de la modale (Enregistrer / Supprimer) */
:root[data-theme="light"] #saveClientBtn.btn.small.primary{
  color:#FFFFFF;
  background: linear-gradient(#3B82F6, #2563EB);
  border-color:#1D4ED8;
}
:root[data-theme="light"] #deleteClientBtn.btn.small.danger{
  color:#FFFFFF;
  background: linear-gradient(#EF4444, #DC2626);
  border-color:#B91C1C;
}

/* Zone Documents client (cartouche) */
:root[data-theme="light"] .panel .section{
  color: var(--text);
}
:root[data-theme="light"] #publicLink.input{
  background:#F8FAFF;
  color:#0E1525;
  border:1px solid #CBD6E6;
}

/* Barre supérieure (header) douceur claire mais lisible */
:root[data-theme="light"] .header{
  background: rgba(255,255,255,.75);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}

/* Assure le contexte pour le bouton */
.modal-card { position: relative; }

/* Close plus visible, top-right */
.modal-close{
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  background: linear-gradient(#fff, #f3f4f6);
  color: #111827;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
  z-index: 2;
}
[data-theme="dark"] .modal-close{
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.22);
}
.modal-close:hover{
  transform: translateY(-1px);
  background: #ef4444;     /* rouge */
  color: #fff;
  border-color: #ef4444;
}
.modal-close:active{ transform: translateY(0); }

.input.readonly { opacity: .8; }

/* ===== Notifications (cloche) ===== */
.top-actions { display:flex; align-items:center; gap:8px; position:relative; }
.btn-ghost { background:transparent; border:1px solid var(--border); padding:8px 10px; border-radius:10px; cursor:pointer; }
.notif-bell { position:relative; background:transparent; border:1px solid var(--border); padding:8px 10px; border-radius:10px; cursor:pointer; }
.notif-bell:hover, .btn-ghost:hover { border-color:#2a3b63; box-shadow:0 0 0 3px rgba(100,150,255,.15); }

.notif-badge {
  position:absolute; top:-6px; right:-6px;
  min-width:20px; height:20px; padding:0 6px;
  background:#e11d48; color:#fff; font-size:12px; line-height:20px; text-align:center;
  border-radius:12px; border:2px solid var(--panel);
}

.notif-dropdown {
  position:absolute; right:0; top:calc(100% + 8px);
  width:360px; max-height:420px; overflow:auto;
  background:var(--panel); border:1px solid var(--border); border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.2); z-index:30;
}
.notif-head { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--border); }
.btn-link { background:transparent; border:0; color:#3b82f6; cursor:pointer; }
.notif-list { display:flex; flex-direction:column; }
.notif-item { padding:10px 12px; border-bottom:1px solid var(--border); display:grid; gap:6px; }
.notif-item.unread { background:rgba(59,130,246,.08); }
.notif-item .meta { font-size:12px; opacity:.7; }

/* ===== Calendrier ===== */
.calendar-body { display:grid; grid-template-columns: 1fr 280px; gap:16px; min-height:480px; }
.calendar-toolbar { display:flex; align-items:center; gap:8px; justify-content:flex-start; }
.cal-title { font-weight:600; margin-right:auto; }
.calendar-grid {
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:6px;
  border-top:1px solid var(--border);
  padding-top:8px;
}
.calendar-cell {
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px;
  min-height:88px;
  display:flex; flex-direction:column; gap:6px;
}
.calendar-cell .day { font-size:12px; opacity:.7; }
.calendar-cell .dot { width:6px; height:6px; border-radius:50%; display:inline-block; margin-right:4px; }
.calendar-cell .chip { display:inline-flex; align-items:center; padding:2px 6px; border-radius:999px; border:1px solid var(--border); font-size:11px; }
.calendar-cell.today { outline:2px solid #3b82f6; }
.calendar-aside { border-left:1px solid var(--border); padding-left:12px; }
.upcoming-list { display:flex; flex-direction:column; gap:8px; max-height:420px; overflow:auto; }

.hide-sm { display:inline; }
@media (max-width: 900px){
  .hide-sm { display:none; }
  .calendar-body { grid-template-columns: 1fr; }
  .calendar-aside { border-left:0; padding-left:0; }
  .notif-dropdown { width:92vw; right:4vw; }
}
/* ===== RDV / Rappel — fiche client ===== */
#editForm .row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

#editForm .row.two .col label[for="rdv_at"],
#editForm .row.two .col label[for="rappel_at"],
#editForm label[for="rdv_title"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin: 2px 0 6px;
  line-height: 1.15;
}

/* Inputs harmonisés (même look que .input) */
#rdv_at,
#rappel_at,
#rdv_title {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card, #fff);
  color: var(--text, #111);
  font: inherit;
  box-sizing: border-box;
}

/* Focus propre */
#rdv_at:focus,
#rappel_at:focus,
#rdv_title:focus {
  outline: none;
  border-color: var(--primary, #6a8cff);
  box-shadow: 0 0 0 3px rgba(106,140,255,0.2);
}

/* Placeholders plus discrets */
#rdv_title::placeholder {
  color: var(--muted, #888);
  opacity: 1;
}

/* Compacte l’espace sous le groupe */
#editForm .row.two + .row {
  margin-top: 8px;
}

/* Responsive : passe sur une colonne en mobile */
@media (max-width: 680px) {
  #editForm .row.two {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
/* ===== Calendrier — "À venir" modern ===== */
.calendar-aside { padding-left: 6px; }

.upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Carte compacte, douce */
.upcoming-item {
  border: 1px solid var(--border);
  background: var(--card, #fff);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.upcoming-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.08);
}

/* Titre cliquable qui ressemble à un lien/app */
.upcoming-item .linklike {
  all: unset;
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
}

/* Icône douce */
.upcoming-item .linklike::before {
  content: '📌';
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(106,140,255,.12); /* fallback sans var --primary-rgb */
  font-size: 14px;
  line-height: 1;
}

/* Variante Rappel (si classe .is-rappel ajoutée – voir mini JS optionnel) */
.upcoming-item.is-rappel .linklike::before { content: '⏰'; background: rgba(255,99,132,.12); }

/* Titre + nom client sur une ligne (truncate élégant) */
.upcoming-item .linklike strong {
  font-weight: 700;
}
.upcoming-item .linklike span {
  color: var(--muted, #6b7280);
  font-weight: 500;
}
.upcoming-item .linklike strong,
.upcoming-item .linklike span {
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Métadonnée heure/date */
.upcoming-item .meta {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted, #6b7280);
}

/* Petites puces dans la grille calendrier cliquables */
.calendar-grid .chip.linklike {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: var(--card, #fff);
  border-radius: 10px;
  font-weight: 600;
  margin-top: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.calendar-grid .chip.linklike:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* Titre section */
.calendar-aside h4 {
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
  margin-bottom: 10px;
}
#clientReminders .row {
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
#clientReminders .row:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  transition: transform .12s ease, box-shadow .12s ease;
}
/* ===== Modales : head/pied fixes, corps scrollable ===== */

/* La modale occupe l'écran, card centrée */
.modal.show {
  align-items: center;
  justify-content: center;
}

/* La carte ne dépasse pas 92vh et gère l'overflow en interne */
.modal .modal-card {
  max-height: 92vh;                 /* limite verticale */
  display: flex;
  flex-direction: column;           /* head / body / foot en colonne */
  overflow: hidden;                 /* évite que le contenu dépasse */
}

/* Head collé en haut (reste visible), avec fond et ombre légère */
.modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card, #fff);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

/* Body scrollable si contenu trop long */
.modal .modal-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch; /* scroll fluide iOS */
  padding: 16px;
}

/* Foot collé en bas (reste visible) */
.modal .modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--card, #fff);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
}

/* Variante tailles : assure max-height quel que soit le format */
.modal .modal-card.small,
.modal .modal-card.large,
.modal .modal-card.xlarge {
  max-height: 92vh;
}

/* Confort sur petits écrans : réduit marges internes */
@media (max-width: 780px) {
  .modal .modal-body { padding: 12px; }
  .modal .modal-head, .modal .modal-foot { padding: 10px 12px; }
}
/* ===== Confirm Modal (design sympa) ===== */
#confirmModal .modal-card.small {
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  border: 1px solid var(--border);
  overflow: hidden;
}

#confirmModal .modal-head {
  background: linear-gradient(180deg, rgba(0,0,0,0.04), transparent);
  border-bottom: 1px solid var(--border);
}

#confirmModal .modal-title {
  font-weight: 800;
  letter-spacing: .2px;
}

#confirmModal .confirm-message {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text, #111);
  padding: 6px 2px;
}

#confirmOk {
  background: var(--primary, #6a8cff);
  border-color: var(--primary, #6a8cff);
  color: #fff;
  border-radius: 10px;
}
#confirmOk:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}
#confirmCancel { border-radius: 10px; }

/* Variante danger (rouge) */
#confirmModal.danger #confirmOk {
  background: #ef4444;
  border-color: #ef4444;
}
#confirmModal.danger .modal-head {
  background: linear-gradient(180deg, rgba(239,68,68,.08), transparent);
}
/* ===== Notifications (cloche) ===== */
#notifDropdown{
  position: absolute;        /* déjà probablement en absolute */
  right: 0;
  top: 100%;
  width: 360px;              /* ajuste si besoin */
  max-height: 70vh;          /* hauteur max du panneau */
  display: flex;             /* pour figer l’entête et scroller la liste */
  flex-direction: column;
  overflow: hidden;          /* cache le débordement global */
  border: 1px solid var(--border, #e4e4e4);
  border-radius: 12px;
  background: var(--bg, #fff);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  z-index: 9999;
}

/* barre d'entête : titre + bouton "Tout marquer comme lu" si tu en as un */
#notifDropdown .notif-header{
  position: sticky; top: 0; z-index: 1;
  background: inherit;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e4e4e4);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600;
}

/* la liste scrolle, pas l’entête */
#notifList{
  overflow-y: auto;
  max-height: calc(70vh - 52px); /* 52px ≈ hauteur de l’entête; ajuste si besoin */
  padding: 8px 0;
  overscroll-behavior: contain;
}

/* items */
.notif-item{
  padding: 10px 12px;
  line-height: 1.35;
  border-bottom: 1px dashed var(--border, #ececec);
}
.notif-item.unread{ background: rgba(255, 208, 0, .08); }
.notif-item:last-child{ border-bottom: 0; }

#notifDropdown .meta{
  font-size: 12px;
  opacity: .7;
  margin-top: 4px;
}

/* badge */
#notifBadge{
  position: absolute;
  top: -4px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #ff3b30; color: #fff;
  font-size: 11px; display: inline-flex; align-items:center; justify-content:center;
}

/* scrollbar (facultatif) */
#notifList::-webkit-scrollbar{ width: 10px; }
#notifList::-webkit-scrollbar-thumb{ border-radius: 10px; background: rgba(0,0,0,.2); }
#notifList::-webkit-scrollbar-track{ background: transparent; }

/*Notifications: respecter l'attribut hidden */
#notifDropdown[hidden] {
  display: none !important;
}
