/* images.zerious.be : identite propre, distincte des autres outils zerious (IBM Plex Sans, palette bleu-vert) */
:root {
  --bg: #f4f7f7; --surface: #ffffff; --text: #13232a; --muted: #5a6a70; --border: #d9e3e5;
  --accent: #0e6a6a; --accent-text: #ffffff; --ok: #2f7a4f; --warn: #a15c07; --err: #b42318;
  --soft: #e5efef; --soft-strong: #cde0e0;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e191c; --surface: #162326; --text: #e4eef0; --muted: #9db0b5; --border: #25373b;
    --accent: #5cc3be; --accent-text: #0e191c; --ok: #6fcf97; --warn: #f2b35b; --err: #f28b82; color-scheme: dark;
    --soft: #1c2e32; --soft-strong: #27413f;
  }
}
:root[data-theme="dark"] {
  --bg: #0e191c; --surface: #162326; --text: #e4eef0; --muted: #9db0b5; --border: #25373b;
  --accent: #5cc3be; --accent-text: #0e191c; --ok: #6fcf97; --warn: #f2b35b; --err: #f28b82; color-scheme: dark;
  --soft: #1c2e32; --soft-strong: #27413f;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { font-family: "IBM Plex Sans", system-ui, sans-serif; font-weight: 300; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 34px; margin: 8px 0 6px; }
h2 { font-size: 24px; margin: 32px 0 12px; }
h3 { font-size: 18px; margin: 0 0 8px; font-weight: 400; }
a { color: var(--accent); }
main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.brand { font-family: "IBM Plex Sans", system-ui, sans-serif; font-weight: 500; font-size: 19px; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
.brand span { color: var(--muted); font-weight: 300; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--soft); }
.nav a.active { color: var(--text); background: var(--soft); }
.user-box { display: flex; align-items: center; gap: 10px; font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stat { font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 28px; font-weight: 300; }

button, .btn { font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: currentColor; }
.pill.warn { color: var(--warn); border-color: currentColor; }
.pill.err { color: var(--err); border-color: currentColor; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.empty { color: var(--muted); padding: 12px 0; }

.module { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.module p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.doc { max-width: 760px; }
.doc p, .doc li { line-height: 1.65; }
.doc code, .doc pre { font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }
.doc pre { background: var(--soft); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.doc .toc { font-size: 14px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { max-width: 400px; width: 100%; padding: 32px; }
.doc .toc a { display: inline-block; margin: 2px 14px 2px 0; }

input[type=text], input[type=email], input[type=search], input[type=password], textarea { font: inherit; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
textarea { width: 100%; min-height: 90px; }
label.field { display: grid; gap: 4px; margin-bottom: 12px; font-size: 14px; font-weight: 500; }
label.field input, label.field textarea { font-weight: 400; }
.help { font-size: 13px; color: var(--muted); font-weight: 400; }
.notice { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 10px 0; border: 1px solid var(--border); }
.notice.err { color: var(--err); border-color: currentColor; }
.notice.ok { color: var(--ok); border-color: currentColor; }
.todo { border-left: 3px solid var(--warn); padding: 8px 12px; background: var(--soft); border-radius: 0 8px 8px 0; margin: 10px 0; font-size: 14px; }
.topbar-inner { max-width: 1400px; }
@media (max-width: 760px) {
  .topbar-inner { gap: 10px; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .user-box > .muted { display: none; }
}

/* ---------- Projets ---------- */
input[type=url], input[type=file] { font: inherit; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 16px; }
.form-grid label.field input, .form-grid label.field select, .form-grid label.field textarea { width: 100%; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 6px 0; }
.section-help { margin: -4px 0 12px; font-size: 13px; color: var(--muted); }
.refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ref { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ref img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); }
.ref .body { padding: 8px 10px; display: grid; gap: 6px; font-size: 13px; }
.ref textarea { min-height: 60px; font-size: 13px; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--border); padding: 10px 0; margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
table input[type=text] { width: 100%; min-width: 120px; }
.form-grid label.field { align-content: start; }
