/* ===== RESET & BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Syne', sans-serif;
    --color-header-bg: linear-gradient(135deg, #f0f2f5, #e6e9ef);
    --color-border: #ddd;
    --color-row-even: #fafafa;
    --color-row-hover: #f2f6ff;
    --sidebar-bg-from: #1a2332;
    --sidebar-bg-to: #243447;
    --accent: #4a90d9;
}

body { font-family: var(--font-primary); background-color: #f0f2f7; margin: 0; padding: 0; color: #333; }
.app-shell { display: flex; min-height: 100vh; }

/* ===================================================
   SIDEBAR
=================================================== */
.sidebar { width:240px; min-width:240px; background:linear-gradient(180deg,var(--sidebar-bg-from) 0%,var(--sidebar-bg-to) 100%); display:flex; flex-direction:column; position:fixed; top:0; left:0; height:100vh; z-index:200; transition:width .3s cubic-bezier(.4,0,.2,1),min-width .3s,transform .3s,box-shadow .3s; box-shadow:4px 0 28px rgba(0,0,0,.18); overflow-y:auto; overflow-x:hidden; }
.sidebar.mini { width:56px; min-width:56px; }
.sidebar-logo { display:flex; align-items:center; gap:10px; padding:20px 10px 16px; border-bottom:1px solid rgba(255,255,255,.07); flex-shrink:0; overflow:hidden; }
.sidebar-burger { width:34px; height:34px; min-width:34px; background:rgba(255,255,255,.06); border:none; border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background .18s; flex-shrink:0; }
.sidebar-burger:hover { background:rgba(255,255,255,.13); }
.sidebar-burger svg { width:16px; height:16px; stroke:#fff; fill:none; stroke-width:2; stroke-linecap:round; display:block; }
.sidebar-logo-text-wrap { overflow:hidden; white-space:nowrap; opacity:1; transition:opacity .2s; }
.sidebar.mini .sidebar-logo-text-wrap { opacity:0; pointer-events:none; }
.sidebar-logo-text { font-family:var(--font-display); font-size:.88rem; font-weight:700; color:#fff; letter-spacing:.5px; line-height:1.2; }
.sidebar-logo-sub  { font-size:.6rem; color:rgba(255,255,255,.35); letter-spacing:.3px; }
.sidebar-nav { flex:1; padding:12px 0; overflow-y:auto; overflow-x:hidden; }
.nav-section-label { font-size:.56rem; font-weight:700; color:rgba(255,255,255,.28); text-transform:uppercase; letter-spacing:1.8px; padding:12px 18px 4px; white-space:nowrap; opacity:1; transition:opacity .2s; }
.sidebar.mini .nav-section-label { opacity:0; height:6px; padding:0; }
.nav-item { display:flex; align-items:center; gap:10px; padding:9px 10px; cursor:pointer; color:rgba(255,255,255,.52); font-size:.78rem; font-weight:500; border-left:3px solid transparent; transition:all .2s ease; text-decoration:none; white-space:nowrap; position:relative; }
.nav-item:hover { background:rgba(255,255,255,.05); color:rgba(255,255,255,.88); border-left-color:rgba(74,144,217,.5); }
.nav-item.active { background:rgba(74,144,217,.13); color:#fff; border-left-color:var(--accent); }
.nav-icon-wrap { width:32px; height:32px; min-width:32px; display:flex; align-items:center; justify-content:center; border-radius:8px; font-size:15px; flex-shrink:0; transition:background .18s; }
.nav-item.active .nav-icon-wrap { background:rgba(74,144,217,.22); }
.nav-item:hover  .nav-icon-wrap { background:rgba(255,255,255,.07); }
.nav-text { opacity:1; transition:opacity .15s; white-space:nowrap; flex:1; }
.sidebar.mini .nav-text { opacity:0; pointer-events:none; }
.nav-badge { background:var(--accent); color:#fff; font-size:.56rem; font-weight:700; padding:2px 6px; border-radius:20px; flex-shrink:0; }
.sidebar.mini .nav-badge { opacity:0; }
.nav-tooltip { display:none; position:absolute; left:58px; top:50%; transform:translateY(-50%); background:#1a2332; color:#fff; font-size:.72rem; font-weight:500; padding:5px 10px; border-radius:6px; white-space:nowrap; pointer-events:none; z-index:999; box-shadow:0 4px 12px rgba(0,0,0,.35); }
.sidebar.mini .nav-item:hover .nav-tooltip,.sidebar.mini .nav-group-toggle:hover .nav-tooltip { display:block; }
.nav-group-toggle { display:flex; align-items:center; gap:10px; padding:9px 10px; cursor:pointer; color:rgba(255,255,255,.52); font-size:.78rem; font-weight:500; border-left:3px solid transparent; transition:all .2s ease; user-select:none; white-space:nowrap; position:relative; }
.nav-group-toggle:hover { background:rgba(255,255,255,.05); color:rgba(255,255,255,.88); border-left-color:rgba(74,144,217,.5); }
.nav-group-toggle.open { color:rgba(255,255,255,.88); }
.nav-group-text { flex:1; opacity:1; transition:opacity .15s; white-space:nowrap; }
.sidebar.mini .nav-group-text { opacity:0; pointer-events:none; }
.nav-group-arrow { font-size:.56rem; color:rgba(255,255,255,.28); transition:transform .25s ease,opacity .2s; display:inline-block; flex-shrink:0; }
.nav-group-toggle.open .nav-group-arrow { transform:rotate(90deg); color:rgba(255,255,255,.5); }
.sidebar.mini .nav-group-arrow { opacity:0; }
.nav-submenu { max-height:0; overflow:hidden; transition:max-height .3s cubic-bezier(.4,0,.2,1); }
.nav-submenu.open { max-height:200px; }
.sidebar.mini .nav-submenu { max-height:0 !important; }
.nav-subitem { display:flex; align-items:center; gap:8px; padding:7px 10px 7px 52px; cursor:pointer; color:rgba(255,255,255,.38); font-size:.73rem; border-left:3px solid transparent; transition:all .18s ease; white-space:nowrap; }
.nav-subitem:hover  { background:rgba(255,255,255,.04); color:rgba(255,255,255,.78); border-left-color:rgba(74,144,217,.4); }
.nav-subitem.active { background:rgba(74,144,217,.10); color:#fff; border-left-color:var(--accent); }
.nav-subitem::before { content:''; width:4px; height:4px; border-radius:50%; background:rgba(255,255,255,.22); flex-shrink:0; transition:background .18s; }
.nav-subitem.active::before { background:var(--accent); }
.sidebar-footer { padding:12px 10px; border-top:1px solid rgba(255,255,255,.07); flex-shrink:0; overflow:hidden; }
.sidebar-user { display:flex; align-items:center; gap:10px; }
.sidebar-avatar { width:32px; height:32px; min-width:32px; background:linear-gradient(135deg,var(--accent),#6c9fd8); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; color:#fff; flex-shrink:0; font-family:var(--font-display); }
.sidebar-user-info { opacity:1; transition:opacity .2s; white-space:nowrap; overflow:hidden; }
.sidebar.mini .sidebar-user-info { opacity:0; pointer-events:none; }
.sidebar-user-name { font-size:.73rem; font-weight:600; color:rgba(255,255,255,.82); }
.sidebar-user-role { font-size:.58rem; color:rgba(255,255,255,.32); }
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.48); z-index:199; opacity:0; pointer-events:none; transition:opacity .3s; }
.sidebar-overlay.active { opacity:1; pointer-events:auto; }

/* ===================================================
   MAIN
=================================================== */
.main-content { margin-left:240px; flex:1; display:flex; flex-direction:column; min-width:0; transition:margin-left .3s cubic-bezier(.4,0,.2,1); }
.main-body { padding:20px; flex:1; width:100%; max-width:1640px; margin:0 auto; }
.page-section { display:none; }
.page-section.active { display:block; width:100%; max-width:1600px; margin:0 auto; }

.topbar { display:flex; align-items:center; gap:10px; padding:12px 24px; background:#fff; border-bottom:1px solid #eaecf0; position:sticky; top:0; z-index:100; box-shadow:0 2px 10px rgba(0,0,0,.05); }
.topbar-burger { display:none; width:32px; height:32px; background:none; border:1px solid #eaecf0; border-radius:7px; cursor:pointer; align-items:center; justify-content:center; flex-shrink:0; }
.topbar-burger svg { width:15px; height:15px; stroke:#2c3e50; fill:none; stroke-width:2; stroke-linecap:round; display:block; }
.topbar-title { font-family:var(--font-display); font-size:.92rem; font-weight:700; color:#1a2332; letter-spacing:.3px; }
#topbar-processus-badge { align-items:center; gap:4px; flex-wrap:wrap; }
.topbar-processus-chip { background:#eef2ff; color:#3d5af1; border:1px solid #c7d2fe; border-radius:20px; padding:3px 10px; font-size:.72rem; font-weight:600; white-space:nowrap; max-width:200px; overflow:hidden; text-overflow:ellipsis; }
#topbar-user-info { align-items:center; gap:4px; flex-wrap:wrap; }
.topbar-role-chip  { border-radius:20px; padding:3px 8px; font-size:.68rem; font-weight:700; white-space:nowrap; }
.topbar-role-admin    { background:#1a2332; color:#fff; }
.topbar-role-pilote   { background:#eaf4fb; color:#1a5276; border:1px solid #aed6f1; }
.topbar-role-auditeur { background:#fef3e2; color:#9a5b0a; border:1px solid #f9d49e; }
.topbar-statut-chip   { border-radius:20px; padding:3px 8px; font-size:.68rem; font-weight:600; white-space:nowrap; }
.topbar-statut-actif  { background:#e8f8f0; color:#1e8449; border:1px solid #a9dfbf; }
.topbar-statut-invite { background:#fef3e2; color:#9a5b0a; border:1px solid #f9d49e; }
.topbar-statut-inactif { background:#f0f2f5; color:#5a6475; border:1px solid #d0d3da; }
.topbar-spacer { flex:1; }
.topbar-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.topbar-btn { background:none; border:1px solid #dde2ec; border-radius:8px; padding:7px 14px; font-size:.75rem; font-weight:600; color:#2c3e50; cursor:pointer; transition:all .2s; font-family:var(--font-primary); white-space:nowrap; }
.topbar-btn:hover { background:#f0f2f5; border-color:#bdc3c7; }
.export-btn { background:linear-gradient(135deg,#e8f5e9,#c8e6c9) !important; color:#1b5e20 !important; border-color:#a5d6a7 !important; font-weight:700 !important; }
.export-btn:hover { background:linear-gradient(135deg,#c8e6c9,#a5d6a7) !important; border-color:#81c784 !important; transform:translateY(-1px); box-shadow:0 3px 10px rgba(27,94,32,.2) !important; }
.export-btn:disabled { opacity:.7; cursor:wait; transform:none !important; }
.topbar-btn.secondary { background:linear-gradient(135deg,#e8f4fd,#d6eaf8); color:#1a6fa8; border-color:#aed6f1; }
.topbar-btn.secondary:hover { background:linear-gradient(135deg,#d6eaf8,#aed6f1); border-color:#85c1e9; transform:translateY(-1px); }
.topbar-btn.primary { background:linear-gradient(135deg,#1a2332,#2c3e50); color:#fff; border-color:transparent; box-shadow:0 2px 8px rgba(26,35,50,.25); }
.topbar-btn.primary:hover { background:linear-gradient(135deg,#243447,#34495e); box-shadow:0 4px 12px rgba(26,35,50,.3); transform:translateY(-1px); }

/* Badge revue validée dans topbar */
.badge-revue-validee {
    display: none;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #d5f5e3, #a9dfbf);
    color: #1e6b3a;
    border: 1px solid #82c99f;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(39,174,96,.15);
    animation: fadeInBadge .4s ease;
}

@keyframes fadeInBadge {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   CONTENU
=================================================== */
.page-title { text-align:center; font-family:var(--font-display); font-size:1.5vw; font-weight:700; text-transform:uppercase; letter-spacing:3px; margin-bottom:22px; padding:14px 20px; background:linear-gradient(135deg,#1a2332,#2c3e50); color:#fff; border-radius:10px; box-shadow:0 4px 16px rgba(0,0,0,.14); }
#conteneur { display:flex; flex-direction:column; align-items:center; width:100%; margin:auto; gap:8px; }
.section-title { width:100%; font-family:var(--font-display); font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; background:linear-gradient(135deg,#243447,#1a2332); color:#fff; padding:9px 16px; border-radius:8px; display:flex; align-items:center; justify-content:space-between; cursor:pointer; }
.contenu { width:100%; display:flex; flex-direction:column; align-items:center; overflow-x:auto; margin-bottom:6px; }

/* ===================================================
   TABLEAUX
=================================================== */
table { width:100%; table-layout:fixed; border-collapse:collapse; margin:10px 0; background:#fff; box-shadow:0 4px 20px rgba(0,0,0,.06); border-radius:10px; overflow:hidden; }
caption { caption-side:top; padding:14px 0 8px; }
.entete_conteneur { display:flex; flex-direction:column; align-items:center; gap:6px; }
.entete_contenu:first-child { font-size:1.4vw; font-weight:600; font-family:var(--font-display); }
.entete_contenu:last-child  { font-size:.85vw; }
th { background:var(--color-header-bg); font-weight:600; font-size:.6vw; padding:8px 6px; border:1px solid var(--color-border); text-transform:uppercase; letter-spacing:.5px; text-align:center; color:#444; }
td { padding:6px 4px; text-align:center; font-size:.72vw; border:1px solid #e8eaed; word-wrap:break-word; overflow-wrap:break-word; background-color:#fff; vertical-align:middle; line-height:1.5; }
tbody tr:first-child td { background:var(--color-header-bg); font-weight:600; font-size:.6vw; text-transform:uppercase; letter-spacing:.4px; color:#555; border-bottom:1px solid var(--color-border); }
tbody tr:not(:first-child):nth-child(even) td { background-color:var(--color-row-even); }
tbody tr:not(:first-child):hover td { background-color:var(--color-row-hover); transition:.2s ease; }
td.espace { min-width:140px; text-align:left; padding-left:8px; }
td.row-label    { font-weight:600; font-size:.68vw; background:var(--color-header-bg) !important; color:#444; text-align:left; padding-left:12px; }
td.label-vertical { font-weight:700; font-size:.72vw; writing-mode:vertical-rl; transform:rotate(180deg); text-align:center; padding:16px 8px; letter-spacing:1px; }
td.footer-label { font-size:.62vw; font-weight:600; font-style:italic; background:var(--color-header-bg) !important; color:#555; text-align:center; padding:8px; }
td.axis-label   { font-weight:700; font-size:.72vw; letter-spacing:1px; text-align:center; padding:10px; }
td.bordure      { border:none !important; background:transparent !important; }
td textarea { width:100%; min-height:70px; resize:vertical; border:1px solid #dde2ec; border-radius:6px; padding:8px 10px; font-size:.78vw; font-family:var(--font-primary); background:#fafbfc; transition:border-color .2s; }
td textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 2px rgba(74,144,217,.15); }
td select { border:none; background:transparent; cursor:pointer; font-size:.7vw; font-family:var(--font-primary); }
td input[type="date"] { border:1px solid #dde2ec; border-radius:6px; padding:4px 6px; font-size:.7vw; font-family:var(--font-primary); background:#fafbfc; }
td input[type="date"]:focus { outline:none; border-color:var(--accent); }
.big-select { font-size:1vw; }

/* ===================================================
   TABLEAU KPI — PAIRES R/O
=================================================== */
.tr-resultat td { border-bottom:1px dashed #d0d5dd !important; background-color:#fff !important; }
.tr-objectif td { background-color:#f7f9fc !important; font-style:italic; color:#5a6a7e; font-size:0.68vw !important; border-bottom:2px solid #c5cdd8 !important; }
.td-label-res { font-weight:700 !important; color:#1a2332 !important; background:#eef2ff !important; font-style:normal !important; border-right:2px solid #c0caff !important; font-size:.65rem !important; text-transform:uppercase; letter-spacing:0.3px; white-space:nowrap !important; }
.td-label-obj { font-weight:600 !important; color:#5a6a7e !important; background:#f0f4f8 !important; font-style:italic !important; border-right:2px solid #c5cdd8 !important; font-size:.65rem !important; text-transform:uppercase; letter-spacing:0.3px; white-space:nowrap !important; }

/* ===================================================
   ALERTE ROUGE KPI
=================================================== */
.ligne-alerte-rouge.tr-resultat td { background-color:#fff0f0 !important; border-color:#f5c6c6 !important; transition:background-color .3s ease; }
.ligne-alerte-rouge.tr-objectif td { background-color:#ffe8e8 !important; border-bottom:2px solid #e74c3c !important; border-color:#f5c6c6 !important; transition:background-color .3s ease; }
.ligne-alerte-rouge .td-label-res { background:#f5b7b1 !important; color:#7b241c !important; border-right-color:#e74c3c !important; }
.ligne-alerte-rouge .td-label-obj { background:#fadbd8 !important; color:#7b241c !important; border-right-color:#e74c3c !important; }
.ligne-alerte-rouge .td-seuil { background:#fad7d7 !important; border-left-color:#e74c3c !important; border-right-color:#e74c3c !important; }
.ligne-alerte-rouge .td-actions-kpi { background:#fad7d7 !important; border-left-color:#e74c3c !important; }
.ligne-alerte-rouge .gris { background-color:#f5e6e6 !important; }
.ligne-alerte-rouge td.rouge { background-color:#f9b8b0 !important; }
.ligne-alerte-rouge.tr-resultat td:first-child { border-left:3px solid #e74c3c !important; }
.ligne-alerte-rouge.tr-objectif td:first-child { border-left:3px solid #e74c3c !important; }

/* ===================================================
   COLONNE SEUIL
=================================================== */
.th-seuil { width:34px !important; min-width:34px !important; max-width:34px !important; padding:4px 2px !important; font-size:0.75vw; text-align:center; background:linear-gradient(135deg,#1a2332,#243447) !important; color:#fff !important; border-left:2px solid #2c4a6e !important; border-right:2px solid #2c4a6e !important; }
.td-seuil { width:34px !important; min-width:34px !important; max-width:34px !important; padding:2px 1px !important; text-align:center; vertical-align:middle; background:#e8f0f8 !important; border-left:2px solid #b8c8d8 !important; border-right:2px solid #b8c8d8 !important; }
.td-seuil-readonly { color:#8a95a3 !important; font-weight:800; font-size:.85rem; background:#eef1f5 !important; cursor:default; }

/* ===================================================
   COLONNES SOLDE (Solde prévu le / Solde le)
   Empêche le passage à la ligne et garantit une largeur lisible
=================================================== */
.th-solde { width:78px !important; min-width:78px !important; white-space:nowrap !important; padding:8px 4px !important; }
.td-solde { white-space:nowrap !important; }

/* ===================================================
   SELECT ANNÉE — section "SYNTHESE DES INDICATEURS"
   Intégré au design sombre de la section-title
=================================================== */
.kpi-annee-select {
    background:rgba(255,255,255,.12);
    color:#fff;
    border:1px solid rgba(255,255,255,.25);
    border-radius:6px;
    padding:3px 8px;
    margin-left:6px;
    font-family:var(--font-display);
    font-size:.72rem;
    font-weight:700;
    letter-spacing:1.2px;
    cursor:pointer;
    transition:background .2s,border-color .2s;
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 6px center;
    padding-right:22px;
}
.kpi-annee-select:hover { background-color:rgba(255,255,255,.22); border-color:rgba(255,255,255,.4); }
.kpi-annee-select:focus { outline:none; background-color:rgba(255,255,255,.22); border-color:var(--accent); }
.kpi-annee-select option { background:#243447; color:#fff; }

/* ===================================================
   COLONNE ACTIONS KPI
=================================================== */
.th-actions { width:64px; min-width:64px; text-align:center; background:linear-gradient(135deg,#1a2332,#243447) !important; color:#fff !important; }
.td-actions-kpi { width:64px; min-width:64px; text-align:center; vertical-align:middle; background:#f0f4f8 !important; border-left:2px solid #c5cdd8 !important; border-bottom:2px solid #c5cdd8 !important; padding:6px 4px; }
.actions-kpi-wrap { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; height:100%; }

/* ===================================================
   TABLEAU PARTICIPANTS
=================================================== */
.th-participant  { width:18%; text-align:left; padding-left:10px !important; }
.th-fonction     { width:14%; text-align:left; padding-left:10px !important; }
.th-client       { width:16%; text-align:left; padding-left:10px !important; }
.th-commentaire  { width:auto; text-align:left; padding-left:10px !important; }
.th-actions-part { width:72px; min-width:72px; text-align:center; background:linear-gradient(135deg,#1a2332,#243447) !important; color:#fff !important; }
.th-validation-group { background:linear-gradient(135deg,#1a3a5c,#1a2332) !important; color:#fff !important; text-align:center; }
.th-valid { width:80px; min-width:80px; text-align:center; font-size:0.65vw; padding:6px 4px !important; }
.th-valid-oui { background:linear-gradient(135deg,#d5f5e3,#a9dfbf) !important; color:#1e8449 !important; border-bottom:2px solid #27ae60 !important; }
.th-valid-non { background:linear-gradient(135deg,#fadbd8,#f5b7b1) !important; color:#c0392b !important; border-bottom:2px solid #e74c3c !important; }
.select-participant { width:100%; border:1px solid #dde2ec; border-radius:6px; padding:5px 8px; font-size:0.68vw; font-family:var(--font-primary); background:#f8f9fb; color:#333; cursor:pointer; transition:border-color .2s; appearance:auto; }
.select-participant:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 2px rgba(74,144,217,.12); }
.td-validation { text-align:center; vertical-align:middle; padding:8px 4px; background:#fafbfc; }
.radio-valid { display:flex; align-items:center; justify-content:center; cursor:pointer; user-select:none; }
.radio-valid input[type="radio"] { display:none; }
.radio-label-oui,.radio-label-non { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.05rem; font-weight:700; cursor:pointer; transition:all .22s ease; border:2px solid #dde2ec; background:#f0f2f5; color:#bbb; }
.radio-label-oui:hover { border-color:#27ae60; background:#eafaf1; color:#27ae60; transform:scale(1.1); }
.radio-label-non:hover { border-color:#e74c3c; background:#fdf2f0; color:#e74c3c; transform:scale(1.1); }
.radio-valid:has(input[value="oui"]:checked) .radio-label-oui { color:#1e8449; background:#d5f5e3; border-color:#27ae60; box-shadow:0 2px 8px rgba(39,174,96,.25); transform:scale(1.08); }
.radio-valid:has(input[value="non"]:checked) .radio-label-non { color:#c0392b; background:#fadbd8; border-color:#e74c3c; box-shadow:0 2px 8px rgba(231,76,60,.25); transform:scale(1.08); }
.ligne-validee td { background-color:#f2faf5 !important; border-color:#a9dfbf !important; transition:background-color .3s ease; }
.ligne-validee td:first-child { border-left:4px solid #27ae60 !important; }
.ligne-non-validee td { background-color:#fdf5f5 !important; border-color:#f5c6c6 !important; transition:background-color .3s ease; }
.ligne-non-validee td:first-child { border-left:4px solid #e74c3c !important; }
.td-editable { text-align:left !important; padding-left:10px !important; cursor:text; min-width:80px; }
.td-editable:focus { outline:2px solid var(--accent); border-radius:4px; background:#fffde7 !important; }
.td-commentaire { font-style:italic; color:#777; min-width:100px; }
.td-actions-part { width:72px; min-width:72px; text-align:center; vertical-align:middle; background:#f0f4f8 !important; border-left:2px solid #c5cdd8 !important; padding:4px 6px; }
.actions-part-wrap { display:flex; flex-direction:row; align-items:center; justify-content:center; gap:4px; }
.tableau-valide { outline:3px solid #27ae60; outline-offset:2px; border-radius:10px; }

/* ===================================================
   BANDEAU VALIDATION FINALE
=================================================== */
.bandeau-validation {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
    border: 2px solid #e8eaed;
    border-radius: 12px;
    padding: 18px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    margin-top: 8px;
    flex-wrap: wrap;
}

.bandeau-conditions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.cond-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .82rem;
    color: #888;
    transition: color .3s ease;
}

.cond-item .cond-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    background: #f0f2f5;
    border: 2px solid #dde2ec;
    color: #bbb;
    flex-shrink: 0;
    transition: all .3s ease;
}

.cond-item .cond-text {
    font-weight: 500;
    transition: color .3s;
}

/* Condition remplie */
.cond-item.cond-ok {
    color: #1e8449;
}

.cond-item.cond-ok .cond-icon {
    background: #d5f5e3;
    border-color: #27ae60;
    color: #1e8449;
}

.cond-item.cond-ok .cond-icon::before {
    content: '✔';
    font-size: .75rem;
}

.cond-item:not(.cond-ok) .cond-icon::before {
    content: '○';
    font-size: .8rem;
}

/* Animation erreur */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.cond-shake { animation: shake 0.5s ease; }

.bandeau-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.horodatage-validation {
    font-size: .72rem;
    color: #1e8449;
    font-weight: 600;
    font-style: italic;
}

/* ===================================================
   BOUTON VALIDER LA REVUE
=================================================== */
.btn-valider-revue {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 10px;
    border: 2px solid #dde2ec;
    background: #f5f6f8;
    color: #aaa;
    font-size: .85rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: not-allowed;
    transition: all .3s ease;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Prêt à valider */
.btn-valider-revue.btn-valider-ready {
    background: linear-gradient(135deg, #1e8449, #27ae60);
    border-color: #1e6b3a;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(39, 174, 96, 0.35);
    animation: pulseGreen 2s infinite;
}

.btn-valider-revue.btn-valider-ready:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    box-shadow: 0 6px 24px rgba(39, 174, 96, 0.5);
    transform: translateY(-2px);
}

@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 4px 18px rgba(39,174,96,.35); }
    50%       { box-shadow: 0 4px 28px rgba(39,174,96,.60); }
}

/* Revue validée */
.btn-valider-revue.btn-valider-done {
    background: linear-gradient(135deg, #d5f5e3, #a9dfbf);
    border-color: #82c99f;
    color: #1e6b3a;
    cursor: default;
    box-shadow: none;
    animation: none;
}

/* ===================================================
   BOUTON DÉVALIDER LA REVUE
=================================================== */
.btn-devalider-revue {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 9px;
    border: 2px solid #e59c3a;
    background: linear-gradient(135deg, #fef3e2, #fde8c0);
    color: #a05c0a;
    font-size: .82rem;
    font-weight: 700;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all .25s ease;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-devalider-revue:hover {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-color: #c87f0a;
    color: #fff;
    box-shadow: 0 4px 14px rgba(230, 126, 34, 0.35);
    transform: translateY(-1px);
}

/* ===================================================
   MODAL VALIDATION REVUE
=================================================== */
.modal-valider { max-width: 480px !important; }

.modal-valider-icon {
    background: linear-gradient(135deg, #d5f5e3, #a9dfbf) !important;
    box-shadow: 0 4px 16px rgba(39,174,96,.2) !important;
}

.modal-valider-icon svg { color: #1e8449 !important; }

.modal-btn.valider {
    background: linear-gradient(135deg, #1e8449, #27ae60);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(39,174,96,.3);
}

.modal-btn.valider:hover {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(39,174,96,.45);
}

/* ===================================================
   ICON BUTTONS
=================================================== */
.icon-btn { width:30px; height:30px; border-radius:8px; border:none; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; transition:all .18s ease; background:transparent; padding:5px; }
.icon-btn svg { width:16px; height:16px; display:block; flex-shrink:0; }
.btn-icon-add    { color:#1e8449; }
.btn-icon-add:hover    { background:#d5f5e3; transform:scale(1.18); box-shadow:0 2px 8px rgba(30,132,73,.2); }
.btn-icon-edit   { color:#1a6fa8; }
.btn-icon-edit:hover   { background:#d6eaf8; transform:scale(1.18); box-shadow:0 2px 8px rgba(26,111,168,.2); }
.btn-icon-edit-active  { background:#aed6f1 !important; color:#1a6fa8; }
.btn-icon-delete { color:#c0392b; }
.btn-icon-delete:hover { background:#fadbd8; transform:scale(1.18); box-shadow:0 2px 8px rgba(192,57,43,.2); }
.btn-icon-save   { color:#117a65; }
.btn-icon-save:hover   { background:#d1f2eb; transform:scale(1.18); box-shadow:0 2px 8px rgba(17,122,101,.22); }
.btn-icon-save.is-saved { color:#fff; background:#117a65; }
.btn-icon-save.is-saved:hover { background:#0e6655; }
.td-editing { background:#fffde7 !important; outline:2px solid #f39c12 !important; border-radius:4px; cursor:text; }

/* ===================================================
   COULEURS
=================================================== */
.gris        { background-color:#eceff1 !important; color:#546e7a; }
.vert        { background-color:#c8f5d8 !important; color:#1b6b3a; font-weight:600; }
.jaune       { background-color:#fffde7 !important; color:#8a6d00; font-weight:600; }
.orange      { background-color:#fff3e0 !important; color:#b85c00; font-weight:600; }
.rouge       { background-color:#ffe5e5 !important; color:#c0392b; font-weight:600; }
.rouge_ecriture { color:#d10c0c; font-weight:600; }

/* ===================================================
   MATRICE DES CRITÈRES
=================================================== */
.block { display:flex; flex-wrap:wrap; width:100%; justify-content:center; gap:20px; margin-bottom:20px; }
.block_contenu { flex:1; min-width:260px; overflow-x:auto; }
.header-left,.header-top { background:linear-gradient(135deg,#1a2332,#2c3e50) !important; color:#fff !important; }
.sub-header { background:var(--color-header-bg) !important; color:#555 !important; font-size:.6vw; }
.row-label-matrix { background:var(--color-header-bg) !important; color:#444 !important; font-weight:600; text-align:left !important; padding-left:10px !important; }
.acceptable   { background-color:#d5f5e3 !important; color:#1e8449; font-weight:600; }
.surveiller   { background-color:#fef9e7 !important; color:#b7950b; font-weight:600; }
.inacceptable { background-color:#fadbd8 !important; color:#c0392b; font-weight:600; }

/* ===================================================
   SECTIONS COLLAPSIBLES
=================================================== */
.section-toggle-btn { background:rgba(255,255,255,.15); border:none; border-radius:6px; color:#fff; font-size:.65rem; padding:3px 8px; cursor:pointer; transition:background .2s,transform .3s; flex-shrink:0; }
.section-toggle-btn:hover { background:rgba(255,255,255,.28); }
.section-toggle-btn.collapsed { transform:rotate(-90deg); }
.section-body { transition:max-height .35s cubic-bezier(.4,0,.2,1),opacity .3s; overflow:hidden; max-height:5000px; opacity:1; width:100%; }
.section-body.collapsed { max-height:0; opacity:0; }

/* ===================================================
   EMOJI PICKER
=================================================== */
.emoji-picker { position:relative; display:inline-block; }
.emoji-picker .emoji-selected { cursor:pointer; font-size:1.3rem; padding:2px 6px; border-radius:6px; border:1px solid transparent; display:inline-block; min-width:36px; text-align:center; transition:border-color .15s; user-select:none; }
.emoji-picker .emoji-selected:hover { border-color:#ccc; background:#f5f5f5; }
.emoji-picker .emoji-selected.vide { font-size:.7rem; color:#aaa; }
.emoji-dropdown { display:none; position:absolute; top:110%; left:50%; transform:translateX(-50%); background:#fff; border:1px solid #ddd; border-radius:10px; box-shadow:0 6px 20px rgba(0,0,0,.12); padding:6px 8px; z-index:999; white-space:nowrap; gap:4px; flex-direction:row; }
.emoji-dropdown.open { display:flex; }
.emoji-option { font-size:1.4rem; cursor:pointer; padding:4px 6px; border-radius:6px; transition:background .15s; }
.emoji-option:hover { background:#f0f0f0; }
/* Seul "content" (😊) est colorise en vert : l'emoji est jaune nativement.
   "moyen" (😐) reste jaune et "pas_content" (😡) reste rouge — couleurs natives OK. */
.emoji-selected[data-val="content"],
.emoji-option[data-val="content"] { filter:hue-rotate(70deg) saturate(1.4); }

/* ===================================================
   MODALS
=================================================== */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); backdrop-filter:blur(4px); z-index:500; align-items:center; justify-content:center; }
.modal-overlay.open { display:flex; }
.modal { background:#fff; border-radius:16px; box-shadow:0 24px 64px rgba(0,0,0,.2); width:90%; max-width:860px; max-height:90vh; overflow-y:auto; padding:32px; position:relative; border:1px solid #e8eaed; }
.modal.modal-large { max-width:780px; }
.modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; padding-bottom:14px; border-bottom:2px solid #e8eaed; }
.modal-header h2 { font-family:var(--font-display); font-size:1rem; font-weight:700; color:#1a2332; text-transform:uppercase; letter-spacing:1px; }
.modal-close { background:none; border:none; font-size:1.4rem; cursor:pointer; color:#888; transition:color .2s; width:32px; height:32px; display:flex; align-items:center; justify-content:center; border-radius:6px; }
.modal-close:hover { color:#c0392b; background:#fff0f0; }
.modal-group { margin-bottom:20px; }
.modal-group-title { font-family:var(--font-display); font-size:.65rem; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:#fff; background:linear-gradient(135deg,#243447,#1a2332); padding:7px 12px; border-radius:6px; margin-bottom:14px; display:flex; align-items:center; justify-content:space-between; cursor:pointer; user-select:none; transition:filter .18s ease, transform .18s ease; }
.modal-group-title:hover { filter:brightness(1.15); }
.modal-group-title:active { transform:scale(.995); }
.modal-group-title .mgt-arrow { display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; font-size:.7rem; line-height:1; transition:transform .22s ease; opacity:.85; }
.modal-group.collapsed .modal-group-title { margin-bottom:0; }
.modal-group.collapsed .modal-group-title .mgt-arrow { transform:rotate(-90deg); }
.modal-group-body { overflow:hidden; transition:max-height .28s ease, opacity .22s ease; }
.modal-group.collapsed .modal-group-body { max-height:0 !important; opacity:0; pointer-events:none; }
.modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.modal-grid.cols-3 { grid-template-columns:1fr 1fr 1fr; }
.modal-grid.cols-4 { grid-template-columns:1fr 1fr 1fr 1fr; }
.modal-field { display:flex; flex-direction:column; gap:5px; }
.modal-field.full { grid-column:1 / -1; }
.modal-field label { font-size:.65rem; font-weight:700; color:#555; text-transform:uppercase; letter-spacing:.5px; }
.modal-field input,.modal-field select,.modal-field textarea { border:1px solid #dde2ec; border-radius:8px; padding:8px 10px; font-size:.8rem; font-family:var(--font-primary); background:#f8f9fb; color:#333; transition:border-color .2s,box-shadow .2s; width:100%; }
.modal-field textarea { min-height:70px; resize:vertical; }
.modal-field input:focus,.modal-field select:focus,.modal-field textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(74,144,217,.12); background:#fff; }
.modal-grid-kpi { display:grid; grid-template-columns:100px 1fr 1fr 1fr; gap:8px; align-items:center; }
.kpi-col-header { font-size:.65rem; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:#1a6fa8; text-align:center; padding:4px 0; border-bottom:2px solid #aed6f1; }
.kpi-row-label  { font-size:.7rem; font-weight:700; color:#444; text-transform:uppercase; letter-spacing:.4px; padding:4px 8px; background:var(--color-header-bg); border-radius:6px; text-align:center; }
.criticite-result { display:flex; align-items:center; gap:10px; padding:9px 14px; border-radius:8px; border:2px solid transparent; font-weight:700; transition:background .3s,border-color .3s,color .3s; background:#f0f2f5; min-height:42px; }
.criticite-value  { font-family:var(--font-display); font-size:1.5rem; font-weight:800; line-height:1; min-width:36px; text-align:center; }
.criticite-label  { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.6px; }
.criticite-acceptable   { background:#d5f5e3 !important; border-color:#27ae60; color:#1e8449; }
.criticite-surveiller   { background:#fef9e7 !important; border-color:#f39c12; color:#b7950b; }
.criticite-inacceptable { background:#fadbd8 !important; border-color:#e74c3c; color:#c0392b; }
/* table-layout:auto (au lieu du fixed hérité de la règle générique "table") :
   permet aux colonnes visibles de se répartir l'espace libéré quand on en
   masque via le sélecteur de colonnes, comme dans le tableau du Plan d'actions. */
#tableau-actions { table-layout:auto; }
/* Code couleur des criticités dans le tableau-actions */
#tableau-actions td.cell-criticite { padding:4px; }
#tableau-actions td.cell-criticite .criticite-badge { display:inline-flex; align-items:center; justify-content:center; min-width:34px; padding:5px 10px; border-radius:6px; border:2px solid transparent; font-family:var(--font-display); font-weight:800; font-size:.95rem; line-height:1; }
#tableau-actions td.cell-criticite .criticite-badge.crit-acceptable   { background:#d5f5e3; border-color:#27ae60; color:#1e8449; }
#tableau-actions td.cell-criticite .criticite-badge.crit-surveiller   { background:#fef9e7; border-color:#f39c12; color:#b7950b; }
#tableau-actions td.cell-criticite .criticite-badge.crit-inacceptable { background:#fadbd8; border-color:#e74c3c; color:#c0392b; }
/* Bouton de tri intégré dans l'en-tête des colonnes Criticité */
#tableau-actions thead td.th-criticite { padding:6px 8px; }
#tableau-actions .th-crit-wrap { display:inline-flex; align-items:center; justify-content:center; gap:6px; line-height:1.15; }
#tableau-actions .th-sort-btn { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; padding:0; border:1px solid rgba(255,255,255,.35); background:rgba(255,255,255,.12); color:inherit; border-radius:5px; cursor:pointer; transition:background .15s, border-color .15s, color .15s, transform .15s; flex-shrink:0; }
#tableau-actions .th-sort-btn:hover { background:rgba(255,255,255,.28); border-color:rgba(255,255,255,.6); transform:translateY(-1px); }
#tableau-actions .th-sort-btn[data-sort-state="desc"],
#tableau-actions .th-sort-btn[data-sort-state="asc"] { background:#fff; border-color:#fff; color:#1a2332; }
#tableau-actions .th-sort-btn svg { display:block; pointer-events:none; }
.modal-footer { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; padding-top:16px; border-top:1px solid #e8eaed; }
.modal-btn { padding:9px 22px; border-radius:8px; font-size:.8rem; font-weight:600; cursor:pointer; transition:all .2s; font-family:var(--font-primary); }
.modal-btn.cancel { background:none; border:1px solid #dde2ec; color:#555; }
.modal-btn.cancel:hover { background:#f0f2f5; }
.modal-btn.save { background:linear-gradient(135deg,#1a2332,#2c3e50); border:none; color:#fff; box-shadow:0 2px 8px rgba(26,35,50,.25); }
.modal-btn.save:hover { background:linear-gradient(135deg,#243447,#34495e); transform:translateY(-1px); }
.modal-btn.delete { background:linear-gradient(135deg,#c0392b,#e74c3c); border:none; color:#fff; }
.modal-btn.delete:hover { background:linear-gradient(135deg,#e74c3c,#c0392b); transform:translateY(-1px); }
.modal-btn:disabled { opacity:.7; cursor:not-allowed; transform:none !important; }
.modal-btn-spinner { width:13px; height:13px; border-radius:50%; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; display:inline-block; vertical-align:middle; animation:modal-btn-spin .7s linear infinite; }
@keyframes modal-btn-spin { to { transform:rotate(360deg); } }
.modal.modal-confirm { max-width:440px; text-align:center; padding:44px 36px; }
.modal-confirm-icon { width:64px; height:64px; background:#fadbd8; border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 22px; box-shadow:0 4px 16px rgba(192,57,43,.15); }
.modal-confirm-icon svg { width:30px; height:30px; color:#c0392b; }
.modal-confirm-title { font-family:var(--font-display); font-size:1.05rem; font-weight:700; color:#1a2332; margin-bottom:12px; letter-spacing:.3px; }
.modal-confirm-text { font-size:.84rem; color:#666; line-height:1.7; margin-bottom:30px; }
.modal-confirm-actions { display:flex; gap:12px; justify-content:center; }

/* ===================================================
   FILTRES
=================================================== */
.filtre-wrap { width:100%; display:flex; flex-direction:column; gap:0; background:#fff; border-radius:12px; box-shadow:0 4px 20px rgba(0,0,0,.07); overflow:hidden; margin-bottom:6px; }
.filtre-groupe-label { font-family:var(--font-display); font-size:.63rem; font-weight:700; text-transform:uppercase; letter-spacing:1.2px; color:#fff; padding:7px 18px; }
.filtre-groupe-label:nth-of-type(1) { background:linear-gradient(135deg,#1a3a5c,#1a2332); }
.filtre-groupe-label:nth-of-type(2) { background:linear-gradient(135deg,#1a4a3a,#1a2332); }
.filtre-groupe-label:nth-of-type(3) { background:linear-gradient(135deg,#3a1a4a,#1a2332); }
.filtre-groupe-label:nth-of-type(4) { background:linear-gradient(135deg,#4a3a1a,#1a2332); }
.filtre-bar { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; padding:12px 18px 14px; border-bottom:1px solid #f0f2f5; background:#fff; border-radius:0; margin-bottom:0; }
.filtre-field { display:flex; flex-direction:column; gap:4px; flex:1; min-width:150px; }
.filtre-field label { font-size:.6rem; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:#555; }
.filtre-field select,.filtre-field input[type="date"] { border:1px solid #dde2ec; border-radius:8px; padding:7px 10px; font-size:.78rem; font-family:var(--font-primary); background:#f8f9fb; color:#333; cursor:pointer; width:100%; }
.filtre-field select:focus,.filtre-field input[type="date"]:focus { outline:none; border-color:var(--accent); }
.filtre-reset-wrap { display:flex; justify-content:flex-end; padding:10px 18px 14px; background:#f8f9fb; }
.filtre-reset { background:none; border:1px solid #fadbd8; border-radius:8px; padding:7px 16px; font-size:.73rem; font-weight:600; color:#c0392b; cursor:pointer; transition:all .2s; font-family:var(--font-primary); }
.filtre-reset:hover { background:#fadbd8; border-color:#e74c3c; }
tr.filtre-hidden { display:none; }

/* ===================================================
   RESPONSIVE
=================================================== */
@media screen and (max-width: 1024px) {
    .sidebar { width:220px; min-width:220px; }
    .sidebar.mini { width:56px; min-width:56px; }
    .main-content { margin-left:220px; }
    .page-title { font-size:clamp(1rem, 2.2vw, 1.4rem); }
    th,td,tbody tr:first-child td { font-size:clamp(11px, 1.1vw, 13px); padding:4px; }
    .modal-grid.cols-4 { grid-template-columns:1fr 1fr; }
    .topbar-btn { padding:6px 10px; font-size:.7rem; }
    .tr-objectif td { font-size:.7rem !important; }
    .td-label-res,.td-label-obj { font-size:.62rem !important; }
    .select-participant { font-size:.85rem; }
    .bandeau-validation { padding:14px 18px; gap:14px; }
    .btn-valider-revue { padding:10px 20px; font-size:.78rem; }
}

@media screen and (max-width: 768px) {
    .sidebar { transform:translateX(-100%); width:260px; min-width:260px; }
    .sidebar.open { transform:translateX(0); box-shadow:6px 0 32px rgba(0,0,0,.22); }
    .sidebar-overlay { display:block; }
    .main-content { margin-left:0 !important; }
    .topbar-burger { display:flex; }
    .page-title { font-size:clamp(.95rem, 4vw, 1.3rem); letter-spacing:1.5px; }
    table,thead,tbody,th,td,tr { display:block; width:100%; }
    thead { display:none; }
    tr { margin-bottom:16px; background:#fff; border-radius:10px; padding:10px; }
    td { text-align:left; padding:6px 10px; font-size:13px; border:none; border-bottom:1px solid #f0f0f0; display:flex; justify-content:space-between; }
    .modal { padding:20px; width:95%; }
    .modal-grid,.modal-grid.cols-3,.modal-grid.cols-4 { grid-template-columns:1fr; }
    .topbar-btn { padding:5px 8px; font-size:.65rem; }
    .icon-btn { width:26px; height:26px; }
    .icon-btn svg { width:14px; height:14px; }
    .td-actions-kpi { display:flex; flex-direction:row; gap:8px; justify-content:flex-end; border-left:none !important; }
    .td-seuil { width:auto !important; min-width:unset !important; }
    .select-seuil { font-size:14px; width:auto; }
    .bandeau-validation { flex-direction:column; align-items:flex-start; }
    .bandeau-right { width:100%; align-items:stretch; }
    .btn-valider-revue { width:100%; justify-content:center; }
    .badge-revue-validee { font-size:.65rem; }
    .td-actions-part { display:flex; flex-direction:row; gap:6px; justify-content:flex-end; border-left:none !important; }
    /* Cartographie mobile */
    .carto-bloc { flex-direction:column; }
    .carto-label { width:100%; min-height:unset; padding:12px 16px; writing-mode:horizontal-tb; transform:none; letter-spacing:0; }
    .carto-cards { flex-direction:column; padding:12px; gap:8px; }
    .carto-card { font-size:.82rem; padding:12px 16px; }
}

/* ===================================================
   PAGE CARTOGRAPHIE DES PROCESSUS
=================================================== */

.carto-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Chaque ligne de la cartographie (Piloter / Opérationnel / Support) */
.carto-bloc {
    display: flex;
    flex-direction: row;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    min-height: 90px;
}

/* Étiquette latérale (label vertical) */
.carto-label {
    width: 110px;
    min-width: 110px;
    background: linear-gradient(180deg, #1a2332 0%, #243447 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    flex-shrink: 0;
}

.carto-label span {
    color: #fff;
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

/* Zone des cartes de processus */
.carto-cards {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #1a2332 100%);
}

/* Carte individuelle de processus */
.carto-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 20px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-primary);
    font-size: .78rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all .22s ease;
    min-width: 140px;
    line-height: 1.4;
    white-space: nowrap;
}

.carto-card:hover {
    background: rgba(74, 144, 217, 0.28);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74,144,217,.25);
}

/* Couleur accent par type de bloc */
.carto-bloc:nth-child(1) .carto-label { background: linear-gradient(180deg, #1a3a5c 0%, #1a2332 100%); }
.carto-bloc:nth-child(1) .carto-cards { background: linear-gradient(135deg, #1a3a5c 0%, #1a2332 100%); }
.carto-bloc:nth-child(1) .carto-card:hover { background:rgba(74,144,217,.35); border-color:#5ba3e0; }

.carto-bloc:nth-child(2) .carto-label { background: linear-gradient(180deg, #1a3347 0%, #243447 100%); }
.carto-bloc:nth-child(2) .carto-cards { background: linear-gradient(135deg, #243447 0%, #1a2332 100%); }
.carto-bloc:nth-child(2) .carto-card:hover { background:rgba(74,144,217,.30); }

.carto-bloc:nth-child(3) .carto-label { background: linear-gradient(180deg, #1e2e40 0%, #1a2332 100%); }
.carto-bloc:nth-child(3) .carto-cards { background: linear-gradient(135deg, #1e2e40 0%, #1a2332 100%); }
.carto-bloc:nth-child(3) .carto-card:hover { background:rgba(74,144,217,.28); }

/* ===================================================
   PAGE FICHE PROCESSUS
=================================================== */

.fiche-processus {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Section générique */
.fiche-section {
    background: #fff;
    border: 1px solid #e0e4ea;
    border-top: none;
    padding: 16px 22px;
}

.fiche-section:first-child {
    border-top: 1px solid #e0e4ea;
    border-radius: 12px 12px 0 0;
}

.fiche-section:last-child {
    border-radius: 0 0 12px 12px;
}

/* Carte d'identité */
.fiche-identite {
    background: linear-gradient(135deg, #1a2332, #243447);
    border-color: transparent !important;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-radius: 12px 12px 0 0 !important;
}

.fiche-identite-label {
    font-family: var(--font-display);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.55);
    white-space: nowrap;
    flex-shrink: 0;
}

.fiche-identite-value {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
}

/* Détails (Typologie, Pilote, Processus clé) */
.fiche-details {
    background: #f8f9fb;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.fiche-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-right: 1px solid #e0e4ea;
    flex: 1;
    min-width: 200px;
}

.fiche-detail-item:last-child { border-right: none; }

.fiche-lbl {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
    white-space: nowrap;
}

.fiche-val {
    font-size: .82rem;
    font-weight: 600;
    color: #1a2332;
}

/* Finalités */
.fiche-finalites {
    background: #eef2ff;
    border-left: 4px solid var(--accent) !important;
    font-size: .88rem;
    font-style: italic;
    color: #2c3e50;
    line-height: 1.7;
}

/* Flux amont / aval */
.fiche-flux {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f0f4f8;
    padding: 0;
    overflow: hidden;
}

.fiche-flux-amont,
.fiche-flux-aval {
    flex: 1;
    padding: 16px 22px;
    text-align: center;
}

.fiche-flux-amont { background: linear-gradient(135deg, #e8f4fd, #d6eaf8); }
.fiche-flux-aval  { background: linear-gradient(135deg, #d5f5e3, #a9dfbf); }

.fiche-flux-title {
    font-family: var(--font-display);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    color: #1a2332;
}

.fiche-flux-amont p { color: #1a6fa8; font-weight: 600; font-size: .85rem; margin: 0; }
.fiche-flux-aval  p { color: #1e6b3a; font-weight: 600; font-size: .85rem; margin: 0; }

.fiche-flux-arrow {
    font-size: 1.4rem;
    color: #bbb;
    padding: 0 8px;
    flex-shrink: 0;
}

/* Opérations (Entrée + Activités + Sortie) */
.fiche-operations {
    display: flex;
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.fiche-entree,
.fiche-sortie {
    width: 180px;
    min-width: 160px;
    padding: 16px 16px;
    background: #f8f9fb;
    border-right: 1px solid #e0e4ea;
}

.fiche-sortie {
    border-right: none;
    border-left: 1px solid #e0e4ea;
}

.fiche-activites {
    flex: 1;
    padding: 16px 18px;
    background: #fff;
}

.fiche-ops-title {
    font-family: var(--font-display);
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, #243447, #1a2332);
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: inline-block;
}

/* Listes */
.fiche-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fiche-list li {
    font-size: .78rem;
    color: #2c3e50;
    padding: 7px 10px;
    background: #eef2ff;
    border-left: 3px solid var(--accent);
    border-radius: 0 6px 6px 0;
    line-height: 1.4;
}

.fiche-list-danger li {
    background: #fff0f0;
    border-left-color: #e74c3c;
    color: #7b241c;
}

/* Tables de la fiche */
.fiche-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
    border-radius: 8px;
    overflow: hidden;
}

.fiche-table th {
    background: linear-gradient(135deg, #f0f2f5, #e6e9ef);
    color: #444;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 8px 10px;
    border: 1px solid #dde2ec;
    text-align: left;
}

.fiche-table td {
    padding: 8px 10px;
    border: 1px solid #e8eaed;
    color: #333;
    font-size: .78rem;
    background: #fff;
    vertical-align: top;
    text-align: left;
    line-height: 1.5;
}

.fiche-table tbody tr:nth-child(even) td { background: #fafafa; }
.fiche-table tbody tr:hover td { background: #f2f6ff; }

/* Bas (Indicateurs + Risques côte à côte) */
.fiche-bas {
    display: flex;
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.fiche-indicateurs {
    flex: 2;
    padding: 16px 18px;
    border-right: 1px solid #e0e4ea;
}

.fiche-risques {
    flex: 1;
    padding: 16px 16px;
    background: #fdf5f5;
    min-width: 180px;
}

/* Dates */
.fiche-dates {
    background: #f8f9fb;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border-radius: 0 0 12px 12px !important;
}

.fiche-date-item {
    font-size: .75rem;
    color: #888;
    font-style: italic;
    flex: 1;
    min-width: 200px;
    padding: 4px 0;
}

/* ===================================================
   FOOTER FICHE PROCESSUS
=================================================== */

.fiche-footer {
    width: 100%;
    max-width: 1100px;
    margin: 28px auto 0;
    background: linear-gradient(135deg, #1a2332, #243447);
    border-radius: 12px;
    padding: 32px 36px 16px;
    color: rgba(255,255,255,.75);
}

.fiche-footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-bottom: 20px;
}

.fiche-footer-section { flex: 1; min-width: 150px; }

.fiche-footer-section h3 {
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #fff;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.fiche-footer-section p {
    font-size: .75rem;
    color: rgba(255,255,255,.6);
    margin-bottom: 4px;
    line-height: 1.6;
}

.fiche-social {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.fiche-social a {
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform .2s;
}

.fiche-social a:hover { transform: scale(1.2); }

.fiche-footer-bottom {
    text-align: center;
    font-size: .68rem;
    color: rgba(255,255,255,.3);
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 14px;
    margin: 0;
}

/* ===================================================
   FICHE PROCESSUS — RESPONSIVE
=================================================== */

@media screen and (max-width: 900px) {
    .fiche-operations { flex-direction: column; }
    .fiche-entree, .fiche-sortie { width: 100%; min-width: unset; border-right: none; border-left: none; border-bottom: 1px solid #e0e4ea; }
    .fiche-bas { flex-direction: column; }
    .fiche-indicateurs { border-right: none; border-bottom: 1px solid #e0e4ea; }
    .fiche-flux { flex-direction: column; }
    .fiche-flux-arrow { display: none; }
    .fiche-details { flex-direction: column; }
    .fiche-detail-item { border-right: none; border-bottom: 1px solid #e0e4ea; }
    .fiche-detail-item:last-child { border-bottom: none; }
    .fiche-footer { padding: 24px 20px 14px; }
    .fiche-footer-container { gap: 20px; }
}

/* ===================================================
   BOUTON CRÉER UNE FICHE PROCESSUS
=================================================== */
.btn-creer-fiche {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1a2332, #2c3e50) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: 700 !important;
    font-family: var(--font-display) !important;
    letter-spacing: .4px;
    padding: 9px 20px !important;
    box-shadow: 0 3px 12px rgba(26,35,50,.3);
    transition: all .2s ease !important;
}

.btn-creer-fiche:hover {
    background: linear-gradient(135deg, #243447, #34495e) !important;
    box-shadow: 0 5px 18px rgba(26,35,50,.42) !important;
    transform: translateY(-1px) !important;
}

/* ===================================================
   MODAL FICHE PROCESSUS
=================================================== */
.modal-fiche {
    max-width: 860px !important;
}

.modal-fiche .modal-group-title {
    background: linear-gradient(135deg, #1a2332, #243447);
}

/* Span requis */
.req {
    color: #e74c3c;
    margin-left: 2px;
}

/* Hint gris dans les labels */
.modal-hint {
    font-size: .6rem;
    font-weight: 400;
    color: #aaa;
    font-style: italic;
    margin-left: 4px;
    text-transform: none;
    letter-spacing: 0;
}

/* Grid 2 colonnes par défaut (déjà défini) — cols-3 pour les dates */
.modal-grid.cols-2 { grid-template-columns: 1fr 1fr; }

@media screen and (max-width: 768px) {
    .modal-grid.cols-2,
    .modal-grid.cols-3 { grid-template-columns: 1fr; }
    .btn-creer-fiche { font-size: .72rem; padding: 8px 14px !important; }
}

/* ===================================================
   PAGE PARTIES INTÉRESSÉES
=================================================== */

/* Layout formulaire + critères côte à côte */
.pi-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    margin: 16px 0;
    flex-wrap: wrap;
    align-items: flex-start;
}

.pi-form-wrap {
    flex: 1;
    min-width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 20px;
}

.pi-criteres-wrap {
    flex: 1;
    min-width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 20px;
}

/* Grille formulaire */
.pi-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.pi-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pi-field label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #555;
}

.pi-field input,
.pi-field select {
    border: 1px solid #dde2ec;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .82rem;
    font-family: var(--font-primary);
    background: #f8f9fb;
    color: #333;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

.pi-field input:focus,
.pi-field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,144,217,.12);
    background: #fff;
}

.pi-field input[readonly] {
    background: #eef2ff;
    color: #1a2332;
    font-weight: 700;
    cursor: default;
}

.pi-field-full { grid-column: 1 / -1; }

.btn-pi-submit {
    width: 100%;
    padding: 11px 20px;
    background: linear-gradient(135deg, #1a2332, #2c3e50);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(26,35,50,.25);
}

.btn-pi-submit:hover {
    background: linear-gradient(135deg, #243447, #34495e);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(26,35,50,.35);
}

/* Tableaux critères */
.pi-criteres-title {
    font-family: var(--font-display);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #1a2332;
    margin: 0 0 8px;
}

.pi-criteres-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
    border-radius: 8px;
    overflow: hidden;
}

.pi-criteres-table th {
    background: linear-gradient(135deg, #f0f2f5, #e6e9ef);
    color: #444;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 7px 10px;
    border: 1px solid #dde2ec;
    text-align: left;
}

.pi-criteres-table td {
    padding: 7px 10px;
    border: 1px solid #e8eaed;
    color: #333;
    font-size: .77rem;
    background: #fff;
    vertical-align: top;
    line-height: 1.5;
    text-align: left;
}

.pi-criteres-table tbody tr:nth-child(even) td { background: #fafafa; }
.pi-criteres-table tbody tr:hover td { background: #f2f6ff; }

/* Badges dans le tableau */
.pi-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.pi-badge-interne {
    background: #d6eaf8;
    color: #1a6fa8;
    border: 1px solid #aed6f1;
}

.pi-badge-externe {
    background: #d5f5e3;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

/* Badge criticité */
.pi-crit-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

.pi-crit-haute   { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }
.pi-crit-moyenne { background: #fdebd0; color: #b7950b; border: 1px solid #f8c471; }
.pi-crit-faible  { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }

/* ── Bandeau date de révision du document ── */
.doc-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 16px;
    background: linear-gradient(135deg, #f8f9fc, #f0f3fa);
    border: 1px solid #e4e8f0;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: .78rem;
    color: #5a6475;
}
.doc-meta-label {
    font-weight: 600;
    white-space: nowrap;
    color: #3a4558;
}
.doc-meta-input {
    padding: 5px 11px;
    border: 1.5px solid #dde2ec;
    border-radius: 7px;
    font-size: .78rem;
    color: #1a2332;
    background: #fff;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    height: 32px;
}
.doc-meta-input:focus {
    outline: none;
    border-color: var(--accent, #3d5af1);
    box-shadow: 0 0 0 3px rgba(61,90,241,.12);
}
.doc-meta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--accent, #3d5af1);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-display);
    letter-spacing: .3px;
    transition: background .18s, transform .15s, box-shadow .18s;
    white-space: nowrap;
    height: 32px;
}
.doc-meta-btn:hover {
    background: #2d4ad1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61,90,241,.28);
}
.doc-meta-btn:active { transform: translateY(0); box-shadow: none; }
.doc-meta-hint {
    font-size: .72rem;
    color: #8a95a5;
    font-style: italic;
    margin-left: 4px;
}

/* Matrice Chart.js */
.pi-matrix-wrap {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 16px 16px 14px 16px;
    margin-top: 8px;
    min-height: 520px;
    position: relative;
    box-sizing: border-box;
}

.pi-matrix-wrap canvas {
    max-width: 100% !important;
    height: 100% !important;
}

/* Légende de la matrice — hors du SVG pour ne jamais chevaucher/déborder */
.pi-matrix-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef0f3;
    justify-content: center;
}

.pi-matrix-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    color: #1a2332;
    max-width: 260px;
}

.pi-matrix-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}

.pi-matrix-legend-name {
    overflow-wrap: anywhere;
}

/* Responsive */
@media screen and (max-width: 900px) {
    .pi-layout { flex-direction: column; }
    .pi-form   { grid-template-columns: 1fr; }
    .pi-matrix-wrap { min-height: 420px; }
}

/* ===== PRIORITÉ AUTO (calculée depuis criticité) ===== */
.pi-priorite-auto {
    font-weight: 700 !important;
    cursor: default !important;
    text-align: center;
    border-radius: 8px !important;
}

.pi-prio-haute {
    background: #fadbd8 !important;
    color: #c0392b !important;
    border-color: #f5b7b1 !important;
}

.pi-prio-moyenne {
    background: #fdebd0 !important;
    color: #b7950b !important;
    border-color: #f8c471 !important;
}

.pi-prio-faible {
    background: #eafaf1 !important;
    color: #1e8449 !important;
    border-color: #a9dfbf !important;
}

/* ===================================================
   PAGE ANALYSE SWOT
=================================================== */

/* Matrice 2×2 */
.swot-matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.swot-quadrant {
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,.07);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Couleurs par quadrant */
.swot-force       { background: linear-gradient(135deg, #d5f5e3 0%, #eafaf1 100%); border: 2px solid #a9dfbf; }
.swot-faiblesse   { background: linear-gradient(135deg, #fef9e7 0%, #fdfefe 100%); border: 2px solid #f8c471; }
.swot-opportunite { background: linear-gradient(135deg, #d6eaf8 0%, #eaf4fb 100%); border: 2px solid #aed6f1; }
.swot-menace      { background: linear-gradient(135deg, #fadbd8 0%, #fef5f4 100%); border: 2px solid #f5b7b1; }

.swot-quadrant-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.swot-icon { font-size: 1.2rem; }

.swot-quadrant-title {
    font-family: var(--font-display);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #1a2332;
    flex: 1;
}

.swot-counter {
    background: #1a2332;
    color: #fff;
    font-family: var(--font-display);
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

.swot-quadrant-sub {
    font-size: .68rem;
    color: #888;
    font-style: italic;
    margin-bottom: 4px;
}

/* Items dans les quadrants */
.swot-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.swot-empty {
    font-size: .75rem;
    color: #bbb;
    font-style: italic;
    text-align: center;
    margin: auto 0;
    padding: 8px 0;
}

.swot-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.7);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: .78rem;
    color: #2c3e50;
    border: 1px solid rgba(0,0,0,.06);
}

.swot-item-desc { flex: 1; line-height: 1.4; }

.swot-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #c0392b;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: background .15s;
    flex-shrink: 0;
}
.swot-del-btn:hover { background: #fadbd8; }

/* Badges influence */
.swot-inf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: .68rem;
    font-weight: 700;
    flex-shrink: 0;
}

.swot-inf-1 { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.swot-inf-2 { background: #fdebd0; color: #b7950b; border: 1px solid #f8c471; }
.swot-inf-3 { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }

/* Layout bas : formulaire + légende */
.swot-bottom {
    display: flex;
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.swot-form-wrap {
    flex: 2;
    min-width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 20px;
}

.swot-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.swot-legende {
    flex: 1;
    min-width: 260px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 20px;
}

.swot-legende-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.swot-legende-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: .82rem;
    color: #444;
    line-height: 1.5;
}

/* Section tableaux détaillés */
.swot-tables {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 20px;
    margin-bottom: 20px;
}

/* Tabs */
.swot-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.swot-tab {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid #dde2ec;
    background: #f8f9fb;
    color: #555;
    font-size: .75rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all .2s;
}

.swot-tab:hover { background: #eef2ff; border-color: var(--accent); color: var(--accent); }

.swot-tab.active {
    background: linear-gradient(135deg, #1a2332, #2c3e50);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,35,50,.25);
}

.swot-table-container { overflow-x: auto; }

/* Responsive */
@media screen and (max-width: 768px) {
    .swot-matrix { grid-template-columns: 1fr; }
    .swot-bottom { flex-direction: column; }
    .swot-form   { grid-template-columns: 1fr; }
    .swot-tabs   { gap: 6px; }
    .swot-tab    { font-size: .68rem; padding: 6px 12px; }
}

/* ===================================================
   GED — GESTION ÉLECTRONIQUE DES DOCUMENTS
=================================================== */

.ged-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

/* KPI Cards */
.ged-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ged-kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    border-left: 4px solid var(--accent);
    transition: transform .2s, box-shadow .2s;
}
.ged-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.1); }
.ged-kpi-card.ged-kpi-green  { border-left-color: #27ae60; }
.ged-kpi-card.ged-kpi-orange { border-left-color: #e67e22; }
.ged-kpi-card.ged-kpi-blue   { border-left-color: #2980b9; }

.ged-kpi-icon { font-size: 1.8rem; flex-shrink: 0; }
.ged-kpi-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #1a2332; line-height: 1; }
.ged-kpi-label { font-size: .72rem; color: #888; margin-top: 3px; font-weight: 500; }

/* Filtre panel */
.ged-filter-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 18px 20px;
}

.ged-filter-title {
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a2332;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ged-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.ged-filter-field label {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ged-filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-bottom: 1px;
}

/* Inputs & selects GED */
.ged-input, .ged-select, .ged-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dde2ec;
    border-radius: 8px;
    font-size: .78rem;
    font-family: var(--font-primary);
    color: #2c3e50;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.ged-input:focus, .ged-select:focus, .ged-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,144,217,.12);
}
.ged-textarea { resize: vertical; min-height: 80px; }

/* Boutons GED */
.ged-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s;
    white-space: nowrap;
}
.ged-btn-primary {
    background: linear-gradient(135deg, #1a2332, #2c3e50);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,35,50,.25);
}
.ged-btn-primary:hover {
    background: linear-gradient(135deg, #243447, #34495e);
    box-shadow: 0 4px 12px rgba(26,35,50,.3);
    transform: translateY(-1px);
}
.ged-btn-secondary {
    background: #f0f2f5;
    color: #2c3e50;
    border-color: #dde2ec;
}
.ged-btn-secondary:hover { background: #e4e8ef; border-color: #bdc3c7; }

/* Tableau GED */
.ged-table-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    overflow: hidden;
}

.ged-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eaecf0;
}

.ged-table-title {
    font-family: var(--font-display);
    font-size: .78rem;
    font-weight: 700;
    color: #1a2332;
    text-transform: uppercase;
    letter-spacing: .8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ged-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .76rem;
}

.ged-table thead tr {
    background: linear-gradient(135deg, #f0f2f5, #e6e9ef);
}

.ged-table th {
    padding: 10px 12px;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #555;
    border-bottom: 1px solid #dde2ec;
    text-align: center;
    white-space: nowrap;
}

.ged-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f5;
    text-align: center;
    color: #2c3e50;
    vertical-align: middle;
    background: #fff;
}

.ged-table tbody tr:hover td { background: #f8f9fb; }
.ged-table tbody tr:last-child td { border-bottom: none; }

/* Badges ref */
.ged-ref-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e8f4fd, #d6eaf8);
    color: #1a6fa8;
    border: 1px solid #aed6f1;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: .68rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: .5px;
}

/* Badges type */
.ged-type-badge {
    display: inline-block;
    background: #f0f2f5;
    color: #555;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .65rem;
    font-weight: 600;
    white-space: nowrap;
}
.ged-type-manuel    { background: #fef3cd; color: #856404; }
.ged-type-processus { background: #d1ecf1; color: #0c5460; }
.ged-type-instruction { background: #e2d9f3; color: #6f42c1; }
.ged-type-mode      { background: #d4edda; color: #155724; }

/* Badges statut */
.ged-statut {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .65rem;
    font-weight: 700;
    white-space: nowrap;
}
.ged-statut-valide    { background: #d5f5e3; color: #1e6b3a; border: 1px solid #a9dfbf; }
.ged-statut-encours   { background: #fdebd0; color: #9c5700; border: 1px solid #f5cba7; }
.ged-statut-brouillon { background: #eaf0fb; color: #2c5282; border: 1px solid #bee3f8; }
.ged-statut-refuse    { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }
.ged-statut-archive   { background: #f0f2f5; color: #5d6d7e; border: 1px solid #bdc3c7; }

/* Badges diffusion */
.ged-diffusion-badge {
    display: inline-block;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: .65rem;
    font-weight: 700;
}
.ged-diff-oui { background: #d5f5e3; color: #1e6b3a; border: 1px solid #a9dfbf; }
.ged-diff-non { background: #f0f2f5; color: #888; border: 1px solid #dde2ec; }

/* Boutons d'action dans le tableau */
.ged-actions-cell { display: flex; gap: 3px; justify-content: center; align-items: center; flex-wrap: nowrap; padding-left: 6px; padding-right: 6px; }

.ged-action-btn {
    width: 23px;
    height: 23px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s;
    flex-shrink: 0;
    padding: 0;
}
.ged-action-btn svg { width: 11px; height: 11px; }
.ged-action-view   { background: #e8f4fd; color: #1a6fa8; border-color: #aed6f1; }
.ged-action-view:hover { background: #aed6f1; }
.ged-action-edit   { background: #fef9e7; color: #9a7d0a; border-color: #f9e79f; }
.ged-action-edit:hover { background: #f9e79f; }
.ged-action-delete { background: #fadbd8; color: #c0392b; border-color: #f5b7b1; }
.ged-action-delete:hover { background: #f5b7b1; }
.ged-action-action  { background: #d5f5e3; color: #1e6b3a; border-color: #a9dfbf; }
.ged-action-action:hover  { background: #a9dfbf; }
.ged-action-archive { background: #f0f2f5; color: #5d6d7e; border-color: #bdc3c7; }
.ged-action-archive:hover { background: #bdc3c7; }
.ged-action-archive-actif { background: #d5d8dc; color: #2c3e50; border-color: #7f8c8d; }
.ged-action-archive-actif:hover { background: #99a3a4; color: #fff; }

/* ---- Formulaire ajout ---- */
.ged-form-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    overflow: hidden;
}

.ged-form-card-header {
    background: linear-gradient(135deg, #1a2332, #2c3e50);
    color: #fff;
    padding: 16px 24px;
    font-family: var(--font-display);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ged-section-block {
    padding: 22px 24px;
    border-bottom: 1px solid #f0f2f5;
}

.ged-section-block-title {
    font-family: var(--font-display);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a2332;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

.ged-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.ged-form-field { display: flex; flex-direction: column; gap: 5px; }
.ged-field-full { grid-column: 1 / -1; }

.ged-label {
    font-size: .68rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.ged-req { color: #e74c3c; }

/* File upload */
.ged-file-wrap { width: 100%; }
.ged-file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1.5px dashed #aed6f1;
    border-radius: 8px;
    background: #f8fbff;
    color: #1a6fa8;
    font-size: .76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.ged-file-label:hover { background: #e8f4fd; border-color: var(--accent); }

/* Radio group */
.ged-radio-group { display: flex; gap: 20px; align-items: center; padding: 6px 0; }
.ged-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
}
.ged-radio-label input[type="radio"] { display: none; }
.ged-radio-custom {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #dde2ec;
    display: inline-block;
    position: relative;
    transition: border-color .18s;
    flex-shrink: 0;
}
.ged-radio-label input[type="radio"]:checked + .ged-radio-custom {
    border-color: var(--accent);
    background: radial-gradient(circle, var(--accent) 45%, transparent 46%);
}

/* Circuit de validation */
.ged-validation-grid {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ged-validation-card {
    flex: 1;
    min-width: 200px;
    border-radius: 10px;
    padding: 16px;
    border: 1.5px solid #eaecf0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.ged-valid-redacteur  { border-color: #aed6f1; background: #f8fbff; }
.ged-valid-verificateur { border-color: #f9e79f; background: #fffdf0; }
.ged-valid-approbateur  { border-color: #a9dfbf; background: #f0faf4; }

.ged-valid-step {
    position: absolute;
    top: -10px;
    left: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a2332, #2c3e50);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
}

.ged-valid-role {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #888;
    margin-top: 6px;
}

.ged-valid-arrow {
    font-size: 1.2rem;
    color: #bdc3c7;
    font-weight: 700;
    flex-shrink: 0;
}

.ged-valid-statut {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: .65rem;
    font-weight: 700;
}
.ged-valid-ok     { background: #d5f5e3; color: #1e6b3a; border: 1px solid #a9dfbf; }
.ged-valid-refuse { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }
.ged-valid-statut-wrap { display: flex; }

/* Checkbox custom */
.ged-checkbox-cell { text-align: center; }
.ged-td-procs { max-width: 220px; }
.ged-td-procs > div { max-width: 220px; }
.ged-checkbox-wrap { display: inline-flex; align-items: center; cursor: pointer; }
.ged-checkbox-wrap input[type="checkbox"] { display: none; }
.ged-checkmark {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid #dde2ec;
    display: inline-block;
    position: relative;
    transition: all .18s;
}
.ged-checkbox-wrap input[type="checkbox"]:checked + .ged-checkmark {
    background: var(--accent);
    border-color: var(--accent);
}
.ged-checkbox-wrap input[type="checkbox"]:checked + .ged-checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Footer formulaire */
.ged-form-footer {
    padding: 18px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fb;
    border-top: 1px solid #eaecf0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .ged-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .ged-filter-grid { grid-template-columns: 1fr; }
    .ged-validation-grid { flex-direction: column; }
    .ged-valid-arrow { transform: rotate(90deg); }
    .ged-form-grid { grid-template-columns: 1fr; }
}

/* ===================================================
   PAGE : PLAN D'ACTIONS
=================================================== */
.plan-actions-wrap { max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* En-tête */
.plan-actions-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan-actions-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: #1a2332; }
.plan-actions-subtitle { font-size: .75rem; color: #8a95a3; margin-top: 3px; }
.plan-actions-btn-new { display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px; background: linear-gradient(135deg, #1a2332, #2c3e50); color: #fff; border: none; border-radius: 10px; font-family: var(--font-primary); font-size: .8rem; font-weight: 700; cursor: pointer; transition: all .2s; box-shadow: 0 3px 12px rgba(26,35,50,.25); }
.plan-actions-btn-new:hover { background: linear-gradient(135deg, #243447, #34495e); transform: translateY(-1px); box-shadow: 0 5px 16px rgba(26,35,50,.32); }

/* KPI cards */
.plan-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan-kpi-card { background: #fff; border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; border: 1px solid #eaecf0; box-shadow: 0 2px 8px rgba(0,0,0,.04); position: relative; overflow: hidden; }
.plan-kpi-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.plan-kpi-total::before    { background: linear-gradient(90deg,#4a90d9,#6c9fd8); }
.plan-kpi-acceptable::before  { background: linear-gradient(90deg,#27ae60,#2ecc71); }
.plan-kpi-surveiller::before  { background: linear-gradient(90deg,#f39c12,#f1c40f); }
.plan-kpi-inacceptable::before { background: linear-gradient(90deg,#e74c3c,#c0392b); }
.plan-kpi-val { font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1; color: #1a2332; }
.plan-kpi-lbl { font-size: .7rem; color: #8a95a3; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* Filtres */
.plan-filtres-bloc { background: #fff; border-radius: 12px; border: 1px solid #eaecf0; padding: 18px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.plan-filtres-title { font-size: .75rem; font-weight: 700; color: #1a2332; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 14px; }
.plan-filtres-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 12px; align-items: end; }
.plan-filtre-field { display: flex; flex-direction: column; gap: 5px; }
.plan-filtre-label { font-size: .67rem; font-weight: 700; color: #5a6475; text-transform: uppercase; letter-spacing: .5px; }
.plan-filtre-input, .plan-filtre-select { border: 1px solid #dde2ec; border-radius: 8px; padding: 7px 10px; font-size: .78rem; color: #2c3e50; background: #fff; font-family: var(--font-primary); transition: border-color .2s; outline: none; width: 100%; }
.plan-filtre-input:focus, .plan-filtre-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,217,.12); }
.plan-filtre-reset-wrap { display: flex; align-items: flex-end; }
.plan-filtre-reset { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; background: #f5f6fa; border: 1px solid #dde2ec; border-radius: 8px; font-size: .75rem; font-weight: 600; color: #5a6475; cursor: pointer; transition: all .2s; font-family: var(--font-primary); white-space: nowrap; }
.plan-filtre-reset:hover { background: #ffe8e8; border-color: #f5b7b1; color: #c0392b; }

/* Info résultat */
.plan-result-info { font-size: .75rem; color: #8a95a3; font-weight: 500; }

/* Toolbar : info résultat + bouton Colonnes */
.plan-table-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; position:relative; }
.plan-cols-wrap { position:relative; }
.plan-cols-btn { display:inline-flex; align-items:center; gap:7px; padding:7px 12px; background:#fff; border:1px solid #dde2ec; border-radius:8px; font-size:.72rem; font-weight:600; color:#3c4858; cursor:pointer; transition:all .18s ease; font-family:var(--font-primary); }
.plan-cols-btn:hover { background:#f5f7fa; border-color:#c7d0dc; color:#1a2332; }
.plan-cols-btn[aria-expanded="true"] { background:#eef2f8; border-color:#b8c3d4; color:#1a2332; }
.plan-cols-btn svg { flex:0 0 auto; }
.plan-cols-badge { display:inline-flex; align-items:center; justify-content:center; min-width:38px; height:18px; padding:0 6px; background:#243447; color:#fff; font-size:.62rem; font-weight:700; letter-spacing:.3px; border-radius:9px; }
.plan-cols-panel { position:absolute; top:calc(100% + 6px); right:0; width:360px; max-height:0; overflow:hidden; opacity:0; pointer-events:none; background:#fff; border:1px solid #dde2ec; border-radius:10px; box-shadow:0 8px 24px rgba(20,30,50,.12); z-index:50; transition:max-height .22s ease, opacity .18s ease; }
.plan-cols-panel.open { max-height:520px; opacity:1; pointer-events:auto; }

/* Le bouton "Colonnes" de la Revue de processus est niché au milieu d'une
   longue page : un panneau ancré en dropdown peut s'ouvrir hors écran.
   On le centre en position fixe pour qu'il reste toujours entièrement visible. */
#revue-cols-panel { position:fixed; top:50%; left:66%; right:auto; width:380px; max-width:calc(100vw - 32px); transform:translate(-50%,-50%); }
#revue-cols-panel.open { max-height:min(520px, 80vh); }
#revue-cols-panel .plan-cols-panel-body { max-height:min(380px, 55vh); }
.plan-cols-panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px 10px; border-bottom:1px solid #eef1f5; }
.plan-cols-panel-title { font-family:var(--font-display); font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:#1a2332; }
.plan-cols-quick { display:inline-flex; gap:4px; }
.plan-cols-quick-btn { padding:3px 8px; background:#f5f6fa; border:1px solid #e4e8ef; border-radius:6px; font-size:.65rem; font-weight:600; color:#5a6475; cursor:pointer; transition:all .15s ease; font-family:var(--font-primary); }
.plan-cols-quick-btn:hover { background:#e8edf5; border-color:#c7d0dc; color:#1a2332; }
.plan-cols-panel-body { padding:8px 6px 8px 14px; max-height:380px; overflow-y:auto; }
.plan-cols-group { margin-bottom:10px; }
.plan-cols-group-head { display:flex; align-items:center; gap:8px; padding:6px 8px; background:linear-gradient(135deg,#f0f2f5,#e8ebf0); border-radius:6px; cursor:pointer; user-select:none; }
.plan-cols-group-head input[type="checkbox"] { accent-color:#243447; width:13px; height:13px; cursor:pointer; margin:0; }
.plan-cols-group-title { font-family:var(--font-display); font-size:.62rem; font-weight:700; text-transform:uppercase; letter-spacing:.7px; color:#1a2332; flex:1; }
.plan-cols-group-count { font-size:.6rem; color:#8a95a3; font-weight:600; }
.plan-cols-items { display:flex; flex-direction:column; padding:4px 0 0 8px; }
.plan-cols-item { display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:5px; cursor:pointer; transition:background .12s ease; font-size:.73rem; color:#3c4858; }
.plan-cols-item:hover { background:#f5f7fa; }
.plan-cols-item input[type="checkbox"] { accent-color:#243447; width:13px; height:13px; cursor:pointer; margin:0; }
.plan-cols-item.locked { color:#8a95a3; cursor:not-allowed; }
.plan-cols-item.locked:hover { background:transparent; }
.plan-cols-item.locked input[type="checkbox"] { cursor:not-allowed; }
.plan-cols-lock { font-size:.7rem; opacity:.7; margin-left:auto; }
.plan-cols-panel-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 14px; border-top:1px solid #eef1f5; background:#fafbfc; border-radius:0 0 10px 10px; }
.plan-cols-hint { font-size:.65rem; color:#8a95a3; }
.plan-cols-close-btn { padding:5px 12px; background:#243447; color:#fff; border:none; border-radius:6px; font-size:.68rem; font-weight:600; cursor:pointer; font-family:var(--font-primary); transition:background .15s ease; }
.plan-cols-close-btn:hover { background:#1a2332; }

/* Masquage dynamique des colonnes — la classe col-hide-XXX est ajoutée sur #plan-table */
/* Règle générée par JS : .plan-table.col-hide-KEY th[data-col="KEY"], .plan-table.col-hide-KEY td[data-col="KEY"] { display:none; } */
/* Masquage d'un groupe d'en-tête (quand toutes ses colonnes sont cachées) */
.plan-table thead tr:first-child th[data-group-hidden="true"] { display:none; }

/* Tableau — scroll vertical sur outer, horizontal sur wrap */
.plan-table-outer { overflow-y: auto; max-height: calc(100vh - 380px); min-height: 200px; border-radius: 12px; border: 1px solid #eaecf0; box-shadow: 0 2px 8px rgba(0,0,0,.04); background: #fff; }
.plan-table-wrap  { overflow-x: auto; }
.plan-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .74rem; }
.plan-table thead tr:first-child th { background: linear-gradient(135deg, #f0f2f5, #e8ebf0); font-family: var(--font-display); font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: #5a6475; padding: 10px 8px; text-align: center; box-shadow: inset 0 -1px 0 #dde2ec; position: sticky; top: 0; z-index: 3; transition: box-shadow .2s ease; }
.plan-th-group-eval  { background: linear-gradient(135deg,#fef9e7,#fef3cd) !important; color:#7d6608 !important; }
.plan-th-group-red   { background: linear-gradient(135deg,#eaf4fb,#d6eaf8) !important; color:#1a5276 !important; }
.plan-th-group-eff   { background: linear-gradient(135deg,#eafaf1,#d5f5e3) !important; color:#1e8449 !important; }
.plan-th-group-rev   { background: linear-gradient(135deg,#f5eef8,#e8daef) !important; color:#6c3483 !important; }
.plan-thead-sub th { background: #fafbfc; font-size: .65rem; font-weight: 700; color: #7a8594; padding: 7px 8px; box-shadow: inset 0 -2px 0 #dde2ec; text-align: center; white-space: nowrap; position: sticky; top: var(--plan-sub-top, 36px); z-index: 2; transition: box-shadow .2s ease; }
/* Ombre "flottante" quand le contenu défile sous l'en-tête */
.plan-table-outer.plan-scrolled .plan-thead-sub th {
    box-shadow: inset 0 -2px 0 #dde2ec, 0 6px 16px -4px rgba(26,35,50,.14);
}
.plan-table-outer.plan-scrolled .plan-table thead tr:first-child th {
    box-shadow: inset 0 -1px 0 #dde2ec, 0 3px 10px -3px rgba(26,35,50,.10);
}
/* Colonnes texte larges : autoriser le retour à la ligne dans l'en-tête et le contenu */
.plan-thead-sub th:nth-child(1),
.plan-thead-sub th:nth-child(8) { white-space: normal; min-width: 160px; }

/* Colonnes texte larges : Risque identifié + Impact */
#plan-table th[data-col="risque"],
#plan-table td[data-col="risque"] {
    min-width: 320px;
    width: 360px;
    max-width: 420px;
}
#plan-table th[data-col="impact"],
#plan-table td[data-col="impact"] {
    min-width: 220px;
    width: 260px;
    max-width: 320px;
}

/* Colonnes numériques compactes : Proba. Gravité Maîtrise */
#plan-table th[data-col="eval-proba"],  #plan-table td[data-col="eval-proba"],
#plan-table th[data-col="eval-gravite"],#plan-table td[data-col="eval-gravite"],
#plan-table th[data-col="eval-maitrise"],#plan-table td[data-col="eval-maitrise"],
#plan-table th[data-col="eff-proba"],   #plan-table td[data-col="eff-proba"],
#plan-table th[data-col="eff-gravite"], #plan-table td[data-col="eff-gravite"],
#plan-table th[data-col="eff-maitrise"],#plan-table td[data-col="eff-maitrise"] {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding-left: 4px;
    padding-right: 4px;
}
/* Colonnes Criticité : badge compact */
#plan-table th[data-col="eval-criticite"],#plan-table td[data-col="eval-criticite"],
#plan-table th[data-col="eff-criticite"], #plan-table td[data-col="eff-criticite"] {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    padding-left: 4px;
    padding-right: 4px;
}

.plan-tr { border-bottom: 1px solid #f0f2f5; transition: background .15s; }
.plan-tr:hover { background: #f8faff; }
.plan-td { padding: 9px 8px; color: #2c3e50; vertical-align: middle; border-right: 1px solid #f0f2f5; word-break: break-word; overflow-wrap: anywhere; }
.plan-td-risque { font-weight: 600; color: #1a2332; min-width: 320px; max-width: 420px; }
.plan-td-center { text-align: center; font-weight: 600; white-space: nowrap; }

/* Criticité pills */
.plan-criticite { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 3px 8px; border-radius: 20px; font-weight: 700; font-size: .72rem; border: 2px solid transparent; }
.plan-crit-acceptable  { background: #d5f5e3; border-color: #27ae60; color: #1e8449; }
.plan-crit-surveiller  { background: #fef9e7; border-color: #f39c12; color: #b7950b; }
.plan-crit-inacceptable { background: #fadbd8; border-color: #e74c3c; color: #c0392b; }
/* Bouton de tri intégré dans l'en-tête des colonnes Criticité du plan-table */
#plan-table .plan-th-crit-wrap { display:inline-flex; align-items:center; justify-content:center; gap:6px; line-height:1.15; }
#plan-table .plan-sort-btn { display:inline-flex; align-items:center; justify-content:center; width:20px; height:20px; padding:0; border:1px solid #cdd3dc; background:#fff; color:#5a6475; border-radius:5px; cursor:pointer; transition:background .15s, border-color .15s, color .15s, transform .15s; flex-shrink:0; }
#plan-table .plan-sort-btn:hover { background:#eef1f5; border-color:#9aa5b5; color:#1a2332; transform:translateY(-1px); }
#plan-table .plan-sort-btn[data-sort-state="desc"],
#plan-table .plan-sort-btn[data-sort-state="asc"] { background:#1a2332; border-color:#1a2332; color:#fff; }
#plan-table .plan-sort-btn svg { display:block; pointer-events:none; }

/* Badges statut */
.plan-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: .67rem; font-weight: 700; white-space: nowrap; }
.plan-badge-en-cours   { background: #eaf4fb; color: #1a6fa8; }
.plan-badge-soldee     { background: #eafaf1; color: #1e8449; }
.plan-badge-en-retard  { background: #fdedec; color: #c0392b; }

/* Empty state */
.plan-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; text-align: center; }
.plan-empty-icon { font-size: 2.5rem; }
.plan-empty-text { font-size: .82rem; color: #8a95a3; font-weight: 500; }

/* ===================================================
   TOOLTIP SURVOL CELLULES — Plan d'actions
=================================================== */
#plan-cell-tooltip {
    position: fixed;
    z-index: 9999;
    display: none;
    max-width: 340px;
    min-width: 120px;
    background: #fff;
    border-radius: 11px;
    border-left: 3px solid var(--accent, #3d5af1);
    box-shadow: 0 8px 32px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.07);
    padding: 10px 14px 11px;
    pointer-events: none;
    animation: planTipIn .16s cubic-bezier(.22,.61,.36,1);
}

@keyframes planTipIn {
    from { opacity: 0; transform: translateY(5px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1);   }
}

.plan-tip-col {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: #a0aab5;
    margin-bottom: 6px;
    line-height: 1;
}

.plan-tip-sep {
    height: 1px;
    background: #f0f2f5;
    margin: 0 0 7px;
}

.plan-tip-body {
    font-size: .79rem;
    color: #1a2332;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-height: 220px;
    overflow-y: auto;
}

/* Responsive */
@media screen and (max-width: 900px) {
    .plan-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .plan-filtres-grid { grid-template-columns: 1fr 1fr; }
}
@media screen and (max-width: 600px) {
    .plan-kpi-row { grid-template-columns: 1fr 1fr; }
    .plan-filtres-grid { grid-template-columns: 1fr; }
}

/* ===================================================
   PAGE : TABLEAU DE BORD INDICATEURS
=================================================== */
.tdb-wrap { max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

/* En-tête */
.tdb-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tdb-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: #1a2332; }
.tdb-subtitle { font-size: .75rem; color: #8a95a3; margin-top: 3px; }
.tdb-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tdb-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 9px; font-family: var(--font-primary); font-size: .78rem; font-weight: 700; cursor: pointer; transition: all .2s; border: none; }
.tdb-btn-primary { background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; box-shadow: 0 3px 12px rgba(26,35,50,.25); }
.tdb-btn-primary:hover { background: linear-gradient(135deg,#243447,#34495e); transform: translateY(-1px); }
.tdb-btn-secondary { background: #f0f2f5; color: #5a6475; border: 1px solid #dde2ec; }
.tdb-btn-secondary:hover { background: #e6e9ef; }

/* KPI cards */
.tdb-kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.tdb-kpi-card { background: #fff; border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; border: 1px solid #eaecf0; box-shadow: 0 2px 10px rgba(0,0,0,.05); position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.tdb-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.09); }
.tdb-kpi-card::before { content:''; position:absolute; top:0; left:0; bottom:0; width:4px; border-radius:4px 0 0 4px; }
.tdb-kpi-blue::before   { background: linear-gradient(180deg,#4a90d9,#6c9fd8); }
.tdb-kpi-green::before  { background: linear-gradient(180deg,#27ae60,#2ecc71); }
.tdb-kpi-orange::before { background: linear-gradient(180deg,#f39c12,#f1c40f); }
.tdb-kpi-red::before    { background: linear-gradient(180deg,#e74c3c,#c0392b); }
.tdb-kpi-icon { font-size: 1.8rem; flex-shrink: 0; }
.tdb-kpi-val { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #1a2332; line-height: 1; }
.tdb-kpi-lbl { font-size: .68rem; color: #8a95a3; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

/* Filtres */
.tdb-filtres-bloc { background: #fff; border-radius: 12px; border: 1px solid #eaecf0; padding: 16px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.tdb-filtres-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr; gap: 14px; margin-bottom: 10px; }
.tdb-filtre-field { display: flex; flex-direction: column; gap: 5px; }
.tdb-filtre-label { font-size: .66rem; font-weight: 700; color: #5a6475; text-transform: uppercase; letter-spacing: .5px; }
.tdb-filtre-select, .tdb-filtre-input { border: 1px solid #dde2ec; border-radius: 8px; padding: 7px 10px; font-size: .78rem; color: #2c3e50; font-family: var(--font-primary); outline: none; transition: border-color .2s; }
.tdb-filtre-select:focus, .tdb-filtre-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,217,.12); }

/* Sélecteur multi-processus dans la barre de filtres : même gabarit que les selects */
#tdb-fp { display: block; width: 100%; }
.tbd-filtre-proc-btn.tdb-fp-btn {
    width: 100%;
    max-width: none;
    justify-content: space-between;
    padding: 7px 10px;
    font-size: .78rem;
    font-weight: 400;
    border-radius: 8px;
    box-shadow: none;
}
.tbd-filtre-proc-btn.tdb-fp-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,217,.12); }
#tdb-fp .tbd-filtre-proc-panel { min-width: 100%; }
.tdb-result-info { font-size: .72rem; color: #8a95a3; font-weight: 500; }

/* Alerte dérive */
.tdb-alerte { display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: linear-gradient(90deg,#fdedec,#fef5f5); border: 1px solid #f5c6c6; border-radius: 10px; font-size: .78rem; font-weight: 600; color: #c0392b; }

/* Bloc tableau */
.tdb-table-bloc { background: #fff; border-radius: 14px; border: 1px solid #eaecf0; box-shadow: 0 2px 10px rgba(0,0,0,.05); overflow: hidden; }
.tdb-table-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #eaecf0; flex-wrap: wrap; gap: 10px; }
.tdb-table-title { font-family: var(--font-display); font-size: .88rem; font-weight: 700; color: #1a2332; }
/* Sélecteur d'année dans le titre du tableau de bord (fond clair) */
.tdb-annee-select {
    background:#1a2332;
    color:#fff;
    border:1px solid #1a2332;
    border-radius:6px;
    padding:3px 8px;
    margin-left:6px;
    font-family:var(--font-display);
    font-size:.78rem;
    font-weight:700;
    letter-spacing:1px;
    cursor:pointer;
    transition:background .2s,border-color .2s,box-shadow .2s;
    -webkit-appearance:none;
    -moz-appearance:none;
    appearance:none;
    background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 6px center;
    padding-right:22px;
}
.tdb-annee-select:hover { background-color:#243447; border-color:#243447; }
.tdb-annee-select:focus { outline:none; box-shadow:0 0 0 3px rgba(26,35,50,.18); }
.tdb-annee-select option { background:#fff; color:#1a2332; }
.tdb-legend { display: flex; gap: 14px; align-items: center; }
.tdb-legend-item { display: flex; align-items: center; gap: 5px; font-size: .7rem; color: #5a6475; font-weight: 600; }
.tdb-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tdb-dot-green  { background: #27ae60; }
.tdb-dot-orange { background: #f39c12; }
.tdb-dot-red    { background: #e74c3c; }
.tdb-table-scroll { overflow-x: auto; }

/* Table principale */
.tdb-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.tdb-thead-groups th { padding: 9px 6px; font-family: var(--font-display); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid #dde2ec; text-align: center; }
.tdb-th-id      { background: linear-gradient(135deg,#1a2332,#243447); color: #fff; }
.tdb-th-meta    { background: #e8ebf0; color: #5a6475; }
.tdb-th-t1      { background: linear-gradient(135deg,#eaf4fb,#d6eaf8); color: #1a5276; }
.tdb-th-t2      { background: linear-gradient(135deg,#eafaf1,#d5f5e3); color: #1e8449; }
.tdb-th-t3      { background: linear-gradient(135deg,#fef9e7,#fef3cd); color: #7d6608; }
.tdb-th-t4      { background: linear-gradient(135deg,#f5eef8,#e8daef); color: #6c3483; }
.tdb-th-bilan   { background: linear-gradient(135deg,#1a2332,#243447); color: #fff; }
.tdb-th-actions { background: linear-gradient(135deg,#1a2332,#243447); color: #fff; width: 54px; }
.tdb-thead-sub th { background: #fafbfc; font-size: .64rem; font-weight: 700; color: #7a8594; padding: 7px 6px; border-bottom: 2px solid #dde2ec; text-align: center; white-space: nowrap; }
.tdb-th-robj   { background: #f0f4f8 !important; }
.tdb-th-seuil  { width: 34px !important; min-width: 34px; background: linear-gradient(135deg,#1a2332,#243447) !important; color: #fff !important; }
.tdb-th-trim   { background: #e8f0f8 !important; color: #1a3a5c !important; font-weight: 800 !important; }
.tdb-th-act    { background: linear-gradient(135deg,#1a2332,#243447) !important; color: #fff !important; width: 54px; }

/* Cellules processus / pilote / indicateur */
.tdb-td-processus { background: linear-gradient(135deg,#1e2d40,#243447) !important; color: #fff !important; padding: 10px 10px !important; vertical-align: middle; text-align: center; min-width: 130px; border-right: 2px solid #2c4a6e !important; }
.tdb-process-tag  { display: inline-block; background: rgba(74,144,217,.35); color: #a8d4f5; font-family: var(--font-display); font-size: .65rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; margin-bottom: 5px; letter-spacing: .3px; }
.tdb-process-name { font-size: .68rem; color: rgba(255,255,255,.82); font-weight: 600; line-height: 1.3; }
.tdb-td-pilote   { background: #f0f4f8 !important; font-weight: 700; font-size: .72rem; color: #1a2332; text-align: center; vertical-align: middle; border-right: 1px solid #dde2ec !important; white-space: nowrap; }
.tdb-td-indicateur { font-weight: 600; color: #1a2332; padding: 8px 10px; vertical-align: middle; max-width: 180px; font-size: .72rem; }
.tdb-td-indicateur.rouge { color: #c0392b !important; }

/* Séparateur entre groupes de processus */
.tdb-tr-separator td { border-top: 3px solid #c5cdd8 !important; }

/* Résumé par processus */
.tdb-resume-title { font-family: var(--font-display); font-size: .9rem; font-weight: 700; color: #1a2332; margin-bottom: 2px; }
.tdb-resume-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.tdb-resume-card { background: #fff; border-radius: 14px; border: 1px solid #eaecf0; box-shadow: 0 2px 8px rgba(0,0,0,.05); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; transition: transform .18s, box-shadow .18s; }
.tdb-resume-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.09); }
.tdb-resume-card-header { display: flex; flex-direction: column; gap: 3px; }
.tdb-resume-tag  { display: inline-block; background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; font-family: var(--font-display); font-size: .63rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; width: fit-content; margin-bottom: 2px; }
.tdb-resume-name { font-size: .82rem; font-weight: 700; color: #1a2332; }
.tdb-resume-pilote { font-size: .68rem; color: #8a95a3; font-weight: 600; }
.tdb-resume-indicators { display: flex; flex-direction: column; gap: 6px; }
.tdb-resume-ind { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .72rem; }
.tdb-resume-ind-name { color: #5a6475; flex: 1; }
.tdb-resume-bilan { font-size: .67rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.tdb-bilan-green  { background: #eafaf1; color: #1e8449; }
.tdb-bilan-orange { background: #fef9e7; color: #9a7d0a; }
.tdb-bilan-red    { background: #fdedec; color: #c0392b; }
.tdb-resume-progress-wrap { display: flex; flex-direction: column; gap: 4px; }
.tdb-resume-progress-label { font-size: .68rem; color: #5a6475; }
.tdb-resume-progress-label strong { color: #1a2332; }
.tdb-resume-progress-bar { height: 7px; background: #eaecf0; border-radius: 10px; overflow: hidden; }
.tdb-resume-progress-fill { height: 100%; border-radius: 10px; transition: width .5s ease; }
.tdb-prog-green  { background: linear-gradient(90deg,#27ae60,#2ecc71); }
.tdb-prog-orange { background: linear-gradient(90deg,#f39c12,#f1c40f); }
.tdb-prog-red    { background: linear-gradient(90deg,#e74c3c,#c0392b); }

/* Responsive */
@media screen and (max-width: 1100px) {
    .tdb-kpi-row { grid-template-columns: repeat(2,1fr); }
    .tdb-resume-grid { grid-template-columns: 1fr 1fr; }
    .tdb-filtres-inner { grid-template-columns: 1fr 1fr; }
}
@media screen and (max-width: 650px) {
    .tdb-kpi-row { grid-template-columns: 1fr 1fr; }
    .tdb-resume-grid { grid-template-columns: 1fr; }
    .tdb-filtres-inner { grid-template-columns: 1fr; }
}

/* ===================================================
   PAGE : POLITIQUE QUALITÉ
=================================================== */
.pq-wrap { max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* En-tête page */
.pq-page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pq-page-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: #1a2332; }
.pq-page-sub { font-size: .72rem; color: #8a95a3; margin-top: 3px; }
.pq-page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Badge statut */
.pq-statut-badge { display: flex; align-items: center; gap: 7px; padding: 6px 14px; background: #fff; border: 1px solid #eaecf0; border-radius: 20px; font-size: .74rem; font-weight: 700; color: #2c3e50; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.pq-statut-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.pq-dot-brouillon { background: #95a5a6; }
.pq-dot-revision  { background: #f39c12; }
.pq-dot-approuvee { background: #27ae60; }
.pq-dot-diffusee  { background: #4a90d9; }

/* Boutons */
.pq-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 9px; font-family: var(--font-primary); font-size: .76rem; font-weight: 700; cursor: pointer; transition: all .18s; border: none; }
.pq-btn-outline  { background: #fff; border: 1px solid #dde2ec; color: #2c3e50; }
.pq-btn-outline:hover { background: #f5f6fa; border-color: #bdc3c7; }
.pq-btn-save    { background: linear-gradient(135deg,#1e8449,#27ae60); color: #fff; box-shadow: 0 2px 8px rgba(30,132,73,.25); }
.pq-btn-save:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,132,73,.3); }
.pq-btn-approve { background: linear-gradient(135deg,#f39c12,#e67e22); color: #fff; box-shadow: 0 2px 8px rgba(243,156,18,.25); }
.pq-btn-approve:hover { transform: translateY(-1px); }
.pq-btn-diffuser { background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; box-shadow: 0 2px 8px rgba(26,35,50,.25); }
.pq-btn-diffuser:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,35,50,.32); }

/* Barre d'outils édition */
.pq-toolbar { background: #fff; border: 1px solid #eaecf0; border-radius: 10px; padding: 8px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.pq-toolbar-inner { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pq-tool-btn { width: 32px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid #eaecf0; background: #fafbfc; border-radius: 6px; cursor: pointer; font-size: .82rem; color: #2c3e50; transition: all .15s; font-family: var(--font-primary); }
.pq-tool-btn:hover { background: #eaf4fb; border-color: var(--accent); color: var(--accent); }
.pq-tool-sep { width: 1px; height: 22px; background: #eaecf0; margin: 0 6px; }
.pq-tool-select { border: 1px solid #eaecf0; background: #fafbfc; border-radius: 6px; padding: 4px 8px; font-size: .74rem; color: #2c3e50; font-family: var(--font-primary); cursor: pointer; outline: none; }
.pq-tool-hint { font-size: .68rem; color: #8a95a3; font-style: italic; margin-left: 8px; }

/* Corps de page */
.pq-body { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }

/* DOCUMENT */
.pq-document { background: #fff; border: 1px solid #dde2ec; border-radius: 4px; box-shadow: 0 4px 24px rgba(0,0,0,.10); padding: 40px 48px; font-family: 'DM Sans', sans-serif; color: #1a2332; }

/* En-tête document */
.pq-doc-header { display: grid; grid-template-columns: 140px 1fr 120px; gap: 20px; align-items: start; padding-bottom: 20px; border-bottom: 2px solid #1a2332; margin-bottom: 28px; }
.pq-doc-logo { cursor: pointer; position: relative; }
.pq-logo-hint { font-size: .6rem; color: #8a95a3; text-align: center; margin-top: 3px; }
.pq-doc-ref-table { display: flex; flex-direction: column; gap: 0; border: 1px solid #dde2ec; border-radius: 4px; overflow: hidden; }
.pq-doc-ref-row { display: grid; grid-template-columns: 100px 1fr; border-bottom: 1px solid #eaecf0; }
.pq-doc-ref-row:last-child { border-bottom: none; }
.pq-doc-ref-label { background: #f0f2f5; font-size: .65rem; font-weight: 700; color: #5a6475; padding: 5px 8px; text-transform: uppercase; letter-spacing: .3px; }
.pq-doc-ref-val { font-size: .72rem; font-weight: 600; color: #1a2332; padding: 5px 8px; }
.pq-ref-statut { color: #e67e22; font-weight: 700; }
.pq-doc-classification { text-align: center; }
.pq-classif-label { font-size: .6rem; font-weight: 700; color: #8a95a3; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.pq-classif-val { background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; display: inline-block; }
.pq-doc-pages { font-size: .65rem; color: #8a95a3; text-align: center; margin-top: 8px; }
.pq-doc-header-right { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* Titre document */
.pq-doc-titre-wrap { text-align: center; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid #eaecf0; }
.pq-doc-titre { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: #1a2332; letter-spacing: 1px; text-transform: uppercase; }
.pq-doc-sous-titre { font-size: .88rem; color: #8a95a3; font-weight: 500; margin-top: 6px; }

/* Corps éditabe */
.pq-doc-corps { min-height: 400px; line-height: 1.75; color: #2c3e50; font-size: .88rem; outline: none; }
.pq-doc-corps h2 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: #1a2332; margin: 24px 0 8px; padding-bottom: 5px; border-bottom: 2px solid #4a90d9; }
.pq-doc-corps h3 { font-size: .88rem; font-weight: 700; color: #2c3e50; margin: 16px 0 6px; }
.pq-doc-corps p { margin-bottom: 10px; text-align: justify; }
.pq-doc-corps ul { margin: 8px 0 12px 24px; }
.pq-doc-corps ul li { margin-bottom: 4px; }
.pq-editable-active { outline: 2px dashed var(--accent) !important; outline-offset: 3px; background: rgba(74,144,217,.03) !important; border-radius: 3px; }

/* Signatures */
.pq-signatures { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-top: 40px; padding-top: 24px; border-top: 2px solid #1a2332; }
.pq-sig-col { text-align: center; }
.pq-sig-role { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #8a95a3; margin-bottom: 6px; }
.pq-sig-name { font-weight: 700; font-size: .82rem; color: #1a2332; }
.pq-sig-fonction { font-size: .72rem; color: #5a6475; margin-bottom: 16px; }
.pq-sig-line { border-bottom: 1px solid #dde2ec; margin: 0 20px 6px; }
.pq-sig-date { font-size: .68rem; color: #8a95a3; }

/* Footer document */
.pq-doc-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 12px; border-top: 1px solid #eaecf0; font-size: .65rem; color: #8a95a3; }

/* PANNEAU LATÉRAL */
.pq-sidebar-panel { display: flex; flex-direction: column; gap: 14px; }
.pq-panel-bloc { background: #fff; border: 1px solid #eaecf0; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.pq-panel-titre { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #1a2332; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #eaecf0; }
.pq-panel-link { display: block; text-align: center; font-size: .73rem; font-weight: 600; color: var(--accent); background: none; border: 1px dashed #aed6f1; border-radius: 7px; padding: 7px; cursor: pointer; margin-top: 10px; width: 100%; font-family: var(--font-primary); transition: all .18s; }
.pq-panel-link:hover { background: #eaf4fb; }

/* Historique */
.pq-histo-list { display: flex; flex-direction: column; gap: 8px; }
.pq-histo-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border-radius: 8px; border: 1px solid #eaecf0; background: #fafbfc; }
.pq-histo-current { border-color: var(--accent); background: #eaf4fb; }
.pq-histo-ver { font-family: var(--font-display); font-size: .72rem; font-weight: 800; color: #1a2332; background: #fff; border: 1px solid #dde2ec; border-radius: 5px; padding: 2px 7px; flex-shrink: 0; }
.pq-histo-info { flex: 1; }
.pq-histo-date   { font-size: .67rem; color: #8a95a3; }
.pq-histo-auteur { font-size: .7rem; font-weight: 600; color: #2c3e50; }
.pq-histo-desc   { font-size: .67rem; color: #5a6475; font-style: italic; }
.pq-histo-badge  { font-size: .63rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.pq-badge-brouillon { background: #f0f2f5; color: #5a6475; }
.pq-badge-revision  { background: #fef3cd; color: #9a7d0a; }
.pq-badge-approuvee { background: #eafaf1; color: #1e8449; }
.pq-badge-diffusee  { background: #eaf4fb; color: #1a5276; }

/* Révisions cliquables (toutes versions) */
.pq-histo-old { cursor: pointer; transition: border-color .15s, background .15s; }
.pq-histo-old:hover { border-color: var(--accent); background: #f0f7ff; }
.pq-histo-old:not(.pq-histo-current) .pq-histo-ver { color: #5a6475; }

/* Modal aperçu révision */
.pq-rev-section { display: flex; flex-direction: column; gap: 10px; }
.pq-view-item { padding: 10px 12px; background: #f8f9fb; border-radius: 8px; border: 1px solid #eaecf0; }
.pq-view-engagement { font-size: .82rem; color: #2c3e50; line-height: 1.6; }
.pq-view-axe-titre { font-size: .82rem; font-weight: 700; color: #1a2332; margin: 0 0 4px; }
.pq-view-axe-desc  { font-size: .78rem; color: #5a6475; margin: 0; line-height: 1.5; }
.pq-view-obj { font-size: .8rem; color: #2c3e50; padding: 2px 0; }

/* Bouton édition titre panneau */
.pq-circuit-edit-btn { background: none; border: none; font-size: .85rem; cursor: pointer; opacity: .5; transition: opacity .15s; padding: 0 2px; line-height: 1; }
.pq-circuit-edit-btn:hover { opacity: 1; }

/* Circuit approbation */
.pq-circuit { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pq-circuit-step { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid #eaecf0; background: #fafbfc; width: 100%; }
.pq-step-done { border-color: #a9dfbf; background: #eafaf1; }
.pq-step-pending { opacity: .65; }
.pq-step-num { width: 24px; height: 24px; border-radius: 50%; background: #eaecf0; color: #5a6475; font-family: var(--font-display); font-size: .7rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pq-step-done .pq-step-num { background: #27ae60; color: #fff; }
.pq-step-role { font-size: .68rem; font-weight: 700; color: #1a2332; }
.pq-step-who  { font-size: .65rem; color: #5a6475; }
.pq-step-statut { font-size: .63rem; font-weight: 700; margin-top: 2px; }
.pq-step-ok           { color: #27ae60; }
.pq-step-wait         { color: #8a95a3; }
.pq-step-inprogress   { color: #f39c12; }
.pq-step-refused      { border-color: #f5b7b1; background: #fdf2f2; }
.pq-step-refused-txt  { color: #c0392b; }
.pq-step-date         { font-size: .6rem; color: #aab4c0; margin-top: 2px; }
.pq-circuit-arrow { font-size: .8rem; color: #dde2ec; margin: 1px 0; }

/* Diffusion */
.pq-diffusion-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.pq-diff-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; border: 1px solid transparent; cursor: pointer; transition: background .14s; }
.pq-diff-item:hover { background: #f5f6fa; border-color: #eaecf0; }
.pq-diff-check { width: 14px; height: 14px; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
.pq-diff-info { flex: 1; }
.pq-diff-name { font-size: .73rem; font-weight: 700; color: #1a2332; }
.pq-diff-role { font-size: .65rem; color: #8a95a3; }
.pq-diff-statut { font-size: .63rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.pq-diff-ok      { background: #eafaf1; color: #1e8449; }
.pq-diff-pending { background: #fef9e7; color: #9a7d0a; }
.pq-diff-na      { background: #f0f2f5; color: #8a95a3; }
.pq-diff-progress-wrap { margin-bottom: 10px; }
.pq-diff-progress-label { font-size: .68rem; color: #5a6475; margin-bottom: 4px; }
.pq-diff-progress-bar { height: 7px; background: #eaecf0; border-radius: 10px; overflow: hidden; }
.pq-diff-progress-fill { height: 100%; background: linear-gradient(90deg,#4a90d9,#6c9fd8); border-radius: 10px; transition: width .4s ease; }
.pq-btn-diffuser-full { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; padding: 9px 0; background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; border: none; border-radius: 9px; font-family: var(--font-primary); font-size: .76rem; font-weight: 700; cursor: pointer; transition: all .2s; }
.pq-btn-diffuser-full:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,35,50,.3); }

/* Méta-données */
.pq-meta-list { display: flex; flex-direction: column; gap: 6px; }
.pq-meta-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .72rem; padding: 4px 0; border-bottom: 1px solid #f0f2f5; }
.pq-meta-item:last-child { border-bottom: none; }
.pq-meta-key { color: #8a95a3; font-weight: 600; }
.pq-meta-val { color: #1a2332; font-weight: 700; text-align: right; }

/* Responsive */
@media screen and (max-width: 1100px) {
    .pq-body { grid-template-columns: 1fr; }
    .pq-sidebar-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media screen and (max-width: 700px) {
    .pq-document { padding: 20px 18px; }
    .pq-doc-header { grid-template-columns: 1fr; }
    .pq-signatures { grid-template-columns: 1fr; }
    .pq-sidebar-panel { grid-template-columns: 1fr; }
    .pq-doc-titre { font-size: 1.1rem; }
}

/* ===================================================
   PAGE : PLANNING
=================================================== */
.pl-wrap { max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* Header */
.pl-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pl-title   { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: #1a2332; }
.pl-subtitle { font-size: .72rem; color: #8a95a3; margin-top: 3px; }
.pl-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Navigation année */
.pl-nav-annee { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #eaecf0; border-radius: 10px; padding: 4px 10px; }
.pl-nav-btn   { background: none; border: none; font-size: 1.1rem; color: #5a6475; cursor: pointer; padding: 0 4px; line-height: 1; transition: color .15s; }
.pl-nav-btn:hover { color: var(--accent); }
.pl-annee-label { font-family: var(--font-display); font-size: .92rem; font-weight: 800; color: #1a2332; min-width: 42px; text-align: center; }

/* Vue toggle */
.pl-vue-toggle { display: flex; background: #f0f2f5; border-radius: 9px; padding: 3px; gap: 2px; }
.pl-vue-btn    { border: none; background: transparent; border-radius: 7px; padding: 6px 14px; font-size: .75rem; font-weight: 600; color: #5a6475; cursor: pointer; transition: all .18s; font-family: var(--font-primary); }
.pl-vue-active { background: #fff; color: #1a2332; box-shadow: 0 1px 4px rgba(0,0,0,.10); }

/* Bouton nouveau */
.pl-btn-new { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; border: none; border-radius: 10px; font-family: var(--font-primary); font-size: .78rem; font-weight: 700; cursor: pointer; transition: all .2s; box-shadow: 0 3px 12px rgba(26,35,50,.25); }
.pl-btn-new:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(26,35,50,.32); }

/* KPI */
.pl-kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.pl-kpi-card { background: #fff; border-radius: 14px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; border: 1px solid #eaecf0; box-shadow: 0 2px 8px rgba(0,0,0,.04); position: relative; overflow: hidden; }
.pl-kpi-card::before { content:''; position:absolute; top:0; left:0; bottom:0; width:4px; border-radius:4px 0 0 4px; }
.pl-kpi-blue::before   { background: linear-gradient(180deg,#3498db,#5dade2); }
.pl-kpi-orange::before { background: linear-gradient(180deg,#e67e22,#f39c12); }
.pl-kpi-green::before  { background: linear-gradient(180deg,#27ae60,#2ecc71); }
.pl-kpi-purple::before { background: linear-gradient(180deg,#9b59b6,#bb8fce); }
.pl-kpi-icon { font-size: 1.6rem; flex-shrink: 0; }
.pl-kpi-val  { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #1a2332; line-height: 1; }
.pl-kpi-lbl  { font-size: .68rem; color: #8a95a3; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

/* Légende */
.pl-legende { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; background: #fff; border-radius: 10px; border: 1px solid #eaecf0; }
.pl-leg-item { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; color: #5a6475; }
.pl-leg-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pl-dot-revue        { background: #3498db; }
.pl-dot-audit-sys    { background: #e67e22; }
.pl-dot-audit-poste  { background: #27ae60; }
.pl-dot-autre        { background: #9b59b6; }
.pl-leg-statut { font-size: .67rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.pl-statut-valide  { background: #eafaf1; color: #1e8449; }
.pl-statut-attente { background: #fef9e7; color: #9a7d0a; }
.pl-statut-refuse  { background: #fdedec; color: #c0392b; }
.pl-leg-sep { width: 1px; height: 20px; background: #eaecf0; }

/* CALENDRIER GRILLE 12 MOIS */
.pl-calendrier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pl-mois-bloc { background: #fff; border: 1px solid #eaecf0; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.pl-mois-titre { background: linear-gradient(135deg,#1a2332,#243447); color: #fff; font-family: var(--font-display); font-size: .78rem; font-weight: 700; padding: 9px 14px; text-align: center; letter-spacing: .3px; }
.pl-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; padding: 6px 6px 2px; }
.pl-cal-jour-hdr { text-align: center; font-size: .58rem; font-weight: 700; color: #8a95a3; text-transform: uppercase; padding: 3px 0; }
.pl-cal-jour { min-height: 34px; border-radius: 6px; padding: 3px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: background .14s; position: relative; }
.pl-cal-jour:hover { background: #f0f5ff; }
.pl-cal-vide { cursor: default; }
.pl-cal-vide:hover { background: transparent; }
.pl-cal-today .pl-cal-num { background: var(--accent); color: #fff; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.pl-cal-num { font-size: .68rem; font-weight: 600; color: #2c3e50; line-height: 1.6; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.pl-cal-ev-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; cursor: pointer; transition: transform .12s; }
.pl-cal-ev-dot:hover { transform: scale(1.4); }

/* Événements sous le calendrier */
.pl-mois-evs { padding: 6px 8px 10px; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid #f0f2f5; }
.pl-mois-ev-item { border-left: 3px solid; border-radius: 6px; padding: 5px 9px; display: flex; flex-direction: column; gap: 2px; }
.pl-ev-label { font-size: .68rem; font-weight: 700; }
.pl-ev-date  { font-size: .62rem; color: #5a6475; }
.pl-ev-statut-mini { font-size: .6rem; font-weight: 700; padding: 1px 6px; border-radius: 20px; width: fit-content; }
.pl-sv-valide  { background: #eafaf1; color: #1e8449; }
.pl-sv-attente { background: #fef9e7; color: #9a7d0a; }
.pl-sv-refuse  { background: #fdedec; color: #c0392b; }
.pl-sv-planifie { background: #eaf4fb; color: #1a5276; }
.pl-sv-badge { font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

/* VUE LISTE */
.pl-liste-filtres { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pl-filtre-sel, .pl-filtre-input { border: 1px solid #dde2ec; border-radius: 8px; padding: 7px 11px; font-size: .78rem; color: #2c3e50; font-family: var(--font-primary); outline: none; transition: border-color .2s; background: #fff; }
.pl-filtre-sel:focus, .pl-filtre-input:focus { border-color: var(--accent); }
.pl-filtre-input { flex: 1; min-width: 180px; }
.pl-liste-vide { text-align: center; padding: 40px; color: #8a95a3; font-size: .82rem; }
.pl-liste-wrap { display: flex; flex-direction: column; gap: 12px; }
.pl-liste-card { background: #fff; border-radius: 12px; border: 1px solid #eaecf0; border-left: 4px solid; box-shadow: 0 2px 8px rgba(0,0,0,.04); overflow: hidden; }
.pl-liste-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 18px 10px; }
.pl-liste-type-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .65rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; margin-bottom: 5px; width: fit-content; }
.pl-liste-titre { font-size: .9rem; font-weight: 700; color: #1a2332; margin-bottom: 6px; }
.pl-liste-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: .7rem; color: #5a6475; }
.pl-liste-meta span { display: inline-flex; align-items: center; gap: 3px; }
.pl-liste-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.pl-liste-btn-detail { background: none; border: 1px solid #dde2ec; border-radius: 7px; padding: 5px 12px; font-size: .72rem; font-weight: 600; color: var(--accent); cursor: pointer; font-family: var(--font-primary); white-space: nowrap; transition: all .15s; }
.pl-liste-btn-detail:hover { background: #eaf4fb; }
.pl-liste-auditeurs { border-top: 1px solid #f0f2f5; padding: 8px 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-liste-audit-label { font-size: .65rem; font-weight: 700; color: #8a95a3; text-transform: uppercase; letter-spacing: .5px; }
.pl-chip-auditeur { font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; }
.pl-chip-ok      { background: #eafaf1; color: #1e8449; }
.pl-chip-refuse  { background: #fdedec; color: #c0392b; }
.pl-chip-attente { background: #fef9e7; color: #9a7d0a; }

/* MODAL PLANNING */
.modal-planning { max-width: 900px !important; }
.pl-modal-body  { display: grid; grid-template-columns: 1fr 340px; gap: 0; }
.pl-modal-left  { padding-right: 16px; border-right: 1px solid #eaecf0; }
.pl-modal-right { padding-left: 18px; }

/* Type cards */
.pl-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pl-type-card { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 2px solid #eaecf0; border-radius: 10px; cursor: pointer; transition: all .18s; }
.pl-type-card input { display: none; }
.pl-type-card:has(input:checked) { border-color: var(--accent); background: #eaf4fb; }
.pl-type-revue:has(input:checked)       { border-color: #3498db; background: #eaf4fb; }
.pl-type-audit-sys:has(input:checked)   { border-color: #e67e22; background: #fef3e2; }
.pl-type-audit-poste:has(input:checked) { border-color: #27ae60; background: #eafaf1; }
.pl-type-autre:has(input:checked)       { border-color: #9b59b6; background: #f5eef8; }
.pl-type-icon { font-size: 1rem; }
.pl-type-name { font-size: .74rem; font-weight: 700; color: #1a2332; }

/* Auditeurs dans modal */
.pl-auditeur-input { width: 100%; border: 1px solid #dde2ec; border-radius: 8px; padding: 7px 10px; font-size: .78rem; font-family: var(--font-primary); outline: none; margin-bottom: 8px; }
.pl-auditeurs-disponibles { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; margin-bottom: 10px; border: 1px solid #eaecf0; border-radius: 9px; padding: 6px; }
.pl-auditeur-item { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 7px; cursor: pointer; transition: background .14s; }
.pl-auditeur-item:hover { background: #f5f6fa; }
.pl-auditeur-sel { background: #eafaf1 !important; }
.pl-auditeur-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg,var(--accent),#6c9fd8); color: #fff; font-size: .6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-display); }
.pl-auditeur-nom  { font-size: .74rem; font-weight: 700; color: #1a2332; }
.pl-auditeur-role { font-size: .65rem; color: #8a95a3; }
.pl-auditeur-toggle { margin-left: auto; font-size: .82rem; font-weight: 700; color: #27ae60; width: 20px; text-align: center; }
.pl-auditeurs-selectionnes-label { font-size: .66rem; font-weight: 700; color: #5a6475; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.pl-chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.pl-chips-empty { font-size: .72rem; color: #8a95a3; font-style: italic; }
.pl-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: #eaf4fb; border: 1px solid #aed6f1; border-radius: 20px; font-size: .72rem; font-weight: 600; color: #1a5276; }
.pl-chip-avatar { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .52rem; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.pl-chip-del { background: none; border: none; color: #8a95a3; cursor: pointer; font-size: .85rem; padding: 0 0 0 2px; line-height: 1; transition: color .15s; }
.pl-chip-del:hover { color: #e74c3c; }

/* Statut options */
.pl-statut-options { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-statut-opt { display: flex; align-items: center; cursor: pointer; }
.pl-statut-opt input { display: none; }
.pl-statut-badge { font-size: .72rem; font-weight: 700; padding: 5px 12px; border-radius: 20px; border: 2px solid #eaecf0; transition: all .15s; cursor: pointer; }
.pl-s-planifie  { background: #eaf4fb; color: #1a5276; }
.pl-s-confirme  { background: #eafaf1; color: #1e8449; }
.pl-s-annule    { background: #fdedec; color: #c0392b; }
.pl-statut-opt:has(input:checked) .pl-statut-badge { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,217,.15); }

/* Notifications */
.pl-notif-check { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: #2c3e50; cursor: pointer; padding: 5px 0; }
.pl-notif-check input { accent-color: var(--accent); }

/* MODAL DÉTAIL */
.pl-detail-bloc { background: #fafbfc; border-radius: 10px; border: 1px solid #eaecf0; padding: 12px 14px; margin-bottom: 14px; }
.pl-detail-row  { display: flex; gap: 12px; padding: 5px 0; border-bottom: 1px solid #f0f2f5; font-size: .78rem; }
.pl-detail-row:last-child { border-bottom: none; }
.pl-detail-key  { color: #8a95a3; font-weight: 600; min-width: 90px; flex-shrink: 0; }
.pl-detail-val  { color: #1a2332; font-weight: 500; }
.pl-detail-desc { align-items: flex-start; }
.pl-detail-auditeurs-titre { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #1a2332; margin-bottom: 10px; }
.pl-detail-auditeurs-list  { display: flex; flex-direction: column; gap: 7px; }
.pl-detail-auditeur { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fafbfc; border-radius: 9px; border: 1px solid #eaecf0; }
.pl-detail-audit-av   { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,var(--accent),#6c9fd8); color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-display); }
.pl-detail-audit-nom  { font-size: .76rem; font-weight: 700; color: #1a2332; }
.pl-detail-audit-date { font-size: .63rem; color: #8a95a3; }
.pl-detail-audit-val-wrap { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pl-detail-audit-val { font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pl-val-ok      { background: #eafaf1; color: #1e8449; }
.pl-val-refuse  { background: #fdedec; color: #c0392b; }
.pl-val-attente { background: #fef9e7; color: #9a7d0a; }
.pl-val-actions { display: flex; gap: 4px; }
.pl-val-btn { width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer; font-size: .75rem; font-weight: 700; transition: all .15s; display: flex; align-items: center; justify-content: center; }
.pl-val-btn-ok     { background: #eafaf1; color: #27ae60; }
.pl-val-btn-ok:hover     { background: #27ae60; color: #fff; }
.pl-val-btn-refuse { background: #fdedec; color: #e74c3c; }
.pl-val-btn-refuse:hover { background: #e74c3c; color: #fff; }

/* Responsive */
@media screen and (max-width: 1200px) { .pl-calendrier-grid { grid-template-columns: repeat(2,1fr); } }
@media screen and (max-width: 900px)  {
    .pl-kpi-row { grid-template-columns: repeat(2,1fr); }
    .pl-modal-body { grid-template-columns: 1fr; }
    .pl-modal-left { padding-right: 0; border-right: none; border-bottom: 1px solid #eaecf0; padding-bottom: 16px; margin-bottom: 4px; }
    .pl-modal-right { padding-left: 0; }
}
@media screen and (max-width: 650px)  { .pl-calendrier-grid { grid-template-columns: 1fr; } }

/* ===================================================
   PAGE : PARAMÈTRES
=================================================== */
.prm-wrap { max-width: 1600px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* Header */
.prm-page-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: #1a2332; }
.prm-page-sub   { font-size: .72rem; color: #8a95a3; margin-top: 3px; }

/* Onglets */
.prm-tabs { display: flex; gap: 4px; background: #f0f2f5; border-radius: 12px; padding: 4px; width: fit-content; }
.prm-tab  { border: none; background: transparent; border-radius: 9px; padding: 8px 22px; font-size: .78rem; font-weight: 700; color: #5a6475; cursor: pointer; transition: all .18s; font-family: var(--font-primary); }
.prm-tab-active { background: #fff; color: #1a2332; box-shadow: 0 2px 8px rgba(0,0,0,.10); }

/* KPI */
.prm-kpi-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.prm-kpi-card { background: #fff; border-radius: 14px; padding: 16px 18px; display: flex; align-items: center; gap: 14px; border: 1px solid #eaecf0; box-shadow: 0 2px 8px rgba(0,0,0,.04); position: relative; overflow: hidden; }
.prm-kpi-card::before { content:''; position:absolute; top:0; left:0; bottom:0; width:4px; border-radius:4px 0 0 4px; }
.prm-kpi-blue::before   { background: linear-gradient(180deg,#3498db,#5dade2); }
.prm-kpi-green::before  { background: linear-gradient(180deg,#27ae60,#2ecc71); }
.prm-kpi-orange::before { background: linear-gradient(180deg,#e67e22,#f39c12); }
.prm-kpi-purple::before { background: linear-gradient(180deg,#9b59b6,#bb8fce); }
.prm-kpi-icon { font-size: 1.6rem; flex-shrink: 0; }
.prm-kpi-val  { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: #1a2332; line-height: 1; }
.prm-kpi-lbl  { font-size: .67rem; color: #8a95a3; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }

/* Layout grille */
.prm-body-grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.prm-card-full { grid-column: 1 / -1; }

/* Cards */
.prm-card { background: #fff; border-radius: 14px; border: 1px solid #eaecf0; box-shadow: 0 2px 10px rgba(0,0,0,.05); overflow: hidden; }
.prm-card-header { padding: 16px 20px; border-bottom: 1px solid #eaecf0; }
.prm-card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.prm-card-title { font-family: var(--font-display); font-size: .92rem; font-weight: 700; color: #1a2332; }
.prm-card-sub   { font-size: .7rem; color: #8a95a3; margin-top: 2px; }
.prm-card-body  { padding: 20px; }
.prm-no-pad     { padding: 0 !important; }
.prm-card-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid #eaecf0; margin-top: 16px; }

/* Formulaire */
.prm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.prm-field { display: flex; flex-direction: column; gap: 5px; }
.prm-field-full { grid-column: 1 / -1; }
.prm-label { font-size: .7rem; font-weight: 700; color: #5a6475; text-transform: uppercase; letter-spacing: .4px; }
.prm-input, .prm-select { border: 1px solid #dde2ec; border-radius: 8px; padding: 8px 11px; font-size: .8rem; color: #2c3e50; font-family: var(--font-primary); outline: none; transition: border-color .2s; width: 100%; }
.prm-input:focus, .prm-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,217,.12); }
.prm-pwd-wrap { display: flex; gap: 6px; }
.prm-pwd-gen { width: 36px; flex-shrink: 0; border: 1px solid #dde2ec; background: #f5f6fa; border-radius: 8px; cursor: pointer; font-size: .9rem; transition: all .15s; }
.prm-pwd-gen:hover { background: #eaf4fb; border-color: var(--accent); }
.prm-checkboxes-row { display: flex; gap: 20px; flex-wrap: wrap; padding: 4px 0; }
.prm-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: #2c3e50; font-weight: 500; cursor: pointer; }
.prm-check { display: none; }
.prm-check-custom { width: 16px; height: 16px; border: 2px solid #dde2ec; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; position: relative; }
.prm-check:checked + .prm-check-custom { background: var(--accent); border-color: var(--accent); }
.prm-check:checked + .prm-check-custom::after { content: '✔'; color: #fff; font-size: .6rem; position: absolute; }
.prm-statut-toggle { display: flex; gap: 16px; }

/* Boutons */
.prm-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 9px; font-family: var(--font-primary); font-size: .78rem; font-weight: 700; cursor: pointer; transition: all .18s; border: none; }
.prm-btn-primary   { background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; box-shadow: 0 3px 10px rgba(26,35,50,.22); }
.prm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(26,35,50,.3); }
.prm-btn-secondary { background: #f0f2f5; color: #5a6475; border: 1px solid #dde2ec; }
.prm-btn-secondary:hover { background: #e6e9ef; }

/* Recherche */
.prm-search-wrap { display: flex; align-items: center; gap: 8px; background: #f5f6fa; border: 1px solid #eaecf0; border-radius: 8px; padding: 7px 12px; }
.prm-search { border: none; background: transparent; outline: none; font-size: .78rem; color: #2c3e50; font-family: var(--font-primary); min-width: 200px; }

/* Filtres liste utilisateurs */
.prm-users-filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 22px; background: #fafbfd; border-bottom: 1px solid #eef1f6; }
.prm-users-filtres .prm-select { flex: 1; min-width: 140px; max-width: 220px; width: auto; font-size: .76rem; padding: 7px 10px; background: #fff; cursor: pointer; }
.prm-filtres-reset { background: #f0f2f5; border: 1px solid #dde2ec; border-radius: 8px; padding: 7px 14px; font-size: .74rem; font-weight: 600; color: #5a6475; cursor: pointer; font-family: var(--font-primary); transition: background .2s, color .2s; white-space: nowrap; }
.prm-filtres-reset:hover { background: #fdecea; border-color: #f5b7b1; color: #c0392b; }

@media (max-width: 900px) {
    .prm-users-filtres .prm-select { max-width: none; min-width: 45%; }
}

/* Filtres liste de diffusion (GED) */
.ged-diff-filtres { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.ged-diff-filtres .prm-select { flex: 0 0 auto; display: inline-block; width: 210px; min-width: 0; max-width: none; font-size: .76rem; padding: 7px 10px; background: #fff; cursor: pointer; margin: 0; }

/* Table users */
.prm-table-wrap { overflow-x: auto; }
.prm-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.prm-table thead th { background: linear-gradient(135deg,#f0f2f5,#e8ebf0); padding: 10px 14px; font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #5a6475; border-bottom: 2px solid #dde2ec; white-space: nowrap; }
.prm-table tbody tr { border-bottom: 1px solid #f0f2f5; transition: background .14s; }
.prm-table tbody tr:hover { background: #f8faff; }
.prm-table td { padding: 11px 14px; vertical-align: middle; color: #2c3e50; }
.prm-td-num     { color: #8a95a3; font-weight: 700; font-size: .72rem; width: 40px; }
.prm-td-actions { width: 80px; }
.prm-th-center  { text-align: center; }

/* Cellule user */
.prm-user-cell  { display: flex; align-items: center; gap: 10px; }
.prm-user-av    { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,var(--accent),#6c9fd8); color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--font-display); }
.prm-user-name  { font-weight: 700; color: #1a2332; font-size: .8rem; }
.prm-user-email { font-size: .68rem; color: #8a95a3; }

/* Rôles badges */
.prm-roles-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
.prm-processus-chip { display:inline-block; max-width:150px; overflow:hidden; text-overflow:ellipsis; background:#eef2ff; color:#3d5af1; border:1px solid #c7d2fe; border-radius:20px; padding:2px 8px; font-size:.65rem; font-weight:600; white-space:nowrap; margin:1px 0; vertical-align:top; }
.edit-proc-row { display:flex; gap:8px; align-items:center; margin-bottom:6px; }
.edit-proc-row .prm-select { flex:1; margin-bottom:0; }
.edit-proc-del-btn { flex-shrink:0; padding:0 10px; height:36px; border:1px solid #e0e4ed; border-radius:6px; background:#fff; cursor:pointer; font-size:1.1rem; color:#8a95a3; }
.edit-proc-del-btn:hover { background:#fef2f2; border-color:#fca5a5; color:#dc2626; }
.edit-proc-add-btn { margin-top:4px; padding:5px 12px; border:1px dashed #3d5af1; border-radius:8px; background:transparent; color:#3d5af1; font-size:.78rem; cursor:pointer; font-weight:600; }
.edit-proc-add-btn:hover { background:#eef2ff; }
.prm-role-badge  { font-size: .62rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.prm-role-admin    { background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; }
.prm-role-pilote   { background: #eaf4fb; color: #1a5276; }
.prm-role-auditeur { background: #fef3e2; color: #9a5b0a; }
.prm-role-user     { background: #f0f2f5; color: #5a6475; }

/* Statut */
.prm-statut-badge { font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.prm-statut-actif   { background: #eafaf1; color: #1e8449; }
.prm-statut-inactif { background: #f0f2f5; color: #8a95a3; }
.prm-statut-invite  { background: #fef9e7; color: #9a7d0a; }

/* RÉFÉRENTIELS */
.prm-ref-intro { display: flex; align-items: center; gap: 8px; padding: 11px 16px; background: #eaf4fb; border: 1px solid #aed6f1; border-radius: 10px; font-size: .76rem; color: #1a5276; font-weight: 500; margin-bottom: 4px; }
.prm-ref-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.prm-ref-card  { background: #fff; border-radius: 14px; border: 1px solid #eaecf0; box-shadow: 0 2px 8px rgba(0,0,0,.04); overflow: hidden; }
.prm-ref-card-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.prm-ref-blue   { background: linear-gradient(135deg,#eaf4fb,#d6eaf8); }
.prm-ref-green  { background: linear-gradient(135deg,#eafaf1,#d5f5e3); }
.prm-ref-orange { background: linear-gradient(135deg,#fef3e2,#fde8c8); }
.prm-ref-purple { background: linear-gradient(135deg,#f3eeff,#e8d5fb); }
.prm-ref-icon   { font-size: 1.4rem; }
.prm-ref-title  { font-family: var(--font-display); font-size: .88rem; font-weight: 700; color: #1a2332; }
.prm-ref-count  { font-size: .67rem; color: #5a6475; font-weight: 600; }
.prm-ref-body   { padding: 14px 16px; }
.prm-ref-add-row { display: flex; gap: 7px; margin-bottom: 12px; }
.prm-ref-add-btn { width: 36px; flex-shrink: 0; background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; border: none; border-radius: 8px; font-size: 1.2rem; font-weight: 700; cursor: pointer; transition: all .15s; }
.prm-ref-add-green  { background: linear-gradient(135deg,#1e8449,#27ae60) !important; }
.prm-ref-add-orange { background: linear-gradient(135deg,#d35400,#e67e22) !important; }
.prm-ref-add-purple { background: linear-gradient(135deg,#6c3483,#9b59b6) !important; }
.prm-ref-add-btn:hover { transform: translateY(-1px); opacity: .9; }
.prm-ref-list { list-style: none; display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.prm-ref-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: #fafbfc; border: 1px solid #eaecf0; border-radius: 7px; font-size: .76rem; color: #2c3e50; font-weight: 500; transition: background .13s; }
.prm-ref-item:hover { background: #f0f5ff; }
.prm-ref-del { background: none; border: none; color: #bdc3c7; cursor: pointer; font-size: 1rem; font-weight: 700; padding: 0 3px; transition: color .13s; flex-shrink: 0; line-height: 1; }
.prm-ref-del:hover { color: #e74c3c; }

/* Responsive */
@media screen and (max-width: 1100px) {
    .prm-body-grid { grid-template-columns: 1fr; }
    .prm-ref-grid  { grid-template-columns: 1fr 1fr; }
    .prm-kpi-row   { grid-template-columns: repeat(2,1fr); }
}
@media screen and (max-width: 650px) {
    .prm-ref-grid { grid-template-columns: 1fr; }
    .prm-form-grid { grid-template-columns: 1fr; }
}

/* ===================================================
   PAGE : TABLEAU DE BORD GÉNÉRAL (TBD)
=================================================== */

.tbd-general-wrap {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 24px;
}

/* HEADER */
.tbd-gen-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1a2332 0%, #243447 60%, #1a3a5c 100%);
    border-radius: 16px;
    box-shadow: 0 6px 28px rgba(26,35,50,.3);
    position: relative;
    overflow: hidden;
}

.tbd-gen-header::before {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(74,144,217,.08);
    pointer-events: none;
}
.tbd-gen-header::after {
    content: '';
    position: absolute;
    right: 60px; bottom: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(39,174,96,.06);
    pointer-events: none;
}

.tbd-gen-kicker {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,.4);
    margin-bottom: 6px;
}

.tbd-gen-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .3px;
    line-height: 1.1;
}

.tbd-gen-subtitle {
    font-size: .75rem;
    color: rgba(255,255,255,.5);
    margin-top: 5px;
    max-width: 500px;
}

.tbd-gen-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.tbd-gen-date {
    font-family: var(--font-display);
    font-size: .78rem;
    color: rgba(255,255,255,.55);
    font-weight: 600;
}

.tbd-gen-health {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(39,174,96,.15);
    border: 1px solid rgba(39,174,96,.3);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: .72rem;
    font-weight: 700;
    color: #2ecc71;
}

.tbd-gen-health-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    animation: pulseDot 2s infinite;
    flex-shrink: 0;
}

@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46,204,113,.5); }
    50%       { box-shadow: 0 0 0 6px rgba(46,204,113,0); }
}

/* SCORE GLOBAL */
.tbd-gen-score-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.tbd-gen-score-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eaecf0;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 320px;
    flex-shrink: 0;
}

.tbd-gen-score-ring-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.tbd-gen-ring {
    width: 110px; height: 110px;
    transform: rotate(0);
    filter: drop-shadow(0 4px 12px rgba(74,144,217,.2));
}

.tbd-gen-score-val {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 800;
    color: #1a2332;
    line-height: 1;
    display: flex;
    align-items: flex-end;
    gap: 1px;
}

.tbd-gen-score-pct {
    font-size: .95rem;
    font-weight: 700;
    color: #8a95a3;
    margin-bottom: 3px;
}

.tbd-gen-score-title {
    font-family: var(--font-display);
    font-size: .92rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 5px;
}

.tbd-gen-score-sub {
    font-size: .72rem;
    color: #8a95a3;
    margin-bottom: 8px;
}

.tbd-gen-score-trend {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    color: #1e8449;
    background: #eafaf1;
    border: 1px solid #a9dfbf;
    border-radius: 20px;
    padding: 3px 10px;
}

/* MINI KPIs */
.tbd-gen-mini-kpis {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tbd-gen-mini-kpi {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    transition: transform .18s, box-shadow .18s;
}

.tbd-gen-mini-kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.09); }

.tbd-gen-mini-kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.tbd-mk-blue::before   { background: linear-gradient(90deg,#4a90d9,#6c9fd8); }
.tbd-mk-green::before  { background: linear-gradient(90deg,#27ae60,#2ecc71); }
.tbd-mk-orange::before { background: linear-gradient(90deg,#e67e22,#f39c12); }
.tbd-mk-purple::before { background: linear-gradient(90deg,#9b59b6,#bb8fce); }
.tbd-mk-red::before    { background: linear-gradient(90deg,#e74c3c,#c0392b); }
.tbd-mk-teal::before   { background: linear-gradient(90deg,#1abc9c,#16a085); }

.tbd-gen-mini-icon { font-size: 1.2rem; margin-bottom: 6px; display: block; }
.tbd-gen-mini-val  { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: #1a2332; line-height: 1; }
.tbd-gen-mini-lbl  { font-size: .72rem; font-weight: 700; color: #2c3e50; margin-top: 3px; }
.tbd-gen-mini-sub  { font-size: .64rem; color: #8a95a3; margin-top: 2px; }

/* TABLEAU DE BORD BLOQUÉ (aucun processus affecté) */
.tbd-general-wrap.tbd-bloque > *:not(.tbd-gen-header):not(.tbd-acces-bloque) { display: none !important; }
.tbd-acces-bloque {
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    padding: 60px 40px;
    margin-top: 20px;
    text-align: center;
}
.tbd-acces-icone {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: .8;
}
.tbd-acces-titre {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: #1a2332;
    margin-bottom: 12px;
}
.tbd-acces-texte {
    font-size: .9rem;
    color: #5a6475;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 18px;
}
.tbd-acces-aide {
    display: inline-block;
    background: #fff8e1;
    border: 1px solid #f9e79f;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: .8rem;
    color: #7d6608;
    margin: 0;
}

/* FILTRE MULTI-PROCESSUS */
.tbd-filtre-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 0 16px;
}
.tbd-filtre-hint { font-size: .74rem; color: #8a95a3; }
.tbd-filtre-proc { position: relative; display: inline-block; }
.tbd-filtre-proc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #dde2ec;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: .8rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    font-family: var(--font-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: border-color .18s, box-shadow .18s;
    max-width: 300px;
    white-space: nowrap;
}
.tbd-filtre-proc-btn:hover { border-color: #4a90d9; box-shadow: 0 4px 12px rgba(74,144,217,.15); }
.tbd-filtre-proc-btn #tbd-filtre-proc-label { overflow: hidden; text-overflow: ellipsis; }
.tbd-fp-caret { font-size: .7rem; color: #8a95a3; }
.tbd-filtre-proc-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #dde2ec;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.15);
    padding: 8px;
    min-width: 260px;
    max-height: 320px;
    overflow-y: auto;
}
.tbd-filtre-proc-panel.open { display: block; }
.tbd-fp-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: .8rem;
    color: #2c3e50;
    cursor: pointer;
    transition: background .15s;
}
.tbd-fp-item:hover { background: #f0f6fd; }
.tbd-fp-item input { accent-color: #4a90d9; cursor: pointer; width: 15px; height: 15px; flex-shrink: 0; }
.tbd-fp-tous-item { border-bottom: 1px solid #eef1f6; margin-bottom: 4px; padding-bottom: 10px; }

/* INDICATEURS SMQ */
.tbd-smq-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.tbd-smq-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform .18s, box-shadow .18s;
}
.tbd-smq-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.09); }
.tbd-smq-card::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; }
.tbd-smq-rouge::before  { background: linear-gradient(180deg,#e74c3c,#c0392b); }
.tbd-smq-bleu::before   { background: linear-gradient(180deg,#4a90d9,#3a7bc8); }
.tbd-smq-vert::before   { background: linear-gradient(180deg,#27ae60,#1e8449); }
.tbd-smq-violet::before { background: linear-gradient(180deg,#9b59b6,#8e44ad); }
.tbd-smq-icon { font-size: 1.5rem; flex-shrink: 0; }
.tbd-smq-val  { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; color: #1a2332; line-height: 1.1; }
.tbd-smq-lbl  { font-size: .74rem; font-weight: 700; color: #2c3e50; margin-top: 2px; }
.tbd-smq-sub  { font-size: .66rem; color: #8a95a3; margin-top: 2px; }

/* Listes Top risques & Échéances */
.tbd-smq-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.tbd-smq-list { padding: 6px 0 2px; }
.tbd-smq-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid #f0f2f5;
    font-size: .8rem;
    color: #2c3e50;
    cursor: default;
    border-radius: 6px;
    transition: background .15s;
}
.tbd-smq-item[onclick] { cursor: pointer; }
.tbd-smq-item:hover { background: #f7f9fc; }
.tbd-smq-item:last-child { border-bottom: none; }
.tbd-smq-item-ico  { flex-shrink: 0; }
.tbd-smq-item-txt  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbd-smq-item-meta { flex-shrink: 0; font-size: .7rem; color: #8a95a3; font-weight: 600; }
.tbd-crit-badge {
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
    border-radius: 8px;
    padding: 3px 8px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: .78rem;
}
.tbd-crit-rouge  { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }
.tbd-crit-orange { background: #fef9e7; color: #9a7d0a; border: 1px solid #f9e79f; }
.tbd-crit-vert   { background: #d5f5e3; color: #1e6b3a; border: 1px solid #a9dfbf; }
.tbd-smq-empty { text-align: center; color: #aab0bc; font-size: .78rem; padding: 22px 0; }

@media (max-width: 900px) {
    .tbd-smq-lists { grid-template-columns: 1fr; }
}

/* CHART CARDS */
.tbd-gen-charts-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.tbd-gen-chart-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 20px 22px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tbd-gc-large { flex: 2; }

.tbd-gen-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.tbd-gen-chart-title {
    font-family: var(--font-display);
    font-size: .88rem;
    font-weight: 700;
    color: #1a2332;
    line-height: 1.3;
}

.tbd-gen-chart-sub {
    font-size: .68rem;
    color: #8a95a3;
    margin-top: 2px;
}

.tbd-gen-chart-body {
    flex: 1;
    min-height: 0;
    position: relative;
}

.tbd-chart-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tbd-gen-doughnut-legend {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 10px;
    flex-shrink: 0;
}

.tbd-dl-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    color: #5a6475;
    font-weight: 600;
}

.tbd-dl-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Badges chart */
.tbd-gen-chart-badge {
    font-size: .62rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.tbd-badge-blue   { background: #eaf4fb; color: #1a5276; }
.tbd-badge-orange { background: #fef3e2; color: #9a5b0a; }
.tbd-badge-green  { background: #eafaf1; color: #1e8449; }
.tbd-badge-purple { background: #f5eef8; color: #6c3483; }
.tbd-badge-teal   { background: #e8f8f5; color: #148f77; }
.tbd-badge-dark   { background: linear-gradient(135deg,#1a2332,#2c3e50); color: #fff; }

/* LIGNE BASSE */
.tbd-gen-bottom-row {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

/* Modules card */
.tbd-gen-modules-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 20px 22px;
    flex: 1.2;
    min-width: 0;
}

.tbd-gen-modules-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tbd-gen-module-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tbd-gen-mod-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.tbd-gen-mod-icon { font-size: 1rem; flex-shrink: 0; }

.tbd-gen-mod-name {
    font-size: .75rem;
    font-weight: 700;
    color: #1a2332;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbd-gen-mod-detail {
    font-size: .63rem;
    color: #8a95a3;
}

.tbd-gen-mod-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tbd-gen-mod-bar-wrap {
    width: 100px;
    height: 7px;
    background: #eaecf0;
    border-radius: 10px;
    overflow: hidden;
}

.tbd-gen-mod-bar {
    height: 100%;
    border-radius: 10px;
    transition: width .6s ease;
}

.tbd-gen-mod-pct {
    font-family: var(--font-display);
    font-size: .72rem;
    font-weight: 800;
    min-width: 36px;
    text-align: right;
}

.tbd-pct-blue   { color: #4a90d9; }
.tbd-pct-orange { color: #e67e22; }
.tbd-pct-purple { color: #9b59b6; }
.tbd-pct-teal   { color: #1abc9c; }
.tbd-pct-red    { color: #e74c3c; }
.tbd-pct-green  { color: #27ae60; }

/* Timeline card */
.tbd-gen-timeline-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 20px 22px;
    flex: 1;
    min-width: 0;
}

.tbd-gen-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.tbd-gen-timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 10px; bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, #eaecf0, #dde2ec);
}

.tbd-gen-tl-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    position: relative;
}

.tbd-gen-tl-dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 3px solid;
    background: #fff;
    flex-shrink: 0;
    margin-top: 1px;
    z-index: 1;
}

.tbd-tl-blue .tbd-gen-tl-dot   { border-color: #3498db; background: #eaf4fb; }
.tbd-tl-green .tbd-gen-tl-dot  { border-color: #27ae60; background: #eafaf1; }
.tbd-tl-orange .tbd-gen-tl-dot { border-color: #e67e22; background: #fef3e2; }

.tbd-gen-tl-content { flex: 1; min-width: 0; }

.tbd-gen-tl-date {
    font-size: .65rem;
    font-weight: 700;
    color: #8a95a3;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}

.tbd-gen-tl-title {
    font-size: .78rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbd-gen-tl-meta {
    font-size: .65rem;
    color: #5a6475;
    margin-bottom: 2px;
}

.tbd-gen-tl-who {
    font-size: .63rem;
    color: #8a95a3;
}

.tbd-gen-tl-badge {
    font-size: .62rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.tbd-tl-badge-attente { background: #fef9e7; color: #9a7d0a; }
.tbd-tl-badge-valide  { background: #eafaf1; color: #1e8449; }

/* Actions card */
.tbd-gen-actions-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eaecf0;
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
    padding: 20px 22px;
    flex: 1;
    min-width: 0;
}

.tbd-gen-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tbd-gen-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border-left: 3px solid;
    background: #fafbfc;
    transition: background .14s;
}

.tbd-gen-action-item:hover { background: #f5f6fa; }

.tbd-action-red    { border-left-color: #e74c3c; }
.tbd-action-blue   { border-left-color: #3498db; }
.tbd-action-orange { border-left-color: #e67e22; }
.tbd-action-green  { border-left-color: #27ae60; }

.tbd-gen-action-icon { font-size: .9rem; flex-shrink: 0; }

.tbd-gen-action-content { flex: 1; min-width: 0; }

.tbd-gen-action-title {
    font-size: .74rem;
    font-weight: 700;
    color: #1a2332;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tbd-gen-action-meta {
    font-size: .64rem;
    color: #5a6475;
    margin-top: 1px;
}

.tbd-gen-action-who {
    font-size: .62rem;
    color: #8a95a3;
    margin-top: 1px;
}

.tbd-gen-action-badge {
    font-size: .62rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tbd-ab-retard  { background: #fdedec; color: #c0392b; }
.tbd-ab-cours   { background: #eaf4fb; color: #1a5276; }
.tbd-ab-attente { background: #fef9e7; color: #9a7d0a; }
.tbd-ab-ok      { background: #eafaf1; color: #1e8449; }

/* Responsive */
@media screen and (max-width: 1200px) {
    .tbd-gen-mini-kpis { grid-template-columns: repeat(3, 1fr); }
    .tbd-gen-charts-row { flex-wrap: wrap; }
    .tbd-gc-large { flex: 1 1 100%; }
    .tbd-gen-bottom-row { flex-wrap: wrap; }
}

@media screen and (max-width: 900px) {
    .tbd-gen-score-row { flex-direction: column; }
    .tbd-gen-score-card { min-width: unset; }
    .tbd-gen-mini-kpis { grid-template-columns: repeat(2, 1fr); }
    .tbd-gen-mod-bar-wrap { width: 60px; }
}

@media screen and (max-width: 600px) {
    .tbd-gen-mini-kpis { grid-template-columns: 1fr 1fr; }
    .tbd-gen-header { flex-direction: column; align-items: flex-start; }
    .tbd-gen-header-right { align-items: flex-start; }
}

/* ============================================================
   MODAL VISIONNEUSE PDF GED
============================================================ */

.modal-viewer {
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden !important;
}

/* Header */
.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #1a2332;
    gap: 12px;
    flex-shrink: 0;
}
.viewer-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.viewer-doc-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.viewer-doc-info {
    min-width: 0;
}
.viewer-doc-nom {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 480px;
}
.viewer-doc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.viewer-meta-badge {
    background: rgba(255,255,255,.15);
    color: #c8d6e5;
    border-radius: 5px;
    font-size: .68rem;
    padding: 1px 7px;
    font-weight: 600;
    letter-spacing: .3px;
}
.viewer-doc-meta span:not(.viewer-meta-badge):not(.viewer-meta-sep) {
    color: #8fa3bb;
    font-size: .72rem;
}
.viewer-meta-sep { color: #3d5166; font-size: .75rem; }

.viewer-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.viewer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 7px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .18s;
    font-family: inherit;
}
.viewer-btn-dl {
    background: #2a7de1;
    color: #fff;
}
.viewer-btn-dl:hover { background: #1a6acf; }
.viewer-btn-change {
    background: #f0f2f5;
    color: #3a4455;
    border: 1px solid #dde2ec;
    cursor: pointer;
}
.viewer-btn-change:hover { background: #e2e6ed; }
.viewer-btn-secondary {
    background: rgba(255,255,255,.1);
    color: #c8d6e5;
    border: 1px solid rgba(255,255,255,.15);
}
.viewer-btn-secondary:hover { background: rgba(255,255,255,.2); }
.viewer-btn-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: none;
    color: #c8d6e5;
    font-size: .85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s;
}
.viewer-btn-close:hover { background: rgba(255,255,255,.25); color: #fff; }

/* Bande d'infos */
.viewer-infobar {
    display: flex;
    gap: 0;
    background: #f7f9fc;
    border-bottom: 1px solid #e2e6ed;
    flex-shrink: 0;
}
.viewer-infobar-item {
    display: flex;
    flex-direction: column;
    padding: 8px 18px;
    border-right: 1px solid #e2e6ed;
    flex: 1;
}
.viewer-infobar-item:last-child { border-right: none; }
.viewer-infobar-lbl {
    font-size: .62rem;
    font-weight: 700;
    color: #aab0bc;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 2px;
}
.viewer-infobar-val {
    font-size: .78rem;
    font-weight: 600;
    color: #2d3748;
}

/* Zone principale */
.viewer-body {
    flex: 1;
    overflow: hidden;
    background: #e8eaed;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Zone upload */
.viewer-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 24px;
    text-align: center;
}
.viewer-upload-icon { font-size: 3rem; opacity: .5; }
.viewer-upload-title {
    font-size: .95rem;
    font-weight: 700;
    color: #3a4455;
}
.viewer-upload-sub {
    font-size: .78rem;
    color: #8a95a3;
    margin-top: -4px;
}
.viewer-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    background: #2a7de1;
    color: #fff;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background .18s;
    font-family: inherit;
}
.viewer-upload-btn:hover { background: #1a6acf; }
.viewer-upload-hint {
    font-size: .68rem;
    color: #aab0bc;
}

/* Iframe PDF */
.viewer-iframe-wrap {
    width: 100%;
    height: 100%;
}
.viewer-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Footer */
.viewer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #f7f9fc;
    border-top: 1px solid #e2e6ed;
    flex-shrink: 0;
}
.viewer-footer-left {
    font-size: .72rem;
    color: #5a6475;
    display: flex;
    align-items: center;
}
.viewer-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ============================================================
   PAGE GED — VALIDATION & APPROBATION
============================================================ */

/* En-tête */
.gedv-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.gedv-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a2332;
    letter-spacing: -.3px;
}
.gedv-subtitle {
    font-size: .78rem;
    color: #8a95a3;
    margin-top: 3px;
}
.gedv-role-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gedv-role-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #aab0bc;
}
.gedv-role-select {
    padding: 7px 12px;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    font-size: .78rem;
    font-family: inherit;
    color: #2d3748;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
}

/* KPIs */
.gedv-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.gedv-kpi-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e6ed;
    background: #fff;
}
.gedv-kpi-icon { font-size: 1.4rem; }
.gedv-kpi-val  { font-size: 1.5rem; font-weight: 800; color: #1a2332; line-height: 1; }
.gedv-kpi-lbl  { font-size: .7rem; color: #8a95a3; margin-top: 3px; }
.gedv-kpi-orange { border-color: #f5cba7; background: #fffbf7; }
.gedv-kpi-orange .gedv-kpi-val { color: #c87941; }
.gedv-kpi-green  { border-color: #a9dfbf; background: #f0faf4; }
.gedv-kpi-green  .gedv-kpi-val { color: #1e6b3a; }
.gedv-kpi-red    { border-color: #f5b7b1; background: #fff8f7; }
.gedv-kpi-red    .gedv-kpi-val { color: #c0392b; }
.gedv-kpi-blue   { border-color: #aed6f1; background: #f0f8ff; }
.gedv-kpi-blue   .gedv-kpi-val { color: #1a6fa8; }

/* Tabs */
.gedv-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e6ed;
    margin-bottom: 20px;
}
.gedv-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    background: none;
    font-size: .8rem;
    font-weight: 600;
    color: #8a95a3;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all .18s;
    font-family: inherit;
    border-radius: 6px 6px 0 0;
}
.gedv-tab:hover { color: #2d3748; background: #f7f9fc; }
.gedv-tab-active { color: #2a7de1; border-bottom-color: #2a7de1; }
.gedv-tab-badge {
    background: #e74c3c;
    color: #fff;
    border-radius: 20px;
    font-size: .62rem;
    font-weight: 700;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
}
.gedv-badge-neutral { background: #dde2ec; color: #5a6475; }

/* Empty state */
.gedv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    gap: 10px;
    text-align: center;
}
.gedv-empty-icon  { font-size: 3rem; }
.gedv-empty-title { font-size: 1rem; font-weight: 700; color: #3a4455; }
.gedv-empty-sub   { font-size: .78rem; color: #aab0bc; }

/* Cartes document */
.gedv-doc-card {
    background: #fff;
    border: 1.5px solid #e2e6ed;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: box-shadow .18s;
}
.gedv-doc-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.07); }

.gedv-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.gedv-card-ref-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.gedv-role-pill {
    background: #eef2ff;
    color: #3d5af1;
    border-radius: 20px;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 9px;
    border: 1px solid #c7d2fe;
}
.gedv-card-nom {
    font-size: .92rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 5px;
}
.gedv-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .72rem;
    color: #8a95a3;
}
.gedv-meta-sep { color: #dde2ec; }

/* Statut badge */
.gedv-statut-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}
.gedv-sb-attente { background: #fdebd0; color: #9c5700; border: 1px solid #f5cba7; }
.gedv-sb-valide  { background: #d5f5e3; color: #1e6b3a; border: 1px solid #a9dfbf; }
.gedv-sb-refuse  { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }

/* Description */
.gedv-card-desc {
    font-size: .75rem;
    color: #5a6475;
    background: #f7f9fc;
    border-left: 3px solid #dde2ec;
    padding: 7px 12px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 14px;
    font-style: italic;
}

/* Circuit mini */
.gedv-circuit-mini {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f7f9fc;
    border: 1px solid #e2e6ed;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.gedv-circuit-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 100px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background .15s;
}
.gedv-cs-moi {
    background: #eef2ff;
    border: 1.5px solid #c7d2fe;
}
.gedv-cs-role {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #aab0bc;
}
.gedv-cs-who {
    font-size: .75rem;
    font-weight: 600;
    color: #2d3748;
}
.gedv-circuit-arrow {
    color: #c8d6e5;
    font-size: 1.1rem;
    flex-shrink: 0;
    padding: 0 4px;
}
.gedv-prog-badge {
    font-size: .62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}
.gedv-prog-valide  { background: #d5f5e3; color: #1e6b3a; }
.gedv-prog-refuse  { background: #fadbd8; color: #c0392b; }
.gedv-prog-attente { background: #fdebd0; color: #9c5700; }

/* Commentaire */
.gedv-comment-bloc {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: .75rem;
    color: #5a6475;
    background: #fffdf0;
    border: 1px solid #f9e79f;
    border-radius: 7px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* Boutons d'action */
.gedv-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.gedv-btn-valider, .gedv-btn-refuser, .gedv-btn-voir, .gedv-btn-annuler {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .18s;
    font-family: inherit;
}
.gedv-btn-valider  { background: #d5f5e3; color: #1e6b3a; border: 1.5px solid #a9dfbf; }
.gedv-btn-valider:hover  { background: #a9dfbf; }
.gedv-btn-refuser  { background: #fadbd8; color: #c0392b; border: 1.5px solid #f5b7b1; }
.gedv-btn-refuser:hover  { background: #f5b7b1; }
.gedv-btn-voir     { background: #e8f4fd; color: #1a6fa8; border: 1.5px solid #aed6f1; margin-left: auto; }
.gedv-btn-voir:hover     { background: #aed6f1; }
.gedv-btn-annuler  { background: #f0f2f5; color: #5a6475; border: 1.5px solid #dde2ec; }
.gedv-btn-annuler:hover  { background: #dde2ec; }

/* Modal décision */
.gedv-recap-doc {
    background: #f7f9fc;
    border: 1px solid #e2e6ed;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 4px;
}
.gedv-recap-ref { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.gedv-recap-nom { font-size: .9rem; font-weight: 700; color: #1a2332; margin-bottom: 4px; }
.gedv-recap-meta { font-size: .72rem; color: #8a95a3; }

.gedv-decision-btns {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.gedv-dec-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 9px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .18s;
    font-family: inherit;
    flex: 1;
    justify-content: center;
}
.gedv-dec-valider { background: #d5f5e3; color: #1e6b3a; border-color: #a9dfbf; }
.gedv-dec-valider:hover { background: #a9dfbf; }
.gedv-dec-refuser { background: #fadbd8; color: #c0392b; border-color: #f5b7b1; }
.gedv-dec-refuser:hover { background: #f5b7b1; }

.gedv-decision-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.gedv-decision-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 700;
}
.gedv-dp-valide { background: #d5f5e3; color: #1e6b3a; border: 1.5px solid #a9dfbf; }
.gedv-dp-refuse { background: #fadbd8; color: #c0392b; border: 1.5px solid #f5b7b1; }
.gedv-dp-changer {
    background: none;
    border: 1px solid #dde2ec;
    border-radius: 6px;
    font-size: .72rem;
    color: #8a95a3;
    padding: 5px 10px;
    cursor: pointer;
    font-family: inherit;
}
.gedv-dp-changer:hover { background: #f0f2f5; color: #3a4455; }

@media (max-width: 768px) {
    .gedv-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .gedv-circuit-mini { flex-direction: column; }
    .gedv-circuit-arrow { transform: rotate(90deg); }
    .gedv-btn-voir { margin-left: 0; }
}

/* ============================================================
   MODAL HISTORIQUE DES VERSIONS GED
============================================================ */

.modal-histo {
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    overflow: hidden !important;
}

/* Header */
.histo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    background: #1a2332;
    flex-shrink: 0;
}
.histo-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    min-width: 0;
}
.histo-header-left svg { flex-shrink: 0; stroke: #7ea8d4; }
.histo-title {
    font-size: .92rem;
    font-weight: 800;
    color: #fff;
}
.histo-subtitle {
    font-size: .72rem;
    color: #8fa3bb;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}
.histo-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.histo-ref {
    background: rgba(255,255,255,.12);
    color: #c8d6e5;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 10px;
    letter-spacing: .3px;
}
.histo-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: none;
    color: #c8d6e5;
    font-size: .82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.histo-close:hover { background: rgba(255,255,255,.25); color: #fff; }

/* Bande version actuelle */
.histo-current-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f0f4fa;
    border-bottom: 1px solid #dde2ec;
    flex-shrink: 0;
}
.histo-current-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    gap: 3px;
    border-right: 1px solid #dde2ec;
}
.histo-current-item:last-child { border-right: none; }
.histo-current-lbl {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #aab0bc;
}
.histo-current-val {
    font-size: .78rem;
    font-weight: 700;
    color: #2d3748;
}

/* Version badge */
.histo-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .3px;
    background: #1a2332;
    color: #fff;
}

/* Body scrollable */
.histo-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Formulaire nouvelle révision */
.histo-form-bloc {
    padding: 18px 22px;
    background: #fff;
    border-bottom: 2px solid #e2e6ed;
    flex-shrink: 0;
}
.histo-form-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 14px;
}
.histo-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.histo-form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.histo-form-field label {
    font-size: .72rem;
    font-weight: 600;
    color: #5a6475;
}
.histo-field-full { grid-column: 1 / -1; }
.histo-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.histo-next-version {
    font-size: .75rem;
    color: #8a95a3;
    display: flex;
    align-items: center;
    gap: 6px;
}
.histo-next-version strong {
    background: #eef2ff;
    color: #3d5af1;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 800;
}
.histo-btn-ajouter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: #2a7de1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s;
    font-family: inherit;
}
.histo-btn-ajouter:hover { background: #1a6acf; }

/* Timeline */
.histo-timeline-wrap {
    padding: 18px 22px;
    flex: 1;
}
.histo-timeline-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 16px;
}
.histo-timeline-count {
    margin-left: auto;
    font-size: .68rem;
    color: #aab0bc;
    font-weight: 400;
}
.histo-empty {
    color: #aab0bc;
    font-size: .78rem;
    text-align: center;
    padding: 24px 0;
}
.histo-timeline {
    display: flex;
    flex-direction: column;
}

/* Entrée timeline */
.histo-entry {
    display: flex;
    gap: 14px;
    position: relative;
}
.histo-entry-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 18px;
}
.histo-entry-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #dde2ec;
    border: 2.5px solid #f0f4fa;
    flex-shrink: 0;
    margin-top: 3px;
    box-shadow: 0 0 0 2px #e2e6ed;
}
.histo-dot-latest {
    background: #2a7de1;
    box-shadow: 0 0 0 3px #c7dcf8;
}
.histo-entry-connector {
    flex: 1;
    width: 2px;
    background: #e2e6ed;
    margin: 4px 0;
    min-height: 16px;
}
.histo-connector-last { display: none; }

.histo-entry-body {
    flex: 1;
    padding-bottom: 20px;
}
.histo-entry-latest .histo-entry-body {
    background: #f0f6ff;
    border: 1.5px solid #c7dcf8;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 4px;
}
.histo-entry:not(.histo-entry-latest) .histo-entry-body {
    background: #f7f9fc;
    border: 1px solid #e2e6ed;
    border-radius: 9px;
    padding: 10px 14px;
}
.histo-entry-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}
.histo-vbadge-latest {
    background: #2a7de1;
    color: #fff;
}
.histo-vbadge-old {
    background: #e8eaed;
    color: #5a6475;
    font-size: .68rem;
}
.histo-current-tag {
    background: #d5f5e3;
    color: #1e6b3a;
    font-size: .62rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid #a9dfbf;
}
.histo-entry-date, .histo-entry-redacteur {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .68rem;
    color: #8a95a3;
}
.histo-entry-redacteur { margin-left: 4px; }
.histo-entry-desc {
    font-size: .77rem;
    color: #3a4455;
    line-height: 1.5;
    font-style: italic;
}

/* Icône historique */
.ged-action-history {
    background: #f3e8ff;
    color: #7c3aed;
    border-color: #d8b4fe;
}
.ged-action-history:hover { background: #d8b4fe; }

/* Footer */
.histo-footer {
    padding: 12px 22px;
    background: #f7f9fc;
    border-top: 1px solid #e2e6ed;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .histo-current-bar { grid-template-columns: repeat(2, 1fr); }
    .histo-form-grid   { grid-template-columns: 1fr; }
}

/* ── Pièce jointe — champ fichier (partagé Historique + Modifier) ── */
.histo-file-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.histo-file-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #f7f9fc;
    border: 1.5px dashed #c8d0dc;
    border-radius: 8px;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 600;
    color: #5a6475;
    transition: border-color .18s, background .18s;
    flex: 1;
    min-width: 0;
}
.histo-file-label:hover {
    border-color: #2a7de1;
    background: #eef5ff;
    color: #2a7de1;
}
.histo-file-label svg { flex-shrink: 0; }
.histo-file-label span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.histo-file-clear {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fadbd8;
    border: none;
    color: #c0392b;
    font-size: .75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.histo-file-clear:hover { background: #f5b7b1; }
.histo-file-hint {
    font-size: .65rem;
    color: #aab0bc;
    margin-top: 4px;
}

/* Pièce jointe dans la timeline */
.histo-pj-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: .68rem;
    font-weight: 600;
    color: #2a7de1;
    background: #eef5ff;
    border: 1px solid #c7dcf8;
    border-radius: 6px;
    padding: 3px 10px;
    text-decoration: none;
    transition: background .15s;
}
.histo-pj-link:hover { background: #c7dcf8; }

/* Badge version — colonne "Version" de la liste des documents */
.ged-version-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
    color: #6c3483;
    border: 1px solid #d8b4fe;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: .68rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: .5px;
    white-space: nowrap;
}

/* Bouton restaurer une version — modal Historique */
.histo-restore-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    margin-left: 8px;
    font-size: .68rem;
    font-weight: 700;
    color: #6c3483;
    background: #f8f4ff;
    border: 1px solid #d8b4fe;
    border-radius: 6px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: background .15s, color .15s;
}
.histo-restore-btn:hover { background: #6c3483; color: #fff; }

/* Liste de diffusion dans le modal Historique */
.histo-diff-table-wrap {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    margin-top: 4px;
}
.histo-diff-table-wrap .ged-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Circuit de validation dans le modal Historique — version compacte */
.histo-validation-grid { margin-top: 4px; }
.histo-validation-grid .ged-validation-card { min-width: 150px; padding: 12px; }
.histo-validation-grid .ged-valid-role { font-size: .62rem; margin-top: 4px; }
.histo-validation-grid .ged-select { font-size: .75rem; padding: 6px 8px; }
@media (max-width: 860px) {
    .histo-validation-grid { flex-direction: column; align-items: stretch; }
    .histo-validation-grid .ged-valid-arrow { transform: rotate(90deg); align-self: center; }
}

/* Bouton télécharger — page Validation & Approbation */
.gedv-btn-telecharger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    background: #eef5ff;
    color: #1a6fa8;
    border: 1.5px solid #aed6f1;
    transition: all .18s;
}
.gedv-btn-telecharger:hover { background: #aed6f1; }

/* Bouton retour — page Fiche Processus */
.fiche-topbar {
    margin-bottom: 8px;
}
.fiche-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #f0f2f5;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 600;
    color: #3a4455;
    cursor: pointer;
    font-family: inherit;
    transition: all .18s;
}
.fiche-back-btn:hover {
    background: #e2e6ed;
    border-color: #c8d0dc;
    color: #1a2332;
}

/* ============================================================
   MODAL FICHE PROCESSUS — Listes dynamiques & tableau EAS
============================================================ */

/* Boutons + / − génériques */
.fiche-row-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    font-family: inherit;
}
.fiche-row-add  { background: #d5f5e3; color: #1e6b3a; }
.fiche-row-add:hover  { background: #a9dfbf; }
.fiche-row-del  { background: #fadbd8; color: #c0392b; }
.fiche-row-del:hover  { background: #f5b7b1; }

/* Listes Amont / Aval */
.fiche-list-inputs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fiche-list-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.fiche-proc-select {
    flex: 1;
    padding: 7px 10px;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    font-size: .78rem;
    font-family: inherit;
    color: #2d3748;
    background: #fff;
    cursor: pointer;
}
.fiche-proc-select:focus { outline: none; border-color: #2a7de1; }

/* Tableau EAS */
.fiche-eas-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1.5px solid #e2e6ed;
}
.fiche-eas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .78rem;
}
.fiche-eas-table thead th {
    background: #f0f4fa;
    color: #5a6475;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 8px 10px;
    border-bottom: 1.5px solid #e2e6ed;
    white-space: nowrap;
}
.fiche-eas-table tbody td {
    padding: 5px 6px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}
.fiche-eas-table tbody tr:last-child td { border-bottom: none; }
.fiche-eas-input {
    width: 100%;
    padding: 5px 8px;
    border: 1.5px solid #e2e6ed;
    border-radius: 6px;
    font-size: .75rem;
    font-family: inherit;
    color: #2d3748;
    background: #fff;
    box-sizing: border-box;
}
.fiche-eas-input:focus { outline: none; border-color: #2a7de1; background: #f0f6ff; }
.fiche-eas-actions {
    text-align: center;
    white-space: nowrap;
}

/* Indicateurs */
.fiche-ind-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fiche-ind-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.fiche-ind-input {
    padding: 7px 10px;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    font-size: .78rem;
    font-family: inherit;
    color: #2d3748;
    background: #fff;
}
.fiche-ind-input:focus { outline: none; border-color: #2a7de1; }
.fiche-ind-nom { flex: 2; }
.fiche-ind-obj  { flex: 1; }

/* Champ sens indicateur (>, <, =) */
.fiche-ind-sens {
    width: 54px !important;
    flex: none !important;
    text-align: center;
    font-weight: 700;
    font-size: .85rem;
    padding: 7px 4px;
    cursor: pointer;
}

/* Champ unité de mesure indicateur */
.fiche-ind-unite {
    width: 64px !important;
    flex: none !important;
    text-align: center;
    font-weight: 600;
    font-size: .78rem;
    padding: 7px 4px;
    cursor: pointer;
}

/* ── Section Parties intéressées — modal fiche processus ── */
.fiche-pi-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fiche-pi-header {
    display: grid;
    grid-template-columns: 2fr 3fr 30px;
    gap: 8px;
    padding: 0 4px 4px;
}
.fiche-pi-header span {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #aab0bc;
}
.fiche-pi-row {
    display: grid;
    grid-template-columns: 2fr 3fr 30px;
    gap: 8px;
    align-items: center;
}
.fiche-pi-nom, .fiche-pi-prox {
    padding: 7px 10px;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    font-size: .78rem;
    font-family: inherit;
    color: #2d3748;
    background: #fff;
    cursor: pointer;
}
.fiche-pi-nom:focus, .fiche-pi-prox:focus { outline: none; border-color: #2a7de1; }
.fiche-pi-exig {
    padding: 7px 10px;
    border: 1.5px solid #dde2ec;
    border-radius: 8px;
    font-size: .78rem;
    font-family: inherit;
    color: #2d3748;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.fiche-pi-exig:focus { outline: none; border-color: #2a7de1; }

/* Champ type indicateur (Suivi / Performance) */
.fiche-ind-type {
    width: 110px !important;
    flex: none !important;
    font-size: .75rem;
    font-weight: 600;
    padding: 7px 6px;
    cursor: pointer;
}

/* ============================================================
   FOOTER GLOBAL — toutes les pages
============================================================ */
.app-footer {
    background: #1a2332;
    color: #c8d6e5;
    padding: 32px 32px 16px;
    margin-top: 48px;
    border-top: 3px solid #2a7de1;
}
.app-footer-container {
    display: grid;
    /* auto-fit : s'adapte au nombre de sections visibles, le tout centré */
    grid-template-columns: repeat(auto-fit, minmax(200px, max-content));
    justify-content: center;
    gap: 32px 64px;
    max-width: 900px;
    margin: 0 auto 20px;
}
.app-footer-section { text-align: center; }
.app-footer-social { justify-content: center; }
.app-footer-section h3 {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #fff;
    margin: 0 0 10px;
}
.app-footer-section p {
    font-size: .72rem;
    color: #8fa3bb;
    margin: 0 0 5px;
    line-height: 1.5;
}
.app-footer-social {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.app-footer-social a {
    font-size: 1.1rem;
    text-decoration: none;
    opacity: .75;
    transition: opacity .18s;
}
.app-footer-social a:hover { opacity: 1; }
.app-footer-bottom {
    text-align: center;
    font-size: .65rem;
    color: #3d5166;
    border-top: 1px solid #243448;
    padding-top: 14px;
    margin: 0;
}

@media (max-width: 768px) {
    .app-footer-container { grid-template-columns: 1fr; gap: 20px; }
    .app-footer { padding: 24px 16px 12px; }
}

/* ===== PI PROCESSUS MULTI-TAGS ===== */
.pi-proc-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pi-proc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 28px;
    padding: 4px 6px;
    background: #f8fafc;
    border: 1px solid #dde3ed;
    border-radius: 6px;
}
.pi-proc-tags:empty::before {
    content: 'Aucun processus sélectionné';
    color: #b0b8c9;
    font-size: .72rem;
    align-self: center;
}
.pi-proc-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f0fe;
    color: #2563eb;
    border: 1px solid #bfcff8;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .5px;
}
.pi-proc-tag-del {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 700;
    padding: 0;
    line-height: 1;
    opacity: .6;
    transition: opacity .15s;
}
.pi-proc-tag-del:hover { opacity: 1; }
.pi-proc-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pi-proc-controls select {
    flex: 1;
}
.pi-proc-btn {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
    flex-shrink: 0;
}
.pi-proc-btn:active { transform: scale(.93); }
.pi-proc-add {
    background: #2563eb;
    color: #fff;
}
.pi-proc-add:hover { background: #1d4ed8; }
.pi-proc-remove {
    background: #fee2e2;
    color: #dc2626;
}
.pi-proc-remove:hover { background: #fecaca; }

/* Tags dans le tableau */
.pi-proc-tag-cell {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e8f0fe;
    color: #2563eb;
    border: 1px solid #bfcff8;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: .68rem;
    font-weight: 600;
    margin: 1px 2px;
}

/* ===== PI IMPACT CHANGEMENT CLIMATIQUE ===== */
.pi-field-climat {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #6ee7b7;
    border-radius: 8px;
    padding: 10px 12px !important;
    position: relative;
}
.pi-field-climat::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 8px 0 0 8px;
}
.pi-label-climat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600 !important;
    color: #065f46 !important;
    font-size: .75rem !important;
}
.pi-label-climat-icon {
    font-size: 1rem;
    line-height: 1;
}
.pi-select-climat {
    margin-top: 6px;
    border-color: #6ee7b7 !important;
    background: #fff !important;
    color: #065f46 !important;
    font-weight: 600;
}
.pi-select-climat:focus {
    outline: none;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
/* Badge dans le tableau */
.pi-climat-oui {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: .68rem;
    font-weight: 700;
}
.pi-climat-non {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: .68rem;
    font-weight: 700;
}

/* ===== SWOT PARTIE INTÉRESSÉE MULTI-TAGS ===== */
.swot-partie-tag {
    background: #f3e8ff !important;
    color: #7c3aed !important;
    border-color: #c4b5fd !important;
}
.swot-partie-tag .pi-proc-tag-del {
    color: #7c3aed !important;
}
.swot-partie-tag-cell {
    background: #f3e8ff !important;
    color: #7c3aed !important;
    border-color: #c4b5fd !important;
}

/* ===== POLITIQUE QUALITÉ — SECTIONS STRUCTURÉES ===== */
.pq-section {
    margin-bottom: 28px;
}
.pq-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}
.pq-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a2332;
    margin: 0;
    border-bottom: 2px solid #2563eb;
    padding-bottom: 4px;
    flex: 1;
}
.pq-section-intro {
    font-size: .82rem;
    color: #5a6475;
    font-style: italic;
    margin: -4px 0 10px 0;
}
.pq-section-actions {
    display: none;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}
.pq-item-btn {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    border: none;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
    line-height: 1;
}
.pq-item-btn:active { transform: scale(.9); }
.pq-item-add  { background: #2563eb; color: #fff; }
.pq-item-add:hover  { background: #1d4ed8; }
.pq-item-remove { background: #fee2e2; color: #dc2626; }
.pq-item-remove:hover { background: #fecaca; }

/* Items AXE */
.pq-item-axe {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #2563eb;
    background: #f8faff;
}
.pq-item-num {
    min-width: 26px;
    height: 26px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.pq-item-num-edit {
    min-width: 26px;
    height: 26px;
    background: #93c5fd;
    color: #1e3a5f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.pq-item-body { flex: 1; }
.pq-axe-titre {
    font-size: .88rem;
    font-weight: 700;
    color: #1a2332;
    margin: 0 0 4px 0;
}
.pq-axe-desc {
    font-size: .8rem;
    color: #4a5568;
    margin: 0;
    line-height: 1.5;
}

/* Items OBJECTIF */
.pq-item-objectif {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 5px 8px;
    border-radius: 6px;
}
.pq-item-objectif:hover { background: #f1f5f9; }
.pq-obj-puce {
    color: #2563eb;
    font-size: .85rem;
    flex-shrink: 0;
}
.pq-obj-texte {
    font-size: .82rem;
    color: #374151;
    flex: 1;
}

/* Items ENGAGEMENT */
.pq-item-engagement {
    position: relative;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #10b981;
    background: #f0fdf4;
}
.pq-engagement-texte {
    font-size: .82rem;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

/* Inputs en mode édition */
.pq-input-titre {
    width: 100%;
    font-size: .88rem;
    font-weight: 700;
    color: #1a2332;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    padding: 4px 8px;
    margin-bottom: 6px;
    font-family: inherit;
    box-sizing: border-box;
}
.pq-input-desc, .pq-input-engagement, .pq-input-libelle {
    width: 100%;
    font-size: .8rem;
    color: #374151;
    border: 1px solid #93c5fd;
    border-radius: 5px;
    padding: 6px 8px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    line-height: 1.5;
}
.pq-input-libelle {
    border: none;
    border-bottom: 1px solid #93c5fd;
    border-radius: 0;
    padding: 3px 4px;
    background: transparent;
    flex: 1;
}
.pq-input-titre:focus, .pq-input-desc:focus,
.pq-input-engagement:focus, .pq-input-libelle:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.12);
}

/* Bouton supprimer item individuel */
.pq-item-del {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    padding: 0 4px;
    opacity: .5;
    transition: opacity .15s;
    flex-shrink: 0;
    line-height: 1;
}
.pq-item-del:hover { opacity: 1; }

/* Hint vide */
.pq-empty-hint {
    font-size: .78rem;
    color: #94a3b8;
    font-style: italic;
    padding: 8px 0;
}
.pq-diffusion-p {
    font-size: .82rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

/* ===== CARTOGRAPHIE — MODE GESTION ===== */
.carto-bloc {
    position: relative;
}
.carto-bloc-actions {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 10;
}
.carto-gestion-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, border-color .18s;
    backdrop-filter: blur(4px);
}
.carto-gestion-btn:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.5);
}
.carto-gestion-active {
    background: rgba(16,185,129,.25) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

/* Carte en mode gestion */
.carto-cards-gestion {
    padding-right: 80px !important; /* laisser place au bouton Terminer */
}
.carto-card-gestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px !important;
    animation: carto-shake-in .2s ease;
    cursor: default !important;
}
.carto-card-gestion:hover {
    background: rgba(239,68,68,.18) !important;
    border-color: rgba(239,68,68,.5) !important;
    transform: none !important;
    box-shadow: none !important;
}
@keyframes carto-shake-in {
    0%   { transform: scale(.96); opacity:.6; }
    100% { transform: scale(1);   opacity:1; }
}
.carto-card-nom {
    flex: 1;
    font-size: .78rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.carto-del-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(239,68,68,.6);
    background: rgba(239,68,68,.15);
    color: #fca5a5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .1s;
}
.carto-del-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    transform: scale(1.15);
}

/* ===== MODALE CONFIRMATION SUPPRESSION PROCESSUS ===== */
.carto-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,15,25,.55);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: carto-fade-in .18s ease;
}
@keyframes carto-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.carto-modal {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.22);
    animation: carto-slide-up .22s ease;
}
@keyframes carto-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.carto-modal-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
}
.carto-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 12px;
}
.carto-modal-body {
    font-size: .84rem;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 8px;
}
.carto-modal-body strong {
    color: #1a2332;
    font-size: .9rem;
}
.carto-modal-warn {
    display: inline-block;
    margin-top: 6px;
    font-size: .75rem;
    color: #ef4444;
    font-weight: 600;
}
.carto-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}
.carto-modal-btn {
    padding: 9px 24px;
    border-radius: 8px;
    border: none;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.carto-modal-btn:active { transform: scale(.96); }
.carto-modal-cancel {
    background: #f1f5f9;
    color: #374151;
}
.carto-modal-cancel:hover { background: #e2e8f0; }
.carto-modal-confirm {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(239,68,68,.3);
}
.carto-modal-confirm:hover { background: #dc2626; }

/* ===================================================
   PAGE PERMISSIONS — Gestion des accès sidebar
=================================================== */
.perm-wrap {
    padding: 28px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

/* En-tête */
.perm-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.perm-page-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a2332;
    letter-spacing: -.02em;
}
.perm-page-sub {
    font-size: .88rem;
    color: #6b7280;
    margin-top: 4px;
}
.perm-header-actions {
    display: flex;
    gap: 10px;
}

/* Boutons */
.perm-btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: var(--font-primary);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.perm-btn-primary {
    background: var(--accent);
    color: #fff;
}
.perm-btn-primary:hover {
    background: #3a7cc4;
    box-shadow: 0 4px 12px rgba(74,144,217,.28);
}
.perm-btn-ghost {
    background: #fff;
    color: #475569;
    border-color: #e5e7eb;
}
.perm-btn-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Barre d'outils */
.perm-toolbar {
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.perm-tool-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.perm-tool-right {
    margin-left: auto;
}
.perm-tool-label {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
}
.perm-tool-hint {
    font-size: .78rem;
    color: #9ca3af;
    font-style: italic;
}
.perm-select, .perm-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-family: var(--font-primary);
    font-size: .88rem;
    background: #fff;
    min-width: 240px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.perm-select:focus, .perm-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74,144,217,.12);
}

/* Légende */
.perm-legend {
    display: flex;
    gap: 24px;
    padding: 10px 18px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.perm-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    color: #6b7280;
}
.perm-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
}
.perm-dot-admin { background: #fbbf24; box-shadow: 0 0 0 2px rgba(251,191,36,.2); }
.perm-dot-ok    { background: #10b981; }
.perm-dot-ko    { background: #e5e7eb; border: 1px solid #cbd5e1; }

/* Matrice */
.perm-matrix-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: auto;
    max-height: 70vh;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.perm-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .85rem;
}
.perm-matrix thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    color: #334155;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 12px 10px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    z-index: 2;
}
.perm-matrix thead th.perm-th-user {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 260px;
    width: 260px;
}
.perm-matrix thead th.perm-th-group {
    background: linear-gradient(180deg, #eef2f7, #dde4ee);
    color: #1e40af;
    font-size: .72rem;
    border-right: 1px solid #cbd5e1;
}
.perm-matrix thead th.perm-th-item {
    min-width: 110px;
    max-width: 140px;
}
.perm-matrix thead th.perm-th-item .perm-th-rotate {
    display: inline-block;
    transform: rotate(-25deg);
    transform-origin: center;
    white-space: normal;
    line-height: 1.15;
    font-size: .72rem;
    text-transform: none;
    letter-spacing: 0;
}
.perm-matrix tbody tr {
    transition: background .15s;
}
.perm-matrix tbody tr:nth-child(even) { background: #fafbfc; }
.perm-matrix tbody tr:hover { background: #f2f6ff; }
.perm-matrix tbody tr.perm-row-admin { background: #fffbeb; }
.perm-matrix tbody tr.perm-row-admin:hover { background: #fef3c7; }

.perm-matrix td {
    padding: 10px 8px;
    border-bottom: 1px solid #eef2f7;
    text-align: center;
    vertical-align: middle;
}
.perm-matrix td.perm-td-user {
    text-align: left;
    position: sticky;
    left: 0;
    background: inherit;
    border-right: 1px solid #e5e7eb;
    z-index: 1;
    min-width: 260px;
    width: 260px;
    padding: 10px 14px;
}

/* Cellule utilisateur */
.perm-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.perm-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6c9fd8);
    color: #fff;
    font-weight: 700;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.perm-user-avatar.perm-avatar-admin {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}
.perm-user-info { min-width: 0; flex: 1; overflow: hidden; }
.perm-user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.perm-user-role {
    font-size: .72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin-top: 2px;
}
.perm-user-role.perm-role-admin { color: #b45309; font-weight: 700; }

/* Colonne "Tout" */
.perm-td-all {
    border-right: 1px solid #e5e7eb;
    background: rgba(74,144,217,.04);
}

/* Checkbox personnalisée */
.perm-check {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    cursor: pointer;
    user-select: none;
}
.perm-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.perm-check .perm-box {
    position: absolute;
    inset: 0;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    transition: all .18s;
}
.perm-check:hover .perm-box { border-color: var(--accent); }
.perm-check input:checked ~ .perm-box {
    background: #10b981;
    border-color: #10b981;
}
.perm-check input:checked ~ .perm-box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.perm-check input:disabled ~ .perm-box {
    background: #fbbf24;
    border-color: #f59e0b;
    cursor: not-allowed;
}
.perm-check input:disabled ~ .perm-box::after {
    content: '🔒';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: .6rem;
    border: none;
    width: auto;
    height: auto;
}

/* Boîte d'info */
.perm-info-box {
    margin-top: 20px;
    padding: 16px 20px;
    background: #eff6ff;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    font-size: .85rem;
    color: #1e3a5f;
}
.perm-info-box strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}
.perm-info-box ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.7;
}
.perm-info-box li { margin-bottom: 2px; }

/* Responsive */
@media (max-width: 768px) {
    .perm-wrap { padding: 16px; }
    .perm-page-header { flex-direction: column; }
    .perm-toolbar { flex-direction: column; align-items: stretch; }
    .perm-tool-right { margin-left: 0; }
    .perm-select, .perm-input { min-width: 100%; width: 100%; }
}

/* État "masqué par permissions" pour la sidebar */
.perm-hidden { display: none !important; }

/* ===================================================
   AMÉLIORATION VISIBILITÉ — Tableaux "Synthèse des indicateurs"
   Cible DEUX tableaux à structure identique :
   - #tdb-tableau     (page "Tableau de bord")
   - #tableau-kpi     (page "Dashboard")
=================================================== */

/* Conteneurs scrollables — overflow-y visible pour les dropdowns emoji */
.tdb-table-scroll,
.kpi-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    width: 100%;
}
.tdb-table-bloc { position: relative; }

/* Scrollbar plus visible */
.tdb-table-scroll::-webkit-scrollbar,
.kpi-table-scroll::-webkit-scrollbar { height: 10px; }
.tdb-table-scroll::-webkit-scrollbar-track,
.kpi-table-scroll::-webkit-scrollbar-track { background: #f1f4f8; border-radius: 5px; }
.tdb-table-scroll::-webkit-scrollbar-thumb,
.kpi-table-scroll::-webkit-scrollbar-thumb { background: #c5cdd8; border-radius: 5px; }
.tdb-table-scroll::-webkit-scrollbar-thumb:hover,
.kpi-table-scroll::-webkit-scrollbar-thumb:hover { background: #9aa5b5; }

/* Tableau : largeur minimum + police lisible */
#tdb-tableau,
#tableau-kpi {
    min-width: 2000px;
    border-collapse: collapse;
    font-size: .72rem;
    table-layout: fixed;
}

/* En-têtes : fond sombre lisible, police fixe */
#tdb-tableau thead th,
#tableau-kpi thead th {
    background: linear-gradient(135deg, #1a2332, #243447);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 10px 6px;
    text-align: center;
    white-space: nowrap;
    border: 1px solid #2c4a6e;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Largeurs dédiées à chaque type de colonne
   Ordre : Processus | Pilote | Indicateurs | Rés/Obj | Seuil
         | Jan Fev Mars T1 | Avr Mai Juin T2 | Juil Aout Sept T3 | Oct Nov Dec T4
         | Bilan | Actions
*/
#tdb-tableau thead th:nth-child(1),  #tableau-kpi thead th:nth-child(1)  { width: 230px; }
#tdb-tableau thead th:nth-child(2),  #tableau-kpi thead th:nth-child(2)  { width: 100px; }
#tdb-tableau thead th:nth-child(3),  #tableau-kpi thead th:nth-child(3)  { width: 220px; }
#tdb-tableau thead th:nth-child(4),  #tableau-kpi thead th:nth-child(4)  { width: 92px;  }
#tdb-tableau thead th:nth-child(5),  #tableau-kpi thead th:nth-child(5)  { width: 42px;  }
/* Mois (colonnes 6 à 21, largeur homogène) */
#tdb-tableau thead th:nth-child(n+6):nth-child(-n+21),
#tableau-kpi thead th:nth-child(n+6):nth-child(-n+21) { width: 84px; }
/* Trimestres (T1, T2, T3, T4 - positions 9, 13, 17, 21) */
#tdb-tableau thead th:nth-child(9),  #tableau-kpi thead th:nth-child(9),
#tdb-tableau thead th:nth-child(13), #tableau-kpi thead th:nth-child(13),
#tdb-tableau thead th:nth-child(17), #tableau-kpi thead th:nth-child(17),
#tdb-tableau thead th:nth-child(21), #tableau-kpi thead th:nth-child(21) {
    width: 72px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: #fff;
    font-size: .62rem;
}
#tdb-tableau thead th:nth-child(22), #tableau-kpi thead th:nth-child(22) { width: 68px; }
#tdb-tableau thead th:nth-child(23), #tableau-kpi thead th:nth-child(23) { width: 78px; }

/* Cellules du corps */
#tdb-tableau tbody td,
#tableau-kpi tbody td {
    font-size: .72rem;
    padding: 7px 5px;
    border: 1px solid #e8eaed;
    text-align: center;
    vertical-align: middle;
    background: #fff;
    line-height: 1.35;
    white-space: nowrap;
}

/* Cellules mois (colonnes 6-8, 10-12, 14-16, 18-20) : ellipsis si dépassement */
#tdb-tableau tbody td:nth-child(6),  #tableau-kpi tbody td:nth-child(6),
#tdb-tableau tbody td:nth-child(7),  #tableau-kpi tbody td:nth-child(7),
#tdb-tableau tbody td:nth-child(8),  #tableau-kpi tbody td:nth-child(8),
#tdb-tableau tbody td:nth-child(10), #tableau-kpi tbody td:nth-child(10),
#tdb-tableau tbody td:nth-child(11), #tableau-kpi tbody td:nth-child(11),
#tdb-tableau tbody td:nth-child(12), #tableau-kpi tbody td:nth-child(12),
#tdb-tableau tbody td:nth-child(14), #tableau-kpi tbody td:nth-child(14),
#tdb-tableau tbody td:nth-child(15), #tableau-kpi tbody td:nth-child(15),
#tdb-tableau tbody td:nth-child(16), #tableau-kpi tbody td:nth-child(16),
#tdb-tableau tbody td:nth-child(18), #tableau-kpi tbody td:nth-child(18),
#tdb-tableau tbody td:nth-child(19), #tableau-kpi tbody td:nth-child(19),
#tdb-tableau tbody td:nth-child(20), #tableau-kpi tbody td:nth-child(20) {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colonnes sticky : on fige les 3 premières pour garder le contexte au scroll */
#tdb-tableau tbody td:nth-child(1),
#tableau-kpi tbody td:nth-child(1) { /* Processus */
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #1a2332;
    white-space: normal;
    word-break: break-word;
    border-right: 2px solid #c5cdd8;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
}
#tdb-tableau tbody td:nth-child(2),
#tableau-kpi tbody td:nth-child(2) { /* Pilote */
    position: sticky;
    left: 230px;
    z-index: 3;
    background: #f0f4f8;
    font-weight: 700;
    color: #1a2332;
    border-right: 1px solid #dde2ec;
}
#tdb-tableau tbody td:nth-child(3),
#tableau-kpi tbody td:nth-child(3) { /* Indicateurs */
    position: sticky;
    left: 330px;
    z-index: 3;
    background: #fff;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #1a2332;
    white-space: normal;
    word-break: break-word;
    border-right: 2px solid #c5cdd8;
    box-shadow: 2px 0 4px rgba(0,0,0,.04);
}
#tdb-tableau tbody td:nth-child(3).rouge,
#tableau-kpi tbody td:nth-child(3).rouge { color: #c0392b !important; }

/* Lignes alternées */
#tdb-tableau tbody tr:nth-child(4n+1) td, #tableau-kpi tbody tr:nth-child(4n+1) td,
#tdb-tableau tbody tr:nth-child(4n+2) td, #tableau-kpi tbody tr:nth-child(4n+2) td { background: #fafbfc; }
#tdb-tableau tbody tr:nth-child(4n+1) td:nth-child(1), #tableau-kpi tbody tr:nth-child(4n+1) td:nth-child(1),
#tdb-tableau tbody tr:nth-child(4n+1) td:nth-child(3), #tableau-kpi tbody tr:nth-child(4n+1) td:nth-child(3),
#tdb-tableau tbody tr:nth-child(4n+2) td:nth-child(1), #tableau-kpi tbody tr:nth-child(4n+2) td:nth-child(1),
#tdb-tableau tbody tr:nth-child(4n+2) td:nth-child(3), #tableau-kpi tbody tr:nth-child(4n+2) td:nth-child(3) { background: #fafbfc; }
#tdb-tableau tbody tr:nth-child(4n+1) td:nth-child(2), #tableau-kpi tbody tr:nth-child(4n+1) td:nth-child(2),
#tdb-tableau tbody tr:nth-child(4n+2) td:nth-child(2), #tableau-kpi tbody tr:nth-child(4n+2) td:nth-child(2) { background: #e9eef5; }

/* Lignes "Résultat" / "Objectif" */
#tdb-tableau .td-label-res,
#tableau-kpi .td-label-res {
    background: linear-gradient(135deg, #eaf4fb, #d6eaf8) !important;
    color: #1a5276 !important;
    font-weight: 700;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .3px;
}
#tdb-tableau .td-label-obj,
#tableau-kpi .td-label-obj {
    background: linear-gradient(135deg, #fdf5e6, #faebd7) !important;
    color: #8a6d3b !important;
    font-weight: 700;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Séparation entre blocs Résultat/Objectif */
#tdb-tableau tbody tr.tr-resultat td,
#tableau-kpi tbody tr.tr-resultat td { border-top: 2px solid #c5cdd8; }

/* Colonne Seuil */
#tdb-tableau .td-seuil,
#tableau-kpi .td-seuil {
    background: #e8f0f8 !important;
    border-left: 2px solid #b8c8d8 !important;
    border-right: 2px solid #b8c8d8 !important;
    padding: 2px !important;
}
#tdb-tableau .td-seuil-readonly,
#tableau-kpi .td-seuil-readonly {
    color: #8a95a3 !important;
    background: #eef1f5 !important;
}

/* Colonnes trimestres (T1..T4) : fond distinct, overflow visible pour dropdown emoji */
#tdb-tableau tbody td:nth-child(9),  #tableau-kpi tbody td:nth-child(9),
#tdb-tableau tbody td:nth-child(13), #tableau-kpi tbody td:nth-child(13),
#tdb-tableau tbody td:nth-child(17), #tableau-kpi tbody td:nth-child(17),
#tdb-tableau tbody td:nth-child(21), #tableau-kpi tbody td:nth-child(21) {
    background: #eef4fa;
    border-left: 1px solid #c5cdd8;
    border-right: 1px solid #c5cdd8;
    overflow: visible;
    position: relative;
}
/* Bilan */
#tdb-tableau tbody td:nth-child(22),
#tableau-kpi tbody td:nth-child(22) {
    background: #f5eef8;
    font-weight: 700;
    border-left: 2px solid #b8a5c8;
    overflow: visible;
    position: relative;
}

/* ===== EMOJI PICKER dans les 2 tableaux ===== */
#tdb-tableau .emoji-picker,
#tableau-kpi .emoji-picker {
    position: relative;
    display: inline-block;
    width: 100%;
}
#tdb-tableau .emoji-picker .emoji-selected,
#tableau-kpi .emoji-picker .emoji-selected {
    font-size: 1.3rem;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-block;
    min-width: 36px;
    text-align: center;
    user-select: none;
    background: rgba(255,255,255,.6);
}
#tdb-tableau .emoji-picker .emoji-selected:hover,
#tableau-kpi .emoji-picker .emoji-selected:hover {
    border-color: #b8c8d8;
    background: #fff;
}
#tdb-tableau .emoji-picker .emoji-selected.vide,
#tableau-kpi .emoji-picker .emoji-selected.vide {
    font-size: .85rem;
    color: #aaa;
    background: transparent;
}
#tdb-tableau .emoji-dropdown,
#tableau-kpi .emoji-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    padding: 6px 8px;
    z-index: 9999;
    white-space: nowrap;
    flex-direction: row;
    gap: 4px;
}
#tdb-tableau .emoji-dropdown.open,
#tableau-kpi .emoji-dropdown.open { display: flex; }
#tdb-tableau .emoji-option,
#tableau-kpi .emoji-option {
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background .15s;
}
#tdb-tableau .emoji-option:hover,
#tableau-kpi .emoji-option:hover { background: #f0f0f0; }

/* Fallback <select.big-select> */
#tdb-tableau .big-select,
#tableau-kpi .big-select {
    font-size: 1.1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 0;
}

/* Colonne Actions figée à droite */
#tdb-tableau tbody td.td-actions-kpi,
#tableau-kpi tbody td.td-actions-kpi {
    position: sticky;
    right: 0;
    z-index: 3;
    background: #f0f4f8 !important;
    border-left: 2px solid #c5cdd8 !important;
    box-shadow: -2px 0 4px rgba(0,0,0,.04);
    padding: 6px !important;
    width: 78px;
    min-width: 78px;
    overflow: visible;
}
#tdb-tableau thead th.th-actions,
#tableau-kpi thead th.th-actions {
    position: sticky;
    right: 0;
    z-index: 6;
    box-shadow: -2px 0 4px rgba(0,0,0,.04);
}

/* Cellules "grises" */
#tdb-tableau td.gris,
#tableau-kpi td.gris {
    background: repeating-linear-gradient(45deg, #f8f9fa, #f8f9fa 4px, #eef0f3 4px, #eef0f3 8px) !important;
}

/* Boutons d'action */
#tdb-tableau .actions-kpi-wrap,
#tableau-kpi .actions-kpi-wrap {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
}
#tdb-tableau .icon-btn,
#tableau-kpi .icon-btn {
    width: 28px;
    height: 28px;
    padding: 4px;
}
#tdb-tableau .icon-btn svg,
#tableau-kpi .icon-btn svg { width: 16px; height: 16px; }

/* Responsive */
@media (max-width: 768px) {
    #tdb-tableau, #tableau-kpi { min-width: 1400px; font-size: .75rem; }
    #tdb-tableau tbody td, #tableau-kpi tbody td { font-size: .75rem; }
    /* Désactive le sticky horizontal sur mobile (trop lourd) */
    #tdb-tableau tbody td:nth-child(1), #tableau-kpi tbody td:nth-child(1),
    #tdb-tableau tbody td:nth-child(2), #tableau-kpi tbody td:nth-child(2),
    #tdb-tableau tbody td:nth-child(3), #tableau-kpi tbody td:nth-child(3),
    #tdb-tableau tbody td.td-actions-kpi, #tableau-kpi tbody td.td-actions-kpi,
    #tdb-tableau thead th.th-actions, #tableau-kpi thead th.th-actions { position: static; box-shadow: none; }
}

/* ============================================
   Colonne ID auto-numérotée (Dashboard)
   ============================================ */
.th-id,
.td-id {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #6b7280;
    background-color: #f9fafb;
}
.th-id {
    color: #374151;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}
.td-id {
    font-variant-numeric: tabular-nums;
    user-select: none;
}

/* ============================================
   Colonnes d'icônes compactes (Dashboard)
   Cible les 4 tableaux marqués data-id-auto="true" :
   - tableau-actions-kpi
   - DOCUMENT DU PROCESSUS
   - BILAN DES AUDITS
   - Liste des actions
   Réduit la largeur des 3 dernières colonnes (Ajouter/Modifier/Supprimer)
   et resserre les boutons icônes pour libérer de l'espace
   pour les colonnes de contenu.
   ============================================ */
table[data-id-auto="true"] thead th:not([colspan]):nth-last-child(-n+3),
table[data-id-auto="true"] tbody td:nth-last-child(-n+3) {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
}
table[data-id-auto="true"] tbody td:nth-last-child(-n+3) .icon-btn {
    width: 26px;
    height: 26px;
    padding: 3px;
}
table[data-id-auto="true"] tbody td:nth-last-child(-n+3) .icon-btn svg {
    width: 14px;
    height: 14px;
}
/* Sur l'effet de survol on retire le scale pour éviter le débordement
   dans une colonne maintenant étroite */
table[data-id-auto="true"] tbody td:nth-last-child(-n+3) .icon-btn:hover {
    transform: none;
}

/* ============================================
   Bouton d'ajout dans une section-title
   (fond sombre du bandeau → bouton clair)
   Aligné à droite, juste à côté du bouton toggle
   ============================================ */
.section-title-btn {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.12) !important;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 8px;
}
.section-title-btn:hover {
    background: rgba(46, 204, 113, 0.35) !important;
    color: #fff !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ===================================================
   REGLES DE TENDANCE TRIMESTRIELLE
   (utilise par les pages Dashboard et Tableau de bord)
=================================================== */

/* Wrapper "carte" specifique a la page Tableau de bord —
   raccord stylistique avec les .tdb-resume-card de cette page */
.tdb-tendance-card {
    background:#fff; border-radius:14px; border:1px solid #eaecf0;
    box-shadow:0 2px 8px rgba(0,0,0,.05);
    padding:18px 20px; margin-bottom:24px;
}

.tendance-intro { font-size:.88rem; line-height:1.55; color:#444; margin:4px 0 16px; }
.tendance-intro strong { color:#1a2332; }

.tendance-grid {
    display:grid;
    grid-template-columns: minmax(320px, 1fr) minmax(280px, 1fr);
    gap:24px;
    align-items:start;
    margin-bottom:18px;
}

.tendance-table { width:100%; border-collapse:collapse; font-size:.82rem; }
.tendance-table th,
.tendance-table td { border:1px solid #cfd4dc; text-align:center; padding:6px; height:44px; background:#fff; }
.tendance-table thead th {
    background:linear-gradient(135deg,#f0f2f5,#e6e9ef);
    font-weight:600; color:#2c3e50; padding:8px 6px;
}
.tendance-table .tendance-rowlabel {
    background:#fafbfc; font-weight:600; color:#2c3e50;
    width:90px;
}

/* Emoji de tendance : 😊 (vert) / 😐 (jaune) / 😡 (rouge)
   Le filtre sur "content" est identique a celui des selects de tendance
   du tableau KPI pour une harmonisation parfaite. */
.emoji-tendance {
    display:inline-block; font-size:1.4rem; line-height:1;
    vertical-align:middle; user-select:none;
}
.emoji-tendance.sm { font-size:1.1rem; }
.emoji-tendance[data-val="content"] { filter:hue-rotate(70deg) saturate(1.4); }

.tendance-examples { display:flex; flex-direction:column; gap:14px; }
.tendance-example-block {
    background:#fafbfc; border:1px solid #e3e6eb; border-radius:8px;
    padding:12px 14px;
}
.tendance-example-title { font-weight:600; color:#1a2332; font-size:.85rem; margin-bottom:6px; }
.tendance-example-block ul { list-style:none; padding:0; margin:0; font-size:.82rem; color:#444; line-height:1.9; }
.tendance-example-block li { display:flex; align-items:center; gap:8px; }
.tendance-example-result { margin-top:6px; padding-top:6px; border-top:1px dashed #d0d4da; font-weight:600; color:#1a2332; }
.tendance-note { font-size:.78rem; color:#666; font-style:italic; margin:0; }

.tendance-rules {
    display:flex; flex-direction:column; gap:10px;
    background:#fff8e1; border-left:4px solid #f59e0b;
    border-radius:6px; padding:14px 16px;
}
.tendance-rule {
    display:flex; align-items:flex-start; gap:10px;
    font-size:.85rem; line-height:1.55; color:#3a3a3a;
}
.tendance-rule strong { color:#1a2332; }

/* Responsive : sur petit ecran on empile */
@media (max-width: 900px) {
    .tendance-grid { grid-template-columns: 1fr; }
}

/* ===================================================
   RESPONSIVE GLOBAL — SMARTPHONES & TABLETTES
   (complément transversal appliqué à toute l'app)
=================================================== */

/* ── Tablette (jusqu'à 1024px) ── */
@media screen and (max-width: 1024px) {
    .main-body { padding: 16px; }
    .modal { width: 92%; max-width: 92%; }
}

/* ── Mobile / tablette portrait (jusqu'à 768px) ── */
@media screen and (max-width: 768px) {
    .main-body { padding: 12px 10px; }
    .topbar { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
    .topbar-title { font-size: .82rem; }
    .topbar-processus-chip { max-width: 140px; }
    .topbar-actions { gap: 6px; }

    /* Modales : plein écran confortable, scroll interne */
    .modal-overlay { padding: 10px; }
    .modal { max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

    /* Filtres empilés */
    .filtre-bar { padding: 10px 12px; gap: 10px; }
    .filtre-field { min-width: 100%; }

    /* Champs de formulaire : 16px minimum pour éviter
       le zoom automatique sur iOS */
    .modal-field input, .modal-field select, .modal-field textarea,
    .filtre-field select, .filtre-field input[type="date"] { font-size: 16px; }

    /* Cibles tactiles plus grandes dans la sidebar */
    .nav-item, .nav-group-toggle { padding: 12px 10px; }
    .nav-subitem { padding: 10px 10px 10px 52px; }
}

/* ── Petit mobile (jusqu'à 480px) ── */
@media screen and (max-width: 480px) {
    .main-body { padding: 10px 8px; }
    .topbar-btn { padding: 5px 8px; font-size: .62rem; }
    .tdb-kpi-row { grid-template-columns: 1fr; }
    .tdb-kpi-card { padding: 14px 16px; }
    .modal { padding: 16px 14px; }
    .modal-footer { flex-direction: column-reverse; gap: 8px; }
    .modal-footer .modal-btn { width: 100%; }
    .modal-confirm-actions { flex-direction: column-reverse; gap: 8px; }
    .modal-confirm-actions .modal-btn { width: 100%; }
}
