/* ===================================
   NEXUS FORUM — DESIGN SYSTEM
   =================================== */

/* 1. CUSTOM PROPERTIES */
:root {
  /* Backgrounds */
  --bg-base:    #0b0c12;
  --bg-surface: #12141e;
  --bg-card:    #181a27;
  --bg-card-h:  #1e2033;
  --bg-input:   #0f1019;
  --bg-hover:   #1e2133;

  /* Borders */
  --border:     rgba(255,255,255,.07);
  --border-h:   rgba(255,255,255,.14);
  --border-focus: #6366f1;

  /* Accent — indigo/violet gradient */
  --accent:     #6366f1;
  --accent-2:   #8b5cf6;
  --gradient:   linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-h: linear-gradient(135deg, #5254d4 0%, #7c4fe0 100%);

  /* Text */
  --text-primary:   #e8eaf0;
  --text-secondary: #9095b0;
  --text-muted:     #5a5f7a;
  --text-link:      #818cf8;

  /* Status */
  --success:  #10b981;
  --warning:  #f59e0b;
  --error:    #ef4444;
  --info:     #38bdf8;

  /* Roles */
  --admin-color: #ef4444;
  --mod-color:   #f59e0b;
  --user-color:  #9095b0;

  /* Sizes */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 20px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  --glow:      0 0 24px rgba(99,102,241,.25);

  /* Motion */
  --transition: 0.18s cubic-bezier(.4,0,.2,1);

  /* Layout */
  --header-h: 64px;
  --sidebar-w: 220px;
}

/* 2. RESET */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--text-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: #a5b4fc; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* 3. SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: #2d3050; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* 4. UTILITIES */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.ml-auto { margin-left: auto; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 5. FLASH MESSAGES */
.flash-container {
  position: fixed; top: 80px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.flash {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 500;
  backdrop-filter: blur(12px);
  border: 1px solid transparent;
  max-width: 380px;
  animation: slideInRight .3s ease;
  box-shadow: var(--shadow);
}
.flash-success { background: rgba(16,185,129,.15); border-color: rgba(16,185,129,.3); color: #6ee7b7; }
.flash-error   { background: rgba(239, 68, 68,.15); border-color: rgba(239,68,68,.3); color: #fca5a5; }
.flash-info    { background: rgba(56,189,248,.15);  border-color: rgba(56,189,248,.3); color: #7dd3fc; }
.flash-close { margin-left: auto; opacity: .6; font-size: 1.1rem; line-height: 1; padding: 0 4px; }
.flash-close:hover { opacity: 1; }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 6. HEADER */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(11,12,18,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  height: 100%;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary); font-weight: 700; font-size: 1.2rem;
  text-decoration: none; flex-shrink: 0;
}
.site-logo:hover { color: var(--text-primary); }
.logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: #fff;
  box-shadow: var(--glow);
}
.main-nav { display: flex; gap: 4px; }
.nav-link {
  color: var(--text-secondary); font-size: .9rem; font-weight: 500;
  padding: 6px 14px; border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-admin { color: var(--error); }
.nav-admin:hover { color: var(--error); background: rgba(239,68,68,.1); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* User Menu */
.user-menu { position: relative; }
.user-menu-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition);
}
.user-menu-toggle:hover { border-color: var(--border-h); background: var(--bg-card-h); }
.user-name { font-size: .9rem; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { font-size: .7rem; opacity: .6; }

.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  display: none;
  animation: fadeIn .15s ease;
}
.dropdown.open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: .9rem;
  transition: all var(--transition);
}
.dropdown-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.dropdown-item-danger:hover { color: var(--error); background: rgba(239,68,68,.1); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Burger */
.burger {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; border-radius: var(--radius-sm);
}
.burger span {
  width: 22px; height: 2px; background: var(--text-secondary);
  border-radius: 99px; transition: all var(--transition);
  display: block;
}
.burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* 7. BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; line-height: 1.2;
  transition: all var(--transition); white-space: nowrap;
  border: 1px solid transparent;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.btn-primary:hover:not(:disabled) { background: var(--gradient-h); box-shadow: 0 6px 18px rgba(99,102,241,.4); transform: translateY(-1px); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-h); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-full { width: 100%; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }

.btn-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: .82rem; color: var(--text-secondary);
  background: var(--bg-hover); border: 1px solid var(--border);
  transition: all var(--transition); cursor: pointer;
}
.btn-action:hover { color: var(--text-primary); border-color: var(--border-h); }
.btn-action-danger:hover { color: var(--error); background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); }

/* 8. FORMS */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .87rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.required { color: var(--error); }
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239095b0' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-color { width: 60px; height: 38px; padding: 4px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.field-hint { display: block; font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.char-count { font-size: .8rem; color: var(--text-muted); text-align: right; margin-top: 4px; }
.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 44px; }
.toggle-pass { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 1rem; opacity: .6; transition: opacity var(--transition); }
.toggle-pass:hover { opacity: 1; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .9rem; margin-bottom: 16px; }
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.25); color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.25); color: #6ee7b7; }

/* 9. MAIN CONTENT */
.main-content { flex: 1; padding: 32px 0; }

/* 10. HERO SECTION */
.hero-section {
  text-align: center; padding: 60px 20px 48px;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.12) 0%, transparent 70%);
  border-radius: var(--radius-xl); margin-bottom: 28px;
}
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 32px; max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 11. STATS BAR */
.stats-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 40px;
}
.stat-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 16px; background: var(--bg-card);
  transition: background var(--transition);
}
.stat-item:hover { background: var(--bg-card-h); }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* 12. SECTION HEADER */
.section-header { margin-bottom: 18px; }
.section-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); letter-spacing: .03em; text-transform: uppercase; }

/* 13. CATEGORIES GRID */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.category-card {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all var(--transition); color: var(--text-primary);
  text-decoration: none;
}
.category-card:hover {
  border-color: var(--border-h); background: var(--bg-card-h);
  transform: translateY(-2px); box-shadow: var(--shadow);
  color: var(--text-primary);
}
.cat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.cat-body { flex: 1; min-width: 0; }
.cat-name { font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.cat-desc { font-size: .85rem; color: var(--text-secondary); margin-bottom: 10px; }
.cat-last { display: flex; align-items: center; gap: 8px; }
.cat-last-text { font-size: .8rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-stats { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.cat-stat { display: flex; flex-direction: column; align-items: center; font-size: .82rem; }
.cat-stat strong { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.cat-stat small { color: var(--text-muted); font-size: .72rem; }

/* 14. AVATARS */
.avatar-xs, .avatar-sm, .avatar-md, .avatar-lg {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0;
}
.avatar-xs { width: 24px; height: 24px; font-size: .7rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .85rem; }
.avatar-md { width: 42px; height: 42px; font-size: 1rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }

/* 15. BREADCRUMB */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: .875rem; color: var(--text-muted); margin-bottom: 24px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); }
.sep { opacity: .4; }

/* 16. CATEGORY HEADER */
.category-header-block {
  display: flex; align-items: center; gap: 20px;
  padding: 24px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 24px; flex-wrap: wrap;
}
.cat-icon-lg {
  width: 60px; height: 60px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
}
.page-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: .95rem; }

/* 17. TOPICS LIST */
.topics-list { display: flex; flex-direction: column; gap: 2px; }
.topic-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all var(--transition);
  color: var(--text-primary); text-decoration: none;
}
.topic-row:hover { background: var(--bg-card-h); border-color: var(--border-h); transform: translateX(3px); }
.topic-pinned { border-left: 3px solid var(--accent); }
.topic-locked { opacity: .8; }
.topic-avatar { flex-shrink: 0; }
.topic-info { flex: 1; min-width: 0; }
.topic-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.topic-title { font-weight: 600; font-size: .95rem; }
.topic-meta { display: flex; gap: 6px; font-size: .82rem; color: var(--text-muted); align-items: center; }
.topic-meta strong { color: var(--text-secondary); }
.topic-stats { display: flex; gap: 16px; flex-shrink: 0; }
.topic-stat { display: flex; flex-direction: column; align-items: center; font-size: .8rem; }
.stat-n { font-weight: 700; font-size: .95rem; }
.topic-last {
  display: flex; align-items: center; gap: 8px;
  min-width: 120px; flex-shrink: 0;
}
.topic-last-info { display: flex; flex-direction: column; font-size: .8rem; }
.topic-last-info small { color: var(--text-muted); }

/* 18. BADGES */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-pin { background: rgba(99,102,241,.15); color: #818cf8; }
.badge-lock { background: rgba(239,68,68,.12); color: #fca5a5; }
.badge-danger { background: rgba(239,68,68,.15); color: #fca5a5; border-radius: 4px; padding: 1px 6px; font-size: .75rem; }

.user-badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.user-badge-admin { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.25); }
.user-badge-moderator { background: rgba(245,158,11,.15); color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.user-badge-user { background: rgba(144,149,176,.1); color: var(--text-muted); border: 1px solid var(--border); }
.user-badge-lg { font-size: .82rem; padding: 4px 12px; }

/* 19. TOPIC HEADER */
.topic-header { margin-bottom: 24px; }
.topic-page-title { font-size: 1.7rem; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.topic-header-meta { display: flex; gap: 10px; color: var(--text-muted); font-size: .875rem; }
.pin-icon { font-size: 1.1rem; }

/* 20. POST CARDS */
.post-card {
  display: flex; gap: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 14px; transition: border-color var(--transition);
}
.post-card:hover { border-color: var(--border-h); }
.post-card-first { border-left: 3px solid var(--accent); }
.post-author {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 16px; background: var(--bg-surface);
  border-right: 1px solid var(--border);
  min-width: 120px; max-width: 140px;
  text-align: center;
}
.post-username { font-size: .85rem; font-weight: 600; color: var(--text-primary); word-break: break-all; }
.post-username:hover { color: var(--text-link); }
.post-author-stats { display: flex; flex-direction: column; gap: 2px; }
.post-author-stats small { font-size: .72rem; color: var(--text-muted); }
.post-body { flex: 1; padding: 20px 24px; min-width: 0; }
.post-date { font-size: .8rem; color: var(--text-muted); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.post-anchor { opacity: .4; font-size: .85rem; }
.post-anchor:hover { opacity: 1; }
.edited-label { font-style: italic; font-size: .75rem; }
.post-content { line-height: 1.75; color: var(--text-primary); }
.post-content p { margin-bottom: 12px; }
.post-content p:last-child { margin-bottom: 0; }
.post-content br { content: ''; display: block; margin: 3px 0; }
.post-admin-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }

.replies-list { margin: 20px 0; }

/* 21. REPLY FORM */
.reply-form-block {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px; margin-top: 24px;
}
.reply-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 18px; }
.locked-notice {
  text-align: center; padding: 20px; margin-top: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text-muted);
}

/* 22. PROFILE PAGE */
.profile-page { display: flex; flex-direction: column; gap: 20px; }
.profile-card {
  display: flex; align-items: flex-start; gap: 28px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; flex-wrap: wrap;
}
.profile-avatar {
  width: 90px; height: 90px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 700; color: #fff;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.profile-username { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.profile-stats { display: flex; gap: 28px; margin: 16px 0; flex-wrap: wrap; }
.profile-stat { display: flex; flex-direction: column; gap: 2px; }
.profile-stat strong { font-size: 1.2rem; font-weight: 700; }
.profile-stat small { color: var(--text-muted); font-size: .8rem; }
.profile-bio { color: var(--text-secondary); font-size: .95rem; max-width: 500px; }

.profile-edit-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.profile-edit-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }

.profile-activity { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.activity-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.activity-section h3 { font-size: .95rem; font-weight: 600; margin-bottom: 14px; color: var(--text-secondary); }
.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid transparent;
  color: var(--text-secondary); font-size: .875rem;
  transition: all var(--transition);
}
.activity-item:hover { background: var(--bg-hover); border-color: var(--border); color: var(--text-primary); }
.activity-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-date { color: var(--text-muted); font-size: .78rem; white-space: nowrap; }

/* 23. NEW TOPIC / FORM PAGES */
.form-page-card {
  max-width: 760px; margin: 0 auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 36px;
}
.form-page-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 28px; }

/* 24. MODALS */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-h);
  border-radius: var(--radius-xl); width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  transform: scale(.95) translateY(10px);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 0; margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.3rem; font-weight: 700; }
.modal-close { font-size: 1.6rem; opacity: .5; padding: 0 4px; line-height: 1; transition: opacity var(--transition); }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 0 28px 28px; }
.modal-footer-links { text-align: center; margin-top: 16px; font-size: .875rem; color: var(--text-muted); }
.modal-footer-links a { color: var(--accent); }
.modal-footer-links a:hover { text-decoration: underline; }

/* 25. PAGINATION */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 12px;
  border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); transition: all var(--transition);
}
.page-btn:hover { background: var(--bg-hover); border-color: var(--border-h); color: var(--text-primary); }
.page-btn.active { background: var(--gradient); border-color: transparent; color: #fff; }

/* 26. EMPTY STATE */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: .6; }
.empty-state h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; }

/* 27. FOOTER */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 36px 0 24px; margin-top: auto;
}
.footer-inner {
  display: flex; gap: 32px; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px;
}
.footer-brand .logo-text { font-size: 1.1rem; font-weight: 700; display: block; margin-bottom: 6px; }
.footer-brand p { font-size: .85rem; color: var(--text-muted); max-width: 220px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .875rem; color: var(--text-secondary); }
.footer-links a:hover { color: var(--text-primary); }
.footer-stats { display: flex; flex-direction: column; gap: 6px; }
.footer-stats span { font-size: .85rem; color: var(--text-muted); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; text-align: center; }
.footer-bottom p { font-size: .82rem; color: var(--text-muted); }

/* 28. ADMIN */
.admin-layout { display: flex; gap: 24px; align-items: flex-start; }
.admin-sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 88px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px; overflow: hidden;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--text-secondary);
  transition: all var(--transition);
}
.admin-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.admin-nav-item.active { background: rgba(99,102,241,.15); color: var(--accent); border-left: 3px solid var(--accent); }
.admin-nav-divider { height: 1px; background: var(--border); margin: 6px 0; }
.admin-main { flex: 1; min-width: 0; }
.admin-top {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.admin-page-title { font-size: 1.4rem; font-weight: 700; }
.admin-search { display: flex; gap: 10px; margin-left: auto; }
.admin-search .form-input { max-width: 260px; }

.admin-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.admin-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 4px solid var(--card-color, var(--accent));
  border-radius: var(--radius); padding: 20px;
  transition: all var(--transition);
}
.admin-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.asc-icon { font-size: 1.6rem; margin-bottom: 10px; }
.asc-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.asc-label { font-size: .85rem; color: var(--text-secondary); font-weight: 500; }
.asc-sub { font-size: .78rem; color: var(--text-muted); margin-top: 6px; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
}
.admin-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.admin-card-header h3 { font-size: 1rem; font-weight: 600; }
.admin-card-link { font-size: .85rem; color: var(--accent); }
.admin-card-link:hover { text-decoration: underline; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead th {
  padding: 12px 16px; text-align: left; font-size: .8rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); background: var(--bg-surface);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.admin-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--bg-hover); }
.admin-table tbody tr.row-banned td { opacity: .6; }
.table-user { display: flex; align-items: center; gap: 8px; }
.table-topic-link { color: var(--text-primary); font-weight: 500; }
.table-topic-link:hover { color: var(--accent); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.action-select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: .82rem; padding: 4px 8px; cursor: pointer;
}
.action-select:focus { outline: none; border-color: var(--accent); }

/* 29. UTILITIES */
.toggleEl { display: none !important; }
.admin-card form { padding: 20px; }

/* 30. RESPONSIVE */
@media (max-width: 900px) {
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; position: static; }
  .topic-last { display: none; }
  .profile-activity { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-nav {
    display: none; flex-direction: column; gap: 4px;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: rgba(11,12,18,.96); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); padding: 12px;
    z-index: 99;
  }
  .main-nav.open { display: flex; }
  .site-header { position: relative; }
  .burger { display: flex; }
  .hero-section { padding: 40px 16px 32px; }
  .hero-title { font-size: 1.8rem; }
  .categories-grid { grid-template-columns: 1fr; }
  .category-header-block { padding: 16px; }
  .topic-row { flex-wrap: wrap; padding: 14px 16px; }
  .topic-stats { display: none; }
  .post-card { flex-direction: column; }
  .post-author {
    flex-direction: row; max-width: none;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }
  .post-author-stats { display: none; }
  .form-page-card { padding: 20px; }
  .profile-card { padding: 20px; }
  .modal { max-width: 100%; border-radius: var(--radius-lg); }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .btn-lg { padding: 10px 20px; font-size: .95rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .header-actions .btn-ghost { display: none; }
  .main-content { padding: 20px 0; }
  .category-card { padding: 14px; }
  .cat-stats { display: none; }
  .admin-top { flex-direction: column; align-items: flex-start; }
  .admin-search { margin-left: 0; width: 100%; }
  .admin-search .form-input { max-width: none; flex: 1; }
  .footer-inner { flex-direction: column; gap: 20px; }
  .profile-card { flex-direction: column; }
}

/* 31. GOOGLE AUTH BUTTON */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  background: #fff; color: #3c4043;
  border: 1px solid #dadce0; border-radius: var(--radius);
  font-size: .95rem; font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.btn-google:hover {
  background: #f8f9fa; border-color: #bdc1c6;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  color: #3c4043; transform: translateY(-1px);
}

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-muted); font-size: .82rem;
}
.auth-divider::before,
.auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* 32. SPINNER */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; }

/* 33. ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* 32. AUTH PAGE CENTERING */
.auth-page .hero-section { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
