/* Inspiré de la charte graphique PLR Suisse (2023) :
   bleu foncé #074EA1, bleu clair #00A0E2, magenta #E8308A, noir, blanc.
   Police officielle : Linotype Univers (titres en Univers Condensed).
   Elle est utilisée si elle est installée sur l'ordinateur (local()) ; sinon Roboto Condensed / Arial.
   Pour la servir à tous, il faut des fichiers webfont (.woff2) sous licence web Linotype :
   les ajouter dans public/fonts/ et compléter les src ci-dessous avec url('/fonts/…'). */
@font-face { font-family: 'PLR Univers Cn'; font-weight: 400; font-style: normal; font-display: swap;
  src: local('Linotype Univers 420 Condensed'), local('LinotypeUnivers-420Cn'), local('Univers 57 Condensed'), local('UniversLTStd-Cn'), local('Univers Condensed'); }
@font-face { font-family: 'PLR Univers Cn'; font-weight: 700; font-style: normal; font-display: swap;
  src: local('Linotype Univers 620 Bold Condensed'), local('Linotype Univers 620 Condensed Bold'), local('LinotypeUnivers-620CnBold'), local('Univers 67 Condensed Bold'), local('UniversLTStd-BoldCn'), local('Univers Condensed Bold'); }
@font-face { font-family: 'PLR Univers Cn'; font-weight: 800 900; font-style: normal; font-display: swap;
  src: local('Linotype Univers 720 Heavy Condensed'), local('Linotype Univers 720 Condensed Heavy'), local('LinotypeUnivers-720CnHeavy'), local('Univers 77 Condensed Black'), local('UniversLTStd-BlackCn'); }
:root {
  --bleu: #074EA1; --bleu-clair: #00A0E2; --magenta: #E8308A; --noir: #000; --blanc: #fff;
  --fond: #F3F6FA; --ligne: #D8E0EA; --texte: #111; --gris: #5B6675;
  --ok: #1F8A4C; --warn: #D97A00; --late: #C8102E;
  --radius: 4px;
  --condensed: 'PLR Univers Cn', 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
  --texte-font: 'Univers', 'Univers 55', 'Univers LT Std', Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--texte-font); color: var(--texte); background: var(--fond); line-height: 1.45; }
a { color: var(--bleu); }
h1, h2, h3, h4 { font-family: var(--condensed); font-weight: 800; color: var(--bleu); line-height: 1.15; margin: 0 0 .6rem; }
h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }

/* ---------- En-tête ---------- */
.topbar { background: var(--bleu); color: #fff; }
.topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 1.5rem; padding: .55rem 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
/* Logo officiel PLR (public/img) : blanc sur la barre bleue, bleu clair sur fond blanc */
.logo-img { display: block; height: 30px; width: auto; }
.brand .logo-img { padding-right: .75rem; border-right: 1px solid rgba(255,255,255,.35); box-sizing: content-box; }
.logo-login { height: 46px; margin-bottom: 1.2rem; }
.logo-print { height: 34px; margin-bottom: .6rem; }
.brand-title { font-family: var(--condensed); font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.brand-title small { display: block; font-weight: 400; opacity: .85; font-size: .82rem; }
.nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
.nav a { color: #fff; text-decoration: none; font-family: var(--condensed); font-weight: 700; font-size: .98rem; padding: .45rem .7rem; border-radius: var(--radius); }
.nav a:hover { background: rgba(255,255,255,.12); }
.nav a.active { background: #fff; color: var(--bleu); }
.userbox { display: flex; align-items: center; gap: .6rem; font-size: .85rem; white-space: nowrap; }
.userbox a { color: #fff; }
.userbox form { margin: 0; }
.role-pill { background: var(--magenta); color: #fff; border-radius: 99px; padding: .1rem .55rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.linkbtn { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.stripe { height: 5px; background: linear-gradient(90deg, var(--bleu-clair) 0 70%, var(--magenta) 70%); }

/* ---------- Mise en page ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
/* Encadré incliné à 3,5° — élément graphique de la charte */
.slant { display: inline-block; position: relative; margin: .3rem 0 .4rem .2rem; }
.slant h1 { display: inline-block; background: var(--bleu); color: #fff; font-size: 1.7rem; padding: .35rem 1rem .4rem; transform: rotate(-3.5deg); transform-origin: left bottom; margin: 0; }
.slant .sub { display: block; width: max-content; max-width: 90vw; background: var(--magenta); color: #fff; font-family: var(--condensed); font-weight: 700; padding: .15rem .8rem; transform: rotate(-3.5deg); transform-origin: left top; margin: .1rem 0 0 1.2rem; font-size: .95rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: #fff; border: 1px solid var(--ligne); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.stat { border-left: 6px solid var(--bleu); }
.stat .n { font-family: var(--condensed); font-size: 2.3rem; font-weight: 800; color: var(--bleu); line-height: 1; }
.stat.magenta { border-color: var(--magenta); } .stat.magenta .n { color: var(--magenta); }
.stat.clair { border-color: var(--bleu-clair); } .stat.clair .n { color: var(--bleu-clair); }
.muted { color: var(--gris); font-size: .9rem; }
.small { font-size: .85rem; }
.flash { background: #E6F5FC; border-left: 5px solid var(--bleu-clair); padding: .7rem 1rem; margin-bottom: 1rem; border-radius: var(--radius); }
.flash.err { background: #FDE8F1; border-color: var(--magenta); }
.flash.ok { background: #E8F6EE; border-color: var(--ok); }

/* ---------- Tableaux & listes ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { font-family: var(--condensed); color: var(--bleu); font-size: .92rem; text-transform: uppercase; letter-spacing: .3px; background: #EEF3F9; }
tr:hover td { background: #FAFCFE; }
.table-wrap { overflow-x: auto; border: 1px solid var(--ligne); border-radius: var(--radius); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .55rem 0; border-bottom: 1px solid var(--ligne); display: flex; justify-content: space-between; gap: .75rem; }
.list li:last-child { border-bottom: 0; }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; background: #E6EDF6; color: var(--bleu); white-space: nowrap; }
.badge-soon { background: #FFF1DC; color: var(--warn); }
.badge-late { background: #FBE3E7; color: var(--late); }
.badge-ok { background: #E3F4EA; color: var(--ok); }
.badge-magenta { background: #FCE3EF; color: var(--magenta); }
.badge-robot { background: #E0F4FC; color: #0077A8; }
.chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--bleu); color: #fff; border-radius: 99px; padding: .1rem .55rem .1rem .15rem; font-size: .8rem; margin: 0 .2rem .2rem 0; }
.chip i { font-style: normal; background: #fff; color: var(--bleu); border-radius: 50%; width: 1.35rem; height: 1.35rem; display: inline-flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 800; }
.chip.done { background: var(--ok); }
.chip.proposed { background: #fff; color: var(--bleu); border: 1px dashed var(--bleu); }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 700; font-size: .88rem; margin: .7rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid #B8C4D3; border-radius: var(--radius); font: inherit; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--bleu-clair); border-color: var(--bleu-clair); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.btn { display: inline-block; background: var(--bleu); color: #fff; border: 0; border-radius: var(--radius); padding: .55rem 1rem; font-family: var(--condensed); font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.1); }
.btn-magenta { background: var(--magenta); }
.btn-clair { background: var(--bleu-clair); }
.btn-ghost { background: #fff; color: var(--bleu); border: 1px solid var(--bleu); }
.btn-danger { background: #fff; color: var(--late); border: 1px solid var(--late); }
.btn-sm { padding: .3rem .6rem; font-size: .88rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .15rem .8rem; }
.checks label { font-weight: 400; margin: 0; display: flex; gap: .4rem; align-items: center; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; background: #fff; border: 1px solid var(--ligne); padding: .7rem .9rem; border-radius: var(--radius); margin-bottom: 1rem; }
.filters label { margin: 0 0 .2rem; font-size: .78rem; text-transform: uppercase; color: var(--gris); }
.filters select, .filters input { width: auto; min-width: 170px; }
details summary { cursor: pointer; color: var(--bleu); font-weight: 700; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .4rem .8rem; border-radius: 99px; text-decoration: none; background: #fff; border: 1px solid var(--ligne); font-size: .9rem; }
.tabs a.active { background: var(--bleu); color: #fff; border-color: var(--bleu); }

/* ---------- Programme de session ---------- */
.day { margin: 1.6rem 0 .6rem; display: flex; align-items: center; gap: .6rem; }
.day h2 { margin: 0; background: var(--bleu-clair); color: #fff; padding: .2rem .8rem; transform: rotate(-3.5deg); display: inline-block; font-size: 1.15rem; }
.affaire { background: #fff; border: 1px solid var(--ligne); border-left: 5px solid var(--bleu); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .5rem; display: grid; grid-template-columns: 2.2rem 1fr 300px; gap: .8rem; }
.affaire.mine { border-left-color: var(--magenta); background: #FFF9FC; }
.affaire .num { font-family: var(--condensed); font-weight: 800; font-size: 1.3rem; color: var(--bleu); }
.affaire .meta { font-size: .82rem; color: var(--gris); }
.affaire .title { font-weight: 700; margin: .1rem 0 .25rem; }
.affaire .assign { border-left: 1px solid var(--ligne); padding-left: .8rem; }
.affaire details .checks { grid-template-columns: 1fr 1fr; max-height: 220px; overflow: auto; margin: .4rem 0; }
.affaire .body { min-width: 0; }
.affaire.election { grid-template-columns: 2.2rem 1fr; border-left-color: #8A96A8; }
.affaire .title a { color: var(--texte); text-decoration: none; border-bottom: 1px solid transparent; }
.affaire .title a:hover { color: var(--bleu); border-bottom-color: var(--bleu); }
.affaire .title .ext { color: var(--bleu-clair); font-size: .85em; }
.docs { list-style: none; padding: 0; margin: .35rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem .4rem; font-size: .8rem; }
.docs li { background: #F0F4F9; border-radius: var(--radius); padding: .1rem .45rem; }
.docs a { text-decoration: none; }
.parlinfo-bar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; background: #fff; border: 1px solid var(--ligne); border-radius: var(--radius); padding: .5rem .9rem; margin-bottom: 1rem; font-size: .88rem; }
.txt-late { color: var(--late); }

/* Notes sur les affaires : fonction (visible par le groupe) / personnelle (privée) */
.notes { margin-top: .45rem; display: grid; gap: .35rem; }
.note { border-radius: var(--radius); padding: .35rem .7rem; font-size: .88rem; }
.note summary { font-weight: 700; font-size: .85rem; }
.note summary .muted { font-weight: 400; }
.note textarea { margin-top: .35rem; min-height: 2.6rem; }
.note-fonction { background: #FFF6FA; border: 1px solid #F6C6DD; border-left: 4px solid var(--magenta); }
.note-fonction summary { color: var(--magenta); }
.note-fonction .note-head { color: var(--magenta); font-size: .85rem; margin-bottom: .15rem; }
.note-fonction .note-head .muted, .note-fonction .note-head { font-weight: 400; }
.note-perso { background: #FFFBEA; border: 1px solid #EEDFA6; border-left: 4px solid #C9A227; }
.note-perso summary { color: #7A6210; }
.note-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.note-perso .note-head strong { color: #7A6210; }
.note-fonction .note-head strong { color: var(--magenta); }
.note.note-empty .rich { display: none; }
/* Note personnelle : une ligne compacte, le texte complet s'ouvre en pop-up */
.note-compact { cursor: pointer; }
.note-compact:hover { border-color: #C9A227; background: #FFF6D1; }
.note-compact .rich { display: none; }
.note-compact .note-label { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-snippet { margin-left: .4rem; color: #4A3D0A; font-style: italic; font-weight: 400; }
.note-compact:not(.note-empty) .note-hint { display: none; }
.note-compact .note-edit { white-space: nowrap; }
.note .rich { margin-top: .2rem; }
.rich p, .rich div { margin: 0 0 .2rem; }
.rich ul, .rich ol { margin: .2rem 0 .2rem 1.2rem; padding: 0; }
@media print { .notes { display: none; } }

/* Éditeur de notes (fenêtre pop-up) */
dialog.note-modal { width: min(760px, 96vw); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.note-modal::backdrop { background: rgba(7, 30, 60, .55); }
.note-modal-inner { display: flex; flex-direction: column; max-height: 88vh; }
.note-modal header { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: var(--bleu); color: #fff; }
.note-modal header strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-modal header button { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius); padding: .2rem .6rem; cursor: pointer; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .45rem .6rem; border-bottom: 1px solid var(--ligne); background: #F7F9FC; }
.rte-toolbar button { min-width: 2rem; height: 2rem; padding: 0 .45rem; border: 1px solid var(--ligne); background: #fff; border-radius: var(--radius); cursor: pointer; font-size: .9rem; }
.rte-toolbar button:hover { border-color: var(--bleu); }
.rte-toolbar .swatch { min-width: 1.6rem; width: 1.6rem; height: 1.6rem; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ligne); }
.rte-toolbar .swatch.mark { border-radius: 4px; font-weight: 700; color: #333; font-size: .8rem; }
.rte-toolbar .sep { width: 1px; height: 1.4rem; background: var(--ligne); margin: 0 .2rem; }
.rte { min-height: 260px; max-height: 60vh; overflow: auto; padding: .9rem 1rem; outline: none; font-size: .95rem; line-height: 1.5; }
.rte:empty::before { content: 'Écrivez votre note…'; color: #9AA4B2; }
.rte ul, .rte ol { margin: .3rem 0 .3rem 1.4rem; padding: 0; }
.note-modal footer { display: flex; align-items: center; gap: .8rem; padding: .55rem .8rem; border-top: 1px solid var(--ligne); }
.note-modal footer .hint { flex: 1; }

/* Excusé·e·s : liste de membres à cocher */
.multi-pick { position: relative; }
.multi-pick summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-height: 2.4rem; padding: .25rem .6rem; border: 1px solid var(--ligne); border-radius: var(--radius); background: #fff; color: var(--texte); font-weight: 400; }
.multi-pick summary::-webkit-details-marker { display: none; }
.multi-pick[open] summary { border-color: var(--bleu-clair); box-shadow: 0 0 0 2px rgba(0,160,226,.2); }
.mp-chips { display: flex; flex-wrap: wrap; gap: .2rem; }
.chip.chip-sm { padding: .05rem .5rem; font-size: .78rem; margin: 0; }
.mp-caret { color: var(--gris); }
.mp-panel { position: absolute; z-index: 20; left: 0; right: 0; min-width: 280px; margin-top: .25rem; background: #fff; border: 1px solid var(--ligne); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: .6rem .7rem; }
.mp-checks { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .8rem; max-height: 260px; overflow: auto; }
.mp-other { display: block; margin-top: .5rem; font-size: .8rem; color: var(--gris); }
.mp-other input { margin-top: .2rem; }

/* PV général sur la page de la session */
.gen-pv { margin-bottom: 1rem; }
.gen-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; align-items: end; }
.gen-head .pv-save { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) { .gen-head { grid-template-columns: 1fr; } }
.gen-point { position: relative; border-top: 1px solid var(--ligne); padding: .6rem 0 .2rem; margin-top: .6rem; }
.gen-point-head { display: flex; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: 1.05rem; color: var(--bleu); }
.gen-num { font-family: var(--condensed); font-weight: 800; color: var(--bleu); }
.gen-title { font-weight: 700; color: var(--bleu); border-color: transparent; background: transparent; padding-left: .2rem; }
.gen-title:hover, .gen-title:focus { border-color: var(--ligne); background: #fff; }
.gen-del { position: absolute; top: .65rem; right: 0; }
.gen-point form.pv-form { padding-right: 5.5rem; }
.gen-session-point { margin: 1.2rem 0 .4rem; }
.gen-session-point h2 { color: var(--bleu); margin: 0 0 .3rem; }
.gen-add { display: flex; gap: .5rem; margin-top: .6rem; }
.gen-add input { flex: 1; }
.gen-fin { margin-top: 1rem; max-width: 320px; }
main .linkbtn { color: var(--bleu); }
.gen-del .linkbtn, .list .linkbtn { color: var(--late); }
.linkbtn.small { font-size: .8rem; }
.gen-point input[type="text"].gen-title { font-weight: 700; color: var(--bleu); font-size: 1.02rem; border-color: transparent; background: transparent; }
.gen-point input[type="text"].gen-title:hover, .gen-point input[type="text"].gen-title:focus { border-color: var(--ligne); background: #fff; }

/* Fenêtre d'aperçu des documents (PDF Parlinfo) */
dialog.doc-modal { width: min(1100px, 96vw); height: 92vh; padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.doc-modal::backdrop { background: rgba(7, 30, 60, .55); }
.doc-modal .doc-modal-inner { display: flex; flex-direction: column; height: 100%; }
.doc-modal header { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; background: var(--bleu); color: #fff; }
.doc-modal header strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-modal header a, .doc-modal header button { color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius); padding: .2rem .6rem; font-size: .85rem; text-decoration: none; cursor: pointer; }
.doc-modal iframe { flex: 1; width: 100%; border: 0; background: #525659; }


/* PV pris directement sur chaque objet ; couleur selon la décision du groupe */
.pv-box { margin-top: .6rem; padding: .55rem .7rem; background: #F7F9FC; border-left: 4px solid var(--ligne); border-radius: var(--radius); }
.pv-box label { font-size: .76rem; text-transform: uppercase; color: var(--gris); margin: .1rem 0 .15rem; }
.pv-box textarea { min-height: 2.6rem; }
.pv-row { display: grid; grid-template-columns: auto 1fr 1fr; gap: .6rem; margin-top: .3rem; align-items: end; }
@media (max-width: 1000px) { .pv-row { grid-template-columns: 1fr; } }
.pv-save { margin-top: .4rem; display: flex; gap: .6rem; align-items: center; }
.js .pv-save .btn { display: none; }
.pv-box.dec-oui { border-left-color: var(--ok); background: #F1FAF4; }
.pv-box.dec-non { border-left-color: var(--late); background: #FDF2F4; }
.pv-box.dec-abstention { border-left-color: var(--warn); background: #FFF8EC; }
.pv-box.dec-liberte { border-left-color: var(--bleu-clair); background: #EEF8FD; }
.seg { display: inline-flex; border: 1px solid var(--ligne); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg label { margin: 0; text-transform: none; font-size: .85rem; color: var(--texte); cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .35rem .6rem; border-right: 1px solid var(--ligne); white-space: nowrap; }
.seg label:last-child span { border-right: 0; }
.seg input:focus-visible + span { outline: 2px solid var(--bleu); outline-offset: -2px; }
.seg-oui input:checked + span { background: var(--ok); color: #fff; }
.seg-non input:checked + span { background: var(--late); color: #fff; }
.seg-abstention input:checked + span { background: var(--warn); color: #fff; }
.seg-liberte input:checked + span { background: var(--bleu-clair); color: #fff; }
.seg-none input:checked + span { background: #E6EBF2; }
.dec-pill { display: inline-block; font-weight: 700; font-size: .8rem; padding: .08rem .55rem; border-radius: 99px; color: #fff; background: var(--gris); }
.dec-pill.dec-oui { background: var(--ok); } .dec-pill.dec-non { background: var(--late); } .dec-pill.dec-abstention { background: var(--warn); } .dec-pill.dec-liberte { background: var(--bleu-clair); }
@media print { .dec-pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 860px) { .affaire { grid-template-columns: 2rem 1fr; } .affaire .assign { grid-column: 1 / -1; border: 0; padding: 0; } }

/* ---------- PV ---------- */
.pv-aff { border: 1px solid var(--ligne); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .8rem; background: #fff; }
.pv-aff h4 { margin: 0 0 .3rem; }
.pv-aff .row textarea { min-height: 60px; }
.sticky-save { position: sticky; bottom: 0; background: rgba(243,246,250,.96); border-top: 1px solid var(--ligne); padding: .7rem 0; margin-top: 1rem; display: flex; gap: .6rem; align-items: center; z-index: 5; }
.print-doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 2.2rem 2.6rem; border: 1px solid var(--ligne); font-size: 11pt; }
.print-doc h1 { font-size: 1.6rem; }
.print-doc h2 { font-size: 1.15rem; margin-top: 1.4rem; }
.print-doc .kv { display: grid; grid-template-columns: 130px 1fr; gap: .1rem .8rem; margin: .8rem 0 1.2rem; }
.print-doc .aff { margin: 0 0 1rem; page-break-inside: avoid; }
.print-doc .aff b.lbl { color: var(--bleu); }
.pre { white-space: pre-wrap; }

/* ---------- Boussole ---------- */
.light { display: inline-flex; flex-direction: column; gap: 4px; background: #1c2430; padding: 6px; border-radius: 12px; flex: none; }
.light i { width: 16px; height: 16px; border-radius: 50%; background: #3a4452; display: block; }
.light.vert i:nth-child(3) { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.light.orange i:nth-child(2) { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.light.rouge i:nth-child(1) { background: var(--late); box-shadow: 0 0 8px var(--late); }
.light.big { padding: 9px; gap: 6px; border-radius: 16px; }
.light.big i { width: 30px; height: 30px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; vertical-align: middle; }
.dot.vert { background: var(--ok); } .dot.orange { background: var(--warn); } .dot.rouge { background: var(--late); } .dot.na { background: #A9B1BD; }
.verdict { display: flex; gap: 1.4rem; align-items: center; }
.reco { display: inline-block; font-weight: 700; font-size: .9rem; padding: .2rem .8rem; border-radius: 99px; margin: .2rem 0 .4rem; }
.reco.vert { background: #E3F4EA; color: var(--ok); } .reco.orange { background: #FFF1DC; color: #9A5D02; } .reco.rouge { background: #FBE3E7; color: var(--late); }
.bar { height: 8px; background: #ECEFF4; border-radius: 99px; overflow: hidden; width: 220px; margin-top: 4px; }
.bar span { display: block; height: 100%; border-radius: 99px; }
.level { border: 1px solid var(--ligne); border-radius: var(--radius); padding: .8rem; display: flex; gap: .7rem; }
.level p { margin: .15rem 0 0; font-size: .9rem; color: var(--gris); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--gris); margin-bottom: .8rem; }
.legend span { display: flex; align-items: center; gap: .35rem; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; }
.theme { border: 1px solid var(--ligne); border-radius: var(--radius); padding: .8rem; display: flex; gap: .7rem; align-items: flex-start; background: #fff; }
.theme.vert { border-left: 5px solid var(--ok); } .theme.orange { border-left: 5px solid var(--warn); } .theme.rouge { border-left: 5px solid var(--late); } .theme.na { border-left: 5px solid #A9B1BD; opacity: .8; }
.theme h4 { margin: 0; font-family: Arial, sans-serif; font-size: .95rem; color: var(--texte); }
.theme .lbl { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.theme.vert .lbl { color: var(--ok); } .theme.orange .lbl { color: var(--warn); } .theme.rouge .lbl { color: var(--late); } .theme.na .lbl { color: var(--gris); }
.theme p { margin: .3rem 0 0; font-size: .9rem; }
.theme .ref { margin-top: .3rem; font-size: .8rem; color: var(--gris); font-style: italic; }
.hidden-report { position: absolute; left: -9999px; width: 1px; height: 1px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #C9D4E4; border-top-color: var(--bleu); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) { .verdict { align-items: flex-start; } }
@media (max-width: 760px) { .topbar-inner { flex-wrap: wrap; } }

/* ---------- Connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bleu); padding: 1rem; }
.login-card { background: #fff; width: 100%; max-width: 400px; padding: 2rem; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.25); }

@media print {
  .topbar, .stripe, .no-print, .sticky-save { display: none !important; }
  body { background: #fff; } main { padding: 0; }
  .print-doc { border: 0; padding: 0; max-width: none; }
}
