/* PuzzPic moderation console.
   Plain CSS, no framework, no build step — the same posture as web/app/styles.css. */

:root {
  --bg: #11131a;
  --panel: #191c26;
  --panel-2: #212534;
  --line: #2c3142;
  --ink: #e8eaf2;
  --muted: #949bb3;
  --accent: #6c8cff;
  --danger: #ff6b6b;
  --ok: #4fd18b;
  --warn: #ffb648;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.warn { color: var(--warn); }
.empty { color: var(--muted); padding: 32px; text-align: center; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---- login ---- */
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; width: 100%; max-width: 380px;
}
.login-card h1 { font-size: 20px; margin: 0 0 6px; }
.login-card label { display: block; margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: 18px; }
.error { color: var(--danger); margin-top: 12px; font-size: 13px; }

/* ---- chrome ---- */
.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .spacer { flex: 1; }
nav#tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
button.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; }

main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.view-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.view-head h2 { font-size: 18px; margin: 0; }

.banner { margin: 0; padding: 10px 18px; font-size: 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.banner.ok { color: var(--ok); }
.banner.error { color: var(--danger); }

/* ---- form controls ---- */
input, select, button {
  font: inherit; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px;
}
input[type="search"], input[type="text"], input:not([type]) { min-width: 240px; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.danger { color: var(--danger); border-color: #4a2b34; }
button.danger:hover:not(:disabled) { border-color: var(--danger); }

/* ---- dashboard ---- */
.caveats {
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--warn);
  border-radius: 10px; padding: 12px 18px; margin: 12px 0 22px;
}
.caveats h3 { margin: 0 0 6px; font-size: 14px; }
.caveats ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
#stats-groups h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 24px 0 10px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.metric-value { font-size: 30px; font-weight: 650; line-height: 1.1; }
.metric-label { font-size: 14px; margin-top: 2px; }
/* The note is NOT small print behind a tooltip: a figure whose definition is hidden gets quoted
   wrongly. It always renders. */
.metric-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.breakdown { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; font-size: 12px; }

.spark { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin-top: 12px; }
.spark-bar { flex: 1; min-width: 2px; background: var(--accent); opacity: .75; border-radius: 2px 2px 0 0; height: var(--h); min-height: 1px; }
.spark-bar[data-count="0"] { background: var(--line); opacity: 1; }
.spark-axis { margin-top: 4px; }

/* ---- report cards ---- */
.cards { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.card { display: flex; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.card-media { flex: 0 0 200px; }
.card-media img { width: 200px; height: 200px; object-fit: cover; border-radius: 8px; background: var(--panel-2); }
.card-body { flex: 1; min-width: 0; }
.caption { margin: 0 0 4px; font-weight: 600; overflow-wrap: anywhere; }
.reasons { margin: 10px 0; padding-left: 18px; font-size: 13px; }
.reasons li { margin-bottom: 4px; overflow-wrap: anywhere; }
.no-image {
  width: 200px; height: 200px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12px; background: var(--panel-2); border: 1px dashed var(--line);
  border-radius: 8px; color: var(--muted); font-size: 12px;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- image grid ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.tile.down { opacity: .58; border-style: dashed; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--panel-2); }
.tile .no-image { width: 100%; height: auto; aspect-ratio: 1; }
.flags { color: var(--warn); margin: 4px 0 0; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr.banned { background: rgba(255, 107, 107, .07); }
td.detail { max-width: 420px; overflow-wrap: anywhere; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }

.pager { display: flex; align-items: center; gap: 10px; margin: 18px 0; }

/* ---- dialog ---- */
dialog {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px; max-width: 460px;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h3 { margin: 0 0 8px; font-size: 17px; }
dialog label { display: block; margin: 16px 0 4px; font-size: 13px; color: var(--muted); }
dialog input { width: 100%; }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; margin: 20px 0 0; padding: 0; }
