/* PaieCM — bulletin-paie.css (extrait du monolithe, fidèle) */
  body{background:#F4F2EA;color:#16261C;font-family:'IBM Plex Sans',sans-serif}
  input,select,textarea{font-size:13px!important}
  .fld{width:100%;border:1px solid #DDD8C8;background:#fff;border-radius:6px;padding:6px 8px;outline:none}
  .fld:focus{border-color:#1F6E43;box-shadow:0 0 0 2px rgba(31,110,67,.15)}
  .lbl{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#5B6B5E;display:block;margin-bottom:3px}
  .chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;border:1px solid #DDD8C8;background:#fff;border-radius:999px;padding:3px 10px;cursor:pointer;user-select:none}
  .chip:hover{border-color:#1F6E43;color:#1F6E43}
  .simple-mode .gc-tc{display:none!important}   /* mode Simplifié : masque les cases T/C (imposable/cotisable) */
  details.sec{border:1px solid #DDD8C8;border-radius:10px;background:#fff;overflow:hidden}
  details.sec>summary{cursor:pointer;list-style:none;padding:10px 14px;font-family:'Space Grotesk';font-weight:600;font-size:14px;display:flex;align-items:center;gap:8px;background:#FBFAF5}
  details.sec>summary::-webkit-details-marker{display:none}
  details.sec[open]>summary{border-bottom:1px solid #EDE9DC}
  details.sec>summary .num{width:22px;height:22px;border-radius:6px;background:#1F6E43;color:#fff;font-size:11px;display:flex;align-items:center;justify-content:center;font-family:'IBM Plex Mono'}
  .cbx{accent-color:#1F6E43;width:15px;height:15px;cursor:pointer}
  .btn{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;border-radius:8px;padding:8px 14px;cursor:pointer;transition:.15s}
  .btn-p{background:#1F6E43;color:#fff}.btn-p:hover{background:#174F31}
  .btn-o{border:1px solid #16261C;color:#16261C;background:#fff}.btn-o:hover{background:#16261C;color:#fff}
  .btn-g{border:1px solid #DDD8C8;background:#fff}.btn-g:hover{border-color:#1F6E43;color:#1F6E43}
  /* ---------- Zone bulletin A4 ---------- */
  #pageWrap{display:flex;justify-content:center}
  #page{width:210mm;min-height:297mm;background:#fff;box-shadow:0 8px 40px rgba(22,38,28,.18);transform-origin:top center;overflow:hidden}
  .bp{width:100%;height:100%;padding:9mm 9mm;font-size:calc(9.2pt*var(--fs,1));font-family:var(--fbody,'IBM Plex Sans',sans-serif);line-height:1.32;color:#111;position:relative;box-sizing:border-box}
  .bp table{width:100%;border-collapse:collapse}
  .bp .mono{font-family:'IBM Plex Mono',monospace}
  .bp .num{text-align:right;font-family:'IBM Plex Mono',monospace;white-space:nowrap}
  /* Modèle CLASSIQUE */
  .tpl-classique .bx{border:1.2px solid #222}
  .tpl-classique th,.tpl-classique td{border:.6px solid #444;padding:2.2px 5px}
  .tpl-classique thead th{background:var(--c1);color:#fff;font-weight:600}
  /* Modèle MODERNE */
  .tpl-moderne .card{border:1px solid #E5E2D6;border-radius:8px;overflow:hidden;margin-bottom:8px}
  .tpl-moderne .card h4{background:var(--c1);color:#fff;font-size:8.6pt;letter-spacing:.06em;text-transform:uppercase;padding:4px 10px;margin:0}
  .tpl-moderne td,.tpl-moderne th{padding:2.6px 10px;border-bottom:.5px solid #EEEBDF}
  .tpl-moderne thead th{font-size:8pt;text-transform:uppercase;letter-spacing:.05em;color:#666;background:#FAF9F3}
  /* Modèle MINIMAL */
  .tpl-minimal{font-family:'IBM Plex Mono',monospace;font-size:8.6pt}
  .tpl-minimal td,.tpl-minimal th{padding:2px 4px;border-bottom:.5px solid #ccc}
  .tpl-minimal .rule{border-top:1.4px solid #111}
  /* Modèle BANDE */
  .tpl-bande{padding-left:15mm}
  .tpl-bande .side{position:absolute;left:0;top:0;bottom:0;width:9mm;background:var(--c1)}
  .tpl-bande .side span{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-90deg);white-space:nowrap;color:#fff;font-family:'Space Grotesk';letter-spacing:.35em;font-size:10pt}
  .tpl-bande td,.tpl-bande th{padding:2.4px 8px;border-bottom:.5px solid #E2DFD2}
  .tpl-bande thead th{color:var(--c1);border-bottom:1.4px solid var(--c1);font-size:8pt;text-transform:uppercase;letter-spacing:.06em}
  /* ---- Piles de polices fidèles ---- */
  /* narrow: Helvetica Narrow (Sage) · calibri: Clinique · tahoma: BrainBox · times/chaparral: APNH · courier: table Ecogef */
  .slogan-cal{font-family:'Lucida Calligraphy','Great Vibes','Segoe Script',cursive}
  /* Modèle SAGE (Helvetica Narrow, cadres arrondis gris) */
  .tpl-sage{font-size:calc(7.9pt*var(--fs,1));font-family:var(--fbody)}
  .tpl-sage .fr{border:.8px solid #9AA0A6;border-radius:9px;padding:4px 9px}
  .tpl-sage table.grid{border:.8px solid #9AA0A6}
  .tpl-sage table.grid td,.tpl-sage table.grid th{border:.4px solid #C3C7CC;padding:1.4px 4px;font-size:calc(7.5pt*var(--fs,1))}
  .tpl-sage table.grid thead th{background:#EDEDED;font-weight:700}
  .tpl-sage .netHead{background:#4A4A4A;color:#fff}
  /* Modèle ECOGEF (Times + slogan calligraphié + table Courier) */
  .tpl-ecogef{font-family:var(--fbody)}
  .tpl-ecogef .lab{color:var(--c1);font-weight:700;text-transform:uppercase;font-size:calc(8pt*var(--fs,1));font-family:Verdana,Geneva,sans-serif}
  .tpl-ecogef table.pay{border:1.5px solid #1a1a1a}
  .tpl-ecogef table.pay th{border-bottom:1.5px solid #1a1a1a;border-left:.8px solid #1a1a1a;padding:3px 8px;font-size:calc(9.4pt*var(--fs,1))}
  .tpl-ecogef table.pay td{border-left:.8px solid #1a1a1a;font-family:'Courier New',Cousine,monospace;font-size:calc(8.5pt*var(--fs,1));padding:1.5px 8px}
  /* Modèle BRAINBOX (Tahoma, bandes obliques) */
  .tpl-brainbox{font-family:var(--fbody);padding:0!important}
  .tpl-brainbox .inner{padding:0 10mm}
  .tpl-brainbox table.pay{border:1.4px solid #222}
  .tpl-brainbox table.pay td,.tpl-brainbox table.pay th{border:.9px solid #333;padding:3.6px 8px;font-size:calc(8.8pt*var(--fs,1))}
  /* Modèle APNH (serif, cachet, filigrane) */
  .tpl-apnh{font-family:var(--fbody);font-size:calc(9pt*var(--fs,1))}
  .tpl-apnh .fr{border:1px solid #333;padding:3px 8px}
  .tpl-apnh table.pay{border:1.2px solid #333}
  .tpl-apnh table.pay td,.tpl-apnh table.pay th{padding:2px 6px;font-size:calc(8.9pt*var(--fs,1))}
  .tpl-apnh table.pay th{border-bottom:1.2px solid #333;border-left:.7px solid #333}
  .tpl-apnh table.pay td{border-left:.7px solid #333}
  .tpl-apnh table.cum td,.tpl-apnh table.cum th{border:.7px solid #333;padding:2.5px 6px;font-size:calc(7.9pt*var(--fs,1))}
  .tpl-apnh .visa{position:absolute;top:7mm;right:13mm;width:23mm;height:17mm;border:1.7px solid #C22;border-radius:50%;color:#C22;display:flex;flex-direction:column;align-items:center;justify-content:center;font-family:Arial;font-size:9.5pt;transform:rotate(-6deg);line-height:1.25}
  .tpl-apnh .wm{position:absolute;top:46%;left:50%;transform:translate(-50%,-50%);font-size:48pt;color:rgba(0,0,0,.055);font-weight:700;white-space:nowrap;pointer-events:none;font-family:Georgia,serif}
  /* Modèle CLINIQUE (Calibri, fiscal / social séparés) */
  .tpl-clinique{font-family:var(--fbody);font-size:calc(8.8pt*var(--fs,1))}
  .tpl-clinique table.pay{border:.9px solid #666}
  .tpl-clinique table.pay td,.tpl-clinique table.pay th{border:.45px solid #999;padding:1.8px 6px;font-size:calc(8.3pt*var(--fs,1))}
  .tpl-clinique table.pay th{background:#F2F2F2}
  .tpl-clinique .secrow td{font-weight:700;font-style:italic;background:#FAFAFA;border-top:.9px solid #666}
  .tpl-clinique .stat{border:.9px solid #666;padding:3px 8px;text-align:center;flex:1}
  /* Modèle ENSTP — secteur public bilingue, tout italique */
  .tpl-enstp{font-family:var(--fbody);font-style:italic;font-size:calc(8.8pt*var(--fs,1))}
  .tpl-enstp table.pay{border:1.3px solid #222}
  .tpl-enstp table.pay td,.tpl-enstp table.pay th{border:.6px solid #333;padding:2px 7px;font-size:calc(8.7pt*var(--fs,1))}
  .tpl-enstp .shade td{background:#EFEFEF;font-weight:700}
  .tpl-enstp .seclbl td{font-weight:700}
  /* Modèle TRACTAFRIC — logo jaune, tampon rouge */
  .tpl-tract{font-family:var(--fbody);font-size:calc(8.8pt*var(--fs,1))}
  .tpl-tract .fr{border:1.1px solid #222;padding:3px 8px}
  .tpl-tract table.pay{border:1.3px solid #222}
  .tpl-tract table.pay td,.tpl-tract table.pay th{padding:1.6px 6px;font-size:calc(8.6pt*var(--fs,1))}
  .tpl-tract table.pay th{border-bottom:1.3px solid #222;border-left:.7px solid #222;font-weight:700}
  .tpl-tract table.pay td{border-left:.7px solid #222}
  .tpl-tract table.cum td,.tpl-tract table.cum th{border:.7px solid #222;padding:2.5px 6px;font-size:calc(8pt*var(--fs,1))}
  .tpl-tract .stamp{border:2.2px solid #D22;color:#D22;transform:rotate(-9deg);padding:3px 8px;font-weight:800;font-size:9.5pt;display:inline-block;line-height:1.2;font-family:Arial}
  /* Modèle GGA — colonnes A AJOUTER / A DEDUIRE / CHARGES PATRONALES */
  .tpl-gga{font-family:var(--fbody);font-size:calc(8.6pt*var(--fs,1))}
  .tpl-gga table.pay td{border:.9px solid #333;padding:2px 7px;font-size:calc(8.4pt*var(--fs,1))}
  .tpl-gga th.hbox{border:1.1px solid #333;padding:2px 5px;font-size:calc(7.8pt*var(--fs,1));font-weight:700;text-align:center}
  .tpl-gga .redlbl{color:var(--c1);font-weight:700}
  /* Modèle SNPC — en-tête bleu ombré, cumuls verts */
  .tpl-snpc{font-family:var(--fbody);font-size:calc(8.8pt*var(--fs,1))}
  .tpl-snpc .fr{border:1.1px solid #333;padding:3px 9px}
  .tpl-snpc table.pay{border:1.1px solid #333}
  .tpl-snpc table.pay td,.tpl-snpc table.pay th{padding:1.5px 6px;font-size:calc(8.5pt*var(--fs,1))}
  .tpl-snpc table.pay th{border-bottom:1.1px solid #333;border-left:.6px solid #333;font-weight:700}
  .tpl-snpc table.pay td{border-left:.6px solid #333}
  .tpl-snpc table.cum td,.tpl-snpc table.cum th{border:.7px solid #333;padding:2px 5px;font-size:calc(7.6pt*var(--fs,1))}
  .tpl-snpc .netgreen{background:#92D050;font-weight:700}
  /* Modèle DÉTAILLÉ (style 3M — en-tête logo, grille détaillée, social/fiscal, billetage) */
  .tpl-detaille{font-family:var(--fbody);font-size:calc(7.9pt*var(--fs,1))}
  .tpl-detaille table{width:100%;border-collapse:collapse}
  .tpl-detaille td,.tpl-detaille th{border:.6px solid #444;padding:1.5px 5px}
  .tpl-detaille .band{background:var(--c1);color:#fff;font-weight:700;text-align:center;letter-spacing:.06em;font-size:calc(9.5pt*var(--fs,1))}
  .tpl-detaille .sec{background:#E7E7E7;font-weight:700}
  .tpl-detaille .red{color:#C0392B}
  .tpl-detaille .nom{background:#DDEBF7;color:#1F4E79;font-weight:700;font-size:calc(13pt*var(--fs,1));text-align:center}
  .tpl-detaille .lab{background:#F5F5F5;font-weight:600}
  .tpl-detaille .tot{background:#EFECE0;font-weight:700}
  .tpl-detaille .net{background:var(--c1);color:#fff;font-weight:700}
  /* ---------- Filigranes ---------- */
  .wm-custom{position:absolute;inset:0;z-index:6;pointer-events:none}
  .wm-lefisk{position:absolute;inset:-25%;z-index:7;pointer-events:none;overflow:hidden;
    transform:rotate(-27deg);display:flex;flex-direction:column;justify-content:space-around;opacity:.11}
  .wm-lefisk>div{white-space:nowrap;font-family:'Space Grotesk',sans-serif;font-weight:800;
    font-size:15pt;letter-spacing:.12em;color:#1F6E43;text-align:center}
  @media print{

    body *{visibility:hidden} #page,#page *{visibility:visible}
    #page{position:absolute;left:0;top:0;transform:none!important;box-shadow:none;width:210mm}
    @page{size:A4;margin:0}
  }
