:root {
  --bg: #f5f3ef; --card: #ffffff; --ink: #1c1c1e; --muted: #6b6b70; --line: #e6e2dc;
  --accent: #f07c1c; --accent-soft: #fdeede; --night: #16161a;
  --vert: #1f8a4c; --bleu: #2563eb; --rouge: #c62828; --violet: #6d28d9; --orange: #c2570c; --gris: #7a7a80;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
header.app { background: var(--night); color: #fff; position: sticky; top: 0; z-index: 10; }
.top { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .02em; font-size: 17px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(240,124,28,.25); }
.brand small { font-weight: 500; color: #a9a9b0; margin-left: 4px; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a { color: #d6d6db; text-decoration: none; font-weight: 600; font-size: 14px; padding: 7px 11px; border-radius: 8px; }
nav.main a:hover, nav.main a.on { color: #fff; background: #2a2a30; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #b9b9c0; }
.who a { color: #d6d6db; text-decoration: none; }
.who button { background: none; border: 1px solid #3a3a40; color: #c9c9cf; border-radius: 8px; padding: 5px 10px; font: inherit; cursor: pointer; }
.bandeau-admin { background: #6d28d9; color: #fff; font-size: 14px; }
.bandeau-admin .top { padding: 6px 20px; }
.bandeau-admin button { background: #fff; color: #6d28d9; border: 0; border-radius: 7px; padding: 3px 10px; font: inherit; font-weight: 700; cursor: pointer; }
main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 17px; margin: 0 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
label.chk { font-weight: 500; color: var(--ink); display: flex; gap: 8px; align-items: flex-start; margin: 7px 0; font-size: 14px; }
label.chk input { margin-top: 3px; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; color: var(--ink); }
textarea { min-height: 170px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink);
       padding: 9px 15px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #cfc8bf; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.96); }
.btn.dark { background: var(--night); border-color: var(--night); color: #fff; }
.btn.big { padding: 14px 22px; font-size: 16px; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--rouge); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; } .end { justify-content: flex-end; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-gris { background: #eeeeef; color: var(--gris); } .b-bleu { background: #e3ecfe; color: var(--bleu); }
.b-vert { background: #e2f4e9; color: var(--vert); } .b-orange { background: #fdeede; color: var(--orange); }
.b-rouge { background: #fde7e7; color: var(--rouge); } .b-violet { background: #efe7fd; color: var(--violet); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr.clic { cursor: pointer; }
tr.clic:hover td { background: #faf9f7; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #eee9e2; border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.bar.bleu > div { background: var(--bleu); }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: #7a3a06; margin-bottom: 14px; }
.notice.erreur { background: #fde7e7; color: var(--rouge); } .notice.ok { background: #e2f4e9; color: var(--vert); }
.notice.info { background: #e3ecfe; color: #1e3a8a; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; background: #fff; border: 1px solid var(--line); }
.tabs a.on { background: var(--night); color: #fff; border-color: var(--night); }
.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1c1c1e; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 40; max-width: 90vw; }
footer.app { text-align: center; color: var(--muted); font-size: 12px; padding: 0 20px 30px; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid #ddd; border-top-color: var(--accent); border-radius: 50%; animation: s 1s linear infinite; vertical-align: -3px; }
@keyframes s { to { transform: rotate(360deg); } }
.vide { text-align: center; padding: 34px 10px; color: var(--muted); }

/* pages de connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
        background: radial-gradient(1200px 600px at 80% -10%, #3a2414 0%, transparent 60%), var(--night); }
.auth .card { width: 100%; max-width: 420px; padding: 28px 26px; }
.auth .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; margin-bottom: 18px; }
.auth .logo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(240,124,28,.2); }
.auth form > div { margin-bottom: 14px; }
.auth .btn.primary { width: 100%; padding: 12px; font-size: 16px; }
.auth .pied { text-align: center; margin-top: 16px; font-size: 14px; }
