:root {
  --orange: #E8731A; --orange-d: #c95f10; --gris: #4a4a4a; --gris-l: #f3f3f3;
  --bord: #e2e2e2; --txt: #222; --muted: #777; --ok: #2e8b57; --no: #c0392b; --warn: #b9770e;
  --cp: #E8731A; --rtt: #3b82c4; --recup: #2e8b57; --abs: #8e44ad;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--txt); background: #fafafa; font-size: 15px; }
a { color: var(--orange-d); }
h1 { font-size: 1.5rem; margin: 0; } h2 { font-size: 1.1rem; margin: 0 0 12px; }
.topbar { display: flex; align-items: center; gap: 24px; background: var(--gris); color: #fff; padding: 0 20px; height: 56px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.logo { background: var(--orange); border-radius: 6px; padding: 4px 7px; font-size: .8rem; letter-spacing: .5px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 8px 12px; border-radius: 6px; opacity: .85; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.me { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.card { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 440px; margin: 40px auto; }
.grid2 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--bord); border-left: 4px solid var(--orange); border-radius: 10px; padding: 16px 18px; }
.stat .lbl { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }
.stat .val { font-size: 2rem; font-weight: 700; margin: 4px 0; } .stat .val.sm { font-size: 1.3rem; }
.stat .val small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.stat .sub { font-size: .82rem; color: var(--muted); }
.neg { color: var(--no) !important; } .warn { color: var(--warn); } .muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: .92rem; }
.form label.req::after { content: "obligatoire pour ce type"; font-size: .75rem; color: var(--orange-d); font-weight: 400; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; } .pad { padding-top: 24px; }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid #ccc; border-radius: 7px; background: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: transparent; }
.row2, .row3, .row4 { display: grid; gap: 12px; } .row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: repeat(3, 1fr); } .row4 { grid-template-columns: repeat(4, 1fr); }
fieldset { border: 1px solid var(--bord); border-radius: 8px; padding: 12px; } legend { font-weight: 600; padding: 0 6px; }
.btn { display: inline-block; background: var(--orange); color: #fff; border: 0; border-radius: 7px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--orange-d); } .btn.ghost { background: #fff; color: var(--gris); border: 1px solid #ccc; }
.btn.ok { background: var(--ok); } .btn.no { background: var(--no); }
button.link { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
button.link.danger { color: var(--no); } .topbar button.link { color: #fff; opacity: .8; }
form.inline { display: inline; }
.flash { padding: 10px 14px; border-radius: 7px; margin-bottom: 14px; background: #e8f5ee; color: #1f6b43; border: 1px solid #bfe3cf; }
.flash.err { background: #fdecea; color: #922; border-color: #f4c4be; } .flash.warn { background: #fff6e5; color: #7a5300; border-color: #f3dca8; }
.calcbox { background: var(--gris-l); border-radius: 7px; padding: 10px 12px; font-size: .9rem; } .calcbox.err { background: #fdecea; color: #922; }
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; } .tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: top; }
.tbl th { font-size: .8rem; text-transform: uppercase; color: var(--muted); font-weight: 600; } .num { text-align: right !important; }
.tbl tr.inactive td { opacity: .5; } .actions { white-space: nowrap; } .actions a { margin-right: 8px; }
.kv { width: 100%; border-collapse: collapse; } .kv th, .kv td { padding: 8px 6px; border-bottom: 1px solid var(--bord); text-align: left; } .kv th { font-weight: 500; color: var(--gris); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.s-en_attente { background: #fff1d6; color: #8a5a00; } .s-acceptee { background: #dff3e7; color: #1f6b43; } .s-refusee { background: #fbe0dc; color: #922; } .s-annulee { background: #eee; color: #777; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: .75rem; font-weight: 600; background: #eee; color: var(--gris); }
.tag.t-CP { background: #fde7d6; color: #a14a08; } .tag.t-RTT { background: #dcebf8; color: #1f5a8c; } .tag.t-RECUP { background: #dff3e7; color: #1f6b43; } .tag.t-ABS { background: #efe3f6; color: #6c2f87; }
.count { background: var(--orange); color: #fff; border-radius: 20px; padding: 1px 10px; font-size: 1rem; vertical-align: middle; }
.demande .dem-head { display: flex; justify-content: space-between; gap: 16px; } .big { font-size: 1.1rem; }
.soldebox { background: var(--gris-l); padding: 10px 14px; border-radius: 8px; white-space: nowrap; font-size: .9rem; }
.decide { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; } .decide label { display: flex; align-items: center; gap: 6px; }
.w80 { width: 80px; } .grow { flex: 1; min-width: 180px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; } .filters select, .filters input { width: auto; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; margin-bottom: 12px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; border: 1px solid #ddd; }
.planning { border-collapse: collapse; font-size: .75rem; }
.planning th, .planning td { border: 1px solid #eee; min-width: 26px; height: 28px; text-align: center; padding: 2px; }
.planning th.who { text-align: left; white-space: nowrap; padding-right: 10px; font-size: .85rem; min-width: 110px; position: sticky; left: 0; background: #fff; }
.planning thead th { color: var(--muted); font-weight: 500; } .planning th.today { background: var(--orange); color: #fff; }
.we { background: #f1f1f1; }
.t-CP { background: var(--cp); } .t-RTT { background: var(--rtt); } .t-RECUP { background: var(--recup); } .t-ABS { background: var(--abs); }
td.pending, i.pending { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.65) 0 4px, transparent 4px 8px); }
i.pending { background-color: #999; }
/* Fiche */
.fiche { background: #fff; border: 1px solid var(--bord); padding: 32px; max-width: 800px; margin: 0 auto; }
.fiche-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--orange); padding-bottom: 14px; margin-bottom: 18px; }
.fiche-titre { font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; color: var(--gris); }
.fiche-kv th { width: 45%; } .fiche-nature { margin: 20px 0; line-height: 2; } .motif { background: var(--gris-l); padding: 8px 12px; border-radius: 6px; line-height: 1.4; }
.fiche-bas { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 30px; }
.sign { border: 1px solid var(--bord); padding: 12px 18px; min-width: 260px; line-height: 1.8; } .signataire { font-family: "Brush Script MT", cursive; font-size: 1.5rem; min-height: 40px; }
@media (max-width: 800px) {
  .grid2, .cards3, .row3, .row4 { grid-template-columns: 1fr; } .topbar { height: auto; padding: 10px; } .topbar nav { flex-wrap: wrap; }
  .demande .dem-head { flex-direction: column; }
}
@media print {
  .no-print, .topbar { display: none !important; } body { background: #fff; } .wrap { padding: 0; } .fiche { border: 0; }
}
