/* ============================================================
   پنل مخزن مستقل — هم‌خانواده با داشبورد کلاینت
   ============================================================ */
:root {
	--ink:    #16202c;
	--muted:  #6b7480;
	--line:   #e6e8ec;
	--bg:     #f5f6f8;
	--card:   #ffffff;
	--accent: #5b3df5;
	--accent-d: #4a2fe0;
	--accent-s: #ece8ff;
	--ok:     #14935a;
	--ok-s:   #e2f4ec;
	--warn:   #e8890c;
	--warn-s: #fdf1df;
	--off:    #8a929c;
	--off-s:  #eef0f3;
	--danger: #c0362c;
	--side:   #171a2b;
	--side-2: #20243a;
}

* { box-sizing: border-box; }
body {
	margin: 0; background: var(--bg); color: var(--ink);
	font-family: Tahoma, "Vazirmatn", system-ui, -apple-system, sans-serif;
	font-size: 14px; line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
code { background: var(--off-s); padding: 2px 7px; border-radius: 6px; direction: ltr; display: inline-block; }

/* ---------------------------------------------------- صفحه‌ی ورود */
.login-body {
	min-height: 100vh; display: grid; place-items: center; padding: 20px;
	background: radial-gradient(1200px 600px at 70% -10%, #efeaff, var(--bg));
}
.login-card {
	background: var(--card); width: 100%; max-width: 380px;
	border: 1px solid var(--line); border-radius: 18px; padding: 34px;
	box-shadow: 0 20px 50px rgba(16,32,44,.10);
}
.login-brand { font-size: 22px; font-weight: 800; }
.login-sub { color: var(--muted); margin: 4px 0 22px; }
.login-card label { display: block; font-weight: 700; margin: 14px 0 6px; }
.login-card input {
	width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px;
	padding: 0 12px; font-size: 14px; font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-s); }
.login-error { background: #fde8e6; color: var(--danger); padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; }
.brand-mark { color: var(--accent); }

/* ---------------------------------------------------- چیدمان اصلی */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
	background: var(--side); color: #cfd3e6; padding: 22px 16px;
	display: flex; flex-direction: column; gap: 8px;
}
.brand {
	display: flex; align-items: center; gap: 10px;
	font-size: 19px; font-weight: 800; color: #fff; padding: 6px 10px 18px;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
	display: flex; align-items: center; gap: 10px;
	color: #c2c7de; padding: 11px 14px; border-radius: 10px; font-weight: 600;
	transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: var(--side-2); color: #fff; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar .logout {
	margin-top: auto; color: #9aa0bd; padding: 11px 14px; border-radius: 10px;
}
.sidebar .logout:hover { background: var(--side-2); color: #fff; }

.content { padding: 30px 36px; max-width: 1320px; margin-inline: auto; width: 100%; }

/* ---------------------------------------------------- سرصفحه */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.page-head .muted { margin: 4px 0 0; }

.flash { background: var(--ok-s); color: var(--ok); padding: 11px 16px; border-radius: 11px; margin-bottom: 18px; font-weight: 600; }

/* ---------------------------------------------------- دکمه‌ها */
.btn {
	display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
	background: var(--card); border: 1px solid var(--line); color: var(--ink);
	height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 700;
	font-family: inherit; font-size: 14px; transition: all .15s;
}
.btn:hover { border-color: #c9cdd4; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: #f0c9c5; background: #fdf3f2; }
.btn-danger:hover { background: #fbe7e5; }
.btn-block { width: 100%; justify-content: center; margin-top: 22px; height: 44px; }

/* ---------------------------------------------------- جدول */
.table-card, .form-card {
	background: var(--card); border: 1px solid var(--line); border-radius: 16px;
	overflow: hidden; margin-bottom: 20px;
}
.form-card { padding: 22px 24px; }
.card-title { margin: 0 0 14px; font-size: 16px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--line); }
.table th { background: #fafbfc; font-size: 12px; color: var(--muted); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.cell-name { display: flex; align-items: center; gap: 10px; }
.mini-icon { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.mini-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #8b6cff); color: #fff; font-weight: 800; }
.cell-actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.inline { display: inline; }

.tag { font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; }
.tag-plugin { background: var(--accent-s); color: var(--accent); }
.tag-theme  { background: var(--warn-s); color: var(--warn); }
.tag-danger { background: #fdecec; color: #d63638; }
.ok { color: var(--ok); font-weight: 800; }
.off { color: var(--off); }
.ok-text { color: var(--ok); display: block; margin-top: 6px; }

.pill { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.pill-ok { background: var(--ok-s); color: var(--ok); }
.pill-warn { background: var(--warn-s); color: var(--warn); }
.pill-off { background: var(--off-s); color: var(--off); }

.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 16px; padding: 44px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------- فرم‌ها */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=number],
.field select, .field textarea {
	width: 100%; border: 1px solid var(--line); border-radius: 10px;
	padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
	outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-s);
}
.field input[type=file] { padding: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.icon-preview { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; margin-top: 8px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form.compact { gap: 6px; flex-wrap: nowrap; }
.inline-form input[type=text], .inline-form input[type=email] {
	height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-family: inherit; flex: 1; min-width: 160px;
}
.inline-form input[type=number] { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-family: inherit; }
.inline-form.compact input[type=number] { height: 32px; }

@media (max-width: 820px) {
	.layout { grid-template-columns: 1fr; }
	.sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
	.sidebar .logout { margin-top: 0; }
	.content { padding: 20px; }
	.grid-2 { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------- مالی: آمار */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
	background: var(--card); border: 1px solid var(--line); border-radius: 14px;
	padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 24px; font-weight: 800; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------------------------------------------------- تنظیمات */
.sep { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 14px; }
.check input { width: 18px; height: 18px; }

.small { font-size: 12px; }

/* ==================================================== صفحه‌ی پرداخت */
.pay-body {
	min-height: 100vh; padding: 30px 16px;
	background: radial-gradient(1200px 600px at 70% -10%, #efeaff, var(--bg));
}
.pay-wrap { max-width: 460px; margin: 0 auto; }
.pay-brand { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 18px; }
.pay-card {
	background: var(--card); border: 1px solid var(--line); border-radius: 20px;
	padding: 28px; box-shadow: 0 20px 50px rgba(16,32,44,.10);
}
.pay-card h1 { font-size: 21px; margin: 0 0 4px; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.plan-price { font-size: 26px; font-weight: 800; color: var(--accent); white-space: nowrap; text-align: left; }
.plan-price small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.plan-desc {
	background: var(--accent-s); color: #3a2bb0; border-radius: 12px;
	padding: 14px 16px; font-size: 13px; line-height: 1.9; margin: 18px 0;
}
.btn-lg { height: 48px; font-size: 15px; }

.pay-divider { text-align: center; margin: 22px 0 16px; position: relative; color: var(--muted); font-size: 13px; }
.pay-divider::before { content: ""; position: absolute; inset-block-start: 50%; inset-inline: 0; height: 1px; background: var(--line); }
.pay-divider span { background: var(--card); padding: 0 12px; position: relative; }

.card-info {
	background: #fafbfc; border: 1px solid var(--line); border-radius: 12px;
	padding: 14px 16px; margin-bottom: 16px;
}
.card-line { display: flex; justify-content: space-between; padding: 5px 0; }
.card-line strong { font-size: 15px; }

.pay-form label { display: block; font-weight: 700; margin: 12px 0 6px; }
.pay-form input {
	width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px;
	padding: 0 12px; font-family: inherit; font-size: 14px;
}
.pay-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-s); }
.pay-form .btn-block { margin-top: 16px; }

/* نتیجه‌ی پرداخت */
.result-card { text-align: center; }
.result-icon {
	width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
	display: grid; place-items: center; font-size: 32px; font-weight: 800; color: #fff;
}
.result-ok .result-icon { background: var(--ok); }
.result-fail .result-icon { background: var(--danger); }
.result-card .btn-block { margin-top: 18px; }

@media (max-width: 600px) {
	.stat-row { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------- نشان پین و درخواست */
.pin-badge { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-s); padding: 2px 8px; border-radius: 999px; margin-inline-start: 6px; }
.row-new td { background: #fffdf5; }
.cell-msg { max-width: 320px; white-space: normal; line-height: 1.7; }

/* ==================================================== صفحه‌ی پرداخت (نو) */
.pay-shell {
	min-height: 100vh; display: grid; grid-template-columns: 380px 1fr;
	max-width: 980px; margin: 0 auto; background: var(--card);
}
@media (min-width: 700px) {
	.pay-shell { margin: 40px auto; border-radius: 22px; overflow: hidden;
		box-shadow: 0 30px 70px rgba(16,32,44,.16); min-height: auto; }
}
.pay-aside {
	background: linear-gradient(160deg, #3a23b8, #5b3df5 55%, #8b6cff);
	color: #fff; padding: 36px 30px; display: flex; flex-direction: column;
}
.pay-brand.light { color: #fff; opacity: .95; }
.pay-plan-name { margin-top: 26px; font-size: 15px; opacity: .85; }
.pay-plan-amount { font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.pay-plan-amount span { font-size: 16px; font-weight: 600; opacity: .85; }
.pay-plan-cycle { opacity: .8; font-size: 13px; margin-top: 4px; }
.pay-features { list-style: none; padding: 0; margin: 26px 0; display: flex; flex-direction: column; gap: 12px; }
.pay-features li { position: relative; padding-inline-start: 26px; font-size: 13px; opacity: .95; line-height: 1.6; }
.pay-features li::before {
	content: "✓"; position: absolute; inset-inline-start: 0; top: 0;
	width: 18px; height: 18px; border-radius: 50%;
	background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 11px;
}
.pay-note-box { background: rgba(255,255,255,.12); border-radius: 12px; padding: 14px 16px; font-size: 12px; line-height: 1.9; }
.pay-account { margin-top: auto; padding-top: 22px; font-size: 13px; opacity: .9; }
.pay-account .muted { color: rgba(255,255,255,.7); }

.pay-main { padding: 40px 38px; }
.pay-title { font-size: 22px; font-weight: 800; margin: 0; }
.pay-subtitle { margin: 4px 0 24px; }

.pay-method-online {
	display: flex; align-items: center; gap: 14px; text-decoration: none;
	border: 1.5px solid var(--accent); background: var(--accent-s); color: var(--ink);
	border-radius: 14px; padding: 16px 18px; transition: all .15s;
}
.pay-method-online:hover { background: #e3dcff; }
.pmo-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 18px; }
.pmo-text { display: flex; flex-direction: column; }
.pmo-text strong { font-size: 15px; }
.pmo-text small { color: var(--muted); }
.pmo-arrow { margin-inline-start: auto; font-size: 26px; color: var(--accent); }

.card-box { margin: 8px 0 18px; }
.card-visual {
	background: linear-gradient(135deg, #1f2430, #3a4150); color: #fff;
	border-radius: 16px; padding: 20px; aspect-ratio: 1.7; max-width: 320px;
	display: flex; flex-direction: column; justify-content: space-between;
}
.card-chip { width: 42px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #e9c46a, #d4a017); }
.card-number { font-size: 19px; letter-spacing: 2px; font-weight: 700; }
.card-foot { display: flex; justify-content: space-between; font-size: 12px; opacity: .85; }
.card-amount-hint { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.8; }
.card-amount-hint strong { color: var(--ink); }

@media (max-width: 699px) {
	.pay-shell { grid-template-columns: 1fr; }
	.pay-main { padding: 28px 22px; }
	.card-visual { max-width: none; }
}

/* تصویر بنر تبلیغ در جدول */
.ad-thumb { width: 120px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* چیپ لینک در جدول نوتیس‌ها */
.link-chip { display: inline-block; background: var(--accent-s); color: var(--accent); font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin: 2px; }

/* نسخه‌ی دیتابیس در نوار کناری */
.side-version { color: #6b7290; font-size: 11px; padding: 8px 14px 0; opacity: .7; }

/* تک‌خطی نگه‌داشتن کلید لایسنس و دکمه‌های ردیف */
.table code { white-space: nowrap; }
.table .cell-actions { white-space: nowrap; }

/* نوار جستجوی ادمین */
.search-bar { display: flex; gap: 8px; align-items: center; margin: 0 0 18px; flex-wrap: wrap; }
.search-bar input[type=search] {
	height: 40px; min-width: 320px; max-width: 100%; border: 1px solid var(--line);
	border-radius: 10px; padding: 0 14px; font-family: inherit; font-size: 14px; background: #fff;
}
.search-bar input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-s); }

/* اکشن‌های لایسنس در دو ردیف منظم و کوچک */
.cell-actions .lic-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.lic-actions .lic-row { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.lic-actions .lic-row .btn-sm { height: 30px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.lic-actions .lic-row input { height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-family: inherit; font-size: 12px; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #0f6b40; border-color: #0f6b40; }

/* نشان دسته‌بندی رایگان/پریمیوم */
.tag-plan-free { background: var(--ok-s); color: #0f6b40; }
.tag-plan-premium { background: #fff4d6; color: #9a6a00; }

/* جعبه‌ی دریافت سریع از وردپرس */
.wporg-box {
	background: var(--accent-s); border: 1px solid #d9d0ff; border-radius: 14px;
	padding: 16px 18px; margin-bottom: 22px;
}
.wporg-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.wporg-head strong { color: var(--accent); font-size: 15px; }
.wporg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wporg-row select { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; font-family: inherit; }
.wporg-row input { flex: 1; min-width: 220px; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-family: inherit; font-size: 14px; background: #fff; }
.wporg-row input:focus, .wporg-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,61,245,.12); }
.wporg-msg { margin-top: 10px; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 9px; }
.wporg-msg.is-ok { background: var(--ok-s); color: #0f6b40; }
.wporg-msg.is-err { background: #fdecec; color: #b3261e; }

/* هشدارهای صفحه‌ی افزونه‌ی اتصال + سلول پیام */
.alert { padding: 12px 16px; border-radius: 11px; margin-bottom: 18px; font-weight: 600; font-size: 14px; }
.alert-ok { background: var(--ok-s); color: var(--ok); }
.alert-warn { background: #fff4d6; color: #9a6a00; }
.cell-wrap { max-width: 420px; white-space: normal; }
