@font-face { font-family: "Nunito"; src: url("polices/Nunito-Regular.ttf") format("truetype"); font-weight: 400; }
@font-face { font-family: "Nunito"; src: url("polices/Nunito-SemiBold.ttf") format("truetype"); font-weight: 600; }
@font-face { font-family: "Nunito"; src: url("polices/Nunito-Bold.ttf") format("truetype"); font-weight: 700; }

:root {
  --bleu: #0E5CAA; --bleu-fonce: #0A4785; --clair: #EDF5FD; --filet: #B7C9DD; --gris: #5A6B7D;
  --sable: #FBF1DE; --abricot: #E8A04B; --rose: #F6E4E6; --rouge: #B3261E; --vert: #1E7B4A; --vert-clair: #E3F3EA;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Nunito", system-ui, sans-serif; color: #1C2733; background: #F7F9FC; font-size: 15.5px; line-height: 1.5; }
a { color: var(--bleu); }
header.bandeau { background: var(--bleu); color: #fff; }
header .ligne { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
header img { height: 46px; }
header .titre { font-weight: 700; font-size: 18px; }
header .sous { font-size: 12.5px; opacity: .9; }
header nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
header nav a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 14px; }
header nav a:hover, header nav a.actif { background: rgba(255,255,255,.18); }
main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
h1 { color: var(--bleu); font-size: 25px; margin: 4px 0 14px; }
h2 { color: var(--bleu); font-size: 19px; margin: 26px 0 10px; }
h3 { color: var(--bleu); font-size: 16px; margin: 18px 0 6px; }
.carte { background: #fff; border: 1px solid #DCE6F1; border-radius: 10px; padding: 16px 18px; margin: 12px 0; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.chiffre { font-size: 30px; font-weight: 700; color: var(--bleu); line-height: 1.1; }
.chiffre + div { color: var(--gris); font-size: 14px; }
.muet { color: var(--gris); font-size: 13.5px; }
.flash { padding: 10px 14px; border-radius: 8px; margin: 8px 0; border-left: 4px solid var(--bleu); background: var(--clair); }
.flash.erreur { background: var(--rose); border-color: var(--rouge); }
.flash.attention { background: var(--sable); border-color: var(--abricot); }
.flash.ok { background: var(--vert-clair); border-color: var(--vert); }
.encadre { padding: 10px 14px; border-radius: 8px; border-left: 4px solid var(--bleu); background: var(--clair); margin: 10px 0; }
.encadre.sable { background: var(--sable); border-color: var(--abricot); }
.encadre.rose { background: var(--rose); border-color: var(--rouge); }
table { border-collapse: collapse; width: 100%; background: #fff; }
th { background: var(--bleu); color: #fff; text-align: left; font-weight: 700; padding: 7px 8px; font-size: 14px; }
td { padding: 6px 8px; border-bottom: 1px solid #E3EAF2; vertical-align: top; font-size: 14.5px; }
tr:nth-child(even) td { background: #F7FAFE; }
td.d, th.d { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 700; background: var(--clair); color: var(--bleu); white-space: nowrap; }
.badge.ok, .badge.payee, .badge.validee { background: var(--vert-clair); color: var(--vert); }
.badge.attention, .badge.a_corriger, .badge.envoyee { background: var(--sable); color: #8A5A12; }
.badge.erreur { background: var(--rose); color: var(--rouge); }
.btn, button { display: inline-block; font-family: inherit; font-size: 15px; font-weight: 700; padding: 8px 16px; border-radius: 8px; border: 2px solid var(--bleu); background: var(--bleu); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); }
.btn.second, button.second { background: #fff; color: var(--bleu); }
.btn.second:hover, button.second:hover { background: var(--clair); }
.btn.petit, button.petit { font-size: 13px; padding: 3px 10px; border-width: 1.5px; }
button.danger { background: #fff; color: var(--rouge); border-color: var(--rouge); }
button.danger:hover { background: var(--rose); }
input, select, textarea { font-family: inherit; font-size: 15px; padding: 6px 8px; border: 1.5px solid var(--filet); border-radius: 6px; background: #fff; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--bleu); border-color: var(--bleu); }
label { font-weight: 600; }
.champ { margin: 10px 0; }
.champ label { display: block; margin-bottom: 3px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.saisie td { padding: 4px 4px; }
.saisie input, .saisie select { width: 100%; }
.saisie input.km, .saisie input.montant { width: 90px; text-align: right; }
.saisie input[type=date] { min-width: 140px; }
tr.retour td { background: #FAFCFF; }
tr.retour td:first-child { border-left: 3px solid var(--filet); }
.suppr { background: none; border: none; color: var(--rouge); font-size: 20px; padding: 0 6px; cursor: pointer; }
.suppr:hover { background: var(--rose); }
.totaux { display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; font-size: 16px; margin-top: 8px; }
.totaux b { color: var(--bleu); }
.refus td { text-decoration: line-through; color: var(--gris); }
.refus td.motif { text-decoration: none; color: var(--rouge); }
.cote { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
.apercu { width: 100%; height: 78vh; border: 1px solid var(--filet); border-radius: 8px; background: #fff; }
.apercu-img { width: 100%; border: 1px solid var(--filet); border-radius: 8px; }
.lien { font-family: monospace; font-size: 12.5px; word-break: break-all; }
.etapes { counter-reset: e; list-style: none; padding: 0; }
.etapes li { counter-increment: e; padding-left: 34px; position: relative; margin: 8px 0; }
.etapes li::before { content: counter(e); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--bleu); color: #fff; text-align: center; font-weight: 700; font-size: 14px; line-height: 24px; }
.alerte-km { color: #8A5A12; font-weight: 700; }
footer { text-align: center; color: var(--gris); font-size: 12.5px; padding: 20px; }
@media (max-width: 800px) {
  .cote { grid-template-columns: 1fr; }
  .saisie thead { display: none; }
  .saisie tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px 0; border-bottom: 2px solid var(--filet); }
  .saisie td { border: none; }
  .saisie td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--gris); font-weight: 700; }
}
