/* =====================================================================
   Plateforme RSR · IA de Louga
   Charte : bleu du Ministère de l'Éducation nationale
   ===================================================================== */

:root {
    --navy: #0a2554;
    --navy-2: #0f3576;
    --primary: #1652b0;
    --primary-dark: #0e3f8a;
    --primary-50: #f0f5fd;
    --primary-100: #dce8fa;
    --primary-200: #b9d0f3;
    --bg: #f2f5f9;
    --panel: #ffffff;
    --text: #0e1a2e;
    --text-2: #3a4a63;
    --muted: #6a7a91;
    --border: #e1e7ef;
    --border-strong: #c9d3e1;
    --green: #15803d;
    --green-50: #e9f7ee;
    --red: #b42318;
    --red-50: #fdecea;
    --amber: #a15c07;
    --amber-50: #fdf3e2;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(14, 26, 46, .05);
    --shadow: 0 1px 2px rgba(14, 26, 46, .04), 0 6px 20px rgba(14, 26, 46, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; color: var(--navy); }
p { margin: 0 0 12px; }
small { color: var(--muted); }

/* ---------- Barre supérieure ---------- */

.topbar {
    position: sticky; top: 0; z-index: 40;
    background: linear-gradient(100deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(10, 37, 84, .25);
}
.topbar::after {
    content: ""; display: block; height: 3px;
    background: linear-gradient(90deg, #1652b0, #4c8be6 50%, #1652b0);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }

.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18);
}
.brand-text strong { display: block; font-size: 16px; font-weight: 750; letter-spacing: .01em; }
.brand-text small { display: block; color: #b8c8e4; font-size: 12px; }

.topbar-right { display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
    white-space: nowrap;
    color: #dbe5f5; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255, 255, 255, .1); color: #fff; }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--navy); font-weight: 800; font-size: 12px; }

main { padding: 28px 0 56px; }

/* ---------- Éléments de base ---------- */

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header p { color: var(--muted); margin: 0; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-blue { background: var(--primary-100); color: var(--primary-dark); }
.badge-gray { background: #edf1f6; color: var(--text-2); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.alert div + div { margin-top: 4px; }
.alert.error { background: var(--red-50); color: var(--red); border-color: #f6c9c4; }
.alert.success { background: var(--green-50); color: var(--green); border-color: #bfe6cc; }
.alert.info { background: var(--primary-50); color: var(--primary-dark); border-color: var(--primary-100); }
.alert strong { display: block; margin-bottom: 4px; }

/* ---------- Boutons ---------- */

button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px; border: 1px solid var(--primary); border-radius: var(--radius-sm);
    background: var(--primary); color: #fff;
    font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover, .btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
button:focus-visible, .btn:focus-visible { outline: 3px solid var(--primary-200); outline-offset: 2px; }
.btn-ghost { background: #fff; color: var(--primary); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--primary-50); color: var(--primary-dark); border-color: var(--primary-200); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Champs ---------- */

label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }

input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: #fff; color: var(--text); font: inherit; font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
input[readonly] { background: #f6f8fb; color: var(--muted); }
::placeholder { color: #a3afc0; }

/* Oui / Non */
.yesno { display: inline-flex; gap: 6px; }
.yn {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    margin: 0; padding: 6px 12px 6px 9px;
    border: 1px solid var(--border-strong); border-radius: 999px;
    background: #fff; color: var(--text-2);
    font-size: 13px; font-weight: 600; cursor: pointer; user-select: none;
    transition: background .15s, border-color .15s, color .15s;
}
.yn input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.yn:hover { border-color: var(--primary-200); background: var(--primary-50); }
.yn-yes:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.yn-yes:has(input:checked) input { accent-color: #fff; }
.yn-no:has(input:checked) { background: #e8edf4; border-color: #b9c4d4; color: var(--text); }
.yn:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-100); }

/* Champs conditionnels */
.dep[hidden] { display: none !important; }
.dep-row.is-hidden { display: none; }
.dep-placeholder { color: #a3afc0; font-size: 13px; }

/* ---------- Tableaux ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 4px; background: #fff; }
.form-table, .data-table { width: 100%; border-collapse: collapse; }
.form-table th, .form-table td, .data-table th, .data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.form-table tr:last-child td, .data-table tr:last-child td { border-bottom: 0; }
.form-table thead th, .form-table tr:first-child th, .data-table th {
    background: #f6f8fb; color: var(--muted);
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.form-table th[scope="row"], .form-table td:first-child { color: var(--text); font-weight: 500; }
.form-table tbody tr:hover, .data-table tr:hover td { background: #fafcff; }
.form-table td small { display: block; font-size: 12px; margin-top: 2px; }
.form-table input[type="number"] { min-width: 84px; max-width: 140px; }
.form-table input[type="text"], .form-table input[type="tel"] { min-width: 160px; }
.form-table select { min-width: 170px; }
.form-table.kv-table tr th { width: 38%; background: #f6f8fb; color: var(--text-2); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 600; }

/* ---------- Tableau de bord ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { display: flex; align-items: center; gap: 14px; margin: 0; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }

.progress { height: 8px; border-radius: 999px; background: #e6ebf2; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #4c8be6); }
.progress-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.progress-cell .progress { flex: 1; }
.progress-cell small { min-width: 38px; text-align: right; font-weight: 700; color: var(--text-2); }

/* ---------- Rapport ---------- */

.progress-card { min-width: 300px; margin: 0; padding: 18px 20px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.progress-top span { font-size: 13px; color: var(--muted); font-weight: 600; }
.progress-top strong { font-size: 24px; color: var(--navy); font-variant-numeric: tabular-nums; }

.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.section-card {
    display: flex; flex-direction: column; gap: 14px;
    padding: 18px; background: #fff; color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.section-card:hover { border-color: var(--primary-200); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.section-card-top { display: flex; align-items: center; justify-content: space-between; }
.num { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.section-card.done .num { background: var(--green-50); color: var(--green); }
.section-card-title { font-weight: 700; font-size: 15px; line-height: 1.35; flex: 1; }
.section-card-foot { font-size: 13px; font-weight: 700; color: var(--primary); }

/* ---------- Saisie d'une section ---------- */

.stepper { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 14px; scrollbar-width: thin; }
.step {
    flex: none; display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px 6px 6px; border: 1px solid var(--border); border-radius: 999px;
    background: #fff; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.step:hover { border-color: var(--primary-200); color: var(--primary-dark); }
.step .step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #edf1f6; font-size: 12px; font-weight: 800; }
.step.done .step-num { background: var(--green-50); color: var(--green); }
.step.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.active .step-num { background: rgba(255, 255, 255, .2); color: #fff; }

.section-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.section-head .num { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
.section-head h1 { font-size: 22px; margin: 0 0 2px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.subcard { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 16px; background: #fbfcfe; }
.subcard h3 { margin-bottom: 12px; }
.hint { color: var(--muted); font-size: 14px; }

.form-actions {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin: 20px -22px -22px; padding: 14px 22px;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
    border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}
.form-actions .spacer { flex: 1; }

/* ---------- Connexion ---------- */

.auth { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 20px 0; }
.auth-card { display: grid; grid-template-columns: 1fr 1fr; width: min(880px, 100%); padding: 0; overflow: hidden; }
.auth-aside {
    padding: 36px; color: #fff;
    background: radial-gradient(circle at 20% 0%, rgba(76, 139, 230, .45), transparent 55%), linear-gradient(160deg, var(--navy), var(--navy-2));
    display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
}
.auth-aside h2 { font-size: 24px; color: #fff; margin-bottom: 10px; }
.auth-aside p { color: #c9d7ef; font-size: 14px; }
.auth-aside ul { margin: 0; padding: 0; list-style: none; font-size: 14px; color: #dbe5f5; }
.auth-aside li { padding: 6px 0 6px 22px; position: relative; }
.auth-aside li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; border-radius: 2px; background: #4c8be6; }
.auth-form { padding: 36px; }
.auth-form h1 { font-size: 22px; }
.auth-form button { width: 100%; margin-top: 20px; padding: 12px; }

/* ---------- Pied de page ---------- */

.footer { border-top: 1px solid var(--border); padding: 18px 0; color: var(--muted); font-size: 13px; background: #fff; }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Pages utilitaires (installation, mise à jour) ---------- */

.narrow { max-width: 520px; margin: 40px auto; }
.narrow button { width: 100%; margin-top: 18px; }

/* ---------- Administration (module 2) ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type="text"] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; min-width: 170px; }
.actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
.actions form { margin: 0; }
.btn-danger-ghost { background: #fff; color: var(--red); border-color: #f2c4bf; }
.btn-danger-ghost:hover { background: var(--red-50); color: var(--red); border-color: var(--red); }
.badge-red { background: var(--red-50); color: var(--red); }
.row-off td { background: #fafbfc; color: var(--muted); }
.row-off strong { color: var(--muted); }
.code { white-space: nowrap; }
.code, .credentials code { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 13px; background: #f1f4f8; padding: 2px 7px; border-radius: 6px; }
a.user-chip { color: #fff; }
a.user-chip:hover { background: rgba(255, 255, 255, .18); color: #fff; }

.form-section { margin: 22px 0 4px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid > [hidden] { display: none; }
.inline-help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.checkbox-field { display: flex; align-items: flex-end; padding-bottom: 10px; }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--text); }
label.check input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }

.credentials { background: #fff; border: 1px solid var(--primary-200); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.credentials-head strong { display: block; color: var(--navy); font-size: 16px; }
.credentials-head span { color: var(--muted); font-size: 14px; }
.credentials-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 28px; margin: 14px 0 10px; }
.credentials-grid small { display: block; margin-bottom: 4px; }
.credentials code { font-size: 18px; font-weight: 700; padding: 6px 12px; color: var(--navy); background: var(--primary-50); letter-spacing: .03em; }

.narrow-card { width: min(460px, 100%); padding: 28px; }

/* ---------- Circuit du rapport (module 3) ---------- */

.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #f5a524; color: #3b2300; font-size: 11px; font-weight: 800; }

.status-panel { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius); border: 1px solid; background: #fff; }
.status-panel strong { display: block; font-size: 16px; margin-bottom: 2px; }
.status-panel p { margin: 4px 0 0; color: var(--text-2); }
.status-panel blockquote { margin: 10px 0 0; padding: 10px 14px; background: rgba(255, 255, 255, .7); border-left: 3px solid currentColor; border-radius: 0 8px 8px 0; color: var(--text); white-space: normal; }
.status-icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; }
.status-red { background: var(--red-50); border-color: #f2c4bf; }
.status-red strong, .status-red blockquote { color: var(--red); }
.status-red .status-icon { background: var(--red); }
.status-amber { background: var(--amber-50); border-color: #f1d7a8; }
.status-amber strong { color: var(--amber); }
.status-amber .status-icon { background: #f5a524; font-size: 15px; }
.status-green { background: var(--green-50); border-color: #bfe6cc; }
.status-green strong, .status-green blockquote { color: var(--green); }
.status-green .status-icon { background: var(--green); }
.status-blue { background: var(--primary-50); border-color: var(--primary-100); }
.status-blue strong { color: var(--primary-dark); }
.status-blue .status-icon { background: var(--primary); }
.status-sections { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px !important; }
.status-panel .badge-red { background: #fff; border: 1px solid #f2c4bf; padding: 4px 10px; }
a.badge-red:hover { background: #f9d6d1; color: var(--red); }

.section-card.fix { border-color: #f2c4bf; box-shadow: 0 0 0 3px var(--red-50); }
.section-card.fix .num { background: var(--red-50); color: var(--red); }
.section-card.fix .section-card-foot { color: var(--red); }
.step.fix .step-num { background: var(--red-50); color: var(--red); }

.submit-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; border-color: var(--primary-200); background: linear-gradient(180deg, #fff, var(--primary-50)); }
.submit-text { flex: 1 1 360px; }
.submit-text p { margin: 0; color: var(--text-2); }
.confirm-box { flex: 1 1 100%; padding: 16px; border: 1px solid #f1d7a8; background: var(--amber-50); border-radius: 12px; }
.confirm-box strong { color: var(--amber); }
.confirm-box ul { margin: 6px 0 14px; padding-left: 20px; columns: 2; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.confirm-actions form { margin: 0; }

.form-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-fieldset[disabled] input, .form-fieldset[disabled] select { background: #f6f8fb; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
.form-fieldset[disabled] .yn { cursor: default; }
.form-fieldset[disabled] .yn:not(:has(input:checked)) { opacity: .45; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 600; font-size: 14px; }
.tab:hover { color: var(--primary-dark); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #edf1f6; color: var(--text-2); font-size: 12px; font-weight: 700; text-align: center; }
.tab.active .tab-count { background: var(--primary-100); color: var(--primary-dark); }
.tab-count.hot { background: #f5a524; color: #3b2300; }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

a.stat-link { color: inherit; transition: border-color .15s, box-shadow .15s; }
a.stat-link:hover { border-color: var(--primary-200); color: inherit; }
.stat-hot { border-color: #f1d7a8; box-shadow: 0 0 0 3px var(--amber-50); }
.stat-text { font-size: 15px; font-weight: 700; color: var(--navy); margin-top: 2px; }

.dossier-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.section-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.section-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.section-row:hover { background: var(--primary-50); color: var(--text); }
.section-row .num { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
.section-row-title { flex: 1; font-size: 14px; font-weight: 600; }

.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.decision { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; }
.decision h3 { margin: 0 0 4px; }
.decision .hint { font-size: 13px; margin-bottom: 4px; }
.decision button { margin-top: 14px; align-self: flex-start; }
.decision-ok { border-top: 3px solid var(--green); }
.decision-ko { border-top: 3px solid var(--red); }
.btn-success { background: var(--green); border-color: var(--green); }
.btn-success:hover { background: #116a32; border-color: #116a32; }
.check-grid { display: grid; grid-template-columns: 1fr; gap: 6px; max-height: 190px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fbfcfe; }
.check-grid label.check { font-size: 13px; font-weight: 500; }
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }

.reopen { margin-top: 12px; }
.reopen summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }

.timeline-card { position: sticky; top: 90px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 18px 6px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--primary-200); }
.timeline li strong { display: block; font-size: 14px; }
.timeline li small { display: block; }
.timeline li p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); background: #f6f8fb; padding: 8px 10px; border-radius: 8px; }
.timeline .tl-validation::before { border-color: var(--green); }
.timeline .tl-rejet::before { border-color: var(--red); }
.timeline .tl-soumission::before { border-color: #f5a524; }
.timeline .tl-sections { background: transparent !important; padding: 0 !important; font-size: 12px !important; color: var(--muted) !important; }

@media (max-width: 1000px) {
    .dossier-grid { grid-template-columns: 1fr; }
    .timeline-card { position: static; }
}

/* ---------- Import (module 4) ---------- */

.steps { display: flex; gap: 8px; list-style: none; margin: 0 0 18px; padding: 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--muted); font-size: 14px; font-weight: 600; }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #edf1f6; font-size: 12px; font-weight: 800; }
.steps li.active { border-color: var(--primary); color: var(--primary-dark); }
.steps li.active span { background: var(--primary); color: #fff; }
.steps li.done { color: var(--green); }
.steps li.done span { background: var(--green-50); color: var(--green); }

.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 14px 0 0; padding: 30px 16px; border: 2px dashed var(--primary-200); border-radius: var(--radius); background: var(--primary-50); color: var(--primary); text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.has-file { border-color: var(--primary); background: #e7effb; }
.dropzone strong { color: var(--navy); font-size: 15px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.help-card h3 { margin-top: 18px; }
.help-list { margin: 0; padding-left: 20px; color: var(--text-2); }
.help-list li { margin-bottom: 6px; }
.values { display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; margin: 0 0 10px; font-size: 13px; }
.values dt { font-weight: 700; color: var(--navy); }
.values dd { margin: 0; color: var(--text-2); }

.stat-bad { border-color: #f2c4bf; box-shadow: 0 0 0 3px var(--red-50); }
.stat-bad .stat-value { color: var(--red); }
.table-scroll { max-height: 520px; overflow-y: auto; }
.table-scroll th { position: sticky; top: 0; z-index: 1; }
.row-error td { background: #fffafa; }
.msg-error { color: var(--red); font-size: 13px; }
.msg-warn { color: var(--amber); font-size: 13px; }
.msg-error + .msg-error, .msg-warn { margin-top: 2px; }
.import-confirm { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.import-confirm select { min-width: 260px; }
.import-confirm-actions { display: flex; gap: 10px; margin-left: auto; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Consolidation (module 5) ---------- */

.conso-table .num-col { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.conso-table th.num-col { text-align: right; }
.conso-table td small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.conso-table .col-total { background: #f6f8fb; font-weight: 700; }
.conso-table .row-total td { background: var(--primary-50); font-weight: 700; color: var(--navy); border-top: 2px solid var(--primary-200); }
.conso-table .val-alert { color: var(--red); font-weight: 700; }
.conso-h3 { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-size: 15px; }
.conso-h3:first-child { margin-top: 0; }
.conso-h3 small { font-weight: 500; }
.coverage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 22px; }
.coverage-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 14px; }
.coverage-top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.coverage-item small { display: block; margin-top: 4px; font-weight: 700; color: var(--text-2); }

/* ---------- Notifications et relances (module 6) ---------- */

.bell { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #dbe5f5; }
.bell:hover, .bell.active { background: rgba(255, 255, 255, .12); color: #fff; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #f5a524; color: #3b2300; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--navy); }

.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: rgba(255, 255, 255, .18); }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(10, 37, 84, .18); padding: 6px; z-index: 60; }
.user-menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-menu-head strong { display: block; color: var(--text); font-size: 14px; }
.user-menu-head small { font-size: 12px; }
.user-menu-panel a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.user-menu-panel a:hover { background: var(--primary-50); color: var(--primary-dark); }
.user-menu-panel a.logout { color: var(--red); }
.user-menu-panel a.logout:hover { background: var(--red-50); }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: linear-gradient(90deg, var(--primary-50), transparent 70%); border-radius: 10px; }
.notif-ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #edf1f6; color: var(--text-2); font-weight: 800; }
.notif-relance .notif-ico { background: var(--amber-50); color: var(--amber); }
.notif-validation .notif-ico { background: var(--green-50); color: var(--green); }
.notif-rejet .notif-ico { background: var(--red-50); color: var(--red); }
.notif-assistance .notif-ico, .notif-soumission .notif-ico, .notif-instruction .notif-ico { background: var(--primary-100); color: var(--primary-dark); }
.notif-body { flex: 1; min-width: 0; }
.notif-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notif-head small { margin-left: auto; }
.notif-body p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }

.messages-card { border-color: #f1d7a8; box-shadow: 0 0 0 3px var(--amber-50); }
.message-item { padding: 10px 0; border-top: 1px solid var(--border); }
.message-item:first-of-type { border-top: 0; padding-top: 0; }
.message-item p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }

.relance-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cible-list { display: grid; gap: 6px; }
.cible { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.cible:hover { border-color: var(--primary-200); background: var(--primary-50); }
.cible.checked { border-color: var(--primary); background: var(--primary-50); color: var(--primary-dark); }
.cible input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.cible span:first-of-type { flex: 1; }
.deadline { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 0 0 10px; color: var(--navy); }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.auto-list { list-style: none; margin: 8px 0 0; padding: 0; }
.auto-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.auto-list li strong { display: block; font-size: 14px; }
.dep-specifique[hidden] { display: none; }

/* ---------- Petits écrans ---------- */

@media (max-width: 760px) {
    body { font-size: 14px; }
    h1 { font-size: 22px; }
    .topbar-inner { min-height: 56px; gap: 10px; }
    .brand-mark { width: 34px; height: 34px; }
    .brand-text small, .user-chip span:not(.avatar) { display: none; }
    .user-chip { padding: 4px; }
    .nav-links a { padding: 7px 9px; font-size: 13px; }
    .card { padding: 16px; }
    .page-header { align-items: stretch; }
    .progress-card { min-width: 0; width: 100%; }
    .form-actions { flex-direction: column-reverse; align-items: stretch; margin: 16px -16px -16px; padding: 12px 16px; }
    .form-actions .spacer { display: none; }
    .form-actions .btn, .form-actions button { width: 100%; }
    .auth { min-height: 0; }
    .auth-card { grid-template-columns: 1fr; }
    .auth-aside { padding: 24px; gap: 0; }
    .auth-aside ul { display: none; }
    .auth-form { padding: 24px; }
    .footer .container { justify-content: center; text-align: center; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .page-header .btn { width: 100%; }
    .decision-grid, .section-list, .import-grid, .relance-grid { grid-template-columns: 1fr; }
    .user-menu-panel { right: -8px; }
    .import-confirm-actions { width: 100%; }
    .import-confirm-actions button { flex: 1; }
    .confirm-box ul { columns: 1; }
    .submit-card form, .submit-card button { width: 100%; }
    .topbar-right { min-width: 0; }
    .nav-links { overflow-x: auto; scrollbar-width: none; max-width: calc(100vw - 90px); }
    .brand-text { display: none; }
}

@media (min-width: 761px) and (max-width: 1000px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .brand-text small { display: none; }
}

@media (max-width: 420px) {
    .nav-links a[href*="logout"] { font-size: 0; padding: 7px; }
    .nav-links a[href*="logout"]::after { content: "Quitter"; font-size: 13px; }
}

.data-table .actions .btn-sm, .data-table .actions button { padding: 6px 10px; font-size: 12.5px; }
.data-table td:last-child { padding-left: 6px; }

/* ---------- Module 7 : campagnes et archives ---------- */
.lifecycle { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: step; }
.lifecycle li { position: relative; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lifecycle li small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.lifecycle li + li::before { content: "→"; position: absolute; left: -12px; top: 12px; color: var(--border-strong); font-weight: 800; }
.camp-card { border-left: 4px solid var(--border-strong); }
.camp-card.camp-ouverte { border-left-color: var(--green); }
.camp-card.camp-cloturee { border-left-color: #f5a524; }
.camp-card.camp-archivee { border-left-color: var(--primary); }
.camp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.camp-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.camp-dates { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.camp-dates .late, .late { color: var(--red); font-weight: 600; }
.camp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 10px; }
.camp-stats > div { padding: 10px 12px; border-radius: var(--radius-sm); background: #f7f9fc; border: 1px solid var(--border); }
.camp-stats strong { display: block; font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }
.camp-stats small { color: var(--muted); font-size: 12px; }
.camp-stats .hot { background: var(--amber-50); border-color: #f1d7a8; }
.camp-stats .hot strong { color: var(--amber); }
.camp-stats .ok strong { color: var(--green); }
.camp-alert { margin: 12px 0 0; }
.camp-actions { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.camp-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0; }
.camp-form label { margin-top: 0; }
.camp-form input { width: auto; min-width: 160px; }
.camp-form button { width: auto; }
.camp-buttons { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.camp-buttons form { margin: 0; }
.camp-buttons .reopen { align-self: center; }
.camp-note { margin: 14px 0 0; }
.archive-box { display: grid; gap: 8px; max-width: 460px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: #fbfcfe; }
.archive-box p { margin: 0; }
.archive-box button { justify-self: start; }
.campagne-switch { display: flex; align-items: center; gap: 8px; }
.campagne-switch label { margin: 0; white-space: nowrap; }
.campagne-switch select { width: auto; }
.archive-list { display: grid; gap: 12px; }
.archive-item { display: flex; align-items: center; gap: 18px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.archive-item:hover { border-color: var(--primary-200); box-shadow: var(--shadow); }
.archive-year { flex: none; min-width: 130px; white-space: nowrap; padding: 10px; border-radius: var(--radius-sm); background: var(--primary-50); text-align: center; }
.archive-year small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.archive-year strong { color: var(--navy); font-size: 17px; }
.archive-body { flex: 1; min-width: 0; }
.archive-body .meta { margin-bottom: 6px; }
.archive-body small { color: var(--muted); }
.archive-go { color: var(--primary); font-weight: 700; font-size: 14px; white-space: nowrap; }
.archive-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.archive-toc a { padding: 5px 10px; border-radius: 999px; background: #edf1f6; color: var(--text-2); font-size: 12px; font-weight: 600; }
.archive-toc a.done { background: var(--primary-50); color: var(--primary-dark); }
.archive-section { scroll-margin-top: 80px; }
.archive-section .section-head h2 { margin: 0; font-size: 18px; }
.print-head { display: none; }

@media (max-width: 760px) {
    .lifecycle, .camp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lifecycle li + li::before { display: none; }
    .camp-buttons { margin-left: 0; }
    .archive-item { flex-wrap: wrap; }
    .page-header .campagne-switch { width: 100%; }
}

@media print {
    .topbar, .footer, .no-print, .alert { display: none !important; }
    body { background: #fff; }
    .print-head { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); border-bottom: 2px solid var(--primary); padding-bottom: 6px; margin-bottom: 12px; }
    .archive-section { break-inside: auto; box-shadow: none; border: 1px solid var(--border); }
    .archive-section .section-head { break-after: avoid; }
    .card { box-shadow: none; }
    @page { size: A4; margin: 12mm; }
}

/* ---------- Module 8 : sécurité, sauvegardes, journal ---------- */
.sec-stats .stat-icon { font-weight: 800; font-size: 18px; }
.sec-ko { background: var(--red-50) !important; color: var(--red) !important; }
.sec-warn { background: var(--amber-50) !important; color: var(--amber) !important; }
.sec-ok { background: var(--green-50) !important; color: var(--green) !important; }
.sec-groupe { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.sec-groupe:first-of-type { margin-top: 4px; }
.sec-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.sec-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; }
.sec-item + .sec-item { border-top: 1px solid var(--border); }
.sec-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; }
.sec-ok .sec-ico { background: var(--green); }
.sec-warn .sec-ico { background: #f5a524; color: #3b2300; }
.sec-ko .sec-ico { background: var(--red); }
.sec-info .sec-ico, .sec-item.sec-info .sec-ico { background: var(--primary); font-style: italic; font-family: Georgia, serif; }
.sec-item.sec-ko { background: #fffafa; }
.sec-text { flex: 1; min-width: 0; }
.sec-text strong { display: block; font-size: 14px; }
.sec-text p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.sec-item form { margin: 0; }
.sec-https-off { margin-top: 14px; }
div.sec-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
div.sec-info > div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--primary-50); border: 1px solid var(--primary-100); }
div.sec-info strong { display: block; color: var(--primary-dark); font-size: 13px; }
div.sec-info span { color: var(--text-2); font-size: 12px; }
.sec-restore { margin: 14px 0 0; }
.sec-check { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.journal-table td { vertical-align: top; }
.journal-det { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.date-field { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.date-field input { width: auto; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) {
    div.sec-info { grid-template-columns: 1fr; }
    .sec-item { flex-wrap: wrap; }
}

/* ---------- Module 9 : assistance et recette ---------- */
.ticket-list { display: grid; gap: 12px; margin-bottom: 18px; }
.ticket { padding: 0; overflow: hidden; border-left: 4px solid var(--border-strong); }
.ticket-ouverte { border-left-color: #f5a524; }
.ticket-repondue { border-left-color: var(--primary); }
.ticket-close { border-left-color: var(--green); }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.ticket-head::-webkit-details-marker { display: none; }
.ticket-head strong { display: block; color: var(--navy); }
.ticket-head small { color: var(--muted); }
.ticket[open] .ticket-head { border-bottom: 1px solid var(--border); }
.ticket .thread, .ticket .ticket-reply, .ticket form.ticket-close { margin: 0 18px; }
.ticket .thread { padding-top: 14px; }
.ticket-reply { padding: 4px 0 6px; }
.ticket-reply textarea { min-height: 60px; }
.ticket-reply .confirm-actions { margin-top: 8px; }
form.ticket-close { padding: 0 0 16px; }
.thread { display: grid; gap: 10px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; }
.msg-etab { background: #f3f5f9; border: 1px solid var(--border); justify-self: start; }
.msg-admin { background: var(--primary-50); border: 1px solid var(--primary-100); justify-self: end; }
.msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-body { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.action-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.action-list li { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.action-list li:last-child { border-bottom: 0; }
.notif-link { display: inline-block; margin-top: 6px; font-weight: 700; font-size: 13px; }
.help-line { text-align: center; margin-top: 14px; }
.verdict { display: flex; align-items: center; gap: 18px; padding: 18px 20px; margin-bottom: 18px; border-radius: var(--radius); border: 1px solid; }
.verdict strong { display: block; font-size: 16px; }
.verdict p { margin: 2px 0 0; color: var(--text-2); }
.verdict-badge { flex: none; padding: 10px 16px; border-radius: 10px; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: .03em; }
.verdict-ok { background: var(--green-50); border-color: #bfe6cc; } .verdict-ok .verdict-badge { background: var(--green); }
.verdict-warn { background: var(--amber-50); border-color: #f1d7a8; } .verdict-warn .verdict-badge { background: #f5a524; color: #3b2300; }
.verdict-ko { background: var(--red-50); border-color: #f2c4bf; } .verdict-ko .verdict-badge { background: var(--red); }
.test-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.test-list li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; background: #fff; font-size: 14px; }
.test-list li + li { border-top: 1px solid var(--border); }
.test-list li.done { background: #f6fbf8; }
.test-list li.done span { color: var(--text-2); }
.test-list small { display: block; color: var(--green); font-size: 12px; margin-top: 2px; }
.test-list form { margin: 0; }
.test-box { width: 24px; height: 24px; padding: 0; border-radius: 6px; border: 2px solid var(--border-strong); background: #fff; color: #fff; font-weight: 800; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.test-box:hover { border-color: var(--primary); background: var(--primary-50); }
.done .test-box { background: var(--green); border-color: var(--green); }
.plan { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.plan strong { color: var(--text); }
@media (max-width: 760px) {
    .verdict { flex-direction: column; align-items: flex-start; }
    .msg { max-width: 100%; }
    .ticket-head { flex-wrap: wrap; }
}
.form-actions.static { position: static; backdrop-filter: none; }
.ticket-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 8px 0 16px; }
.ticket .ticket-reply { padding-bottom: 0; }

/* En-tête : 7 entrées de menu pour l'administration, sur écrans moyens */
.brand-text strong { white-space: nowrap; }
.topbar-admin .nav-links a { padding: 8px 9px; font-size: 13.5px; }
.topbar-admin .user-chip span:not(.avatar) { display: none; }
.topbar-admin .user-chip { padding: 4px; }
.topbar-admin .brand-text small { display: none; }
@media (max-width: 1120px) {
    .brand-text { display: none; }
}
@media (max-width: 1000px) and (min-width: 761px) {
    .nav-links { overflow-x: auto; scrollbar-width: none; max-width: calc(100vw - 170px); }
}

/* ---------- Améliorations 2026/2027 ---------- */
.autorite { background: #fff; border-bottom: 1px solid var(--border); }
.autorite .container { display: flex; flex-direction: column; gap: 1px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; line-height: 1.35; }
.autorite strong { color: var(--navy); font-weight: 700; letter-spacing: .01em; }
.autorite span { color: var(--primary-dark); font-weight: 600; }
.auth-eyebrow { color: #9fc0f0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { display: block; padding: 16px 18px; color: inherit; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--primary-200); box-shadow: var(--shadow); color: inherit; }
.kpi-hero { grid-row: span 2; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(140deg, var(--navy) 0%, var(--primary-dark) 100%); color: #fff; border: 0; }
.kpi-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 18px; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-hero .kpi-label, .kpi-hero .kpi-sub { color: #c9d7ef; }
.kpi-hero .kpi-value { color: #fff; font-size: 52px; }
.kpi-hot { border-color: #f1d7a8; background: var(--amber-50); }
.kpi-hot .kpi-value { color: var(--amber); }
.meter { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); overflow: hidden; margin: 12px 0 6px; }
.meter span { display: block; height: 100%; border-radius: 999px; background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend-etapes { margin: 4px 0 12px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.chart-grid .card { margin-bottom: 0; }
.hbars { display: grid; gap: 9px; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; }
.hbar-label { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: flex; gap: 2px; height: 18px; min-width: 6px; }
.hbar-seg { min-width: 3px; height: 100%; }
.hbar-seg:first-child { border-radius: 4px 0 0 4px; }
.hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-seg:only-child { border-radius: 4px; }
.hbar-seg:hover { filter: brightness(.9); }
.hbar-total { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.courbes { width: 100%; height: auto; display: block; }
.courbes .grid { stroke: var(--border); stroke-width: 1; }
.courbes .axis { font-size: 11px; fill: var(--muted); }
.courbes .hit { fill: transparent; }
.courbes .hit:hover { fill: rgba(22, 82, 176, .07); }
.courbes + .legend { margin-top: 8px; }
@media (max-width: 1000px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-hero { grid-column: 1 / -1; grid-row: auto; }
    .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .hbar-row { grid-template-columns: 100px 1fr 32px; }
    .kpi-value { font-size: 24px; }
    .kpi-hero .kpi-value { font-size: 40px; }
}
.reprise { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--primary); }
.reprise strong { display: block; color: var(--navy); }
.reprise p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.section-card.draft { border-color: #f1d7a8; background: #fffdf8; }
.etats-legende { margin: 12px 0 18px; }
.etat-gray { background: #c9d3e1; } .etat-amber { background: #f5a524; } .etat-green { background: var(--green); } .etat-blue { background: var(--primary); }
.rsr-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.rsr-card h2 { margin: 0 0 4px; }
.rsr-card p { margin: 0; color: var(--text-2); }
.rsr-text { flex: 1 1 360px; }
.rsr-card button[disabled] { width: auto; opacity: .5; cursor: not-allowed; }
.alert.warn { background: var(--amber-50); color: #7a4504; border-color: #f1d7a8; }
.inline-reset { display: inline; margin-left: 8px; }
.inline-reset button { width: auto; }
.step.draft .step-num { background: #f5a524; color: #3b2300; }
.autosave-etat { font-size: 12px; color: var(--muted); margin-right: 6px; }
.autosave-etat.ok { color: var(--green); }
.autosave-etat.attente { color: var(--amber); }
.autosave-etat.erreur { color: var(--red); font-weight: 600; }
tr.gp-off td:first-child { color: var(--muted); }
tr.gp-off td:first-child::after { content: " · aucun groupe"; font-size: 11px; color: var(--muted); }
input.gp-conflit { border-color: var(--red) !important; background: var(--red-50) !important; }
.gp-alerte { margin-bottom: 14px; }
.gp-hint { margin: -4px 0 10px; }
@media (max-width: 760px) { .autosave-etat { order: 3; text-align: center; margin: 0; } }
.atteste { margin: 0 0 10px; font-size: 14px; } .submit-card form { display: flex; flex-direction: column; align-items: flex-end; }

/* ---------- Rapport Statistique de Rentrée imprimable ---------- */
.rsr-doc-page { background: #fff; }
.rsr-doc-page .print-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; background: var(--navy); color: #fff; flex-wrap: wrap; }
.rsr-doc-page .print-bar button { width: auto; background: #fff; color: var(--navy); border-color: #fff; }
.rsr-doc { max-width: 1000px; margin: 0 auto; padding: 28px 24px 40px; font-size: 13px; }
.rsr-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--primary); padding-bottom: 14px; margin-bottom: 18px; }
.rsr-head .org { font-size: 12px; line-height: 1.5; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.rsr-head .org strong { color: var(--navy); }
.rsr-head .meta-doc { text-align: right; font-size: 11px; color: var(--muted); }
.rsr-titre { text-align: center; margin: 10px 0 20px; }
.rsr-titre h1 { font-size: 24px; color: var(--navy); margin: 0 0 4px; }
.rsr-etab { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.rsr-doc .doc-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.rsr-doc .doc-statut { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--green-50); color: var(--green); border: 1px solid #bfe6cc; }
.rsr-doc .doc-statut.prov { background: var(--amber-50); color: var(--amber); border-color: #f1d7a8; }
.rsr-doc h2 { font-size: 15px; color: #fff; background: var(--primary-dark); margin: 22px 0 10px; padding: 6px 10px; border-radius: 4px; }
.rsr-ident { width: 100%; border-collapse: collapse; }
.rsr-ident th, .rsr-ident td { border: 1px solid var(--border-strong); padding: 5px 9px; text-align: left; vertical-align: top; }
.rsr-ident th { width: 32%; background: var(--primary-50); color: var(--navy); font-weight: 700; }
.rsr-contenu .subcard { margin: 0 0 12px; padding: 0; border: 0; background: none; box-shadow: none; }
.rsr-contenu h3 { font-size: 13px; color: var(--navy); margin: 10px 0 6px; }
.rsr-contenu .table-wrap { overflow: visible; border: 0; border-radius: 0; }
.rsr-contenu table { width: 100%; border-collapse: collapse; }
.rsr-contenu th, .rsr-contenu td { border: 1px solid var(--border-strong) !important; padding: 4px 8px !important; font-size: 12px; text-align: left; background: #fff; }
.rsr-contenu tr:first-child th { background: var(--primary-50); color: var(--navy); font-weight: 700; text-transform: none; letter-spacing: 0; }
.rsr-contenu td:not(:first-child) { text-align: center; }
.rsr-contenu .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.rsr-contenu .v-vide { color: #9aa7b8; font-weight: 400; }
.rsr-contenu .v-oui { color: var(--green); }
.rsr-contenu label { display: inline-block; margin: 4px 8px 4px 0; font-weight: 600; color: var(--text-2); }
.rsr-contenu label + .v { display: inline-block; margin-right: 18px; }
.rsr-contenu .dep, .rsr-contenu .dep-row { display: revert !important; }
.rsr-note { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.rsr-signs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.rsr-sign { border: 1px solid var(--border-strong); border-radius: 6px; padding: 10px 12px; display: flex; flex-direction: column; break-inside: avoid; }
.rsr-sign strong { color: var(--navy); font-size: 13px; }
.rsr-sign small { color: var(--muted); }
.rsr-sign .visa { margin: 8px 0; font-size: 11px; color: var(--green); min-height: 30px; }
.rsr-sign .visa .vide { color: var(--muted); }
.rsr-sign .sign-zone { margin-top: auto; height: 90px; border-top: 1px dotted var(--muted); padding-top: 4px; font-size: 10px; color: var(--muted); }
.rsr-foot { margin-top: 26px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); text-align: center; }
@media print {
    .rsr-doc-page .print-bar { display: none; }
    .rsr-doc { padding: 0; max-width: none; }
    .rsr-doc h2 { break-after: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rsr-contenu tr, .rsr-ident tr { break-inside: avoid; }
    .rsr-contenu h3 { break-after: avoid; }
    .rsr-circuit { break-inside: avoid; }
    .rsr-ident th, .rsr-contenu tr:first-child th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4; margin: 12mm 10mm; }
}
.kpi-grid.kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ident-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.ident-grid .card { margin-bottom: 0; }
.ident-grid h2 { margin-top: 0; }
.ident-result { border-left: 4px solid #f5a524; }
@media (max-width: 760px) { .ident-grid, .kpi-grid.kpi-3 { grid-template-columns: 1fr; } }
.form-table input:disabled { background: #f1f4f8; color: #9aa7b8; border-style: dashed; }
.rsr-contenu .kv-table td { text-align: left !important; }

/* Guides d'utilisation */
.guides-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.guide-card h2 { margin: 0; font-size: 1.05rem; }
.guide-card .btn { align-self: flex-start; margin-top: auto; }
.guide-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #5b6b82); }
.guide-admin { border-top: 4px solid #0e3f8a; }
.guide-taille { color: var(--muted, #5b6b82); }
.progress-card .date-limite { margin-top: 10px; font-size: .85rem; color: var(--muted); }
.progress-card .date-limite strong { color: var(--text); }
.progress-card .date-limite.proche, .progress-card .date-limite.proche strong { color: #b42318; }

/* Portail Outils IEF */
.portail-alerte { display: grid; gap: 8px; }
.portail-alerte .btn { justify-self: start; }
.portail-lien { margin-top: 18px; font-size: .88rem; color: var(--muted); }
.nav-portail { opacity: .85; }
.portail-refus { max-width: 620px; margin: 40px auto; }
.portail-refus h1 { margin: 6px 0 10px; }
.portail-etat { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 8px; }
.ident-commun { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.ident-commun label { display: grid; gap: 6px; font-weight: 600; }

/* Extraction */
.extraction-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 18px; }
.extraction-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.extraction-card .btn { align-self: flex-start; margin-top: 8px; }
.hint-list { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.devalider-modes { display: grid; gap: 10px; margin: 10px 0 14px; }
.devalider-modes .check { align-items: flex-start; }
.devalider-modes small { color: var(--muted); font-weight: 400; }

/* Suppression */
.zone-danger { border-top: 4px solid #b42318; }
.pile-form { display: grid; gap: 10px; max-width: 460px; margin-top: 14px; }
button.btn-danger, .btn-danger { background: #b42318; border-color: #b42318; color: #fff; }
.devalider-modes strong { color: var(--text); }
.devalider-modes .check span { display: block; line-height: 1.35; }
.devalider-modes small { display: inline-block; margin-top: 2px; }
