/* ============================================================
   Page CONTRATS — matrice clients × produits
   ============================================================ */

.page_contrat {
  --ct-sticky-bg: #ffffff;
  --ct-border: #e2e6ea;
  --ct-active: #1e9e6a;
  --ct-closed: #8a94a0;
  --ct-other: #c9820a;
  padding: 16px 20px 40px;
  box-sizing: border-box;
  text-align: left;
}

/* === Header === */
.header-contrat {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.ct-header-left {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.header-contrat h1 {
  margin: 0;
  font-size: 20pt;
  color: var(--main-bg-color);
}

.ct-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ct-stat {
  font-size: 9pt;
  color: #55606b;
  background: #f1f4f6;
  border-radius: 999px;
  padding: 3px 10px;
}
.ct-stat b { color: #2a3138; }

.ct-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 9pt;
  color: #55606b;
}
.ct-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ct-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.ct-dot--active { background: var(--ct-active); }
.ct-dot--closed { background: var(--ct-closed); }
.ct-dot--other  { background: var(--ct-other); }

/* === Onglets Matrice / Hygiène / Rentabilité (doc/PLAN_PILOTAGE_CONTRATS.md) === */
.ct-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--ct-border);
  margin-bottom: 14px;
}
.ct-tab {
  padding: 8px 16px;
  font-size: 10pt;
  color: #55606b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.ct-tab:hover { color: var(--main-bg-color); }
.ct-tab-active { color: var(--main-bg-color); border-bottom-color: var(--main-bg-color); font-weight: 600; }
.ct-tab-badge {
  font-size: 7.5pt;
  font-weight: 700;
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
}
.ct-tab-badge-alerte { background: #e53935; }

/* === Onglets pilotage : KPI compacts, filtres, tableaux === */
.ct-pil { text-align: left; }
.ct-pil-kpis { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ct-pil-kpi {
  font-size: 9pt;
  color: #55606b;
  background: #f1f4f6;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.ct-pil-kpi b { color: #2a3138; }
.ct-pil-kpi-on { border-color: var(--main-bg-color); background: #fff; }
.ct-pil-kpi-fixe { cursor: default; }
.ct-pil-kpi-alerte { background: #fdecea; }
.ct-pil-kpi-alerte b { color: #b71c1c; }
.ct-pil-kpi-attention { background: #fff4e5; }
.ct-pil-kpi-attention b { color: #8a5300; }
.ct-pil-kpi-info { background: #e8eaf6; }
.ct-pil-kpi-info b { color: #3949ab; }
.ct-pil-kpi-ok { background: #e8f5e9; }
.ct-pil-kpi-ok b { color: #2e7d32; }

.ct-chip-filtre {
  font-size: 8.5pt;
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.ct-chip-filtre b { margin-left: 3px; }
.ct-chip-filtre-on { border-color: var(--main-bg-color); box-shadow: 0 0 0 1px var(--main-bg-color); }

.ct-pil-warn {
  padding: 8px 12px; border-radius: 6px; font-size: 9pt; margin-bottom: 10px;
  background: #fff4e5; border: 1px solid #ffd8a8; color: #8a5300;
  display: flex; gap: 8px; align-items: center;
}
.ct-pil-wrap { overflow-x: auto; background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.ct-pil-table { width: 100%; border-collapse: collapse; font-size: 9pt; margin: 0; }
/* main.css : thead th / th a prennent la couleur principale et tout est centré → surcharge */
.ct-pil-table thead th, .ct-pil-table thead th a { background: #f8f9fa; color: #555; }
.ct-pil-table thead th {
  padding: 8px 10px; text-align: left; font-weight: 600; font-size: 8.5pt;
  border-bottom: 2px solid var(--ct-border); white-space: nowrap; position: sticky; top: 0; z-index: 2; cursor: pointer;
}
.ct-pil-table td { padding: 7px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid #f0f0f0; }
.ct-pil-table tbody tr:hover td { background: #fafbfc; }
.ct-pil-row-alerte td:first-child { box-shadow: inset 4px 0 0 #e53935; }
.ct-pil-row-attention td:first-child { box-shadow: inset 4px 0 0 #ff9800; }
.ct-pil-row-info td:first-child { box-shadow: inset 4px 0 0 #9fa8da; }
.ct-pil-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-pil-sub { font-size: 7.5pt; color: #8a94a0; }
.ct-pil-rouge { color: #b71c1c; font-weight: 600; }
.ct-pil-ok { color: #2e7d32; }
.ct-pil-vide { text-align: center !important; color: #8a94a0; padding: 20px !important; }
.ct-pil-statut { font-size: 8pt; border-radius: 10px; padding: 1px 8px; }
.ct-pil-statut-actif { background: #e8f5e9; color: #2e7d32; }
.ct-pil-statut-brouillon { background: #eceff1; color: #546e7a; }

.ct-pil-dossier { white-space: nowrap; }
.ct-pil-coche {
  display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 50%; font-size: 7.5pt; font-weight: 700; margin-right: 2px;
}
.ct-pil-coche-ok { background: #e8f5e9; color: #2e7d32; }
.ct-pil-coche-ko { background: #fdecea; color: #b71c1c; }

.ct-ano {
  display: inline-block; font-size: 8pt; border-radius: 6px; padding: 2px 7px; margin: 1px 3px 1px 0;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.ct-ano-alerte { background: #fdecea; color: #b71c1c; }
.ct-ano-attention { background: #fff4e5; color: #8a5300; }
.ct-ano-info { background: #e8eaf6; color: #3949ab; }

.ct-verdict { font-size: 8pt; font-weight: 600; border-radius: 10px; padding: 2px 9px; white-space: nowrap; }
.ct-verdict-deficitaire { background: #fdecea; color: #b71c1c; }
.ct-verdict-attention { background: #fff4e5; color: #8a5300; }
.ct-verdict-ok { background: #e8f5e9; color: #2e7d32; }
.ct-verdict-inactif { background: #eceff1; color: #546e7a; }
.ct-pil-barre { height: 4px; background: #eef1f4; border-radius: 2px; margin-top: 3px; overflow: hidden; }
.ct-pil-barre-in { height: 100%; border-radius: 2px; background: #43a047; }
.ct-pil-barre-attention { background: #ff9800; }
.ct-pil-barre-alerte { background: #e53935; }
.ct-pil-barre-info { background: #9fa8da; }

.ct-pil-bloc { margin-top: 16px; background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); padding: 12px 14px; }
.ct-pil-bloc h3 { margin: 0 0 8px; font-size: 10pt; color: #2a3138; text-align: left; }
.ct-pil-liste { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 9pt; }
.ct-pil-pied { margin-top: 12px; font-size: 8pt; color: #8a94a0; }

@media (max-width: 992px) {
  .ct-tabs { overflow-x: auto; }
  .ct-tab { padding: 8px 10px; font-size: 9pt; white-space: nowrap; }
}
@media (max-width: 768px) {
  .ct-pil-table { font-size: 8pt; }
  .ct-pil-table th:nth-child(5), .ct-pil-table td:nth-child(5),
  .ct-pil-table th:nth-child(8), .ct-pil-table td:nth-child(8) { display: none; }
  .ct-pil-kpi { font-size: 8pt; padding: 3px 9px; }
}

/* === Toolbar / recherche === */
.ct-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ct-search {
  position: relative;
  display: flex;
  align-items: center;
}
.ct-search-icon {
  position: absolute;
  left: 12px;
  color: #98a2ac;
  font-size: 10pt;
  pointer-events: none;
}
.ct-search input {
  width: 260px;
  max-width: 60vw;
  padding: 8px 32px 8px 34px;
  border: 1px solid var(--ct-border);
  border-radius: 999px;
  font-size: 10pt;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ct-search input:focus {
  border-color: var(--main-bg-color);
  box-shadow: 0 0 0 3px rgba(38, 154, 142, 0.15);
}
.ct-search-clear {
  position: absolute;
  right: 12px;
  color: #98a2ac;
  cursor: pointer;
  font-size: 10pt;
}
.ct-search-clear:hover { color: #55606b; }
.ct-count {
  font-size: 9pt;
  color: #8a94a0;
}

/* === Chargement === */
.ct-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: #8a94a0;
  font-size: 10.5pt;
}
.ct-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(38, 154, 142, 0.2);
  border-top-color: var(--main-bg-color);
  border-radius: 50%;
  animation: ct-spin 0.8s linear infinite;
}
@keyframes ct-spin {
  to { transform: rotate(360deg); }
}

/* === Etat vide === */
.ct-empty {
  padding: 40px;
  text-align: center;
  color: #8a94a0;
  font-style: italic;
  background: #f7f9fa;
  border: 1px dashed var(--ct-border);
  border-radius: 10px;
}

/* === Conteneur défilant === */
.ct-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 150px);
  border: 1px solid var(--ct-border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  background: #fff;
}

/* === Table === */
.ct-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 10pt;
}

.ct-table th,
.ct-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--ct-border);
  white-space: nowrap;
  text-align: center;
}

/* En-tête figé en haut */
.ct-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;              /* neutralise le fond teal global (main.css) */
  border-bottom: 2px solid var(--main-bg-color);
  overflow: visible;            /* les libellés inclinés peuvent déborder */
}

/* En-têtes produits inclinés à 45° → colonnes étroites */
.ct-table thead th.ct-rot {
  height: 130px;
  padding: 0;
  vertical-align: bottom;
  width: 46px;
  min-width: 46px;
  max-width: 46px;
}
.ct-table thead th.ct-rot .ct-rot-box {
  position: relative;
  width: 46px;
  height: 100%;
  overflow: visible;
}
.ct-table thead th.ct-rot .ct-rot-label {
  position: absolute;
  left: 14px;
  bottom: 6px;
  transform-origin: left bottom;
  transform: rotate(-45deg);
  white-space: nowrap;
  line-height: 1;
}
/* Le libellé lui-même (neutralise le fond/couleur teal hérités de main.css thead th a) */
.ct-table thead th.ct-rot .ct-rot-label a {
  background: transparent;
  color: #33404d;
  text-decoration: none;
  font-size: 8.5pt;
  font-weight: 600;
  letter-spacing: .2px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(38, 154, 142, 0.45);
}
.ct-table thead th.ct-rot .ct-rot-label a:hover {
  color: var(--main-bg-color);
  border-bottom-color: var(--main-bg-color);
}

/* Colonne client figée à gauche */
.ct-table th.sticky,
.ct-table td.sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--ct-sticky-bg);
  box-shadow: 6px 0 8px -6px rgba(0, 0, 0, 0.18);
}

/* Coin haut-gauche : au-dessus de toutes les colonnes */
.ct-table th.ct-corner {
  z-index: 900;
  vertical-align: bottom;
  color: var(--main-bg-color);
  font-weight: 700;
  border-bottom: 2px solid var(--main-bg-color);
}

.ct-tiers-cell a {
  color: var(--main-button);
  text-decoration: none;
  font-weight: 600;
}
.ct-tiers-cell a:hover { text-decoration: underline; }

/* Lignes alternées + hover */
.ct-table tbody tr.line-alternate td { background: #f7f9fa; }
.ct-table tbody tr.line-alternate td.sticky { background: #f0f3f5; }

.ct-table tbody tr:hover td { background: rgba(38, 154, 142, 0.10); }
.ct-table tbody tr:hover td.sticky { background: rgba(38, 154, 142, 0.16); }

/* Surbrillance de colonne au survol */
.ct-table tbody tr td.ct-col-hover { background: rgba(38, 154, 142, 0.12); }
.ct-table thead th.ct-rot.ct-col-hover { background: #eaf6f4; }
.ct-table thead th.ct-rot.ct-col-hover .ct-rot-label a {
  color: var(--main-bg-color);
  border-bottom-color: var(--main-bg-color);
  font-weight: 700;
}

/* === Cellule / puce produit === */
.ct-cell {
  color: #2a3138;
  width: 46px;
  min-width: 46px;
  padding-left: 4px;
  padding-right: 4px;
}

.ct-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8.5pt;
  font-weight: 600;
  line-height: 1;
  color: #fff;
}
.ct-chip .fas { font-size: 7pt; }
.ct-chip .ct-qty { font-variant-numeric: tabular-nums; }

.ct-chip--active { background: var(--ct-active); }
.ct-chip--closed { background: var(--ct-closed); }
.ct-chip--other  { background: var(--ct-other); }

/* === Actions par client (génération documents) === */
.ct-tiers-cell { min-width: 220px; }
.ct-row-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.ct-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--ct-border);
  background: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 8.5pt;
  font-weight: 600;
  cursor: pointer;
  color: #33404d;
  font-family: inherit;
  transition: background .12s, border-color .12s, color .12s;
}
.ct-act .fas { font-size: 8pt; }
.ct-act--contrat:hover { background: var(--main-bg-color); border-color: var(--main-bg-color); color: #fff; }
.ct-act--avenant:hover { background: var(--main-button); border-color: var(--main-button); color: #fff; }

/* === Modale avenant === */
.ct-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 44, 0.55);
  display: flex;
  align-items: flex-start;       /* modale en haut ; l'overlay défile si elle est haute */
  justify-content: center;
  z-index: 9999;
  padding: 30px 20px;
  overflow-y: auto;
}
.ct-modal {
  background: #fff;
  border-radius: 12px;
  width: 900px;
  max-width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: visible;             /* ne rogne PAS la liste déroulante du multiselect */
  text-align: left;
}
.ct-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--main-bg-color);
  color: #fff;
  border-radius: 12px 12px 0 0;  /* coins arrondis conservés sans overflow:hidden */
}
.ct-modal-head h2 { margin: 0; font-size: 14pt; font-weight: 700; }
.ct-modal-head .fas { margin-right: 6px; }
.ct-modal-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15pt;
  cursor: pointer;
  line-height: 1;
}
.ct-modal-body {
  padding: 18px;
  overflow: visible;             /* laisse la liste déroulante déborder hors de la modale */
}
/* Multiselect pleine largeur (input + liste déroulante) qui passe au-dessus du reste de la modale */
.ct-modal .multiselect { z-index: 20; width: 100%; }
.ct-modal .multiselect--active { z-index: 60; }
.ct-modal .multiselect__content-wrapper { z-index: 60; width: 100%; }
.ct-modal-label {
  display: block;
  font-weight: 700;
  color: var(--main-button);
  font-size: 10.5pt;
  margin-bottom: 4px;
}
.ct-modal-hint {
  font-size: 9pt;
  color: #8a94a0;
  margin-bottom: 12px;
}
.ct-opt-ref {
  font-variant-numeric: tabular-nums;
  color: #8a94a0;
  font-size: 9pt;
  margin-right: 4px;
}
.ct-opt-price {
  color: var(--main-bg-color);
  font-weight: 600;
  margin-left: 6px;
}
.ct-opt-incontract {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(30, 158, 106, 0.15);
  color: #1e9e6a;
  font-size: 8pt;
  font-weight: 700;
}
.ct-opt-incontract .fas { font-size: 7pt; margin-right: 3px; }
.ct-ms-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8a94a0;
  padding: 14px 0;
}
.ct-ms-loading .ct-spinner { width: 24px; height: 24px; border-width: 3px; }

/* Table des lignes d'avenant */
.ct-avenant-lines {
  width: 100%;
  table-layout: fixed;            /* colonnes maîtrisées → ne déborde pas de la modale */
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 9.5pt;
}
.ct-avenant-lines th,
.ct-avenant-lines td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--ct-border);
  text-align: left;
  vertical-align: top;
  overflow: hidden;
}
/* Largeurs de colonnes (Réf / Produit / Statut / Qté / Tarif / Remise / Total / suppr.) */
.ct-avenant-lines thead th:nth-child(1) { width: 74px; }
.ct-avenant-lines thead th:nth-child(2) { width: auto; }
.ct-avenant-lines thead th:nth-child(3) { width: 108px; }
.ct-avenant-lines thead th:nth-child(4) { width: 52px; }
.ct-avenant-lines thead th:nth-child(5) { width: 68px; }
.ct-avenant-lines thead th:nth-child(6) { width: 64px; }
.ct-avenant-lines thead th:nth-child(7) { width: 84px; }
.ct-avenant-lines thead th:nth-child(8) { width: 28px; }
.ct-avenant-lines thead th {
  background: #f1f4f6;
  color: #55606b;
  font-weight: 600;
  font-size: 8pt;
  text-transform: uppercase;
  letter-spacing: .2px;
}
.ct-avenant-lines .ct-al-ref { font-variant-numeric: tabular-nums; color: #8a94a0; word-break: break-all; }
.ct-avenant-lines .ct-al-label { white-space: normal; word-break: break-word; }
.ct-avenant-lines .ct-al-total { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; color: var(--main-button); }
.ct-al-input, .ct-al-num {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ct-border);
  border-radius: 5px;
  padding: 3px 5px;
  font-family: inherit;
  font-size: 9pt;
}
.ct-al-num { text-align: right; -moz-appearance: textfield; }
.ct-al-num::-webkit-outer-spin-button,
.ct-al-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ct-al-num:disabled, .ct-al-input:disabled { background: #f1f4f6; color: #b0b8c0; }
.ct-al-del {
  border: none;
  background: transparent;
  color: #c0392b;
  cursor: pointer;
  font-size: 10pt;
}
.ct-al-subtotal-lbl { text-align: right; font-weight: 700; color: var(--main-button); }
.ct-al-recall-lbl { text-align: right; color: #55606b; }
.ct-al-recall { text-align: right; color: #55606b; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-al-newtotal-lbl { text-align: right; font-weight: 800; color: var(--main-bg-color); }
.ct-al-newtotal { text-align: right; font-weight: 800; color: var(--main-bg-color); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ct-al-impacted {
  display: flex; align-items: center; gap: 6px; margin-top: 5px;
  font-size: 8.5pt; color: #c9820a; flex-wrap: wrap;
}
.ct-al-impacted > span { flex: none; }
.ct-al-impacted select { flex: 1; min-width: 120px; max-width: 100%; }
.ct-al-oldqty { flex: none; font-weight: 700; color: #c0392b; white-space: nowrap; }
.ct-modal-empty { color: #8a94a0; font-style: italic; margin-top: 16px; }

.ct-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--ct-border);
  background: #fafbfc;
  border-radius: 0 0 12px 12px;  /* coins arrondis conservés sans overflow:hidden */
}
.ct-btn-secondary, .ct-btn-primary {
  border-radius: 7px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 10pt;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--ct-border);
}
.ct-btn-secondary { background: #fff; color: #55606b; }
.ct-btn-secondary:hover { background: #f1f4f6; }
.ct-btn-primary {
  background: var(--main-bg-color);
  border-color: var(--main-bg-color);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.ct-btn-primary:hover { background: #1f8478; }
.ct-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* Modale de choix de contrat */
.ct-modal--sm { width: 520px; }
.ct-picker-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ct-picker-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--ct-border); border-radius: 8px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.ct-picker-item:hover { border-color: var(--main-bg-color); background: #f2fbf9; }
.ct-picker-ref { font-weight: 700; color: var(--main-button); font-size: 10.5pt; }
.ct-picker-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 9pt; color: #8a94a0; margin-top: 3px; }
.ct-picker-arrow { color: var(--main-bg-color); flex: none; }

/* === Responsive === */
/* Tablette (768-1024px) : la colonne client figée (dimensionnée au nom le plus
   long, ~404-412px quel que soit l'écran) ne laissait voir que 6 à 10 des 53
   colonnes produit (G7). On la borne pour rendre plus de colonnes visibles ;
   le nom complet reste lisible via l'infobulle (title) posée sur le lien. */
@media (max-width: 1024px) {
  .ct-table th.sticky,
  .ct-table td.sticky {
    max-width: 200px;
  }
  .ct-tiers-cell {
    min-width: 0;
    max-width: 200px;
  }
  .ct-tiers-cell a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
  }
}

@media (max-width: 768px) {
  .page_contrat { padding: 12px; }
  .header-contrat h1 { font-size: 16pt; }
  .ct-table-wrap { max-height: calc(100vh - 130px); }
  .ct-table th,
  .ct-table td { padding: 6px 8px; }
  .ct-modal { width: 100%; }
  .ct-avenant-lines { font-size: 9pt; }

  /* BLOQUANT (B7) : à 375px, la colonne client figée dépassait seule la
     largeur de l'écran et recouvrait en permanence toutes les colonnes
     produit (position:sticky). On la borne à une fraction du viewport, nom
     sur 2 lignes maximum (ellipse), infobulle pour le nom complet. */
  .ct-table th.sticky,
  .ct-table td.sticky {
    max-width: 42vw;
  }
  .ct-tiers-cell {
    max-width: 42vw;
  }
  .ct-row-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .ct-act {
    font-size: 8pt;
    padding: 3px 7px;
  }
}
