/* ==========================================================================
   Salam BI — طبقة تباين مشتركة لكل الثيمات (v6.7)
   بتتحمّل بعد كل ملفات الثيمات. بتصلّح عيوب «مؤكدة بالقياس» جاية من ماركب الصفحات المشتركة
   (ألوان Tailwind الثابتة زي text-amber-500 / text-slate-400) ومن نص أبيض فوق ألوان تمييز فاتحة.
   - مابتغيّرش هوية أي ثيم: الألوان الجديدة درجات أغمق/أفتح من نفس اللون أو من مقياس الثيم نفسه (--brand-*).
   - الثيمات المخصصة اللي ليها قواعد أقوى (قوس قزح، الكحلي والأحمر، الأزرق الملكي والقرمزي) بتكسب بالـ specificity.
   - كل نسبة تباين مكتوبة جنب القاعدة مقاسة على سطح أبيض/الكارت الفعلي.
   ========================================================================== */

/* ---------------- النهاري: نصوص الحالات (Semantic) ---------------- */
html:not(.dark) .text-slate-400 { color: rgb(var(--slate-500)); }                     /* 2.45 → ≥4.6 */
html:not(.dark) .text-amber-500,
html:not(.dark) .text-amber-600 { color: #B45309; }                                    /* 2.15/3.19 → 5.02 */
html:not(.dark) .text-emerald-500,
html:not(.dark) .text-emerald-600 { color: #047857; }                                  /* 2.54/3.77 → 5.48 */
html:not(.dark) .text-red-500 { color: #B91C1C; }                                      /* 3.76 → 6.47 */
html:not(.dark) .text-purple-500 { color: #9333EA; }                                   /* 3.96 → 5.38 */
/* شارة «متصل» في الشريط العلوي (نص أخضر على خلفية خضرا فاتحة) */
html:not(.dark) .v6-status { color: #047857; }                                         /* 3.41 → 4.95 */
/* نصوص لون الثيم الأساسي (بعض الثيمات: ذهبي/برتقالي/سماوي/تركواز فاتح) → درجة 700 من مقياس الثيم نفسه */
html:not(.dark) .text-blue-500,
html:not(.dark) .text-blue-600,
html:not(.dark) .text-brand-500,
html:not(.dark) .text-brand-600 { color: rgb(var(--brand-700)); }

/* ---------------- الليلي: نصوص من غير درجة «dark:» مخصوصة ---------------- */
html.dark .text-slate-500:not([class*="dark:text-"]) { color: rgb(var(--slate-400)); }  /* 3.6–4.3 → ≥5 */
html.dark .text-purple-500:not([class*="dark:text-"]) { color: #D8B4FE; }               /* 3.1–4.5 → ≥7 */
html.dark .text-red-500:not([class*="dark:text-"]) { color: #FCA5A5; }                  /* 3.3–4.5 → ≥7 */
html.dark .text-emerald-600:not([class*="dark:text-"]) { color: #34D399; }              /* 3.3–4.5 → ≥6.4 */
html.dark .text-blue-500:not([class*="dark:text-"]),
html.dark .text-blue-600:not([class*="dark:text-"]),
html.dark .text-brand-600:not([class*="dark:text-"]) { color: rgb(var(--brand-200)); }
/* شارات لون الثيم (خلفية شفافة من لون الثيم) في الليلي */
html.dark .text-blue-600[class*="dark:text-blue-400"],
html.dark .text-brand-600[class*="dark:text-brand-400"] { color: rgb(var(--brand-200)); }   /* الياقوت/العنابي: 4.0–4.1 → ≥5.5 */

/* ---------------- نص أبيض فوق لون الثيم (العلامة، الصورة، علامة الملخص، زر «تحديث المبيعات») ----------------
   كان التدرج بينتهي بدرجة فاتحة (ذهبي/برتقالي/سماوي/تركواز/بنفسجي فاتح) والنص الأبيض عليها 1.4–4.2.
   بقى من درجتي 700 → 800 لنفس الثيم. الثيمات المخصصة الثلاثة ليها تصميمها الخاص فمستثناة. */
html:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) .v6-brand-mark,
html:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) .v6-avatar {
  background: linear-gradient(135deg, rgb(var(--brand-700)), rgb(var(--brand-800)));
  color: #FFFFFF;
}
html:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) #qpHandle {
  background: rgb(var(--brand-700));
}
html:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) button.bg-brand-600,
html:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) a.bg-brand-600 {
  background-color: rgb(var(--brand-700)) !important;
  background-image: linear-gradient(135deg, rgb(var(--brand-700)), rgb(var(--brand-800))) !important;
  color: #FFFFFF !important;
}
html:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) button.bg-brand-600:hover,
html:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) a.bg-brand-600:hover {
  background-image: linear-gradient(135deg, rgb(var(--brand-800)), rgb(var(--brand-900))) !important;
}

/* الليلي: درجة 700 لسه فاتحة شوية في الذهبي/الزمرد/المحيط/البرتقالي (4.3–4.5) → 800 → 900 */
html.dark:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) .v6-brand-mark,
html.dark:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) .v6-avatar {
  background: linear-gradient(135deg, rgb(var(--brand-800)), rgb(var(--brand-900)));
}
html.dark:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) #qpHandle {
  background: rgb(var(--brand-800));
}
html.dark:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) button.bg-brand-600,
html.dark:not([data-color-theme="editorial-rainbow-cinematic"]):not([data-color-theme="royal-blue-crimson"]):not([data-color-theme="salam-navy-red"]) a.bg-brand-600 {
  background-color: rgb(var(--brand-800)) !important;
  background-image: linear-gradient(135deg, rgb(var(--brand-800)), rgb(var(--brand-900))) !important;
}

/* بترولي ونحاسي — الليلي: نص بنفسجي فاتح على شارة بترولي (4.35) */
html.dark[data-color-theme="cinematic-teal-copper-light"] [class*="dark:text-purple-400"] { color: #D8B4FE; }
