:root {
  --fond: #ffffff;
  --texte: #1f2937;
  --discret: #6b7280;
  --accent: #0f766e;
  --bordure: #e5e7eb;
  --succes: #15803d;
  --alerte: #b45309;
  --danger: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #111827; --texte: #f3f4f6; --discret: #9ca3af; --bordure: #374151; }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fond);
  color: var(--texte);
}
.entete { background: var(--accent); padding: 12px 16px; }
.marque { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.15rem; }
.contenu { max-width: 40rem; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; }
a { color: var(--accent); }
button, .bouton {
  display: inline-block; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font: inherit; text-decoration: none; cursor: pointer;
}
input, select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; color: inherit;
  background: var(--fond); border: 1px solid var(--bordure); border-radius: 8px;
}
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.navigation { display: flex; align-items: center; gap: 12px; }
.navigation a, .navigation .lien { color: #fff; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--alerte); color: #fff; text-align: center; font-size: 0.85rem; }
.lien { background: none; border: 0; min-height: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
.secondaire { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.champ { margin-bottom: 14px; }
.champ label { display: block; font-weight: 600; margin-bottom: 4px; }
.champ-case { display: flex; gap: 8px; align-items: flex-start; }
.champ-case input { width: auto; min-height: 0; margin-top: 4px; }
.champ-case label { font-weight: 400; }
.aide { color: var(--discret); font-size: 0.9rem; }
.erreur, .erreur-champ { color: var(--danger); }
.alerte { padding: 10px 12px; border-left: 4px solid var(--alerte); background: rgba(180, 83, 9, 0.08); }
.liste { list-style: none; padding: 0; }
.liste li { padding: 10px 0; border-bottom: 1px solid var(--bordure); }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.details dt { color: var(--discret); }
.details dd { margin: 0; }
.justificatif { max-width: 100%; height: auto; border: 1px solid var(--bordure); border-radius: 8px; margin: 12px 0; }
form + form, .refus { margin-top: 12px; }
.en-ligne { display: inline; }
.statut-paye, .statut-confirme { color: var(--succes); }
.statut-en_retard, .statut-refuse { color: var(--danger); }
.statut-partiel, .statut-a_payer, .statut-declare { color: var(--alerte); }
.mois { display: flex; align-items: center; justify-content: space-between; }
.mois a { font-size: 1.8rem; text-decoration: none; padding: 0 12px; }
.totaux { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.totaux div { border: 1px solid var(--bordure); border-radius: 8px; padding: 8px 10px; }
.totaux span { display: block; color: var(--discret); font-size: 0.85rem; }
.periode { font-size: 0.95rem; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.annule { opacity: 0.6; }
.message { padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; }
.message-success { background: rgba(21, 128, 61, 0.1); color: var(--succes); }
.message-error { background: rgba(185, 28, 28, 0.1); color: var(--danger); }
.codes { columns: 2; font-size: 1.1rem; }
.codes code, .cle { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.05em; }
.cle { display: inline-block; padding: 6px 8px; border: 1px solid var(--bordure); border-radius: 6px; word-break: break-all; }
.navigation { flex-wrap: wrap; justify-content: flex-end; }
button.danger, .bouton.danger:not(.secondaire) { background: var(--danger); }
.secondaire.danger { color: var(--danger); border-color: var(--danger); }
