/* =========================================================
   Persian Support Ticket v2 - Fancy Front & Admin Styles
   RTL / Responsive (Mobile + Desktop)
   ========================================================= */

.pst-wrap, .pst-wrap * {
	box-sizing: border-box;
}

.pst-wrap {
	direction: rtl;
	text-align: right;
	font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
	max-width: 960px;
	margin: 28px auto;
	padding: 0 14px;
	color: #1e293b;
}

/* ---------- Generic surfaces ---------- */
.pst-box, .pst-glass-box {
	background: #ffffff;
	border: 1px solid #eef0f4;
	border-radius: 16px;
	padding: 26px;
	margin-bottom: 22px;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.pst-box-title {
	margin: 0 0 16px 0;
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
}

.pst-title {
	margin: 0 0 16px 0;
	font-size: 22px;
	font-weight: 800;
	color: #0f172a;
}

.pst-notice-box {
	max-width: 460px;
	margin: 60px auto;
	text-align: center;
}

.pst-notice-icon {
	font-size: 34px;
	margin-bottom: 10px;
}

.pst-notice-box .pst-btn {
	margin-top: 14px;
}

/* ---------- Auth shell (login/register combined) ---------- */
.pst-auth-wrap {
	max-width: 980px;
}

.pst-auth-shell {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	background: #fff;
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
	border: 1px solid #eef0f4;
}

.pst-auth-visual {
	background: linear-gradient(155deg, #4338ca 0%, #2563eb 45%, #0ea5e9 100%);
	color: #fff;
	padding: 44px 36px;
	display: flex;
	align-items: center;
}

.pst-auth-visual-inner {
	position: relative;
	z-index: 1;
}

.pst-auth-logo {
	font-size: 40px;
	margin-bottom: 14px;
}

.pst-auth-visual h3 {
	font-size: 24px;
	margin: 0 0 12px 0;
	font-weight: 800;
}

.pst-auth-visual p {
	font-size: 13.5px;
	line-height: 1.9;
	opacity: 0.92;
	margin: 0 0 18px 0;
}

.pst-auth-points {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 13px;
	line-height: 2.3;
	opacity: 0.95;
}

.pst-auth-form-side {
	padding: 40px 36px;
}

/* ---------- Tabs ---------- */
.pst-tabs {
	display: flex;
	gap: 6px;
	background: #f1f5f9;
	padding: 5px;
	border-radius: 12px;
	margin-bottom: 24px;
}

.pst-tab {
	flex: 1;
	text-align: center;
	padding: 10px 0;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 700;
	color: #64748b;
	text-decoration: none;
	transition: all .15s;
}

.pst-tab.is-active {
	background: #fff;
	color: #2563eb;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* ---------- Forms ---------- */
.pst-form .pst-field {
	margin-bottom: 16px;
}

.pst-field-row {
	display: flex;
	gap: 14px;
}

.pst-field-row .pst-field {
	flex: 1;
}

.pst-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #475569;
}

.pst-field-inline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 12.5px;
}

.pst-field-inline label {
	font-weight: 400;
	display: flex;
	align-items: center;
	gap: 6px;
}

.pst-field input[type="text"],
.pst-field input[type="email"],
.pst-field input[type="password"],
.pst-field input[type="number"],
.pst-field input[type="file"],
.pst-field select,
.pst-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid #e2e8f0;
	border-radius: 11px;
	font-size: 14px;
	font-family: inherit;
	background: #f8fafc;
	transition: border-color .15s, box-shadow .15s, background .15s;
}

.pst-field input:focus,
.pst-field select:focus,
.pst-field textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 4px rgba(37,99,235,0.10);
	background: #fff;
}

.pst-field textarea {
	resize: vertical;
	min-height: 90px;
}

/* ---------- Buttons ---------- */
.pst-btn {
	display: inline-block;
	padding: 12px 24px;
	border-radius: 11px;
	font-size: 14px;
	font-weight: 700;
	border: none;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: transform .1s, opacity .15s, background .15s, box-shadow .15s;
	font-family: inherit;
}

.pst-btn:active {
	transform: scale(0.97);
}

.pst-btn-primary {
	background: linear-gradient(135deg, #2563eb, #4f46e5);
	color: #fff;
	box-shadow: 0 6px 16px rgba(37,99,235,0.28);
}

.pst-btn-primary:hover {
	filter: brightness(1.07);
	color: #fff;
}

.pst-btn-outline {
	background: transparent;
	color: #2563eb;
	border: 1.5px solid #2563eb;
}

.pst-btn-outline:hover {
	background: #eff6ff;
}

.pst-btn-light {
	color: #fff;
	border-color: rgba(255,255,255,0.6);
}

.pst-btn-light:hover {
	background: rgba(255,255,255,0.15);
	color: #fff;
}

.pst-btn-block {
	display: block;
	width: 100%;
}

.pst-btn-sm {
	padding: 6px 14px;
	font-size: 12px;
	border-radius: 8px;
}

.pst-btn:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* ---------- Alerts ---------- */
.pst-alert {
	padding: 12px 16px;
	border-radius: 11px;
	font-size: 13px;
	margin-bottom: 16px;
}

.pst-alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pst-alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pst-alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.pst-alt-link { text-align: center; font-size: 13px; color: #6b7280; margin-top: 18px; }
.pst-alt-link a, .pst-back-link { color: #2563eb; text-decoration: none; font-weight: 700; }
.pst-back-link { display: inline-block; margin-bottom: 14px; font-size: 13px; }

/* ---------- Tables ---------- */
.pst-table { width: 100%; border-collapse: collapse; }
.pst-table th, .pst-table td { padding: 12px 10px; text-align: right; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.pst-table th { color: #64748b; font-weight: 600; background: #f8fafc; }
.pst-account-table th { width: 190px; background: transparent; color: #64748b; }
.pst-table-scroll { overflow-x: auto; }
.pst-empty { text-align: center; color: #9ca3af; padding: 30px 0; }

/* ---------- Badges ---------- */
.pst-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pst-badge-status-open { background:#dbeafe; color:#1d4ed8; }
.pst-badge-status-in_progress { background:#fef3c7; color:#b45309; }
.pst-badge-status-answered { background:#dcfce7; color:#15803d; }
.pst-badge-status-closed { background:#f1f5f9; color:#475569; }
.pst-badge-priority-low { background:#f1f5f9; color:#475569; }
.pst-badge-priority-normal { background:#e0e7ff; color:#4338ca; }
.pst-badge-priority-high { background:#ffedd5; color:#c2410c; }
.pst-badge-priority-urgent { background:#fee2e2; color:#b91c1c; }

/* ---------- Ticket header / list ---------- */
.pst-ticket-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pst-ticket-header .pst-title { margin: 0; }

/* ---------- Single ticket / thread ---------- */
.pst-ticket-meta-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.pst-ticket-badges { display: flex; gap: 8px; }

.pst-admin-controls {
	display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
	background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px;
	padding: 14px 18px; margin-bottom: 20px; font-size: 13px;
}
.pst-admin-controls select { margin-right: 6px; padding: 6px 8px; border-radius: 8px; border: 1px solid #d1d5db; }
.pst-owner-info { color: #64748b; margin-right: auto; }

.pst-thread { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.pst-message { border: 1px solid #eef0f4; border-radius: 14px; padding: 16px 18px; background: #f8fafc; }
.pst-message-admin { background: #eff6ff; border-color: #bfdbfe; }
.pst-message-first { background: #fff; }
.pst-message-head { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 8px; color: #64748b; }
.pst-tag-support { background: #2563eb; color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 999px; }
.pst-message-date { margin-right: auto; color: #9ca3af; }
.pst-message-body { font-size: 14px; line-height: 1.9; }
.pst-message-body p { margin: 0 0 8px 0; }
.pst-attachment-link { display: inline-block; margin-top: 8px; font-size: 12px; color: #2563eb; text-decoration: none; }
.pst-reply-box { border-top: 1px solid #f1f5f9; padding-top: 18px; margin-top: 10px; }
.pst-reply-box h3 { margin-top: 0; font-size: 16px; }
.pst-price { font-size: 16px; }

/* ---------- Dashboard (Hero + Avatar) ---------- */
.pst-dashboard-wrap { max-width: 980px; }

.pst-hero-card {
	position: relative;
	border-radius: 22px;
	overflow: hidden;
	padding: 34px 30px;
	margin-bottom: 22px;
	color: #fff;
}

.pst-hero-bg {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #4338ca 0%, #2563eb 55%, #0ea5e9 100%);
	z-index: 0;
}

.pst-profile-row {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.pst-avatar-wrap { position: relative; flex-shrink: 0; }

.pst-avatar {
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	border: 3px solid rgba(255,255,255,0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	font-weight: 800;
	background-size: cover;
	background-position: center;
}

.pst-avatar-edit {
	position: absolute;
	bottom: -2px;
	left: -2px;
	background: #fff;
	color: #2563eb;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.pst-profile-info { flex: 1; min-width: 180px; }
.pst-profile-info h2 { margin: 0 0 4px 0; font-size: 20px; font-weight: 800; }
.pst-profile-sub { margin: 0 0 10px 0; font-size: 13px; opacity: 0.9; }

.pst-logout-form { }

.pst-hero-actions {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	margin-right: auto;
}

.pst-notif-bell {
	position: relative;
	padding: 10px 14px;
	font-size: 16px;
}

.pst-notif-dot {
	position: absolute;
	top: -6px;
	left: -6px;
	background: #ef4444;
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	min-width: 18px;
	height: 18px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

.pst-unread-banner {
	margin: -6px 0 22px 0;
}

.pst-unread-banner a {
	color: #1d4ed8;
	font-weight: 700;
	margin-right: 8px;
}

/* ---------- Stat grid ---------- */
.pst-stat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 22px;
}

.pst-stat-card {
	background: #fff;
	border: 1px solid #eef0f4;
	border-radius: 16px;
	padding: 20px;
	text-align: center;
	box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.pst-stat-icon {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 19px;
	margin: 0 auto 10px auto;
}

.pst-stat-icon-blue { background: #dbeafe; }
.pst-stat-icon-green { background: #dcfce7; }
.pst-stat-icon-orange { background: #fef3c7; }
.pst-stat-icon-gray { background: #f1f5f9; }

.pst-stat-value { font-size: 24px; font-weight: 800; color: #0f172a; }
.pst-stat-label { font-size: 12.5px; color: #64748b; margin-top: 2px; }

/* ---------- Info grid ---------- */
.pst-info-grid {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 20px;
}

.pst-quick-links { display: flex; flex-direction: column; gap: 10px; }
.pst-quick-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 12px;
	background: #f8fafc;
	border: 1px solid #eef0f4;
	text-decoration: none;
	color: #1e293b;
	font-size: 13.5px;
	font-weight: 600;
	transition: background .15s, transform .1s;
}

.pst-quick-link:hover { background: #eff6ff; transform: translateX(-2px); color: #1e293b; }
.pst-quick-icon { font-size: 18px; }
.pst-quick-link-disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Modal ---------- */
.pst-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	direction: rtl;
	font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
	padding: 16px;
}

.pst-modal-box {
	background: #fff;
	border-radius: 18px;
	padding: 34px 30px;
	max-width: 380px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0,0,0,0.25);
	animation: pstModalPop .18s ease-out;
}

@keyframes pstModalPop {
	from { transform: scale(0.92); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

.pst-modal-icon { font-size: 40px; margin-bottom: 12px; }
.pst-modal-title { margin: 0 0 8px 0; font-size: 17px; font-weight: 800; color: #0f172a; }
.pst-modal-message { margin: 0 0 20px 0; font-size: 13.5px; color: #64748b; line-height: 1.8; }
.pst-modal-success .pst-modal-title { color: #15803d; }
.pst-modal-error .pst-modal-title { color: #b91c1c; }

/* ---------- Domain badge ---------- */
.pst-badge-domain { background:#ecfeff; color:#0e7490; }

/* ---------- Mini avatar (thread messages) ---------- */
.pst-mini-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #e0e7ff;
	color: #4338ca;
	font-weight: 800;
	flex-shrink: 0;
}

/* ---------- Hero datetime + site name ---------- */
.pst-hero-datetime {
	position: relative;
	z-index: 1;
	font-size: 12.5px;
	opacity: 0.9;
	margin-bottom: 14px;
}

.pst-profile-site {
	margin: 0 0 10px 0;
	font-size: 12.5px;
	opacity: 0.9;
}

/* ---------- Payment page: month selection ---------- */
.pst-month-presets {
	display: flex;
	gap: 8px;
	margin: -6px 0 18px 0;
	flex-wrap: wrap;
}

.pst-total-box {
	background: #f8fafc;
	border: 1px solid #eef0f4;
	border-radius: 12px;
	padding: 16px;
	text-align: center;
	font-size: 15px;
	margin-bottom: 18px;
}

.pst-total-box strong {
	color: #2563eb;
	font-size: 20px;
}

.pst-total-sub {
	display: block;
	font-size: 11.5px;
	color: #94a3b8;
	margin-top: 4px;
}

/* ---------- Card-to-card modal ---------- */
.pst-card-modal-box { max-width: 420px; }

.pst-card-info {
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	padding: 14px 16px;
	margin: 6px 0 16px 0;
	text-align: right;
}

.pst-card-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 13px;
	border-bottom: 1px dashed #e2e8f0;
}

.pst-card-row:last-child { border-bottom: none; }
.pst-card-row span { color: #64748b; }
.pst-card-row strong { color: #0f172a; direction: ltr; }

/* ---------- Admin panel (wp-admin) ---------- */
.pst-admin-wrap { direction: rtl; text-align: right; }
.pst-admin-filters { margin: 14px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pst-admin-hero {
	background: linear-gradient(135deg, #4338ca, #2563eb);
	color: #fff;
	padding: 22px 26px;
	border-radius: 14px;
	margin: 16px 0 22px 0;
}
.pst-admin-hero h2 { margin: 0 0 4px 0; }
.pst-admin-hero p { margin: 0; opacity: 0.9; font-size: 13px; }

/* =========================================================
   Responsive - Mobile
   ========================================================= */
@media (max-width: 900px) {
	.pst-auth-shell { grid-template-columns: 1fr; }
	.pst-auth-visual { display: none; }
	.pst-info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
	.pst-wrap { margin: 14px auto; }
	.pst-box, .pst-glass-box { padding: 18px; border-radius: 12px; }
	.pst-title { font-size: 18px; }
	.pst-field-row { flex-direction: column; gap: 0; }
	.pst-ticket-header { flex-direction: column; align-items: flex-start; }
	.pst-ticket-header .pst-btn { width: 100%; }
	.pst-admin-controls { flex-direction: column; align-items: flex-start; }
	.pst-owner-info { margin-right: 0; }
	.pst-table th, .pst-table td { font-size: 12px; padding: 8px 6px; }
	.pst-btn-sm { padding: 5px 10px; }
	.pst-auth-form-side { padding: 26px 20px; }
	.pst-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.pst-stat-card { padding: 14px; }
	.pst-profile-row { flex-direction: column; text-align: center; }
	.pst-logout-form { margin-right: 0; }
	.pst-hero-card { padding: 26px 20px; }
	.pst-modal-box { padding: 26px 20px; }
}
