/* FanTest Admin — modern control panel */
:root {
  --bg: #070b14;
  --panel: rgba(13, 21, 37, 0.84);
  --panel-solid: #0d1525;
  --panel-2: rgba(20, 31, 52, 0.7);
  --line: rgba(148, 163, 184, 0.13);
  --line-strong: rgba(148, 163, 184, 0.23);
  --text: #eef4ff;
  --muted: #8b9bb5;
  --muted-2: #677892;
  --accent: #7c96ff;
  --accent-2: #32d5ee;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --radius: 18px;
  --font: "Manrope", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1000px 620px at 8% -10%, rgba(60, 76, 170, 0.22), transparent 65%),
    radial-gradient(900px 540px at 100% 0%, rgba(14, 133, 160, 0.14), transparent 62%),
    linear-gradient(180deg, #070b14, #05080f);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.032) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 82%);
  z-index: -1;
}
.ambient { position: fixed; border-radius: 999px; filter: blur(90px); pointer-events: none; z-index: -1; opacity: 0.5; }
.ambient-a { width: 430px; height: 430px; background: rgba(94, 118, 255, 0.2); top: -160px; left: -100px; }
.ambient-b { width: 380px; height: 380px; background: rgba(34, 211, 238, 0.1); right: -150px; top: 280px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.w-full { width: 100%; }

/* ── Shared controls ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.5; cursor: progress; transform: none; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #6d8cff, #4f74f7 58%, #32b8e6);
  box-shadow: 0 10px 26px rgba(85, 116, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.24);
}
.btn-primary:hover { box-shadow: 0 14px 32px rgba(85, 116, 255, 0.4); }
.btn-secondary { border-color: var(--line-strong); background: rgba(148, 163, 184, 0.07); color: #d5dff2; }
.btn-secondary:hover { background: rgba(148, 163, 184, 0.13); }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(148, 163, 184, 0.08); }
.btn-danger { color: #fff; background: linear-gradient(135deg, #f43f5e, #dc2626); }
.btn-sm { min-height: 31px; padding: 0 11px; border-radius: 8px; font-size: 11px; }
.btn-xs { min-height: 27px; padding: 0 8px; border-radius: 7px; font-size: 10px; }
.row-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.actions-menu { position: relative; }
.actions-menu summary {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}
.actions-menu summary::-webkit-details-marker { display: none; }
.actions-menu[open] summary { color: var(--text); background: rgba(148, 163, 184, 0.13); }
.menu-pop {
  position: absolute;
  top: 31px;
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 190px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #0c1423;
  box-shadow: 0 18px 44px rgba(2, 7, 18, 0.55);
}
.menu-pop button {
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c7d2e6;
  font-size: 10.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.menu-pop button:hover { background: rgba(148, 163, 184, 0.09); color: #fff; }
.menu-pop button.danger-item { color: #fda4af; }
.menu-pop button.danger-item:hover { background: rgba(251, 113, 133, 0.12); }
.stack { display: grid; gap: 18px; align-content: start; }
.user-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.user-action-grid .btn { justify-content: flex-start; min-height: 37px; font-size: 11px; }
@media (max-width: 520px) { .user-action-grid { grid-template-columns: 1fr; } }
.icon-btn {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.icon-btn:hover { background: rgba(148, 163, 184, 0.1); color: var(--text); }
.linklike { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #e8eeff;
  background: linear-gradient(145deg, rgba(109, 140, 255, 0.95), rgba(50, 213, 238, 0.75));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(145deg, #6d8cff, #32d5ee);
  box-shadow: 0 8px 24px rgba(84, 118, 255, 0.34), inset 0 1px 0 rgba(255,255,255,0.35);
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; line-height: 1; display: flex; flex-direction: column; gap: 4px; }
.brand-name small { font-size: 9px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.panel-kicker { color: var(--accent-2); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }

/* ── Login screen ─────────────────────────────────────────────── */
.admin-login-page { display: grid; place-items: center; padding: 22px; }
.login-screen { width: 100%; display: grid; place-items: center; min-height: calc(100vh - 44px); }
.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(520px 260px at 15% -10%, rgba(124, 150, 255, 0.16), transparent 70%),
    linear-gradient(160deg, rgba(17, 27, 46, 0.95), rgba(8, 14, 25, 0.96));
  box-shadow: 0 28px 80px rgba(2, 7, 18, 0.6);
}
.login-head { margin: 27px 0 21px; }
.login-head h1 { margin: 6px 0 9px; font-size: 26px; line-height: 1.14; letter-spacing: -0.035em; }
.login-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10.5px; }
.login-footer a:hover { color: var(--text); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-stack { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 41px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(5, 10, 18, 0.62);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: 0.18s ease;
}
.field textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(124, 150, 255, 0.55); box-shadow: 0 0 0 3px rgba(124, 150, 255, 0.1); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-error { padding: 9px 11px; border: 1px solid rgba(251, 113, 133, 0.3); border-radius: 9px; background: rgba(251, 113, 133, 0.08); color: #fda4af; font-size: 11px; font-weight: 600; line-height: 1.45; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; align-items: center; }
.hint { margin: 0; color: var(--muted-2); font-size: 10.5px; line-height: 1.5; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; }
.check { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.check input { accent-color: #6d8cff; width: 15px; height: 15px; }

/* ── App shell ───────────────────────────────────────────────── */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: rgba(7, 12, 21, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 50;
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: 3px 6px 24px; }
.sidebar-close { display: none; }
.sidebar-label { padding: 14px 10px 7px; color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.admin-nav { display: grid; gap: 3px; }
.admin-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
  transition: 0.17s ease;
}
.admin-nav button svg { width: 17px; height: 17px; opacity: 0.85; flex-shrink: 0; }
.admin-nav button:hover { background: rgba(148, 163, 184, 0.07); color: #d7e1f3; }
.admin-nav button.active { border-color: rgba(124, 150, 255, 0.2); background: rgba(124, 150, 255, 0.11); color: #e7edff; }
.admin-nav button.active svg { color: #9fb1ff; opacity: 1; }
.admin-nav button em { margin-left: auto; min-width: 21px; height: 19px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.1); color: var(--muted); font-style: normal; font-size: 9.5px; font-weight: 800; }
.sidebar-links { display: grid; gap: 3px; }
.sidebar-links a { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px; color: var(--muted); font-size: 11.5px; font-weight: 650; }
.sidebar-links a:hover { background: rgba(148, 163, 184, 0.07); color: var(--text); }
.sidebar-links svg { width: 15px; height: 15px; }
.sidebar-foot { margin-top: auto; padding-top: 17px; border-top: 1px solid var(--line); }
.admin-identity { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; }
.admin-identity strong { display: block; font-size: 11.5px; }
.admin-identity span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9.5px; }
.sidebar-overlay { display: none; }
.admin-main { min-width: 0; padding: 24px 28px 54px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.admin-topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-topbar-title h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -0.035em; }
.sidebar-toggle { display: none; }
.admin-topbar-actions { display: flex; align-items: center; gap: 11px; }
.live-status { display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(13, 21, 37, 0.6); color: var(--muted); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.live-status i { width: 6px; height: 6px; border-radius: 999px; background: var(--success); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.live-status strong { color: #dce6f8; }
.admin-view { display: grid; gap: 18px; }

/* ── Cards / metrics ──────────────────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(20, 31, 54, 0.82), rgba(9, 15, 27, 0.8));
  box-shadow: 0 12px 30px rgba(2, 7, 18, 0.24);
}
.metric-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -48px; bottom: -52px; border-radius: 999px; background: radial-gradient(circle, rgba(124, 150, 255, 0.2), transparent 68%); }
.metric-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.metric-value { display: block; margin: 10px 0 5px; font-size: 30px; line-height: 1; font-weight: 800; letter-spacing: -0.045em; }
.metric-foot { color: var(--muted-2); font-size: 10.5px; font-weight: 600; }
.metric-card.good .metric-value { color: #6ee7b7; }
.metric-card.warn .metric-value { color: #fcd34d; }
.metric-card.bad .metric-value { color: #fda4af; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: 18px; align-items: start; }
.grid-2.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(16, 25, 43, 0.86), rgba(9, 15, 27, 0.82));
  box-shadow: 0 12px 34px rgba(2, 7, 18, 0.25);
  overflow: hidden;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: 14px; letter-spacing: -0.015em; }
.card-head p { margin: 4px 0 0; color: var(--muted-2); font-size: 10.5px; }
.card-body { padding: 18px 19px; }
.card-body.tight { padding: 9px 19px 15px; }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
thead th { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
tbody td { padding: 11px 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); color: #c7d2e6; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(124, 150, 255, 0.035); }
.table-user { display: flex; align-items: center; gap: 9px; min-width: 120px; }
.table-user .avatar { width: 27px; height: 27px; font-size: 10px; }
.table-user strong { font-size: 11.5px; color: #e0e8f6; }
.table-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; color: var(--muted-2); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.tag.green { color: #6ee7b7; background: rgba(52, 211, 153, 0.12); }
.tag.red { color: #fda4af; background: rgba(251, 113, 133, 0.12); }
.tag.gray { color: #a6b4ca; background: rgba(148, 163, 184, 0.1); }
.tag.yellow { color: #fcd34d; background: rgba(251, 191, 36, 0.12); }
.tag.blue { color: #a5b4fc; background: rgba(124, 150, 255, 0.12); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.empty strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 14px 19px; border-bottom: 1px solid var(--line); }
.searchbox { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5, 10, 18, 0.55); color: var(--muted-2); flex: 1; min-width: 180px; }
.searchbox input { border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11.5px; width: 100%; }
.searchbox input::placeholder { color: var(--muted-2); }
.filter-select { height: 34px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 9px; background-color: rgba(5, 10, 18, 0.55); color: #c7d2e6; font-size: 11px; outline: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-repeat: no-repeat; background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; }

/* ── Overview specifics ──────────────────────────────────────── */
.info-list { display: grid; gap: 1px; }
.info-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.07); font-size: 11px; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row strong { color: #d8e2f3; text-align: right; font-weight: 700; word-break: break-all; }
.status-banner { display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin-bottom: 15px; border: 1px solid rgba(52, 211, 153, 0.2); border-radius: 12px; background: rgba(52, 211, 153, 0.06); color: #a7f3d0; font-size: 11.5px; font-weight: 600; }
.status-banner.bad { border-color: rgba(251, 113, 133, 0.24); background: rgba(251, 113, 133, 0.07); color: #fecdd3; }
.status-banner .tag { flex-shrink: 0; }
.recent-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(148, 163, 184, 0.07); }
.recent-row:last-child { border-bottom: 0; }
.recent-main { min-width: 0; flex: 1; }
.recent-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: #dce6f8; }
.recent-main span { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9.5px; }
.recent-time { color: var(--muted-2); font-size: 9.5px; white-space: nowrap; }
.progress { height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.1); overflow: hidden; margin-top: 9px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d8cff, #32d5ee); }

/* ── Forum admin ─────────────────────────────────────────────── */
.forum-admin-list { display: grid; }
.forum-admin-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 19px; border-bottom: 1px solid rgba(148, 163, 184, 0.075); }
.forum-admin-row:last-child { border-bottom: 0; }
.forum-admin-row:hover { background: rgba(124, 150, 255, 0.035); }
.forum-admin-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.forum-admin-title strong { font-size: 12.5px; color: #e1e9f7; }
.forum-admin-meta { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 5px; color: var(--muted-2); font-size: 9.5px; font-weight: 600; }
.forum-admin-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

/* ── Chat ────────────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.chat-log { height: 460px; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; background: rgba(5, 10, 18, 0.38); border-radius: 12px; border: 1px solid var(--line); }
.chat-row { padding: 8px 9px; border-radius: 9px; background: rgba(148, 163, 184, 0.035); }
.chat-row.admin { background: rgba(251, 191, 36, 0.055); }
.chat-head { display: flex; align-items: baseline; gap: 8px; }
.chat-head strong { font-size: 10.5px; color: #a5b4fc; }
.chat-head strong.admin { color: #fbbf24; }
.chat-head time { color: var(--muted-2); font-size: 9px; }
.chat-text { margin: 4px 0 0; color: #c3cfe2; font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form input { flex: 1; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(5, 10, 18, 0.6); color: var(--text); font-size: 12px; outline: none; }
.chat-form input:focus { border-color: rgba(124, 150, 255, 0.55); }
.online-list { display: flex; flex-wrap: wrap; gap: 6px; }
.online-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 10, 18, 0.35); color: #c7d2e6; font-size: 10px; font-weight: 650; }
.online-chip .avatar { width: 20px; height: 20px; font-size: 8px; }

/* ── Notifications / logs ────────────────────────────────────── */
.notice-list { display: grid; gap: 8px; }
.notice-item { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(5, 10, 18, 0.32); }
.notice-item.yellow { border-color: rgba(251, 191, 36, 0.2); }
.notice-item.red { border-color: rgba(251, 113, 133, 0.22); }
.notice-item p { margin: 5px 0 0; color: #c3cfe2; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.notice-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted-2); font-size: 9px; font-weight: 600; }
.log-list { display: grid; gap: 7px; max-height: 520px; overflow: auto; }
.log-item { padding: 10px 12px; border: 1px solid rgba(251, 113, 133, 0.13); border-radius: 9px; background: rgba(251, 113, 133, 0.04); }
.log-item strong { color: #fda4af; font-size: 10.5px; }
.log-item p { margin: 4px 0 0; color: #c3cfe2; font-size: 10.5px; line-height: 1.45; word-break: break-word; }
.log-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; color: var(--muted-2); font-size: 9px; }

/* ── Files ───────────────────────────────────────────────────── */
.upload-box { padding: 16px; border: 1px dashed rgba(148, 163, 184, 0.24); border-radius: 12px; background: rgba(5, 10, 18, 0.3); }
.upload-box input[type="file"] { width: 100%; color: var(--muted); font-size: 11px; }
.upload-box input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(148, 163, 184, 0.08); color: #d8e2f3; font-weight: 700; font-size: 10.5px; cursor: pointer; }
.upload-note { margin: 9px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.upload-note code { color: #a5b4fc; font-size: 9.5px; }

/* ── Dialogs — reused from forum ─────────────────────────────── */
dialog.dialog { width: min(460px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 20px; background: transparent; color: var(--text); overflow: visible; }
dialog.dialog::backdrop { background: rgba(2, 6, 14, 0.74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
dialog.dialog[open] { animation: dialog-in 0.2s ease both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.dialog-card { position: relative; max-height: calc(100vh - 48px); overflow: auto; padding: 25px; border: 1px solid var(--line-strong); border-radius: 20px; background: radial-gradient(500px 240px at 15% -10%, rgba(124, 150, 255, 0.14), transparent 70%), linear-gradient(160deg, #101a2c, #090f1b); box-shadow: 0 28px 80px rgba(2, 7, 18, 0.6); }
.dialog-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 10, 18, 0.55); color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); }
.dialog-head { padding-right: 24px; margin-bottom: 18px; }
.dialog-head h2 { margin: 5px 0 7px; font-size: 22px; letter-spacing: -0.035em; }
.dialog-head p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
dialog.dialog-wide { width: min(780px, calc(100% - 32px)); }
.topic-dialog-card { padding: 0; }
.topic-dialog-content { padding: 25px; }
.topic-detail-head { padding-right: 28px; margin-bottom: 17px; }
.topic-detail-head h2 { margin: 8px 0 9px; font-size: clamp(21px, 3vw, 27px); line-height: 1.18; letter-spacing: -0.035em; }
.topic-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.topic-detail-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted-2); font-size: 10px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; padding: 2.5px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.badge-pin { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.badge-lock { color: #9aa8c0; background: rgba(148, 163, 184, 0.1); }
.badge-cat { color: #a9b8ff; background: rgba(124, 150, 255, 0.1); }
.topic-op { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5, 10, 18, 0.38); color: #cbd6e8; font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.replies-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 21px 0 11px; padding-top: 16px; border-top: 1px solid var(--line); }
.replies-head h3 { margin: 0; font-size: 13px; }
.replies-head span { color: var(--muted-2); font-size: 10px; font-weight: 700; }
.reply-list { display: grid; gap: 8px; }
.reply { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 11px; border: 1px solid rgba(148, 163, 184, 0.09); border-radius: 11px; background: rgba(13, 21, 37, 0.55); }
.reply.admin { border-color: rgba(251, 191, 36, 0.16); background: rgba(55, 41, 14, 0.2); }
.reply .avatar { width: 32px; height: 32px; font-size: 11px; }
.reply-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.reply-head strong { font-size: 10.5px; color: #dce6f8; }
.reply-head time { color: var(--muted-2); font-size: 9px; }
.reply-body { margin: 4px 0 0; color: #b5c2d8; font-size: 11px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.locked-note { margin-top: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: rgba(148, 163, 184, 0.05); color: var(--muted); font-size: 11px; text-align: center; }
.reply-form { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.reply-form textarea { min-height: 84px; }
.reply-form .form-actions { justify-content: space-between; }
.skeleton-list { display: grid; gap: 11px; }
.skeleton-row { height: 58px; border-radius: 11px; background: linear-gradient(90deg, rgba(148,163,184,0.06) 25%, rgba(148,163,184,0.12) 37%, rgba(148,163,184,0.06) 63%); background-size: 400% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ── Toasts ───────────────────────────────────────────────────── */
.toast-stack { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(330px, calc(100% - 36px)); pointer-events: none; }
.toast { padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 11px; background: rgba(13, 21, 37, 0.96); box-shadow: 0 12px 30px rgba(2,7,18,0.4); color: #d9e3f5; font-size: 11.5px; font-weight: 600; line-height: 1.45; pointer-events: auto; animation: toast-in 0.2s ease both; }
.toast.success { border-color: rgba(52, 211, 153, 0.28); color: #a7f3d0; }
.toast.error { border-color: rgba(251, 113, 133, 0.3); color: #fecdd3; }
.toast.info { border-color: rgba(124, 150, 255, 0.3); color: #c7d2fe; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2.equal { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-log { height: 360px; }
}
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: 24px 0 60px rgba(2,7,18,0.5); }
  .admin-sidebar.open { transform: none; }
  .sidebar-close { display: grid; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(2,6,14,0.7); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: grid; }
  .admin-main { padding: 18px 16px 40px; }
  .admin-topbar { align-items: flex-start; }
  .admin-topbar-actions .live-status { display: none; }
  .admin-topbar-title h1 { font-size: 21px; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
  .card-head { align-items: flex-start; flex-direction: column; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .searchbox { width: 100%; }
  .forum-admin-row { grid-template-columns: 1fr; }
  .forum-admin-actions { justify-content: flex-start; }
  .admin-topbar { flex-direction: column; align-items: stretch; }
  .admin-topbar-actions { justify-content: space-between; }
  .login-card { padding: 23px; }
  .dialog-card, .topic-dialog-content { padding: 20px; }
}
