/* ================================================================
   دؤوي — نظام التصميم المتقدم للصيدلية (Pharmacy Master Theme 2026)
   دعم فائق الدقة للوضعين المضيء (Light Pro) والمظلم (Dark Pro)
   مبني على أحدث معايير واجهات التطبيقات الطبية العالمية (Apple Health / Linear / Stripe)
   ================================================================ */

/* ════════════════════════════════════════════════════════════════
   ☀️ 1. الوضع المضيء الفائق (LIGHT PRO — CRISP MEDICAL STANDARD)
   ════════════════════════════════════════════════════════════════ */

html[data-theme="light"],
html:not([data-theme="dark"]),
html[data-theme="light"] body.pharmacy-body,
html:not([data-theme="dark"]) body.pharmacy-body,
html[data-theme="light"] .pharmacy-body,
html:not([data-theme="dark"]) .pharmacy-body {
  background: #F4F6F8 !important;
  color: #0F172A !important;
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif !important;
}

/* ── الخلفية والمحتوى الرئيسي في المضيء ── */
html[data-theme="light"] .dashboard,
html:not([data-theme="dark"]) .dashboard,
html[data-theme="light"] .dashboard-main,
html:not([data-theme="dark"]) .dashboard-main,
html[data-theme="light"] .panel,
html:not([data-theme="dark"]) .panel {
  background: #F4F6F8 !important;
  color: #0F172A !important;
}

/* ── الشريط الجانبي (Sidebar) في المضيء — أبيض ناصع وواضح بالكامل ── */
html[data-theme="light"] .sidebar,
html:not([data-theme="dark"]) .sidebar {
  background: #FFFFFF !important;
  border-inline-end: 1.5px solid #E2E8F0 !important;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .sidebar-brand .brand-name,
html:not([data-theme="dark"]) .sidebar-brand .brand-name {
  color: #0F172A !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .sidebar-brand .brand-sub,
html:not([data-theme="dark"]) .sidebar-brand .brand-sub {
  color: #64748B !important;
  font-weight: 600 !important;
}

/* أزرار الشريط الجانبي غير النشطة في المضيء (واضحة تماماً بلون غامق) */
html[data-theme="light"] .sidebar-btn,
html:not([data-theme="dark"]) .sidebar-btn,
html[data-theme="light"] .sidebar-nav button,
html:not([data-theme="dark"]) .sidebar-nav button,
html[data-theme="light"] .sidebar-footer button,
html:not([data-theme="dark"]) .sidebar-footer button,
html[data-theme="light"] .sidebar-footer a,
html:not([data-theme="dark"]) .sidebar-footer a {
  background: transparent !important;
  color: #334155 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  border-radius: 12px !important;
}

html[data-theme="light"] .sidebar-btn span,
html:not([data-theme="dark"]) .sidebar-btn span,
html[data-theme="light"] .sidebar-btn .material-symbols-outlined,
html:not([data-theme="dark"]) .sidebar-btn .material-symbols-outlined,
html[data-theme="light"] .sidebar-footer a span,
html:not([data-theme="dark"]) .sidebar-footer a span {
  color: #334155 !important;
  font-weight: 700 !important;
}

/* عند تمرير الماوس على الأزرار في المضيء */
html[data-theme="light"] .sidebar-btn:hover,
html:not([data-theme="dark"]) .sidebar-btn:hover,
html[data-theme="light"] .sidebar-footer a:hover,
html:not([data-theme="dark"]) .sidebar-footer a:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .sidebar-btn:hover span,
html:not([data-theme="dark"]) .sidebar-btn:hover span,
html[data-theme="light"] .sidebar-btn:hover .material-symbols-outlined,
html:not([data-theme="dark"]) .sidebar-btn:hover .material-symbols-outlined {
  color: #0F172A !important;
}

/* زر الشريط الجانبي النشط المختار في المضيء */
html[data-theme="light"] .sidebar-btn.active,
html:not([data-theme="dark"]) .sidebar-btn.active {
  background: linear-gradient(135deg, #006C49 0%, #10B981 100%) !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
}

html[data-theme="light"] .sidebar-btn.active span,
html:not([data-theme="dark"]) .sidebar-btn.active span,
html[data-theme="light"] .sidebar-btn.active .material-symbols-outlined,
html:not([data-theme="dark"]) .sidebar-btn.active .material-symbols-outlined {
  color: #FFFFFF !important;
}

/* فوتر الشريط الجانبي في المضيء */
html[data-theme="light"] .sidebar-footer,
html:not([data-theme="dark"]) .sidebar-footer {
  border-top: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .sidebar-status,
html:not([data-theme="dark"]) .sidebar-status,
html[data-theme="light"] #status-label,
html:not([data-theme="dark"]) #status-label {
  color: #334155 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .sidebar-support,
html:not([data-theme="dark"]) .sidebar-support {
  background: #F8FAFC !important;
  border: 1.5px dashed #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .sidebar-support span,
html:not([data-theme="dark"]) .sidebar-support span {
  color: #0F172A !important;
}

html[data-theme="light"] .logout-btn,
html:not([data-theme="dark"]) .logout-btn,
html[data-theme="light"] .logout-btn span,
html:not([data-theme="dark"]) .logout-btn span {
  color: #DC2626 !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .logout-btn:hover,
html:not([data-theme="dark"]) .logout-btn:hover {
  background: #FEE2E2 !important;
  color: #991B1B !important;
}

/* ── الهيدر العلوي في المضيء ── */
html[data-theme="light"] .dashboard-header,
html:not([data-theme="dark"]) .dashboard-header {
  background: #FFFFFF !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .header-time,
html:not([data-theme="dark"]) .header-time {
  color: #475569 !important;
  font-weight: 700 !important;
}

/* ── رقاقات الإحصائيات (Stat Chips) ── */
html[data-theme="light"] .stat-chip,
html:not([data-theme="dark"]) .stat-chip {
  background: #FFFFFF !important;
  color: #1E293B !important;
  border: 1.5px solid #E2E8F0 !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
}

html[data-theme="light"] .stat-chip-green,
html:not([data-theme="dark"]) .stat-chip-green {
  background: #ECFDF5 !important;
  border-color: #A7F3D0 !important;
  color: #065F46 !important;
}

html[data-theme="light"] .stat-chip-blue,
html:not([data-theme="dark"]) .stat-chip-blue {
  background: #EFF6FF !important;
  border-color: #BFDBFE !important;
  color: #1E40AF !important;
}

html[data-theme="light"] .stat-chip-red,
html:not([data-theme="dark"]) .stat-chip-red {
  background: #FEF2F2 !important;
  border-color: #FECACA !important;
  color: #991B1B !important;
}

/* ── العناوين والنصوص في المضيء ── */
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6,
html[data-theme="light"] .panel-header h2,
html:not([data-theme="dark"]) h1,
html:not([data-theme="dark"]) h2,
html:not([data-theme="dark"]) h3,
html:not([data-theme="dark"]) h4,
html:not([data-theme="dark"]) h5,
html:not([data-theme="dark"]) h6,
html:not([data-theme="dark"]) .panel-header h2 {
  color: #0F172A !important;
  font-weight: 800 !important;
}

html[data-theme="light"] p,
html[data-theme="light"] span:not(.material-symbols-outlined):not(.sidebar-badge):not(.status-dot):not(.sidebar-btn.active span),
html[data-theme="light"] label,
html[data-theme="light"] td,
html[data-theme="light"] th,
html[data-theme="light"] li,
html[data-theme="light"] strong,
html[data-theme="light"] b,
html:not([data-theme="dark"]) p,
html:not([data-theme="dark"]) span:not(.material-symbols-outlined):not(.sidebar-badge):not(.status-dot):not(.sidebar-btn.active span),
html:not([data-theme="dark"]) label,
html:not([data-theme="dark"]) td,
html:not([data-theme="dark"]) th,
html:not([data-theme="dark"]) li,
html:not([data-theme="dark"]) strong,
html:not([data-theme="dark"]) b {
  color: #1E293B !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .text-hint,
html[data-theme="light"] .color-hint,
html[data-theme="light"] .order-ph-time,
html[data-theme="light"] .report-label,
html[data-theme="light"] .order-ph-distance,
html:not([data-theme="dark"]) .text-hint,
html:not([data-theme="dark"]) .color-hint,
html:not([data-theme="dark"]) .order-ph-time,
html:not([data-theme="dark"]) .report-label,
html:not([data-theme="dark"]) .order-ph-distance {
  color: #64748B !important;
  font-weight: 500 !important;
}

/* ── بطاقات الطلبات (Order Cards) في المضيء ── */
html[data-theme="light"] .order-ph-card,
html:not([data-theme="dark"]) .order-ph-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  border-radius: 16px !important;
  color: #0F172A !important;
}

html[data-theme="light"] .order-ph-card:hover,
html:not([data-theme="dark"]) .order-ph-card:hover {
  border-color: #CBD5E1 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px);
}

html[data-theme="light"] .order-ph-patient,
html:not([data-theme="dark"]) .order-ph-patient {
  color: #0F172A !important;
  font-weight: 800 !important;
  font-size: 16px !important;
}

html[data-theme="light"] .order-ph-prescription,
html:not([data-theme="dark"]) .order-ph-prescription {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  color: #334155 !important;
  border-radius: 12px !important;
}

html[data-theme="light"] .order-ph-prescription::after,
html:not([data-theme="dark"]) .order-ph-prescription::after {
  background: linear-gradient(transparent, #F8FAFC) !important;
}

html[data-theme="light"] .order-ph-prescription-label,
html:not([data-theme="dark"]) .order-ph-prescription-label {
  color: #006C49 !important;
  font-weight: 700 !important;
}

/* ── بطاقات الإحصائيات (Stat & Report Cards) في المضيء ── */
html[data-theme="light"] .stat-card,
html[data-theme="light"] .report-card,
html:not([data-theme="dark"]) .stat-card,
html:not([data-theme="dark"]) .report-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  border-radius: 16px !important;
  color: #0F172A !important;
}

html[data-theme="light"] .stat-card h3,
html[data-theme="light"] .report-card .report-label,
html:not([data-theme="dark"]) .stat-card h3,
html:not([data-theme="dark"]) .report-card .report-label {
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .stat-card .stat-value,
html[data-theme="light"] .stat-card p.stat-value,
html[data-theme="light"] .report-card .report-value,
html:not([data-theme="dark"]) .stat-card .stat-value,
html:not([data-theme="dark"]) .stat-card p.stat-value,
html:not([data-theme="dark"]) .report-card .report-value {
  color: #006C49 !important;
  font-size: 32px !important;
  font-weight: 900 !important;
}

/* ── جدول المخزون في المضيء ── */
html[data-theme="light"] .inventory-table-wrapper,
html:not([data-theme="dark"]) .inventory-table-wrapper {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
  overflow: hidden !important;
}

html[data-theme="light"] .inventory-table th,
html:not([data-theme="dark"]) .inventory-table th {
  background: #F1F5F9 !important;
  color: #334155 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
  padding: 14px 16px !important;
}

html[data-theme="light"] .inventory-table td,
html:not([data-theme="dark"]) .inventory-table td {
  background: #FFFFFF !important;
  color: #0F172A !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-top: 1px solid #F1F5F9 !important;
  padding: 14px 16px !important;
}

html[data-theme="light"] .inventory-table tr:hover td,
html:not([data-theme="dark"]) .inventory-table tr:hover td {
  background: #F8FAFC !important;
}

/* ── حقول الإدخال والبحث في المضيء ── */
html[data-theme="light"] .input-field,
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html:not([data-theme="dark"]) .input-field,
html:not([data-theme="dark"]) input,
html:not([data-theme="dark"]) textarea,
html:not([data-theme="dark"]) select {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

html[data-theme="light"] .input-field:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html:not([data-theme="dark"]) .input-field:focus,
html:not([data-theme="dark"]) input:focus,
html:not([data-theme="dark"]) textarea:focus {
  border-color: #006C49 !important;
  box-shadow: 0 0 0 3px rgba(0, 108, 73, 0.15) !important;
}

html[data-theme="light"] .input-label,
html[data-theme="light"] label,
html:not([data-theme="dark"]) .input-label,
html:not([data-theme="dark"]) label {
  color: #1E293B !important;
  font-weight: 700 !important;
}

/* ── أزرار الفلاتر في المضيء ── */
html[data-theme="light"] .filter-btn,
html:not([data-theme="dark"]) .filter-btn {
  background: #FFFFFF !important;
  color: #475569 !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .filter-btn:hover,
html:not([data-theme="dark"]) .filter-btn:hover {
  background: #F1F5F9 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .filter-btn.active,
html:not([data-theme="dark"]) .filter-btn.active {
  background: #006C49 !important;
  color: #FFFFFF !important;
  border-color: #006C49 !important;
  box-shadow: 0 2px 8px rgba(0, 108, 73, 0.25) !important;
}

/* ── النوافذ المنبثقة في المضيء ── */
html[data-theme="light"] .modal,
html[data-theme="light"] .overlay .modal,
html[data-theme="light"] .order-detail-modal,
html:not([data-theme="dark"]) .modal,
html:not([data-theme="dark"]) .overlay .modal,
html:not([data-theme="dark"]) .order-detail-modal {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15) !important;
  border-radius: 20px !important;
}

html[data-theme="light"] .modal-header,
html:not([data-theme="dark"]) .modal-header {
  border-bottom: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .modal-footer,
html:not([data-theme="dark"]) .modal-footer {
  border-top: 1.5px solid #E2E8F0 !important;
}

/* ── الدردشة في المضيء ── */
html[data-theme="light"] .chat-layout,
html:not([data-theme="dark"]) .chat-layout {
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 16px !important;
  background: #FFFFFF !important;
}

html[data-theme="light"] .chat-list,
html:not([data-theme="dark"]) .chat-list {
  background: #F8FAFC !important;
  border-inline-end: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .chat-list-header,
html:not([data-theme="dark"]) .chat-list-header {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .chat-conversation-item,
html:not([data-theme="dark"]) .chat-conversation-item {
  color: #0F172A !important;
  border-bottom: 1px solid #E2E8F0 !important;
}

html[data-theme="light"] .chat-conversation-item:hover,
html:not([data-theme="dark"]) .chat-conversation-item:hover {
  background: #EDF2F7 !important;
}

html[data-theme="light"] .chat-conversation-item.active,
html:not([data-theme="dark"]) .chat-conversation-item.active {
  background: #ECFDF5 !important;
  border-inline-start: 3px solid #006C49 !important;
}

html[data-theme="light"] .chat-patient-name,
html:not([data-theme="dark"]) .chat-patient-name {
  color: #0F172A !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .chat-window,
html:not([data-theme="dark"]) .chat-window {
  background: #FFFFFF !important;
}

html[data-theme="light"] .chat-bubble.sent,
html:not([data-theme="dark"]) .chat-bubble.sent {
  background: #006C49 !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] .chat-bubble.received,
html:not([data-theme="dark"]) .chat-bubble.received {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border: 1px solid #E2E8F0 !important;
}

/* ── شاشة تسجيل الدخول في المضيء ── */
html[data-theme="light"] .pharmacy-auth,
html:not([data-theme="dark"]) .pharmacy-auth {
  background: radial-gradient(circle at top right, #E0F2FE 0%, #F0FDF4 50%, #F8FAFC 100%) !important;
}

html[data-theme="light"] .auth-card,
html:not([data-theme="dark"]) .auth-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .auth-card h2,
html:not([data-theme="dark"]) .auth-card h2 {
  color: #0F172A !important;
}


/* ════════════════════════════════════════════════════════════════
   🌙 2. الوضع المظلم الفائق (DARK PRO — 2026 WORLD CLASS)
   ════════════════════════════════════════════════════════════════ */

html[data-theme="dark"],
html[data-theme="dark"] body.pharmacy-body,
html[data-theme="dark"] .dashboard,
html[data-theme="dark"] .pharmacy-body {
  background: #0B0F19 !important;
  color: #F8FAFC !important;
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif !important;
}

/* ── الخلفية والمحتوى الرئيسي في الداكن ── */
html[data-theme="dark"] .dashboard-main,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .panel-header {
  background: #0B0F19 !important;
  color: #F8FAFC !important;
}

/* ── الشريط الجانبي في الداكن ── */
html[data-theme="dark"] .sidebar {
  background: #070A10 !important;
  border-inline-end: 1px solid #1E293B !important;
}

html[data-theme="dark"] .sidebar-brand .brand-name {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] .sidebar-brand .brand-sub {
  color: #94A3B8 !important;
}

/* أزرار الشريط الجانبي غير النشطة في الداكن (رمادي فاتح مقروء جداً) */
html[data-theme="dark"] .sidebar-btn,
html[data-theme="dark"] .sidebar-nav button,
html[data-theme="dark"] .sidebar-footer button,
html[data-theme="dark"] .sidebar-footer a {
  background: transparent !important;
  color: #94A3B8 !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  border-radius: 12px !important;
}

html[data-theme="dark"] .sidebar-btn span,
html[data-theme="dark"] .sidebar-btn .material-symbols-outlined,
html[data-theme="dark"] .sidebar-footer a span {
  color: #94A3B8 !important;
  font-weight: 600 !important;
}

/* عند تمرير الماوس على الأزرار في الداكن */
html[data-theme="dark"] .sidebar-btn:hover,
html[data-theme="dark"] .sidebar-footer a:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .sidebar-btn:hover span,
html[data-theme="dark"] .sidebar-btn:hover .material-symbols-outlined {
  color: #FFFFFF !important;
}

/* زر الشريط الجانبي النشط في الداكن */
html[data-theme="dark"] .sidebar-btn.active {
  background: linear-gradient(135deg, #006C49 0%, #10B981 100%) !important;
  color: #FFFFFF !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

html[data-theme="dark"] .sidebar-btn.active span,
html[data-theme="dark"] .sidebar-btn.active .material-symbols-outlined {
  color: #FFFFFF !important;
}

/* فوتر الشريط الجانبي في الداكن */
html[data-theme="dark"] .sidebar-footer {
  border-top: 1px solid #1E293B !important;
}

html[data-theme="dark"] .sidebar-status,
html[data-theme="dark"] #status-label {
  color: #CBD5E1 !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .logout-btn,
html[data-theme="dark"] .logout-btn span {
  color: #F87171 !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .logout-btn:hover {
  background: rgba(248, 113, 113, 0.15) !important;
  color: #FF8080 !important;
}

/* ── الهيدر العلوي في الداكن ── */
html[data-theme="dark"] .dashboard-header {
  background: #0F172A !important;
  border-bottom: 1px solid #1E293B !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .header-time {
  color: #94A3B8 !important;
}

/* ── رقاقات الإحصائيات في الداكن ── */
html[data-theme="dark"] .stat-chip {
  background: #1E293B !important;
  color: #F1F5F9 !important;
  border: 1px solid #334155 !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .stat-chip-green {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #34D89E !important;
}

html[data-theme="dark"] .stat-chip-blue {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #93C5FD !important;
}

html[data-theme="dark"] .stat-chip-red {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #FCA5A5 !important;
}

/* ── العناوين والنصوص في الداكن ── */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .panel-header h2 {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] span:not(.material-symbols-outlined):not(.sidebar-badge):not(.status-dot):not(.sidebar-btn.active span),
html[data-theme="dark"] label,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] li,
html[data-theme="dark"] strong,
html[data-theme="dark"] b {
  color: #E2E8F0 !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] .text-hint,
html[data-theme="dark"] .color-hint,
html[data-theme="dark"] .order-ph-time,
html[data-theme="dark"] .report-label,
html[data-theme="dark"] .order-ph-distance {
  color: #94A3B8 !important;
  font-weight: 500 !important;
}

/* ── بطاقات الطلبات في الداكن ── */
html[data-theme="dark"] .order-ph-card {
  background: #131D31 !important;
  border: 1px solid #1E293B !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
  border-radius: 16px !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .order-ph-card:hover {
  background: #18253E !important;
  border-color: rgba(52, 216, 158, 0.3) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55) !important;
  transform: translateY(-2px);
}

html[data-theme="dark"] .order-ph-patient {
  color: #FFFFFF !important;
  font-weight: 800 !important;
  font-size: 16px !important;
}

html[data-theme="dark"] .order-ph-prescription {
  background: #0B0F19 !important;
  border: 1px solid #1E293B !important;
  color: #CBD5E1 !important;
  border-radius: 12px !important;
}

html[data-theme="dark"] .order-ph-prescription::after {
  background: linear-gradient(transparent, #0B0F19) !important;
}

html[data-theme="dark"] .order-ph-prescription-label {
  color: #34D89E !important;
  font-weight: 700 !important;
}

/* ── بطاقات الإحصائيات في الداكن ── */
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .report-card {
  background: #131D31 !important;
  border: 1px solid #1E293B !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  border-radius: 16px !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .stat-card h3,
html[data-theme="dark"] .report-card .report-label {
  color: #94A3B8 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .stat-card .stat-value,
html[data-theme="dark"] .stat-card p.stat-value,
html[data-theme="dark"] .report-card .report-value {
  color: #34D89E !important;
  font-size: 32px !important;
  font-weight: 900 !important;
}

/* ── جدول المخزون في الداكن ── */
html[data-theme="dark"] .inventory-table-wrapper {
  background: #131D31 !important;
  border: 1px solid #1E293B !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden !important;
}

html[data-theme="dark"] .inventory-table th {
  background: #0F172A !important;
  color: #94A3B8 !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  border-bottom: 1px solid #1E293B !important;
  padding: 14px 16px !important;
}

html[data-theme="dark"] .inventory-table td {
  background: #131D31 !important;
  color: #F1F5F9 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  padding: 14px 16px !important;
}

html[data-theme="dark"] .inventory-table tr:hover td {
  background: #1A263D !important;
}

/* ── حقول الإدخال في الداكن ── */
html[data-theme="dark"] .input-field,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: #0F172A !important;
  color: #FFFFFF !important;
  border: 1.5px solid #334155 !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

html[data-theme="dark"] .input-field:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus {
  border-color: #10B981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

html[data-theme="dark"] .input-label,
html[data-theme="dark"] label {
  color: #CBD5E1 !important;
  font-weight: 700 !important;
}

/* ── أزرار الفلاتر في الداكن ── */
html[data-theme="dark"] .filter-btn {
  background: #1E293B !important;
  color: #94A3B8 !important;
  border: 1px solid #334155 !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .filter-btn:hover {
  background: #334155 !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .filter-btn.active {
  background: #006C49 !important;
  color: #FFFFFF !important;
  border-color: #10B981 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

/* ── النوافذ المنبثقة في الداكن ── */
html[data-theme="dark"] .modal,
html[data-theme="dark"] .overlay .modal,
html[data-theme="dark"] .order-detail-modal {
  background: #13241F !important;
  color: #FFFFFF !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8) !important;
  border-radius: 24px !important;
}

html[data-theme="dark"] .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ── هيكل وسكرول نافذة تفاصيل الطلب (Order Detail Modal Scroll & Layout) ── */
#order-detail-modal.hidden,
#order-detail-modal.overlay.hidden,
.overlay.hidden,
.modal.hidden {
  display: none !important;
}

#order-detail-modal.overlay:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  z-index: 10000 !important;
  touch-action: pan-y !important;
}

#order-detail-modal .modal.order-detail-modal {
  max-width: 580px !important;
  width: 100% !important;
  max-height: 88dvh !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  position: relative !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75) !important;
  animation: screenFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#order-detail-modal .modal-header {
  padding: 18px 24px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: inherit !important;
  z-index: 2 !important;
}

#order-detail-modal #order-modal-content.order-modal-content {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: contain !important;
  padding: 20px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  margin-bottom: 0 !important;
  scrollbar-width: thin !important;
}

#order-detail-modal .order-modal-actions {
  padding: 16px 24px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #13241F !important;
  z-index: 5 !important;
  position: sticky !important;
  bottom: 0 !important;
}

html[data-theme="light"] #order-detail-modal .order-modal-actions {
  background: #FFFFFF !important;
  border-top: 1px solid #E2E8F0 !important;
}

/* ── تباين عناصر نافذة الطلب في الوضع المظلم ── */
html[data-theme="dark"] #order-detail-modal .order-section-title {
  color: #34D89E !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] #order-detail-modal .order-patient-card,
html[data-theme="dark"] #order-detail-modal .order-products-card {
  background: #18253E !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] #order-detail-modal .patient-card-name {
  color: #FFFFFF !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] #order-detail-modal .patient-card-detail {
  color: #CBD5E1 !important;
  font-size: 13px !important;
}

html[data-theme="dark"] #order-detail-modal .order-medical-title {
  color: #F87171 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] #order-detail-modal .order-medical-card {
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1.5px solid rgba(239, 68, 68, 0.4) !important;
  border-radius: 14px !important;
  padding: 14px 16px !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] #order-detail-modal .medical-label {
  color: #FFFFFF !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] #order-detail-modal .medical-val {
  color: #F1F5F9 !important;
  font-weight: 600 !important;
}

html[data-theme="dark"] #order-detail-modal .medical-val.text-warn,
html[data-theme="dark"] #order-detail-modal .medical-val.text-disease {
  color: #FCA5A5 !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] #order-detail-modal .order-missing-data-alert {
  background: rgba(245, 158, 11, 0.18) !important;
  border: 1.5px solid #F59E0B !important;
  color: #FDE68A !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] #order-detail-modal .ocr-result-box {
  background: #0A1815 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.35) !important;
  color: #34D89E !important;
}

html[data-theme="dark"] #order-detail-modal #order-price-input {
  background: #0A1815 !important;
  color: #FFFFFF !important;
  border: 1.5px solid rgba(52, 216, 158, 0.4) !important;
}


/* ── الدردشة في الداكن ── */
html[data-theme="dark"] .chat-layout {
  border: 1px solid #1E293B !important;
  border-radius: 16px !important;
  background: #0B0F19 !important;
}

html[data-theme="dark"] .chat-list {
  background: #070A10 !important;
  border-inline-end: 1px solid #1E293B !important;
}

html[data-theme="dark"] .chat-list-header {
  background: #0F172A !important;
  color: #FFFFFF !important;
  border-bottom: 1px solid #1E293B !important;
}

html[data-theme="dark"] .chat-conversation-item {
  color: #E2E8F0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] .chat-conversation-item:hover {
  background: #131D31 !important;
}

html[data-theme="dark"] .chat-conversation-item.active {
  background: rgba(0, 108, 73, 0.3) !important;
  border-inline-start: 3px solid #10B981 !important;
}

html[data-theme="dark"] .chat-patient-name {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

html[data-theme="dark"] .chat-window {
  background: #0B0F19 !important;
}

html[data-theme="dark"] .chat-bubble.sent {
  background: #006C49 !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .chat-bubble.received {
  background: #1E293B !important;
  color: #FFFFFF !important;
}

/* ── شاشة تسجيل الدخول في الداكن ── */
html[data-theme="dark"] .pharmacy-auth {
  background: radial-gradient(circle at top right, #111C2E 0%, #070A10 100%) !important;
}

html[data-theme="dark"] .auth-card {
  background: #131D31 !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
  color: #FFFFFF !important;
}

html[data-theme="dark"] .auth-card h2 {
  color: #FFFFFF !important;
}

/* ════════════════════════════════════════════════════════════════
   ☀️ 3. Surgical Light Mode Fixes (Zero Contrast Conflicts)
   ════════════════════════════════════════════════════════════════ */
html[data-theme="light"] .otp-modal-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

html[data-theme="light"] .otp-modal-card h2,
html[data-theme="light"] #rep-total-orders,
html[data-theme="light"] #rep-all-orders,
html[data-theme="light"] .glass h3,
html[data-theme="light"] .glass-premier h3,
html[data-theme="light"] .card-3d-interactive h3 {
  color: #0F172A !important;
}

html[data-theme="light"] .otp-modal-card p {
  color: #475569 !important;
}

html[data-theme="light"] .otp-modal-card #otp-input {
  background: #F1F5F9 !important;
  color: #006C49 !important;
  -webkit-text-fill-color: #006C49 !important;
  border-color: #10B981 !important;
}

html[data-theme="light"] .otp-modal-card .btn-outline {
  color: #475569 !important;
  border-color: #CBD5E1 !important;
  background: #F8FAFC !important;
}

html[data-theme="light"] .glass,
html[data-theme="light"] .glass-premier,
html[data-theme="light"] .card-3d-interactive {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .input-field,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1 !important;
}

