/* =========================================================
   PromoMedia Designer — שפה חזותית לפי סעיף 7 במסמך האפיון.
   Design Tokens — נקודת פתיחה; לדגום סופית מהלוגו/Figma.
   הטיפוגרפיה יורשת מ-Elementor Global Fonts (אין פונט חדש).
   ========================================================= */
/* העורך (position:fixed) יושב מחוץ ל-.pmd-app ולכן ה-tokens מוגדרים על שניהם */
.pmd-app,
.pmd-editor-shell,
.pmd-toast {
	--pmd-header-bg: #0B0B0B;
	--pmd-primary:   #E91E63;  /* מג'נטה — פעולות ראשיות בלבד */
	--pmd-text:      #222222;
	--pmd-text-2:    #666666;
	--pmd-border:    #E2E2E2;
	--pmd-bg-2:      #F6F6F6;
	--pmd-success:   #2E7D32;
	--pmd-warn:      #E9A11A;
	--pmd-error:     #D32F2F;

}

.pmd-app {
	color: var(--pmd-text);
	background: #fff;
	direction: rtl;
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px;
}

/* ---------- כפתורים ---------- */
.pmd-app .pmd-btn-primary,
.pmd-app .pmd-btn-secondary,
.pmd-app .pmd-btn-danger,
.pmd-editor-shell .pmd-btn-primary {
	display: inline-block;
	min-height: 44px;
	line-height: 44px;
	padding: 0 22px;
	border-radius: 8px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	text-align: center;
}
.pmd-app .pmd-btn-primary,
.pmd-editor-shell .pmd-btn-primary { background: var(--pmd-primary); color: #fff; }
.pmd-app .pmd-btn-primary:hover,
.pmd-editor-shell .pmd-btn-primary:hover { filter: brightness(0.92); color: #fff; }
.pmd-app .pmd-btn-secondary { background: #fff; color: var(--pmd-text); border-color: var(--pmd-border); }
.pmd-app .pmd-btn-danger    { background: #fff; color: var(--pmd-error); border-color: var(--pmd-error); }

/* ---------- כרטיסים ---------- */
.pmd-card {
	background: #fff;
	border: 1px solid var(--pmd-border);
	border-radius: 10px;
	padding: 18px;
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
}
.pmd-empty { background: var(--pmd-bg-2); text-align: center; padding: 40px; color: var(--pmd-text-2); }

/* ---------- Badge סטטוס ---------- */
.pmd-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pmd-badge--draft    { background: var(--pmd-bg-2);  color: var(--pmd-text-2); }
.pmd-badge--review   { background: #FFF6E5; color: var(--pmd-warn); }
.pmd-badge--changes  { background: #FDECEC; color: var(--pmd-error); }
.pmd-badge--approved { background: #EAF5EB; color: var(--pmd-success); }
.pmd-badge--rejected { background: #FDECEC; color: var(--pmd-error); }

/* ---------- Tabs ---------- */
.pmd-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--pmd-border); margin-bottom: 20px; }
.pmd-tab { padding: 10px 2px; color: var(--pmd-text); cursor: pointer; border-bottom: 2px solid transparent; }
.pmd-tab.is-active { border-bottom-color: var(--pmd-primary); font-weight: 700; }

/* ---------- F-01: מסך כניסה ---------- */
.pmd-gate { display: grid; grid-template-columns: 1fr 1.2fr; border-radius: 12px; overflow: hidden; border: 1px solid var(--pmd-border); padding: 0; }
.pmd-gate-brand { background: var(--pmd-header-bg); color: #fff; padding: 40px 32px; }
.pmd-gate-logo { font-size: 28px; font-weight: 800; letter-spacing: 1px; }
.pmd-gate-logo span { color: var(--pmd-primary); }
.pmd-gate-tag { color: var(--pmd-primary); font-weight: 700; margin-top: 18px; }
.pmd-gate-brand ul { margin: 18px 0 0; padding: 0; list-style: none; }
.pmd-gate-brand li { padding: 4px 0; opacity: 0.9; }
.pmd-gate-form { padding: 32px; }
.pmd-gate-tabs { margin-bottom: 18px; }
.pmd-gate-panel { display: flex; flex-direction: column; gap: 12px; }
.pmd-gate-panel .pmd-btn-primary { align-self: flex-start; }
.pmd-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pmd-gate-err { background: #FDECEC; color: var(--pmd-error); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
@media (max-width: 767px) { .pmd-gate { grid-template-columns: 1fr; } .pmd-field-row { grid-template-columns: 1fr; } }

/* ---------- F-02: לוח בקרה ---------- */
.pmd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.pmd-kpi  { text-align: center; }
.pmd-kpi b { display: block; font-size: 32px; }
.pmd-kpi span { color: var(--pmd-text-2); font-size: 13px; }
@media (max-width: 767px) { .pmd-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- F-03: קטלוג ---------- */
.pmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.pmd-product-card h4 { margin: 10px 0 4px; }
.pmd-product-card small { color: var(--pmd-text-2); }

/* ---------- F-04: קונפיגורטור ---------- */
.pmd-config { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pmd-field { margin-bottom: 14px; }
.pmd-field label { display: block; font-weight: 600; margin-bottom: 4px; }
.pmd-field select, .pmd-field input {
	width: 100%; border: 1px solid var(--pmd-border); border-radius: 8px; padding: 10px; background: #fff;
}
.pmd-price { font-size: 24px; font-weight: 800; }
.pmd-price small { font-weight: 400; color: var(--pmd-text-2); }
@media (max-width: 767px) { .pmd-config { grid-template-columns: 1fr; } }

/* ---------- F-05: עורך ---------- */
.pmd-editor-shell { position: fixed; inset: 0; z-index: 99999; background: var(--pmd-bg-2); display: flex; flex-direction: column; direction: rtl; }
.pmd-editor-header {
	background: var(--pmd-header-bg); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 16px; height: 56px;
}
.pmd-editor-header .pmd-gate-logo { font-size: 18px; }
.pmd-editor-header .pmd-save-status { color: #9e9e9e; font-size: 13px; }
.pmd-editor-header .pmd-spacer { flex: 1; }
.pmd-editor-header button {
	background: transparent; color: #fff; border: 1px solid #333; border-radius: 6px; padding: 6px 12px; cursor: pointer;
}
.pmd-editor-header .pmd-btn-primary { border: 0; line-height: normal; min-height: 36px; padding: 8px 18px; }
.pmd-editor-header button.is-on { background: var(--pmd-primary); border-color: var(--pmd-primary); color: #fff; }
/* פאנל מאפיינים (Canva-like) — קבוצות-שבב */
.pmd-props { background: #fff; border-bottom: 1px solid var(--pmd-border); padding: 6px 12px; display: flex; align-items: center; gap: 6px; row-gap: 6px; flex-wrap: wrap; min-height: 30px; max-height: 96px; overflow-y: auto; direction: rtl; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.pmd-props-hint { color: var(--pmd-text-2); font-size: 13px; }
/* שבב-קבוצה: מאגד פקדים קשורים ברקע עדין */
.pmd-props .pmd-p-sec { display: inline-flex; align-items: center; gap: 5px; background: var(--pmd-bg-2); border: 1px solid var(--pmd-border); border-radius: 8px; padding: 3px 6px; }
.pmd-props select.pmd-p { height: 30px; border: 1px solid var(--pmd-border); border-radius: 6px; padding: 0 6px; background: #fff; max-width: 170px; }
.pmd-props select.pmd-p-font { min-width: 148px; font-size: 14px; }
.pmd-props .pmd-p-num { width: 56px; height: 30px; border: 1px solid var(--pmd-border); border-radius: 6px; padding: 0 4px; text-align: center; background: #fff; }
.pmd-props .pmd-p-xf .pmd-p-num { width: 48px; }
.pmd-props .pmd-p-color { width: 28px; height: 28px; padding: 0; border: 1px solid var(--pmd-border); border-radius: 6px; background: #fff; cursor: pointer; }
.pmd-props .pmd-p-btn { min-width: 30px; height: 30px; border: 1px solid var(--pmd-border); border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; padding: 0 6px; transition: background .12s, color .12s; }
.pmd-props .pmd-p-btn:hover { background: #fff; border-color: var(--pmd-primary); color: var(--pmd-primary); }
.pmd-props .pmd-p-btn.is-on { background: var(--pmd-primary); color: #fff; border-color: var(--pmd-primary); }
.pmd-props .pmd-p-btn.pmd-p-danger { color: var(--pmd-error); border-color: var(--pmd-error); }
.pmd-props .pmd-p-btn.pmd-p-danger:hover { background: var(--pmd-error); color: #fff; }
.pmd-props .pmd-p-group { display: inline-flex; gap: 2px; }
.pmd-props .pmd-p-lbl { font-size: 12px; color: var(--pmd-text-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pmd-props .pmd-p-range { width: 84px; accent-color: var(--pmd-primary); }
.pmd-props .pmd-p-sep { width: 1px; height: 22px; background: var(--pmd-border); margin: 0 2px; }

.pmd-editor-body { flex: 1; display: flex; overflow: hidden; }
.pmd-editor-tools {
	width: 78px; background: #fff; border-left: 1px solid var(--pmd-border); display: flex; flex-direction: column; gap: 6px; padding: 12px 8px;
}
.pmd-editor-tools button {
	position: relative; background: var(--pmd-bg-2); border: 1px solid transparent; border-radius: 10px; padding: 10px 4px; font-size: 11.5px; line-height: 1.5; cursor: pointer; color: var(--pmd-text-2); font-weight: 600; transition: background .12s, color .12s;
}
.pmd-editor-tools button:hover { background: #fff; border-color: var(--pmd-border); color: var(--pmd-text); }
.pmd-editor-tools button.is-on { background: #FDE8F0; color: var(--pmd-primary); border-color: transparent; }
.pmd-editor-tools button.is-on::before { content: ""; position: absolute; inset-inline-start: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--pmd-primary); }

/* ---------- פאנל כלים (shapes/elements/uploads/bg/image) ---------- */
.pmd-tool-panel { width: 224px; background: #fff; border-inline-start: 1px solid var(--pmd-border); border-inline-end: 1px solid var(--pmd-border); padding: 12px; overflow-y: auto; }
.pmd-tool-panel h4 { margin: 0 0 10px; }
.pmd-tool-panel .pmd-tp-add { display: block; width: 100%; text-align: right; background: var(--pmd-bg-2); border: 1px solid var(--pmd-border); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
.pmd-tool-panel .pmd-tp-add:hover { background: #eee; }
.pmd-tp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pmd-tp-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--pmd-bg-2); border: 1px solid var(--pmd-border); border-radius: 8px; cursor: pointer; color: #333; }
.pmd-tp-cell:hover { background: #eee; border-color: var(--pmd-primary); }
.pmd-tp-sw { aspect-ratio: 1; border: 1px solid var(--pmd-border); border-radius: 8px; cursor: pointer; }
.pmd-tp-slider { display: block; font-size: 13px; color: var(--pmd-text-2); margin-bottom: 10px; }
.pmd-tp-slider input { width: 100%; display: block; margin-top: 4px; }
/* תבניות מוכנות */
.pmd-tp-hint { font-size: 11.5px; color: var(--pmd-text-2); margin: 0 0 10px; line-height: 1.5; }
.pmd-tpl-list { display: grid; gap: 10px; }
.pmd-tpl { display: block; width: 100%; background: var(--pmd-bg-2); border: 1px solid var(--pmd-border); border-radius: 10px; padding: 8px; cursor: pointer; text-align: center; transition: border-color .12s, box-shadow .12s; }
.pmd-tpl:hover { border-color: var(--pmd-primary); box-shadow: 0 2px 8px rgb(233 30 99 / 0.15); }
.pmd-tpl img { width: 100%; display: block; border: 1px solid var(--pmd-border); border-radius: 6px; background: #fff; }
.pmd-tpl span { display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--pmd-text); }
.pmd-tpl--mine { position: relative; }
.pmd-tpl-noimg { display: grid; place-items: center; height: 54px; background: #fff; border: 1px solid var(--pmd-border); border-radius: 6px; color: #c9c9c9; font-size: 22px; }
.pmd-tpl-del { position: absolute; inset-inline-end: 6px; top: 6px; background: rgba(255,255,255,.92); border: 1px solid var(--pmd-border); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 3px 5px; }
.pmd-tpl-del:hover { border-color: var(--pmd-error); }
.pmd-editor-shell .pmd-tpl-save { width: 100%; margin-top: 12px; font-size: 13px; min-height: 38px; }

/* ---------- זום בהדר ---------- */
.pmd-zoom { display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 8px; }
.pmd-zoom button { background: transparent; color: #fff; border: 1px solid #333; border-radius: 6px; width: 28px; height: 30px; cursor: pointer; }
.pmd-zoom #pmd-zoom-val { color: #ccc; font-size: 12px; min-width: 42px; text-align: center; }
.pmd-editor-canvas-wrap {
	flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 32px;
	background-color: #E9EAEE;
	background-image: linear-gradient(45deg, #e0e1e6 25%, transparent 25%), linear-gradient(-45deg, #e0e1e6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e0e1e6 75%), linear-gradient(-45deg, transparent 75%, #e0e1e6 75%);
	background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}
.pmd-editor-canvas-wrap.is-panning { cursor: grabbing; }
.pmd-editor-canvas-wrap .canvas-container { box-shadow: 0 6px 26px rgb(0 0 0 / 0.22); border-radius: 2px; }
.pmd-editor-layers {
	width: 232px; background: #fff; border-right: 1px solid var(--pmd-border); padding: 12px; overflow: auto; font-size: 13px;
}
.pmd-editor-layers > b { display: block; margin-bottom: 8px; }
.pmd-layer { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 8px; cursor: default; border: 1px solid transparent; }
.pmd-layer:hover { background: var(--pmd-bg-2); }
.pmd-layer.is-active { background: #FDE8F0; border-color: #F6B6D0; }
.pmd-layer.is-drag { opacity: .5; }
.pmd-layer.is-over { border-color: var(--pmd-primary); background: #FDF0F5; }
.pmd-layer-grip { color: #c3c3c3; cursor: grab; font-size: 12px; }
.pmd-layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.pmd-layer-acts { display: inline-flex; gap: 1px; opacity: 0; transition: opacity .12s; }
.pmd-layer:hover .pmd-layer-acts, .pmd-layer.is-active .pmd-layer-acts { opacity: 1; }
.pmd-layer-acts button { background: transparent; border: 0; cursor: pointer; font-size: 13px; padding: 2px; border-radius: 4px; line-height: 1; }
.pmd-layer-acts button:hover { background: #fff; }
.pmd-editor-footer {
	background: #fff; border-top: 1px solid var(--pmd-border); padding: 6px 16px; font-size: 12px; color: var(--pmd-text-2);
	display: flex; gap: 18px;
}
.pmd-legend i { display: inline-block; width: 20px; border-top: 2px dashed; margin-inline-end: 4px; vertical-align: middle; }
.pmd-legend--cut  i { border-color: #000; border-top-style: solid; }
.pmd-legend--safe i { border-color: #29b6f6; }
.pmd-legend--bleed i { border-color: var(--pmd-primary); }

/* ---------- בורר צדדים (עורך דו-צדדי) ---------- */
.pmd-side-tabs { display: inline-flex; gap: 4px; background: #1c1c1c; border-radius: 8px; padding: 3px; }
.pmd-side-tab { background: transparent; color: #bbb; border: 0; border-radius: 6px; padding: 5px 14px; cursor: pointer; font-size: 13px; }
.pmd-side-tab.is-active { background: var(--pmd-primary); color: #fff; }

/* ---------- F-07: שורת פעולות ---------- */
.pmd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pmd-actions .pmd-btn-primary, .pmd-actions .pmd-btn-secondary, .pmd-actions .pmd-btn-danger,
.pmd-actions button { min-height: 36px; line-height: 34px; padding: 0 12px; font-size: 13px;
	border-radius: 8px; border: 1px solid var(--pmd-border); background: #fff; cursor: pointer; }
.pmd-actions .pmd-btn-primary { background: var(--pmd-primary); color: #fff; border: 0; }
.pmd-actions .pmd-btn-danger  { color: var(--pmd-error); border-color: var(--pmd-error); }
.pmd-actions button:disabled  { opacity: 0.5; cursor: default; }

/* ---------- F-06: מסך סיכום ---------- */
.pmd-summary { position: fixed; inset: 0; z-index: 100001; background: rgba(0,0,0,.55);
	display: flex; align-items: center; justify-content: center; direction: rtl; padding: 20px; }
.pmd-summary-box { background: #fff; border-radius: 12px; padding: 24px; max-width: 640px; width: 100%;
	max-height: 92vh; overflow: auto; }
.pmd-summary-box h2 { margin-top: 0; }
.pmd-summary-previews { display: flex; gap: 14px; flex-wrap: wrap; }
.pmd-summary-previews figure { margin: 0; flex: 1; min-width: 180px; text-align: center; }
.pmd-summary-previews figcaption { font-size: 13px; color: var(--pmd-text-2); margin-bottom: 6px; }
.pmd-summary-previews img { max-width: 100%; border: 1px solid var(--pmd-border); border-radius: 6px; }
.pmd-summary-spec { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.pmd-summary-spec td { border: 1px solid var(--pmd-border); padding: 8px 10px; }
.pmd-summary-spec td:first-child { color: var(--pmd-text-2); width: 40%; }
.pmd-check { display: block; margin: 8px 0; cursor: pointer; }
.pmd-check input { margin-inline-end: 8px; }
.pmd-summary-actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 16px; }

/* ---------- F-08: Timeline ---------- */
.pmd-timeline { list-style: none; padding: 0; margin: 8px 0; }
.pmd-timeline li { padding: 6px 0; border-inline-start: 2px solid var(--pmd-border); padding-inline-start: 12px; margin-inline-start: 4px; font-size: 13px; }

/* ---------- Toast ---------- */
.pmd-toast {
	position: fixed; bottom: 20px; right: 20px; z-index: 100000; background: var(--pmd-header-bg); color: #fff;
	padding: 12px 18px; border-radius: 8px; box-shadow: 0 4px 14px rgb(0 0 0 / 0.25); font-size: 14px;
}
.pmd-toast--error { background: var(--pmd-error); }

/* ---------- תת-כותרת בפאנל כלים ---------- */
.pmd-tp-sub { font-size: 12px; color: var(--pmd-text-2); font-weight: 600; margin: 12px 0 6px; }

/* ---------- כפתור עזרה בהדר ---------- */
.pmd-editor-header #pmd-help { width: 30px; padding: 6px 0; font-weight: 700; border-radius: 50%; }

/* ---------- חלונית קיצורי מקלדת ---------- */
.pmd-shortcuts {
	position: absolute; top: 62px; inset-inline-start: 16px; z-index: 100002; width: 340px;
	background: #fff; color: var(--pmd-text); border: 1px solid var(--pmd-border); border-radius: 12px;
	padding: 16px 18px; box-shadow: 0 10px 34px rgb(0 0 0 / 0.28); direction: rtl;
}
.pmd-shortcuts h4 { margin: 0 0 10px; }
.pmd-shortcuts ul { list-style: none; margin: 0 0 12px; padding: 0; }
.pmd-shortcuts li { padding: 5px 0; font-size: 13px; color: var(--pmd-text-2); border-bottom: 1px dashed var(--pmd-border); }
.pmd-shortcuts li:last-child { border-bottom: 0; }
.pmd-shortcuts li b { color: var(--pmd-text); font-weight: 700; }
.pmd-shortcuts .pmd-btn-secondary { display: inline-block; min-height: 36px; line-height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--pmd-border); background: #fff; cursor: pointer; }

/* =========================================================
   האזור האישי — מעטפת, ניווט ורכיבי UI
   ========================================================= */
.pmd-appbar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	background: var(--pmd-header-bg); color: #fff; border-radius: 14px; padding: 14px 18px; margin-bottom: 22px;
}
.pmd-appbar-user { display: flex; align-items: center; gap: 10px; }
.pmd-avatar {
	width: 40px; height: 40px; border-radius: 50%; background: var(--pmd-primary); color: #fff;
	display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.pmd-appbar-who { display: flex; flex-direction: column; line-height: 1.3; }
.pmd-appbar-who small { color: #9e9e9e; font-size: 12px; }
.pmd-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pmd-nav a {
	color: #ddd; text-decoration: none; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600;
	transition: background .12s, color .12s;
}
.pmd-nav a:hover { background: #1e1e1e; color: #fff; }
.pmd-nav a.is-active { background: #fff; color: var(--pmd-header-bg); }
.pmd-nav a.pmd-nav-cta { background: var(--pmd-primary); color: #fff; }
.pmd-nav a.pmd-nav-cta:hover { filter: brightness(0.92); }
.pmd-nav a.pmd-nav-cta.is-active { background: var(--pmd-primary); color: #fff; }

/* ---------- כותרות מסך ---------- */
.pmd-page-head { margin-bottom: 18px; }
.pmd-page-head h2 { margin: 0 0 4px; }
.pmd-page-sub { color: var(--pmd-text-2); margin: 0; font-size: 14px; }
.pmd-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.pmd-section-head h3 { margin: 0; }
.pmd-section-head a { font-size: 14px; }
.pmd-count { background: var(--pmd-bg-2); color: var(--pmd-text-2); border-radius: 20px; padding: 1px 9px; font-size: 12px; font-weight: 600; }
.pmd-back { margin: 0 0 10px; font-size: 14px; }
.pmd-muted { color: var(--pmd-text-2); font-size: 13px; }

/* ---------- KPI כרטיסים לחיצים ---------- */
.pmd-app a.pmd-kpi { text-decoration: none; color: inherit; display: block; position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.pmd-app a.pmd-kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgb(0 0 0 / 0.09); }
.pmd-kpi::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--pmd-border); }
.pmd-kpi--review::after   { background: var(--pmd-warn); }
.pmd-kpi--changes::after  { background: var(--pmd-error); }
.pmd-kpi--approved::after { background: var(--pmd-success); }
.pmd-kpi--draft::after    { background: var(--pmd-text-2); }

/* ---------- מרכז התראות ---------- */
.pmd-notes { border-inline-start: 3px solid var(--pmd-primary); }
.pmd-notes-list { list-style: none; margin: 10px 0 0; padding: 0; }
.pmd-notes-list li { border-top: 1px solid var(--pmd-border); }
.pmd-notes-list li:first-child { border-top: 0; }
.pmd-notes-list a { display: flex; align-items: center; gap: 8px; padding: 9px 2px; font-size: 14px; text-decoration: none; color: var(--pmd-text); }
.pmd-notes-list a:hover { color: var(--pmd-primary); }

/* ---------- תמונות ממוזערות של עיצובים ---------- */
.pmd-thumb {
	aspect-ratio: 16 / 10; background: var(--pmd-bg-2); border: 1px solid var(--pmd-border); border-radius: 8px;
	overflow: hidden; display: grid; place-items: center; margin-bottom: 10px;
}
.pmd-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pmd-thumb--empty span { font-size: 30px; font-weight: 800; color: #c9c9c9; }
.pmd-thumb--lg { aspect-ratio: auto; }
.pmd-thumb--lg img { max-height: 320px; }
.pmd-product-card { display: flex; flex-direction: column; }
.pmd-product-card > a { text-decoration: none; }
.pmd-product-card h4 { margin: 0 0 3px; font-size: 15px; }
.pmd-product-card .pmd-actions { margin-top: auto; padding-top: 10px; }
.pmd-cat-card .pmd-thumb { aspect-ratio: 3 / 2; }
.pmd-sizes { color: var(--pmd-text-2); margin-inline-start: 6px; }
.pmd-prod-step { background: var(--pmd-bg-2); border-radius: 20px; padding: 1px 9px; font-size: 12px; color: var(--pmd-text-2); }

/* ---------- שלד טעינה (skeleton) ---------- */
@keyframes pmd-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.pmd-sk-thumb, .pmd-sk-line, .pmd-sk-head {
	background: linear-gradient(90deg, #eee 25%, #f7f7f7 37%, #eee 63%); background-size: 200% 100%;
	animation: pmd-shimmer 1.3s linear infinite; border-radius: 6px;
}
.pmd-sk-thumb { aspect-ratio: 16 / 10; margin-bottom: 10px; }
.pmd-sk-line { height: 12px; margin-bottom: 8px; }
.pmd-sk-line.is-short { width: 55%; }
.pmd-sk-head { height: 26px; width: 240px; margin-bottom: 20px; }

/* ---------- מצב ריק עשיר ---------- */
.pmd-empty--rich { padding: 46px 24px; grid-column: 1 / -1; }
.pmd-empty-ico { font-size: 40px; margin-bottom: 10px; }
.pmd-empty--rich b { display: block; font-size: 17px; color: var(--pmd-text); margin-bottom: 6px; }
.pmd-empty--rich p { margin: 0 0 16px; }

/* ---------- שורת כלים: חיפוש + שבבי סינון ---------- */
.pmd-toolbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pmd-search { flex: 1; min-width: 200px; border: 1px solid var(--pmd-border); border-radius: 8px; padding: 10px 12px; background: #fff; }
.pmd-search:focus { outline: 2px solid var(--pmd-primary); outline-offset: -1px; }
.pmd-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pmd-chip { border: 1px solid var(--pmd-border); background: #fff; border-radius: 20px; padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--pmd-text-2); }
.pmd-chip:hover { border-color: var(--pmd-primary); color: var(--pmd-primary); }
.pmd-chip.is-on { background: var(--pmd-primary); border-color: var(--pmd-primary); color: #fff; font-weight: 600; }
.pmd-chip-n { opacity: .6; font-size: 12px; margin-inline-start: 2px; }

/* ---------- קונפיגורטור: כרטיס מפרט ---------- */
.pmd-spec-preview {
	background: var(--pmd-bg-2); border: 2px dashed var(--pmd-border); border-radius: 8px;
	display: grid; place-items: center; color: var(--pmd-text-2); font-size: 13px; max-height: 260px; margin-bottom: 14px;
}
.pmd-spec-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.pmd-spec-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--pmd-border); }
.pmd-spec-list li:first-child { border-top: 0; }
.pmd-spec-list span { color: var(--pmd-text-2); }

/* ---------- F-08: תצוגת בדיקה ---------- */
.pmd-rev-wrap { position: relative; display: inline-block; border: 1px solid var(--pmd-border); border-radius: 6px; overflow: hidden; }
.pmd-rev-wrap > div { position: absolute; inset: 0; pointer-events: none; }
.pmd-pin {
	position: absolute; transform: translate(-50%, -50%); background: var(--pmd-primary); color: #fff;
	border-radius: 50%; width: 22px; height: 22px; line-height: 22px; text-align: center; font-size: 12px; font-weight: 700;
}
.pmd-anno { background: var(--pmd-bg-2); border-radius: 8px; padding: 9px 10px; margin-bottom: 6px; font-size: 14px; }
.pmd-note-box { background: var(--pmd-bg-2); border-inline-start: 3px solid var(--pmd-primary); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.pmd-note-box p { margin: 6px 0 10px; }
.pmd-note-box--ok { border-inline-start-color: var(--pmd-success); }

/* ---------- דיאלוג מעוצב ---------- */
.pmd-modal { position: fixed; inset: 0; z-index: 100002; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 20px; direction: rtl; }
.pmd-modal-box { background: #fff; border-radius: 12px; padding: 22px 24px; max-width: 440px; width: 100%; box-shadow: 0 12px 40px rgb(0 0 0 / 0.3); }
.pmd-modal-box--wide { max-width: 780px; text-align: center; }
.pmd-modal-box h3 { margin: 0 0 10px; }
.pmd-modal-box p { margin: 0 0 16px; color: var(--pmd-text-2); }
.pmd-modal-box .pmd-summary-actions { margin-top: 18px; }
.pmd-modal-box input { width: 100%; border: 1px solid var(--pmd-border); border-radius: 8px; padding: 10px; }
.pmd-modal-img { max-width: 100%; max-height: 62vh; border: 1px solid var(--pmd-border); border-radius: 8px; background: var(--pmd-bg-2); }

/* ---------- בחירה מרובה בעיצובים ---------- */
.pmd-product-card { position: relative; }
.pmd-pick { position: absolute; inset-inline-start: 10px; top: 10px; z-index: 2; background: #fff; border: 1px solid var(--pmd-border); border-radius: 6px; padding: 3px 5px; line-height: 0; cursor: pointer; }
.pmd-pick input { cursor: pointer; accent-color: var(--pmd-primary); margin: 0; }
.pmd-product-card.is-picked { border-color: var(--pmd-primary); box-shadow: 0 0 0 2px rgb(233 30 99 / 0.16); }
.pmd-thumb-wrap { cursor: zoom-in; }
.pmd-bulkbar { display: flex; align-items: center; gap: 10px; background: var(--pmd-header-bg); color: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; flex-wrap: wrap; }
.pmd-bulkbar .pmd-btn-danger, .pmd-bulkbar .pmd-btn-secondary { min-height: 34px; line-height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid; background: #fff; cursor: pointer; font-size: 13px; }
.pmd-bulkbar .pmd-btn-danger { color: var(--pmd-error); border-color: var(--pmd-error); }
.pmd-bulkbar .pmd-btn-secondary { color: var(--pmd-text); border-color: var(--pmd-border); }
.pmd-icon-btn { background: transparent; border: 0; cursor: pointer; font-size: 13px; color: var(--pmd-text-2); padding: 2px 4px; border-radius: 4px; }
.pmd-icon-btn:hover { background: var(--pmd-bg-2); color: var(--pmd-primary); }
.pmd-sort { border: 1px solid var(--pmd-border); border-radius: 8px; padding: 9px 10px; background: #fff; }

/* ---------- התקדמות ייצור ---------- */
.pmd-prog { margin: 6px 0 4px; }
.pmd-prog-bar { height: 6px; background: var(--pmd-bg-2); border-radius: 4px; overflow: hidden; }
.pmd-prog-bar span { display: block; height: 100%; background: var(--pmd-success); border-radius: 4px; }
.pmd-prog small { color: var(--pmd-text-2); font-size: 11.5px; }

/* ---------- הודעות נערמות ---------- */
.pmd-toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.pmd-toasts .pmd-toast { position: static; }

/* ---------- ספינר בכפתור ---------- */
@keyframes pmd-spin { to { transform: rotate(360deg); } }
.pmd-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: pmd-spin .7s linear infinite; vertical-align: -2px; }
button.is-busy { opacity: .75; cursor: progress; }

/* ---------- תפריט חשבון ---------- */
.pmd-appbar-user { position: relative; }
button.pmd-avatar { border: 0; cursor: pointer; font-family: inherit; }
button.pmd-avatar:hover { filter: brightness(1.1); }
.pmd-acct {
	position: absolute; top: 50px; inset-inline-start: 0; z-index: 30; min-width: 210px;
	background: #fff; color: var(--pmd-text); border: 1px solid var(--pmd-border); border-radius: 10px;
	padding: 12px 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.22); display: flex; flex-direction: column; gap: 4px;
}
.pmd-acct b { font-size: 14px; }
.pmd-acct small { color: var(--pmd-text-2); font-size: 12px; margin-bottom: 6px; word-break: break-all; }
.pmd-acct a { font-size: 13px; padding: 5px 0; text-decoration: none; color: var(--pmd-text); border-top: 1px solid var(--pmd-border); }
.pmd-acct a:hover { color: var(--pmd-primary); }
.pmd-acct .pmd-acct-out { color: var(--pmd-error); }

/* ---------- כרטיס "המשך מהמקום שעצרת" ---------- */
.pmd-app a.pmd-resume {
	display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit;
	border-inline-start: 3px solid var(--pmd-primary); margin-bottom: 18px; transition: box-shadow .12s;
}
.pmd-app a.pmd-resume:hover { box-shadow: 0 6px 18px rgb(0 0 0 / 0.09); }
.pmd-resume-thumb { width: 108px; flex: 0 0 108px; aspect-ratio: 16 / 10; margin: 0; }
.pmd-resume-thumb span { font-size: 24px; color: #c9c9c9; }
.pmd-resume-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pmd-resume-txt small { color: var(--pmd-primary); font-weight: 700; font-size: 12px; }
.pmd-resume-txt b { font-size: 16px; }
.pmd-resume-txt > span { color: var(--pmd-text-2); font-size: 13px; }
.pmd-resume-cta { color: var(--pmd-primary); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------- ציר שלבי ייצור ---------- */
.pmd-stages { list-style: none; margin: 14px 0 0; padding: 0; }
.pmd-stages li { position: relative; padding: 5px 22px 5px 0; font-size: 13px; color: var(--pmd-text-2); }
.pmd-stages li span { position: absolute; inset-inline-start: 4px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--pmd-border); }
.pmd-stages li::before { content: ""; position: absolute; inset-inline-start: 8px; top: 18px; bottom: -4px; width: 2px; background: var(--pmd-border); }
.pmd-stages li:last-child::before { display: none; }
.pmd-stages li.is-done { color: var(--pmd-text); }
.pmd-stages li.is-done span { background: var(--pmd-success); }
.pmd-stages li.is-now { color: var(--pmd-text); font-weight: 700; }
.pmd-stages li.is-now span { background: var(--pmd-primary); box-shadow: 0 0 0 3px rgb(233 30 99 / 0.18); }

/* ---------- נגישות: מיקוד מקלדת ---------- */
.pmd-app a:focus-visible, .pmd-app button:focus-visible, .pmd-app input:focus-visible,
.pmd-app select:focus-visible, .pmd-editor-shell button:focus-visible {
	outline: 2px solid var(--pmd-primary); outline-offset: 2px;
}

/* ---------- מובייל ---------- */
@media (max-width: 640px) {
	.pmd-appbar { flex-direction: column; align-items: stretch; }
	.pmd-nav { justify-content: space-between; }
	.pmd-nav a { padding: 8px 10px; font-size: 13px; }
	.pmd-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- העורך במסך צר ---------- */
@media (max-width: 860px) {
	.pmd-editor-tools { width: 62px; }
	.pmd-editor-layers { display: none; }
	.pmd-tool-panel { width: 190px; }
}
