/* Écrin — feuille de style. Codes « Maison » : noir profond, ivoire, platine, or champagne. */
:root {
  --ink: #0b0b0c;
  --ink-2: #1a1a1d;
  --ivory: #f6f4ef;
  --paper: #ffffff;
  --platinum: #c9ccd1;
  --gold: #85672f; /* contraste AA (≥ 4,5:1) sur ivoire */
  --gold-soft: #b39a6b;
  --wine: #7a1f2b;
  --green: #2f6b4f;

  --bg: var(--ivory);
  --surface: var(--paper);
  --surface-2: #faf9f6;
  --text: #16161a;
  --muted: #6b6b72;
  --line: #e4e1da;
  --line-strong: #cfcac0;
  --accent: var(--gold);
  --focus: #8a6d3b;
  --danger: var(--wine);
  --shadow: 0 1px 2px rgba(11, 11, 12, .04), 0 8px 24px rgba(11, 11, 12, .06);

  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --display: 'Josefin Sans', 'Futura', 'Century Gothic', var(--sans-fallback);
  --script: 'Nothing You Could Do', 'Segoe Script', cursive;
  --sans-fallback: system-ui, sans-serif;
  --sans: 'Jost', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --radius: 4px;
  --sidebar: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --surface: #17171a;
    --surface-2: #1d1d21;
    --text: #ece9e2;
    --muted: #a19f99;
    --line: #2a2a2f;
    --line-strong: #3a3a40;
    --accent: #c8ad78;
    --focus: #d9bf8a;
    --danger: #d06070;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ── Structure ─────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--ink); color: #e9e6df;
  display: flex; flex-direction: column; padding: 28px 18px 22px;
  border-right: 1px solid #000;
}
/* Bloc de marque inspiré de la couverture « Inspire Writing » : emblème cerclé, capitales grasses, signature. */
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 24px; border-bottom: 1px solid #26262a; text-align: center; }
.brand-mark { color: #fff; display: inline-flex; }
.brand-mark .icon { stroke-width: 1.1; }
.brand-text { display: flex; flex-direction: column; align-items: center; }
.brand-name { display: block; font: 700 23px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; color: #fff; padding-top: 4px; }
.brand-script { display: block; font: 400 22px/1 var(--script); color: #e9e6df; margin-top: 6px; transform: rotate(-3deg); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 22px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  text-decoration: none; color: #b9b5ac; font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  border-left: 2px solid transparent; transition: color .15s, background .15s, border-color .15s;
}
.nav a:hover { color: #fff; background: #151517; }
.nav a[aria-current='page'] { color: #fff; border-left-color: var(--gold-soft); background: #151517; }
.nav a[aria-current='page'] .icon { color: var(--gold-soft); }
.sidebar-foot { margin-top: auto; padding: 0 12px; font: italic 15px/1.4 var(--serif); color: #7d7a73; }

.view { padding: 40px clamp(16px, 4vw, 56px) 80px; outline: none; min-width: 0; }
.page { max-width: 1240px; margin: 0 auto; animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Typographie ───────────────────────────────────────────────────────── */
.eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.page-title { margin: 0; font: 700 clamp(26px, 3.4vw, 40px)/1.12 var(--display); letter-spacing: .02em; text-transform: uppercase; padding-top: .12em; }
.script { font-family: var(--script); font-weight: 400; letter-spacing: 0; text-transform: none; }
.lead { margin: 10px 0 0; color: var(--muted); font-size: 16px; max-width: 62ch; }
h2, h3 { font-weight: 500; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.page-head .eyebrow { text-transform: uppercase; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 42px; padding: 0 20px; border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2a2a2e; }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--ivory); color: var(--ink); } .btn-primary:hover { background: #fff; } }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-glass { background: rgba(11, 11, 12, .62); color: #fff; backdrop-filter: blur(8px); border-color: rgba(255, 255, 255, .18); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn.glass { background: rgba(11, 11, 12, .62); color: #fff; }
.link { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ── Cartes & grilles ──────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font: 600 21px/1.2 var(--display); }
.card-head h2 .icon { color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-bottom: 22px; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 22px; border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--surface); padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-icon { color: var(--accent); margin-bottom: 8px; }
.kpi-label { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font: 600 32px/1.15 var(--display); font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.kpi-money { display: flex; flex-direction: column; font-size: clamp(18px, 2.1vw, 30px); }
.kpi-money .money { white-space: nowrap; }
.kpi-foot { font-size: 12.5px; color: var(--muted); }

.featured { display: grid; grid-template-columns: 180px 1fr; gap: 22px; padding: 0; overflow: hidden; }
.featured-photo { display: block; background: #fff; }
.featured-body { padding: 22px 22px 22px 0; min-width: 0; }
.featured-title { margin: 0 0 4px; font: 600 28px/1.1 var(--display); }
.featured-title a { text-decoration: none; }
.mini-stats { display: flex; gap: 22px; margin: 16px 0 12px; }
.mini-stats div { min-width: 0; }
.mini-stats dt { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.mini-stats dd { margin: 2px 0 0; font: 600 20px/1.2 var(--display); }
.compact-link { display: flex; align-items: center; gap: 8px; font: 600 21px/1.2 var(--display); text-decoration: none; }
.compact-link .icon { color: var(--accent); }
.compact p { margin: 4px 0 0; }

/* barres */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 32px; align-items: center; gap: 12px; font-size: 13.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--ink), var(--accent)); }
@media (prefers-color-scheme: dark) { .bar-fill { background: linear-gradient(90deg, #6d6450, var(--accent)); } }
.bar-count { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* frise */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl-item { position: relative; display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-strong); color: var(--accent); z-index: 1; }
.tl-item[data-kind='signature'] .tl-dot { background: var(--ink); color: var(--gold-soft); border-color: var(--ink); }
.tl-item[data-kind='souvenir'] .tl-dot { border-color: var(--accent); }
.tl-body { min-width: 0; padding-top: 3px; }
.tl-meta { margin: 0; font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.tl-title { margin: 2px 0 2px; font: 600 18px/1.3 var(--display); overflow-wrap: anywhere; }
.tl-notes { margin: 4px 0 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.tl-pen { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.tl-pen:hover { text-decoration: underline; }
.timeline-wide .tl-item { padding-bottom: 22px; }

/* ── Collection ────────────────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--muted); }
.search:focus-within { border-color: var(--text); }
.search input { flex: 1; border: 0; background: transparent; min-height: 44px; outline: none; min-width: 0; }
.filter select, .field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.filter select { min-width: 160px; }
.field textarea { padding: 10px 12px; resize: vertical; min-height: 96px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .filter select:focus { border-color: var(--text); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.result-count { margin: 0 0 16px; font-size: 13px; letter-spacing: .08em; }

.pen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.pen-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.pen-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.pen-card-link { display: block; text-decoration: none; height: 100%; }
.pen-card-photo { position: relative; aspect-ratio: 1 / 1; background: #fff; overflow: hidden; }
.pen-card-body { padding: 18px 18px 16px; }
.pen-card-title { margin: 0 0 4px; font: 600 22px/1.15 var(--display); overflow-wrap: anywhere; }
.pen-card-body .muted { margin: 0; font-size: 13px; }
.pen-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pen-card-foot .stars { margin-left: auto; }
.badge { position: absolute; top: 12px; left: 12px; background: rgba(11, 11, 12, .7); color: #fff; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; padding: 5px 9px; backdrop-filter: blur(6px); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-gold { color: var(--accent); }

/* Photo affichée INTÉGRALEMENT, telle que chargée (jamais recadrée), sur fond blanc. */
.photo { width: 100%; height: 100%; object-fit: contain; padding: 4%; background: #fff; }
.photo.photo-empty { padding: 0; }
.photo-empty {
  display: grid; place-items: center; color: #8d8a83;
  background: radial-gradient(circle at 50% 35%, #2a2a2e 0%, #0b0b0c 70%);
}
.photo-empty .icon { stroke-width: 1; color: var(--gold-soft); opacity: .8; }
.photo-feature { aspect-ratio: 1; min-height: 100%; }
.photo-thumb { width: 88px; height: 88px; }

.stars { display: inline-flex; gap: 2px; color: var(--accent); }
.stars .off { color: var(--line-strong); }
.stars .on path { fill: currentColor; }

/* ── Fiche ─────────────────────────────────────────────────────────────── */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--muted); margin-bottom: 18px; }
.back:hover { color: var(--text); }
.notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; border: 1px solid var(--line-strong); background: var(--surface-2); border-left: 3px solid var(--accent); }
.notice span { flex: 1; min-width: 200px; }
.pen-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; margin-bottom: 28px; align-items: start; }
.hero-photo { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; max-height: 78vh; }
.photo-hero { position: absolute; inset: 0; }
.photo-actions { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; }
.hero-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; justify-content: center; }
.hero-body .page-title { overflow-wrap: anywhere; }
.hero-body .lead { margin: 0; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; padding: 4px 10px; border: 1px solid var(--line-strong); font-size: 12px; letter-spacing: .06em; border-radius: 2px; }
.tag-gold { border-color: var(--accent); color: var(--accent); margin-left: 8px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; padding: 2px 6px; }
.status { padding: 4px 10px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; background: var(--ink); color: #fff; border-radius: 2px; }
.status-en_reserve { background: #4a4a50; }
.status-en_revision { background: var(--accent); }
.status-cede { background: var(--wine); }
@media (prefers-color-scheme: dark) { .status { background: var(--ivory); color: var(--ink); } }
.hero-value { display: flex; gap: 36px; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-value > div { display: flex; flex-direction: column; gap: 2px; }
.hero-amount { font: 600 34px/1.1 var(--display); font-variant-numeric: lining-nums tabular-nums; }
.hero-amount.secondary { color: var(--muted); font-size: 26px; }
.delta { font-size: 12.5px; font-weight: 500; }
.delta.up { color: var(--green); }
.delta.down { color: var(--danger); }
@media (prefers-color-scheme: dark) { .delta.up { color: #6fbf93; } }
.history-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.history-strip div { background: var(--surface); padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.history-strip .icon { color: var(--accent); }
.history-strip strong { font: 600 24px/1.1 var(--display); }
.history-strip span { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.specs { margin: 0; display: grid; gap: 0; }
.spec { display: grid; grid-template-columns: minmax(110px, 42%) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.spec:last-child { border-bottom: 0; }
.spec dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.spec dd { margin: 0; overflow-wrap: anywhere; }
.prose h3 { margin: 18px 0 4px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); }
.prose p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.appreciation { margin: 14px 0 0; padding: 0 0 0 16px; border-left: 2px solid var(--accent); font: italic 19px/1.5 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }

.dossier { padding: 0; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 16px 20px; border: 0; background: none; cursor: pointer;
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent); }
.tab[aria-selected='true'] .icon { color: var(--accent); }
.tab-count { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); letter-spacing: 0; }
.tab-panel { padding: 24px; outline: none; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.row-actions { display: flex; gap: 4px; align-items: flex-start; flex-wrap: wrap; }

.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.act { display: grid; grid-template-columns: 112px 1fr auto; gap: 18px; padding: 18px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.act-date { border-right: 1px solid var(--line); padding-right: 14px; }
.act-day { font: 600 17px/1.25 var(--display); }
.act-body { min-width: 0; }
.act-body h3 { margin: 0 0 6px; font: 600 22px/1.2 var(--display); overflow-wrap: anywhere; }
.act-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0; color: var(--muted); font-size: 13.5px; }
.act-meta .icon { margin-right: -8px; }
.act blockquote { margin: 12px 0 0; padding-left: 14px; border-left: 2px solid var(--accent); font: italic 17px/1.5 var(--serif); white-space: pre-line; overflow-wrap: anywhere; }
.act-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; align-items: center; }
.file-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); text-decoration: none; margin-top: 10px; }
.act-links .file-link { margin-top: 0; }
.file-link:hover { text-decoration: underline; }
.year-block { margin-bottom: 30px; }
.year { margin: 0 0 14px; font: 600 34px/1 var(--display); color: var(--accent); display: flex; align-items: center; gap: 16px; }
.year::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.table tr.current td { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }

.docs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.doc { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-rows: auto 1fr; position: relative; background: var(--surface); }
.doc > .icon-btn { position: absolute; top: 8px; right: 8px; background: var(--surface); }
.doc-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); color: var(--accent); text-decoration: none; overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.doc-thumb.pdf { gap: 4px; align-content: center; font-size: 11px; letter-spacing: .2em; }
.doc-body { padding: 12px 14px; }
.doc-body p { margin: 0; overflow-wrap: anywhere; }

.archive-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.archive-row { display: grid; grid-template-columns: 88px 1fr auto; gap: 18px; align-items: center; padding: 14px; }
.archive-photo { display: block; width: 88px; height: 88px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.archive-body h3 { margin: 0; font: 600 22px/1.2 var(--display); }
.archive-body h3 a { text-decoration: none; }
.archive-body p { margin: 2px 0 0; }

.feature-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.feature-card h2 { margin: 6px 0 0; font: 600 26px/1.2 var(--display); }
.feature-card p { margin: 0 0 8px; }
.feature-icon { width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); }

.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); grid-column: 1 / -1; }
.empty-icon { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); margin-bottom: 14px; }
.empty-icon .icon { stroke-width: 1.1; }
.empty h3 { margin: 0 0 6px; font: 600 26px/1.2 var(--display); }
.empty p { margin: 0 auto 20px; color: var(--muted); max-width: 46ch; }

/* ── Segmenté / formulaires ────────────────────────────────────────────── */
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; cursor: pointer; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); }
.segmented label:last-of-type { border-right: 0; }
.segmented input:checked + label { background: var(--ink); color: #fff; }
.segmented input:checked + label .icon { color: var(--gold-soft); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (prefers-color-scheme: dark) { .segmented input:checked + label { background: var(--ivory); color: var(--ink); } .segmented input:checked + label .icon { color: var(--gold); } }
.filter-seg { margin-bottom: 18px; }

.form { display: flex; flex-direction: column; gap: 8px; }
.form.busy { opacity: .7; pointer-events: none; }
.form-section { border: 0; padding: 0 0 18px; margin: 0 0 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.form-section:last-of-type { border-bottom: 0; }
.form-section legend { display: flex; align-items: center; gap: 8px; padding: 0 0 12px; font: 600 19px/1.2 var(--display); }
.form-section legend .icon { color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field > .label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.req { color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); font-size: 12.5px; min-height: 0; }
.error:empty { display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field input[type='file'] { padding: 9px 12px; }
.form-error { color: var(--danger); margin: 0; }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; padding: 16px 0 4px; background: var(--surface); border-top: 1px solid var(--line); }
.rating-input { display: flex; gap: 4px; }
.rating-input button { border: 0; background: none; padding: 4px; cursor: pointer; color: var(--line-strong); border-radius: 50%; }
.rating-input button.on { color: var(--accent); }
.rating-input button.on path { fill: currentColor; }

/* ── Tiroir, modale, notifications ─────────────────────────────────────── */
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(11, 11, 12, .45); backdrop-filter: blur(2px); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 50;
  background: var(--surface); box-shadow: -20px 0 50px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column; transform: translateX(16px); opacity: 0; transition: transform .22s ease, opacity .22s ease;
  outline: none;
}
.drawer.open { transform: none; opacity: 1; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 600 26px/1.2 var(--display); }
.drawer-body { padding: 22px 26px 0; overflow-y: auto; flex: 1; }
.modal-backdrop { display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); max-width: 460px; width: 100%; padding: 30px; border-radius: var(--radius); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); }
.modal h2 { font: 600 25px/1.25 var(--display); margin: 14px 0 8px; overflow-wrap: anywhere; }
.modal p { color: var(--muted); margin: 0 0 22px; }
.modal-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--ink); color: #fff; border-left: 3px solid var(--gold-soft); box-shadow: var(--shadow); font-size: 14px; transition: opacity .4s, transform .4s; }
.toast-error, .toast-warn { border-left-color: #e07a88; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .brand { border: 0; padding: 0 6px 0 0; flex: 0 0 auto; flex-direction: row; gap: 8px; }
  .brand-script, .sidebar-foot { display: none; }
  .brand-name { font-size: 17px; padding-top: 3px; }
  .brand-mark .icon { width: 30px; height: 30px; }
  .account { display: flex; align-items: center; margin: 0 0 0 auto; padding: 0; border: 0; }
  .account-name, .account-role { display: none; }
  .account-actions { flex-direction: row; gap: 0; }
  .account-btn { padding: 10px 8px; }
  .account-btn span:last-child { display: none; }
  .nav { flex-direction: row; margin: 0; gap: 0; }
  .nav a { border-left: 0; border-bottom: 2px solid transparent; padding: 10px; }
  .nav a .nav-label { display: none; }
  .nav a[aria-current='page'] { border-bottom-color: var(--gold-soft); }
  .grid-2, .pen-hero { grid-template-columns: 1fr; }
  .pen-hero { gap: 24px; }
  .view { padding-top: 26px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 16px; }
  .kpi-value { font-size: 24px; }
  .grid-3 { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; }
  .featured-photo { aspect-ratio: 16 / 10; }
  .featured-body { padding: 0 18px 18px; }
  .history-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .act { grid-template-columns: 1fr; gap: 8px; }
  .act-date { border-right: 0; padding: 0; }
  .archive-row { grid-template-columns: 64px 1fr; }
  .archive-row .row-actions { grid-column: 1 / -1; }
  .archive-photo, .photo-thumb { width: 64px; height: 64px; }
  .form-section { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .tab-panel { padding: 16px; }
  .filter { flex: 1 1 140px; }
  .filter select { min-width: 0; }
  .page-head .page-actions, .page-head .page-actions .btn { width: 100%; }
  .table thead { display: none; }
  .table tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 4px 6px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}
.card > .empty { border: 0; box-shadow: none; padding: 32px 12px; }
.hero-amount { white-space: nowrap; }
@media (max-width: 420px) {
  .brand-name { display: none; }
  .nav a { padding: 10px 8px; }
  .form-actions .btn { flex: 1 1 auto; }
}

/* ── v2 : écrans d'accès, compte, membres, éditions ────────────────────── */
body.auth-mode .sidebar { display: none; }
body.auth-mode .shell { grid-template-columns: 1fr; }
body.auth-mode .view { display: grid; place-items: center; min-height: 100vh; padding: 32px 16px;
  background: radial-gradient(circle at 50% 0%, #26242a 0%, #0b0b0c 65%); }
body.auth-mode .page { width: 100%; max-width: 440px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 36px 32px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.auth-brand { display: flex; flex-direction: column; align-items: center; color: var(--text); margin-bottom: 22px; }
.auth-brand .icon { stroke-width: 1.1; }
.auth-name { margin: 12px 0 0; font: 700 20px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.auth-script { margin: 6px 0 0; font: 400 20px/1 var(--script); color: var(--accent); transform: rotate(-3deg); }
.auth-title { margin: 0; text-align: center; font: 700 22px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.auth-lead { text-align: center; color: var(--muted); margin: 8px 0 20px; }
.auth-form { gap: 14px; }
.auth-form .field { gap: 6px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 13px; }
.auth-foot a { color: var(--accent); }
.btn-block { width: 100%; }

.account { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid #26262a; }
.account-name { margin: 0; color: #fff; font: 600 15px/1.3 var(--display); letter-spacing: .04em; overflow-wrap: anywhere; }
.account-role { margin: 2px 0 10px; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-soft); }
.account-actions { display: flex; flex-direction: column; gap: 2px; }
.account-btn { display: flex; align-items: center; gap: 10px; padding: 8px 0; border: 0; background: none; color: #b9b5ac; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.account-btn:hover { color: #fff; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--gold-soft); color: #111; font-size: 11px; font-weight: 600; text-align: center; letter-spacing: 0; }

.member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.member { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.member-pending { border-left: 3px solid var(--accent); }
.member-disabled { opacity: .75; }
.member-name { margin: 0; font: 600 18px/1.2 var(--display); overflow-wrap: anywhere; }
.member-id .muted { margin: 2px 0 8px; overflow-wrap: anywhere; }
.member-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.member-meta { display: flex; flex-direction: column; gap: 2px; }
.member-meta .warn { color: var(--danger); }
.member .row-actions { grid-column: 1 / -1; gap: 8px; }
.member .row-actions .btn { min-height: 36px; padding: 0 12px; font-size: 11px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.link-box .link-row { display: flex; gap: 8px; margin: 8px 0; }
.link-input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-2); font-family: ui-monospace, monospace; font-size: 12px; }

.stack-sm { display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pick-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pick-list li:last-child { border-bottom: 0; }
.pick-list input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.pick-list label { cursor: pointer; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .member { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px 22px; }
}

/* Mobile : placé APRÈS le bloc v2 pour que la cascade s'applique. */
@media (max-width: 900px) {
  .account { display: flex; align-items: center; margin: 0 0 0 auto; padding: 0; border: 0; flex: 0 0 auto; }
  .account-name, .account-role { display: none; }
  .account-actions { flex-direction: row; gap: 0; }
  .account-btn { padding: 10px 6px; }
  .account-btn span:last-child { display: none; }
  .nav-badge { margin-left: 4px; }
}
@media (max-width: 640px) {
  /* Barre repliée : tous les boutons restent visibles sans défilement horizontal. */
  .brand-name { display: none; }
  .sidebar { flex-wrap: wrap; row-gap: 2px; overflow-x: visible; }
  .nav { flex-wrap: wrap; }
  .nav a { padding: 8px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
