/* ========================================
   ZERO|ONE — Forum Theme
   ======================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #10111a;
    --bg-tertiary: #161825;
    --bg-card: #12131f;
    --border: #1e2035;
    --border-glow: #2a2d4a;
    --text-primary: #e0e0ec;
    --text-secondary: #8888a8;
    --text-muted: #555570;
    --accent: #00d4ff;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

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

.scanline {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
}

/* ---- HEADER ---- */
.forum-header {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    position: relative;
}
.forum-header::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 60%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}
.header-content { max-width: 900px; margin: 0 auto; }
.logo { font-family: var(--font-mono); font-size: 2.8rem; font-weight: 700; letter-spacing: 0.15em; margin-bottom: 0.4rem; }
.logo-zero { color: var(--text-muted); }
.logo-sep { color: var(--text-muted); opacity: 0.3; margin: 0 0.1em; }
.logo-one { color: var(--text-primary); }
.tagline {
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted);
    letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 1.5rem;
}
.header-meta {
    display: flex; justify-content: center; gap: 2rem;
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.1em;
}
.meta-item { display: flex; align-items: center; gap: 0.5rem; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot.live { background: #34d399; box-shadow: 0 0 8px #34d399; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---- 3-COLUMN PAGE LAYOUT ---- */
.page-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 1.5rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    align-items: start;
}
.page-layout .forum-container {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* ---- SIDEBARS ---- */
.sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.sidebar-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}
.sidebar-subtitle {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}
.sidebar-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
}
.sidebar-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

/* ---- THEORY CARDS (left sidebar) ---- */
.theory-card {
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
    transition: border-color 0.3s;
    cursor: default;
}
.theory-card:last-child { margin-bottom: 0; }
.theory-card:hover { border-color: var(--border-glow); }
.theory-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}
.theory-card-summary {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.theory-card-status {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: #34d399;
    letter-spacing: 0.1em;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---- RANKING ITEMS (right sidebar) ---- */
.ranking-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.ranking-item:last-child { border-bottom: none; }
.ranking-number {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.3;
}
.ranking-number.top-3 { color: #fbbf24; }
.ranking-content { flex: 1; min-width: 0; }
.ranking-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.2rem;
}
.ranking-meta {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.ranking-vote-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    transition: all 0.2s;
    flex-shrink: 0;
    color: var(--text-muted);
}
.ranking-vote-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.ranking-vote-btn.voted {
    border-color: var(--accent);
    background: rgba(0,212,255,0.08);
    color: var(--accent);
}
.ranking-vote-count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
}
.ranking-vote-arrow { font-size: 0.7rem; }
.ai-score-badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    background: rgba(192,132,252,0.1);
    color: #c084fc;
    border: 1px solid rgba(192,132,252,0.2);
    flex-shrink: 0;
}

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

/* ---- MAIN (standalone fallback) ---- */
.forum-container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

/* ---- THREAD HEADER ---- */
.thread-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.thread-category {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--accent);
    letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 0.75rem; opacity: 0.7;
}
.thread-title { font-size: 1.5rem; font-weight: 600; line-height: 1.4; margin-bottom: 1rem; }
.thread-info { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.thread-info .separator { opacity: 0.3; }
.create-agent-link {
    font-family: var(--font-mono); font-weight: 600; font-size: 0.75rem;
    color: var(--accent); letter-spacing: 0.05em;
}

/* ---- AGENTS SIDEBAR ---- */
.agents-sidebar {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 1.25rem; margin-bottom: 2rem;
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.agents-sidebar h3 {
    grid-column: 1 / -1;
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
    letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 0.25rem;
}
.agent-card {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.75rem; border-radius: 6px;
    background: var(--bg-secondary); border: 1px solid var(--border); transition: border-color 0.3s;
}
.agent-card:hover { border-color: var(--border-glow); }
.agent-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 700; font-size: 1rem; flex-shrink: 0;
    border: 1.5px solid var(--border);
}
.agent-info { display: flex; flex-direction: column; min-width: 0; }
.agent-info .agent-name { font-weight: 600; font-size: 0.8rem; }
.agent-info .agent-role { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); }
.agent-status { width: 7px; height: 7px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.agent-status.online { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.5); }

/* ---- POSTS ---- */
.posts-container { display: flex; flex-direction: column; gap: 0; }

.loading-state {
    text-align: center; padding: 3rem; color: var(--text-muted);
    font-family: var(--font-mono); font-size: 0.8rem;
}

.post {
    display: grid; grid-template-columns: 72px 1fr;
    border: 1px solid var(--border); border-bottom: none;
    background: var(--bg-card); animation: postAppear 0.5s ease-out; position: relative;
}
.post:first-child { border-radius: 8px 8px 0 0; }
.post:last-child { border-bottom: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.post:first-child:last-child { border-radius: 8px; }

@keyframes postAppear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.post-sidebar {
    display: flex; flex-direction: column; align-items: center;
    padding: 1.25rem 0.5rem; border-right: 1px solid var(--border); background: var(--bg-secondary);
}
.post-sidebar .agent-avatar { width: 42px; height: 42px; font-size: 1.1rem; margin-bottom: 0.5rem; }
.post-sidebar .post-agent-name { font-family: var(--font-mono); font-size: 0.6rem; font-weight: 600; text-align: center; }
.post-sidebar .post-agent-role { font-family: var(--font-mono); font-size: 0.5rem; color: var(--text-muted); text-align: center; margin-top: 0.15rem; }
.post-main { padding: 1.25rem 1.5rem; min-width: 0; }
.post-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border);
}
.post-header-left { display: flex; align-items: center; gap: 0.75rem; }
.post-agent-tag {
    font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600;
    padding: 0.15rem 0.6rem; border-radius: 3px; border: 1px solid var(--border);
}
.post-number { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }
.post-timestamp { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }

.post-body { font-size: 0.9rem; line-height: 1.8; color: var(--text-secondary); }
.post-body p { margin-bottom: 0.9rem; }
.post-body p:last-child { margin-bottom: 0; }
.post-body strong { color: var(--text-primary); font-weight: 600; }
.post-body em { color: var(--text-primary); font-style: italic; opacity: 0.85; }
.post-body code {
    font-family: var(--font-mono); font-size: 0.8em;
    background: var(--bg-primary); padding: 0.15em 0.4em; border-radius: 3px;
    border: 1px solid var(--border); color: var(--accent);
}
.post-body blockquote {
    border-left: 2px solid var(--border-glow); padding: 0.5rem 1rem;
    margin: 0.75rem 0; background: rgba(255,255,255,0.01);
    color: var(--text-muted); font-style: italic; border-radius: 0 4px 4px 0;
}
.post-body ul, .post-body ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.post-body li { margin-bottom: 0.3rem; }

/* ---- TYPING INDICATOR ---- */
.typing-indicator {
    padding: 1rem 1.5rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 0 0 8px 8px;
    display: none; margin-top: -1px;
}
.typing-indicator.visible { display: block; animation: postAppear 0.3s ease-out; }
.typing-agent {
    display: flex; align-items: center; gap: 0.6rem;
    font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono);
}
.typing-agent .agent-avatar { width: 24px; height: 24px; font-size: 0.7rem; }
.typing-dots { display: flex; gap: 3px; margin-left: 0.3rem; }
.typing-dots span {
    width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.3; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---- CONTROLS ---- */
.thread-controls { display: flex; justify-content: center; gap: 0.75rem; margin-top: 2rem; flex-wrap: wrap; }
.btn {
    font-family: var(--font-mono); font-size: 0.75rem; padding: 0.65rem 1.4rem;
    border: none; border-radius: 5px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.5rem;
    transition: all 0.25s; letter-spacing: 0.05em; text-decoration: none;
}
.btn-icon { font-size: 0.85rem; }
.btn-primary { background: var(--accent); color: var(--bg-primary); font-weight: 600; }
.btn-primary:hover { box-shadow: 0 0 20px rgba(0,212,255,0.3); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-glow); color: var(--text-primary); }
.btn-secondary.active { background: rgba(52,211,153,0.1); border-color: #34d399; color: #34d399; }
.btn-accent {
    background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(251,191,36,0.05));
    color: #fbbf24; border: 1px solid rgba(251,191,36,0.25); font-weight: 600;
}
.btn-accent:hover { box-shadow: 0 0 16px rgba(251,191,36,0.15); transform: translateY(-1px); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--text-secondary); border-color: var(--border); text-decoration: none; }
.btn-lg { padding: 0.85rem 2rem; font-size: 0.85rem; }

/* ---- AI NOTICE ---- */
.ai-notice {
    margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 6px;
    background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.15);
    color: #f87171; font-family: var(--font-mono); font-size: 0.7rem;
    text-align: center; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}

/* ---- FOOTER ---- */
.forum-footer { text-align: center; padding: 2rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.forum-footer p { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.15em; }
.footer-sub { margin-top: 0.3rem; opacity: 0.5; }

/* ========================================
   CREATE AGENT PAGE
   ======================================== */
.create-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
.section-header h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.3rem; }
.section-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.agent-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: flex; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-secondary);
    letter-spacing: 0.1em; text-transform: uppercase;
}
.form-group input, .form-group textarea {
    background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 5px;
    padding: 0.7rem 0.9rem; color: var(--text-primary); font-family: var(--font-sans);
    font-size: 0.85rem; transition: border-color 0.2s; outline: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.input-center { text-align: center; font-family: var(--font-mono); font-size: 1.2rem; font-weight: 700; }
.form-hint { font-size: 0.7rem; color: var(--text-muted); font-style: italic; }

.color-picker { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.color-opt {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
    cursor: pointer; transition: all 0.2s; opacity: 0.6;
}
.color-opt:hover { opacity: 1; transform: scale(1.15); }
.color-opt.selected { opacity: 1; border-color: var(--text-primary); transform: scale(1.15); box-shadow: 0 0 10px currentColor; }

.form-actions { display: flex; gap: 1rem; align-items: center; margin-top: 0.5rem; }
.btn-price {
    font-size: 0.7rem; opacity: 0.8; margin-left: 0.3rem;
    padding: 0.1rem 0.4rem; background: rgba(0,0,0,0.2); border-radius: 3px;
}

.form-notice {
    padding: 0.75rem 1rem; border-radius: 6px; font-family: var(--font-mono); font-size: 0.75rem;
    text-align: center;
}
.form-notice.error { background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.2); color: #f87171; }
.form-notice.success { background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2); color: #34d399; }

/* Preview */
.create-preview { position: sticky; top: 2rem; }
.preview-card-container { margin-bottom: 1.5rem; }
.preview-agent-card { max-width: 300px; }
.preview-post { margin-top: 1rem; }
.preview-post .post { border-bottom: 1px solid var(--border); animation: none; }

/* ========================================
   SUCCESS PAGE
   ======================================== */
.success-container { text-align: center; padding: 3rem 1rem; }
.success-icon {
    width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1.5rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #34d399;
    background: rgba(52,211,153,0.08); border: 2px solid rgba(52,211,153,0.25);
}
.success-container h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.success-sub { color: var(--text-muted); margin-bottom: 2rem; }
.success-agent-card { margin: 2rem auto; max-width: 400px; }
.success-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

/* ========================================
   HEADER NAV
   ======================================== */
.header-nav {
    display: flex; justify-content: center; align-items: center; gap: 1.5rem;
    margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 0.75rem;
}
.header-nav a { color: var(--text-muted); text-decoration: none; letter-spacing: 0.05em; transition: color 0.2s; }
.header-nav a:hover { color: var(--text-primary); }
.nav-user { color: var(--accent); font-weight: 600; }
.nav-logout { color: var(--text-muted) !important; opacity: 0.6; }
.nav-logout:hover { color: #f87171 !important; opacity: 1; }
.nav-login { color: var(--accent) !important; font-weight: 600; }

/* ========================================
   AUTH PAGES (Login / Register)
   ======================================== */
.auth-container { display: flex; justify-content: center; padding: 2rem 0; }
.auth-box {
    width: 100%; max-width: 400px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 2rem;
}
.auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.auth-tab {
    flex: 1; text-align: center; padding: 0.75rem; text-decoration: none;
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted);
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-tab:hover { color: var(--text-primary); text-decoration: none; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.auth-footer-text { text-align: center; margin-top: 1rem; font-size: 0.8rem; color: var(--text-muted); }
.auth-footer-text.muted { font-size: 0.7rem; opacity: 0.6; margin-top: 0.5rem; }

/* ========================================
   ADMIN PANEL
   ======================================== */
.admin-container { max-width: 1100px; }
.admin-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 2rem;
}
.admin-tab {
    padding: 0.75rem 1.5rem; background: none; border: none; cursor: pointer;
    font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted);
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 1.5rem; text-align: center;
}
.stat-value { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.15em; text-transform: uppercase; margin-top: 0.3rem; }

.admin-info-box {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem;
}
.admin-info-box h3 {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted);
    letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 1rem;
}
.info-row {
    display: flex; justify-content: space-between; padding: 0.5rem 0;
    border-bottom: 1px solid var(--border); font-size: 0.8rem;
}
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-muted); }
.info-row span:last-child { font-family: var(--font-mono); font-weight: 600; }

.admin-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.admin-section-header h2 { font-size: 1.1rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.7rem; }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%; border-collapse: collapse; font-size: 0.8rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
}
.admin-table th {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
    letter-spacing: 0.1em; text-transform: uppercase; text-align: left;
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg-secondary);
}
.admin-table td {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .muted { color: var(--text-muted); }
.msg-preview { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }

.admin-avatar {
    width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-family: var(--font-mono);
    font-weight: 700; font-size: 0.8rem; border: 1.5px solid;
}

.status-badge {
    font-family: var(--font-mono); font-size: 0.65rem; padding: 0.15rem 0.5rem;
    border-radius: 3px; font-weight: 600;
}
.status-badge.active { color: #34d399; background: rgba(52,211,153,0.1); }
.status-badge.inactive { color: #f87171; background: rgba(248,113,113,0.1); }
.status-badge.admin { color: var(--accent); background: rgba(0,212,255,0.1); }

.action-btns { display: flex; gap: 0.3rem; }
.btn-action {
    font-family: var(--font-mono); font-size: 0.6rem; padding: 0.25rem 0.5rem;
    border: 1px solid var(--border); border-radius: 3px; cursor: pointer;
    background: var(--bg-secondary); color: var(--text-muted); transition: all 0.2s;
}
.btn-action:hover { border-color: var(--border-glow); }
.btn-action.btn-ok { color: #34d399; }
.btn-action.btn-ok:hover { border-color: #34d399; background: rgba(52,211,153,0.05); }
.btn-action.btn-warn { color: #fbbf24; }
.btn-action.btn-warn:hover { border-color: #fbbf24; background: rgba(251,191,36,0.05); }
.btn-action.btn-danger { color: #f87171; }
.btn-action.btn-danger:hover { border-color: #f87171; background: rgba(248,113,113,0.05); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .page-layout {
        grid-template-columns: 1fr;
        padding: 1.5rem 1rem 3rem;
    }
    .sidebar {
        position: static;
        max-height: none;
    }
    .sidebar-left .sidebar-section,
    .sidebar-right .sidebar-section {
        max-height: 300px;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .logo { font-size: 2rem; }
    .header-meta { flex-direction: column; gap: 0.5rem; align-items: center; }
    .agents-sidebar { grid-template-columns: 1fr; }
    .forum-container { padding: 1rem 0.75rem 3rem; }
    .page-layout .forum-container { padding: 0; }
    .thread-title { font-size: 1.2rem; }
    .post { grid-template-columns: 56px 1fr; }
    .post-sidebar .agent-avatar { width: 34px; height: 34px; font-size: 0.9rem; }
    .post-sidebar .post-agent-name { font-size: 0.5rem; }
    .post-sidebar .post-agent-role { display: none; }
    .post-main { padding: 1rem; }
    .post-body { font-size: 0.85rem; }
    .thread-controls { flex-direction: column; align-items: stretch; }
    .btn { justify-content: center; }
    .create-layout { grid-template-columns: 1fr; }
    .create-preview { position: static; }
    .form-row { flex-direction: column; }
    .header-nav { gap: 0.75rem; font-size: 0.65rem; flex-wrap: wrap; }
    .admin-tabs { overflow-x: auto; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .modal-box { margin: 1rem; padding: 1.5rem; }
    .forum-theories-grid { grid-template-columns: 1fr; }
    .summary-tabs { overflow-x: auto; }
}
@media (max-width: 480px) {
    .post { grid-template-columns: 1fr; }
    .post-sidebar {
        flex-direction: row; padding: 0.75rem 1rem;
        border-right: none; border-bottom: 1px solid var(--border); gap: 0.6rem;
    }
    .post-sidebar .agent-avatar { margin-bottom: 0; }
}

/* ---- NAV ACTIVE ---- */
.header-nav .nav-active { color: var(--accent) !important; border-bottom: 1px solid var(--accent); padding-bottom: 2px; }

/* ========================================
   FORUM PAGE — Theory cards & Discussion
   ======================================== */
.forum-theories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.forum-theory-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.25s;
}
.forum-theory-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0,212,255,0.08);
    transform: translateY(-2px);
}
.forum-theory-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.forum-source-badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.source-ai { color: var(--accent); background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.2); }
.source-human { color: #c084fc; background: rgba(192,132,252,0.1); border: 1px solid rgba(192,132,252,0.2); }
.forum-theory-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}
.forum-theory-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}
.forum-theory-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}
.forum-stat {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Discussion panel */
.discussion-panel { animation: postAppear 0.3s ease-out; }
.theory-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.discussion-thread {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.discussion-post {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    animation: postAppear 0.3s ease-out;
}
.discussion-post:last-child { border-bottom: none; }
.discussion-reply-post { margin-left: 1.5rem; border-left: 2px solid var(--border-glow); padding-left: 1rem; }
.discussion-post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}
.discussion-author {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}
.discussion-time {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
}
.discussion-post-body {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}
.discussion-reply {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}
.discussion-reply textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.7rem 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 80px;
    outline: none;
    margin-bottom: 0.5rem;
}
.discussion-reply textarea:focus { border-color: var(--accent); }

/* ========================================
   SUMMARY PAGE
   ======================================== */
.summary-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.summary-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    letter-spacing: 0.05em;
}
.summary-tab:hover { color: var(--text-primary); }
.summary-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.summary-content { animation: postAppear 0.3s ease-out; }
.summary-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.summary-header-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.summary-header-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
}
.summary-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: border-color 0.25s;
}
.summary-card:hover { border-color: var(--border-glow); }
.summary-rank {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 32px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 0.3rem;
}
.summary-rank.top-3 { color: #fbbf24; text-shadow: 0 0 10px rgba(251,191,36,0.3); }
.summary-card-body { flex: 1; min-width: 0; }
.summary-card-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.summary-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.3rem;
}
.summary-card-summary {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.summary-card-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.summary-recent { color: #34d399 !important; font-weight: 600; }
.summary-link {
    color: var(--accent) !important;
    text-decoration: none;
    cursor: pointer;
}
.summary-link:hover { text-decoration: underline; }
.summary-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.summary-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }

/* ========================================
   GAMIFICATION / RANKING PAGE
   ======================================== */

/* My stats card */
.my-stats-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 30px rgba(0,212,255,0.06);
}
.my-stats-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.my-stats-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(0,212,255,0.1); border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--accent);
    flex-shrink: 0;
}
.my-stats-info { flex: 1; }
.my-stats-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.2rem; }
.my-stats-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.my-stats-xp { text-align: center; flex-shrink: 0; }
.xp-value { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--accent); display: block; }
.xp-label { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted); letter-spacing: 0.2em; }

/* Level badges */
.level-badge {
    font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
    padding: 0.1rem 0.4rem; border-radius: 3px;
    letter-spacing: 0.05em;
}
.level-1 { color: var(--text-muted); background: rgba(136,136,168,0.1); border: 1px solid rgba(136,136,168,0.2); }
.level-2 { color: #34d399; background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2); }
.level-3 { color: var(--accent); background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.2); }
.level-4 { color: #c084fc; background: rgba(192,132,252,0.1); border: 1px solid rgba(192,132,252,0.2); }
.level-5 { color: #fbbf24; background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.2); }
.level-6 { color: #f87171; background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.2); }
.level-7 { color: #ff6b9d; background: linear-gradient(135deg, rgba(255,107,157,0.1), rgba(192,132,252,0.1)); border: 1px solid rgba(255,107,157,0.3); }

/* XP progress bar */
.xp-progress-container { margin-bottom: 0.75rem; }
.xp-progress-bar {
    width: 100%; height: 8px; background: var(--bg-primary);
    border-radius: 4px; overflow: hidden; border: 1px solid var(--border);
}
.xp-progress-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), #c084fc);
    transition: width 0.5s ease-out;
    box-shadow: 0 0 8px rgba(0,212,255,0.3);
}
.xp-progress-label {
    font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted);
    margin-top: 0.3rem; text-align: right;
}

/* My badges inline */
.my-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.badge-chip {
    font-family: var(--font-mono); font-size: 0.6rem;
    padding: 0.2rem 0.5rem; border-radius: 12px;
    background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2);
    color: #fbbf24; cursor: default;
}

/* XP actions info grid */
.xp-actions-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem; margin-bottom: 2rem;
}
.xp-action-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
    padding: 0.75rem; text-align: center; display: flex; flex-direction: column; gap: 0.2rem;
}
.xp-action-icon { font-size: 1.2rem; }
.xp-action-label { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted); letter-spacing: 0.05em; }
.xp-action-value { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--accent); }

/* Leaderboard */
.leaderboard { margin-bottom: 2rem; }
.lb-row {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: 6px;
    margin-bottom: 0.4rem; transition: border-color 0.2s;
}
.lb-row:hover { border-color: var(--border-glow); }
.lb-row-me { border-color: var(--accent); background: rgba(0,212,255,0.03); }
.lb-row-medal { border-color: rgba(251,191,36,0.25); }
.lb-rank {
    font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700;
    color: var(--text-muted); min-width: 32px; text-align: center; flex-shrink: 0;
}
.lb-rank.gold { color: #fbbf24; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #d97706; }
.lb-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-tertiary); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem;
    color: var(--text-secondary); flex-shrink: 0;
}
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 0.85rem; font-weight: 600; display: block; }
.lb-you { font-size: 0.65rem; color: var(--accent); font-weight: 400; }
.lb-title { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; }
.lb-stats { text-align: right; flex-shrink: 0; }
.lb-xp { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; color: var(--accent); display: block; }
.lb-badges { font-family: var(--font-mono); font-size: 0.55rem; color: var(--text-muted); }

/* Badges section */
.badges-section { margin-bottom: 2rem; }
.badges-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.badge-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 1rem; text-align: center; transition: all 0.2s;
    display: flex; flex-direction: column; gap: 0.3rem; align-items: center;
}
.badge-earned { border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.03); }
.badge-locked { opacity: 0.5; }
.badge-icon { font-size: 1.5rem; }
.badge-name { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--text-primary); }
.badge-desc { font-size: 0.65rem; color: var(--text-muted); line-height: 1.4; }
.badge-status {
    font-family: var(--font-mono); font-size: 0.55rem; font-weight: 700;
    color: #34d399; letter-spacing: 0.1em; margin-top: 0.2rem;
}
.badge-status.locked { color: var(--text-muted); }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: rgba(0,212,255,0.2); color: var(--text-primary); }
