/* Thème NA Publications — couleurs officielles NA France. */
:root {
  --na-blue: #002a94;        /* bleu marine primaire */
  --na-blue-light: #1e73be;  /* bleu accent */
  --na-blue-dark: #001f6e;
  --ink: #141414;
  --muted: #5c6270;
  --line: #e3e6ee;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #2e7d32;
  --err: #c62828;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 64, .08), 0 1px 2px rgba(16, 24, 64, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

.container { max-width: 920px; margin: 0 auto; padding: 0 1.1rem; }

/* En-tête (logo NA blanc sur fond bleu marine) */
.site-header {
  background: var(--na-blue);
  border-bottom: 3px solid var(--na-blue-light);
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.1rem; }
.header-inner .logo { height: 42px; width: auto; display: block; }
.site-title {
  font-weight: 600; color: #fff;
  border-left: 1px solid rgba(255, 255, 255, .35); padding-left: .8rem; letter-spacing: .2px;
}
main.container { padding-top: 1.4rem; padding-bottom: 2.5rem; }

/* Titres */
h1 { color: var(--na-blue); font-size: 1.7rem; margin: .2rem 0 .4rem; }
h2 { color: var(--na-blue); font-size: 1.2rem; margin: 1.6rem 0 .6rem; }

a { color: var(--na-blue-light); }
a:hover { color: var(--na-blue-dark); }

/* Cartes : fieldset et sections deviennent des blocs blancs */
fieldset, section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.1rem;
  box-shadow: var(--shadow);
}
fieldset { border-color: var(--line); }
legend { font-weight: 600; color: var(--na-blue); padding: 0 .4rem; }

/* Formulaires */
label { display: inline-block; margin: .15rem .6rem .15rem 0; }
input[type="text"], input[type="email"], input[type="number"], input[type="tel"],
input:not([type]), textarea, select {
  font: inherit; color: var(--ink);
  padding: .45rem .55rem; border: 1px solid #c7cede; border-radius: 8px;
  background: #fff; max-width: 100%;
}
input[type="number"] { width: 6.5rem; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--na-blue-light);
  box-shadow: 0 0 0 3px rgba(30, 115, 190, .18);
}

/* Boutons */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--na-blue); color: #fff; border: 0;
  padding: .6rem 1.1rem; border-radius: 8px;
}
button:hover:not([disabled]) { background: var(--na-blue-dark); }
button[disabled] { background: #aeb6ca; cursor: not-allowed; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: .4rem 0; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
thead th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .4px; }
tfoot th, tfoot td { border-top: 2px solid var(--na-blue); font-weight: 700; }
td:last-child, th:last-child { text-align: right; }
tbody tr:hover { background: #f8faff; }

.r { text-align: right; }

/* Catégories repliables du bon de commande */
details.cat-bloc { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin: 0 0 .6rem; box-shadow: var(--shadow); overflow: hidden; }
details.cat-bloc > summary { cursor: pointer; padding: .7rem 1rem; font-weight: 600;
  color: var(--na-blue); list-style: none; user-select: none; }
details.cat-bloc > summary::-webkit-details-marker { display: none; }
details.cat-bloc > summary::before { content: "▸ "; color: var(--na-blue-light); }
details.cat-bloc[open] > summary::before { content: "▾ "; }
details.cat-bloc[open] > summary { border-bottom: 1px solid var(--line); }
details.cat-bloc > summary:hover { background: #f2f6ff; }
details.cat-bloc .cat-count { color: var(--muted); font-weight: 400; }
details.cat-bloc table { margin: 0; }
details.cat-bloc td, details.cat-bloc th { padding: .45rem 1rem; }
.ligne-total { font-weight: 600; color: var(--na-blue); }

/* Récapitulatif détaillé (fragment HTMX) */
#totaux { margin: 1rem 0; }
table.recap { background: #f2f6ff; border-radius: var(--radius); overflow: hidden; }
table.recap td, table.recap th { border-bottom: 1px solid #dbe4f7; padding: .4rem .7rem; }
tr.recap-cat th { text-align: left; color: var(--na-blue); font-size: .82rem;
  text-transform: uppercase; letter-spacing: .4px; padding-top: .6rem; }
tr.recap-sous td { font-weight: 600; }
tr.recap-total th { border-top: 2px solid var(--na-blue); border-bottom: 0;
  font-size: 1.05rem; color: var(--na-blue); }

/* Messages */
ul.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.messages li { padding: .6rem .8rem; border-radius: 8px; margin-bottom: .5rem; }
ul.messages li.error { background: #fdecea; color: var(--err); border: 1px solid #f5c6c0; }
ul.messages li.success { background: #eaf5ea; color: var(--ok); border: 1px solid #c3e2c3; }

/* Recherche de groupe */
.groupe-resultats { margin: .3rem 0; }
.groupe-resultats ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; max-width: 480px; }
.groupe-resultats li + li { border-top: 1px solid var(--line); }
.groupe-choix, .article-choix { display: block; width: 100%; text-align: left; background: #fff;
  color: var(--ink); border: 0; border-radius: 0; padding: .5rem .7rem; font-weight: 400; }
.groupe-choix:hover, .article-choix:hover { background: #eef3ff; }
#groupe-autre { background: transparent; color: var(--na-blue-light); text-decoration: underline;
  padding: .3rem 0; font-weight: 400; }
#groupe-autre:hover { background: transparent; color: var(--na-blue-dark); }
#groupe-nom[readonly], #groupe-ville[readonly] { background: #f0f3fa; }

/* Captcha */
altcha-widget { display: block; margin: 1rem 0; max-width: 320px; }

/* --- Back-office comité --- */
.comite-nav { display: flex; align-items: center; gap: 1.1rem; padding: .6rem 0;
  border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; flex-wrap: wrap; }
.comite-nav a { font-weight: 600; text-decoration: none; }
.comite-nav-spacer { flex: 1; }
.comite-nav form { margin: 0; }
button.lien, .lien { background: transparent; color: var(--na-blue-light); border: 0;
  padding: 0; font-weight: 600; text-decoration: underline; cursor: pointer; }
button.danger { background: var(--err); }
button.danger:hover { background: #a01818; }

.filtres { display: flex; gap: .9rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.filtres label { display: flex; flex-direction: column; gap: .2rem; margin: 0; }

/* Pages « prise en main » / aide */
.guide-intro { color: var(--muted); font-size: 1.02rem; margin: 0 0 1.2rem; }
.guide-etapes { list-style: none; counter-reset: etape; padding: 0; margin: 0; }
.guide-etapes > li { counter-increment: etape; position: relative; padding: 0 0 0 3rem; margin: 0 0 1.1rem; min-height: 2rem; }
.guide-etapes > li::before {
  content: counter(etape); position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--na-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; }
.guide-etapes > li h3 { margin: .1rem 0 .2rem; color: var(--na-blue-dark); font-size: 1.05rem; }
.guide-etapes > li p { margin: .2rem 0; }
.guide-liens { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.guide-liens a { display: inline-block; padding: .5rem .9rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); text-decoration: none; font-weight: 600; }
.astuce { border-left: 4px solid var(--na-blue-light); background: #eef4fb; border-radius: 0;
  padding: .7rem .9rem; margin: 1rem 0; }
.astuce strong { color: var(--na-blue-dark); }

.mois-liste { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 1.4rem; }
.mois-item { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .8rem; font-weight: 600; }
.mois-item.actif { border-color: var(--na-blue-light); background: var(--card); }

.detail-cols { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.detail-cols > * { flex: 1; min-width: 250px; }
.carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.actions form { margin: 0; }

.badge { display: inline-block; font-size: .78rem; padding: .12em .55em; border-radius: 999px;
  background: #e7edfb; color: var(--na-blue); vertical-align: middle; }
.badge.hors-ref { background: #fde7cf; color: #8a5300; }
.statut-preparation { background: #fff3cd; color: #7a5b00; }
.statut-expediee, .statut-retiree { background: #d8f0dd; color: #1c6b2c; }
.statut-annulee { background: #f3d6d6; color: #a01818; }
.oui { color: var(--ok); font-weight: 600; }
.non { color: var(--err); font-weight: 600; }
.alerte { color: #a6730a; font-weight: 600; }
.pagination { display: flex; gap: 1rem; align-items: center; }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer .container { padding-top: 1rem; padding-bottom: 1.4rem; }

@media (max-width: 560px) {
  .site-title { display: none; }
  input[type="number"] { width: 5rem; }
}
