/* ============================================
   Asgard Scripts Guide — Documentation Portal
   ============================================ */

:root {
    --primary: hsl(187, 80%, 48%);
    --primary-hover: hsl(187, 80%, 40%);
    --primary-light: rgba(20,184,166,.12);
    --secondary: hsl(220, 16%, 14%);
    --secondary-light: hsl(220, 14%, 16%);
    --accent: hsl(187, 80%, 60%);
    --bg: hsl(220, 20%, 8%);
    --bg-alt: hsl(220, 18%, 11%);
    --card: hsl(220, 18%, 11%);
    --card-hover: hsl(220, 16%, 14%);
    --text: hsl(210, 20%, 95%);
    --text-secondary: hsl(210, 12%, 72%);
    --text-muted: hsl(210, 10%, 50%);
    --border: hsl(220, 14%, 16%);
    --border-hover: rgba(20,184,166,.35);
    --success: #22c55e;
    --success-light: rgba(34,197,94,.12);
    --warning: hsl(48, 96%, 53%);
    --warning-light: rgba(234,179,8,.12);
    --danger: #ef4444;
    --danger-light: rgba(239,68,68,.12);
    --shadow-xs: 0 1px 2px rgba(0,0,0,.3);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.3), 0 2px 4px -2px rgba(0,0,0,.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.3);
    --glow: 0 0 20px rgba(20,184,166,.15);
    --discord-blurple: #5865F2;
    --discord-blurple-hover: #4752c4;
    --radius: .5rem;
    --radius-lg: .75rem;
    --header-h: 64px;
    --sidebar-w: 280px;
    --admin-sidebar-w: 260px;
}

/* Force Bootstrap dark mode to use our dark palette */
html[data-bs-theme=dark] {
    --bs-body-bg: hsl(220, 20%, 8%);
    --bs-body-color: hsl(210, 20%, 95%);
    --bs-border-color: hsl(220, 14%, 16%);
    --bs-link-color-rgb: 20, 184, 166;
    --bs-card-bg: hsl(220, 18%, 11%);
    --bs-secondary-bg: hsl(220, 18%, 11%);
    --bs-tertiary-bg: hsl(220, 16%, 14%);
    --bs-emphasis-color: #ffffff;
    --bs-heading-color: #e5e5e5;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; min-height: 100%; scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    background: rgba(10, 10, 10, .85);
    backdrop-filter: blur(10px);
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.site-header .container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 2rem;
}

.site-logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    letter-spacing: -.3px;
}

.site-logo i { font-size: 1.25rem; color: hsl(187, 80%, 48%); }

.site-user-info {
    color: #a3a3a3;
    font-size: .8125rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.site-nav a:not(.btn) {
    color: #a3a3a3;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: color .15s;
}

.site-nav a:not(.btn):hover { color: #fff; }

.btn-header {
    background: rgba(255,255,255,.08);
    color: #e2e8f0 !important;
    border: 1px solid rgba(255,255,255,.1);
    padding: .4rem 1rem;
    border-radius: 6px;
    font-size: .8125rem;
    font-weight: 500;
    transition: all .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.btn-header:hover {
    background: rgba(255,255,255,.15);
    color: #fff !important;
}

.btn-discord {
    background: rgba(88,101,242,.15);
    color: #fff !important;
    border: 1px solid rgba(88,101,242,.35);
    padding: .4rem 1rem;
    border-radius: 6px;
    font-size: .8125rem;
    font-weight: 600;
    transition: all .25s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.btn-discord:hover {
    background: var(--discord-blurple);
    color: #fff !important;
    border-color: var(--discord-blurple);
    box-shadow: 0 0 20px rgba(88,101,242,.4), 0 0 40px rgba(88,101,242,.15);
    transform: translateY(-1px);
}

/* Guide site user info (header) */
.guide-user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: rgba(30,41,59,.6);
    border: 1px solid rgba(148,163,184,.12);
    border-radius: 8px;
    padding: .3rem .5rem .3rem .3rem;
}

.guide-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid rgba(88,101,242,.5);
    flex-shrink: 0;
}

.guide-user-avatar-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(88,101,242,.2);
    border: 1.5px solid rgba(88,101,242,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .6875rem;
    font-weight: 700;
    color: #e2e8f0;
    flex-shrink: 0;
}

.guide-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.guide-user-name {
    font-size: .75rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.guide-user-id {
    font-size: .5625rem;
    color: #64748b;
    font-family: 'JetBrains Mono', Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.guide-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: #64748b;
    text-decoration: none;
    transition: all .2s;
    flex-shrink: 0;
}

.guide-logout-btn:hover {
    background: rgba(239,68,68,.15);
    color: #f87171;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    background: transparent;
    color: #fff;
    padding: 6rem 2rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(20,184,166,.06) 0%, transparent 60%);
}

.hero > * { position: relative; z-index: 1; }

.hero-badge {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: hsl(187, 80%, 60%);
    border: 1px solid rgba(20,184,166,.25);
    padding: .375rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    background: rgba(20,184,166,.08);
}

.hero h1 {
    font-size: 3.25rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin: 0 0 1rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.125rem;
    color: #94a3b8;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-search {
    max-width: 580px;
    margin: 0 auto;
}

.hero-search-wrap {
    display: flex;
    background: hsla(220, 18%, 11%, .6);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: border-color .2s, background .2s;
}

.hero-search-wrap:focus-within {
    border-color: rgba(20,184,166,.5);
    background: hsla(220, 18%, 11%, .8);
    box-shadow: 0 0 20px rgba(20,184,166,.15);
}

.hero-search-wrap i {
    padding: .875rem 0 .875rem 1rem;
    color: #64748b;
    font-size: 1.125rem;
}

.hero-search-wrap input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    padding: .875rem .75rem;
    font-size: .9375rem;
    outline: none;
}

.hero-search-wrap input::placeholder { color: #64748b; }

.hero-search-wrap button {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: .75rem 1.5rem;
    font-weight: 600;
    font-size: .875rem;
    cursor: pointer;
    transition: background .15s;
}

.hero-search-wrap button:hover { background: var(--primary-hover); }
.hero-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.hero-actions .btn { font-size: .875rem; }

/* ============================================
   HOME SECTIONS
   ============================================ */
.home-section {
    padding: 2.5rem 2rem 5rem;
    background: transparent;
    position: relative;
}

.home-section .container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--text);
    margin: 0 0 .5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: hsla(220, 18%, 11%, .85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: all .2s;
    display: block;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--glow);
    transform: translateY(-2px);
    color: var(--text);
    background: hsla(220, 16%, 14%, .9);
}

.category-card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 .375rem;
}

.category-card p {
    color: var(--text-muted);
    font-size: .875rem;
    margin: 0 0 1rem;
}

.category-card-link {
    color: var(--primary);
    font-size: .8125rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.home-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.home-empty i { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; display: block; }
.home-empty h3 { color: var(--text-secondary); margin-bottom: .5rem; }
.home-empty p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ============================================
   GUIDE LAYOUT
   ============================================ */
.guide-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-h) - 60px);
    position: relative;
}

.guide-sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: hsla(220, 20%, 6%, .85);
    backdrop-filter: blur(8px);
    color: hsl(210, 10%, 55%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow: hidden;
}

.guide-sidebar-search {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 .75rem;
    transition: all .15s;
}

.search-input-wrap:focus-within {
    border-color: hsl(187, 80%, 48%);
    background: rgba(255,255,255,.06);
}

.search-input-wrap i { color: hsl(210, 10%, 55%); font-size: .875rem; }

.search-input-wrap input {
    background: none;
    border: none;
    color: hsl(210, 20%, 95%);
    padding: .5rem;
    font-size: .8125rem;
    width: 100%;
    outline: none;
}

.search-input-wrap input::placeholder { color: hsl(210, 10%, 55%); }

.guide-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 0;
}

.guide-category {
    padding: 0 .75rem;
    margin-bottom: .25rem;
}

.guide-category-title {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: hsl(210, 10%, 55%);
    padding: .5rem .75rem;
    display: flex;
    align-items: center;
    gap: .375rem;
    cursor: pointer;
    border-radius: 6px;
    user-select: none;
    transition: background .1s;
}

.guide-category-title:hover { background: rgba(255,255,255,.04); }

.guide-category-chevron {
    font-size: .5rem;
    transition: transform .2s;
}

.guide-category.collapsed .guide-category-chevron { transform: rotate(-90deg); }
.guide-category.collapsed .guide-category-pages { display: none; }

.guide-category-count {
    margin-left: auto;
    font-size: .5625rem;
    background: rgba(255,255,255,.08);
    color: #737373;
    padding: .1rem .4rem;
    border-radius: 10px;
    font-weight: 600;
}

.guide-category-pages {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-link {
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .425rem .75rem .425rem 1.5rem;
    color: hsl(210, 10%, 55%);
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 450;
    border-radius: 6px;
    transition: all .1s;
    line-height: 1.4;
}

.guide-link:hover {
    background: rgba(255,255,255,.04);
    color: hsl(210, 20%, 90%);
}

.guide-link.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(20,184,166,.2);
}

.guide-main {
    flex: 1;
    padding: 2.5rem 3.5rem;
    background: transparent;
    margin-left: var(--sidebar-w);
}

/* Guide sidebar language selector */
.guide-sidebar-lang {
    padding: .5rem .75rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.guide-lang-select-wrap {
    position: relative;
}

.guide-lang-select-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .5rem .75rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: hsl(210, 10%, 55%);
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}

.guide-lang-select-btn:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(20,184,166,.3);
    color: hsl(210, 20%, 90%);
}

.guide-lang-select-btn .bi-translate {
    color: var(--primary);
    font-size: .875rem;
}

.guide-lang-chevron {
    margin-left: auto;
    font-size: .5rem;
    transition: transform .2s;
}

.guide-lang-select-wrap.open .guide-lang-chevron {
    transform: rotate(180deg);
}

.guide-lang-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    right: 0;
    background: hsla(220, 18%, 11%, .95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .25rem;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 -8px 24px rgba(0,0,0,.4);
}

.guide-lang-select-wrap.open .guide-lang-dropdown {
    display: block;
}

.guide-lang-option {
    display: block;
    padding: .375rem .625rem;
    font-size: .8125rem;
    color: hsl(210, 10%, 55%);
    text-decoration: none;
    border-radius: 4px;
    transition: all .1s;
}

.guide-lang-option:hover {
    background: rgba(255,255,255,.06);
    color: hsl(210, 20%, 90%);
}

.guide-lang-option.active {
    background: rgba(20,184,166,.12);
    color: var(--primary);
    font-weight: 600;
}

/* Guide sidebar footer (user info / dashboard / sign out) */
.guide-sidebar-footer {
    padding: .75rem;
    border-top: 1px solid var(--border);
}

.guide-sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    color: hsl(210, 10%, 55%);
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all .15s;
    margin-bottom: 2px;
}

.guide-sidebar-nav-item:hover { background: rgba(255,255,255,.04); color: hsl(210, 20%, 90%); }

.guide-sidebar-dashboard {
    color: hsl(48,96%,60%);
    background: rgba(234,179,8,.08);
    border: 1px solid rgba(234,179,8,.15);
}

.guide-sidebar-dashboard:hover {
    background: rgba(234,179,8,.15);
    color: hsl(48,96%,70%);
}

.guide-sidebar-logout { color: #ef4444; }
.guide-sidebar-logout:hover { background: rgba(239,68,68,.1); color: #f87171; }

.guide-sidebar-signin {
    color: #fff;
    background: rgba(88,101,242,.15);
    border: 1px solid rgba(88,101,242,.3);
}

.guide-sidebar-signin:hover {
    background: #5865F2;
    border-color: #5865F2;
    color: #fff;
}

.guide-sidebar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    color: #64748b;
    font-size: .75rem;
    overflow: hidden;
}

.guide-sidebar-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(20,184,166,.3);
}

.guide-content-wrap {
    display: flex;
    gap: 2rem;
}

.guide-article {
    flex: 1;
    min-width: 0;
    background: hsla(220, 18%, 11%, .92);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    transition: border-color .2s;
}

.guide-article:hover {
    border-color: rgba(20,184,166,.3);
}

/* Table of Contents (right column) */
.guide-toc {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-h) + 2.5rem);
    align-self: flex-start;
    max-height: calc(100vh - var(--header-h) - 5rem);
    overflow-y: auto;
    background: hsla(220, 18%, 11%, .92);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color .2s;
}

.guide-toc:hover {
    border-color: rgba(20,184,166,.3);
}

.guide-toc-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text);
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .375rem;
}

.guide-toc-link {
    display: block;
    font-size: .8125rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: .25rem 0 .25rem .75rem;
    border-left: 2px solid transparent;
    line-height: 1.4;
    transition: all .1s;
}

.guide-toc-link:hover { color: var(--text); }
.guide-toc-link.active { color: var(--primary); border-left-color: var(--primary); }
.guide-toc-link.guide-toc-sub { padding-left: 1.25rem; font-size: .75rem; }

/* Language picker */
.guide-lang-picker {
    display: flex;
    align-items: center;
    gap: .375rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: .75rem;
    color: var(--text-muted);
}

.guide-lang-btn {
    color: var(--text-muted);
    text-decoration: none;
    padding: .2rem .5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: all .1s;
    font-size: .6875rem;
}

.guide-lang-btn:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border-hover); }
.guide-lang-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.guide-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.guide-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.guide-breadcrumb a:hover { color: var(--primary); }
.guide-breadcrumb i { font-size: .5625rem; color: var(--text-muted); }
.guide-breadcrumb span { color: var(--text); }

.guide-article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.guide-article-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0 0 .5rem;
    color: var(--text);
}

.guide-article-desc {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.6;
}

.guide-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: .75rem;
    color: var(--text-muted);
}

.guide-article-meta i { margin-right: .25rem; }

.guide-article-body {
    line-height: 1.8;
    font-size: .9375rem;
    color: hsl(210, 15%, 78%);
    overflow-wrap: break-word;
    word-break: break-word;
}

.guide-article-body h2 { font-size: 1.5rem; font-weight: 700; margin-top: 2.5rem; margin-bottom: .75rem; color: var(--text); }
.guide-article-body h3 { font-size: 1.25rem; font-weight: 600; margin-top: 2rem; margin-bottom: .5rem; color: var(--text); }
.guide-article-body h4 { font-size: 1.0625rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: .5rem; color: var(--text); }
.guide-article-body p { margin-bottom: 1rem; }
.guide-article-body ul, .guide-article-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.guide-article-body li { margin-bottom: .35rem; }
.guide-article-body a { color: var(--accent); }

.guide-article-body pre {
    background: hsl(220, 22%, 4%);
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: .8125rem;
    margin: 1.25rem 0;
    border: 1px solid var(--border);
}

.guide-article-body code {
    background: rgba(20,184,166,.1);
    padding: .15em .4em;
    border-radius: 4px;
    font-size: .85em;
    color: hsl(187, 80%, 60%);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.guide-article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.guide-article-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .875rem; display: block; overflow-x: auto; }
.guide-article-body th, .guide-article-body td { border: 1px solid var(--border); padding: .625rem .875rem; text-align: left; }
.guide-article-body th { background: var(--bg-alt); font-weight: 600; color: var(--text); }
.guide-article-body img { max-width: 100%; border-radius: var(--radius); margin: 1rem 0; }

.guide-article-body blockquote {
    border-left: 3px solid var(--primary);
    padding: .875rem 1.25rem;
    margin: 1.25rem 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text);
    font-size: .9375rem;
}
/* Callout blocks */
.guide-article-body .callout {
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    border-left: 4px solid;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}

.guide-article-body .callout-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
    line-height: 1.5;
}

.guide-article-body .callout-body {
    flex: 1;
}

.guide-article-body .callout-title {
    font-weight: 700;
    font-size: .8125rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}

.guide-article-body .callout-text {
    font-size: .9375rem;
    line-height: 1.6;
}

.guide-article-body .callout-info {
    background: rgba(20,184,166,.08);
    border-color: hsl(187, 80%, 48%);
    color: hsl(187, 80%, 75%);
}

.guide-article-body .callout-warning {
    background: rgba(234,179,8,.08);
    border-color: hsl(48, 96%, 53%);
    color: hsl(48, 80%, 70%);
}

.guide-article-body .callout-danger {
    background: rgba(239,68,68,.08);
    border-color: #ef4444;
    color: #fca5a5;
}

.guide-article-body .callout-success {
    background: rgba(34,197,94,.08);
    border-color: #22c55e;
    color: #86efac;
}

.guide-article-body .callout-note {
    background: rgba(148,163,184,.06);
    border-color: hsl(210, 10%, 55%);
    color: hsl(210, 20%, 80%);
}

.guide-menu-btn {
    background: var(--secondary);
    color: #fff;
    border: none;
    padding: .5rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: .8125rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    position: sticky;
    top: var(--header-h);
    z-index: 50;
}

.guide-sidebar-close { display: none; }

.guide-sidebar-backdrop { display: none; }

/* Search results */
.search-result-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item h4 { margin: 0 0 .375rem; font-size: 1.0625rem; }
.search-result-item h4 a { color: var(--primary); text-decoration: none; }
.search-result-item h4 a:hover { text-decoration: underline; }
.search-result-item p { color: var(--text-muted); font-size: .875rem; margin: 0 0 .5rem; }
.search-snippet { font-size: .8125rem; color: hsl(210, 10%, 60%); line-height: 1.6; }
.search-snippet mark { background: rgba(20,184,166,.2); color: var(--primary); padding: .05em .2em; border-radius: 2px; }

/* ============================================
   ADMIN LAYOUT (standalone)
   ============================================ */
body.admin-body {
    background: var(--bg);
    color: var(--text);
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--admin-sidebar-w);
    min-width: var(--admin-sidebar-w);
    background: var(--secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.06);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.admin-sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.admin-sidebar-brand i { color: #3b82f6; font-size: 1.25rem; }

.admin-classification {
    font-size: .5625rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    color: #f59e0b;
    background: rgba(245,158,11,.08);
    border-top: 1px solid rgba(245,158,11,.15);
    border-bottom: 1px solid rgba(245,158,11,.15);
    padding: .375rem .75rem;
}

.admin-sidebar-nav {
    flex: 1;
    padding: 1rem .75rem;
    overflow-y: auto;
}

.admin-nav-label {
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
    padding: .75rem .75rem .375rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .75rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all .1s;
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.admin-nav-item:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.admin-nav-item.active { background: #3b82f6; color: #fff; font-weight: 600; }

.admin-sidebar-footer {
    padding: .75rem;
    border-top: 1px solid rgba(255,255,255,.06);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .75rem;
    color: #64748b;
    font-size: .75rem;
    overflow: hidden;
}

.admin-user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-logout-btn { color: #ef4444 !important; }
.admin-logout-btn:hover { background: rgba(239,68,68,.1) !important; }

.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-page-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.admin-menu-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .375rem .625rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.125rem;
}

.admin-content-area {
    flex: 1;
    padding: 2rem;
}

/* Admin page header */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -.3px;
}

.admin-page-header p {
    color: var(--text-muted);
    font-size: .875rem;
    margin: .25rem 0 0;
}

/* Admin stat cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.stat-card-icon.blue { background: rgba(59,130,246,.15); color: #60a5fa; }
.stat-card-icon.green { background: rgba(34,197,94,.15); color: #4ade80; }
.stat-card-icon.amber { background: rgba(245,158,11,.15); color: #fbbf24; }
.stat-card-icon.purple { background: rgba(124,58,237,.15); color: #a78bfa; }
.stat-card-icon.slate { background: rgba(148,163,184,.1); color: #94a3b8; }

.stat-card-info .stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: .125rem;
}

.stat-card-info .stat-label {
    font-size: .75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 500;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-h) - 60px);
    padding: 2rem;
    background: var(--bg);
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: .75rem;
    display: block;
}

.auth-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 .375rem;
    letter-spacing: -.5px;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: .8125rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 500;
}

.auth-field { margin-bottom: 1.25rem; }

.auth-field .form-label {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .375rem;
}

.auth-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 .75rem;
    transition: border-color .15s;
    background: rgba(255,255,255,.05);
}

.auth-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }

.discord-btn {
    background: #5865F2;
    color: #fff;
    font-weight: 600;
    font-size: .9375rem;
    padding: .65rem 1rem;
    border: none;
    border-radius: 8px;
    transition: background .15s;
}
.discord-btn:hover { background: #4752c4; color: #fff; }
.auth-input-wrap i { color: var(--text-muted); font-size: .875rem; }

.auth-input-wrap .form-control {
    border: none;
    box-shadow: none;
    padding: .625rem .5rem;
    font-size: .875rem;
    background: transparent;
    color: var(--text);
}

.auth-input-wrap .form-control:focus { box-shadow: none; }

.auth-invite-info {
    text-align: center;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: .875rem;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.auth-invite-info strong { color: var(--text); display: block; margin-top: .25rem; }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.auth-footer small { color: var(--text-muted); font-size: .75rem; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: rgba(10, 10, 10, .85);
    backdrop-filter: blur(10px);
    color: #737373;
    text-align: center;
    padding: 1.25rem 2rem;
    font-size: .8125rem;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.06);
}

.site-footer p { margin: 0; }

/* ============================================
   COMPONENTS
   ============================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}

.card-header {
    font-weight: 600;
    font-size: .875rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.table { font-size: .875rem; }
.table th { font-weight: 600; color: var(--text-secondary); background: var(--bg-alt); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.table td { vertical-align: middle; color: var(--text-secondary); }

.badge { font-weight: 600; font-size: .6875rem; letter-spacing: .02em; padding: .3em .6em; }

.btn {
    font-weight: 600;
    font-size: .8125rem;
    border-radius: 6px;
    padding: .5rem 1rem;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
}

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-outline-secondary { color: var(--text-secondary); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border-hover); }
.btn-outline-danger { color: var(--danger); border-color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: .3rem .625rem; font-size: .75rem; }

.form-control { font-size: .875rem; border-color: var(--border); border-radius: 6px; background: rgba(255,255,255,.05); color: var(--text); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(20,184,166,.15); background: rgba(255,255,255,.07); color: var(--text); }
.form-label { font-size: .8125rem; font-weight: 600; color: var(--text-secondary); }
.form-select { font-size: .875rem; border-color: var(--border); border-radius: 6px; background-color: rgba(255,255,255,.05); color: var(--text); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

body.admin-body .form-control { background: rgba(255,255,255,.05); color: var(--text); }
body.admin-body .form-control:focus { background: rgba(255,255,255,.07); color: var(--text); }
body.admin-body .form-select { background-color: rgba(255,255,255,.05); color: var(--text); }

.alert { font-size: .875rem; border-radius: var(--radius); }

/* Help page content */
.help-content { font-size: .875rem; line-height: 1.7; color: var(--text-secondary); }
.help-content h6 { font-weight: 700; margin-top: 1rem; margin-bottom: .5rem; color: var(--text); }
.help-content p { margin-bottom: .5rem; }
.help-content ol, .help-content ul { margin-bottom: .75rem; }
.help-content li { margin-bottom: .25rem; }
.help-content code { background: rgba(255,255,255,.08); color: #e2e8f0; padding: .1em .35em; border-radius: 3px; font-size: .8em; }
.help-content .table { font-size: .8125rem; }
.help-content .alert { font-size: .8125rem; }

/* Page tree (admin drag-and-drop) */
.page-tree-category { margin-bottom: .5rem; }

.page-tree-category-header {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: .5rem .5rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.page-tree-category-header i { color: var(--primary); font-size: .875rem; }

.page-tree-list { min-height: 32px; padding: 0 .25rem .25rem; }

.page-tree-item {
    display: flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .5rem;
    margin-bottom: 2px;
    border-radius: 6px;
    font-size: .8125rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    cursor: default;
    transition: background .1s;
}

.page-tree-item:hover { background: var(--card); border-color: var(--border-hover); }

.page-tree-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: .875rem;
}

.drag-handle:active { cursor: grabbing; }

.page-tree-ghost {
    opacity: .4;
    background: var(--primary-light) !important;
    border-color: var(--primary) !important;
}

.page-tree-chosen {
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1199.98px) {
    .guide-toc { display: none !important; }
    .guide-main { padding: 2rem 2rem; }
}

@media (max-width: 767.98px) {
    .site-nav { display: none; }
    .site-nav.show {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        background: var(--secondary);
        padding: 1rem 1.5rem;
        gap: .75rem;
        border-bottom: 1px solid rgba(255,255,255,.1);
    }

    .hero h1 { font-size: 2rem; }
    .hero p { font-size: .9375rem; }
    .hero { padding: 3.5rem 1.5rem 3rem; }

    .guide-sidebar {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0; bottom: 0;
        width: var(--sidebar-w);
        z-index: 999;
        height: auto;
        flex-direction: column;
        background: hsl(220, 20%, 10%);
        backdrop-filter: none;
    }
    .guide-sidebar.show { display: flex !important; }
    .guide-sidebar-close {
        display: flex;
        align-items: center;
        gap: .375rem;
        background: none;
        border: none;
        color: #94a3b8;
        font-size: .8125rem;
        padding: .75rem 1rem;
        cursor: pointer;
        border-bottom: 1px solid var(--border);
        width: 100%;
        text-align: left;
    }
    .guide-sidebar-close:hover { color: #e2e8f0; background: rgba(255,255,255,.06); }
    .guide-main { padding: 1rem; margin-left: 0; }
    .guide-article { padding: 1.25rem; }
    .guide-article-meta { flex-direction: column; gap: .375rem; }
    .guide-article-body pre { max-width: 100%; }

    .guide-sidebar-backdrop.show {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,.5);
        z-index: 998;
    }

    .admin-sidebar { transform: translateX(-100%); transition: transform .2s; }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-content-area { padding: 1rem; }
}
