/* Dashboard micro : direction « fintech épurée ».
   Couleurs en variables, thème clair ou sombre selon le système. */

@font-face {
  font-family: "Inter";
  src: url("inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --text: #0f1729;
  --muted: #536071;
  --faint: #667180;
  --border: #e2e6eb;
  --accent: #0b6e69;
  --accent-strong: #075450;
  --accent-soft: #e0f0ee;
  --on-accent: #ffffff;
  --hero-a: #0b6e69;
  --hero-b: #0a4b5a;
  --adv-a: #a8520e;
  --adv-b: #7a3a0a;
  --ok: #11693f;
  --ok-soft: #e2f3e9;
  --warn: #a8520e;
  --warn-soft: #fbf0e2;
  --danger: #b42318;
  --danger-soft: #fdecea;
  /* Séries des graphiques : validées (daltonisme, contraste) avec le skill dataviz. */
  --c1: #00897b;
  --c2: #d95926;
  --c3: #2a78d6;
  --c4: #c98500;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(15 23 41 / 0.04), 0 4px 12px rgb(15 23 41 / 0.04);
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e13;
    --surface: #121920;
    --surface-2: #19222b;
    --text: #e7edf3;
    --muted: #9ba6b4;
    --faint: #808b9a;
    --border: #232e3a;
    --accent: #3db3a9;
    --accent-strong: #6fd0c6;
    --accent-soft: #10302d;
    --on-accent: #04201d;
    --hero-a: #0f5c57;
    --hero-b: #0b3d48;
    --adv-a: #8a4510;
    --adv-b: #5e2f0b;
    --ok: #4cc38a;
    --ok-soft: #0f2a1d;
    --warn: #f0a24a;
    --warn-soft: #33230f;
    --danger: #f87067;
    --danger-soft: #3a1513;
    --c1: #199e8f;
    --c2: #d95926;
    --c3: #3987e5;
    --c4: #c98500;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 1rem; font-weight: 600; }
p { margin: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--warn); }
.icon { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Mise en page ----------------------------------------------------- */
.main {
  display: grid; gap: 16px; align-content: start;
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
}
.sidebar { display: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}
.tabbar a { display: grid; justify-items: center; gap: 2px; min-height: 44px; padding: 8px 0; color: var(--muted); font-size: 0.7rem; font-weight: 500; }
.tabbar a.active { color: var(--accent); }
.tab-add {
  justify-self: center; display: grid; place-items: center;
  width: 54px; height: 54px; margin-top: -20px; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tab-add .icon { width: 26px; height: 26px; }

@media (min-width: 900px) {
  body { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .tabbar { display: none; }
  .sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column; gap: 2px;
    padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--border);
  }
  .main { padding: 32px 40px 48px; }
}
.brand { padding: 4px 12px 20px; color: var(--text); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; }
.brand span { color: var(--accent); }
.sidebar > .btn { margin-bottom: 16px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }

/* --- Connexion -------------------------------------------------------- */
.login { grid-column: 1 / -1; max-width: 400px; min-height: 100dvh; align-content: center; gap: 24px; }
.login .brand { padding: 0; font-size: 2.25rem; text-align: center; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-strong); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow { margin-bottom: 2px; color: var(--muted); font-size: 0.85rem; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; color: var(--muted); font-size: 0.9rem; }
.back .icon { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 899px) {
  .page-head > .actions { width: 100%; }
  .page-head > .actions .btn { flex: 1; }
}

/* --- Cartes et indicateurs ------------------------------------------- */
.card { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.narrow { width: 100%; max-width: 560px; }
.grid { display: grid; gap: 12px; }
.duo, .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kpi-label { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.kpi-value { margin: 6px 0 2px; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; }
.kpi-sub { color: var(--faint); font-size: 0.78rem; }
.kpi.accent { background: var(--accent-soft); border-color: transparent; }
a.card { color: inherit; }
a.card:hover { border-color: var(--accent); }

.hero { padding: 22px; border: 0; color: #fff; background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); }
.hero-advance { background: linear-gradient(135deg, var(--adv-a), var(--adv-b)); }
.hero-label { font-weight: 500; opacity: 0.85; }
.hero-amount { margin: 4px 0 6px; font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.035em; }
.hero-sub { max-width: 52ch; font-size: 0.9rem; opacity: 0.85; }
.hero-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 0.2); }
.hero-meta { position: relative; }
.hero-meta dt { color: rgb(255 255 255 / 0.8); font-size: 0.75rem; }
.hero-meta dd { margin: 0; font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero .btn-on-hero { margin-top: 16px; }
.hero :focus-visible { outline-color: #fff; }

/* Info-bulle : survol sur ordinateur, toucher ou clavier (focus) sur mobile. Ancrée à la ligne sur mobile. */
.tip { display: inline-flex; align-items: center; gap: 4px; cursor: help; border-radius: 6px; }
.tip .icon { width: 14px; height: 14px; }
.tip-text {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; display: none;
  padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--text);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); font-size: 0.82rem; font-weight: 400; line-height: 1.45; white-space: normal;
}
.tip:hover .tip-text, .tip:focus .tip-text, .tip:focus-within .tip-text { display: grid; gap: 6px; }
.tip-title { color: var(--muted); }
.tip-line { display: flex; justify-content: space-between; gap: 12px; }
.tip-line .num { font-weight: 600; }
.tip-total { padding-top: 6px; border-top: 1px solid var(--border); font-weight: 650; }
@media (min-width: 900px) {
  .hero-meta > div { position: relative; }
  .tip-text { right: auto; width: 400px; }
}

/* --- Boutons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--surface-2); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-lg { width: 100%; min-height: 52px; font-size: 1rem; }
.btn-sm { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 0.82rem; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-on-hero { background: rgb(255 255 255 / 0.16); border-color: rgb(255 255 255 / 0.32); color: #fff; }
.btn-on-hero:hover { background: rgb(255 255 255 / 0.26); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* --- Formulaires ------------------------------------------------------ */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-label { padding: 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-xl { padding: 8px 12px; font-size: 1.9rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.has-error input { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.8rem; }
.hint { color: var(--faint); font-size: 0.8rem; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; }
.inline input { width: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
.chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; }
.switch input {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 46px; height: 28px; padding: 0; border: 0; border-radius: 999px;
  background: var(--border); cursor: pointer; transition: background 0.15s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.15s;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

.file { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; }
.file:hover, .file:focus-within { border-color: var(--accent); color: var(--accent); }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.km-field { display: none; }
.lines { display: grid; gap: 8px; }
.lines:empty { display: none; }
.line { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.line input, .line select { width: 100%; min-height: 40px; padding: 6px 8px; font-size: 0.85rem; }
.add-line { justify-self: start; padding-left: 4px; white-space: normal; text-align: left; }
.form:has(input[name="category"][value="Frais kilométriques"]:checked) .km-field { display: grid; gap: 6px; }
details summary { color: var(--muted); font-size: 0.85rem; font-weight: 600; cursor: pointer; }
details[open] summary { margin-bottom: 8px; }
.sim > summary { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1rem; }
.sim > summary .icon:last-child { margin-left: auto; transition: rotate 0.15s; }
.sim[open] > summary .icon:last-child { rotate: 90deg; }
.sim > summary + .form { margin-bottom: 16px; }
.sim .notes { margin-top: 16px; }

dialog.sheet {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  margin: auto auto 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  border: 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 40px rgb(0 0 0 / 0.25);
}
dialog.sheet[open] { animation: sheet-up 0.22s ease-out; }
dialog::backdrop { background: rgb(8 12 18 / 0.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
@keyframes sheet-up { from { transform: translateY(32px); opacity: 0; } }
@media (min-width: 900px) { dialog.sheet { margin: auto; padding: 24px; border-radius: 24px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { font-size: 1.15rem; }

/* --- Listes, badges, filtres, onglets -------------------------------- */
.list { padding: 4px 0; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); color: inherit; }
.list-row > .badges { flex-basis: 100%; justify-content: flex-start; }
.list-row > .badges:empty { display: none; }
@media (min-width: 900px) {
  .list-row { flex-wrap: nowrap; }
  .list-row > .badges { flex-basis: auto; order: 1; justify-content: flex-end; }
  .list-row > .list-side { order: 2; min-width: 120px; }
}
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; display: grid; min-width: 0; color: inherit; }
.list-main:hover .list-title, a.list-row:hover .list-title { color: var(--accent); }
.list-title { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { color: var(--muted); font-size: 0.8rem; }
.list-side { display: grid; justify-items: end; gap: 4px; text-align: right; }
.list-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; font-weight: 650; }
.check-row { cursor: pointer; }
.empty { padding: 28px 16px; color: var(--faint); text-align: center; }
.menu-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }

.badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-pending { background: var(--accent-soft); color: var(--accent-strong); }
.badge-action { min-height: 30px; border: 1px solid var(--border); background: var(--surface); color: var(--accent); cursor: pointer; }
.badge-action:hover { border-color: var(--accent); }

.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.filters select, .filters input { width: 100%; min-height: 40px; padding: 6px 10px; font-size: 0.85rem; }
.filters .inline { min-width: 0; }
@media (min-width: 900px) {
  .filters { display: flex; flex-wrap: wrap; }
  .filters select, .filters input { width: auto; }
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { margin-bottom: -1px; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a.on { border-color: var(--accent); color: var(--text); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.segmented a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(15 23 41 / 0.08); }
.period-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.period-nav { display: flex; align-items: center; gap: 4px; }
.period-nav strong { min-width: 96px; text-align: center; }

/* --- Alertes, jauge, déclarations, graphiques, frise ------------------ */
.alerts { display: grid; gap: 8px; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; font-size: 0.88rem; }
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--accent-soft); color: var(--accent-strong); }

.gauge { position: relative; height: 10px; margin: 6px 0 10px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.gauge::after { content: ""; position: absolute; top: 0; bottom: 0; left: 80%; width: 2px; background: var(--surface); }
.gauge span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.gauge span.warn { background: var(--warn); }

.decl { display: grid; gap: 10px; margin: 0; }
.decl div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.decl dt { color: var(--muted); font-size: 0.85rem; }
.decl dd { margin: 0; font-weight: 650; }
.decl .sub { padding-top: 10px; border-top: 1px dashed var(--border); }
.decl .sub dt, .decl .sub dd { color: var(--faint); font-size: 0.8rem; font-weight: 500; }
.decl .total { padding-top: 10px; border-top: 1px solid var(--border); }
.decl .total dt { color: var(--text); font-weight: 650; }
.notes { display: grid; gap: 6px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.82rem; }

.chart { position: relative; height: 260px; }

.timeline { display: grid; margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.timeline strong { display: block; font-size: 0.9rem; font-weight: 600; }
.timeline span { color: var(--muted); font-size: 0.8rem; }
.timeline .late time { color: var(--warn); font-weight: 600; }

/* --- Tableaux (cartes empilées sur mobile avec .stack) ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border); }
td.num, th.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { border-top: 1px solid var(--border); border-bottom: 0; font-weight: 650; }
@media (max-width: 899px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tfoot { display: block; }
  table.stack tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  table.stack td { display: flex; justify-content: space-between; gap: 8px; padding: 0; border: 0; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--faint); font-size: 0.75rem; text-align: left; }
  table.stack td.full { grid-column: 1 / -1; order: -1; font-weight: 600; text-align: left; }
  table.stack td.full::before { content: none; }
  table.stack td:empty { display: none; }
}

/* --- Calendrier ------------------------------------------------------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { padding-bottom: 4px; color: var(--faint); font-size: 0.7rem; font-weight: 600; text-align: center; text-transform: uppercase; }
.cal-day {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0; aspect-ratio: 1; padding: 6px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.cal-day:hover { border-color: var(--accent); }
.cal-day .d { font-size: 0.85rem; font-weight: 600; }
.cal-day .k { overflow: hidden; color: var(--muted); font-size: 0.62rem; text-overflow: ellipsis; white-space: nowrap; }
.cal-day.off { border-color: transparent; background: var(--surface-2); color: var(--faint); }
.cal-day.before { opacity: 0.4; }
.cal-day.absent { border-color: transparent; background: var(--warn-soft); }
.cal-day.absent .k { color: var(--warn); }
.cal-day.absent.half { border-color: var(--border); background: linear-gradient(135deg, var(--warn-soft) 50%, var(--surface) 50%); }
.cal-day.absent.half.aprem { background: linear-gradient(135deg, var(--surface) 50%, var(--warn-soft) 50%); }
.cal-day.worked { border-color: transparent; background: var(--accent-soft); }
.cal-day.worked .k { color: var(--accent-strong); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; color: var(--muted); font-size: 0.78rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.legend .absent { background: var(--warn-soft); }
.legend .worked { background: var(--accent-soft); }
.legend .off { background: var(--surface-2); }

/* --- Paramètres ------------------------------------------------------- */
.param { display: grid; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.param:last-child { border-bottom: 0; }
.param-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.param-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.param-form > input, .param-form > select { flex: 1 1 140px; width: auto; }
.history { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.82rem; }
.history li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
