/* ==========================================================================
   Private Listings Manager - Frontend Styles
   هوية بصرية: كحلي داكن (ثقة/احترافية) + ذهبي دافئ (شراكة/تميّز)
   لا تحميل خطوط خارجية ولا مكتبات إضافية - أداء خفيف بالكامل.
   ========================================================================== */

.plm-wrapper,
.plm-auth-wrapper {
	--plm-primary: #16324f;
	--plm-primary-dark: #0e2338;
	--plm-accent: #c9962c;
	--plm-accent-dark: #a97c1e;
	--plm-bg: #f5f7fa;
	--plm-card-bg: #ffffff;
	--plm-border: #e2e6ec;
	--plm-text: #1f2a37;
	--plm-text-muted: #6b7684;
	--plm-success-bg: #e9f7ef;
	--plm-success-text: #1c7c4b;
	--plm-success-border: #bee6ce;
	--plm-error-bg: #fdecec;
	--plm-error-text: #b23b3b;
	--plm-error-border: #f5c6c6;
	--plm-radius: 12px;
	--plm-radius-sm: 8px;
	--plm-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);

	color: var(--plm-text);
}

.plm-wrapper { max-width: 960px; margin: 0 auto; }

/* --------------------------------------------------------------------
   بطاقة عامة (تُستخدم في: الدخول، التسجيل، إضافة/تعديل منتج/خدمة)
   -------------------------------------------------------------------- */
.plm-card {
	background: var(--plm-card-bg);
	border: 1px solid var(--plm-border);
	border-radius: var(--plm-radius);
	box-shadow: var(--plm-shadow);
	padding: 32px;
	position: relative;
	overflow: hidden;
}
.plm-card::before {
	content: "";
	position: absolute;
	top: 0; right: 0; left: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--plm-primary) 0%, var(--plm-accent) 100%);
}

.plm-eyebrow {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	color: var(--plm-accent-dark);
	background: rgba(201, 150, 44, .1);
	padding: 4px 12px;
	border-radius: 999px;
	margin-bottom: 14px;
}

.plm-form-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: var(--plm-primary-dark); }
.plm-form-subtitle { font-size: 14px; color: var(--plm-text-muted); margin: 0 0 24px; line-height: 1.7; }

/* --------------------------------------------------------------------
   بطاقات الدخول/التسجيل - عرض أضيق وتوسيط
   -------------------------------------------------------------------- */
.plm-auth-wrapper { display: flex; justify-content: center; padding: 24px 16px; }
.plm-auth-card { max-width: 420px; width: 100%; }
.plm-auth-card-wide { max-width: 640px; }
.plm-auth-switch { text-align: center; font-size: 14px; color: var(--plm-text-muted); margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--plm-border); }
.plm-auth-switch a { color: var(--plm-primary); font-weight: 700; text-decoration: none; margin-inline-start: 4px; }
.plm-auth-switch a:hover { color: var(--plm-accent-dark); text-decoration: underline; }

/* --------------------------------------------------------------------
   بطاقة نموذج المنتج/الخدمة - عرض كامل
   -------------------------------------------------------------------- */
.plm-listing-card-form { max-width: 760px; margin: 0 auto; }

/* --------------------------------------------------------------------
   أقسام النموذج
   -------------------------------------------------------------------- */
.plm-form-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--plm-border); }
.plm-form-section:last-of-type { border-bottom: none; padding-bottom: 0; }
.plm-form-section-title {
	font-size: 13px;
	font-weight: 700;
	text-transform: none;
	color: var(--plm-primary);
	margin: 0 0 16px;
	padding-inline-start: 10px;
	border-inline-start: 3px solid var(--plm-accent);
}

.plm-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }

/* --------------------------------------------------------------------
   الإشعارات
   -------------------------------------------------------------------- */
.plm-notice { padding: 12px 16px; border-radius: var(--plm-radius-sm); margin-bottom: 20px; font-size: 14px; border-inline-start-width: 3px; border-inline-start-style: solid; }
.plm-notice-success { background: var(--plm-success-bg); color: var(--plm-success-text); border: 1px solid var(--plm-success-border); border-inline-start-color: var(--plm-success-text); }
.plm-notice-error { background: var(--plm-error-bg); color: var(--plm-error-text); border: 1px solid var(--plm-error-border); border-inline-start-color: var(--plm-error-text); }
.plm-notice ul { margin: 4px 0 0; padding-inline-start: 18px; }

/* --------------------------------------------------------------------
   الحقول
   -------------------------------------------------------------------- */
.plm-field { margin-bottom: 18px; }
.plm-field:last-child { margin-bottom: 0; }
.plm-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; color: var(--plm-text); }
.plm-field-narrow input { max-width: 220px; }
.plm-field-inline { display: flex; align-items: center; }
.plm-field-note { font-size: 13px; color: var(--plm-text-muted); margin: -6px 0 16px; }

.plm-field input[type="text"],
.plm-field input[type="email"],
.plm-field input[type="password"],
.plm-field input[type="number"],
.plm-field select,
.plm-field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--plm-border);
	border-radius: var(--plm-radius-sm);
	font-size: 14px;
	background: #fbfcfd;
	color: var(--plm-text);
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
	box-sizing: border-box;
}
.plm-field input[type="text"]:focus,
.plm-field input[type="email"]:focus,
.plm-field input[type="password"]:focus,
.plm-field input[type="number"]:focus,
.plm-field select:focus,
.plm-field textarea:focus {
	outline: none;
	border-color: var(--plm-primary);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(22, 50, 79, .1);
}
.plm-field input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}
.plm-field input[type="number"]::-webkit-inner-spin-button,
.plm-field input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.plm-field input[type="file"].plm-file-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px dashed var(--plm-border);
	border-radius: var(--plm-radius-sm);
	background: #fbfcfd;
	font-size: 13px;
	box-sizing: border-box;
}
.plm-current-thumb { display: block; margin-top: 10px; }
.plm-current-thumb img { border-radius: var(--plm-radius-sm); border: 1px solid var(--plm-border); }

.plm-checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; cursor: pointer; }
.plm-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--plm-primary); cursor: pointer; }

.plm-private-fields {
	border: 1px dashed var(--plm-border);
	background: var(--plm-bg);
	padding: 20px;
	margin: 8px 0 24px;
	border-radius: var(--plm-radius-sm);
}
.plm-private-fields legend { font-weight: 700; font-size: 13px; padding: 0 8px; color: var(--plm-text-muted); }

/* --------------------------------------------------------------------
   الأزرار
   -------------------------------------------------------------------- */
.plm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	border-radius: var(--plm-radius-sm);
	text-decoration: none;
	cursor: pointer;
	border: none;
	font-size: 14px;
	font-weight: 700;
	transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
.plm-btn:active { transform: translateY(1px); }
.plm-btn-primary { background: var(--plm-primary); color: #fff !important; box-shadow: 0 2px 8px rgba(22, 50, 79, .25); }
.plm-btn-primary:hover { background: var(--plm-primary-dark); color: #fff !important; }
.plm-btn-primary:visited { color: #fff !important; }
.plm-btn-secondary { background: #eef0f3; color: var(--plm-text); margin-inline-end: 8px; }
.plm-btn-secondary:hover { background: #e2e6ec; }
.plm-btn-block { width: 100%; }

/* --------------------------------------------------------------------
   شاشة تأكيد إرسال منتج/خدمة جديد
   -------------------------------------------------------------------- */
.plm-submitted-card { text-align: center; }
.plm-submitted-card .plm-notice { text-align: start; }
.plm-submitted-card .plm-actions { justify-content: center; margin-top: 18px; }

.plm-actions { display: flex; align-items: center; margin-top: 24px; }

/* --------------------------------------------------------------------
   شبكة المنتجات والخدمات (الأرشيف العام)
   -------------------------------------------------------------------- */
.plm-listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.plm-listing-card { border: 1px solid var(--plm-border); border-radius: var(--plm-radius); overflow: hidden; position: relative; background: var(--plm-card-bg); box-shadow: var(--plm-shadow); }
.plm-card-status-badge { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 1; }
.plm-card-manage { margin: 0 12px 12px; font-size: 13px; }
.plm-card-thumb img { width: 100%; height: 160px; object-fit: cover; display: block; }
.plm-no-thumb { display: block; height: 160px; background: var(--plm-bg); }
.plm-card-body { padding: 14px; }
.plm-card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--plm-text-muted); margin-top: 8px; }
.plm-card-city { color: var(--plm-text-muted); }
p.plm-card-city { margin: 0 12px 6px; font-size: 13px; }
.plm-card-price { font-weight: 700; color: var(--plm-accent-dark); font-size: 15px; margin: 6px 12px 0; }

/* --------------------------------------------------------------------
   صفحة عرض المنتج/الخدمة المفردة
   -------------------------------------------------------------------- */
.plm-single-title { font-size: 26px; margin-bottom: 14px; font-weight: 700; color: var(--plm-primary-dark); }
.plm-single-thumb img { width: 100%; border-radius: var(--plm-radius); margin-bottom: 20px; box-shadow: var(--plm-shadow); }

.plm-single-info-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin-bottom: 16px;
	background: var(--plm-card-bg);
	border: 1px solid var(--plm-border);
	border-radius: var(--plm-radius);
	box-shadow: var(--plm-shadow);
	overflow: hidden;
}
.plm-single-info-table tr:not(:last-child) { border-bottom: 1px solid var(--plm-border); }
.plm-single-info-table tr:nth-child(even) { background: #fafbfc; }
.plm-single-info-table th,
.plm-single-info-table td {
	padding: 13px 18px;
	text-align: start;
	vertical-align: middle;
	font-size: 14.5px;
}
.plm-single-info-table th {
	width: 150px;
	color: var(--plm-text-muted);
	font-weight: 600;
	white-space: nowrap;
}
.plm-single-info-table th,
.plm-single-info-table td:first-of-type { }
.plm-single-info-table td { color: var(--plm-text); font-weight: 500; }

.plm-single-content {
	font-size: 15.5px;
	font-weight: 400;
	line-height: 1.8;
	color: var(--plm-text);
	margin-bottom: 20px;
}

.plm-info-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-inline-end: 8px;
	color: var(--plm-accent-dark);
	vertical-align: -4px;
}
.plm-info-icon svg { width: 100%; height: 100%; fill: currentColor; }

.plm-single-price {
	display: inline-block;
	font-weight: 700;
	font-size: 17px;
	color: var(--plm-accent-dark);
	background: #fdf5e8;
	border: 1px solid var(--plm-accent);
	border-radius: var(--plm-radius-sm);
	padding: 4px 14px;
}

.plm-single-whatsapp-cta { display: flex; align-items: stretch; gap: 10px; margin-bottom: 24px; }
.plm-whatsapp-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 46px;
	height: auto;
	background: #25d366;
	border-radius: var(--plm-radius-sm);
	box-shadow: 0 4px 12px rgba(37, 211, 102, .28);
}
.plm-whatsapp-icon svg { width: 22px; height: 22px; fill: #fff; }
.plm-single-whatsapp-cta .plm-whatsapp-button {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	background: #25d366;
	color: #fff;
	font-weight: 700;
	font-size: 15.5px;
	text-decoration: none;
	padding: 13px 18px;
	border-radius: var(--plm-radius-sm);
	box-shadow: 0 4px 12px rgba(37, 211, 102, .28);
	transition: background .15s ease, transform .1s ease;
}
.plm-single-whatsapp-cta .plm-whatsapp-button:hover { background: #1ebe57; }
.plm-single-whatsapp-cta .plm-whatsapp-button:active { transform: scale(.99); }

@media (max-width: 600px) {
	.plm-single-info-table th { width: 110px; font-size: 13px; padding: 11px 14px; }
	.plm-single-info-table td { font-size: 13px; padding: 11px 14px; }
	.plm-info-icon { width: 15px; height: 15px; margin-inline-end: 6px; }
	.plm-single-content { font-size: 14px; }
}

/* --------------------------------------------------------------------
   لوحة تحكم العضو
   -------------------------------------------------------------------- */
.plm-dashboard-divider { border: none; border-top: 1px solid var(--plm-border); margin: 32px 0; }
.plm-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 24px; }
.plm-stat-card { text-align: center; padding: 18px; border: 1px solid var(--plm-border); border-radius: var(--plm-radius); background: var(--plm-card-bg); }
.plm-stat-number { display: block; font-size: 28px; font-weight: 700; color: var(--plm-primary); }
.plm-stat-label { font-size: 13px; color: var(--plm-text-muted); }
.plm-listings-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.plm-listings-table th, .plm-listings-table td { padding: 12px 10px; border-bottom: 1px solid var(--plm-border); text-align: right; font-size: 14px; }
.plm-listings-table th { color: var(--plm-text-muted); font-weight: 600; font-size: 13px; }
.plm-status { padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.plm-status-publish { background: var(--plm-success-bg); color: var(--plm-success-text); }
.plm-status-pending { background: #fff8e1; color: #9a6b00; }
.plm-status-draft { background: #eee; color: #555; }
.plm-status-rejected { background: var(--plm-error-bg); color: var(--plm-error-text); }

/* --------------------------------------------------------------------
   استجابة للشاشات الصغيرة
   -------------------------------------------------------------------- */
@media (max-width: 600px) {
	.plm-card { padding: 22px 18px; }
	.plm-form-grid { grid-template-columns: 1fr; }
	.plm-actions { flex-direction: column; align-items: stretch; gap: 10px; }
	.plm-btn-secondary { margin-inline-end: 0; }
}

/* RTL هو الافتراضي هنا لأن المحتوى عربي؛ الثيمات LTR ستظل ترث اتجاه الصفحة من القالب */
