/* ============================================================
   Agent Comités & Conseils Municipaux — Mairie de Livry-Gargan
   Design tokens et composants issus de la maquette validée
   (canvas « Agent Comités & Conseils Municipaux.dc.html »)
   Mode clair par défaut (N-13).
   ============================================================ */

:root {
  --header: #0D3B5C;
  --primary: #1B4F72;
  --primary-tint: #E8F0F6;
  --link: #2980B9;
  --green: #27AE60;
  --green-bright: #58D68D;
  --green-dark: #1E8449;
  --green-tint: #E9F7EF;
  --orange: #E67E22;
  --orange-dark: #B9770E;
  --orange-deep: #7E5109;
  --orange-tint: #FEF5E7;
  --orange-bg: #FEF9F3;
  --orange-border: #F0D9B5;
  --orange-border-2: #E0C08C;
  --orange-hl: #FCEFDC;
  --red: #E74C3C;
  --red-dark: #C0392B;
  --red-tint: #FDEDEC;
  --text: #2C3E50;
  --muted: #6C757D;
  --faint: #9AA5AE;
  --border: #E9ECEF;
  --border-strong: #D6DBE0;
  --border-soft: #F1F3F5;
  --border-dash: #CBD3DA;
  --bg: #F8F9FA;
  --chip: #F4F6F7;
  --card: #FFFFFF;
  --row-hint: #FCFDFE;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  min-height: 100vh;
}

button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); color: var(--text); }
a { color: var(--link); text-decoration: none; }

/* ---------- Barre d'en-tête ---------- */

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 58px;
  background: var(--header); color: #fff;
  position: sticky; top: 0; z-index: 30;
}
.topbar__logo { height: 30px; width: auto; display: block; }
.topbar__back {
  width: 30px; height: 30px; border-radius: 6px; flex: none;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.topbar__back:hover { background: rgba(255,255,255,.18); }
.topbar__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar__title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__subtitle { font-size: 11px; color: rgba(255,255,255,.62); white-space: nowrap; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__pill {
  display: flex; align-items: center; gap: 7px; padding: 5px 11px;
  border-radius: 20px; background: rgba(255,255,255,.10);
  font-size: 11.5px; color: rgba(255,255,255,.88); white-space: nowrap;
}
.topbar__note { font-size: 11.5px; color: rgba(255,255,255,.7); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot--green { background: var(--green-bright); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--link);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; color: #fff; flex: none;
}

/* ---------- Structure générale ---------- */

.layout { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }

.sidebar {
  width: 224px; flex: none; background: var(--card);
  border-right: 1px solid var(--border);
  padding: 18px 0; display: flex; flex-direction: column; gap: 4px;
}
.sidebar__section {
  padding: 6px 18px 8px; font-size: 10px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint); font-weight: 600;
}
.sidebar__section + .sidebar__section,
.sidebar__item + .sidebar__section { padding-top: 16px; }
.sidebar__item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 10px; padding: 9px 12px; border-radius: 6px;
  color: var(--text); font-size: 13px; border: 0; background: none;
  text-align: left; width: calc(100% - 20px);
}
.sidebar__item:hover { background: var(--bg); }
.sidebar__item.is-active {
  background: var(--primary); color: #fff; font-weight: 600;
  justify-content: flex-start;
}
.sidebar__item.is-active:hover { background: var(--primary); }
.sidebar__item.is-active .dot { margin-right: 4px; }
.sidebar__count { font-size: 11px; color: var(--muted); }
.sidebar__item.is-active .sidebar__count { color: rgba(255,255,255,.7); }
.badge-late {
  font-size: 11px; background: var(--red-tint); color: var(--red-dark);
  padding: 1px 7px; border-radius: 10px; white-space: nowrap;
}
.sidebar__footer {
  margin-top: auto; padding: 14px 18px 0; border-top: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar__footer button {
  font-size: 11.5px; color: var(--muted); background: none; border: 0;
  text-align: left; padding: 0;
}
.sidebar__footer button:hover { color: var(--text); }

.main { flex: 1; padding: 24px 26px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- Typo & briques ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head__titles { display: flex; flex-direction: column; gap: 4px; }
.page-title { font-size: 20px; font-weight: 600; color: var(--text); }
.page-title--sm { font-size: 17px; }
.page-subtitle { font-size: 12.5px; color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title { font-size: 13.5px; font-weight: 600; color: var(--text); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.card--pad { padding: 18px; }
.card--hidden { overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 6px; font-size: 12.5px;
  border: 1px solid var(--border-strong); background: var(--card); color: var(--text);
}
.btn:hover { background: var(--bg); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn--primary:hover { background: #163F5C; }
.btn--success { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn--success:hover { background: #219653; }
.btn--sm { padding: 6px 12px; font-size: 11.5px; border-radius: 5px; }
.btn--xs { padding: 4px 10px; font-size: 11px; border-radius: 5px; }
.btn--warn-outline { border-color: var(--orange-border-2); color: var(--orange-deep); background: var(--card); }
.btn--warn-outline:hover { background: var(--orange-bg); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi__label { font-size: 11.5px; color: var(--muted); }
.kpi__value { font-size: 26px; font-weight: 600; color: var(--text); }
.kpi__value--red { color: var(--red); }
.kpi__value--orange { color: var(--orange); }
.kpi__value--green { color: var(--green); }
.kpi__hint { font-size: 11.5px; color: var(--muted); }
.kpi__hint--green { color: var(--green); }
.kpi--accent-primary { border-left: 3px solid var(--primary); }
.kpi--accent-link { border-left: 3px solid var(--link); }
.kpi--accent-red { border-left: 3px solid var(--red); }
.kpi--accent-orange { border-left: 3px solid var(--orange); }

.tag {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
.tag--copil { color: var(--primary); background: var(--primary-tint); }
.tag--cosui { color: var(--green-dark); background: var(--green-tint); }
.tag--strat { color: var(--orange-dark); background: var(--orange-tint); }
.tag--them { color: var(--muted); background: var(--chip); }

.pill {
  font-size: 11px; padding: 3px 9px; border-radius: 10px; white-space: nowrap;
}
.pill--orange { background: var(--orange-tint); color: var(--orange-dark); }
.pill--blue { background: var(--primary-tint); color: var(--primary); }
.pill--grey { background: var(--chip); color: var(--muted); }
.pill--red { background: var(--red-tint); color: var(--red-dark); }
.pill--green { background: var(--green-tint); color: var(--green-dark); }

.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 4px;
  background: var(--chip); color: var(--text); white-space: nowrap;
}
.chip--warn { background: var(--orange-tint); color: var(--orange-dark); }

.meter { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 3px; }
.meter__fill--green { background: var(--green); }
.meter__fill--orange { background: var(--orange); }

.hint-dashed {
  border: 1px dashed var(--border-dash); border-radius: 8px;
  padding: 12px 14px; font-size: 11.5px; color: var(--muted); line-height: 1.5;
}

.callout-warn {
  border-left: 3px solid var(--orange); background: var(--orange-bg);
  padding: 12px 14px; font-size: 11.5px; color: var(--orange-deep); line-height: 1.55;
}

.divider { height: 1px; background: var(--border-soft); border: 0; margin: 0; }

/* ---------- Tableaux ---------- */

.thead-row {
  display: grid; gap: 14px; padding: 12px 18px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600;
}
.trow { display: grid; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--border-soft); align-items: center; }
.trow:last-child { border-bottom: 0; }
.trow__title { font-size: 13px; font-weight: 600; color: var(--text); }
.trow__sub { font-size: 11.5px; color: var(--muted); }
.link-btn { background: none; border: 0; font-size: 11.5px; color: var(--link); padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Listes de décision ---------- */

.decision { display: flex; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.decision:last-child { border-bottom: 0; }
.decision__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }
.decision__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.decision__title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.decision__text { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.decision__actions { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap; }

.jalons-list .jalon {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 16px; font-size: 12px; color: var(--text);
}
.jalon span:last-child { color: var(--muted); white-space: nowrap; }

/* ---------- Wizard ---------- */

.wizard-steps {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 20px 26px; display: flex; align-items: center;
}
.wstep {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 0; text-align: left;
}
.wstep__num {
  width: 28px; height: 28px; border-radius: 50%;
  font-size: 12.5px; font-weight: 600; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border-strong); color: var(--faint);
}
.wstep--done .wstep__num { background: var(--green); border-color: var(--green); color: #fff; }
.wstep--current .wstep__num { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-tint); }
.wstep__labels { display: flex; flex-direction: column; gap: 1px; }
.wstep__name { font-size: 12.5px; font-weight: 600; color: var(--faint); }
.wstep--done .wstep__name, .wstep--current .wstep__name { color: var(--text); }
.wstep__state { font-size: 11px; color: var(--faint); }
.wstep--done .wstep__state { color: var(--green); }
.wstep--current .wstep__state { color: var(--muted); }
.wstep-link { height: 1px; flex: 0 0 60px; background: var(--border); }
.wstep-link--done { background: var(--border-strong); }
.wizard-noia {
  margin-left: 24px; padding: 6px 12px; border-radius: 20px;
  background: var(--chip); border: 1px solid var(--border); font-size: 11px;
  color: var(--muted); white-space: nowrap; flex: none;
}
.wizard-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: 600; color: var(--text); }
.field__input, .field select, .field textarea {
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 9px 11px; background: var(--card); font-size: 12.5px; color: var(--text);
}
.field__input:focus, .field textarea:focus { outline: 2px solid var(--primary-tint); border-color: var(--primary); }
.field__hint { font-size: 11px; color: var(--muted); }

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  flex: 1; min-width: 110px; border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 11px; text-align: center; font-size: 12.5px; color: var(--text);
  background: var(--card);
}
.choice.is-selected { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); font-weight: 600; }

.person-chip {
  font-size: 11.5px; padding: 6px 11px; border-radius: 16px;
  background: var(--chip); border: 1px solid var(--border); color: var(--text);
  display: inline-flex; align-items: center; gap: 6px;
}
.person-chip--muted { color: var(--muted); }
.person-chip.is-off { opacity: .45; text-decoration: line-through; }

.reminder-chip {
  font-size: 11.5px; padding: 5px 10px; border-radius: 5px;
  background: var(--primary-tint); color: var(--primary); font-weight: 600;
  border: 0; display: inline-flex; align-items: center; gap: 6px;
}
.reminder-chip--hours { background: var(--orange-tint); color: var(--orange-dark); }
.reminder-chip__x { font-weight: 400; opacity: .55; }
.reminder-add {
  font-size: 11.5px; padding: 5px 10px; border-radius: 5px;
  border: 1px dashed var(--border-dash); color: var(--muted); background: none;
}
.date-box {
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 8px 10px; background: var(--card); font-size: 12.5px; color: var(--text); width: 100%;
}

.toggle {
  width: 34px; height: 19px; border-radius: 12px; background: var(--border-strong);
  position: relative; flex: none; border: 0; padding: 0;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff;
  transition: left .15s ease;
}
.toggle.is-on { background: var(--green); }
.toggle.is-on::after { left: 17px; }
.toggle-card {
  border: 1px solid var(--border); border-radius: 6px; padding: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.toggle-card__label { font-size: 12.5px; color: var(--text); }
.toggle-card__label--muted { color: var(--muted); }

.mono { font-family: var(--mono); }
.prompt-editor {
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--row-hint);
  padding: 14px; font-size: 12.5px; line-height: 1.7; color: var(--text);
  min-height: 210px; width: 100%; resize: vertical; font-family: var(--font);
}

/* ---------- Onglets modules (comité) ---------- */

.module-tabs {
  display: flex; align-items: center; gap: 28px; padding: 0 24px;
  background: var(--primary); color: rgba(255,255,255,.7); font-size: 12.5px;
  height: 42px; overflow-x: auto;
}
.module-tab {
  height: 42px; display: flex; align-items: center; white-space: nowrap;
  background: none; border: 0; color: inherit; font-size: inherit; padding: 0;
}
.module-tab.is-active { color: #fff; font-weight: 600; box-shadow: inset 0 -3px 0 var(--green-bright); }
.module-tab.is-future { color: rgba(255,255,255,.45); }

/* ---------- File d'attente IA ---------- */

.queue-item { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); }
.queue-item:last-child { border-bottom: 0; }
.queue-item--active { background: var(--row-hint); padding: 18px; }
.queue-icon {
  width: 34px; height: 34px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.queue-icon--done { background: var(--green-tint); color: var(--green-dark); }
.queue-icon--progress { background: var(--orange-tint); color: var(--orange-dark); font-size: 13px; font-weight: 600; }
.queue-icon--waiting { background: var(--chip); color: var(--faint); }
.queue-icon--retreat { background: var(--primary-tint); color: var(--primary); }
.queue-body { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.queue-name-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.queue-name { font-size: 13px; font-weight: 600; color: var(--text); }
.queue-meta { font-size: 11.5px; color: var(--muted); }
.queue-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.queue-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.progress-lg { height: 8px; border-radius: 5px; background: var(--border); overflow: hidden; }
.progress-lg > div { height: 100%; background: var(--green); }
.progress-md { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; }
.progress-md > div { height: 100%; background: var(--orange); }

/* ---------- Circuit de validation ---------- */

.circuit-bar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 18px 26px; display: flex; align-items: center;
}
.circuit-step { flex: 1; display: flex; align-items: center; gap: 12px; padding-right: 14px; }
.circuit-step__num {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.circuit-step__role { font-size: 12.5px; font-weight: 600; color: var(--text); }
.circuit-step__detail { font-size: 11px; color: var(--muted); }

.delib-doc {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 28px 32px; display: flex; flex-direction: column; gap: 14px;
  font-size: 13px; line-height: 1.75; color: var(--text);
}
.delib-doc__rubrique { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.delib-doc__title { font-size: 16px; font-weight: 600; line-height: 1.4; }
.legal-ref {
  background: var(--primary-tint); border-bottom: 1.5px solid var(--primary);
  padding: 1px 2px; cursor: pointer;
}
.legal-ref-note { color: var(--link); font-size: 11.5px; }

.ia-flag {
  background: var(--orange-bg); border-left: 3px solid var(--orange);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.ia-flag--resolved { background: var(--green-tint); border-left-color: var(--green); }
.ia-flag__note { font-size: 11.5px; color: var(--orange-deep); line-height: 1.55; }
.ia-flag--resolved .ia-flag__note { color: var(--green-dark); }

.ia-flag-card {
  border: 1px solid var(--orange-border); background: var(--orange-bg); border-radius: 6px;
  padding: 13px 14px; display: flex; flex-direction: column; gap: 8px;
}
.ia-flag-card__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ia-flag-card__title { font-size: 12px; font-weight: 600; color: var(--orange-deep); }
.ia-flag-card__time { margin-left: auto; font-size: 11px; color: var(--orange-dark); }
.ia-flag-card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ia-source {
  background: var(--card); border: 1px solid var(--orange-border); border-radius: 5px;
  padding: 10px; display: flex; flex-direction: column; gap: 3px;
}
.ia-source__where { font-size: 10.5px; color: var(--orange-dark); }
.ia-source__value { font-size: 14px; font-weight: 600; color: var(--text); }
.ia-source__quote { font-size: 10.5px; color: var(--muted); }

.print-dest {
  border: 1px solid var(--border); border-radius: 6px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px; background: var(--card);
  text-align: left; font-family: var(--font);
}
.print-dest.is-selected { border-color: var(--primary); background: var(--primary-tint); }
.print-dest__name { font-size: 12px; font-weight: 600; color: var(--text); }
.print-dest.is-selected .print-dest__name { color: var(--primary); }
.print-dest__docs { font-size: 11px; color: var(--muted); line-height: 1.5; }
.print-dest.is-selected .print-dest__docs { color: var(--primary); }

/* ---------- Fils d'annotations ---------- */

.threads {
  flex: 1; max-width: 430px; background: var(--card);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
}
.threads__tabs { display: flex; border-bottom: 1px solid var(--border); }
.threads__tab {
  flex: 1; padding: 14px 16px; font-size: 12.5px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; background: none; border: 0;
}
.threads__tab.is-active { font-weight: 600; color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); }
.threads__notice {
  padding: 12px 16px; background: var(--row-hint); border-bottom: 1px solid var(--border-soft);
  font-size: 11px; color: var(--muted); line-height: 1.5;
}
.threads__scroll { padding: 16px; display: flex; flex-direction: column; gap: 16px; flex: 1; overflow-y: auto; }
.msg { display: flex; gap: 11px; }
.msg__avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.msg__avatar--daj { background: var(--primary-tint); color: var(--primary); }
.msg__avatar--service { background: var(--green-tint); color: var(--green-dark); }
.msg__avatar--dgs { background: var(--orange-tint); color: var(--orange-dark); }
.msg__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.msg__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg__author { font-size: 12.5px; font-weight: 600; color: var(--text); }
.msg__time { font-size: 11px; color: var(--faint); }
.msg__quote { border-left: 2px solid var(--border-strong); padding-left: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.msg__text { font-size: 12.5px; color: var(--text); line-height: 1.6; }
.msg__ok { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--green-dark); }
.attachment {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
}
.attachment__icon {
  width: 22px; height: 22px; border-radius: 4px; background: var(--red);
  color: #fff; font-size: 9px; font-weight: 700; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.attachment__name { font-size: 11.5px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.attachment__open { margin-left: auto; font-size: 11px; color: var(--link); background: none; border: 0; padding: 0; }

.composer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.composer__box {
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 12px 13px;
  background: var(--card); display: flex; flex-direction: column; gap: 10px;
}
.composer__input {
  border: 0; padding: 0; font-size: 12px; color: var(--text);
  resize: none; min-height: 20px; outline: none; background: transparent;
}
.composer__input::placeholder { color: var(--faint); }
.composer__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.composer__actions { display: flex; gap: 10px; }
.composer__actions > * { flex: 1; }

/* ---------- Divers ---------- */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2--wide-left { grid-template-columns: 1.55fr 1fr; }
.grid-2--wizard { grid-template-columns: 1.4fr 1fr; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; }
.stack-3 { display: flex; flex-direction: column; gap: 3px; }
.stack-5 { display: flex; flex-direction: column; gap: 5px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; }
.row--between { justify-content: space-between; }
.row--gap8 { gap: 8px; }
.row--gap10 { gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.tiny { font-size: 11px; }
.txt-green { color: var(--green); }
.txt-orange { color: var(--orange); }
.txt-link { color: var(--link); }
.fw-600 { font-weight: 600; }

.timeline { display: flex; align-items: center; padding: 10px 0; }
.timeline__node { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.timeline__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--primary); }
.timeline__dot--final { background: var(--green); }
.timeline__label { font-size: 11px; color: var(--text); text-align: center; line-height: 1.4; }
.timeline__link { height: 2px; flex: 1; background: var(--border-strong); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--header); color: #fff; font-size: 12.5px;
  padding: 11px 18px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 100;
  max-width: 90vw; text-align: center;
}
.toast.is-visible { opacity: 1; }

.empty-view {
  border: 1px dashed var(--border-dash); border-radius: 8px;
  padding: 46px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px;
  color: var(--muted); background: var(--card);
}
.empty-view__title { font-size: 14px; font-weight: 600; color: var(--text); }

@media (max-width: 1080px) {
  .kpis, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2--wide-left, .grid-2--wizard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .threads { max-width: none; border-left: 0; border-top: 1px solid var(--border); }
  .delib-layout { flex-direction: column; }
}

/* ---------- Modales ---------- */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,59,92,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal {
  background: var(--card); border-radius: 10px; width: 100%; max-width: 760px;
  max-height: 86vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.modal--sm { max-width: 520px; }
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text);
  position: sticky; top: 0; background: var(--card);
}
.modal__close { border: 0; background: none; font-size: 17px; color: var(--muted); padding: 2px 6px; }
.modal__close:hover { color: var(--text); }
.modal__body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }

.pdf-excerpt { border: 1px solid var(--border); border-radius: 6px; padding: 18px 20px; background: var(--row-hint); font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.pdf-excerpt mark { background: #FFF3B0; color: #2C3E50; padding: 1px 2px; }

.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slide-mock { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.slide-mock__label { padding: 8px 12px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.slide-mock__label--avant { color: var(--muted); background: var(--chip); }
.slide-mock__label--apres { color: var(--green-dark); background: var(--green-tint); }
.slide-mock__body { padding: 14px 16px; font-size: 11px; line-height: 1.6; color: var(--text); min-height: 170px; background: var(--card); }

/* ---------- Workflow Livrables ---------- */

.flow { display: flex; align-items: stretch; gap: 0; }
.flow__step { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.flow__step--done { border-color: var(--green); }
.flow__step--current { border-color: var(--primary); background: var(--primary-tint); }
.flow__arrow { align-self: center; padding: 0 8px; color: var(--faint); font-size: 15px; flex: none; }
.flow__name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.flow__state { font-size: 11px; color: var(--muted); }
.flow__step--done .flow__state { color: var(--green-dark); }

/* ---------- Ordre de passage (drag & drop) ---------- */

.ordre-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--card);
  font-size: 12.5px; color: var(--text); cursor: grab;
}
.ordre-item.is-dragover { border-color: var(--primary); background: var(--primary-tint); }
.ordre-item__grip { color: var(--faint); font-size: 13px; letter-spacing: 2px; }
.ordre-item__num { width: 20px; height: 20px; border-radius: 50%; background: var(--primary-tint); color: var(--primary); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.ordre-item__arrows { margin-left: auto; display: flex; gap: 4px; }
.ordre-item__arrows button { border: 1px solid var(--border-strong); background: var(--card); border-radius: 4px; font-size: 11px; padding: 2px 7px; color: var(--muted); }
.ordre-item__arrows button:hover { color: var(--text); }

/* ---------- Thème sombre (N-13 : bascule en un clic, clair par défaut) ---------- */

body.theme-dark {
  --header: #0A2438;
  --primary: #2E6DA0;
  --primary-tint: #1D3A52;
  --link: #5DADE2;
  --green: #2ECC71;
  --green-dark: #58D68D;
  --green-tint: #17352A;
  --orange: #E67E22;
  --orange-dark: #E5A34D;
  --orange-deep: #EDBE7E;
  --orange-tint: #3A2D15;
  --orange-bg: #2E2514;
  --orange-border: #55431F;
  --orange-border-2: #6B5526;
  --orange-hl: #4A3A1A;
  --red: #E74C3C;
  --red-dark: #F1948A;
  --red-tint: #3A201C;
  --text: #E8EDF2;
  --muted: #9DB0C0;
  --faint: #6B7E8F;
  --border: #2A3844;
  --border-strong: #3A4C5E;
  --border-soft: #243240;
  --border-dash: #3E5061;
  --bg: #10181F;
  --chip: #22303D;
  --card: #182430;
  --row-hint: #1C2A37;
}
body.theme-dark .modal-overlay { background: rgba(0,0,0,.55); }
body.theme-dark .btn--primary { color: #fff; }
body.theme-dark .sidebar__item.is-active { color: #fff; }

.theme-toggle {
  width: 30px; height: 30px; border-radius: 6px; flex: none;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: rgba(255,255,255,.18); }
