/* ==========================================================================
   Waveflow — feuille de style unique (sans framework)
   ========================================================================== */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e6eb;
  --border-strong: #cdd3db;
  --text: #17202e;
  --muted: #5e6978;
  --faint: #8a94a3;

  --primary: #1f3b63;
  --primary-hover: #172e4e;
  --primary-soft: #e9eef6;
  --accent: #2b7a9b;

  --cdc: #2f5d8a;  --cdc-soft: #edf3f9;
  --bpu: #2e7454;  --bpu-soft: #ebf5ef;
  --sla: #94611b;  --sla-soft: #f9f2e6;

  --danger: #b42318;  --danger-soft: #fdecea;
  --success: #1f7a4d; --success-soft: #e7f5ed;
  --warn: #9a5b07;    --warn-soft: #fdf3e2;
  --info: #1f5fa8;    --info-soft: #e8f0fb;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 268px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { vertical-align: middle; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.ico { flex: none; }

/* ------------------------------------------------------------------ Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #b9c0ca; text-decoration: none; }
.btn:focus-visible, .input:focus-visible, .btn-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #f1b5ae; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(31, 59, 99, .06); border-color: transparent; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent;
  animation: spin .7s linear infinite;
}
.btn-primary.is-loading::after { border-color: #fff transparent #fff transparent; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; background: transparent; color: var(--muted); border-radius: var(--radius-sm); cursor: pointer;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ Formulaires */
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row > label, .label { font-weight: 550; font-size: 13px; }
.form-hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; color: var(--text); font: 14px/1.4 var(--font);
}
textarea.input { resize: vertical; min-height: 64px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43, 122, 155, .15); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--primary); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* ------------------------------------------------------------------ Flash & toasts */
.flashes { display: grid; gap: 8px; margin-bottom: 16px; }
.site-main > .flashes, .bare-main > .flashes { max-width: 1120px; margin: 16px auto 0; padding: 0 24px; }
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px;
}
.flash-info    { background: var(--info-soft);    border-color: #c4d7f1; color: var(--info); }
.flash-success { background: var(--success-soft); border-color: #b7dfc9; color: var(--success); }
.flash-error   { background: var(--danger-soft);  border-color: #f3c0ba; color: var(--danger); }
.flash-warn    { background: var(--warn-soft);    border-color: #f2d6a7; color: var(--warn); }
.flash-close { border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 1000; max-width: 380px; }
.toast {
  padding: 11px 14px; border-radius: var(--radius-sm); background: #17202e; color: #fff;
  box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .18s ease-out;
}
.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-warn { background: #8a5208; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-draft  { background: var(--warn-soft); color: var(--warn); border-color: #f2dcb4; }
.badge-locked { background: var(--primary-soft); color: var(--primary); border-color: #cbd6e7; }
.badge-done   { background: var(--success-soft); color: var(--success); border-color: #c3e3d1; }
.badge-ai     { background: #f1eefb; color: #5b3fb0; border-color: #ddd5f5; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--faint); }
.dot-draft { background: #d39a3a; } .dot-done { background: var(--success); } .dot-locked { background: var(--primary); }

/* ------------------------------------------------------------------ Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-head h2 { margin: 0; }
.card-head p { margin: 2px 0 0; }
.card-body { padding: 20px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h3 { color: var(--text); }
.empty-state .ico-wrap {
  width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); border-radius: 12px;
}

/* ------------------------------------------------------------------ Site public */
.site-header { background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.4) blur(6px); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.site-nav { display: flex; gap: 8px; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 72px; }
.site-footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 64px; font-size: 13px; flex-wrap: wrap; }

.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.025em; margin-bottom: 18px; }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 520px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--muted); }

.preview { padding: 18px; display: grid; gap: 12px; }
.preview-msg { padding: 10px 12px; border-radius: 10px; font-size: 13px; max-width: 88%; }
.preview-bot { background: var(--surface-2); border: 1px solid var(--border); }
.preview-user { background: var(--primary); color: #fff; justify-self: end; }
.preview-opts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.preview-opts span { padding: 3px 9px; border-radius: 12px; border: 1px solid var(--border-strong); background: #fff; font-size: 12px; }
.preview-opts span.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.preview-sheet { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; font-size: 12px; }
.preview-sheet div { display: grid; grid-template-columns: 52px 1fr 70px; border-top: 1px solid var(--border); }
.preview-sheet div span { padding: 6px 8px; }
.preview-sheet .ph { border-top: 0; color: #fff; font-weight: 600; }
.preview-sheet .ph.cdc { background: var(--cdc); } .preview-sheet .ph.bpu { background: var(--bpu); } .preview-sheet .ph.sla { background: var(--sla); }

.section { padding: 48px 0; }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-title h2 { font-size: 26px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 24px; }
.feature .num {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--primary-soft); color: var(--primary); font-weight: 700;
}
.feature p { color: var(--muted); margin: 0; }
.doc-pills { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.pill { font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 4px; color: #fff; letter-spacing: .03em; }
.pill-cdc { background: var(--cdc); } .pill-bpu { background: var(--bpu); } .pill-sla { background: var(--sla); }
.cta-band { padding: 36px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--primary); color: #fff; border-radius: 12px; }
.cta-band h2 { margin: 0 0 4px; } .cta-band p { margin: 0; opacity: .8; }
.cta-band .btn { background: #fff; color: var(--primary); border-color: #fff; }

/* ------------------------------------------------------------------ Authentification */
.auth-wrap { min-height: calc(100vh - 64px - 136px); display: grid; place-items: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 440px; padding: 32px; }
.auth-card.wide { max-width: 560px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.auth-alt { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------------------------ Application */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40;
}
.sidebar-brand { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  color: #344054; font-weight: 520; cursor: pointer; list-style: none; user-select: none;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary); }
.nav-link .ico { color: var(--faint); }
.nav-link.is-active .ico { color: var(--primary); }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary > span:first-of-type { flex: 1; }
.nav-group > summary > .ico:last-child { transition: transform .15s; }
.nav-group[open] > summary > .ico:last-child { transform: rotate(180deg); }
.nav-count { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 0 6px; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 18px; margin-left: 10px; border-left: 1px solid var(--border); }
.nav-sub form { margin: 0; }
.nav-sublink {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border-radius: 6px;
  color: #475467; font: 13px/1.35 var(--font); background: none; border: 0; text-align: left; cursor: pointer;
}
.nav-sublink:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-sublink.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 550; }
.nav-sub-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-new { color: var(--primary); font-weight: 550; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 650; flex: none; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.who strong, .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.who span { font-size: 12px; }
.sidebar-backdrop { display: none; }

.app-content { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.app-topbar { display: none; }
.app-main { padding: 28px 32px 64px; max-width: 1480px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head-main { min-width: 0; flex: 1 1 360px; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.page-title { margin: 0 0 8px; outline: none; border-radius: 4px; }
.page-title[contenteditable="true"]:hover { box-shadow: 0 0 0 1px var(--border-strong); }
.page-title[contenteditable="true"]:focus { box-shadow: 0 0 0 2px var(--accent); background: #fff; }
.meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { padding: 16px 18px; }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfcfd; }
.table .actions { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack { display: grid; gap: 20px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }

/* ------------------------------------------------------------------ Projet : sections */
.project-section { margin-bottom: 24px; }
.section-head-title { display: flex; align-items: center; gap: 12px; }
.section-num {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex: none;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px;
}
.is-disabled .section-num { background: var(--faint); }
.steps { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; font-size: 12px; }
.steps li { display: flex; align-items: center; gap: 6px; color: var(--faint); padding: 0 10px; position: relative; }
.steps li + li::before { content: ""; position: absolute; left: -6px; width: 12px; height: 1px; background: var(--border-strong); }
.steps li::after { content: counter(step); }
.steps { counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::after { order: -1; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-strong); font-weight: 600; font-size: 11px; }
.steps li.current { color: var(--primary); font-weight: 600; }
.steps li.current::after { border-color: var(--primary); background: var(--primary); color: #fff; }
.steps li.done { color: var(--success); }
.steps li.done::after { content: "✓"; border-color: var(--success); background: var(--success-soft); }

/* ------------------------------------------------------------------ RFI : discussion */
.rfi-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.chat { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.chat-thread { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-height: 560px; min-height: 240px; overflow-y: auto; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg-avatar { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--primary); color: #fff; }
.msg-body { min-width: 0; }
.msg-author { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.msg-text { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--border); padding: 10px 13px; border-radius: 4px 10px 10px 10px; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-user .msg-text { background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 10px 4px 10px 10px; }
.msg-user .msg-author { text-align: right; }
.summary-box { margin-top: 8px; padding: 12px 14px; border: 1px solid #c3e3d1; background: var(--success-soft); border-radius: 8px; white-space: pre-line; }
.summary-box strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--success); margin-bottom: 4px; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 10px 10px 10px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.chat-composer { border-top: 1px solid var(--border); padding: 16px 20px; background: #fcfcfd; border-radius: 0 0 0 var(--radius); }
.chat-composer.is-busy { opacity: .6; pointer-events: none; }
.answer-form { display: grid; gap: 14px; }
.fields { display: grid; gap: 14px; }
.field-label { font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.opts { display: flex; flex-direction: column; gap: 4px; }
.opt > label {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; cursor: pointer; transition: border-color .1s, background .1s;
}
.opt > label:hover { border-color: var(--border-strong); }
.opt > label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opt input { accent-color: var(--primary); margin: 0; }
.opt-children { margin: 6px 0 4px 26px; padding-left: 12px; border-left: 2px solid var(--primary-soft); display: grid; gap: 10px; }
.opt-children .opts { flex-direction: row; flex-wrap: wrap; }
.opt-children .opt > label { padding: 5px 9px; font-size: 13px; }
.field-checkbox > .opts, .field-radio > .opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.field-checkbox > .opts > .opt:has(.opt-children:not([hidden])),
.field-radio > .opts > .opt:has(.opt-children:not([hidden])) { grid-column: 1 / -1; }
.input-unit { display: flex; align-items: center; gap: 8px; max-width: 320px; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
.composer-row textarea { min-height: 40px; }
.composer-hint { font-size: 12px; color: var(--faint); }
.confirm-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.rfi-side { padding: 18px; background: var(--surface-2); border-radius: 0 0 var(--radius) 0; }
.rfi-side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.maslow { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column-reverse; gap: 4px; align-items: center; }
.maslow li {
  text-align: center; font-size: 11.5px; padding: 6px 4px; background: #e7ebf1; color: var(--muted);
  border-radius: 3px; transition: background .2s, color .2s; line-height: 1.25;
}
.maslow li:nth-child(1) { width: 100%; } .maslow li:nth-child(2) { width: 88%; } .maslow li:nth-child(3) { width: 76%; }
.maslow li:nth-child(4) { width: 64%; } .maslow li:nth-child(5) { width: 52%; }
.maslow li.reached { background: #c9d5e6; color: var(--primary); }
.maslow li.current { background: var(--primary); color: #fff; font-weight: 600; }
.side-list { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.side-list li::before { content: "•"; color: var(--accent); margin-right: 6px; }

/* Candidats */
.candidates { border-top: 1px solid var(--border); padding: 20px; }
.cand-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cand-head h3 { margin: 0; }
.cand-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.cand-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; background: #fff; }
.cand-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.cand-item input { margin-top: 3px; accent-color: var(--primary); }
.cand-item .name { font-weight: 600; }
.cand-item .tags { font-size: 12px; color: var(--muted); }
.cand-item .badge { margin-left: auto; height: 20px; font-size: 11px; }
.cand-add { display: grid; grid-template-columns: 1.2fr 1.2fr 1.4fr auto; gap: 8px; margin-top: 12px; padding: 12px; background: var(--surface-2); border-radius: 7px; border: 1px dashed var(--border-strong); }
.suggestions { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px dashed var(--border-strong); border-radius: 14px; background: #fff; cursor: pointer; font: 12.5px var(--font); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.cand-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ------------------------------------------------------------------ RFQ : tableur */
.rfq-legend { display: flex; gap: 14px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.rfq-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rfq-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.save-status { font-size: 12px; color: var(--faint); white-space: nowrap; }
.save-status.dirty { color: var(--warn); } .save-status.error { color: var(--danger); }
.stale-note { margin: 0 20px 0; }
.sheet-wrap { overflow-x: auto; padding: 0 20px 20px; }
.sheet { min-width: 920px; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; background: #fff; }
.grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.grid + .grid { border-top: 2px solid var(--border-strong); }
.grid col.c-handle { width: 28px; } .grid col.c-actions { width: 112px; }
.grid th, .grid td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0; vertical-align: top; }
.grid th:last-child, .grid td:last-child { border-right: 0; }
.doc-band th { padding: 0; border-bottom: 0; }
.band-inner { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: #fff; text-align: left; }
.doc-tag { font-weight: 750; letter-spacing: .05em; font-size: 12px; padding: 2px 7px; border-radius: 3px; background: rgba(255, 255, 255, .18); }
.doc-title { font-weight: 600; font-size: 13.5px; }
.doc-count { font-size: 12px; opacity: .8; font-weight: 400; }
.band-actions { margin-left: auto; display: flex; gap: 6px; }
.band-actions .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; }
.band-actions .btn:hover { background: rgba(255, 255, 255, .26); }
.grid-cdc .band-inner { background: var(--cdc); } .grid-bpu .band-inner { background: var(--bpu); } .grid-sla .band-inner { background: var(--sla); }
.col-head th { padding: 7px 9px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; text-align: left; color: #344054; }
.grid-cdc .col-head th { background: var(--cdc-soft); } .grid-bpu .col-head th { background: var(--bpu-soft); } .grid-sla .col-head th { background: var(--sla-soft); }
.grid td.cell { padding: 7px 9px; outline: none; word-wrap: break-word; white-space: pre-wrap; min-height: 32px; line-height: 1.45; }
.grid td.cell[contenteditable="true"]:hover { background: #fbfcfe; }
.grid td.cell[contenteditable="true"]:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); }
.grid td.cell:empty::before { content: attr(data-ph); color: var(--faint); font-style: italic; }
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.computed { padding: 7px 9px; color: var(--muted); background: var(--surface-2); }
.grid td.cell-select { padding: 3px 4px; }
.grid td.cell-select select { width: 100%; border: 0; background: transparent; font: 13px var(--font); padding: 4px; cursor: pointer; }
.grid .row-section td { background: #f6f7f9; }
.grid .row-section td.cell { font-weight: 650; color: var(--text); }
.grid-cdc .row-section td:first-child { box-shadow: inset 3px 0 0 var(--cdc); }
.grid-bpu .row-section td:first-child { box-shadow: inset 3px 0 0 var(--bpu); }
.grid-sla .row-section td:first-child { box-shadow: inset 3px 0 0 var(--sla); }
.grid td.c-handle { text-align: center; color: var(--faint); cursor: grab; user-select: none; padding-top: 7px; font-size: 13px; }
.grid td.c-handle:active { cursor: grabbing; }
.grid td.c-actions { padding: 3px 4px; white-space: nowrap; text-align: right; }
.grid td.c-actions button { width: 24px; height: 24px; border: 0; background: none; color: var(--faint); border-radius: 4px; cursor: pointer; font-size: 13px; }
.grid td.c-actions button:hover { background: var(--surface-2); color: var(--text); }
.grid td.c-actions button.del:hover { background: var(--danger-soft); color: var(--danger); }
.grid tr.dragging { opacity: .4; }
.grid tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.grid tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
.grid tr.empty td { padding: 14px; text-align: center; color: var(--faint); font-style: italic; }
.grid tfoot td { padding: 8px 9px; font-weight: 650; background: var(--bpu-soft); border-bottom: 0; }
.is-locked .grid td.c-handle { cursor: default; }

/* Lecture seule (partage) */
.ro-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 0; }
.ro-table th, .ro-table td { border: 1px solid var(--border); padding: 7px 9px; text-align: left; vertical-align: top; white-space: pre-wrap; }
.ro-table .num { text-align: right; }

/* ------------------------------------------------------------------ Dialogues */
dialog.modal { border: 0; padding: 0; border-radius: 10px; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); color: var(--text); }
dialog.modal::backdrop { background: rgba(16, 24, 40, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 10px 10px; }
.export-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.export-choice {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); text-align: center; font-weight: 600;
}
.export-choice:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.export-choice .fmt { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; color: #fff; letter-spacing: .04em; }
.export-choice small { color: var(--muted); font-weight: 400; font-size: 12px; }
.fmt-docx { background: #2b579a; } .fmt-xlsx { background: #217346; } .fmt-pdf { background: #b42318; }
.copy-field { display: flex; gap: 6px; }
.copy-field .input { font-family: var(--mono); font-size: 12.5px; }
.share-result { padding: 14px; border: 1px solid #c3e3d1; background: var(--success-soft); border-radius: 8px; display: grid; gap: 10px; }
.share-list { font-size: 12.5px; }
.share-list td, .share-list th { padding: 7px 8px; }
.pw-row { display: flex; gap: 6px; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1100px) {
  .rfi-body { grid-template-columns: 1fr; }
  .chat { border-right: 0; }
  .rfi-side { border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
  .maslow { max-width: 320px; margin-left: auto; margin-right: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 30; }
  .app-content { margin-left: 0; }
  .app-topbar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .app-main { padding: 20px 16px 48px; }
  .hero-grid, .features, .grid-2, .form-grid.cols-2 { grid-template-columns: 1fr; }
  .hero { padding: 40px 0; } .hero h1 { font-size: 30px; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .cand-add { grid-template-columns: 1fr; }
  .export-choices { grid-template-columns: 1fr; }
  .toolbar { justify-content: flex-start; }
  .steps { display: none; }
  .msg { max-width: 100%; }
}

/* ------------------------------------------------------------------ Impression */
@media print {
  .sidebar, .app-topbar, .toolbar, .chat-composer, .c-actions, .c-handle, .band-actions, .toasts { display: none !important; }
  .app-content { margin: 0; }
  .chat-thread { max-height: none; overflow: visible; }
  body { background: #fff; }
}
.cand-item > div { flex: 1; min-width: 0; }
