  [hidden]{display:none !important;}
  :root{
    --bg:#FAF6EE;
    --surface:#FFFFFF;
    --surface-alt:#F1E9D8;
    --surface-hover:#EAE0C7;
    --text:#2A2820;
    --text-muted:#7A705B;
    --border:#E4D9BF;
    --border-soft:#EEE4CE;
    --accent:#69794C;
    --accent-strong:#4E5C38;
    --accent-soft:#E4E8D5;
    --warn:#BD7A38;
    --warn-soft:#F4E3C9;
    --danger:#AE4C42;
    --danger-soft:#F3DCD6;
    --good:#4C7A5C;
    --good-soft:#DCEADD;
    --muted-pill:#E7E0CD;
    --shadow-sm:0 1px 2px rgba(38,34,20,.06);
    --shadow-md:0 10px 28px -14px rgba(38,34,20,.28);
    --radius-sm:8px;
    --radius-md:14px;
    --radius-lg:20px;
    --sidebar-w:248px;
    color-scheme:light;
  }

  *,*::before,*::after{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--bg);
    color:var(--text);
    font-family:"Work Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-size:15px;
    line-height:1.5;
    -webkit-font-smoothing:antialiased;
  }
  h1,h2,h3,h4{
    font-family:"Fraunces", Georgia, serif;
    font-weight:560;
    letter-spacing:-.01em;
    text-wrap:balance;
    margin:0;
    color:var(--text);
  }
  p{margin:0;}
  button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit;}
  /* 16px minimum sur les champs : en dessous, Safari iOS zoome automatiquement
     l'écran à chaque fois qu'on touche un champ, ce qui casse l'expérience
     sur iPhone. */
  input,select,textarea{font-size:16px;}
  button{cursor:pointer;}
  a{color:inherit;}
  ::selection{background:var(--accent-soft);}
  :focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px;}
  .num{font-variant-numeric:tabular-nums;}
  .eyebrow{
    font-size:11.5px;font-weight:600;letter-spacing:.09em;text-transform:uppercase;
    color:var(--text-muted);
  }

  /* ---------- shell ---------- */
  .app-shell{
    display:grid;
    grid-template-columns:var(--sidebar-w) 1fr;
    min-height:100vh;
  }
  .auth-screen{
    min-height:100vh;display:flex;align-items:center;justify-content:center;
    background:var(--bg);padding:24px;
  }
  .auth-card{
    width:100%;max-width:360px;background:var(--surface);border:1px solid var(--border-soft);
    border-radius:18px;padding:30px 26px;box-shadow:0 12px 32px rgba(0,0,0,.06);
  }
  .sidebar{
    border-right:1px solid var(--border-soft);
    padding:26px 18px 20px;
    display:flex;
    flex-direction:column;
    gap:28px;
    position:sticky;
    top:0;
    height:100vh;
  }
  .brand{
    display:flex;align-items:center;gap:10px;padding:0 6px;
  }
  .brand-mark{
    width:34px;height:34px;border-radius:50%;
    background:var(--accent-soft);
    display:flex;align-items:center;justify-content:center;
    color:var(--accent-strong);flex:none;
  }
  .brand-name{
    font-family:"Fraunces", serif;font-style:italic;font-weight:560;
    font-size:17px;line-height:1.2;color:var(--text);
  }
  .season-picker{display:flex;flex-direction:column;gap:2px;min-width:0;}
  .season-picker select{min-width:0;}
  .season-picker select{
    width:100%;border:1px solid var(--border);border-radius:var(--radius-sm);
    background:var(--surface-alt);color:var(--text);font-size:12.5px;font-weight:600;
    padding:7px 9px;
  }
  .season-picker .season-status{font-size:11px;color:var(--text-muted);padding:0 2px;}
  .nav{display:flex;flex-direction:column;gap:2px;flex:1;}
  .nav-item{
    display:flex;align-items:center;gap:11px;
    padding:10px 12px;border-radius:var(--radius-sm);
    color:var(--text-muted);background:none;border:none;text-align:left;
    font-size:14.5px;font-weight:500;
  }
  .nav-item svg{flex:none;opacity:.85;}
  .nav-item:hover{background:var(--surface-alt);color:var(--text);}
  .nav-item.active{background:var(--accent-soft);color:var(--accent-strong);}
  .sidebar-footer{border-top:1px solid var(--border-soft);padding-top:14px;}
  .profile-pill{
    display:flex;align-items:center;gap:10px;width:100%;
    background:none;border:1px solid var(--border);border-radius:999px;
    padding:7px 12px 7px 7px;color:var(--text);
  }
  .profile-pill:hover{background:var(--surface-alt);}
  .avatar{
    width:26px;height:26px;border-radius:50%;background:var(--accent);
    color:var(--surface);display:flex;align-items:center;justify-content:center;
    font-size:12px;font-weight:700;flex:none;
  }
  .profile-pill .who{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .profile-pill .change{margin-left:auto;font-size:11px;color:var(--text-muted);}

  .mobile-header{display:none;}
  .bottom-nav{display:none;}

  /* overflow-x:hidden vit ici plutôt que sur html/body : posé sur html/body,
     il transforme <body> en son propre conteneur de défilement (au lieu du
     viewport), ce qui casse position:sticky partout dans la page (menu
     latéral et en-tête mobile qui défilent au lieu de rester fixés). Posé
     uniquement sur .main — qui ne contient aucun élément sticky — il garde
     le même filet de sécurité contre les débordements horizontaux du
     contenu (utile sur mobile) sans affecter le collage du menu/en-tête. */
  .main{padding:34px 42px 80px;min-width:0;overflow-x:hidden;}
  .view-wrap{max-width:1180px;margin:0 auto;display:flex;flex-direction:column;gap:26px;}
  /* Comme .main plus haut : dans un flex column, un enfant (toolbar, panel…)
     n'est pas forcé de rétrécir en dessous de la largeur "min-content" de
     son contenu (ex. les libellés des filtres sur une seule ligne), donc
     sans min-width:0 il peut pousser plus large que .view-wrap lui-même —
     invisible via document.scrollWidth (masqué par overflow-x:hidden sur
     .main) mais bien réel : le contenu de droite (badges, boutons…) est
     alors coupé à l'écran sur mobile. */
  .view-wrap > *{min-width:0;}
  .view-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;}
  .view-head h1{font-size:27px;}
  .view-head .sub{color:var(--text-muted);font-size:13.5px;margin-top:4px;}

  /* ---------- buttons ---------- */
  .btn{
    display:inline-flex;align-items:center;gap:7px;
    padding:9px 15px;border-radius:999px;border:1px solid var(--border);
    background:var(--surface);color:var(--text);font-weight:600;font-size:13.5px;
    line-height:1;white-space:nowrap;
  }
  .btn:hover{background:var(--surface-alt);}
  .btn-primary{background:var(--accent);border-color:var(--accent);color:#fff;}
  .btn-primary:hover{background:var(--accent-strong);border-color:var(--accent-strong);}
  .btn-ghost{border-color:transparent;background:none;}
  .btn-ghost:hover{background:var(--surface-alt);}
  .btn-danger{color:var(--danger);}
  .btn-sm{padding:6px 11px;font-size:12.5px;}
  .btn:disabled{opacity:.45;cursor:not-allowed;}
  .icon-btn{
    width:32px;height:32px;border-radius:50%;border:1px solid transparent;background:none;
    display:flex;align-items:center;justify-content:center;color:var(--text-muted);
  }
  .icon-btn:hover{background:var(--surface-alt);color:var(--text);}

  /* ---------- pills / badges ---------- */
  .pill{
    display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:999px;
    font-size:12px;font-weight:600;white-space:nowrap;
  }
  .pill-dot{width:6px;height:6px;border-radius:50%;background:currentColor;flex:none;}
  .pill-good{background:var(--good-soft);color:var(--good);}
  .pill-warn{background:var(--warn-soft);color:var(--warn);}
  .pill-danger{background:var(--danger-soft);color:var(--danger);}
  .pill-muted{background:var(--muted-pill);color:var(--text-muted);}
  .pill-accent{background:var(--accent-soft);color:var(--accent-strong);}

  /* ---------- stat tiles ---------- */
  .stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;}
  .stat-tile{
    background:var(--surface);border:1px solid var(--border-soft);border-radius:var(--radius-md);
    padding:16px 18px;display:flex;flex-direction:column;gap:8px;box-shadow:var(--shadow-sm);
  }
  .stat-tile .num-big{font-family:"Fraunces",serif;font-size:30px;font-weight:560;}
  .stat-tile .label{font-size:12.5px;color:var(--text-muted);font-weight:500;}

  /* ---------- panels / cards ---------- */
  .panel{
    background:var(--surface);border:1px solid var(--border-soft);border-radius:var(--radius-lg);
    box-shadow:var(--shadow-sm);
  }
  .panel-head{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    padding:16px 20px;border-bottom:1px solid var(--border-soft);
  }
  .panel-head h2{font-size:16.5px;}
  .panel-body{padding:6px 20px 16px;}
  .panel-body.pad{padding:18px 20px 20px;}
  .empty-row{padding:26px 4px;text-align:center;color:var(--text-muted);font-size:13.5px;}

  /* ---------- lists ---------- */
  .row-list{display:flex;flex-direction:column;}
  .row-item{
    display:flex;align-items:center;gap:14px;padding:13px 4px;
    border-bottom:1px solid var(--border-soft);min-width:0;
  }
  .row-item:last-child{border-bottom:none;}
  .row-item .rname{font-weight:600;font-size:14px;}
  .row-item .rmeta{font-size:12.5px;color:var(--text-muted);margin-top:2px;}
  .row-avatar{
    width:36px;height:36px;border-radius:50%;background:var(--surface-alt);color:var(--accent-strong);
    display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;flex:none;
  }
  .row-grow{flex:1;min-width:0;}
  .row-grow .rname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  /* Une ligne de nom avec des pictos (santé, adhésions…) ne doit JAMAIS les
     faire disparaître dans l'ellipse quand le nom est long — seul le TEXTE
     du nom se tronque, les pictos restent toujours visibles à sa suite.
     Spécificité (.row-grow .rname.rname-badged, 3 classes) volontairement
     plus élevée que la règle générique ci-dessus pour la remplacer ici. */
  .row-grow .rname.rname-badged{display:flex;align-items:center;overflow:visible;text-overflow:clip;white-space:normal;}
  .rname-badged .rn-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
  .rname-badged .rn-badges{display:inline-flex;align-items:center;flex:none;}
  .row-end{display:flex;align-items:center;gap:10px;flex:none;}
  .clickable{background:none;border:none;text-align:left;width:100%;padding:0;}
  .clickable:hover .rname{color:var(--accent-strong);}

  /* ---------- filters / toolbar ---------- */
  .toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
  .search-input{
    display:flex;align-items:center;gap:8px;background:var(--surface);
    border:1px solid var(--border);border-radius:999px;padding:8px 14px;min-width:220px;flex:1;
  }
  .search-input input{border:none;background:none;outline:none;width:100%;color:var(--text);}
  .search-input svg{color:var(--text-muted);flex:none;}
  .seg{display:flex;background:var(--surface-alt);border-radius:999px;padding:3px;gap:2px;}
  .seg button{
    border:none;background:none;padding:6px 13px;border-radius:999px;font-size:12.5px;font-weight:600;
    color:var(--text-muted);
  }
  .seg button.active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm);}

  /* ---------- table ---------- */
  .table-wrap{overflow-x:auto;}
  table{width:100%;border-collapse:collapse;font-size:13.5px;}
  th{
    text-align:left;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);
    font-weight:600;padding:0 10px 10px;border-bottom:1px solid var(--border-soft);white-space:nowrap;
  }
  td{padding:12px 10px;border-bottom:1px solid var(--border-soft);vertical-align:middle;}
  tr:last-child td{border-bottom:none;}

  /* ---------- progress ---------- */
  .progress{height:6px;border-radius:999px;background:var(--surface-alt);overflow:hidden;width:100%;}
  .progress > span{display:block;height:100%;background:var(--accent);border-radius:999px;}
  .progress.warn > span{background:var(--warn);}
  .progress.danger > span{background:var(--danger);}

  /* ---------- forms ---------- */
  .field{display:flex;flex-direction:column;gap:6px;}
  .field label{font-size:12.5px;font-weight:600;color:var(--text-muted);}
  .field input[type=text],.field input[type=number],.field input[type=date],.field input[type=tel],
  .field input[type=email],.field select,.field textarea{
    border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 11px;
    background:var(--surface);color:var(--text);width:100%;
  }
  .field textarea{resize:vertical;min-height:64px;}
  .field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
  .field-row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;}
  .chip-row{display:flex;gap:8px;flex-wrap:wrap;}
  .chip{
    border:1px solid var(--border);background:var(--surface);border-radius:999px;
    padding:7px 14px;font-size:13px;font-weight:600;color:var(--text);
  }
  .chip.active{background:var(--accent);border-color:var(--accent);color:#fff;}
  .radio-row{display:flex;gap:8px;flex-wrap:wrap;}
  .radio-card{
    border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 14px;
    background:var(--surface);flex:1;min-width:150px;
  }
  .radio-card.active{border-color:var(--accent);background:var(--accent-soft);}
  .radio-card .t{font-weight:600;font-size:13.5px;}
  .radio-card .d{font-size:12px;color:var(--text-muted);margin-top:2px;}
  .hint{font-size:12px;color:var(--text-muted);}
  .formula-list{display:flex;flex-direction:column;gap:8px;}
  .formula-option{
    display:flex;align-items:center;gap:12px;width:100%;text-align:left;
    border:1px solid var(--border);border-radius:var(--radius-sm);padding:11px 14px;
    background:var(--surface);
  }
  .formula-option:hover{background:var(--surface-alt);}
  .formula-option.active{border-color:var(--accent);background:var(--accent-soft);}
  .fo-dot{width:16px;height:16px;border-radius:50%;border:2px solid var(--border);flex:none;position:relative;}
  .formula-option.active .fo-dot{border-color:var(--accent);}
  .formula-option.active .fo-dot::after{content:'';position:absolute;inset:3px;border-radius:50%;background:var(--accent);}
  .fo-main{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0;}
  .fo-title{font-weight:600;font-size:13.5px;}
  .fo-sub{font-size:12px;color:var(--text-muted);}
  .form-grid{display:flex;flex-direction:column;gap:16px;}

  /* ---------- combobox (présences) ---------- */
  .combo{position:relative;}
  .combo-list{
    position:absolute;top:calc(100% + 6px);left:0;right:0;background:var(--surface);
    border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-md);
    max-height:260px;overflow-y:auto;z-index:20;
  }
  .combo-list button{
    display:flex;width:100%;align-items:center;gap:10px;padding:10px 14px;background:none;border:none;
    text-align:left;font-size:13.5px;
  }
  .combo-list button:hover{background:var(--surface-alt);}
  .combo-empty{padding:14px;font-size:13px;color:var(--text-muted);}

  /* ---------- modal ---------- */
  .modal-backdrop{
    position:fixed;inset:0;background:rgba(24,21,12,.42);backdrop-filter:blur(1px);
    display:flex;align-items:flex-start;justify-content:center;padding:5vh 16px;z-index:100;
    overflow-y:auto;
  }
  .modal{
    background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);
    width:100%;max-width:520px;padding:22px 24px 24px;
  }
  .modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;}
  .modal-head h3{font-size:19px;}
  .modal-foot{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;}

  /* ---------- toast ---------- */
  .toast-root{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px;align-items:center;}
  .toast{
    background:var(--text);color:var(--bg);padding:10px 18px;border-radius:999px;font-size:13px;font-weight:600;
    box-shadow:var(--shadow-md);opacity:0;transform:translateY(6px);transition:opacity .18s,transform .18s;
  }
  .toast.show{opacity:1;transform:translateY(0);}

  .banner{
    display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:var(--radius-sm);
    background:var(--warn-soft);color:var(--warn);font-size:13px;font-weight:600;
  }

  .watch-item{display:flex;align-items:center;gap:12px;padding:12px 4px;border-bottom:1px solid var(--border-soft);}
  .check-row{display:flex;align-items:center;gap:14px;padding:13px 6px;border-bottom:1px solid var(--border-soft);cursor:pointer;border-radius:10px;min-width:0;}
  .check-row:hover{background:var(--surface-alt);}
  .check-row:last-child{border-bottom:none;}
  .check-row input[type="checkbox"]{width:23px;height:23px;flex:none;accent-color:var(--accent);cursor:pointer;}
  .check-row.locked{opacity:.6;cursor:not-allowed;}
  .check-row.locked:hover{background:none;}
  .check-row.locked input[type="checkbox"]{cursor:not-allowed;}
  .check-row .rname{font-weight:600;font-size:14px;}
  .check-row .rmeta{font-size:12.5px;color:var(--text-muted);margin-top:2px;}
  .session-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:space-between;}
  .session-bar .sb-info{font-size:13px;color:var(--text-muted);}
  .link-btn{background:none;border:none;padding:0;color:var(--accent-strong);font-size:12.5px;font-weight:600;cursor:pointer;text-decoration:underline;}
  .watch-item:last-child{border-bottom:none;}
  .two-col{display:grid;grid-template-columns:1.5fr 1fr;gap:20px;align-items:start;}
  /* Un item de grid a par défaut min-width:auto, ce qui revient à sa taille
     min-content — et donc, tant qu'aucun de ses descendants profonds n'a
     lui-même overflow non-visible, à la largeur d'un texte non-coupable
     (ex. un nom d'élève long dans .rname, avec white-space:nowrap) au sein
     d'un panneau. Ça élargissait toute la colonne (et donc les DEUX
     panneaux du .two-col) au-delà de l'écran sur mobile, sans que ce soit
     détectable via le scroll horizontal de la page (cf. commentaire sur
     .main plus haut) — le panneau lui-même semblait "normal" en desktop où
     il y a largement la place. min-width:0 force la colonne à respecter la
     largeur disponible ; l'ellipse de .row-grow .rname prend le relais.  */
  .two-col > *{min-width:0;}

  @media (max-width:1020px){
    .stat-grid{grid-template-columns:repeat(2,1fr);}
    .two-col{grid-template-columns:1fr;}
  }
  @media (max-width:780px){
    .app-shell{grid-template-columns:1fr;}
    .sidebar{display:none;}
    .mobile-header{
      display:flex;flex-direction:column;gap:10px;
      padding:calc(14px + env(safe-area-inset-top)) 18px 14px;border-bottom:1px solid var(--border-soft);position:sticky;top:0;
      background:var(--bg);z-index:30;
    }
    /* Le nom de l'appli + déconnexion/profil restent sur une première ligne ;
       le sélecteur de saison passe sur sa propre ligne juste en dessous,
       plutôt que de se serrer sur la même ligne — sur un petit écran, les
       trois ensemble (nom de l'appli en italique assez large + menu de
       saison + pastille profil) n'ont pas la place et se chevauchaient. */
    .mobile-header-top{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0;}
    .mobile-header .brand-name{font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
    .mobile-header .season-picker select{width:100%;}
    .main{padding:20px 16px 96px;}
    .bottom-nav{
      display:flex;position:fixed;bottom:0;left:0;right:0;background:var(--surface);
      border-top:1px solid var(--border-soft);z-index:30;padding:6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-nav .nav-item{
      flex:1;flex-direction:column;gap:3px;align-items:center;font-size:10.5px;padding:6px 2px;
      border-radius:10px;
    }
    .field-row, .field-row-3{grid-template-columns:1fr;}
    .view-head h1{font-size:23px;}
    .view-head{flex-direction:column;align-items:stretch;}
    .view-head > .btn{width:100%;justify-content:center;}
    .toolbar{flex-direction:column;align-items:stretch;}
    /* Même remarque que sur .view-wrap plus haut : en colonne, un enfant
       (la barre de recherche, un groupe de filtres .seg…) peut refuser de
       rétrécir sous la largeur "contenu" de ce qu'il contient et déborder
       du panneau — invisible dans le scroll horizontal de la page à cause
       d'overflow-x:hidden sur .main, mais bien réel à l'écran. */
    .toolbar > *{min-width:0;width:100%;}
    /* (règle .view-head .toolbar retirée : elle forçait les boutons d'un
       toolbar placé dans le view-head sur UNE SEULE ligne à largeur égale —
       correct avec 1-2 boutons courts, mais l'écran Comptabilité (seul cas
       actuel) en a 3, dont "Exporter le grand livre" : sur un écran de
       téléphone, ça ne laissait qu'une trentaine de pixels par bouton, texte
       et icône illisibles/chevauchés. Signalé par Jonathan ("l'onglet
       Comptabilité n'est pas responsive"). Sans cette règle, ce toolbar suit
       maintenant le même empilement en colonne, pleine largeur, que tous les
       autres toolbars de l'appli — lisible quel que soit le nombre de
       boutons. */
    .seg{overflow-x:auto;}
    .btn{padding:11px 16px;font-size:14px;}
    .btn-sm{padding:9px 13px;font-size:13px;}
    .icon-btn{width:40px;height:40px;}
    .check-row{padding:15px 6px;gap:14px;}
    .check-row input[type="checkbox"]{width:25px;height:25px;}
    .row-avatar{width:40px;height:40px;font-size:14px;}
    /* Sur mobile, une ligne de liste peut porter plusieurs badges + un montant
       (ex. carte : statut + paiement + prix) en plus du bouton "…" : ça ne
       tient pas sur une seule ligne. On force ce groupe de fin de ligne
       (.row-end) à passer systématiquement sur sa propre ligne, sous le nom,
       plutôt que de déborder hors de l'écran. */
    .row-item{flex-wrap:wrap;row-gap:8px;}
    .row-item .row-end{flex-basis:100%;justify-content:flex-end;margin-top:0;}
    /* Même traitement pour le roster de Présences : une ligne peut porter
       jusqu'à 3 badges (santé / droit à l'image / newsletter) + un nom long
       + le bouton "Annoncer/Annuler une absence" + le bouton "i" — ça ne
       tient pas non plus sur une seule ligne à 393px de large. */
    .check-row{flex-wrap:wrap;row-gap:8px;}
    .check-row .row-end{flex-basis:100%;justify-content:flex-end;margin-top:0;}
    .stat-grid{grid-template-columns:repeat(2,1fr);gap:10px;}
    .stat-tile{padding:14px;}
    .modal{padding:20px 18px 20px;max-width:none;}
    .modal-foot{flex-direction:column-reverse;}
    .modal-foot .btn{width:100%;justify-content:center;}
    .field-row-3{grid-template-columns:1fr;}
    .radio-row{flex-direction:column;}
    .radio-card{min-width:0;}
    table{font-size:12.5px;}
  }

/* ---------- impression de facture ---------- */
/* #print-area est rempli juste avant l'impression (voir printInvoice() dans
   app.js) avec le contenu de la facture, et cachée le reste du temps :
   la règle @media print ci-dessous la rend visible à l'impression, en
   masquant tout le reste de la page (app, modales, toasts…) pour n'imprimer
   QUE la facture, jamais l'interface de l'appli autour. La classe
   .print-area-visible fait la même chose mais à l'écran (hors impression) :
   utilisée par downloadInvoicePdf() le temps de la capture par html2canvas,
   qui ne "voit" que ce qui est réellement affiché à l'écran — contrairement
   à @media print, qui ne s'applique qu'à l'impression proprement dite. */
#print-area{display:none;}
/* Affichée en plein écran (par-dessus toute l'appli) plutôt que positionnée
   hors-écran (ex. left:-10000px) : html2canvas (utilisé par
   downloadInvoicePdf) clone et rend l'élément tel que le NAVIGATEUR l'a
   réellement peint, et un élément positionné très loin hors du viewport
   n'est souvent peint que partiellement (voire pas du tout) par le
   navigateur lui-même — ce qui produisait une facture PDF incomplète
   (retour de Jonathan, 1er correctif). L'affichage est bref (le temps de la
   capture, quelques centaines de ms) et masqué dès la fin de la génération.
   pointer-events:none évite toute interaction accidentelle pendant ce
   court instant.
   overflow:visible (et NON auto/hidden) est essentiel : #print-area occupe
   ici toute la hauteur de l'écran (inset:0), or une facture avec beaucoup de
   contenu est plus haute qu'un écran — avec overflow:auto, tout ce qui
   dépasse cette hauteur est mis en scroll et n'est donc JAMAIS peint par le
   navigateur (uniquement les en-têtes tenaient à l'écran), ce qu'html2canvas
   capturait ensuite tel quel : une facture tronquée après Prestataire/Client
   (2e correctif, retour de Jonathan avec captures à l'appui). En laissant
   le débordement visible, la facture s'affiche entièrement, même si cela
   dépasse le bas de l'écran le temps très bref de la capture. */
#print-area.print-area-visible{
  display:block;position:fixed;inset:0;z-index:9999;overflow:visible;
  padding:24px 12px;pointer-events:none;
  background:#fff;
}
/* Aperçu plein écran d'une facture (previewInvoiceFullPage(), app.js) —
   demande explicite de Jonathan ("un bouton pour afficher une facture en
   pleine page"), distinct de .print-area-visible ci-dessus : celle-ci n'est
   affichée que quelques centaines de ms, sans interaction possible
   (pointer-events:none), le temps d'une capture html2canvas. Ici au
   contraire l'utilisateur doit pouvoir consulter la facture confortablement
   (fond assombri, carte centrée avec ombre, défilement vertical si la
   facture dépasse la hauteur de l'écran) puis la refermer (bouton Fermer,
   clic sur le fond, ou touche Échap — gérés en JS). */
#print-area.print-area-preview{
  display:block;position:fixed;inset:0;z-index:9999;overflow:auto;
  padding:72px 16px 32px;pointer-events:auto;
  background:rgba(42,40,32,0.6);
}
#print-area.print-area-preview .print-invoice{
  background:#fff;border-radius:12px;box-shadow:0 24px 60px rgba(0,0,0,0.4);
}
#print-area .pi-preview-close{
  position:fixed;top:16px;right:16px;z-index:10000;
}
@media print{
  body > *:not(#print-area){display:none !important;}
  #print-area{display:block !important;position:static !important;}
  /* margin:0 sur @page supprime l'en-tête/pied de page que le navigateur
     ajoute par défaut à l'impression (titre/URL en haut, URL/date/numéro de
     page en bas) — Chrome n'affiche ces éléments que s'il reste de la place
     dans la marge de page ; à 0, il n'y en a plus, donc plus d'en-tête/pied
     de page du navigateur. La marge visuelle autour de la facture est reprise
     en padding sur .print-invoice ci-dessous, donc la mise en page ne change
     pas — seuls le titre/URL/date/n° de page du navigateur disparaissent. */
  @page{size:auto;margin:0;}
}
/* Maquette calquée sur le devis transmis par Jonathan (DEV-2026-001) : logo +
   titre en tête, filet doré, bandeaux Prestataire/Client, bandeau "Objet",
   tableau à en-tête vert foncé, encadré de totaux avec ligne "NET À PAYER"
   surlignée en doré, bandeau Conditions, mentions légales en pied de page.
   Ces styles s'appliquent maintenant TOUJOURS (plus seulement à
   l'impression via @media print) : le téléchargement PDF (downloadInvoicePdf,
   app.js) capture #print-area affiché à l'écran via .print-area-visible, et a
   donc besoin de la même mise en forme en dehors de tout contexte
   d'impression. print-color-adjust:exact force le rendu des fonds de couleur
   (Chrome ne les imprime pas par défaut sans cette règle). */
/* Espacements verticaux volontairement resserrés (padding de page, marges
   entre blocs, hauteurs de ligne) par rapport à la maquette d'origine
   calquée sur le devis : sur une facture un peu chargée (informations
   complémentaires multiligne, conditions détaillées, RIB, note), la version
   précédente débordait sur une 2e page à l'impression (retour explicite de
   Jonathan) — resserré ici avec une marge de sécurité confortable plutôt
   qu'un ajustement au plus juste. */
.print-invoice{
  max-width:760px;margin:0 auto;padding:10mm 8mm;
  font-family:"Work Sans", ui-sans-serif, system-ui, sans-serif;color:#2A2820;
  -webkit-print-color-adjust:exact;print-color-adjust:exact;color-adjust:exact;
  background:#fff;
}
.print-invoice .pi-head{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;}
.print-invoice .pi-logo{
  width:130px;height:110px;overflow:hidden;border-radius:10px;border:1px solid #D8C68A;
  background:#FBF6EC;flex:none;
}
.print-invoice .pi-logo img{width:100%;height:auto;display:block;object-fit:cover;object-position:top;}
.print-invoice .pi-title-block{text-align:right;padding-top:4px;}
.print-invoice .pi-doc-title{
  font-family:"Fraunces",Georgia,serif;font-size:23px;font-weight:700;
  color:var(--accent-strong);letter-spacing:.02em;
}
.print-invoice .pi-doc-number{font-size:13px;font-weight:700;color:#B4842A;margin-top:4px;}
.print-invoice .pi-meta{font-size:11.5px;color:#4A4636;margin-top:4px;}
.print-invoice .pi-rule{height:2px;background:#C79A3E;margin:10px 0 14px;}
.print-invoice .pi-cols{display:flex;gap:18px;margin-bottom:12px;}
.print-invoice .pi-col{flex:1;min-width:0;}
.print-invoice .pi-col-head{
  background:var(--accent-soft);color:var(--accent-strong);font-size:11px;font-weight:700;
  letter-spacing:.05em;text-transform:uppercase;padding:5px 12px;border-radius:3px;margin-bottom:6px;
}
.print-invoice .pi-col-body{font-size:12px;line-height:1.45;padding:0 2px;}
.print-invoice .pi-objet{
  background:#F1ECDF;font-size:12px;font-weight:600;color:#3A3626;
  padding:7px 14px;border-radius:3px;margin-bottom:12px;
}
.print-invoice table{width:100%;border-collapse:collapse;}
.print-invoice thead th{
  background:var(--accent-strong);color:#fff;font-size:10.5px;font-weight:700;
  text-transform:uppercase;letter-spacing:.04em;padding:7px 12px;text-align:left;
}
.print-invoice thead th.num{text-align:right;}
.print-invoice tbody td{padding:8px 12px;font-size:12.5px;border-bottom:1px solid #E4D9BF;vertical-align:top;}
.print-invoice tbody td.num{text-align:right;white-space:nowrap;}
.print-invoice .pi-sub{font-size:10.5px;font-style:italic;color:#8A8168;margin-top:2px;}
.print-invoice .pi-totals-wrap{margin-top:10px;text-align:right;}
.print-invoice .pi-totals{
  width:260px;margin-left:auto;border-radius:4px;overflow:hidden;
  border:1px solid #E4D9BF;text-align:left;
}
.print-invoice .pi-totals-row{display:flex;justify-content:space-between;padding:6px 14px;font-size:12px;background:#F1ECDF;}
.print-invoice .pi-totals-net{background:#C0912E;color:#fff;font-weight:700;font-size:13px;}
.print-invoice .pi-status{
  display:inline-block;margin-top:8px;padding:4px 12px;border-radius:4px;
  font-size:11.5px;font-weight:700;letter-spacing:.02em;
}
.print-invoice .pi-status-good{background:var(--good-soft);color:var(--good);}
.print-invoice .pi-status-danger{background:var(--danger-soft);color:var(--danger);}
.print-invoice .pi-cb-row{display:flex;gap:14px;margin-top:12px;align-items:flex-start;}
.print-invoice .pi-conditions, .print-invoice .pi-bank{
  flex:1;min-width:0;border-radius:4px;overflow:hidden;border:1px solid #E4D9BF;
}
.print-invoice .pi-conditions-head, .print-invoice .pi-bank-head{
  background:var(--accent-strong);color:#fff;font-size:10.5px;font-weight:700;
  text-transform:uppercase;letter-spacing:.05em;padding:5px 12px;
}
.print-invoice .pi-conditions-body, .print-invoice .pi-bank-body{
  background:#F1ECDF;padding:7px 12px;font-size:11px;line-height:1.35;color:#3A3626;
}
.print-invoice .pi-footer{margin-top:10px;font-size:8px;line-height:1.3;color:#8A8168;text-align:center;}
