/* =====================================================================
   SUIVI AO — DESIGN
   Identité : cadre neutre "dossier institutionnel moderne".
   La couleur d'accent (--accent) est dynamique : elle prend la couleur
   de l'entreprise consultée. Le client a ainsi l'impression d'un outil
   qui lui appartient — ce qui renforce le sentiment de cloisonnement.
   ===================================================================== */

:root {
  --accent:      #2f4fcc;   /* surchargé dynamiquement par entreprise */
  --accent-soft: #2f4fcc1a;
  --ink:         #16243d;
  --ink-2:       #3a4a63;
  --muted:       #6b7a93;
  --bg:          #eef2f7;
  --surface:     #ffffff;
  --surface-2:   #f7f9fc;
  --line:        #e3e9f1;
  --line-2:      #d4dce8;
  --danger:      #c0392b;
  --radius:      14px;
  --shadow:      0 1px 2px rgba(16,36,61,.06), 0 8px 24px rgba(16,36,61,.06);
  --font-ui:     'Inter', system-ui, -apple-system, sans-serif;
  --font-display:'Space Grotesk', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "tnum" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
a { color: var(--accent); text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* ───────── App shell ───────── */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--ink);
  color: #c7d2e4;
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand .dot {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center; color: #fff; font-family: var(--font-display);
  font-weight: 700; flex-shrink: 0;
}
.brand b { color: #fff; font-family: var(--font-display); font-size: 15px; line-height: 1.15; }
.brand small { color: #8597b4; display: block; font-size: 11px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px; cursor: pointer;
  color: #b6c2d8; font-size: 14px; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: #ffffff12; color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-sep { height: 1px; background: #ffffff14; margin: 12px 6px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f81a0; padding: 6px 11px 4px; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: #6f81a0; padding: 8px 11px; }

.main { display: flex; flex-direction: column; min-width: 0; }

/* ───────── Top bar ───────── */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 18px; }
.topbar .spacer { flex: 1; }
.ent-pill {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 6px 8px 6px 6px; border-radius: 999px;
}
.ent-logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent); font-weight: 700; font-family: var(--font-display); font-size: 13px; }
.ent-img { width: 30px; height: 30px; border-radius: 7px; object-fit: contain; background: #fff; padding: 2px; border: 1px solid var(--line); }
.usermenu { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }

.content { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 23px; }
.page-head p { color: var(--muted); margin: 3px 0 0; font-size: 14px; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 9px 14px; border-radius: 10px; font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(.94); border-color: var(--accent); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: #e7c3bd; }
.btn-danger:hover { background: #fdf1ef; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ───────── Cards / KPIs ───────── */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .value { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-top: 6px; letter-spacing: -.02em; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .accent { color: var(--accent); }

.panel { padding: 20px 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; }
.panel-head .spacer { flex: 1; }

/* ───────── Status badges ───────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-st { background: var(--st-bg); color: var(--st-fg); }

/* deadline urgency pill */
.echeance { font-size: 12px; font-weight: 600; }
.echeance.urgent { color: var(--danger); }
.echeance.bientot { color: #b45309; }
.echeance.passe { color: var(--muted); text-decoration: line-through; }

/* ───────── Toolbar (search + filters) ───────── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.field { position: relative; }
.field svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.input, .select, textarea.input {
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 12px; outline: none; transition: border .12s, box-shadow .12s; width: 100%;
}
.input.with-icon { padding-left: 34px; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search { min-width: 240px; flex: 1; max-width: 360px; }

/* ───────── Table ───────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); position: sticky; top: 0;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; transition: background .1s; }
table.data tbody tr:hover { background: var(--accent-soft); }
.cell-strong { font-weight: 600; color: var(--ink); }
.cell-muted { color: var(--muted); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ───────── Kanban ───────── */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { min-width: 256px; flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kcol-head .count { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; cursor: pointer; transition: .12s; }
.kcard:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.kcard .t { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.kcard .m { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; justify-content: space-between; gap: 8px; }

/* ───────── Modal ───────── */
.overlay { position: fixed; inset: 0; background: rgba(16,36,61,.45); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 60; padding: 18px; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 720px; max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(16,36,61,.3); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 18px; }
.modal-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); }
.x { margin-left: auto; cursor: pointer; color: var(--muted); border: 0; background: transparent; padding: 4px; border-radius: 8px; }
.x:hover { background: var(--surface-2); color: var(--ink); }

/* Tabs in modal */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 18px; }
.tab { padding: 9px 13px; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--accent); border-color: var(--accent); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; }
.dl dt { color: var(--muted); font-size: 13px; padding: 6px 0; }
.dl dd { margin: 0; font-size: 13.5px; padding: 6px 0; }

/* Timeline (échanges + audit) */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl-item { display: flex; gap: 12px; padding: 4px 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; position: relative; }
.tl-dot::after { content: ''; position: absolute; left: 50%; top: 12px; bottom: -8px; width: 1px; background: var(--line-2); transform: translateX(-50%); }
.tl-item:last-child .tl-dot::after { display: none; }
.tl-body { padding-bottom: 10px; }
.tl-body .meta { font-size: 11.5px; color: var(--muted); }
.tl-body .txt { font-size: 13.5px; margin-top: 2px; }

/* Empty / states */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty svg { width: 38px; height: 38px; color: var(--line-2); margin-bottom: 10px; }
.empty h4 { color: var(--ink); margin-bottom: 4px; font-size: 16px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 600px at 70% -10%, #20335a 0%, var(--ink) 55%); }
.login-card { background: var(--surface); border-radius: 20px; padding: 34px; width: 100%; max-width: 400px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.login-card .brand { padding: 0 0 22px; }
.login-card h2 { font-size: 20px; margin-bottom: 4px; }
.login-card p.sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.login-card label.lbl { margin-top: 14px; }
.login-card .btn-primary { width: 100%; margin-top: 20px; padding: 11px; }
.login-err { background: #fdf1ef; color: var(--danger); border: 1px solid #e7c3bd; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 16px; }

/* Toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13.5px; box-shadow: var(--shadow); z-index: 90; opacity: 0; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--danger); }

.muted { color: var(--muted); }
.spin { width: 30px; height: 30px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: r .7s linear infinite; }
@keyframes r { to { transform: rotate(360deg); } }
.loading-full { min-height: 100vh; display: grid; place-items: center; }

/* ───────── Responsive ───────── */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 248px; transform: translateX(-100%); transition: transform .2s; z-index: 70; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(16,36,61,.4); z-index: 65; }
  .menu-btn { display: inline-flex; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 0 0; }
  .dl dt { padding-bottom: 0; }
  .dl dd { padding-top: 2px; padding-bottom: 10px; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 12px 16px; }
}
@media (min-width: 861px) { .menu-btn { display: none; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* focus visibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ───────── Tableau de bord : sections + cartes par entreprise ───────── */
.dash-section { margin-bottom: 40px; }
.dash-h { font-size: 22px; color: var(--ink); font-weight: 600; font-family: var(--font-display); letter-spacing: -.01em; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 2px solid var(--hc, var(--line)); display: flex; align-items: center; gap: 13px; }
.dash-h .badge { font-size: 13px; padding: 4px 11px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); cursor: pointer; transition: transform .14s, box-shadow .14s, border-color .14s; display: flex; flex-direction: column; gap: 12px; }
.dash-card:hover { transform: translateY(-3px); border-color: var(--c); box-shadow: 0 14px 34px rgba(16,36,61,.12); }
.dash-card-top { display: flex; align-items: center; justify-content: space-between; }
.dash-ico { width: 52px; height: 52px; border-radius: 15px; background: var(--c); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.dash-count { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--c); letter-spacing: -.02em; }
.dash-card h4 { font-size: 18px; }
.dash-meta { color: var(--muted); font-size: 13px; margin-top: -4px; }
.dash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.dash-list li { font-size: 13.5px; color: var(--ink-2); padding-left: 15px; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list li::before { content: '•'; position: absolute; left: 2px; color: var(--c); }
.dash-list li.muted::before { content: ''; }
.dash-open { margin-top: auto; background: var(--ink); color: #fff; text-align: center; padding: 9px; border-radius: 10px; font-size: 13px; font-weight: 500; transition: background .14s; }
.dash-card:hover .dash-open { background: var(--c); }

/* ───────── Liste de marchés (depuis une carte) ───────── */
.liste-marches { display: flex; flex-direction: column; }
.lm-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 8px; transition: background .1s; }
.lm-row:last-child { border-bottom: 0; }
.lm-row:hover { background: var(--accent-soft); }

/* ───────── Planning : calendrier mensuel ───────── */
.cal-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cal-titre { font-size: 18px; text-transform: capitalize; min-width: 168px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 10px; text-align: center; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-cell { min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--surface-2); }
.cal-day { font-size: 12.5px; color: var(--muted); font-weight: 600; align-self: flex-start; }
.cal-cell.today .cal-day { background: var(--accent); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-ev { background: var(--c, var(--accent)); color: #fff; border-radius: 7px; padding: 4px 7px; font-size: 11.5px; line-height: 1.25; cursor: pointer; overflow: hidden; text-overflow: ellipsis; transition: filter .12s; }
.cal-ev:hover { filter: brightness(.92); }
.cal-ev .e-ent { font-size: 10px; opacity: .85; margin-top: 1px; }

@media (max-width: 860px) {
  .cal-cell { min-height: 78px; padding: 4px; }
  .cal-ev { font-size: 10px; padding: 3px 5px; }
  .cal-dow { padding: 7px 2px; font-size: 10px; }
  .cal-titre { min-width: 120px; font-size: 15px; }
  .dash-grid { grid-template-columns: 1fr; }
}

/* Icône SVG dans les cartes par statut */
.dash-ico svg { width: 24px; height: 24px; }

/* ───────── Tableau de bord entreprise : bandeau personnalisé + grille 2×2 ───────── */
.ent-banner {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 14%, #fff) 0%, var(--surface) 70%);
  border: 1px solid var(--line); border-left: 5px solid var(--c);
  border-radius: 16px; padding: 20px 24px; margin-bottom: 24px; box-shadow: var(--shadow);
}
.ent-banner h2 { font-size: 24px; }
.ent-banner p { color: var(--muted); margin: 3px 0 0; font-size: 14px; }
.ent-mark-lg { width: 62px !important; height: 62px !important; border-radius: 14px !important; font-size: 22px !important; flex-shrink: 0; }
img.ent-mark-lg { padding: 6px; }

.dash-grid-quad { display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: 26px; width: 100%; }

/* Tableau de bord entreprise : occupe toute la largeur et la hauteur dispo */
.content--dash { max-width: none; min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.content--dash .dash-grid-quad { flex: 1; }
.dash-grid-quad .dash-card { padding: 34px 36px; min-height: 320px; border-radius: 24px; gap: 16px; }
.dash-grid-quad .dash-card h4 { font-size: 23px; }
.dash-grid-quad .dash-card-top { margin-bottom: 4px; }
.dash-grid-quad .dash-ico { width: 68px; height: 68px; border-radius: 19px; }
.dash-grid-quad .dash-ico svg { width: 32px; height: 32px; }
.dash-grid-quad .dash-count { font-size: 40px; }
.dash-grid-quad .dash-meta { font-size: 15px; }
.dash-grid-quad .dash-list { gap: 8px; }
.dash-grid-quad .dash-list li { font-size: 15px; }
.dash-grid-quad .dash-open { padding: 13px; font-size: 14.5px; border-radius: 12px; }

@media (max-width: 760px) {
  .content--dash { min-height: 0; display: block; }
  .dash-grid-quad { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 16px; }
  .dash-grid-quad .dash-card { min-height: 0; padding: 22px 22px; }
  .dash-grid-quad .dash-card h4 { font-size: 19px; }
  .dash-grid-quad .dash-count { font-size: 30px; }
  .ent-banner { padding: 16px 18px; gap: 14px; }
  .ent-banner h2 { font-size: 20px; }
  .ent-mark-lg { width: 50px !important; height: 50px !important; }
}

/* ───────── Téléversement du logo (formulaire entreprise) ───────── */
.logo-uploader { display: flex; align-items: center; gap: 14px; }
.logo-preview {
  width: 72px; height: 72px; flex-shrink: 0; border-radius: 14px;
  border: 1px solid var(--line-2); background: #fff;
  display: grid; place-items: center; overflow: hidden; padding: 6px;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ───────── Ciblage : bouton bandeau + GO/NO-GO ───────── */
.btn-ciblage { background: var(--c, var(--accent)); color: #fff; border: 0; font-weight: 600; gap: 8px; box-shadow: 0 4px 14px rgba(16,36,61,.18); }
.btn-ciblage:hover { filter: brightness(.95); }
.ciblage-badge { background: rgba(255,255,255,.25); border-radius: 999px; padding: 1px 9px; font-size: 13px; font-weight: 700; }

.cib-row { display: flex; align-items: center; gap: 16px; padding: 14px 8px; border-bottom: 1px solid var(--line); }
.cib-row:last-child { border-bottom: 0; }
.cib-info { flex: 1; min-width: 0; }
.cib-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.cib-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-oui { background: #15803d; color: #fff; border: 0; }
.btn-oui:hover { background: #126c34; }
.btn-non { background: var(--surface); color: #b91c1c; border: 1px solid #f0c8c5; }
.btn-non:hover { background: #fbe0de; }
.cib-row.confirm-non .btn-non { background: #b91c1c; color: #fff; border-color: #b91c1c; }

@media (max-width: 620px) {
  .cib-row { flex-direction: column; align-items: stretch; }
  .cib-actions { justify-content: flex-end; }
}

/* ───────── Messagerie ───────── */
/* Bouton "Échanger" (bandeau client) */
.side-echanger {
  display: flex; align-items: center; gap: 10px;
  margin: auto 12px 8px; padding: 11px 14px; border-radius: 11px;
  background: var(--accent); color: #fff; border: 0; font-weight: 600; font-size: 14px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(16,36,61,.2);
}
.side-echanger + .sidebar-foot { margin-top: 0; }
.side-echanger:hover { filter: brightness(.95); }
.side-echanger svg { width: 18px; height: 18px; }

/* Pastilles de non-lus */
.msg-badge, .nav-badge, .conv-badge {
  background: #e11d48; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
}
.nav-item .msg-badge { margin-left: auto; }
.side-echanger .msg-badge { margin-left: auto; background: rgba(255,255,255,.28); }

/* Liste des conversations (admin) */
.conv-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.conv-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .1s; }
.conv-row:last-child { border-bottom: 0; }
.conv-row:hover { background: var(--accent-soft); }
.conv-ico { width: 44px; height: 44px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; flex-shrink: 0; }
.conv-preview { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.conv-badge { margin-top: 4px; }

/* Fenêtre de conversation */
.modal-chat { display: flex; flex-direction: column; max-height: 80vh; }
.chat-thread { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 240px; background: var(--surface-2); }
.chat-empty { text-align: center; color: var(--muted); margin: auto; }
.chat-empty svg { width: 30px; height: 30px; opacity: .5; }
.chat-msg { display: flex; flex-direction: column; max-width: 78%; }
.chat-msg.mien { align-self: flex-end; align-items: flex-end; }
.chat-msg.autre { align-self: flex-start; align-items: flex-start; }
.chat-bulle { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.chat-msg.mien .chat-bulle { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.autre .chat-bulle { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-heure { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.chat-compose { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-compose textarea { flex: 1; resize: none; }
.chat-compose .btn { padding: 10px 14px; }
.chat-compose .btn svg { width: 18px; height: 18px; }
