/* Base : polices, variables, éléments de formulaire. Libron partout (seuls Regular, Italic, Bold, BoldItalic existent). */
@font-face { font-family: "Libron"; src: url("../fonts/Libron-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libron"; src: url("../fonts/Libron-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libron"; src: url("../fonts/Libron-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Libron"; src: url("../fonts/Libron-BoldItalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --font: "Libron", Georgia, "Times New Roman", serif;
  --bg: #f5f4f0; --panel: #ffffff; --panel2: #faf9f6; --ink: #1f2328; --muted: #5f6670; --line: #e3e0d8;
  --accent: #3f5f86; --accent-ink: #ffffff; --soft: rgba(63, 95, 134, .08); --soft2: rgba(63, 95, 134, .16);
  --shadow: 0 1px 2px rgba(20, 24, 30, .05), 0 8px 24px rgba(20, 24, 30, .06);
  --c-business: #4f6b88; --c-symbolisme: #a37a22; --c-master: #5f8564; --c-personnel: #a98a5c; --c-defaut: #7a8088;
  --ok: #4d7f5a; --wait: #8f6a1f; --stop: #6b727c; --danger: #a4412f; --danger-soft: rgba(164, 65, 47, .09);
  --r: 12px; --r-s: 8px; --t: 160ms ease;
  --sw: 248px; --cw: 392px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
html[data-theme="dark"] {
  --bg: #13161a; --panel: #1a1e23; --panel2: #1f242a; --ink: #e8e6e1; --muted: #a0a8b2; --line: #2b3138;
  --accent: #8fb0d8; --accent-ink: #10161d; --soft: rgba(143, 176, 216, .10); --soft2: rgba(143, 176, 216, .20);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --c-business: #7c9bbd; --c-symbolisme: #d4a94a; --c-master: #93b597; --c-personnel: #d2b88f; --c-defaut: #98a0aa;
  --ok: #7fb48c; --wait: #d0a655; --stop: #8e969f; --danger: #e08a78; --danger-soft: rgba(224, 138, 120, .12);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #13161a; --panel: #1a1e23; --panel2: #1f242a; --ink: #e8e6e1; --muted: #a0a8b2; --line: #2b3138;
    --accent: #8fb0d8; --accent-ink: #10161d; --soft: rgba(143, 176, 216, .10); --soft2: rgba(143, 176, 216, .20);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    --c-business: #7c9bbd; --c-symbolisme: #d4a94a; --c-master: #93b597; --c-personnel: #d2b88f; --c-defaut: #98a0aa;
    --ok: #7fb48c; --wait: #d0a655; --stop: #8e969f; --danger: #e08a78; --danger-soft: rgba(224, 138, 120, .12);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; font-weight: 700; }
h2 { font-size: 1.1rem; line-height: 1.3; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem .8rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .45rem .95rem;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--panel); color: var(--ink); line-height: 1.2;
  transition: background var(--t), border-color var(--t);
}
.btn:hover { background: var(--panel2); border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-small { min-height: 36px; padding: .25rem .65rem; font-size: .9rem; }
.btn[aria-pressed="true"] { background: var(--soft2); border-color: var(--accent); color: var(--ink); font-weight: 700; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-s); color: var(--ink); }
.icon-btn:hover { background: var(--soft); }

/* Formulaires */
label { display: block; font-size: .92rem; margin-bottom: .25rem; color: var(--muted); }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--panel); color: var(--ink);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field { margin-bottom: .9rem; }

/* Interrupteur */
.switch { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; cursor: pointer; color: var(--ink); font-size: 1rem; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.switch .track { width: 44px; height: 26px; border-radius: 13px; background: var(--stop); position: relative; flex: none; transition: background var(--t); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--t); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
