:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3248;
  --text: #e2e4f0;
  --muted: #7b80a0;
  --accent: #5865f2;
  --ok: #3ba55d;
  --danger: #ed4245;
  --warn: #faa61a;
  --gold: #ffd700;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
}

.nav-brand { font-weight: 700; font-size: 16px; color: var(--text); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--surface2); color: var(--text); }

.btn-logout {
  background: var(--surface2) !important;
  color: var(--danger) !important;
  border: 1px solid var(--border);
}

/* ── Main ────────────────────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

h1 { font-size: 24px; margin-bottom: 24px; color: var(--text); }
h2 { font-size: 17px; color: var(--muted); margin: 32px 0 12px; text-transform: uppercase; letter-spacing: .05em; }

.muted { color: var(--muted); font-size: 13px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; display: block; margin-bottom: 8px; }
.back-link:hover { color: var(--text); }

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.stat-card.danger { border-color: var(--danger); background: #2a1415; }
.stat-card.ok { border-color: var(--ok); }

.stat-value { font-size: 32px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ── Table ───────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

thead th {
  background: var(--surface2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody tr.blacklisted { opacity: .5; }
tbody tr.red-flag td:first-child { border-left: 3px solid var(--danger); }
tbody tr.one-star { background: #1e0f0f; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge.danger { background: #3b1214; color: var(--danger); border: 1px solid var(--danger); }
.badge.ok { background: #0e2e1a; color: var(--ok); border: 1px solid var(--ok); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
button, .btn {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  transition: opacity 0.15s;
}
button:hover { opacity: .85; }

.btn-sm { padding: 4px 10px; font-size: 12px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.btn-sm:hover { color: var(--text); }

.btn-danger, button.btn-danger { background: var(--danger); }
.btn-ok, button.btn-ok { background: var(--ok); }

.action-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

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

/* ── Pet thumbnail ───────────────────────────────────────────────────────── */
.pet-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 4px;
}

.pet-emoji-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 10px;
  border-radius: 6px;
}

/* ── Stars ───────────────────────────────────────────────────────────────── */
.stars { letter-spacing: 2px; }

/* ── Type icons ──────────────────────────────────────────────────────────── */
.type-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 3px;
}
.type-icon-btn {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 4px;
}
.type-label { font-size: 0.85rem; color: var(--text-muted, #aaa); }

/* ── Type filter bar ─────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar label { font-weight: 600; white-space: nowrap; }
.type-filter-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.type-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #444;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.type-btn:hover { background: rgba(255,255,255,0.08); }
.type-btn.active { background: rgba(88,101,242,0.35); border-color: #5865f2; }
.type-btn-label { font-size: 0.78rem; }

/* ── Two-column layout ───────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ── Upload form ─────────────────────────────────────────────────────────── */
.upload-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.85rem; font-weight: 600; }
.form-group input[type="text"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  background: #1e2130;
  border: 1px solid #3a3f55;
  border-radius: 6px;
  padding: 7px 10px;
  color: inherit;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}
.form-group textarea { resize: vertical; }
.form-group select option { background: #1e2130; }
.required { color: #e74c3c; }
.btn-primary {
  background: #5865f2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  align-self: flex-start;
  transition: background 0.15s;
}
.btn-primary:hover { background: #4752c4; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 500;
}
.alert-success { background: rgba(46,139,87,0.25); border: 1px solid #2e8b57; color: #6bcb77; }
.alert-error   { background: rgba(231,76,60,0.2);  border: 1px solid #e74c3c; color: #ff6b6b; }

/* ── Approve / Reject buttons ────────────────────────────────────────────── */
.btn-approve {
  background: rgba(46,139,87,0.25);
  border: 1px solid #2e8b57;
  color: #6bcb77;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s;
}
.btn-approve:hover { background: rgba(46,139,87,0.45); }

.btn-reject {
  background: rgba(231,76,60,0.2);
  border: 1px solid #e74c3c;
  color: #ff6b6b;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s;
}
.btn-reject:hover { background: rgba(231,76,60,0.4); }

/* ── Login page ──────────────────────────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-card h1 { font-size: 22px; margin-bottom: 28px; }
.login-card label { display: block; text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 4px; }
.login-card input { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 14px; outline: none; }
.login-card input:focus { border-color: var(--accent); }
.login-card button { width: 100%; margin-top: 20px; padding: 12px; font-size: 15px; }
.error { color: var(--danger); font-size: 13px; margin-bottom: 12px; }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 { margin-bottom: 4px; }

section { margin-bottom: 40px; }

/* ── Player links ─────────────────────────────────────────────────────────── */
.player-link, a.player-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.player-link:hover { text-decoration: underline; color: var(--text); }

/* ── Blacklist / small action buttons ────────────────────────────────────── */
.btn-sm { color: #fff !important; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); background: transparent; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Pet favourite button (looks like text, acts as button) ──────────────── */
.pet-fav-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: inherit;
  transition: color 0.15s;
}
.pet-fav-btn:hover { color: #ff8fab; }
.pet-fav-btn strong { text-decoration: underline dotted; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: var(--surface2); }

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
}

.fav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fav-list li {
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: 6px;
  font-size: 13px;
}

/* ── Stat card warn ───────────────────────────────────────────────────────── */
.stat-card.warn { border-color: var(--warn); background: #2a2010; }
