/* L'Observatoire, composants.css : boutons, champs, cadres, étiquettes, tableaux, fenêtres, messages, pagination.
   Chaque partie d'un composant porte sa classe ; aucune règle ne passe par un enfant direct. */

/* ================================================================ boutons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r); font: 500 14px/1 var(--sans); color: var(--encre);
       white-space: nowrap; text-decoration: none !important; border: 1px solid transparent; background: var(--surface); transition: background .1s, border-color .1s, color .1s, transform .1s; cursor: pointer; }
.btn .lucide { width: 16px; height: 16px; }
.btn.p { background: var(--jaune); border-color: var(--jaune); color: var(--encre); font-weight: 600; } .btn.p:hover { background: var(--jaune-fort); border-color: var(--jaune-fort); }
.btn.s { border-color: var(--filet-fort); } .btn.s:hover { border-color: var(--encre-4); background: var(--surface-2); }
.btn.v { background: var(--produit); border-color: var(--produit); color: #fff; font-weight: 600; } .btn.v:hover { background: var(--vert-nuit); }
.btn.g { background: transparent; color: var(--encre-2); } .btn.g:hover { background: var(--appuye); color: var(--encre); }
.btn.d { background: var(--rouge); border-color: var(--rouge); color: #fff; font-weight: 600; } .btn.d:hover { filter: brightness(.92); }
.btn.l { background: none; border: 0; color: var(--vert-fort); font-weight: 600; padding: 0 4px; } .btn.l:hover { text-decoration: underline !important; text-underline-offset: 3px; }
.btn.t { height: 34px; padding: 0 12px; font-size: 13.5px; } .btn.grand { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.ic { width: 38px; padding: 0; } .btn.t.ic { width: 34px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.en-cours { color: transparent !important; pointer-events: none; }
.btn.en-cours::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(17, 17, 17, .25); border-top-color: var(--encre); animation: tourne .7s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.btn.pulse { animation: appel 1.8s var(--doux) 2; } @keyframes appel { 30% { box-shadow: 0 0 0 8px rgba(248, 179, 52, .35); } }
.fichier { position: relative; display: inline-flex; cursor: pointer; }
.fichier input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.fichier input[type=file]:focus-visible + .btn { outline: 2px solid var(--jaune-fort); outline-offset: 2px; }

/* ================================================================ champs */
.champ { display: grid; gap: 6px; }
.champ > span, .etiquette { font-size: 13.5px; font-weight: 600; color: var(--encre); }
.champ input, .champ select, .champ textarea, .saisie-t { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--filet-fort); border-radius: var(--r); background: var(--surface); font-size: 14px; color: var(--encre); transition: border-color .1s, box-shadow .1s; }
.champ textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.champ input:focus, .champ select:focus, .champ textarea:focus, .saisie-t:focus { outline: 0; border-color: var(--jaune-fort); box-shadow: var(--anneau); }
.champ .aide { font-size: 12.5px; color: var(--encre-3); line-height: 1.45; }
.cherche { position: relative; } .cherche .lucide { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; color: var(--encre-3); pointer-events: none; }
.cherche input { height: 38px; padding-left: 34px; border: 1px solid var(--filet-fort); border-radius: var(--r); background: var(--surface); font-size: 14px; min-width: 240px; }
.cherche input:focus { outline: 0; border-color: var(--jaune-fort); box-shadow: var(--anneau); }
.sel { height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--filet-fort); border-radius: var(--r); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E716E' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; font-size: 14px; color: var(--encre); }
.sel:focus { outline: 0; border-color: var(--jaune-fort); box-shadow: var(--anneau); }

/* ================================================================ cadres */
.cadre { background: var(--surface); border: 1px solid var(--filet); border-radius: var(--r-g); }
.cadre-tete { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--filet-2); flex-wrap: wrap; }
.cadre-tete-t { display: grid; gap: 3px; } .cadre-tete-t p { font-size: 13px; color: var(--encre-3); }
.cadre-tete h2 { font-size: 16.5px; } .cadre-tete .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.cadre-corps { padding: 18px 20px 20px; } .cadre-pied { padding: 12px 20px; border-top: 1px solid var(--filet-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--encre-3); }
.cadre-intro { padding: 12px 20px; font-size: 13.5px; color: var(--encre-2); line-height: 1.55; border-bottom: 1px solid var(--filet-2); max-width: 1100px; }
.grille-c { display: grid; gap: 16px; align-items: start; } .grille-c.c21 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); } .grille-c.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pile { display: grid; gap: 16px; }
.compte-p { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--appuye); color: var(--encre-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.compte-p.j { background: var(--jaune); color: var(--encre); } .compte-p.at { background: var(--at-pale); color: var(--at); } .compte-p.ok { background: var(--ok-pale); color: var(--ok); }
.vide { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 20px; color: var(--encre-3); font-size: 13.5px; }
.vide b { color: var(--encre); font-size: 14.5px; } .vide .lucide { width: 26px; height: 26px; color: var(--encre-4); margin-bottom: 4px; }
.vide.gauche { justify-items: start; text-align: left; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; padding: 18px 20px; border: 1px dashed var(--filet-fort); border-radius: var(--r-g); }
.vide.gauche .lucide { grid-row: span 2; margin: 0; }
.tuile-i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--survol); color: var(--encre-2); flex: none; }
.tuile-i .lucide { width: 16px; height: 16px; } .tuile-i.ok { background: var(--ok-pale); color: var(--ok); } .tuile-i.at { background: var(--at-pale); color: var(--at); } .tuile-i.j { background: var(--jaune-pale); color: var(--jaune-texte); }
.tuile-i.v { background: var(--produit); color: #fff; } .tuile-i.g { width: 40px; height: 40px; border-radius: 11px; } .tuile-i.g .lucide { width: 19px; height: 19px; }

/* le sceau du réseau : les quatre tuiles du logo Cerfrance, dans le coin des cartes qui portent un bilan */
.motif { position: relative; }
.motif::after { content: ''; position: absolute; right: 16px; top: 14px; width: 34px; height: 32px; background: url('img/marque-tuiles.svg') no-repeat center / contain; pointer-events: none; opacity: .9; }
.rail-tete.motif::after { width: 26px; height: 24px; right: 12px; top: 10px; }

/* ================================================================ étiquettes et états */
.etat { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; color: var(--encre-2); }
.etat::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--encre-4); flex: none; }
.etat.ok::before { background: var(--ok-point); } .etat.at::before { background: var(--at-point); } .etat.j::before { background: var(--jaune); } .etat.ko::before { background: var(--rouge); }
.pastille { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-s); font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--survol); color: var(--encre-2); border: 1px solid var(--filet); }
.pastille .lucide { width: 13px; height: 13px; }
.pastille.ok { background: var(--ok-pale); color: var(--ok); border-color: var(--ok-filet); } .pastille.at { background: var(--at-pale); color: var(--at); border-color: var(--at-filet); }
.pastille.j { background: var(--jaune-pale); color: var(--jaune-texte); border-color: var(--jaune-filet); } .pastille.ko { background: var(--ko-pale); color: var(--ko); border-color: var(--ko-filet); }
.pastille.v { background: var(--produit); color: #fff; border-color: var(--produit); } .pastille.sombre { background: var(--encre-2); color: #fff; border-color: var(--encre-2); }
/* les statuts d'un dossier */
.v2-statut { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--survol); color: var(--encre-2); }
.v2-statut::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--encre-4); }
.v2-statut.en_cours { background: var(--jaune-pale); color: var(--jaune-texte); } .v2-statut.en_cours::before { background: var(--jaune); }
.v2-statut.soumis { background: var(--vert-pale); color: var(--vert-texte); } .v2-statut.soumis::before { background: var(--vert); }
.v2-statut.valide { background: var(--produit); color: #fff; } .v2-statut.valide::before { background: #fff; }
.v2-statut.a_corriger { background: var(--at-pale); color: var(--at); } .v2-statut.a_corriger::before { background: var(--orange); }
.v2-statut.refus { background: var(--encre-2); color: #fff; } .v2-statut.refus::before { background: #fff; }

/* ================================================================ notes et messages de page */
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--miel); border: 1px solid var(--jaune-filet); font-size: 13.5px; line-height: 1.5; color: var(--encre-2); }
.note .lucide { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--jaune-texte); } .note b { color: var(--encre); }
.note.ok { background: var(--ok-pale); border-color: var(--ok-filet); } .note.ok .lucide { color: var(--ok); }
.note.at { background: var(--at-pale); border-color: var(--at-filet); } .note.at .lucide { color: var(--at); }
.note.info { background: var(--surface-2); border-color: var(--filet); } .note.info .lucide { color: var(--encre-3); }
.v2-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--miel); border: 1px solid var(--jaune-filet); font-size: 13.5px; line-height: 1.5; margin-bottom: 14px; }
.v2-note .lucide { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--jaune-texte); }
.v2-note.imp-note { align-items: center; } .v2-note.imp-note > div { flex: 1; } .v2-note.imp-note form { flex: none; }
.v2-ok { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--ok-pale); border: 1px solid var(--ok-filet); color: var(--ok); font-size: 13.5px; font-weight: 500; }
.v2-ok .lucide { width: 16px; height: 16px; }

/* ================================================================ tableaux */
.tab-z { overflow-x: auto; }
.tab { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tab th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-3); background: var(--surface); height: 40px; padding: 0 12px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.tab th:first-child, .tab td:first-child { padding-left: 20px; } .tab th:last-child, .tab td:last-child { padding-right: 20px; }
.tab td { padding: 8px 12px; height: 46px; border-bottom: 1px solid var(--filet-2); vertical-align: middle; color: var(--encre-2); }
.tab tbody tr:last-child td { border-bottom: 0; } .tab tbody tr:hover td { background: var(--surface-2); }
.tab td b { color: var(--encre); font-weight: 600; } .tab .n { text-align: right; font-variant-numeric: tabular-nums; } .tab .fin { text-align: right; white-space: nowrap; width: 1%; }
.tab tr.lien-ligne { cursor: pointer; }
.ent { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.ent-t { display: grid; line-height: 1.3; min-width: 0; } .ent-t b { font-size: 14px; } .ent-t small { font-size: 12.5px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* les filtres en pastilles, et la barre de liste */
.barre-l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filtres { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--appuye); }
.filtres a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-s); font-size: 13.5px; font-weight: 500; color: var(--encre-2); text-decoration: none; }
.filtres a em { font-style: normal; font-size: 12px; color: var(--encre-3); } .filtres a:hover { color: var(--encre); }
.filtres a.on { background: var(--surface); color: var(--encre); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 17, 17, .08); }
.barre-l .compte-l { margin-left: auto; font-size: 13px; color: var(--encre-3); }

/* ================================================================ pagination */
.pages { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.pages-n { font-size: 13px; color: var(--encre-3); } .pages-l { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pages a, .pages .pn, .pages .pp, .pages .ps { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--r); font-size: 13px; font-weight: 500; color: var(--encre-2); text-decoration: none; }
.pages a { background: var(--surface); border: 1px solid var(--filet-fort); } .pages a:hover { border-color: var(--encre-4); text-decoration: none; }
.pages .pn.on { background: var(--jaune); border-color: var(--jaune); color: var(--encre); font-weight: 600; } .pages .off { color: var(--encre-4); opacity: .6; }

/* ================================================================ fenêtres (confirmation) et messages */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(17, 17, 17, .42); }
.modal.open { display: flex; animation: apparait .12s; } @keyframes apparait { from { opacity: 0; } }
.modal .box { width: 460px; max-width: 100%; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: var(--r-g); box-shadow: var(--ombre-pop); padding: 22px 24px 18px; animation: monte .18s var(--doux); }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } }
.confirm-box { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; }
.confirm-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 11px; background: var(--jaune-pale); color: var(--jaune-texte); display: grid; place-items: center; }
.confirm-ic .lucide { width: 20px; height: 20px; } .confirm-box.danger .confirm-ic { background: var(--ko-pale); color: var(--ko); }
.confirm-box h3 { font-size: 17px; margin: 0; align-self: center; } .confirm-msg { font-size: 14px; line-height: 1.5; color: var(--encre-2); }
.confirm-box .foot { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.foot .btn-ghost { border-color: var(--filet-fort); } .foot .btn-primary { background: var(--jaune); border-color: var(--jaune); font-weight: 600; }
.foot .btn-warn { background: var(--rouge); border-color: var(--rouge); color: #fff; font-weight: 600; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r); background: var(--encre); color: #fff; font-size: 13.5px; box-shadow: var(--ombre-pop); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s var(--doux); }
.toast.show { opacity: 1; transform: none; } .toast .lucide { width: 17px; height: 17px; color: var(--vert); } .toast.error .lucide { color: var(--orange); }

/* ================================================================ anneaux et jauges */
.anneau { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.anneau svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau .piste { fill: none; stroke: var(--filet-2); stroke-width: 9; }
.anneau .arc { fill: none; stroke: var(--produit); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.2s var(--doux); }
.anneau > div { position: relative; text-align: center; display: grid; } .anneau b { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: var(--encre); font-variant-numeric: tabular-nums; }
.anneau span { font-size: 12px; color: var(--encre-3); margin-top: 4px; line-height: 1.3; }
.anneau.petit { width: 64px; height: 64px; } .anneau.petit b { font-size: 18px; } .anneau.petit span { display: none; } .anneau.petit .piste, .anneau.petit .arc { stroke-width: 10; }
.anneau.moyen { width: 96px; height: 96px; } .anneau.moyen b { font-size: 26px; }
.jauge { height: 6px; border-radius: 3px; background: var(--filet-2); overflow: hidden; } .jauge i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--produit); transition: width 1s var(--doux); }
.jauge.j i { background: var(--jaune); }
