/* NSFWTF.red — backoffice : même charte que le site, version compacte */

@font-face {
  font-family: "Anton";
  src: url("/fonts/anton-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #070708;
  --surface: #111114;
  --surface-2: #17171b;
  --line: rgba(255, 255, 255, 0.08);
  --red: #ff2e43;
  --text: #f5f3ef;
  --grey: #8a8a93;
  --green: #3ddc97;
  --amber: #ffb547;
  --blue: #6aa6ff;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.dot {
  color: var(--red);
}

.brand {
  margin: 0;
  font-family: "Anton", Impact, sans-serif;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.04em;
  line-height: 1;
}
.brand small {
  margin-left: 6px;
  font-family: "Inter", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ───────── Boutons / champs ───────── */

input[type="text"],
input[type="url"],
input[type="password"] {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
input::placeholder {
  color: #5f5f68;
}
input:focus {
  outline: none;
  border-color: var(--red);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms, opacity 150ms;
}
.btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.22);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  height: 38px;
  padding: 0 18px;
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #ff4a5d;
  border-color: #ff4a5d;
}
.btn-ghost {
  background: transparent;
}
.btn-danger:hover:not(:disabled) {
  color: var(--red);
  border-color: var(--red);
}

.msg {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--grey);
}
.msg-error {
  color: var(--red);
}
.msg-ok {
  color: var(--green);
}

/* ───────── Porte ───────── */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 80px -40px rgba(255, 46, 67, 0.35);
}
.gate-card .brand {
  margin-bottom: 8px;
  font-size: 30px;
}
.gate-card .msg {
  margin: 0;
}

/* ───────── App ───────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 clamp(14px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 8, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sync {
  font-size: 11px;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}
.sync.is-bad {
  color: var(--red);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px clamp(14px, 3vw, 32px) 60px;
}

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey);
}
.add {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}
.counters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.counters li {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--grey);
}
.counters b {
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.counters li[data-s="processing"] b {
  color: var(--amber);
}
.counters li[data-s="ready"] b {
  color: var(--green);
}
.counters li[data-s="error"] b {
  color: var(--red);
}

.list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.item.is-hidden {
  opacity: 0.55;
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #0c0c0f;
  display: grid;
  place-items: center;
  color: #3a3a42;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.info {
  min-width: 0;
}
.item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}
.item-title span.t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-title span.t.is-empty {
  color: var(--grey);
  font-weight: 400;
  font-style: italic;
}
.badge {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.badge[data-s="queued"] {
  color: var(--blue);
}
.badge[data-s="processing"] {
  color: var(--amber);
}
.badge[data-s="ready"] {
  color: var(--green);
}
.badge[data-s="error"] {
  color: var(--red);
}
.badge[data-s="processing"]::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.tag {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--grey);
  text-transform: uppercase;
}

.meta {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 12px;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}
.meta .src {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta .src:hover {
  color: var(--text);
}
.err {
  margin-top: 2px;
  font-size: 12px;
  color: var(--red);
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

@media (max-width: 720px) {
  .add {
    grid-template-columns: 1fr;
  }
  .item {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  .actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.empty {
  margin: 40px 0;
  text-align: center;
  color: var(--grey);
}

.brand img {
  height: 20px;
  width: auto;
  vertical-align: middle;
}
