:root {
  --bg: #f5f6f8; --surface: #ffffff; --ink: #16202c; --muted: #5d6b7a;
  --line: #dde2e8; --accent: #8b0a0a; --accent-ink: #ffffff; --accent-soft: #f6e9e9;
  --ok: #1d7a46; --error: #b3261e; --demo: #8a5a00; --demo-bg: #fff4dc;
  --radius: 10px;
  --free: #8fd6a6; --busy: #ef9a9a; --off: #ffffff; --booked: #9bb7e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c; --surface: #1a2129; --ink: #e8edf2; --muted: #9aa8b6;
    --line: #2c3540; --accent: #ef6b6b; --accent-ink: #1a0606; --accent-soft: #3a1d1f;
    --ok: #6fd19a; --error: #ff8a80; --demo: #ffcf70; --demo-bg: #3a2e14;
    --free: #2e7048; --busy: #84302f; --off: #1a2129; --booked: #36548a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center;
  max-width: 960px; margin: 0 auto; padding: 16px; }
.brand img { display: block; height: 40px; width: auto; }
.lang, a { color: var(--accent); }
.tag { font-size: 14px; color: var(--muted); }
main.card { max-width: 640px; margin: 0 auto 40px; }
main.wide { max-width: 960px; margin: 0 auto 40px; padding: 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 20px; }
main.card { margin-left: 16px; margin-right: 16px; }
@media (min-width: 672px) { main.card { margin-left: auto; margin-right: auto; } }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.card > h2:first-child { margin-top: 0; }
.email { color: var(--muted); margin: 2px 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 18px; }
.chips, .times { display: flex; flex-wrap: wrap; gap: 8px; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); padding: 8px 14px; }
button:hover { border-color: var(--accent); }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:disabled { opacity: .6; cursor: wait; }
button.danger { background: var(--error); color: #fff; border-color: var(--error); }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
.danger-text { color: var(--error) !important; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.days button { min-width: 74px; display: flex; flex-direction: column; align-items: center; padding: 8px 10px; }
.days .dow { font-size: 13px; text-transform: capitalize; }
.days .dnum { font-size: 20px; font-weight: 600; }
.days .mon { font-size: 12px; }
.times button { min-width: 84px; }
.summary { background: var(--accent-soft); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.notice { background: var(--accent-soft); border-radius: 8px; padding: 4px 16px; }
.error { color: var(--error); }
.ok { color: var(--ok); }
.flash { padding: 10px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.flash.demo { background: var(--demo-bg); color: var(--demo); border-color: transparent; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tr.highlight { background: var(--accent-soft); }
tr.dim { opacity: .55; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row label.grow { flex: 1 1 320px; }
.row label.grow input { width: 100%; }
/* Collègues à inviter aussi (formulaire « Inviter quelqu'un ») */
.with-team { display: flex; flex-wrap: wrap; gap: 4px 12px; border: 0; margin: 0; padding: 0; }
.with-team legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.with-team label { flex-direction: row; align-items: center; gap: 4px; color: var(--ink); padding: 7px 0; }
label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); gap: 4px; }
input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; }
/* Champ de mot de passe avec son œil (static/motdepasse.js) ; l'œil d'Edge est caché pour ne pas en avoir deux */
.pw { position: relative; display: flex; }
.pw input { flex: 1 1 auto; min-width: 0; padding-right: 38px; }
.pw input::-ms-reveal { display: none; }
.pw-oeil { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex;
  background: none; border: none; padding: 4px; color: var(--muted); }
.pw-oeil:hover { color: var(--accent); }
.copy { display: flex; gap: 6px; }
.copy input { min-width: 0; flex: 1; font-size: 14px; }
code { font-size: 14px; }
@media (max-width: 640px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: none; padding: 4px 0; }
}
.who { display: flex; flex-wrap: wrap; gap: 12px; }
.person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 220px; padding: 14px 16px; text-align: left; }
.person.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.place { font-weight: 600; margin-top: -4px; }
.pending-row { background: var(--demo-bg); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.wait { background: var(--demo-bg); color: var(--demo); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-nav { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: flex-end; }
.account-nav form { display: inline; }
.account-nav button.link { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.passkey-box { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
details form { margin-top: 8px; }

/* Journal RS&DE */
textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; width: 100%; resize: vertical; min-height: 76px; }
.entry-form { display: flex; flex-direction: column; gap: 12px; }
.entry-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.entry-fields label.grow { flex: 1 1 240px; }
.entry-fields label.grow select { width: 100%; }
.hours-input { width: 6.5em; }
.entry-fields input, .entry-fields select, .filters input, .filters select { height: 40px; }
.actions .button-link { align-self: center; }
.delete-form { margin-top: 12px; }
.filters { margin-bottom: 6px; }
.quick { margin: 6px 0 4px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.journal .desc { overflow-wrap: anywhere; min-width: 260px; }
.journal .text { white-space: pre-line; }
.journal tr.new-day td { border-top: 2px solid var(--line); }
tfoot td { font-weight: 600; border-bottom: none; border-top: 2px solid var(--line); }
.versions { margin-top: 4px; }
.versions summary { cursor: pointer; }
.versions ul { margin: 6px 0 0; padding-left: 18px; }
.versions li { margin-bottom: 6px; }
/* Approbation des heures */
.badge.status-pending, .badge.status-changed { background: var(--demo-bg); color: var(--demo); }
.badge.status-approved { background: transparent; color: var(--ok); border: 1px solid currentColor; }
.badge.status-refused { background: var(--error); color: #fff; }
.before { margin-top: 4px; }
.before s, .journal td.num s { color: var(--muted); }
.entry-actions form, .entry-actions details { margin-top: 6px; }
.entry-actions button { padding: 3px 10px; }
.entry-actions details form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; min-width: 200px; }
.entry-actions summary { cursor: pointer; }
.approve-all { justify-content: space-between; align-items: center; background: var(--demo-bg);
  border-radius: 8px; padding: 8px 12px; margin-top: 10px; }
.approve-all p { margin: 0; color: var(--demo); }
.table-wrap { overflow-x: auto; }
.totals td, .totals th { white-space: nowrap; }
.flash.error { color: var(--error); }
.flash.ok { color: var(--ok); }
@media (max-width: 640px) {
  .journal .desc { min-width: 0; }
  .journal td.num::before { content: "Heures : "; color: var(--muted); }
  .journal tfoot td.num::before { content: ""; }
  .totals, .totals thead, .totals tbody, .totals tr, .totals th, .totals td { display: revert; }
  .totals thead { display: table-header-group; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 8px; }
  .account-nav { justify-content: flex-start; }
  .journal td.num { text-align: left; }
  .journal td.nowrap { white-space: normal; }
  .entry-fields > label { flex: 1 1 140px; }
  .entry-fields input, .entry-fields select { width: 100%; }
}
/* Rappels par courriel (« Mon compte ») */
.reminders { margin-bottom: 16px; }
.reminder-form { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.reminder-form .with-team label { padding: 4px 0; }
.pause-form { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; align-items: center; }
.pause-form p { margin: 0; flex: 1 1 320px; }
@media (max-width: 640px) { .reminders td.num { text-align: left; } }
