/* ══════════════════════════════════════════════════════════════════
   DAWAEI ULTRA-LIGHT MATERIAL DESIGN 3 UNIFIED STYLESHEET (2026)
   High-performance, zero-blur, native 60fps mobile architecture
   ══════════════════════════════════════════════════════════════════ */

/* ── 0. Local Material Symbols & Fonts ── */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('../fonts/material-symbols-outlined.woff2') format('woff2');
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* ── 1. Clean MD3 Design Tokens (Dark Default & Light Mode) ── */
:root {
  --safe-top:             env(safe-area-inset-top, 0px);
  --safe-bottom:          env(safe-area-inset-bottom, 0px);

  /* Primary Dark MD3 Palette */
  --bg-primary:           #0D1311;
  --bg-surface:           #16211D;
  --bg-surface-elevated:  #1C2A25;
  --bg-input:             #1C2A25;
  --bg-page:              #0D1311;
  --bg-card:              #16211D;
  --bg-container:         #1C2A25;
  --bg-header:            #121C18;

  --accent-primary:       #10B981;
  --accent-secondary:     #00E599;
  --alert-amber:          #FFA94D;
  --status-error:         #F87171;

  --color-primary:        #10B981;
  --color-primary-light:  #00E599;
  --color-primary-dim:    #00E599;
  --color-primary-bg:     rgba(16, 185, 129, 0.12);

  --text-primary:         #FFFFFF;
  --text-secondary:       #94A3B8;
  --text-muted:           #A0AEC0;
  --text-hint:            #94A3B8;
  --text-main:            #FFFFFF;

  --border-color:         rgba(255, 255, 255, 0.10);
  --border-subtle:        rgba(255, 255, 255, 0.06);

  --shadow-card:          0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-modal:         0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-btn:           0 4px 14px rgba(16, 185, 129, 0.25);

  --font-body:            'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-headline:        'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Zero-blur solid surface equivalents */
  --glass-bg-light:       #16211D;
  --glass-bg-mid:         #16211D;
  --glass-bg-dark:        #121C18;
  --glass-border:         rgba(255, 255, 255, 0.10);
  --glass-border-mid:     rgba(16, 185, 129, 0.25);
  --glass-shadow:         0 4px 20px rgba(0, 0, 0, 0.4);

  --radius-sm:            8px;
  --radius-md:            14px;
  --radius-lg:            18px;
  --radius-xl:            24px;
  --radius-full:          9999px;
  --transition:           0.2s cubic-bezier(0.2, 0, 0, 1);
}

html[data-theme="light"] {
  --bg-primary:           #F8FAFC;
  --bg-surface:           #FFFFFF;
  --bg-surface-elevated:  #F1F5F9;
  --bg-input:             #F1F5F9;
  --bg-page:              #F8FAFC;
  --bg-card:              #FFFFFF;
  --bg-container:         #F1F5F9;
  --bg-header:            #FFFFFF;

  --accent-primary:       #10B981;
  --accent-secondary:     #059669;

  --color-primary:        #006c49;
  --color-primary-light:  #10B981;

  --text-primary:         #0F172A;
  --text-secondary:       #475569;
  --text-muted:           #64748B;
  --text-hint:            #64748B;
  --text-main:            #0F172A;

  --border-color:         #E2E8F0;
  --border-subtle:        #F1F5F9;

  --glass-bg-light:       #FFFFFF;
  --glass-bg-mid:         #FFFFFF;
  --glass-bg-dark:        #F8FAFC;
  --glass-border:         #E2E8F0;
  --glass-border-mid:     rgba(16, 185, 129, 0.3);
  --glass-shadow:         0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ── 2. Reset & Mobile Layout Optimization ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  overscroll-behavior-y: none !important;
  background-color: var(--bg-page) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}

button, a, .nav-btn, .btn, .chip, .card {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent !important;
}

input, textarea, select {
  user-select: text;
  -webkit-user-select: text;
  font-family: inherit;
  font-size: 15px !important;
}

/* ── 3. Clean Surfaces & Cards (No Blur, High FPS) ── */
.glass-card,
.search-card,
.prescription-card,
.feature-card,
.auth-form,
.modal,
.order-card-v4,
.chat-bubble,
.message-input-container {
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--text-primary) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ── 4. Bottom Nav MD3 Native Styling ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-header) !important;
  border-top: 1px solid var(--border-color) !important;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.bottom-nav .nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary) !important;
  cursor: pointer;
  padding: 6px 0;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}

.bottom-nav .nav-btn .material-symbols-outlined {
  font-size: 24px;
  transition: transform 0.2s ease;
}

.bottom-nav .nav-btn .nav-label {
  font-size: 11.5px;
  font-weight: 700;
}

/* MD3 Active Pill Indicator */
.bottom-nav .nav-btn.active {
  color: var(--accent-primary) !important;
}

.bottom-nav .nav-btn.active .material-symbols-outlined {
  transform: scale(1.1);
  color: var(--accent-primary) !important;
}

/* Central Floating FAB Button */
.bottom-nav .nav-btn.upload-fab {
  transform: translateY(-14px);
}

.bottom-nav .nav-btn.upload-fab > div {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #10B981, #059669) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
}

.bottom-nav .nav-btn.upload-fab .material-symbols-outlined {
  color: #FFFFFF !important;
  font-size: 28px;
}

/* ── 5. MD3 Input Fields & Search Bar ── */
.input-field, .search-input {
  background: var(--bg-input) !important;
  border: 1.5px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.input-field:focus, .search-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.input-field::placeholder, .search-input::placeholder {
  color: var(--text-secondary) !important;
  opacity: 0.7;
}

/* ── 6. MD3 Filter Chips (Horizontal Scroll) ── */
.category-chips, .filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px 12px 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-chips::-webkit-scrollbar, .filter-chips::-webkit-scrollbar {
  display: none;
}

.filter-chip, .category-chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.filter-chip.active, .category-chip.active {
  background: var(--accent-primary) !important;
  color: #FFFFFF !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3) !important;
}

/* ── 7. Clean Bottom Sheets & Modals ── */
.overlay, .modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75) !important;
  z-index: 99999;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: flex;
  align-items: flex-end; /* Bottom sheet align by default on mobile */
  justify-content: center;
}

@media (min-width: 640px) {
  .overlay, .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet, .verified-order-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface) !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: 24px 24px 0 0 !important;
  padding: 20px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slideUpSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .modal-sheet, .verified-order-card {
    border-radius: var(--radius-xl) !important;
  }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── 8. Utility & Helpers ── */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.2s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── 9. High-Contrast Direction Button & Card Typography (WCAG AAA) ── */
.luxury-direction-btn,
.med-btn-directions,
.map-btn,
[id^="directions-btn-"] {
  background: #FFA94D !important;
  color: #0A1F1A !important;
  border: 1.5px solid #FF922B !important;
  border-radius: 10px !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-weight: 800 !important;
  font-size: 12.5px !important;
  padding: 6px 14px !important;
  height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  text-decoration: none !important;
  box-shadow: 0 3px 12px rgba(255, 169, 77, 0.35) !important;
  transition: transform 0.15s ease, background 0.15s ease !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.luxury-direction-btn *,
.med-btn-directions *,
.map-btn *,
[id^="directions-btn-"] * {
  color: #0A1F1A !important;
  font-weight: 800 !important;
}

.luxury-direction-btn:active,
.med-btn-directions:active,
.map-btn:active,
[id^="directions-btn-"]:active {
  transform: scale(0.96) !important;
  background: #FF922B !important;
}

.luxury-direction-btn:hover,
.med-btn-directions:hover,
.map-btn:hover,
[id^="directions-btn-"]:hover {
  background: #FF922B !important;
  color: #000000 !important;
}

/* 🌙/☀️ Card Text & Contrast Enhancement */
.pharmacy-card strong,
.popular-card .med-title,
.luxury-offer-card .med-title-text,
.order-card-v4 .order-title {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

.pharmacy-card p,
.popular-card .med-desc,
.luxury-offer-card .med-sub-text {
  color: #CBD5E1 !important;
}

.badge-open, [data-open="true"] {
  color: #00E599 !important;
  background: rgba(0, 229, 153, 0.15) !important;
  border: 1px solid rgba(0, 229, 153, 0.35) !important;
}

.badge-closed, [data-open="false"] {
  color: #F87171 !important;
  background: rgba(248, 113, 113, 0.15) !important;
  border: 1px solid rgba(248, 113, 113, 0.35) !important;
}

.med-price-display {
  color: #10B981 !important;
  font-weight: 900 !important;
}

/* ── 10. Comprehensive Light Mode Overrides (Patient & AI Chat) ── */
html[data-theme="light"],
body.light-theme,
body.theme-light {
  background-color: #F8FAFC !important;
  color: #0F172A !important;
}

html[data-theme="light"] .pharmacy-card,
html[data-theme="light"] .popular-card,
html[data-theme="light"] .luxury-offer-card,
html[data-theme="light"] .order-card-v4,
html[data-theme="light"] .glass-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .profile-menu,
html[data-theme="light"] .user-card,
html[data-theme="light"] .wallet-referral-card,
html[data-theme="light"] .verified-order-card,
html[data-theme="light"] .patient-otp-card,
html[data-theme="light"] .modal {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .pharmacy-card strong,
html[data-theme="light"] .popular-card .med-title,
html[data-theme="light"] .luxury-offer-card .med-title-text,
html[data-theme="light"] .order-card-v4 .order-title,
html[data-theme="light"] .verified-order-card h3,
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 {
  color: #0F172A !important;
}

html[data-theme="light"] .pharmacy-card p,
html[data-theme="light"] .popular-card .med-desc,
html[data-theme="light"] .luxury-offer-card .med-sub-text,
html[data-theme="light"] .text-secondary,
html[data-theme="light"] .color-hint,
html[data-theme="light"] .verified-order-card p,
html[data-theme="light"] .verified-order-card label {
  color: #475569 !important;
}

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

html[data-theme="light"] .bottom-nav {
  background: #FFFFFF !important;
  border-top-color: #E2E8F0 !important;
}

html[data-theme="light"] .bottom-nav .nav-btn {
  color: #64748B !important;
}

html[data-theme="light"] .bottom-nav .nav-btn.active {
  color: #006c49 !important;
}

/* 🤖 AI Chat & Bot Messaging in Light Mode */
html[data-theme="light"] #screen-ai,
html[data-theme="light"] #ai-chat-inline-section,
html[data-theme="light"] #ai-chat-messages {
  background: #F8FAFC !important;
}

html[data-theme="light"] .track-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .track-header h3 {
  color: #0F172A !important;
}

html[data-theme="light"] .chat-start-notice {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .chat-start-notice h4,
html[data-theme="light"] .chat-start-notice p {
  color: #0F172A !important;
}

html[data-theme="light"] .ai-bot-bubble {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .ai-bot-bubble strong,
html[data-theme="light"] .ai-reply-content,
html[data-theme="light"] .ai-reply-content * {
  color: #0F172A !important;
}

html[data-theme="light"] .ai-bot-disclaimer {
  background: #FFF1F2 !important;
  border: 1px solid #FECDD3 !important;
  color: #9F1239 !important;
}

html[data-theme="light"] .ai-bot-disclaimer * {
  color: #9F1239 !important;
}

html[data-theme="light"] #ai-chat-input-container {
  background: #FFFFFF !important;
  border-top: 1px solid #E2E8F0 !important;
}

html[data-theme="light"] #ai-chat-input {
  background: #F1F5F9 !important;
  color: #0F172A !important;
  border-color: #CBD5E1 !important;
}

/* ── 11. Profile Settings, Bot Chat & Pharmacy Ordering Contrast Engine (WCAG AAA) ── */

/* ── A. Buttons & CTAs: Always High-Contrast Pure White Text ── */
.btn-primary,
button.btn-primary,
.verified-order-trigger-btn,
button.verified-order-trigger-btn,
.btn-confirm-order,
button.btn-confirm-order,
#save-reminder-action-btn,
#confirm-order-action-btn,
#save-edit-profile-btn,
#ai-chat-send-btn {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  color: #FFFFFF !important;
  border: none !important;
}

.btn-primary *,
.verified-order-trigger-btn *,
.btn-confirm-order *,
#save-edit-profile-btn * {
  color: #FFFFFF !important;
  font-weight: 800 !important;
}

/* ── B. Dark Mode Architecture (OLED / Deep Midnight Emerald) ── */
html:not([data-theme="light"]) .pharmacy-card,
html[data-theme="dark"] .pharmacy-card,
body.dark-theme .pharmacy-card {
  background: #16211D !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

html:not([data-theme="light"]) .pharmacy-card strong,
html[data-theme="dark"] .pharmacy-card strong,
body.dark-theme .pharmacy-card strong {
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .pharmacy-card p,
html[data-theme="dark"] .pharmacy-card p,
body.dark-theme .pharmacy-card p {
  color: #CBD5E1 !important;
}

/* Verified Order Modal Dark */
html:not([data-theme="light"]) .verified-order-card,
html[data-theme="dark"] .verified-order-card,
body.dark-theme .verified-order-card {
  background: #0F1F1B !important;
  border: 1.5px solid rgba(52, 216, 158, 0.35) !important;
  color: #FFFFFF !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
}

html:not([data-theme="light"]) .verified-order-card h3,
html[data-theme="dark"] .verified-order-card h3,
body.dark-theme .verified-order-card h3 {
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .verified-order-card label,
html[data-theme="dark"] .verified-order-card label,
body.dark-theme .verified-order-card label {
  color: #CBD5E1 !important;
  font-weight: 800 !important;
}

html:not([data-theme="light"]) #verified-order-medicines-input,
html[data-theme="dark"] #verified-order-medicines-input,
body.dark-theme #verified-order-medicines-input {
  background: #0A1815 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) #order-confirm-text,
html[data-theme="dark"] #order-confirm-text,
body.dark-theme #order-confirm-text {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1px solid rgba(52, 216, 158, 0.25) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .order-patient-box,
html[data-theme="dark"] .order-patient-box,
body.dark-theme .order-patient-box {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #FFFFFF !important;
}

/* Settings Sheet & Profile Dark */
html:not([data-theme="light"]) .profile-settings-sheet,
html[data-theme="dark"] .profile-settings-sheet,
body.dark-theme .profile-settings-sheet {
  background: #0F1F1B !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .settings-header,
html[data-theme="dark"] .settings-header,
body.dark-theme .settings-header {
  background: #142E26 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html:not([data-theme="light"]) .settings-title,
html[data-theme="dark"] .settings-title,
body.dark-theme .settings-title {
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .settings-sub,
html[data-theme="dark"] .settings-sub,
body.dark-theme .settings-sub {
  color: #34D89E !important;
}

html:not([data-theme="light"]) .settings-close-btn,
html[data-theme="dark"] .settings-close-btn,
body.dark-theme .settings-close-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .settings-card-block,
html[data-theme="dark"] .settings-card-block,
body.dark-theme .settings-card-block {
  background: #13241F !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
}

html:not([data-theme="light"]) .settings-card-title,
html[data-theme="dark"] .settings-card-title,
body.dark-theme .settings-card-title {
  color: #34D89E !important;
}

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

html:not([data-theme="light"]) .settings-input,
html[data-theme="dark"] .settings-input,
body.dark-theme .settings-input {
  background: #0A1815 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .disease-pill-label,
html[data-theme="dark"] .disease-pill-label,
body.dark-theme .disease-pill-label {
  background: #0A1815 !important;
  color: #FFFFFF !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
}

html:not([data-theme="light"]) .settings-inner-box,
html[data-theme="dark"] .settings-inner-box,
body.dark-theme .settings-inner-box {
  background: #0A1815 !important;
  border: 1px solid rgba(52, 216, 158, 0.25) !important;
}

html:not([data-theme="light"]) .settings-footer,
html[data-theme="dark"] .settings-footer,
body.dark-theme .settings-footer {
  background: #142E26 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html:not([data-theme="light"]) .settings-cancel-btn,
html[data-theme="dark"] .settings-cancel-btn,
body.dark-theme .settings-cancel-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .user-card,
html[data-theme="dark"] .user-card,
body.dark-theme .user-card,
html:not([data-theme="light"]) .stat-card,
html[data-theme="dark"] .stat-card,
body.dark-theme .stat-card,
html:not([data-theme="light"]) .profile-menu,
html[data-theme="dark"] .profile-menu,
body.dark-theme .profile-menu {
  background: #16211D !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
}

html:not([data-theme="light"]) #profile-name,
html[data-theme="dark"] #profile-name,
body.dark-theme #profile-name {
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) #profile-email,
html[data-theme="dark"] #profile-email,
body.dark-theme #profile-email {
  color: #CBD5E1 !important;
}

html:not([data-theme="light"]) .profile-menu-item span,
html[data-theme="dark"] .profile-menu-item span,
body.dark-theme .profile-menu-item span {
  color: #FFFFFF !important;
}

/* Bot Chat Dark */
html:not([data-theme="light"]) .ai-header,
html[data-theme="dark"] .ai-header,
body.dark-theme .ai-header {
  background: #142E26 !important;
  border-bottom: 1.5px solid rgba(52, 216, 158, 0.2) !important;
}

html:not([data-theme="light"]) .ai-header-title,
html[data-theme="dark"] .ai-header-title,
body.dark-theme .ai-header-title {
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .ai-header-badge,
html[data-theme="dark"] .ai-header-badge,
body.dark-theme .ai-header-badge {
  background: rgba(52, 216, 158, 0.14) !important;
  color: #34D89E !important;
}

html:not([data-theme="light"]) .ai-header-status,
html[data-theme="dark"] .ai-header-status,
body.dark-theme .ai-header-status {
  color: #34D89E !important;
}

html:not([data-theme="light"]) .ai-chat-section,
html[data-theme="dark"] .ai-chat-section,
body.dark-theme .ai-chat-section,
html:not([data-theme="light"]) .ai-messages-container,
html[data-theme="dark"] .ai-messages-container,
body.dark-theme .ai-messages-container {
  background: #0B1713 !important;
}

html:not([data-theme="light"]) .ai-start-card,
html[data-theme="dark"] .ai-start-card,
body.dark-theme .ai-start-card {
  background: #142E26 !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
}

html:not([data-theme="light"]) .ai-start-title,
html[data-theme="dark"] .ai-start-title,
body.dark-theme .ai-start-title {
  color: #34D89E !important;
}

html:not([data-theme="light"]) .ai-start-desc,
html[data-theme="dark"] .ai-start-desc,
body.dark-theme .ai-start-desc {
  color: #CBD5E1 !important;
}

html:not([data-theme="light"]) .ai-bot-bubble,
html[data-theme="dark"] .ai-bot-bubble,
body.dark-theme .ai-bot-bubble {
  background: #16211D !important;
  border: 1px solid rgba(52, 216, 158, 0.25) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

html:not([data-theme="light"]) .ai-bot-bubble .ai-reply-content,
html[data-theme="dark"] .ai-bot-bubble .ai-reply-content,
body.dark-theme .ai-bot-bubble .ai-reply-content {
  color: #F1F5F9 !important;
}

html:not([data-theme="light"]) .ai-input-bar,
html[data-theme="dark"] .ai-input-bar,
body.dark-theme .ai-input-bar {
  background: #142E26 !important;
  border-top: 1.5px solid rgba(52, 216, 158, 0.25) !important;
}

html:not([data-theme="light"]) .ai-text-input,
html[data-theme="dark"] .ai-text-input,
body.dark-theme .ai-text-input {
  background: #0A1815 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.35) !important;
  color: #FFFFFF !important;
}

/* ── C. Light Mode Architecture (Clean Crisp Off-White WCAG AAA) ── */
html[data-theme="light"] .pharmacy-card,
body.light-theme .pharmacy-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .pharmacy-card strong,
body.light-theme .pharmacy-card strong {
  color: #0F172A !important;
}

html[data-theme="light"] .pharmacy-card p,
body.light-theme .pharmacy-card p {
  color: #334155 !important;
}

/* Verified Order Modal Light */
html[data-theme="light"] .verified-order-card,
body.light-theme .verified-order-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="light"] .verified-order-card h3,
body.light-theme .verified-order-card h3 {
  color: #0F172A !important;
}

html[data-theme="light"] .verified-order-card label,
body.light-theme .verified-order-card label {
  color: #1E293B !important;
  font-weight: 800 !important;
}

html[data-theme="light"] #verified-order-medicines-input,
body.light-theme #verified-order-medicines-input {
  background: #F8FAFC !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] #order-confirm-text,
body.light-theme #order-confirm-text {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .order-patient-box,
body.light-theme .order-patient-box {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .order-patient-box label,
body.light-theme .order-patient-box label {
  color: #1E293B !important;
  font-weight: 800 !important;
}

/* Settings Sheet & Profile Light */
html[data-theme="light"] .profile-settings-sheet,
body.light-theme .profile-settings-sheet {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .settings-header,
body.light-theme .settings-header {
  background: #F8FAFC !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .settings-title,
body.light-theme .settings-title {
  color: #0F172A !important;
}

html[data-theme="light"] .settings-sub,
body.light-theme .settings-sub {
  color: #059669 !important;
}

html[data-theme="light"] .settings-close-btn,
body.light-theme .settings-close-btn {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .settings-card-block,
body.light-theme .settings-card-block {
  background: #F8FAFC !important;
  border: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .settings-card-title,
body.light-theme .settings-card-title {
  color: #006c49 !important;
}

html[data-theme="light"] .settings-label,
body.light-theme .settings-label {
  color: #1E293B !important;
  font-weight: 800 !important;
}

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

html[data-theme="light"] .disease-pill-label,
body.light-theme .disease-pill-label {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1.5px solid #CBD5E1 !important;
}

html[data-theme="light"] .settings-inner-box,
body.light-theme .settings-inner-box {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
}

html[data-theme="light"] .settings-footer,
body.light-theme .settings-footer {
  background: #F8FAFC !important;
  border-top: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .settings-cancel-btn,
body.light-theme .settings-cancel-btn {
  background: #E2E8F0 !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .user-card,
body.light-theme .user-card,
html[data-theme="light"] .stat-card,
body.light-theme .stat-card,
html[data-theme="light"] .profile-menu,
body.light-theme .profile-menu {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] #profile-name,
body.light-theme #profile-name {
  color: #0F172A !important;
}

html[data-theme="light"] #profile-email,
body.light-theme #profile-email {
  color: #334155 !important;
}

html[data-theme="light"] .profile-menu-item span,
body.light-theme .profile-menu-item span {
  color: #0F172A !important;
}

/* Bot Chat Light */
html[data-theme="light"] .ai-header,
body.light-theme .ai-header {
  background: #FFFFFF !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .ai-header-title,
body.light-theme .ai-header-title {
  color: #0F172A !important;
}

html[data-theme="light"] .ai-header-badge,
body.light-theme .ai-header-badge {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #006c49 !important;
}

html[data-theme="light"] .ai-header-status,
body.light-theme .ai-header-status {
  color: #059669 !important;
}

html[data-theme="light"] .ai-chat-section,
body.light-theme .ai-chat-section,
html[data-theme="light"] .ai-messages-container,
body.light-theme .ai-messages-container {
  background: #F8FAFC !important;
}

html[data-theme="light"] .ai-start-card,
body.light-theme .ai-start-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .ai-start-title,
body.light-theme .ai-start-title {
  color: #006c49 !important;
}

html[data-theme="light"] .ai-start-desc,
body.light-theme .ai-start-desc {
  color: #334155 !important;
}

html[data-theme="light"] .ai-bot-bubble,
body.light-theme .ai-bot-bubble {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .ai-bot-bubble .ai-reply-content,
body.light-theme .ai-bot-bubble .ai-reply-content {
  color: #0F172A !important;
}

html[data-theme="light"] .ai-input-bar,
body.light-theme .ai-input-bar {
  background: #FFFFFF !important;
  border-top: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .ai-text-input,
body.light-theme .ai-text-input {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}

/* ── Verified Order Modal Classes ── */
[data-theme="light"] .verified-order-card,
body.light-theme .verified-order-card {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
  color: #0F172A !important;
}
[data-theme="light"] .verified-order-title,
body.light-theme .verified-order-title { color: #0F172A !important; }
[data-theme="light"] .verified-order-ph-name,
body.light-theme .verified-order-ph-name { color: #006c49 !important; }
[data-theme="light"] .verified-order-notice-box,
body.light-theme .verified-order-notice-box {
  background: #F1F5F9 !important;
  border: 1.5px dashed #CBD5E1 !important;
}
[data-theme="light"] .verified-order-notice-text,
body.light-theme .verified-order-notice-text { color: #1E293B !important; }
[data-theme="light"] .verified-order-input-label,
body.light-theme .verified-order-input-label { color: #0F172A !important; }
[data-theme="light"] .verified-order-textarea,
body.light-theme .verified-order-textarea {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}
[data-theme="light"] .verified-order-pickup-box,
body.light-theme .verified-order-pickup-box {
  background: #F8FAFC !important;
  border: 1.5px solid #E2E8F0 !important;
}
[data-theme="light"] .verified-order-pickup-title,
body.light-theme .verified-order-pickup-title { color: #0F172A !important; }
[data-theme="light"] .verified-order-pickup-desc,
body.light-theme .verified-order-pickup-desc { color: #475569 !important; }

[data-theme="dark"] .verified-order-card,
body.dark-theme .verified-order-card {
  background: #16211D !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .verified-order-title,
body.dark-theme .verified-order-title { color: #FFFFFF !important; }
[data-theme="dark"] .verified-order-ph-name,
body.dark-theme .verified-order-ph-name { color: #34D89E !important; }
[data-theme="dark"] .verified-order-notice-box,
body.dark-theme .verified-order-notice-box {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1.5px dashed rgba(52, 216, 158, 0.3) !important;
}
[data-theme="dark"] .verified-order-notice-text,
body.dark-theme .verified-order-notice-text { color: #FFFFFF !important; }
[data-theme="dark"] .verified-order-input-label,
body.dark-theme .verified-order-input-label { color: #CBD5E1 !important; }
[data-theme="dark"] .verified-order-textarea,
body.dark-theme .verified-order-textarea {
  background: #0A1815 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.35) !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .verified-order-pickup-box,
body.dark-theme .verified-order-pickup-box {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
}
[data-theme="dark"] .verified-order-pickup-title,
body.dark-theme .verified-order-pickup-title { color: #FFFFFF !important; }
[data-theme="dark"] .verified-order-pickup-desc,
body.dark-theme .verified-order-pickup-desc { color: #94A3B8 !important; }

/* ── Pharmacy Chat Modal Classes ── */
[data-theme="light"] .chat-modal-sheet,
body.light-theme .chat-modal-sheet {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12) !important;
}
[data-theme="light"] .chat-header-bar,
body.light-theme .chat-header-bar {
  background: #F8FAFC !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
}
[data-theme="light"] .chat-title-text,
body.light-theme .chat-title-text { color: #0F172A !important; }
[data-theme="light"] .chat-close-btn,
body.light-theme .chat-close-btn {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}
[data-theme="light"] .chat-messages-body,
body.light-theme .chat-messages-body { background: #F8FAFC !important; }
[data-theme="light"] .chat-start-notice-card,
body.light-theme .chat-start-notice-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #334155 !important;
}
[data-theme="light"] .chat-input-bar,
body.light-theme .chat-input-bar {
  background: #FFFFFF !important;
  border-top: 1.5px solid #E2E8F0 !important;
}
[data-theme="light"] .chat-input-field,
body.light-theme .chat-input-field {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}
[data-theme="light"] .patient-chat-bubble-ph,
body.light-theme .patient-chat-bubble-ph {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
}

[data-theme="dark"] .chat-modal-sheet,
body.dark-theme .chat-modal-sheet {
  background: #0F1F1B !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7) !important;
}
[data-theme="dark"] .chat-header-bar,
body.dark-theme .chat-header-bar {
  background: #142E26 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .chat-title-text,
body.dark-theme .chat-title-text { color: #FFFFFF !important; }
[data-theme="dark"] .chat-close-btn,
body.dark-theme .chat-close-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .chat-messages-body,
body.dark-theme .chat-messages-body { background: #0B1713 !important; }
[data-theme="dark"] .chat-start-notice-card,
body.dark-theme .chat-start-notice-card {
  background: #142E26 !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
  color: #CBD5E1 !important;
}
[data-theme="dark"] .chat-input-bar,
body.dark-theme .chat-input-bar {
  background: #142E26 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
[data-theme="dark"] .chat-input-field,
body.dark-theme .chat-input-field {
  background: #0A1815 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  color: #FFFFFF !important;
}
[data-theme="dark"] .patient-chat-bubble-ph,
body.dark-theme .patient-chat-bubble-ph {
  background: #16211D !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
  color: #FFFFFF !important;
}

/* ── Ultra-Visible Inputs Architecture (فتحة النص عالية التباين والوضوح) ── */
html:not([data-theme="light"]) .input-field,
html:not([data-theme="light"]) .search-input,
html:not([data-theme="light"]) textarea,
html:not([data-theme="light"]) input[type="text"],
html:not([data-theme="light"]) input[type="search"],
html:not([data-theme="light"]) input[type="tel"],
html:not([data-theme="light"]) input[type="email"],
html:not([data-theme="light"]) input[type="password"],
html:not([data-theme="light"]) input[type="number"],
[data-theme="dark"] .input-field,
[data-theme="dark"] .search-input,
[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
body.dark-theme .input-field,
body.dark-theme .search-input,
body.dark-theme textarea {
  background: #0B1713 !important;
  background-color: #0B1713 !important;
  border: 1.5px solid rgba(0, 229, 153, 0.45) !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border-radius: 12px !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 229, 153, 0.12) !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  outline: none !important;
}

html:not([data-theme="light"]) .input-field:focus,
html:not([data-theme="light"]) .search-input:focus,
html:not([data-theme="light"]) textarea:focus,
[data-theme="dark"] .input-field:focus,
[data-theme="dark"] .search-input:focus,
[data-theme="dark"] textarea:focus {
  background: #0F231D !important;
  border-color: #00E599 !important;
  box-shadow: 0 0 0 3px rgba(0, 229, 153, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

html:not([data-theme="light"]) .input-field::placeholder,
html:not([data-theme="light"]) .search-input::placeholder,
html:not([data-theme="light"]) textarea::placeholder,
[data-theme="dark"] .input-field::placeholder,
[data-theme="dark"] .search-input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #8EBDB1 !important;
  -webkit-text-fill-color: #8EBDB1 !important;
  opacity: 0.95 !important;
  font-weight: 500 !important;
}

html[data-theme="light"] .input-field,
html[data-theme="light"] .search-input,
html[data-theme="light"] textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
body.light-theme .input-field,
body.light-theme .search-input,
body.light-theme textarea {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  border: 1.5px solid #94A3B8 !important;
  color: #0F172A !important;
  -webkit-text-fill-color: #0F172A !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), inset 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  outline: none !important;
}

html[data-theme="light"] .input-field:focus,
html[data-theme="light"] .search-input:focus,
html[data-theme="light"] textarea:focus,
body.light-theme .input-field:focus,
body.light-theme .search-input:focus,
body.light-theme textarea:focus {
  background: #FFFFFF !important;
  border-color: #10B981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .input-field::placeholder,
html[data-theme="light"] .search-input::placeholder,
html[data-theme="light"] textarea::placeholder,
body.light-theme .input-field::placeholder,
body.light-theme .search-input::placeholder,
body.light-theme textarea::placeholder {
  color: #64748B !important;
  -webkit-text-fill-color: #64748B !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

/* ══════════════════════════════════════════════════════════════════
   12. Verified Pharmacy Order ("طلب دواء موثّق 🌿") - Click & Collect
   ══════════════════════════════════════════════════════════════════ */
/* Dark Theme (Default) */
html:not([data-theme="light"]) .verified-order-card,
[data-theme="dark"] .verified-order-card,
body.dark-theme .verified-order-card {
  background: #16211D !important;
  border: 1.5px solid rgba(52, 216, 158, 0.35) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .verified-order-title,
[data-theme="dark"] .verified-order-title,
body.dark-theme .verified-order-title {
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .verified-order-input-label,
[data-theme="dark"] .verified-order-input-label,
body.dark-theme .verified-order-input-label {
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .verified-order-summary-card,
[data-theme="dark"] .verified-order-summary-card,
body.dark-theme .verified-order-summary-card {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
  color: #FFFFFF !important;
}

html:not([data-theme="light"]) .verified-pickup-option.active,
[data-theme="dark"] .verified-pickup-option.active,
body.dark-theme .verified-pickup-option.active {
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1.5px solid #10B981 !important;
}

html:not([data-theme="light"]) .verified-delivery-option.disabled,
[data-theme="dark"] .verified-delivery-option.disabled,
body.dark-theme .verified-delivery-option.disabled {
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1.5px dashed rgba(255, 255, 255, 0.15) !important;
  opacity: 0.55 !important;
}

html:not([data-theme="light"]) .verified-quick-chips .verified-chip,
[data-theme="dark"] .verified-quick-chips .verified-chip,
body.dark-theme .verified-quick-chips .verified-chip {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #CBD5E1 !important;
}

html:not([data-theme="light"]) .verified-quick-chips .verified-chip:active,
html:not([data-theme="light"]) .verified-quick-chips .verified-chip:hover,
[data-theme="dark"] .verified-quick-chips .verified-chip:active,
[data-theme="dark"] .verified-quick-chips .verified-chip:hover {
  border-color: #00E599 !important;
  color: #00E599 !important;
  background: rgba(0, 229, 153, 0.1) !important;
}

html:not([data-theme="light"]) .verified-order-rx-shortcut-btn,
[data-theme="dark"] .verified-order-rx-shortcut-btn,
body.dark-theme .verified-order-rx-shortcut-btn {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1.5px dashed rgba(16, 185, 129, 0.4) !important;
  color: #10B981 !important;
}

html:not([data-theme="light"]) .verified-order-autocomplete-box,
[data-theme="dark"] .verified-order-autocomplete-box,
body.dark-theme .verified-order-autocomplete-box {
  background: #0B1713 !important;
  border: 1.5px solid #10B981 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

html:not([data-theme="light"]) .verified-order-discard-dialog,
[data-theme="dark"] .verified-order-discard-dialog,
body.dark-theme .verified-order-discard-dialog {
  background: rgba(10, 20, 16, 0.95) !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
}

/* Light Theme Overrides */
html[data-theme="light"] .verified-order-card,
body.light-theme .verified-order-card {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.12) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .verified-order-title,
body.light-theme .verified-order-title {
  color: #0F172A !important;
}

html[data-theme="light"] .verified-order-ph-name,
body.light-theme .verified-order-ph-name {
  color: #006c49 !important;
}

html[data-theme="light"] .verified-order-input-label,
body.light-theme .verified-order-input-label {
  color: #0F172A !important;
}

html[data-theme="light"] .verified-order-summary-card,
body.light-theme .verified-order-summary-card {
  background: #F8FAFC !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .verified-pickup-option.active,
body.light-theme .verified-pickup-option.active {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1.5px solid #059669 !important;
}

html[data-theme="light"] .verified-delivery-option.disabled,
body.light-theme .verified-delivery-option.disabled {
  background: #F1F5F9 !important;
  border: 1.5px dashed #CBD5E1 !important;
  opacity: 0.6 !important;
}

html[data-theme="light"] .verified-quick-chips .verified-chip,
body.light-theme .verified-quick-chips .verified-chip {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .verified-quick-chips .verified-chip:active,
html[data-theme="light"] .verified-quick-chips .verified-chip:hover,
body.light-theme .verified-quick-chips .verified-chip:active,
body.light-theme .verified-quick-chips .verified-chip:hover {
  border-color: #059669 !important;
  color: #059669 !important;
  background: #ECFDF5 !important;
}

html[data-theme="light"] .verified-order-rx-shortcut-btn,
body.light-theme .verified-order-rx-shortcut-btn {
  background: #F0FDF4 !important;
  border: 1.5px dashed #10B981 !important;
  color: #059669 !important;
}

html[data-theme="light"] .verified-order-autocomplete-box,
body.light-theme .verified-order-autocomplete-box {
  background: #FFFFFF !important;
  border: 1.5px solid #10B981 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="light"] .verified-order-discard-dialog,
body.light-theme .verified-order-discard-dialog {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1.5px solid #CBD5E1 !important;
}

html[data-theme="light"] .verified-discard-title,
body.light-theme .verified-discard-title {
  color: #0F172A !important;
}

html[data-theme="light"] .verified-discard-desc,
body.light-theme .verified-discard-desc {
  color: #475569 !important;
}

/* ── Dawaei Loyalty Wallet & VIP Gold Card (Dark Default) ── */
.wallet-gold-card {
  background: linear-gradient(135deg, #241A08 0%, #141004 50%, #1A241C 100%) !important;
  border: 1.5px solid rgba(255, 169, 77, 0.45) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
}
.wallet-gold-card .card-badge-vip {
  color: #FDE68A !important;
}
.wallet-gold-card .points-label {
  color: #CBD5E1 !important;
}
.wallet-gold-card #wallet-amount {
  color: #FFA94D !important;
  text-shadow: 0 0 20px rgba(255, 169, 77, 0.4) !important;
}
.wallet-gold-card .points-unit {
  color: #FDE68A !important;
}
.wallet-gold-card .real-wallet-box {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.wallet-gold-card .real-wallet-box .balance-label {
  color: #94A3B8 !important;
}
.wallet-gold-card .real-wallet-box #real-wallet-amount {
  color: #34D89E !important;
}

.wallet-referral-card {
  background: linear-gradient(135deg, #13241F, #0D1A16) !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}
.wallet-referral-card .referral-code-box {
  background: #081310 !important;
  border: 1px dashed rgba(52, 216, 158, 0.4) !important;
}

.wallet-info-mini-card {
  background: #13241F !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
}

.screen-back-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #FFFFFF !important;
}

#wallet-header-btn {
  background: #1E2D2B !important;
  border: 1px solid rgba(52, 216, 158, 0.15) !important;
  color: #FFFFFF !important;
}
.wallet-label {
  color: #94A3B8 !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
}
.wallet-balance-mini,
#wallet-mini {
  color: #34D89E !important;
  background: rgba(52, 216, 158, 0.12) !important;
}
.transaction-item-card {
  background: #16211D !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #FFFFFF !important;
}


/* ══════════════════════════════════════════════════════════════════
   2. Patient Core Components (Cleaned & Integrated)
   ══════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════
   patient.css — Dawaei Patient App Styles
   ═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════
   1. إعادة ضبط أساسية
══════════════════════════════════════════════════════════ */
html, body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior-y: none !important;
}
button, a, .nav-btn, .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent !important;
}
input, textarea, select {
  font-size: 16px !important;
}
.bottom-nav {
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px)) !important;
}

/* ══════════════════════════════════════════════════════════
   2. متغيرات المريض الإضافية
══════════════════════════════════════════════════════════ */
:root {
  --safe-top:              env(safe-area-inset-top, 0px);
  --safe-bottom:           env(safe-area-inset-bottom, 0px);
  --bg-primary:            #0F1F1B;
  --bg-surface:            #122822;
  --bg-surface-elevated:   #1E2D2B;
  --bg-input:              #1E2D2B;
  --accent-primary:        #10B981;
  --accent-secondary:      #34D89E;
  --text-primary:          #FFFFFF;
  --text-secondary:        #94A3B8;
  --text-muted:            #A0AEC0;
  --patient-accent:        #00c17a;
  --patient-accent-soft:   rgba(0, 193, 122, 0.12);
  --patient-surface:       rgba(255, 255, 255, 0.6);
  --patient-glass:         rgba(255, 255, 255, 0.75);
  --patient-glass-border:  rgba(255, 255, 255, 0.4);
  --patient-shadow-soft:   0 2px 16px rgba(16, 185, 129, 0.07);
  --patient-shadow-card:   0 4px 32px rgba(16, 185, 129, 0.10);
  --patient-shadow-strong: 0 12px 40px rgba(16, 185, 129, 0.18);
  --patient-radius:        20px;
  --patient-radius-sm:     12px;
  --easing-spring:         cubic-bezier(0.34, 1.56, 0.64, 1);
  --easing-smooth:         cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════
   3. جسم الصفحة والخلفية
══════════════════════════════════════════════════════════ */
html {
  font-size: 16px;
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Noto Sans Arabic', 'IBM Plex Sans Arabic', 'Inter', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  direction: rtl;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

:root:not([data-theme="dark"]) body {
  background: linear-gradient(160deg, #f0fdf8 0%, #f8fafc 50%, #e8f5f0 100%) !important;
}

/* ══════════════════════════════════════════════════════════
   4. خلفيات Glow الهادئة (بدون وميض مزعج)
══════════════════════════════════════════════════════════ */
.glow-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  z-index: -10;
  pointer-events: none;
  will-change: transform;
  animation: gentleFloat 30s infinite alternate ease-in-out;
}

.glow-blob-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  top: -100px; right: -80px;
}
.glow-blob-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #10B981 0%, transparent 70%);
  bottom: 10%; left: -100px;
  animation-delay: 8s;
  animation-duration: 35s;
}
.glow-blob-3 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #FFA94D 0%, transparent 70%);
  top: 40%; right: 5%;
  opacity: 0.10;
  animation-delay: 15s;
  animation-duration: 25s;
}

@keyframes gentleFloat {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(20px, -30px); }
  100% { transform: translate(-10px, 15px); }
}

/* ══════════════════════════════════════════════════════════
   5. شاشة التحميل (Splash)
══════════════════════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #10B981 0%, #0A1F1A 40%, #0A1F1A 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  z-index: 9999;
  transition: opacity 0.6s var(--easing-smooth), visibility 0.6s;
}

.splash.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-logo { text-align: center; color: white; }
.splash-logo h1 {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 42px;
  font-weight: 900;
  margin-top: 12px;
  letter-spacing: -0.5px;
}
.splash-logo p { font-size: 16px; opacity: 0.75; margin-top: 6px; }

.splash .spinner {
  border-color: rgba(255,255,255,0.25);
  border-top-color: white;
  width: 36px; height: 36px;
}

/* ══════════════════════════════════════════════════════════
   6. شاشة تسجيل الدخول
══════════════════════════════════════════════════════════ */
#auth-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  height: auto;
  position: absolute;
  top: 0; left: 0; width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: max(20px, env(safe-area-inset-top, 20px));
  padding-bottom: max(80px, calc(60px + env(safe-area-inset-bottom, 24px))) !important;
  background: linear-gradient(180deg, rgba(16,185,129,0.06) 0%, var(--bg-body, #0f172a) 35%);
  z-index: 10;
  box-sizing: border-box !important;
}

.auth-hero {
  text-align: center;
  padding: 28px 24px 16px;
}

.auth-hero h1 {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--color-primary, #10B981);
  margin: 8px 0 0;
}

.auth-hero p {
  color: var(--text-secondary, #94A3B8);
  margin-top: 4px;
  font-size: 14px;
}

/* ── Segmented Tabs (Equal 50% dimensions & animated active pill) ── */
.auth-tabs {
  display: flex;
  background: var(--bg-surface, #122822);
  border: 1px solid rgba(52, 216, 158, 0.18);
  border-radius: 16px;
  padding: 5px;
  gap: 6px;
  margin: 0 20px 20px;
  box-sizing: border-box;
}

.auth-tab {
  flex: 1 1 50%;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary, #94A3B8);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-tab.active {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.auth-tab:hover:not(.active) {
  color: #FFFFFF;
  background: rgba(52, 216, 158, 0.08);
}

/* ── Phone / Email Segmented Toggle Container ── */
.auth-toggle-container {
  display: flex;
  background: var(--bg-surface, #122822);
  border: 1px solid rgba(52, 216, 158, 0.18);
  border-radius: 16px;
  padding: 5px;
  gap: 6px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.auth-toggle-btn {
  flex: 1 1 50%;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary, #94A3B8);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-toggle-btn.active {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.auth-toggle-btn:hover:not(.active) {
  color: #FFFFFF;
  background: rgba(52, 216, 158, 0.08);
}

/* ── Form Container & Input Fields (High Contrast #1E2D2B Container) ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 24px;
}

.auth-input-group {
  margin-bottom: 18px;
  width: 100%;
  text-align: right;
}

.auth-input-group .input-label {
  display: block;
  font-weight: 800;
  color: var(--accent-secondary, #34D89E);
  margin-bottom: 8px;
  font-size: 14px;
}

.auth-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.auth-input,
.auth-form .input-field {
  width: 100%;
  height: 54px;
  background-color: #1E2D2B !important;
  background: #1E2D2B !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border: 1.5px solid rgba(52, 216, 158, 0.22) !important;
  border-radius: 14px !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  padding: 0 50px 0 16px !important;
  box-sizing: border-box !important;
  outline: none !important;
  caret-color: #34D89E !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.auth-input:focus,
.auth-form .input-field:focus {
  background-color: #1E2D2B !important;
  background: #1E2D2B !important;
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
  border-color: #34D89E !important;
  box-shadow: 0 0 0 3.5px rgba(52, 216, 158, 0.25) !important;
  outline: none !important;
}

.auth-input::placeholder,
.auth-form .input-field::placeholder {
  color: #94A3B8 !important;
  -webkit-text-fill-color: #94A3B8 !important;
  opacity: 0.9 !important;
  font-weight: 500 !important;
}

/* Leading Icon inside Auth Field */
.auth-input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-secondary, #34D89E) !important;
  font-size: 22px !important;
  pointer-events: none;
  z-index: 2;
}

/* Trailing Visibility Toggle Button */
.auth-toggle-pwd {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #94A3B8;
  background: transparent;
  border: none;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.auth-toggle-pwd:hover {
  color: #34D89E;
  background: rgba(52, 216, 158, 0.12);
}

/* Fields with trailing button have double padding */
#login-password.auth-input,
#reg-password.auth-input {
  padding-left: 50px !important;
  padding-right: 50px !important;
}

/* ── Phone Input Card & Prefix ── */
.auth-phone-card {
  background: var(--bg-surface, #122822) !important;
  border: 1px solid rgba(52, 216, 158, 0.18) !important;
  padding: 20px;
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

#login-phone.auth-input {
  padding: 0 14px !important;
  height: 54px !important;
}

#telegram-otp-input.auth-input {
  padding: 0 12px !important;
  height: 54px !important;
}

/* ── Action Buttons ── */
/* Outlined Biometric Login Button (12dp margin before separator) */
#biometric-login-btn,
.auth-biometric-btn {
  background: transparent !important;
  color: var(--accent-secondary, #34D89E) !important;
  border: 1.5px solid var(--accent-primary, #10B981) !important;
  border-radius: 14px !important;
  height: 54px !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin-bottom: 12px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#biometric-login-btn:hover,
.auth-biometric-btn:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: #34D89E !important;
  transform: translateY(-1px);
}

/* Unified Dark Google Button */
#google-login-btn,
#google-register-btn,
.auth-google-btn {
  background: #1E2D2B !important;
  color: #FFFFFF !important;
  border: 1.5px solid rgba(52, 216, 158, 0.2) !important;
  border-radius: 14px !important;
  height: 54px !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
  margin-bottom: 12px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#google-login-btn:hover,
#google-register-btn:hover,
.auth-google-btn:hover {
  background: #253835 !important;
  border-color: #34D89E !important;
  transform: translateY(-1px);
}

/* Primary Filled Submit Buttons */
#login-btn,
#register-btn,
#send-otp-btn {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  color: #FFFFFF !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-weight: 800 !important;
  font-size: 16px !important;
  height: 54px !important;
  border-radius: 14px !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.28) !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

#login-btn:hover,
#register-btn:hover,
#send-otp-btn:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.38) !important;
  transform: translateY(-1px);
}

/* Bottom Safe Area Portal Navigation Button */
.auth-portal-nav {
  text-align: center;
  margin: 24px 0 0;
  padding-bottom: max(24px, calc(16px + env(safe-area-inset-bottom, 0px)));
}

.auth-portal-btn {
  background: rgba(30, 45, 43, 0.85) !important;
  color: #94A3B8 !important;
  border: 1px solid rgba(52, 216, 158, 0.2) !important;
  border-radius: 100px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 46px !important;
  padding: 0 24px !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.auth-portal-btn:hover {
  background: #1E2D2B !important;
  color: #FFFFFF !important;
  border-color: #34D89E !important;
}

.auth-error {
  color: #F87171;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════
   7. الهيكل الرئيسي للتطبيق
══════════════════════════════════════════════════════════ */
#app-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.screen {
  animation: screenFadeIn 0.3s var(--easing-smooth) both;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   8. الهيدر العلوي (Glassmorphism / MD3 Safe Area)
══════════════════════════════════════════════════════════ */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: max(16px, env(safe-area-inset-top, 16px)) !important;
  padding-bottom: 12px !important;
  padding-inline: 16px !important;
  min-height: 64px;
  box-sizing: border-box;
  background: var(--bg-header, rgba(15, 31, 27, 0.95)) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid var(--border-color, rgba(52, 216, 158, 0.15)) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25) !important;
  position: sticky;
  top: 0;
  z-index: 50;
}

[data-theme="dark"] .app-header {
  background: var(--bg-header, rgba(15, 31, 27, 0.95)) !important;
  border-bottom: 1px solid var(--border-color, rgba(52, 216, 158, 0.15)) !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3) !important;
}

.header-user { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.header-greeting { margin: 0; font-size: 11px; color: #94A3B8; font-weight: 500; }
.header-name { margin: 0; font-size: 14px; font-weight: 800; line-height: 1.2; color: #FFFFFF; }
.header-actions  { display: flex; align-items: center; gap: 8px; }

.notif-dot {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 8px;
  height: 8px;
  background: #F87171;
  border-radius: 50%;
  border: 1.5px solid #1E2D2B;
}

.wallet-balance-mini {
  font-size: 11.5px;
  font-weight: 800;
  color: #34D89E;
  background: rgba(52, 216, 158, 0.12);
  padding: 1px 6px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   9. المحتوى الرئيسي
══════════════════════════════════════════════════════════ */
.app-main {
  flex: 1;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-behavior: auto;
}

.app-section {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.section-title {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header h3 {
  font-size: 15px;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   10. بنر البطل (Hero Banner) المذهل
══════════════════════════════════════════════════════════ */
.hero-banner {
  display: grid !important;
  grid-template-columns: 1fr 100px !important;
  align-items: center !important;
  gap: var(--space-md) !important;
  background: linear-gradient(135deg, #10B981 0%, #0A1F1A 60%, #0A1F1A 100%) !important;
  border-radius: var(--patient-radius) !important;
  padding: var(--space-lg) !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.25) !important;
  border: none !important;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  pointer-events: none;
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 220px; height: 220px;
  background: rgba(16,185,129,0.08);
  border-radius: 50%;
  pointer-events: none;
}

.hero-banner h2 {
  font-family: 'Noto Sans Arabic', sans-serif !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: white !important;
  line-height: 1.35 !important;
  margin-bottom: 8px !important;
}

.hero-banner p {
  font-size: 12px !important;
  color: rgba(255,255,255,0.72) !important;
  line-height: 1.65 !important;
  margin: 0 !important;
}

.hero-image {
  width: 90px !important;
  height: 90px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3)) !important;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   11. بطاقة البحث
══════════════════════════════════════════════════════════ */
.search-card {
  background: var(--bg-card) !important;
  border-radius: var(--patient-radius) !important;
  padding: var(--space-md) !important;
  box-shadow: var(--patient-shadow-card) !important;
  border: 1px solid rgba(16,185,129,0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: var(--space-sm) !important;
}

.search-card h2 {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

.search-wrapper { position: relative; }

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-hint);
  pointer-events: none;
  font-size: 20px;
}

.search-input {
  padding-right: 46px !important;
  border-radius: 50px !important;
  border: 1.5px solid rgba(16,185,129,0.12) !important;
  background: rgba(16,185,129,0.03) !important;
  font-size: 14px !important;
  transition: all 0.2s var(--easing-smooth) !important;
}

.search-input:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.08) !important;
  background: var(--bg-card) !important;
}

.search-results {
  background: var(--bg-card) !important;
  border-radius: var(--patient-radius-sm);
  box-shadow: var(--patient-shadow-strong);
  overflow: hidden;
  margin-top: var(--space-sm);
  border: 1px solid rgba(16,185,129,0.08);
  max-height: 400px;
  overflow-y: auto; overscroll-behavior-y: none; -webkit-overflow-scrolling: touch;
}

[data-theme="dark"] .search-results {
  background: var(--bg-card) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.search-result-item {
  padding: 14px var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(16,185,129,0.06);
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 14px;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

.search-result-item:hover { background: var(--bg-container-low) !important; }
.search-result-item:last-child { border-bottom: none; }

/* بطاقات نتائج البحث التفصيلية الجديدة */
.search-result-item.detailed {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  gap: var(--space-md);
  border-bottom: 1.5px solid rgba(16, 185, 129, 0.08);
  background: var(--bg-card) !important;
  cursor: default;
  transition: background var(--transition);
  text-align: right;
}

.search-result-item.detailed:hover {
  background: var(--bg-container-low) !important;
}

[data-theme="dark"] .search-result-item.detailed {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.search-result-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.search-result-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.search-result-name-row .med-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary) !important;
}

.search-result-pharmacy-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.search-result-stock-row {
  margin-top: 4px;
}

.stock-count {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.08);
  color: var(--color-primary);
}

.stock-count.out {
  background: rgba(248, 113, 113, 0.08);
  color: var(--color-error);
}

[data-theme="dark"] .stock-count {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-primary-dim);
}

[data-theme="dark"] .stock-count.out {
  background: rgba(248, 113, 113, 0.15);
  color: #ff6b6b;
}

.search-result-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.search-result-price {
  text-align: left;
}

.search-result-price .new-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary);
}

[data-theme="dark"] .search-result-price .new-price {
  color: var(--color-primary-dim) !important;
}

.search-result-btns {
  display: flex;
  gap: 6px;
}

.search-result-btns .btn {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  height: 28px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ══════════════════════════════════════════════════════════
   12. أقسام الصيدلية (Categories)
══════════════════════════════════════════════════════════ */
.categories-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.categories-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 12px 2px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 95px;
  width: auto;
  max-width: 115px;
  background: var(--bg-card) !important;
  border: 1.5px solid rgba(16,185,129,0.08) !important;
  border-radius: var(--patient-radius-sm);
  padding: 12px 4px 10px;
  cursor: pointer;
  transition: all 0.25s var(--easing-spring);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  flex-shrink: 0;
  overflow: hidden;
}

[data-theme="dark"] .category-card {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(71, 85, 105, 0.3) !important;
}

.category-card:hover,
.category-card:active {
  transform: translateY(-4px);
  border-color: var(--color-primary) !important;
  box-shadow: 0 8px 20px rgba(16,185,129,0.12) !important;
}

.category-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--easing-smooth);
  font-size: 22px;
}

.category-card:hover .category-icon-wrapper {
  background: var(--color-primary);
  color: white;
  transform: scale(1.08);
}

.category-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* ══════════════════════════════════════════════════════════
   13. بطاقة الوصفة الطبية
══════════════════════════════════════════════════════════ */
.prescription-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--space-md) !important;
  background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, rgba(16,185,129,0.04) 100%) !important;
  border: 1.5px solid rgba(16,185,129,0.12) !important;
  border-radius: var(--patient-radius) !important;
  padding: var(--space-md) !important;
  box-shadow: none !important;
}

.prescription-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.prescription-info h3 {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prescription-info p {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════
   13. قسم العروض الحصرية (Exclusive Offers)
══════════════════════════════════════════════════════════ */
.offers-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.offers-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.offers-scroll::-webkit-scrollbar {
  display: none;
}

.offer-card {
  min-width: 220px;
  width: 220px;
  background: var(--bg-card) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.15) !important;
  border-radius: var(--patient-radius-sm);
  padding: 14px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s var(--easing-spring);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.05);
  flex-shrink: 0;
  cursor: pointer;
}

[data-theme="dark"] .offer-card {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
}

.offer-card:hover {
  transform: translateY(-4px);
  border-color: #FFA94D !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15) !important;
}

.offer-card .offer-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #FFA94D, #FFA94D);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}

.offer-card .offer-img-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  background: rgba(245, 158, 11, 0.05);
  border-radius: 12px;
  min-height: 80px;
}

.offer-card .offer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}

.offer-card .offer-pharmacy {
  font-size: 10px;
  color: var(--text-hint);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.offer-card .offer-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.offer-card .offer-price-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.offer-card .old-price {
  font-size: 11px;
  text-decoration: line-through;
  color: var(--text-hint);
}

.offer-card .new-price {
  font-size: 14px;
  font-weight: 800;
  color: #FFA94D;
}

.offer-card .offer-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFA94D;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
}

.offer-card:hover .offer-action-btn {
  background: #FFA94D;
  transform: scale(1.1);
}

.category-card:hover .category-icon-wrapper {
  background: var(--color-primary);
  color: white;
  transform: scale(1.08);
}

.category-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* ══════════════════════════════════════════════════════════
   13. بطاقة الوصفة الطبية
══════════════════════════════════════════════════════════ */
.prescription-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--space-md) !important;
  background: linear-gradient(135deg, rgba(16,185,129,0.06) 0%, rgba(16,185,129,0.04) 100%) !important;
  border: 1.5px solid rgba(16,185,129,0.12) !important;
  border-radius: var(--patient-radius) !important;
  padding: var(--space-md) !important;
  box-shadow: none !important;
}

.prescription-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 0;
}

.prescription-info h3 {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prescription-info p {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════
   13. قسم العروض الحصرية (Exclusive Offers)
══════════════════════════════════════════════════════════ */
.offers-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.offers-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.offers-scroll::-webkit-scrollbar {
  display: none;
}

.offer-card {
  min-width: 220px;
  width: 220px;
  background: var(--bg-card) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.15) !important;
  border-radius: var(--patient-radius-sm);
  padding: 14px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s var(--easing-spring);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.05);
  flex-shrink: 0;
  cursor: pointer;
}

[data-theme="dark"] .offer-card {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
}

.offer-card:hover {
  transform: translateY(-4px);
  border-color: #FFA94D !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15) !important;
}

.offer-card .offer-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #FFA94D, #FFA94D);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2);
}

.offer-card .offer-img-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  background: rgba(245, 158, 11, 0.05);
  border-radius: 12px;
  min-height: 80px;
}

.offer-card .offer-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}

.offer-card .offer-pharmacy {
  font-size: 10px;
  color: var(--text-hint);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.offer-card .offer-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.offer-card .offer-price-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.offer-card .old-price {
  font-size: 11px;
  text-decoration: line-through;
  color: var(--text-hint);
}

.offer-card .new-price {
  font-size: 14px;
  font-weight: 800;
  color: #FFA94D;
}

.offer-card .offer-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #FFA94D;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  transition: all 0.2s;
}

.offer-card:hover .offer-action-btn {
  background: #FFA94D;
  transform: scale(1.1);
}

/* ══════════════════════════════════════════════════════════
   14. المنتجات الشائعة
══════════════════════════════════════════════════════════ */
.products-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--bg-card) !important;
  border: 1.5px solid rgba(16,185,129,0.07) !important;
  border-radius: var(--patient-radius-sm);
  padding: 14px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s var(--easing-spring);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  cursor: pointer;
}

[data-theme="dark"] .product-card {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(71, 85, 105, 0.25) !important;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: rgba(16,185,129,0.2) !important;
  box-shadow: 0 10px 28px rgba(16,185,129,0.10) !important;
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(16,185,129,0.1);
  color: var(--color-primary);
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.product-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  background: rgba(16,185,129,0.04);
  border-radius: 12px;
  min-height: 90px;
}

.product-image-placeholder { font-size: 40px; }

.product-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.product-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}

.product-category {
  font-size: 10px;
  color: var(--text-hint);
  font-weight: 500;
}

.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary);
}

.product-quick-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--easing-spring);
  box-shadow: 0 3px 10px rgba(16,185,129,0.3);
}

.product-quick-btn:hover { transform: scale(1.1); background: #0A1F1A; }
.product-quick-btn:active { transform: scale(0.93); }

/* ══════════════════════════════════════════════════════════
   15. الطلبات النشطة — تأثيرات احترافية بمستوى عالمي
══════════════════════════════════════════════════════════ */
.orders-list { display: flex; flex-direction: column; gap: 12px; }

/* ── Keyframes مشتركة ── */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4), 0 4px 18px rgba(0,0,0,0.07); }
  50%       { box-shadow: 0 0 0 8px rgba(245,158,11,0), 0 4px 18px rgba(0,0,0,0.07); }
}
@keyframes preparingShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes readyPop {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.018); }
}
@keyframes progressBar {
  0%   { width: 20%; }
  50%  { width: 70%; }
  100% { width: 95%; }
}
@keyframes confirmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.35), 0 4px 18px rgba(0,0,0,0.07); }
  60%       { box-shadow: 0 0 0 10px rgba(16,185,129,0), 0 4px 18px rgba(0,0,0,0.07); }
}
@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1;   }
}
@keyframes scanLine {
  0%   { transform: translateY(0); opacity: 0.7; }
  50%  { opacity: 1; }
  100% { transform: translateY(28px); opacity: 0.7; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

/* ── البطاقة الأساسية ── */
.order-card {
  background: var(--bg-card, #122822);
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  border: 1.5px solid rgba(52, 216, 158, 0.15);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.order-card:hover  { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.35); border-color: rgba(52, 216, 158, 0.3); }
.order-card:active { transform: scale(0.98); }

/* ── شريط الحالة العلوي (accent bar) ── */
.order-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: rgba(52, 216, 158, 0.2);
  transition: background 0.3s;
}

/* ══ pending: نبضة ذهبية ══ */
.order-card.status-pending {
  border-color: rgba(245, 158, 11, 0.3);
  animation: pulseGlow 2s ease-in-out infinite;
}
.order-card.status-pending::before {
  background: linear-gradient(90deg, #FFA94D, #fbbf24);
}

/* ══ confirmed: نبضة زمردية ══ */
.order-card.status-confirmed,
.order-card.status-patient_confirmed {
  border-color: rgba(52, 216, 158, 0.35);
  animation: confirmPulse 2.2s ease-in-out infinite;
}
.order-card.status-confirmed::before,
.order-card.status-patient_confirmed::before {
  background: linear-gradient(90deg, #10B981, #34D89E);
}

/* ══ preparing: شريط تقدم متحرك ══ */
.order-card.status-preparing {
  border-color: rgba(52, 216, 158, 0.4);
}
.order-card.status-preparing::before {
  background: linear-gradient(90deg,
    #10B981 0%, #10b981 40%, #34d399 60%, #10B981 100%);
  background-size: 200% 100%;
  animation: preparingShimmer 1.8s linear infinite;
}
/* شريط التقدم السفلي */
.order-card.status-preparing::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 16px 16px;
  background: rgba(16, 185, 129, 0.25);
  animation: progressBar 3s ease-in-out infinite alternate;
}

/* ══ ready: اهتزاز جاهز ══ */
.order-card.status-ready {
  border-color: rgba(16, 185, 129, 0.45);
  animation: readyPop 1.4s ease-in-out infinite;
}
.order-card.status-ready::before {
  background: linear-gradient(90deg, #059669, #10b981, #34d399);
}

/* ══ completed / delivered: هادئ زمردي خافت ══ */
.order-card.status-completed,
.order-card.status-delivered {
  border-color: rgba(52, 216, 158, 0.12);
  opacity: 0.95;
}
.order-card.status-completed::before,
.order-card.status-delivered::before {
  background: rgba(52, 216, 158, 0.25);
}

/* ══ cancelled / not_found: أحمر ══ */
.order-card.status-cancelled,
.order-card.status-not_found {
  border-color: rgba(248, 113, 113, 0.25);
  opacity: 0.85;
}
.order-card.status-cancelled::before,
.order-card.status-not_found::before {
  background: rgba(248, 113, 113, 0.5);
}

/* ── رأس البطاقة ── */
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.order-card-id { font-size: 12px; color: #94A3B8; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.order-card-pharmacy { font-weight: 800; font-size: 15.5px; color: #FFFFFF; }

/* ── تذييل البطاقة ── */
.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(52, 216, 158, 0.12);
}

/* Compact status badges (20dp-24dp) */
.badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 8px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}
.badge-yellow { background: rgba(245, 158, 11, 0.15) !important; color: #FFA94D !important; border: 1px solid rgba(245, 158, 11, 0.35) !important; }
.badge-blue   { background: rgba(52, 216, 158, 0.15) !important; color: #34D89E !important; border: 1px solid rgba(52, 216, 158, 0.35) !important; }
.badge-green  { background: rgba(16, 185, 129, 0.18) !important; color: #10B981 !important; border: 1px solid rgba(16, 185, 129, 0.35) !important; }
.badge-red    { background: rgba(239, 68, 68, 0.15) !important; color: #F87171 !important; border: 1px solid rgba(239, 68, 68, 0.35) !important; }
.badge-gray   { background: rgba(148, 163, 184, 0.15) !important; color: #94A3B8 !important; border: 1px solid rgba(148, 163, 184, 0.25) !important; }
.badge-orange { background: rgba(249, 115, 22, 0.15) !important; color: #FB923C !important; border: 1px solid rgba(249, 115, 22, 0.35) !important; }

/* ── مؤشر الحالة المتحرك (3 نقاط) لحالة preparing ── */
.order-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 6px;
  vertical-align: middle;
}
.order-status-indicator span {
  width: 5px; height: 5px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  animation: dotBounce 1.4s ease-in-out infinite;
}
.order-status-indicator span:nth-child(2) { animation-delay: 0.2s; }
.order-status-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ── أيقونة الحالة المتحركة ── */
.order-status-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.order-status-icon.floating { animation: float 2s ease-in-out infinite; }
.order-status-icon.scanning {
  position: relative;
  overflow: hidden;
}

/* Dark mode */
[data-theme="dark"] .order-card { background: var(--bg-card); }


/* ══════════════════════════════════════════════════════════
   16. بطاقات الصيدليات القريبة
══════════════════════════════════════════════════════════ */
.pharmacies-list { display: flex; flex-direction: column; gap: 10px; }

.app-main {
  flex: 1;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 24px)) !important;
  scroll-behavior: smooth;
  box-sizing: border-box !important;
}

.app-section {
  padding: var(--space-md);
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 24px)) !important;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-sizing: border-box !important;
}

.pharmacy-card {
  background: var(--bg-card);
  border-radius: var(--patient-radius-sm);
  box-shadow: var(--patient-shadow-soft);
  padding: var(--space-md);
  border-right: 4px solid var(--color-primary);
  transition: all 0.2s var(--easing-smooth);
  cursor: pointer;
}

.pharmacy-card:hover { transform: translateY(-2px); box-shadow: var(--patient-shadow-card); }
.pharmacy-card:active { transform: scale(0.98); }

.pharmacy-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.pharmacy-card-name  { font-family: 'Noto Sans Arabic', sans-serif; font-size: 16px; font-weight: 700; }
.pharmacy-card-price { font-size: 17px; font-weight: 800; color: var(--color-primary); }
.pharmacy-card-meta  { display: flex; gap: var(--space-md); font-size: 13px; color: var(--text-hint); }
.pharmacy-meta-item  { display: flex; align-items: center; gap: 4px; }

.pharmacy-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.loading-pharmacies {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: var(--space-xl);
  color: var(--text-hint);
}

/* ══════════════════════════════════════════════════════════
   17. شريط التنقل السفلي
══════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-header, rgba(15, 31, 27, 0.95)) !important;
  border-top: 1px solid var(--border-color, rgba(52, 216, 158, 0.15)) !important;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 12px)) !important;
  z-index: 9999;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 30px rgba(0,0,0,0.3) !important;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-hint, #94A3B8);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  transition: all 0.25s var(--easing-smooth);
  border-radius: 14px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn .material-symbols-outlined {
  font-size: 23px;
  transition: all 0.25s var(--easing-spring);
}

.nav-btn.active {
  color: #34D89E;
}

.nav-btn.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
  transform: translateY(-2px) scale(1.1);
}

/* الدائرة خلف الأيقونة النشطة */
.nav-btn::before {
  content: '';
  position: absolute;
  top: 4px;
  width: 44px;
  height: 28px;
  border-radius: 14px;
  background: rgba(52, 216, 158, 0.12);
  z-index: -1;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.3s var(--easing-spring);
}

.nav-btn.active::before {
  opacity: 1;
  transform: scale(1);
}

/* FAB وسط البار — زر الوصفة */
.upload-fab {
  position: relative;
  top: -16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.fab-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.40);
  border: 3px solid #0F1F1B;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-fab span {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #94A3B8;
}

.nav-btn:hover .fab-circle { transform: translateY(-2px) scale(1.06); box-shadow: 0 8px 24px rgba(16, 185, 129, 0.50); }
.upload-fab:active .fab-circle { transform: scale(0.92); }

/* ══════════════════════════════════════════════════════════
   18. الشاشات الداخلية (طلباتي، المحفظة، حسابي)
══════════════════════════════════════════════════════════ */

/* فلتر الطلبات - MD3 Fluid Scroll Container */
.orders-filter {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 4px 4px 10px 4px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.orders-filter::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 8px 18px;
  min-height: 38px;
  border: 1.5px solid rgba(52, 216, 158, 0.18);
  border-radius: 50px;
  background: #1E2D2B;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn:hover:not(.active) {
  color: #FFFFFF;
  border-color: rgba(52, 216, 158, 0.35);
  background: #253835;
}

.filter-btn.active {
  border-color: #10B981;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF !important;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

#screen-orders {
  box-sizing: border-box !important;
}

#all-orders-list,
.orders-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  overflow: visible !important;
  overflow-y: visible !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y !important;
  padding-bottom: 24px !important;
}

.track-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.timeline { display: flex; flex-direction: column; }

.timeline-step { display: flex; gap: var(--space-md); }

.timeline-line {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  transition: all 0.3s var(--easing-smooth);
}

.timeline-dot.done   { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.timeline-dot.active { border-color: var(--color-primary); box-shadow: 0 0 0 5px rgba(16,185,129,0.12); }

.timeline-connector       { width: 2px; flex: 1; min-height: 32px; background: var(--border-subtle); }
.timeline-connector.done  { background: var(--color-primary); }

.timeline-content { padding-bottom: var(--space-lg); padding-top: 3px; }
.timeline-title   { font-weight: 700; font-size: 15px; }
.timeline-desc    { font-size: 13px; color: var(--text-hint); margin-top: 2px; }
.timeline-time    { font-size: 12px; color: var(--text-hint); margin-top: 4px; }

.wallet-card {
  background: linear-gradient(135deg, #10B981 0%, #10b981 100%);
  border-radius: var(--patient-radius);
  padding: var(--space-xl);
  color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  box-shadow: 0 10px 30px rgba(16,185,129,0.30);
}

.wallet-label  { font-size: 14px; opacity: 0.85; font-weight: 500; }

.wallet-amount {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
}

.wallet-amount span { font-size: 22px; margin-inline-start: 6px; opacity: 0.8; letter-spacing: 0; }
.wallet-card .btn-primary { background: rgba(255,255,255,0.18); box-shadow: none; border: 1px solid rgba(255,255,255,0.2); }
.wallet-card .btn-primary:hover { background: rgba(255,255,255,0.28); }

.transactions-list { display: flex; flex-direction: column; gap: 8px; }

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--patient-radius-sm);
  box-shadow: var(--patient-shadow-soft);
}

.transaction-type               { font-size: 13px; color: var(--text-hint); }
.transaction-amount.credit      { color: var(--color-success); font-weight: 800; }
.transaction-amount.debit       { color: var(--color-error);   font-weight: 800; }

/* شحن المحفظة */
.topup-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: var(--space-md);
}

.amount-btn {
  padding: 12px 6px;
  border: 2px solid rgba(16,185,129,0.12);
  border-radius: var(--patient-radius-sm);
  background: var(--bg-card);
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--easing-smooth);
  color: var(--text-secondary);
}

.amount-btn.selected {
  border-color: var(--color-primary);
  background: rgba(16,185,129,0.06);
  color: var(--color-primary);
}

.topup-methods { margin: var(--space-md) 0; }
.topup-methods h4 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }

.method-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 13px var(--space-md);
  border: 2px solid rgba(16,185,129,0.10);
  border-radius: var(--patient-radius-sm);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s var(--easing-smooth);
}

.method-option:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(16,185,129,0.05);
}

.method-label { font-size: 15px; font-weight: 600; }

/* حسابي */
.profile-card {
  text-align: center;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.profile-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #10B981);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(16,185,129,0.30);
}

.profile-card h3 { font-size: 20px; font-weight: 800; }

.profile-menu { display: flex; flex-direction: column; gap: 8px; }

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 15px var(--space-md);
  background: var(--bg-card);
  border: none;
  border-radius: var(--patient-radius-sm);
  cursor: pointer;
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  text-align: start;
  transition: all 0.2s var(--easing-smooth);
  box-shadow: var(--patient-shadow-soft);
}

.profile-menu-item:hover {
  background: rgba(16,185,129,0.04);
  transform: translateX(-3px);
}

.profile-menu-item .arrow {
  margin-inline-start: auto;
  color: var(--text-hint);
  font-size: 18px;
}

/* ══════════════════════════════════════════════════════════
   19. النوافذ المنبثقة (Modals)
══════════════════════════════════════════════════════════ */
.overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);


  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 16px)) max(16px, env(safe-area-inset-right, 16px)) max(16px, env(safe-area-inset-bottom, 16px)) max(16px, env(safe-area-inset-left, 16px));
  transition: opacity 0.3s var(--easing-smooth), visibility 0.3s;
}
.overlay.hidden,
.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal {
  background: var(--bg-card);
  width: 100%;
  max-width: 450px;
  max-height: calc(100dvh - max(32px, calc(env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px))));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--patient-radius);
  padding: var(--space-xl);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(0) scale(1);
  transition: transform 0.3s var(--easing-smooth);
}

.overlay.hidden .modal,
.modal-overlay.hidden .modal {
  transform: translateY(20px) scale(0.95);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.modal-header h3 {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.modal-footer .btn { flex: 1; }

/* منطقة رفع الوصفة */
.upload-zone {
  border: 2px dashed rgba(16,185,129,0.25);
  border-radius: var(--patient-radius);
  padding: var(--space-xl);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-hint);
  background: rgba(16,185,129,0.02);
  transition: all 0.2s ease;
}

.upload-zone:hover {
  border-color: var(--color-primary);
  background: rgba(16,185,129,0.04);
}

.upload-zone-icon { font-size: 48px; color: var(--color-primary); opacity: 0.6; }
.upload-zone p    { font-size: 14px; }
.upload-btns      { display: flex; gap: var(--space-sm); }

.prescription-preview {
  position: relative;
  border-radius: var(--patient-radius);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.prescription-preview img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border-radius: var(--patient-radius);
}

.ocr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: white;
  border-radius: var(--patient-radius);
}

.ocr-overlay .spinner { border-top-color: white; border-color: rgba(255,255,255,0.25); }
.ocr-result h4  { font-size: 15px; margin-bottom: var(--space-sm); font-weight: 700; }
.ocr-textarea   { resize: none; font-size: 14px; }

/* نافذة الدردشة */
.chat-modal-box {
  max-width: 460px;
  height: 80vh;
  max-height: 640px;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
  border-radius: var(--patient-radius) !important;
  background: var(--bg-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18) !important;
}

.chat-header {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  margin-bottom: 0 !important;
}

.chat-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(16,185,129,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

#chat-title { font-size: 16px; font-weight: 800; color: var(--text-primary); margin: 0; }

.chat-status-indicator { font-size: 11px; color: var(--color-success); display: block; margin-top: 2px; font-weight: 600; }

.chat-messages-container {
  flex: 1;
  overflow-y: auto; overscroll-behavior-y: none; -webkit-overflow-scrolling: touch;
  padding: var(--space-md);
  background: var(--bg-container-low);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.chat-start-notice {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--patient-radius-sm);
  padding: var(--space-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.chat-start-notice .notice-icon { font-size: 28px; }
.chat-start-notice p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0; }

.chat-message-bubble {
  max-width: 78%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  animation: messageSlideIn 0.25s var(--easing-smooth) both;
  word-break: break-word;
}

@keyframes messageSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-message-bubble.sender {
  background: var(--color-primary) !important; /* أخضر للمريض */
  color: white !important;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.chat-message-bubble.receiver {
  background: #10B981 !important; /* أزرق صلب للصيدلية */
  border: none !important;
  color: white !important;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.chat-message-time {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.65;
}

.chat-input-wrapper {
  padding: 12px var(--space-md);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════
   20. Skeleton Loaders & Animations (New)
══════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.04) 25%, rgba(16, 185, 129, 0.1) 50%, rgba(16, 185, 129, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--patient-radius-sm);
  min-height: 20px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.animate-float {
  animation: floatImg 4s ease-in-out infinite;
}

@keyframes floatImg {
  0% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-10px) scale(1.02); }
  100% { transform: translateY(0px) scale(1); }
}

.skeleton-text { width: 100%; height: 16px; margin-bottom: 6px; }
.skeleton-text.short { width: 60%; }
.skeleton-text.title { height: 20px; margin-bottom: 12px; }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-box { width: 100%; height: 100px; border-radius: var(--patient-radius-sm); }

.chat-message-input {
  flex: 1;
  border-radius: 50px !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
}

.chat-send-btn {
  width: 40px; height: 40px;
  border-radius: 50% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 !important;
}

/* ══════════════════════════════════════════════════════════
   20. مركز الدعم العائم
══════════════════════════════════════════════════════════ */
.floating-support-hub {
  position: fixed;
  bottom: 90px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.support-fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.40);
  cursor: pointer;
  transition: all 0.3s var(--easing-spring);
  border: none;
  position: relative;
}

.support-fab::after {
  display: none;
}

.support-fab:hover {
  transform: scale(1.05);
  background: #1da851;
}

.support-menu {
  background: rgba(255,255,255,0.9) !important;


  border: 1px solid rgba(16,185,129,0.10) !important;
  border-radius: var(--patient-radius) !important;
  padding: var(--space-sm) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.10) !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.97);
  transition: all 0.25s var(--easing-smooth);
  min-width: 185px;
}

[data-theme="dark"] .support-menu {
  background: rgba(30, 41, 59, 0.92) !important;
  border-color: rgba(71, 85, 105, 0.4) !important;
}

.floating-support-hub.active .support-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.support-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--patient-radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.support-menu-item:hover {
  background: rgba(16,185,129,0.07) !important;
  color: var(--color-primary) !important;
}

.support-menu-item .icon-box {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   21. زر مساعد الذكاء الاصطناعي 
══════════════════════════════════════════════════════════ */
.ai-assistant-fab {
  position: fixed;
  bottom: 90px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 950;
  cursor: pointer;
  background: linear-gradient(135deg, #10b981 0%, #10B981 100%);
  border: none;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-assistant-fab:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5);
}
.ai-assistant-fab:active {
  transform: scale(0.95);
}

/* إلغاء النبض (pulse) تماماً */
.ai-pulse {
  display: none !important;
}

[data-theme="dark"] .ai-assistant-fab {
  box-shadow: none !important;
}

/* ══════════════════════════════════════════════════════════
   22. البطاقات العامة
══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--patient-radius-sm);
  box-shadow: var(--patient-shadow-soft);
  padding: var(--space-md);
  transition: box-shadow 0.25s var(--easing-smooth);
}

.card:hover { box-shadow: var(--patient-shadow-card); }

/* ══════════════════════════════════════════════════════════
   23. الحالة الفارغة
══════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px var(--space-lg);
  text-align: center;
  gap: var(--space-md);
  color: var(--text-hint);
}

.empty-state .icon { font-size: 52px; opacity: 0.4; }
.empty-state h3    { font-size: 16px; color: var(--text-secondary); font-weight: 700; }
.empty-state p     { font-size: 13px; line-height: 1.6; }

/* ══════════════════════════════════════════════════════════
   24. تجاوب شامل — حاوية الهاتف على الشاشات الكبيرة
══════════════════════════════════════════════════════════ */
@media (min-width: 500px) {
  html {
    background: linear-gradient(135deg, #14332A 0%, #0F2921 50%, #14332A 100%) !important;
    min-height: 100vh;
  }

  body {
    max-width: 430px !important;
    margin: 0 auto !important;
    min-height: 100vh !important;
    position: relative !important;
    box-shadow:
      0 0 0 1px rgba(0,0,0,0.06),
      0 8px 60px rgba(0,0,0,0.10) !important;
    background: linear-gradient(160deg, #f0fdf8 0%, #f8fafc 50%, #14332A 100%) !important;
  }

  /* الهيدر الثابت ضمن الحاوية */
  .app-header {
    max-width: 430px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
  }

  /* البار السفلي ضمن الحاوية */
  .bottom-nav {
    max-width: 430px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
  }

  /* الـ Splash وشاشة Auth ضمن الحاوية */
  .splash,
  #auth-screen {
    max-width: 430px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
  }

  /* الأزرار العائمة ضمن الحاوية — حساب الموقع بدقة */
  .floating-support-hub {
    position: absolute !important;
    left: 16px !important;
    right: auto !important;
  }

  .ai-assistant-fab {
    position: fixed !important;
    bottom: 90px !important; /* Above bottom nav */
    right: 16px !important;
    left: auto !important;
  }

  /* إخفاء الـ glow blobs على الديسكتوب لأنها تخرج عن الحاوية */
  .glow-blob {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
   25. تحسينات اللمس للموبايل
══════════════════════════════════════════════════════════ */
@media (hover: none) {
  .card:hover,
  .pharmacy-card:hover,
  .order-card:hover,
  .product-card:hover,
  .category-card:hover {
    transform: none;
    box-shadow: var(--patient-shadow-soft);
  }

  .profile-menu-item:hover { transform: none; }
}

/* ══════════════════════════════════════════════════════════
   26. الوضع الداكن
══════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --patient-glass: rgba(30, 41, 59, 0.8);
}

[data-theme="dark"] body {
  background: linear-gradient(160deg, #0a1628 0%, #0A1F1A 50%, #0a1628 100%) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .top-header {
  background: rgba(15, 23, 42, 0.88) !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

[data-theme="dark"] .app-header {
  background: rgba(15, 23, 42, 0.88) !important;
  border-bottom-color: rgba(255,255,255,0.06) !important;
}

[data-theme="dark"] .bottom-nav {
  background: rgba(15, 23, 42, 0.92) !important;
  border-top-color: rgba(255,255,255,0.06) !important;
}

[data-theme="dark"] .hero-banner {
  background: linear-gradient(135deg, #0A1F1A 0%, #0A1F1A 100%) !important;
}

[data-theme="dark"] .search-card,
[data-theme="dark"] .prescription-card {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(71, 85, 105, 0.3) !important;
}

[data-theme="dark"] .product-card,
[data-theme="dark"] .order-card,
[data-theme="dark"] .pharmacy-card,
[data-theme="dark"] .transaction-item,
[data-theme="dark"] .profile-menu-item,
[data-theme="dark"] .amount-btn,
[data-theme="dark"] .card,
[data-theme="dark"] .modal,
[data-theme="dark"] .upload-zone {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(71, 85, 105, 0.25) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .input-field,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: rgba(15, 23, 42, 0.9) !important;
  border-color: rgba(71, 85, 105, 0.4) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .category-card {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(71, 85, 105, 0.25) !important;
}

[data-theme="dark"] .chat-message-bubble.receiver {
  background: #0F2921 !important; /* أزرق داكن في النمط الليلي للصيدلية */
  border: none !important;
  color: white !important;
}

/* ══════════════════════════════════════════════════════════
   27. إمكانية الوصول وتقليل الحركة
══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .glow-blob,
  .hero-image,
  .support-fab::after,
  .ai-pulse {
    animation: none !important;
  }

  .card, .product-card, .pharmacy-card, .category-card,
  .order-card, .profile-menu-item {
    transition: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
   28. تأثيرات صندوق الرسائل المطور
══════════════════════════════════════════════════════════ */
.inbox-item {
  transition: all 0.25s var(--easing-spring) !important;
}
.inbox-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.05);
  border-color: var(--color-primary) !important;
}
.inbox-item.unread {
  position: relative;
}
.inbox-item.unread::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 8px;
  height: 8px;
  background-color: #FFA94D;
  border-radius: 50%;
}

/* AI Chat Styles */
.ai-user-bubble {
  align-self: flex-start;
  background: var(--color-primary);
  color: white;
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  max-width: 85%;
  font-size: 14px;
  margin-top: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: start;
  line-height: 1.5;
}
.ai-bot-bubble {
  align-self: flex-end;
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 16px 16px 16px 4px;
  max-width: 85%;
  font-size: 14px;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  text-align: start;
  line-height: 1.6;
}
.ai-error-bubble {
  align-self: flex-end;
  background: #fee2e2;
  color: #F87171;
  padding: 12px 16px;
  border-radius: 16px 16px 16px 4px;
  max-width: 85%;
  font-size: 13px;
  margin-top: 10px;
}
.ai-typing-bubble {
  align-self: flex-end;
  background: var(--bg-card);
  color: var(--text-hint);
  padding: 10px 16px;
  border-radius: 16px 16px 16px 4px;
  font-size: 13px;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }


/* --- Bento Grid UI --- */
.bento-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 0 16px; }
.bento-card { background: var(--bg-card); border-radius: 24px; padding: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.04); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.bento-card.wide { grid-column: span 2; }
.bento-card .b-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.bento-card .b-icon { font-size: 24px; padding: 10px; border-radius: 16px; display: inline-flex; justify-content: center; align-items: center; }

/* ══════════════════════════════════════════════════════════
   انتقالات لحظية بدون لاق — GPU Accelerated v4.0
══════════════════════════════════════════════════════════ */

/* ضبط الشاشات الفرعية بدون عزل رسومي أو تعارض سكرول */
.app-section {
  overflow-y: visible !important;
  overflow-x: hidden !important;
}

/* تسريع الكروت */
.order-card, .pharmacy-card, .product-card, .card {
  contain: none;
}

/* إزالة تأخير 300ms على الأزرار فقط (بدون [onclick] لمنع حجب التمرير) */
.nav-btn, button, .btn, a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer;
}

/* ضغط ناعم لأزرار التنقل */
.nav-btn:active {
  transform: scale(0.88);
  transition: transform 0.08s ease !important;
}

/* منع وميض ظهور العناصر */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* Dark mode auth tab */
[data-theme='dark'] .auth-tab.active {
  background: var(--bg-card, #1e293b);
}

#login-error, #reg-error {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
#login-form, #register-form {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity:0; transform:translateY(4px); }
  to   { opacity:1; transform:translateY(0); }
}
.auth-form .input-field:focus {
  border-color: var(--color-primary, #10b981);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
  outline: none;
}
#send-otp-btn:active, #google-login-btn:active, #google-register-btn:active {
  transform: scale(0.98);
}

/* ╔══════════════════════════════════════════════════════════════════
   ║  DAWAEI v5 — PROFESSIONAL UI UPGRADE (Talabat/Noon style)
   ╚══════════════════════════════════════════════════════════════════ */

/* ── 1. صور الأدوية: placeholder احترافي بتدرج لوني ── */
.product-image-container {
  background: linear-gradient(145deg, #f0fdf4, #ecfdf5) !important;
  border-radius: 14px !important;
  min-height: 100px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .product-image-container {
  background: linear-gradient(145deg, #0f2922, #0d2118) !important;
}
.product-image-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 30%, rgba(16,185,129,0.08), transparent 70%);
  pointer-events: none;
}
.product-img-real {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.12));
  transition: transform 0.3s var(--easing-spring);
  position: relative;
  z-index: 1;
}
.product-card:hover .product-img-real {
  transform: scale(1.07) translateY(-3px);
}
/* Emoji placeholder بحجم مناسب */
.product-image-placeholder {
  font-size: 52px !important;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  transition: transform 0.3s var(--easing-spring);
}
.product-card:hover .product-image-placeholder {
  transform: scale(1.1) translateY(-2px);
}

/* ── 2. بطاقة المنتج: أكبر، أوضح، أسرع ── */
.product-card {
  border-radius: 16px !important;
  padding: 0 0 12px !important;
  overflow: hidden !important;
  border: 1px solid rgba(16,185,129,0.06) !important;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05), 0 4px 16px rgba(0,0,0,0.03) !important;
  transition: transform 0.2s var(--easing-spring), box-shadow 0.2s ease !important;
}
.product-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 32px rgba(16,185,129,0.13) !important;
}
.product-image-container {
  border-radius: 0 !important;
  padding: 16px !important;
  min-height: 110px !important;
}
.product-details {
  padding: 10px 12px 0 !important;
  gap: 4px !important;
}
.product-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--text-primary) !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price-row {
  padding: 0 12px;
  margin-top: 8px !important;
}
.product-price {
  font-size: 15px !important;
  font-weight: 900 !important;
}
.product-quick-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  font-size: 18px !important;
  box-shadow: 0 4px 12px rgba(16,185,129,0.35) !important;
}

/* ── 3. شبكة المنتجات: 2 عمود بمسافات منظمة ── */
.products-grid {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
}

/* ── 4. شريط التنقل السفلي: أنيق مثل Talabat ── */
.bottom-nav {
  background: rgba(255,255,255,0.97) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border-top: 1px solid rgba(0,0,0,0.06) !important;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.08) !important;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
}
[data-theme="dark"] .bottom-nav {
  background: rgba(15,23,42,0.97) !important;
  border-top-color: rgba(255,255,255,0.06) !important;
}
.nav-btn {
  padding: 6px 10px !important;
  border-radius: 14px !important;
  transition: all 0.18s var(--easing-spring) !important;
  position: relative;
  min-width: 52px;
}
.nav-btn.active {
  background: rgba(16,185,129,0.1) !important;
}
.nav-btn.active .nav-icon {
  color: var(--color-primary) !important;
}
.nav-btn.active .nav-label {
  color: var(--color-primary) !important;
  font-weight: 800 !important;
}
.nav-btn:active {
  transform: scale(0.88) !important;
}
.nav-icon { font-size: 22px !important; transition: transform 0.2s var(--easing-spring) !important; }
.nav-btn.active .nav-icon { transform: scale(1.18) !important; }
.nav-label { font-size: 10px !important; font-weight: 600 !important; margin-top: 1px !important; }

/* ── 5. بانر الموقع: gradient احترافي ── */
#screen-home > div[style*="linear-gradient(135deg,var(--color-primary)"] {
  border-radius: 16px !important;
  box-shadow: 0 4px 20px rgba(0,90,200,0.2) !important;
}

/* ── 6. هيدر التطبيق: أنظف وأخف ── */
.app-header {
  padding: max(10px, env(safe-area-inset-top, 10px)) 16px 10px !important;
  background: rgba(255,255,255,0.96) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
  box-shadow: none !important;
}
[data-theme="dark"] .app-header {
  background: rgba(15,23,42,0.96) !important;
  border-bottom-color: rgba(255,255,255,0.05) !important;
}
.header-name { font-size: 16px !important; font-weight: 800 !important; }
.avatar {
  width: 38px !important;
  height: 38px !important;
  font-size: 15px !important;
  box-shadow: 0 2px 8px rgba(16,185,129,0.2) !important;
}

/* ── 7. بطاقات الصيدليات: تصميم أعمق ── */
.pharmacy-card {
  border-radius: 16px !important;
  border: none !important;
  border-right: none !important;
  background: var(--bg-card) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06) !important;
  padding: 16px !important;
  position: relative;
  overflow: hidden;
}
.pharmacy-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--color-primary), #10b981);
  border-radius: 0 16px 16px 0;
}
.pharmacy-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 28px rgba(16,185,129,0.12) !important;
}
.pharmacy-card-name { font-size: 15px !important; font-weight: 800 !important; }
.pharmacy-card-price { font-size: 18px !important; font-weight: 900 !important; }

/* ── 8. شريط البحث: احترافي ── */
.search-input {
  height: 46px !important;
  font-size: 14px !important;
  padding-right: 48px !important;
  background: var(--bg-card) !important;
  border: 1.5px solid rgba(0,0,0,0.07) !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04) !important;
  border-radius: 50px !important;
}
.search-input:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.1), 0 2px 8px rgba(0,0,0,0.06) !important;
}
[data-theme="dark"] .search-input {
  background: rgba(30,41,59,0.8) !important;
  border-color: rgba(255,255,255,0.07) !important;
}

/* ── 9. بطاقات الفئات: أجمل وأكبر ── */
.category-card {
  min-width: 82px !important;
  width: 82px !important;
  padding: 12px 6px 10px !important;
  border-radius: 16px !important;
  border: 1.5px solid rgba(0,0,0,0.04) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04) !important;
}
.category-icon-wrapper {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  font-size: 22px !important;
  background: rgba(16,185,129,0.07) !important;
}
.category-card.active .category-icon-wrapper,
.category-card:hover .category-icon-wrapper {
  background: linear-gradient(135deg, var(--color-primary), #10b981) !important;
  color: white !important;
  border-radius: 14px !important;
}
.category-name {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: var(--text-secondary) !important;
}

/* ── 10. offer-card: أنيق مثل تطبيقات التوصيل ── */
.offer-card {
  border-radius: 18px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06) !important;
  border: none !important;
  min-width: 200px !important;
  width: 200px !important;
}
.offer-card .offer-img-wrapper {
  border-radius: 14px !important;
  min-height: 90px !important;
  font-size: 48px !important;
  background: linear-gradient(145deg, #fffbeb, #fef3c7) !important;
}
[data-theme="dark"] .offer-card .offer-img-wrapper {
  background: linear-gradient(145deg, #1c1700, #2d2000) !important;
}

/* ── 11. Hero Banner: أقوى وأوضح ── */
.hero-banner {
  background: linear-gradient(135deg, #005f3f 0%, #00894f 50%, #00b36a 100%) !important;
  box-shadow: 0 8px 32px rgba(0,100,60,0.3) !important;
}

/* ── 12. search-result-item: أسرع وأوضح ── */
.search-result-item.detailed {
  padding: 14px 16px !important;
  gap: 12px !important;
}
.search-result-name-row .med-name {
  font-size: 14px !important;
  font-weight: 700 !important;
}
.search-result-price .new-price {
  font-size: 16px !important;
  font-weight: 900 !important;
}

/* ── 13. بطاقة الطلب: حدة أعمق ── */
.order-card {
  border-radius: 18px !important;
  padding: 16px !important;
}
.order-card-pharmacy { font-size: 15px !important; font-weight: 800 !important; }

/* ── 14. أزرار الإجراءات الرئيسية: أضخم وأوضح ── */
.btn-primary {
  border-radius: 50px !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
  box-shadow: 0 4px 14px rgba(16,185,129,0.25) !important;
  transition: all 0.18s var(--easing-spring) !important;
}
.btn-primary:active {
  transform: scale(0.96) !important;
  box-shadow: 0 2px 8px rgba(16,185,129,0.2) !important;
}

/* ── 15. Modal: أنظف مع rounded corners أكبر ── */
.modal {
  border-radius: 28px !important;
  overflow: hidden !important;
}
.modal-header {
  padding: 18px 20px 14px !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}
[data-theme="dark"] .modal-header {
  border-bottom-color: rgba(255,255,255,0.05) !important;
}

/* ── 16. Toast نظيف ── */
.toast {
  border-radius: 50px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
  padding: 12px 20px !important;
  font-size: 14px !important;
}

/* ── 17. Skeleton loader: أسرع وأجمل ── */
.skel {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 0%,
    rgba(0,0,0,0.03) 50%,
    rgba(0,0,0,0.06) 100%) !important;
  background-size: 200% 100% !important;
  animation: shimmer 1.4s ease-in-out infinite !important;
  border-radius: 10px !important;
}
[data-theme="dark"] .skel {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.02) 50%,
    rgba(255,255,255,0.05) 100%) !important;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 18. Dark mode تحسينات عامة ── */
[data-theme="dark"] .product-card {
  background: rgba(22,32,48,0.9) !important;
  border-color: rgba(255,255,255,0.04) !important;
}
[data-theme="dark"] .pharmacy-card {
  background: rgba(22,32,48,0.9) !important;
}
[data-theme="dark"] .category-card {
  background: rgba(22,32,48,0.9) !important;
  border-color: rgba(255,255,255,0.05) !important;
}


/* Lock background scrolling when modal is active */
body.modal-open {
  overflow: hidden !important;
  /* Removed position: fixed which was freezing Home and Orders screens */
}

/* ══════════════════════════════════════════════════════════
   🩺 SURGICAL FIX v5.0 — إصلاح الألوان والتباين (جراحي)
   يُطبَّق فوق كل القواعد السابقة دون إفسادها
══════════════════════════════════════════════════════════ */

/* ── أ. الهيدر — دعم الوضع الداكن الكامل ───────────────── */
html:not([data-theme="light"]) .app-header {
  background: rgba(15, 31, 27, 0.92) !important;
  border-bottom-color: rgba(52, 216, 158, 0.12) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html:not([data-theme="light"]) .header-greeting,
html:not([data-theme="light"]) .header-name {
  color: #D4F4E8 !important;
}

html:not([data-theme="light"]) .header-actions .btn-icon {
  color: #D4F4E8 !important;
}

/* الوضع المضيء — هيدر واضح */
html[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom-color: rgba(16, 185, 129, 0.15) !important;
  box-shadow: 0 2px 16px rgba(16, 185, 129, 0.06) !important;
}

/* ── ب. الشريط السفلي — داكن وفاتح ────────────────────── */
html:not([data-theme="light"]) .bottom-nav {
  background: rgba(15, 31, 27, 0.96) !important;
  border-top-color: rgba(52, 216, 158, 0.15) !important;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.35) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html:not([data-theme="light"]) .nav-btn {
  color: rgba(212, 244, 232, 0.55) !important;
}

html:not([data-theme="light"]) .nav-btn.active {
  color: #34D89E !important;
}

html:not([data-theme="light"]) .nav-btn::before {
  background: rgba(52, 216, 158, 0.12) !important;
}

html[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.97) !important;
  border-top-color: rgba(16, 185, 129, 0.12) !important;
  box-shadow: 0 -4px 24px rgba(16, 185, 129, 0.06) !important;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px)) !important;
}

html[data-theme="light"] .nav-btn {
  color: #6B7280 !important;
}

html[data-theme="light"] .nav-btn.active {
  color: #10B981 !important;
}

/* ── ج. تأثير bounce للأيقونة النشطة ───────────────────── */
.nav-btn.active .material-symbols-outlined {
  animation: navIconBounce 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

@keyframes navIconBounce {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-5px) scale(1.18); }
  70%  { transform: translateY(-2px) scale(1.08); }
  100% { transform: translateY(-2px) scale(1.1); }
}

/* ── د. البطاقات العامة — وضع داكن ─────────────────────── */
html:not([data-theme="light"]) .glass-card,
html:not([data-theme="light"]) .search-card,
html:not([data-theme="light"]) .feature-card,
html:not([data-theme="light"]) .order-card,
html:not([data-theme="light"]) .pharmacy-card,
html:not([data-theme="light"]) .product-card,
html:not([data-theme="light"]) .category-card,
html:not([data-theme="light"]) .transaction-item,
html:not([data-theme="light"]) .filter-btn,
html:not([data-theme="light"]) .amount-btn,
html:not([data-theme="light"]) .method-option {
  background: #13362C !important;
  border-color: #1F4A3C !important;
  color: #f0fdf4 !important;
}

html:not([data-theme="light"]) .profile-menu-item {
  background: #13362C !important;
  border-color: #1F4A3C !important;
  color: #f0fdf4 !important;
}

html:not([data-theme="light"]) .modal {
  background: #0D2820 !important;
  border: 1px solid #1F4A3C !important;
  color: #f0fdf4 !important;
}

html:not([data-theme="light"]) .modal-header {
  border-bottom-color: rgba(52, 216, 158, 0.12) !important;
}

/* ── هـ. الوضع المضيء — تباين واضح ────────────────────── */
html[data-theme="light"] .glass-card,
html[data-theme="light"] .search-card,
html[data-theme="light"] .feature-card,
html[data-theme="light"] .order-card,
html[data-theme="light"] .pharmacy-card,
html[data-theme="light"] .product-card,
html[data-theme="light"] .category-card,
html[data-theme="light"] .transaction-item,
html[data-theme="light"] .filter-btn,
html[data-theme="light"] .profile-menu-item {
  background: #FFFFFF !important;
  border-color: rgba(16, 185, 129, 0.15) !important;
  color: #111827 !important;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.06) !important;
}

html[data-theme="light"] .modal {
  background: #FFFFFF !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
  color: #111827 !important;
}

/* نصوص Light Mode واضحة */
html[data-theme="light"] .text-primary,
html[data-theme="light"] .header-name,
html[data-theme="light"] h1, html[data-theme="light"] h2,
html[data-theme="light"] h3, html[data-theme="light"] h4 {
  color: #111827 !important;
}

html[data-theme="light"] .text-secondary,
html[data-theme="light"] .text-hint,
html[data-theme="light"] .header-greeting {
  color: #4B5563 !important;
}

html[data-theme="light"] .product-title,
html[data-theme="light"] .pharmacy-card-name,
html[data-theme="light"] .order-card-pharmacy,
html[data-theme="light"] .timeline-title,
html[data-theme="light"] .modal-header h3 {
  color: #111827 !important;
}

html[data-theme="light"] .product-category,
html[data-theme="light"] .order-card-id,
html[data-theme="light"] .pharmacy-card-meta,
html[data-theme="light"] .timeline-desc {
  color: #6B7280 !important;
}

/* ── و. Skeleton Loading محسّن ─────────────────────────── */
.skeleton-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(16, 185, 129, 0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

html:not([data-theme="light"]) .skeleton-card {
  background: #13362C;
  border-color: #1F4A3C;
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  margin-bottom: 10px;
  animation: skeletonShimmer 1.6s ease-in-out infinite;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 0%,
    rgba(0,0,0,0.12) 50%,
    rgba(0,0,0,0.06) 100%);
  background-size: 300% 100%;
}

.skeleton-line.short  { width: 55%; }
.skeleton-line.medium { width: 75%; }
.skeleton-line.full   { width: 100%; }
.skeleton-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  animation: skeletonShimmer 1.6s ease-in-out infinite;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 0%, rgba(0,0,0,0.12) 50%, rgba(0,0,0,0.06) 100%);
  background-size: 300% 100%;
}

html:not([data-theme="light"]) .skeleton-line,
html:not([data-theme="light"]) .skeleton-circle {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 300% 100%;
}

@keyframes skeletonShimmer {
  0%   { background-position: 150% 0; }
  100% { background-position: -150% 0; }
}

/* ── ز. إصلاح حقل البحث في الوضع المضيء ─────────────── */
html[data-theme="light"] .search-input {
  background: #F9FAFB !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
  color: #111827 !important;
}

html[data-theme="light"] .search-input:focus {
  border-color: #10B981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
  background: #FFFFFF !important;
}

html[data-theme="light"] .search-input::placeholder {
  color: #9CA3AF !important;
}

/* ── ح. أزرار الفلتر — وضع داكن ───────────────────────── */
html:not([data-theme="light"]) .filter-btn {
  background: #13362C !important;
  border-color: #1F4A3C !important;
  color: #D4F4E8 !important;
}

html:not([data-theme="light"]) .filter-btn.active {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #0A1F1A !important;
}

html[data-theme="light"] .filter-btn {
  background: #F9FAFB !important;
  border-color: rgba(16, 185, 129, 0.2) !important;
  color: #374151 !important;
}

html[data-theme="light"] .filter-btn.active {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
}

/* ── ط. بطاقة الحساب (Profile) — وضع داكن ─────────────── */
html:not([data-theme="light"]) .profile-card {
  color: #f0fdf4 !important;
}

html:not([data-theme="light"]) .profile-card h3,
html:not([data-theme="light"]) .profile-card p {
  color: #D4F4E8 !important;
}

/* ── ي. إصلاح background الـ App Screen ──────────────── */
html:not([data-theme="light"]) #app-screen,
html:not([data-theme="light"]) .app-main,
html:not([data-theme="light"]) .app-section {
  background-color: #0F1F1B !important;
}

html[data-theme="light"] #app-screen,
html[data-theme="light"] .app-main,
html[data-theme="light"] .app-section {
  background-color: #F4FAF7 !important;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(16,185,129,0.04), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(16,185,129,0.03), transparent 40%) !important;
}

/* ── ك. Wallet Card — فاتح ─────────────────────────────── */
html[data-theme="light"] .wallet-card {
  background: linear-gradient(135deg, #059669 0%, #10B981 100%) !important;
}

/* ── ل. splash screen ─────────────────────────────────── */
html[data-theme="light"] .splash {
  background: linear-gradient(160deg, #10B981 0%, #059669 100%) !important;
}


/* ============================================================
   ══ 2026 PATIENT UI PRO MAX UPGRADE ══
   Floating Capsule Bottom Nav | Glass Medical Cards | Apple iOS 18
   ============================================================ */

/* ── Floating Apple iOS 18 Capsule Bottom Nav ── */
.bottom-nav {
  position: fixed !important;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  left: 16px !important;
  right: 16px !important;
  width: calc(100% - 32px) !important;
  max-width: 480px !important;
  margin: 0 auto !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 12px 35px -8px rgba(13, 148, 136, 0.22), 0 4px 12px -4px rgba(0, 0, 0, 0.08) !important;
  padding: 8px 12px !important;
  z-index: 1000 !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

[data-theme="dark"] .bottom-nav {
  background: rgba(18, 40, 34, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 12px 35px -8px rgba(0, 0, 0, 0.5) !important;
}

.bottom-nav .nav-item {
  border-radius: 20px !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.bottom-nav .nav-item.active {
  background: rgba(13, 148, 136, 0.12) !important;
  color: #10B981 !important;
  transform: translateY(-2px);
}

[data-theme="dark"] .bottom-nav .nav-item.active {
  background: rgba(20, 184, 166, 0.2) !important;
  color: #34D89E !important;
}

/* ── Medical Header & Hero ── */
.app-header {
  backdrop-filter: none !important;
  background: rgba(255, 255, 255, 0.8) !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.4) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="dark"] .app-header {
  background: rgba(15, 31, 27, 0.92) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* ── Pharmacy & Medicine Cards ── */
.pharmacy-card, .medicine-card {
  border-radius: 20px !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  background: #ffffff !important;
}

[data-theme="dark"] .pharmacy-card, [data-theme="dark"] .medicine-card {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.pharmacy-card:hover, .medicine-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 16px 35px -8px rgba(13, 148, 136, 0.18) !important;
}

/* ── Order Trackers ── */
.order-card {
  border-left: 4px solid #10B981 !important;
}

/* ══════════════════════════════════════════════════════════════
   ⭐ تصميم كروت الأدوية العالمي (International Pharmacy App Standard)
   مستوحى من أقوى تطبيقات الصيدليات العالمية (GoodRx, Boots UK, Alto Pharmacy)
══════════════════════════════════════════════════════════════ */

.med-card-world {
  background: #14332A !important;
  border: 1.5px solid rgba(16, 185, 129, 0.18) !important;
  border-radius: 18px !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  cursor: pointer !important;
}

.med-card-world:hover {
  transform: translateY(-6px) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.18) !important;
}

/* مسرح عرض صورة الدواء (Photo Spotlight Stage) */
.med-photo-stage {
  width: 100% !important;
  height: 125px !important;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.22) 0%, rgba(10, 31, 26, 0.75) 75%, rgba(10, 31, 26, 0.95) 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.12) !important;
  overflow: hidden !important;
  padding: 14px !important;
}

.med-box-img {
  max-width: 90px !important;
  max-height: 95px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4)) !important;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.med-card-world:hover .med-box-img {
  transform: scale(1.12) translateY(-4px) !important;
}

.med-badge-tag {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  background: rgba(255, 169, 77, 0.95) !important;
  color: #0A1F1A !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  z-index: 3 !important;
  box-shadow: 0 2px 8px rgba(255, 169, 77, 0.35) !important;
  letter-spacing: -0.2px !important;
}

.med-card-body {
  padding: 12px 14px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  flex: 1 !important;
  justify-content: space-between !important;
}

.med-cat-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #34D89E !important;
  opacity: 0.9 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.med-title-text {
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
  line-height: 1.35 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.med-sub-text {
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  color: #94A3B8 !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.med-footer-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-top: 6px !important;
  padding-top: 8px !important;
  border-top: 1px dashed rgba(16, 185, 129, 0.15) !important;
}

.med-price-display {
  font-family: var(--font-mono), 'JetBrains Mono', monospace !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #34D89E !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 3px !important;
}

.med-price-display small {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #10B981 !important;
}

.med-actions-flex {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.med-btn-order {
  background: #10B981 !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 6px 12px !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
  transition: all 0.2s ease !important;
}

.med-btn-order:hover {
  background: #34D89E !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45) !important;
}

.med-btn-order-circle {
  background: #10B981 !important;
  color: #FFFFFF !important;
  border: 1px solid #10B981 !important;
  border-radius: 10px !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25) !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}

.med-btn-order-circle:hover {
  background: #34D89E !important;
  border-color: #34D89E !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4) !important;
}

.med-btn-icon {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10B981 !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  border-radius: 10px !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
}

.med-btn-icon:hover {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34D89E !important;
}

/* ── توحيد لغة التصميم للأزرار الرئيسية والـ CTA ── */
.btn-primary,
button.btn-primary,
#save-reminder-action-btn,
#confirm-order-action-btn,
#save-edit-profile-btn,
#submit-rating-btn,
#open-add-reminder-btn,
#upload-prescription-btn {
  background-color: #10B981 !important;
  background: #10B981 !important;
  color: #FFFFFF !important;
  border: none !important;
}

.btn-primary:hover,
button.btn-primary:hover,
#open-add-reminder-btn:hover,
#upload-prescription-btn:hover {
  background-color: #0d9488 !important; /* درجة أغمق متناسقة عند الحوم */
  background: #0d9488 !important;
}





/* ══════════════════════════════════════════════════════════════
   ══ SURGICAL FIX: Overlays, Modals, FAB Button & Clean Spacing ══
   ══════════════════════════════════════════════════════════════ */

/* 1. Modal Overlays (Highest Priority, Never blocked by Bottom Nav) */
.overlay,
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 100000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: max(16px, env(safe-area-inset-top, 16px)) max(16px, env(safe-area-inset-right, 16px)) max(16px, env(safe-area-inset-bottom, 16px)) max(16px, env(safe-area-inset-left, 16px)) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.overlay.hidden,
.modal-overlay.hidden,
.overlay[style*="display: none"],
.overlay[style*="display:none"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 2. Bottom Nav (Full Width, Visible Overflow so FAB circle is never split) */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  min-height: calc(60px + env(safe-area-inset-bottom, 12px)) !important;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 12px)) !important;
  border-radius: 20px 20px 0 0 !important;
  background: rgba(15, 23, 42, 0.98) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4) !important;
  z-index: 9999 !important;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  overflow: visible !important; /* Prevents FAB button circle from being chopped */
  box-sizing: border-box !important;
}

[data-theme="light"] .bottom-nav,
html[data-theme="light"] .bottom-nav {
  background: rgba(255, 255, 255, 0.98) !important;
  border-top-color: rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08) !important;
}

.nav-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
  max-width: 80px !important;
  padding: 4px 6px !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  gap: 3px !important;
  cursor: pointer !important;
  border-radius: 12px !important;
  overflow: visible !important;
  -webkit-tap-highlight-color: transparent !important;
  box-sizing: border-box !important;
}

.nav-btn svg, .nav-btn .nav-svg {
  width: 22px !important;
  height: 22px !important;
  stroke: #94a3b8 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-btn.active {
  color: #10b981 !important;
}

.nav-btn.active svg, .nav-btn.active .nav-svg {
  stroke: #10b981 !important;
  transform: scale(1.12) !important;
}

/* 3. Elevated Prescription FAB Button (Complete Circle, Never Split) */
.nav-btn.upload-fab {
  overflow: visible !important;
  position: relative !important;
}

.nav-btn.upload-fab .fab-circle {
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  min-height: 48px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: -24px !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
  border: 3.5px solid #0f172a !important;
  box-sizing: border-box !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  flex-shrink: 0 !important;
}

[data-theme="light"] .nav-btn.upload-fab .fab-circle,
html[data-theme="light"] .nav-btn.upload-fab .fab-circle {
  border-color: #ffffff !important;
}

.nav-btn.upload-fab .fab-circle svg {
  stroke: #ffffff !important;
  width: 22px !important;
  height: 22px !important;
}

/* 4. Natural, Balanced Scroll Clearance (No Excessive Dead Space) */
.app-main {
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overflow-x: hidden !important;
  padding-bottom: calc(85px + env(safe-area-inset-bottom, 16px)) !important;
  box-sizing: border-box !important;
}

.app-section {
  padding: var(--space-md) !important;
  padding-bottom: 20px !important;
  box-sizing: border-box !important;
}

#screen-profile, #screen-home, #screen-orders, #screen-cart, #screen-chat {
  padding-bottom: 20px !important;
}


/* ══════════════════════════════════════════════════════════════════
   3. Master Overrides & High-Contrast Light Mode Engine (2026)
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   3. Essential Component Definitions (Popular Products, Chips, Symptoms)
   ══════════════════════════════════════════════════════════════════ */

/* A. شريط السحب والبطاقات للأدوية الأكثر طلباً */
.products-horizontal-scroll {
  display: flex !important;
  gap: 12px !important;
  overflow-x: auto !important;
  padding-bottom: 12px !important;
  scroll-snap-type: x mandatory !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
}
.products-horizontal-scroll::-webkit-scrollbar {
  display: none !important;
}

#popular-products-grid .popular-product-card,
.popular-product-card {
  flex: 0 0 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  scroll-snap-align: start !important;
  background: var(--bg-card, #16211D) !important;
  border: 1.5px solid var(--border-color, rgba(16, 185, 129, 0.25)) !important;
  border-radius: 18px !important;
  padding: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-shadow: var(--shadow-card, 0 6px 20px rgba(0,0,0,0.3)) !important;
  position: relative !important;
  cursor: pointer !important;
  user-select: none !important;
  touch-action: manipulation !important;
  box-sizing: border-box !important;
  transition: transform 0.18s ease, border-color 0.18s ease !important;
}
.popular-product-card:active {
  transform: scale(0.97) !important;
}

.popular-product-photo-stage {
  width: 100% !important;
  height: 100px !important;
  border-radius: 14px !important;
  background: rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(16, 185, 129, 0.15) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px !important;
  margin-bottom: 8px !important;
  position: relative !important;
}

.popular-badge-pill {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  background: rgba(16, 185, 129, 0.2) !important;
  color: #10B981 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  border-radius: 6px !important;
  font-size: 9.5px !important;
  font-weight: 800 !important;
  padding: 2px 6px !important;
  z-index: 2 !important;
}

.popular-title {
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: var(--text-primary, #FFFFFF) !important;
  line-height: 1.35 !important;
  height: 34px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  margin-bottom: 4px !important;
}

.popular-sub {
  font-size: 10.5px !important;
  color: var(--text-secondary, #94A3B8) !important;
  margin-bottom: 6px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-weight: 500 !important;
}

.popular-pharmacy-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 4px !important;
  background: rgba(0, 0, 0, 0.2) !important;
  padding: 4px 8px !important;
  border-radius: 8px !important;
  margin-bottom: 8px !important;
}

.popular-category-chips-bar {
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  padding-bottom: 10px !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}
.popular-category-chips-bar::-webkit-scrollbar {
  display: none !important;
}

.popular-cat-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #CBD5E1 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  font-family: inherit !important;
}
.popular-cat-chip.active {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35) !important;
}

/* B. بطاقات الأعراض الشائعة (Symptom Cards) */
.symptom-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 95px !important;
  max-width: 115px !important;
  background: var(--bg-card, #16211D) !important;
  border: 1.5px solid var(--border-color, rgba(16, 185, 129, 0.12)) !important;
  border-radius: 16px !important;
  padding: 12px 6px 10px !important;
  cursor: pointer !important;
  box-shadow: var(--shadow-card, 0 2px 10px rgba(0,0,0,0.08)) !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease, border-color 0.2s ease !important;
}
.symptom-card:active {
  transform: scale(0.96) !important;
}

.symptom-icon-wrapper {
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.symptom-headache { background: rgba(239, 68, 68, 0.14) !important; }
.symptom-stomach  { background: rgba(245, 158, 11, 0.14) !important; }
.symptom-flu      { background: rgba(6, 182, 212, 0.14) !important; }
.symptom-allergy  { background: rgba(16, 185, 129, 0.14) !important; }

.symptom-name {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: var(--text-primary, #FFFFFF) !important;
  text-align: center !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 90px !important;
}

/* ══════════════════════════════════════════════════════════════════
   4. AI Pharmacist & Medical Diagnosis (High-Contrast & Clarity)
   ══════════════════════════════════════════════════════════════════ */
.ai-bot-bubble {
  align-self: flex-start !important;
  background: #162520 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  color: #FFFFFF !important;
  padding: 14px 16px !important;
  border-radius: 4px 18px 18px 18px !important;
  max-width: 90% !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}

.ai-bot-bubble .ai-reply-content {
  font-size: 14.5px !important;
  line-height: 1.8 !important;
  font-weight: 600 !important;
  color: #FFFFFF !important;
  letter-spacing: 0.1px !important;
}

.ai-bot-bubble .ai-reply-content strong {
  color: #34D89E !important;
  font-weight: 800 !important;
}

.ai-bot-disclaimer {
  margin-top: 12px !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  font-size: 11.5px !important;
  line-height: 1.6 !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1.5px solid #FFA94D !important;
  color: #FDE68A !important;
  font-weight: 600 !important;
}

.ai-bot-disclaimer .disclaimer-svg {
  color: #FFA94D !important;
  flex-shrink: 0 !important;
  margin-top: 2px !important;
}

.ai-top-disclaimer-bar {
  background: rgba(239, 68, 68, 0.14) !important;
  border-bottom: 1.5px solid rgba(239, 68, 68, 0.35) !important;
}
.ai-top-disclaimer-bar .disclaimer-text {
  color: #FCA5A5 !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
}

/* ══════════════════════════════════════════════════════════════════
   5. MASTER LIGHT MODE ENGINE (Zero Invisible Text, WCAG AAA)
   ══════════════════════════════════════════════════════════════════ */
html[data-theme="light"],
body.light-theme,
html.light-theme {
  --bg-primary:           #F8FAFC !important;
  --bg-surface:           #FFFFFF !important;
  --bg-surface-elevated:  #F1F5F9 !important;
  --bg-input:             #F1F5F9 !important;
  --bg-page:              #F8FAFC !important;
  --bg-card:              #FFFFFF !important;
  --bg-container:         #F1F5F9 !important;
  --bg-header:            #FFFFFF !important;
  --text-primary:         #0F172A !important;
  --text-secondary:       #475569 !important;
  --text-muted:           #64748B !important;
  --text-hint:            #64748B !important;
  --text-main:            #0F172A !important;
  --border-color:         #E2E8F0 !important;
  --border-subtle:        #F1F5F9 !important;
}

/* Body & Containers */
html[data-theme="light"] body,
body.light-theme {
  background: #F8FAFC !important;
  color: #0F172A !important;
}

/* Medicine Titles & Text Overrides (Overriding patient.css line 3750) */
html[data-theme="light"] .med-title-text,
body.light-theme .med-title-text,
html[data-theme="light"] .popular-title,
body.light-theme .popular-title,
html[data-theme="light"] .product-title,
body.light-theme .product-title,
html[data-theme="light"] .section-title,
body.light-theme .section-title,
html[data-theme="light"] h1,
html[data-theme="light"] h2:not(.banner-white-text),
html[data-theme="light"] h3:not(.banner-white-text),
html[data-theme="light"] h4:not(.banner-white-text) {
  color: #0F172A !important;
}

html[data-theme="light"] .med-sub-text,
body.light-theme .med-sub-text,
html[data-theme="light"] .popular-sub,
body.light-theme .popular-sub {
  color: #475569 !important;
}

/* Quick Action Cards in Home */
html[data-theme="light"] .quick-action-card,
body.light-theme .quick-action-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] .quick-action-card span,
body.light-theme .quick-action-card span {
  color: #0F172A !important;
  font-weight: 700 !important;
}

/* Search Card & Search Input */
html[data-theme="light"] .search-card,
body.light-theme .search-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] .search-input,
html[data-theme="light"] #medicine-search,
body.light-theme .search-input {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}
html[data-theme="light"] .search-input::placeholder,
body.light-theme .search-input::placeholder {
  color: #64748B !important;
}

/* Search Chips */
html[data-theme="light"] .search-chip,
body.light-theme .search-chip {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
}

/* Popular Product Cards */
html[data-theme="light"] .popular-product-card,
body.light-theme .popular-product-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] .popular-product-photo-stage,
body.light-theme .popular-product-photo-stage {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
}
html[data-theme="light"] .popular-pharmacy-row,
body.light-theme .popular-pharmacy-row {
  background: #F1F5F9 !important;
}
html[data-theme="light"] .popular-actions-row .luxury-direction-btn,
body.light-theme .popular-actions-row .luxury-direction-btn {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
}

/* Categories and Symptoms */
html[data-theme="light"] .category-card,
body.light-theme .category-card,
html[data-theme="light"] .symptom-card,
body.light-theme .symptom-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .category-name,
body.light-theme .category-name,
html[data-theme="light"] .symptom-name,
body.light-theme .symptom-name {
  color: #0F172A !important;
  font-weight: 700 !important;
}

/* Category Chips Bar */
html[data-theme="light"] .popular-cat-chip,
body.light-theme .popular-cat-chip {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
}
html[data-theme="light"] .popular-cat-chip.active,
body.light-theme .popular-cat-chip.active {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
}

/* Profile / Settings / Cards */
html[data-theme="light"] .user-card,
body.light-theme .user-card,
html[data-theme="light"] .stat-card,
body.light-theme .stat-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .user-card h3,
body.light-theme .user-card h3,
html[data-theme="light"] .stat-card h4,
body.light-theme .stat-card h4 {
  color: #0F172A !important;
}

html[data-theme="light"] .profile-menu-item,
body.light-theme .profile-menu-item {
  border-bottom-color: #E2E8F0 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .settings-card-block,
body.light-theme .settings-card-block {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
}
html[data-theme="light"] .settings-label,
body.light-theme .settings-label {
  color: #0F172A !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .settings-input,
body.light-theme .settings-input {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}
html[data-theme="light"] .settings-card-title,
body.light-theme .settings-card-title {
  color: #0F172A !important;
}

/* Orders Filter & Cards */
html[data-theme="light"] .orders-filter .filter-btn,
body.light-theme .orders-filter .filter-btn {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #334155 !important;
}
html[data-theme="light"] .orders-filter .filter-btn.active,
body.light-theme .orders-filter .filter-btn.active {
  background: #10B981 !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
}
html[data-theme="light"] .order-card-v4,
body.light-theme .order-card-v4,
html[data-theme="light"] .order-card,
body.light-theme .order-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}

/* AI Chat in Light Mode */
html[data-theme="light"] .ai-bot-bubble,
body.light-theme .ai-bot-bubble {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] .ai-reply-content,
body.light-theme .ai-reply-content {
  color: #0F172A !important;
  font-size: 14.5px !important;
  line-height: 1.8 !important;
  font-weight: 600 !important;
}
html[data-theme="light"] .ai-reply-content strong,
body.light-theme .ai-reply-content strong {
  color: #006c49 !important;
  font-weight: 800 !important;
}
html[data-theme="light"] .ai-bot-disclaimer,
body.light-theme .ai-bot-disclaimer {
  background: #FFFBEB !important;
  border: 1.5px solid #F59E0B !important;
  color: #78350F !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .ai-bot-disclaimer .disclaimer-svg,
body.light-theme .ai-bot-disclaimer .disclaimer-svg {
  color: #D97706 !important;
}
html[data-theme="light"] .ai-top-disclaimer-bar,
body.light-theme .ai-top-disclaimer-bar {
  background: #FEF3C7 !important;
  border-bottom: 1.5px solid #F59E0B !important;
}
html[data-theme="light"] .ai-top-disclaimer-bar .disclaimer-text,
body.light-theme .ai-top-disclaimer-bar .disclaimer-text {
  color: #92400E !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .ai-top-disclaimer-bar .disclaimer-icon,
body.light-theme .ai-top-disclaimer-bar .disclaimer-icon {
  color: #D97706 !important;
}
html[data-theme="light"] .ai-input-bar,
body.light-theme .ai-input-bar {
  background: #FFFFFF !important;
  border-top: 1.5px solid #E2E8F0 !important;
}
html[data-theme="light"] .ai-text-input,
body.light-theme .ai-text-input {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}
html[data-theme="light"] .ai-start-card,
body.light-theme .ai-start-card {
  background: #F8FAFC !important;
  border: 1.5px solid #E2E8F0 !important;
}
html[data-theme="light"] .ai-start-title,
body.light-theme .ai-start-title {
  color: #0F172A !important;
}
html[data-theme="light"] .ai-start-desc,
body.light-theme .ai-start-desc {
  color: #475569 !important;
}

/* Modals in Light Mode */
html[data-theme="light"] .modal-content,
body.light-theme .modal-content,
html[data-theme="light"] .modal-sheet,
body.light-theme .modal-sheet {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
}
html[data-theme="light"] .modal-header,
body.light-theme .modal-header {
  background: #F8FAFC !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
  color: #0F172A !important;
}
html[data-theme="light"] .modal-header h3,
body.light-theme .modal-header h3 {
  color: #0F172A !important;
}

/* Pharmacy Light Mode Global Matchers */
html[data-theme="light"].pharmacy-body,
html[data-theme="light"] body.pharmacy-body,
body.pharmacy-body.theme-light {
  background-color: #F4FAF7 !important;
  background: #F4FAF7 !important;
  color: #111827 !important;
}

/* ══════════════════════════════════════════════════════════════════
   6. 2026 COMPOUND ORDER CARDS & CLICK & COLLECT TRACKING (21st.dev)
   ══════════════════════════════════════════════════════════════════ */

/* A. 21st.dev Compound Order Card */
.order-card {
  background: var(--bg-card, #16211D) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  padding: 16px 18px !important;
  margin-bottom: 14px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  position: relative !important;
  cursor: pointer !important;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease !important;
  user-select: none !important;
  touch-action: manipulation !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.order-card:hover {
  border-color: rgba(16, 185, 129, 0.4) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
}

.order-card:active {
  transform: scale(0.985) !important;
}

/* B. Interactive Order ID Chip with Quick Copy */
.order-card-id-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text-primary, #FFFFFF) !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.order-card-id-chip:hover {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #10B981 !important;
}

.order-card-id-chip .icon-copy {
  font-size: 13px !important;
  opacity: 0.65 !important;
  transition: opacity 0.15s ease !important;
}

.order-card-id-chip:hover .icon-copy {
  opacity: 1 !important;
}

/* C. Live Status Pip Animation */
.live-status-pip {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  position: relative !important;
  margin-inline-end: 6px !important;
  vertical-align: middle !important;
}

.live-status-pip::after {
  content: '' !important;
  position: absolute !important;
  top: -3px !important;
  left: -3px !important;
  width: 13px !important;
  height: 13px !important;
  border-radius: 50% !important;
  background: inherit !important;
  opacity: 0.6 !important;
  animation: live-pip-pulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite !important;
}

@keyframes live-pip-pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.status-pip-pending { background-color: #FFA94D !important; }
.status-pip-confirmed, .status-pip-patient_confirmed { background-color: #38BDF8 !important; }
.status-pip-preparing { background-color: #10B981 !important; }
.status-pip-ready { background-color: #00E599 !important; }

/* D. Items Preview Capsule */
.order-items-preview {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  font-size: 12px !important;
  color: var(--text-secondary, #94A3B8) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.order-items-preview .order-items-text {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 !important;
}

/* E. Quick Tracking & Action Buttons */
.order-track-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.35) !important;
  color: #10B981 !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
}

.order-track-btn:hover {
  background: #10B981 !important;
  color: #FFFFFF !important;
}

/* F. Filter Chips Navigation */
.orders-filter {
  display: flex !important;
  gap: 8px !important;
  overflow-x: auto !important;
  padding-bottom: 8px !important;
  margin-bottom: 16px !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}

.orders-filter::-webkit-scrollbar {
  display: none !important;
}

.orders-filter .filter-btn {
  flex: 0 0 auto !important;
  padding: 8px 16px !important;
  border-radius: 9999px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--text-secondary, #94A3B8) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer !important;
}

.orders-filter .filter-btn:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #FFFFFF !important;
}

.orders-filter .filter-btn.active {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3) !important;
}

/* G. High Contrast Light Mode Overrides for Order Components */
html[data-theme="light"] .order-card,
body.light-theme .order-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .order-card:hover,
body.light-theme .order-card:hover {
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.08) !important;
}

html[data-theme="light"] .order-card-id-chip,
body.light-theme .order-card-id-chip {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .order-card-id-chip:hover,
body.light-theme .order-card-id-chip:hover {
  background: #ECFDF5 !important;
  border-color: #10B981 !important;
  color: #059669 !important;
}

html[data-theme="light"] .order-items-preview,
body.light-theme .order-items-preview {
  background: #F8FAFC !important;
  border-color: #E2E8F0 !important;
  color: #475569 !important;
}

html[data-theme="light"] .order-track-btn,
body.light-theme .order-track-btn {
  background: #ECFDF5 !important;
  border-color: #A7F3D0 !important;
  color: #059669 !important;
}

html[data-theme="light"] .order-track-btn:hover,
body.light-theme .order-track-btn:hover {
  background: #10B981 !important;
  color: #FFFFFF !important;
}

html[data-theme="light"] .orders-filter .filter-btn,
body.light-theme .orders-filter .filter-btn {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .orders-filter .filter-btn.active,
body.light-theme .orders-filter .filter-btn.active {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
  border-color: #10B981 !important;
  color: #FFFFFF !important;
}

/* ══════════════════════════════════════════════════════════════════
   7. UI/UX PRO MAX (2026): WCAG AAA CONTRAST & LUXURY MEDICAL SUITE
   ══════════════════════════════════════════════════════════════════ */

/* A. AI Pharmacist Suite (#screen-ai & Bot Components) */
.ai-header {
  background: #10221B !important;
  border-bottom: 1.5px solid rgba(52, 216, 158, 0.25) !important;
}

.ai-header .ai-header-title,
.ai-header-title {
  color: #FFFFFF !important;
  font-size: 16.5px !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

.ai-header .ai-header-status,
.ai-header-status {
  color: #34D89E !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
}

.ai-header .ai-header-badge,
.ai-header-badge {
  background: rgba(52, 216, 158, 0.18) !important;
  color: #34D89E !important;
  border: 1px solid rgba(52, 216, 158, 0.4) !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
}

.ai-top-disclaimer-bar {
  background: rgba(245, 158, 11, 0.1) !important;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.ai-top-disclaimer-bar .disclaimer-icon {
  color: #FFA94D !important;
}

.ai-top-disclaimer-bar .disclaimer-text {
  color: #FDE68A !important;
  font-weight: 600 !important;
  font-size: 11.5px !important;
}

.ai-top-disclaimer-bar .disclaimer-text strong {
  color: #FFA94D !important;
  font-weight: 800 !important;
}

/* AI Welcome / Start Notice Card */
.ai-start-card,
.chat-start-notice {
  background: #142822 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

.ai-start-card .ai-start-title,
.ai-start-title {
  color: #FFFFFF !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

.ai-start-card .ai-start-desc,
.ai-start-desc,
.chat-start-notice p {
  color: #CBD5E1 !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  font-weight: 500 !important;
}

/* AI Chat Input Bar & Field */
.ai-chat-input-wrapper {
  background: #0B1713 !important;
  border-top: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

#ai-chat-input,
.ai-text-input {
  background: #142822 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.3) !important;
  color: #FFFFFF !important;
  font-size: 15px !important;
  border-radius: 24px !important;
  padding: 0 18px !important;
  height: 48px !important;
  outline: none !important;
  font-weight: 500 !important;
}

#ai-chat-input::placeholder,
.ai-text-input::placeholder {
  color: #94A3B8 !important;
  opacity: 1 !important;
}

#ai-chat-input:focus,
.ai-text-input:focus {
  border-color: #10B981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

/* B. Verified Pharmacy Order Modal (#verified-pharmacy-order-modal) */
.verified-order-card {
  background: #0E1C17 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.35) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
  border-radius: 22px !important;
  color: #FFFFFF !important;
}

.verified-order-title {
  color: #FFFFFF !important;
  font-size: 20px !important;
  font-weight: 800 !important;
}

.verified-order-ph-name,
#verified-ph-target-name {
  color: #34D89E !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

.verified-order-summary-card {
  background: rgba(16, 185, 129, 0.09) !important;
  border: 1.5px solid rgba(52, 216, 158, 0.25) !important;
  color: #FFFFFF !important;
}

.verified-order-summary-card span {
  color: #FFFFFF !important;
}

.verified-order-pickup-box {
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1.5px solid #10B981 !important;
}

.verified-order-pickup-title {
  color: #FFFFFF !important;
  font-weight: 800 !important;
  font-size: 13px !important;
}

.verified-order-pickup-desc {
  color: #A7F3D0 !important;
  font-weight: 600 !important;
  font-size: 11px !important;
}

.verified-order-input-label {
  color: #FFFFFF !important;
  font-weight: 800 !important;
  font-size: 13px !important;
}

#verified-order-medicines-input,
.verified-order-textarea {
  background: #0B1713 !important;
  border: 1.5px solid rgba(52, 216, 158, 0.35) !important;
  color: #FFFFFF !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  border-radius: 14px !important;
}

#verified-order-medicines-input::placeholder,
.verified-order-textarea::placeholder {
  color: #94A3B8 !important;
  opacity: 1 !important;
}

#verified-order-medicines-input:focus,
.verified-order-textarea:focus {
  border-color: #10B981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25) !important;
}

.verified-order-notice-box {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1.5px dashed rgba(52, 216, 158, 0.35) !important;
}

.verified-order-notice-text {
  color: #E2E8F0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

/* C. Universal Close Buttons (btn-close-universal & modal close buttons) */
.btn-close-universal,
.screen-close-btn,
.btn-back-ai-close,
.verified-order-close-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease !important;
  flex-shrink: 0 !important;
}

.btn-close-universal:active,
.screen-close-btn:active,
.btn-back-ai-close:active,
.verified-order-close-btn:active {
  transform: scale(0.92) !important;
  background: rgba(255, 255, 255, 0.15) !important;
}

/* D. Light Mode Overrides for UI/UX Pro Max (Zero Invisible Text) */
html[data-theme="light"] .ai-header,
body.light-theme .ai-header {
  background: #FFFFFF !important;
  border-bottom: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] .ai-header-title,
body.light-theme .ai-header-title {
  color: #0F172A !important;
}

html[data-theme="light"] .ai-header-status,
body.light-theme .ai-header-status {
  color: #059669 !important;
}

html[data-theme="light"] .ai-header-badge,
body.light-theme .ai-header-badge {
  background: #ECFDF5 !important;
  color: #059669 !important;
  border-color: #A7F3D0 !important;
}

html[data-theme="light"] .ai-top-disclaimer-bar,
body.light-theme .ai-top-disclaimer-bar {
  background: #FFFBEB !important;
  border-bottom: 1.5px solid #FDE68A !important;
}

html[data-theme="light"] .ai-top-disclaimer-bar .disclaimer-icon,
body.light-theme .ai-top-disclaimer-bar .disclaimer-icon {
  color: #D97706 !important;
}

html[data-theme="light"] .ai-top-disclaimer-bar .disclaimer-text,
body.light-theme .ai-top-disclaimer-bar .disclaimer-text {
  color: #78350F !important;
}

html[data-theme="light"] .ai-top-disclaimer-bar .disclaimer-text strong,
body.light-theme .ai-top-disclaimer-bar .disclaimer-text strong {
  color: #B45309 !important;
}

html[data-theme="light"] .ai-start-card,
body.light-theme .ai-start-card,
html[data-theme="light"] .chat-start-notice,
body.light-theme .chat-start-notice {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .ai-start-title,
body.light-theme .ai-start-title {
  color: #0F172A !important;
}

html[data-theme="light"] .ai-start-desc,
body.light-theme .ai-start-desc,
html[data-theme="light"] .chat-start-notice p,
body.light-theme .chat-start-notice p {
  color: #475569 !important;
}

html[data-theme="light"] .ai-chat-input-wrapper,
body.light-theme .ai-chat-input-wrapper {
  background: #FFFFFF !important;
  border-top: 1.5px solid #E2E8F0 !important;
}

html[data-theme="light"] #ai-chat-input,
body.light-theme #ai-chat-input,
html[data-theme="light"] .ai-text-input,
body.light-theme .ai-text-input {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] #ai-chat-input::placeholder,
body.light-theme #ai-chat-input::placeholder,
html[data-theme="light"] .ai-text-input::placeholder,
body.light-theme .ai-text-input::placeholder {
  color: #64748B !important;
}

html[data-theme="light"] .verified-order-card,
body.light-theme .verified-order-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .verified-order-title,
body.light-theme .verified-order-title {
  color: #0F172A !important;
}

html[data-theme="light"] .verified-order-ph-name,
body.light-theme .verified-order-ph-name,
html[data-theme="light"] #verified-ph-target-name,
body.light-theme #verified-ph-target-name {
  color: #059669 !important;
}

html[data-theme="light"] .verified-order-summary-card,
body.light-theme .verified-order-summary-card {
  background: #F0FDF4 !important;
  border: 1.5px solid #BBF7D0 !important;
}

html[data-theme="light"] .verified-order-summary-card span,
body.light-theme .verified-order-summary-card span {
  color: #0F172A !important;
}

html[data-theme="light"] .verified-order-pickup-box,
body.light-theme .verified-order-pickup-box {
  background: #ECFDF5 !important;
  border-color: #10B981 !important;
}

html[data-theme="light"] .verified-order-pickup-title,
body.light-theme .verified-order-pickup-title {
  color: #065F46 !important;
}

html[data-theme="light"] .verified-order-pickup-desc,
body.light-theme .verified-order-pickup-desc {
  color: #047857 !important;
}

html[data-theme="light"] .verified-order-input-label,
body.light-theme .verified-order-input-label {
  color: #0F172A !important;
}

html[data-theme="light"] #verified-order-medicines-input,
body.light-theme #verified-order-medicines-input,
html[data-theme="light"] .verified-order-textarea,
body.light-theme .verified-order-textarea {
  background: #F8FAFC !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] #verified-order-medicines-input::placeholder,
body.light-theme #verified-order-medicines-input::placeholder,
html[data-theme="light"] .verified-order-textarea::placeholder,
body.light-theme .verified-order-textarea::placeholder {
  color: #64748B !important;
}

html[data-theme="light"] .verified-order-notice-box,
body.light-theme .verified-order-notice-box {
  background: #F0FDF4 !important;
  border-color: #86EFAC !important;
}

html[data-theme="light"] .verified-order-notice-text,
body.light-theme .verified-order-notice-text {
  color: #166534 !important;
}

html[data-theme="light"] .btn-close-universal,
html[data-theme="light"] .screen-close-btn,
html[data-theme="light"] .btn-back-ai-close,
html[data-theme="light"] .verified-order-close-btn,
body.light-theme .btn-close-universal,
body.light-theme .screen-close-btn,
body.light-theme .btn-back-ai-close,
body.light-theme .verified-order-close-btn {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #475569 !important;
}

/* ══════════════════════════════════════════════════════════════════
   ⭐ VIP Loyalty Wallet & "رصيدك" High-Contrast Light Mode Engine
   ══════════════════════════════════════════════════════════════════ */
html[data-theme="light"] #wallet-header-btn,
body.light-theme #wallet-header-btn,
body.theme-light #wallet-header-btn {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .wallet-label,
body.light-theme .wallet-label,
body.theme-light .wallet-label {
  color: #475569 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .wallet-balance-mini,
html[data-theme="light"] #wallet-mini,
body.light-theme .wallet-balance-mini,
body.light-theme #wallet-mini,
body.theme-light .wallet-balance-mini,
body.theme-light #wallet-mini {
  color: #047857 !important;
  background: #E6F4EA !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .wallet-gold-card,
body.light-theme .wallet-gold-card,
body.theme-light .wallet-gold-card {
  background: linear-gradient(135deg, #FFFDF7 0%, #FEF9EE 45%, #F0FDF4 100%) !important;
  border: 1.5px solid #F59E0B !important;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.12), inset 0 1px 0 #FFFFFF !important;
  color: #0F172A !important;
}

html[data-theme="light"] .wallet-gold-card .card-badge-vip,
body.light-theme .wallet-gold-card .card-badge-vip,
body.theme-light .wallet-gold-card .card-badge-vip {
  color: #B45309 !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .wallet-gold-card .points-label,
body.light-theme .wallet-gold-card .points-label,
body.theme-light .wallet-gold-card .points-label {
  color: #475569 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .wallet-gold-card #wallet-amount,
body.light-theme .wallet-gold-card #wallet-amount,
body.theme-light .wallet-gold-card #wallet-amount {
  color: #D97706 !important;
  text-shadow: none !important;
  font-weight: 900 !important;
}

html[data-theme="light"] .wallet-gold-card .points-unit,
body.light-theme .wallet-gold-card .points-unit,
body.theme-light .wallet-gold-card .points-unit {
  color: #B45309 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .wallet-gold-card .real-wallet-box,
body.light-theme .wallet-gold-card .real-wallet-box,
body.theme-light .wallet-gold-card .real-wallet-box {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .wallet-gold-card .real-wallet-box .balance-label,
body.light-theme .wallet-gold-card .real-wallet-box .balance-label,
body.theme-light .wallet-gold-card .real-wallet-box .balance-label {
  color: #475569 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .wallet-gold-card .real-wallet-box #real-wallet-amount,
body.light-theme .wallet-gold-card .real-wallet-box #real-wallet-amount,
body.theme-light .wallet-gold-card .real-wallet-box #real-wallet-amount {
  color: #047857 !important;
  font-weight: 800 !important;
}

html[data-theme="light"] .wallet-referral-card,
body.light-theme .wallet-referral-card,
body.theme-light .wallet-referral-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .wallet-referral-card h4,
body.light-theme .wallet-referral-card h4,
body.theme-light .wallet-referral-card h4 {
  color: #0F172A !important;
}

html[data-theme="light"] .wallet-referral-card p,
body.light-theme .wallet-referral-card p,
body.theme-light .wallet-referral-card p {
  color: #475569 !important;
}

html[data-theme="light"] .wallet-referral-card .referral-code-box,
body.light-theme .wallet-referral-card .referral-code-box,
body.theme-light .wallet-referral-card .referral-code-box {
  background: #F8FAFC !important;
  border: 1.5px dashed #CBD5E1 !important;
}

html[data-theme="light"] .wallet-referral-card #patient-referral-code-display,
body.light-theme .wallet-referral-card #patient-referral-code-display,
body.theme-light .wallet-referral-card #patient-referral-code-display {
  color: #D97706 !important;
}

html[data-theme="light"] .wallet-info-mini-card,
body.light-theme .wallet-info-mini-card,
body.theme-light .wallet-info-mini-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .wallet-info-mini-card h4,
body.light-theme .wallet-info-mini-card h4,
body.theme-light .wallet-info-mini-card h4 {
  color: #0F172A !important;
}

html[data-theme="light"] .wallet-info-mini-card p,
body.light-theme .wallet-info-mini-card p,
body.theme-light .wallet-info-mini-card p {
  color: #64748B !important;
}

html[data-theme="light"] .screen-back-btn,
body.light-theme .screen-back-btn,
body.theme-light .screen-back-btn {
  background: #F1F5F9 !important;
  border: 1px solid #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .wallet-section-title,
body.light-theme .wallet-section-title,
body.theme-light .wallet-section-title {
  color: #0F172A !important;
}

html[data-theme="light"] .transaction-item-card,
body.light-theme .transaction-item-card,
body.theme-light .transaction-item-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  color: #0F172A !important;
}

/* بطاقة تحديث التطبيق السحابي ونافذة التحديث */
html[data-theme="light"] .in-app-update-card,
body.light-theme .in-app-update-card,
body.theme-light .in-app-update-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .updater-info-card,
body.light-theme .updater-info-card,
body.theme-light .updater-info-card {
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
}

html[data-theme="light"] .updater-info-label,
body.light-theme .updater-info-label,
body.theme-light .updater-info-label {
  color: #475569 !important;
}

html[data-theme="light"] .updater-ota-btn,
body.light-theme .updater-ota-btn,
body.theme-light .updater-ota-btn {
  background: #F1F5F9 !important;
  border: 1.5px solid #CBD5E1 !important;
  color: #0F172A !important;
}

html[data-theme="light"] .pharmacy-select-card,
body.light-theme .pharmacy-select-card,
body.theme-light .pharmacy-select-card {
  background: #FFFFFF !important;
  border: 1.5px solid #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  color: #0F172A !important;
}

html[data-theme="light"] .pharmacy-select-card h4,
body.light-theme .pharmacy-select-card h4,
body.theme-light .pharmacy-select-card h4 {
  color: #0F172A !important;
}


/* ══════════════════════════════════════════════════════════════════
   8. SURGICAL FIX: 120 FPS NATIVE SCROLLING & BOTTOM LAYOUT ENGINE
   ══════════════════════════════════════════════════════════════════ */

/* A. Outer Page Setup - Zero horizontal overflow, single vertical viewport */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  overflow-x: hidden !important;
  position: static !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}

#app-screen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  overflow-x: hidden !important;
  touch-action: pan-y !important;
  transform: none !important;
  z-index: 1 !important;
  box-sizing: border-box !important;
}

.screen {
  animation: screenFadeIn 0.2s ease-out !important;
}
@keyframes screenFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* B. Master Scroll Container (.app-main) - The ONLY scrolling element */
.app-main {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: contain !important;
  scroll-behavior: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 16px)) !important;
  box-sizing: border-box !important;
}

/* C. All app sections must flow naturally inside .app-main (NOT nested scrollbars) */
.app-section,
#screen-home,
#screen-orders,
#screen-profile,
#screen-cart,
#screen-returns,
#screen-wallet,
#screen-track {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: hidden !important;
  touch-action: pan-y !important;
  box-sizing: border-box !important;
  padding: 16px !important;
  padding-bottom: 30px !important;
}

.app-section.hidden {
  display: none !important;
}

/* D. Cards and List Items - MUST allow pan-y to pass to .app-main */
.card,
.pharmacy-card,
.medicine-card,
.order-card,
.product-card,
.stat-card,
.quick-action-card,
.bento-card,
.hero-pharmacy-banner,
.search-card {
  touch-action: pan-y !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* E. Full-Screen AI Assistant Screen (#screen-ai) */
#screen-ai:not(.hidden) {
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 10001 !important;
  background: var(--bg-page) !important;
  box-sizing: border-box !important;
}

#screen-ai .ai-header {
  flex-shrink: 0 !important;
  padding-top: max(16px, env(safe-area-inset-top, 16px)) !important;
  padding-bottom: 12px !important;
  padding-inline: 16px !important;
  min-height: 64px !important;
  box-sizing: border-box !important;
}

#screen-ai .ai-top-disclaimer-bar {
  flex-shrink: 0 !important;
}

#screen-ai #ai-chat-inline-section {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#screen-ai #ai-chat-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior-y: contain !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

#screen-ai .ai-chat-input-wrapper {
  flex-shrink: 0 !important;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 16px)) 16px !important;
  background: var(--bg-surface, #122822) !important;
  border-top: 1.5px solid var(--border-color, rgba(52, 216, 158, 0.25)) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  z-index: 10002 !important;
  position: relative !important;
  box-sizing: border-box !important;
  min-height: 68px !important;
}

html[data-theme="light"] #screen-ai .ai-chat-input-wrapper,
body.light-theme #screen-ai .ai-chat-input-wrapper {
  background: #FFFFFF !important;
  border-top: 1.5px solid #E2E8F0 !important;
}

#screen-ai #ai-chat-input {
  flex: 1 1 auto !important;
  height: 48px !important;
  border-radius: 24px !important;
  padding: 0 18px !important;
  font-size: 15px !important;
  outline: none !important;
  box-sizing: border-box !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#screen-ai #ai-chat-send-btn {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #10B981, #059669) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* F. Direct Pharmacy Chat Modal (#chat-modal) */
#chat-modal {
  z-index: 100000 !important;
}

#chat-modal .chat-modal-box {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 500px !important;
  height: min(92dvh, 750px) !important;
  max-height: 92dvh !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 28px 28px 0 0 !important;
  box-sizing: border-box !important;
}

#chat-modal .chat-header {
  flex-shrink: 0 !important;
}

#chat-modal #chat-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

#chat-modal .chat-input-wrapper {
  flex-shrink: 0 !important;
  padding: 10px 16px max(16px, env(safe-area-inset-bottom, 16px)) 16px !important;
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border-color) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

#chat-modal #chat-send-btn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  flex-shrink: 0 !important;
}

/* G. Verified Pharmacy Order Modal Sheet (#verified-pharmacy-order-modal) */
#verified-pharmacy-order-modal {
  z-index: 100000 !important;
  padding: 0 !important;
  align-items: flex-end !important;
  justify-content: center !important;
}

#verified-pharmacy-order-modal .verified-order-card {
  width: 100% !important;
  max-width: 500px !important;
  height: min(92dvh, 760px) !important;
  max-height: 92dvh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 28px 28px 0 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

#verified-pharmacy-order-modal .verified-order-header {
  flex-shrink: 0 !important;
}

#verified-pharmacy-order-modal .verified-order-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-y !important;
  padding: 14px 16px !important;
}

#verified-pharmacy-order-modal .verified-order-footer {
  flex-shrink: 0 !important;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 14px)) 16px !important;
  background: inherit !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  z-index: 20 !important;
}

html[data-theme="light"] #verified-pharmacy-order-modal .verified-order-footer,
body.light-theme #verified-pharmacy-order-modal .verified-order-footer {
  border-top-color: #E2E8F0 !important;
  background: #FFFFFF !important;
}

/* H. Bottom Navigation Bar - Bulletproof Visibility, High Contrast & Safe Area */
.bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  height: calc(64px + env(safe-area-inset-bottom, 16px)) !important;
  min-height: calc(64px + env(safe-area-inset-bottom, 16px)) !important;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 16px)) 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-around !important;
  align-items: center !important;
  z-index: 9999 !important;
  border-radius: 20px 20px 0 0 !important;
  background: #0B1713 !important;
  border-top: 1px solid rgba(52, 216, 158, 0.20) !important;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.50) !important;
  overflow: visible !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="light"] .bottom-nav,
body.light-theme .bottom-nav {
  background: #FFFFFF !important;
  border-top: 1px solid #E2E8F0 !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
}

.bottom-nav .nav-btn {
  flex: 1 1 0% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 2px !important;
  gap: 3px !important;
  border: none !important;
  background: transparent !important;
  overflow: visible !important;
  position: relative !important;
  cursor: pointer !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  color: #94A3B8 !important;
}

html[data-theme="light"] .bottom-nav .nav-btn,
body.light-theme .bottom-nav .nav-btn {
  color: #475569 !important;
}

.bottom-nav .nav-btn.active {
  color: #34D89E !important;
}

html[data-theme="light"] .bottom-nav .nav-btn.active,
body.light-theme .bottom-nav .nav-btn.active {
  color: #059669 !important;
}

/* Icons: Guaranteed NEVER to collapse, 100% visible SVG & Material Symbols */
.bottom-nav .nav-btn svg,
.bottom-nav .nav-btn .nav-svg,
.bottom-nav .nav-btn .material-symbols-outlined {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  flex-shrink: 0 !important;
  display: block !important;
  stroke-width: 2.2 !important;
  stroke: #94A3B8 !important;
  fill: none !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease !important;
}

html[data-theme="light"] .bottom-nav .nav-btn svg,
html[data-theme="light"] .bottom-nav .nav-btn .nav-svg,
html[data-theme="light"] .bottom-nav .nav-btn .material-symbols-outlined,
body.light-theme .bottom-nav .nav-btn svg,
body.light-theme .bottom-nav .nav-btn .nav-svg,
body.light-theme .bottom-nav .nav-btn .material-symbols-outlined {
  stroke: #475569 !important;
  color: #475569 !important;
}

.bottom-nav .nav-btn.active svg,
.bottom-nav .nav-btn.active .nav-svg,
.bottom-nav .nav-btn.active .material-symbols-outlined {
  stroke: #34D89E !important;
  color: #34D89E !important;
  transform: scale(1.12) !important;
}

html[data-theme="light"] .bottom-nav .nav-btn.active svg,
html[data-theme="light"] .bottom-nav .nav-btn.active .nav-svg,
html[data-theme="light"] .bottom-nav .nav-btn.active .material-symbols-outlined,
body.light-theme .bottom-nav .nav-btn.active svg,
body.light-theme .bottom-nav .nav-btn.active .nav-svg,
body.light-theme .bottom-nav .nav-btn.active .material-symbols-outlined {
  stroke: #059669 !important;
  color: #059669 !important;
}

/* Nav button label text */
.bottom-nav .nav-btn span,
.bottom-nav .nav-btn .nav-label {
  font-size: 11px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  color: inherit !important;
  font-family: 'IBM Plex Sans Arabic', sans-serif !important;
  text-align: center !important;
  margin-top: 1px !important;
}

.bottom-nav .nav-btn.active span,
.bottom-nav .nav-btn.active .nav-label {
  font-weight: 800 !important;
}

/* Central Floating Prescription FAB Button */
.bottom-nav .nav-btn.upload-fab {
  overflow: visible !important;
  position: relative !important;
}

.bottom-nav .nav-btn.upload-fab .fab-circle {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  min-height: 52px !important;
  margin-top: -26px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #10B981, #059669) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45) !important;
  border: 3.5px solid #0B1713 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

html[data-theme="light"] .bottom-nav .nav-btn.upload-fab .fab-circle,
body.light-theme .bottom-nav .nav-btn.upload-fab .fab-circle {
  border-color: #FFFFFF !important;
}

.bottom-nav .nav-btn.upload-fab .fab-circle svg,
.bottom-nav .nav-btn.upload-fab .fab-circle .fab-svg {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  stroke: #FFFFFF !important;
  fill: none !important;
  stroke-width: 2.5 !important;
}

/* I. Connectivity Bar - Fixed Overlay (Zero Flow Impact) */
#dawaei-connectivity-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 99999 !important;
  box-sizing: border-box !important;
  transform: translateY(-100%) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  text-align: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #FFFFFF !important;
  background: rgba(239, 68, 68, 0.95) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  padding-top: max(10px, env(safe-area-inset-top, 10px)) !important;
  padding-bottom: 8px !important;
  padding-inline: 16px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

#dawaei-connectivity-bar.visible {
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

#dawaei-connectivity-bar.online {
  background: rgba(16, 185, 129, 0.95) !important;
}

/* ── 12. Quick Top Medicines & Shortage Engine (Click & Collect Optimization) ── */
.quick-shortage-section {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-med-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-med-card:hover {
  transform: translateY(-2px);
}

.quick-med-card.is-out {
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.15) !important;
}

@keyframes highlightPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.highlight-pulse {
  animation: highlightPulse 0.8s ease-in-out;
}

html[data-theme="light"] .quick-med-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .quick-med-card.is-out {
  background: #FEF2F2 !important;
  border-color: #EF4444 !important;
}

html[data-theme="light"] .quick-shortage-section {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

/* Patient Search Badges */
.pharmacy-shortage-badge {
  animation: fadeIn 0.3s ease-in;
}

.pharmacy-med-out-of-stock {
  filter: grayscale(0.2);
}

