:root {
  --bg: #0a0a0c;
  --bg2: #111114;
  --bg3: #18181c;
  --line: #252528;
  --text: #e8e8ec;
  --muted: #8e8e9a;
  --accent: #ff007f;
  --accent2: #c2185b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.04em;
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.nav a, .nav button {
  color: var(--muted);
  font-size: 0.85rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nav a:hover, .nav button:hover { color: #fff; }
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-accent { background: var(--accent2); color: #fff; }
.btn-accent:hover { background: var(--accent); }
.btn-save { display: block; margin: 1.5rem auto 0; min-width: 200px; }
.btn-ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--line); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }

.welcome {
  background: linear-gradient(135deg, #121218, #0a0a0c);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.welcome h1 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.welcome p { color: var(--muted); font-size: 0.9rem; }

.cat-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.forum-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.forum-table th,
.forum-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.88rem;
}
.forum-table th {
  background: var(--bg3);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}
.forum-table tr:last-child td { border-bottom: none; }
.forum-table .col-stats { width: 70px; text-align: center; color: var(--muted); }
.forum-table .col-last { width: 28%; font-size: 0.8rem; color: var(--muted); }

.rank-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  margin-left: 0.35rem;
}

.sidebar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}
@media (max-width: 900px) {
  .sidebar { grid-template-columns: 1fr; }
}

.panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.panel h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.panel ul { list-style: none; }
.panel li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.panel li:last-child { border-bottom: none; }

.post {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.post-head {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--line);
}
.post-user { min-width: 140px; text-align: center; }
.post-user .name { font-weight: 700; display: block; }
.post-user .meta { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
.post-body { padding: 1rem; white-space: pre-wrap; word-break: break-word; }

.form-box {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
}
.form-box h1 { font-size: 1.25rem; margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.error { color: #ff6b6b; font-size: 0.85rem; margin-bottom: 0.75rem; }

.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 1rem 0;
}
.breadcrumb a { color: var(--muted); }

.footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}

.pinned { color: var(--accent); font-size: 0.75rem; margin-right: 0.25rem; }
.locked { color: #ff6b6b; font-size: 0.75rem; margin-right: 0.25rem; }

.nav-main { display: flex; gap: 1rem; align-items: center; }
.nav-main a.active, .nav-main a:hover { color: var(--accent); }
.nav-user { display: flex; gap: 0.75rem; align-items: center; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 0.4rem; text-decoration: none !important; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }

.rank-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  color: #fff;
  margin: 0.15rem 0.2rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rank-label.sm { font-size: 0.6rem; }
.leader-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 2px;
  margin: 0.1rem 0.15rem 0 0;
}
.user-badges-row, .user-badges-col { margin-top: 0.35rem; }
.uname { font-weight: 700; text-decoration: none !important; }

.account-page { margin: 1.5rem 0 2rem; }
.account-title { font-size: 1.5rem; margin-bottom: 0.25rem; }
.account-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; margin-top: 1rem; }
@media (max-width: 800px) { .account-grid { grid-template-columns: 1fr; } }
.account-nav { background: var(--bg2); border: 1px solid var(--line); }
.account-nav-section { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.account-nav-head { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); padding: 0.5rem 1rem; }
.account-nav-link {
  display: block; padding: 0.45rem 1rem; color: var(--text); font-size: 0.88rem;
  text-decoration: none !important; border: none; background: none; width: 100%; text-align: left; cursor: pointer;
}
.account-nav-link:hover { background: var(--bg3); }
.account-nav-link.active { background: var(--accent2); color: #fff; }
.account-nav-link.logout { color: #ff6b6b; }
.account-content { background: var(--bg2); border: 1px solid var(--line); padding: 1.25rem; min-height: 320px; }

.settings-form.wide { max-width: 720px; }
.settings-row { display: grid; grid-template-columns: 180px 1fr; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.settings-row label { color: var(--muted); font-size: 0.85rem; text-align: right; padding-top: 0.5rem; }
.settings-row input, .settings-row textarea, .settings-row select {
  width: 100%; padding: 0.55rem; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 4px;
}
.settings-row .check { text-align: left; display: flex; gap: 0.5rem; align-items: center; }
.badge-checks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge-checks .check { flex-direction: row; }

.profile-card { display: flex; gap: 1.25rem; background: var(--bg2); border: 1px solid var(--line); padding: 1.25rem; margin-bottom: 1rem; }
.profile-card .about { margin-top: 0.75rem; white-space: pre-wrap; }
.meta { color: var(--muted); font-size: 0.82rem; }
.ok-msg { color: #5ee89a; margin-bottom: 0.75rem; }

.whats-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem; margin: 1.5rem 0; }
@media (max-width: 900px) { .whats-layout { grid-template-columns: 1fr; } }
.whats-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin: 1rem 0; padding-bottom: 0.5rem; }
.whats-tabs .active { color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 0.35rem; }
.whats-list { list-style: none; }
.whats-item { display: flex; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.whats-title { font-weight: 600; color: #fff; font-size: 1rem; }
.online-list li { padding: 0.35rem 0; font-size: 0.85rem; }
.online-cloud { font-size: 0.8rem; line-height: 1.8; }
.stats-pill { background: var(--accent2); color: #fff; padding: 0.5rem; margin-top: 0.75rem; font-size: 0.8rem; text-align: center; }

.admin-cards { display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-card {
  background: var(--bg2); border: 1px solid var(--line); padding: 1rem 1.25rem; border-radius: 8px;
  text-decoration: none !important; color: var(--text); min-width: 200px;
}
.admin-card strong { display: block; margin-bottom: 0.35rem; }
.admin-card span { font-size: 0.8rem; color: var(--muted); }
.search-bar { display: flex; gap: 0.5rem; max-width: 480px; }
.search-bar input { flex: 1; padding: 0.5rem; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 4px; }

.post-user { text-align: center; min-width: 160px; }
.post-user .name { display: block; font-weight: 700; margin-top: 0.35rem; }
.post-meta-right { flex: 1; color: var(--muted); font-size: 0.8rem; text-align: right; }
.post-signature { border-top: 1px dashed var(--line); margin: 0 1rem 1rem; padding-top: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.mod-actions { margin-bottom: 1rem; }

.avatar-upload-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  padding: 1rem;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.avatar-form { flex: 1; min-width: 200px; }
.avatar-form input[type="file"] { margin: 0.5rem 0; width: 100%; color: var(--muted); }
