/* LCA — gestion de parc (démo). Sobre : c'est un outil de test, pas une vitrine. */
:root {
  --fond: #f4f6f5;
  --carte: #ffffff;
  --texte: #17211f;
  --discret: #5b6865;
  --ligne: #dde3e1;
  --marque: #0f5c55;
  --marque-clair: #e3f0ee;
  --alerte: #a15c00;
  --erreur: #b42318;
  --ok: #1d6b3a;
  --police: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.5 var(--police); }
a { color: var(--marque); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--marque-clair); padding: 0.05em 0.3em; border-radius: 3px; overflow-wrap: anywhere; }
h1 { font-size: 1.45rem; margin: 0.2rem 0 0.6rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.7rem; }
small, .discret { color: var(--discret); }

.test-bandeau { background: #fff4d6; color: #6b4e00; text-align: center; font-size: 0.85rem; padding: 0.35rem 1rem; }
.entete { background: var(--marque); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.7rem max(16px, 2rem); }
.marque { display: flex; align-items: center; gap: 0.7rem; }
.logo { background: #fff; color: var(--marque); font-weight: 800; letter-spacing: 0.04em; padding: 0.15rem 0.5rem; border-radius: 4px; }
.nom small { color: #cfe7e3; display: block; font-size: 0.75rem; }
nav { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
nav a { color: #e6f3f1; text-decoration: none; padding: 0.35rem 0.7rem; border-radius: 5px; }
nav a.actif, nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.inline { display: inline; }
.lien { background: none; border: 0; color: #cfe7e3; cursor: pointer; font: inherit; padding: 0.35rem 0.7rem; }

.page { max-width: 1150px; margin: 0 auto; padding: 1.2rem max(16px, 2rem) 2rem; display: grid; gap: 1rem; }
.page > * { min-width: 0; }
.pied { text-align: center; color: var(--discret); font-size: 0.8rem; padding: 1rem; }

.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 1.1rem 1.25rem; min-width: 0; }
.carte.danger { border-color: #f1c4bf; }
.titre-ligne { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

.bouton { display: inline-block; background: var(--marque); color: #fff; border: 0; border-radius: 6px; padding: 0.55rem 1rem; font: 600 0.92rem var(--police); text-decoration: none; cursor: pointer; }
.bouton:hover { filter: brightness(1.1); }
.bouton.secondaire { background: var(--marque-clair); color: var(--marque); }
.bouton.danger { background: var(--erreur); }
.bouton:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #8cc9c1; outline-offset: 1px; }

label { display: block; font-weight: 600; font-size: 0.88rem; margin: 0.7rem 0 0.25rem; }
input, select, textarea { width: 100%; font: inherit; padding: 0.5rem 0.6rem; border: 1px solid #c8d1ce; border-radius: 6px; background: #fff; }
.formulaire small { display: block; margin-top: 0.2rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.actions { margin-top: 1.2rem; }
.sous-formulaire { display: grid; gap: 0.5rem; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed var(--ligne); }
.sous-formulaire label { margin: 0; }
.filtres { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.filtres label { margin: 0; }
.filtres select { width: auto; }

.flash { margin: 0; padding: 0.6rem 0.9rem; border-radius: 6px; }
.flash-ok { background: #e3f4e8; color: var(--ok); }
.flash-erreur { background: #fde8e6; color: var(--erreur); }
.vide { color: var(--discret); background: var(--carte); border: 1px dashed var(--ligne); border-radius: 10px; padding: 1.5rem; text-align: center; }

.tableau { overflow-x: auto; background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; }
.carte .tableau { border: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--discret); padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--ligne); }
td { padding: 0.55rem 0.7rem; border-bottom: 1px solid #eef1f0; vertical-align: top; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { border-bottom: 0; }

.etape { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; background: #eef1f0; color: #34403d; white-space: nowrap; }
.etape.grande { font-size: 0.9rem; padding: 0.3rem 0.8rem; }
.etape-declared { background: #eef1f0; }
.etape-work_sheet { background: #e7eefc; color: #2b4a8a; }
.etape-quote_received { background: #fff1d9; color: #7a5200; }
.etape-quote_corrected { background: #e9e4fb; color: #4b3a8f; }
.etape-work_completed { background: #dff3f0; color: #0f5c55; }
.etape-delivered { background: #e3f4e8; color: var(--ok); }
.etape-cancelled { background: #fde8e6; color: var(--erreur); }
.pastille { font-size: 0.72rem; padding: 0.05rem 0.45rem; border-radius: 4px; background: #eef1f0; color: var(--discret); white-space: nowrap; }
.pastille-alerte { background: #fff1d9; color: var(--alerte); }
.pastille-ok { background: #e3f4e8; color: var(--ok); }

.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 0.8rem; }
.fiche dt { color: var(--discret); }
.fiche dd { margin: 0; }
.frise { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }
.documents { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; }
.documents small { display: block; }
.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.messages li { padding: 0.5rem 0.75rem; border-radius: 8px; max-width: 90%; }
.messages li p { margin: 0.15rem 0 0; white-space: pre-wrap; }
.messages .moi { background: var(--marque-clair); justify-self: end; }
.messages .eux { background: #f1f3f2; }
.pagination { display: flex; gap: 1rem; justify-content: center; color: var(--discret); }

.connexion { max-width: 380px; margin: 3rem auto; }
.connexion .bouton { margin-top: 1rem; width: 100%; }
@media (max-width: 600px) { .fiche { grid-template-columns: 1fr; } .fiche dt { margin-top: 0.4rem; } }
.detail-cle { color: var(--discret); }
