:root {
  --bleu: #1f4e79;
  --bleu-clair: #eaf1f8;
  --gris: #6b7280;
  --bord: #d8dee6;
  --fond: #f5f7fa;
}
* { box-sizing: border-box; }
body {
  margin: 0; font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  background: var(--fond); color: #1c2530;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bleu); color: #fff; padding: 10px 22px; flex-wrap: wrap; gap: 8px;
}
.brand { font-weight: 700; font-size: 17px; }
.brand span { font-weight: 300; }
nav a {
  color: #dbe7f3; text-decoration: none; margin-left: 16px; padding: 4px 2px;
}
nav a.on { color: #fff; border-bottom: 2px solid #fff; }
nav a:hover { color: #fff; }
nav a.sortie { opacity: .7; }
main { max-width: 1080px; margin: 24px auto; padding: 0 18px 60px; }
h1 { font-size: 24px; color: var(--bleu); margin: 6px 0 18px; }
h2 { font-size: 18px; color: var(--bleu); margin-top: 30px; }
h3 { font-size: 15px; color: var(--bleu); margin: 12px 0 8px; }
a { color: var(--bleu); }

.flash {
  background: #e6f4e6; border: 1px solid #b5dcb5; color: #245c24;
  padding: 8px 14px; border-radius: 6px; margin-bottom: 16px;
}
.vide, .note { color: var(--gris); }
.err { color: #b02a2a; }

table.liste {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--bord); border-radius: 8px; overflow: hidden;
}
table.liste th {
  text-align: left; background: var(--bleu-clair); color: var(--bleu);
  padding: 8px 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .3px;
}
table.liste td { padding: 8px 10px; border-top: 1px solid var(--bord); vertical-align: top; }
table.liste td.num, table.liste th.num { text-align: right; }
table.liste tr.inactif td { opacity: .5; }
table.liste tr.total td { background: var(--bleu-clair); }
.actions { white-space: nowrap; }
.actions a { margin-right: 8px; font-size: 13px; }

.statut { padding: 2px 9px; border-radius: 10px; font-size: 12.5px; white-space: nowrap; }
.s-brouillon { background: #eee; color: #555; }
.s-emise    { background: #fff3cd; color: #8a6d1a; }
.s-payee    { background: #d7efd7; color: #1f6b1f; }
.s-annulee  { background: #fbdada; color: #a03030; }

form.barre { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
form.fiche {
  background: #fff; border: 1px solid var(--bord); border-radius: 8px;
  padding: 16px 18px; margin: 14px 0;
}
form.fiche.large { max-width: none; }
label { display: block; margin-bottom: 10px; font-size: 13.5px; color: #37414d; }
input[type=text], input[type=email], input[type=date], input[type=password],
select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--bord); border-radius: 6px;
  font: inherit; background: #fff; margin-top: 3px;
}
form.barre select { width: auto; }
textarea { resize: vertical; }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.grille .pleine { grid-column: 1 / -1; }
.rangee { display: flex; gap: 12px; }
.rangee label { flex: 1; }
.deux-col { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: start; }
@media (max-width: 800px) {
  .grille, .deux-col { display: block; }
}

button {
  background: var(--bleu); color: #fff; border: 0; border-radius: 6px;
  padding: 8px 16px; font: inherit; cursor: pointer;
}
button:hover { background: #2a629a; }
button:disabled { background: #9aa7b5; cursor: default; }
button.secondaire { background: #7a8694; }
button.lien {
  background: none; color: var(--bleu); padding: 0; text-decoration: underline; font-size: 13px;
}
button.lien.danger { color: #b02a2a; }
.btn-lien { font-weight: 600; }

table.lignes input.desc { margin-top: 4px; font-size: 12.5px; color: var(--gris); }

body.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-box {
  background: #fff; border: 1px solid var(--bord); border-radius: 10px;
  padding: 34px 38px; text-align: center; width: 320px;
}
.login-box h1 { margin: 0; color: var(--bleu); }
.login-box p { margin-top: 4px; color: var(--gris); }
.login-box input { margin: 14px 0; text-align: center; }
.login-box button { width: 100%; }
