/* ═══════════════════════════════════════════════════
   NAJD THEME v3 — ملتقى التجار
   تصميم جديد كامل بناءً على النموذج
═══════════════════════════════════════════════════ */

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

:root {
    --nj-primary:       #2f4a6d;
    --nj-primary-dark:  #1e3450;
    --nj-primary-light: #eef3fc;
    --nj-primary-soft:  #d4e2f5;
    --nj-accent:        #ffd966;
    --nj-bg:            #f4f6fa;
    --nj-surface:       #ffffff;
    --nj-border:        #e6edf4;
    --nj-border-soft:   #f0f2f8;
    --nj-text:          #1a2634;
    --nj-text-soft:     #4a5e7a;
    --nj-text-muted:    #7c8aa2;
    --nj-radius:        16px;
    --nj-radius-lg:     20px;
    --nj-shadow:        0 2px 8px rgba(0,0,0,0.05);
    --nj-shadow-md:     0 8px 24px rgba(0,0,0,0.08);
}

body.nj-body {
    font-family: 'Tajawal', sans-serif;
    background: var(--nj-bg);
    color: var(--nj-text);
    direction: rtl;
    min-height: 100vh;
    line-height: 1.6;
}

/* ─── TOPBAR ─── */
.nj-topbar {
    background: var(--nj-primary);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.nj-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.nj-logo-dot {
    background: rgba(255,255,255,0.18);
    width: 42px; height: 42px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.3rem;
}
.nj-logo-name { font-weight: 800; font-size: 1.3rem; color: white; }

.nj-topnav { display: flex; gap: 4px; }
.nj-topnav a {
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
    transition: background 0.15s;
}
.nj-topnav a:hover { background: rgba(255,255,255,0.18); color: white; }
.nj-nav-active { background: rgba(255,255,255,0.2) !important; color: white !important; }

.nj-spacer { flex: 1; }

.nj-search {
    background: rgba(255,255,255,0.14);
    border-radius: 40px;
    padding: 7px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    width: 220px;
    flex-shrink: 0;
}
.nj-search i { color: rgba(255,255,255,0.65); font-size: 13px; }
.nj-search input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 13px;
    color: white;
    width: 100%;
    font-family: inherit;
}
.nj-search input::placeholder { color: rgba(255,255,255,0.55); }

.nj-vdiv { width: 1px; height: 28px; background: rgba(255,255,255,0.2); flex-shrink: 0; }

.nj-icon-btns { display: flex; gap: 6px; }
.nj-icon-btn, .nj-notif-wrap {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 40px;
    text-decoration: none;
    color: white;
    font-size: 0.82rem;
    font-weight: 500;
    transition: background 0.15s;
    position: relative;
}
.nj-icon-btn:hover, .nj-notif-wrap:hover { background: rgba(255,255,255,0.22); }
.nj-notif-badge {
    position: absolute;
    top: -5px; right: -3px;
    background: #ff6b4a;
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 17px; height: 17px;
    border-radius: 30px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--nj-primary);
}

.nj-btn-new {
    background: white;
    color: var(--nj-primary);
    padding: 8px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    transition: 0.15s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.nj-btn-new:hover { background: #f8f9fc; transform: translateY(-1px); }

.nj-profile-btn { position: relative; }
.nj-profile-btn > button {
    background: rgba(255,255,255,0.1);
    border: none;
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px 4px 8px;
    border-radius: 60px;
    cursor: pointer;
    transition: background 0.15s;
}
.nj-profile-btn > button:hover { background: rgba(255,255,255,0.2); }
.nj-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.3); }
.nj-avatar-placeholder {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0;
}
.nj-profile-info { display: flex; flex-direction: column; }
.nj-profile-name { font-size: 0.83rem; font-weight: 700; color: white; line-height: 1.3; }
.nj-profile-role { font-size: 0.62rem; color: var(--nj-accent); }

.nj-dropdown {
    position: absolute;
    top: calc(100% + 8px); left: 0;
    min-width: 200px;
    background: white;
    border: 1px solid var(--nj-border);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    overflow: hidden;
    z-index: 200;
    padding: 6px 0;
}
.nj-dropdown a, .nj-dropdown button {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    font-size: 13px; color: #1e293b;
    text-decoration: none; background: white; border: none;
    width: 100%; text-align: right; cursor: pointer; font-family: inherit;
    transition: background 0.1s;
}
.nj-dropdown a:hover, .nj-dropdown button:hover { background: var(--nj-primary-light); color: var(--nj-primary); }
.nj-dropdown hr { border: none; border-top: 1px solid var(--nj-border); margin: 4px 0; }
.nj-logout { color: #ef4444 !important; }
.nj-logout:hover { background: #fef2f2 !important; }

/* ─── SUBNAV ─── */
.nj-subnav {
    background: white;
    border-bottom: 2px solid var(--nj-border);
    padding: 0 24px;
    display: flex;
    gap: 28px;
    align-items: center;
    overflow-x: auto;
}
.nj-tab {
    padding: 14px 2px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--nj-text-soft);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: 0.15s;
}
.nj-tab:hover { color: var(--nj-primary); border-bottom-color: var(--nj-primary-soft); }
.nj-tab-active, .nj-tab.nj-tab-active { color: var(--nj-primary); border-bottom-color: var(--nj-primary); }

/* ─── CONTAINER & LAYOUT ─── */
.nj-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.nj-main { padding: 28px 0; }

/* Page layout with sidebar */
.nj-page-layout {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

/* ─── CATEGORY GROUPS (Home) ─── */
.nj-cat-group {
    background: white;
    border-radius: var(--nj-radius-lg);
    border: 1px solid var(--nj-border);
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: var(--nj-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}
.nj-cat-group:hover { box-shadow: var(--nj-shadow-md); transform: translateY(-2px); }

.nj-cat-head {
    background: var(--nj-primary);
    color: white;
    padding: 14px 22px;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nj-cat-head i {
    background: rgba(255,255,255,0.18);
    padding: 7px;
    border-radius: 10px;
    font-size: 1.1rem;
}

.nj-col-labels {
    display: grid;
    grid-template-columns: 50px 1fr 80px 80px 1.2fr;
    background: var(--nj-primary-light);
    padding: 10px 22px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--nj-primary);
    border-bottom: 1px solid var(--nj-border);
    letter-spacing: 0.5px;
}
.nj-col-labels .r { text-align: right; }

.nj-cat-body { display: flex; flex-direction: column; }

.nj-frow {
    display: grid;
    grid-template-columns: 50px 1fr 80px 80px 1.2fr;
    align-items: center;
    padding: 14px 22px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--nj-border-soft);
    transition: background 0.15s;
    cursor: pointer;
}
.nj-frow:last-child { border-bottom: none; }
.nj-frow:hover { background: var(--nj-primary-light); }
.nj-frow:hover .nj-fi { background: var(--nj-primary); color: white; }

.nj-fi {
    width: 42px; height: 42px;
    background: var(--nj-primary-light);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    transition: background 0.15s;
    flex-shrink: 0;
}
.nj-finfo { padding: 0 10px; }
.nj-fname { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.nj-fdesc { font-size: 0.7rem; color: var(--nj-text-muted); }

.nj-cv { font-weight: 800; font-size: 1rem; color: var(--nj-primary); text-align: center; }
.nj-cl { font-size: 0.62rem; color: var(--nj-text-muted); text-align: center; }

.nj-lpt { font-size: 0.8rem; font-weight: 600; color: #1f2a3e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nj-lpm { font-size: 0.65rem; color: var(--nj-text-muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.nj-lav { width: 24px; height: 24px; border-radius: 50%; background: var(--nj-primary-light); display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; color: var(--nj-primary); flex-shrink: 0; }

/* ─── SIDEBAR (left panel) ─── */
.nj-sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 20px; }

.nj-sidebar-card {
    background: white;
    border-radius: var(--nj-radius-lg);
    border: 1px solid var(--nj-border);
    overflow: hidden;
    box-shadow: var(--nj-shadow);
}
.nj-sidebar-header {
    background: var(--nj-primary);
    padding: 12px 16px;
    color: white;
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nj-categories-list { padding: 6px 0; }
.nj-category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #334155;
    transition: all 0.15s;
    border-right: 3px solid transparent;
    font-size: 0.82rem;
}
.nj-category-item:hover, .nj-category-item.active {
    background: var(--nj-primary-light);
    border-right-color: var(--nj-primary);
    color: var(--nj-primary);
}
.nj-category-icon {
    width: 30px; height: 30px;
    background: var(--nj-primary-light);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: 0.15s;
}
.nj-category-item:hover .nj-category-icon, .nj-category-item.active .nj-category-icon {
    background: var(--nj-primary);
    color: white;
}
.nj-category-name { font-weight: 600; line-height: 1.3; }
.nj-category-stats { font-size: 0.6rem; color: var(--nj-text-muted); margin-top: 1px; }

/* Online users in sidebar */
.nj-online-users-wrap { padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.nj-online-user {
    display: flex; align-items: center; gap: 7px;
    background: var(--nj-primary-light);
    padding: 4px 10px 4px 12px;
    border-radius: 40px;
    text-decoration: none;
    color: var(--nj-primary);
    font-size: 0.75rem;
    font-weight: 500;
    transition: 0.15s;
}
.nj-online-user:hover { background: var(--nj-primary-soft); }
.nj-online-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--nj-primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ─── SECTION HEADER (topic-list) ─── */
.nj-section-card {
    background: white;
    border-radius: var(--nj-radius-lg);
    border: 1px solid var(--nj-border);
    overflow: hidden;
    margin-bottom: 22px;
    box-shadow: var(--nj-shadow);
}
.nj-section-banner {
    background: linear-gradient(135deg, var(--nj-primary) 0%, var(--nj-primary-dark) 100%);
    padding: 16px 22px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}
.nj-section-title { font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.nj-section-title i { background: rgba(255,255,255,0.18); padding: 8px; border-radius: 12px; }
.nj-section-desc { font-size: 0.78rem; opacity: 0.85; margin-top: 3px; }
.nj-section-stats { display: flex; gap: 12px; }
.nj-stat-pill { display: flex; align-items: center; gap: 6px; font-size: 0.73rem; background: rgba(255,255,255,0.15); padding: 5px 12px; border-radius: 30px; }
.nj-stat-pill strong { font-size: 0.95rem; font-weight: 800; }

.nj-filters-bar {
    background: var(--nj-primary-light);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
.nj-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.nj-filter-btn {
    padding: 5px 14px;
    border-radius: 30px;
    background: white;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    transition: 0.15s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.nj-filter-btn:hover, .nj-filter-btn.active { background: var(--nj-primary); color: white; }

/* ─── TOPICS LIST (topic-list) ─── */
.nj-topics-card {
    background: white;
    border-radius: var(--nj-radius-lg);
    border: 1px solid var(--nj-border);
    overflow: hidden;
    box-shadow: var(--nj-shadow);
    margin-bottom: 28px;
}
.nj-topics-header-row {
    display: grid;
    grid-template-columns: 46px 1fr 88px 88px 130px;
    background: var(--nj-primary-light);
    padding: 10px 18px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--nj-primary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--nj-border);
    letter-spacing: 0.4px;
}
.nj-topic-row {
    display: grid;
    grid-template-columns: 46px 1fr 88px 88px 130px;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid var(--nj-border-soft);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.nj-topic-row:last-child { border-bottom: none; }
.nj-topic-row:hover { background: var(--nj-primary-light); }
.nj-topic-row.is-pinned { background: #fffdf0; border-right: 3px solid #f59e0b; }
.nj-topic-row.is-locked { opacity: 0.8; }

.nj-topic-status-icon { font-size: 1.1rem; text-align: center; color: var(--nj-text-muted); }
.nj-topic-status-icon.pinned { color: #f59e0b; }
.nj-topic-status-icon.hot { color: #ef4444; }
.nj-topic-status-icon.locked { color: #94a3b8; }
.nj-topic-status-icon.solved { color: #16a34a; }

.nj-topic-title-text { font-weight: 700; font-size: 0.92rem; color: #1e293b; line-height: 1.4; }
.nj-topic-meta-row { display: flex; gap: 8px; font-size: 0.65rem; color: var(--nj-text-muted); margin-top: 4px; flex-wrap: wrap; align-items: center; }
.nj-topic-tag { background: var(--nj-primary-light); color: var(--nj-primary); padding: 2px 8px; border-radius: 20px; font-size: 0.6rem; font-weight: 600; }
.nj-topic-tag.solved { background: #f0fdf4; color: #16a34a; }
.nj-topic-tag.hot { background: #fef2f2; color: #ef4444; }
.nj-topic-tag.locked { background: #f8fafc; color: #64748b; }
.nj-topic-tag.premium { background: #fffbeb; color: #d97706; }

.nj-replies-cell { text-align: center; }
.nj-replies-num { font-weight: 800; font-size: 1rem; color: var(--nj-primary); line-height: 1; }
.nj-replies-label { font-size: 0.6rem; color: var(--nj-text-muted); }

.nj-views-cell { text-align: center; }
.nj-views-num { font-weight: 600; font-size: 0.85rem; color: #475569; line-height: 1; }
.nj-views-label { font-size: 0.6rem; color: var(--nj-text-muted); }

.nj-last-post-cell { display: flex; align-items: center; gap: 8px; }
.nj-last-post-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--nj-primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--nj-primary);
    flex-shrink: 0;
    overflow: hidden;
    object-fit: cover;
}
.nj-last-post-name { font-weight: 600; font-size: 0.75rem; color: #1e293b; }
.nj-last-post-time { font-size: 0.62rem; color: var(--nj-text-muted); }

/* ─── TOPIC SHOW ─── */
.nj-topic-header-card {
    background: linear-gradient(135deg, var(--nj-primary) 0%, var(--nj-primary-dark) 100%);
    border-radius: var(--nj-radius-lg);
    padding: 20px 24px;
    color: white;
    margin-bottom: 20px;
}
.nj-topic-badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.nj-topic-badge-pill {
    background: rgba(255,255,255,0.18);
    padding: 3px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
}
.nj-topic-main-title { font-size: 1.5rem; font-weight: 800; line-height: 1.4; margin-bottom: 14px; }
.nj-topic-meta-strip { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.78rem; opacity: 0.9; }
.nj-topic-meta-strip i { margin-left: 5px; }

/* Posts (topic + replies) */
.nj-post-card {
    background: white;
    border-radius: var(--nj-radius-lg);
    border: 1px solid var(--nj-border);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--nj-shadow);
}
.nj-post {
    display: flex;
    border-bottom: 1px solid var(--nj-border);
    transition: background 0.15s;
}
.nj-post:last-child { border-bottom: none; }
.nj-post.is-solution { border-right: 4px solid #16a34a; background: #f0fdf4; }

.nj-post-user-panel {
    width: 200px;
    flex-shrink: 0;
    background: #f9fafb;
    padding: 18px 14px;
    text-align: center;
    border-left: 1px solid var(--nj-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.nj-post-user-avatar {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: var(--nj-primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 800;
    color: var(--nj-primary);
    margin-bottom: 4px;
    overflow: hidden;
    object-fit: cover;
}
.nj-post-username { font-weight: 800; font-size: 0.95rem; color: var(--nj-primary); }
.nj-post-role {
    background: var(--nj-primary-light);
    color: var(--nj-primary);
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 0.63rem;
    font-weight: 600;
}
.nj-post-stats {
    font-size: 0.68rem;
    color: var(--nj-text-muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--nj-border);
    width: 100%;
    line-height: 1.9;
}

.nj-post-body { flex: 1; padding: 18px 22px; }
.nj-post-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.nj-post-date { font-size: 0.7rem; color: #94a3b8; }
.nj-post-actions { display: flex; gap: 14px; }
.nj-post-actions a, .nj-post-actions button {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.72rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.nj-post-actions a:hover, .nj-post-actions button:hover { color: var(--nj-primary); }

.nj-post-text { font-size: 0.93rem; line-height: 1.75; color: #1e293b; }
.nj-post-text p { margin-bottom: 12px; }
.nj-post-text p:last-child { margin-bottom: 0; }
.nj-post-text strong { color: #1a2634; }
.nj-post-text blockquote {
    border-right: 4px solid var(--nj-primary);
    background: var(--nj-primary-light);
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.88rem;
    color: #374151;
}

.nj-signature {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px dashed var(--nj-border);
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Solution banner */
.nj-solution-banner {
    background: linear-gradient(90deg, #f0fdf4, #dcfce7);
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #86efac;
}

/* Reply box */
.nj-reply-card {
    background: white;
    border-radius: var(--nj-radius-lg);
    border: 1px solid var(--nj-border);
    overflow: hidden;
    box-shadow: var(--nj-shadow);
}
.nj-reply-header {
    background: var(--nj-primary-light);
    padding: 12px 18px;
    font-weight: 700;
    color: var(--nj-primary);
    border-bottom: 1px solid var(--nj-border);
    font-size: 0.9rem;
}
.nj-reply-body { padding: 18px; }
.nj-reply-body textarea {
    width: 100%;
    border: 1px solid var(--nj-border);
    border-radius: 14px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 110px;
    outline: none;
    transition: border-color 0.15s;
    background: #fafcff;
}
.nj-reply-body textarea:focus { border-color: var(--nj-primary); background: white; }
.nj-reply-footer { padding: 10px 18px 18px; display: flex; justify-content: flex-end; }
.nj-btn-reply {
    background: var(--nj-primary);
    color: white;
    border: none;
    padding: 10px 26px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: 0.15s;
    display: flex;
    align-items: center;
    gap: 7px;
}
.nj-btn-reply:hover { background: var(--nj-primary-dark); }

/* Topic sidebar info */
.nj-topic-info-list { padding: 14px; }
.nj-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.78rem;
}
.nj-info-row span:first-child { color: var(--nj-text-muted); }
.nj-info-row span:last-child { font-weight: 600; color: #1e293b; }

.nj-tags-list { padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.nj-tag-pill {
    background: var(--nj-primary-light);
    color: var(--nj-primary);
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 0.68rem;
    text-decoration: none;
    font-weight: 500;
}
.nj-tag-pill:hover { background: var(--nj-primary-soft); }

.nj-similar-list { padding: 4px 0; }
.nj-similar-item {
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid var(--nj-border-soft);
    transition: background 0.12s;
}
.nj-similar-item:last-child { border-bottom: none; }
.nj-similar-item:hover { background: var(--nj-primary-light); }
.nj-similar-title { font-size: 0.78rem; font-weight: 600; color: #1e293b; margin-bottom: 3px; line-height: 1.4; }
.nj-similar-meta { font-size: 0.62rem; color: #94a3b8; }

/* ─── BREADCRUMB ─── */
.nj-breadcrumb {
    background: white;
    padding: 11px 24px;
    border-bottom: 1px solid var(--nj-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.83rem;
}
.nj-breadcrumb a { text-decoration: none; color: var(--nj-text-muted); transition: color 0.12s; }
.nj-breadcrumb a:hover { color: var(--nj-primary); }
.nj-breadcrumb .sep { color: var(--nj-border); font-size: 0.7rem; }
.nj-breadcrumb-current { color: var(--nj-primary); font-weight: 600; }

/* ─── PAGINATION ─── */
.nj-pagination { display: flex; justify-content: center; gap: 6px; margin: 24px 0 32px; }
.nj-page {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--nj-border);
    text-decoration: none;
    color: #475569;
    font-size: 0.85rem;
    transition: 0.15s;
}
.nj-page.active, .nj-page:hover { background: var(--nj-primary); color: white; border-color: var(--nj-primary); }

/* ─── UTILITIES ─── */
.nj-badge-solved { background: #f0fdf4; color: #16a34a; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.nj-badge-hot { background: #fff7ed; color: #c2410c; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.nj-badge-pinned { background: #fffbeb; color: #b45309; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.nj-badge-premium { background: #fffbeb; color: #d97706; font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }

/* ─── FOOTER ─── */
.nj-footer {
    background: var(--nj-primary-dark);
    margin-top: 48px;
    padding: 32px 24px 24px;
    color: rgba(255,255,255,0.85);
}
.nj-footer-container { max-width: 1280px; margin: 0 auto; }

.nj-footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 28px;
}
.nj-footer-online-item { display: flex; align-items: center; gap: 14px; }
.nj-footer-online-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    color: var(--nj-accent);
}
.nj-footer-online-label { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-bottom: 2px; }
.nj-footer-online-number { font-size: 1.7rem; font-weight: 800; color: var(--nj-accent); line-height: 1; }

.nj-fgrid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 36px;
}
.nj-footer-col { flex: 1; min-width: 170px; }
.nj-fch {
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    border-right: 3px solid var(--nj-accent);
    padding-right: 10px;
}
.nj-frow2 { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.nj-frow2:last-child { margin-bottom: 0; }
.nj-av {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 0.75rem;
    flex-shrink: 0;
}
.nj-nm { font-weight: 600; font-size: 0.82rem; color: white; line-height: 1.3; }
.nj-sm { font-size: 0.68rem; color: rgba(255,255,255,0.6); }
.nj-divl { height: 1px; background: rgba(255,255,255,0.12); margin: 12px 0; }
.nj-bignum { font-size: 1.8rem; font-weight: 800; color: var(--nj-accent); line-height: 1; }

.nj-fbot {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.73rem;
}
.nj-fcopy { color: rgba(255,255,255,0.55); }
.nj-flinks { display: flex; gap: 0; flex-wrap: wrap; }
.nj-flinks a {
    text-decoration: none;
    color: rgba(255,255,255,0.65);
    margin-right: 24px;
    transition: color 0.15s;
}
.nj-flinks a:hover { color: var(--nj-accent); }

/* ─── SCROLL TOP ─── */
.nj-scroll-top {
    position: fixed;
    bottom: 28px; left: 28px;
    background: var(--nj-primary);
    color: white;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    transition: 0.15s;
    z-index: 99;
    border: none;
    font-size: 16px;
}
.nj-scroll-top:hover { background: var(--nj-primary-dark); transform: scale(1.08); }

/* ─── MISC ─── */
[x-cloak] { display: none !important; }

.nj-maintenance-bar {
    background: #fef9c3;
    border-bottom: 2px solid #fde68a;
    padding: 10px 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

/* Moderator notes */
.nj-mod-notes {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--nj-border);
    padding: 14px 16px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--nj-text-soft);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .nj-page-layout { grid-template-columns: 240px 1fr; gap: 20px; }
}
@media (max-width: 768px) {
    .nj-page-layout { grid-template-columns: 1fr; padding: 16px; }
    .nj-sidebar { position: static; }
    .nj-col-labels, .nj-frow { grid-template-columns: 40px 1fr 60px 60px 1fr; padding: 12px 14px; }
    .nj-topics-header-row, .nj-topic-row { grid-template-columns: 40px 1fr 70px 70px 100px; padding: 10px 12px; }
    .nj-post { flex-direction: column; }
    .nj-post-user-panel { width: 100%; flex-direction: row; text-align: right; padding: 12px 14px; border-left: none; border-bottom: 1px solid var(--nj-border); }
    .nj-post-user-avatar { width: 48px; height: 48px; font-size: 1.1rem; }
    .nj-post-stats { padding-top: 0; border-top: none; display: flex; gap: 14px; margin-top: 0; }
    .nj-icon-btn span, .nj-notif-wrap span:not(.nj-notif-badge) { display: none; }
    .nj-topbar { gap: 10px; padding: 8px 14px; }
    .nj-topnav { display: none; }
}

/* ─── FORM STYLES ─── */
.nj-form-card{background:white;border-radius:20px;border:1px solid #e6edf4;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.nj-form-header{background:linear-gradient(135deg,#2f4a6d,#1e3450);padding:18px 24px;color:white}
.nj-form-header h1{font-size:1.2rem;font-weight:800;display:flex;align-items:center;gap:10px}
.nj-form-body{padding:24px}
.nj-form-group{margin-bottom:18px}
.nj-form-label{display:block;font-size:13px;font-weight:700;color:#374151;margin-bottom:7px}
.nj-form-input{width:100%;padding:10px 14px;border:1px solid #e2e8f0;border-radius:12px;font-family:inherit;font-size:13px;outline:none;transition:border-color .15s;background:white}
.nj-form-input:focus{border-color:#2f4a6d}
.nj-form-textarea{width:100%;padding:10px 14px;border:1px solid #e2e8f0;border-radius:12px;font-family:inherit;font-size:13px;resize:vertical;min-height:120px;outline:none;transition:border-color .15s}
.nj-form-textarea:focus{border-color:#2f4a6d}
.nj-editor-toolbar{background:#f8fafc;padding:8px 12px;border-bottom:1px solid #e2e8f0;display:flex;gap:4px;flex-wrap:wrap}
.nj-editor-btn{padding:5px 10px;border:1px solid #e2e8f0;border-radius:7px;background:white;cursor:pointer;font-size:12px;font-family:inherit;transition:.15s}
.nj-editor-btn:hover{background:#eef3fc;border-color:#2f4a6d;color:#2f4a6d}
.nj-form-textarea-editor{min-height:200px;padding:14px;font-size:14px;line-height:1.75;outline:none;font-family:inherit}
.nj-btn-submit{display:inline-flex;align-items:center;gap:8px;padding:11px 28px;background:#2f4a6d;color:white;border-radius:40px;font-weight:700;font-size:14px;border:none;cursor:pointer;font-family:inherit;transition:.15s}
.nj-btn-submit:hover{background:#1e3450}
.nj-btn-cancel{font-size:13px;color:#64748b;text-decoration:none;padding:11px 16px;border-radius:40px;border:none;background:none;cursor:pointer;font-family:inherit}
.nj-guide-card{background:white;border-radius:16px;border:1px solid #e6edf4;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.nj-guide-header{background:#2f4a6d;padding:12px 16px;color:white;font-weight:700;font-size:13px}
.nj-guide-body{padding:14px 16px}
.nj-guide-tip{font-size:12px;color:#475569;line-height:2}

/* ─── PROFILE STYLES ─── */
.nj-profile-cover{height:180px;background:linear-gradient(135deg,#2f4a6d,#1e3450);border-radius:20px 20px 0 0}
.nj-profile-avatar-section{padding:0 24px;margin-top:-48px;display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:12px}
.nj-profile-avatar-large{width:96px;height:96px;border-radius:50%;border:4px solid white;object-fit:cover;background:#eef3fc;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:800;color:#2f4a6d}
.nj-profile-buttons{display:flex;gap:8px;margin-bottom:8px}
.nj-btn-follow,.nj-btn-message{padding:8px 20px;border-radius:30px;font-size:13px;font-weight:600;border:none;cursor:pointer;font-family:inherit;transition:.15s}
.nj-btn-follow{background:#2f4a6d;color:white}
.nj-btn-follow:hover{background:#1e3450}
.nj-btn-message{background:#eef3fc;color:#2f4a6d}
.nj-profile-info-section{padding:16px 24px 20px}
.nj-profile-fullname{font-size:1.3rem;font-weight:800;color:#1e293b}
.nj-profile-username{font-size:13px;color:#94a3b8;margin-top:2px}
.nj-profile-stats{display:flex;gap:24px;padding:14px 24px;border-top:1px solid #f0f2f8;border-bottom:1px solid #f0f2f8;flex-wrap:wrap}
.nj-stat-circle{text-align:center}
.nj-stat-number{font-size:1.3rem;font-weight:800;color:#2f4a6d;line-height:1}
.nj-stat-label{font-size:11px;color:#94a3b8;margin-top:2px}
.nj-profile-tabs{display:flex;border-bottom:2px solid #e6edf4}
.nj-tab-btn{padding:12px 20px;font-size:13px;font-weight:600;color:#64748b;border:none;border-bottom:3px solid transparent;background:none;cursor:pointer;font-family:inherit;transition:.15s;margin-bottom:-2px}
.nj-tab-btn.active,.nj-tab-btn:hover{color:#2f4a6d;border-bottom-color:#2f4a6d}

/* ─── ARTICLES STYLES ─── */
.nj-articles-header{background:linear-gradient(135deg,#2f4a6d,#1e3450);border-radius:20px;padding:24px;color:white;margin-bottom:22px}
.nj-articles-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px;margin-bottom:28px}
.nj-article-card{background:white;border-radius:16px;border:1px solid #e6edf4;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.05);transition:.2s}
.nj-article-card:hover{box-shadow:0 8px 24px rgba(0,0,0,.08);transform:translateY(-2px)}
.nj-article-image{height:180px;background:linear-gradient(135deg,#eef3fc,#d4e2f5);overflow:hidden}
.nj-article-image img{width:100%;height:100%;object-fit:cover}
.nj-article-content{padding:16px}
.nj-article-category{font-size:11px;font-weight:700;color:#2f4a6d;background:#eef3fc;padding:3px 10px;border-radius:20px;display:inline-block;margin-bottom:8px}
.nj-article-title{font-size:1rem;font-weight:700;color:#1e293b;line-height:1.4;margin-bottom:8px}
.nj-article-excerpt{font-size:12px;color:#64748b;line-height:1.6;margin-bottom:12px}
.nj-article-meta{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#94a3b8}
.nj-article-stats{display:flex;gap:10px}

/* ─── SETTINGS STYLES ─── */
.nj-settings-container{max-width:700px;margin:0 auto;padding:28px 24px}
.nj-settings-card{background:white;border-radius:20px;border:1px solid #e6edf4;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.05);margin-bottom:20px}
.nj-settings-header{background:linear-gradient(135deg,#2f4a6d,#1e3450);padding:16px 24px;color:white;font-weight:700;font-size:1rem;display:flex;align-items:center;gap:10px}
.nj-settings-body{padding:24px}
.nj-upload-area{border:2px dashed #e2e8f0;border-radius:14px;padding:20px;text-align:center;cursor:pointer;transition:.15s}
.nj-upload-area:hover{border-color:#2f4a6d;background:#f8fafc}
.nj-avatar-preview{width:80px;height:80px;border-radius:50%;object-fit:cover;border:3px solid #eef3fc;display:block;margin:0 auto 10px}
.nj-btn-save{display:inline-flex;align-items:center;gap:8px;padding:10px 24px;background:#2f4a6d;color:white;border-radius:30px;font-weight:700;font-size:13px;border:none;cursor:pointer;font-family:inherit;transition:.15s}
.nj-btn-save:hover{background:#1e3450}
.nj-password-section{margin-top:8px}
.nj-password-title{font-size:14px;font-weight:700;color:#1e293b;margin-bottom:14px;display:flex;align-items:center;gap:8px}

/* ── أزرار دخول / انضم ───────────────────────── */
.nj-btn-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 40px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
    border: 1.5px solid rgba(255,255,255,0.5);
    color: white;
    background: rgba(255,255,255,0.12);
}
.nj-btn-login:hover {
    background: rgba(255,255,255,0.22);
    border-color: white;
    color: white;
}

.nj-btn-register {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 40px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: 0.2s;
    background: white;
    color: var(--nj-primary);
    border: 1.5px solid white;
}
.nj-btn-register:hover {
    background: #f0f4ff;
    transform: translateY(-1px);
    color: var(--nj-primary);
}
