/* =========================================================
   Les Voies du Nord — feuille de style principale
   Thème nordique / médiéval : pierre, parchemin, or, bleu glacier
   Mobile-first · contraste AA · focus visible · sans source externe
   hormis Google Fonts et images data: (CSP)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Crimson+Pro:wght@400;600;700&display=swap');

/* ---------- Variables ---------- */
:root {
  --c-bg: #1b1d21;          /* pierre sombre (fond) */
  --c-stone: #262a31;       /* pierre moyenne (cartes, modale) */
  --c-stone-2: #323742;     /* pierre claire (champs, en-têtes) */
  --c-line: #4a5160;        /* bordures */
  --c-line-soft: #4f5868;   /* bordures de cartes */
  --c-parch: #ece0c4;       /* parchemin (texte principal) */
  --c-parch-dim: #bfb49b;   /* parchemin atténué (texte secondaire) */
  --c-gold: #d9ab4f;        /* or */
  --c-gold-dark: #b98a32;   /* or sombre (bordures) */
  --c-ice: #9dd6f0;         /* bleu glacier */
  --c-ice-dark: #5fa8cc;    /* bleu glacier sombre (bordures) */
  --c-ok-bg: #1f3d28;
  --c-ok-tx: #d4f2d9;
  --c-ok-bd: #4f9a62;
  --c-err-bg: #4a1f1d;
  --c-err-tx: #ffd9d4;
  --c-err-bd: #c0605a;

  --font-title: 'Cinzel', Georgia, 'Times New Roman', serif;
  --font-text: 'Crimson Pro', Georgia, 'Times New Roman', serif;

  --radius: 6px;
  --shadow: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .55);
  --glow-gold: 0 0 22px rgba(217, 171, 79, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus: 3px solid var(--c-ice);

  /* Motifs en SVG / bruit, en data: URI (aucune requête externe) */
  --tex-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --tex-mountains: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 80' preserveAspectRatio='none'%3E%3Cpath fill='%23000' fill-opacity='.5' d='M0 80 L60 30 L95 52 L150 8 L205 48 L250 20 L300 56 L345 14 L400 50 V80 Z'/%3E%3Cpath fill='%23d9ab4f' fill-opacity='.16' d='M150 8 L172 32 L150 28 L132 36 Z M345 14 L364 34 L345 30 L330 38 Z'/%3E%3C/svg%3E");
  --tex-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23d9ab4f' stroke-width='2'/%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-text);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--c-parch);
  background-color: var(--c-bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(95, 168, 204, .22), transparent 70%),
    radial-gradient(ellipse 50% 35% at 12% 0%, rgba(120, 220, 170, .07), transparent 70%),
    radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .65) 100%),
    var(--tex-noise),
    linear-gradient(180deg, #23262c 0%, var(--c-bg) 45%, #121315 100%);
  background-attachment: fixed;
}

h1,
h2,
h3 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--c-gold);
  letter-spacing: .04em;
  line-height: 1.25;
  margin: 0 0 .6em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; color: var(--c-parch); }

p {
  margin: 0 0 1em;
}

a {
  color: var(--c-ice);
  text-underline-offset: .2em;
  transition: color .2s;
}

a:hover {
  color: var(--c-gold);
}

:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: .5rem;
  top: -100px;
  z-index: 2000;
  padding: .5rem 1rem;
  background: var(--c-gold);
  color: var(--c-bg);
  font-weight: 700;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: .5rem;
}

/* ---------- Structure : en-tête ---------- */
header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding: 1.1rem 1rem 1.2rem;
  background:
    var(--tex-mountains) center bottom / 100% 70px no-repeat,
    var(--tex-noise),
    linear-gradient(180deg, #3b404b 0%, #272b33 55%, #1a1c21 100%);
  border-bottom: 2px solid var(--c-gold-dark);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* Filet double sous l'en-tête */
header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-ice-dark), var(--c-gold), var(--c-ice-dark), transparent);
  opacity: .7;
  pointer-events: none;
}

header h1 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--c-gold);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .6));
}

/* Titre à dégradé doré (si background-clip: text est pris en charge) */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  header h1 {
    background: linear-gradient(180deg, #fff3c4 0%, #e9bd62 45%, #a8771f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem .9rem;
  color: var(--c-parch);
  text-decoration: none;
  font-family: var(--font-title);
  font-size: .85rem;
  letter-spacing: .04em;
  background: rgba(0, 0, 0, .2);
  border: 1px solid rgba(217, 171, 79, .25);
  border-radius: var(--radius);
  transition: color .2s, border-color .2s, background-color .2s, box-shadow .2s;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--c-gold);
  border-color: var(--c-gold-dark);
  background: rgba(217, 171, 79, .1);
  box-shadow: 0 0 14px rgba(217, 171, 79, .18);
}

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* ---------- Pied de page ---------- */
footer {
  position: relative;
  padding: 1.25rem 1rem 1.5rem;
  text-align: center;
  font-size: .95rem;
  color: var(--c-parch-dim);
  background: linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .5));
  border-top: 1px solid var(--c-line);
}

footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: min(360px, 70%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
}

footer p {
  margin: 0;
  letter-spacing: .02em;
}

footer p::before,
footer p::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 .7rem .2rem;
  background: var(--c-gold);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(217, 171, 79, .6);
}

/* ---------- Accueil ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 1.75rem 1rem 1.25rem;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 0%, rgba(157, 214, 240, .1), transparent 70%);
}

.hero h2 {
  font-size: 1.5rem;
  text-shadow: 0 0 18px rgba(217, 171, 79, .35), 0 2px 2px rgba(0, 0, 0, .6);
}

.hero p {
  max-width: 60ch;
  margin: 0 auto 1.25rem;
  color: var(--c-parch-dim);
}

/* Séparateur décoratif : filet doré et losange central */
.divider {
  position: relative;
  display: block;
  height: 2px;
  width: min(260px, 60%);
  margin: 1rem auto 1.5rem;
  background: linear-gradient(90deg, transparent, var(--c-gold), transparent);
  border: 0;
  overflow: visible;
}

.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  background: var(--c-gold);
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 10px rgba(217, 171, 79, .6);
}

/* Titres de section : petit filet doré sous le titre */
main > section:not(.hero) > h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin-top: .4rem;
  background: linear-gradient(90deg, var(--c-gold), transparent);
}

.text-center { text-align: center; }
.text-muted { color: var(--c-parch-dim); }
.text-gold { color: var(--c-gold); }
.text-ice { color: var(--c-ice); }

.stack > * + * {
  margin-top: 1.1rem;
}

/* ---------- Boutons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .55rem 1.2rem;
  font-family: var(--font-title);
  font-size: .9rem;
  letter-spacing: .05em;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  color: var(--c-gold);
  background: linear-gradient(180deg, rgba(217, 171, 79, .12), rgba(217, 171, 79, .03));
  border: 2px solid var(--c-gold);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .1);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s, transform .12s;
}

.btn:not(:disabled):not([aria-disabled="true"]):hover {
  color: #f3d08a;
  background: linear-gradient(180deg, rgba(217, 171, 79, .26), rgba(217, 171, 79, .1));
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 16px rgba(217, 171, 79, .3);
  text-decoration: none;
}

.btn:not(:disabled):not([aria-disabled="true"]):active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .45);
}

/* Principal : or en dégradé, relief marqué */
.btn-primary {
  color: #17181c;
  background: linear-gradient(180deg, #f2cf7e 0%, #d9ab4f 50%, #b9862e 100%);
  border-color: #8a6322;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}

.btn-primary:not(:disabled):not([aria-disabled="true"]):hover {
  color: #111216;
  background: linear-gradient(180deg, #f8e2a6 0%, #e6bb63 50%, #c9963a 100%);
  border-color: #8a6322;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 18px rgba(217, 171, 79, .5);
}

/* Secondaire : bleu glacier */
.btn-secondary {
  color: var(--c-ice);
  border-color: var(--c-ice-dark);
  background: linear-gradient(180deg, rgba(157, 214, 240, .16), rgba(95, 168, 204, .05));
}

.btn-secondary:not(:disabled):not([aria-disabled="true"]):hover {
  color: #e6f6fd;
  background: linear-gradient(180deg, rgba(157, 214, 240, .3), rgba(95, 168, 204, .12));
  border-color: var(--c-ice);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 14px rgba(157, 214, 240, .35);
}

.btn-danger {
  color: #ffb3ab;
  border-color: var(--c-err-bd);
  background: linear-gradient(180deg, rgba(192, 96, 90, .2), rgba(192, 96, 90, .05));
}

.btn-danger:not(:disabled):not([aria-disabled="true"]):hover {
  color: var(--c-err-tx);
  background: linear-gradient(180deg, rgba(192, 96, 90, .34), rgba(192, 96, 90, .12));
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 14px rgba(192, 96, 90, .35);
}

.btn-small {
  min-height: 36px;
  padding: .35rem .8rem;
  font-size: .8rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Désactivé : nettement distinct (gris, sans relief, sans effet) */
.btn:disabled,
.btn[aria-disabled="true"] {
  color: var(--c-parch-dim);
  background: rgba(255, 255, 255, .03);
  border-color: var(--c-line);
  box-shadow: none;
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  text-shadow: none;
}

/* ---------- Formulaires ---------- */
label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--c-parch);
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: .55rem .8rem;
  font: inherit;
  color: var(--c-parch);
  background: linear-gradient(180deg, #2a2f38, var(--c-stone-2));
  border: 1px solid #5a6273;
  border-radius: var(--radius);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35);
  transition: border-color .2s, box-shadow .2s;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: var(--tex-arrow), linear-gradient(180deg, #2a2f38, var(--c-stone-2));
  background-repeat: no-repeat;
  background-position: right .85rem center, 0 0;
  background-size: 12px 8px, auto;
}

input::placeholder,
textarea::placeholder {
  color: #aaa28f;
  opacity: 1;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Focus lumineux : bordure bleu glacier + halo */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--c-ice);
  outline: var(--focus);
  outline-offset: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3), 0 0 0 3px rgba(157, 214, 240, .22), 0 0 16px rgba(157, 214, 240, .2);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--c-err-bd);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35), 0 0 0 3px rgba(192, 96, 90, .2);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: .6;
  cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  margin-right: .4rem;
  accent-color: var(--c-gold);
  box-shadow: none;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  gap: 1rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
}

.field-help {
  display: block;
  margin-top: .3rem;
  font-size: .9rem;
  color: var(--c-parch-dim);
}

.field-error {
  display: block;
  margin-top: .3rem;
  font-size: .9rem;
  color: var(--c-err-tx);
}

fieldset {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .12);
}

legend {
  padding: 0 .5rem;
  font-family: var(--font-title);
  letter-spacing: .03em;
  color: var(--c-gold);
}

/* ---------- Animations ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ---------- Grille & cartes ---------- */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

/* "backwards" : l'animation n'écrase pas le survol (transform) après coup */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.25rem 1.3rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .04), transparent 40%),
    linear-gradient(180deg, var(--c-stone-2), var(--c-stone));
  border: 1px solid var(--c-line-soft);
  border-top: 3px solid var(--c-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
  animation: fade-up .45s var(--ease) backwards;
}

/* Coins ornés : équerres dorées en haut à gauche et en bas à droite */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--c-gold-dark);
  opacity: .75;
  pointer-events: none;
  transition: border-color .25s, opacity .25s, width .25s, height .25s;
}

.card::before {
  top: 6px;
  left: 6px;
  border-width: 1px 0 0 1px;
  border-radius: 4px 0 0 0;
}

.card::after {
  right: 6px;
  bottom: 6px;
  border-width: 0 1px 1px 0;
  border-radius: 0 0 4px 0;
}

.card:hover {
  border-color: var(--c-ice-dark);
  border-top-color: var(--c-gold);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(217, 171, 79, .12), var(--glow-gold);
}

.card:hover::before,
.card:hover::after {
  opacity: 1;
  border-color: var(--c-gold);
  width: 18px;
  height: 18px;
}

/* Soulèvement uniquement pour les cartes de liste (trajets) */
.grid > .card:hover {
  transform: translateY(-4px);
}

.card h2,
.card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.card-route {
  font-family: var(--font-title);
  font-size: 1.05rem;
  letter-spacing: .03em;
  color: var(--c-ice);
  text-shadow: 0 0 12px rgba(157, 214, 240, .25);
}

.card-meta {
  margin: 0;
  font-size: .95rem;
  color: var(--c-parch-dim);
}

.card-price {
  font-weight: 700;
  color: var(--c-gold);
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px dashed var(--c-line);
}

/* ---------- Badges (postes libres / occupés / statut) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .65rem .2rem .5rem;
  font-family: var(--font-text);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
}

.badge::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.badge-libre {
  color: var(--c-ok-tx);
  background: var(--c-ok-bg);
  border-color: var(--c-ok-bd);
}

.badge-pris {
  color: var(--c-err-tx);
  background: var(--c-err-bg);
  border-color: var(--c-err-bd);
}

.badge-info {
  color: var(--c-ice);
  background: rgba(157, 214, 240, .12);
  border-color: var(--c-ice-dark);
}

/* ---------- Bandeau d'info RDV ---------- */
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.2rem;
  color: var(--c-parch);
  background:
    linear-gradient(90deg, rgba(95, 168, 204, .2), rgba(217, 171, 79, .1)),
    var(--tex-noise);
  border: 1px solid var(--c-ice-dark);
  border-left: 5px solid var(--c-ice);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: fade-up .45s var(--ease) backwards;
}

/* Losange d'ornement en tête de bandeau */
.banner::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-left: .2rem;
  background: var(--c-gold);
  transform: rotate(45deg);
  box-shadow: 0 0 10px rgba(217, 171, 79, .6);
}

.banner strong {
  font-family: var(--font-title);
  font-size: .98rem;
  letter-spacing: .02em;
  color: var(--c-gold);
}

.banner .btn {
  margin-left: auto;
}

/* ---------- Messages succès / erreur (icône en pseudo-élément) ---------- */
.msg-ok,
.msg-err {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin: 0 0 1rem;
  padding: .8rem 1rem;
  font-weight: 600;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: fade-up .3s var(--ease) backwards;
}

/* Zone vide (admin-msg garde sa classe) : rien à afficher */
.msg-ok:empty,
.msg-err:empty {
  display: none;
}

.msg-ok {
  color: var(--c-ok-tx);
  background: linear-gradient(90deg, rgba(79, 154, 98, .3), var(--c-ok-bg));
  border-color: var(--c-ok-bd);
}

.msg-err {
  color: var(--c-err-tx);
  background: linear-gradient(90deg, rgba(192, 96, 90, .3), var(--c-err-bg));
  border-color: var(--c-err-bd);
}

.msg-ok::before,
.msg-err::before {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  font-size: .85rem;
  line-height: 1;
  font-weight: 700;
}

.msg-ok::before {
  content: "✔";
  color: #0f1f14;
  background: #8fd19a;
  box-shadow: 0 0 10px rgba(143, 209, 154, .5);
}

.msg-err::before {
  content: "✖";
  color: #2a0f0d;
  background: #f29a92;
  box-shadow: 0 0 10px rgba(242, 154, 146, .5);
}

/* ---------- Onglets ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1.25rem;
  border-bottom: 2px solid var(--c-line);
}

.tab {
  min-height: 44px;
  margin-bottom: -2px;
  padding: .5rem 1.05rem;
  font-family: var(--font-title);
  font-size: .9rem;
  letter-spacing: .03em;
  color: var(--c-parch-dim);
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s;
}

.tab:hover {
  color: var(--c-parch);
  background: rgba(255, 255, 255, .05);
}

.tab.active,
.tab[aria-selected="true"] {
  color: var(--c-gold);
  background: linear-gradient(180deg, rgba(217, 171, 79, .16), rgba(217, 171, 79, .03));
  border-bottom-color: var(--c-gold);
  text-shadow: 0 0 12px rgba(217, 171, 79, .35);
}

/* Apparition douce des sections d'administration */
#admin-section:not(.hidden),
section[id^="tab-"]:not(.hidden) {
  animation: fade-up .35s var(--ease) backwards;
}

/* ---------- Modale : fond flouté + apparition ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(6, 7, 9, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in .2s ease-out backwards;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .05), transparent 40%),
    linear-gradient(180deg, var(--c-stone-2), var(--c-stone));
  border: 1px solid var(--c-gold-dark);
  border-radius: 8px;
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(217, 171, 79, .08), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: modal-in .25s var(--ease) backwards;
}

.modal-content h2 {
  margin-top: 0;
  padding-right: 2.5rem;
}

.modal-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--c-parch);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--c-gold);
  background: rgba(255, 255, 255, .08);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: 1.25rem;
}

/* ---------- Utilitaires ---------- */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Tableaux admin ---------- */
.table-wrap {
  position: relative;
  width: 100%;
  max-height: 70vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--c-stone);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: .95rem;
}

caption {
  padding: .6rem .85rem;
  text-align: left;
  font-family: var(--font-title);
  font-size: .85rem;
  letter-spacing: .03em;
  color: var(--c-parch-dim);
  caption-side: top;
}

th,
td {
  padding: .65rem .85rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--c-line);
}

/* En-têtes collants */
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #3d4350, #2c313b);
  box-shadow: inset 0 -2px 0 var(--c-gold-dark);
}

th {
  font-family: var(--font-title);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-gold);
  background: var(--c-stone-2);
}

/* Lignes alternées et survol */
tbody tr:nth-child(odd) {
  background: rgba(0, 0, 0, .12);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, .03);
}

tbody tr {
  transition: background-color .2s, box-shadow .2s;
}

tbody tr:hover {
  background: rgba(157, 214, 240, .08);
  box-shadow: inset 3px 0 0 var(--c-gold);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td .btn {
  min-height: 36px;
  padding: .35rem .75rem;
  font-size: .8rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Tablette et plus ---------- */
@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .modal-content {
    padding: 2rem;
  }
}

@media (min-width: 720px) {
  h1 { font-size: 2.3rem; }
  h2 { font-size: 1.7rem; }
  h3 { font-size: 1.25rem; }

  header {
    padding: 1.25rem 2rem 1.35rem;
  }

  header h1 {
    font-size: 1.9rem;
    letter-spacing: .06em;
  }

  main {
    padding: 2rem 2rem 3.5rem;
  }

  .hero {
    padding: 2.5rem 1.5rem 1.75rem;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 1.6rem 1.7rem;
  }

  .banner {
    padding: 1.1rem 1.4rem;
  }
}

/* ---------- Ordinateur ---------- */
@media (min-width: 1100px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- Accessibilité : animations réduites ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .grid > .card:hover {
    transform: none;
  }
}

/* ---------- Compléments : listes d'affectation, totaux, récapitulatif ---------- */
.liste-simple {
  margin: 0 0 .5rem;
  padding-left: 1.1rem;
  list-style: "◆  ";
  color: var(--c-parch);
}

.liste-simple li {
  padding: .15rem 0;
  color: var(--c-parch);
}

.liste-simple li::marker {
  color: var(--c-gold);
}

tfoot th,
tfoot td {
  font-weight: 700;
  color: var(--c-gold);
  background: linear-gradient(180deg, rgba(217, 171, 79, .14), rgba(217, 171, 79, .05));
  border-top: 2px solid var(--c-gold-dark);
  border-bottom: 0;
}

tfoot th {
  font-family: var(--font-title);
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#remu-recap {
  border-left: 4px solid var(--c-ice-dark);
}

#remu-recap h4 {
  margin: 0 0 .4rem;
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--c-ice);
}

#remu-recap p {
  margin: 0;
}

#remu-recap strong {
  color: var(--c-gold);
}

#admin-section > .form-actions {
  justify-content: space-between;
  margin: 0 0 1rem;
}

/* === Ornements HTML (Hugo) === */

/* Frise de runes décorative dans l'en-tête */
.runes {
  flex: 1 1 100%;
  order: 3;
  margin: 0;
  font-family: var(--font-title);
  font-size: .95rem;
  letter-spacing: .6em;
  text-align: center;
  color: var(--c-gold);
  opacity: .6;
  text-shadow: 0 0 8px rgba(217, 171, 79, .5);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

/* Cadre orné de l'accueil : double bordure dorée fine + losanges aux coins */
.hero-inner {
  position: relative;
  padding: 1.5rem 1.1rem 1.25rem;
  border: 1px solid var(--c-gold-dark);
  outline: 1px solid rgba(217, 171, 79, .3);
  outline-offset: 4px;
  border-radius: 4px;
}

.hero-inner::before,
.hero-inner::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--c-gold);
  box-shadow: 0 0 8px rgba(217, 171, 79, .6);
  transform: rotate(45deg);
  pointer-events: none;
}

.hero-inner::before {
  top: -5px;
  left: -5px;
}

.hero-inner::after {
  right: -5px;
  bottom: -5px;
}

@media (min-width: 720px) {
  .runes {
    flex: 1 1 auto;
    order: 0;
    font-size: 1.1rem;
  }
}

/* Mobile : frise plus discrète */
@media (max-width: 599px) {
  .runes {
    font-size: .7rem;
    letter-spacing: .4em;
  }

  .hero-inner {
    padding: 1.1rem .8rem .9rem;
  }
}
