/* Application simplifiée — feuille unique, sans dépendance.
   Pensée pour l'ordinateur et la tablette : cibles tactiles de 44 px. */
:root {
  --vert: #2e7d32; --vert-clair: #e8f5e9; --texte: #1b1f1d; --gris: #5f6b66; --bord: #d5dcd8;
  --fond: #f7f9f8; --rouge: #b3261e; --rouge-clair: #fdecea; --bleu-clair: #e8f0fe; --orange-clair: #fff4e5;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); background: var(--fond); }
a { color: var(--vert); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--bord); }
.marque { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--vert); }
.bandeau-instance { background: var(--orange-clair); border: 1px solid #f0c27b; border-radius: 4px; padding: 2px 8px; font-size: .85rem; }
.menu { display: flex; flex-wrap: wrap; gap: 4px; }
.menu a { padding: 10px 12px; border-radius: 6px; text-decoration: none; color: var(--texte); min-height: 44px; display: inline-flex; align-items: center; }
.menu a.actif, .menu a:hover { background: var(--vert-clair); color: var(--vert); }
.qui { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--gris); }
.qui form { margin: 0; }
button, .bouton { font: inherit; min-height: 44px; padding: 8px 16px; border: 1px solid var(--bord); border-radius: 6px; background: #fff; color: var(--texte); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
button.principal, .bouton.principal { background: var(--vert); border-color: var(--vert); color: #fff; }
button:disabled { opacity: .6; cursor: wait; }
button.lien { border: 0; background: none; color: var(--vert); padding: 0 4px; min-height: auto; text-decoration: underline; }
.actions-rapides { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
form.en-ligne { display: inline; margin: 0; }
.flash { padding: 10px 14px; border-radius: 6px; border: 1px solid var(--bord); }
.flash-ok { background: var(--vert-clair); border-color: #a5d6a7; }
.flash-erreur, .alerte { background: var(--rouge-clair); border-color: #f5b7b1; }
.flash-info { background: var(--bleu-clair); border-color: #b6ccf5; }
.aide, .sous-titre, .vide { color: var(--gris); }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 20px; }
.etroite { max-width: 420px; margin: 40px auto; }
.formulaire { display: flex; flex-direction: column; gap: 12px; max-width: 900px; }
.formulaire label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.formulaire input, .formulaire select, .formulaire textarea, .recherche input { font: inherit; font-weight: 400; padding: 10px; border: 1px solid var(--bord); border-radius: 6px; min-height: 44px; width: 100%; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ligne-radio { border: 0; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.ligne-radio label { flex-direction: row; align-items: center; font-weight: 400; }
.ligne-radio input { width: auto; min-height: auto; }
.en-cadre { border: 1px solid var(--bord); border-radius: 8px; padding: 16px; background: #fff; }
.recherche, .filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.recherche input { max-width: 420px; }
.filtres a { padding: 8px 12px; border-radius: 6px; text-decoration: none; }
.filtres a.actif { background: var(--vert-clair); }
.filtres .bouton { margin-left: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
.liste th, .liste td { padding: 10px 8px; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: top; }
.liste thead th { font-size: .85rem; color: var(--gris); }
.nb { text-align: right !important; white-space: nowrap; }
.lignes-lecture .description { white-space: pre-line; }
tr.section td { font-weight: 700; background: var(--vert-clair); }
tr.note td { font-style: italic; color: var(--gris); white-space: pre-line; }
tfoot th { text-align: right; } tfoot .total { font-weight: 700; font-size: 1.1rem; }
table.lignes td { padding: 4px; vertical-align: top; }
table.lignes td.large { width: 40%; }
table.lignes select, table.lignes input, table.lignes textarea { width: 100%; }
tr[data-type=line_section] .seulement-produit, tr[data-type=line_note] .seulement-produit { visibility: hidden; }
.boutons-lignes { display: flex; gap: 8px; flex-wrap: wrap; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.chiffre { background: #fff; border: 1px solid var(--bord); border-radius: 8px; padding: 16px; text-decoration: none; color: var(--texte); display: flex; flex-direction: column; }
.chiffre .nombre { font-size: 1.6rem; font-weight: 700; color: var(--vert); }
.chiffre.alerte .nombre { color: var(--rouge); }
.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.fiche dt { color: var(--gris); }
.historique ol { list-style: none; padding: 0; }
.historique li { padding: 8px 0; border-bottom: 1px solid var(--bord); }
.historique .date { color: var(--gris); font-size: .9rem; }
.envoi-echec { color: var(--rouge); font-weight: 600; }
.envoi-en_file { color: #8a5300; }
.apercu { width: 100%; height: 80vh; border: 1px solid var(--bord); background: #fff; }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
@media (max-width: 700px) {
  .deux { grid-template-columns: 1fr; }
  .qui { margin-left: 0; }
  table.lignes, table.lignes tbody, table.lignes tr, table.lignes td { display: block; width: 100% !important; }
  table.lignes thead { display: none; }
  table.lignes tr { border: 1px solid var(--bord); border-radius: 6px; margin-bottom: 8px; padding: 6px; }
}
