:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #5d6b78;
  --line: #dde3e9;
  --brand: #0b5c8c;
  --brand-ink: #ffffff;
  --brand-soft: #e6f0f7;
  --accent: #e07a1f;
  --ok: #1e7d4f;
  --ok-soft: #e3f4ea;
  --warn: #9a6300;
  --warn-soft: #fdf1da;
  --err: #b42318;
  --err-soft: #fde8e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

/* En-tête */
.topbar { background: var(--brand); color: var(--brand-ink); }
.topbar .in { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo { font-weight: 800; letter-spacing: .3px; font-size: 1.1rem; color: inherit; text-decoration: none; }
.logo span { color: #ffd5a8; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.topbar nav a, .topbar nav button { color: var(--brand-ink); text-decoration: none; background: transparent; border: 0; padding: 6px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.topbar nav a.on, .topbar nav a:hover, .topbar nav button:hover { background: rgba(255, 255, 255, .15); }
.who { font-size: .85rem; opacity: .85; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow { max-width: 760px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Formulaires */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid .full { grid-column: 1 / -1; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid, .grid-3 { grid-template-columns: 1fr; } }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 4px; }
label .req { color: var(--err); }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[readonly] { background: #f7f9fb; }
textarea { min-height: 90px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; color: var(--brand); padding: 0; margin-bottom: 10px; font-size: 1rem; }
.hp { position: absolute; left: -5000px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); padding: 9px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.light { background: #fff; color: var(--brand); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.danger { background: #fff; color: var(--err); border-color: #f1b8b2; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.msg { padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.err { background: var(--err-soft); color: var(--err); }
.msg.info { background: var(--brand-soft); color: var(--brand); }
.hidden { display: none !important; }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f7f9fb; font-weight: 600; color: var(--muted); white-space: nowrap; position: sticky; top: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f9fbfd; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clip { max-width: 340px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #eef1f4; color: var(--muted); }
.b-nouveau { background: #e8eefc; color: #2847a8; }
.b-en_cours { background: var(--warn-soft); color: var(--warn); }
.b-en_attente { background: #f2ecfb; color: #6b3fb3; }
.b-regle, .b-actif { background: var(--ok-soft); color: var(--ok); }
.b-abandonne, .b-resilie { background: var(--err-soft); color: var(--err); }
.b-proposition { background: #fff1e3; color: #a3530c; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .85rem; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* Panneau latéral */
.drawer-bg { position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--bg); z-index: 21; overflow-y: auto; padding: 20px; box-shadow: -8px 0 24px rgba(0, 0, 0, .12); }

.price { font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.suggest { border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; background: #fff; overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 9px 12px; font: inherit; cursor: pointer; border-bottom: 1px solid var(--line); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover { background: var(--brand-soft); }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.choice { display: block; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.choice:hover { border-color: var(--brand); }
.choice h2 { color: var(--brand); }

.notes { list-style: none; padding: 0; margin: 0; }
.notes li { border-left: 3px solid var(--brand-soft); padding: 4px 10px; margin-bottom: 8px; }
.notes small { color: var(--muted); }
.qr { width: 140px; height: 140px; }
