/*
 * Pointage — Historique mobile
 * Source de vérité CSS pour les éléments propres au mode Historique mobile.
 *
 * Périmètre actuel :
 * - bandeau/en-tête : surcharges propres à l'Historique
 * - résumé financier du cours
 * - Participants
 * - Absents décomptés / payants
 * - Absents excusés : identité + carte, sans aucun montant
 *
 * Les styles génériques du bandeau (calendrier, titre, compteurs et actions
 * partagés avec Pointage/Réservation) restent dans leur composant transversal.
 *
 * Règles :
 * - aucune règle versionnée empilée ;
 * - aucune priorité forcée dans cette feuille ;
 * - exactement deux séparateurs de colonnes sur Participants / Absents payants : Nom|CA et CA|Bénéfice ;
 * - aucun séparateur autour du chevron ;
 * - Absents excusés : aucun CA, aucun bénéfice, aucun statut de paiement ;
 * - le mode bureau n'est pas concerné.
 */

@media (max-width:1050px){
  /* Bandeau Historique — uniquement les différences propres à course-closed. */
  .app.course-closed .course-heading-row{
    border-radius:0;
  }
/* Résumé financier du cours — source canonique Historique mobile. */
  .app.course-closed .course-summary-row{
    align-items:stretch;
    gap:12px;
    padding:10px 12px 8px;
    border-radius:0;
  }

  .app.course-closed .course-summary-row .stats.stats-closed{
    display:none;
  }

  .app.course-closed .course-summary-row #courseFinance{
    flex:1 1 100%;
    width:100%;
    min-width:0;
    margin:0;
    padding:10px 4px;
    align-self:stretch;
    box-sizing:border-box;
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
    font-size:16px;
    line-height:1.35;
    border:0;
    border-radius:0;
    background:transparent;
  }

  .app.course-closed .course.profit-positive #courseFinance,
  .app.course-closed .course.profit-nonpositive #courseFinance{
    background:transparent;
  }

  .app.course-closed #courseFinance .finance-row{
    font-size:16px;
    line-height:1.25;
    padding:2px 0;
  }

  .app.course-closed #courseFinance .finance-profit{
    font-size:17px;
  }

  .app.course-closed #courseFinance .finance-separator{
    margin:7px 0 5px;
  }

  .app.course-closed #courseFinance .finance-separator,
  .app.course-closed #courseFinance .finance-unpaid-separator{
    border-top-style:solid;
    opacity:.65;
  }

  .app.course-closed #courseFinance #financeLocalCost,
  .app.course-closed #courseFinance #financeCharges,
  .app.course-closed #courseFinance #financeTax{
    color:var(--ink);
  }

  .app.course-closed #courseFinance #financeUnpaidRevenue{
    color:#a93f3f;
  }

  .app.course-closed .profit-positive #financeProfit{
    color:#3f6f45;
  }

  .app.course-closed .profit-nonpositive #financeProfit{
    color:#a93f3f;
  }

  .app.course-closed #sectionPresent{
    margin-top:0;
  }

  .app.course-closed #sectionPresent > .section-title{
    display:none;
    margin:0;
    padding:0;
    min-height:0;
    height:0;
    border:0;
  }

  .app.course-closed #sectionPaid > .section-title h2,
  .app.course-closed #sectionExcused > .section-title h2{
    font-size:15px;
    font-weight:800;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-list-head,
  .app.course-closed :is(#listPresent,#listPaid) .history-participant-main{
    display:grid;
    grid-template-columns:minmax(0,1fr) 72px 72px 26px;
    column-gap:0;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-list-head{
    padding:0;
    align-items:stretch;
    font-size:13px;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-list-head span{
    box-sizing:border-box;
    display:flex;
    align-items:center;
    min-width:0;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-list-head span:first-child{
    padding:8px 14px;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-list-head span:nth-child(2),
  .app.course-closed :is(#listPresent,#listPaid) .history-list-head span:nth-child(3){
    justify-content:center;
    padding:8px 4px;
    border-left:1px solid var(--line);
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-participant-main{
    grid-template-rows:auto auto;
    align-items:stretch;
    gap:0;
    padding:0;
    min-height:0;
    position:relative;
    background-image:none;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-table::before,
  .app.course-closed :is(#listPresent,#listPaid) .history-table::after,
  .app.course-closed :is(#listPresent,#listPaid) .history-participant-main::before,
  .app.course-closed :is(#listPresent,#listPaid) .history-participant-main::after,
  .app.course-closed :is(#listPresent,#listPaid) .history-list-head::before,
  .app.course-closed :is(#listPresent,#listPaid) .history-list-head::after{
    content:none;
    display:none;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-name{
    grid-column:1;
    grid-row:1;
    min-width:0;
    padding:11px 14px 2px;
    overflow:visible;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-name strong{
    display:block;
    width:auto;
    max-width:none;
    font-size:15px;
    font-weight:700;
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    overflow-wrap:break-word;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-card-summary{
    grid-column:1;
    grid-row:2;
    min-width:0;
    padding:0 14px 11px;
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:6px;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-payment-badge-inline{
    display:inline-flex;
    align-items:center;
    flex:0 0 auto;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-revenue-value,
  .app.course-closed :is(#listPresent,#listPaid) .history-profit-value{
    grid-row:1 / 3;
    box-sizing:border-box;
    width:100%;
    align-self:stretch;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    padding:0 6px 0 0;
    border-left:1px solid var(--line);
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-revenue-value{
    grid-column:2;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-profit-value{
    grid-column:3;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-revenue-value strong,
  .app.course-closed :is(#listPresent,#listPaid) .history-profit-value strong{
    font-size:13.5px;
    font-weight:800;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-chevron{
    grid-column:4;
    grid-row:1 / 3;
    align-self:stretch;
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
  }

  /* Participants + Absents payants — autonomie complète des tableaux financiers mobiles. */
  .app.course-closed :is(#listPresent,#listPaid){
    display:block;
    width:100vw;
    max-width:none;
    margin-left:calc(50% - 50vw);
    margin-right:calc(50% - 50vw);
    box-sizing:border-box;
    background:var(--card);
    border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-list-head{
    background:#eee4d8;
    color:var(--muted);
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.035em;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-participant-row{
    margin:0;
    border:0;
    border-top:1px solid var(--line);
    border-radius:0;
    box-shadow:none;
    background:var(--card);
    cursor:pointer;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-participant-row:first-of-type{
    border-top:0;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-profit-value strong,
  .app.course-closed :is(#listPresent,#listPaid) .history-summary-profit,
  .app.course-closed :is(#listPresent,#listPaid) .history-detail-profit strong{
    color:#3f6f45;
  }

  .app.course-closed :is(#listPresent,#listPaid) .profit-nonpositive .history-profit-value strong,
  .app.course-closed :is(#listPresent,#listPaid) .profit-nonpositive .history-summary-profit,
  .app.course-closed :is(#listPresent,#listPaid) .profit-nonpositive .history-detail-profit strong{
    color:#9e4545;
  }

  .app.course-closed :is(#listPresent,#listPaid) .participant-finance-collapsible.expanded .history-chevron{
    transform:rotate(180deg);
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-participant-details{
    display:none;
    grid-template-columns:1fr;
    gap:5px;
    padding:9px 12px 11px;
    border-top:1px solid var(--line);
    background:#faf7f2;
  }

  .app.course-closed :is(#listPresent,#listPaid) .participant-finance-collapsible.expanded .history-participant-details{
    display:grid;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-participant-details > div:not(.history-finance-separator){
    display:flex;
    justify-content:space-between;
    gap:10px;
    font-size:13px;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-finance-separator{
    height:0;
    border-top:1px solid var(--line);
    margin:4px 0 3px;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-detail-ca,
  .app.course-closed :is(#listPresent,#listPaid) .history-detail-profit{
    font-weight:800;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-detail-unpaid{
    background:transparent;
    margin-left:0;
    margin-right:0;
    padding-left:0;
    padding-right:0;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-detail-unpaid > span{
    color:inherit;
    animation:none;
  }

  .app.course-closed :is(#listPresent,#listPaid) .history-detail-unpaid > strong{
    color:#a93f3f;
    animation:none;
  }

  /* Absents excusés — composant métier distinct, sans aucune donnée financière. */
  .app.course-closed #listExcused .history-excused-row{
    display:flex;
    flex-direction:column;
    gap:3px;
    padding:12px 28px;
    background:var(--card);
    border-bottom:1px solid var(--line);
  }

  .app.course-closed #listExcused .history-excused-row strong{
    font-size:16px;
    color:var(--ink);
  }

  .app.course-closed #listExcused .history-excused-row span{
    font-size:14px;
    color:var(--muted);
  }
}

@media (max-width:700px){


  .app.course-closed .course-summary-row{
    gap:7px;
    padding:8px 7px 6px;
  }

  .app.course-closed .course-summary-row #courseFinance{
    padding:10px 4px;
    font-size:14px;
  }

  .app.course-closed #courseFinance .finance-row{
    font-size:13.5px;
  }

  .app.course-closed #courseFinance .finance-profit{
    font-size:14.5px;
  }

  .app.course-closed #listExcused .history-excused-row{
    padding:10px 20px;
  }
}

@media (max-width:430px){
}

/*
 * Historique mobile — contexte résiduel extrait de index.html lors de la purge finale.
 * Ces règles ne doivent plus être redéfinies dans index.html.
 */
@media (max-width:1050px){
.app.course-closed .stats.stats-closed{
  flex:0 0 360px;
  width:360px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:0;
  align-self:stretch;
}
.app.course-closed .stats.stats-closed .stat.present{
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.55);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:10px;
}
.app.course-closed .stat-hero-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.app.course-closed .stats.stats-closed .stat.present strong{
  font-size:46px;
  line-height:.95;
}
.app.course-closed .stat-main-label{
  margin-top:4px;
  font-size:13px;
  font-weight:700;
}
.app.course-closed .stat-icon{
  display:block;
}
.app.course-closed .stats.stats-closed .absence-square{
  display:flex;
  flex-direction:column;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:rgba(255,255,255,.55);
}
.app.course-closed .stats.stats-closed .absence-line{
  flex:1 1 50%;
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 9px;
  border:0;
  text-align:left;
}
.app.course-closed .stats.stats-closed .absence-line + .absence-line{
  border-top:1px solid var(--line);
}
.app.course-closed .absence-icon{
  display:block;
  flex:0 0 31px;
  width:31px;
  height:31px;
}
.app.course-closed .absence-line.excused .absence-icon{color:#c47b18}
.app.course-closed .absence-line.excused .mark{stroke:#c47b18;stroke-width:3.2}
.app.course-closed .absence-line.paid .absence-icon{color:#b83f3f}
.app.course-closed .absence-line.paid .mark{stroke:#b83f3f;stroke-width:3.2}
.app.course-closed .absence-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.app.course-closed .absence-copy strong{
  font-size:21px;
  line-height:1;
}
.app.course-closed .absence-copy > span{
  margin-top:2px;
  font-size:11px;
  line-height:1.1;
}
@media(max-width:700px){.app.course-closed .stats.stats-closed{
    flex:1 1 42%;
    width:auto;
    min-width:150px;
    gap:6px;
  }
.app.course-closed .stats.stats-closed .stat.present{
    padding:6px 4px;
  }
.app.course-closed .stats.stats-closed .stat.present strong{
    font-size:34px;
  }
.app.course-closed .stat-icon{
    width:32px;
    height:32px;
  }
.app.course-closed .stat-main-label{
    font-size:10px;
  }
.app.course-closed .stats.stats-closed .absence-line{
    gap:4px;
    padding:5px 5px;
  }
.app.course-closed .absence-icon{
    flex-basis:24px;
    width:24px;
    height:24px;
  }
.app.course-closed .absence-copy strong{
    font-size:17px;
  }
.app.course-closed .absence-copy > span{
    font-size:8.5px;
  }}
.app.course-closed .stats.stats-closed{
  align-items:stretch;
}
.app.course-closed .stats.stats-closed .stat.present{
  height:100%;
  min-height:190px;
  box-sizing:border-box;
}
.app.course-closed .stats.stats-closed .absence-square{
  height:100%;
  min-height:190px;
  box-sizing:border-box;
}
.app.course-closed .stats.stats-closed .stat.present{
  justify-content:center;
  gap:12px;
}
.app.course-closed .stat-main-label{
  order:0;
  margin:0;
  font-size:15px;
  font-weight:800;
  text-transform:none;
}
.app.course-closed .stat-hero-line{
  order:1;
}
.app.course-closed .stats.stats-closed .stat.present strong{
  font-size:52px;
}
.app.course-closed .stat-icon{
  width:46px;
  height:46px;
}
.app.course-closed .stats.stats-closed .absence-square{
  display:grid;
  grid-template-rows:auto 1fr 1fr;
}
.app.course-closed .absence-title{
  display:block;
  text-align:center;
  padding:8px 6px 7px;
  font-size:15px;
  font-weight:800;
  border-bottom:1px solid var(--line);
}
.app.course-closed .stats.stats-closed .absence-line{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1px;
  padding:5px 7px 6px;
  text-align:center;
}
.app.course-closed .absence-value{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
}
.app.course-closed .absence-value strong{
  font-size:32px;
  line-height:1;
}
.app.course-closed .absence-icon{
  flex:0 0 31px;
  width:31px;
  height:31px;
}
.app.course-closed .absence-label{
  display:block;
  margin-top:0;
  font-size:12px;
  line-height:1.05;
  font-weight:700;
  color:#302d29;
}
.app.course-closed .stats.stats-closed .absence-line + .absence-line{
  border-top:1px solid var(--line);
}
@media(max-width:700px){.app.course-closed .stats.stats-closed .stat.present{
    min-height:150px;
  }
.app.course-closed .stats.stats-closed .absence-square{
    min-height:150px;
  }
.app.course-closed .stats.stats-closed .stat.present{
    gap:7px;
  }
.app.course-closed .stat-main-label{
    font-size:11px;
  }
.app.course-closed .absence-title{
    font-size:11px;
  }
.app.course-closed .stats.stats-closed .stat.present strong{
    font-size:38px;
  }
.app.course-closed .stat-icon{
    width:34px;
    height:34px;
  }
.app.course-closed .absence-title{
    padding:6px 4px 5px;
  }
.app.course-closed .absence-value strong{
    font-size:25px;
  }
.app.course-closed .absence-icon{
    flex-basis:25px;
    width:25px;
    height:25px;
  }
.app.course-closed .absence-label{
    font-size:9.5px;
  }}
.app.course-closed .stats.stats-closed .absence-square{grid-template-rows:1fr 1fr}
.app.course-closed .absence-title{display:none}
.app.course-closed .stat-main-label{order:2;margin:0;font-size:15px;line-height:1.1;font-weight:800}
.app.course-closed .stat-hero-line{order:1}
.app.course-closed .absence-label{font-size:15px;line-height:1.1;font-weight:800}
@media(max-width:700px){.app.course-closed .stat-main-label{font-size:11px}
.app.course-closed .absence-label{font-size:11px}}
.app.course-closed .stats.stats-closed .stat.present{
  display:none;
}
.app.course-closed .stats.stats-closed{
  grid-template-columns:1fr;
  flex-basis:180px;
  width:180px;
}
.app.course-closed .stats.stats-closed .absence-square{
  width:100%;
}
@media(max-width:700px){.app.course-closed .stats.stats-closed{
    flex-basis:130px;
    width:130px;
    min-width:130px;
  }}

}
