/* Identité MKA — Masudi Kadogo & Associés : or sur bois de noyer.
   Thème clair « ivoire » (barre latérale en noyer) et thème sombre (noir et or). */
:root {
  --bg: #f6f1e8;
  --card: #fffdf8;
  --text: #2a1c14;
  --muted: #7b6857;
  --line: #e6d9c6;
  --hover: #f1e7d7;
  --accent: #2b1c13;          /* boutons principaux : noyer, texte or */
  --accent-text: #f1d9a2;
  --gold: #a9823d;            /* or lisible sur fond clair */
  --gold-vif: #d8b46e;
  --gold-soft: #f4e8cf;
  --side-bg: linear-gradient(180deg, #2b1c13 0%, #1c130d 100%);
  --side-solid: #22170f;
  --side-text: #d8c6a6;
  --side-strong: #ecd3a0;
  --side-line: #3b2a1e;
  --side-hover: rgba(236, 211, 160, .08);
  --red: #9b1c1c;    --red-soft: #f8e7e3;
  --green: #2d6a3e;  --green-soft: #e8f1e6;
  --orange: #9a5b05; --orange-soft: #f8ecd9;
  --violet: #5b3f8c; --violet-soft: #efe9f7;
  --grey: #6b5c4f;   --grey-soft: #eee6da;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(43, 28, 19, .05), 0 6px 18px -12px rgba(43, 28, 19, .25);
  color-scheme: light;
}
:root[data-theme="sombre"] {
  --bg: #0c0a09;
  --card: #161210;
  --text: #f0e7d8;
  --muted: #a39482;
  --line: #2e2620;
  --hover: #201a16;
  --accent: #d8b46e;
  --accent-text: #1a120d;
  --gold: #d8b46e;
  --gold-vif: #e7c886;
  --gold-soft: #2c2215;
  --side-bg: #070605;
  --side-solid: #070605;
  --side-text: #c9b796;
  --side-strong: #e7c886;
  --side-line: #231c16;
  --side-hover: rgba(231, 200, 134, .07);
  --red: #e58a7f;    --red-soft: #2c1513;
  --green: #86c497;  --green-soft: #13241a;
  --orange: #e0ac62; --orange-soft: #2b2010;
  --violet: #bda2ea; --violet-soft: #251d33;
  --grey: #a69a8c;   --grey-soft: #221d19;
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --bg: #0c0a09;
    --card: #161210;
    --text: #f0e7d8;
    --muted: #a39482;
    --line: #2e2620;
    --hover: #201a16;
    --accent: #d8b46e;
    --accent-text: #1a120d;
    --gold: #d8b46e;
    --gold-vif: #e7c886;
    --gold-soft: #2c2215;
    --side-bg: #070605;
    --side-solid: #070605;
    --side-text: #c9b796;
    --side-strong: #e7c886;
    --side-line: #231c16;
    --side-hover: rgba(231, 200, 134, .07);
    --red: #e58a7f;    --red-soft: #2c1513;
    --green: #86c497;  --green-soft: #13241a;
    --orange: #e0ac62; --orange-soft: #2b2010;
    --violet: #bda2ea; --violet-soft: #251d33;
    --grey: #a69a8c;   --grey-soft: #221d19;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
input[type=checkbox] { accent-color: var(--accent); }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  font-size: 15px;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); }
.serif, .topbar h1, .brand strong, .detail-head h2, .stat .num, .login-card h1 { font-family: Georgia, "Times New Roman", serif; }

/* ---------- Barre latérale (PC) ---------- */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--side-bg);
  color: var(--side-text);
  border-right: 1px solid var(--side-line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 4px 8px 26px; border-bottom: 1px solid var(--side-line); margin-bottom: 14px; }
.brand-logo { width: 150px; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.brand strong { display: block; font-size: 15px; color: var(--side-strong); letter-spacing: .02em; }
.brand span { font-size: 11px; color: var(--side-text); text-transform: uppercase; letter-spacing: .14em; opacity: .8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--side-text);
}
.nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.nav a.active { background: linear-gradient(135deg, #e7c886, #b8904a); color: #1a120d; font-weight: 600; box-shadow: 0 4px 14px -6px rgba(216, 180, 110, .6); }
.nav .ic { width: 20px; text-align: center; font-size: 16px; }
.install {
  margin-top: auto; background: transparent; border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 10px; cursor: pointer;
}

/* ---------- Contenu ---------- */
main { flex: 1; min-width: 0; padding: 24px 32px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 25px; font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--card);
  padding: 9px 14px; border-radius: 8px; cursor: pointer; font-weight: 500;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 17px; padding: 6px; color: var(--muted); border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--hover); }
.link { background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; text-decoration: underline; font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.card.alert { border-color: var(--red); }
.card.alert h3 { color: var(--red); }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 30px; font-weight: 600; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.stat.accent { border-left: 3px solid var(--accent); }

.empty { color: var(--muted); text-align: center; padding: 24px 8px; }
.warn { background: var(--orange-soft); color: var(--orange); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.info { background: var(--grey-soft); padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-top: 0; }
.err { color: var(--red); font-size: 14px; min-height: 1em; margin: 8px 0 0; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Listes */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--hover); }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t.barre { text-decoration: line-through; opacity: .6; }
.item .t.tenu { opacity: .78; }
/* « Suite ? » : audience passée sans renvoi — invite à donner la suite d'un toucher. */
.badge.suite { background: var(--orange, #d9822b); color: #fff; font-weight: 700; cursor: pointer; animation: suite-pulse 2.4s ease-in-out infinite; }
@keyframes suite-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,130,43,.55); } 50% { box-shadow: 0 0 0 6px rgba(217,130,43,0); } }
@media (prefers-reduced-motion: reduce) { .badge.suite { animation: none; } }   /* date passée et tenue : pas barrée (ce n'est pas une annulation) */
.item .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.item .renvoi-info { color: var(--text); font-size: 12.5px; }
.datebox {
  width: 50px; flex-shrink: 0; text-align: center; border-radius: 8px;
  border: 1px solid var(--line); padding: 6px 0; line-height: 1.1;
}
.datebox b { display: block; font-size: 19px; font-family: Georgia, serif; }
.datebox span { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.lock { font-size: .9em; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--grey-soft); color: var(--text);
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.grey { background: var(--grey-soft); color: var(--muted); }

/* Filtres */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
input, select, textarea {
  border: 1px solid var(--line); background: var(--card);
  border-radius: 8px; padding: 9px 12px; width: 100%;
}
.toolbar select { width: auto; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Tableau dossiers (PC) */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--hover); }
.ref { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--muted); }

/* Détail dossier */
.detail-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; }
.detail-head h2 { margin: 4px 0 8px; font-weight: 600; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.journal-entry { border-left: 2px solid var(--accent); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.journal-entry small { color: var(--muted); }
.journal-entry p { margin: 4px 0 0; white-space: pre-wrap; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; }
.renvois { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }

/* Pièces */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer;
  color: var(--text); margin-bottom: 8px;
}
.dropzone span { color: var(--muted); font-size: 13px; font-weight: 400; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--hover); }
.ftag {
  flex-shrink: 0; width: 42px; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 8px 0; border-radius: 6px; background: var(--grey-soft); color: var(--muted);
}
.ftag.pdf { background: var(--red-soft); color: var(--red); }
.ftag.doc { background: var(--grey-soft); color: var(--text); border: 1px solid var(--line); }
.ftag.xls { background: var(--green-soft); color: var(--green); }

/* Dossier verrouillé */
.lock-card { text-align: center; }
.lock-big { font-size: 40px; }
.unlock-form { display: flex; gap: 8px; margin-top: 12px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.segmented button { background: var(--card); border: 0; padding: 9px 14px; cursor: pointer; border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }

/* Calendrier */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h3 { margin: 0 8px; font-size: 18px; text-transform: capitalize; min-width: 150px; font-family: Georgia, serif; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-grid .dow { background: var(--card); text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 0; text-transform: uppercase; letter-spacing: .05em; }
.cal-cell { background: var(--card); min-height: 96px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal-cell:hover { background: var(--hover); }
.cal-cell.other { opacity: .4; }
.cal-cell.today .d { background: var(--accent); color: var(--accent-text); }
.cal-cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-cell .d { font-size: 13px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-ev { font-size: 11.5px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--grey-soft); color: var(--text); border-left: 3px solid var(--grey); }
.cal-ev.Audience { background: var(--red-soft); color: var(--red); border-left-color: var(--red); }
.cal-ev.Échéance { background: var(--orange-soft); color: var(--orange); border-left-color: var(--orange); }
.cal-ev.Rendez-vous { background: var(--green-soft); color: var(--green); border-left-color: var(--green); }
.cal-ev.done { opacity: .55; }
.cal-ev.renvoye { text-decoration: line-through; opacity: .55; background: var(--grey-soft); color: var(--muted); border-left-color: var(--muted); }
.cal-more { font-size: 11px; color: var(--muted); }
.dots { display: none; gap: 3px; justify-content: center; }
.dots i, .legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--grey); }
.dots i.Audience, .legend i.Audience { background: var(--red); }
.dots i.Échéance, .legend i.Échéance { background: var(--orange); }
.dots i.Rendez-vous, .legend i.Rendez-vous { background: var(--green); }
.dots i.renvoye, .legend i.renvoye { background: transparent; border: 1.5px solid var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { width: 9px; height: 9px; margin-right: 6px; vertical-align: 0; }
.cal-tache { font-size: 11px; color: var(--muted); padding: 0 6px; }
/* Agenda perso : vert sauge, distinct des procédures ; confidentiel (n'apparaît que chez son auteur). */
.cal-ev.perso { background: rgba(110, 160, 120, .16); color: #4f8a5b; border-left-color: #6ea078; border-left-style: dashed; }
.jour-sec.perso h4 { display: flex; align-items: center; gap: 8px; }
.jour-sec.perso .perso-plus { margin-left: auto; padding: 2px 10px; font-size: 16px; line-height: 1.2; }
.tache.perso { align-items: center; }
.tache.perso.recue .main .t { font-style: italic; }
.perso-heure { display: flex; flex-direction: column; align-items: flex-end; min-width: 46px; font-weight: 700; font-variant-numeric: tabular-nums; color: #4f8a5b; font-size: 13px; line-height: 1.1; }
.perso-heure small { font-weight: 500; color: var(--muted); font-size: 11px; }
.cats-perso { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cats-perso .chip-choix { padding: 5px 10px; font-size: 13px; }
.btn.perso-btn { border-color: #6ea078; color: #4f8a5b; }
/* Fiche d'une date : intitulé, puis n° du registre, dossier, juridiction ; type en dessous ; état à droite. */
.item.evt .s.ident { color: var(--text); opacity: .85; font-size: 12.5px; line-height: 1.35; }
.item.evt .s.ident.rg { font-weight: 700; letter-spacing: .02em; opacity: 1; }
.item.evt .s.type-ligne { margin-top: 2px; }
.badge.etat { white-space: nowrap; align-self: flex-start; }
.badge.etat.violet { background: rgba(142, 108, 196, .18); color: #8e6cc4; }
.apercu-ident { margin: 6px 0 10px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.suite-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suite-choix .btn { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; text-align: left; white-space: normal; }
.suite-choix .btn small { font-weight: 400; opacity: .8; font-size: 12px; }
@media (max-width: 520px) { .suite-choix { grid-template-columns: 1fr; } }
.choix-chambres .chip-choix small { opacity: .65; font-size: 11px; }
.dots i.tache, .legend i.tache { background: transparent; border-radius: 2px; border: 1.5px solid var(--text); }

/* Agenda : calendrier + tableau du jour */
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.jour-col { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.jour-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.jour-head h3 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 600; }
.jour-nom { text-transform: capitalize; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.moi { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 6px; }
.moi select { flex: 1; padding: 7px 10px; }
.jour-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.jour-sec h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jour-sec h4 small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 12px; margin-left: auto; }
.count { background: var(--grey-soft); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; }
.jour-sec.prive { background: var(--hover); margin-left: -18px; margin-right: -18px; padding: 12px 18px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.avocat-groupe { margin-top: 8px; }
.avocat-nom { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 0 0; }
.alerte { color: var(--red); font-size: 13px; font-weight: 600; margin: 6px 0 2px; }
.petit { font-size: 13px; }
.empty.petit { padding: 12px 4px; text-align: left; }
.tache { display: flex; gap: 10px; align-items: flex-start; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.tache:last-child { border-bottom: 0; }
.tache input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.tache .main { flex: 1; min-width: 0; cursor: pointer; }
.tache .t { font-weight: 500; }
.tache .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tache.faite .t { text-decoration: line-through; color: var(--muted); }
.tache.retard .s { color: var(--red); }
.tache-add { display: flex; gap: 6px; margin-top: 8px; }
.tache-add input { padding: 7px 10px; }
.tache-add input[type=time] { width: 110px; flex-shrink: 0; }

/* Équipe, délais, tâches de dossier */
.equipe-choix { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.equipe-choix legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.equipe-choix label.check { color: var(--text); font-weight: 400; font-size: 14px; }
.delai-resultat { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.delai-date { font-size: 14px; }
.delai-date b { font-family: Georgia, serif; font-size: 22px; }
.td-add { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 6px; margin-top: 10px; }
.td-add input, .td-add select { padding: 7px 10px; width: auto; min-width: 0; }
.table-delais { display: flex; flex-direction: column; gap: 4px; overflow-x: auto; }
.td-ligne { display: grid; grid-template-columns: 26px minmax(200px, 1.4fr) 70px 90px 50px minmax(220px, 2fr); gap: 8px; align-items: center; min-width: 720px; }
.td-ligne input, .td-ligne select { padding: 6px 8px; }
.td-ligne input[type=checkbox] { width: 16px; height: 16px; justify-self: center; accent-color: var(--accent); }
.td-entete { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.td-lib { font-size: 14px; }
.td-lib small { display: block; font-size: 11px; }

.groupe-champs { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
.groupe-champs legend { font-size: 13px; font-weight: 600; color: var(--text); padding: 0 4px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { border: 1px dashed var(--line); background: var(--card); border-radius: 999px; padding: 5px 10px; font-size: 13px; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--accent); }
.rt-liste { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rt-ligne { display: grid; grid-template-columns: 1fr 160px 140px 100px 32px; gap: 6px; align-items: center; }
.rt-ligne.ligne-tache:not(:has(select)) { grid-template-columns: 1fr 140px 100px 32px; }
.rt-ligne input, .rt-ligne select { padding: 7px 9px; min-width: 0; }
@media (max-width: 860px) {
  .rt-ligne, .rt-ligne.ligne-tache:not(:has(select)) { grid-template-columns: 1fr 1fr 32px; }
  .rt-ligne > :first-child { grid-column: 1 / -1; }
}

/* Saisie proposée */
.ac-parent { position: relative; }
.ac-liste {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60; margin-top: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
  max-height: 260px; overflow: auto; text-align: left;
}
.ac-item { padding: 9px 12px; cursor: pointer; font-size: 14px; color: var(--text); font-weight: 400; display: flex; justify-content: space-between; gap: 10px; }
.ac-item small { color: var(--muted); white-space: nowrap; }
.ac-item:hover, .ac-item.actif { background: var(--hover); }
.ac-aide { padding: 6px 12px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.ac-wrap { display: block; min-width: 0; }
.ac-wrap > input { width: 100%; }
.tache-add > .ac-wrap { flex: 1; }
.verif { width: min(460px, 94vw); }
.verif .verif-corps { padding: 16px 20px; font-size: 15px; }
.verif-fautes { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.verif-boutons { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.verif-boutons .btn { justify-content: center; }
.aide-delai { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* Saisie rapide */
.saisie-rapide { display: flex; gap: 8px; margin-bottom: 8px; }
.saisie-rapide > .ac-wrap { flex: 1; }
.saisie-rapide input { font-size: 16px; padding: 12px 14px; border-radius: 10px; }
.qa-apercu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; min-height: 0; }
.qa-apercu:empty { display: none; }
.qa-apercu .chip { border-style: solid; cursor: default; }
.qa-apercu .chip.on { cursor: pointer; background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.qa-apercu .chip small { color: inherit; opacity: .75; }
.qa-titre { font-size: 13.5px; color: var(--muted); }
#tAide { margin: 6px 0 0; }

/* Archivage des pièces */
.bandeau-archive { background: var(--orange-soft); color: var(--text); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.archivees { margin-top: 10px; }
.archivees summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.etapes { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* Répertoire des contacts */
.filtres-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filtres-types .chip { border-style: solid; }
.filtres-types .chip.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.filtres-types .chip small { opacity: .7; margin-left: 2px; }
.lettre { font-family: Georgia, serif; font-weight: 600; color: var(--muted); padding: 10px 4px 2px; border-bottom: 1px solid var(--line); }
.item.contact .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grey-soft); display: grid; place-items: center; flex-shrink: 0; font-size: 16px; }
.actions-contact { display: flex; gap: 4px; flex-shrink: 0; }
.contact-btn { text-decoration: none; }
.link-fiche { background: none; border: 0; cursor: pointer; padding: 0 2px; font-size: 15px; }
#dConflit .warn ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 860px) {
  .actions-contact .contact-btn { padding: 6px 8px; }
}

/* Installation de l'application */
.install-bandeau {
  position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 120; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.install-bandeau img { border-radius: 10px; flex-shrink: 0; }
.install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.install-txt .link { align-self: flex-start; font-size: 13px; color: var(--muted); }
.install-entete { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.install-entete img { border-radius: 14px; }
.lien-copie { font-family: Consolas, monospace; background: var(--hover); padding: 8px 10px; border-radius: 8px; word-break: break-all; user-select: all; }
.ico-partage { display: inline-block; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 4px; font-size: 13px; }
@media (max-width: 860px) {
  .install-bandeau { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.locked .install-bandeau { bottom: 16px; }
}

/* Parquet / police */
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.cal-ev.Parquet { background: var(--violet-soft); color: var(--violet); border-left-color: var(--violet); }
.dots i.Parquet, .legend i.Parquet { background: var(--violet); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.cal-ev.Extrajudiciaire { background: var(--gold-soft); color: var(--gold); border-left-color: var(--gold); }
.dots i.Extrajudiciaire, .legend i.Extrajudiciaire { background: var(--gold); }
.cal-ev.Pénitentiaire, .cal-ev.Greffe { background: var(--grey-soft); color: var(--grey); border-left-color: var(--grey); }
.dots i.Pénitentiaire, .dots i.Greffe, .legend i.Greffe { background: var(--grey); }
.badge.matiere { background: var(--text); color: var(--bg); }

/* Assistant pas à pas */
.fil-etapes { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 18px; counter-reset: e; }
.fil-etapes li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; position: relative; font-size: 12px; color: var(--muted); text-align: center; }
.fil-etapes li::before { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.fil-etapes li:first-child::before { display: none; }
.fil-etapes li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); font-weight: 700; z-index: 1; }
.fil-etapes li.fait span { background: var(--green); border-color: var(--green); color: #fff; }
.fil-etapes li.fait::before, .fil-etapes li.actuelle::before { background: var(--accent); }
.fil-etapes li.actuelle span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.fil-etapes li.actuelle em { color: var(--text); font-weight: 600; }
.fil-etapes em { font-style: normal; }
.assistant-corps .question { font-family: Georgia, serif; font-size: 21px; font-weight: 600; margin: 0 0 6px; }
.assistant-corps .aide { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.titre-champ { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-choix { border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.chip-choix:hover { border-color: var(--muted); }
.chip-choix.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.etiquettes { border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.etiquettes-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.etiquettes-liste:empty { display: none; }
.etiquettes input { border: 0; padding: 6px; }
.etiquettes input:focus { outline: none; }
.etiquette { display: inline-flex; align-items: center; gap: 6px; background: var(--grey-soft); color: var(--text); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13.5px; }
.etiquette button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; }
.etiquette.lecture { padding: 3px 10px; margin: 2px 0; }
.champ-tel { display: flex; gap: 6px; align-items: center; position: relative; }
.champ-tel > input, .champ-tel > .ac-wrap { flex: 1; min-width: 0; }
.partie { display: grid; grid-template-columns: 130px 150px 1fr 130px 1fr 32px; gap: 6px; align-items: center; margin-bottom: 8px; }
.partie input, .partie select { padding: 7px 9px; min-width: 0; }
.plus-options { margin-top: 12px; }
.plus-options summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.liste-dossiers { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 46vh; overflow: auto; }
.dossier-choix { text-align: left; border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.dossier-choix:hover { border-color: var(--muted); }
.dossier-choix.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dossier-choix small { color: var(--muted); }
.rappel-dossier { background: var(--hover); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 14px; }

/* Aperçus */
.apercu-tete h2 { font-family: Georgia, serif; font-size: 22px; margin: 0 0 6px; }
.apercu-tete h2.barre { text-decoration: line-through; opacity: .6; }
.apercu-date { margin: 0 0 10px; color: var(--muted); text-transform: none; }
.apercu-date::first-letter { text-transform: uppercase; }
.apercu-kv { margin-top: 12px; }
.apercu-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.apercu-cases > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.apercu-cases small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.apercu-cases b { font-size: 15.5px; }
.apercu-cases span { color: var(--muted); font-size: 13px; }

/* Accueil */
.salut { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(120deg, #2b1c13 0%, #3d2919 55%, #2b1c13 100%); color: #f3e6cc;
  border: 1px solid #4a3424; border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; position: relative; overflow: hidden; }
.salut::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 92% 20%, rgba(231, 200, 134, .22), transparent 45%); pointer-events: none; }
.salut b { font-family: Georgia, serif; font-size: 19px; display: block; color: #ecd3a0; }
.salut span { color: #d9c7a6; font-size: 14px; }
.salut .badge { position: relative; z-index: 1; }
.salut span::first-letter { text-transform: uppercase; }
.prochaine-etape { background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 8px; padding: 10px 14px; margin: -4px 0 16px; font-size: 14.5px; }

@media (max-width: 860px) {
  .partie { grid-template-columns: 1fr 1fr 32px; }
  .partie > .champ-tel { grid-column: 1 / -1; }
  .fil-etapes em { font-size: 10.5px; }
  .apercu-cases { grid-template-columns: 1fr 1fr; }
  #modalFooter .btn { flex: 1 1 auto; justify-content: center; }
}

/* Membres */
.demandes { background: var(--orange-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 6px; }
.demandes h4, #carteMembres h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
.demandes .item { border-bottom-color: color-mix(in srgb, var(--orange) 25%, transparent); }
.demandes .item:hover { background: transparent; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* Préférences de rappel */
.prefs { display: flex; flex-direction: column; gap: 12px; }
.pref-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pref-ligne input[type=time] { width: 120px; }
.prefs label.check { color: var(--text); font-size: 14px; font-weight: 400; }
.etat-notif { font-size: 14px; margin: 0 0 10px; }
.etat-notif.ok { color: var(--green); }
.etat-notif.err { color: var(--red); }

/* Modale */
dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(640px, 94vw);
  background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
dialog h2 { margin: 0; font-size: 18px; font-family: Georgia, serif; font-weight: 600; }
#modalBody { padding: 18px 20px; max-height: 70vh; overflow: auto; }
dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px);
  background: var(--accent); color: var(--accent-text); padding: 11px 18px; border-radius: 8px;
  transition: transform .25s; z-index: 150; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw;
}
#toast.show { transform: translateX(-50%) translateY(0); }

.only-mobile { display: none; }

/* Statut de synchronisation */
.title-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sync-badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--grey-soft); color: var(--muted); }
.sync-badge.ok { background: var(--green-soft); color: var(--green); }
.sync-badge.off { background: var(--orange-soft); color: var(--orange); }
.sync-badge.err { background: var(--red-soft); color: var(--red); }

/* Écran de connexion */
#login {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at top, #3a271b 0%, #1a110c 60%, #0e0906 100%);
}
#login[hidden] { display: none; }
body.locked .sidebar, body.locked main { visibility: hidden; }
.login-card {
  width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.12); text-align: center;
}
.login-card img { align-self: center; }
.login-logo { width: 190px; max-width: 70%; height: auto; filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 600; }
.login-card h2 { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--muted); }
.login-card label { text-align: left; }
.login-card .btn { justify-content: center; padding: 12px; }
.login-card .link { color: var(--muted); }
#loginMsg { margin: 0; color: var(--red); font-size: 14px; min-height: 1em; }
#loginMsg.ok { color: var(--green); }
.login-info { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); background: var(--hover); padding: 12px; border-radius: 8px; text-align: left; }
.login-card [hidden] { display: none !important; }
.login-card small { color: var(--muted); }
/* « Continuer avec Google » : bouton blanc aux couleurs de Google, seul moyen de connexion visible. */
.login-card .btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; gap: 12px; font-weight: 600; font-size: 16px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.login-card .btn.google:hover { background: #f8f9fa; }
.login-card .login-aide { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }
.login-card .link.discret { font-size: 12px; opacity: .55; }

/* ---------- Mobile ---------- */
@media (max-width: 1180px) and (min-width: 861px) {
  .agenda-layout { grid-template-columns: minmax(0, 1fr) 330px; }
  .cal-cell { min-height: 80px; }
}

@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; width: 100%;
    border-right: 0; border-top: 1px solid var(--side-line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 20; flex-direction: row;
  }
  .brand, .install { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; flex: 1; text-align: center; }
  .nav .ic { font-size: 19px; }
  main { padding: 16px 16px 96px; }
  .topbar h1 { font-size: 21px; }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .agenda-layout { grid-template-columns: minmax(0, 1fr); }
  .jour-col { position: static; max-height: none; overflow: visible; }
  .cal-cell .cal-tache { display: none; }
  .cal-cell { min-height: 52px; padding: 4px 2px; align-items: center; }
  .cal-cell .cal-ev, .cal-cell .cal-more { display: none; }
  .dots { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .td-add { grid-template-columns: 1fr 1fr; }
  .td-add > :first-child { grid-column: 1 / -1; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .only-desktop { display: none; }
  .only-mobile { display: block; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  #toast { bottom: auto; top: calc(8px + env(safe-area-inset-top)); transform: translateX(-50%) translateY(-140%); font-size: 13.5px; padding: 9px 14px; pointer-events: none; }
  #toast.show { transform: translateX(-50%) translateY(0); }
}

/* ---------- Identité MKA : finitions ---------- */
.topbar-logo { display: none; }
.topbar h1 { color: var(--text); }
.card h3 { font-family: Georgia, serif; font-size: 16.5px; font-weight: 600; }
.card h3 small { font-family: system-ui, sans-serif; font-weight: 400; }
.sidebar { box-shadow: inset -1px 0 0 rgba(0,0,0,.2); }
.badge.matiere { background: var(--gold-soft); color: var(--gold); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--gold) 55%, transparent); outline-offset: 0; border-color: var(--gold); }
.chip-choix.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.fil-etapes .on b, .fil-etapes .fait b { background: var(--gold); border-color: var(--gold); color: #1a120d; }
.cal-cell.today .d { background: var(--gold); color: #1a120d; }
.cal-voir { width: auto; margin-left: auto; font-weight: 600; }
.item.reserve { opacity: .78; }
.item.reserve .t::after { content: " 👁"; font-size: 12px; }
.s.motifs { color: var(--gold); font-weight: 500; }

/* Renvoi */
.renvoi-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.renvoi-tete small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.renvoi-tete b { font-family: Georgia, serif; font-size: 16px; }
.renvoi-tete span { color: var(--gold); font-weight: 600; font-size: 14px; }
#rvDelib { background: var(--hover); border-radius: 8px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Vidéo d'ouverture */
.intro { position: fixed; inset: 0; z-index: 300; background: #0e0906; display: grid; place-items: center; transition: opacity .6s ease; }
.intro video { width: 100%; height: 100%; object-fit: cover; }
.intro::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(14, 9, 6, .85) 100%); }
.intro.fin { opacity: 0; pointer-events: none; }
.intro-passer { position: absolute; z-index: 2; right: 18px; bottom: calc(22px + env(safe-area-inset-bottom)); background: rgba(14, 9, 6, .55);
  color: #ecd3a0; border: 1px solid rgba(236, 211, 160, .4); border-radius: 999px; padding: 8px 16px; font-size: 14px; cursor: pointer; backdrop-filter: blur(4px); }

/* Verrouillage par empreinte */
.bio-lock { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at top, #3a271b 0%, #1a110c 60%, #0e0906 100%); }
.bio-carte { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: #e8d6b4; width: min(340px, 100%); }
.bio-carte p { margin: 0; font-family: Georgia, serif; font-size: 18px; }
.bio-carte .btn.primary { background: linear-gradient(135deg, #e7c886, #b8904a); color: #1a120d; border: 0; padding: 14px 28px; font-size: 16px; width: 100%; justify-content: center; }
.bio-carte small { color: #b9a688; }
.bio-carte .link { color: #b9a688; }
body.verrou-bio .sidebar, body.verrou-bio main { visibility: hidden; }

@media (max-width: 860px) {
  .topbar-logo { display: block; height: 30px; width: auto; margin-right: 4px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
  :root:not([data-theme="sombre"]) .topbar-logo { filter: drop-shadow(0 0 1px #2b1c13) drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
  .title-wrap { display: flex; align-items: center; gap: 8px; }
  .salut { padding: 14px; }
  .cal-voir { margin-left: 0; width: 100%; }
}
/* ---------- Actions du dossier ---------- */
.actions-dossier { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 4px 0 16px; }
.actions-dossier .action.claude span { color: #c96442; }
.actions-dossier .action { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; color: var(--text); box-shadow: var(--shadow); }
.actions-dossier .action span { font-size: 20px; color: var(--gold); line-height: 1; }
.actions-dossier .action:hover { border-color: var(--gold); background: var(--gold-soft); }
#modalBody .actions-dossier { margin: 0 0 14px; }

/* Régimes (classique / exception / extrajudiciaire) et passages */
.regimes, .passages { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.regime, .passage { text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border-radius: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--text); }
.regime small, .passage small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.regime.on { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.passage:hover { border-color: var(--gold); background: var(--gold-soft); }
.passage b { font-family: Georgia, serif; font-size: 15px; }

/* Devoirs à cocher */
.devoirs-liste { display: flex; flex-direction: column; gap: 4px; }
.devoir { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; font-size: 14px; color: var(--text); }
.devoir:hover { background: var(--hover); }
.devoir .dv-date { width: 150px; padding: 5px 8px; font-size: 13px; }
.devoir input[type=checkbox]:not(:checked) ~ span { color: var(--muted); text-decoration: line-through; }
.chip.tout { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* Parties : camp visible d'un coup d'œil */
.partie.nous { border-left: 3px solid var(--green); padding-left: 8px; }
.partie.adverse { border-left: 3px solid var(--red); padding-left: 8px; }

/* Frise du parcours */
.frise { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.frise::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.frise li { position: relative; padding: 0 0 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.frise li::before { content: ""; position: absolute; left: -18px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--gold); }
.frise li.depart::before { background: var(--gold); }
.frise li b { font-size: 14.5px; }
.frise li span { color: var(--muted); font-size: 13.5px; }
.frise li small { color: var(--gold); font-size: 12.5px; }
.frise li.vide::before { border-color: var(--line); }

@media (max-width: 860px) {
  .actions-dossier { gap: 5px; }
  .actions-dossier .action { padding: 10px 2px; font-size: 11.5px; }
  .actions-dossier .action span { font-size: 18px; }
  .devoir { grid-template-columns: 22px 1fr; }
  .devoir .dv-date { grid-column: 2; width: 100%; }
}
/* OneDrive */
.onedrive-barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.btn.onedrive { background: #0f6cbd; border-color: #0f6cbd; color: #fff; text-decoration: none; }
.ftag.onedrive { background: #e6f0fa; color: #0f6cbd; }

/* Documents versés et résumés */
.resume-doc .kv { margin-top: 6px; }
.dispositif { margin: 8px 0 0; padding: 10px 12px; background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 6px; font-size: 13.5px; line-height: 1.5; max-height: 220px; overflow: auto; }
.resume-dossier .resume-cadre { font-family: Georgia, serif; font-size: 15.5px; line-height: 1.5; margin-top: 0; }
.resume-dossier h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); display: flex; gap: 8px; align-items: center; }
.resume-dossier ul { margin: 0; padding-left: 18px; line-height: 1.55; }
.depot-voile { display: none; position: fixed; inset: 12px; z-index: 400; border: 3px dashed var(--gold); border-radius: 18px; background: rgba(26, 18, 13, .82);
  color: #ecd3a0; font: 600 20px Georgia, serif; place-items: center; text-align: center; padding: 20px; pointer-events: none; }
body.depot .depot-voile { display: grid; }
/* Paramètres en rubriques */
.rubriques { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
.rubrique { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.rubrique.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.rubrique.admin { border-style: dashed; border-color: var(--gold); }
.rubrique.admin.on { border-style: solid; }
.rubrique-titre { font-family: Georgia, serif; font-size: 20px; margin: 6px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.rubrique-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* Liens du dossier */
.liens-dossier { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -6px 0 16px; }
.lien-dossier { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px dashed var(--line); background: transparent;
  color: var(--muted); font-size: 13.5px; cursor: pointer; text-decoration: none; }
.lien-dossier.on { border-style: solid; color: var(--text); background: var(--card); font-weight: 600; }
.lien-dossier.on.onedrive span { color: #0f6cbd; } .lien-dossier.on.gdrive span { color: #188038; } .lien-dossier.on.claudeProjet span { color: #c96442; }
.lien-dossier small { color: var(--gold); }
.ftag.gdrive { background: #e6f4ea; color: #188038; }
.carte-claude { border-left: 3px solid #c96442; }

@media (max-width: 860px) {
  .btn .lbl { display: none; }
  .rubrique-titre { font-size: 18px; }
}
/* Paramètres : liste verticale */
.liste-reglages { padding: 4px; display: flex; flex-direction: column; max-width: 640px; }
.reglage { display: grid; grid-template-columns: 38px 1fr 18px; align-items: center; gap: 12px; padding: 13px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); text-align: left; cursor: pointer; border-radius: 8px; }
.reglage:last-child { border-bottom: 0; }
.reglage:hover { background: var(--hover); }
.reglage .ic { font-size: 20px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--gold-soft); }
.reglage .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reglage .txt b { font-size: 15px; } .reglage .txt small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reglage .fl { color: var(--muted); font-size: 22px; }
.reglage.admin { margin-top: 8px; border-top: 1px dashed var(--gold); }
.reglage.admin .ic { background: var(--accent); color: var(--accent-text); }
.retour-reglages { display: inline-block; margin-bottom: 4px; color: var(--muted); }
/* Très petites icônes (imprimer, verser, Claude) */
.btn.mini { padding: 4px 7px; font-size: 13px; min-width: 0; line-height: 1; border-radius: 7px; }
/* =====================================================================
   Refonte 2026-11 : un seul langage visuel, boutons compacts, icônes.
   ===================================================================== */
:root { --r: 12px; --h-btn: 36px; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; letter-spacing: .005em; }
main { max-width: 1240px; }

/* Boutons : une hauteur, un rayon, des icônes nettes */
.btn { min-height: var(--h-btn); padding: 0 14px; border-radius: 10px; font-size: 14px; gap: 6px; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.mini { min-height: 28px; width: 28px; padding: 0; justify-content: center; font-size: 14px; border-radius: 8px; }
.btn.primary { box-shadow: 0 2px 8px -4px rgba(0,0,0,.35); }
.btn.ajout { border-style: dashed; color: var(--muted); background: transparent; margin-top: 4px; }
.btn.ajout:hover { color: var(--text); border-color: var(--gold); }
.icon-btn.mini { font-size: 11px; font-weight: 700; padding: 4px 6px; }
#modalFooter .btn { min-height: 40px; }

/* Cartes */
.card { border-radius: var(--r); padding: 18px 18px 16px; }
.card h3 { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.grid.two { gap: 14px; }

/* En-tête du dossier : titre, résumé, liens en icônes */
.detail-head { align-items: flex-start; margin-bottom: 12px; }
.detail-head h2 { font-family: Georgia, serif; font-size: 24px; margin: 2px 0 2px; line-height: 1.2; }
.lien-resume { background: none; border: 0; padding: 2px 0; color: var(--gold); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.badges-cadre { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.liens-dossier { margin: 0; gap: 6px; flex-wrap: nowrap; }
.lien-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px dashed var(--line); background: transparent; color: var(--muted); opacity: .75; }
.lien-ic.on { border-style: solid; background: var(--card); opacity: 1; box-shadow: var(--shadow); }
.lien-ic.on.onedrive { border-color: #0f6cbd; } .lien-ic.on.gdrive { border-color: #188038; } .lien-ic.on.claudeProjet { border-color: #c96442; color: #c96442; }
.lien-ic.lier { border-style: solid; opacity: 1; }
.lien-ic:hover { opacity: 1; border-color: var(--gold); }

/* Barre d'actions : compacte, une ligne */
.actions-dossier { gap: 6px; margin: 0 0 16px; }
.actions-dossier .action { flex-direction: row; justify-content: center; gap: 7px; padding: 9px 8px; font-size: 13.5px; border-radius: 10px; box-shadow: none; }
.actions-dossier .action span { font-size: 15px; }
.lier-claude { display: block; width: 100%; margin: 16px 0 0; padding: 12px; border-radius: var(--r); border: 1px dashed #c9644277; background: transparent;
  color: #c96442; font-weight: 600; font-size: 14px; cursor: pointer; }
.lier-claude:hover { background: #c964420f; }
.etiquette.demande { background: var(--green-soft); color: var(--green); }

/* Formulaires de l'assistant */
.groupe-champs { border-radius: var(--r); padding: 12px 14px 14px; }
.groupe-champs legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.bloc-nous { border-left: 3px solid var(--green); }
.bloc-adverse { border-left: 3px solid var(--red); }
.liste-parties { margin-top: 10px; }
.partie { grid-template-columns: minmax(0, 1.3fr) 150px 150px minmax(0, 1fr) 32px; border-left: 0 !important; padding-left: 0 !important; }
.partie.nous { grid-template-columns: minmax(0, 1.3fr) 150px 150px 32px; }
.partie.siege { grid-template-columns: 170px minmax(0, 1fr) 150px 32px; }
.bloc-juridiction { margin-top: 12px; }
.deroulant { background: var(--card); }
.deroulant input { background: transparent; }
.deroulant input::placeholder { color: var(--gold); opacity: .9; }
.ac-liste { max-height: 280px; overflow-y: auto; }

/* Tuiles (liens en icônes) */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tuile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--text); text-decoration: none; cursor: pointer; font: inherit; }
.tuile .ic { font-size: 22px; line-height: 1; } .tuile .ic.od { color: #0f6cbd; }
.tuile b { font-size: 12.5px; font-weight: 600; text-align: center; }
.tuile:hover, .tuile.on { border-color: var(--gold); background: var(--gold-soft); }

/* Profil en liste verticale */
.profil { display: flex; flex-direction: column; }
.profil-ligne { display: grid; grid-template-columns: 28px 150px 1fr; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.profil-ligne:last-child { border-bottom: 0; }
.profil-ligne .ic { text-align: center; color: var(--gold); }
.profil-ligne .lib { color: var(--muted); font-size: 13px; }
.profil-ligne input { border: 0; background: transparent; padding: 6px 4px; }
.profil-ligne input:focus { background: var(--hover); border-radius: 6px; }
.profil-ligne input[readonly] { color: var(--muted); }

@media (max-width: 860px) {
  .detail-head { flex-direction: column; gap: 8px; }
  .detail-head h2 { font-size: 20px; }
  .actions-dossier { display: grid; grid-auto-flow: column; }
  .actions-dossier .action { flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 11px; }
  .actions-dossier .action span { font-size: 17px; }
  .partie, .partie.nous, .partie.siege { grid-template-columns: 1fr 1fr 32px; }
  .partie > .champ-tel { grid-column: 1 / -1; }
  .profil-ligne { grid-template-columns: 24px 1fr; }
  .profil-ligne input { grid-column: 2; padding-top: 0; }
  .tuiles { grid-template-columns: repeat(3, 1fr); }
}
.alerte-creneau { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--orange-soft); color: var(--text); border-left: 3px solid var(--orange); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Listes déroulantes à cases à cocher ---------- */
.coches { position: relative; margin-top: 6px; }
.coches-bouton { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.coches-bouton:hover { border-color: var(--gold); }
.coches.vide .coches-resume { color: var(--muted); }
.coches-fl { color: var(--gold); font-size: 12px; }
.coches-panneau { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 14px 34px -10px rgba(0,0,0,.35); padding: 8px; }
.coches-filtre { width: 100%; margin-bottom: 6px; }
.coches-liste { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.coche { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 400; color: var(--text); margin: 0; }
.coche:hover { background: var(--hover); }
.coche input { width: 18px; height: 18px; flex-shrink: 0; margin: 0; accent-color: var(--gold); }
.coche.ajout { border: 1px dashed var(--gold); background: var(--gold-soft); color: var(--text); font: inherit; text-align: left; margin-bottom: 4px; }
.coches-pied { display: flex; justify-content: flex-end; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 6px; }
.coches-choisis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.coches-choisis:empty { display: none; }

/* Parties en blocs complets */
.partie.bloc { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--hover); }
.partie.bloc.nous { border-left: 3px solid var(--green) !important; padding-left: 12px !important; }
.partie.bloc.adverse { border-left: 3px solid var(--red) !important; padding-left: 12px !important; }
.partie-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 13.5px; }

/* Changement de juridiction par phase */
.phase-groupe { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin-bottom: 8px; }
.phase-groupe summary { cursor: pointer; padding: 8px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.phase-groupe summary small { color: var(--muted); }
.phase-groupe[open] { padding-bottom: 12px; }
.passage.ph-prej { border-left: 3px solid var(--violet); }
.passage.ph-jur { border-left: 3px solid var(--gold); }
.passage.ph-extra { border-left: 3px solid var(--green); }
#bioOuvrir[hidden] { display: none !important; }
/* Cases à cocher : toujours devant le mot, alignées à gauche (partout) */
.coche, label.check, .devoir, .tuile, .regime { text-align: left; }
.coche { flex-direction: row !important; justify-content: flex-start; align-items: center; }
.coche input, label.check input, .devoir input[type=checkbox], .coche input[type=radio] { width: 18px !important; min-width: 18px; height: 18px; margin: 0; flex: 0 0 18px; }
.coche span { flex: 1; min-width: 0; }
label.check { flex-direction: row !important; justify-content: flex-start; align-items: center; }
.devoir { justify-items: start; }
.partage .lien-recu { word-break: break-all; background: var(--hover); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.fichiers-recus { padding-left: 18px; }
.choix-recu { display: flex; flex-direction: column; gap: 6px; }

/* Secours quand le téléphone ne renvoie pas le contact */
.secours-contact { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 500; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--card); color: var(--text); border: 1px solid var(--gold); border-radius: 14px; padding: 14px; box-shadow: 0 16px 40px -10px rgba(0,0,0,.5); }
.secours-contact > div:first-child { flex: 1 1 220px; display: flex; flex-direction: column; gap: 3px; font-size: 14px; padding-right: 26px; }
.secours-contact span { color: var(--muted); font-size: 13px; }
.secours-contact .btn { flex-direction: row; }
.secours-contact .etapes-partage { margin: 4px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.secours-contact .etapes-partage b { color: var(--text); }
.secours-contact .secours-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.secours-contact .fermer { position: absolute; top: 8px; right: 8px; }
