:root {
  color-scheme: light dark;
  --ink: #12181a;
  --muted: #5c6f72;
  --paper: #f5f7f6;
  --surface: #ffffff;
  --border: #dfe6e5;
  --accent: #053f4d;
  --accent-dark: #032a33;
  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --ok: #0f6b45;
  --ok-bg: #e6f4ee;
  --pending: #8a6d1f;
  --pending-bg: #f5f0e6;
  --done: #4b5a5c;
  --done-bg: #eef1f1;

  /* Statuts de commande : trois teintes franchement distinctes (orange /
     vert / ardoise) plutôt que trois variations autour du vert-canard de la
     charte, pour repérer une ligne d'un coup d'œil dans une longue liste.
     Texte foncé sur fond très clair, contraste largement au-delà de 4.5:1. */
  --status-pending: #96430a;
  --status-pending-bg: #fdeddd;
  --status-pending-mark: #e07b18;
  --status-paid: #0a6634;
  --status-paid-bg: #dcf4e5;
  --status-paid-mark: #15a04a;
  --status-done: #44556b;
  --status-done-bg: #e7edf4;
  --status-done-mark: #8296ab;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 3rem 1rem 4rem;
}

/* Les écrans admin portent des tableaux larges (7 colonnes pour les commandes,
   9 pour le stock) : 960px ne suffisaient pas et la colonne d'actions sortait
   du cadre. C'est un outil de bureau, on lui laisse la place. */
.container.wide { max-width: 1240px; padding: 2rem 1.5rem 4rem; }

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 2rem; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; flex-shrink: 0;
}
/* Logo téléversé dans une barre de navigation : gabarit de la pastille qu'il
   remplace, contenu entier visible quel que soit son rapport d'aspect. */
.brand .mark-logo { background: none; object-fit: contain; border-radius: 8px; }

/* En-tête des pages publiques : le logo devient l'élément principal, centré et
   sur toute la largeur utile. Les logos fournis sont des bannières larges — les
   enfermer dans un carré de 34px les rendait illisibles. */
/* La bannière est seule dans l'en-tête : plus de texte à aligner à côté. */
.brand-banniere { display: block; }
/* Pleine largeur : la marque et la carte du formulaire sont toutes deux des
   enfants directs du conteneur, le logo s'aligne donc exactement sur elle. */
.brand-banniere .brand-image { width: 100%; height: auto; display: block; }

.brand .name { font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
/* Seconde ligne de la marque : le nom complet ne tient pas sur une ligne de
   mobile, la paroisse passe dessous en retrait typographique. */
.brand .name .sub { display: block; font-weight: 600; font-size: 0.76rem; color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(5, 63, 77, 0.04), 0 16px 32px rgba(5, 63, 77, 0.07);
}

/* Connexion : la page est la même pour les deux espaces, seule la couleur et
   le libellé les distinguent. Le libellé porte le sens, la couleur ne fait que
   le renforcer — un bénévole daltonien lit « Poste de retrait » comme un autre. */
.login { border-top: 4px solid var(--border); }
.login-staff { border-top-color: var(--status-paid-mark); }
.login-admin { border-top-color: var(--accent); }
.login-espace {
  display: inline-block; margin: 0 0 0.6rem; padding: 0.25rem 0.7rem;
  border-radius: 999px; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: #f6f8f7; color: var(--muted);
}
.login-staff .login-espace { background: var(--status-paid-bg); color: var(--status-paid); }
.login-admin .login-espace { background: color-mix(in oklch, var(--accent) 12%, white); color: var(--accent); }
.login-sous-titre { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }

/* Recours en cas de problème, au pied des pages publiques : c'est le seul
   endroit où quelqu'un de bloqué pense à chercher de l'aide. */
.contact {
  margin: 2.5rem 0 0; text-align: center;
  font-size: 0.85rem; color: var(--muted);
}

/* Étapes du parcours public : numérotées dans une pastille, pour qu'on voie
   d'un coup d'œil qu'il y en a trois et où l'on se trouve. */
.etapes { list-style: none; padding: 0; margin: 0 0 1.5rem; counter-reset: etape; }
.etapes li {
  counter-increment: etape;
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.4rem 0; font-size: 0.92rem; line-height: 1.45;
}
.etapes li::before {
  content: counter(etape);
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 0.1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 800;
}

/* Action secondaire dans une carte publique : présente sans concurrencer
   l'action principale. */
.card .btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.card .btn-secondary:hover { background: #f6f8f7; }

.card-footer { margin-top: 1.15rem; text-align: center; font-size: 0.9rem; font-weight: 600; }

h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.5rem; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.75rem; }

nav.admin-nav {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.85rem 1.25rem; margin-bottom: 2rem; font-size: 0.88rem;
}
nav.admin-nav .brand { margin-bottom: 0; }
/* Poste de retrait : liseré vert, comme sa page de connexion — le bénévole
   retrouve la même couleur d'un écran à l'autre. Le sous-titre nomme l'espace,
   la couleur ne fait que le confirmer. */
nav.staff-nav { border-color: var(--status-paid-mark); border-top: 4px solid var(--status-paid-mark); }
nav.staff-nav .brand .sub { color: var(--status-paid); }
nav.admin-nav .links { display: flex; gap: 1.15rem; flex-wrap: wrap; font-weight: 600; }
nav.admin-nav a { color: var(--muted); text-decoration: none; padding-bottom: 2px; }
nav.admin-nav a:hover { color: var(--ink); }
nav.admin-nav a.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
nav.admin-nav form { display: inline; }
nav.admin-nav button.link {
  background: none; border: none; padding: 0; color: var(--muted); font: inherit; font-weight: 600;
  cursor: pointer;
}
nav.admin-nav button.link:hover { color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; }
.stat-card .n { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-card .label { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin-top: 0.4rem; }

.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.25rem; }
.filters > div { display: flex; flex-direction: column; gap: 0.35rem; }
.filters label { font-size: 0.76rem; }

fieldset { border: none; padding: 0; margin: 0; }
legend {
  padding: 0; margin-bottom: 0.6rem; font-size: 0.78rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}

form { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
form > div { display: flex; flex-direction: column; gap: 0.4rem; }

label { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }

input[type="text"], input[type="email"], input[type="password"], input[type="file"], select {
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
}
textarea {
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #9aa8a8; }
input:focus, select:focus { outline: none; border-color: var(--accent); }

button, .btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

button.link { text-decoration: underline; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

.alert { padding: 0.9rem 1.1rem; border-radius: 12px; margin: 1rem 0; font-size: 0.92rem; line-height: 1.5; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid color-mix(in oklch, var(--danger) 30%, white); }
.alert-success { background: color-mix(in oklch, var(--accent) 8%, white); color: var(--ink); border: 1px solid color-mix(in oklch, var(--accent) 30%, white); }

.tier-option {
  display: flex; align-items: center; gap: 14px;
  padding: 1rem 1.15rem; border-radius: 12px; margin-bottom: 0.6rem;
  border: 2px solid var(--border); background: var(--surface); cursor: pointer;
}
.tier-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.tier-option .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.tier-option .label { flex: 1; font-weight: 600; font-size: 0.95rem; }
.tier-option .price { font-weight: 800; }
.tier-option:has(input:checked) { border-color: var(--accent); background: color-mix(in oklch, var(--accent) 8%, white); }
.tier-option:has(input:checked) .dot { border-color: var(--accent); background: var(--accent); }

/* Choix des membres d'un foyer à régler (/commande/tarif) */
fieldset.member { border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 1rem 1rem; margin: 0 0 1rem; }
fieldset.member legend { padding: 0 0.4rem; font-size: 0.9rem; }
.member-check { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; cursor: pointer; }
.member-check input { width: 18px; height: 18px; flex-shrink: 0; }
.member-tiers { margin-top: 0.75rem; }
/* Membre décoché : ses tarifs restent lisibles mais visiblement inactifs. */
fieldset.member-off .member-tiers { opacity: 0.4; pointer-events: none; }
.total-line { font-size: 1.05rem; text-align: right; }

/* Foyer sur la page résultat et dans la popup de retrait du staff */
.household-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.household-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.household-list li:last-child { border-bottom: none; }
.household-pick { border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem 0.9rem 0.8rem; margin: 1rem 0; text-align: left; }
.household-pick legend { padding: 0 0.4rem; font-size: 0.8rem; color: var(--muted); }
.household-pick label { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; font-size: 0.9rem; cursor: pointer; }
.household-pick input { width: 18px; height: 18px; flex-shrink: 0; }

.hint { font-size: 0.85rem; color: var(--muted); }

.logo-reglage { display: flex; align-items: flex-start; gap: 1.25rem; flex-wrap: wrap; margin: 1rem 0; }
.logo-reglage .mark {
  width: 64px; height: 64px; border-radius: 14px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.3rem; flex-shrink: 0;
}
.logo-reglage .logo-apercu {
  width: 64px; height: 64px; border-radius: 14px; object-fit: contain;
  border: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.logo-reglage .banniere-apercu {
  width: 200px; height: auto; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.logo-reglage .apercu-vide {
  width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); color: var(--muted); font-size: 0.75rem;
}
.logo-reglage > div { flex: 1 1 260px; }
.logo-reglage .btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }

/* Notification de réussite, en haut à droite. Position fixe : elle doit être
   vue quel que soit l'endroit de la page où on se trouve après l'action. */
.toast {
  position: fixed; top: 1rem; right: 1rem; z-index: 100;
  display: flex; align-items: center; gap: 0.6rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem; border-radius: 12px;
  font-size: 0.9rem; font-weight: 600; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(13, 43, 51, 0.18);
  animation: toast-in 0.22s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.toast-hidden { opacity: 0; transform: translateY(-8px); }
.toast-success { background: var(--status-paid-bg); color: var(--status-paid); border: 1px solid var(--status-paid-mark); }
.toast-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.toast-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%;
  background: currentColor; color: var(--surface); font-size: 0.7rem; font-weight: 800;
}
.toast-close {
  background: none; border: none; padding: 0 0 0 0.3rem; margin-left: auto;
  color: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0.6;
}
.toast-close:hover { background: none; opacity: 1; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* Une notification qui glisse peut gêner ; on la pose sans animation. */
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 1.25rem;
  margin: 1rem 0 2rem; font-size: 0.9rem; font-weight: 600;
}
.pagination .disabled { color: var(--border); }
.pagination .pagination-etat { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Jauges de stock (/admin/stock).
   Rampe séquentielle d'une seule teinte, du plus avancé au plus incertain :
   retiré → payé → en attente → libre. Clarté strictement croissante (OKLab
   0,341 / 0,555 / 0,787 / 0,944), séparation CVD ΔE 21,3 entre pas adjacents.
   Les segments les plus clairs passent sous 3:1 : chaque quantité est donc
   aussi écrite en toutes lettres dans les colonnes voisines. */
:root {
  --jauge-retirees: #053f4d;
  --jauge-payees: #2b7f92;
  --jauge-attente: #8fc4cf;
  --jauge-libre: #e3eff1;
}

.meter {
  position: relative; display: flex; gap: 2px;
  height: 22px; min-width: 120px; border-radius: 5px;
  background: var(--jauge-libre); overflow: hidden;
}
.meter .seg { display: block; height: 100%; }
.seg-retirees { background: var(--jauge-retirees); }
.seg-payees { background: var(--jauge-payees); }
.seg-attente { background: var(--jauge-attente); }
/* Repère de la limite de stock : ce qui le dépasse à droite est en trop. */
.meter-limite {
  position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px;
  background: var(--ink); border-radius: 1px;
}

.legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; margin: 0.75rem 0; font-size: 0.8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.swatch-retirees { background: var(--jauge-retirees); }
.swatch-payees { background: var(--jauge-payees); }
.swatch-attente { background: var(--jauge-attente); }
.swatch-libre { background: var(--jauge-libre); border: 1px solid var(--border); }
.swatch-limite { background: var(--ink); width: 2px !important; border-radius: 1px; }

.col-jauge { width: 34%; min-width: 130px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ecart-negatif { color: var(--danger); font-weight: 800; }

/* Pastilles d'état : icône + libellé, la couleur ne porte jamais seule le sens. */
.pill.sev-ok { background: var(--status-paid-bg); color: var(--status-paid); border-color: var(--status-paid-mark); }
.pill.sev-juste { background: var(--status-done-bg); color: var(--status-done); border-color: var(--status-done-mark); }
.pill.sev-alerte { background: var(--status-pending-bg); color: var(--status-pending); border-color: var(--status-pending-mark); }
.pill.sev-critique { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.pill.sev-inconnu { background: #f6f8f7; color: var(--muted); border-color: var(--border); }
.pill.sev::before { display: none; }

.stock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.75rem; }
.stock-grid > div { display: flex; flex-direction: column; gap: 0.3rem; }
.stock-grid input { padding: 0.5rem 0.6rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Ajout manuel d'une personne : les champs tiennent sur une ligne tant qu'il y
   a la place, et repassent en colonne sur mobile. */
.manual-add { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.manual-add > div { flex: 1 1 150px; }
.manual-add .manual-add-submit { flex: 0 0 auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
/* overflow-x plutôt que hidden : un tableau plus large que l'écran défile
   dans sa carte au lieu d'être rogné (les actions disparaissaient à droite). */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; margin: 1rem 0; }
.table-card table { margin: 0; }
th {
  text-align: left; padding: 0.65rem 1rem; font-weight: 700; color: var(--muted);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; background: #f6f8f7;
}
td { text-align: left; padding: 0.75rem 1rem; border-top: 1px solid var(--border); }

/* La pastille de couleur en tête double l'information portée par la teinte du
   fond : le statut reste distinguable en niveaux de gris comme en cas de
   daltonisme, où orange et vert se rapprochent. */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.7rem 0.25rem 0.6rem; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; white-space: nowrap;
  border: 1px solid currentColor;
}
.pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.pill-en_attente_paiement { background: var(--status-pending-bg); color: var(--status-pending); border-color: var(--status-pending-mark); }
.pill-payee { background: var(--status-paid-bg); color: var(--status-paid); border-color: var(--status-paid-mark); }
.pill-retiree { background: var(--status-done-bg); color: var(--status-done); border-color: var(--status-done-mark); }

/* Compteurs du tableau de bord : mêmes teintes que les pastilles, pour que la
   vue d'ensemble et la liste des commandes se lisent avec le même code. */
.stat-card.stat-en_attente_paiement { background: var(--status-pending-bg); border-color: var(--status-pending-mark); }
.stat-card.stat-en_attente_paiement .n { color: var(--status-pending); }
.stat-card.stat-en_attente_paiement .label { color: var(--status-pending); }
.stat-card.stat-payee { background: var(--status-paid-bg); border-color: var(--status-paid-mark); }
.stat-card.stat-payee .n,
.stat-card.stat-payee .label { color: var(--status-paid); }
.stat-card.stat-retiree { background: var(--status-done-bg); border-color: var(--status-done-mark); }
.stat-card.stat-retiree .n,
.stat-card.stat-retiree .label { color: var(--status-done); }

/* Le sprite ne sert qu'à héberger les <symbol> référencés par <use>. */
.icon-sprite { display: none; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; }

/* Dans le tableau, les actions tiennent sur une ligne et se réduisent à leurs
   icônes (le libellé reste dans le DOM pour les lecteurs d'écran, et
   réapparaît dans la popup mobile où il y a la place). */
.row-actions { display: flex; flex-direction: row; align-items: center; gap: 0.35rem; }
.row-actions form { flex-direction: row; align-items: center; gap: 0.35rem; margin: 0; }
.row-actions select { padding: 0.4rem 0.5rem; font-size: 0.8rem; width: auto; }
.row-actions button { padding: 0.45rem; font-size: 0.78rem; }
.row-actions .btn-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.row-actions .btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.row-actions .btn-secondary:hover { background: #f6f8f7; }

/* La colonne d'actions ne se comprime pas (un bouton coupé est inutilisable) :
   `width: 1%` + nowrap lui donne sa largeur naturelle, le reste va aux autres.
   Et l'email, seule colonne vraiment longue, a le droit de passer à la ligne
   plutôt que d'imposer sa largeur à tout le tableau. */
.col-actions { width: 1%; white-space: nowrap; }
.table-card td.col-secondary { overflow-wrap: anywhere; }

dialog#detail-modal,
dialog#order-actions-modal,
dialog#tarif-etudiant-modal {
  border: none;
  border-radius: 18px;
  padding: 1.75rem;
  width: min(90vw, 380px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background: var(--surface);
  color: var(--ink);
}
dialog#detail-modal::backdrop,
dialog#order-actions-modal::backdrop,
dialog#tarif-etudiant-modal::backdrop { background: rgba(13, 43, 51, 0.55); }
dialog#tarif-etudiant-modal h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }
dialog#tarif-etudiant-modal #tarif-etudiant-who { font-weight: 700; color: var(--accent); }
dialog#tarif-etudiant-modal p { margin: 0 0 0.75rem; font-size: 0.9rem; }
dialog#tarif-etudiant-modal .modal-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.25rem; }
dialog#tarif-etudiant-modal .modal-actions button { width: 100%; }
dialog#tarif-etudiant-modal .btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
dialog#tarif-etudiant-modal .btn-secondary:hover { background: #f6f8f7; }
dialog#detail-modal #close-modal,
dialog#order-actions-modal #order-actions-close { margin-top: 1rem; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
dialog#detail-modal #close-modal:hover,
dialog#order-actions-modal #order-actions-close:hover { background: #f6f8f7; }
dialog#order-actions-modal .modal-subtitle { margin: 0 0 1rem; color: var(--muted); font-size: 0.85rem; }
/* Dans la popup, place suffisante : les actions repassent en colonne et les
   boutons retrouvent leur libellé à côté de l'icône. */
dialog#order-actions-modal #order-actions-body .row-actions { flex-direction: column; align-items: stretch; gap: 0.75rem; }
dialog#order-actions-modal #order-actions-body form { flex-direction: column; align-items: stretch; gap: 0.5rem; width: 100%; }
dialog#order-actions-modal #order-actions-body select { width: 100%; }
dialog#order-actions-modal #order-actions-body button { padding: 0.6rem 0.75rem; }
dialog#order-actions-modal #order-actions-body .btn-label {
  position: static; width: auto; height: auto; overflow: visible; clip-path: none;
}

/* Bouton "⋯" en bout de nom : dès que la fenêtre ne peut plus tenir les sept
   colonnes, on masque les secondaires et les actions, et tout passe par la
   popup — plutôt que de laisser un bouton coupé au bord du cadre. Le seuil
   (820px) est la largeur en dessous de laquelle le tableau complet déborde. */
.row-menu { display: none; }

@media (max-width: 820px) {
  .table-card .col-secondary,
  .table-card .col-actions { display: none; }
  .table-card td:first-child { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
  .row-menu {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex-shrink: 0; padding: 0; margin: -0.25rem 0;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--muted);
    font-size: 1.1rem; line-height: 1; cursor: pointer;
  }
  .row-menu:active { background: #f6f8f7; }
}

/* Dimensionné pour tenir aussi bien "XXL" que "12 ans" sans déborder de la
   popup : c'est l'information que le bénévole lit de loin au moment de
   prendre le t-shirt dans le carton. */
dialog#detail-modal .size-badge {
  font-size: clamp(2.6rem, 14vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  color: var(--accent);
  margin: 0.5rem 0 1rem;
}
