:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1f2a37;
  --muted: #6b7380;
  --line: #e6e2da;
  --accent: #1f7a6d;
  --accent-soft: #e3f1ee;
  --accent-ink: #ffffff;
  --sun: #f3b54a;
  --sun-soft: #fdf3df;
  --danger: #b4423a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 42, 55, 0.04), 0 6px 20px rgba(31, 42, 55, 0.05);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.55; font-size: 16px; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.15em 0 0.6em; }
.lead { font-size: 1.1rem; color: #3d4754; }
.eyebrow { color: var(--accent); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.4em; }
.error { color: var(--danger); }

/* ---------- Barre du haut ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.1rem; margin: 0; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, var(--sun), var(--accent) 70%); }
.brand-sub { font-weight: 400; color: var(--muted); font-size: 0.95rem; }
.save-state { font-size: 0.875rem; color: var(--muted); }
.save-state.ok { color: var(--accent); }
.save-state.warn { color: #a06a00; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: inherit; font-size: 0.95rem; padding: 0.7rem 1.3rem; border-radius: 999px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  cursor: pointer; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-primary { background: var(--btn-bg, var(--accent)); color: var(--btn-ink, var(--accent-ink)); border-color: var(--btn-bg, var(--accent)); }
.btn-primary:hover { background: var(--btn-hover, #18665b); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--danger); }

/* ---------- Étapes ---------- */

.sticky-head { position: sticky; top: 0; z-index: 10; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.sticky-head .topbar { position: static; }
.stepper {
  display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none;
  max-width: 860px; margin: 0 auto; padding: 0.6rem 1rem;
}
.stepper::-webkit-scrollbar { display: none; }
.stepper button {
  flex: 1 0 auto; display: flex; align-items: center; gap: 0.5rem;
  background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer;
  padding: 0.5rem 0.6rem; border-radius: 999px; font-size: 0.9rem; white-space: nowrap;
}
.stepper .num {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.85rem;
}
.stepper button.visited .num { background: var(--accent-soft); box-shadow: none; color: var(--accent); }
.stepper button.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.stepper button.active .num { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
@media (max-width: 640px) {
  .stepper button:not(.active) .lbl { display: none; }
}

/* ---------- Formulaire client ---------- */

.form-wrap { max-width: 760px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.step > h1 { margin-bottom: 0.4em; }
.type-label { color: var(--accent); font-weight: 400; }

.intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin: 1.5rem 0 2.5rem; }
.intro-card { background: var(--surface); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.intro-card h3 { font-size: 1rem; }
.intro-card p { margin: 0; color: #4a5462; font-size: 0.95rem; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.8rem; margin-top: 1rem; }
.type-card {
  position: relative; display: flex; flex-direction: column; gap: 0.25rem; cursor: pointer;
  background: var(--surface); border-radius: var(--radius); padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow); outline: 2px solid transparent; transition: outline-color 0.15s, transform 0.12s;
}
.type-card:hover { transform: translateY(-2px); }
.type-card input { position: absolute; opacity: 0; }
.type-card:has(input:checked) { outline-color: var(--accent); background: var(--accent-soft); }
.type-card:has(input:focus-visible) { outline-color: var(--sun); }
.type-name { font-weight: 600; }
.type-desc { color: var(--muted); font-size: 0.875rem; }

.block { background: var(--surface); border-radius: var(--radius); padding: 1.5rem clamp(1.1rem, 3vw, 1.75rem); margin: 1.25rem 0; box-shadow: var(--shadow); }
.block > h3, .block-head h3 { color: var(--accent); margin-bottom: 1rem; }
.block-head { display: flex; align-items: center; gap: 1rem; }
.block-head h3 { margin-bottom: 0; }
.block-head:has(h3) { margin-bottom: 1rem; }
.block-img { max-width: 120px; max-height: 64px; object-fit: contain; background: #fff; border-radius: 8px; padding: 0.35rem; box-shadow: 0 0 0 1px var(--line); }
.block.grid .block-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.5rem; }
.block.grid .q { margin: 0; }

.q-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: center; margin: 0.15rem 0 0.4rem; font-size: 0.8rem; color: var(--muted); }
.prio { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.75rem; }
.prio-block { background: #fbe4e1; color: #9b3128; }
.prio-imp { background: #e5eefb; color: #2b5a99; }
.prio-opt { background: #eeebe5; color: var(--muted); }
.current { margin: 0 0 0.5rem; padding: 0.55rem 0.8rem; border-radius: 10px; background: var(--sun-soft); font-size: 0.9rem; color: #5a4300; }
.current-label { color: #8a6a1f; }
.q-actions { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.later.ok { color: var(--accent); }
.later.ok::before { content: '✓ '; }
.summary-row .blocking { color: #9b3128; margin-right: 0.9rem; font-size: 0.85rem; }
.q { border: 0; padding: 0; margin: 0 0 1.6rem; min-width: 0; }
.q:last-child { margin-bottom: 0; }
.q > label, .q > legend { display: block; padding: 0; margin-bottom: 0.2rem; }
.tag { display: inline-block; font-size: 0.75rem; color: #8a5b00; background: var(--sun-soft); padding: 0.1rem 0.55rem; border-radius: 999px; vertical-align: 2px; margin-left: 0.25rem; }

textarea, input:not([type=radio]):not([type=file]):not([type=checkbox]), select {
  width: 100%; font: inherit; color: var(--ink); background: #fbfaf8;
  border: 1px solid var(--line); border-radius: 10px; padding: 0.7rem 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; min-height: 5.2rem; field-sizing: content; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }

.ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.3rem 0 0.6rem; }
.ideas-label { font-size: 0.85rem; color: var(--muted); margin-right: 0.15rem; }
.idea {
  font: inherit; font-size: 0.85rem; cursor: pointer; border: 0;
  padding: 0.3rem 0.75rem; border-radius: 999px; background: var(--sun-soft); color: #6b4a00;
  transition: background 0.15s, color 0.15s;
}
.idea::before { content: '+ '; opacity: 0.6; }
.idea:hover { background: #fbe8c2; }
.idea[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.idea[aria-pressed="true"]::before { content: '✓ '; opacity: 1; }
.idea:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.later { margin-top: 0.35rem; background: none; border: 0; padding: 0.2rem 0; font: inherit; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.later:hover { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 0.45rem 1rem; border-radius: 999px; background: #f1eee8; transition: background 0.15s, color 0.15s; }
.chip:hover span { background: #e8e4dc; }
.chip input:checked + span { background: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--sun); }

.nav-buttons { display: flex; justify-content: space-between; margin-top: 2rem; }

.summary { margin-bottom: 1rem; }
.summary-row {
  display: flex; justify-content: space-between; width: 100%; font: inherit; text-align: left; cursor: pointer;
  background: var(--surface); border: 0; border-radius: 10px; padding: 0.85rem 1.1rem; margin-bottom: 0.5rem; box-shadow: var(--shadow);
}
.summary-row .count { color: var(--muted); }
.summary-row.complete .count { color: var(--accent); }
.summary-row.complete .count::after { content: ' ✓'; }

.files { list-style: none; padding: 0; margin: 0 0 1rem; }
.files li { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; }
.file-name { flex: 1; overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.upload { display: inline-block; cursor: pointer; }
.upload input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload span { display: inline-block; padding: 0.6rem 1.2rem; border-radius: 999px; background: var(--sun-soft); color: var(--sun-ink, #7a5200); }
.upload:hover span { background: #fbe8c2; }
.upload input:focus-visible + span { box-shadow: 0 0 0 3px var(--sun); }
.upload-status { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--muted); }

.send { text-align: center; background: var(--accent-soft); box-shadow: none; }
.send .btn { font-size: 1.05rem; padding: 0.85rem 1.8rem; }

.center-wrap { min-height: 80vh; display: grid; place-items: center; padding: 2rem 1rem; }
.done-card { max-width: 520px; text-align: center; background: var(--surface); border-radius: 20px; padding: 2.5rem 2rem; box-shadow: var(--shadow); }
.done-icon { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: var(--accent-soft); color: var(--accent); }

/* ---------- Admin ---------- */

.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-head h1 { margin-bottom: 0.2em; }
.card { background: var(--surface); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.card.empty { text-align: center; padding: 3rem 1rem; }
.card.note { background: var(--sun-soft); box-shadow: none; }
.card.note p { white-space: pre-wrap; margin: 0; }
details.card summary { cursor: pointer; color: var(--accent); }
details.card[open] summary { margin-bottom: 1rem; }

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem 1rem; margin-bottom: 1.2rem; }
.field-grid label, .login-card label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.field-grid .wide { grid-column: 1 / -1; }

.table-card { padding: 0.5rem 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.8rem 1.3rem; white-space: nowrap; }
th { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
tbody tr + tr td { border-top: 1px solid var(--line); }
td a { color: var(--ink); text-decoration: none; }
td a:hover { color: var(--accent); }

.badge { display: inline-block; font-size: 0.8rem; padding: 0.15rem 0.65rem; border-radius: 999px; background: #eeebe5; color: var(--muted); }
.badge-opened { background: var(--sun-soft); color: #7a5200; }
.badge-progress { background: #e5eefb; color: #2b5a99; }
.badge-done { background: var(--accent-soft); color: var(--accent); }
.badge-site { background: var(--sun-soft); color: #7a5200; }
.badge-model { background: #eae6f7; color: #4b3a8f; white-space: normal; }
td.wrap { white-space: normal; max-width: 260px; }
.blocking { color: #9b3128; }
.answers dd.was { color: #8a6a1f; font-size: 0.85rem; }
.answers dd.was + dd { margin-top: 0.15rem; }
.answer-img { height: 28px; max-width: 80px; object-fit: contain; vertical-align: middle; margin-right: 0.6rem; }
.badge-waiting { background: #f3e8fb; color: #7a3f99; }
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem 2.5rem; }
.phases h2 { font-size: 1.05rem; }
.phases p:last-child, .phases form:last-child { margin-bottom: 0; }
.checks { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0 1rem; }
.check { display: flex; align-items: baseline; gap: 0.5rem; cursor: pointer; }
.check input { accent-color: var(--accent); flex: none; width: 1.1rem; height: 1.1rem; margin: 0.15rem 0 0; }
.phase-title { margin: 2.25rem 0 1rem; color: var(--muted); font-weight: 500; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }
.bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: #eeebe5; vertical-align: middle; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.export-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-left: auto; }
.link-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.link-row input { flex: 1 1 280px; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }

.answers h3 { color: var(--accent); margin-top: 1.5rem; }
.answers h3:first-of-type { margin-top: 0.5rem; }
.answers dl { margin: 0; }
.answers dt { color: var(--muted); font-size: 0.9rem; margin-top: 0.9rem; }
.answers dd { margin: 0.2rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.answers dd.empty { color: #b6bac0; }
.danger-zone { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.start-card { width: 100%; max-width: 520px; background: var(--surface); border-radius: 20px; padding: 2rem clamp(1.2rem, 4vw, 2.2rem); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1rem; }
.start-card > label:not(.check) { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.95rem; }
.start-card .hint { margin: 0; }
.start-card .lead { font-size: 1rem; }
.start-card .check span { font-size: 0.9rem; color: #4a5462; }
.start-card .btn { align-self: flex-start; }
/* piège à robots : invisible pour les humains */
.website { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.5rem; }
.notice p { margin: 0; }
.notice code { font-size: 0.85rem; overflow-wrap: anywhere; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1rem; }
.login-card h1 { font-size: 1.4rem; margin: 0; }

/* ---------- Logos ---------- */

.cs-logo { display: block; height: 20px; width: auto; }
.cs-logo-dark { filter: brightness(0); opacity: 0.82; }
.brand .cs-logo { height: 22px; }
.login-brand { align-self: flex-start; background: #1a2813; padding: 0.7rem 1rem; border-radius: 12px; }

/* ---------- Gestion : navigation et éléments communs ---------- */

.admin-bar { flex-wrap: wrap; row-gap: 0.5rem; background: #1a2813; box-shadow: none; color: #fff; }
.admin-bar .brand { gap: 0.7rem; }
.admin-bar .brand-sub { color: #9aa096; font-size: 0.85rem; padding-left: 0.7rem; border-left: 1px solid rgba(255, 255, 255, 0.18); }
.admin-bar .link { color: #bce70c; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 0.15rem; flex: 1; justify-content: center; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { padding: 0.4rem 0.8rem; border-radius: 999px; color: #bcc0b8; text-decoration: none; font-size: 0.92rem; white-space: nowrap; }
.admin-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.admin-nav a[aria-current] { color: #1a2813; background: #bce70c; font-weight: 500; }
.admin-nav a:focus-visible, .admin-bar .link:focus-visible { outline: 2px solid #bce70c; outline-offset: 2px; }

/* Recherche rapide */
.quick-search { position: relative; flex: 0 1 240px; min-width: 0; }
.admin-bar .quick-search input[type=search] { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); color: #fff; padding: 0.5rem 2.2rem 0.5rem 0.9rem; border-radius: 999px; font-size: 0.9rem; }
.quick-search input[type=search]::placeholder { color: #9aa096; }
.admin-bar .quick-search input[type=search]:focus { background: #fff; color: var(--ink); border-color: #bce70c; box-shadow: 0 0 0 3px rgba(188, 231, 12, 0.35); }
.quick-search input[type=search]:focus::placeholder { color: var(--muted); }
.quick-search kbd { position: absolute; right: 0.7rem; top: 50%; transform: translateY(-50%); font: 0.75rem ui-monospace, Consolas, monospace; color: #9aa096; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 5px; padding: 0 0.35rem; pointer-events: none; }
.quick-search:focus-within kbd { display: none; }
.qs-results { position: absolute; right: 0; top: calc(100% + 0.5rem); width: min(440px, calc(100vw - 2rem)); max-height: min(70vh, 520px); overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(20, 30, 20, 0.25); padding: 0.4rem; z-index: 30; }
.qs-results a { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.75rem; border-radius: 10px; color: var(--ink); text-decoration: none; }
.qs-results a span { color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
.qs-results a:hover, .qs-results a.active { background: var(--accent-soft); }
.qs-group { margin: 0.5rem 0.75rem 0.15rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.qs-more, .qs-none { margin: 0.2rem 0.75rem 0.4rem; font-size: 0.82rem; color: var(--muted); }
.qs-results .qs-all { margin-top: 0.3rem; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--accent); font-size: 0.88rem; }
mark { background: #eef9b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-list { list-style: none; padding: 0; margin: 0; }
.search-list a { display: flex; flex-direction: column; padding: 0.6rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.search-list li:last-child a { border-bottom: 0; }
.search-list a:hover strong { color: var(--accent); }
@media (max-width: 900px) {
  .quick-search { flex: 1 1 160px; }
}
/* Mobile : logo et déconnexion, puis la recherche sur toute la largeur, puis le menu */
@media (max-width: 600px) {
  .admin-bar .brand-sub { display: none; }
  .admin-bar > form[action="/admin/logout"] { order: 2; margin-left: auto; font-size: 0.9rem; }
  .quick-search { order: 3; flex: 1 1 100%; }
  .admin-nav { order: 4; }
  .quick-search kbd { display: none; }
  .qs-results { left: 0; right: auto; width: 100%; }
}

/* Tableau des tâches */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .kanban { grid-template-columns: minmax(0, 1fr); } }
.kanban-col { background: #ece9e2; border-radius: var(--radius); padding: 0.8rem; min-height: 160px; transition: background 0.15s, box-shadow 0.15s; }
.kanban-col h2 { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; margin: 0.2rem 0.3rem 0.7rem; }
.kanban-col .count { font-size: 0.8rem; font-weight: 500; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 0.05rem 0.6rem; }
.kanban-doing h2 { color: #2b5a99; }
.kanban-done h2 { color: var(--accent); }
.kanban-col.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.kanban-list { padding: 0; list-style: none; margin: 0; display: flex; flex-direction: column; gap: 0.55rem; min-height: 1rem; }
.kanban-list .task { flex-direction: column; gap: 0.5rem; background: var(--surface); border-radius: 12px; padding: 0.75rem 0.85rem; border: 0; box-shadow: 0 1px 2px rgba(31, 42, 55, 0.06); cursor: grab; }
.kanban-list .task:active { cursor: grabbing; }
.kanban-list .task.dragging { opacity: 0.4; }
.kanban-list .task-actions { max-width: none; justify-content: flex-start; gap: 0.3rem 0.7rem; }
.kanban-list .task-edit { text-align: left; }
.kanban-list .task-done { opacity: 0.75; }
.kanban-empty { margin: 0.4rem 0; padding: 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; border: 2px dashed #d6d1c7; border-radius: 12px; }
.kanban-col > .small { margin: 0.7rem 0.3rem 0; }
.kanban-filter select { min-width: 200px; }

/* Questionnaires : import, aperçu, liste sur la fiche */
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
.import-form > label:not(.check) { color: var(--ink); }
.import-form .hint { display: block; }
.import-form details.sub label { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.8rem; }
.qs-step { padding: 0.8rem 0; border-top: 1px solid var(--line); }
.qs-step:first-of-type { border-top: 0; }
.qs-step h3 { margin-bottom: 0.4rem; }
.qs-section { margin: 0.7rem 0 0.3rem; color: var(--accent); font-weight: 500; font-size: 0.92rem; }
.qs-questions { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.45rem; }
.qs-questions li { display: flex; flex-direction: column; }
.qs-meta { color: var(--muted); font-size: 0.8rem; }
.qs-hint { color: #4a5462; font-size: 0.85rem; font-style: italic; }
.qs-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.qs-rows a { color: var(--ink); text-decoration: none; }
.qs-rows a:hover { color: var(--accent); }
.qs-row-side { margin-left: auto; display: inline-flex; align-items: center; gap: 0.5rem; }

/* Abonnements */
.sub-list { margin-bottom: 0.8rem; }
.sub-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; }
.sub-row p { margin: 0 0 0.2rem; }
.sub-main { flex: 1 1 280px; min-width: 0; }
.sub-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.3rem 1rem; }
.sub-actions form { margin: 0; }
.sub-row.is-paused .sub-main { opacity: 0.6; }
.sub-edit { flex-basis: 100%; }
.sub-edit summary { list-style: none; cursor: pointer; display: inline; }
.sub-edit summary::-webkit-details-marker { display: none; }
.sub-edit[open] { background: var(--bg); border-radius: 10px; padding: 0.8rem; }
.sub-form .field-grid { margin-bottom: 0.8rem; }
.issue-form .field-grid { margin-bottom: 0.6rem; }

/* Raccourci discret vers les partages (bas à droite) */
.share-fab { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--line); color: #1db954; opacity: 0.55; transition: opacity 0.15s, transform 0.15s; }
.share-fab svg { width: 24px; height: 24px; fill: currentColor; }
.share-fab:hover, .share-fab:focus-visible { opacity: 1; transform: scale(1.06); }
.share-fab:focus-visible { outline: 2px solid #1db954; outline-offset: 2px; }
.share-fab.has-due { opacity: 0.85; }
.fab-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #c0473d; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
@media print { .share-fab { display: none; } }

/* Partages perso */
.member-list { display: flex; flex-direction: column; gap: 0.8rem; margin: 0.6rem 0 1.2rem; }
.member-list li { border-bottom: 0; padding: 0; }
.member-card { background: var(--bg); border-radius: 12px; padding: 0.9rem 1rem; }
.member-card.is-paused { opacity: 0.6; }
.member-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem 1rem; flex-wrap: wrap; }
.member-head p { margin: 0; }
.member-owed { display: flex; flex-direction: column; align-items: flex-end; }
.due-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.7rem 0 0.5rem; }
.due-chips form { margin: 0; }
.due-chip { font: inherit; font-size: 0.82rem; border: 0; border-radius: 999px; padding: 0.3rem 0.75rem; cursor: pointer; white-space: nowrap; }
.due-chip.paid { background: var(--accent-soft); color: var(--accent); }
.due-chip.unpaid { background: #fbe4e1; color: #8a2a22; font-weight: 500; }
.due-chip.unpaid:hover { box-shadow: inset 0 0 0 2px #c0473d; }
.due-chip.paid:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.due-chip.none { background: transparent; color: var(--muted); cursor: default; box-shadow: inset 0 0 0 1px var(--line); }
.member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.member-actions form { margin: 0; }
.member-advance { flex-basis: 100%; }
.member-advance summary { list-style: none; cursor: pointer; display: inline; }
.member-advance summary::-webkit-details-marker { display: none; }
.member-advance[open] { background: var(--surface); border-radius: 10px; padding: 0.8rem; }
.member-advance .inline-form { margin: 0.4rem 0; }
.member-advance .inline-date { display: flex; align-items: center; gap: 0.4rem; color: var(--ink); font-size: 0.9rem; flex-wrap: wrap; }
.member-advance p { margin: 0; }
.member-history { flex-basis: 100%; }
.member-history summary { list-style: none; cursor: pointer; display: inline; }
.member-history summary::-webkit-details-marker { display: none; }
.member-history[open] { background: var(--surface); border-radius: 10px; padding: 0.8rem; }
.member-history p { margin: 0.2rem 0 0.6rem; }
.member-history table th, .member-history table td { white-space: nowrap; }
.paid-date { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; }
.member-history .paid-date input[type=date] { width: auto !important; padding: 0.2rem 0.4rem !important; font-size: 0.82rem; }
.pay-all { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pay-all .inline-date, .member-advance .inline-date { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.pay-all input[type=date], .member-advance input[type=date] { width: auto !important; padding: 0.3rem 0.5rem !important; font-size: 0.85rem; }
.member-edit { flex-basis: 100%; }
.member-edit summary { list-style: none; cursor: pointer; display: inline; }
.member-edit summary::-webkit-details-marker { display: none; }
.member-edit[open] { background: var(--surface); border-radius: 10px; padding: 0.8rem; }
.member-edit .field-grid { margin-bottom: 0.6rem; }
.add-member input[name=name] { flex: 1 1 140px; }
.add-member input[name=email] { flex: 2 1 220px; }
.add-member .num-input { flex: 0 1 100px; }
.add-member .inline-date { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--muted); flex: 1 1 200px; }
.add-member .inline-date input { flex: 1; }

/* Documents archivés */
.archive-zone { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.archive-zone p { margin: 0 0 0.3rem; }
.archived-docs { margin: -0.5rem 0 1.25rem; }
.archived-docs summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; padding: 0.3rem 0; }
.archived-docs[open] summary { margin-bottom: 0.6rem; }

/* Tableau des clients par étape */
.view-switch { display: inline-flex; background: var(--surface); border-radius: 999px; box-shadow: 0 0 0 1px var(--line); padding: 3px; }
.view-switch a { padding: 0.4rem 0.95rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.view-switch a[aria-current] { background: var(--ink); color: #fff; }
.board-hint { margin: -0.8rem 0 1rem; font-size: 0.9rem; }
.kanban-clients { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, 0.6fr); }
@media (max-width: 1000px) { .kanban-clients { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kanban-clients { grid-template-columns: minmax(0, 1fr); } }
.kanban-stage-prospect h2 { color: #8a5c00; }
.kanban-stage-projet h2 { color: #2b5a99; }
.kanban-stage-suivi h2 { color: var(--accent); }
/* une colonne très remplie (beaucoup de prospects) défile sur place au lieu d'allonger la page */
.kanban-clients .kanban-list { max-height: 72vh; overflow-y: auto; padding: 2px; margin: -2px; scrollbar-width: thin; }
.kanban-archive { background: transparent; box-shadow: inset 0 0 0 2px #d6d1c7; }
.kanban-archive h2 { color: var(--muted); }
.kanban-archive.drop-target { background: #eeebe5; box-shadow: inset 0 0 0 2px var(--muted); }
.client-card { background: var(--surface); border-radius: 12px; padding: 0.7rem 0.8rem; box-shadow: 0 1px 2px rgba(31, 42, 55, 0.06); cursor: grab; list-style: none; }
.client-card:active { cursor: grabbing; }
.client-card.dragging { opacity: 0.4; }
.client-card-head { display: flex; align-items: center; gap: 0.65rem; color: var(--ink); text-decoration: none; min-width: 0; }
.client-card-head > span { display: flex; flex-direction: column; min-width: 0; }
.client-card-head strong { overflow-wrap: anywhere; line-height: 1.3; }
.client-card-head:hover strong { color: var(--accent); }
.client-signals { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.55rem 0 0; }
.client-signals .badge { font-size: 0.75rem; }

/* Actions sans rechargement */
form.is-busy { opacity: 0.6; pointer-events: none; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50; max-width: min(520px, calc(100vw - 2rem)); margin: 0; box-shadow: 0 10px 30px rgba(20, 30, 20, 0.2); animation: toast-in 0.2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Étape du suivi d'un client */
.stage-steps { display: flex; gap: 0.4rem; margin: -0.6rem 0 1.4rem; flex-wrap: wrap; }
.stage-step { display: inline-flex; align-items: center; gap: 0.45rem; font: inherit; font-size: 0.9rem; padding: 0.45rem 0.9rem 0.45rem 0.5rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.stage-step:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.stage-num { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: #eeebe5; font-size: 0.75rem; font-weight: 600; }
.stage-step.is-past { color: var(--ink); }
.stage-step.is-past .stage-num { background: var(--accent-soft); color: var(--accent); }
.stage-step.is-current { cursor: default; color: #fff; font-weight: 500; border-color: transparent; }
.stage-step.is-current .stage-num { background: rgba(255, 255, 255, 0.25); color: #fff; }
.stage-step.is-current.stage-prospect { background: #8a5c00; }
.stage-step.is-current.stage-projet { background: #2b5a99; }
.stage-step.is-current.stage-suivi { background: var(--accent); }
.stage-step.is-current.stage-archive { background: #6b7380; }
.stage-step.stage-archive:not(.is-current) { margin-left: auto; border-style: dashed; }
@media (max-width: 600px) { .stage-step.stage-archive:not(.is-current) { margin-left: 0; } }
.stage-inline { display: inline; }
.stage-select { width: auto !important; padding: 0.25rem 1.8rem 0.25rem 0.7rem !important; border-radius: 999px !important; font-size: 0.82rem !important; border: 0 !important; cursor: pointer; }
.stage-select.stage-prospect { background-color: var(--sun-soft) !important; color: #7a5200; }
.stage-select.stage-projet { background-color: #e5eefb !important; color: #2b5a99; }
.stage-select.stage-suivi { background-color: var(--accent-soft) !important; color: var(--accent); }
.stage-select.stage-archive { background-color: #eeebe5 !important; color: var(--muted); }

/* Logos des clients côté admin */
.client-cell { display: inline-flex; align-items: center; gap: 0.6rem; }
.mini-logo { width: 30px; height: 30px; flex: none; object-fit: contain; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.mini-initial { display: inline-grid; place-items: center; background: #eeebe5; color: var(--muted); font-weight: 600; font-size: 0.85rem; box-shadow: none; }
.fiche-title { display: flex; align-items: center; gap: 1rem; }
.fiche-logo { max-height: 60px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 10px; padding: 0.4rem; box-shadow: var(--shadow); }

/* Charte d'un client */
.charte summary .badge { margin-left: 0.4rem; }
.charte-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 1.5rem; align-items: start; margin-top: 1rem; }
@media (max-width: 760px) { .charte-grid { grid-template-columns: minmax(0, 1fr); } }
.charte-grid .stack > label:not(.check) { color: var(--ink); }
.charte-grid .stack > label .small { color: var(--muted); }
.charte .colors { margin: 0; }
.charte .colors label { gap: 0.35rem; }
.color-field { display: flex; align-items: center; gap: 0.6rem; }
.color-field input[type=color] { width: 52px !important; height: 40px; padding: 3px !important; cursor: pointer; flex: none; }
.color-field code { font-size: 0.85rem; color: var(--muted); }
.charte-preview { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line); background: var(--bg); font-size: 0.85rem; }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; padding: 0.7rem 0.9rem; background: var(--p-header); color: var(--p-head-ink); }
.pv-head img { max-height: 30px; max-width: 140px; object-fit: contain; }
.pv-head span { font-size: 0.75rem; opacity: 0.7; }
.pv-body { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.pv-eyebrow { margin: 0; color: var(--p-primary); filter: brightness(0.8); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.pv-title { margin: 0; font-weight: 600; font-size: 1.05rem; }
.pv-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.pv-cards span { height: 42px; border-radius: 8px; background: #fff; border-top: 4px solid var(--p-primary); box-shadow: var(--shadow); }
.pv-cards span + span { border-top-color: var(--p-secondary); }
.pv-btn { align-self: flex-start; padding: 0.45rem 0.9rem; border-radius: 999px; background: var(--p-primary); color: var(--p-btn-ink); font-size: 0.8rem; }

/* Suivi d'une demande : reçue → en cours → terminée */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 0.8rem 0 1.4rem; counter-reset: step; }
.timeline li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.15rem; padding: 0 0.3rem; min-width: 0; }
.timeline li::before { content: ''; position: absolute; top: 11px; right: 50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.timeline li:first-child::before { display: none; }
.timeline li.is-done::before, .timeline li.is-current::before { background: var(--accent); }
.timeline .dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 3px var(--line); margin-bottom: 0.3rem; }
.timeline li.is-done .dot { background: var(--accent); box-shadow: none; }
.timeline li.is-done .dot::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-ink); font-size: 0.8rem; font-weight: 700; }
.timeline li.is-current .dot { background: var(--surface); box-shadow: inset 0 0 0 3px var(--accent), 0 0 0 5px var(--accent-soft); }
.timeline li.is-current .dot::after { content: none; }
.timeline strong { font-size: 0.92rem; }
.timeline span:not(.dot) { font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.due-client { color: var(--accent); }

/* Du nouveau pour le client */
.badge-fresh { background: var(--btn-bg, var(--accent)); color: var(--btn-ink, #fff); font-weight: 500; }
.news-banner { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1.4rem; padding: 0.9rem 1.1rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.news-banner:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.news-banner > span:nth-child(2) { flex: 1; }
.news-banner > span:last-child { color: var(--accent); font-weight: 600; }
.news-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--btn-bg, var(--accent)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 8%, transparent); } }
@media (prefers-reduced-motion: reduce) { .news-dot { animation: none; } }

/* Aide */
.help-link { white-space: nowrap; font-size: 0.95rem; }
.aide-toc ol { margin: 0; padding-left: 1.3rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0.3rem 1.5rem; }
.aide-toc { padding-top: 1.1rem; padding-bottom: 1.1rem; }
.aide { scroll-margin-top: 1rem; }
.aide h3 { color: var(--ink); font-size: 1rem; margin: 1.1rem 0 0.4rem; }
.aide ol, .aide ul { padding-left: 1.3rem; margin: 0 0 1rem; }
.aide li { margin-bottom: 0.35rem; }
.aide p:last-child { margin-bottom: 0; }
.aide-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 0 1.5rem; }
.aide-cols h3 { margin-top: 0.4rem; }
.aide details { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.aide details:last-child { padding-bottom: 0; }
.aide summary { cursor: pointer; font-weight: 500; }
.aide details p { margin: 0.5rem 0 0; color: #3d4754; }

/* Coordonnées de Comsimple en bas de l'espace */
.espace-foot { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.espace-foot p { margin: 0; }
.espace-foot a { white-space: nowrap; }

.nowrap { white-space: nowrap; }

/* Régler une facture */
.pay-box { background: var(--sun-soft); }
.pay-box p { margin: 0 0 0.5rem; }
.pay-fields { margin: 0.6rem 0 0; display: flex; flex-direction: column; gap: 0.45rem; }
.pay-fields > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; background: var(--surface); border-radius: 10px; }
.pay-fields dt { color: var(--muted); font-size: 0.85rem; }
.pay-fields dd { margin: 0; min-width: 0; }
.pay-fields code { font-size: 0.92rem; overflow-wrap: anywhere; }
.btn.copied { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
@media (max-width: 480px) {
  .pay-fields > div { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-fields dt { grid-column: 1 / -1; }
}

/* Récapitulatif avant l'envoi d'une demande */
dialog.recap { width: min(480px, calc(100vw - 2rem)); border: 0; border-radius: 18px; padding: 1.5rem; box-shadow: 0 20px 60px rgba(20, 30, 20, 0.3); color: var(--ink); }
dialog.recap::backdrop { background: rgba(20, 28, 20, 0.45); }
dialog.recap h2 { margin-bottom: 0.8rem; }
.recap-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.35rem 1rem; margin: 0 0 0.8rem; }
.recap-list dt { color: var(--muted); font-size: 0.9rem; }
.recap-list dd { margin: 0; overflow-wrap: anywhere; }
.recap-body { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.92rem; max-height: 9rem; overflow: auto; }

/* Brouillon retrouvé, enregistrement local */
.draft-notice { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; }
.autosave-state { align-self: center; font-size: 0.82rem; color: var(--muted); }

/* Ajouter l'espace à l'écran d'accueil */
.install-card { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem 1.2rem; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; margin: -0.8rem 0 2rem; border-left: 4px solid var(--accent); }
.install-card p { margin: 0; }
.install-card .small { color: #4a5462; margin-top: 0.2rem; }
.install-actions { display: flex; align-items: center; gap: 1rem; }
.icon-preview { display: flex; align-items: center; gap: 0.9rem; }
.icon-preview canvas { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow), 0 0 0 1px var(--line); flex: none; }
.icon-preview p { margin: 0; }

/* En-tête de l'espace client, à ses couleurs */
.espace-head .save-state { color: var(--head-muted, var(--muted)); margin-left: auto; }
.espace-head { background: var(--head-bg, var(--surface)); box-shadow: 0 1px 0 rgba(31, 42, 55, 0.08); min-height: 68px; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.espace-brand { display: flex; align-items: center; min-width: 0; text-decoration: none; }
.client-logo { display: block; max-height: 46px; max-width: min(220px, 55vw); width: auto; height: auto; object-fit: contain; }
.client-name { font-weight: 600; font-size: 1.1rem; color: var(--head-ink, var(--ink)); overflow-wrap: anywhere; }
.by-comsimple { display: flex; align-items: center; gap: 0.4rem; flex: none; text-decoration: none; color: var(--head-muted, var(--muted)); font-size: 0.75rem; }
.by-comsimple .cs-logo { height: 13px; }
.by-comsimple .cs-logo-dark { opacity: 0.6; }
@media (max-width: 900px) {
  .admin-nav { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
}
.admin-wrap { max-width: 1140px; }
.h-sub { font-weight: 400; font-size: 0.6em; }
.flash { border-radius: var(--radius); padding: 0.8rem 1.1rem; margin: 0 0 1.25rem; }
.flash-ok { background: var(--accent-soft); color: #165a50; }
.flash-error { background: #fbe4e1; color: #8a2a22; }
.flash a { color: inherit; }
.section-title { margin: 2rem 0 0.8rem; font-size: 1.1rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.card-head h2 { margin: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.pill { padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--surface); color: var(--muted); text-decoration: none; font-size: 0.9rem; box-shadow: 0 0 0 1px var(--line); }
.pill:hover { color: var(--ink); }
.pill.active { background: var(--ink); color: #fff; box-shadow: none; }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.875rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.late { color: var(--danger); }
.strong { font-weight: 600; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 0.8rem; }
.stack > label:not(.check) { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.stack > div:has(> .btn) { display: flex; }
.stack > .field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); }
.stack > .field > label { display: flex; flex-direction: column; }
.text-tools { display: flex; gap: 0.4rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.6rem 0; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 180px; }

/* Mon Builder : sites et liens de mise à jour */
.builder-version { font-size: 1.1rem; }
.builder-sites td { vertical-align: top; }
.builder-sites .inline-rename { display: flex; gap: 0.4rem; align-items: center; }
.builder-sites .inline-rename input { padding: 0.35rem 0.5rem; max-width: 16rem; }
.builder-sites form.inline { display: inline; }
.builder-sites .link-field { font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; padding: 0.35rem 0.5rem; margin-bottom: 0.4rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.wide-label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; color: var(--muted); margin: 0 0 1.2rem; }
details.sub { margin: 0 0 1.2rem; }
details.sub summary { cursor: pointer; color: var(--accent); margin-bottom: 0.8rem; }
.field-grid .check, label.check { color: var(--ink); flex-direction: row; }
.export-buttons form { margin: 0; }
.stack-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge-late, .badge-refused { background: #fbe4e1; color: #9b3128; }
.badge-draft { background: #eeebe5; color: var(--muted); }
.badge-none { background: #eeebe5; color: var(--muted); }
.badge-stage-prospect { background: var(--sun-soft); color: #7a5200; }
.badge-stage-projet { background: #e5eefb; color: #2b5a99; }
.badge-stage-suivi { background: var(--accent-soft); color: var(--accent); }
.badge-stage-archive { background: #eeebe5; color: var(--muted); }
.table-scroll { overflow-x: auto; }
table.compact th, table.compact td { padding: 0.5rem 0.6rem; }

/* Chiffres clés */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 1.5rem; margin: 0 0 1.25rem; }
.kpis.card { padding: 1.2rem 1.6rem; }
.kpis dt { color: var(--muted); font-size: 0.85rem; }
.kpis dd { margin: 0.15rem 0 0; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpis.months dd { font-size: 1.05rem; }
.fiche-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 0 1.25rem; }
.fiche-grid .kpis { margin: 0; }

/* Tâches */
.tasks { list-style: none; padding: 0; margin: 0.6rem 0 0; }
.tasks.card { padding: 0.4rem 1.4rem; }
.task { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-main { flex: 1; min-width: 0; }
.task-title { margin: 0; overflow-wrap: anywhere; }
.task-title a { color: var(--ink); }
.task-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { margin: 0.1rem 0 0; font-size: 0.85rem; color: var(--muted); }
.task-meta a { color: var(--muted); }
.task-details { margin: 0.3rem 0 0; font-size: 0.9rem; color: #4a5462; white-space: pre-wrap; }
.task-actions { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; justify-content: flex-end; max-width: 50%; }
.task-actions form { margin: 0; }
.task-edit { flex-basis: 100%; text-align: right; }
.task-edit summary { list-style: none; cursor: pointer; display: inline; }
.task-edit summary::-webkit-details-marker { display: none; }
.task-edit[open] { text-align: left; background: var(--bg); border-radius: 10px; padding: 0.8rem; margin-top: 0.4rem; }
.task-edit[open] summary { display: block; margin-bottom: 0.6rem; }
.due.late { color: var(--danger); font-weight: 500; }
.task-new { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.task-new input[name=title] { flex: 3 1 240px; }
.task-new input[type=date], .task-new select { flex: 1 1 150px; width: auto; }
@media (max-width: 640px) {
  .task { flex-direction: column; gap: 0.5rem; }
  .task-actions { max-width: none; justify-content: flex-start; }
  .task-edit { text-align: left; }
}

/* Documents */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
@media (max-width: 960px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } }
.sheet { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.2rem, 4vw, 2.4rem); font-size: 0.95rem; }
.sheet p { margin: 0; }
.sheet-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1rem 2rem; margin-bottom: 1.8rem; }
.sheet-parties > div:last-child { background: var(--bg); border-radius: 10px; padding: 0.9rem 1.1rem; }
.sheet-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.3rem !important; }
.sheet-title { font-size: 1.4rem; margin-bottom: 0.4rem; }
.sheet-object { margin-bottom: 0.6rem !important; }
.sheet-infos { display: flex; flex-wrap: wrap; gap: 0.3rem 1.6rem; margin: 0 0 1.2rem; font-size: 0.88rem; }
.sheet-infos dt { color: var(--muted); display: inline; }
.sheet-infos dt::after { content: ' : '; }
.sheet-infos dd { display: inline; margin: 0; }
.sheet-intro { margin-bottom: 1rem !important; white-space: pre-wrap; }
table.lines th, table.lines td { padding: 0.65rem 0.6rem; white-space: normal; vertical-align: top; }
table.lines thead th { background: var(--accent); color: #fff; font-size: 0.8rem; }
table.lines thead th:first-child { border-radius: 8px 0 0 8px; }
table.lines thead th:last-child { border-radius: 0 8px 8px 0; }
table.lines td.num { white-space: nowrap; }
.designation strong { font-weight: 600; }
.designation span { display: block; color: var(--muted); font-size: 0.88rem; white-space: pre-wrap; margin-top: 0.15rem; }
table.totals { width: auto; min-width: 260px; margin: 1rem 0 0 auto; }
table.totals th, table.totals td { padding: 0.35rem 0.8rem; border: 0 !important; font-weight: 400; color: var(--ink); font-size: 0.95rem; }
table.totals tr.strong { background: var(--bg); font-weight: 600; }
table.totals tr.strong th, table.totals tr.strong td { font-weight: 600; }
/* Petit écran : chaque ligne devient une carte (désignation, puis quantité, prix, montant) */
@media (max-width: 600px) {
  table.lines thead { display: none; }
  table.lines, table.lines tbody, table.lines tr, table.lines td { display: block; width: 100%; }
  table.lines tr { padding: 0.7rem 0; border-top: 1px solid var(--line); }
  table.lines tbody tr + tr td { border-top: 0; }
  table.lines td { padding: 0.1rem 0; }
  table.lines td.num { display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  table.lines td.num::before { content: attr(data-label); color: var(--muted); font-size: 0.85rem; }
  table.lines td.strong-cell { font-weight: 600; }
  table.totals { width: 100%; min-width: 0; }
}
.sheet-notes { margin-top: 1.4rem !important; white-space: pre-wrap; }
.sheet-mentions { list-style: none; padding: 1rem 0 0; margin: 1.4rem 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; display: flex; flex-direction: column; gap: 0.25rem; }

/* Éditeur de lignes */
table.lines-edit th, table.lines-edit td { padding: 0.35rem 0.3rem; vertical-align: top; white-space: normal; }
table.lines-edit tbody tr + tr td { border-top: 1px solid var(--line); }
table.lines-edit td:first-child { min-width: 220px; width: 45%; }
table.lines-edit textarea { min-height: 2.4rem; margin-top: 0.3rem; font-size: 0.9rem; }
.num-input { text-align: right; min-width: 5rem; }
.num-input.tiny { width: 4.5rem !important; min-width: 0; padding: 0.3rem 0.5rem !important; }
.unit-input { min-width: 5.5rem; }
.line-total { padding-top: 0.9rem !important; white-space: nowrap !important; }
[data-remove-line] { text-decoration: none; padding: 0.6rem 0.2rem !important; }
.lines-tools { display: flex; flex-wrap: wrap; gap: 0.8rem 1.5rem; align-items: center; margin: 0.8rem 0; }
.lines-tools .inline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.lines-tools select { width: auto; }
.invoice-from { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); gap: 0.5rem; }
.invoice-from .check { align-items: center; }
.payment-form { margin: 1rem 0 0; }
.payment-form > div { display: flex; align-items: flex-end; }

/* Demandes */
.request-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border-radius: 10px; padding: 1rem 1.2rem; margin: 0.6rem 0 1rem; max-height: 32rem; overflow-y: auto; }
.photo-grid { list-style: none; padding: 0; margin: 0.6rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; }
.photo-grid li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); }
.photo-grid a, .photo-grid img { display: block; width: 100%; height: 100%; }
.photo-grid img { object-fit: cover; }
.file-chip { display: grid; place-items: center; height: 100%; padding: 0.5rem; font-size: 0.75rem; text-align: center; overflow-wrap: anywhere; color: var(--muted); }
.file-remove { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(31, 42, 55, 0.75); color: #fff; cursor: pointer; font-size: 0.75rem; line-height: 1; }
.files .file-remove { position: static; flex: none; background: none; color: var(--danger); }
.thread { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.msg { max-width: 92%; border-radius: 12px; padding: 0.6rem 0.9rem; background: var(--bg); }
.msg-me { align-self: flex-end; background: var(--accent-soft); }
.msg-meta { margin: 0 0 0.15rem; font-size: 0.78rem; color: var(--muted); }
.msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.progress { height: 8px; border-radius: 4px; background: #eeebe5; overflow: hidden; margin-top: 0.6rem; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.uploader { display: flex; flex-direction: column; }
.uploader .label { margin: 0; }
.uploader .hint { margin-bottom: 0.4rem; }
.uploader .upload { align-self: flex-start; }

/* ---------- Espace client ---------- */

.espace-wrap { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.espace .topbar { position: static; }
.espace h2 { font-size: 1.15rem; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.8rem; margin: 1.5rem 0 2rem; }
.action-card { display: flex; flex-direction: column; gap: 0.3rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); transition: transform 0.12s, box-shadow 0.12s; border-top: 4px solid var(--accent); }
.action-card:hover { transform: translateY(-2px); }
.action-modification { border-top-color: var(--stripe-1, var(--accent)); }
.action-article { border-top-color: var(--stripe-2, var(--sun)); }
.action-album { border-top-color: var(--stripe-3, #6b8fd6); }
.action-autre { border-top-color: #b9b2a5; }
.action-title { font-weight: 600; }
.action-desc { color: var(--muted); font-size: 0.88rem; }
/* Mobile : les 4 actions en deux colonnes, pour garder les demandes à portée de pouce */
@media (max-width: 520px) {
  .action-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; margin: 1.2rem 0 1.6rem; }
  .action-card { padding: 0.9rem 0.9rem 1rem; }
  .action-title { font-size: 0.95rem; line-height: 1.3; }
  .action-desc { display: none; }
}
.rows { list-style: none; padding: 0; margin: 0; }
.row-link a { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; padding: 0.8rem 0.4rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.row-link:last-child a { border-bottom: 0; }
.row-link a:hover { background: var(--bg); }
.row-main { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.row-main .small { margin-top: 0.1rem; }
.row-side { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.notice-action { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--sun-soft); }
.notice-action form { margin: 0; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.doc-head h1 { margin: 0; overflow-wrap: anywhere; }
.accept-form { background: var(--accent-soft); box-shadow: none; }
.accept-form .check span { font-size: 0.95rem; }
.espace .block .stack label { color: var(--ink); font-size: 1rem; }
.espace .block .stack label .hint { font-size: 0.88rem; }
.espace label.short input { max-width: 220px; }
.espace .sheet { margin-top: 1rem; }

@media print {
  body { background: #fff; }
  .topbar, .no-print { display: none !important; }
  .card { box-shadow: none; padding: 0; margin-bottom: 1.5rem; break-inside: auto; }
  .answers dt { break-after: avoid; }
}

/* URSSAF (tableau de bord) */
.urssaf-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line, #e5e1d8); }
.urssaf-row:last-child { border-bottom: 0; }
.urssaf-side { display: flex; align-items: center; gap: .75rem; }
.urssaf-side form { margin: 0; }
.urssaf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin-top: .5rem; }
.urssaf-foot form { margin: 0; }
#urssaf { scroll-margin-top: 10rem; }
.urssaf-kpis { margin: .25rem 0 1rem; }
.urssaf-pay { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin: 0; }
.urssaf-pay label { display: flex; flex-direction: column; gap: .2rem; }
.urssaf-pay input[name="amount"] { width: 7.5rem; }
.urssaf-pay input[type="date"] { width: 10rem; }
.urssaf-history { margin-top: .75rem; }
.urssaf-history summary { cursor: pointer; }
.share-client summary { cursor: pointer; }
.share-client form { margin-top: 1rem; }
.share-kind { border: 0; padding: 0; margin: 0; display: grid; gap: .35rem; }
