/* Feuille de style de la page d'administration.
   Elle n'est chargée que par public/admin.html. Les règles ci-dessous sont toutes portées
   par la classe .adm, posée sur le conteneur de la page par le script, donc rien ici ne
   peut atteindre les autres pages qui partagent la feuille principale. */

.adm {
  --adm-gap: 30px;
  --adm-panel-dim: rgba(12, 11, 10, .72);
}

/* Un élément masqué par le script doit disparaitre, meme quand une de nos regles
   lui donne un display explicite (pagination, tableau en mode fiche). */
.adm [hidden] { display: none !important; }

/* ---------- titres de section ---------- */
.adm .adm-head { margin: 0 0 14px; }
.adm .adm-h2 {
  margin: 0;
  font: 800 clamp(22px, 3vw, 30px)/1.1 var(--display);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.adm .adm-sub {
  margin: 8px 0 0;
  max-width: 82ch;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.5;
}
.adm .adm-note {
  margin: 0 0 18px;
  max-width: 82ch;
  color: var(--adm-panel-dim);
  font-size: 14px;
  line-height: 1.5;
}
.adm .adm-sec { margin: 0 0 var(--adm-gap); }

/* ---------- ce qu'il faut faire maintenant ---------- */
.adm .adm-now {
  margin: 0 0 var(--adm-gap);
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-left: 6px solid var(--red);
}
.adm .adm-now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adm .adm-now-list li {
  position: relative;
  padding-left: 20px;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.adm .adm-now-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background: var(--red);
}
.adm .adm-now-list li b { color: var(--bone); font-weight: 600; }
.adm .adm-now-list li.adm-now-none { padding-left: 0; }
.adm .adm-now-list li.adm-now-none::before { display: none; }

/* ---------- cartes chiffrées ---------- */
.adm .stats {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
  margin: 0 0 var(--adm-gap);
}
.adm .kpi { padding: 16px 18px; gap: 6px; }
.adm .kpi .k-v { font-size: 30px; overflow-wrap: anywhere; }
.adm .kpi .k-hint {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  line-height: 1.45;
}

/* ---------- tableau du registre ---------- */
.adm .adm-table { width: 100%; border-collapse: collapse; }
.adm .adm-table th {
  padding: 0 10px 10px 0;
  border-bottom: 2px solid var(--line);
  color: var(--dim);
  font: 600 12px/1.3 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: left;
  vertical-align: bottom;
}
.adm .adm-table td {
  padding: 14px 10px 14px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.adm .adm-table th:last-child, .adm .adm-table td:last-child { padding-right: 0; }
.adm .adm-table .adm-id {
  font: 800 18px/1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.adm .adm-table .c-name b {
  display: block;
  font: 800 18px/1.2 var(--display);
  text-transform: uppercase;
  letter-spacing: .01em;
}
.adm .adm-table .c-meta {
  display: block;
  margin-top: 4px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.adm .adm-table .adm-cls { font-size: 15px; font-weight: 600; }
.adm .adm-table .adm-price {
  font: 800 17px/1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Un libelle de statut se lit sur une seule ligne : les colonnes du tableau sont
   dimensionnees pour que la pastille ne se coupe pas en deux au milieu d'un mot. */
.adm .adm-table .c-status .pill { display: inline-block; margin: 0 6px 6px 0; white-space: nowrap; }
.adm .adm-table .adm-none { color: var(--dim); font-size: 13px; line-height: 1.4; }
.adm .adm-table .c-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }

/* Les actions secondaires restent en contour, la seule action pleine est de confirmer un paiement. */
.adm .btn, .adm .btn.alt, .adm .btn.sm, .adm .btn.alt.sm {
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.adm .btn { background: var(--red); color: #fff; border: 0; }
.adm .btn.alt { background: transparent; border: 2px solid var(--bone); color: var(--bone); }
.adm .btn.alt.danger { background: transparent; border-color: var(--red); color: var(--red); }
.adm .btn[disabled] { opacity: .45; }
.adm .btn:focus-visible, .adm .btn.alt:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* ---------- pagination ---------- */
.adm .adm-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 18px 0 0;
}
.adm .adm-page {
  margin: 0;
  color: var(--dim);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.adm .adm-pager .ghost { min-height: 44px; }
.adm .adm-pager .ghost[disabled] { opacity: .4; }

/* ---------- panneaux repliés ---------- */
.adm .adm-fold { margin: 0 0 14px; border: 2px solid var(--line); }
.adm .adm-fold > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  min-height: 56px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.adm .adm-fold > summary::-webkit-details-marker { display: none; }
.adm .adm-fold > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--red);
  font: 800 22px/1 var(--display);
}
.adm .adm-fold[open] > summary::after { content: "\2212"; }
.adm .adm-fold[open] > summary { border-bottom: 2px solid var(--line); }
.adm .adm-fold > summary:focus-visible { outline: 3px solid var(--red); outline-offset: -4px; }
.adm .adm-fold-t {
  font: 800 clamp(19px, 2.4vw, 24px)/1.15 var(--display);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.adm .adm-fold-m {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.adm .adm-fold-b { padding: 18px; }

/* Les listes de créneaux, de morceaux et de tables vivent maintenant sur le fond sombre :
   elles reprennent les couleurs de la page au lieu du noir sur fond clair du panneau. */
.adm .adm-fold-b .shift { border-top: 1px solid var(--line); }
.adm .adm-fold-b .shift:first-of-type { border-top: 0; }
.adm .adm-fold-b .shift-h span,
.adm .adm-fold-b .shift-row .sid,
.adm .adm-fold-b .shift-row .who .meta,
.adm .adm-fold-b .shift-places .lbl { color: var(--dim); opacity: 1; }
.adm .adm-fold-b .shift-row { border-top: 1px solid var(--line); }
.adm .adm-fold-b .shift-row.pend { background: rgba(255, 69, 38, .1); }
.adm .adm-fold-b .shift-places .step {
  width: 44px;
  height: 44px;
  border-color: var(--bone);
  color: var(--bone);
}
.adm .adm-fold-b .shift-places .step:active { background: rgba(241, 235, 224, .12); }
.adm .adm-fold-b .shift-places .num { min-width: 30px; font-size: 20px; }

/* ---------- réglages : deux colonnes, chaque champ avec son intitulé et sa phrase ---------- */
.adm .adm-cols { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: start; }
.adm .adm-col { display: grid; gap: 20px; align-content: start; }
.adm .adm-cols .panel { max-width: none; margin: 0; }
.adm .adm-hint {
  margin: 8px 0 0;
  color: var(--adm-panel-dim);
  font-size: 13px;
  line-height: 1.45;
  max-width: 60ch;
}
.adm .panel .msg { margin-top: 14px; }
.adm .panel .go { font-size: 20px; min-height: 58px; }

/* ---------- écrans étroits : une ligne du tableau devient une fiche ---------- */
@media (min-width: 900px) {
  .adm .adm-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .adm .adm-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .adm .adm-table, .adm .adm-table tbody, .adm .adm-table tr, .adm .adm-table td { display: block; width: 100%; }
  .adm .adm-table tr { margin: 0 0 12px; padding: 14px 16px; border: 2px solid var(--line); }
  .adm .adm-table td { padding: 6px 0; border: 0; }
  .adm .adm-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--dim);
    font: 600 11px/1.3 var(--body);
    letter-spacing: .14em;
    text-transform: uppercase;
  }
  .adm .adm-table td.c-acts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
  .adm .adm-table td.c-acts::before { flex: 0 0 100%; }
  .adm .adm-table td.c-acts .btn, .adm .adm-table td.c-acts .btn.alt { flex: 1 1 100%; }
  .adm .adm-fold > summary { padding: 14px 16px; }
  .adm .adm-fold-b { padding: 14px 16px; }
}
