/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #232a3b;
    --bg-surface: rgba(26, 31, 46, 0.85);
    --bg-input: #151a28;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-violet: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-blue: #3b82f6;
    --gradient-main: linear-gradient(135deg, #8b5cf6, #06b6d4);
    --gradient-warm: linear-gradient(135deg, #f43f5e, #f59e0b);
    --gradient-cool: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gradient-hero: linear-gradient(135deg, #0b0f19 0%, #1a1033 50%, #0b0f19 100%);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(139, 92, 246, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --header-height: 68px;
    --sidebar-width: 320px;
    --container-max: 1320px;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.9);
    --bg-input: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-violet: #7c3aed;
    --accent-cyan: #0891b2;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(124, 58, 237, 0.25);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.08);
    --gradient-hero: linear-gradient(135deg, #f1f5f9 0%, #ede9fe 50%, #f1f5f9 100%);
}

/* ===== GLOBAL STYLES ===== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

a {
    color: var(--accent-violet);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-cyan);
}

img {
    max-width: 100%;
    height: auto;
}

::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-violet);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* ===== CONTAINER ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all var(--transition-base);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-main);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: 2px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 2px;
    padding: 2px 6px;
    border: 1px solid var(--accent-violet);
    border-radius: var(--radius-sm);
    color: var(--accent-violet);
    text-transform: uppercase;
}

.nav {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.nav-link.active {
    color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.12);
}

.nav-link i {
    font-size: 0.82rem;
}

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

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 220px;
}

.search-bar:hover {
    border-color: var(--border-hover);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    width: 100%;
    cursor: pointer;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar kbd {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    white-space: nowrap;
}

.theme-toggle {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
}

.theme-toggle:hover {
    border-color: var(--border-hover);
    color: var(--accent-amber);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--accent-violet);
    border: 1.5px solid var(--accent-violet);
}

.btn-outline:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-violet);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 10px;
}

.btn-ghost:hover {
    color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.08);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-new-topic span {
    display: inline;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== AD CONTAINERS ===== */
.ad-container {
    margin: 0 auto;
    overflow: hidden;
}

.ad-leaderboard {
    max-width: var(--container-max);
    padding: 0 24px;
    margin-top: calc(var(--header-height) + 16px);
    margin-bottom: 0;
}

.ad-footer-banner {
    margin-top: 0;
    margin-bottom: 32px;
    padding: 0;
}

.ad-sidebar-unit {
    margin-bottom: 20px;
}

.ad-placeholder {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.ad-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-main);
    opacity: 0.03;
    pointer-events: none;
}

.ad-placeholder:hover {
    border-color: var(--border-hover);
}

.ad-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ad-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ad-content i {
    font-size: 1.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ad-content p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.ad-size {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.ad-inline {
    margin: 16px 0;
}

/* ===== MAIN LAYOUT ===== */
.main {
    padding-top: 16px;
    padding-bottom: 60px;
    min-height: calc(100vh - var(--header-height));
}

.main-layout {
    position: relative;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 28px;
    align-items: start;
}

.content-main {
    min-width: 0;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb a:hover {
    color: var(--accent-violet);
}

.breadcrumb .separator {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== CATEGORY CARDS ===== */
.categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.categories-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.category-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--cat-color, var(--gradient-main));
    border-radius: 4px 0 0 4px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.category-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cat-color, var(--gradient-main));
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.category-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding-left: 62px;
}

.subcat-tag {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-violet);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.category-card:hover .subcat-tag {
    background: rgba(139, 92, 246, 0.15);
}

.category-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 62px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.category-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-stats i {
    font-size: 0.7rem;
}

.category-last-post {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.category-last-post .last-post-avatar {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ===== TOPIC LIST ===== */
.topics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.topics-header h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topics-header h2 .cat-icon-sm {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.9rem;
}

.topics-filters {
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.filter-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.filter-btn.active {
    color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.2);
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topic-row {
    display: grid;
    grid-template-columns: 1fr 100px 80px 140px;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0;
    transform: translateY(12px);
    animation: fadeInUp 0.4s ease forwards;
}

.topic-row:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.topic-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.topic-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.topic-content {
    flex: 1;
    min-width: 0;
}

.topic-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.topic-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.topic-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-pinned {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.badge-hot {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

.badge-locked {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-muted);
}

.badge-solved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.topic-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.topic-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topic-tags {
    display: flex;
    gap: 4px;
    margin-left: 4px;
}

.topic-tag {
    font-size: 0.68rem;
    padding: 1px 7px;
    background: rgba(6, 182, 212, 0.08);
    color: var(--accent-cyan);
    border-radius: var(--radius-full);
}

.topic-stat {
    text-align: center;
    font-size: 0.82rem;
}

.topic-stat-value {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.topic-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topic-last-reply {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.topic-last-reply .reply-avatar {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.topic-last-reply .reply-info {
    min-width: 0;
}

.topic-last-reply .reply-user {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-last-reply .reply-time {
    font-size: 0.72rem;
}

/* ===== THREAD / POSTS ===== */
.thread-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
}

.thread-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.thread-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.thread-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.thread-tags {
    display: flex;
    gap: 6px;
    margin-top: 14px;
}

.thread-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 12px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-violet);
    border-radius: var(--radius-full);
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.5s ease forwards;
}

.post-card.post-op {
    border-color: rgba(139, 92, 246, 0.2);
}

.post-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
}

.post-author {
    padding: 24px 16px;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

[data-theme="light"] .post-author {
    background: rgba(0, 0, 0, 0.02);
}

.post-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    border: 3px solid var(--border-color);
}

.post-username {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.post-role {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.role-admin {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
}

.role-mod {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.role-member {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-violet);
}

.role-author {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
}

.role-vip {
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-cyan);
}

.post-user-stats {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.post-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-primary);
    flex: 1;
}

.post-text p {
    margin-bottom: 12px;
}

.post-text p:last-child {
    margin-bottom: 0;
}

.post-text code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 2px 6px;
    background: var(--bg-primary);
    border-radius: 4px;
    color: var(--accent-cyan);
}

.post-text pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
}

.post-text blockquote {
    border-left: 3px solid var(--accent-violet);
    padding: 12px 16px;
    margin: 12px 0;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.post-action:hover {
    color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.08);
}

.post-action.liked {
    color: var(--accent-rose);
}

.reply-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 16px;
}

.reply-box h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-box textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
}

.reply-box textarea:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.reply-box .reply-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 16px);
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    transition: border-color var(--transition-base);
}

.widget:hover {
    border-color: var(--border-hover);
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.widget-title i {
    color: var(--accent-violet);
}

.widget-login {
    text-align: center;
}

.widget-login h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.widget-login h3 i {
    color: var(--accent-violet);
}

.widget-login p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.widget-login .btn {
    margin-bottom: 8px;
}

.widget-login .btn:last-child {
    margin-bottom: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trending-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.trending-item:hover {
    background: var(--bg-card-hover);
}

.trending-rank {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-violet);
    min-width: 22px;
}

.trending-info {
    flex: 1;
    min-width: 0;
}

.trending-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.trending-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

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

.online-user {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.online-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-emerald);
    border-radius: var(--radius-full);
    animation: pulse 2s ease infinite;
}

.text-online {
    color: var(--accent-emerald);
    font-size: 0.5rem;
    animation: pulse 2s ease infinite;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.page-btn:hover {
    border-color: var(--border-hover);
    color: var(--accent-violet);
}

.page-btn.active {
    background: var(--gradient-main);
    border-color: transparent;
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--accent-violet);
}

.modal-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.modal-close:hover {
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.3);
}

.modal-body {
    padding: 26px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 26px;
    border-top: 1px solid var(--border-color);
}

.modal-search {
    max-width: 580px;
    max-height: 70vh;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.search-modal-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
}

.search-modal-input i {
    color: var(--accent-violet);
    font-size: 1.1rem;
}

.search-modal-input input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
}

.search-modal-input input::placeholder {
    color: var(--text-muted);
}

.search-modal-input kbd {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 3px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
}

.search-results {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.search-hint {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
}

.search-hint i {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: block;
    color: var(--accent-amber);
}

.search-hint p {
    font-size: 0.88rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-result-item:hover {
    background: var(--bg-card);
}

.search-result-item i {
    color: var(--accent-violet);
    width: 20px;
    text-align: center;
}

.search-result-item .result-title {
    font-size: 0.88rem;
    font-weight: 500;
}

.search-result-item .result-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

.editor-toolbar {
    display: flex;
    gap: 2px;
    padding: 6px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-bottom: -1px;
}

.editor-toolbar button {
    width: 32px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.82rem;
}

.editor-toolbar button:hover {
    color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.1);
}

.editor-toolbar + textarea {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    color: var(--text-primary);
    animation: slideInRight 0.3s ease;
    min-width: 280px;
}

.toast i {
    font-size: 1.1rem;
}

.toast.toast-success i {
    color: var(--accent-emerald);
}

.toast.toast-error i {
    color: var(--accent-rose);
}

.toast.toast-info i {
    color: var(--accent-blue);
}

/* ===== LOADING SKELETONS ===== */
.loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-card {
    height: 120px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.05), transparent);
    animation: shimmer 1.5s infinite;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 48px 0 0;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.footer-logo .logo-text {
    font-size: 1.2rem;
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer-social {
    display: flex;
    gap: 8px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.footer-social a:hover {
    border-color: var(--accent-violet);
    color: var(--accent-violet);
    transform: translateY(-2px);
}

.footer h4 {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 8px;
}

.footer li a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.footer li a:hover {
    color: var(--accent-violet);
    padding-left: 4px;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.text-danger {
    color: var(--accent-rose);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* ===== BACK BUTTON ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 16px;
    font-family: var(--font-body);
}

.back-btn:hover {
    border-color: var(--border-hover);
    color: var(--accent-violet);
}

/* ===== AUTH MODALS ===== */
.modal-auth {
    max-width: 480px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo .logo-icon {
    margin: 0 auto 12px;
}

.auth-logo p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 42px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.88rem;
    padding: 4px;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--accent-violet);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    font-size: 0.82rem;
}

.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent-violet);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.form-link {
    font-size: 0.82rem;
    color: var(--accent-violet);
}

.form-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== LOGGED-IN USER WIDGET ===== */
.widget-logged-in {
    text-align: center;
}

.widget-logged-in .logged-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 10px;
    border: 3px solid var(--border-color);
    position: relative;
}

.widget-logged-in .logged-avatar .online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--accent-emerald);
    border: 2px solid var(--bg-card);
    border-radius: var(--radius-full);
}

.widget-logged-in .logged-username {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.widget-logged-in .logged-role {
    display: inline-block;
    margin-bottom: 12px;
}

.widget-logged-in .logged-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.widget-logged-in .logged-stats span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.widget-logged-in .logged-stats strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.widget-logged-in .logged-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ===== ADMIN PANEL ===== */
.admin-panel {
    animation: fadeInUp 0.4s ease forwards;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h2 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-header h2 i {
    color: var(--accent-rose);
}

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 6px;
}

.admin-tab {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.admin-tab.active {
    color: #fff;
    background: var(--gradient-main);
}

.admin-tab .tab-count {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    background: rgba(244, 63, 94, 0.2);
    color: var(--accent-rose);
    border-radius: var(--radius-full);
}

.admin-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    transition: all var(--transition-fast);
}

.admin-stat-card:hover {
    border-color: var(--border-hover);
}

.admin-stat-card .admin-stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin: 0 auto 10px;
    font-size: 1rem;
    color: #fff;
}

.admin-stat-card .admin-stat-val {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-stat-card .admin-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-section-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-section-title i {
    color: var(--accent-violet);
}

/* Admin Tables / Lists */
.admin-table {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table-header {
    display: grid;
    padding: 12px 18px;
    background: var(--bg-primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.admin-table-row {
    display: grid;
    padding: 14px 18px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    transition: background var(--transition-fast);
}

.admin-table-row:last-child {
    border-bottom: none;
}

.admin-table-row:hover {
    background: var(--bg-card-hover);
}

.users-grid {
    grid-template-columns: 2fr 1.5fr 1fr 1fr 120px;
    gap: 12px;
}

.requests-grid {
    grid-template-columns: 1.5fr 1.5fr 2fr 1fr 140px;
    gap: 12px;
}

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-user-cell .mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.admin-user-cell .user-info-col {
    min-width: 0;
}

.admin-user-cell .user-info-col .name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-cell .user-info-col .email {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-select {
    padding: 4px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
}

.role-select:focus {
    border-color: var(--accent-violet);
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}

.status-active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-emerald);
}

.status-pending {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
}

.status-banned {
    background: rgba(244, 63, 94, 0.12);
    color: var(--accent-rose);
}

.status-denied {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
}

.status-locked {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-amber);
}

.admin-actions {
    display: flex;
    gap: 4px;
}

.admin-action-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.78rem;
}

.admin-action-btn:hover {
    border-color: var(--border-hover);
    color: var(--accent-violet);
}

.admin-action-btn.btn-approve:hover {
    color: var(--accent-emerald);
    border-color: var(--accent-emerald);
}

.admin-action-btn.btn-deny:hover {
    color: var(--accent-rose);
    border-color: var(--accent-rose);
}

.admin-action-btn.btn-ban:hover {
    color: var(--accent-rose);
    border-color: var(--accent-rose);
}

.request-reason {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* Permissions Info */
.permissions-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.permissions-card h4 {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.perm-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.perm-item i {
    width: 16px;
    text-align: center;
}

.perm-item i.fa-check {
    color: var(--accent-emerald);
}

.perm-item i.fa-times {
    color: var(--accent-rose);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .sidebar .widget,
    .sidebar .ad-container {
        margin-bottom: 0;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .admin-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .users-grid,
    .requests-grid {
        grid-template-columns: 2fr 1fr 100px;
    }

    .users-grid > :nth-child(5n+2),
    .users-grid > :nth-child(5n+4),
    .requests-grid > :nth-child(5n+3),
    .requests-grid > :nth-child(5n+4) {
        display: none;
    }

    .form-row-2col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) /* nav */ {
    .nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        padding: 12px 24px;
        flex-direction: column;
        gap: 2px;
        transform: translateY(-120%);
        transition: transform var(--transition-base);
        z-index: 999;
        box-shadow: var(--shadow-lg);
    }

    .nav.active {
        transform: translateY(0);
    }

    .hamburger {
        display: flex;
    }

    .search-bar {
        display: none;
    }

    .btn-new-topic span {
        display: none;
    }

    .topic-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .topic-stat,
    .topic-last-reply {
        display: none;
    }

    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-author {
        flex-direction: row;
        padding: 14px 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        gap: 12px;
    }

    .post-avatar-lg {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .post-user-stats {
        flex-direction: row;
        gap: 10px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }

    .header-inner {
        gap: 10px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo-badge {
        display: none;
    }

    .ad-leaderboard {
        padding: 0 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .thread-header {
        padding: 18px;
    }

    .thread-title {
        font-size: 1.1rem;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg);
    }

    .modal-search {
        align-self: flex-start;
        margin-top: 60px;
    }
}
