/* Fast Publication — tableau de bord (noir profond & or métallique) */
:root {
  --bg: #070708;
  --bg-2: #0d0d0f;
  --panel: #111114;
  --panel-2: #16161a;
  --line: #24221d;
  --line-2: #2f2b22;
  --text: #ece9e2;
  --muted: #9a9384;
  --dim: #6f6a60;
  --gold: #d4af37;
  --gold-hi: #f6d77d;
  --gold-lo: #a8781f;
  --gold-grad: linear-gradient(180deg, #f8dc8a 0%, #c9982f 100%);
  --ok: #8fd19e;
  --warn: #f2c46d;
  --err: #ff8a7a;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(212, 175, 55, .07), transparent 60%), var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--gold-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
code, kbd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; background: #1a1a1e; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* ---------- Mise en page ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0b0b0d, #08080a); display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 22px rgba(212, 175, 55, .25); }
.brand b { display: block; font-size: 16px; color: var(--gold-hi); letter-spacing: .01em; }
.brand small { display: block; color: var(--dim); font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted);
  font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: #141416; color: var(--text); text-decoration: none; }
.nav a.active { background: linear-gradient(90deg, rgba(212, 175, 55, .16), rgba(212, 175, 55, .03)); color: var(--gold-hi); box-shadow: inset 2px 0 0 var(--gold); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; font-size: 12px; color: var(--dim); padding: 0 6px; display: grid; gap: 8px; }
.main { padding: 28px 34px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mobile-bar { display: none; }

/* ---------- Composants ---------- */
.card { background: linear-gradient(180deg, var(--panel), #0f0f12); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 16px 18px; }
.stat .v { font-size: 30px; font-weight: 800; color: var(--gold-hi); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.stat .s { color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: #141417; color: var(--text); font: 600 13px/1.2 inherit; cursor: pointer;
  transition: border-color .15s, color .15s, transform .08s, filter .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); color: var(--gold-hi); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.gold { background: var(--gold-grad); color: #0b0b0c; border-color: transparent; box-shadow: 0 8px 22px rgba(212, 175, 55, .22); }
.btn.gold:hover { filter: brightness(1.06); color: #0b0b0c; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger:hover { border-color: var(--err); color: var(--err); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid var(--line-2); color: var(--muted); background: #121215; white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(143, 209, 158, .35); background: rgba(143, 209, 158, .06); }
.badge.warn { color: var(--warn); border-color: rgba(242, 196, 109, .35); background: rgba(242, 196, 109, .06); }
.badge.err { color: var(--err); border-color: rgba(255, 138, 122, .35); background: rgba(255, 138, 122, .06); }
.badge.gold { color: var(--gold-hi); border-color: rgba(212, 175, 55, .4); background: rgba(212, 175, 55, .08); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px rgba(143, 209, 158, .6); }
.dot.err { background: var(--err); }
.dot.warn { background: var(--warn); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { padding: 34px 16px; text-align: center; color: var(--dim); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 12.5px; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--dim); }
input[type=text], input[type=url], input[type=number], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #0c0c0e; color: var(--text);
  font: 13.5px/1.45 inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; font-family: inherit; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .14); }
input[type=range] { width: 100%; accent-color: var(--gold); }
input[type=checkbox] { accent-color: var(--gold); width: 16px; height: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; margin-bottom: 10px; }
.notice { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #0f0f12; color: var(--muted); font-size: 13px; }
.notice.gold { border-color: rgba(212, 175, 55, .35); background: rgba(212, 175, 55, .05); color: var(--text); }
.notice.err { border-color: rgba(255, 138, 122, .35); background: rgba(255, 138, 122, .05); color: var(--text); }
.notice.ok { border-color: rgba(143, 209, 158, .35); background: rgba(143, 209, 158, .05); color: var(--text); }
.progress { height: 7px; border-radius: 99px; background: #1b1b1f; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--gold-grad); border-radius: 99px; transition: width .4s ease; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid #1a1916; vertical-align: middle; }
.table tr:hover td { background: #121215; }
.thumb { width: 44px; height: 58px; object-fit: cover; border-radius: 7px; background: #1b1b1e; display: block; }
.title-cell { max-width: 380px; }
.title-cell b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-cell small { color: var(--dim); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.stages { display: flex; gap: 4px; }
.stage { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #17171a; color: var(--dim); border: 1px solid var(--line); }
.stage.running { color: var(--gold-hi); border-color: rgba(212, 175, 55, .45); animation: pulse 1.4s ease-in-out infinite; }
.stage.done { color: var(--ok); border-color: rgba(143, 209, 158, .3); }
.stage.skipped { color: var(--dim); text-decoration: line-through; }
.stage.error, .stage.blocked { color: var(--err); border-color: rgba(255, 138, 122, .4); }
@keyframes pulse { 50% { opacity: .55; } }
.job { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0f0f12; animation: fadein .25s ease; }
.job + .job { margin-top: 10px; }
.job .thumb { width: 64px; height: 84px; }
.job h4 { margin: 0 0 4px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(4, 4, 5, .72); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fadein .15s ease; }
.modal { width: min(920px, 100%); max-height: 92vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; }
.modal pre { white-space: pre-wrap; background: #0b0b0d; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12.5px; max-height: 260px; overflow: auto; }
.log { font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.log .warn { color: var(--warn); }
.log .error { color: var(--err); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #1a1a1d; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.bg-item { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; background: #0f0f12; transition: border-color .15s, transform .15s; }
.bg-item:hover { transform: translateY(-2px); }
.bg-item.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .15); }
.bg-item img, .bg-item .ph { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #1a1a1d; }
.bg-item div { padding: 8px 10px; font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; }
.compare { position: relative; width: 100%; max-width: 520px; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #111; user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 50%); }
.compare .bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--gold); box-shadow: 0 0 12px rgba(212, 175, 55, .8); }
.compare .lbl { position: absolute; top: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, .65); font-size: 11px; font-weight: 700; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-grad); color: #0b0b0c; font-weight: 800; }
.toast-zone { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { padding: 11px 15px; border-radius: 11px; background: #0b0b0c; border: 1px solid var(--gold-lo); color: var(--gold-hi); font-weight: 600; box-shadow: var(--shadow); animation: fadein .2s ease; max-width: 380px; }
.toast.err { border-color: var(--err); color: var(--err); }
.skeleton { background: linear-gradient(90deg, #141417 0%, #1c1c20 50%, #141417 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.ext-missing { border: 1px dashed rgba(212, 175, 55, .45); }
.hide { display: none !important; }

@media (max-width: 980px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease; z-index: 40; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .mobile-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(7, 7, 8, .92); backdrop-filter: blur(8px); z-index: 30; }
  .mobile-bar img { width: 30px; height: 30px; border-radius: 8px; }
  .main { padding: 18px 16px 50px; }
  .job { grid-template-columns: 52px 1fr; }
  .job .actions { grid-column: 1 / -1; }
  .table .hide-sm { display: none; }
}
