/* القسم (ب) — تباين النصوص WCAG AA (4.5 للنص العادي) وإصلاحات النوافذ — 29/11/2026 */

/* عناوين مجموعات القائمة: #A8A49B (2.49) → #6B675F */
.group-title { color: #6B675F !important; }
body.theme-dark .group-title { color: #B9B4A8 !important; }

/* الذهبي على الكريمي: #B0840A (2.9–3.4) → #7A5A06 */
.firm-sub, .brand-sub, .case-id, .badge-soft.gold, .badge-soft.amber, .nav-item.active .count, .user-role, .user-menu .user-name, .app-credit b { color: #7A5A06 !important; }
body.theme-dark .firm-sub, body.theme-dark .brand-sub, body.theme-dark .case-id, body.theme-dark .badge-soft.gold, body.theme-dark .badge-soft.amber, body.theme-dark .nav-item.active .count, body.theme-dark .app-credit b { color: #E9C78F !important; }

/* الأخضر في الوسوم: #16A34A (2.95) → #15803D */
.tag-green, .badge-soft.green { color: #15803D !important; }
/* الأزرق: #0EA5E9 (2.4) → #0369A1 */
.badge-soft.blue, .prio-low { color: #0369A1 !important; }
/* الأحمر: #DC2626 (3.9) → #B91C1C */
.badge-soft.red, .prio-high { color: #B91C1C !important; }
body.theme-dark .tag-green, body.theme-dark .badge-soft.green { color: #6EE7A0 !important; }
body.theme-dark .badge-soft.blue, body.theme-dark .prio-low { color: #7DD3FC !important; }
body.theme-dark .badge-soft.red, body.theme-dark .prio-high { color: #FCA5A5 !important; }

/* أزرار الشرائح الأساسية (مثل «بانتظار قراري»): نص أبيض على الأخضر (كان 1.44) */
.seg .btn-primary, .seg button.btn-primary, .seg button.active { color: #fff !important; }
.seg .btn-primary em, .seg button.active em { color: #fff !important; }

/* «وقائية» على الشريط الأخضر: #E5B743 (3.46) → #F3D27A */
.firm-tagline em { color: #F3D27A !important; }

/* نص «لم يُرفع» وما شابه بلون #999 على رمادي فاتح → #5F5F5F */
[style*="color:#999"], [style*="color: #999"] { color: #5F5F5F !important; }
body.theme-dark [style*="color:#999"], body.theme-dark [style*="color: #999"] { color: #B5B5B5 !important; }

/* الوضع الليلي: بطاقات التنبيه الكريمية تأخذ خلفية داكنة */
body.theme-dark [style*="background:#FFF8EC"], body.theme-dark [style*="background:#FFFAEB"], body.theme-dark [style*="background:#fffaeb"],
body.theme-dark [style*="background:#fff4d6"], body.theme-dark [style*="background:#fff3c4"], body.theme-dark [style*="background:#fdf9ec"],
body.theme-dark [style*="background:#fffaf0"], body.theme-dark [style*="background:#fffdf6"], body.theme-dark [style*="background:#FBFAF7"],
body.theme-dark [style*="background:#fef3f2"], body.theme-dark [style*="background:#FEF0C7"], body.theme-dark [style*="background:#fbf3e4"],
body.theme-dark [style*="background:var(--gold-soft)"], body.theme-dark [style*="background: var(--gold-soft)"] {
  background: #2A2617 !important; color: #F1E6CC !important; border-color: #6B5A2E !important;
}
body.theme-dark [style*="background:#fef3f2"] { background: #34191A !important; border-color: #7A2620 !important; }
body.theme-dark .card[style*="border-inline-start:4px solid var(--gold-d)"], body.theme-dark .card[style*="border-inline-start:4px solid var(--danger)"] { background: #24221B !important; }
body.theme-dark [style*="color:#93370D"], body.theme-dark [style*="color:#B54708"] { color: #F6C77A !important; }

/* النوافذ: شبكة العمودين لا تتجاوز الحاوية فلا يُقص العمود الأيسر ولا يظهر تمرير أفقي */
.app-modal .modal-body { overflow-x: hidden; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.form-grid-2 > *, .form-grid-3 > *, .field, .field > * { min-width: 0; max-width: 100%; }
.field input, .field select, .field textarea, .select-wrap, .select-wrap select { width: 100%; box-sizing: border-box; }
@media (max-width: 720px) { .form-grid-2, .form-grid-3 { grid-template-columns: 1fr !important; } }

/* الحقل الناقص: إطار أحمر واضح */
[aria-invalid="true"], .field-invalid input, .field-invalid select, .field-invalid textarea { border-color: #B91C1C !important; box-shadow: 0 0 0 3px rgba(185, 28, 28, .15) !important; background: #FFF5F5 !important; }
body.theme-dark [aria-invalid="true"] { background: #2B1414 !important; }
.field-invalid > label { color: #B91C1C !important; }
.field-err-msg { color: #B91C1C; font-size: 12px; font-weight: 700; margin-top: 4px; }

/* تركيز مرئي للوحة المفاتيح */
:focus-visible { outline: 2px solid #1F4D2E; outline-offset: 2px; }
body.theme-dark :focus-visible { outline-color: #E9C78F; }

/* م-14: الجلسة بلا محامٍ بلون مميز في التقويم */
.cal-ev.cal-unassigned{background:#FEF3F2 !important;color:#B42318 !important;border-inline-start:3px solid #B42318 !important;font-weight:700}
body.theme-dark .cal-ev.cal-unassigned{background:#3a1616 !important;color:#FCA5A5 !important}
