/* =========================================================
   TechPulse — Main Stylesheet
   Dark-first, modern editorial design
   ========================================================= */

/* ── Variables ─────────────────────────────────────────── */
:root {
    --bg:          #0d1117;
    --bg-2:        #161b22;
    --bg-3:        #21262d;
    --bg-hover:    #30363d;
    --border:      #30363d;
    --border-2:    #21262d;
    --text:        #e6edf3;
    --text-2:      #8b949e;
    --text-3:      #6e7681;
    --accent:      #58a6ff;
    --accent-2:    #1f6feb;
    --green:       #3fb950;
    --red:         #f85149;
    --yellow:      #d29922;
    --purple:      #a371f7;
    --orange:      #f0883e;
    --card-shadow: 0 1px 3px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.2);
    --radius:      8px;
    --radius-lg:   12px;
    --font:        'Space Grotesk', system-ui, sans-serif;
    --font-mono:   'JetBrains Mono', monospace;
    --nav-h:       60px;
}

[data-theme="light"] {
    --bg:          #f6f8fa;
    --bg-2:        #ffffff;
    --bg-3:        #f0f2f4;
    --bg-hover:    #e8ebee;
    --border:      #d0d7de;
    --border-2:    #e8ebee;
    --text:        #1f2328;
    --text-2:      #656d76;
    --text-3:      #9198a1;
    --accent:      #0969da;
    --accent-2:    #0550ae;
    --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    height: var(--nav-h);
}

.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon { font-size: 20px; }

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo-text span { color: var(--accent); }

/* Search */
.nav-search {
    flex: 1;
    max-width: 380px;
    position: relative;
}

.nav-search input {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px 7px 34px;
    font-size: 13px;
    color: var(--text);
    font-family: var(--font);
    transition: border-color .15s, box-shadow .15s;
}

.nav-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,166,255,.15);
}

.nav-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    width: 14px;
    height: 14px;
}

/* Nav pills */
.nav-pills { display: flex; gap: 4px; }

.pill {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    transition: all .15s;
    white-space: nowrap;
}

.pill:hover, .pill.active {
    background: var(--bg-3);
    color: var(--text);
    text-decoration: none;
}

/* Nav actions */
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s, transform .1s;
    text-decoration: none;
}

.btn-primary:hover { background: var(--accent-2); text-decoration: none; color: #fff; }
.btn-primary:active { transform: scale(.97); }

.btn-ghost {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
    text-decoration: none;
}

.btn-ghost:hover { border-color: var(--text-2); color: var(--text); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    position: relative;
}

.icon-btn:hover { background: var(--bg-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* Avatar */
.avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dropdowns */
.user-menu-wrapper, .notif-wrapper { position: relative; }

.user-avatar-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    transition: border-color .15s;
}

.user-avatar-btn:hover { border-color: var(--text-2); }
.chevron { width: 14px; height: 14px; color: var(--text-3); }

.user-dropdown, .notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    display: none;
    min-width: 200px;
    z-index: 200;
    overflow: hidden;
    animation: dropIn .15s ease;
}

.user-dropdown.open, .notif-dropdown.open { display: block; }

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-drop-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-dropdown a, .dropdown-link-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-2);
    font-size: 13px;
    transition: all .1s;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: var(--font);
}

.user-dropdown a:hover, .dropdown-link-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
    text-decoration: none;
}

.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.user-dropdown svg, .dropdown-link-btn svg { width: 15px; height: 15px; }

/* Notification dropdown */
.notif-dropdown { min-width: 320px; max-height: 420px; overflow-y: auto; }

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14px;
}

.mark-read-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
}

.notif-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-2);
    transition: background .1s;
}

.notif-item:hover { background: var(--bg-hover); text-decoration: none; }
.notif-item.unread { background: rgba(88,166,255,.05); border-left: 3px solid var(--accent); }
.notif-title { font-size: 13px; color: var(--text); margin-bottom: 2px; }
.notif-time  { font-size: 11px; color: var(--text-3); }
.notif-empty, .notif-loading { padding: 20px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

/* Badge dot */
.badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Role badges */
.role-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.role-admin     { background: rgba(248,81,73,.15);  color: var(--red); }
.role-moderator { background: rgba(163,113,247,.15); color: var(--purple); }
.role-verified  { background: rgba(63,185,80,.15);  color: var(--green); }
.role-user      { background: var(--bg-3);           color: var(--text-3); }

/* ── Flash Messages ─────────────────────────────────────── */
.flash-container {
    position: fixed;
    top: calc(var(--nav-h) + 12px);
    right: 16px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--card-shadow);
    animation: slideIn .3s ease;
    position: relative;
}

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

.flash svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.flash-success { background: #162312; border: 1px solid #2a4a1a; color: #7ee787; }
.flash-error   { background: #2c1515; border: 1px solid #4a1a1a; color: #ff7b7b; }
.flash-close   { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 18px; color: inherit; opacity: .7; }
.flash-errors  { padding-left: 16px; list-style: disc; }

/* ── Layout ─────────────────────────────────────────────── */
.main-content { min-height: calc(100vh - var(--nav-h)); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.page-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-grid-wide {
    grid-template-columns: 1fr 340px;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.card:hover { border-color: var(--border); box-shadow: var(--card-shadow); }

.card-body { padding: 20px; }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; }

/* ── Post Card ──────────────────────────────────────────── */
.post-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color .2s, transform .15s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

.post-card-image {
    height: 180px;
    overflow: hidden;
    background: var(--bg-3);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.post-card:hover .post-card-image img { transform: scale(1.03); }

.post-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.category-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.type-badge {
    font-size: 11px;
    color: var(--text-3);
    background: var(--bg-3);
    padding: 2px 7px;
    border-radius: 4px;
}

.post-time { font-size: 11px; color: var(--text-3); margin-left: auto; }

.post-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title:hover { color: var(--accent); }
.post-excerpt { font-size: 13px; color: var(--text-2); line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.post-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border-2);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-2);
    text-decoration: none;
}

.post-author img { width: 22px; height: 22px; border-radius: 50%; }
.post-author:hover { color: var(--accent); text-decoration: none; }

.post-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    font-size: 12px;
    color: var(--text-3);
}

.stat-item { display: flex; align-items: center; gap: 3px; }
.stat-item svg { width: 12px; height: 12px; }

/* ── Post Grid ──────────────────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 16px; }

.sidebar-widget { /* = .card */ }

.trending-list { padding: 8px 0; }

.trending-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-2);
    transition: background .1s;
}

.trending-item:last-child { border-bottom: none; }
.trending-item:hover { background: var(--bg-hover); }

.trending-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    width: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.trending-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }
.trending-title:hover { color: var(--accent); text-decoration: none; }
.trending-stats { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── Post Detail ────────────────────────────────────────── */
.post-header { padding: 32px 0 20px; }
.post-hero-image { height: 360px; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; background: var(--bg-3); }
.post-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.post-headline { font-size: 28px; font-weight: 700; line-height: 1.3; margin-bottom: 16px; color: var(--text); }

.post-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.post-content {
    line-height: 1.8;
    color: var(--text);
    font-size: 15px;
}

.post-content h2, .post-content h3 { margin: 24px 0 12px; font-weight: 600; }
.post-content p  { margin-bottom: 16px; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 16px; }
.post-content li { margin-bottom: 6px; }
.post-content a  { color: var(--accent); }
.post-content blockquote { border-left: 3px solid var(--accent); padding-left: 16px; margin: 16px 0; color: var(--text-2); font-style: italic; }
.post-content code { font-family: var(--font-mono); background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.post-content pre { background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; margin-bottom: 16px; }
.post-content pre code { background: none; padding: 0; }
.post-content img { border-radius: var(--radius); max-width: 100%; }

.source-attribution { font-size: 13px; color: var(--text-2); background: var(--bg-3); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; margin-top: 24px; }

/* AI Summary box */
.ai-summary-box {
    background: linear-gradient(135deg, rgba(88,166,255,.08), rgba(163,113,247,.08));
    border: 1px solid rgba(88,166,255,.2);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.ai-summary-box h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); margin-bottom: 8px; }
.ai-summary-box p  { font-size: 14px; color: var(--text-2); line-height: 1.6; white-space: pre-line; }

/* Post actions */
.post-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 16px 0;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    transition: all .15s;
}

.action-btn:hover, .action-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(88,166,255,.08); }
.action-btn.active.heart { border-color: var(--red); color: var(--red); background: rgba(248,81,73,.08); }
.action-btn svg { width: 16px; height: 16px; }

/* ── Comments ────────────────────────────────────────────── */
.comments-section { padding: 24px 0; }
.comments-section h3 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }

.comment-form-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
}

.comment-form-box textarea {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    font-family: var(--font);
    resize: vertical;
    min-height: 80px;
    transition: border-color .15s;
}

.comment-form-box textarea:focus { outline: none; border-color: var(--accent); }

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-2);
}

.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-time   { color: var(--text-3); }
.comment-text   { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.comment-actions { display: flex; gap: 10px; margin-top: 8px; }
.comment-action { background: none; border: none; color: var(--text-3); font-size: 12px; cursor: pointer; font-family: var(--font); display: flex; align-items: center; gap: 3px; }
.comment-action:hover { color: var(--accent); }
.comment-replies { margin-left: 40px; border-left: 2px solid var(--border); padding-left: 16px; }

/* ── Admin Panel ─────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    padding: 20px 0;
    position: sticky;
    top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    overflow-y: auto;
}

.admin-nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-3);
    padding: 8px 20px 4px;
    font-weight: 600;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--text-2);
    font-size: 14px;
    transition: all .1s;
    border-left: 3px solid transparent;
}

.admin-nav-link:hover, .admin-nav-link.active {
    background: var(--bg-hover);
    color: var(--text);
    border-left-color: var(--accent);
    text-decoration: none;
}

.admin-nav-link svg { width: 16px; height: 16px; }

.admin-main { flex: 1; padding: 24px; overflow-x: hidden; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-header h1 { font-size: 22px; font-weight: 700; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}

.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat-card-icon  { font-size: 20px; float: right; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); padding: 10px 16px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg-hover); }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.status-published { background: rgba(63,185,80,.15); color: var(--green); }
.status-pending   { background: rgba(210,153,34,.15); color: var(--yellow); }
.status-draft     { background: var(--bg-3); color: var(--text-3); }
.status-rejected  { background: rgba(248,81,73,.15); color: var(--red); }
.status-fetched   { background: rgba(88,166,255,.15); color: var(--accent); }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-control {
    width: 100%;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    font-family: var(--font);
    transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88,166,255,.12);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-page {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 420px;
}

.auth-box h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-box p  { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-2); }

/* ── User Dashboard ──────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Badges ──────────────────────────────────────────────── */
.badges-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-2);
}

.badge-item .badge-icon { font-size: 14px; }

/* ── Tags ────────────────────────────────────────────────── */
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag-link {
    background: var(--bg-3);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    transition: all .15s;
}

.tag-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 24px 0; }
.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: 13px;
    padding: 0 10px;
    transition: all .15s;
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding: 48px 0 24px;
}

.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

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

.footer-brand p { font-size: 13px; color: var(--text-3); margin: 12px 0 16px; line-height: 1.6; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { color: var(--text-3); width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; transition: all .15s; }
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }
.footer-social svg { width: 14px; height: 14px; }

.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-3); font-size: 13px; margin-bottom: 8px; transition: color .15s; }
.footer-col a:hover { color: var(--text); text-decoration: none; }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-3);
    flex-wrap: wrap;
    gap: 8px;
}

.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-3); }
.footer-links a:hover { color: var(--text); }
.perf { background: var(--bg-3); padding: 2px 8px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; }

/* ── Utilities ──────────────────────────────────────────── */
.text-muted   { color: var(--text-2); }
.text-small   { font-size: 13px; }
.text-center  { text-align: center; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.p-4   { padding: 16px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .page-grid, .footer-grid { grid-template-columns: 1fr; }
    .sidebar { order: -1; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .hide-mobile { display: none; }
    .posts-grid  { grid-template-columns: 1fr; }
    .auth-box    { padding: 24px 20px; }
    .footer-grid { grid-template-columns: 1fr; }
    .post-headline { font-size: 22px; }
}
