/* Charte e-Conception : Lexend (titres), Mulish (texte), #011037, #FD1741, #65B0E5, #BDCCEA */
:root {
    --navy: #011037; --red: #FD1741; --sky: #65B0E5; --pale: #BDCCEA;
    --bg: #F4F6FB; --surface: #FFFFFF; --band: #EAF0FA; --line: #D5DDEE;
    --fg: #1B2340; --muted: #5A6585; --link: #1F6FB0; --head: #011037;
    --ok: #1E8A5B; --warn: #B7791F;
    --hf: 'Lexend', system-ui, sans-serif; --bf: 'Mulish', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--bf); padding: 0 16px 48px; }
h1, h2, h3 { font-family: var(--hf); color: var(--head); font-weight: 600; margin: 0; }
h1 { font-size: 26px; line-height: 1.2; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 4px 0 0; }
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.wrap { max-width: 1080px; margin: 0 auto; }

.top { margin: 0 -16px; padding: 12px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 5; }
.top .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-family: var(--hf); font-weight: 600; font-size: 18px; color: #fff; text-decoration: none; }
.logo b { color: var(--red); }
.baseline { font-size: 13px; color: var(--pale); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--pale); }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 8px 14px; cursor: pointer; font-weight: 700; text-decoration: none; color: var(--fg); }
.btn:hover { border-color: var(--link); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { filter: brightness(.95); }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.stack { display: flex; flex-direction: column; gap: 20px; padding-top: 28px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .hint { font-size: 13px; color: var(--muted); }
.note { background: var(--band); border-left: 4px solid var(--red); padding: 12px 16px; border-radius: 0 6px 6px 0; }
.err { color: var(--red); font-weight: 700; font-size: 14px; }
.flash { margin-top: 20px; padding: 10px 14px; border-radius: 6px; background: var(--band); border-left: 4px solid var(--sky); }
.flash-erreur { border-left-color: var(--red); }

.tablewrap { overflow-x: auto; padding: 8px 12px; }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th { font-family: var(--hf); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; text-align: left; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); font-weight: 500; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--band); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.avancement { min-width: 140px; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 10px; border: 1px solid currentColor; white-space: nowrap; }
.pill-non_commence, .pill-client-brouillon { color: var(--muted); }
.pill-en_cours { color: var(--warn); }
.pill-envoye, .pill-client-ouvert { color: var(--ok); }
.pill-client-clos { color: var(--navy); }
.bar { height: 8px; background: var(--band); border-radius: 4px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--sky); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.grid-large { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.svc { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.svc h3 { overflow-wrap: anywhere; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13px; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; min-width: 0; }
.login { max-width: 440px; margin: 28px auto 0; }

/* ---------- Saisie ---------- */
a.svc { color: inherit; text-decoration: none; cursor: pointer; }
a.svc:hover { border-color: var(--link); }
.crumb { font-size: 14px; color: var(--muted); }
.saved { font-size: 13px; color: var(--ok); font-weight: 700; }
.req { color: var(--red); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
details summary { cursor: pointer; font-weight: 700; color: var(--link); }
.exemples table { margin-top: 8px; min-width: 900px; }
.lines { padding: 8px; }
.saisie td { padding: 6px; vertical-align: top; }
.saisie-a, .saisie-b { min-width: 1180px; }
.saisie-c { min-width: 820px; }
.saisie textarea { resize: vertical; min-height: 38px; min-width: 160px; }
.saisie select, .saisie input[type=text] { min-width: 120px; }
.saisie td.hrs { font-weight: 700; white-space: nowrap; padding-top: 14px; }
.saisie td.vide { padding: 16px 10px; }
.saisie tfoot td { border-bottom: 0; padding-top: 10px; }
.saisie select:disabled, .saisie input:disabled, .saisie textarea:disabled { background: var(--band); color: var(--fg); opacity: 1; }
.saisie tr.incomplete td { background: #FFF1F3; }
.saisie tr.incomplete td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.autre { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-weight: 400; flex-direction: row; }
.autre input { min-width: 70px !important; width: 80px; }
.autre select { min-width: 110px; }
.actions-ligne { display: flex; gap: 4px; padding-top: 4px; }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--navy); color: #fff; padding: 8px 16px; border-radius: 6px; font-weight: 700; font-size: 14px; z-index: 30; box-shadow: 0 6px 18px rgba(1,16,55,.25); }
.toast::before { content: "✓ "; color: var(--sky); }

/* Menu à cases à cocher (partie C) */
.ms { position: relative; min-width: 200px; }
.ms summary { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 28px 8px 10px; font-weight: 400; color: var(--fg); position: relative; }
.ms summary::-webkit-details-marker { display: none; }
.ms summary::after { content: "\25BE"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.ms[open] summary { border-color: var(--link); }
.mslist { display: none; flex-direction: column; position: fixed; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px; box-shadow: 0 8px 24px rgba(1,16,55,.22); max-height: min(320px, 60vh); overflow-y: auto; }
.ms[open] .mslist { display: flex; }
.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.chk:hover { background: var(--band); }
.chk input { width: auto; }

/* ---------- Suivi ---------- */
.lien-fort { font-weight: 700; }
.pill-retard { color: var(--red); }
.avancement-global { min-width: 200px; }
.suivi { min-width: 820px; }
.suivi td.actions { white-space: nowrap; }
.suivi td.actions form { display: inline; margin-left: 4px; }
.suivi tbody.annexes tr:first-child td { border-top: 2px solid var(--line); }
.reponses { min-width: 980px; }
.reponses td { vertical-align: top; }
.reponses tr.incomplete td { background: #FFF1F3; }
.reponses tfoot td { border-bottom: 0; }
.texte-long { white-space: pre-line; max-width: 280px; }
.infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; margin: 0; }
.infos dt { font-family: var(--hf); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.infos dd { margin: 2px 0 0; }

/* ---------- Administration ---------- */
.who a { color: var(--pale); }
.who a:hover { color: #fff; }
.nowrap { white-space: nowrap; }
form.inline { display: inline; }
.barre-actions { gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; align-items: start; }
.form-grid > div, .stack-sm > div:has(> label) { display: flex; flex-direction: column; gap: 4px; }
form label.required::after { content: " *"; color: var(--red); }
/* Libellés des formulaires Symfony (libellé séparé du champ) : en bloc, pour que l'astérisque reste sur la même ligne. */
.form-grid > div > label, .stack-sm > div > label { display: block; }
.help-text, [id$="_help"] { font-size: 12px; color: var(--muted); font-weight: 400; }
form ul { list-style: none; padding: 0; margin: 2px 0 0; }
form ul li { color: var(--red); font-weight: 700; font-size: 13px; }
.cred { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; background: var(--band); border-radius: 6px; padding: 14px; }
.cred code { font-family: ui-monospace, Menlo, monospace; font-size: 15px; background: var(--surface); padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line); overflow-wrap: anywhere; }
.zone-danger { border-color: var(--red); }
.services-admin { min-width: 760px; }
.services-admin .renommer { flex-wrap: nowrap; }
.services-admin .renommer input { min-width: 200px; }
label.grow { flex: 1; }
.exemples-admin { min-width: 1100px; }
.exemples-admin td { padding: 4px; vertical-align: top; }
.exemples-admin input, .exemples-admin select { min-width: 110px; }
/* Ligne libellé + champ + bouton : bouton aligné sur le champ, pas sur le libellé. */
.row.row-bas { align-items: flex-end; }
/* Bloc de saisie (titre, tableau, boutons) : même respiration que le reste de la page. */
.tableau-saisie { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Saisie en cartes (parties A et B) ---------- */
.cartes { display: flex; flex-direction: column; gap: 14px; }
.carte-ligne { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.carte-ligne.incomplete { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.carte-entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.carte-entete h3 { font-size: 15px; }
.carte-entete .hrs { font-weight: 700; white-space: nowrap; color: var(--head); }
.carte-entete .actions-ligne { padding-top: 0; }
.champ { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 13px; min-width: 0; }
.champ .libelle { display: block; }
.champ .aide { font-weight: 400; color: var(--muted); }
.champ textarea { resize: vertical; min-height: 60px; line-height: 1.45; overflow-y: hidden; }
.champ select:disabled, .champ input:disabled, .champ textarea:disabled { background: var(--band); color: var(--fg); opacity: 1; }
.champs-courts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: start; }
.champs-longs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.recap { margin: -6px 0 0; }
.cartes .vide { margin: 0; }
.saisie-c textarea { overflow-y: hidden; }

/* Logo e-Conception (image blanche et rouge sur le bandeau bleu nuit) */
.logo { display: inline-flex; align-items: center; line-height: 0; }
.logo img { height: 24px; width: auto; display: block; }
