/* =========================================================
   OLD'S GYM — Administration
   ========================================================= */
:root {
  --bg: #131313;
  --bg2: #1b1b1b;
  --card: #1e1e1e;
  --accent: #c23706;
  --accent2: #e8531d;
  --text: #f5f5f5;
  --muted: #a6a6a6;
  --line: rgba(255, 255, 255, .1);
  --ok: #16a34a;
  --side: 250px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); }
.hidden { display: none !important; }
.sub { color: var(--muted); font-size: .95rem; }

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 18px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .18s, border-color .18s, color .18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent2); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn--ghost { background: transparent; }
.btn--danger { border-color: rgba(194, 55, 6, .55); color: #f6b8a0; }
.btn--danger:hover { background: rgba(194, 55, 6, .18); color: #ffd8c9; }
.btn--sm { padding: 6px 12px; font-size: .88rem; border-radius: 7px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 7px; width: 32px; height: 32px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent2); }

/* ---------------- Champs ---------------- */
.f { margin: 0 0 16px; }
.f label {
  display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px;
  color: #ddd; margin: 0 0 6px;
}
.f input, .f textarea, .f select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 13px; color: var(--text); font: inherit;
}
.f textarea { min-height: 120px; resize: vertical; }
.f input:focus, .f textarea:focus, .f select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(194, 55, 6, .22);
}
.f .hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.f--inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.f--inline > * { flex: 1 1 180px; }

.msg { padding: 12px 16px; border-radius: 10px; margin: 0 0 16px; font-size: .95rem; }
.msg--ok { background: rgba(22, 163, 74, .15); border: 1px solid var(--ok); color: #9ff0b6; }
.msg--err { background: rgba(194, 55, 6, .15); border: 1px solid var(--accent); color: #f6b8a0; }

/* ---------------- Connexion ---------------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth__card {
  width: 100%; max-width: 400px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 34px;
}
.auth__card h1 { margin: 0 0 4px; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 1px; }
.auth__card .sub { margin: 0 0 22px; }

/* ---------------- Application ---------------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }

.side {
  background: #0f0f0f; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side__brand {
  padding: 20px 18px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; border-bottom: 1px solid var(--line);
}
.side__nav { list-style: none; margin: 12px 0; padding: 0; }
.side__nav button {
  width: 100%; text-align: left; background: transparent; border: 0;
  border-left: 3px solid transparent; color: var(--muted);
  padding: 11px 18px; font: inherit; cursor: pointer;
}
.side__nav button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.side__nav button.active { color: var(--text); border-left-color: var(--accent); background: rgba(194, 55, 6, .12); }
.side__nav .badge {
  float: right; background: var(--accent); color: #fff; border-radius: 999px;
  font-size: .72rem; padding: 0 7px; line-height: 18px; margin-top: 4px;
}
.side__foot { padding: 16px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: .9rem; }
.side__foot button { background: none; border: 0; color: var(--muted); font: inherit; text-align: left; cursor: pointer; padding: 0; }
.side__foot button:hover { color: var(--accent2); }
.side__foot span { color: var(--muted); font-size: .82rem; word-break: break-all; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; background: #0f0f0fee; backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar b { text-transform: uppercase; letter-spacing: 1px; }
.topbar > div { display: flex; align-items: center; gap: 12px; }
#save-state { color: var(--muted); font-size: .85rem; }
#save-state.dirty { color: var(--accent2); }

.content { padding: 24px; max-width: 900px; width: 100%; }
.savebar { display: none; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px 22px; margin: 0 0 20px;
}
.card > h3 {
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent2);
}
.card > .sub { margin: -6px 0 16px; }

.item { border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; margin: 0 0 12px; background: var(--bg2); }
.item__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.item__head b { font-weight: 600; }
.item__badge {
  font-size: .72rem; text-transform: uppercase; letter-spacing: 1px;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; color: var(--muted);
}
.item__badge--support { border-color: var(--accent); color: var(--accent2); }
.item__badge--new { border-color: var(--ok); color: #9ff0b6; }
.item pre { white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; font: inherit; color: var(--muted); }

.media { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.media__preview {
  width: 140px; height: 88px; border-radius: 8px; border: 1px solid var(--line);
  background: #000; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .8rem; overflow: hidden; flex: none;
}
.media__preview img, .media__preview video { width: 100%; height: 100%; object-fit: cover; }
.media__body { flex: 1 1 220px; min-width: 0; }
.media__body .path { color: var(--muted); font-size: .82rem; word-break: break-all; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: #222; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 18px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50;
  max-width: min(520px, 90vw);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--accent); color: #f6b8a0; }

/* ---------------- Mobile ---------------- */
@media (max-width: 780px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: column; }
  .side__nav { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px; }
  .side__nav li { flex: 1 1 auto; }
  .side__nav button { border-left: 0; border-bottom: 3px solid transparent; border-radius: 8px; text-align: center; padding: 9px 12px; }
  .side__nav button.active { border-left: 0; border-bottom-color: var(--accent); }
  .content { padding: 16px; }
  .topbar { flex-wrap: wrap; }
}
