/* ==========================================================================
   RYM HOLDING : finition premium (Ben, 02/12/2026 : « la forme est aussi importante que le fond »).
   Charge APRES rym-design-system.css. Source : audit design du 02/12/2026 (33 constats), système proposé §4.
   Deux parties :
     1) corrections mesurées, valables partout (contraste, focus, texte secondaire, cible tactile, chiffres) ;
     2) composants « page acteur » (.pa-*) : un seul gabarit pour les espaces des intervenants, du conseil et des affectations.
   Polices : Nunito (corps) + Manrope (titres et chiffres clés).
   ========================================================================== */
:root {
    --rym-action: #1D5FBF;
    --rym-action-hover: #174E9E;
    --rym-action-active: #123F80;
    --rym-slate: #5B6A80;
    --rym-line: #DDE4EE;
    --rym-mist: #F5F8FC;
    --rym-ok: #176A3C;      --rym-ok-bg: #E8F6EE;
    --rym-warn: #8A5A00;    --rym-warn-bg: #FDF3E0;
    --rym-err: #B42318;     --rym-err-bg: #FDECED;
    --rym-info-fg: #164F9C; --rym-info-soft: #EAF1FB;
    --rym-neutral: #42526B; --rym-neutral-bg: #EEF2F9;
    --rym-font-titre: "Manrope", "Nunito", "Segoe UI", system-ui, sans-serif;
}

/* ---------- 1) Corrections valables partout ---------- */
/* Contraste : le bleu ciel #4A90E2 ne porte plus de texte blanc (3,3 : sous le seuil AA de 4,5). */
body .cons-btn.primary, body .btn-primary, body a.btn-primary {
    background: var(--rym-action); border-color: var(--rym-action); color: #fff;
}
body .cons-btn.primary:hover, body .btn-primary:hover { background: var(--rym-action-hover); border-color: var(--rym-action-hover); filter: none; }
body .cons-btn.primary:active, body .btn-primary:active { background: var(--rym-action-active); border-color: var(--rym-action-active); }
body .btn-outline-primary { color: var(--rym-action); border-color: var(--rym-action); }
body .btn-outline-primary:hover { background: var(--rym-action); color: #fff; }
body .cons-kpi.accent .v { color: var(--rym-action); }
/* Texte secondaire : une seule valeur, lisible. */
body .text-muted, body .ea-gris, body .pb-qual, body .ei-note { color: var(--rym-slate) !important; }
/* Les groupes de chiffres copiables gardent la couleur du texte qui les entoure (ils s'affichaient plus pâles que leur phrase). */
body .rym-ri-chiffre { color: inherit !important; }
/* Anneau de focus clavier visible partout. */
:focus-visible { outline: 3px solid #4A90E2; outline-offset: 2px; }
#accordionSidebar a:focus-visible, .sidebar a:focus-visible { outline-color: #fff; }
/* La bulle d'assistance ne cache plus le pied de page. */
footer, .sticky-footer { padding-right: 88px; }
/* Chiffres alignés, dates et références insécables. */
table, .cons-kpi .v, .pa-kpi .v { font-variant-numeric: lining-nums tabular-nums; }
.rym-ri-chiffre { display: inline; margin: 0; padding: 0; white-space: nowrap; }
/* Mobile : un tableau déborde en défilant, jamais en cachant sa dernière colonne. */
@media (max-width: 640px) {
    .card-body, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .card-body > table, .table-responsive > table { min-width: 600px; }
    .cons-filtres input, .cons-filtres select, .cons-fg input, .cons-fg select { width: 100%; min-height: 44px; }
}

/* ---------- 2) Gabarit « page acteur » ---------- */
.pa { font-family: "Nunito", "Segoe UI", system-ui, sans-serif; color: #0A1F44; font-size: 14px; line-height: 20px; max-width: 1180px; margin: 0 auto; padding: 24px 24px 56px; }
.pa * { box-sizing: border-box; }
.pa-crumbs { font-size: 13px; color: var(--rym-slate); margin-bottom: 12px; }
.pa-crumbs a { color: var(--rym-action); text-decoration: none; }
.pa-crumbs a:hover { text-decoration: underline; }
.pa-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
           background: linear-gradient(135deg, #0A1F44 0%, #173F7A 100%); color: #fff; border-radius: 16px; padding: 24px 28px; margin-bottom: 20px;
           box-shadow: 0 12px 30px -16px rgba(10,31,68,.32); }
.pa-head h1 { font-family: var(--rym-font-titre); font-weight: 800; font-size: 24px; line-height: 32px; margin: 0; color: #fff; letter-spacing: -.01em; }
.pa-head p { margin: 4px 0 0; color: #DCE6F7; font-size: 14px; max-width: 70ch; }
.pa-head .pa-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9FC0F2; margin-bottom: 4px; display: block; }
.pa-card { background: #fff; border: 1px solid var(--rym-line); border-radius: 12px; box-shadow: 0 2px 10px rgba(10,31,68,.06); margin-bottom: 20px; overflow: hidden; }
.pa-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--rym-line); }
.pa-card > header h2 { font-family: var(--rym-font-titre); font-weight: 700; font-size: 18px; line-height: 26px; margin: 0; color: #0A1F44; }
.pa-card .pa-count { font-size: 12px; font-weight: 700; color: var(--rym-neutral); background: var(--rym-neutral-bg); border-radius: 999px; padding: 2px 10px; }
.pa-body { padding: 24px; }
.pa-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pa-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.pa-table th { background: var(--rym-mist); color: #0A1F44; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: left; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--rym-line); white-space: nowrap; }
.pa-table td { padding: 12px 16px; border-bottom: 1px solid var(--rym-line); font-size: 14px; line-height: 20px; vertical-align: middle; color: #0A1F44; }
.pa-table tbody tr { min-height: 52px; }
.pa-table tbody tr:hover td { background: var(--rym-mist); }
.pa-table tbody tr:last-child td { border-bottom: 0; }
.pa-table .pa-date, .pa-table .pa-num { white-space: nowrap; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.pa-table .pa-act { width: 140px; text-align: right; white-space: nowrap; }
.pa-sub { display: block; color: var(--rym-slate); font-size: 13px; margin-top: 2px; }
.pa-empty-cell { color: var(--rym-slate); }
.pa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--rym-action);
          background: var(--rym-action); color: #fff; font: 600 14px/1 "Nunito", sans-serif; text-decoration: none; cursor: pointer; }
.pa-btn:hover { background: var(--rym-action-hover); border-color: var(--rym-action-hover); color: #fff; text-decoration: none; }
.pa-btn.sm { height: 36px; padding: 0 14px; }
.pa-btn.ghost { background: #fff; color: var(--rym-action); }
.pa-btn.ghost:hover { background: var(--rym-info-soft); color: var(--rym-action); }
.pa-btn.danger { background: #fff; color: var(--rym-err); border-color: var(--rym-err); }
.pa-btn.danger:hover { background: var(--rym-err-bg); }
.pa-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 700 12px/1 "Nunito", sans-serif; white-space: nowrap; background: var(--rym-neutral-bg); color: var(--rym-neutral); }
.pa-badge.ok { background: var(--rym-ok-bg); color: var(--rym-ok); }
.pa-badge.warn { background: var(--rym-warn-bg); color: var(--rym-warn); }
.pa-badge.err { background: var(--rym-err-bg); color: var(--rym-err); }
.pa-badge.info { background: var(--rym-info-soft); color: var(--rym-info-fg); }
.pa-banner { display: flex; gap: 12px; padding: 12px 16px; border-radius: 12px; border-left: 4px solid #164F9C; background: var(--rym-info-soft); color: #0A1F44; margin-bottom: 20px; font-size: 14px; line-height: 20px; }
.pa-banner.ok { border-left-color: var(--rym-ok); background: var(--rym-ok-bg); }
.pa-banner.err { border-left-color: var(--rym-err); background: var(--rym-err-bg); }
.pa-banner strong { font-weight: 700; }
.pa-empty { text-align: center; padding: 48px 24px; max-width: 44ch; margin: 0 auto; }
.pa-empty .pa-dot { width: 64px; height: 64px; border-radius: 50%; background: var(--rym-info-soft); color: var(--rym-action); display: inline-flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 16px; }
.pa-empty h3 { font-family: var(--rym-font-titre); font-weight: 700; font-size: 18px; line-height: 26px; margin: 0 0 4px; }
.pa-empty p { color: var(--rym-slate); margin: 0 0 16px; }
.pa-field { height: 40px; border: 1px solid #C9D3E3; border-radius: 8px; padding: 0 12px; font: 400 14px "Nunito", sans-serif; color: #0A1F44; background: #fff; min-width: 160px; }
.pa-field:focus { outline: none; border-color: var(--rym-action); box-shadow: 0 0 0 3px rgba(29,95,191,.25); }
.pa-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) {
    .pa { padding: 16px 16px 40px; }
    .pa-head { padding: 20px; border-radius: 12px; }
    .pa-head h1 { font-size: 22px; line-height: 28px; }
    .pa-card > header, .pa-body { padding: 16px; }
    .pa-btn { height: 44px; }
    .pa-field { width: 100%; height: 44px; }
}
@media print { .pa-head { background: #fff; color: #000; box-shadow: none; } .pa-head h1, .pa-head p { color: #000; } .pa-btn { display: none; } }

/* ---------- 3) Documentation : titres de cartes lisibles (étaient blanc sur blanc, audit D-30) ---------- */
body .doc-carte h5, body .doc-carte .card-title { color: #0A1F44 !important; font: 700 18px/26px "Manrope", "Nunito", sans-serif; }
body .doc-carte p { color: var(--rym-slate); }

/* ---------- 4) Passe 2 de l'audit design (03/12/2026) : ce que la première feuille ne gagnait pas contre les règles existantes ---------- */
/* D-06 : le pied d'impression (« page 1 sur 1 ») ne s'affiche qu'à l'impression. */
@media screen { body .rym-ri-pied-impression { display: none !important; } }
/* D-08 : la bulle d'assistance ne recouvre plus « Mentions légales ». */
body .rym-footer .rym-footer__inner { padding-right: 96px !important; }
@media (max-width: 640px) { body .rym-footer .rym-footer__inner { padding-right: 16px !important; padding-bottom: 80px !important; } }
/* D-09 : anneau de focus visible dans la barre latérale (sur fond marine : blanc). */
body #accordionSidebar a:focus-visible, body #accordionSidebar .nav-link:focus-visible, body #accordionSidebar .collapse-item:focus-visible {
    outline: 3px solid #fff !important; outline-offset: -3px !important; }
/* D-12 : les groupes de chiffres copiables ne cassent plus les phrases sur mobile. */
@media (max-width: 640px) { body .rym-ri-chiffre { display: inline !important; padding: 0 !important; min-height: 0 !important; margin: 0 !important; } }
/* D-01 : pastilles numérotées et bouton principal du répertoire en bleu d'action (contraste 6,1). */
body .qn, body a.rym-btn-primary, body .rym-btn-primary { background: var(--rym-action) !important; border-color: var(--rym-action) !important; color: #fff !important; }
/* D-02 : boutons « Accéder » de l'accueil : fond assombri (orange, teal, cyan) pour que le texte blanc passe 4,5. */
body .btn-access { background-color: #a8a8a8 !important; background-blend-mode: multiply; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
/* D-04 : textes secondaires et références, une seule valeur lisible (5,5 sur blanc). */
body .ref, body .fp-p, body .pb-etat-p, body .cd-ct-vide, body .b55-suite, body .pb-num, body .ch-rang, body .rym-footer__copy, body .rym-footer span,
body .dataTables_info, body .small.text-muted { color: var(--rym-slate) !important; }
body .page-item:not(.active) .page-link { color: var(--rym-slate); }
body .rym-footer a { color: #0A1F44; }
/* D-05 : pastilles d'état, texte foncé sur fond doux (contraste 5,9 et plus). */
body .cons-badge.publiee, body .cons-badge.en_chiffrage { background: #EAF1FB !important; color: #164F9C !important; }
body .cons-badge.en_negociation, body .cons-badge.validation_archi { background: #FDF3E0 !important; color: #8A5A00 !important; }
body .cons-badge.adjugee { background: #E8F6EE !important; color: #176A3C !important; }
/* D-11 : les tableaux qui défilent sur mobile le montrent (ombre à droite) et AccesChantier ne déborde plus de la page. */
@media (max-width: 640px) {
    .pa-wrap { background: linear-gradient(to right, #fff 30%, rgba(255,255,255,0)), linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) 100% 0, linear-gradient(to right, rgba(10,31,68,.18), rgba(10,31,68,0)), linear-gradient(to left, rgba(10,31,68,.18), rgba(10,31,68,0)) 100% 0; background-repeat: no-repeat; background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%; background-attachment: local, local, scroll, scroll; }
    .pa { max-width: 100%; overflow-x: hidden; }
    body .table-responsive > table, body .card-body > table { min-width: 560px; }
}
/* D-30 : « Mises en ligne » et boutons secondaires de la Documentation lisibles. */
body .doc-carte .btn-link, body .btn-outline-secondary { color: #42526B; }

/* ---------- 5) Finition : nombres sans pointillés permanents (Ben, 03/12/2026, capture de la production) ---------- */
/* Les groupes de chiffres restent copiables, mais le soulignement en pointillés ne se montre qu'au survol. */
body .rym-ri-chiffre { border-bottom-color: transparent !important; text-decoration: none !important; background-image: none !important; cursor: inherit; }
body .rym-ri-chiffre:hover { border-bottom: 1px dotted var(--rym-slate) !important; cursor: copy; }

/* ---------- 4) Menu latéral replié : les titres de rubrique ne sont plus coupés (audit D-07) ---------- */
body #accordionSidebar.toggled .rym-sb-section {
    white-space: normal !important; text-overflow: clip !important; overflow: visible !important;
    padding: 10px 4px 4px !important; font-size: 9px !important; letter-spacing: .05em !important;
    line-height: 1.2; text-align: center; word-break: break-word; hyphens: auto;
}

/* Menu replié, suite (retour d'aprim-127, 03/12/2026) : les libellés des entrées (« GESTION INTERNE », « COMMUNICATION », « Documentation ») sont des <span>
   en blanc-espace figé avec points de suspension : ils passent à la ligne et gardent toute la largeur utile. */
body #accordionSidebar.toggled .nav-link { padding-left: 6px !important; padding-right: 6px !important; }
body #accordionSidebar.toggled .nav-link > span {
    white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
    font-size: 9px !important; line-height: 1.2; letter-spacing: 0 !important; text-align: center; word-break: break-word;
}

/* Menu replié, 3e passe (Ben, 03/12/2026 : les mots étaient coupés au milieu, « Appe / ls d'offr / e ») : l'icône passe AU-DESSUS du libellé,
   centrée, et le libellé garde toute la largeur du menu ; les mots ne sont plus cassés. */
body #accordionSidebar.toggled .nav-link { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 3px; text-align: center; }
body #accordionSidebar.toggled .nav-link > i, body #accordionSidebar.toggled .nav-link > svg { margin: 0 !important; }
body #accordionSidebar.toggled .nav-link > span { width: 100%; word-break: normal !important; overflow-wrap: normal !important; hyphens: manual; font-size: 8.5px !important; line-height: 1.15; letter-spacing: 0 !important; }
