/**
 * WP Ticketing Pro — استایل پنل کاربری
 * راست‌به‌چپ، مستقل از قالب سایت
 */

.wtp-panel {
	--wtp-primary: #4f6ef7;
	--wtp-primary-dark: color-mix(in srgb, var(--wtp-primary) 78%, #1e1b4b);
	--wtp-primary-soft: color-mix(in srgb, var(--wtp-primary) 10%, #ffffff);
	--wtp-surface: #ffffff;
	--wtp-text: #0f172a;
	--wtp-text-soft: #64748b;
	--wtp-border: #e2e8f0;
	--wtp-radius: 16px;
	--wtp-radius-sm: 12px;
	--wtp-shadow: 0 8px 24px rgba(15, 23, 42, .06);
	--wtp-font: 'Vazirmatn', Vazir, Tahoma, 'Segoe UI', Arial, sans-serif;

	direction: rtl;
	text-align: right;
	font-family: var(--wtp-font);
	color: var(--wtp-text);
	font-size: 14.5px;
	line-height: 1.9;
	max-width: 1020px;
	margin: 0 auto;
	-webkit-font-smoothing: antialiased;
}

.wtp-panel *,
.wtp-panel *::before,
.wtp-panel *::after {
	box-sizing: border-box;
}

.wtp-panel h2,
.wtp-panel h3 {
	color: var(--wtp-text);
	margin: 0;
	line-height: 1.6;
}

/* ---------- هدر ---------- */
.wtp-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-dark));
	border-radius: var(--wtp-radius);
	padding: 26px 30px;
	color: #fff;
	box-shadow: var(--wtp-shadow);
	margin-bottom: 18px;
}

.wtp-header h2 {
	color: #fff;
	font-size: 21px;
	font-weight: 800;
}

.wtp-header p {
	margin: 6px 0 0;
	font-size: 13.5px;
	opacity: .92;
	max-width: 560px;
}

.wtp-user-chip {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(255, 255, 255, .16);
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 999px;
	padding: 6px 18px 6px 8px;
	backdrop-filter: blur(4px);
}

.wtp-user-chip img {
	border-radius: 50%;
	display: block;
}

.wtp-user-chip-info {
	display: flex;
	flex-direction: column;
	line-height: 1.5;
}

.wtp-user-chip-info strong {
	font-size: 14px;
	color: #fff;
}

.wtp-user-chip-info span {
	font-size: 11.5px;
	opacity: .85;
}

/* ---------- کارت آمار ---------- */
.wtp-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 18px;
}

.wtp-stat {
	background: var(--wtp-surface);
	border: 1px solid var(--wtp-border);
	border-radius: var(--wtp-radius-sm);
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	box-shadow: var(--wtp-shadow);
	position: relative;
	overflow: hidden;
}

.wtp-stat::after {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: var(--wtp-primary);
	opacity: .85;
}

.wtp-stat.wtp-stat-open::after { background: #f59e0b; }
.wtp-stat.wtp-stat-answered::after { background: #10b981; }
.wtp-stat.wtp-stat-closed::after { background: #64748b; }

.wtp-stat-num {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.4;
}

.wtp-stat-label {
	font-size: 12.5px;
	color: var(--wtp-text-soft);
}

/* ---------- تب‌ها ---------- */
.wtp-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.wtp-tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid var(--wtp-border);
	background: var(--wtp-surface);
	color: var(--wtp-text-soft);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	padding: 9px 20px;
	border-radius: 999px;
	cursor: pointer;
	transition: all .2s ease;
}

.wtp-tab:hover {
	color: var(--wtp-primary);
	border-color: var(--wtp-primary-soft);
	background: var(--wtp-primary-soft);
}

.wtp-tab.is-active {
	background: var(--wtp-primary);
	border-color: var(--wtp-primary);
	color: #fff;
	box-shadow: 0 4px 14px color-mix(in srgb, var(--wtp-primary) 35%, transparent);
}

/* ---------- کارت عمومی ---------- */
.wtp-card {
	background: var(--wtp-surface);
	border: 1px solid var(--wtp-border);
	border-radius: var(--wtp-radius);
	box-shadow: var(--wtp-shadow);
	padding: 20px 22px;
	margin-bottom: 16px;
}

/* ---------- نوار ابزار لیست ---------- */
.wtp-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding: 14px 18px;
}

.wtp-chips {
	display: flex;
	gap: 7px;
	flex-wrap: wrap;
}

.wtp-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--wtp-border);
	background: transparent;
	color: var(--wtp-text-soft);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	padding: 6px 13px;
	border-radius: 999px;
	cursor: pointer;
	transition: all .18s ease;
}

.wtp-chip i {
	font-style: normal;
	background: #f1f5f9;
	border-radius: 999px;
	padding: 0 8px;
	font-size: 11.5px;
	line-height: 1.9;
}

.wtp-chip:hover {
	border-color: var(--wtp-primary);
	color: var(--wtp-primary);
}

.wtp-chip.is-active {
	background: var(--wtp-primary);
	border-color: var(--wtp-primary);
	color: #fff;
}

.wtp-chip.is-active i {
	background: rgba(255, 255, 255, .22);
	color: #fff;
}

.wtp-filters {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

/* ---------- فرم‌ها ---------- */
.wtp-input,
.wtp-form input[type="text"],
.wtp-form input[type="search"],
.wtp-form input[type="email"],
.wtp-form input[type="number"],
.wtp-form select,
.wtp-form textarea {
	width: 100%;
	border: 1.5px solid var(--wtp-border);
	border-radius: var(--wtp-radius-sm);
	background: #fff;
	font-family: inherit;
	font-size: 13.5px;
	color: var(--wtp-text);
	padding: 10px 14px;
	outline: none;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.wtp-filters .wtp-input {
	width: auto;
	min-width: 170px;
}

.wtp-form textarea { resize: vertical; min-height: 90px; }

.wtp-input:focus,
.wtp-form input:focus,
.wtp-form select:focus,
.wtp-form textarea:focus {
	border-color: var(--wtp-primary);
	box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--wtp-primary) 14%, transparent);
}

.wtp-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px 18px;
}

.wtp-field { display: flex; flex-direction: column; gap: 6px; }
.wtp-field.wtp-col-2 { grid-column: span 2; }

.wtp-field label {
	font-size: 13px;
	font-weight: 700;
	color: var(--wtp-text);
}

.wtp-field label i {
	color: #ef4444;
	font-style: normal;
}

.wtp-label-hint {
	font-weight: 400;
	font-size: 11.5px;
	color: var(--wtp-text-soft);
}

.wtp-hint { font-size: 11.5px; color: var(--wtp-text-soft); }
.wtp-hint-error { color: #ef4444; font-weight: 600; }

.wtp-form-head { margin-bottom: 16px; }
.wtp-form-head h3 { font-size: 17px; font-weight: 800; }
.wtp-form-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--wtp-text-soft); }

.wtp-form-actions {
	display: flex;
	gap: 10px;
	margin-top: 18px;
	flex-wrap: wrap;
}

/* ---------- دکمه‌ها ---------- */
.wtp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	border: 1.5px solid transparent;
	border-radius: var(--wtp-radius-sm);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	padding: 10px 22px;
	cursor: pointer;
	transition: all .2s ease;
	text-decoration: none !important;
	line-height: 1.7;
}

.wtp-btn-primary {
	background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-dark));
	color: #fff !important;
	box-shadow: 0 6px 16px color-mix(in srgb, var(--wtp-primary) 30%, transparent);
}

.wtp-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 9px 22px color-mix(in srgb, var(--wtp-primary) 40%, transparent);
}

.wtp-btn-ghost {
	background: transparent;
	border-color: var(--wtp-border);
	color: var(--wtp-text) !important;
}

.wtp-btn-ghost:hover {
	border-color: var(--wtp-primary);
	color: var(--wtp-primary) !important;
	background: var(--wtp-primary-soft);
}

.wtp-btn-danger {
	background: #ef4444;
	color: #fff !important;
}

.wtp-btn-danger:hover { background: #dc2626; }

.wtp-btn-sm { padding: 6px 14px; font-size: 12.5px; }

.wtp-btn.is-loading {
	opacity: .65;
	pointer-events: none;
	position: relative;
}

/* ---------- منطقه پیوست ---------- */
.wtp-drop {
	border: 1.5px dashed var(--wtp-border);
	border-radius: var(--wtp-radius-sm);
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	background: #f8fafc;
	transition: border-color .18s ease;
}

.wtp-drop:hover,
.wtp-drop.is-dragover { border-color: var(--wtp-primary); }

.wtp-drop-inline {
	background: transparent;
	padding: 10px 0;
	border: none;
	border-top: 1px dashed var(--wtp-border);
	border-radius: 0;
	margin-top: 4px;
}

.wtp-file-chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	width: 100%;
}

.wtp-file-chips:empty { display: none; }

.wtp-file-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--wtp-primary-soft);
	border: 1px solid color-mix(in srgb, var(--wtp-primary) 25%, transparent);
	color: var(--wtp-text);
	border-radius: 8px;
	padding: 5px 10px;
	font-size: 12px;
}

.wtp-file-chip button {
	border: none;
	background: transparent;
	cursor: pointer;
	color: #ef4444;
	font-size: 14px;
	line-height: 1;
	padding: 0;
	font-family: inherit;
}

/* ---------- لیست تیکت‌ها ---------- */
.wtp-trow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 16px 20px;
	cursor: pointer;
	transition: all .18s ease;
}

.wtp-trow:hover {
	border-color: var(--wtp-primary);
	transform: translateY(-1px);
	box-shadow: 0 10px 26px color-mix(in srgb, var(--wtp-primary) 10%, rgba(15, 23, 42, .07));
}

.wtp-trow-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14.5px;
}

.wtp-trow-title strong { font-weight: 700; }

.wtp-dot {
	width: 8px;
	height: 8px;
	min-width: 8px;
	border-radius: 50%;
	background: #ef4444;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
	display: inline-block;
}

.wtp-trow-meta {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 5px;
	font-size: 12px;
	color: var(--wtp-text-soft);
}

.wtp-ticknum {
	font-weight: 700;
	color: var(--wtp-primary);
	direction: ltr;
	display: inline-block;
	font-size: 12px;
}

.wtp-dept-chip {
	background: #f1f5f9;
	border-radius: 6px;
	padding: 1px 9px;
	font-size: 11.5px;
}

.wtp-trow-badges {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-shrink: 0;
}

.wtp-chevron { color: #cbd5e1; }

.wtp-trow:hover .wtp-chevron { color: var(--wtp-primary); }

/* ---------- برچسب‌ها ---------- */
.wtp-badge {
	display: inline-flex;
	align-items: center;
	font-size: 11.5px;
	font-weight: 700;
	padding: 2.5px 11px;
	border-radius: 999px;
	line-height: 1.8;
	white-space: nowrap;
}

.wtp-status-open      { background: #fef3c7; color: #b45309; }
.wtp-status-processing{ background: #dbeafe; color: #1d4ed8; }
.wtp-status-answered  { background: #d1fae5; color: #047857; }
.wtp-status-closed    { background: #e2e8f0; color: #475569; }

.wtp-priority-low     { background: #f1f5f9; color: #64748b; }
.wtp-priority-medium  { background: #dbeafe; color: #1d4ed8; }
.wtp-priority-high    { background: #ffedd5; color: #c2410c; }
.wtp-priority-critical{ background: #fee2e2; color: #b91c1c; }

/* ---------- صفحه‌بندی ---------- */
.wtp-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 20px 0 6px;
	flex-wrap: wrap;
}

.wtp-page-btn {
	border: 1px solid var(--wtp-border);
	background: var(--wtp-surface);
	color: var(--wtp-text-soft);
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	min-width: 38px;
	padding: 7px 12px;
	border-radius: 9px;
	cursor: pointer;
	transition: all .18s ease;
}

.wtp-page-btn:hover { border-color: var(--wtp-primary); color: var(--wtp-primary); }

.wtp-page-btn.is-active {
	background: var(--wtp-primary);
	border-color: var(--wtp-primary);
	color: #fff;
}

.wtp-page-dots { color: var(--wtp-text-soft); padding: 0 4px; }

/* ---------- حالت خالی ---------- */
.wtp-empty {
	text-align: center;
	padding: 44px 20px;
	color: var(--wtp-text-soft);
}

.wtp-empty-icon {
	color: #cbd5e1;
	margin-bottom: 10px;
}

.wtp-empty p {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--wtp-text);
}

.wtp-empty span { font-size: 12.5px; }

/* ---------- نمای تیکت ---------- */
.wtp-view-top {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.wtp-view-title { font-size: 18px; font-weight: 800; }

.wtp-view-meta {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
	margin-top: 10px;
	font-size: 12.5px;
	color: var(--wtp-text-soft);
}

.wtp-view-meta strong { color: var(--wtp-text); }

.wtp-closed-banner {
	margin-top: 14px;
	background: #f1f5f9;
	border: 1px solid var(--wtp-border);
	border-right: 4px solid #64748b;
	border-radius: 10px;
	padding: 10px 16px;
	font-size: 12.5px;
	color: #475569;
}

/* ---------- گفتگو ---------- */
.wtp-thread {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 18px;
}

.wtp-msg {
	background: var(--wtp-surface);
	border: 1px solid var(--wtp-border);
	border-radius: var(--wtp-radius);
	box-shadow: var(--wtp-shadow);
	padding: 15px 19px;
	max-width: 88%;
}

.wtp-msg.is-user {
	align-self: flex-start;
	border-right: 3.5px solid var(--wtp-primary);
}

.wtp-msg.is-staff {
	align-self: flex-end;
	border-left: 3.5px solid #10b981;
	background: color-mix(in srgb, #10b981 4%, #ffffff);
}

.wtp-msg-meta {
	display: flex;
	align-items: center;
	gap: 9px;
	flex-wrap: wrap;
	margin-bottom: 8px;
	font-size: 12px;
	color: var(--wtp-text-soft);
}

.wtp-msg-meta strong { color: var(--wtp-text); font-size: 13px; }

.wtp-msg-role {
	background: #f1f5f9;
	border-radius: 999px;
	padding: 0 10px;
	font-size: 10.5px;
	font-weight: 700;
}

.wtp-msg.is-staff .wtp-msg-role {
	background: #d1fae5;
	color: #047857;
}

.wtp-msg-body {
	font-size: 14px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.wtp-atts {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 11px;
	padding-top: 11px;
	border-top: 1px dashed var(--wtp-border);
}

.wtp-att {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: #f8fafc;
	border: 1px solid var(--wtp-border);
	border-radius: 9px;
	padding: 6px 12px;
	font-size: 12px;
	color: var(--wtp-text) !important;
	text-decoration: none !important;
	transition: border-color .18s ease;
}

.wtp-att:hover { border-color: var(--wtp-primary); color: var(--wtp-primary) !important; }
.wtp-att svg { color: var(--wtp-primary); }
.wtp-att-size { color: var(--wtp-text-soft); font-size: 11px; }

/* ---------- ورود مهمان ---------- */
.wtp-guest {
	max-width: 480px;
}

.wtp-login-card {
	background: var(--wtp-surface);
	border: 1px solid var(--wtp-border);
	border-radius: 20px;
	box-shadow: var(--wtp-shadow);
	padding: 36px 34px;
	text-align: center;
}

.wtp-login-icon {
	width: 68px;
	height: 68px;
	margin: 0 auto 16px;
	border-radius: 20px;
	background: var(--wtp-primary-soft);
	color: var(--wtp-primary);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wtp-login-card h2 { font-size: 19px; font-weight: 800; }

.wtp-login-desc {
	color: var(--wtp-text-soft);
	font-size: 13px;
	margin: 8px 0 20px;
}

.wtp-login-form p { margin: 12px 0; text-align: right; }
.wtp-login-form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }

.wtp-login-form input[type="text"],
.wtp-login-form input[type="password"] {
	width: 100%;
	border: 1.5px solid var(--wtp-border);
	border-radius: var(--wtp-radius-sm);
	padding: 11px 14px;
	font-family: inherit;
	font-size: 13.5px;
	outline: none;
	transition: border-color .18s ease;
}

.wtp-login-form input:focus { border-color: var(--wtp-primary); }

.wtp-login-form .login-submit input[type="submit"],
.wtp-login-form p.submit input[type="submit"] {
	width: 100%;
	background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-dark));
	border: none;
	border-radius: var(--wtp-radius-sm);
	color: #fff;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 800;
	padding: 12px;
	cursor: pointer;
	margin-top: 6px;
	transition: opacity .18s ease;
}

.wtp-login-form .login-submit input[type="submit"]:hover { opacity: .92; }

.wtp-register-hint,
.wtp-lost-hint {
	font-size: 12.5px;
	text-align: center !important;
	color: var(--wtp-text-soft);
}

.wtp-login-card a { color: var(--wtp-primary); text-decoration: none; font-weight: 700; }
.wtp-login-card a:hover { text-decoration: underline; }

/* ---------- توست ---------- */
.wtp-toast-wrap {
	position: fixed;
	top: 22px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	pointer-events: none;
}

.wtp-toast {
	background: #0f172a;
	color: #fff;
	border-radius: 12px;
	padding: 11px 22px;
	font-family: 'Vazirmatn', Tahoma, sans-serif;
	font-size: 13.5px;
	box-shadow: 0 12px 30px rgba(15, 23, 42, .3);
	animation: wtpToastIn .25s ease;
	max-width: 90vw;
	text-align: center;
}

.wtp-toast.is-success { background: #059669; }
.wtp-toast.is-error { background: #dc2626; }

@keyframes wtpToastIn {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 860px) {
	.wtp-stats { grid-template-columns: repeat(2, 1fr); }
	.wtp-form-grid { grid-template-columns: 1fr; }
	.wtp-field.wtp-col-2 { grid-column: span 1; }
}

@media (max-width: 600px) {
	.wtp-header { padding: 20px; }
	.wtp-toolbar { flex-direction: column; align-items: stretch; }
	.wtp-filters .wtp-input { width: 100%; min-width: 0; }
	.wtp-trow { flex-direction: column; align-items: flex-start; gap: 10px; }
	.wtp-trow-badges { align-self: flex-end; }
	.wtp-msg { max-width: 100%; }
	.wtp-msg.is-staff { align-self: flex-start; border-left: none; border-right: 3.5px solid #10b981; }
	.wtp-stats { grid-template-columns: repeat(2, 1fr); }
}
