/**
 * واجهة التذاكر — تصميم محايد يتجاوب مع قوالب مختلفة.
 * كل الفئات مسبوقة بـrdn-tk- حتى لا تصطدم بأنماط القالب.
 */

.rdn-tk {
	direction: rtl;
	text-align: right;
	font-size: 15px;
	line-height: 1.8;
	color: #2c3a34;
}

.rdn-tk * {
	box-sizing: border-box;
}

.rdn-tk-card {
	background: #fff;
	border: 1px solid #e2e9e6;
	border-radius: 12px;
	padding: 20px;
	margin: 0 0 20px;
}

.rdn-tk-card-title {
	margin: 0 0 12px;
	font-size: 19px;
	color: #17402f;
}

.rdn-tk-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.rdn-tk-notice {
	border-radius: 10px;
	padding: 12px 16px;
	margin: 0 0 16px;
	border: 1px solid transparent;
}

.rdn-tk-notice.is-success {
	background: #ecfdf5;
	border-color: #a7f3d0;
	color: #065f46;
}

.rdn-tk-notice.is-error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.rdn-tk-empty {
	background: #f6f8f7;
	border: 1px dashed #cfdad5;
	border-radius: 10px;
	padding: 18px;
	text-align: center;
	color: #5b6b64;
}

.rdn-tk-hint {
	font-size: 13px;
	color: #6b7a73;
	margin: 6px 0 0;
}

/* ---------- الحقول ---------- */

.rdn-tk-field {
	margin: 0 0 14px;
}

.rdn-tk-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}

.rdn-tk-field .req {
	color: #b91c1c;
}

.rdn-tk-field input[type="text"],
.rdn-tk-field input[type="email"],
.rdn-tk-field input[type="search"],
.rdn-tk-field select,
.rdn-tk-field textarea {
	width: 100%;
	max-width: 100%;
	padding: 10px 12px;
	border: 1px solid #cfdad5;
	border-radius: 8px;
	background: #fff;
	font: inherit;
	color: inherit;
}

.rdn-tk-field textarea {
	resize: vertical;
}

.rdn-tk-row {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.rdn-tk-row .rdn-tk-field {
	flex: 1 1 200px;
}

.rdn-tk-grow {
	flex: 3 1 320px !important;
}

.rdn-tk-fixed-dept {
	margin: 0;
	font-weight: 700;
	color: #17402f;
}

.rdn-tk-check {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
}

/* ---------- الأزرار ---------- */

.rdn-tk-btn {
	display: inline-block;
	padding: 10px 20px;
	border: 1px solid #cfdad5;
	border-radius: 8px;
	background: #f6f8f7;
	color: #17402f;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.rdn-tk-btn:hover {
	background: #eef2f0;
}

.rdn-tk-btn.is-primary {
	background: #17402f;
	border-color: #17402f;
	color: #fff;
}

.rdn-tk-btn.is-primary:hover {
	background: #1d5340;
}

.rdn-tk-btn.is-small {
	padding: 6px 12px;
	font-size: 13px;
}

.rdn-tk-btn[disabled] {
	opacity: .5;
	cursor: default;
}

.rdn-tk-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
}

/* ---------- التبويبات والفلاتر ---------- */

.rdn-tk-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}

.rdn-tk-tab {
	padding: 7px 14px;
	border: 1px solid #cfdad5;
	border-radius: 999px;
	text-decoration: none;
	color: #47564f;
	font-size: 14px;
}

.rdn-tk-tab.is-active {
	background: #17402f;
	border-color: #17402f;
	color: #fff;
}

.rdn-tk-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
}

.rdn-tk-filters select,
.rdn-tk-filters input[type="search"] {
	padding: 8px 10px;
	border: 1px solid #cfdad5;
	border-radius: 8px;
	font: inherit;
}

/* ---------- الجدول ---------- */

.rdn-tk-table-wrap {
	overflow-x: auto;
	border: 1px solid #e2e9e6;
	border-radius: 12px;
	margin-bottom: 16px;
}

.rdn-tk-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	min-width: 640px;
}

.rdn-tk-table th,
.rdn-tk-table td {
	padding: 12px 14px;
	text-align: right;
	border-bottom: 1px solid #eef2f0;
	vertical-align: middle;
}

.rdn-tk-table th {
	background: #f6f8f7;
	font-size: 13px;
	color: #5b6b64;
	font-weight: 700;
}

.rdn-tk-table tr:last-child td {
	border-bottom: 0;
}

.rdn-tk-ref {
	font-family: monospace;
	font-size: 13px;
	color: #6b7a73;
	direction: ltr;
	display: inline-block;
}

.rdn-tk-link {
	color: #17402f;
	font-weight: 600;
	text-decoration: none;
}

.rdn-tk-link:hover {
	text-decoration: underline;
}

/* ---------- الشارات ---------- */

.rdn-tk-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	background: #eef2f0;
	color: #47564f;
	white-space: nowrap;
}

.rdn-tk-badge.is-new      { background: #dbeafe; color: #1e40af; }
.rdn-tk-badge.is-open     { background: #fef3c7; color: #92400e; }
.rdn-tk-badge.is-pending  { background: #ede9fe; color: #5b21b6; }
.rdn-tk-badge.is-resolved { background: #d1fae5; color: #065f46; }
.rdn-tk-badge.is-closed   { background: #e5e7eb; color: #4b5563; }

.rdn-tk-prio {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 700;
}

.rdn-tk-prio.is-low    { background: #f3f4f6; color: #6b7280; }
.rdn-tk-prio.is-high   { background: #ffedd5; color: #9a3412; }
.rdn-tk-prio.is-urgent { background: #fee2e2; color: #b91c1c; }

/* ---------- صفحة التذكرة ---------- */

.rdn-tk-back {
	margin: 0 0 12px;
}

.rdn-tk-back a {
	color: #17402f;
	text-decoration: none;
}

.rdn-tk-ticket-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	border-bottom: 1px solid #eef2f0;
	padding-bottom: 12px;
	margin-bottom: 12px;
}

.rdn-tk-ticket-badges {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.rdn-tk-meta {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
}

.rdn-tk-meta li {
	margin: 0;
}

.rdn-tk-meta span {
	display: block;
	font-size: 12px;
	color: #7a8a83;
}

.rdn-tk-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	background: #f6f8f7;
	border: 1px solid #e2e9e6;
	border-radius: 10px;
	padding: 12px;
	margin-bottom: 18px;
}

.rdn-tk-inline-form {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.rdn-tk-inline-form label {
	font-size: 13px;
	color: #5b6b64;
	font-weight: 600;
}

.rdn-tk-inline-form select {
	padding: 6px 8px;
	border: 1px solid #cfdad5;
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
}

/* ---------- سلسلة الردود ---------- */

.rdn-tk-thread {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.rdn-tk-msg {
	border: 1px solid #e2e9e6;
	border-radius: 10px;
	padding: 14px 16px;
	background: #fff;
}

.rdn-tk-msg.is-staff {
	background: #f4f9f7;
	border-color: #cfe6dd;
}

.rdn-tk-msg.is-private {
	background: #fffbeb;
	border-color: #fde68a;
}

.rdn-tk-msg.is-system {
	background: transparent;
	border: 0;
	border-right: 3px solid #dbe4e0;
	border-radius: 0;
	padding: 4px 12px;
	color: #7a8a83;
	font-size: 13px;
}

.rdn-tk-msg-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 6px;
	font-size: 13px;
	color: #6b7a73;
}

.rdn-tk-msg-body p {
	margin: 0 0 8px;
}

.rdn-tk-msg-body p:last-child {
	margin-bottom: 0;
}

.rdn-tk-tag {
	background: #fde68a;
	color: #92400e;
	border-radius: 6px;
	padding: 1px 8px;
	font-size: 12px;
	font-weight: 700;
}

.rdn-tk-files {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rdn-tk-files a {
	display: inline-block;
	background: #f6f8f7;
	border: 1px solid #e2e9e6;
	border-radius: 8px;
	padding: 4px 10px;
	font-size: 13px;
	text-decoration: none;
	color: #17402f;
}

/* ---------- متفرقات ---------- */

.rdn-tk-details {
	margin-top: 8px;
}

.rdn-tk-details > summary {
	display: inline-block;
	list-style: none;
	margin-bottom: 12px;
}

.rdn-tk-details > summary::-webkit-details-marker {
	display: none;
}

.rdn-tk-pager {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.rdn-tk-page {
	padding: 6px 12px;
	border: 1px solid #cfdad5;
	border-radius: 8px;
	text-decoration: none;
	color: #47564f;
	font-size: 14px;
}

.rdn-tk-page.is-active {
	background: #17402f;
	border-color: #17402f;
	color: #fff;
}

@media (max-width: 600px) {
	.rdn-tk-card {
		padding: 16px;
	}

	.rdn-tk-tools {
		flex-direction: column;
		align-items: stretch;
	}
}

/* ---------- الشاشة الموحّدة ---------- */

.rdn-tk-tabs.is-main {
	border-bottom: 1px solid #e2e9e6;
	padding-bottom: 12px;
	margin-bottom: 18px;
}

.rdn-tk-tabs.is-main .rdn-tk-tab {
	font-weight: 600;
}

/* بطاقة «من أنت» فوق نموذج الفتح: المتجر والباقة وانتهاء الاشتراك كما تعرفها
   إضافة الباقات — ليطمئن العميل أن الدعم يعرف متجره بلا أن يكتبه. */
.rdn-tk-whoami {
	background: #f6f8f7;
	border: 1px solid #e2e9e6;
	border-radius: 8px;
	padding: 10px 14px;
	margin: 0 0 16px;
}

.rdn-tk-whoami span {
	color: #6b7a73;
	font-size: 13px;
	margin-right: 8px;
}

/* اشتراك منتهٍ: يراه العميل قبل أن يكتب، ويراه الدعم في التذكرة. */
.rdn-tk-whoami.is-expired {
	background: #fdf3f3;
	border-color: #f0c9c9;
}

.rdn-tk-whoami.is-expired span {
	color: #a4292f;
	font-weight: 600;
}

.rdn-tk-sub.is-expired {
	color: #a4292f;
	font-weight: 600;
}

.rdn-tk-meta li.is-expired strong {
	color: #a4292f;
}

.rdn-tk-sub {
	display: block;
	color: #7a8a83;
	font-size: 12px;
}
