/* Couleurs */
:root {
  --cmw-primaire: #880033;
  --cmw-primaire-dark: #560027;
}

/* Scope général */
.cmw-contrat { padding-bottom: 2rem; }

/* Bouton PDF */
.cmw-contrat .download-btn{
  margin:1.5em 0; padding:.5em 1em; background:var(--cmw-primaire); color:#fff;
  border:none; cursor:pointer; border-radius:4px; font-size:1em;
}

/* Onglets */
.cmw-contrat .onglets{display:flex;gap:1em;margin-bottom:1.5em;flex-wrap:wrap}
.cmw-contrat .onglet{padding:.5em 1em;background:#eee;border-radius:5px;cursor:pointer;transition:background .2s}
.cmw-contrat .onglet.active{background:var(--cmw-primaire);color:#fff;font-weight:700}

/* Titres (scopés) */
.cmw-contrat h1{
  font-size:2em;color:var(--cmw-primaire);
  border-bottom:2px solid var(--cmw-primaire);padding-bottom:.3em;margin-bottom:1em;text-align:left
}
.cmw-contrat h2{font-size:1.5em;color:var(--cmw-primaire);margin-top:2em;border-bottom:1px solid #ccc;padding-bottom:.2em}
.cmw-contrat h3{font-size:1.2em;color:#444;margin-top:1.5em}

/* Liste contrats */
.cmw-contrat ul{padding-left:1em}
.cmw-contrat li{
  margin-bottom:1.5em;padding:.5em;background:#f9f9f9;border-left:4px solid var(--cmw-primaire);padding-left:1em
}
.cmw-contrat strong{color:#000}

/* Ligne + logo */
.cmw-contrat .ligne-contrat{display:flex;align-items:flex-start;margin-bottom:1.5em}
.cmw-contrat .logo-contrat-container{flex:0 0 auto;margin-right:1em}
.cmw-contrat .logo-contrat-container img{height:40px;border-radius:4px;box-shadow:0 0 2px rgba(0,0,0,.1)}
.cmw-contrat .texte-contrat{flex:1}

/* Badge ID */
.cmw-contrat .badge-contrat{display:inline-block;background:var(--cmw-primaire);color:#fff;padding:.2em .6em;border-radius:6px;font-weight:700;font-size:.85em;margin-top:.5em}
.cmw-contrat .badge-contrat__link{color:#fff;text-decoration:none}

/* Liens de tri (si utilisés) */
.cmw-contrat .tri-contrats{margin:1em 0;display:flex;align-items:center;gap:.5em;flex-wrap:wrap}
.cmw-contrat .tri-contrats a{
  background:#f5f5f5;border:1px solid #ccc;padding:.3em .6em;border-radius:4px;
  color:var(--cmw-primaire-dark);text-decoration:none;font-size:.9em;transition:background .2s
}
.cmw-contrat .tri-contrats a:hover,
.cmw-contrat .tri-contrats a.active{background:var(--cmw-primaire-dark);color:#fff;border-color:var(--cmw-primaire-dark)}

/* Impression */
@page { size: A4; margin: 12mm; }
@media print{
  .cmw-contrat .download-btn, .cmw-contrat .onglets, .cmw-contrat .toggle-arrow{display:none!important}
  .cmw-contrat [id^="bloc-"]{display:block!important}
  .cmw-contrat h1, .cmw-contrat h2, .cmw-contrat h3{page-break-after:avoid}
  .cmw-contrat .ligne-contrat{page-break-inside:avoid;margin-bottom:6mm}
  .cmw-contrat{padding-bottom:0}
}
