/* BlogSaz UI — RTL, responsive, light/dark (based on ui.html tokens) */
@font-face { font-family: 'Vazirmatn'; src: local('Vazirmatn'); font-display: swap; }

:root, html[data-theme="light"] {
	--bg: #f7f8fb; --bg2: #ffffff; --bg3: #eef1f6;
	--text: #1c2333; --muted: #6b7280; --border: #e4e7ee;
	--primary: #4f6ef7; --primary-2: #3b5ae0; --primary-soft: #e8edfe;
	--green: #16a34a; --green-soft: #e7f6ec; --red: #dc2626; --red-soft: #fdecec;
	--yellow: #b45309; --yellow-soft: #fdf3e0; --orange: #ea580c; --orange-soft: #fdeee2;
	--blue: #2563eb; --blue-soft: #e7eefe; --purple: #7c3aed; --purple-soft: #f1e9fe;
	--gray: #6b7280; --gray-soft: #eef0f4;
	--shadow: 0 1px 3px rgba(16,24,40,.07), 0 8px 24px rgba(16,24,40,.05);
	--radius: 14px;
}
html[data-theme="dark"] {
	--bg: #0b1220; --bg2: #101a2e; --bg3: #17233c;
	--text: #e7ecf5; --muted: #93a0b4; --border: #223252;
	--primary: #6d8bff; --primary-2: #4f6ef7; --primary-soft: #1a2647;
	--green: #34d399; --green-soft: #10301f; --red: #f87171; --red-soft: #3a1414;
	--yellow: #fbbf24; --yellow-soft: #3a2a08; --orange: #fb923c; --orange-soft: #3a1f0a;
	--blue: #60a5fa; --blue-soft: #10233f; --purple: #a78bfa; --purple-soft: #241543;
	--gray: #93a0b4; --gray-soft: #1a2439;
	--shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
	font-size: 14.5px; line-height: 1.75; direction: rtl;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { line-height: 1.4; margin: 0 0 .6em; }
h1{font-size:1.5rem} h2{font-size:1.25rem} h3{font-size:1.08rem} h4{font-size:1rem}
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code { background: var(--bg3); border-radius: 6px; padding: 1px 6px; font-size: .86em; direction: ltr; display: inline-block; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .empty { padding: 18px 0; text-align: center; }

/* ===== Layout ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
	width: 264px; flex-shrink: 0; background: var(--bg2); border-left: 1px solid var(--border);
	padding: 18px 14px; display: flex; flex-direction: column; gap: 14px;
	position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--primary); }
.blog-switcher select { width: 100%; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
	display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
	color: var(--text); font-size: .93rem;
}
.side-nav a:hover { background: var(--bg3); text-decoration: none; }
.side-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-title { font-size: .74rem; font-weight: 700; color: var(--muted); margin: 12px 4px 4px; letter-spacing: .03em; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(10,15,30,.45); z-index: 40; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
	display: flex; align-items: center; gap: 12px; padding: 12px 22px;
	background: var(--bg2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.hamburger { display: none; }
.page-title { font-weight: 700; font-size: 1.05rem; margin: 0; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
	border: 1px solid var(--border); background: var(--bg2); color: var(--text); border-radius: 10px;
	width: 36px; height: 36px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.icon-btn:hover { background: var(--bg3); }
.notif-btn { position: relative; }
.notif-dot {
	position: absolute; top: -5px; left: -5px; background: var(--red); color: #fff;
	border-radius: 99px; font-size: .66rem; min-width: 17px; height: 17px; line-height: 17px; padding: 0 4px;
}
.user-chip { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.content { padding: 22px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ===== Cards & grids ===== */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h3, .card-head h4 { margin: 0; }
.card-narrow { max-width: 640px; }
.card-danger { border-color: var(--red); }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ===== Lists ===== */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.list-item:last-child { border-bottom: 0; }
.list-title { font-weight: 600; }
.list-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.notif-list .notif-title { font-weight: 700; }
.notif-list .notif-body { color: var(--muted); font-size: .88rem; }
.notif-list .unread { background: var(--primary-soft); border-radius: 10px; padding: 10px; }
.notif-list .read { opacity: .8; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: right; font-size: .78rem; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--bg3); }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 7px 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); font-size: .88rem; }
.tab:hover { text-decoration: none; background: var(--bg3); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ===== Comments / moderation ===== */
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.comment-meta { font-size: .84rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.comment-body { white-space: pre-wrap; }
.comment-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mod-item { align-items: flex-start; }
.mod-content { background: var(--bg3); border-radius: 10px; padding: 8px 12px; margin: 6px 0; }

/* ===== Media ===== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg3); }
.media-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.media-file { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.media-name { font-size: .78rem; padding: 6px 8px 0; word-break: break-all; direction: ltr; text-align: left; }
.media-actions { display: flex; gap: 4px; padding: 6px 8px 8px; flex-wrap: wrap; }

/* ===== Stats ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bar:hover { opacity: 1; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Editor ===== */
.editor-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.editor-main textarea[name="content"] { min-height: 380px; font-size: .95rem; }
.editor-side .card { position: sticky; top: 76px; }
.code-area { font-family: Consolas, Menlo, monospace; font-size: .84rem; direction: ltr; text-align: left; white-space: pre; }
.seo-box summary { cursor: pointer; font-weight: 600; }

/* ===== Forms ===== */
.form label { display: block; margin-bottom: 10px; font-size: .9rem; font-weight: 600; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="number"],
.form input[type="search"], .form input[type="file"], .form select, .form textarea,
.search-form input, .search-form select, .blog-switcher select {
	width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
	background: var(--bg); color: var(--text); font: inherit; font-weight: 400;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.form textarea { resize: vertical; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline label { flex: 1; min-width: 170px; margin-bottom: 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.check input { width: auto !important; margin: 0 !important; }
.hint { display: block; font-weight: 400; }
.input-xs { padding: 4px 8px !important; width: auto !important; font-size: .84rem !important; margin-top: 0 !important; }
.search-form { display: flex; gap: 6px; align-items: center; }
.search-form input, .search-form select { width: auto; margin-top: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.upload-form { margin-bottom: 14px; }
.cap-row, .feature-row { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; font-weight: 400 !important; margin-bottom: 6px !important; }
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 12px; }

/* ===== Chat (tickets) ===== */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.chat-msg { max-width: 85%; background: var(--bg3); border-radius: 14px 14px 14px 4px; padding: 10px 14px; align-self: flex-start; }
.chat-msg.admin, .chat-msg.mine { background: var(--primary-soft); border-radius: 14px 14px 4px 14px; align-self: flex-end; }
.chat-meta { font-size: .76rem; color: var(--muted); margin-bottom: 4px; }
.chat-body { white-space: pre-wrap; }

/* ===== Badges / alerts ===== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge-gray { background: var(--gray-soft); color: var(--gray); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.alert { border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; font-size: .92rem; border: 1px solid transparent; }
.alert-ok { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.alert-err { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.alert-info { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }

/* ===== Pagination ===== */
.pagination { display: flex; gap: 5px; margin-top: 14px; flex-wrap: wrap; }
.page-link { min-width: 34px; height: 34px; line-height: 32px; text-align: center; border: 1px solid var(--border); border-radius: 9px; background: var(--bg2); color: var(--text); padding: 0 6px; }
.page-link:hover { text-decoration: none; background: var(--bg3); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-dots { padding: 0 4px; color: var(--muted); }

/* ===== Buttons ===== */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
	border: 1px solid var(--border); background: var(--bg2); color: var(--text);
	border-radius: 10px; padding: 8px 16px; font: inherit; font-size: .9rem; font-weight: 600;
	transition: background .12s, transform .05s;
}
.btn:hover { background: var(--bg3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 4px 11px; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: 12px 26px; font-size: 1rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-success { background: transparent; border-color: var(--green); color: var(--green); }
.btn-success:hover { background: var(--green-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-block { width: 100%; }

/* ===== Auth pages ===== */
.auth-body { background: var(--bg); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg2); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; }
.auth-logo { text-align: center; font-weight: 800; font-size: 1.3rem; color: var(--primary); margin-bottom: 16px; }
.auth-foot, .auth-links { text-align: center; margin-top: 14px; font-size: .88rem; }
.otp-input { text-align: center; letter-spacing: .5em; font-size: 1.3rem !important; direction: ltr; }

/* Honeypot: must stay invisible for humans */
.hp-field { position: absolute !important; right: -9999px !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* ===== Blank / error / landing ===== */
.blank-body { background: var(--bg); }
.panel-body { background: var(--bg); }
.error-page { max-width: 560px; margin: 8vh auto; text-align: center; padding: 24px; }
.error-code { font-size: 3.4rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.error-page .row-actions { justify-content: center; }

.landing { max-width: 1080px; margin: 0 auto; padding: 20px; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 40px; }
.landing-actions { display: flex; gap: 8px; align-items: center; }
.landing-hero { text-align: center; padding: 30px 0 50px; }
.landing-hero h1 { font-size: 2.2rem; }
.landing-sub { margin: 14px 0 24px; }
.landing-blogs h2 { text-align: center; margin-bottom: 20px; }
.blog-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.blog-card { display: block; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); }
.blog-card:hover { text-decoration: none; border-color: var(--primary); }
.blog-card-title { font-weight: 700; margin-bottom: 4px; }
.blog-card-url { color: var(--primary); margin-top: 8px; }
.landing-foot { text-align: center; padding: 40px 0 16px; }

/* ===== Shop public ===== */
.shop-page { max-width: 960px; margin: 0 auto; padding: 20px; }
.shop-head { margin-bottom: 20px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.product-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.product-price { font-size: 1.15rem; font-weight: 800; color: var(--primary); margin: 8px 0; }
.buy-box summary { list-style: none; cursor: pointer; margin-top: 8px; }
.buy-box summary::-webkit-details-marker { display: none; }
.buy-box form { margin-top: 12px; }
.shop-foot { margin-top: 30px; }

/* ===== Plans ===== */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.plan-card { margin-bottom: 0; display: flex; flex-direction: column; }
.plan-card form { margin-top: auto; }
.plan-current { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.plan-price { font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.plan-features { padding-right: 18px; margin: 0 0 12px; }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
	.grid-3 { grid-template-columns: 1fr 1fr; }
	.editor-layout { grid-template-columns: 1fr; }
	.editor-side .card { position: static; }
}
@media (max-width: 780px) {
	.sidebar {
		position: fixed; right: 0; top: 0; z-index: 50; height: 100vh;
		transform: translateX(100%); transition: transform .2s ease;
	}
	body.sidebar-open .sidebar { transform: translateX(0); }
	body.sidebar-open .backdrop { display: block; }
	.hamburger { display: inline-flex; }
	.grid-2, .grid-3 { grid-template-columns: 1fr; }
	.content { padding: 14px; }
	.topbar { padding: 10px 14px; }
	.user-chip .user-name { display: none; }
	.form-inline label { min-width: 100%; }
}
@media (max-width: 420px) {
	body { font-size: 14px; }
	.stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== v5: آیکون‌های SVG و گالری قالب ===== */
.side-nav a svg.icon{vertical-align:-4px;margin-inline-end:9px;opacity:.72;transition:opacity .15s}
.side-nav a:hover svg.icon,.side-nav a.active svg.icon{opacity:1}
.brand a svg.icon{vertical-align:-4px;margin-inline-end:6px}
.icon-btn svg.icon{vertical-align:-3px}
.auth-logo svg.icon{vertical-align:-4px;margin-inline-end:6px}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px;margin:14px 0}
.theme-card{border:1px solid var(--border);border-radius:14px;padding:16px;background:var(--bg2);display:grid;gap:8px;align-content:start}
.theme-card.active{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}
.theme-name{display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* ===================================================================== */
/* ===== v6: پوسته پنل مطابق ui.html — منوی بالایی + کارت‌های نرم ===== */
/* ===================================================================== */
:root{--primary:#4f46e5;--primary-soft:rgba(79,70,229,.12);--brand-50:#eef2ff;--brand-100:#e0e7ff;--brand-600:#4f46e5;--brand-700:#4338ca}
[data-theme="dark"]{--brand-50:rgba(99,102,241,.16);--brand-100:rgba(99,102,241,.25);--brand-600:#6366f1;--brand-700:#a5b4fc}

/* نوار پیشرفت SPA */
#spa-bar{position:fixed;top:0;right:0;height:2.5px;width:0;z-index:100;background:linear-gradient(90deg,#6366f1,#8b5cf6);border-radius:0 0 0 3px;opacity:0;transition:none}
#spa-bar.loading{opacity:1;width:82%;transition:width 8s cubic-bezier(.08,.74,.34,1)}
#spa-bar.done{opacity:0;width:100%;transition:width .2s ease,opacity .4s ease .2s}

/* هدر چسبان */
.topnav{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.86);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid #f1f2f6}
[data-theme="dark"] .topnav{background:rgba(15,23,42,.86);border-bottom-color:rgba(255,255,255,.07)}
.tn-wrap{max-width:1200px;margin:0 auto;padding:0 16px}
.tn-row1{display:flex;align-items:center;gap:12px;height:58px}
.tn-brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit}
.tn-logo{width:34px;height:34px;border-radius:12px;background:var(--brand-600);color:#fff;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 1px 2px rgba(15,23,42,.08)}
.tn-logo svg.icon{vertical-align:0;margin:0}
.tn-title{display:flex;flex-direction:column;line-height:1.35}
.tn-title b{font-size:14px;font-weight:800}
.tn-title small{font-size:11px;color:#6b7280;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
[data-theme="dark"] .tn-title small{color:#94a3b8}
.tn-spacer{flex:1}
.tn-actions{display:flex;align-items:center;gap:6px}
.tn-actions .icon-btn{width:36px;height:36px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;color:#6b7280;cursor:pointer;position:relative;transition:.15s}
.tn-actions .icon-btn:hover{background:#f3f4f6;color:#111827}
[data-theme="dark"] .tn-actions .icon-btn{color:#94a3b8}
[data-theme="dark"] .tn-actions .icon-btn:hover{background:rgba(255,255,255,.08);color:#e2e8f0}
.tn-actions .user-chip{display:flex;align-items:center;gap:4px;background:#f3f4f6;border-radius:12px;padding:3px 4px 3px 3px}
[data-theme="dark"] .tn-actions .user-chip{background:rgba(255,255,255,.07)}
.tn-actions .user-chip>a{font-size:12.5px;font-weight:700;padding:4px 10px;border-radius:9px;text-decoration:none;color:inherit}
.tn-actions .user-chip>a:hover{background:#fff}
[data-theme="dark"] .tn-actions .user-chip>a:hover{background:rgba(255,255,255,.09)}
.tn-actions .notif-btn .notif-dot{position:absolute;top:2px;left:2px;background:#f59e0b;color:#fff;font-size:9.5px;line-height:1;border-radius:999px;padding:2.5px 5px;font-weight:800}

/* ردیف منوی پیلی */
.tn-navrow{border-top:1px solid #f4f5f8;overflow-x:auto;scrollbar-width:thin}
[data-theme="dark"] .tn-navrow{border-top-color:rgba(255,255,255,.05)}
.pill-nav{display:flex;align-items:center;gap:3px;padding-top:7px;padding-bottom:7px;white-space:nowrap}
.pill-nav a{display:inline-flex;align-items:center;gap:7px;padding:7px 13px;border-radius:10px;font-size:13px;font-weight:600;color:#4b5563;text-decoration:none;transition:.14s}
.pill-nav a svg.icon{vertical-align:0;margin:0;opacity:.8}
.pill-nav a:hover{background:#f3f4f6;color:#111827}
.pill-nav a.active{background:var(--brand-50);color:var(--brand-700)}
.pill-nav a.active svg.icon{opacity:1}
[data-theme="dark"] .pill-nav a{color:#94a3b8}
[data-theme="dark"] .pill-nav a:hover{background:rgba(255,255,255,.07);color:#e2e8f0}
[data-theme="dark"] .pill-nav a.active{background:var(--brand-50);color:var(--brand-700)}
.pill-nav .blog-switcher{border:1px solid #e5e7eb;background:#fff;border-radius:10px;font:inherit;font-size:12.5px;font-weight:600;padding:6px 10px;color:#374151;max-width:220px;margin-inline-end:6px}
[data-theme="dark"] .pill-nav .blog-switcher{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12);color:#e2e8f0}

/* محتوا */
.tn-main{padding:22px 0 46px}
.content-head{display:flex;align-items:center;gap:10px;margin-bottom:16px}
.content-head .page-title{font-size:19px;font-weight:800;margin:0}

/* کارت‌ها و جدول‌ها به سبک ui.html */
.panel-body .card{border-radius:16px;border:1px solid #f1f2f6;box-shadow:0 1px 2px rgba(15,23,42,.04),0 4px 16px -4px rgba(15,23,42,.06)}
[data-theme="dark"] .panel-body .card{border-color:rgba(255,255,255,.07)}
.panel-body .btn{border-radius:10px}
.panel-body .btn-primary{background:var(--brand-600);border-color:var(--brand-600)}
.panel-body .btn-primary:hover{background:var(--brand-700);border-color:var(--brand-700)}
.panel-body .table thead th{font-size:11.5px;color:#6b7280;font-weight:700;letter-spacing:.2px}
[data-theme="dark"] .panel-body .table thead th{color:#94a3b8}
.panel-body .table tbody tr{transition:background .12s}
.panel-body .table tbody tr:hover{background:#f8fafc}
[data-theme="dark"] .panel-body .table tbody tr:hover{background:rgba(255,255,255,.03)}
.panel-body input:focus,.panel-body select:focus,.panel-body textarea:focus{outline:none;border-color:var(--brand-600);box-shadow:0 0 0 3px rgba(99,102,241,.25)}
@media(max-width:700px){.tn-title small{display:none}.tn-row1{height:52px}}

/* ===== v7.1: کارتی‌سازی اعلان‌ها ===== */
.notif-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.notif-list li{background:#fff;border:1px solid #f0f1f5;border-radius:12px;padding:12px 14px;display:flex;flex-direction:column;gap:4px;opacity:1}
.notif-list li.unread{background:#fbfbff;border-color:#e0e7ff;border-inline-start:3px solid #6366f1;padding:12px 14px}
.notif-list li.read{opacity:.72;background:#fff}
.notif-list .notif-title{font-weight:700;font-size:13.5px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.notif-list .notif-title .muted{font-weight:500}
.notif-list .notif-body{color:#6b7280;font-size:12.8px;line-height:1.9}
.notif-list a.small{color:#4f46e5;font-weight:600;text-decoration:none;align-self:flex-start;margin-top:2px}
.notif-list a.small:hover{text-decoration:underline}
[data-theme="dark"] .notif-list li{background:rgba(255,255,255,.03);border-color:rgba(255,255,255,.08)}
[data-theme="dark"] .notif-list li.unread{background:rgba(99,102,241,.09);border-color:rgba(99,102,241,.35)}
[data-theme="dark"] .notif-list .notif-body{color:#94a3b8}

/* دکمه پنل سوپرادمین (تاج) */
.tn-admin-link{color:#b45309}
.tn-admin-link:hover{background:#fef3c7;color:#92400e}
[data-theme="dark"] .tn-admin-link{color:#fbbf24}
[data-theme="dark"] .tn-admin-link:hover{background:rgba(251,191,36,.12)}

/* ===== v9: دراپ‌زون، تب‌ها، داشبورد سوپرادمین، دسته‌بندی ===== */
/* آپلودر حرفه‌ای */
.dz{position:relative;border:2px dashed #d7d9e0;border-radius:14px;padding:20px 16px;text-align:center;cursor:pointer;transition:border-color .15s,background .15s;background:#fafbfc;display:flex;flex-direction:column;align-items:center;gap:6px;margin:6px 0}
.dz:hover,.dz.drag{border-color:#6366f1;background:#eef2ff}
.dz input[type="file"]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.dz .dz-ic{color:#6366f1;display:inline-flex}
.dz .dz-text b{font-size:13.5px;display:block;font-weight:700}
.dz .dz-hint{font-size:11.5px;color:#9ca3af;direction:ltr;display:block;margin-top:2px}
.dz .dz-name{font-size:12.5px;font-weight:700;color:#4f46e5;direction:ltr}
.dz.has-file{border-style:solid;border-color:#c7d2fe;background:#f5f7ff}
[data-theme="dark"] .dz{background:rgba(255,255,255,.02);border-color:rgba(255,255,255,.14)}
[data-theme="dark"] .dz:hover,[data-theme="dark"] .dz.drag{background:rgba(99,102,241,.08);border-color:#6366f1}
[data-theme="dark"] .dz.has-file{background:rgba(99,102,241,.06);border-color:rgba(99,102,241,.4)}

/* تب‌های خودکار صفحات چندبخشی */
.page-tabs{margin-bottom:14px}
.page-tabs .tab{cursor:pointer;font-family:inherit;transition:background .15s,color .15s}
.page-tabs .tab:hover{border-color:#c7d2fe;color:#4f46e5}
.page-tabs .tab.active{background:#4f46e5;border-color:#4f46e5;color:#fff}
[data-theme="dark"] .page-tabs .tab.active{background:#6366f1;border-color:#6366f1}

/* کارت‌های آمار داشبورد سوپرادمین */
.stat-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));gap:12px;margin-bottom:16px}
.stat-card{background:var(--bg2,#fff);border:1px solid #f3f4f6;border-radius:16px;padding:14px 16px;display:flex;align-items:center;gap:12px;box-shadow:0 1px 2px 0 rgba(15,23,42,.04)}
.stat-card .stat-num{font-size:1.3rem;font-weight:800;line-height:1.3}
.stat-card .stat-label{font-size:.84rem;font-weight:600;color:#374151}
.stat-card .stat-sub{font-size:.7rem;color:#9ca3af;margin-top:1px}
.stat-ic{width:42px;height:42px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.ic-indigo{background:#eef2ff;color:#4f46e5}
.ic-blue{background:#eff6ff;color:#2563eb}
.ic-violet{background:#f5f3ff;color:#7c3aed}
.ic-green{background:#ecfdf5;color:#059669}
.ic-amber{background:#fffbeb;color:#b45309}
.ic-rose{background:#fff1f2;color:#e11d48}
[data-theme="dark"] .stat-card{border-color:rgba(255,255,255,.08)}
[data-theme="dark"] .stat-card .stat-label{color:#cbd5e1}
[data-theme="dark"] .ic-indigo,[data-theme="dark"] .ic-blue,[data-theme="dark"] .ic-violet,[data-theme="dark"] .ic-green,[data-theme="dark"] .ic-amber,[data-theme="dark"] .ic-rose{background:rgba(255,255,255,.07)}

/* لیست نیازمند رسیدگی */
.attn-list{list-style:none;margin:0;padding:0}
.attn-list li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 4px;border-bottom:1px solid #f3f4f6}
.attn-list li:last-child{border-bottom:0}
.attn-list a{display:flex;align-items:center;gap:10px;font-weight:600;font-size:.9rem;text-decoration:none;color:inherit}
.attn-list a:hover{color:#4f46e5}
.attn-ic{width:30px;height:30px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
[data-theme="dark"] .attn-list li{border-color:rgba(255,255,255,.07)}

/* لیست رویدادها */
.event-list{list-style:none;margin:0;padding:0}
.event-list li{display:flex;align-items:center;gap:8px;padding:8px 2px;border-bottom:1px dashed #f3f4f6;flex-wrap:wrap}
.event-list li:last-child{border-bottom:0}
.event-dot{width:7px;height:7px;border-radius:99px;background:#c7d2fe;flex:0 0 auto}
.event-title{font-size:.86rem;font-weight:600}
.event-code{font-size:.7rem;background:#f6f7f9;border-radius:6px;padding:1px 6px}
.event-time{margin-inline-start:auto}
[data-theme="dark"] .event-list li{border-color:rgba(255,255,255,.07)}
[data-theme="dark"] .event-code{background:rgba(255,255,255,.06)}

/* جدول دسته‌بندی‌ها */
.cat-table td{vertical-align:middle}
.cat-table input{min-width:0}
.grid-cats{align-items:start}

/* ===== v9.1: چیدمان سایدبار راست + سلکتور وبلاگ + نمودار ===== */
.layout-side{display:flex;align-items:flex-start;gap:24px}
.side-menu{width:228px;flex:0 0 228px;position:sticky;top:72px;display:flex;flex-direction:column;gap:12px;padding:20px 0 46px;max-height:calc(100vh - 72px);overflow-y:auto;scrollbar-width:thin}
.layout-side .tn-main{flex:1;min-width:0;padding:22px 0 46px}
.side-menu .side-nav{display:flex;flex-direction:column;gap:2px}
.side-menu .side-nav a{display:flex;align-items:center;gap:9px;padding:8.5px 12px;border-radius:10px;font-size:13px;font-weight:600;color:#4b5563;text-decoration:none;transition:.14s}
.side-menu .side-nav a svg.icon{margin:0;opacity:.75}
.side-menu .side-nav a:hover{background:#f3f4f6;color:#111827}
.side-menu .side-nav a.active{background:var(--brand-50,#eef2ff);color:var(--brand-700,#4338ca)}
.side-menu .side-nav a.active svg.icon{opacity:1}
[data-theme="dark"] .side-menu .side-nav a{color:#94a3b8}
[data-theme="dark"] .side-menu .side-nav a:hover{background:rgba(255,255,255,.07);color:#e2e8f0}
[data-theme="dark"] .side-menu .side-nav a.active{background:rgba(99,102,241,.16);color:#a5b4fc}
.side-menu .blog-switcher{-webkit-appearance:none;appearance:none;width:100%;border:1px solid #e5e7eb;background:#fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat left 10px center;border-radius:12px;font:inherit;font-size:13px;font-weight:700;padding:9px 12px;padding-inline-end:12px;padding-inline-start:30px;color:#374151;cursor:pointer;box-shadow:0 1px 2px rgba(15,23,42,.04);transition:border-color .15s,box-shadow .15s}
.side-menu .blog-switcher:hover{border-color:#c7d2fe}
.side-menu .blog-switcher:focus{outline:none;border-color:var(--brand-600,#4f46e5);box-shadow:0 0 0 3px rgba(99,102,241,.25)}
[data-theme="dark"] .side-menu .blog-switcher{background-color:rgba(255,255,255,.05);border-color:rgba(255,255,255,.12);color:#e2e8f0}
.chart30{margin-top:8px}
.chart30 svg{display:block;width:100%;height:170px}
.chart-meta{display:flex;justify-content:space-between;font-size:11px;color:#9ca3af;margin-top:6px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.card-head h3{margin:0}
@media (max-width: 900px){
	.layout-side{display:block}
	.side-menu{position:fixed;top:0;right:0;z-index:70;height:100vh;max-height:100vh;width:262px;background:var(--bg2,#fff);padding:16px 14px;transform:translateX(100%);transition:transform .2s ease;box-shadow:-8px 0 30px rgba(15,23,42,.12);border-inline-start:1px solid var(--border,#e5e7eb)}
	body.sidebar-open .side-menu{transform:translateX(0)}
	body.sidebar-open .backdrop{display:block;z-index:60}
	.hamburger{display:inline-flex}
}

/* ===== v10: global inputs + landing ===== */
.panel-body input[type="text"],.panel-body input[type="email"],.panel-body input[type="password"],.panel-body input[type="number"],.panel-body input[type="search"],.panel-body input[type="url"],.panel-body input[type="tel"],.panel-body select,.panel-body textarea{border:1px solid #e5e7eb;background:var(--bg2,#fff);border-radius:10px;padding:8px 12px;font:inherit;font-size:13px;color:inherit;box-shadow:0 1px 2px rgba(15,23,42,.04);transition:border-color .15s,box-shadow .15s}
.panel-body input[type="text"]:hover,.panel-body input[type="email"]:hover,.panel-body input[type="password"]:hover,.panel-body input[type="number"]:hover,.panel-body input[type="search"]:hover,.panel-body select:hover,.panel-body textarea:hover{border-color:#d1d5db}
[data-theme="dark"] .panel-body input[type="text"],[data-theme="dark"] .panel-body input[type="email"],[data-theme="dark"] .panel-body input[type="password"],[data-theme="dark"] .panel-body input[type="number"],[data-theme="dark"] .panel-body input[type="search"],[data-theme="dark"] .panel-body input[type="url"],[data-theme="dark"] .panel-body input[type="tel"],[data-theme="dark"] .panel-body select,[data-theme="dark"] .panel-body textarea{background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.12)}
.table input{width:100%}
.table input.input-xs{width:80px !important}
.row-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.cat-table .row-actions{flex-wrap:nowrap}
.cat-table td{vertical-align:middle}

/* --- landing v10 --- */
.landing{max-width:1120px;margin:0 auto;padding:18px 18px 0}
.landing-top{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 0}
.landing-brand{display:inline-flex;align-items:center;gap:9px;text-decoration:none;color:inherit;font-size:15px}
.landing-brand:hover{text-decoration:none}
.lb-logo{width:34px;height:34px;border-radius:12px;background:var(--brand-600,#4f46e5);color:#fff;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 6px 14px -6px rgba(79,70,229,.5)}
.hero{text-align:center;padding:64px 12px 40px;position:relative}
.hero::before{content:"";position:absolute;inset:0;background:radial-gradient(620px 280px at 50% 0,rgba(99,102,241,.13),transparent 70%);pointer-events:none}
.hero-badge{display:inline-block;background:#eef2ff;color:#4338ca;font-size:12px;font-weight:700;border-radius:999px;padding:6px 14px;margin-bottom:18px}
.hero h1{font-size:2.6rem;font-weight:800;margin:0 0 10px;background:linear-gradient(90deg,#4f46e5,#7c3aed);-webkit-background-clip:text;background-clip:text;color:transparent}
.hero-desc{font-size:1.05rem;color:#6b7280;max-width:560px;margin:0 auto 18px}
.hero-chips{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-bottom:22px}
.hero-chips code{background:var(--bg2,#fff);border:1px solid #e5e7eb;border-radius:10px;padding:7px 12px;font-size:12.5px;box-shadow:0 1px 2px rgba(15,23,42,.05)}
.hero-cta{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.hero-stats{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:34px;position:relative}
.hero-stats > div{background:var(--bg2,#fff);border:1px solid #f0f1f5;border-radius:14px;padding:12px 24px;min-width:124px;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.hero-stats b{display:block;font-size:1.3rem;color:var(--brand-600,#4f46e5)}
.hero-stats span{font-size:.75rem;color:#9ca3af}
.landing-sec{padding:26px 0}
.sec-head{display:flex;align-items:baseline;gap:10px;margin-bottom:16px}
.sec-head h2{margin:0;font-size:1.25rem;font-weight:800}
.post-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.post-card{display:flex;flex-direction:column;gap:12px;background:var(--bg2,#fff);border:1px solid #f0f1f5;border-radius:14px;padding:15px 16px;color:inherit;text-decoration:none;box-shadow:0 1px 2px rgba(15,23,42,.04);transition:transform .15s,border-color .15s,box-shadow .15s}
.post-card:hover{transform:translateY(-2px);border-color:#c7d2fe;box-shadow:0 10px 22px -10px rgba(79,70,229,.28);text-decoration:none}
.pc-title{font-weight:700;font-size:.95rem;line-height:1.7}
.pc-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}
.pc-blog{background:#eef2ff;color:#4338ca;border-radius:999px;padding:3px 10px;font-size:11.5px;font-weight:700;max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.blog-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.blog-card{display:flex;flex-direction:column;gap:5px;background:var(--bg2,#fff);border:1px solid #f0f1f5;border-radius:14px;padding:16px;color:inherit;text-decoration:none;box-shadow:0 1px 2px rgba(15,23,42,.04);transition:transform .15s,border-color .15s,box-shadow .15s}
.blog-card:hover{transform:translateY(-2px);border-color:#c7d2fe;box-shadow:0 10px 22px -10px rgba(79,70,229,.28);text-decoration:none}
.bc-avatar{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:1rem;margin-bottom:5px}
.blog-card-title{font-weight:700}
.blog-card-url{color:var(--brand-600,#4f46e5);margin-top:4px}
.feat-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.feat-card{background:var(--bg2,#fff);border:1px solid #f0f1f5;border-radius:16px;padding:18px;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.feat-card b{display:block;margin:10px 0 6px}
.feat-card p{margin:0;line-height:1.9}
.feat-ic{width:40px;height:40px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center}
.cta-band{text-align:center;background:linear-gradient(135deg,#4f46e5,#7c3aed);border-radius:20px;color:#fff;padding:38px 20px;margin:22px 0 14px;box-shadow:0 18px 38px -18px rgba(79,70,229,.55)}
.cta-band h2{margin:0 0 6px;color:#fff;font-size:1.4rem}
.cta-band p{margin:0 0 16px;opacity:.85}
.cta-btn{background:#fff;color:#4338ca;border:0;font-weight:800}
.cta-btn:hover{background:#eef2ff;color:#4338ca}
[data-theme="dark"] .hero-badge,[data-theme="dark"] .pc-blog{background:rgba(99,102,241,.16);color:#a5b4fc}
[data-theme="dark"] .hero-chips code,[data-theme="dark"] .hero-stats > div,[data-theme="dark"] .post-card,[data-theme="dark"] .blog-card,[data-theme="dark"] .feat-card{border-color:rgba(255,255,255,.08)}
[data-theme="dark"] .hero-desc{color:#9ca3af}
@media (max-width:640px){.hero{padding:40px 8px 28px}.hero h1{font-size:1.9rem}.hero-stats > div{min-width:calc(50% - 10px)}}

/* ===== v10.1: unified card action bars ===== */
.card-actions{margin-top:16px;padding-top:14px;border-top:1px solid #f3f4f6}
.row-actions .inline-form{margin:0}
.row-actions .btn{margin:0}
[data-theme="dark"] .card-actions{border-top-color:rgba(255,255,255,.08)}

/* ===== v11: رفع سلکتور در حالت دارک + ادیتور حرفه‌ای ===== */
:root{color-scheme:light}
[data-theme="dark"]{color-scheme:dark}
[data-theme="dark"] .blog-switcher select,
[data-theme="dark"] .side-menu select{background:#0b1220;color:#e5e7eb;border-color:rgba(255,255,255,.12)}
[data-theme="dark"] .blog-switcher select option,
[data-theme="dark"] .side-menu select option{background:#0f172a;color:#e5e7eb}
[data-theme="dark"] .blog-switcher select:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.25)}
[data-theme="dark"] .panel-body select option{background:#0f172a;color:#e5e7eb}

/* SunEditor هماهنگ با طراحی پنل */
.sun-editor{border:1px solid #e5e7eb;border-radius:14px;overflow:hidden;font-family:inherit;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.sun-editor .se-toolbar{background:#f9fafb;border-bottom:1px solid #f3f4f6;outline:none}
.sun-editor .se-btn{border-radius:8px}
.sun-editor .se-btn:enabled:hover{background:#eef2ff;color:#4338ca}
.sun-editor .se-btn.active{background:#eef2ff;color:#4f46e5}
.sun-editor .se-resizing-bar{background:#f9fafb;border-top:1px solid #f3f4f6}
.sun-editor .se-wrapper .se-wrapper-inner{font-family:inherit}
.sun-editor-editable{font-family:inherit !important;background:#fff}
.sun-editor-editable hr.bs-more,.sun-editor-editable hr.__se__bs-more{border:none;border-top:2px dashed #6366f1;margin:18px 0;position:relative;overflow:visible}
.sun-editor-editable hr.bs-more,.sun-editor-editable hr.__se__bs-more::after{content:"ادامه مطلب";position:absolute;top:-11px;right:12px;background:#eef2ff;color:#4f46e5;font-size:11px;font-weight:800;padding:2px 10px;border-radius:999px}
.bs-more-label{font-size:11px;font-weight:800;white-space:nowrap;color:#4f46e5;padding:0 4px}
.bs-more-toolbar-btn{width:auto !important;min-width:72px}
label > .sun-editor{margin-top:6px}

/* حالت تیره ادیتور */
[data-theme="dark"] .sun-editor{border-color:rgba(255,255,255,.12);background:#0f172a}
[data-theme="dark"] .sun-editor .se-toolbar{background:#0b1220;border-bottom-color:rgba(255,255,255,.08)}
[data-theme="dark"] .sun-editor .se-btn{color:#cbd5e1}
[data-theme="dark"] .sun-editor .se-btn:enabled:hover{background:rgba(99,102,241,.18);color:#c7d2fe}
[data-theme="dark"] .sun-editor .se-btn.active{background:rgba(99,102,241,.22);color:#c7d2fe}
[data-theme="dark"] .sun-editor-editable{background:#0f172a;color:#e2e8f0}
[data-theme="dark"] .sun-editor .se-resizing-bar{background:#0b1220;border-top-color:rgba(255,255,255,.08)}
[data-theme="dark"] .sun-editor .se-dialog .se-dialog-inner .se-dialog-content{background:#0f172a;color:#e2e8f0}
[data-theme="dark"] .sun-editor-editable hr.bs-more,.sun-editor-editable hr.__se__bs-more::after{background:rgba(99,102,241,.2);color:#c7d2fe}

/* لینک «ادامه مطلب» در خروجی وبلاگ (اگر قالب استایل نداد)*/
.bs-more-link{margin-top:10px}
.bs-more-link a{font-weight:700;text-decoration:none}


/* ===== v12: nav submenus (WordPress-style) ===== */
.pill-nav .nav-sub{display:none;flex-direction:column;gap:1px;margin:-4px 6px 6px 0;padding:2px 26px 2px 6px;position:relative}
.pill-nav .nav-sub::before{content:"";position:absolute;top:4px;bottom:6px;right:18px;width:1px;background:#e5e7eb}
.pill-nav .nav-sub a{display:block;padding:5px 10px;border-radius:8px;font-size:12.5px;font-weight:500;color:#6b7280;text-decoration:none;position:relative;line-height:1.7}
.pill-nav .nav-sub a::before{content:"";position:absolute;right:-8px;top:50%;width:7px;height:1px;background:#d1d5db}
.pill-nav .nav-sub a:hover{background:#eef2ff;color:#4338ca}
.pill-nav .nav-sub a.active{background:#eef2ff;color:#4f46e5;font-weight:700}
.pill-nav a.active + .nav-sub{display:flex}
.pill-nav .nav-sub:has(a.active){display:flex}
[data-theme="dark"] .pill-nav .nav-sub::before{background:rgba(255,255,255,.12)}
[data-theme="dark"] .pill-nav .nav-sub a{color:#94a3b8}
[data-theme="dark"] .pill-nav .nav-sub a::before{background:rgba(255,255,255,.16)}
[data-theme="dark"] .pill-nav .nav-sub a:hover,[data-theme="dark"] .pill-nav .nav-sub a.active{background:rgba(99,102,241,.16);color:#a5b4fc}

/* ===== v13: کتابخانه رسانه ===== */
.bs-media-overlay{position:fixed;inset:0;z-index:1200;background:rgba(15,23,42,.55);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center;padding:20px}
.bs-media-modal{background:#fff;border-radius:16px;width:min(860px,100%);max-height:82vh;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 25px 60px rgba(0,0,0,.25)}
.bs-media-head{display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid #e5e7eb}
.bs-media-head b{font-size:15px}
.bs-media-close{margin-inline-start:auto;border:0;background:#f1f5f9;width:32px;height:32px;border-radius:10px;cursor:pointer;font-size:14px;color:inherit}
.bs-media-body{overflow:auto;padding:16px 18px}
.bs-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px}
.bs-media-cell{border:1px solid #e5e7eb;border-radius:12px;background:#fff;cursor:pointer;padding:0;overflow:hidden;display:flex;flex-direction:column;transition:.15s}
.bs-media-cell:hover{border-color:#6366f1;box-shadow:0 6px 16px rgba(79,70,229,.15);transform:translateY(-1px)}
.bs-media-cell img{width:100%;height:96px;object-fit:cover;display:block}
.bs-media-doc{display:flex;align-items:center;justify-content:center;height:96px;background:#f8fafc;color:#64748b;font-size:12px}
.bs-media-cap{display:block;font-size:11px;color:#475569;padding:6px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:ltr;text-align:left}
.bs-media-more-wrap{text-align:center;padding:14px 0 4px}
html.dark .bs-media-modal{background:#0f172a;color:#e5e7eb}
html.dark .bs-media-head{border-color:rgba(255,255,255,.12)}
html.dark .bs-media-close{background:rgba(255,255,255,.08)}
html.dark .bs-media-cell{background:#111c33;border-color:rgba(255,255,255,.12)}
html.dark .bs-media-doc{background:rgba(255,255,255,.05);color:#94a3b8}
html.dark .bs-media-cap{color:#94a3b8}
.list-filter{margin:0 0 14px}
