:root {
  --paper: #faf8f4;
  --surface: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #5c554c;
  --ink-mute: #938a7c;
  --brass: #a98554;
  --brass-soft: #f0e7d9;
  --olive: #5c6349;
  --line: #e8e2d7;
  --danger: #a8402f;
  --ok: #4d6b4a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28,26,23,.05), 0 8px 24px -12px rgba(28,26,23,.18);
  --sidebar: 236px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/1.55 -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1 { font-size: 25px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 13px; font-weight: 500; margin: 0 0 10px; }
p { margin: 0 0 12px; }
.lead { color: var(--ink-soft); max-width: 68ch; margin-bottom: 22px; }
.muted { color: var(--ink-mute); font-size: 12.5px; }
.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: .16em;
  color: var(--ink-mute); margin-bottom: 8px; font-weight: 500; }

/* ---------- ossature ---------- */
.shell { display: flex; min-height: 100%; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar); background: var(--ink);
  color: #cfc7b9; padding: 20px 0 24px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar .brand { padding: 0 20px 20px; font-size: 13px; font-weight: 500;
  color: #fff; letter-spacing: .02em; line-height: 1.3; }
.sidebar .brand small { display: block; color: #8c8375; font-weight: 400;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; margin-top: 5px; }
.sidebar .group { padding: 14px 20px 5px; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .18em; color: #7c7366; }
.sidebar a {
  display: flex; align-items: center; gap: 9px; padding: 8px 20px;
  text-decoration: none; font-size: 13px; color: #cfc7b9; border-left: 2px solid transparent;
}
.sidebar a:hover { color: #fff; background: rgba(255,255,255,.04); }
.sidebar a.on { color: #fff; border-left-color: var(--brass); background: rgba(169,133,84,.14); }
.sidebar a .count { margin-left: auto; font-size: 11px; color: #8c8375; }
.sidebar .foot { margin-top: auto; padding: 16px 20px 0; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .sp { margin-left: auto; }
.content { padding: 28px 32px 90px; max-width: 1240px; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border: 1px solid transparent; border-radius: 7px; background: var(--ink);
  color: #fff; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none;
  transition: background .13s, border-color .13s, color .13s;
}
.btn:hover { background: #33302b; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--paper); border-color: #d4ccbe; }
.btn-brass { background: var(--brass); }
.btn-brass:hover { background: #96744a; }
.btn-danger { background: var(--surface); border-color: #e4cdc8; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- cartes et formulaires ---------- */
.card { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.cols2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
label { display: block; font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-mute); margin: 14px 0 5px; }
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 13.5px;
  border: 1px solid #ded6c9; border-radius: 7px; background: var(--surface); color: var(--ink);
}
textarea { min-height: 86px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(169,133,84,.14); }

.flash { padding: 11px 15px; margin-bottom: 14px; border-radius: 8px; font-size: 13px;
  white-space: pre-wrap; background: #eef2ec; color: #33452f; border: 1px solid #d5e0d1; }
.flash.error { background: #fbeeec; color: #7d2f22; border-color: #eed4ce; }

/* ---------- maquette de page ---------- */
.blk {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.blk-head { display: flex; gap: 13px; padding: 15px 18px; align-items: flex-start; }
.blk-num { flex: 0 0 26px; height: 26px; border-radius: 7px; background: var(--paper-2, #f1ece2);
  color: var(--ink-mute); display: grid; place-items: center; font-size: 11.5px;
  font-weight: 600; font-variant-numeric: tabular-nums; }
.blk-head h3 { margin: 0 0 3px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.blk-where { font-size: 12.5px; color: var(--ink-mute); line-height: 1.5; }

/* Toutes les photos de maquette ont exactement la même taille. */
.blk-body { display: grid; gap: 20px; padding: 0 18px 18px;
  grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.blk-body.flip > .shot { order: 2; }
.blk-body.wide { grid-template-columns: minmax(0, 1fr); }

.shot { display: flex; flex-direction: column; gap: 8px; }
.slot {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3;
  border: 1px solid var(--line); border-radius: 8px; padding: 0; overflow: hidden;
  background: var(--paper); cursor: pointer;
}
.slot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slot::after { content: ''; position: absolute; inset: 0; background: rgba(28,26,23,0);
  transition: background .15s; pointer-events: none; }
.slot:hover::after { background: rgba(28,26,23,.46); }
.slot .pen { position: absolute; z-index: 2; left: 50%; top: 50%;
  transform: translate(-50%,-50%) scale(.96); background: #fff; color: var(--ink);
  border-radius: 7px; padding: 7px 13px; font-size: 12.5px; font-weight: 500; opacity: 0;
  transition: opacity .15s, transform .15s; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.slot:hover .pen { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.shot .file { font-family: ui-monospace, Menlo, monospace; font-size: 11px;
  color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.copy { min-width: 0; padding-top: 2px; }
.copy .eb { font-size: 10px; text-transform: uppercase; letter-spacing: .18em;
  color: var(--brass); margin-bottom: 7px; font-weight: 500; }
.copy .h { font-size: 18px; font-weight: 400; letter-spacing: -.01em; margin-bottom: 8px;
  line-height: 1.3; }
.copy .h em { font-style: italic; color: var(--ink-soft); }
.copy p { font-size: 13px; color: var(--ink-soft); line-height: 1.65; margin: 0 0 8px; }
.copy p:last-child { margin-bottom: 0; }
.copy .sign { font-size: 12px; color: var(--ink-mute); font-style: italic; }
.copy .nothing { font-size: 12.5px; color: var(--ink-mute); }

/* couvertures : même taille entre elles */
.covers { display: grid; gap: 14px; padding: 0 18px 18px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.covers .cap { font-size: 12.5px; }
.covers .cap small { display: block; color: var(--ink-mute); font-size: 11px;
  font-family: ui-monospace, Menlo, monospace; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* services : une ligne par service, photo identique à toutes les autres */
.svc { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px;
  padding: 18px; border-top: 1px solid var(--line); align-items: start; }
.svc.flip > .shot { order: 2; }
.svc .num { color: var(--brass); font-size: 12px; font-weight: 500; letter-spacing: .1em;
  margin-bottom: 6px; }

.mini-table { width: 100%; }
.mini-table td { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- galerie : en-tête et grille ---------- */
.gal-head { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px;
  align-items: start; margin-bottom: 24px; }
.gal-head .cover { position: relative; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--paper); }
.gal-head .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-head .cover .badge { position: absolute; left: 9px; top: 9px; }
.gal-stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 18px 0 0;
  padding-top: 16px; border-top: 1px solid var(--line); }
.gal-stats div strong { display: block; font-size: 21px; font-weight: 500;
  font-variant-numeric: tabular-nums; line-height: 1.2; }
.gal-stats div span { font-size: 10px; text-transform: uppercase; letter-spacing: .13em;
  color: var(--ink-mute); }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.tile { position: relative; border-radius: 9px; overflow: hidden; background: var(--paper);
  border: 1px solid var(--line); aspect-ratio: 4 / 3; }
.tile > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile.is-cover { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass-soft); }
.tile .badge { position: absolute; left: 8px; top: 8px; z-index: 3; }
.tile .fname { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 18px 9px 6px;
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: #fff;
  background: linear-gradient(transparent, rgba(28,26,23,.82));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .acts { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; background: rgba(28,26,23,.6);
  opacity: 0; transition: opacity .14s; }
.tile:hover .acts, .tile:focus-within .acts { opacity: 1; }
.tile .acts .line { display: flex; gap: 5px; }
.tile .acts .btn { background: #fff; color: var(--ink); border-color: #fff; }
.tile .acts .btn:hover { background: var(--brass); color: #fff; border-color: var(--brass); }
.tile .acts .btn-danger { background: rgba(255,255,255,.12); color: #fff;
  border-color: rgba(255,255,255,.45); }
.tile .acts .btn-danger:hover { background: var(--danger); border-color: var(--danger); }
.tile .acts .btn:disabled { opacity: .3; }

.dropzone { border: 2px dashed #ded6c9; border-radius: 11px; padding: 24px 20px;
  text-align: center; color: var(--ink-mute); background: var(--paper); cursor: pointer;
  display: block; transition: border-color .14s, background .14s; }
.dropzone:hover { border-color: var(--brass); background: var(--brass-soft); color: var(--ink); }
.dropzone strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 5px; }

/* ---------- fenêtre de sélection ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal[open] { display: block; }
.modal .veil { position: absolute; inset: 0; background: rgba(28,26,23,.55); backdrop-filter: blur(2px); }
.modal .box {
  position: relative; margin: 34px auto; width: min(1000px, calc(100% - 44px));
  max-height: calc(100vh - 68px); background: var(--surface); border-radius: 13px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.34);
}
.modal .head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; gap: 12px; }
.modal .head h2 { margin: 0; }
.modal .body { overflow-y: auto; padding: 18px 20px 24px; }
.tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.tab { padding: 7px 14px; border-radius: 7px; border: 1px solid transparent; background: none;
  font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.tab.on { background: var(--paper); border-color: var(--line); color: var(--ink); font-weight: 500; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12px; cursor: pointer; font: inherit; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pickgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.pick { border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: none; padding: 0; display: block; }
.pick img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--paper); }
.pick:hover { border-color: var(--brass); }
.pick.cur { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
.drop { border: 2px dashed #d9d1c3; border-radius: 11px; padding: 40px 20px; text-align: center;
  color: var(--ink-mute); background: var(--paper); }
.drop.over { border-color: var(--brass); background: var(--brass-soft); color: var(--ink); }

table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-mute); font-weight: 500; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login { width: 330px; }

.langs { display: flex; gap: 2px; margin-left: 14px; }
.langs a { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 500;
  letter-spacing: .06em; color: var(--ink-mute); text-decoration: none; }
.langs a:hover { background: var(--paper); color: var(--ink); }
.langs a.on { background: var(--ink); color: #fff; }

@media (max-width: 980px) {
  .blk-body, .svc, .gal-head { grid-template-columns: minmax(0, 1fr); }
  .blk-body.flip > .shot, .svc.flip > .shot { order: 0; }
  .shot { max-width: 360px; }
}
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; padding-bottom: 14px; }
  .sidebar a { display: inline-flex; border-left: 0; border-bottom: 2px solid transparent; }
  .sidebar a.on { border-left: 0; border-bottom-color: var(--brass); }
  .sidebar .foot { margin-top: 12px; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
  .content { padding-bottom: 60px; }
}
