:root {
    --primary: #2563eb;
    --primary-dark: #0f2557;
    --text: #1e293b;
    --muted: #64748b;
    --border-color: #e2e8f0;
    --bg: #f8fafc;
}

* { box-sizing: border-box; }
body { font-family: 'Vazirmatn', Tahoma, sans-serif; background: var(--bg); color: var(--text); margin: 0; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
h1:focus { outline: none; }

/* ---------- top bar ---------- */
.top-bar { background: linear-gradient(to left, #2563eb, #0f2557); color: #fff; font-size: 13px; padding: 8px 0; }
.top-bar .date-info i { color: #fbbf24; }
.top-bar .top-links { text-align: left; }
.top-bar a { color: #fff; font-weight: 600; }

/* ---------- header ---------- */
.main-header { background: #fff; border-bottom: 1px solid var(--border-color); padding: 14px 0; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.org-logo img { height: 56px; }

.user-login-dropdown { position: relative; }
.user-login-btn {
    display: flex; align-items: center; gap: 10px; border: 0; color: #fff; font-family: inherit; font-weight: 600;
    background: linear-gradient(135deg, #0f2557, #1e40af); padding: 10px 16px; border-radius: 10px;
    box-shadow: 0 4px 14px rgba(15, 37, 87, .35); cursor: pointer;
}
.user-login-btn .avatar { width: 30px; height: 30px; border-radius: 50%; background: #3b82f6; display: grid; place-items: center; font-size: 13px; }
.user-login-btn .arrow { font-size: 11px; transition: transform .2s; }
.user-login-btn.active .arrow { transform: rotate(180deg); }
.user-dropdown-menu {
    display: none; position: absolute; top: calc(100% + 12px); left: 0; width: 330px; background: #fff; z-index: 1000;
    border-radius: 12px; box-shadow: 0 12px 40px rgba(15, 23, 42, .2); overflow: hidden;
}
.user-dropdown-menu.show { display: block; }
.dropdown-header-custom { background: linear-gradient(135deg, #0f2557, #2563eb); color: #fff; padding: 14px 18px; font-weight: 700; }
.dropdown-item-custom { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #f1f5f9; }
.dropdown-item-custom:hover { background: #eff6ff; }
.dropdown-item-custom .item-icon { width: 38px; height: 38px; border-radius: 10px; background: #dbeafe; color: var(--primary); display: grid; place-items: center; }
.dropdown-item-custom .item-text { flex: 1; display: flex; flex-direction: column; }
.dropdown-item-custom small { color: var(--muted); }
.item-arrow { color: #94a3b8; font-size: 12px; }

/* ---------- nav ---------- */
.main-nav { background: #fff; border-bottom: 3px solid var(--primary); position: relative; z-index: 50; }
.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; }
.nav-menu .nav-item { position: static; }
.nav-menu .nav-link {
    display: flex; align-items: center; gap: 8px; padding: 14px 18px; font-weight: 700; font-size: 14px; color: #334155;
    background: none; border: 0; font-family: inherit; cursor: pointer;
}
.nav-menu .nav-link:hover, .nav-item.has-mega.active > .nav-link { background: #eff6ff; color: var(--primary); }
.hamburger-btn { background: none; border: 0; font-size: 20px; width: 44px; color: var(--primary-dark); }

.mega-menu {
    display: none; position: absolute; right: 0; left: 0; top: 100%; background: #fff; padding: 24px 32px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .15); grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid var(--border-color);
}
.nav-item.has-mega.active .mega-menu { display: grid; }
@media (min-width: 992px) { .nav-item.has-mega:hover .mega-menu { display: grid; } }
.mega-menu-column h4 { font-size: 15px; font-weight: 800; color: var(--primary-dark); margin-bottom: 10px; }
.mega-menu-column h4 i { color: var(--primary); margin-left: 6px; }
.mega-menu-column ul { list-style: none; margin: 0; padding: 0; }
.mega-menu-column li a { display: block; padding: 5px 0; font-size: 13.5px; color: #475569; }
.mega-menu-column li a:hover { color: var(--primary); }

@media (max-width: 991px) {
    .nav-menu { display: none; flex-direction: column; }
    .nav-menu.show { display: flex; }
    .mega-menu { position: static; grid-template-columns: 1fr; box-shadow: none; padding: 12px 20px; }
}

/* ---------- hero ---------- */
.hero-section { padding: 28px 0; }
.featured-news { position: relative; border-radius: 18px; overflow: hidden; height: 420px; background: #0f172a; }
.featured-news > img { width: 100%; height: 100%; object-fit: cover; }
.featured-news .overlay { position: absolute; inset: auto 0 0 0; padding: 70px 32px 24px; color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, .88), rgba(0, 0, 0, 0)); }
.featured-news h2 { font-size: 24px; font-weight: 800; line-height: 1.8; }
.featured-news p { font-size: 13px; color: #e2e8f0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured-news .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.btn-view-news { border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .12); padding: 8px 18px; border-radius: 10px; color: #fff; }
.btn-view-news:hover { background: rgba(255, 255, 255, .25); }

.sidebar-news { background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(15, 23, 42, .06); padding: 6px 14px 4px; height: 420px; overflow: hidden; display: flex; flex-direction: column; }
.sidebar-news-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; align-items: center; }
.sidebar-news-item .news-img { width: 76px; height: 60px; flex: none; border-radius: 8px; overflow: hidden; }
.sidebar-news-item .news-img img, .news-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-news-item h6 { font-size: 13px; font-weight: 700; line-height: 1.7; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.date { font-size: 12px; color: var(--muted); }
.view-all-link { display: block; text-align: center; padding: 12px; color: var(--primary); font-weight: 700; font-size: 14px; margin-top: auto; }
.view-all-link.outlined { border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 24px; background: #fff; }

/* ---------- sections ---------- */
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.section-title h3 { margin: 0; font-size: 18px; font-weight: 800; }
.section-title .icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.section-title .icon.blue { background: #dbeafe; color: var(--primary); }
.section-title .icon.red { background: #fee2e2; color: #ef4444; }

.related-news-item { display: block; }
.news-card { display: flex; gap: 16px; background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); transition: transform .2s, box-shadow .2s; }
.news-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, .1); }
.news-card .card-img { width: 120px; height: 90px; flex: none; border-radius: 10px; overflow: hidden; }
.news-card h6 { font-weight: 800; font-size: 15px; line-height: 1.8; margin-bottom: 4px; }
.news-card p { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- list / detail pages ---------- */
.page-banner { background: linear-gradient(135deg, #0f2557, #2563eb); color: #fff; text-align: center; padding: 44px 0; border-bottom: 3px solid #1d4ed8; }
.page-banner h1 { font-size: 30px; font-weight: 800; margin: 0; }
.content-card { display: block; background: #fff; border-radius: 16px; border: 1px solid var(--border-color); overflow: hidden; height: 100%; transition: transform .2s, box-shadow .2s; }
.content-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15, 23, 42, .1); }
.cc-img { position: relative; height: 200px; margin: 16px 16px 0; border-radius: 10px; overflow: hidden; }
.cc-img img { width: 100%; height: 100%; object-fit: cover; }
.cc-badge { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, .65); color: #fff; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.cc-body { padding: 16px 20px 20px; }
.cc-body h5 { font-weight: 800; font-size: 16px; line-height: 1.9; margin: 8px 0; }
.cc-body p { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.article-card { background: #fff; border-radius: 16px; padding: 28px; border: 1px solid var(--border-color); max-width: 900px; margin: 0 auto; }
.article-img { width: 100%; border-radius: 12px; margin-bottom: 20px; }
.article-title { font-size: 24px; font-weight: 800; line-height: 2; }
.article-body { line-height: 2.1; font-size: 15px; overflow-wrap: anywhere; }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.article-body table { max-width: 100%; border-collapse: collapse; margin: 12px 0; }
.article-body th, .article-body td { border: 1px solid #cbd5e1; padding: 6px 10px; vertical-align: top; }
.article-body th { background: #f1f5f9; }
.article-body blockquote { border-right: 4px solid var(--primary); padding: 4px 16px; color: #475569; margin: 12px 0; }
.article-body ul, .article-body ol { padding-right: 24px; }
.article-body a { color: var(--primary); text-decoration: underline; }
.editor-host .jodit-container { border-radius: 10px; }

.faq { max-width: 860px; margin: 0 auto; }
.faq-item { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 10px; }
.faq-q { width: 100%; display: flex; justify-content: space-between; background: none; border: 0; padding: 16px 20px; font-family: inherit; font-weight: 700; text-align: right; }
.faq-q i { color: var(--primary); }
.faq-a { padding: 0 20px 16px; color: #475569; }

/* ---------- login ---------- */
.login-card { max-width: 420px; margin: 20px auto; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 10px 30px rgba(15, 23, 42, .1); }
.login-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: linear-gradient(135deg, #0f2557, #2563eb); color: #fff; display: grid; place-items: center; font-size: 26px; }

/* ---------- footer ---------- */
.main-footer { margin-top: 40px; color: #cbd5e1; }
.footer-top { background: linear-gradient(to left, #1d4ed8, #0f2557); padding: 40px 0; }
.footer-top h5 { color: #fff; font-weight: 800; font-size: 16px; margin-bottom: 16px; }
.footer-top h5 i { color: #fbbf24; margin-left: 6px; }
.footer-links ul, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li a { display: block; padding: 4px 0; color: #cbd5e1; }
.footer-links li a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.footer-contact i { color: #60a5fa; margin-top: 6px; }
.footer-bottom { background: #0a1a3d; padding: 14px 0; font-size: 13px; color: #94a3b8; }

/* ---------- floating notice ---------- */
.floating-notice { position: fixed; left: 24px; bottom: 24px; z-index: 2000; background: #fff; border-radius: 14px; padding: 18px 22px; width: 280px; box-shadow: 0 10px 36px rgba(15, 23, 42, .22); cursor: pointer; }
.notice-close { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-color); background: #fff; font-size: 11px; }
.notice-content { text-align: center; }
.notice-bell { color: #fbbf24; font-size: 26px; animation: ring 2s infinite; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } 50% { transform: rotate(0); } }
.notice-label { display: block; color: #ef4444; font-weight: 800; font-size: 13px; margin-top: 4px; }
.notice-title { color: #334155; font-size: 14px; }

/* ---------- admin ---------- */
.admin-shell { display: flex; min-height: 100vh; background: #f1f5f9; }
.admin-sidebar { width: 250px; flex: none; background: #0f2557; color: #cbd5e1; padding: 18px 0; }
.admin-brand { color: #fff; font-weight: 800; padding: 6px 22px 18px; font-size: 16px; border-bottom: 1px solid rgba(255, 255, 255, .1); margin-bottom: 10px; }
.admin-link { display: flex; align-items: center; gap: 12px; padding: 12px 22px; color: #cbd5e1; font-size: 14px; }
.admin-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; padding: 12px 24px; display: flex; align-items: center; border-bottom: 1px solid var(--border-color); }
.admin-content { padding: 24px; }
.admin-card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); }
.edit-panel { background: #f8fafc; border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-bottom: 22px; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; }
.thumb-video { width: 220px; border-radius: 8px; }
.perm-group { background: #fff; border: 1px solid var(--border-color); border-radius: 10px; padding: 12px 14px; height: 100%; }
.perm-group strong { display: block; margin-bottom: 6px; color: var(--primary-dark); }
.stat-card { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); }
.stat-card i { font-size: 26px; color: var(--primary); }
.stat-card strong { font-size: 28px; }
.stat-card span { color: var(--muted); }

@media (max-width: 991px) {
    .admin-sidebar { position: fixed; z-index: 3000; top: 0; bottom: 0; right: -260px; transition: right .25s; }
    .admin-sidebar.open { right: 0; }
    .featured-news { height: 320px; }
    .featured-news h2 { font-size: 18px; }
    .sidebar-news { height: auto; }
    .floating-notice { left: 12px; bottom: 12px; width: 240px; }
}

/* ---------- mega menu (details) ---------- */
.nav-chevron { font-size: 10px; margin-right: 2px; }
.mega-menu-column h4 { padding-bottom: 10px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 8px; }
.mega-menu-column h4 a { display: flex; align-items: center; gap: 8px; color: inherit; }
.mega-menu { row-gap: 28px; }

/* ---------- FAQ ---------- */
.faq-box { max-width: 860px; margin: 0 auto; }
.faq-input { position: relative; }
.faq-input i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.faq-input input { padding: 14px 44px 14px 16px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 2px 8px rgba(15, 23, 42, .05); }
.faq-answer { margin-top: 14px; min-height: 120px; background: #fff; border: 1px solid var(--border-color); border-right: 4px solid var(--primary); border-radius: 12px; padding: 20px 24px; line-height: 2.1; }
.faq-suggestions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.faq-chip { background: #eff6ff; color: var(--primary); border: 0; border-radius: 20px; padding: 6px 14px; font-family: inherit; font-size: 13px; }
.faq-chip:hover { background: #dbeafe; }

/* ---------- 404 / error ---------- */
.error-box { max-width: 560px; margin: 40px auto; background: #fff; border: 1px solid var(--border-color); border-radius: 18px; padding: 48px 32px; text-align: center; box-shadow: 0 8px 28px rgba(15, 23, 42, .06); }
.error-code { font-size: 96px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, #2563eb, #0f2557); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-box h1 { font-size: 24px; font-weight: 800; margin: 12px 0 8px; }
.error-box p { color: var(--muted); line-height: 2; margin-bottom: 20px; }
