:root {
  --bleu: #1f3a5f;
  --bleu-clair: #e8eef6;
  --accent: #b3893a;
  --texte: #1d2433;
  --gris: #6b7280;
  --bord: #d8dee8;
  --ok: #1d7a46;
  --ko: #b42318;
  --fond: #f5f7fa;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--texte); background: var(--fond); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.top { background: var(--bleu); color: #fff; }
.bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 58px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand small { font-weight: 400; opacity: .8; }
.logo { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav a { color: #dbe5f3; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: .95rem; }
nav a:hover, nav a.on { background: rgba(255,255,255,.15); color: #fff; }
nav a.out { border: 1px solid rgba(255,255,255,.35); }
main { padding-top: 22px; padding-bottom: 40px; min-height: 70vh; }
h1 { font-size: 1.55rem; margin: 0 0 14px; color: var(--bleu); }
h2 { font-size: 1.15rem; margin: 22px 0 10px; color: var(--bleu); }
.card { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.card h1:first-child, .card h2:first-child { margin-top: 0; }
.muted { color: var(--gris); font-size: .92rem; }
.foot { color: var(--gris); font-size: .85rem; padding-bottom: 24px; }
a { color: var(--bleu); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: #e9f7ef; border-color: #b7e1c6; color: #14532d; }
.flash.err { background: #fdecea; border-color: #f5c2bd; color: #7a1c14; }
.flash.warn { background: #fff6e0; border-color: #f0d9a0; color: #7a5200; }

.btn, button { display: inline-block; background: var(--bleu); color: #fff; border: 0; border-radius: 7px; padding: 9px 16px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { filter: brightness(1.15); }
.btn.sec, button.sec { background: #fff; color: var(--bleu); border: 1px solid var(--bleu); }
.btn.danger, button.danger { background: var(--ko); }
.btn.small, button.small { padding: 4px 10px; font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }

label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: .94rem; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 7px; font: inherit; background: #fff;
}
textarea { min-height: 110px; resize: vertical; }
textarea.big { min-height: 220px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 12px; }
.check input { width: auto; }
.hint { color: var(--gris); font-size: .86rem; margin-top: 3px; }

table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
th { background: var(--bleu-clair); color: var(--bleu); font-size: .88rem; }
td.num, th.num { text-align: center; width: 90px; }
td input[type=number] { width: 80px; text-align: center; }
.tablewrap { overflow-x: auto; border: 1px solid var(--bord); border-radius: 10px; }
.tablewrap table { border-radius: 10px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef0f4; color: #444; }
.badge.ok { background: #e1f4e8; color: var(--ok); }
.badge.ko { background: #fde7e4; color: var(--ko); }
.badge.warn { background: #fff1cc; color: #7a5200; }
.badge.blue { background: var(--bleu-clair); color: var(--bleu); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--bord); margin: 14px 0 18px; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--gris); border-radius: 8px 8px 0 0; font-weight: 600; }
.tabs a.on { color: var(--bleu); background: #fff; border: 1px solid var(--bord); border-bottom: 2px solid #fff; margin-bottom: -2px; }

.head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.inline { display: inline; }
.inline button { margin: 0; }
.rowacts { white-space: nowrap; }
.center { text-align: center; }
.loginbox { max-width: 400px; margin: 60px auto; }
.presrow td { padding: 6px 10px; }
.presrow label { display: inline-flex; font-weight: 400; margin: 0 10px 0 0; gap: 4px; }
.presrow input[type=radio] { width: auto; }

@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ---------- Vue document (HTML imprimable) ---------- */
body.docview { background: #e9edf2; }
.doctools { max-width: 800px; margin: 16px auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px; align-items: center; }
.sheet { max-width: 800px; margin: 0 auto 22px; background: #fff; padding: 56px 64px; box-shadow: 0 2px 10px rgba(0,0,0,.12); font-family: "Times New Roman", Georgia, serif; font-size: 12pt; line-height: 1.45; color: #000; }
.sheet h1 { font: 700 14pt "Times New Roman", serif; text-align: center; color: #000; text-transform: uppercase; margin: 6px 0; }
.sheet h2 { font: 700 12pt "Times New Roman", serif; color: #000; margin: 14px 0 4px; }
.sheet p { margin: 0 0 8px; }
.sheet .j { text-align: justify; }
.sheet .c { text-align: center; }
.sheet .r { text-align: right; }
.sheet table { border-collapse: collapse; width: 100%; margin: 8px 0 12px; font-size: 11pt; }
.sheet table th, .sheet table td { border: 1px solid #333; padding: 4px 8px; background: #fff; color: #000; vertical-align: top; }
.sheet table th { background: #eee; font-size: 11pt; }
.sheet table.nb th, .sheet table.nb td { border: 0; }
.sheet .projet { color: #b42318; border: 2px solid #b42318; padding: 6px; font-weight: 700; margin-bottom: 14px; }
.sheet .small { font-size: 10pt; }

@media print {
  body, body.docview { background: #fff; }
  .doctools, .top, .foot, .flash { display: none !important; }
  .sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .sheet + .sheet { page-break-before: always; }
  @page { size: A4; margin: 20mm; }
}
