/* Compléments propres à l'outil de gestion de projet */
:root { --primary: #1d4fb8; --primary-d: #163d8f; --side: #1b2433; }
.input:focus { outline: 3px solid rgba(29,79,184,.3); }
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #f0b400; outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; background: #fff; color: var(--primary); border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 8px; }
.content:focus { outline: none; }
.sidebar-foot a { color: #9aa4b2; }
.muted { color: #5b6573; }   /* contraste ≥ 4,5:1 */
.table th { color: #4f5a67; }

/* Badges des listes de valeurs : couleur paramétrable + symbole + texte */
.badge-valeur { --badge: #6b7785; background: color-mix(in srgb, var(--badge) 14%, #fff); color: color-mix(in srgb, var(--badge) 70%, #000);
  border: 1px solid color-mix(in srgb, var(--badge) 35%, #fff); }
.meteo-vert { background: #e5f5eb; color: #17613a; } .meteo-orange { background: #fff0e0; color: #8a4508; }
.meteo-rouge { background: #fde8e9; color: #a11d24; } .meteo-ne { background: #eef0f3; color: #4f5a67; }

/* Résumé cliquable → détail */
.resume { color: var(--text); display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; text-decoration: none; border-radius: 4px; }
.resume.clamp-1 { -webkit-line-clamp: 1; line-clamp: 1; }
.resume.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.resume.clamp-0 { display: inline; }
.resume:hover { text-decoration: none; background: #eef3fd; }
.resume:hover .detail-tag { text-decoration: underline; }
.detail-tag { color: var(--primary); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.compteur { color: #5b6573; font-size: 12px; text-align: right; }
.compteur-alerte { color: #a2520a; font-weight: 600; }

/* Panneau latéral (dialog) */
.panneau { position: fixed; inset: 0 0 0 auto; width: min(620px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0;
  padding: 0; border: 0; border-left: 1px solid var(--border); box-shadow: -12px 0 40px rgba(0,0,0,.18); background: #fff; }
.panneau::backdrop { background: rgba(15, 23, 42, .32); }
.panneau[open] { display: flex; flex-direction: column; animation: glisse .18s ease-out; }
@keyframes glisse { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.panneau-barre { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.panneau-corps { padding: 20px 22px 32px; overflow-y: auto; }
.panneau-corps h2, .detail-page h2 { margin: 0 0 4px; font-size: 20px; }
.detail-resume { margin: 14px 0; padding: 12px 14px; background: #f3f6fb; border-left: 4px solid var(--primary); border-radius: 6px; font-weight: 500; }
.detail-texte { line-height: 1.65; }
.detail-texte p { margin: 0 0 10px; }
.detail-texte table { border-collapse: collapse; margin: 8px 0; }
.detail-texte th, .detail-texte td { border: 1px solid var(--border); padding: 4px 8px; }
.detail-meta { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); color: #5b6573; font-size: 12.5px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.historique-champ { margin: 10px 0 0; padding-left: 18px; font-size: 13px; }

/* Liste des dossiers */
.familles-onglets { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.familles-onglets a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-weight: 600; font-size: 13px; }
.familles-onglets a[aria-current] { background: var(--primary); border-color: var(--primary); color: #fff; }
.filtres-avances { padding: 0 16px 12px; background: #fbfcfd; border-bottom: 1px solid var(--border); }
.filtres-avances summary { padding: 10px 0; cursor: pointer; font-weight: 600; color: var(--primary); }
.filtres-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.filtres-grille label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; }
.table-dossiers td { vertical-align: top; }
.table-dossiers .titre { font-weight: 700; color: var(--text); }
.table-dossiers .col-synthese { min-width: 260px; max-width: 460px; }
.th-tri a { color: inherit; }
.th-tri a:hover { color: var(--primary); }
.indicateurs { display: flex; flex-wrap: wrap; gap: 4px; }
.cartes { display: none; }
.carte { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.carte .titre { font-weight: 700; }
.carte .ligne { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }

/* Fiche */
.entete { position: sticky; top: 60px; z-index: 10; margin: -24px -24px 20px; padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--border); }
.entete h1 { font-size: 21px; }
.entete .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; color: #4f5a67; }
.entete .meta strong { color: var(--text); }
.entete-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.etat-form select { padding: 5px 8px; }
.en-bref { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; padding: 16px; }
.en-bref h3, .bloc-titre { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #4f5a67; }
.en-bref .synthese { grid-column: 1 / -1; font-size: 15px; }
.onglets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.onglets a { margin-bottom: -2px; padding: 9px 14px; border-bottom: 3px solid transparent; color: #4f5a67; font-weight: 600; }
.onglets a[aria-current] { border-color: var(--primary); color: var(--primary); }
.onglets a:hover { text-decoration: none; color: var(--primary); }
.onglets .compte { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #eef0f3; font-size: 11.5px; text-align: center; }
.liste-items { margin: 0; padding: 0; list-style: none; }
.liste-items > li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.liste-items > li:last-child { border-bottom: 0; }
.liste-items .grow { flex: 1; min-width: 0; }
.liste-items .actions-item { display: flex; gap: 4px; flex: none; }
.axe { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.axe:last-child { border-bottom: 0; }
.axe-tete { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.axe-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; }
.arbitrage-ligne { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.arbitrage-ligne:last-child { border-bottom: 0; }
.qqqp { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.qqqp dt { color: #4f5a67; font-weight: 600; font-size: 13px; }
.qqqp dd { margin: 0; }
.circuit { margin: 0; padding: 0; list-style: none; }
.circuit li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.circuit .rang { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef0f3; font-weight: 700; font-size: 12px; }
.boite-action { padding: 16px; border-top: 1px solid var(--border); background: #fbfcfd; }
.boite-action h3 { margin: 0 0 10px; font-size: 15px; }
details.action-repliee { border-top: 1px solid var(--border); }
details.action-repliee > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; color: var(--primary); }
details.action-repliee > form { padding: 0 16px 16px; }
.radios ul, .radios > div { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; }
.radios label { display: flex; gap: 6px; align-items: center; font-weight: 500; }

/* Fiche légère (petits projets) */
.accordeons details { border-bottom: 1px solid var(--border); }
.accordeons details:last-child { border-bottom: 0; }
.accordeons summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.accordeons summary::-webkit-details-marker { display: none; }
.accordeons summary::before { content: "›"; display: inline-block; width: 12px; color: var(--primary); font-size: 18px; transition: transform .15s; }
.accordeons details[open] > summary::before { transform: rotate(90deg); }
.accordeons summary .apercu { flex: 1; min-width: 0; overflow: hidden; color: #4f5a67; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.accordeons .contenu { padding: 0 16px 16px 38px; }
.bmsa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bmsa > div { padding: 12px; border: 1px solid var(--border); border-radius: 8px; }

/* Frise */
.frise { width: 100%; height: auto; display: block; }
.frise text { font: 11px system-ui, sans-serif; fill: #4f5a67; }
.frise .libelle { font-size: 12px; fill: #1f2933; }
.frise .mois-pair { fill: #f6f8fb; } .frise .mois-impair { fill: #fff; }
.frise .annee { stroke: #b9c2ce; stroke-width: 1; }
.frise .prevu { fill: #c7d7f5; stroke: #6f8fd0; }
.frise .reel { fill: #1d4fb8; } .frise .reel-retard { fill: #c0262d; }
.frise .aujourdhui { stroke: #e5484d; stroke-width: 2; stroke-dasharray: 4 3; }
.frise .echeance { stroke: #8a4508; stroke-width: 2; }
.legende { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 16px; font-size: 12.5px; color: #4f5a67; }
.legende i { display: inline-block; width: 18px; height: 8px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.legende .l-prevu { background: #c7d7f5; border: 1px solid #6f8fd0; } .legende .l-reel { background: #1d4fb8; }
.legende .l-retard { background: #c0262d; } .legende .l-auj { border-top: 2px dashed #e5484d; height: 0; }
.retard { color: #a11d24; font-weight: 700; }

/* Coûts */
.table-num td.num, .table-num th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; background: #f8fafc; }

/* Tableau de bord */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tuile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border);
  border-left: 5px solid var(--t, var(--primary)); color: var(--text); box-shadow: var(--shadow); }
.tuile:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.08); }
.tuile strong { font-size: 28px; line-height: 1.1; }
.tuile span { color: #4f5a67; font-weight: 600; font-size: 13px; }
.tuile-alerte { --t: #e5484d; } .tuile-arbitrage { --t: #f08c2e; } .tuile-echeance { --t: #8b5cf6; } .tuile-actifs { --t: #1b2433; }

/* Séances */
.points { margin: 0; padding: 0; list-style: none; counter-reset: point; }
.point { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.point-tete { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.point-num { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 6px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; }
.lecture { max-width: 900px; margin: 0 auto; }
.lecture .nav-lecture { display: flex; justify-content: space-between; gap: 8px; margin: 16px 0; }

/* Formulaire */
.form-fieldset { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; }
.form-fieldset legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #4f5a67; }
.form-fieldset + .form-fieldset { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.field-radioselect ul, .field-radioselect > div { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; }
.field-radioselect label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.avertissement-rgpd { margin-bottom: 14px; padding: 10px 14px; background: #fff6e6; border: 1px solid #f7d9a6; border-radius: 8px; color: #6b4600; font-size: 13px; }

@media (max-width: 1100px) {
  .axe-grille { grid-template-columns: 1fr; }
  .arbitrage-ligne { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .panneau { width: 100vw; border-left: 0; }
  .table-dossiers { display: none; }
  .cartes { display: block; }
  .entete { position: static; margin: -16px -16px 16px; padding: 14px 16px; }
  .bmsa { grid-template-columns: 1fr; }
  .btn, .icon-btn, .onglets a, .familles-onglets a { min-height: 44px; }
  .onglets { flex-wrap: nowrap; overflow-x: auto; }
  .onglets a { white-space: nowrap; }
  .qqqp { grid-template-columns: 1fr; }
  .frise-bloc { display: none; }
  .accordeons .contenu { padding-left: 16px; }
}
@media print {
  .sidebar, .topbar, .entete-actions, .onglets, .btn, .panneau, .actions-item { display: none !important; }
  .entete { position: static; }
  .content { padding: 0; }
}
