:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --text-primary: #1a1d20;
    --text-secondary: #5f5e5a;
    --text-tertiary: #9b9994;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-strong: rgba(0, 0, 0, 0.18);
    --info-bg: #e6f1fb; --info-text: #0c447c; --info-accent: #185fa5;
    --warning-bg: #faeeda; --warning-text: #854f0b; --warning-accent: #ba7517;
    --success-bg: #e1f5ee; --success-text: #0f6e56; --success-accent: #1d9e75;
    --coral-bg: #faece7; --coral-text: #993c1d; --coral-accent: #d85a30;
    --neutral-bg: #f1efe8; --neutral-text: #444441; --neutral-accent: #888780;
    --danger-bg: #fceaea; --danger-text: #a32d2d; --danger-accent: #c4423a;
    --purple-bg: #f3e8ff; --purple-text: #6b21a8; --purple-accent: #9333ea;
    --card-edit-bg: rgba(230, 241, 251, 0.4);
    --scrollbar-thumb: rgba(0, 0, 0, 0.25);
    --scrollbar-track: rgba(0, 0, 0, 0.04);
    --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
    /* Palette CATEGORIELLE (identites : tranches, familles, postes) - decalee des
       accents d'etat ET sure pour le daltonisme (base Okabe-Ito) : les paires
       les plus utilisees (1-2, 1-3) different en teinte ET en luminosite. */
    --cat-1: #0072b2; --cat-2: #e69f00; --cat-3: #56b4e9;
    --cat-4: #cc79a7; --cat-5: #9467bd; --cat-6: #64748b;
    /* Couleurs de phase (consommees par PHASE_COLORS dans app.js) */
    --ph-cep-bg: #faeeda; --ph-cep-text: #854f0b; --ph-cep-accent: #ba7517;
    --ph-ca-bg: #e6f1fb;  --ph-ca-text: #0c447c;  --ph-ca-accent: #185fa5;
    --ph-cpr-bg: #e0f2f1; --ph-cpr-text: #0b5e55; --ph-cpr-accent: #159b8a;
    --ph-cl-bg: #e9e8fb;  --ph-cl-text: #3730a3;  --ph-cl-accent: #5a54d6;
    --ph-os-bg: #faece7;  --ph-os-text: #993c1d;  --ph-os-accent: #d85a30;
    --ph-clo-bg: #e1f5ee; --ph-clo-text: #0f6e56; --ph-clo-accent: #1d9e75;
    --radius-xs: 4px; --radius-pill: 999px;
  }
  [data-theme="dark"] {
    --bg-primary: #1c1f24;
    --bg-secondary: #14171b;
    --bg-tertiary: #0f1216;
    --text-primary: #e8e6e1;
    --text-secondary: #aeacaa;
    --text-tertiary: #707070;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-color-strong: rgba(255, 255, 255, 0.18);
    --info-bg: #18324f; --info-text: #a8cdef; --info-accent: #3b82c4;
    --warning-bg: #3a2a14; --warning-text: #e8c082; --warning-accent: #d99843;
    --success-bg: #143729; --success-text: #88d6b8; --success-accent: #3ec896;
    --coral-bg: #3d1f15; --coral-text: #f0a283; --coral-accent: #e87a52;
    --neutral-bg: #2a2925; --neutral-text: #bcbcb8; --neutral-accent: #999893;
    --danger-bg: #3a1c1c; --danger-text: #ec9292; --danger-accent: #de6357;
    --purple-bg: #2d1d44; --purple-text: #d4adee; --purple-accent: #b063ed;
    --card-edit-bg: rgba(24, 50, 79, 0.4);
    --scrollbar-thumb: rgba(255, 255, 255, 0.18);
    --scrollbar-track: rgba(255, 255, 255, 0.04);
    --cat-1: #3f97d9; --cat-2: #f2b23e; --cat-3: #8fd4ff;
    --cat-4: #e59fc6; --cat-5: #b592e0; --cat-6: #94a3b8;
    --ph-cep-bg: #3a2a14; --ph-cep-text: #e8c082; --ph-cep-accent: #d99843;
    --ph-ca-bg: #18324f;  --ph-ca-text: #a8cdef;  --ph-ca-accent: #3b82c4;
    --ph-cpr-bg: #12343a; --ph-cpr-text: #7fd6c9; --ph-cpr-accent: #2ba898;
    --ph-cl-bg: #232047;  --ph-cl-text: #b9b4f0;  --ph-cl-accent: #7d76e8;
    --ph-os-bg: #3d1f15;  --ph-os-text: #f0a283;  --ph-os-accent: #e87a52;
    --ph-clo-bg: #143729; --ph-clo-text: #88d6b8; --ph-clo-accent: #3ec896;
  }
  /* Scrollbar styling (works in WebKit + Firefox) */
  * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: var(--scrollbar-track); }
  *::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb); border-radius: var(--radius-sm);
    border: 2px solid var(--scrollbar-track);
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--border-color-strong); }
  *::-webkit-scrollbar-corner { background: var(--scrollbar-track); }
  /* Field modified during current edit session - visual indicator */
  .field-modified-session {
    background: rgba(186, 117, 23, 0.07) !important;
    border-color: var(--warning-accent) !important;
    box-shadow: 0 0 0 1px rgba(186, 117, 23, 0.18) !important;
  }
  .field-modified-session:focus { box-shadow: 0 0 0 2px rgba(186, 117, 23, 0.30) !important; }

  /* Validation : champ invalide */
  .field-invalid {
    border-color: var(--danger-accent) !important;
    background: rgba(196, 66, 58, 0.06) !important;
    box-shadow: 0 0 0 1px rgba(196, 66, 58, 0.25) !important;
  }
  .field-invalid:focus { box-shadow: 0 0 0 2px rgba(196, 66, 58, 0.35) !important; }
  .field-error-msg {
    font-size: 11px;
    color: var(--danger-text);
    margin-top: 2px;
    font-style: italic;
  }

  /* ============== BILAN PRINT (aperçu PDF) ============== */
  /* Overlay plein écran qui affiche la page bilan en mode preview */
  .bilan-preview-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(20, 22, 30, 0.65);
    z-index: 9000;
    display: flex; flex-direction: column;
    backdrop-filter: blur(4px);
  }
  .bilan-preview-toolbar {
    background: #1c2330;
    color: #fff;
    padding: 10px 20px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 2;
  }
  .bilan-preview-toolbar-left {
    display: flex; align-items: center; gap: 10px;
    font-weight: 500; font-size: 14px;
  }
  .bilan-preview-toolbar-left i { font-size: 20px; color: #6db3f2; }
  .bilan-preview-toolbar-right {
    display: flex; gap: 10px; align-items: center;
  }
  .bilan-preview-toolbar-right .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
  }
  .bilan-preview-toolbar-right .btn-primary {
    background: #1c4e80;
    color: #fff;
    border-color: #1c4e80;
  }
  .bilan-preview-toolbar-right .btn-primary:hover {
    background: #245d96;
  }
  .bilan-preview-toolbar-right .btn-ghost {
    background: transparent;
    color: #ccc;
    border-color: #4a5568;
  }
  .bilan-preview-toolbar-right .btn-ghost:hover {
    background: rgba(255,255,255,0.08);
  }
  .bilan-preview-scroller {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex; justify-content: center;
  }

  /* La page bilan : format A4 (21 cm × 29.7 cm), couleurs Axentia */
  .bilan-print-page {
    width: 21cm; min-height: 29.7cm; background: #fff; color: #2b2b2b;
    font-family: 'Segoe UI', Calibri, Arial, sans-serif; font-size: 10pt;
    padding: 1.4cm 1.6cm; box-shadow: 0 4px 24px rgba(0,0,0,0.4); box-sizing: border-box;
  }
  .bilan-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2px; }
  .bilan-title-block { flex: 1; }
  .bilan-title { font-size: 16.5pt; font-weight: 700; color: #1F3A5F; margin: 0; letter-spacing: 0.3px; }
  .bilan-subtitle { font-size: 10pt; color: #7A7A7A; margin: 2px 0 0; }
  .bilan-logo { height: 40px; width: auto; }
  .bilan-date-block { text-align: right; font-size: 9pt; color: #7A7A7A; margin: 2px 0 12px; }
  .bilan-date-block b { color: #1F3A5F; font-weight: 700; }

  /* Bandeau de section : navy plein */
  .bilan-section-header { background: #1F3A5F; color: #fff; font-weight: 700; font-size: 10pt; padding: 7px 12px; margin-top: 12px; letter-spacing: 0.3px; display: flex; justify-content: space-between; align-items: center; }
  .bilan-section-header .bsh-cols { display: flex; }
  .bilan-section-header .bsh-m { width: 120px; text-align: right; font-size: 9pt; }
  .bilan-section-header .bsh-p { width: 64px; text-align: right; font-size: 9pt; }

  /* Sous-bandeau : beige */
  .bilan-subsection-header { background: #F4F1EA; color: #1F3A5F; font-weight: 700; font-size: 9.5pt; padding: 5px 12px; letter-spacing: 0.2px; margin-top: 2px; }

  .bilan-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .bilan-table td { padding: 4px 12px; border-bottom: 1px solid #ececec; vertical-align: top; }
  .bilan-table td.bilan-libelle-indent { padding-left: 26px; color: #333; }
  .bilan-table td.bilan-libelle { color: #1F3A5F; }
  .bilan-table td.bilan-montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; width: 120px; color: #1F3A5F; }
  .bilan-table td.bilan-pct { text-align: right; font-variant-numeric: tabular-nums; color: #7A7A7A; width: 64px; }

  /* Sous-total de bloc : texte navy gras, filet au-dessus, sans fond (comme l'Excel) */
  .bilan-table tr.bilan-subtotal td { color: #1F3A5F; font-weight: 700; border-top: 1.5px solid #1F3A5F; border-bottom: none; padding-top: 5px; padding-bottom: 5px; }

  /* Totaux Dépenses / Financement : bandeau navy plein */
  .bilan-table tr.bilan-total-navy td { background: #1F3A5F; color: #fff; font-weight: 700; border-bottom: none; padding-top: 7px; padding-bottom: 7px; }
  .bilan-table tr.bilan-total-navy td.bilan-montant, .bilan-table tr.bilan-total-navy td.bilan-pct { color: #fff; }
  /* Prix de revient opération : bandeau or */
  .bilan-table tr.bilan-total-gold td { background: #C9A961; color: #fff; font-weight: 700; border-bottom: none; padding-top: 8px; padding-bottom: 8px; font-size: 10pt; }
  .bilan-table tr.bilan-total-gold td.bilan-montant, .bilan-table tr.bilan-total-gold td.bilan-pct { color: #fff; }

  /* Identification : grille clé(beige)/valeur 2 colonnes */
  .bilan-id-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; border: 1px solid #ececec; border-top: none; }
  .bilan-id-grid .bik { background: #F4F1EA; color: #1F3A5F; font-weight: 700; padding: 5px 12px; font-size: 9.5pt; border-bottom: 1px solid #fff; white-space: nowrap; }
  .bilan-id-grid .biv { color: #1F3A5F; padding: 5px 12px; font-size: 9.5pt; border-bottom: 1px solid #ececec; }

  .bilan-equilibre { margin-top: 10px; padding: 6px 12px; text-align: right; font-size: 10pt; font-weight: 700; color: #1F3A5F; border-top: 1.5px solid #1F3A5F; }
  .bilan-equilibre-ok { color: #1F3A5F; }
  .bilan-equilibre-ko { color: #c4423a; }
  .bilan-footer { margin-top: 22px; text-align: center; font-size: 8pt; font-style: italic; color: #A0A0A0; border-top: 1px solid #ececec; padding-top: 8px; }
  .bilan-tranches-legend { margin: 6px 0; padding: 7px 12px; background: #F4F1EA; border-left: 3px solid #1F3A5F; font-size: 9pt; color: #555; }
  .bilan-tranches-legend strong { color: #1F3A5F; }

  /* ============== MODE PRINT ============== */
  @media print {
    /* Masquer tout sauf la page bilan */
    body * { visibility: hidden; }
    .bilan-preview-overlay,
    .bilan-preview-overlay * { visibility: visible; }
    .bilan-preview-overlay {
      position: absolute !important;
      top: 0 !important; left: 0 !important; right: auto !important; bottom: auto !important;
      background: #fff !important;
      backdrop-filter: none !important;
      display: block !important;
    }
    .no-print { display: none !important; }
    .bilan-preview-scroller {
      padding: 0 !important;
      overflow: visible !important;
      display: block !important;
    }
    .bilan-print-page {
      width: 100% !important;
      min-height: auto !important;
      padding: 0 !important;
      box-shadow: none !important;
      page-break-inside: avoid;
    }
    /* Format A4 portrait */
    @page {
      size: A4 portrait;
      margin: 1.2cm;
    }
    /* Forcer l'impression des couleurs de fond */
    * {
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
    }
  }

  /* ============== MODAL SÉLECTION TRANCHES ============== */
  .bilan-tranches-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(20,22,30,0.55);
    z-index: 9100;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(2px);
  }
  .bilan-tranches-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    width: 480px; max-width: 92vw;
    max-height: 85vh;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .bilan-tranches-modal-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600;
  }
  .bilan-tranches-modal-head .bilan-tranches-modal-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-tertiary); font-size: 22px; line-height: 1;
  }
  .bilan-tranches-modal-body {
    padding: 14px 18px;
    flex: 1; overflow-y: auto;
  }
  .bilan-tranches-modal-body .helper {
    font-size: 12px; color: var(--text-tertiary);
    margin-bottom: 10px;
  }
  .bilan-tranche-check {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.12s;
  }
  .bilan-tranche-check:hover { background: var(--bg-secondary); }
  .bilan-tranche-check input { margin: 0; cursor: pointer; }
  .bilan-tranche-check-info { flex: 1; }
  .bilan-tranche-check-name {
    font-weight: 500; font-size: 13px;
  }
  .bilan-tranche-check-meta {
    font-size: 11.5px; color: var(--text-tertiary);
    margin-top: 1px;
  }
  .bilan-tranches-modal-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px;
  }
  .bilan-tranches-modal-foot .selection-count {
    font-size: 12px; color: var(--text-secondary);
  }
  .bilan-tranches-modal-foot button {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
  }
  .bilan-tranches-modal-foot button.primary {
    background: var(--info-accent);
    color: #fff;
    border-color: var(--info-accent);
  }

  /* Comités - fiche op section + global tab */
  .comites-empty {
    padding: 10px 12px;
    font-size: 12.5px; font-style: italic;
    color: var(--text-tertiary);
  }
  .comites-list {
    display: flex; flex-direction: column; gap: 8px;
  }
  .comite-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    padding: 10px 12px;
  }
  .comite-card-success { border-left-color: var(--success-accent); }
  .comite-card-warning { border-left-color: var(--warning-accent); }
  .comite-card-info { border-left-color: var(--info-accent); }
  .comite-card-edit {
    background: var(--card-edit-bg);
  }
  .comite-card-row {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
  }
  .comite-type-pill {
    flex-shrink: 0;
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: var(--radius-lg);
    font-size: 11.5px; font-weight: 700;
    border: 1px solid;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .comite-date {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; font-weight: 600;
    color: var(--text-primary);
  }
  .comite-date i, .comite-date .tabler-svg-icon {
    color: var(--text-tertiary); font-size: 13px;
  }
  /* State pills for comites: Planifié / PV signé */
  .comite-state-pill {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 10px;
    font-size: 11.5px; font-weight: 600;
    border: 1px solid;
  }
  .comite-state-pill.planned {
    background: var(--warning-bg); color: var(--warning-text); border-color: rgba(186, 117, 23, 0.3);
  }
  .comite-state-pill.signed {
    background: var(--success-bg); color: var(--success-text); border-color: rgba(29, 158, 117, 0.3);
  }
  .comite-state-pill i, .comite-state-pill .tabler-svg-icon { font-size: 12px; }
  .comite-card-actions {
    display: flex; gap: 4px; flex-shrink: 0;
  }
  .comite-action-btn {
    width: 30px; height: 30px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.1s;
  }
  .comite-action-btn:hover {
    background: var(--info-bg); color: var(--info-text); border-color: var(--info-accent);
  }
  .comite-submit-btn:hover {
    background: var(--success-bg); color: var(--success-text); border-color: var(--success-accent);
  }
  .comite-action-btn i, .comite-action-btn .tabler-svg-icon { font-size: 14px; }

  .comite-wf-status {
    margin-top: 6px;
    padding: 5px 9px; border-radius: var(--radius-xs);
    font-size: 11.5px;
    display: flex; align-items: center; gap: 5px;
  }
  .comite-wf-status i, .comite-wf-status .tabler-svg-icon { font-size: 12px; }

  /* Edit mode */
  .comite-card-edit .comite-card-row { gap: 8px; align-items: flex-end; }
  .comite-edit-field {
    display: flex; flex-direction: column; gap: 2px;
    flex: 1 1 130px;
  }
  .comite-edit-field-wide { flex: 2 1 260px; }
  .comite-edit-field label {
    font-size: 10px; font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.4px;
  }
  .comite-edit-input {
    padding: 5px 8px; font-size: 12px;
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-xs);
    background: var(--bg-primary); color: var(--text-primary);
    font-family: inherit;
    width: 100%;
  }
  .comite-edit-input:focus {
    outline: none; border-color: var(--info-accent);
    box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.15);
  }
  .comite-remove-btn {
    width: 30px; height: 30px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--danger-text);
    border-radius: var(--radius-sm); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .comite-remove-btn:hover { background: var(--danger-accent); color: white; border-color: var(--danger-accent); }

  .btn-add-comite {
    margin-top: 10px;
    padding: 6px 12px; font-size: 12px; font-weight: 500;
    background: transparent; color: var(--info-text);
    border: 1px dashed var(--info-accent);
    border-radius: var(--radius-sm); cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .btn-add-comite:hover { background: var(--info-bg); }
  .btn-add-comite i, .btn-add-comite .tabler-svg-icon { font-size: 13px; }

  /* Global Comités tab list */
  .com-list { display: flex; flex-direction: column; gap: 8px; }
  .com-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color-strong);
    border-radius: var(--radius-md);
  }
  .com-row-success { border-left-color: var(--success-accent); }
  .com-row-warning { border-left-color: var(--warning-accent); }
  .com-row-info { border-left-color: var(--info-accent); }
  .com-row-date {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
  }
  .com-row-date i, .com-row-date .tabler-svg-icon { color: var(--text-tertiary); font-size: 13px; }
  .com-row-main { flex: 1; min-width: 0; }
  .com-row-op { font-size: 13px; color: var(--text-primary); margin-bottom: 2px; }
  .com-row-op-link {
    color: var(--info-text); text-decoration: none;
  }
  .com-row-op-link:hover { text-decoration: underline; }
  .com-row-doc {
    font-size: 11.5px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .com-row-wf {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 4px;
    font-size: 11px; font-weight: 600;
    padding: 2px 7px; border-radius: var(--radius-xs);
  }
  .com-row-wf.wf-status-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
  .com-row-wf.wf-status-warning { background: var(--warning-bg); color: var(--warning-text); }
  .com-row-wf.wf-status-success { background: var(--success-bg); color: var(--success-text); }
  .com-row-wf.wf-status-danger { background: var(--danger-bg); color: var(--danger-text); }
  .com-row-actions { display: flex; gap: 4px; flex-shrink: 0; }


  .wf-filter-bar {
    display: flex; gap: 14px; align-items: center;
    margin-bottom: 14px; flex-wrap: wrap;
  }
  .wf-status-tabs {
    display: inline-flex; gap: 4px;
    background: var(--bg-secondary);
    padding: 4px; border-radius: var(--radius-md);
  }
  .wf-status-tab {
    padding: 6px 12px; font-size: 12.5px; font-weight: 500;
    border: none; background: transparent;
    color: var(--text-secondary); cursor: pointer;
    border-radius: var(--radius-sm); font-family: inherit;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .wf-status-tab.active { background: var(--bg-primary); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
  .wf-status-count {
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: var(--radius-md);
    background: var(--border-color-strong); color: var(--text-secondary);
  }
  .wf-status-tab.active .wf-status-count { background: var(--info-accent); color: white; }
  .wf-search { flex: 1; min-width: 220px; }

  .wf-list { display: flex; flex-direction: column; gap: 10px; }
  .wf-empty {
    padding: 40px; text-align: center;
    background: var(--bg-primary);
    border: 1px dashed var(--border-color-strong);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
  }
  .wf-empty i, .wf-empty .tabler-svg-icon {
    display: block; margin: 0 auto 10px;
    font-size: 36px; color: var(--text-tertiary);
  }

  .wf-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--border-color-strong);
  }
  .wf-item-neutral { border-left-color: var(--neutral-accent); }
  .wf-item-warning { border-left-color: var(--warning-accent); }
  .wf-item-success { border-left-color: var(--success-accent); }
  .wf-item-danger { border-left-color: var(--danger-accent); }
  .wf-item-icon {
    width: 40px; height: 50px; flex-shrink: 0;
    background: linear-gradient(135deg, #f08080, #c4423a);
    color: white;
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
    position: relative;
  }
  .wf-item-icon::after {
    content: 'PDF';
    position: absolute;
    bottom: 4px;
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .wf-item-icon i, .wf-item-icon .tabler-svg-icon { font-size: 18px; margin-top: -6px; }
  .wf-item-body { flex: 1; min-width: 0; }
  .wf-item-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 4px;
  }
  .wf-item-name {
    flex: 1; min-width: 0;
    font-size: 13.5px; font-weight: 600;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .wf-item-status {
    flex-shrink: 0;
    font-size: 10.5px; font-weight: 700;
    padding: 2px 9px; border-radius: 10px;
    text-transform: uppercase; letter-spacing: 0.4px;
    display: inline-flex; align-items: center; gap: 3px;
  }
  .wf-item-status i, .wf-item-status .tabler-svg-icon { font-size: 11px; }
  .wf-status-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
  .wf-status-warning { background: var(--warning-bg); color: var(--warning-text); }
  .wf-status-success { background: var(--success-bg); color: var(--success-text); }
  .wf-status-danger { background: var(--danger-bg); color: var(--danger-text); }
  .wf-item-meta {
    font-size: 11.5px; color: var(--text-secondary);
    margin-bottom: 6px;
  }
  .wf-item-type {
    font-weight: 600; color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 1px 7px; border-radius: var(--radius-xs);
  }
  .wf-item-flow {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; margin-bottom: 6px;
    flex-wrap: wrap;
  }
  .wf-flow-person {
    display: inline-flex; align-items: center; gap: 3px;
    color: var(--text-primary);
  }
  .wf-flow-person i, .wf-flow-person .tabler-svg-icon { font-size: 12px; color: var(--text-tertiary); }
  .wf-flow-recipient { font-weight: 600; color: var(--info-text); }
  .wf-flow-arrow { color: var(--text-tertiary); font-size: 13px; }
  .wf-flow-date { font-size: 11px; color: var(--text-tertiary); font-style: italic; margin-left: auto; }
  .wf-item-message {
    font-size: 12px; color: var(--text-secondary);
    font-style: italic;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-left: 2px solid var(--border-color-strong);
    border-radius: 0 4px 4px 0;
    margin-top: 4px;
  }
  .wf-item-result {
    margin-top: 6px;
    padding: 6px 10px; border-radius: var(--radius-xs);
    font-size: 12px; font-weight: 500;
    display: flex; align-items: center; gap: 5px;
    flex-wrap: wrap;
  }
  .wf-item-result i, .wf-item-result .tabler-svg-icon { font-size: 13px; }
  .wf-result-success { background: var(--success-bg); color: var(--success-text); }
  .wf-result-danger { background: var(--danger-bg); color: var(--danger-text); }
  .wf-refused-reason {
    width: 100%; margin-top: 4px;
    font-size: 11.5px; font-weight: 400;
    font-style: italic;
  }
  .wf-item-actions {
    display: flex; flex-direction: column; gap: 5px;
    flex-shrink: 0;
  }
  .btn-primary {
    background: var(--info-accent); color: white;
  }
  .btn-primary:hover { background: var(--info-text); }

  /* Workflow modal */
  .wf-modal-backdrop {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
  }
  .wf-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 600px;
    max-height: 90vh; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  }
  .wf-modal-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 15px; font-weight: 600;
  }
  .wf-modal-head i, .wf-modal-head .tabler-svg-icon { color: var(--info-accent); font-size: 18px; }
  .wf-modal-close {
    margin-left: auto; border: none; background: transparent;
    color: var(--text-secondary); cursor: pointer;
    font-size: 22px; padding: 0 8px; line-height: 1;
  }
  .wf-modal-close:hover { color: var(--text-primary); }
  .wf-modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
  /* Comités tab toolbar (drop zone + plan button) */
  .com-toolbar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
  }
  .com-plan-btn {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px;
    border: 2px dashed var(--info-accent);
    border-radius: var(--radius-md);
    background: var(--info-bg);
    color: var(--info-text);
    cursor: pointer; font-family: inherit;
    text-align: left;
    transition: all 0.15s;
  }
  .com-plan-btn:hover {
    background: var(--info-accent); color: white;
    border-style: solid;
  }
  .com-plan-btn > i, .com-plan-btn > .tabler-svg-icon {
    font-size: 32px; flex-shrink: 0;
  }
  .com-plan-btn-title {
    display: block; font-size: 14px; font-weight: 600;
    margin-bottom: 2px;
  }
  .com-plan-btn-sub {
    display: block; font-size: 11.5px; opacity: 0.85;
  }
  @media (max-width: 900px) {
    .com-toolbar { grid-template-columns: 1fr; }
  }

  /* Statut filter tabs separator */
  .wf-status-tab-sep {
    width: 1px; height: 22px;
    background: var(--border-color-strong);
    margin: 0 4px;
    align-self: center;
  }

  /* Statut pills inside rows */
  .com-statut-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 10px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    flex-shrink: 0;
  }
  .com-statut-pill i, .com-statut-pill .tabler-svg-icon { font-size: 11px; }
  .com-statut-planifie { background: var(--info-bg); color: var(--info-text); }
  .com-statut-realise { background: var(--success-bg); color: var(--success-text); }

  .com-row-future {
    font-size: 11px; font-weight: 600;
    color: var(--info-text);
    padding: 2px 7px; border-radius: var(--radius-md);
    background: var(--info-bg);
    flex-shrink: 0;
  }
  .com-row-past {
    font-size: 11px; font-weight: 600;
    color: var(--text-tertiary);
    padding: 2px 7px; border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    flex-shrink: 0;
  }
  .com-row-planifie {
    background: linear-gradient(to right, var(--info-bg) 0%, var(--bg-primary) 8%);
  }

  /* Grouped comité (multi-ops) */
  .com-group {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .com-group-planifie { border-left-color: var(--info-accent); }
  .com-group-realise { border-left-color: var(--success-accent); }
  .com-group-success { border-left-color: var(--success-accent); }
  .com-group-warning { border-left-color: var(--warning-accent); }
  .com-group-info { border-left-color: var(--info-accent); }
  .com-group-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
  }
  .com-group-lieu {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; color: var(--text-secondary);
  }
  .com-group-lieu i, .com-group-lieu .tabler-svg-icon { font-size: 12px; color: var(--text-tertiary); }
  .com-group-count {
    margin-left: auto;
    font-size: 11px; font-weight: 700;
    padding: 3px 9px; border-radius: 10px;
    background: var(--info-accent); color: white;
    text-transform: uppercase; letter-spacing: 0.5px;
  }
  .com-group-actions { display: flex; gap: 5px; flex-shrink: 0; }
  .com-group-ops {
    display: flex; flex-direction: column;
  }
  .com-group-op-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px dotted var(--border-color);
    font-size: 12.5px;
  }
  .com-group-op-row:last-child { border-bottom: none; }
  .com-group-op-row .com-row-op-link {
    flex: 0 0 320px; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--info-text); text-decoration: none;
  }
  .com-group-op-row .com-row-op-link:hover { text-decoration: underline; }
  .com-group-op-doc {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-secondary); font-size: 11.5px;
  }
  .com-group-op-doc-empty { font-style: italic; color: var(--text-tertiary); }
  .com-row-wf-mini {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 7px; border-radius: var(--radius-md);
    font-size: 10.5px; font-weight: 600;
    flex-shrink: 0;
  }
  .com-row-wf-mini i, .com-row-wf-mini .tabler-svg-icon { font-size: 11px; }
  .com-group-op-actions { display: flex; gap: 4px; flex-shrink: 0; }

  /* Plan-comité modal: large + ops list */
  .wf-modal-large { max-width: 760px !important; }
  .wf-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
  }
  .wf-modal-row .wf-modal-field { margin-bottom: 0; }
  .plan-ops-count {
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: var(--radius-md);
    background: var(--info-accent); color: white;
    margin-left: 6px;
  }
  .plan-ops-search { margin-bottom: 6px; }
  .plan-ops-search input {
    width: 100%; padding: 6px 10px;
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-xs);
    background: var(--bg-primary); color: var(--text-primary);
    font-size: 12.5px; font-family: inherit;
  }
  .plan-ops-list {
    max-height: 260px; overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    padding: 4px;
  }
  .plan-op-check {
    display: grid;
    grid-template-columns: auto 70px 1fr auto;
    gap: 8px; align-items: center;
    padding: 5px 8px; border-radius: var(--radius-xs);
    font-size: 12.5px; cursor: pointer;
    background: var(--bg-primary);
    margin: 2px 0;
    transition: background 0.1s;
  }
  .plan-op-check:hover { background: var(--info-bg); }
  .plan-op-check input { accent-color: var(--info-accent); }
  .plan-op-code {
    font-size: 10.5px; font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 1px 6px; border-radius: var(--radius-xs);
    text-align: center;
  }
  .plan-op-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-primary);
  }
  .plan-op-phase {
    font-size: 9.5px; font-weight: 700;
    padding: 2px 7px; border-radius: var(--radius-md);
    text-transform: uppercase; letter-spacing: 0.4px;
  }

  /* Multi-recipient validators (comité workflow modal) */
  .wf-multi-recipients {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
  }
  .wf-recipient-check {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px; border-radius: var(--radius-xs);
    font-size: 12.5px;
    cursor: pointer;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    user-select: none;
    transition: background 0.1s;
  }
  .wf-recipient-check:hover { background: var(--info-bg); }
  .wf-recipient-check input[type="checkbox"] {
    margin: 0;
    accent-color: var(--info-accent);
  }
  .wf-recipient-check input:checked + span { font-weight: 600; color: var(--info-text); }

  /* Recipient chips in workflow list */
  .wf-flow-recipients {
    display: inline-flex; flex-wrap: wrap; gap: 4px;
    align-items: center;
  }
  .wf-recipient-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
    line-height: 1.4;
  }
  .wf-recipient-chip i, .wf-recipient-chip .tabler-svg-icon { font-size: 11px; }
  .wf-recipient-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
  .wf-recipient-warning { background: var(--warning-bg); color: var(--warning-text); }
  .wf-recipient-success { background: var(--success-bg); color: var(--success-text); }
  .wf-recipient-danger { background: var(--danger-bg); color: var(--danger-text); }

  .wf-progress-count {
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: var(--radius-md);
    background: rgba(255,255,255,0.35);
    margin-left: 3px;
  }

  /* Per-recipient action rows when multiple pending */
  .wf-actions-per-recipient {
    display: flex; flex-direction: column; gap: 4px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
  }
  .wf-action-row {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px;
  }
  .wf-action-row-name {
    flex: 1; min-width: 0;
    font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .btn-tiny {
    padding: 3px 8px; font-size: 11px; font-weight: 600;
    border: none; border-radius: var(--radius-xs); cursor: pointer;
    display: inline-flex; align-items: center; gap: 3px;
    font-family: inherit;
  }
  .btn-tiny i, .btn-tiny .tabler-svg-icon { font-size: 12px; }
  .btn-tiny.btn-restore { background: var(--success-bg); color: var(--success-text); }
  .btn-tiny.btn-restore:hover { background: var(--success-accent); color: white; }
  .btn-tiny.btn-perm-delete { background: var(--danger-bg); color: var(--danger-text); }
  .btn-tiny.btn-perm-delete:hover { background: var(--danger-accent); color: white; }

  /* Recipient chips inside comité card */
  .comite-wf-status {
    flex-wrap: wrap;
  }
  .comite-wf-chips {
    display: inline-flex; flex-wrap: wrap; gap: 4px;
    margin-left: auto;
  }
  .comite-wf-chip {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 7px; border-radius: var(--radius-md);
    font-size: 10.5px; font-weight: 600;
    line-height: 1.4;
  }
  .comite-wf-chip i, .comite-wf-chip .tabler-svg-icon { font-size: 10px; }
  .comite-wf-chip.wf-status-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
  .comite-wf-chip.wf-status-warning { background: var(--warning-bg); color: var(--warning-text); }
  .comite-wf-chip.wf-status-success { background: var(--success-bg); color: var(--success-text); }
  .comite-wf-chip.wf-status-danger { background: var(--danger-bg); color: var(--danger-text); }


  .wf-modal-field { margin-bottom: 14px; }
  .wf-modal-field label {
    display: block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-tertiary); margin-bottom: 4px;
  }
  .wf-modal-field select,
  .wf-modal-field textarea {
    width: 100%; padding: 7px 10px;
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-primary); color: var(--text-primary);
    font-size: 13px; font-family: inherit;
  }
  .wf-modal-field select:focus,
  .wf-modal-field textarea:focus {
    outline: none; border-color: var(--info-accent);
    box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.15);
  }
  .wf-modal-field textarea { resize: vertical; }
  .wf-modal-foot {
    padding: 14px 22px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex; gap: 8px; justify-content: flex-end;
  }

  /* Saved views (Synthese tab) */
  .synth-saved-views {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; margin-bottom: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
  }
  .synth-saved-label {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.5px;
    flex-shrink: 0;
  }
  .synth-saved-label i, .synth-saved-label .tabler-svg-icon {
    color: var(--info-accent); font-size: 13px;
  }
  .synth-saved-list {
    display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0;
  }
  .synth-saved-empty {
    font-size: 11.5px; color: var(--text-tertiary); font-style: italic;
  }
  .synth-saved-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 4px 4px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color-strong);
    border-radius: 14px;
    font-size: 12px; font-weight: 500;
    color: var(--text-primary);
    cursor: pointer; font-family: inherit;
    transition: all 0.1s;
  }
  .synth-saved-chip:hover {
    background: var(--info-bg);
    border-color: var(--info-accent);
    color: var(--info-text);
  }
  .synth-saved-chip.active {
    background: var(--info-accent);
    border-color: var(--info-accent);
    color: white;
  }
  .synth-saved-chip-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%;
    font-size: 14px; line-height: 1;
    color: inherit; opacity: 0.5;
    transition: all 0.1s;
  }
  .synth-saved-chip-x:hover {
    opacity: 1; background: rgba(0,0,0,0.15);
  }
  .synth-saved-add {
    padding: 5px 12px; font-size: 11.5px; font-weight: 500;
    background: var(--bg-primary);
    color: var(--info-text);
    border: 1px dashed var(--info-accent);
    border-radius: 14px;
    cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 4px;
    flex-shrink: 0;
  }
  .synth-saved-add:hover { background: var(--info-bg); border-style: solid; }
  .synth-saved-add i, .synth-saved-add .tabler-svg-icon { font-size: 12px; }

  /* Op timeline (collapsible chronology) */
  .section-timeline {
    padding: 0;
  }
  .section-timeline::before { display: none; }
  .timeline-toggle {
    width: 100%; display: flex; align-items: center; gap: 10px;
    background: transparent; border: none;
    padding: 10px 12px;
    font-family: inherit; font-size: inherit; text-align: left;
    cursor: pointer;
  }
  .timeline-toggle:hover { background: var(--bg-secondary); border-radius: var(--radius-md); }
  .timeline-toggle .section-label { margin: 0; flex-shrink: 0; }
  .timeline-count {
    font-size: 11.5px; font-weight: 500; color: var(--text-tertiary);
    margin-left: auto;
  }
  .timeline-toggle > i, .timeline-toggle > .tabler-svg-icon {
    color: var(--text-secondary); font-size: 14px;
    flex-shrink: 0;
  }
  .timeline-content {
    padding: 4px 12px 12px;
  }
  .timeline-list {
    list-style: none; margin: 0; padding: 0 0 0 8px;
    border-left: 2px dashed var(--border-color);
  }
  .timeline-evt {
    display: grid;
    grid-template-columns: auto 100px 95px 1fr;
    gap: 10px; align-items: start;
    padding: 8px 0 8px 16px;
    position: relative;
    font-size: 12.5px;
  }
  .timeline-evt-future { opacity: 0.55; }
  .timeline-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border-color-strong);
    margin-left: -22px;
    margin-top: 4px;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 0 1px var(--border-color);
    flex-shrink: 0;
  }
  .timeline-evt-success .timeline-dot { background: var(--success-accent); }
  .timeline-evt-info .timeline-dot { background: var(--info-accent); }
  .timeline-evt-warning .timeline-dot { background: var(--warning-accent); }
  .timeline-evt-danger .timeline-dot { background: var(--danger-accent); }
  .timeline-evt-purple .timeline-dot { background: var(--purple-accent); }
  .timeline-date {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    font-size: 11.5px;
  }
  .timeline-type {
    font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    padding: 2px 7px; border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    text-align: center;
    height: fit-content;
  }
  .timeline-evt-success .timeline-type { background: var(--success-bg); color: var(--success-text); }
  .timeline-evt-info .timeline-type { background: var(--info-bg); color: var(--info-text); }
  .timeline-evt-warning .timeline-type { background: var(--warning-bg); color: var(--warning-text); }
  .timeline-evt-purple .timeline-type { background: rgba(147, 51, 234, 0.10); color: var(--purple-text); }
  .timeline-label { font-weight: 500; color: var(--text-primary); }
  .timeline-detail {
    font-size: 11px; color: var(--text-tertiary);
    margin-top: 2px;
  }

  /* Accueil - personal dashboard */
  .accueil-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 20px;
  }
  .accueil-kpi {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color-strong);
    border-radius: var(--radius-md);
  }
  .accueil-kpi-info { border-left-color: var(--info-accent); }
  .accueil-kpi-success { border-left-color: var(--success-accent); }
  .accueil-kpi-warning { border-left-color: var(--warning-accent); }
  .accueil-kpi-danger { border-left-color: var(--danger-accent); }
  .accueil-kpi-icon {
    font-size: 28px; flex-shrink: 0;
    color: var(--text-secondary);
  }
  .accueil-kpi-info .accueil-kpi-icon { color: var(--info-accent); }
  .accueil-kpi-success .accueil-kpi-icon { color: var(--success-accent); }
  .accueil-kpi-warning .accueil-kpi-icon { color: var(--warning-accent); }
  .accueil-kpi-danger .accueil-kpi-icon { color: var(--danger-accent); }
  .accueil-kpi-num {
    font-size: 26px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1; color: var(--text-primary);
  }
  .accueil-kpi-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-top: 3px;
  }

  .accueil-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .accueil-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  .accueil-card-wide { grid-column: span 2; }
  @media (max-width: 1100px) {
    .accueil-grid { grid-template-columns: 1fr; }
    .accueil-card-wide { grid-column: span 1; }
  }
  .accueil-card-head {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 13.5px; font-weight: 600;
    color: var(--text-primary);
  }
  .accueil-card-head i, .accueil-card-head .tabler-svg-icon {
    color: var(--info-accent); font-size: 16px;
  }
  .accueil-card-link {
    margin-left: auto; font-size: 11.5px; font-weight: 500;
    color: var(--info-text); text-decoration: none;
  }
  .accueil-card-link:hover { text-decoration: underline; }
  .accueil-card-more {
    padding: 6px 16px; font-size: 12px;
    text-align: center; border-top: 1px solid var(--border-color);
  }
  .accueil-card-more a { color: var(--info-text); text-decoration: none; }
  .accueil-card-more a:hover { text-decoration: underline; }
  .accueil-empty {
    padding: 24px 16px; text-align: center;
    color: var(--text-secondary);
  }
  .accueil-empty i, .accueil-empty .tabler-svg-icon {
    display: block; margin: 0 auto 8px;
    font-size: 28px; color: var(--success-accent);
  }
  .accueil-empty p { margin: 0 0 4px; font-size: 13px; }

  .accueil-alerts {
    list-style: none; margin: 0; padding: 0;
  }
  .accueil-alerts .alert-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.1s;
  }
  .accueil-alerts .alert-item:hover { background: var(--bg-secondary); }
  .accueil-alerts .alert-item:last-child { border-bottom: none; }
  .accueil-alert-body { flex: 1; min-width: 0; }
  .accueil-alert-op {
    font-size: 12.5px; color: var(--text-primary);
    margin-bottom: 2px;
  }
  .accueil-alert-msg {
    font-size: 11.5px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis;
  }

  .accueil-wf-list, .accueil-com-list, .accueil-activity {
    list-style: none; margin: 0; padding: 0;
  }
  .accueil-wf-item, .accueil-com-item, .accueil-activity-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 12.5px;
    transition: background 0.1s;
  }
  .accueil-wf-item:hover, .accueil-com-item:hover, .accueil-activity-item:hover { background: var(--bg-secondary); }
  .accueil-wf-item:last-child, .accueil-com-item:last-child, .accueil-activity-item:last-child { border-bottom: none; }
  .accueil-wf-item i, .accueil-wf-item .tabler-svg-icon {
    color: var(--info-accent); font-size: 16px; flex-shrink: 0;
  }
  .accueil-wf-body { flex: 1; min-width: 0; }
  .accueil-wf-name {
    font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .accueil-wf-meta {
    font-size: 11px; color: var(--text-tertiary);
    margin-top: 1px;
  }
  .accueil-wf-from {
    font-size: 10.5px; color: var(--text-tertiary); font-style: italic;
    flex-shrink: 0;
  }
  .accueil-com-item.accueil-com-soon { background: var(--warning-bg); }
  .accueil-com-item.accueil-com-past { opacity: 0.6; }
  .accueil-com-body { flex: 1; min-width: 0; }
  .accueil-com-op {
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .accueil-com-meta {
    font-size: 11px; color: var(--text-tertiary);
    margin-top: 1px;
  }
  .accueil-activity-date {
    font-size: 10.5px; color: var(--text-tertiary); font-weight: 600;
    min-width: 85px; flex-shrink: 0;
  }
  .accueil-activity-user { color: var(--text-primary); }
  .accueil-activity-action { color: var(--text-secondary); }
  .accueil-activity-action em { color: var(--text-primary); font-style: normal; font-weight: 500; }
  .accueil-activity-op {
    margin-left: auto; font-size: 11.5px;
    color: var(--info-text); font-weight: 500;
    flex-shrink: 0;
  }

  .accueil-phases {
    padding: 12px 16px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .accueil-phase-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 12.5px;
  }
  .accueil-phase-label {
    min-width: 110px; font-weight: 500;
    text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.5px;
  }
  .accueil-phase-bar {
    flex: 1; height: 14px; border-radius: var(--radius-md);
    background: var(--bg-tertiary); overflow: hidden;
  }
  .accueil-phase-bar-fill {
    height: 100%; border-radius: var(--radius-md);
    transition: width 0.3s;
  }
  .accueil-phase-num {
    min-width: 24px; text-align: right;
    font-weight: 700; font-variant-numeric: tabular-nums;
  }

  /* Finances consolidées */
  .finances-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px; margin-bottom: 20px;
  }
  .finances-kpi {
    padding: 16px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--border-color-strong);
    border-radius: var(--radius-md);
  }
  .finances-kpi-primary { border-top-color: var(--info-accent); }
  .finances-kpi-info { border-top-color: var(--info-accent); }
  .finances-kpi-warning { border-top-color: var(--warning-accent); }
  .finances-kpi-success { border-top-color: var(--success-accent); }
  .finances-kpi-purple { border-top-color: var(--purple-accent); }
  .finances-kpi-label {
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
  }
  .finances-kpi-num {
    font-size: 22px; font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
  }
  .finances-kpi-sub {
    font-size: 11px; color: var(--text-secondary);
    margin-top: 4px;
  }

  .finances-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px; margin-bottom: 16px;
  }
  .finances-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px;
  }
  .finances-panel-wide { grid-column: span 2; }
  @media (max-width: 1100px) {
    .finances-grid { grid-template-columns: 1fr; }
    .finances-panel-wide { grid-column: span 1; }
  }
  .finances-panel-title {
    margin: 0 0 14px;
    font-size: 13.5px; font-weight: 600;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
  }
  .finances-panel-title i, .finances-panel-title .tabler-svg-icon {
    color: var(--info-accent); font-size: 16px;
  }
  .finances-stages, .finances-bars {
    display: flex; flex-direction: column; gap: 10px;
  }
  .finances-stage { display: flex; flex-direction: column; gap: 3px; }
  .finances-stage-label {
    font-size: 12px; font-weight: 500; color: var(--text-secondary);
  }
  .finances-stage-bar {
    height: 24px; border-radius: var(--radius-xs);
    background: var(--bg-tertiary); overflow: hidden;
  }
  .finances-stage-bar-fill { height: 100%; transition: width 0.3s; border-radius: var(--radius-xs); }
  .finances-stage-val {
    font-size: 12.5px; font-weight: 600; color: var(--text-primary);
    font-variant-numeric: tabular-nums;
  }
  .finances-stage-pct { font-weight: 400; color: var(--text-tertiary); font-size: 11px; }

  .finances-bar-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 10px; align-items: center;
    font-size: 12px;
  }
  .finances-bar-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-primary);
  }
  .finances-bar-track {
    height: 16px; border-radius: var(--radius-xs);
    background: var(--bg-tertiary); overflow: hidden;
  }
  .finances-bar-fill { height: 100%; border-radius: var(--radius-xs); transition: width 0.3s; }
  .finances-bar-val {
    font-weight: 600; font-variant-numeric: tabular-nums;
    min-width: 80px; text-align: right;
    color: var(--text-primary);
  }
  .finances-empty {
    padding: 20px; text-align: center;
    color: var(--text-tertiary); font-style: italic; font-size: 12.5px;
  }

  /* ===== Nouveaux éléments Finances enrichies ===== */
  .finances-mini-kpis {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-bottom: 12px;
  }
  .finances-mini-kpi {
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-align: center;
  }
  .finances-mini-kpi-num {
    font-size: 18px; font-weight: 700;
    color: var(--info-text); font-variant-numeric: tabular-nums;
  }
  .finances-mini-kpi-label {
    font-size: 10.5px; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.3px;
    margin-top: 2px;
  }
  .finances-panel-footnote {
    margin-top: 8px;
    font-size: 11px; color: var(--text-tertiary);
    font-style: italic;
  }
  .finances-panel-warning {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--warning-bg, #faece7);
    color: var(--warning-text, #993c1d);
    border-left: 3px solid var(--warning-accent);
    border-radius: var(--radius-xs);
    font-size: 11.5px;
    display: flex; gap: 6px; align-items: center;
  }
  .finances-panel-badge {
    margin-left: 8px;
    padding: 1px 8px;
    background: var(--warning-bg);
    color: var(--warning-text);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
  }
  /* Indicateurs HLM */
  .finances-kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }
  .finances-indicator {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--info-accent);
  }
  .finances-indicator-label {
    font-size: 10.5px; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.3px;
    margin-bottom: 4px;
  }
  .finances-indicator-num {
    font-size: 20px; font-weight: 700;
    color: var(--text-primary); font-variant-numeric: tabular-nums;
  }
  .finances-indicator-sub {
    font-size: 11px; color: var(--text-tertiary);
    margin-top: 2px;
  }
  .finances-indicator-sub.good { color: var(--success-text); font-weight: 600; }
  .finances-indicator-sub.warn { color: var(--warning-text); font-weight: 600; }
  /* Tableau Plan de financement */
  .finances-table-wrap {
    max-height: 360px; overflow-y: auto;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
  }
  .finances-table {
    width: 100%; border-collapse: collapse;
    font-size: 12px;
  }
  .finances-table thead {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-tertiary);
  }
  .finances-table thead th {
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-color);
  }
  .finances-table thead th.num { text-align: right; }
  .finances-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
  }
  .finances-table tbody td.num {
    text-align: right; font-variant-numeric: tabular-nums;
  }
  .finances-table tbody tr:hover { background: var(--bg-tertiary); }
  .finances-table-subtext {
    font-size: 11px; color: var(--text-tertiary);
    font-weight: normal;
  }
  .finances-table-link {
    cursor: pointer; color: var(--info-accent);
    display: inline-flex;
  }
  .finances-table-link:hover { color: var(--info-text); }
  .equilibre-ok { color: var(--success-text); font-weight: 700; }
  .equilibre-warn { color: var(--warning-text); font-weight: 600; }
  .equilibre-bad { color: var(--error-text, #b91c1c); font-weight: 700; }
  .phase-badge-mini {
    padding: 2px 6px; border-radius: var(--radius-xs);
    font-size: 10.5px; font-weight: 500;
    white-space: nowrap;
  }
  .finances-disclaimer {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 10px 14px; margin-top: 12px;
    background: var(--info-bg); color: var(--info-text);
    border: 1px solid var(--info-accent);
    border-radius: var(--radius-md);
    font-size: 12px; line-height: 1.5;
  }
  .finances-disclaimer i, .finances-disclaimer .tabler-svg-icon {
    flex-shrink: 0; font-size: 14px; margin-top: 1px;
  }

  /* Trésorerie */
  .treso-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px; margin-bottom: 20px;
  }
  .treso-kpi {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--info-accent);
    border-radius: var(--radius-md);
    padding: 16px 18px;
  }
  .treso-kpi-label {
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
  }
  .treso-kpi-num {
    font-size: 22px; font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
  }
  .treso-kpi-detail {
    font-size: 11px; color: var(--text-secondary);
    margin-top: 4px;
  }
  .treso-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 18px; margin-bottom: 16px;
  }
  .treso-panel-title {
    margin: 0 0 14px;
    font-size: 13.5px; font-weight: 600;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 6px;
  }
  .treso-panel-title i, .treso-panel-title .tabler-svg-icon {
    color: var(--info-accent); font-size: 16px;
  }
  .treso-chart {
    display: flex; align-items: flex-end; gap: 4px;
    height: 200px; padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
  }
  .treso-month {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    min-width: 0; cursor: default;
  }
  .treso-month-bars {
    flex: 1; width: 100%;
    display: flex; flex-direction: column-reverse;
    align-items: center;
    gap: 1px;
  }
  .treso-bar {
    width: 100%; max-width: 30px;
    min-height: 1px;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s;
  }
  .treso-bar-pret { background: var(--info-accent); }
  .treso-bar-subv { background: var(--success-accent); }
  .treso-month-label {
    font-size: 10px; color: var(--text-tertiary);
    transform: rotate(-45deg); transform-origin: center top;
    white-space: nowrap; margin-top: 4px;
  }
  .treso-legend {
    margin-top: 14px;
    display: flex; gap: 16px;
    font-size: 12px; color: var(--text-secondary);
  }
  .treso-legend-item { display: inline-flex; align-items: center; gap: 5px; }
  .treso-legend-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 2px;
  }
  .treso-table {
    width: 100%; border-collapse: collapse;
    font-size: 12.5px;
  }
  .treso-table thead { background: var(--bg-secondary); }
  .treso-table th {
    padding: 8px 10px; text-align: left;
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-tertiary);
  }
  .treso-table td {
    padding: 8px 10px;
    border-bottom: 1px dotted var(--border-color);
    font-variant-numeric: tabular-nums;
  }
  .treso-table td:first-child { font-variant-numeric: normal; }

  /* ===== Nouveaux éléments Trésorerie enrichie ===== */
  /* Variantes KPI couleur */
  .treso-kpi-warning { border-top-color: var(--warning-accent); }
  .treso-kpi-success { border-top-color: var(--success-accent); }
  .treso-positive { color: var(--success-text); }
  .treso-negative { color: var(--warning-text); }

  /* Histogramme positif/négatif (encaissements/décaissements) */
  .treso-chart-pn {
    display: flex; align-items: stretch; gap: 4px;
    height: 240px; padding: 10px 0;
    position: relative;
    border-bottom: 1px solid var(--border-color);
  }
  .treso-chart-pn::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    border-top: 1px dashed var(--border-color);
  }
  .treso-month-pn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; min-width: 0;
    cursor: default; gap: 4px;
  }
  .treso-month-pn-positive {
    flex: 1; width: 100%;
    display: flex; flex-direction: column-reverse;
    align-items: center;
  }
  .treso-month-pn-negative {
    flex: 1; width: 100%;
    display: flex; flex-direction: column;
    align-items: center;
  }
  .treso-bar-in {
    width: 100%; max-width: 30px;
    background: var(--info-accent);
    border-radius: 2px 2px 0 0;
    min-height: 1px;
    transition: height 0.3s;
  }
  .treso-bar-out {
    width: 100%; max-width: 30px;
    background: var(--warning-accent);
    border-radius: 0 0 2px 2px;
    min-height: 1px;
    transition: height 0.3s;
    opacity: 0.85;
  }
  .treso-legend-dot.in { background: var(--info-accent); }
  .treso-legend-dot.out { background: var(--warning-accent); }

  /* Courbe solde cumulé */
  .treso-cumul-chart {
    display: flex; align-items: stretch; gap: 3px;
    height: 140px; padding: 10px 0;
    position: relative;
  }
  .treso-cumul-chart::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    border-top: 1px dashed var(--border-color);
  }
  .treso-cumul-month {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; min-width: 0;
    justify-content: center;
    position: relative;
  }
  .treso-cumul-area {
    width: 100%; max-width: 22px;
    border-radius: 2px;
    min-height: 2px;
    opacity: 0.75;
    transition: height 0.3s;
  }

  /* Tableau événements */
  .treso-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  @media (max-width: 1100px) {
    .treso-grid { grid-template-columns: 1fr; }
  }
  .treso-events {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 320px; overflow-y: auto;
  }
  .treso-event {
    display: grid; grid-template-columns: auto 1fr auto;
    gap: 12px; align-items: center;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--border-color);
  }
  .treso-event-icon {
    font-size: 18px;
    display: flex; align-items: center;
  }
  .treso-event-body { min-width: 0; }
  .treso-event-label {
    font-size: 12.5px;
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .treso-event-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .treso-event-amount {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    white-space: nowrap;
  }
  .treso-empty {
    padding: 20px; text-align: center;
    color: var(--text-tertiary); font-style: italic; font-size: 12.5px;
  }

  .treso-disclaimer {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 10px 14px; margin-top: 12px;
    background: var(--info-bg); color: var(--info-text);
    border: 1px solid var(--info-accent);
    border-radius: var(--radius-md);
    font-size: 12px; line-height: 1.5;
  }
  .treso-disclaimer i, .treso-disclaimer .tabler-svg-icon {
    flex-shrink: 0; margin-top: 2px;
  }

  /* History modal */
  .history-modal-backdrop {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
  }
  .history-modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 900px;
    max-height: 85vh; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  }
  .history-modal-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 15px; font-weight: 600;
  }
  .history-modal-head i, .history-modal-head .tabler-svg-icon { color: var(--info-accent); font-size: 18px; }
  .history-modal-close {
    margin-left: auto; border: none; background: transparent;
    color: var(--text-secondary); cursor: pointer;
    font-size: 22px; padding: 0 8px; line-height: 1;
  }
  .history-modal-close:hover { color: var(--text-primary); }
  .history-modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
  .history-empty {
    padding: 40px 20px; text-align: center;
    color: var(--text-secondary);
  }
  .history-empty i, .history-empty .tabler-svg-icon {
    display: block; margin: 0 auto 12px;
    font-size: 40px; color: var(--text-tertiary);
  }
  .history-empty p:first-of-type { font-size: 14px; font-weight: 500; margin: 0 0 8px; }
  .history-table {
    width: 100%; border-collapse: collapse;
    font-size: 12.5px;
  }
  .history-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color-strong);
  }
  .history-table th {
    padding: 8px 10px; text-align: left;
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-tertiary);
  }
  .history-table td {
    padding: 8px 10px;
    border-bottom: 1px dotted var(--border-color);
    vertical-align: top;
  }
  .history-table code {
    font-size: 11px; background: var(--bg-tertiary);
    padding: 1px 5px; border-radius: var(--radius-xs);
  }

  /* Trash view */
  .trash-empty, .trash-info {
    padding: 24px; border-radius: var(--radius-md);
    background: var(--bg-primary); border: 1px dashed var(--border-color-strong);
    text-align: center; color: var(--text-secondary);
    margin-bottom: 14px;
  }
  .trash-info {
    text-align: left; display: flex; align-items: center; gap: 12px;
    background: var(--warning-bg); border: 1px solid var(--warning-accent); border-style: solid;
    color: var(--warning-text);
  }
  .trash-info i, .trash-info .tabler-svg-icon { font-size: 18px; flex-shrink: 0; }
  .trash-empty i, .trash-empty .tabler-svg-icon {
    display: block; margin: 0 auto 12px; font-size: 40px; color: var(--text-tertiary);
  }
  .trash-empty p:first-of-type { font-size: 15px; font-weight: 500; margin: 0 0 8px; color: var(--text-primary); }
  .trash-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    overflow: hidden;
  }
  .trash-table thead { background: var(--bg-secondary); }
  .trash-table th {
    padding: 10px 12px; text-align: left; font-size: 11px;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-color-strong);
  }
  .trash-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--border-color);
  }
  .trash-table tr:last-child td { border-bottom: none; }
  .trash-actions { display: flex; gap: 6px; }
  .btn-small {
    padding: 5px 10px; font-size: 11.5px; font-weight: 500;
    border: none; border-radius: var(--radius-xs); cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    font-family: inherit;
  }
  .btn-small i, .btn-small .tabler-svg-icon { font-size: 12px; }
  .btn-restore { background: var(--success-bg); color: var(--success-text); }
  .btn-restore:hover { background: var(--success-accent); color: white; }
  .btn-perm-delete { background: var(--danger-bg); color: var(--danger-text); }
  .btn-perm-delete:hover { background: var(--danger-accent); color: white; }

  /* Op tags (manual labels for linking ops together) */
  .op-row-tag-line {
    margin: 2px 0 4px;
    display: flex; flex-wrap: wrap; gap: 3px;
  }
  .op-row-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 7px; border-radius: var(--radius-md);
    font-size: 10.5px; font-weight: 600;
    background: rgba(24, 178, 192, 0.12);
    color: #007a85;
    border: 1px solid rgba(24, 178, 192, 0.35);
  }
  [data-theme="dark"] .op-row-tag {
    background: rgba(48, 200, 215, 0.15);
    color: #5edae8;
    border-color: rgba(48, 200, 215, 0.4);
  }
  .op-row-tag i, .op-row-tag .tabler-svg-icon { font-size: 9.5px; }
  .op-row-tag.op-row-aap {
    background: rgba(176, 121, 31, 0.13);
    color: #9a6614;
    border-color: rgba(176, 121, 31, 0.4);
  }
  [data-theme="dark"] .op-row-tag.op-row-aap {
    background: rgba(220, 170, 70, 0.16);
    color: #e3b768;
    border-color: rgba(220, 170, 70, 0.4);
  }
  /* Pastille jalon prévu / réel (cliquable en mode édition pour basculer) */
  .jalon-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: var(--radius-pill);
    font-size: 11px; font-weight: 600; white-space: nowrap;
    border: 1px solid transparent; cursor: pointer;
    user-select: none; transition: filter .12s ease;
  }
  .jalon-pill i, .jalon-pill .tabler-svg-icon { font-size: 11px; }
  .jalon-pill.prev { background: rgba(176,121,31,0.12); color: #9a6614; border-color: rgba(176,121,31,0.35); }
  .jalon-pill.reel { background: rgba(31,158,110,0.13); color: #1f7a5a; border-color: rgba(31,158,110,0.40); }
  .jalon-pill:hover { filter: brightness(0.95); }
  [data-theme="dark"] .jalon-pill.prev { background: rgba(220,170,70,0.16); color: #e3b768; border-color: rgba(220,170,70,0.40); }
  [data-theme="dark"] .jalon-pill.reel { background: rgba(48,190,140,0.18); color: #5fd9aa; border-color: rgba(48,190,140,0.40); }
  .op-tags-wrap {
    display: inline-flex; flex-wrap: wrap; align-items: center;
    gap: 4px; margin-left: 4px;
  }
  .op-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 9px; border-radius: var(--radius-lg);
    font-size: 11.5px; font-weight: 600;
    background: rgba(24, 178, 192, 0.12);
    color: #007a85;
    border: 1px solid rgba(24, 178, 192, 0.35);
    cursor: pointer;
    transition: background 0.1s;
  }
  [data-theme="dark"] .op-tag {
    background: rgba(48, 200, 215, 0.15);
    color: #5edae8;
    border-color: rgba(48, 200, 215, 0.4);
  }
  .op-tag:hover { background: rgba(24, 178, 192, 0.25); }
  .op-tag i, .op-tag .tabler-svg-icon { font-size: 11px; }
  .op-tag-editing { cursor: default; padding-right: 4px; }
  .op-tag-editing:hover { background: rgba(24, 178, 192, 0.12); }
  .op-tag-remove {
    border: none; background: transparent;
    color: #007a85; cursor: pointer;
    padding: 0 4px; margin-left: 2px;
    font-size: 16px; line-height: 1;
    border-radius: 50%;
  }
  [data-theme="dark"] .op-tag-remove { color: #5edae8; }
  .op-tag-remove:hover { background: rgba(216, 90, 48, 0.2); color: var(--danger-text); }
  .op-tag-add {
    display: inline-flex; align-items: center;
  }
  .op-tag-add input {
    padding: 3px 9px; border-radius: var(--radius-lg);
    font-size: 11.5px; font-family: inherit;
    border: 1px dashed var(--border-color-strong);
    background: var(--bg-primary); color: var(--text-primary);
    min-width: 140px;
  }
  .op-tag-add input:focus {
    outline: none; border-color: var(--info-accent);
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.15);
  }

  /* Tag popover (shows ops linked by a tag) */
  .tag-linked-popover {
    position: fixed; z-index: 1000;
    min-width: 320px; max-width: 460px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    overflow: hidden;
  }
  .tag-linked-head {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 14px; font-size: 13px; font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
  }
  .tag-linked-head i, .tag-linked-head .tabler-svg-icon { color: #007a85; }
  .tag-linked-close {
    margin-left: auto; border: none; background: transparent;
    color: var(--text-tertiary); cursor: pointer;
    font-size: 18px; padding: 0 6px; line-height: 1;
  }
  .tag-linked-close:hover { color: var(--text-primary); }
  .tag-linked-empty {
    padding: 16px; font-size: 13px; color: var(--text-tertiary); font-style: italic;
    text-align: center;
  }
  .tag-linked-list {
    list-style: none; margin: 0; padding: 6px;
    max-height: 320px; overflow-y: auto;
  }
  .tag-linked-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 13px;
  }
  .tag-linked-list li:hover { background: var(--bg-secondary); }
  .tag-linked-code {
    font-size: 10.5px; font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 6px; border-radius: var(--radius-xs);
    flex-shrink: 0;
  }
  .tag-linked-name {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text-primary); font-weight: 500;
  }
  .tag-linked-phase {
    font-size: 9.5px; font-weight: 700;
    padding: 2px 7px; border-radius: var(--radius-md);
    text-transform: uppercase; letter-spacing: 0.4px;
    flex-shrink: 0;
  }

  /* Suivi view */
  .suivi-selector {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
  }
  .suivi-selector-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
  .suivi-selector-select {
    flex: 0 0 280px; padding: 7px 10px;
    background: var(--bg-primary); color: var(--text-primary);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
    font-family: inherit;
  }
  .suivi-selector-meta {
    margin-left: auto; font-size: 12px;
    color: var(--text-tertiary); font-style: italic;
  }

  .suivi-kpis {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }
  .suivi-kpi {
    padding: 14px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--border-color-strong);
    text-align: center;
  }
  .suivi-kpi-num {
    font-size: 26px; font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
  }
  .suivi-kpi-label {
    font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-top: 4px;
  }
  .suivi-kpi-zero { opacity: 0.55; }
  .suivi-kpi-total { border-left-color: var(--info-accent); }
  .suivi-kpi-expired { border-left-color: var(--danger-accent); }
  .suivi-kpi-expired .suivi-kpi-num { color: var(--danger-text); }
  .suivi-kpi-critical { border-left-color: var(--coral-accent); }
  .suivi-kpi-critical .suivi-kpi-num { color: var(--coral-text); }
  .suivi-kpi-warning { border-left-color: var(--warning-accent); }
  .suivi-kpi-warning .suivi-kpi-num { color: var(--warning-text); }
  .suivi-kpi-info { border-left-color: var(--info-accent); }
  .suivi-kpi-info .suivi-kpi-num { color: var(--info-text); }
  .suivi-kpi-clean { border-left-color: var(--success-accent); }
  .suivi-kpi-clean .suivi-kpi-num { color: var(--success-text); }

  @media (max-width: 1100px) {
    .suivi-kpis { grid-template-columns: repeat(3, 1fr); }
  }

  .suivi-ops-list {
    display: flex; flex-direction: column; gap: 10px;
  }
  .suivi-op-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow 0.1s;
  }
  .suivi-op-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
  .suivi-op-clean { opacity: 0.7; }
  .suivi-op-clean:hover { opacity: 1; }
  .suivi-op-head {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; cursor: pointer;
  }
  .suivi-op-info {
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
  }
  .suivi-op-code {
    font-size: 11px; font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 7px; border-radius: var(--radius-xs);
    flex-shrink: 0;
  }
  .suivi-op-name {
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
  }
  .suivi-op-phase {
    font-size: 9.5px; font-weight: 700;
    padding: 2px 7px; border-radius: var(--radius-md);
    text-transform: uppercase; letter-spacing: 0.4px;
    flex-shrink: 0;
  }
  .suivi-op-meta {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
  }
  .suivi-role-tag {
    font-size: 10.5px; font-weight: 600;
    padding: 3px 8px; border-radius: var(--radius-xs);
    background: var(--purple-bg); color: var(--purple-text);
  }
  .suivi-op-alert-summary { display: flex; gap: 3px; }
  .suivi-op-alert-summary .alert-pill { padding: 2px 7px; }
  .suivi-op-clean-tag {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 10.5px; font-weight: 700;
    padding: 3px 8px; border-radius: var(--radius-xs);
    background: var(--success-bg); color: var(--success-text);
    text-transform: uppercase; letter-spacing: 0.4px;
  }
  .suivi-op-clean-tag i, .suivi-op-clean-tag .tabler-svg-icon { font-size: 11px; }
  .suivi-op-arrow {
    color: var(--text-tertiary); font-size: 14px;
    margin-left: 4px;
  }
  .suivi-alerts-list {
    list-style: none; margin: 0;
    padding: 4px 16px 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
  }

  .suivi-empty-state {
    padding: 40px; text-align: center;
    background: var(--bg-primary);
    border: 1px dashed var(--border-color-strong);
    border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 14px;
  }
  .suivi-empty-state i, .suivi-empty-state .tabler-svg-icon {
    display: block; margin: 0 auto 10px;
    font-size: 32px; color: var(--success-accent);
  }

  /* Suivi - tâches priorisées */
  .suivi-cat-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 18px; }
  .suivi-cat-chip {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--border-color); background: var(--bg-primary);
    color: var(--text-secondary); border-radius: var(--radius-pill); padding: 4px 11px;
    font-size: 12px; font-weight: 600; cursor: pointer; transition: all .12s;
  }
  .suivi-cat-chip:hover { background: var(--bg-secondary); }
  .suivi-cat-chip.active { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); }
  .suivi-cat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .suivi-tasks { display: flex; flex-direction: column; gap: 20px; }
  .suivi-group-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: var(--text-primary);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 9px;
  }
  .suivi-group-dot { width: 10px; height: 10px; border-radius: 50%; }
  .suivi-group-g1 .suivi-group-dot { background: #c0392b; }
  .suivi-group-g2 .suivi-group-dot { background: #e07a1f; }
  .suivi-group-g3 .suivi-group-dot { background: #2f6fb3; }
  .suivi-group-g4 .suivi-group-dot { background: #97a2b0; }
  .suivi-group-count {
    margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--text-tertiary);
    background: var(--bg-tertiary); border-radius: var(--radius-pill); padding: 1px 8px;
  }
  .suivi-group-body { display: flex; flex-direction: column; gap: 7px; }
  .suivi-task {
    display: flex; align-items: stretch; gap: 12px;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: 10px; padding: 11px 14px 11px 0; cursor: pointer; transition: all .12s;
    overflow: hidden;
  }
  .suivi-task:hover { border-color: var(--border-color-strong); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
  .suivi-task-bar { width: 4px; flex-shrink: 0; border-radius: 4px 0 0 4px; background: #97a2b0; }
  .suivi-task-l1 .suivi-task-bar { background: #c0392b; }
  .suivi-task-l2 .suivi-task-bar { background: #e07a1f; }
  .suivi-task-l3 .suivi-task-bar { background: #2f6fb3; }
  .suivi-task-l4 .suivi-task-bar { background: #97a2b0; }
  .suivi-task-main { flex: 1; min-width: 0; }
  .suivi-task-action { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
  .suivi-task-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; }
  .suivi-task-cat { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); border: 1px solid; white-space: nowrap; }
  .suivi-task-op { color: var(--text-secondary); }
  .suivi-task-detail { color: var(--text-tertiary); font-style: italic; }
  .suivi-task-ech {
    flex-shrink: 0; align-self: center; text-align: right;
    font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
    display: flex; flex-direction: column; gap: 2px;
  }
  .suivi-task-date { font-size: 11px; font-weight: 500; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
  .suivi-task-overdue .suivi-task-ech { color: #c0392b; }


  /* Geo panel inside Localisation section */
  .loc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 10px;
  }
  .loc-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .loc-left .geo-panel { margin-top: auto; }
  .loc-fields { min-width: 0; }
  .loc-map-col { min-width: 0; display: flex; flex-direction: column; }
  .loc-map-wrap {
    display: flex; flex-direction: column;
    flex: 1; min-height: 320px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
  }
  .loc-map {
    flex: 1; width: 100%; min-height: 320px;
    background: var(--bg-tertiary);
    position: relative;
    z-index: 0;
    isolation: isolate;
  }
  .loc-map-empty {
    flex: 1; min-height: 320px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color-strong);
    border-radius: var(--radius-md);
    text-align: center;
  }
  .loc-map-empty i, .loc-map-empty .tabler-svg-icon {
    font-size: 32px; color: var(--text-tertiary); margin-bottom: 8px;
  }
  .loc-map-empty p {
    margin: 0; font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
  }
  .loc-map-empty-hint {
    margin-top: 4px !important;
    font-size: 11.5px !important; font-weight: 400 !important;
    color: var(--text-tertiary) !important; font-style: italic;
    max-width: 280px;
  }
  @media (max-width: 1100px) {
    .loc-grid { grid-template-columns: 1fr; }
    .loc-map-wrap, .loc-map-empty { min-height: 220px; }
  }

  /* Map Plan/Satellite toggle (custom Leaflet control) */
  .map-layer-toggle {
    display: flex;
    background: white;
    border-radius: var(--radius-xs);
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.2);
    background-clip: padding-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  .map-layer-btn {
    border: none; background: white;
    padding: 6px 12px;
    font-size: 12px; font-weight: 600;
    font-family: inherit; cursor: pointer;
    color: #333;
    transition: background 0.1s;
  }
  .map-layer-btn:hover { background: #f0f0f0; }
  .map-layer-btn.active {
    background: #185fa5; color: white;
  }
  .map-layer-btn.active:hover { background: #144d85; }

  /* Geo panel inside Localisation section (keeps button + status below the grid) */
  .geo-panel {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color-strong);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
  }
  .geo-panel-status {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px; color: var(--text-primary);
    flex: 1 1 auto;
  }
  .geo-panel-status i, .geo-panel-status .tabler-svg-icon { color: var(--info-accent); font-size: 14px; }
  .geo-panel-label { color: var(--text-tertiary); font-style: italic; font-size: 11.5px; }
  .geo-panel-btn {
    padding: 6px 12px; font-size: 12px; font-weight: 500;
    background: var(--info-accent); color: white;
    border: none; border-radius: var(--radius-xs);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .geo-panel-btn:hover { background: var(--info-text); }
  .geo-panel-btn i, .geo-panel-btn .tabler-svg-icon { font-size: 13px; }

  /* Map view */
  .map-filter-bar {
    display: flex; gap: 8px; align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
  }
  .map-filter-bar .synth-filter-input { flex: 1 1 240px; min-width: 200px; }
  .map-legend {
    display: flex; gap: 14px; align-items: center;
    padding: 8px 14px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap; font-size: 12px; color: var(--text-secondary);
  }
  .map-legend-item { display: inline-flex; align-items: center; gap: 5px; }
  .map-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    border: 1.5px solid white; box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
  }
  .map-legend-warning { margin-left: auto; color: var(--warning-text); font-style: italic; }
  .map-legend-warning i, .map-legend-warning .tabler-svg-icon { font-size: 13px; }
  .map-marker-icon { background: transparent; border: none; }
  .map-marker-pin {
    width: 22px; height: 22px; border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.1s;
  }
  .map-marker-pin:hover { transform: scale(1.2); }
  .map-popup { min-width: 200px; font-family: inherit; }
  .map-popup-code { font-size: 10.5px; font-weight: 600; color: var(--text-tertiary); }
  .map-popup-name { font-size: 14px; font-weight: 600; margin: 2px 0 6px; }
  .map-popup-meta { display: flex; gap: 6px; align-items: center; font-size: 11.5px; margin-bottom: 6px; flex-wrap: wrap; }
  .map-popup-phase { padding: 2px 7px; border-radius: var(--radius-md); font-weight: 700; font-size: 9.5px; text-transform: uppercase; }
  .map-popup-addr { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 8px; }
  .map-popup-open {
    width: 100%; padding: 6px 10px;
    background: var(--info-accent); color: white;
    border: none; border-radius: var(--radius-xs);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
  }
  .map-popup-open:hover { background: var(--info-text); }

  /* === Pop-up enrichi (map-popup-rich) === */
  .map-popup-rich { min-width: 260px; max-width: 290px; }
  .map-popup-header { padding-bottom: 8px; border-bottom: 1px solid var(--border-color); margin-bottom: 8px; }
  .map-popup-rich .map-popup-name { margin: 2px 0 4px; }
  .map-popup-rich .map-popup-addr {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.35;
  }
  .map-popup-rich .map-popup-addr i, .map-popup-rich .map-popup-addr .tabler-svg-icon { font-size: 12px; flex-shrink: 0; }
  .map-popup-loc { color: var(--text-secondary); }
  .map-popup-stats {
    display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-primary);
  }
  .map-popup-stat {
    display: flex; align-items: center; gap: 7px;
  }
  .map-popup-stat i, .map-popup-stat .tabler-svg-icon {
    color: var(--info-accent);
    font-size: 14px;
    width: 16px; flex-shrink: 0;
  }
  .map-popup-stat strong {
    color: var(--text-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .map-popup-people {
    display: flex; align-items: center; gap: 7px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xs);
    font-size: 11.5px;
    margin-bottom: 8px;
    line-height: 1.4;
  }
  .map-popup-people i, .map-popup-people .tabler-svg-icon {
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
  }
  .map-popup-rich .map-popup-open {
    display: flex; align-items: center; justify-content: center;
    gap: 4px;
  }
  .map-popup-rich .map-popup-open i, .map-popup-rich .map-popup-open .tabler-svg-icon { font-size: 14px; }
  .map-popup-alert-badge {
    margin-top: 8px;
    padding: 5px 8px;
    background: var(--warning-bg);
    color: var(--warning-text);
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    justify-content: center;
  }
  .map-popup-alert-badge i, .map-popup-alert-badge .tabler-svg-icon { font-size: 13px; }
  /* Override Leaflet default popup styling to match our theme */
  .leaflet-popup-content-wrapper {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
  }
  .leaflet-popup-tip { background: var(--bg-primary) !important; }
  [data-theme="dark"] .leaflet-tile { filter: brightness(0.65) saturate(0.85); }
  /* La carte Leaflet crée son propre contexte d'empilement borné (z-index:0)
     pour que ses panneaux/contrôles (jusqu'à ~1000) ne passent pas par-dessus
     la barre de navigation et son menu déroulant. */
  .leaflet-container { z-index: 0; }


  .alerts-panel {
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    border: 1px solid;
    overflow: hidden;
  }
  .alerts-panel-warning { background: var(--warning-bg); border-color: var(--warning-accent); }
  .alerts-panel-critical { background: var(--danger-bg); border-color: var(--danger-accent); }
  .alerts-panel-head {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; background: transparent; border: none;
    font-family: inherit; font-size: 13px; text-align: left;
    cursor: pointer;
    color: var(--warning-text);
  }
  .alerts-panel-critical .alerts-panel-head { color: var(--danger-text); }
  .alerts-panel-head > i, .alerts-panel-head > .tabler-svg-icon { font-size: 16px; flex-shrink: 0; }
  .alerts-panel-count { flex-shrink: 0; font-weight: 500; }
  .alerts-panel-summary { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
  .alert-pill {
    font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    text-transform: uppercase; letter-spacing: 0.4px;
  }
  .alert-pill-expired { background: var(--danger-accent); color: white; }
  .alert-pill-critical { background: var(--coral-accent); color: white; }
  .alert-pill-warning { background: var(--warning-accent); color: white; }
  .alert-pill-info { background: var(--info-accent); color: white; }
  .alerts-panel-list {
    list-style: none; margin: 0;
    padding: 4px 14px 12px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
  }
  .alert-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 0; font-size: 13px;
    border-bottom: 1px dotted var(--border-color);
  }
  .alert-item:last-child { border-bottom: none; }
  .alert-days {
    flex-shrink: 0; min-width: 88px;
    font-weight: 700; font-size: 11.5px;
    padding: 3px 8px; border-radius: var(--radius-xs);
    text-align: center;
    font-variant-numeric: tabular-nums;
  }
  .alert-expired .alert-days { background: var(--danger-accent); color: white; }
  .alert-critical .alert-days { background: var(--coral-accent); color: white; }
  .alert-warning .alert-days { background: var(--warning-accent); color: white; }
  .alert-info .alert-days { background: var(--info-bg); color: var(--info-text); }
  .alert-msg { flex: 1; color: var(--text-primary); }

  /* Validation panel - inconsistency warnings */
  .validation-panel {
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    border: 1px solid;
    overflow: hidden;
  }
  .validation-panel-warning {
    background: var(--warning-bg); border-color: var(--warning-accent);
  }
  .validation-panel-error {
    background: var(--danger-bg); border-color: var(--danger-accent);
  }
  .validation-panel-head {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; background: transparent; border: none;
    font-family: inherit; font-size: 13px; text-align: left;
    cursor: pointer;
    color: var(--warning-text);
  }
  .validation-panel-error .validation-panel-head { color: var(--danger-text); }
  .validation-panel-head > i, .validation-panel-head > .tabler-svg-icon { font-size: 16px; flex-shrink: 0; }
  .validation-panel-count { flex: 1 1 auto; }
  .validation-panel-hint {
    font-size: 11px; color: var(--text-tertiary); font-style: italic;
  }
  .validation-panel-list {
    list-style: none; margin: 0;
    padding: 4px 14px 12px 44px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
  }
  .validation-issue {
    padding: 5px 0 5px 14px; font-size: 12.5px;
    color: var(--text-primary);
    position: relative;
    border-bottom: 1px dotted var(--border-color);
  }
  .validation-issue:last-child { border-bottom: none; }
  .validation-issue::before {
    content: '•'; position: absolute; left: 0; top: 5px;
    color: var(--warning-accent); font-weight: 700;
  }
  .validation-error::before { color: var(--danger-accent); }

  /* SharePoint mini icon in entity card heads */
  .sharepoint-mini {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: var(--radius-xs);
    color: var(--info-text); background: var(--info-bg);
    text-decoration: none;
    transition: transform 0.1s, background 0.1s;
    flex-shrink: 0;
  }
  .sharepoint-mini:hover { background: var(--info-accent); color: white; transform: scale(1.08); }
  .sharepoint-mini i, .sharepoint-mini .tabler-svg-icon { font-size: 13px; }

  /* SharePoint link icon next to a jalon (pret timeline) */
  .jalon-sp-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin-left: 4px;
    border-radius: var(--radius-xs); vertical-align: middle;
    color: var(--info-text); background: var(--info-bg);
    text-decoration: none;
    transition: all 0.1s;
  }
  .jalon-sp-link:hover { background: var(--info-accent); color: white; }
  .jalon-sp-link i, .jalon-sp-link .tabler-svg-icon { font-size: 11px; }

  /* Theme toggle button */
  .theme-toggle {
    background: transparent; border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary);
    padding: 0;
    margin-right: 0;
  }
  .theme-toggle:hover { background: var(--bg-secondary); color: var(--text-primary); }
  .theme-toggle i, .theme-toggle .tabler-svg-icon { font-size: 16px; }
  .theme-toggle .theme-icon-light { display: none; }
  [data-theme="dark"] .theme-toggle .theme-icon-dark { display: none; }
  [data-theme="dark"] .theme-toggle .theme-icon-light { display: inline-block; }
  .theme-toggle svg.tabler-svg-icon { width: 16px; height: 16px; }
  /* Easter egg : mode arc-en-ciel (calque teinté, n'altère pas la mise en page) */
  #rainbowFx { position: fixed; inset: 0; z-index: 99990; pointer-events: none; opacity: 0.38; mix-blend-mode: hue;
    background: linear-gradient(60deg, #ff0040, #ff8000, #ffe000, #00e000, #00e0e0, #0040ff, #a000ff, #ff0040);
    background-size: 400% 400%; animation: rainbowMove 7s linear infinite; }
  @keyframes rainbowMove { 0% { background-position: 0% 50%; } 100% { background-position: 400% 50%; } }
  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-tertiary); color: var(--text-primary);
    font-size: 14px; line-height: 1.5;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  }

  .view { display: none; }
  .view.active { display: block; }
  .topnav {
    background: var(--bg-primary); border-bottom: 1px solid var(--border-color);
    padding: 0 24px; display: flex; align-items: center; gap: 16px;
    height: 56px; position: sticky; top: 0; z-index: 1500;
  }
  .topnav-brand { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
  .topnav-brand i { color: var(--info-accent); }
  .topnav-brand-logo {
    height: 28px;
    width: auto;
    display: block;
    flex-shrink: 0;
  }
  /* Léger ajustement en mode sombre pour que le logo reste lisible */
  [data-theme="dark"] .topnav-brand-logo {
    filter: brightness(1.15);
  }

  /* === Écran de chargement Axentia === */
  .loading-splash {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  .loading-splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .loading-splash-logo {
    width: 280px;
    max-width: 60vw;
    height: auto;
    animation: splashLogoFade 0.6s ease;
  }
  [data-theme="dark"] .loading-splash-logo {
    filter: brightness(1.15);
  }
  .loading-splash-product {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: -10px;
  }
  .loading-splash-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--info-accent);
    border-radius: 50%;
    animation: splashSpin 0.8s linear infinite;
    margin-top: 8px;
  }
  .loading-splash-msg {
    font-size: 13px;
    color: var(--text-secondary);
  }
  @keyframes splashSpin { to { transform: rotate(360deg); } }
  @keyframes splashLogoFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .topnav-tabs {
    display: flex; gap: 0; flex: 1; margin-left: 24px; align-items: center;
    min-width: 0;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: thin;
  }
  .topnav-tabs::-webkit-scrollbar { height: 4px; }
  .topnav-tabs::-webkit-scrollbar-thumb { background: var(--border-color-strong); border-radius: 2px; }
  .topnav-group { display: flex; gap: 2px; flex-shrink: 0; }
  .topnav-sep {
    width: 1px; height: 24px;
    background: var(--border-color);
    margin: 0 8px;
    flex-shrink: 0;
  }
  .topnav-spacer { flex: 1; min-width: 12px; flex-shrink: 0; }

  /* Adaptation aux écrans laptop (≤ 1500 px) - densifier la navbar */
  @media (max-width: 1500px) {
    .topnav { padding: 0 14px; gap: 12px; }
    .topnav-tabs { margin-left: 12px; }
    .topnav-sep { margin: 0 4px; }
    .topnav-tab { padding: 8px 9px; font-size: 12.5px; gap: 5px; }
    .topnav-user { gap: 6px; }
  }
  @media (max-width: 1024px) { .topnav-user span { display: none; } }
  /* Écrans plus serrés (≤ 1280 px) - encore plus compact */
  @media (max-width: 1280px) {
    .topnav { padding: 0 10px; gap: 8px; }
    .topnav-tabs { margin-left: 8px; }
    .topnav-tab { padding: 7px 7px; font-size: 12px; gap: 4px; }
    .topnav-tab i, .topnav-tab .tabler-svg-icon { font-size: 14px; }
    .topnav-sep { margin: 0 2px; }
    .topnav-brand { font-size: 14px; }
  }

  .topnav-tab {
    padding: 8px 12px; border-radius: var(--radius-md); font-size: 13px;
    color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
    display: flex; align-items: center; gap: 6px; font-weight: 500;
    position: relative;
    border-bottom: 2px solid transparent;
  }
  .topnav-tab:hover { background: var(--bg-secondary); color: var(--text-primary); }

  /* Badge compteur sur l'onglet (ex: nb workflows en attente) */
  .topnav-badge {
    background: var(--warning-accent, #ba7517);
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    margin-left: 2px;
  }

  /* Group color accents on hover and when active */
  .topnav-group-pilotage .topnav-tab.active {
    background: var(--info-bg); color: var(--info-text);
    border-bottom-color: var(--info-accent);
  }
  .topnav-group-pilotage .topnav-tab:hover:not(.active) {
    border-bottom-color: rgba(24, 95, 165, 0.3);
  }

  .topnav-group-docs .topnav-tab.active {
    background: rgba(147, 51, 234, 0.10); color: var(--purple-text);
    border-bottom-color: var(--purple-accent);
  }
  .topnav-group-docs .topnav-tab:hover:not(.active) {
    border-bottom-color: rgba(147, 51, 234, 0.3);
  }

  .topnav-group-analyses .topnav-tab.active {
    background: var(--success-bg); color: var(--success-text);
    border-bottom-color: var(--success-accent);
  }
  .topnav-group-analyses .topnav-tab:hover:not(.active) {
    border-bottom-color: rgba(29, 158, 117, 0.3);
  }

  .topnav-group-admin .topnav-tab {
    font-size: 12px; opacity: 0.7;
  }
  .topnav-group-admin .topnav-tab:hover { opacity: 1; }
  .topnav-group-admin .topnav-tab.active {
    background: var(--bg-secondary); color: var(--text-primary);
    border-bottom-color: var(--text-tertiary);
    opacity: 1;
  }

  /* === Dropdown Admin (hover) === */
  .topnav-dropdown { position: relative; }
  .topnav-dropdown-trigger {
    cursor: default;
    padding: 8px 12px;
    display: flex; align-items: center; gap: 6px;
    color: var(--text-secondary);
    font-size: 13px; font-weight: 500;
    border-radius: var(--radius-md);
    transition: background 0.15s, color 0.15s;
    user-select: none;
  }
  .topnav-dropdown:hover .topnav-dropdown-trigger {
    background: var(--bg-secondary); color: var(--text-primary);
  }
  .topnav-dropdown-chevron {
    font-size: 12px !important; transition: transform 0.2s;
  }
  .topnav-dropdown:hover .topnav-dropdown-chevron { transform: rotate(180deg); }
  .topnav-dropdown-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 180px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 4px;
    display: none;
    flex-direction: column;
    gap: 1px;
    z-index: 110;
  }
  .topnav-dropdown:hover .topnav-dropdown-menu { display: flex; }
  /* Pont invisible pour éviter que le hover se perde entre trigger et menu */
  .topnav-dropdown::before {
    content: '';
    position: absolute;
    top: 100%; left: 0; right: 0;
    height: 12px;
    pointer-events: auto;
  }
  .topnav-dropdown-menu .topnav-tab {
    width: 100%;
    padding: 8px 12px;
    border-bottom: none !important;
    border-radius: var(--radius-md);
    font-size: 13px;
    opacity: 1 !important;
    cursor: pointer;
  }
  .topnav-dropdown-menu .topnav-tab:hover {
    background: var(--bg-secondary);
  }
  .topnav-dropdown-menu .topnav-tab.active {
    background: var(--info-bg); color: var(--info-text);
  }
  /* Trigger marqué actif si une des sous-options est active */
  .topnav-dropdown:has(.topnav-tab.active) .topnav-dropdown-trigger { color: var(--info-text); font-weight: 600; }
  .topnav-search { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); color: var(--text-tertiary); flex-shrink: 1; min-width: 130px; width: 240px; }
  .topnav-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); flex-shrink: 0; white-space: nowrap; }
  .topnav-search:focus-within { background: var(--bg-primary); border-color: var(--info-accent); box-shadow: 0 0 0 2px rgba(24,95,165,0.12); }
  .topnav-search-input { flex: 1; border: none; background: transparent; outline: none; font-size: 13px; color: var(--text-primary); min-width: 0; }
  .topnav-search-kbd { font-size: 10px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-xs); padding: 1px 5px; color: var(--text-tertiary); }
  .cmdp-dropdown { position: fixed; width: 460px; max-width: 90vw; max-height: 64vh; overflow-y: auto; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: 0 20px 50px -12px rgba(0,0,0,0.35); z-index: 100001; padding: 6px; }
  @media (max-width: 1280px) { .topnav-search { width: 190px; } .topnav-search-kbd { display: none; } }
  .cmdp-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-md); cursor: pointer; }
  .cmdp-item.active { background: var(--info-bg); }
  .cmdp-kind { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-tertiary); background: var(--bg-tertiary); padding: 2px 7px; border-radius: var(--radius-pill); flex-shrink: 0; min-width: 72px; text-align: center; }
  .cmdp-label { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; max-width: 48%; }
  .cmdp-sub { color: var(--text-tertiary); font-size: 12px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; text-align: right; }
  .cmdp-empty { padding: 18px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
  .jalon-montant {
    font-size: 10.5px; color: var(--text-secondary);
    margin-top: 1px; font-variant-numeric: tabular-nums;
  }
  .jalon-sub {
    font-size: 9.5px; color: var(--text-tertiary); margin-top: 1px;
  }

  /* Previsional LO input styling */
  .previsional-input {
    color: var(--warning-text) !important;
    font-style: italic;
    background: rgba(250,238,218,0.3) !important;
    border-color: var(--warning-accent) !important;
  }

  /* Pieces attendues multi-select */
  .pieces-multiselect {
    display: flex; flex-wrap: wrap; gap: 4px 8px;
    padding: 6px 8px;
    border: 1px solid var(--border-color-strong); border-radius: var(--radius-xs);
    background: var(--bg-primary);
  }
  .piece-checkbox {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; cursor: pointer;
    padding: 2px 6px; border-radius: var(--radius-xs);
    color: var(--text-primary);
  }
  .piece-checkbox:hover { background: var(--bg-secondary); }
  .piece-checkbox input { margin: 0; cursor: pointer; }
  .piece-pill {
    font-size: 10.5px; padding: 2px 8px;
    background: var(--info-bg); color: var(--info-text);
    border-radius: 10px; white-space: nowrap;
  }
  .gar-coverage-status {
    font-size: 11px; font-weight: 500;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 4px;
  }
  .gar-coverage-status.complete { color: var(--success-text); }
  .gar-coverage-status.partial { color: var(--warning-text); }
  .gar-coverage-status.over { color: var(--danger-text); }
  .gar-coverage-status.none { color: var(--text-tertiary); }

  .gar-row {
    padding: 8px 0; border-top: 1px dashed var(--border-color);
    display: flex; gap: 10px; align-items: flex-start;
  }
  .gar-loan-card > .gar-row:nth-of-type(1) { border-top: 1px solid var(--border-color); margin-top: 4px; padding-top: 8px; }
  .gar-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
  .gar-row-content { flex: 1; min-width: 0; }
  .gar-row-line1 {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .gar-row-name { font-size: 12.5px; font-weight: 500; color: var(--text-primary); }
  .gar-row-pct {
    font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
    padding: 1px 6px; background: var(--bg-tertiary); border-radius: var(--radius-xs);
  }
  .gar-row-meta {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-secondary);
    margin-top: 3px;
  }
  .gar-row-meta i, .gar-row-meta .tabler-svg-icon { font-size: 12px; margin-right: 2px; vertical-align: text-bottom; }
  .gar-row-notes {
    margin-top: 5px; padding: 5px 8px;
    background: var(--bg-tertiary); border-radius: var(--radius-xs);
    font-size: 11px; color: var(--text-secondary);
    font-style: italic;
  }

  .gar-add-btn-mini {
    margin-top: 8px;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 6px; border: 1px dashed var(--border-color-strong);
    border-radius: var(--radius-md); cursor: pointer;
    color: var(--info-accent); font-size: 11.5px; font-weight: 500;
    background: transparent; transition: all 0.15s;
    font-family: inherit; width: 100%;
  }
  .gar-add-btn-mini:hover { background: var(--info-bg); border-color: var(--info-accent); }

  .gar-no-prets {
    padding: 14px; text-align: center;
    background: var(--bg-secondary); border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 12px; font-style: italic;
  }
  .gar-orphans-header {
    font-size: 11.5px; font-weight: 600; color: var(--warning-text);
    margin: 14px 0 4px; display: flex; align-items: center; gap: 5px;
  }

  /* SharePoint URL row (in op edit mode) */
  .op-sharepoint-row {
    display: flex; gap: 6px; align-items: center;
    margin: 0 0 10px;
  }
  .op-sharepoint-row > input {
    flex: 1; min-width: 0;
    font-size: 12px; padding: 5px 9px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  }
  .op-sharepoint-row > input:placeholder-shown {
    font-family: inherit;
  }
  .op-sharepoint-row .icon-btn {
    width: 30px; height: 30px; flex-shrink: 0;
  }
  .detail-badges { display: flex; gap: 6px; flex-wrap: wrap; }
  .badge-secondary { background: var(--bg-secondary); color: var(--text-secondary); font-size: 11px; padding: 2px 8px; border-radius: var(--radius-lg); }
  .badge-statut { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-lg); font-weight: 500; }

  .sidebar-create-btn {
    background: transparent; border: none; cursor: pointer;
    color: var(--info-accent); padding: 4px; border-radius: var(--radius-xs);
    margin-left: auto; display: flex; align-items: center; justify-content: center;
  }
  .sidebar-create-btn:hover { background: var(--info-bg); }
  .sidebar-create-btn .tabler-svg-icon { width: 16px; height: 16px; }
  .ops-shell:not(.expanded) .sidebar-create-btn,
  .ops-shell:not(.expanded) .sidebar-title { display: none; }

  .icon-btn.danger-btn { color: var(--danger-text); border-color: var(--danger-bg); }
  .icon-btn.danger-btn:hover { background: var(--danger-bg); border-color: var(--danger-accent); }

  .empty-tranches {
    padding: 20px; text-align: center;
    color: var(--text-tertiary); font-size: 13px;
  }
  .empty-tranches button {
    margin-top: 10px; padding: 6px 14px;
    background: var(--info-accent); color: white;
    border: none; border-radius: var(--radius-md);
    cursor: pointer; font-size: 12px; font-family: inherit;
  }
  .empty-tranches button:hover { background: var(--info-text); }
  .icon-btn {
    background: transparent; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-secondary);
  }
  .icon-btn:hover { background: var(--bg-secondary); }
  .icon-btn i { font-size: 16px; }
  .icon-btn svg { display: block; }
  .sharepoint-btn:hover { background: #e9f5f6 !important; border-color: #036C70 !important; }
  .sidebar-toggle:hover i { color: var(--info-accent); }
  /* SVG icon fallback (when Tabler CDN is unreachable) */
  .tabler-svg-icon {
    width: 1em; height: 1em; vertical-align: -0.15em;
    display: inline-block; flex-shrink: 0;
  }
  i.ti { font-size: 16px; }
  .icon-btn .tabler-svg-icon, .icon-btn-svg { width: 16px; height: 16px; }

  .metric-row { display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 8px; margin-bottom: 16px; }
  .metric-card { background: var(--bg-secondary); padding: 12px; border-radius: var(--radius-md); }
  .metric-label { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 500; }
  .metric-value { font-size: 18px; font-weight: 600; margin-top: 4px; color: var(--text-primary); }

  .section {
    border-top: 1px solid var(--border-color);
    padding-top: 14px; padding-left: 14px;
    margin-bottom: 14px;
    position: relative;
  }
  .section::before {
    content: ''; position: absolute;
    left: 0; top: 18px; bottom: 4px;
    width: 3px; border-radius: 2px;
    background: var(--neutral-accent);
    opacity: 0.55;
  }
  /* Section category colors - side bar */
  .section:has(.section-label.vol)::before    { background: var(--purple-accent); }
  .section:has(.section-label.fin)::before    { background: var(--info-accent); }
  .section:has(.section-label.loc)::before    { background: var(--success-accent); }
  .section:has(.section-label.team)::before   { background: var(--coral-accent); }
  .section:has(.section-label.cal)::before    { background: var(--warning-accent); }
  .section:has(.section-label.id)::before     { background: var(--info-accent); }
  .section:has(.section-label.agr)::before    { background: var(--success-accent); }
  .section:has(.section-label.sim)::before    { background: var(--info-accent); }
  .section:has(.section-label.loyer)::before  { background: var(--warning-accent); }
  .section:has(.section-label.montage)::before{ background: var(--coral-accent); }
  .section:has(.section-label.notes)::before  { background: var(--neutral-accent); }
  .section:has(.section-label.batiment)::before { background: var(--purple-accent); }
  .section:has(.section-label.comites)::before { background: var(--info-accent); }

  /* Section-label as colored pill */
  .section-label {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    padding: 4px 10px 4px 8px;
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    background: var(--bg-secondary); color: var(--text-secondary);
    border: 1px solid var(--border-color);
  }
  .section-label i, .section-label .tabler-svg-icon { font-size: 13px; }

  /* Per-category pill colors */
  .section-label.vol     { background: rgba(147, 51, 234, 0.10); color: var(--purple-text); border-color: rgba(147, 51, 234, 0.25); }
  .section-label.fin     { background: var(--info-bg); color: var(--info-text); border-color: rgba(24, 95, 165, 0.25); }
  .section-label.loc     { background: var(--success-bg); color: var(--success-text); border-color: rgba(29, 158, 117, 0.25); }
  .section-label.team    { background: rgba(216, 90, 48, 0.10); color: var(--coral-text); border-color: rgba(216, 90, 48, 0.25); }
  .section-label.cal     { background: var(--warning-bg); color: var(--warning-text); border-color: rgba(186, 117, 23, 0.25); }
  .section-label.id      { background: var(--info-bg); color: var(--info-text); border-color: rgba(24, 95, 165, 0.25); }
  .section-label.agr     { background: var(--success-bg); color: var(--success-text); border-color: rgba(29, 158, 117, 0.25); }
  .section-label.sim     { background: var(--info-bg); color: var(--info-text); border-color: rgba(24, 95, 165, 0.25); }
  .section-label.loyer   { background: var(--warning-bg); color: var(--warning-text); border-color: rgba(186, 117, 23, 0.25); }
  .section-label.conv-loc { background: var(--success-bg); color: var(--success-text); border-color: rgba(29, 158, 117, 0.25); }
  .section-label.montage { background: rgba(216, 90, 48, 0.10); color: var(--coral-text); border-color: rgba(216, 90, 48, 0.25); }
  .section-label.notes   { background: var(--bg-secondary); color: var(--text-secondary); }
  .section-label.batiment { background: rgba(147, 51, 234, 0.10); color: var(--purple-text); border-color: rgba(147, 51, 234, 0.25); }
  .section-label.comites { background: var(--info-bg); color: var(--info-text); border-color: rgba(24, 95, 165, 0.25); }

  /* Hide old ::before pseudo (the small trait) since we replaced it */
  .section-label::before { display: none; }
  .kv-row {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;
    column-gap: 16px;
    padding: 3px 0; font-size: 13px;
    align-items: baseline;
  }
  .kv-key { color: var(--text-secondary); }
  .kv-value { color: var(--text-primary); font-weight: 500; text-align: left; overflow-wrap: break-word; word-break: normal; min-width: 0; }
  .kv-value-empty { color: var(--text-tertiary); font-weight: 400; }

  .notes-block { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 10px 12px; font-size: 12px; color: var(--text-secondary); white-space: pre-wrap; }

  /* Tranche selector pills */
  /* === [RESTAURÉ] @media print (export PDF fiche opération) === */
  @media print {
    body.printing-op-detail .topnav,
    body.printing-op-detail .sidebar,
    body.printing-op-detail .tranche-detail,
    body.printing-op-detail .op-sticky-top .edit-toolbar,
    body.printing-op-detail .icon-btn,
    body.printing-op-detail .alerts-panel-head,
    body.printing-op-detail .validation-panel-head,
    body.printing-op-detail .stepper-advance,
    body.printing-op-detail .toast,
    body.printing-op-detail .history-modal-backdrop,
    body.printing-op-detail .tag-linked-popover,
    body.printing-op-detail #ganttSearchInput,
    body.printing-op-detail .compare-row { display: none !important; }
    body.printing-op-detail .ops-shell { display: block; }
    body.printing-op-detail .op-detail { width: 100% !important; max-width: 100% !important; }
    body.printing-op-detail .alerts-panel-list,
    body.printing-op-detail .validation-panel-list { display: block !important; }
    body.printing-op-detail .section { page-break-inside: avoid; }
    body.printing-op-detail .entity-card { page-break-inside: avoid; }
    body.printing-op-detail .op-sticky-top { position: static !important; }
  }
  /* === [RESTAURÉ-2] sidebar op-row, op-detail header, garanties détail, toggles, print === */
  .sidebar-header { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 10px; }
  .sidebar-search-input:focus { outline: none; border-color: var(--info-accent); background-color: var(--bg-primary); box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.12); }
  .sidebar-toggle:hover { background: var(--bg-secondary); }
  .sidebar-title { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
  .ops-shell:not(.expanded) .sidebar-title { display: none; }
  .op-row { padding: 9px 16px 10px; border-left: 3px solid transparent; cursor: pointer; transition: background 0.1s; }
  .op-row:hover { background: var(--bg-secondary); }
  .op-row.active { background: var(--info-bg); border-left-color: var(--info-accent); }
  .op-row.active .op-name { color: var(--info-text); }
  .op-row.active .op-meta { color: var(--info-accent); }
  .op-row-line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .op-name { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .op-code { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; font-variant-numeric: tabular-nums; }
  .op-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
  .op-team { font-size: 10.5px; color: var(--text-tertiary); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .op-row.active .op-team { color: var(--info-accent); opacity: 0.85; }
  .op-row-compact:hover { background: var(--bg-secondary); }
  .op-row-compact.active { background: var(--info-bg); border-left-color: var(--info-accent); }
  .op-row-compact.active .op-code-compact { color: var(--info-text); }
  .op-code-compact { font-size: 11px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; padding: 0 4px; }
  .op-sticky-top .phase-stepper-wrap { margin: 0; }
  .op-sticky-top .edit-toolbar { margin: 0; }
  .op-sticky-top .compare-row { margin: 0; }
  .op-sticky-top .snapshot-banner { margin: 0; }
  .detail-eyebrow { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
  .detail-title { font-size: 20px; font-weight: 600; margin: 2px 0 8px; color: var(--text-primary); }
  .gar-loan-title { font-weight: 600; font-size: 13px; color: var(--text-primary); }
  .gar-loan-amount { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; font-weight: 500; }
  .gar-segment:hover { filter: brightness(1.1); }
  .gar-coverage-status.relais { color: var(--info-text); font-weight: 500; }
  .gar-loan-card-non-garanti::before { background: var(--success-accent); }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-label { flex: 1; }
  .jalon-empty { border-left-color: var(--border-color); opacity: 0.6; }
  .jalon-prev { border-left-color: var(--warning-accent); background: rgba(250,238,218,0.4); }
  /* === [RESTAURÉ] Contrôles (tableaux + chips) === */
  .ctrl-block { border: 1px solid var(--border-color); border-radius: 10px; padding: 16px 18px; margin-bottom: 18px; }
  .ctrl-block-title { font-size: 13px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
  .ctrl-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .ctrl-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-tertiary); font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--border-color); }
  .ctrl-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); }
  .ctrl-table tfoot td { border-top: 2px solid var(--border-color); border-bottom: none; color: var(--text-primary); }
  .ctrl-chip { font-size: 10.5px; padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 600; white-space: nowrap; }
  .ctrl-chip-over { background: rgba(216,90,48,0.16); color: #d85a30; }
  .ctrl-chip-soon { background: var(--warning-bg); color: var(--warning-text); }
  .ctrl-chip-ok { background: var(--success-bg); color: var(--success-text); }
  .ctrl-chip-muted { color: var(--text-tertiary); }
/* === Mise en place des financements : radar portefeuille + steppers === */
  .fm2-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
  .fm2-filter { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; font-family: inherit; }
  .fm2-filter:hover { background: var(--bg-secondary); }
  .fm2-filter.active { background: var(--info-bg); color: var(--info-text); border-color: var(--info-accent); }
  .fm2-filter b { font-weight: 700; }
  .fm2-kpis { margin-left: auto; font-size: 11.5px; color: var(--text-tertiary); display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
  .fm2-kpis strong { color: var(--text-primary); }

  .fm2-row { border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 6px; background: var(--bg-primary); overflow: hidden; }
  .fm2-row[open] { border-color: var(--border-color-strong); box-shadow: 0 2px 10px -4px rgba(0,0,0,0.12); }
  .fm2-head { display: grid; grid-template-columns: 14px minmax(140px, 1.2fr) 1fr 0.8fr 0.7fr; gap: 12px; align-items: center; padding: 7px 12px; cursor: pointer; list-style: none; user-select: none; }
  .fm2-head::-webkit-details-marker { display: none; }
  .fm2-head:hover { background: var(--bg-secondary); }
  .fm2-chev { color: var(--text-tertiary); font-size: 12px; transition: transform 0.15s ease; }
  .fm2-row[open] .fm2-chev { transform: rotate(90deg); }
  .fm2-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fm2-cell { display: flex; align-items: center; gap: 7px; min-width: 0; }
  .fm2-cell-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-tertiary); width: 32px; flex-shrink: 0; }
  .fm2-dots { display: flex; gap: 3px; flex-wrap: wrap; }
  .fm2-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
  .fm2-dot.ok { background: var(--success-accent); }
  .fm2-dot.soon { background: var(--warning-accent); }
  .fm2-dot.over { background: #d85a30; }
  .fm2-dot.muted { background: var(--border-color-strong); }
  .fm2-cell-mt { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-left: 2px; margin-right: auto; padding-right: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .fm2-cell-empty { font-size: 11px; color: var(--text-tertiary); }

  .fm2-body { border-top: 1px solid var(--border-color); padding: 6px 12px 12px 26px; background: var(--bg-secondary); }
  .fm2-tr-code { display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-tertiary); margin: 10px 0 2px; }
  .fm2-line { display: grid; grid-template-columns: minmax(150px, 0.9fr) 80px 1.6fr; gap: 12px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--border-color); }
  .fm2-line:last-child { border-bottom: none; }
  .fm2-line.dim { opacity: 0.38; }
  .fm2-line-lib { font-size: 12px; color: var(--text-primary); min-width: 0; display: flex; align-items: baseline; gap: 6px; }
  .fm2-line-type { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-tertiary); flex-shrink: 0; width: 30px; }
  .fm2-line-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fm2-line-mt { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .fm2-stepper { display: flex; align-items: center; gap: 0; min-width: 0; overflow: hidden; }
  .fm2-step { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: var(--radius-pill); flex-shrink: 0; }
  .fm2-step em { font-style: normal; font-weight: 500; opacity: 0.75; font-size: 9.5px; }
  .fm2-step.done { background: var(--success-bg); color: var(--success-text); }
  .fm2-step.next { background: var(--warning-bg); color: var(--warning-text); }
  .fm2-step.todo { background: var(--bg-tertiary); color: var(--text-tertiary); }
  .fm2-step-link { width: 12px; height: 1px; background: var(--border-color-strong); flex-shrink: 0; }
  @media (max-width: 1100px) {
    .fm2-head { grid-template-columns: 14px 1fr; grid-auto-rows: auto; row-gap: 4px; }
    .fm2-line { grid-template-columns: 1fr; row-gap: 2px; }
    .fm2-line-mt { text-align: left; }
  }
  /* === [RESTAURÉ] Calendrier Comités === */
  .com-cal { border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 18px; background: var(--bg-secondary); }
  .com-cal-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
  .com-cal-nav { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); background: var(--bg-primary); color: var(--text-secondary); cursor: pointer; font-size: 17px; line-height: 1; }
  .com-cal-nav:hover { background: var(--bg-tertiary); }
  .com-cal-title { font-size: 14px; font-weight: 700; color: var(--text-primary); min-width: 150px; text-align: center; }
  .com-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .com-cal-dow { text-align: center; font-size: 10px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; padding-bottom: 4px; }
  .com-cal-day { min-height: 46px; border-radius: var(--radius-sm); border: 1px solid transparent; padding: 3px 4px; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; background: var(--bg-primary); }
  .com-cal-empty { background: transparent; }
  .com-cal-num { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
  .com-cal-tags { display: flex; flex-direction: column; gap: 2px; width: 100%; }
  .com-cal-tag { font-size: 9.5px; font-weight: 600; padding: 1px 4px; border-radius: var(--radius-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.45; }
  .com-cal-dots { display: flex; gap: 2px; flex-wrap: wrap; }
  .com-cal-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
  .com-cal-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
  .com-cal-li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; flex-wrap: wrap; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--bg-primary); }
  .com-cal-li-date { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 600; min-width: 78px; }
  .com-cal-li-op { color: var(--text-primary); font-weight: 500; flex: 1; min-width: 120px; }
  .com-cal-li-lieu { color: var(--text-tertiary); font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; }
  .com-cal-li-badge { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); }
  .com-cal-empty-msg { color: var(--text-tertiary); font-size: 12.5px; font-style: italic; padding: 6px 0; }
  /* === [RESTAURÉ] sidebar, garanties (barres de couverture), toggles, jalons === */
  .topnav-dropdown:has(.topnav-tab.active) .topnav-dropdown-trigger {
    color: var(--text-primary);
    background: var(--bg-secondary);
  }
  .topnav-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--info-bg); color: var(--info-text);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 12px;
  }
  .sidebar-sticky {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg-primary);
    padding-top: 12px;
    border-bottom: 1px solid var(--border-color);
  }
  .sidebar-search-input {
    width: 100%; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 6px 10px 6px 30px;
    font-size: 12px; font-family: inherit;
    color: var(--text-primary); background: var(--bg-secondary);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239b9994' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
    background-repeat: no-repeat; background-position: 9px center;
  }
  .sidebar-toggle {
    background: transparent; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 6px 8px; cursor: pointer;
    color: var(--text-secondary); display: flex; align-items: center;
  }
  .op-row-compact {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 8px 6px; cursor: pointer;
    border-left: 3px solid transparent;
  }
  .op-sticky-top {
    position: sticky; top: 0; z-index: 1100;
    background: var(--bg-primary);
    margin: 0 -24px 16px;
    padding: 14px 24px 0;
    display: flex; flex-direction: column; gap: 8px;
    border-bottom: 1px solid var(--border-color);
  }
  .op-sticky-top .detail-header {
    margin: 0; padding: 8px 0 12px;
    border-bottom: none;
  }
  .tranche-code-row {
    display: flex; align-items: center; gap: 6px;
    margin: -2px 0 8px; font-size: 12px;
  }
  .tranche-code-row label {
    color: var(--text-tertiary); font-size: 10px; text-transform: uppercase;
    letter-spacing: 0.3px; font-weight: 600; margin-right: 4px;
  }
  .tranche-code-row .editable-input {
    width: auto; flex: 0 1 220px; min-width: 0;
    font-size: 12px; padding: 3px 7px;
  }
  .gar-loan-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px 12px 16px;
    margin-bottom: 8px;
    position: relative;
    background: var(--bg-primary);
  }
  .gar-loan-card::before {
    content: ''; position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: 3px; border-radius: 0 2px 2px 0;
    background: var(--purple-accent);
  }
  .gar-loan-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px;
  }
  .gar-coverage-bar {
    display: flex; height: 22px;
    border-radius: var(--radius-xs); overflow: hidden;
    background: var(--neutral-bg);
    margin-bottom: 6px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
  }
  .gar-segment {
    display: flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 600; color: white;
    white-space: nowrap; padding: 0 6px;
    transition: filter 0.15s;
    overflow: hidden;
  }
  .gar-segment.uncovered {
    background: repeating-linear-gradient(45deg,
      var(--neutral-bg), var(--neutral-bg) 5px,
      var(--bg-primary) 5px, var(--bg-primary) 10px);
    color: var(--text-tertiary);
  }
  .gar-segment-prev {
    position: relative;
    opacity: 0.85;
  }
  .gar-segment-prev::after {
    content: ''; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(45deg,
      transparent, transparent 4px,
      rgba(255,255,255,0.35) 4px, rgba(255,255,255,0.35) 8px);
    pointer-events: none;
  }
  .gar-segment-relais {
    position: relative;
    opacity: 0.8;
    outline: 1.5px dashed rgba(0,0,0,0.4);
    outline-offset: -3px;
  }
  .gar-segment-relais::after {
    content: ''; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(135deg,
      transparent, transparent 5px,
      rgba(0,0,0,0.2) 5px, rgba(0,0,0,0.2) 10px);
    pointer-events: none;
  }
  .relais-tag {
    display: inline-block; padding: 1px 6px; border-radius: var(--radius-xs);
    font-size: 9.5px; font-weight: 700;
    background: rgba(0,0,0,0.06); color: var(--text-secondary);
    border: 1px dashed var(--text-tertiary); letter-spacing: 0.3px;
  }
  .gar-non-garanti-msg {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; margin-top: 4px;
    background: var(--success-bg); color: var(--success-text);
    border-radius: var(--radius-xs); font-size: 12px; font-weight: 500;
  }
  .gar-non-garanti-msg i, .gar-non-garanti-msg .tabler-svg-icon {
    font-size: 16px; color: var(--success-accent);
  }
  .toggle-row {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; user-select: none;
    padding: 4px 0; font-size: 12px; font-weight: 500;
    color: var(--text-primary);
  }
  .toggle-switch {
    position: relative; width: 36px; height: 20px; flex-shrink: 0;
  }
  .toggle-slider {
    position: absolute; inset: 0;
    background: var(--neutral-bg); border: 1px solid var(--border-color-strong);
    border-radius: 20px; transition: 0.2s; cursor: pointer;
  }
  .toggle-slider::before {
    content: ''; position: absolute; left: 1.5px; top: 0.5px;
    width: 15px; height: 15px; background: white;
    border-radius: 50%; transition: 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  }
  .toggle-switch input:checked + .toggle-slider {
    background: var(--info-accent); border-color: var(--info-accent);
  }
  .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
  }
  .jalons-timeline {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px; margin: 8px 0 4px;
  }
  .jalon {
    background: var(--bg-secondary); border-radius: var(--radius-xs);
    padding: 6px 8px;
    display: flex; flex-direction: column; min-width: 0;
    border-left: 2px solid var(--info-accent);
  }
  .jalon-label {
    font-size: 9.5px; font-weight: 600; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 2px;
  }
  .jalon-date {
    font-size: 11.5px; color: var(--text-primary); font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .jalon-date.previsional {
    color: var(--warning-text); font-style: italic;
    display: inline-flex; align-items: center; gap: 3px;
  }
  .jalon-date.previsional .prev-tag {
    font-size: 9px; padding: 1px 4px;
    background: var(--warning-bg); color: var(--warning-text);
    border-radius: 2px; font-weight: 600; font-style: normal;
    text-transform: uppercase; letter-spacing: 0.2px;
  }
  /* === [RESTAURÉ] Mise en page Opérations (ops-shell grid + sidebar + détail) === */
  .ops-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width, 96px) 1fr 1.15fr;
    height: calc(100vh - 56px); overflow: hidden;
    transition: grid-template-columns 0.2s ease;
  }
  .ops-shell.expanded { --sidebar-width: 260px; }
  @media (max-width: 1500px) {
    .ops-shell { grid-template-columns: var(--sidebar-width, 96px) 1fr 1.1fr; }
    .op-detail, .tranche-detail { padding-left: 18px; padding-right: 18px; }
  }
  @media (max-width: 1280px) {
    .ops-shell { grid-template-columns: var(--sidebar-width, 90px) 1fr 1fr; }
    .ops-shell.expanded { --sidebar-width: 220px; }
    .op-detail, .tranche-detail { padding-left: 14px; padding-right: 14px; }
  }
  @media (max-width: 1100px) {
    .ops-shell { grid-template-columns: var(--sidebar-width, 72px) 1fr 1fr; }
    .ops-shell.expanded { --sidebar-width: 200px; }
  }
  @media (max-width: 900px) {
    .ops-shell {
      grid-template-columns: var(--sidebar-width, 60px) 1fr;
      grid-template-rows: auto 1fr;
    }
    .ops-shell .sidebar { grid-row: span 2; }
    .op-detail { border-bottom: 2px solid var(--border-color); max-height: 50vh; }
    .tranche-detail { padding-left: 14px; padding-right: 14px; }
  }
  .sidebar { background: var(--bg-primary); border-right: 1px solid var(--border-color); overflow-y: auto; padding: 0; }
  .sidebar-search { padding: 0 12px 10px; }
  .sidebar-search-empty { padding: 12px 16px; font-size: 12px; color: var(--text-tertiary); font-style: italic; text-align: center; }
  .ops-shell:not(.expanded) .sidebar-search { display: none; }
  .ops-shell.expanded .op-row { display: block; }
  .ops-shell.expanded .op-row-compact { display: none; }
  .ops-shell:not(.expanded) .op-row { display: none; }
  .ops-shell:not(.expanded) .op-row-compact { display: flex; }
  .op-detail { background: var(--bg-primary); border-right: 1px solid var(--border-color); padding: 0 24px 20px; overflow-y: auto; }
  .detail-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    background: var(--bg-primary);
    margin: 12px -24px 16px;
    padding: 8px 24px 14px;
    border-bottom: 1px solid var(--border-color);
  }
  .tranche-detail { background: var(--bg-primary); padding: 0 24px 20px; overflow-y: auto; }
  .tranches-selector {
    position: sticky; top: 0; z-index: 5;
    background: var(--bg-primary);
    margin: 0 -24px 14px;
    padding: 14px 24px 12px;
    border-bottom: 1px solid var(--border-color);
  }
  .tranches-row { display: flex; gap: 6px; flex-wrap: wrap; }
  .tranche-pill {
    flex: 1 1 0; min-width: 150px;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 10px 12px; cursor: pointer; transition: all 0.15s;
    background: var(--bg-primary);
    display: flex; flex-direction: column; gap: 3px;
  }
  .tranche-pill:hover { border-color: var(--border-color-strong); }
  .tranche-pill.active { border-color: var(--info-accent); border-width: 2px; padding: 9px 11px; background: var(--info-bg); }
  .tranche-pill.active .tranche-pill-title { color: var(--info-text); }
  .tranche-pill-eyebrow {
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 600; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.3px;
    margin-bottom: 4px;
  }
  .tranche-pill-title { font-weight: 600; font-size: 13px; line-height: 1.3; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tranche-pill-stats { color: var(--text-secondary); font-size: 11px; margin-top: 4px; }
  .tranches-selector.compact { padding-top: 8px; padding-bottom: 8px; margin-bottom: 8px; box-shadow: 0 4px 10px -6px rgba(0,0,0,0.18); }
  .tranches-selector.compact .tranches-selector-head { display: none; }
  .tranches-selector.compact .tranche-pill { padding: 5px 10px; flex-direction: row; align-items: center; gap: 8px; }
  .tranches-selector.compact .tranche-pill-eyebrow { margin-bottom: 0; }
  .tranches-selector.compact .tranche-pill-stats { display: none; }
  .tranches-selector.compact .tranche-pill-title { font-size: 12px; }
  .tranches-selector.compact .tranche-pill-add { padding: 5px 10px; }
  .tranche-pill-badge { font-size: 10px; padding: 2px 6px; border-radius: var(--radius-md); font-weight: 500; white-space: nowrap; flex-shrink: 0; text-transform: none; letter-spacing: 0; }
  .tranche-pill-add {
    border-style: dashed !important;
    color: var(--info-accent) !important;
    background: transparent !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 500;
    font-size: 13px;
    text-align: center;
  }
  .tranche-pill-add:hover { background: var(--info-bg) !important; }
  .tranche-empty-state { color: var(--text-tertiary); text-align: center; padding: 40px; font-size: 13px; }

  .volumetrie-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 8px; }
  .vol-cell { text-align: center; background: var(--bg-secondary); padding: 8px 4px; border-radius: var(--radius-sm); }
  .vol-cell-label { color: var(--text-tertiary); font-size: 10px; font-weight: 600; }
  .vol-cell-value { font-weight: 600; margin-top: 2px; font-size: 14px; }
  .vol-cell-empty .vol-cell-value { color: var(--text-tertiary); }
  .vol-cell-surface {
    font-size: 10.5px; color: var(--text-secondary);
    margin-top: 1px; font-variant-numeric: tabular-nums;
  }
  .vol-cell-surface-empty { color: var(--text-tertiary); font-style: italic; }
  /* Edit mode: stacked input rows */
  .vol-cell-edit { padding: 6px 3px; }
  .vol-cell-edit-row {
    display: flex; align-items: center; gap: 2px;
    margin-top: 3px;
  }
  .vol-cell-input {
    flex: 1; min-width: 0; width: 100%;
    text-align: center; padding: 2px 3px;
    font-size: 12px;
  }
  .vol-cell-edit-unit {
    font-size: 9px; color: var(--text-tertiary);
    flex-shrink: 0; font-weight: 600;
  }

  /* Sub-entity rows (richer detail) */
  .subent-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
  .subent-title { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--text-primary); }
  .subent-title i, .subent-title .tabler-svg-icon { font-size: 16px; color: var(--text-secondary); }
  .subent-title.subv i, .subent-title.subv .tabler-svg-icon { color: var(--success-accent); }
  .subent-title.prets i, .subent-title.prets .tabler-svg-icon { color: var(--info-accent); }
  .subent-title.gar i, .subent-title.gar .tabler-svg-icon { color: var(--purple-accent); }
  .subent-title.prefin i, .subent-title.prefin .tabler-svg-icon { color: var(--warning-accent); }
  .subent-title.res i, .subent-title.res .tabler-svg-icon { color: var(--coral-accent); }
  .subent-aggr { font-size: 11px; color: var(--text-secondary); }
  .subent-empty { font-size: 12px; color: var(--text-tertiary); padding: 6px 0; font-style: italic; }
  .status-text-warning { color: var(--warning-accent); font-weight: 500; }
  .status-text-info { color: var(--info-accent); font-weight: 500; }
  .status-text-success { color: var(--success-text); font-weight: 500; }
  .status-text-coral { color: var(--coral-accent); font-weight: 500; }
  .status-text-neutral { color: var(--text-tertiary); }
  .status-text-danger { color: var(--danger-text); font-weight: 500; }
  .status-bg-success { background: var(--success-bg); color: var(--success-text); }
  .status-bg-warning { background: var(--warning-bg); color: var(--warning-text); }
  .status-bg-info { background: var(--info-bg); color: var(--info-text); }
  .status-bg-coral { background: var(--coral-bg); color: var(--coral-text); }
  .status-bg-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
  .status-bg-danger { background: var(--danger-bg); color: var(--danger-text); }
  .has-comment { color: var(--info-accent); cursor: help; font-size: 12px; }

  /* Entity cards (redesigned sub-entities) */
  .entity-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
  .entity-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px 10px 16px;
    font-size: 12px;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
  }
  .entity-card::before {
    content: ''; position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 2px 2px 0;
    background: var(--neutral-accent);
  }
  .entity-card[data-section="subventions"]::before { background: var(--success-accent); }
  .entity-card[data-section="prets"]::before { background: var(--info-accent); }
  .entity-card[data-section="garanties"]::before { background: var(--purple-accent); }
  .entity-card[data-section="prefinancements"]::before { background: var(--warning-accent); }
  .entity-card[data-section="reservataires"]::before { background: var(--coral-accent); }
  .entity-card:hover { border-color: var(--border-color-strong); }
  .entity-card.editing { border-color: var(--info-accent); background: var(--card-edit-bg); padding: 11px 13px 11px 17px; border-width: 1.5px; }
  .entity-card-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 8px; margin-bottom: 6px;
  }
  .entity-card-title { font-weight: 600; font-size: 13px; color: var(--text-primary); line-height: 1.3; }
  .entity-card-sub { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }
  .entity-card-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px 12px; margin-top: 4px;
  }
  .entity-card-stat { display: flex; flex-direction: column; min-width: 0; }
  .stat-label { font-size: 9.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
  .stat-val { font-size: 12px; color: var(--text-primary); font-weight: 500; margin-top: 1px; font-variant-numeric: tabular-nums; }
  .stat-val.muted { color: var(--text-tertiary); font-weight: 400; }
  .entity-card-meta {
    display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px;
    font-size: 11px; color: var(--text-secondary);
    padding-top: 6px; border-top: 1px dashed var(--border-color);
  }
  .entity-card-meta i { font-size: 12px; margin-right: 3px; vertical-align: text-bottom; }
  .entity-card-notes {
    margin-top: 6px; padding: 6px 9px;
    background: var(--bg-tertiary); border-radius: var(--radius-xs);
    font-size: 11px; color: var(--text-secondary);
    font-style: italic; white-space: pre-wrap; line-height: 1.4;
  }
  .entity-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
  .entity-card-actions button {
    background: transparent; border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); padding: 4px 7px; cursor: pointer;
    color: var(--text-secondary); font-size: 11px;
    display: inline-flex; align-items: center; gap: 2px;
  }
  .entity-card-actions button:hover { background: var(--bg-secondary); }
  .entity-card-actions button.danger:hover { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-accent); }

  .add-row-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px; border: 1px dashed var(--border-color-strong);
    border-radius: var(--radius-md); cursor: pointer;
    color: var(--text-secondary); font-size: 12px; font-weight: 500;
    background: transparent; transition: all 0.15s;
    font-family: inherit; margin-top: 6px;
  }
  .add-row-btn:hover { background: var(--info-bg); border-color: var(--info-accent); color: var(--info-text); }

  .card-input {
    border: 1px solid var(--border-color-strong); border-radius: var(--radius-xs);
    padding: 4px 8px; font-size: 12px; font-family: inherit;
    color: var(--text-primary); background: var(--bg-primary);
    width: 100%; min-width: 0;
  }
  .card-input:focus { outline: none; border-color: var(--info-accent); box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.15); }
  textarea.card-input { resize: vertical; }
  .card-auto-value {
    border: 1px dashed var(--border-color-strong); border-radius: var(--radius-xs);
    padding: 4px 8px; font-size: 12px; min-height: 26px;
    background: var(--bg-secondary); color: var(--text-secondary);
    display: flex; align-items: center;
    font-variant-numeric: tabular-nums;
  }
  /* Card edit: logical sub-groups for ergonomics */
  .card-edit-subgroup {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
  }
  .card-edit-subgroup:first-of-type {
    border-top: none; padding-top: 4px; margin-top: 0;
  }
  .card-edit-subgroup-title {
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
  }
  .card-edit-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
  }
  .card-edit-field { display: flex; flex-direction: column; min-width: 0; }
  .card-edit-field label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.2px; margin-bottom: 2px; font-weight: 600; }
  .card-edit-field.wide { grid-column: 1 / -1; }
  .auto-tag { font-size: 9px; color: var(--text-tertiary); font-style: italic; font-weight: 500; text-transform: lowercase; letter-spacing: 0; margin-left: 4px; }

  /* Dashboard */
  .dashboard { padding: 24px 32px; max-width: 1800px; margin: 0 auto; }
  .dashboard-title { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
  .dashboard-sub { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }
  .dashboard-section-title {
    font-size: 16px; font-weight: 600; margin: 32px 0 14px;
    color: var(--text-primary);
    padding-bottom: 8px; border-bottom: 1px solid var(--border-color);
  }

  /* PHASE STEPPER (top of op detail) */
  /* PHASE STEPPER (top of op detail) - compact horizontal layout */
  .phase-stepper-wrap {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .phase-stepper {
    display: flex; align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    /* Tighten when space is limited so we avoid horizontal scroll */
    flex-wrap: nowrap;
  }
  .stepper-item {
    display: flex; align-items: center; gap: 5px;
    flex: 0 0 auto;
    padding: 2px 0;
    min-width: 0;
  }
  .stepper-item.stepper-clickable { cursor: pointer; }
  .stepper-item[data-no-click] { cursor: default; opacity: 0.55; }
  .stepper-clickable:hover .stepper-name { color: var(--info-text); }
  /* Phase used as comparison reference: visual marker (still fully clickable) */
  .stepper-item.stepper-compare-ref .stepper-dot {
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.25);
  }
  .ref-tag {
    display: inline-block; margin-left: 5px;
    font-size: 9px; font-weight: 700;
    padding: 1px 5px; border-radius: var(--radius-md);
    background: var(--purple-bg); color: var(--purple-text);
    text-transform: uppercase; letter-spacing: 0.3px;
    vertical-align: middle;
  }
  .stepper-dot {
    width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    border: 2px solid var(--border-color-strong);
    background: white; color: var(--text-tertiary);
    transition: all 0.2s;
  }
  .stepper-dot i, .stepper-dot .tabler-svg-icon { font-size: 13px; }
  .stepper-past .stepper-dot { background: var(--success-accent); border-color: var(--success-accent); color: white; }
  .stepper-current .stepper-dot {
    background: var(--phase-accent, var(--info-accent));
    border-color: var(--phase-accent, var(--info-accent));
    color: white;
    box-shadow: 0 0 0 3px var(--phase-bg, var(--info-bg));
  }
  .stepper-viewing .stepper-dot {
    background: var(--warning-accent); border-color: var(--warning-accent); color: white;
    box-shadow: 0 0 0 3px var(--warning-bg);
  }
  .stepper-future .stepper-dot { background: var(--bg-primary); }
  .stepper-label {
    display: flex; flex-direction: column;
    min-width: 0;
    line-height: 1.15;
  }
  .stepper-name {
    font-size: 11.5px; font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
  }
  .stepper-past .stepper-name { color: var(--success-text); }
  .stepper-current .stepper-name { color: var(--phase-text, var(--info-text)); font-weight: 700; }
  .stepper-viewing .stepper-name { color: var(--warning-text); font-weight: 700; }
  .stepper-date {
    font-size: 9px; color: var(--text-tertiary); margin-top: 1px;
    white-space: nowrap;
  }
  .stepper-current-tag {
    display: inline-block; margin-top: 1px;
    padding: 0 5px; border-radius: var(--radius-xs);
    background: var(--phase-accent, var(--info-accent)); color: white;
    font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
    align-self: flex-start;
    line-height: 1.5;
  }
  .stepper-connector {
    flex: 1 1 auto;
    min-width: 12px;
    max-width: 40px;
    height: 2px;
    background: var(--border-color);
    margin: 0 2px;
    align-self: center;
  }
  .stepper-item.stepper-past + .stepper-connector,
  .stepper-item.stepper-past .stepper-connector { background: var(--success-accent); }
  .stepper-advance {
    flex-shrink: 0; white-space: normal;
    font-size: 10.5px; padding: 5px 10px;
    line-height: 1.15;
    display: inline-flex; align-items: center; gap: 6px;
    text-align: left;
    max-width: 180px;
  }
  .stepper-advance-text {
    display: flex; flex-direction: column; gap: 1px;
  }
  .stepper-advance-l1 {
    font-size: 9.5px; font-weight: 500; opacity: 0.85;
    text-transform: uppercase; letter-spacing: 0.3px;
    white-space: nowrap;
  }
  .stepper-advance-l2 {
    font-size: 11.5px; font-weight: 700;
    white-space: nowrap;
  }
  .stepper-advance i, .stepper-advance .tabler-svg-icon {
    flex-shrink: 0; font-size: 14px;
  }

  /* Phase badge in detail header */
  .phase-badge {
    font-size: 11px; padding: 3px 10px; border-radius: 10px;
    font-weight: 600; letter-spacing: 0.2px;
  }

  /* Snapshot consultation banner */
  .snapshot-banner {
    display: flex; gap: 12px; align-items: center;
    background: var(--warning-bg);
    border: 1px solid var(--warning-accent);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin: 0 0 12px;
    color: var(--warning-text); font-size: 13px;
  }
  .snapshot-banner i, .snapshot-banner .tabler-svg-icon { font-size: 18px; color: var(--warning-accent); flex-shrink: 0; }
  .snapshot-banner > div { flex: 1; }
  .snapshot-banner .btn-edit { flex-shrink: 0; }

  /* Compare-with row */
  .compare-row {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: var(--bg-secondary); border-radius: var(--radius-md);
    padding: 8px 12px; margin: 0 0 12px;
    font-size: 12px;
  }
  .compare-label { color: var(--text-secondary); font-weight: 500; }
  .compare-select {
    border: 1px solid var(--border-color-strong); border-radius: var(--radius-xs);
    padding: 4px 8px; font-size: 12px; font-family: inherit;
    background: var(--bg-primary); color: var(--text-primary); cursor: pointer;
  }
  .compare-active-tag {
    font-size: 10.5px; padding: 2px 8px;
    background: var(--warning-bg); color: var(--warning-text);
    border-radius: 10px; font-weight: 600;
  }

  /* Diff highlights (comparison mode) */
  .diff-changed {
    background: rgba(250, 238, 218, 0.5);
    padding: 1px 4px; border-radius: var(--radius-xs);
    border-bottom: 1.5px dotted var(--warning-accent);
    cursor: help;
  }
  .diff-mark {
    display: inline-block; margin-left: 3px;
    color: var(--warning-accent); font-weight: 700; font-size: 0.9em;
  }
  /* Whole-row / whole-card highlight when a diff is detected inside */
  .metric-card:has(.diff-changed) {
    background: rgba(250, 238, 218, 0.55);
    border: 1px solid var(--warning-accent);
    box-shadow: 0 0 0 1px rgba(186, 117, 23, 0.15);
  }
  .metric-card:has(.diff-changed) .diff-changed {
    background: transparent; border-bottom: none; padding: 0;
  }
  .kv-row:has(.diff-changed) {
    background: rgba(250, 238, 218, 0.4);
    border-radius: var(--radius-xs);
    padding-left: 8px; padding-right: 8px;
    margin-left: -8px; margin-right: -8px;
    box-shadow: inset 3px 0 0 var(--warning-accent);
  }
  .kv-row:has(.diff-changed) .diff-changed {
    background: transparent; border-bottom: none; padding: 0;
  }
  .vol-cell:has(.diff-changed) {
    background: rgba(250, 238, 218, 0.6);
    border-color: var(--warning-accent);
  }
  .vol-cell:has(.diff-changed) .diff-changed {
    background: transparent; border-bottom: none; padding: 0;
  }
  .notes-block.diff-changed {
    background: rgba(250, 238, 218, 0.4);
    padding: 8px 10px;
    box-shadow: inset 3px 0 0 var(--warning-accent);
  }
  /* Entity cards changed/added during compare */
  .entity-card.diff-entity-new,
  .gar-row.diff-entity-new {
    box-shadow: inset 3px 0 0 var(--success-accent);
    background: rgba(225, 245, 238, 0.35);
    position: relative;
  }
  .entity-card.diff-entity-new::after,
  .gar-row.diff-entity-new::after {
    content: '+ NOUVEAU'; position: absolute; top: 8px; right: 10px;
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px;
    color: var(--success-text); background: var(--success-bg);
    padding: 2px 6px; border-radius: var(--radius-xs);
  }
  .entity-card.diff-entity-modified,
  .gar-row.diff-entity-modified {
    box-shadow: inset 3px 0 0 var(--warning-accent);
    background: rgba(250, 238, 218, 0.25);
    position: relative;
  }
  .entity-card.diff-entity-modified::after,
  .gar-row.diff-entity-modified::after {
    content: '≠ MODIFIÉ'; position: absolute; top: 8px; right: 10px;
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px;
    color: var(--warning-text); background: var(--warning-bg);
    padding: 2px 6px; border-radius: var(--radius-xs);
  }
  /* Avoid overlap with built-in section bars on entity-card */
  .entity-card.diff-entity-new::before,
  .entity-card.diff-entity-modified::before { display: none; }
  /* Deleted entities (ghost card) */
  .entity-card.diff-entity-deleted {
    box-shadow: inset 3px 0 0 var(--danger-accent);
    background: rgba(252, 234, 234, 0.35);
    opacity: 0.7;
    position: relative;
    text-decoration: line-through;
    text-decoration-color: rgba(0,0,0,0.25);
  }
  .entity-card.diff-entity-deleted::before { display: none; }
  .entity-card.diff-entity-deleted::after {
    content: '− SUPPRIMÉ'; position: absolute; top: 8px; right: 10px;
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px;
    color: var(--danger-text); background: var(--danger-bg);
    padding: 2px 6px; border-radius: var(--radius-xs);
    text-decoration: none;
  }

  /* Gantt view */
  .gantt-edit-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
  .gantt-edit-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
  .gantt-switch { position: relative; width: 40px; height: 22px; }
  .gantt-switch input { opacity: 0; width: 0; height: 0; }
  .gantt-switch-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--neutral-bg); border: 1px solid var(--border-color-strong);
    border-radius: 22px; transition: 0.25s;
  }
  .gantt-switch-slider::before {
    content: ''; position: absolute; left: 2px; top: 1px;
    width: 16px; height: 16px; background: white;
    border-radius: 50%; transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .gantt-switch input:checked + .gantt-switch-slider { background: var(--info-accent); border-color: var(--info-accent); }
  .gantt-switch input:checked + .gantt-switch-slider::before { transform: translateX(18px); }

  .gantt-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    padding: 10px 16px; border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary); font-size: 11px; color: var(--text-secondary);
  }
  .gantt-legend-item { display: inline-flex; align-items: center; gap: 5px; }
  .gantt-dot-sample {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  }

  .gantt-wrap {
    background: var(--bg-primary);
    position: relative;
    display: flex; flex-direction: column;
  }
  .gantt-scroll-area {
    overflow-x: auto; overflow-y: auto;
    max-height: 70vh;
    position: relative;
  }
  .gantt-table {
    border-collapse: separate; border-spacing: 0;
    table-layout: fixed; width: max-content;
  }
  .gantt-table th, .gantt-table td { padding: 0; vertical-align: middle; }

  .gantt-table thead th {
    position: sticky; top: 0; z-index: 3;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color-strong);
    height: 40px;
  }
  .gantt-table thead th.gantt-side-header {
    position: sticky; left: 0; top: 0; z-index: 4;
    width: 240px; min-width: 240px;
    text-align: left; padding: 0 12px;
    font-size: 10.5px; font-weight: 600;
    color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px;
    border-right: 1px solid var(--border-color-strong);
  }
  .gantt-table thead th.gantt-axis-th {
    padding: 0;
  }

  .gantt-axis { position: relative; height: 40px; }
  .gantt-axis-year {
    position: absolute; top: 4px; height: 16px;
    font-size: 11px; font-weight: 600; color: var(--text-primary);
    padding-left: 6px;
    border-left: 1px solid var(--border-color-strong);
  }
  .gantt-axis-month {
    position: absolute; bottom: 4px; height: 14px;
    font-size: 9.5px; color: var(--text-tertiary);
    padding-left: 4px;
    border-left: 1px solid var(--border-color);
  }
  .gantt-axis-month.q1 { border-left-color: var(--border-color-strong); }

  .gantt-table tbody tr { height: 36px; }
  .gantt-table tbody td.gantt-side {
    position: sticky; left: 0; z-index: 5;
    background: var(--bg-primary);
    width: 280px; min-width: 280px;
    padding: 8px 12px;
    border-right: 1px solid var(--border-color-strong);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
  }
  .gantt-table tbody tr:hover td.gantt-side { background: var(--bg-secondary); z-index: 6; }
  .gantt-table tbody tr:hover td.gantt-track-cell { background: var(--bg-secondary); }
  .gantt-side-line1 {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; margin-bottom: 2px;
  }
  .gantt-side-line2 {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px;
  }
  .gantt-side .op-code-cell { font-size: 10.5px; color: var(--text-tertiary); font-weight: 600; }
  .gantt-side .op-name-cell { font-size: 13px; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
  .gantt-side-phase {
    font-size: 9px; font-weight: 700;
    padding: 2px 7px; border-radius: var(--radius-md);
    text-transform: uppercase; letter-spacing: 0.4px;
    flex-shrink: 0;
  }
  .gantt-side-tranches {
    font-size: 10px; color: var(--text-tertiary);
    background: var(--bg-tertiary); padding: 1px 5px; border-radius: var(--radius-xs);
    flex-shrink: 0; font-variant-numeric: tabular-nums;
  }

  .gantt-table tbody td.gantt-track-cell {
    padding: 0; border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
  }
  .gantt-track {
    position: relative; height: 44px;
    background-image: linear-gradient(to right, var(--border-color) 1px, transparent 1px);
  }

  /* Today line: more prominent with gradient */
  .gantt-today-line {
    position: absolute; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(to bottom, var(--coral-accent), rgba(216, 90, 48, 0.4));
    pointer-events: none; z-index: 1;
    box-shadow: 0 0 8px rgba(216, 90, 48, 0.3);
  }
  .gantt-today-badge {
    position: absolute;
    top: 4px;
    transform: translateX(-50%);
    background: var(--coral-accent); color: white;
    font-size: 9.5px; font-weight: 700;
    padding: 2px 7px 2px 5px;
    border-radius: 10px;
    white-space: nowrap;
    z-index: 4;
    display: inline-flex; align-items: center; gap: 2px;
    box-shadow: 0 2px 4px rgba(216, 90, 48, 0.35);
  }
  .gantt-today-badge i, .gantt-today-badge .tabler-svg-icon { font-size: 11px; }

  /* Phase bars (Acquisition, PC, Chantier, GPA) */
  .gantt-phase-bar {
    position: absolute;
    top: 50%; height: 14px;
    transform: translateY(-50%);
    border-radius: var(--radius-md);
    opacity: 0.22;
    z-index: 0;
    transition: opacity 0.15s;
    overflow: hidden;
    display: flex; align-items: center;
  }
  .gantt-phase-bar:hover {
    opacity: 0.4;
    z-index: 1;
  }
  .gantt-phase-label {
    font-size: 9px; font-weight: 700;
    color: rgba(0, 0, 0, 0.7);
    padding: 0 8px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.55;
  }
  .gantt-phase-gpa { border: 1px dashed currentColor; opacity: 0.14; }
  .gantt-phase-gpa:hover { opacity: 0.28; }

  .gantt-dot {
    position: absolute; top: 50%;
    width: 14px; height: 14px;
    border-radius: 50%; transform: translate(-50%, -50%);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 2;
    cursor: default;
    transition: transform 0.1s, box-shadow 0.1s;
  }
  .gantt-dot:hover {
    transform: translate(-50%, -50%) scale(1.4);
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  body.gantt-edit-active .gantt-dot { cursor: grab; }
  body.gantt-edit-active .gantt-dot:active,
  .gantt-dot.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 100;
    box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.3), 0 2px 8px rgba(0,0,0,0.3);
  }

  /* Filter bar for Gantt */
  .gantt-filter-bar {
    display: flex; gap: 8px; align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
  }
  .gantt-filter-bar .synth-filter-input {
    flex: 1 1 240px; min-width: 200px;
  }


  [data-theme="dark"] input[type="date"],
  [data-theme="dark"] input[type="datetime-local"],
  [data-theme="dark"] input[type="time"],
  [data-theme="dark"] input[type="month"] { color-scheme: dark; }
  [data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
  [data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(1) brightness(1.6); opacity: 0.85; cursor: pointer; }

  .gantt-tooltip {
    position: fixed; pointer-events: none;
    background: #1f2430; color: #ffffff;
    border: 1px solid rgba(255,255,255,0.16);
    padding: 5px 9px; border-radius: var(--radius-sm);
    font-size: 11px; font-weight: 600; white-space: nowrap;
    z-index: 9999; box-shadow: 0 6px 18px rgba(0,0,0,0.45);
  }

  .gantt-empty { padding: 40px; text-align: center; color: var(--text-tertiary); font-style: italic; }
  .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

  /* === Dashboard bar-list (Vue d'ensemble) === */
  .bar-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
  .bar-row {
    display: grid;
    grid-template-columns: minmax(80px, 120px) 1fr auto;
    gap: 10px; align-items: center;
  }
  .bar-row-label {
    font-size: 12px; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .bar-row-track {
    height: 8px; background: var(--bg-secondary);
    border-radius: var(--radius-xs); overflow: hidden;
  }
  .bar-row-fill {
    height: 100%; border-radius: var(--radius-xs);
    transition: width 0.3s ease;
  }
  .bar-row-value {
    font-size: 12px; font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    text-align: right; min-width: 50px;
  }
  .empty-state-mini {
    padding: 16px; text-align: center;
    color: var(--text-tertiary); font-style: italic; font-size: 12px;
  }
  .kpi-card { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 18px 20px; }
  .kpi-label { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
  .kpi-value { font-size: 28px; font-weight: 600; color: var(--text-primary); }
  .dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
  .panel { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; }
  .panel-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
  .stat-bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; }
  .stat-bar-label { width: 200px; color: var(--text-secondary); flex-shrink: 0; }
  .stat-bar-track { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: var(--radius-xs); overflow: hidden; }
  .stat-bar-fill { height: 100%; border-radius: var(--radius-xs); }
  .stat-bar-count { width: 32px; text-align: right; color: var(--text-primary); font-weight: 600; }
  .op-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .op-table th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-color-strong); color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
  .op-table td { padding: 12px; border-bottom: 1px solid var(--border-color); }
  .op-table tr.clickable { cursor: pointer; }
  .op-table tr.clickable:hover td { background: var(--bg-secondary); }

  /* Tabbed synthese */
  .synth-tabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--border-color);
    margin: 8px 0 12px; overflow-x: auto; padding-bottom: 0;
  }
  .synth-tab {
    padding: 8px 12px; cursor: pointer; font-size: 12px; font-weight: 500;
    color: var(--text-secondary); border-radius: 6px 6px 0 0;
    border: 1px solid transparent; border-bottom: 2px solid transparent;
    margin-bottom: -1px; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all 0.15s;
  }
  .synth-tab:hover { color: var(--text-primary); background: var(--bg-secondary); }
  .synth-tab.active {
    color: var(--info-text); background: var(--bg-primary);
    border-color: var(--border-color); border-bottom-color: var(--info-accent);
    font-weight: 600;
  }
  .synth-tab i, .synth-tab .tabler-svg-icon { font-size: 13px; }
  .synth-tab.active i, .synth-tab.active .tabler-svg-icon { color: var(--info-accent); }

  .synth-filter {
    display: flex; gap: 8px; align-items: center; margin-bottom: 10px; padding: 0 2px;
    flex-wrap: wrap;
  }
  .synth-filter-input {
    flex: 1 1 220px; min-width: 200px; max-width: 340px;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 6px 10px 6px 30px; font-size: 12px; font-family: inherit;
    color: var(--text-primary); background: var(--bg-secondary);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239b9994' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
    background-repeat: no-repeat; background-position: 9px center;
  }
  .synth-filter-input:focus { outline: none; border-color: var(--info-accent); background-color: var(--bg-primary); box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.12); }
  .synth-filter-select {
    flex: 0 0 auto;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 6px 24px 6px 10px; font-size: 12px; font-family: inherit;
    color: var(--text-primary); background: var(--bg-secondary);
    cursor: pointer; max-width: 180px;
  }
  .synth-filter-select:focus { outline: none; border-color: var(--info-accent); background: var(--bg-primary); box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.12); }
  .synth-filter-select:not([value=""]) { background: var(--info-bg); border-color: var(--info-accent); color: var(--info-text); font-weight: 500; }
  .synth-filter-contextual {
    border-style: dashed !important;
    border-color: var(--purple-accent) !important;
  }
  .synth-filter-contextual:not([value=""]) {
    background: rgba(147, 51, 234, 0.08) !important;
    color: var(--purple-accent) !important;
    border-style: solid !important;
  }
  .synth-context-filters { display: inline-flex; gap: 8px; flex-wrap: wrap; }

  /* Bilan d'opération (LEON-style) */
  .bilan-actions {
    display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap;
  }
  .bilan-action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; font-size: 11px; font-weight: 500;
    border: 1px solid var(--border-color); background: var(--bg-primary);
    color: var(--text-secondary); border-radius: var(--radius-md);
    cursor: pointer; font-family: inherit;
    transition: all 0.15s;
  }
  .bilan-action-btn:hover { background: var(--info-bg); color: var(--info-text); border-color: var(--info-accent); }
  .bilan-action-btn i, .bilan-action-btn .tabler-svg-icon { font-size: 12px; }
  .bilan-action-leon {
    border-style: dashed; border-color: var(--info-accent);
    color: var(--info-text);
  }
  .bilan-action-leon:hover { background: var(--info-accent); color: white; border-style: solid; }

  .bilan-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    overflow: hidden;
  }
  .bilan-section { border-bottom: 1px solid var(--border-color); }
  .bilan-section:last-of-type { border-bottom: none; }
  .bilan-section-expanded { background: var(--bg-secondary); }
  .bilan-section-head {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: transparent; border: none;
    font-family: inherit; font-size: 13px; cursor: pointer;
    color: var(--text-primary); text-align: left;
  }
  .bilan-section-head:hover { background: var(--bg-tertiary); }
  .bilan-section-expanded .bilan-section-head { background: var(--bg-secondary); }
  .bilan-chevron {
    width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-xs); background: var(--bg-tertiary); color: var(--text-secondary);
    flex-shrink: 0;
  }
  .bilan-section-expanded .bilan-chevron { background: var(--info-bg); color: var(--info-text); }
  .bilan-chevron i, .bilan-chevron .tabler-svg-icon { font-size: 14px; }
  .bilan-num {
    font-size: 10px; font-weight: 700; color: var(--text-tertiary);
    background: var(--bg-tertiary); padding: 2px 6px; border-radius: var(--radius-xs);
    font-family: ui-monospace, monospace;
    flex-shrink: 0;
  }
  .bilan-label { flex: 1; font-weight: 500; }
  .bilan-section-total {
    font-variant-numeric: tabular-nums;
    font-weight: 600; color: var(--text-primary);
    padding-left: 10px;
  }
  .bilan-section-total-empty { color: var(--text-tertiary); font-weight: 400; }
  .bilan-lines {
    padding: 4px 16px 14px 50px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
  }
  .bilan-line {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 0; font-size: 12.5px;
    border-bottom: 1px dotted var(--border-color);
  }
  .bilan-line:last-of-type { border-bottom: none; }
  .bilan-line-empty .bilan-line-label,
  .bilan-line-empty .bilan-line-value { color: var(--text-tertiary); }
  .bilan-line-label { flex: 1; color: var(--text-secondary); }
  .bilan-line-value {
    font-variant-numeric: tabular-nums;
    color: var(--text-primary); padding-left: 12px;
  }
  .bilan-line-input {
    width: 140px; text-align: right; font-size: 12px; padding: 3px 8px;
  }
  .bilan-line-subtotal {
    padding-top: 6px; margin-top: 4px;
    border-top: 1px solid var(--border-color-strong) !important;
    font-weight: 600; color: var(--text-primary);
  }
  .bilan-line-subtotal .bilan-line-label,
  .bilan-line-subtotal .bilan-line-value { color: var(--text-primary); font-weight: 600; }
  .bilan-grand-total {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: var(--info-bg);
    border-top: 2px solid var(--info-accent);
    color: var(--info-text);
  }
  .bilan-grand-total-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  .bilan-grand-total-value {
    font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums;
  }

  /* Plan de financement */
  .pf-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    overflow: hidden;
  }
  .pf-category {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-color);
  }
  .pf-category:nth-last-of-type(2) { border-bottom: 2px solid var(--border-color-strong); }
  .pf-line {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 0; font-size: 13px;
  }
  .pf-line-cat .pf-line-label { font-weight: 600; color: var(--text-primary); }
  .pf-line-sub {
    padding-left: 18px;
    font-size: 12px;
    color: var(--text-secondary);
  }
  .pf-line-sub .pf-line-label { color: var(--text-secondary); }
  .pf-line-sub .pf-line-value { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .pf-line-empty { padding-left: 18px; font-size: 11.5px; color: var(--text-tertiary); padding: 4px 0 4px 18px; }
  .pf-cat-total { font-weight: 600; font-variant-numeric: tabular-nums; }
  .pf-line-value { font-variant-numeric: tabular-nums; }
  .pf-tranche-tag {
    display: inline-block; padding: 1px 6px;
    background: var(--bg-tertiary); color: var(--text-secondary);
    border-radius: var(--radius-xs); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.3px;
    margin-right: 6px; vertical-align: middle;
    font-variant-numeric: tabular-nums;
  }
  .pf-totals {
    padding: 10px 14px;
    background: var(--bg-secondary);
  }
  .pf-total-line { padding: 4px 0; font-size: 13px; }
  .pf-total-line .pf-line-label { font-weight: 600; color: var(--text-primary); }
  .pf-total-line .pf-line-value { font-weight: 600; font-variant-numeric: tabular-nums; }
  .pf-ecart {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; margin-top: 8px;
    border-radius: var(--radius-xs); font-size: 12.5px;
  }
  .pf-ecart i, .pf-ecart .tabler-svg-icon { font-size: 16px; flex-shrink: 0; }
  .pf-ecart-label { flex: 1; font-weight: 500; }
  .pf-ecart-value { font-weight: 600; font-variant-numeric: tabular-nums; }
  .pf-ecart-zero { background: var(--success-bg); color: var(--success-text); }
  .pf-ecart-positive { background: var(--danger-bg); color: var(--danger-text); }
  .pf-ecart-negative { background: var(--warning-bg); color: var(--warning-text); }

  /* History chart (phase evolution) */
  .chart-wrap {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    overflow-x: auto;
  }
  .chart-empty {
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
  }
  .chart-empty > i, .chart-empty > .tabler-svg-icon {
    font-size: 28px; color: var(--text-tertiary);
    display: block; margin-bottom: 8px;
  }
  .chart-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    margin-bottom: 8px; font-size: 11.5px;
    color: var(--text-secondary);
  }
  .chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
  .chart-legend-dot {
    width: 14px; height: 3px; border-radius: 2px; display: inline-block;
  }
  /* Plan de charge - graphe + légende */
  .charge-chart-wrap { width: 100%; }
  .charge-svg { width: 100%; height: auto; display: block; }
  .charge-legend {
    display: flex; flex-wrap: wrap; gap: 8px 18px;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12.5px; color: var(--text-secondary);
  }
  .charge-leg { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
  .charge-leg-dot {
    width: 11px; height: 11px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
  }
  .delta-summary {
    margin-top: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 10px 14px;
  }
  .delta-summary-title {
    font-size: 11.5px; color: var(--text-secondary);
    margin-bottom: 8px; font-weight: 500;
  }
  .delta-row {
    display: grid;
    grid-template-columns: 12px minmax(120px, 1fr) auto 18px auto auto;
    gap: 8px; align-items: center;
    padding: 4px 0; font-size: 12px;
    border-bottom: 1px dotted var(--border-color);
  }
  .delta-row:last-child { border-bottom: none; }
  .delta-color { width: 10px; height: 10px; border-radius: 2px; }
  .delta-label { color: var(--text-secondary); }
  .delta-from, .delta-to {
    font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 11.5px;
  }
  .delta-arrow { color: var(--text-tertiary); }
  .delta-change {
    font-variant-numeric: tabular-nums; font-weight: 600;
    padding: 2px 8px; border-radius: var(--radius-xs); font-size: 11px;
    margin-left: 8px; white-space: nowrap;
  }
  .delta-up { background: var(--success-bg); color: var(--success-text); }
  .delta-down { background: var(--info-bg); color: var(--info-text); }
  .delta-neutral { background: var(--bg-tertiary); color: var(--text-secondary); }
  .referentiels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
  }
  .ref-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex; flex-direction: column;
  }
  .ref-card-head { margin-bottom: 10px; }
  .ref-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
  .ref-card-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
  .ref-card-sub code {
    background: var(--bg-secondary); padding: 1px 4px; border-radius: var(--radius-xs);
    font-family: ui-monospace,monospace; font-size: 10px;
  }
  .ref-items {
    list-style: none; padding: 0; margin: 0 0 10px;
    display: flex; flex-direction: column; gap: 4px;
    max-height: 260px; overflow-y: auto;
  }
  .ref-item {
    display: flex; gap: 6px; align-items: center;
  }
  .ref-item-input {
    flex: 1; border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); padding: 5px 8px; font-size: 12px;
    background: var(--bg-secondary); color: var(--text-primary);
    font-family: inherit;
  }
  .ref-item-input:focus { outline: none; border-color: var(--info-accent); background: var(--bg-primary); }
  .ref-item-del {
    width: 26px; height: 26px; flex-shrink: 0;
    border: 1px solid transparent; background: transparent;
    border-radius: var(--radius-xs); cursor: pointer;
    color: var(--text-tertiary);
    display: flex; align-items: center; justify-content: center;
  }
  .ref-item-del:hover {
    border-color: var(--danger-accent);
    color: var(--danger-text);
    background: var(--danger-bg);
  }
  .ref-item-del i, .ref-item-del .tabler-svg-icon { font-size: 14px; }
  .ref-card-foot {
    display: flex; gap: 6px; padding-top: 10px;
    border-top: 1px dashed var(--border-color);
  }
  .ref-new-input {
    flex: 1; border: 1px solid var(--border-color);
    border-radius: var(--radius-xs); padding: 5px 8px; font-size: 12px;
    background: var(--bg-primary); color: var(--text-primary);
    font-family: inherit;
  }
  .ref-new-input:focus { outline: none; border-color: var(--info-accent); }
  .ref-add-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--info-accent);
    background: var(--info-accent); color: white;
    border-radius: var(--radius-xs); padding: 5px 10px; font-size: 11px;
    font-family: inherit; font-weight: 500;
    cursor: pointer;
  }
  .ref-add-btn:hover { filter: brightness(1.1); }
  .ref-add-btn i, .ref-add-btn .tabler-svg-icon { font-size: 12px; }
  .synth-filter-reset {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid var(--border-color); background: var(--bg-secondary);
    color: var(--text-secondary); border-radius: var(--radius-md);
    padding: 6px 10px; font-size: 11.5px; font-family: inherit;
    cursor: pointer; transition: all 0.15s; font-weight: 500;
  }
  .synth-filter-reset:hover { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-accent); }
  .synth-filter-reset i, .synth-filter-reset .tabler-svg-icon { font-size: 12px; }
  .synth-count { font-size: 11px; color: var(--text-tertiary); font-weight: 500; margin-left: auto; }

  .synth-table-wrap {
    max-height: 65vh; overflow: auto;
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
  }
  .synth-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    font-size: 12px; font-variant-numeric: tabular-nums;
  }
  .synth-table thead th {
    position: sticky; top: 0; z-index: 3;
    background: var(--bg-secondary);
    text-align: left; padding: 9px 12px;
    border-bottom: 1px solid var(--border-color-strong);
    color: var(--text-secondary); font-weight: 600;
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px;
    white-space: nowrap;
  }
  .synth-table tbody td {
    padding: 9px 12px; border-bottom: 1px solid var(--border-color);
    white-space: nowrap; background: var(--bg-primary);
  }
  .synth-table tbody tr.clickable { cursor: pointer; }
  .synth-table tbody tr.clickable:hover td { background: var(--bg-secondary); }
  .synth-table th.num, .synth-table td.num { text-align: right; }
  .synth-table th.sortable:hover { background: var(--info-bg); color: var(--info-text); }
  .synth-table th.sortable .sort-arrow { color: var(--info-accent); font-weight: 700; margin-left: 3px; }
  .synth-table th.sticky-left, .synth-table td.sticky-left {
    position: sticky; left: 0; z-index: 2;
    box-shadow: 1px 0 0 var(--border-color);
  }
  .synth-table th.sticky-left { z-index: 4; }
  .synth-table th.sticky-left-2, .synth-table td.sticky-left-2 {
    position: sticky; z-index: 2;
    box-shadow: 1px 0 0 var(--border-color);
  }
  .synth-table th.sticky-left-2 { z-index: 4; }
  .synth-table td.code-cell { font-weight: 600; color: var(--text-primary); }
  .synth-table td.muted { color: var(--text-tertiary); }
  .synth-table .mini-badge {
    display: inline-block; padding: 2px 7px; border-radius: var(--radius-md);
    font-size: 10.5px; font-weight: 500; white-space: nowrap;
  }
  .synth-empty {
    padding: 30px; text-align: center; color: var(--text-tertiary);
    font-size: 13px; font-style: italic;
  }

  .link-btn { color: var(--info-accent); text-decoration: none; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
  .link-btn:hover { text-decoration: underline; }

  /* Edit mode */
  .edit-toolbar {
    display: flex; align-items: center; gap: 8px;
    background: var(--warning-bg); border-radius: var(--radius-md);
    padding: 8px 12px; margin-bottom: 14px;
    font-size: 12px; color: var(--warning-text);
  }
  .edit-toolbar i { font-size: 16px; }
  .edit-toolbar .btn-bar { margin-left: auto; display: flex; gap: 6px; }
  .btn-edit {
    border: 1px solid var(--border-color-strong);
    background: var(--bg-primary); color: var(--text-primary);
    padding: 5px 12px; border-radius: var(--radius-md);
    font-size: 12px; font-weight: 500; cursor: pointer;
    font-family: inherit; display: inline-flex; align-items: center; gap: 4px;
  }
  .btn-edit:hover { background: var(--bg-secondary); }
  .btn-edit.primary { background: var(--info-accent); color: white; border-color: var(--info-accent); }
  .btn-edit.primary:hover { background: var(--info-text); }
  .btn-edit.danger {
    background: var(--bg-primary);
    color: var(--danger-text);
    border-color: var(--danger-bg);
  }
  .btn-edit.danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger-accent);
    color: var(--danger-text);
  }
  /* Sépare le bouton supprimer des actions principales (Annuler/Enregistrer) */
  .edit-toolbar .btn-bar .btn-edit.danger {
    margin-right: 14px;
    border-right: 1px solid transparent; /* visual placeholder for separation */
  }
  .edit-toolbar .btn-bar .btn-edit.danger::after {
    content: '';
    position: absolute;
    /* fallback if needed in future */
  }
  .icon-btn.active { background: var(--info-bg); color: var(--info-accent); border-color: var(--info-accent); }

  .editable-input {
    border: 1px solid var(--border-color-strong); border-radius: var(--radius-xs);
    padding: 3px 8px; font-size: 13px; font-family: inherit;
    color: var(--text-primary); background: var(--bg-primary);
    text-align: left; min-width: 0; max-width: 100%; width: 100%;
  }
  .editable-input:focus {
    outline: none; border-color: var(--info-accent);
    box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.15);
  }
  .editable-textarea {
    border: 1px solid var(--border-color-strong); border-radius: var(--radius-xs);
    padding: 6px 8px; font-size: 12px; font-family: inherit;
    color: var(--text-primary); background: var(--bg-primary);
    width: 100%; min-height: 60px; resize: vertical;
  }
  .editable-textarea:focus {
    outline: none; border-color: var(--info-accent);
    box-shadow: 0 0 0 2px rgba(24, 95, 165, 0.15);
  }
  .editable-select {
    border: 1px solid var(--border-color-strong); border-radius: var(--radius-xs);
    padding: 3px 8px; font-size: 13px; font-family: inherit;
    color: var(--text-primary); background: var(--bg-primary);
    min-width: 140px;
  }

  #toastStack {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
    z-index: 1000; pointer-events: none;
  }
  .toast {
    background: var(--success-text); color: white;
    padding: 10px 16px; border-radius: var(--radius-md);
    font-size: 13px; font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 6px;
    animation: toastIn 0.2s ease-out; pointer-events: auto;
  }
  .toast-error { background: var(--danger-accent); }
  .toast-x { appearance: none; border: none; background: none; color: white; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 0 0 6px; opacity: .8; }
  .toast-x:hover { opacity: 1; }
  .toast-repop { animation: toastRepop 0.3s ease-out; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes toastRepop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

  @media (max-width: 1024px) { .dashboard-grid, .kpi-grid { grid-template-columns: 1fr 1fr; } }
  /* ============== SECTIONS REPLIABLES + CHRONOLOGIE (refonte onglet Opérations) ============== */
  /* Sections repliables : clic sur le titre */
  .section > .section-label, .section > .subent-header { cursor: pointer; user-select: none; }
  .section > .section-label::after, .section > .subent-header .subent-title::after {
    content: '▾'; font-size: 10px; color: var(--text-tertiary);
    margin-left: 6px; display: inline-block;
    transition: transform 0.15s ease;
  }
  .section.collapsed > .section-label::after, .section.collapsed > .subent-header .subent-title::after { transform: rotate(-90deg); }
  .section.collapsed > *:not(.section-label):not(.subent-header) { display: none !important; }
  .section.collapsed { padding-bottom: 2px; margin-bottom: 8px; }

  /* Bouton d'ouverture de la chronologie (dans Calendrier travaux) */
  .timeline-open-btn {
    display: inline-flex; align-items: center; gap: 7px;
    margin-top: 12px; padding: 8px 14px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); cursor: pointer;
    font-size: 12.5px; font-weight: 600; color: var(--text-primary);
    font-family: inherit; transition: background 0.12s ease, border-color 0.12s ease;
  }
  .timeline-open-btn:hover { background: var(--info-bg); border-color: var(--info-accent); color: var(--info-text); }
  .timeline-open-btn i { font-size: 15px; }
  .timeline-open-count {
    font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill);
    background: var(--info-accent); color: #fff;
  }

  /* Modale chronologie */
  .timeline-modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,0.45); align-items: center; justify-content: center;
    padding: 24px;
  }
  .timeline-modal-backdrop.open { display: flex; }
  .timeline-modal {
    background: var(--bg-primary); border-radius: 14px;
    width: 720px; max-width: 96vw; max-height: 88vh;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px -12px rgba(0,0,0,0.45);
    border: 1px solid var(--border-color);
  }
  .timeline-modal-head {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
  }
  .timeline-modal-head .ti { font-size: 19px; color: var(--info-accent); }
  .timeline-modal-head .tm-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .timeline-modal-head .tm-kicker { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-tertiary); }
  .timeline-modal-head .tm-title { font-size: 15px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .timeline-modal-close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    width: 32px; height: 32px; border-radius: var(--radius-md); color: var(--text-tertiary);
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
  }
  .timeline-modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
  .timeline-modal-body { padding: 8px 20px 20px; overflow-y: auto; }
  .timeline-modal-filters {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 12px 0; position: sticky; top: 0; background: var(--bg-primary); z-index: 1;
  }
  .tmf-chip {
    background: var(--bg-secondary); border: 1px solid transparent; border-radius: var(--radius-pill);
    padding: 4px 11px; cursor: pointer; font-size: 11.5px; font-weight: 600;
    color: var(--text-secondary); font-family: inherit; transition: background 0.12s ease, color 0.12s ease;
  }
  .tmf-chip span { font-weight: 700; color: var(--text-tertiary); margin-left: 3px; }
  .tmf-chip:hover { background: var(--bg-tertiary); color: var(--text-primary); }
  .tmf-chip.active { background: var(--info-bg); color: var(--info-text); border-color: var(--info-accent); }
  .tmf-chip.active span { color: var(--info-text); }

  body.printing-op-detail .timeline-open-btn { display: none !important; }
  body.printing-op-detail .section.collapsed > * { display: block !important; }
  #opDetail .section, #trancheDetail .section { scroll-margin-top: 16px; }
  /* ============== FIN SECTIONS REPLIABLES + CHRONOLOGIE ============== */

  /* ============== AUTHENTIFICATION (logo AXENTIA centré, style épique) ============== */
  @media (max-width: 480px){ .auth-logo-img{ width: 220px; } }

  /* Barre de session (topnav) */
  .sess-btn { margin-left: 8px; background: var(--info-bg); border: 1px solid var(--info-accent); color: var(--info-text); border-radius: var(--radius-sm); padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; white-space: nowrap; }
  .sess-btn:hover { filter: brightness(0.97); }
  .sess-refresh-ico { display: inline-block; }
  .sess-btn.spinning .sess-refresh-ico { animation: authspin .6s linear; }
  .sess-stamp { margin-left: 10px; font-size: 11px; color: var(--text-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .sess-icon-btn { padding: 5px 9px; font-size: 15px; line-height: 1; }
  .sess-user { position: relative; margin-left: 12px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; cursor: default; padding: 3px 6px 3px 4px; border-radius: var(--radius-md); }
  .sess-user:hover { background: var(--bg-secondary); }
  .sess-caret { font-size: 10px; color: var(--text-tertiary); }
  .sess-menu { display: none; position: absolute; top: 100%; right: 0; margin-top: 6px; min-width: 190px; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.20); padding: 8px; z-index: 1000; }
  .sess-menu::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
  .sess-user:hover .sess-menu { display: block; }
  .sess-menu-email { font-size: 11.5px; color: var(--text-tertiary); padding: 2px 8px 8px; border-bottom: 1px solid var(--border-color); margin-bottom: 6px; word-break: break-all; }
  .sess-menu-logout { width: 100%; text-align: left; background: none; border: none; border-radius: var(--radius-sm); padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; font-family: inherit; }
  .sess-menu-logout:hover { background: var(--bg-secondary); color: #c4423a; }
  .sess-menu-item { width: 100%; text-align: left; background: none; border: none; border-radius: var(--radius-sm); padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; font-family: inherit; }
  .sess-menu-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
  /* Modale Administration des comptes */
  .acct-modal-backdrop { position: fixed; inset: 0; z-index: 100000; background: rgba(10,22,38,0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; }
  .acct-modal { width: 640px; max-width: 96vw; max-height: 86vh; display: flex; flex-direction: column; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,0.4); overflow: hidden; }
  .acct-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-color); }
  .acct-modal-title { font-size: 16px; font-weight: 800; color: var(--text-primary); }
  .acct-modal-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }
  .acct-modal-close { background: none; border: none; font-size: 16px; color: var(--text-tertiary); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); line-height: 1; }
  .acct-modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
  .acct-modal-body { padding: 16px 20px 20px; overflow: auto; }
  .acct-section-title { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 8px; }
  .acct-list { display: flex; flex-direction: column; gap: 6px; }
  .acct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-secondary); }
  .acct-row-main { min-width: 0; }
  .acct-email { font-size: 13px; font-weight: 600; color: var(--text-primary); }
  .acct-person { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
  .acct-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .acct-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
  .acct-badge.ok { background: rgba(42,157,111,0.12); color: #1f7d56; border: 1px solid rgba(42,157,111,0.4); }
  .acct-badge.warn { background: rgba(196,66,58,0.10); color: #c4423a; border: 1px solid rgba(196,66,58,0.35); }
  .acct-del { background: none; border: 1px solid var(--border-color); color: var(--text-tertiary); border-radius: var(--radius-sm); padding: 3px 8px; cursor: pointer; font-size: 12px; line-height: 1; }
  .acct-del:hover { color: #c4423a; border-color: #c4423a; }
  .acct-add { display: flex; gap: 8px; margin-top: 12px; }
  .acct-input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-primary); color: var(--text-primary); font-size: 13px; font-family: inherit; }
  .acct-add-btn { background: var(--info-bg); border: 1px solid var(--info-accent); color: var(--info-text); border-radius: var(--radius-md); padding: 8px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; }
  .acct-add-btn:hover { filter: brightness(0.97); }
  .acct-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .acct-chip { font-size: 12px; padding: 4px 10px; border-radius: var(--radius-pill); }
  .acct-chip.warn { background: rgba(196,66,58,0.10); color: #c4423a; border: 1px solid rgba(196,66,58,0.30); }
  .acct-muted { color: var(--text-tertiary); font-size: 12px; }
  .sess-ava { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg,#1F3A5F,#2e639e); color:#fff; font-size:10.5px; font-weight:700; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; letter-spacing:0.3px; }
  .sess-uname { font-size: 12.5px; font-weight: 600; color: var(--text-primary); max-width: 160px; overflow:hidden; text-overflow:ellipsis; }
  .auth-logout { margin-left: 8px; background: none; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; font-family: inherit; white-space: nowrap; }
  .auth-logout:hover { background: var(--bg-secondary); color: var(--text-primary); }

  /* ================================================================
     REFONTE ONGLET OPÉRATIONS - ergonomie & hiérarchie visuelle
     (sections en cartes, repli visible, duo-grilles, sous-navigation)
     ================================================================ */

  /* Panneaux sur fond doux : les cartes ressortent */
  .op-detail { background: var(--bg-secondary); }
  .tranche-detail { background: var(--bg-secondary); }
  .op-sticky-top { background: var(--bg-secondary); padding: 10px 24px 0; gap: 6px; }
  .tranches-selector { background: var(--bg-secondary); padding: 12px 24px 10px; }

  /* Sections = cartes */
  .op-detail .section, .tranche-detail .section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px 14px;
    margin-bottom: 12px;
  }
  .op-detail .section::before, .tranche-detail .section::before { display: none; }

  /* En-tête de section : pleine largeur, chevron de repli visible */
  .op-detail .section > .section-label, .tranche-detail .section > .section-label {
    display: flex; width: 100%; align-items: center; gap: 7px;
    background: transparent; border: none; border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0 0 9px; margin: 0 0 11px;
    font-size: 11.5px; letter-spacing: 0.55px;
    cursor: pointer; user-select: none;
  }
  .op-detail .section > .section-label::after,
  .tranche-detail .section > .section-label::after {
    content: '▾'; margin-left: auto; font-size: 10px;
    color: var(--text-tertiary); transition: transform 0.15s ease;
  }
  .op-detail .section.collapsed > .section-label::after,
  .tranche-detail .section.collapsed > .section-label::after { transform: rotate(-90deg); }

  /* En-têtes des blocs d'entités (Prêts, Garanties…) : même traitement */
  .op-detail .section > .subent-header, .tranche-detail .section > .subent-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 9px; margin-bottom: 11px;
    cursor: pointer; user-select: none;
  }
  .op-detail .section > .subent-header .subent-title::after,
  .tranche-detail .section > .subent-header .subent-title::after {
    content: '▾'; margin-left: 6px; font-size: 10px;
    color: var(--text-tertiary); transition: transform 0.15s ease;
  }
  .op-detail .section.collapsed > .subent-header .subent-title::after,
  .tranche-detail .section.collapsed > .subent-header .subent-title::after { transform: rotate(-90deg); }

  /* État replié : la carte se réduit à son en-tête */
  .op-detail .section.collapsed, .tranche-detail .section.collapsed { padding-bottom: 12px; margin-bottom: 10px; }
  .op-detail .section.collapsed > .section-label, .tranche-detail .section.collapsed > .section-label,
  .op-detail .section.collapsed > .subent-header, .tranche-detail .section.collapsed > .subent-header {
    border-bottom: none; margin-bottom: 0; padding-bottom: 0;
  }

  /* Duo-grilles : deux petites sections côte à côte */
  .section-duo {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    margin-bottom: 12px; align-items: start;
  }
  .section-duo > .section { margin-bottom: 0; }
  @media (max-width: 1500px) { .section-duo { grid-template-columns: 1fr; gap: 12px; } }

  
  
  
  
  
  
  

  /* Cartes KPI : ressortent sur le fond doux */
  .op-detail .metric-row .metric-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
  }

  /* Impression : fond neutre, cartes conservées par leurs bordures */
  body.printing-op-detail .op-detail { background: #fff; }



  /* ================================================================
     ÉCRAN DE CONNEXION - "L'empreinte"
     AX vectoriel immense en filigrane, mesh profond, UI épurée.
     ================================================================ */
  @keyframes authspin { to{transform:rotate(360deg);} }

  .auth-overlay { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; overflow: hidden;
      background: #070c1a;
      font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
  .auth-overlay * { box-sizing: border-box; }
  .auth-overlay.auth-leave { opacity: 0; transition: opacity .6s ease; }

  /* Mesh de fond en mouvement lent */
  .auth-bg { position:absolute; inset:0; background:
      radial-gradient(900px 620px at 50% 8%, rgba(38,62,110,0.55), transparent 62%),
      radial-gradient(760px 560px at 12% 92%, rgba(24,44,86,0.5), transparent 60%),
      radial-gradient(820px 600px at 90% 88%, rgba(50,42,20,0.32), transparent 60%),
      linear-gradient(180deg, #080e1e 0%, #0a1226 55%, #0c1630 100%);
      background-size: 190% 190%, 190% 190%, 190% 190%, 100% 100%;
      animation: authmesh 26s ease-in-out infinite; }
  @keyframes authmesh { 0%,100%{background-position:50% 0%,0% 100%,100% 100%,0 0;} 50%{background-position:50% 30%,20% 66%,80% 60%,0 0;} }

  /* Grain premium */
  .auth-grain { position:absolute; inset:0; pointer-events:none; opacity:.06; mix-blend-mode: overlay;
      background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }

  /* Grille de plan, à peine visible */
  .auth-grid { position:absolute; inset:-60px; opacity:.34; background:
      linear-gradient(rgba(96,150,210,0.05) 1px, transparent 1px),
      linear-gradient(90deg, rgba(96,150,210,0.05) 1px, transparent 1px);
      background-size: 64px 64px; animation: authpan 80s linear infinite; }
  @keyframes authpan { to { transform: translate(64px, 64px); } }

  /* L'empreinte AX - immense, vectorielle */
  .auth-mark-wrap { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; pointer-events:none; }
  .auth-mark { width: 128vmin; max-width: none; margin-top: -6vh; opacity: 0.11;
      filter: drop-shadow(0 0 90px rgba(56,150,205,0.28)) drop-shadow(0 0 40px rgba(194,164,92,0.14)) brightness(1.25);
      -webkit-mask-image: radial-gradient(75% 75% at 50% 44%, #000 55%, transparent 92%);
      mask-image: radial-gradient(75% 75% at 50% 44%, #000 55%, transparent 92%);
      animation: authbreathe 11s ease-in-out infinite, authmarkin 1.6s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes authbreathe { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.02); } }
  @keyframes authmarkin { from{ opacity:0; } to{ opacity:0.11; } }
  .auth-overlay.auth-sunrise .auth-mark { opacity: 0.30; filter: drop-shadow(0 0 130px rgba(90,190,235,0.6)) drop-shadow(0 0 70px rgba(233,196,106,0.5)) brightness(1.7); transition: all .9s ease; }

  /* Braises */
  .auth-particles { position:absolute; inset:0; pointer-events:none; }
  .auth-pt { position:absolute; bottom:-14px; border-radius:50%; background: rgba(201,169,97,0.85); box-shadow: 0 0 8px rgba(201,169,97,0.7);
      animation-name: authrise; animation-timing-function: linear; animation-iteration-count: infinite; }
  @keyframes authrise { 0%{ transform: translateY(0) translateX(0); opacity:0; } 10%{opacity:.95;} 85%{opacity:.5;} 100%{ transform: translateY(-108vh) translateX(38px); opacity:0; } }
  .auth-burst { position:absolute; width:4px; height:4px; border-radius:50%; background:#ffd98a; box-shadow:0 0 8px rgba(255,206,120,.9); pointer-events:none;
      animation: authburst 1.2s ease-out forwards; }
  @keyframes authburst { from{ transform: translateY(0) scale(1); opacity:1; } to{ transform: translateY(-90px) translateX(var(--dx,0px)) scale(.4); opacity:0; } }

  .auth-vignette { position:absolute; inset:0; pointer-events:none; background: radial-gradient(120% 92% at 50% 42%, transparent 52%, rgba(2,4,10,0.6) 100%); }
  .auth-flash { position:absolute; left:50%; top:50%; width:24px; height:24px; border-radius:50%; pointer-events:none; opacity:0;
      transform: translate(-50%,-50%) scale(0);
      background: radial-gradient(circle, rgba(255,232,180,0.22) 0%, rgba(255,224,160,0.10) 55%, transparent 72%); }
  .auth-overlay.auth-sunrise .auth-flash { animation: authflash .85s cubic-bezier(.15,.6,.3,1) both; }
  @keyframes authflash { 0%{ transform: translate(-50%,-50%) scale(0); opacity:1; } 65%{ opacity:.8; } 100%{ transform: translate(-50%,-50%) scale(240); opacity:0; } }

  /* Scène centrale */
  .auth-stage { position: relative; z-index: 4; width: 400px; max-width: 92vw; display: flex; flex-direction: column; align-items: center; text-align: center; }
  @keyframes authup { from{ opacity:0; transform: translateY(16px);} to{ opacity:1; transform:none;} }
  .auth-stage > * { animation: authup .7s cubic-bezier(.2,.75,.25,1) both; }
  .auth-stage > :nth-child(1){ animation-delay:.1s; } .auth-stage > :nth-child(2){ animation-delay:.22s; }
  .auth-stage > :nth-child(3){ animation-delay:.32s; } .auth-stage > :nth-child(4){ animation-delay:.44s; }
  .auth-stage > :nth-child(5){ animation-delay:.62s; }

  .auth-logo-wrap { position:relative; margin-bottom: 2px; }
  .auth-logo-wrap::before { content:''; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:320px; height:140px; border-radius:50%;
      background: radial-gradient(closest-side, rgba(194,164,92,0.22), transparent 72%); animation: authhalo 5s ease-in-out infinite; }
  @keyframes authhalo { 0%,100%{opacity:.6;} 50%{opacity:1;} }
  .auth-logo-img { position:relative; width: 208px; filter: drop-shadow(0 8px 26px rgba(0,0,0,0.6)) brightness(1.08); animation: authfloat 6s ease-in-out infinite; }
  @keyframes authfloat { 0%,100%{transform: translateY(0);} 50%{transform: translateY(-6px);} }

  .auth-word { font-weight: 800; font-size: 32px; letter-spacing: -0.02em; line-height: 1; color: #f4f6fb;
      text-shadow: 0 2px 24px rgba(194,164,92,0.35); }
  .auth-word em { font-style: normal; background: linear-gradient(115deg, #f0dfae, #c2a45c 55%, #f6e7ba); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .auth-kicker { font-weight: 500; font-size: 12.5px; color: rgba(196,210,234,0.7); letter-spacing: 0.22em; text-transform: uppercase; margin-top: 9px; }

  .auth-card { position: relative; width: 100%; margin-top: 24px; padding: 26px 24px 22px; border-radius: 22px;
      background: rgba(13,20,40,0.62);
      border: 1px solid rgba(160,185,225,0.14);
      backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3);
      box-shadow: 0 30px 80px rgba(0,0,0,0.6);
      animation: authup .7s cubic-bezier(.2,.75,.25,1) both, authcardglow 6s ease-in-out infinite !important; animation-delay: .44s, 0s !important; }
  @keyframes authcardglow { 0%,100%{ box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 rgba(194,164,92,0); } 50%{ box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 46px rgba(194,164,92,0.13); } }
  .auth-card.shake { animation: authshake .45s cubic-bezier(.36,.07,.19,.97) !important; }
  @keyframes authshake { 10%,90%{transform:translateX(-2px);} 20%,80%{transform:translateX(3px);} 30%,50%,70%{transform:translateX(-5px);} 40%,60%{transform:translateX(5px);} }

  .auth-field { text-align:left; margin-bottom: 13px; }
  .af-lab { display:block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(168,188,218,0.68); margin: 0 0 7px 3px; }
  .af-wrap { position: relative; }
  .af-ic2 { position:absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: rgba(194,164,92,0.9); font-style: normal; }
  .auth-input { width: 100%; padding: 13px 15px 13px 38px; border-radius: var(--radius-lg); font-size: 15px; font-weight: 500; color: #f2f5fb;
      background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,0.09); outline: none; font-family: inherit;
      transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
  .auth-input::placeholder { color: rgba(150,168,196,0.45); font-weight: 400; }
  .auth-input:focus { border-color: rgba(233,196,106,0.7); box-shadow: 0 0 0 4px rgba(233,196,106,0.13); background: rgba(255,255,255,0.08); }

  .auth-err { min-height: 16px; font-size: 12.5px; font-weight: 500; color: #ff9d8a; margin: 3px 0 9px; }
  .auth-btn { width: 100%; padding: 14px; border: none; border-radius: var(--radius-lg); cursor: pointer; position:relative; overflow:hidden;
      font-family: inherit; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: #221803;
      background: linear-gradient(180deg, #ecca77, #d3ac57);
      box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 10px 30px rgba(194,164,92,0.30);
      transition: transform .12s ease, box-shadow .2s ease, filter .2s ease; }
  .auth-btn::after { content:''; position:absolute; top:0; bottom:0; left:-70%; width:45%; transform: skewX(-20deg);
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent); animation: authshine 4.2s ease-in-out infinite; }
  @keyframes authshine { 0%, 60%{ left:-70%; } 90%, 100%{ left: 135%; } }
  .auth-btn:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 14px 36px rgba(194,164,92,0.42); }
  .auth-btn:active:not(:disabled) { transform: scale(0.985); }
  .auth-btn:disabled { opacity:.82; cursor: wait; }

  .auth-foot { margin-top: 18px; font-size: 11px; font-weight: 500; color: rgba(185,200,224,0.5); letter-spacing: 0.08em; }
  .auth-foot .lk { color:#3fae7f; }

  .auth-overlay.auth-sunrise .auth-stage { transform: scale(1.02); transition: transform .9s ease; }

  @media (prefers-reduced-motion: reduce) {
    .auth-overlay *, .auth-overlay *::before, .auth-overlay *::after { animation: none !important; }
  }
  @media (max-width: 560px) { .auth-logo-img { width: 164px; } .auth-word { font-size: 26px; } .auth-mark { width: 210vmin; } }

  /* ================================================================
     ESPACE OPÉRATIONS - architecture en onglets
     En-tête permanent (identité + actions) puis 6 vues focalisées.
     ================================================================ */
  .ops-shell { grid-template-rows: auto minmax(0, 1fr); }
  .ops-shell > .sidebar { grid-row: 1 / 3; grid-column: 1; }
  .ops-header { grid-column: 2 / 4; grid-row: 1; min-width: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); }
  .ops-header:empty { display: none; }
  .ops-header .op-sticky-top { position: static; }
  .op-detail { grid-row: 2; grid-column: 2; }
  .tranche-detail { grid-row: 2; grid-column: 3; }

  /* Pastille compteur (réutilisée dans le bandeau unifié) */
  .ops-tab-n { font-size: 10px; font-weight: 700; line-height: 1;
    background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-pill); padding: 2px 6px; color: var(--text-tertiary); }
  .ops-tab-alert { background: #d64545; border-color: transparent; color: #fff; }

  /* Visibilité des colonnes selon l'onglet */
  .ops-shell[data-tab="syn"] .tranche-detail, .ops-shell[data-tab="dos"] .tranche-detail,
  .ops-shell[data-tab="bilan"] .tranche-detail, .ops-shell[data-tab="suivi"] .tranche-detail { display: none; }
  .ops-shell[data-tab="syn"] .op-detail, .ops-shell[data-tab="dos"] .op-detail,
  .ops-shell[data-tab="bilan"] .op-detail, .ops-shell[data-tab="suivi"] .op-detail { grid-column: 2 / 4; }
  .ops-shell[data-tab="tr"] .op-detail, .ops-shell[data-tab="fin"] .op-detail { display: none; }
  .ops-shell[data-tab="tr"] .tranche-detail, .ops-shell[data-tab="fin"] .tranche-detail { grid-column: 2 / 4; }

  /* Visibilité des blocs selon l'onglet (les blocs sans data-grp restent toujours visibles) */
  .ops-shell[data-tab="syn"] .op-detail > [data-grp]:not([data-grp~="syn"]),
  .ops-shell[data-tab="dos"] .op-detail > [data-grp]:not([data-grp~="dos"]),
  .ops-shell[data-tab="bilan"] .op-detail > [data-grp]:not([data-grp~="bilan"]),
  .ops-shell[data-tab="suivi"] .op-detail > [data-grp]:not([data-grp~="suivi"]),
  .ops-shell[data-tab="tr"] .tranche-detail > [data-grp]:not([data-grp~="tr"]),
  .ops-shell[data-tab="fin"] .tranche-detail > [data-grp]:not([data-grp~="fin"]) { display: none !important; }

  /* Consultation (accueil) : seul le tableau de bord "home" est visible dans
     #opDetail ; les groupes op (syn/dos/bilan/suivi) restent en DOM comme source
     du tiroir. #trancheDetail (source tr/fin) est masqué. */
  .ops-shell[data-tab="home"] .tranche-detail { display: none; }
  .ops-shell[data-tab="home"] .op-detail { grid-column: 2 / 4; }
  .ops-shell[data-tab="home"] .op-detail > [data-grp]:not([data-grp~="home"]) { display: none !important; }


  /* Impression : la fiche complète, sans les onglets */
  body.printing-op-detail .ops-header { display: block !important; }
  body.printing-op-detail .op-detail { display: block !important; }
  body.printing-op-detail .op-detail > [data-grp] { display: block !important; max-width: none; }


  /* ================================================================
     ONGLETS OPÉRATIONS v3 - bandeau en slots, grilles denses 1920px
     ================================================================ */

  /* --- Bandeau : une ligne [identité | stepper | actions] --- */
  .ops-shell > .sidebar { position: relative; z-index: 6; }
  .ops-header { position: relative; z-index: 4; }
  .ops-header .op-sticky-top { position: static; z-index: auto; margin: 0; padding: 8px 28px 0; display: block; }
  .ops-hd { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 26px; }
  .ops-hd-id { flex: 0 1 auto; min-width: 0; max-width: 52%; }
  .ops-hd-mid { flex: 1 1 auto; min-width: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
  .ops-hd-mid .compare-row { flex: none; margin: 0; padding: 5px 10px; gap: 7px; flex-wrap: nowrap; }
  .ops-hd-mid .compare-label { white-space: nowrap; }
  .ops-hd-mid .phase-stepper-wrap { margin: 0; transform: scale(0.94); transform-origin: right center; }
  .ops-hd-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
  .ops-header .detail-title { font-size: 19px; margin: 1px 0 4px; line-height: 1.2; }
  .ops-header .detail-badges { margin: 0; }
  .ops-header .edit-toolbar, .ops-header .compare-row, .ops-header .snapshot-banner { margin: 8px 0 0; }

  /* --- Conteneurs : centrage fluide jusqu'à 1560px --- */
  .op-detail, .tranche-detail { padding: 16px max(28px, calc((100% - 1560px) / 2)) 26px; }

  /* --- Grilles par onglet (base : pleine largeur) --- */
  .ops-shell[data-tab="syn"] .op-detail, .ops-shell[data-tab="dos"] .op-detail,
  .ops-shell[data-tab="bilan"] .op-detail, .ops-shell[data-tab="suivi"] .op-detail,
  .ops-shell[data-tab="tr"] .tranche-detail, .ops-shell[data-tab="fin"] .tranche-detail {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px; align-content: start;
  }
  .ops-shell[data-tab] .op-detail > *, .ops-shell[data-tab] .tranche-detail > * {
    grid-column: 1 / -1; margin: 0;
  }
  .ops-shell[data-tab] .tranche-detail > .tranches-selector { margin: 0; border-radius: 10px; }
  .op-anchor > .section, .op-anchor > div { margin-bottom: 0; }

  @media (min-width: 1400px) {
    /* Synthèse */
    .ops-shell[data-tab="syn"] .op-detail > #sec-op-vol { grid-column: span 5; }
    .ops-shell[data-tab="syn"] .op-detail > #sec-op-loc { grid-column: span 7; }
    /* Dossier : rangée de 3 cartes, puis calendrier 2 colonnes internes + notes */
    .ops-shell[data-tab="dos"] .op-detail > .section-duo { display: contents; }
    .ops-shell[data-tab="dos"] .section-duo > .section { margin: 0; }
    .ops-shell[data-tab="dos"] #sec-op-team { grid-column: span 4; order: 1; }
    .ops-shell[data-tab="dos"] #sec-op-montage { grid-column: span 4; order: 2; }
    .ops-shell[data-tab="dos"] #sec-op-bat { grid-column: span 4; order: 3; }
    .ops-shell[data-tab="dos"] .op-detail > #sec-op-cal { grid-column: span 8; order: 4;
      display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; align-content: start; }
    .ops-shell[data-tab="dos"] #sec-op-cal > .section-label { grid-column: 1 / -1; }
    .ops-shell[data-tab="dos"] #sec-op-notes { grid-column: span 4; order: 5; }
    /* Bilan */
    .ops-shell[data-tab="bilan"] .op-detail > #sec-op-bilan { grid-column: span 6; }
    .ops-shell[data-tab="bilan"] .op-detail > #sec-op-pf { grid-column: span 6; }
    /* Tranches : identité compacte + volumétrie large, puis paires */
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-id { grid-column: span 4; }
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-vol { grid-column: span 8; }
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-agr { grid-column: span 6; }
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-horsagr { grid-column: span 6; }
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-loyer { grid-column: span 6; }
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-convloc { grid-column: span 6; }
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-bilan { grid-column: span 6; }
    .ops-shell[data-tab="tr"] .tranche-detail > #sec-tr-pf { grid-column: span 6; }
    /* Financements : tout en pleine largeur, empilé verticalement dans l'ordre
       prêts, garanties, subventions, réservataires, préfis, avenants. */
    .ops-shell[data-tab="fin"] .tranche-detail > #sec-tr-prets { grid-column: 1 / -1; order: 1; }
    .ops-shell[data-tab="fin"] .tranche-detail > #sec-tr-gar { grid-column: 1 / -1; order: 2; }
    .ops-shell[data-tab="fin"] .tranche-detail > #sec-tr-subv { grid-column: 1 / -1; order: 3; }
    .ops-shell[data-tab="fin"] .tranche-detail > #sec-tr-res { grid-column: 1 / -1; order: 4; }
    .ops-shell[data-tab="fin"] .tranche-detail > #sec-tr-prefi { grid-column: 1 / -1; order: 5; }
    .ops-shell[data-tab="fin"] .tranche-detail > #sec-tr-avenants { grid-column: 1 / -1; order: 6; }
    .ops-shell[data-tab="fin"] .tranche-detail > .tranches-selector { order: 0; }
    .ops-shell[data-tab="fin"] .tranche-detail > .metric-row { order: 0; }
    /* Suivi */
    .ops-shell[data-tab="suivi"] .op-detail > #sec-op-histo { grid-column: span 6; }
    .ops-shell[data-tab="suivi"] .op-detail > #sec-op-controle { grid-column: span 6; }
  }

  /* Volumétrie compacte en demi-largeur (3 x 2) */
  .ops-shell[data-tab="syn"] #sec-op-vol .volumetrie-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ================================================================
   REFONTE VUE OPÉRATION (consultation) : bandeau tranches permanent,
   tableau de bord, tiroir de détail. Portée globale, tokens de l'app.
   ================================================================ */
/* En-tête au-dessus du tiroir (le tiroir est positionné juste en dessous en JS) */
.ops-header { position: relative; z-index: 60; }

/* Bandeau tranches (dans l'en-tête, toujours visible) */
.ops-tbar { display: flex; align-items: center; gap: 9px; padding: 9px 24px; border-top: 1px solid var(--border-color);
  background: var(--bg-secondary); overflow-x: auto; scrollbar-width: thin; }
.ops-tbar-lead { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); flex: none; }
.ops-tpill { appearance: none; font-family: inherit; cursor: pointer; text-align: left; flex: none; position: relative;
  border: 1px solid var(--border-color); background: var(--bg-primary); border-radius: 10px; padding: 7px 13px; color: var(--text-primary);
  display: flex; flex-direction: column; gap: 1px; min-width: 122px; transition: border-color .12s, background .12s, box-shadow .12s; }
.ops-tpill:hover { border-color: var(--border-strong, var(--text-tertiary)); background: var(--bg-secondary); }
.ops-tpill.active { border-color: var(--info-accent); background: var(--info-bg); box-shadow: 0 0 0 1px var(--info-accent) inset; }
.ops-tpill.op { min-width: auto; justify-content: center; }
.ops-tpill-top { display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: 13px; }
.ops-tpill-top i { font-size: 15px; color: var(--info-accent); }
.ops-tpill.active .ops-tpill-top { color: var(--info-text); }
.ops-tpill-meta { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
/* Statut d'agrément : couleur + FORME (rond plein / losange / anneau) pour
   rester lisible en cas de daltonisme. */
.ops-tpill-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; }
.ops-tpill-dot.good { background: var(--success-accent); }
.ops-tpill-dot.warn { background: var(--warning-accent); border-radius: 2px; transform: rotate(45deg); }
.ops-tpill-dot.neutral { background: transparent; border: 1.5px solid var(--text-tertiary); }

/* Tableau de bord */
.op-home { padding: 18px 2px 44px; }
.oph-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; max-width: 1400px; }
.oph-card { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(0,0,0,.05); display: flex; flex-direction: column; overflow: hidden; }
.oph-card.drill { cursor: pointer; transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease; }
.oph-card.drill:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.10); border-color: var(--info-accent); }
.oph-card.drill:focus-visible { outline: 2px solid var(--info-accent); outline-offset: 2px; }
.oph-head { display: flex; align-items: center; gap: 9px; padding: 12px 15px 11px; border-bottom: 1px solid var(--border-color); }
.oph-ic { width: 26px; height: 26px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--info-bg); color: var(--info-accent); flex: none; }
.oph-ic i { font-size: 15px; }
.oph-title { font-size: 13.5px; font-weight: 650; color: var(--text-primary); flex: 1; }
.oph-open { font-size: 11.5px; font-weight: 600; color: var(--info-accent); opacity: 0; transition: opacity .13s ease; white-space: nowrap; }
.oph-card.drill:hover .oph-open, .oph-card.drill:focus-visible .oph-open { opacity: 1; }
.oph-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.oph-c6 { grid-column: span 6; }
@media (max-width: 1100px) { .oph-c6 { grid-column: span 12; } }
@media (max-width: 640px) { .oph-grid { grid-template-columns: 1fr; } .op-home { padding: 14px; } }
.oph-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.oph-pill.good { background: var(--success-bg); color: var(--success-text); } .oph-pill.warn { background: var(--warning-bg); color: var(--warning-text); }
.oph-pill.crit { background: var(--danger-bg); color: var(--danger-text); } .oph-pill.neutral { background: var(--bg-secondary); color: var(--text-secondary); }
.oph-kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; align-items: baseline; margin: 0; font-size: 12.8px; }
.oph-kv dt { color: var(--text-secondary); } .oph-kv dd { margin: 0; font-weight: 600; text-align: right; color: var(--text-primary); }
.oph-figrow { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 16px; }
.oph-fig { display: flex; flex-direction: column; gap: 1px; }
.oph-fl { font-size: 11.5px; color: var(--text-secondary); }
.oph-fv { font-size: 16px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.oph-tsub { color: var(--text-secondary); font-size: 12px; }
.oph-line { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px dashed var(--border-color); font-size: 13px; }
.oph-line:first-child { border-top: none; }
.oph-line .l { flex: 1; color: var(--text-primary); }
.oph-line .d { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

/* Boutons de nav du bandeau opération (.ops-dn) */
.ops-dn { appearance: none; border: 1px solid transparent; background: transparent; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 5px 10px; border-radius: var(--radius-md); cursor: pointer; white-space: nowrap; }
.ops-dn:hover { background: var(--bg-primary); color: var(--text-primary); }
.ops-dn.active { background: var(--bg-primary); color: var(--info-accent); border-color: var(--border-color); }


/* ===== Edition financements : lignes compactes depliables (refonte) ===== */
.entity-card.editing.fin-erow { padding: 0; overflow: hidden; }
.fin-emain, .fin-rmain, .fin-lhead { display: grid; grid-template-columns: minmax(140px, 230px) minmax(120px, 190px) minmax(90px, 130px) minmax(130px, 200px) minmax(150px, 185px) 32px 32px; gap: 8px; align-items: center; padding: 8px 12px; }
.fin-emain .card-input, .fin-cell { min-width: 0; width: 100%; font-size: 12.5px; padding: 5px 7px; }
.fin-num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 940px) { .fin-emain { grid-template-columns: 1fr 1fr auto auto; } .fin-cyc { grid-column: 1 / -1; order: 5; } }
.fin-expand, .fin-del { appearance: none; border: none; background: transparent; cursor: pointer; width: 30px; height: 30px; border-radius: var(--radius-md); display: grid; place-items: center; color: var(--text-tertiary); }
.fin-expand:hover { background: var(--bg-secondary); color: var(--text-primary); }
.fin-del:hover { background: var(--danger-bg); color: var(--danger-text); }
.fin-erow.open .fin-expand { transform: rotate(180deg); color: var(--info-accent); }
.fin-edetail { display: none; padding: 6px 12px 12px; border-top: 1px solid var(--border-color); background: var(--bg-secondary); }
.fin-erow.open .fin-edetail { display: block; }
.fin-cyc { display: flex; align-items: center; gap: 0; min-width: 150px; }
.fin-cyc .st { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; }
.fin-cyc .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-secondary); border: 2px solid var(--border-color); z-index: 1; }
.fin-cyc .st.done .dot { background: var(--success-accent); border-color: var(--success-accent); }
.fin-cyc .st.current .dot { background: var(--bg-primary); border-color: var(--info-accent); box-shadow: 0 0 0 3px var(--info-bg); }
.fin-cyc .lbl { font-size: 8.5px; color: var(--text-tertiary); margin-top: 3px; white-space: nowrap; line-height: 1.1; }
.fin-cyc .st.current .lbl { color: var(--info-accent); font-weight: 700; }
.fin-cyc .conn { position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--border-color); z-index: 0; }
.fin-cyc .st.done .conn { background: var(--success-accent); }
.fin-cyc .st:first-child .conn { display: none; }

.vol-empty-note { font-size: 12.5px; color: var(--text-tertiary); font-style: italic; padding: 2px 0; }

/* Synthese alertes inline (brique vue operation) */
.oph-aline { display: flex; align-items: flex-start; gap: 9px; padding: 6px 0; border-top: 1px dashed var(--border-color); font-size: 12.8px; }
.oph-aline:first-child { border-top: none; }
.oph-adays { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: var(--radius-pill); flex: none; background: var(--bg-secondary); color: var(--text-secondary); }
.oph-a-expired .oph-adays { background: var(--danger-bg); color: var(--danger-text); }
.oph-a-critical .oph-adays { background: var(--coral-bg); color: var(--coral-text); }
.oph-a-warning .oph-adays { background: var(--warning-bg); color: var(--warning-text); }
.oph-a-info .oph-adays { background: var(--info-bg); color: var(--info-text); }
.oph-amsg { flex: 1; color: var(--text-primary); }

/* Carte de localisation sur le tableau de bord */
.oph-map { height: 260px; width: 100%; }
.oph-map-empty { display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 13px; background: var(--bg-secondary); }

/* % de repartition en soft + barre de repartition du financement */
.pf-pct, .oph-soft { color: var(--text-tertiary); font-weight: 500; font-size: 11px; font-variant-numeric: tabular-nums; }
.oph-stack { display: flex; height: 10px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-secondary); }
.oph-stack > span { display: block; height: 100%; }

/* Mini calendrier de la brique Dossier */
.oph-cal { display: flex; flex-direction: column; }
.oph-calrow { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-top: 1px dashed var(--border-color); font-size: 12.8px; }
.oph-calrow:first-child { border-top: none; }
.oph-caldot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-color); flex: none; }
.oph-calrow.done .oph-caldot { background: var(--success-accent); }
.oph-callabel { flex: 1; color: var(--text-primary); }
.oph-calrow.done .oph-callabel { color: var(--text-secondary); }
.oph-caldate { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-secondary); }

/* ===== Audit v51 : KPI header, en-tetes de colonnes, lignes lecture, tiroir finop ===== */
/* Bandeau KPI compact de l'en-tete */
.ops-kpis { display: flex; align-items: center; gap: 0; margin-top: 6px; border-top: 1px solid var(--border-color); overflow-x: auto; }
.ops-kpi { display: flex; flex-direction: column; gap: 1px; padding: 7px 22px 7px 0; margin-right: 22px; border-right: 1px solid var(--border-color); min-width: max-content; }
.ops-kpi:last-of-type { border-right: none; }
.ops-kpi .l { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); }
.ops-kpi .v { font-size: 15px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ops-kpi-alert { appearance: none; border: none; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-pill); background: var(--danger-bg); color: var(--danger-text); margin-left: auto; flex: none; }
.ops-kpi-alert:hover { background: var(--danger-accent); color: #fff; }
.ops-kpi-alert i { font-size: 13px; }

/* En-tetes de colonnes des listes de financement */
.fin-lhead { padding: 4px 12px 3px; }
.fin-lhead span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Lignes compactes de consultation */
.fin-erow.fin-read { padding: 0; overflow: hidden; }
.fin-rmain { cursor: pointer; transition: background .1s ease; }
.fin-rmain:hover { background: var(--bg-secondary); }
.fin-rcell { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fin-rcell.strong { font-weight: 650; }
.fin-rcell.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.fin-rdetail { padding: 10px 12px 12px; }
.fin-rdetail > .entity-card { margin: 0; }

/* Affordance permanente des briques */
.oph-chev { color: var(--text-tertiary); display: inline-flex; }
.oph-chev i { font-size: 15px; }
.oph-card.drill:hover .oph-chev { color: var(--info-accent); }

/* Mini barres de statut (brique Financements) */
.oph-sb { display: flex; flex-direction: column; gap: 6px; }
.oph-sbrow { display: flex; align-items: center; gap: 10px; }
.oph-sblabel { font-size: 11.5px; color: var(--text-secondary); min-width: 150px; white-space: nowrap; }
.oph-sbbar { flex: 1; display: flex; height: 7px; border-radius: var(--radius-xs); overflow: hidden; background: var(--bg-secondary); }
.oph-sbbar > span { display: block; height: 100%; }
.oph-pillrow { display: flex; flex-wrap: wrap; gap: 6px; }

/* CTA des etats vides */
.subent-cta { appearance: none; border: 1px solid transparent; background: var(--info-bg); color: var(--info-accent);
  font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); cursor: pointer; margin-left: 6px; }
.subent-cta:hover { background: var(--info-accent); color: #fff; }


/* Tiroir Financements de l'operation */
.finop-tr { margin-bottom: 22px; }
.finop-tr-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-md); background: var(--bg-secondary); margin-bottom: 9px; }
.finop-tr-head .ops-tpill-top { color: var(--info-accent); }
.finop-tr-name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.finop-sub { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin: 12px 0 4px; }
.finop-tr .entity-card { margin-bottom: 7px; }

/* Swatch legende bilan (dashboard operation) */
.oph-lsw { width: 9px; height: 9px; border-radius: 2px; flex: none; }

/* ===== v53 : vues EN PLACE (tiroir retire) ===== */
/* Vue "Financements de l'operation" (contenu genere, pleine zone centrale) */
.ops-shell[data-tab="finop"] .tranche-detail { display: none; }
.ops-shell[data-tab="finop"] .op-detail { grid-column: 2 / 4; }
.ops-shell[data-tab="finop"] .op-detail > [data-grp]:not([data-grp~="finop"]) { display: none !important; }
.op-finop { padding: 16px 0 48px; max-width: 1400px; }

/* v54 : garanties integrees sous chaque pret dans la vue Financements op */
.finop-garstrip { padding: 6px 12px 10px; border-top: 1px dashed var(--border-color); display: flex; flex-direction: column; gap: 7px; }
.finop-bar { height: 16px; }
.finop-bar .gar-segment { font-size: 10px; }
.finop-garchips { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.finop-garchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-primary); }
.finop-garchip b { font-variant-numeric: tabular-nums; }
.finop-garnone { font-size: 12px; color: var(--warning-text); }

/* v57 : bandeau unique (nav + tranches + sous-vues) */
.ops-unibar { gap: 5px; }
.ops-unibar .ops-tpill { padding: 4px 11px; min-width: auto; }
.ops-unibar .ops-tpill-meta { font-size: 10.5px; }

/* ===== v59 : en-tete compact (recupere de la hauteur sur ecrans portables) ===== */
.ops-header .op-sticky-top { padding: 4px 24px 0; }
.ops-hd { gap: 2px 18px; }
.ops-header .detail-eyebrow { font-size: 10px; }
.ops-header .detail-title { font-size: 16px; margin: 0 0 2px; line-height: 1.2; }
.ops-header .detail-badges { gap: 4px; margin-top: 1px; }
.ops-header .phase-badge, .ops-header .badge-secondary, .ops-header .op-tag { font-size: 10.5px; padding: 2px 8px; }
.ops-hd-mid .phase-stepper-wrap { transform: scale(0.8); }
.ops-hd-mid .compare-row { padding: 2px 8px; font-size: 11px; }
.ops-hd-mid .compare-select { padding: 2px 6px; font-size: 11px; }
.ops-kpis { margin-top: 2px; }
.ops-kpi { padding: 3px 14px 4px 0; margin-right: 14px; }
.ops-kpi .l { font-size: 9px; }
.ops-kpi .v { font-size: 13px; }
.ops-kpi-alert { font-size: 10.5px; padding: 2px 9px; }
.ops-tbar { padding: 4px 24px; gap: 6px; }
.ops-unibar .ops-tpill { padding: 2px 9px; }
.ops-tpill-top { font-size: 12px; gap: 5px; }
.ops-tpill-meta { font-size: 10px; }
.ops-dn { font-size: 11.5px; padding: 3px 9px; }
.op-home { padding-top: 10px; }

/* Ecrans encore plus bas (petits portables) : on resserre davantage */
@media (max-height: 860px) {
  .ops-hd-mid .phase-stepper-wrap { transform: scale(0.72); }
  .ops-kpi .v { font-size: 12px; }
  .ops-header .detail-title { font-size: 15px; }
  .ops-unibar .ops-tpill-meta { display: none; } /* pastilles tranches sur une ligne */
}

/* v60 : boutons d'action (historique / SharePoint / editer) ancres en haut a droite,
   alignes avec la ligne titre + stepper au lieu de passer a la ligne. */
.ops-header .op-sticky-top { position: relative; }
.ops-header .ops-hd { padding-right: 132px; }
.ops-header .ops-hd-actions { position: absolute; top: 6px; right: 24px; }

/* ===== v61 : ergonomie (en-tete, Informations sans scroll, tranches, finop) ===== */

/* En-tete : alignements et marges reguliers */
.ops-header .op-sticky-top { padding: 6px 20px 0 24px; }
.ops-header .ops-hd { align-items: center; padding-right: 140px; }
.ops-header .ops-hd-actions { top: 10px; right: 20px; display: flex; gap: 6px; }
.ops-hd-mid { align-items: center; }

/* Bandeau : zone tranches visuellement distincte des vues operation */
.ops-tzone { display: flex; align-items: center; gap: 6px; margin-left: auto;
  background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 10px; padding: 3px 8px; }
.ops-tzone.active { border-color: var(--info-accent); }
.ops-tzone .ops-tbar-lead { color: var(--info-accent); }
.ops-tzone-sub { display: inline-flex; gap: 3px; border-left: 1px solid var(--border-color); padding-left: 8px; margin-left: 2px; }

/* Vue Informations : tout tenir sans scroll (localisation 2 colonnes, carte bornee) */
.ops-shell[data-tab="dos"] .op-detail { gap: 10px; }
.ops-shell[data-tab="dos"] #sec-op-loc .loc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; align-content: start; }
.ops-shell[data-tab="dos"] #sec-op-loc .loc-map, .ops-shell[data-tab="dos"] #sec-op-loc .loc-map-wrap { height: 235px; min-height: 0; }
.ops-shell[data-tab="dos"] #sec-op-loc .loc-map-empty { min-height: 120px; }
.ops-shell[data-tab="dos"] .geo-panel { padding: 5px 10px; margin-top: 4px; }
@media (min-width: 1400px) {
  .ops-shell[data-tab="dos"] .op-detail > #sec-op-loc { grid-column: span 12; order: 0; }
}

/* Vue Detail tranche : les sections ne s'etirent plus sur la hauteur du voisin */
.ops-shell[data-tab="tr"] .tranche-detail { align-items: start; }
.ops-shell[data-tab="fin"] .tranche-detail { align-items: start; }

/* Vue Financements op : un cadre par tranche */
.finop-tr { border: 1px solid var(--border-color); border-left: 3px solid var(--info-accent);
  border-radius: var(--radius-lg); padding: 10px 14px 12px; background: var(--bg-primary); }
.finop-tr-head { background: transparent; border-radius: 0; padding: 2px 0 8px;
  border-bottom: 1px solid var(--border-color); margin-bottom: 10px; }

/* Titres de colonnes alignes sur leurs valeurs (montant a droite, statut/cycle centres) */
.fin-lhead span:nth-child(3) { text-align: right; }
.fin-lhead span:nth-child(4), .fin-lhead span:nth-child(5) { text-align: center; }
.fin-rmain .fin-rcell:nth-child(4) { text-align: center; }

/* ===== v62 : detail pret reworke (stepper date + chips) + pile droite tranche ===== */
.pd-card { padding: 12px 14px; }
.pd-steps { display: flex; padding: 2px 0 10px; }
.pd-step { flex: 1; min-width: 0; text-align: center; padding: 0 4px; }
.pd-track { display: flex; align-items: center; margin-bottom: 5px; }
.pd-line { flex: 1; height: 2px; background: var(--border-color); }
.pd-step:first-child .pd-line-l, .pd-step:last-child .pd-line-r { visibility: hidden; }
.pd-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bg-secondary); border: 2px solid var(--border-color); margin: 0 4px; flex: none; }
.pd-step.done .pd-dot { background: var(--success-accent); border-color: var(--success-accent); }
.pd-step.done .pd-line-l, .pd-step.done .pd-line-r { background: var(--success-accent); }
.pd-step.next .pd-dot { background: var(--bg-primary); border-color: var(--info-accent); box-shadow: 0 0 0 3px var(--info-bg); }
.pd-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); font-weight: 650; display: flex; justify-content: center; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.pd-step.done .pd-label { color: var(--text-secondary); }
.pd-step.next .pd-label { color: var(--info-accent); }
.pd-date { font-size: 12.5px; font-weight: 650; color: var(--text-primary); font-variant-numeric: tabular-nums; margin-top: 1px; }
.pd-step:not(.done):not(.next) .pd-date { color: var(--text-tertiary); font-weight: 400; }
.pd-date.prev { color: var(--warning-text); }
.pd-sub { font-size: 11.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-chipwarn { display: inline-flex; margin-top: 3px; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--warning-bg); color: var(--warning-text); }
.pd-chipwarn.crit { background: var(--danger-bg); color: var(--danger-text); }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; border-top: 1px dashed var(--border-color); padding-top: 9px; }
.pd-chip { display: inline-flex; align-items: baseline; gap: 6px; background: var(--bg-secondary); border-radius: var(--radius-md); padding: 3px 9px; font-size: 12px; }
.pd-chip .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-tertiary); font-weight: 650; }
.pd-chip .v { color: var(--text-primary); font-weight: 600; }
.pd-pieces { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; }
.pd-pieces-l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-tertiary); font-weight: 650; margin-right: 3px; }

/* Pile de droite de la vue tranche : Hors agrement + Convention de location */
.tr-stack6 { display: flex; flex-direction: column; gap: 14px; }
.tr-stack6 > .section { margin: 0; }
@media (min-width: 1400px) {
  .ops-shell[data-tab="tr"] .tranche-detail > .tr-stack6 { grid-column: span 6; }
}

/* ===== v63 : KPI Synthese reworkes ===== */
.kpi-sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 5px; line-height: 1.4; }
.kpi-card.kpi-crit { border-color: var(--danger-accent); }
.kpi-card.kpi-crit .kpi-value { color: var(--danger-text); }
.kpi-card.kpi-good .kpi-value { color: var(--success-text); }
.kpi-card.kpi-warn .kpi-value { color: var(--warning-text); }
.kpi-sub .kpi-bar { display: block; height: 5px; border-radius: var(--radius-xs); background: var(--bg-secondary); overflow: hidden; margin: 3px 0 5px; }
.kpi-sub .kpi-bar > span { display: block; height: 100%; border-radius: var(--radius-xs); background: var(--success-accent); }

/* ===== v64 : filtres Synthese reworkes (chips actifs, vues modifiables) ===== */
.synth-active-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px 0 2px; }
.synth-fchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  background: var(--info-bg); color: var(--info-text); border-radius: var(--radius-pill); padding: 3px 6px 3px 10px; }
.synth-fchip .l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; opacity: .75; font-weight: 700; }
.synth-fchip .x { appearance: none; border: none; cursor: pointer; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: inherit; font-size: 13px; line-height: 1; padding: 0; }
.synth-fchip .x:hover { background: var(--info-accent); color: #fff; }
.synth-filter-select.has-value { border-color: var(--info-accent); background: var(--info-bg); color: var(--info-text); font-weight: 600; }
.synth-saved-chip.dirty { border-style: dashed; }
.synth-dirty-dot { color: var(--warning-accent); font-size: 9px; vertical-align: middle; }
.synth-saved-chip-upd { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--warning-bg); color: var(--warning-text); font-size: 12px; font-weight: 700; cursor: pointer; }
.synth-saved-chip-upd:hover { background: var(--warning-accent); color: #fff; }

/* ===== v66 : Suivi reworke en cockpit personnel ===== */
.suivi-mode { display: inline-flex; margin-left: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; }
.suivi-mode-btn { appearance: none; border: none; background: var(--bg-primary); color: var(--text-secondary);
  font-family: inherit; font-size: 12px; font-weight: 600; padding: 6px 13px; cursor: pointer; }
.suivi-mode-btn + .suivi-mode-btn { border-left: 1px solid var(--border-color); }
.suivi-mode-btn.active { background: var(--info-bg); color: var(--info-accent); }
.suivi-kpi { appearance: none; border: 1px solid var(--border-color); font-family: inherit; cursor: pointer; text-align: center; }
.suivi-kpi.active { outline: 2px solid var(--info-accent); outline-offset: 1px; }
.suivi-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .suivi-layout { grid-template-columns: 1fr; } }
.suivi-panel { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 14px; }
.suivi-panel-title { font-size: 12.5px; font-weight: 650; color: var(--text-primary); display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.suivi-panel-title i { color: var(--info-accent); }
.suivi-panel-hint { margin-left: auto; font-size: 10px; color: var(--text-tertiary); font-weight: 500; }
.suivi-empty-mini { font-size: 12px; color: var(--text-tertiary); font-style: italic; padding: 4px 0; }
/* Agenda */
.suivi-ag { display: flex; align-items: baseline; gap: 8px; padding: 6px 4px; border-top: 1px dashed var(--border-color); cursor: pointer; border-radius: var(--radius-sm); }
.suivi-ag:first-of-type { border-top: none; }
.suivi-ag:hover { background: var(--bg-secondary); }
.suivi-ag-date { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 12px; color: var(--text-primary); flex: none; }
.suivi-ag-days { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--bg-secondary); color: var(--text-secondary); flex: none; }
.suivi-ag.overdue .suivi-ag-days { background: var(--danger-bg); color: var(--danger-text); }
.suivi-ag-body { min-width: 0; display: flex; flex-direction: column; }
.suivi-ag-action { font-size: 12px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suivi-ag-op { font-size: 10.5px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
/* Portefeuille */
.suivi-pf { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-top: 1px dashed var(--border-color); cursor: pointer; border-radius: var(--radius-sm); }
.suivi-pf:first-of-type { border-top: none; }
.suivi-pf:hover { background: var(--bg-secondary); }
.suivi-pf-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.suivi-pf-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suivi-pf-late { font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--radius-pill); background: var(--danger-bg); color: var(--danger-text); display: grid; place-items: center; flex: none; }
.suivi-pf-count { font-size: 11px; font-weight: 650; color: var(--text-secondary); font-variant-numeric: tabular-nums; flex: none; }
/* Groupement par operation */
.suivi-opgroup { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; }
.suivi-opgroup.has-overdue { border-left: 3px solid var(--danger-accent); }
.suivi-opgroup-head { display: flex; align-items: center; gap: 10px; padding: 9px 13px; background: var(--bg-secondary); cursor: pointer; }
.suivi-opgroup-head:hover .suivi-opgroup-open { opacity: 1; }
.suivi-opgroup-code { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12px; color: var(--info-accent); }
.suivi-opgroup-name { font-weight: 650; font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suivi-opgroup-late { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--danger-bg); color: var(--danger-text); flex: none; }
.suivi-opgroup-count { margin-left: auto; font-size: 11px; color: var(--text-secondary); flex: none; }
.suivi-opgroup-open { font-size: 11px; font-weight: 600; color: var(--info-accent); opacity: 0; transition: opacity .12s; flex: none; }
.suivi-opgroup-body { padding: 6px 10px 10px; }

/* ===== v68 : Accueil reworke ("ma journee") ===== */
.acc2-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .acc2-kpis { grid-template-columns: 1fr 1fr; } }
.acc2-kpi { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.acc2-kpi:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(0,0,0,.10); }
.acc2-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; margin-top: 18px; }
@media (max-width: 1100px) { .acc2-layout { grid-template-columns: 1fr; } }
.acc2-main .suivi-task { cursor: pointer; }
.accueil-kpi-warning { border-color: var(--warning-accent); }
.accueil-kpi-warning .accueil-kpi-num, .accueil-kpi-warning .accueil-kpi-icon { color: var(--warning-text); }

/* v76 : bandeau unifie aussi en mode edition */
.ops-tpill-add { padding: 2px 8px; border-style: dashed; color: var(--text-tertiary); }
.ops-tpill-add:hover { color: var(--info-accent); border-color: var(--info-accent); }

/* ===== v77 : cockpit de saisie (edition, vue Detail de tranche) - codes visuels de la maquette validee ===== */
.ops-shell[data-tab="tr"] .tranche-detail.edit-cockpit,
.ops-shell[data-tab="fin"] .tranche-detail.edit-cockpit,
.ops-shell[data-tab="dos"] .op-detail.edit-cockpit { grid-template-columns: 240px repeat(12, minmax(0, 1fr)); }
.ops-shell[data-tab="tr"] .tranche-detail.edit-cockpit > *:not(.edit-rail),
.ops-shell[data-tab="fin"] .tranche-detail.edit-cockpit > *:not(.edit-rail),
.ops-shell[data-tab="dos"] .op-detail.edit-cockpit > *:not(.edit-rail) { grid-column: 2 / -1 !important; }
.ops-shell[data-tab="tr"] .tranche-detail.edit-cockpit > .edit-rail,
.ops-shell[data-tab="fin"] .tranche-detail.edit-cockpit > .edit-rail,
.ops-shell[data-tab="dos"] .op-detail.edit-cockpit > .edit-rail { grid-column: 1; grid-row: 1 / span 99; align-self: start; position: sticky; top: 8px; }
.ops-shell:not([data-tab="tr"]):not([data-tab="fin"]):not([data-tab="dos"]) .edit-rail { display: none; }
.cockpit-hidden { display: none !important; }
.only-missing .is-filled { display: none !important; }
.only-missing .all-filled { display: none !important; }

.edit-rail { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.er-h { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-tertiary); padding: 4px 8px 8px; }
.er-sec { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid transparent; background: none; color: var(--text-secondary); font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: var(--radius-md); cursor: pointer; }
.er-sec:hover { background: var(--bg-primary); color: var(--text-primary); }
.er-sec.active { background: var(--bg-primary); border-color: var(--border-color); color: var(--text-primary); }
.er-ring { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.er-ring > span { width: 19px; height: 19px; border-radius: 50%; background: var(--bg-secondary); display: grid; place-items: center; font-size: 8.5px; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.er-lab { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.er-miss { font-size: 10px; font-weight: 700; color: var(--warning-text); background: var(--warning-bg); border-radius: var(--radius-pill); padding: 2px 7px; flex: none; }
.er-miss.done { color: var(--success-text); background: var(--success-bg); }
.er-all { margin-top: 6px; padding-top: 9px; border-top: 1px solid var(--border-color); border-radius: 0; }
.er-missing-toggle { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--warning-text); background: var(--warning-bg); border-radius: var(--radius-md); padding: 7px 9px; margin: 8px 4px 0; cursor: pointer; }
.er-missing-toggle input { accent-color: var(--warning-accent, #d9a13b); }
.er-total { margin: 12px 8px 2px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.er-total-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.er-bar { height: 7px; border-radius: var(--radius-pill); background: var(--border-color); margin-top: 6px; overflow: hidden; }
.er-bar i { display: block; height: 100%; width: 0; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--info-accent), var(--success-accent, #2fbf8f)); transition: width .3s ease; }
.er-kbd { font-size: 10.5px; color: var(--text-tertiary); padding: 8px 8px 2px; }
.er-kbd kbd { border: 1px solid var(--border-color); border-bottom-width: 2px; border-radius: var(--radius-sm); padding: 0 5px; font-size: 10px; background: var(--bg-primary); }

/* Steppers : -/+ autour d'un champ qui reste saisissable au clavier */
.stp { display: inline-flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.stp input { flex: 1; min-width: 0; text-align: center; }
.stp input::-webkit-outer-spin-button, .stp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stp-btn { width: 24px; height: 24px; flex: none; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-secondary); font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; }
.stp-btn:hover { color: var(--info-accent); border-color: var(--info-accent); }
.kv-row .stp { width: 100%; }

/* Champs vides attendus : lisere ambre discret (code visuel maquette) */
.edit-cockpit .kv-row:not(.is-filled) { box-shadow: inset 2px 0 0 rgba(217, 161, 59, .55); border-radius: var(--radius-xs); padding-left: 10px; }
.edit-cockpit .vol-cell-edit:not(.is-filled) { border: 1px dashed rgba(217, 161, 59, .45); border-radius: var(--radius-md); }

/* ===== v79 : lot integrite - bandeau d'echec d'enregistrement ===== */
.save-error-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin: 0 0 10px;
  background: var(--danger-bg); color: var(--danger-text); border: 1px solid var(--danger-accent);
  border-radius: 10px; font-size: 13px; font-weight: 600; }
.save-error-banner span { flex: 1; }
.save-error-banner .btn-edit { flex: none; }

/* ===== v80 : dashboard operation - lecture metier d'abord ===== */
/* Reste a financer : segment hachure, jamais une barre pleine trompeuse */
.oph-stack .rest { background: repeating-linear-gradient(135deg, var(--danger-bg), var(--danger-bg) 5px, transparent 5px, transparent 9px); border-left: 1px dashed var(--danger-accent); }
.oph-lsw-rest { background: repeating-linear-gradient(135deg, var(--danger-bg), var(--danger-bg) 3px, transparent 3px, transparent 6px); border: 1px dashed var(--danger-accent); }
.oph-fl { display: inline-flex; align-items: center; gap: 6px; }
.oph-famdone { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--success-text); background: var(--success-bg); border-radius: var(--radius-md); padding: 6px 10px; }
.oph-famdone i { font-size: 14px; }
/* Prochaines actions : lignes cliquables */
.oph-task { cursor: pointer; border-radius: var(--radius-md); }
.oph-task:hover { background: var(--bg-secondary); }
.oph-task .oph-amsg b { font-weight: 650; color: var(--text-primary); }
/* Flash de la brique cible quand on clique le badge critique */
@keyframes ophFlash { 0% { box-shadow: 0 0 0 3px var(--danger-accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.oph-flash { animation: ophFlash 1.3s ease-out; }
/* Le strip KPI redevient le niveau de lecture n.1 */
.ops-kpi .v { font-size: 17px; }

/* ===== v81 : navigation - fleche retour contextuelle dans le bandeau ===== */

/* ===== v83 : export SFO one-click dans la vue Financements op ===== */
.finop-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }

/* ===== v84 : ligne de temps operation + benchmark KPI ===== */
.oph-c12 { grid-column: 1 / -1; }
.optl { display: flex; flex-direction: column; gap: 7px; }
.optl-row { display: flex; align-items: center; gap: 10px; }
.optl-lab { flex: 0 0 210px; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.optl-track { flex: 1; position: relative; height: 14px; background: var(--bg-secondary); border-radius: var(--radius-pill); overflow: visible; }
.optl-bar { position: absolute; top: 2px; bottom: 2px; border-radius: var(--radius-pill); }
.optl-bar.ok { background: var(--success-bg); border: 1px solid var(--success-accent); }
.optl-bar.warn { background: var(--warning-bg); border: 1px solid var(--warning-accent); }
.optl-bar.crit { background: var(--coral-bg); border: 1px solid var(--coral-accent); }
.optl-bar.expired { background: var(--danger-bg); border: 1px solid var(--danger-accent); }
.optl-cd { flex: 0 0 92px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.optl-cd.ok { color: var(--success-text); } .optl-cd.warn { color: var(--warning-text); }
.optl-cd.crit { color: var(--coral-text); } .optl-cd.expired { color: var(--danger-text); }
.optl-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--info-accent); border-radius: 2px; }
.optl-now i { position: absolute; top: -14px; left: -12px; font-style: normal; font-size: 9px; font-weight: 700; color: var(--info-accent); }
.optl-axisrow { margin-top: 4px; }
.optl-axis { height: 18px; background: none; border-top: 2px solid var(--border-color-strong); border-radius: 0; }
.optl-dot { position: absolute; top: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--info-accent); border: 2px solid var(--bg-primary); transform: translateX(-50%); cursor: help; }
.optl-dot.past { background: var(--neutral-accent); }

/* ===== v86 : stepper de phases compact (consultation) + fusion Financements ===== */
.psc-wrap { display: flex; align-items: center; }
.phase-stepper-compact { display: flex; align-items: center; gap: 0; }
.psc-dot { width: 18px; height: 18px; border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 2px solid var(--border-color-strong); background: var(--bg-primary); color: var(--success-accent); font-size: 10px; }
.psc-dot i { font-size: 11px; }
.psc-past { border-color: var(--success-accent); background: var(--success-bg); }
.psc-current { border-color: var(--phase-accent, var(--info-accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--phase-accent, var(--info-accent)) 25%, transparent); }
.psc-current::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--phase-accent, var(--info-accent)); }
.psc-future { opacity: .55; }
.psc-dot.stepper-clickable { cursor: pointer; }
.psc-dot.stepper-clickable:hover { transform: scale(1.15); }
.psc-line { width: 16px; height: 2px; background: var(--border-color-strong); flex: none; }
.psc-cur { display: inline-flex; align-items: baseline; gap: 5px; margin-left: 10px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.psc-cur i { font-style: normal; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .75; }

/* ===== v87 : purge finale de l'audit ===== */
/* LO caduque : signal rouge sur la ligne compacte (mini-cycle) */
.cyc-warn { font-size: 9.5px; font-weight: 700; color: var(--danger-text); background: var(--danger-bg); border: 1px solid var(--danger-accent); border-radius: var(--radius-pill); padding: 1px 7px; margin-left: 8px; align-self: center; white-space: nowrap; }
.fin-cyc.cyc-urgent .st.done:last-of-type .dot { background: var(--danger-accent); }
/* Comparer avec : replie par defaut, bouton d'en-tete pour l'ouvrir */
.compare-fold { display: none; }
.compare-fold.open { display: flex; }
.icon-btn.cmp-on { color: var(--info-accent); border-color: var(--info-accent); }

/* ===== v88 : scope Total / tranche dans le bandeau ===== */
.ops-tpill-total .ops-tpill-top { display: inline-flex; align-items: center; gap: 4px; color: var(--text-primary); }
.ops-tpill-total .ops-tpill-top i { font-size: 12px; }
.ops-tpill-total.active { background: var(--info-bg); border-color: var(--info-accent); }

/* ===== v93 : creation rapide 3 champs (prets / subventions) ===== */
.qadd { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-top: 6px;
  border: 1px dashed var(--border-color-strong); border-radius: var(--radius-lg); background: var(--bg-secondary); }
.qadd-ic { color: var(--info-accent); flex: none; }
.qadd .card-input { flex: 1; min-width: 0; font-size: 12.5px; }
.qadd .qadd-go { flex: none; }

/* ===== v94 : encart de saisie du pret - ligne de vie editable ===== */
.pe-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 12px 4px; }
@media (max-width: 1150px) { .pe-stages { grid-template-columns: 1fr; } }
.pe-stage { border: 1px solid var(--border-color); border-left-width: 3px; border-radius: var(--radius-lg); background: var(--bg-primary); padding: 10px 12px; min-width: 0; }
.pe-stage.done { border-left-color: var(--success-accent); }
.pe-stage.current { border-left-color: var(--info-accent); background: var(--card-edit-bg); }
.pe-stage.future { border-left-color: var(--border-color-strong); opacity: .8; }
.pe-stage-h { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); margin-bottom: 9px; }
.pe-dot { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; color: #fff; background: var(--border-color-strong); flex: none; }
.pe-stage.done .pe-dot { background: var(--success-accent); }
.pe-stage.current .pe-dot { background: var(--info-accent); }
.pe-state { margin-left: auto; font-size: 9.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-tertiary); white-space: nowrap; }
.pe-stage.current .pe-state { color: var(--info-accent); }
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 9px; }
.pe-grid .card-edit-field { min-width: 0; }
.pe-grid .card-edit-field.wide { grid-column: 1 / -1; }
.pe-grid .card-input { width: 100%; font-size: 12px; }

/* ===== v95 : login screen - meme identite, finition superieure ===== */
/* Aurore conique en rotation tres lente derriere la scene */
.auth-aurora { position: absolute; inset: -25%; pointer-events: none; opacity: .55; filter: blur(70px);
  background: conic-gradient(from 180deg at 50% 42%, transparent 0deg, rgba(46, 86, 150, .22) 70deg, transparent 130deg,
    rgba(194, 164, 92, .13) 200deg, transparent 260deg, rgba(38, 120, 160, .18) 320deg, transparent 360deg);
  animation: authaur 44s linear infinite; }
@keyframes authaur { to { transform: rotate(360deg); } }
/* Rayons d'aube derriere le logo, oscillation lente */
.auth-rays { position: absolute; left: 50%; top: -10vh; width: 150vmin; height: 80vh; pointer-events: none; opacity: .85;
  background: conic-gradient(from 90deg at 50% 0%, transparent 41%, rgba(226, 199, 130, 0.07) 45%, transparent 49%,
    rgba(140, 190, 235, 0.05) 54%, transparent 58%, rgba(226, 199, 130, 0.05) 63%, transparent 67%);
  -webkit-mask-image: linear-gradient(180deg, #000 15%, transparent 85%); mask-image: linear-gradient(180deg, #000 15%, transparent 85%);
  animation: authraysway 16s ease-in-out infinite; }
@keyframes authraysway { 0%, 100% { transform: translateX(-50%) rotate(-2.5deg); } 50% { transform: translateX(-50%) rotate(2.5deg); } }
/* Parallaxe fluide */
.auth-mark-wrap, .auth-stage { will-change: transform; transition: transform .25s ease-out; }
/* Kicker encadre de filets */
.auth-kicker { display: flex; align-items: center; justify-content: center; gap: 12px; }
.auth-kicker > span { display: block; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, rgba(196, 210, 234, 0.45)); }
.auth-kicker > span:last-child { transform: scaleX(-1); }
/* Liseret lumineux en tete de carte */
.auth-card::before { content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 196, 106, 0.55), transparent); }
/* Labels flottants */
.af-wrap .af-float { position: absolute; left: 38px; top: 50%; transform: translateY(-50%); font-size: 14px; font-weight: 500;
  color: rgba(160, 180, 210, .55); pointer-events: none; transition: all .16s ease; }
.auth-input.af-fl { padding: 20px 42px 8px 38px; }
.auth-input.af-fl:focus + .af-float, .auth-input.af-fl:not(:placeholder-shown) + .af-float {
  top: 9px; transform: none; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  color: rgba(233, 196, 106, .85); }
/* Oeil afficher/masquer */
.af-eye { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); border: none; background: none; cursor: pointer;
  color: rgba(170, 190, 215, .55); padding: 5px; display: grid; place-items: center; border-radius: var(--radius-sm); }
.af-eye:hover, .af-eye.on { color: #e9c46a; }
/* Alerte verrouillage majuscules */
.af-caps { margin: 6px 3px 0; font-size: 11px; font-weight: 600; color: #e9c46a; text-align: left; }
/* Erreur avec pictogramme */
.auth-err:not(:empty)::before { content: '⚠ '; }
/* Spinner du bouton */
.auth-btn .auth-spin { display: none; }
.auth-btn.loading .auth-spin { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid rgba(34, 24, 3, .3); border-top-color: #221803; border-radius: 50%; animation: authspin .7s linear infinite; }
@keyframes authspin { to { transform: rotate(360deg); } }
