html { scroll-behavior: smooth; scroll-padding-top: 85px; overflow-x: hidden; max-width: 100%; }
section { scroll-margin-top: 85px; }
body { font-family: 'Cairo', sans-serif; background-color: #f7f6f2; color: #0f172a; overflow-x: hidden; max-width: 100%; }
.font-mono { font-variant-numeric: tabular-nums; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: #0284c7; box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12); outline: none; }
.tab-active { background: linear-gradient(135deg, #0b2240 0%, #0284c7 100%); color: #ffffff; font-weight: 700; box-shadow: 0 4px 12px -2px rgba(2, 132, 199, 0.28); }
.pkg-tab-active { background: linear-gradient(135deg, #0b2240 0%, #0284c7 100%); color: #ffffff; font-weight: 800; box-shadow: 0 6px 16px -3px rgba(2, 132, 199, 0.35); }
.pulse-badge { animation: pulse 1.6s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.08); }
}
@keyframes ringShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(16deg); }
  40% { transform: rotate(-16deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-10deg); }
}
.ring-icon { animation: ringShake 0.6s infinite; }
#modalQrBox img, #modalQrBox canvas { margin: 0 auto; border-radius: 12px; }
#orderLeafletMap { width: 100%; height: 210px; border-radius: 1rem; z-index: 1; }
.date-strip-scroll::-webkit-scrollbar { height: 4px; }
.date-strip-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ===== شاشة فتح التطبيق (Luxury Sapphire Splash) ===== */
#appSplash {
  position: fixed; inset: 0; z-index: 2147483600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(95% 70% at 50% 22%, #154573 0%, #0b2545 50%, #061120 100%);
  color: #fff; text-align: center; padding: 24px; overflow: hidden;
  transition: opacity .45s ease, visibility .45s ease;
  animation: splashAutoHide .45s ease 6s forwards;
}
#appSplash.splash-out { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes splashAutoHide { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.splash-aura {
  position: absolute; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(243, 200, 108, 0.08) 42%, transparent 72%);
  filter: blur(22px);
}
.splash-logo-wrap { position: relative; width: 124px; height: 124px; animation: splashPop .45s cubic-bezier(.2,.9,.3,1.15) both; z-index: 1; }
.splash-logo-wrap img {
  position: relative; width: 124px; height: 124px; border-radius: 30px; z-index: 2;
  box-shadow: 0 24px 54px -12px rgba(2, 6, 23, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.16);
  animation: splashFloat 3.2s ease-in-out .45s infinite;
}
.splash-halo {
  position: absolute; inset: -16px; border-radius: 999px; z-index: 1;
  border: 1.5px solid rgba(243, 200, 108, 0.34);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.18);
  animation: splashHaloPulse 2.4s ease-in-out infinite;
}
.splash-brand { position: relative; z-index: 1; }
.splash-kicker {
  font-size: .66rem; font-weight: 800; letter-spacing: .24em; color: #7dd3fc;
  margin-bottom: 6px; animation: splashUp .4s ease both;
}
.splash-title { font-weight: 900; font-size: 1.9rem; letter-spacing: -.01em; color: #ffffff; animation: splashUp .45s ease both; }
.splash-divider {
  width: 52px; height: 2px; margin: 10px auto; border-radius: 99px;
  background: linear-gradient(90deg, transparent, #f3c86c, transparent);
  animation: splashUp .45s ease both;
}
.splash-sub { font-weight: 700; font-size: .88rem; color: #dbeafe; opacity: .95; animation: splashUp .45s ease both; }
.splash-bar { position: relative; z-index: 1; width: 140px; height: 3px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; margin-top: 4px; animation: splashUp .45s ease both; }
.splash-bar span { display: block; width: 42%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7dd3fc, #f3c86c); animation: splashSlide 1.15s ease-in-out infinite; }
.splash-foot { position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 1; font-size: .72rem; color: #93c5fd; font-weight: 700; letter-spacing: .01em; }
@keyframes splashPop { from { transform: scale(.92); opacity: .88; } to { transform: scale(1); opacity: 1; } }
@keyframes splashFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes splashHaloPulse { 0%,100% { transform: scale(.98); opacity: .45; } 50% { transform: scale(1.06); opacity: .85; } }
@keyframes splashUp { from { transform: translateY(6px); opacity: .88; } to { transform: translateY(0); opacity: 1; } }
@keyframes splashSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { #appSplash *, #appSplash { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }

/* ===== الهوية البصرية الموحدة v19 ===== */
.sahaba-header { border-bottom-color: rgba(226, 232, 240, 0.85); box-shadow: 0 4px 20px -12px rgba(11, 34, 64, 0.12); }
.sahaba-hero-card {
  position: relative;
  background: radial-gradient(120% 90% at 15% 0%, #16497a 0%, #0b2444 58%, #071426 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 22px 45px -18px rgba(7, 20, 38, 0.55);
}
.sahaba-hero-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #fef3c7;
  border: 1px solid rgba(243, 200, 108, 0.35);
}
.sahaba-hero-chip {
  background: rgba(255, 255, 255, 0.10);
  color: #e0f2fe;
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}
.sahaba-hero-cta-primary {
  background: #ffffff;
  color: #0b2444;
  box-shadow: 0 8px 18px -6px rgba(2, 6, 23, 0.45);
}
.sahaba-hero-cta-primary:hover { background: #f0f9ff; transform: translateY(-1px); }
.sahaba-hero-cta-ghost {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.sahaba-hero-cta-ghost:hover { background: rgba(255, 255, 255, 0.18); }
.sahaba-surface-card {
  background: #ffffff;
  border: 1px solid #e6e3da;
  box-shadow: 0 10px 28px -14px rgba(15, 23, 42, 0.10);
}
.sahaba-pkg-card {
  background: #ffffff;
  border: 1px solid #e6e3da;
  box-shadow: 0 8px 22px -14px rgba(15, 23, 42, 0.10);
}
.sahaba-pkg-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 14px 30px -14px rgba(2, 132, 199, 0.18);
  transform: translateY(-1px);
}
.sahaba-pkg-card-open {
  background: #ffffff;
  border: 2px solid #0284c7;
  box-shadow: 0 18px 36px -14px rgba(11, 36, 68, 0.18);
}
.sahaba-pkg-featured { border-color: #d9a13b; box-shadow: 0 12px 26px -14px rgba(217, 161, 59, 0.24); }
.sahaba-illus-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.15rem;
  padding: 4px;
}
.sahaba-expand-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800; color: #0369a1;
  background: #f0f9ff; border: 1px solid #bae6fd;
  padding: 2px 10px; border-radius: 999px;
}
.sahaba-choice-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
}
.sahaba-choice-card:hover { border-color: #7dd3fc; }
.sahaba-choice-active {
  background: #f0f9ff;
  border-color: #0284c7;
  box-shadow: 0 6px 16px -6px rgba(2, 132, 199, 0.25);
}
.sahaba-cta-btn {
  background: linear-gradient(135deg, #0b2444 0%, #0369a1 100%);
  box-shadow: 0 10px 22px -8px rgba(11, 36, 68, 0.45);
}
.sahaba-cta-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sahaba-footer {
  background: linear-gradient(180deg, #091c34 0%, #061120 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== شروط الرمز السري ===== */
.pin-rules { list-style: none; margin: 6px 0 0; padding: 8px 10px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; font-size: 11px; font-weight: 700; display: grid; gap: 3px; }
.pin-rules li { color: #64748b; display: flex; align-items: center; gap: 6px; }
.pin-rules li::before { content: '○'; font-size: 11px; width: 12px; text-align: center; }
.pin-rules li.ok { color: #047857; }
.pin-rules li.ok::before { content: '✓'; }
.pin-rules li.bad { color: #be123c; }
.pin-rules li.bad::before { content: '✕'; }
.pin-input { letter-spacing: .35em; text-align: center !important; font-size: 1.05rem !important; }

/* ===== أدوات تنسيق إضافية لشاشات الإدارة الجديدة (غير موجودة في styles.css المبني مسبقاً) ===== */
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.h-3 { height: .75rem; }
.h-40 { height: 10rem; }
.h-full { height: 100%; }
.w-56 { width: 14rem; }
.justify-end { justify-content: flex-end; }
.leading-tight { line-height: 1.25; }
.mb-0\.5 { margin-bottom: .125rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.opacity-50 { opacity: .5; }
.opacity-60 { opacity: .6; }
.rounded-t-md { border-top-left-radius: .375rem; border-top-right-radius: .375rem; }
.text-\[9px\] { font-size: 9px; }
.max-w-\[180px\] { max-width: 180px; }
.max-h-\[560px\] { max-height: 560px; }
.bg-sky-300 { background-color: rgb(125 211 252); }
.group:hover .group-hover\:bg-sky-400 { background-color: rgb(56 189 248); }
.hover\:bg-amber-50:hover { background-color: rgb(255 251 235); }
.hover\:bg-emerald-50:hover { background-color: rgb(236 253 245); }
.hover\:shadow-sm:hover { box-shadow: 0 1px 2px 0 rgba(0,0,0,.05); }
@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:gap-1\.5 { gap: .375rem; }
  .sm\:p-3 { padding: .75rem; }
  .sm\:p-5 { padding: 1.25rem; }
  .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* ===== تابات المندوب ===== */
.drv-tab { color: #475569; background: transparent; }
.drv-tab:hover { background: #f1f5f9; }
.drv-tab.active { background: #0f172a; color: #fff; }
.min-w-\[96px\] { min-width: 96px; }
.min-w-\[22px\] { min-width: 22px; }
.top-\[4\.25rem\] { top: 4.25rem; }
.z-30 { z-index: 30; }
@media (min-width: 768px) { .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.laundry-opt { display: flex; align-items: center; gap: .5rem; border: 1px solid #e2e8f0; border-radius: .75rem; padding: .5rem .6rem; background: #fff; cursor: pointer; }
.laundry-opt:has(input:checked) { border-color: #0284c7; background: #f0f9ff; box-shadow: 0 0 0 2px #bae6fd; }
.bg-cyan-50 { background-color: rgb(236 254 255); }
.text-cyan-800 { color: rgb(21 94 117); }
.border-cyan-200 { border-color: rgb(165 243 252); }
.max-h-48 { max-height: 12rem; }
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.min-w-\[64px\] { min-width: 64px; }
.bg-amber-500 { background-color: #f59e0b; }
.gap-0\.5 { gap: 0.125rem; }
.text-left { text-align: left; }
.line-through { text-decoration-line: line-through; }
.cursor-not-allowed { cursor: not-allowed; }
.whitespace-nowrap { white-space: nowrap; }
.disabled\:opacity-50:disabled { opacity: 0.5; }
@media (min-width: 768px) {
  .md\:col-span-2 { grid-column: span 2 / span 2; }
}
.max-h-\[90vh\] { max-height: 90vh; }
.pt-3 { padding-top: 0.75rem; }
.pb-8 { padding-bottom: 2rem; }
.py-9 { padding-top: 2.25rem; padding-bottom: 2.25rem; }
.opacity-40 { opacity: 0.4; }
.left-1 { left: 0.25rem; }
.top-1 { top: 0.25rem; }
.w-1\.5 { width: 0.375rem; }
.h-1\.5 { height: 0.375rem; }
.items-stretch { align-items: stretch; }
.text-amber-300 { color: #fcd34d; }
.border-amber-300\/40 { border-color: rgba(252, 211, 77, 0.4); }
@media (min-width: 640px) {
  .sm\:flex-col { flex-direction: column; }
  .sm\:flex-initial { flex: 0 1 auto; }
  .sm\:w-auto { width: auto; }
  .sm\:py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
}

/* ===================== v20 ===================== */

/* أزرار اختيار (الدفع، التغليف، طريقة التسليم): تتلون أزرق لما تتختار زي أوقات الاستلام */
.choice-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; text-align: center;
  min-width: 0; padding: .6rem .4rem; border: 1px solid #e2e8f0; border-radius: .9rem; background: #fff; color: #334155; cursor: pointer;
  font-weight: 700; font-size: .75rem; line-height: 1.25; transition: background .15s, color .15s, border-color .15s, box-shadow .15s; user-select: none; }
.choice-tile:hover { border-color: #38bdf8; }
.choice-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.choice-tile .choice-ico { font-size: 1.25rem; line-height: 1; }
.choice-tile .choice-title { font-weight: 800; }
.choice-tile .choice-sub { font-size: .65rem; font-weight: 700; color: #64748b; }
.choice-tile:has(input:checked), .choice-tile.is-checked { background: #0284c7; border-color: #0284c7; color: #fff; box-shadow: 0 4px 12px -4px rgba(2,132,199,.55); }
.choice-tile:has(input:checked) .choice-sub, .choice-tile.is-checked .choice-sub { color: #e0f2fe; }
.choice-tile:has(input:focus-visible) { outline: 2px solid #0ea5e9; outline-offset: 2px; }
.pay-tile { padding: .75rem .5rem; }
.pay-tile .choice-ico { font-size: 1.6rem; }

/* شاشة الكتالوج في الإدارة */
.catalog-subtabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; background: #f1f5f9; padding: .35rem; border-radius: 1rem; }
.catalog-subtab { padding: .55rem .4rem; border-radius: .75rem; font-size: .75rem; font-weight: 800; color: #475569; white-space: nowrap; }
.catalog-subtab:hover { background: #e2e8f0; }
.catalog-subtab.active { background: #0f172a; color: #fff; }
.cat-chip-row { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .35rem; scrollbar-width: thin; }
.cat-chip-row::-webkit-scrollbar { height: 4px; }
.cat-chip-row::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.cat-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border: 1px solid #e2e8f0; border-radius: 999px;
  background: #fff; color: #334155; font-size: .78rem; font-weight: 800; white-space: nowrap; transition: all .15s; }
.cat-chip:hover { border-color: #38bdf8; }
.cat-chip.active { background: #0284c7; border-color: #0284c7; color: #fff; box-shadow: 0 4px 12px -4px rgba(2,132,199,.55); }
.cat-chip.is-hidden { border-style: dashed; opacity: .75; }
.cat-chip-icon { font-size: 1rem; line-height: 1; }
.cat-chip-count { min-width: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: .68rem; text-align: center; }
.cat-chip.active .cat-chip-count { background: rgba(255,255,255,.22); color: #fff; }
.cat-list-icon { width: 2.4rem; height: 2.4rem; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem;
  background: #fff; border: 1px solid #e2e8f0; border-radius: .8rem; }
.cat-move-btn { width: 1.9rem; height: 1.9rem; border: 1px solid #e2e8f0; border-radius: .6rem; background: #fff; color: #475569; font-size: .7rem; }
.cat-move-btn:hover:not(:disabled) { border-color: #38bdf8; color: #0284c7; }
.cat-move-btn:disabled { opacity: .35; cursor: not-allowed; }
.emoji-pick { width: 2rem; height: 2rem; border: 1px solid #e2e8f0; border-radius: .55rem; background: #fff; font-size: 1.05rem; line-height: 1; }
.emoji-pick:hover { border-color: #38bdf8; background: #f0f9ff; }
.cat-emoji-illus { font-size: 2.1rem; line-height: 1; }

/* شريط تنبيه الطلبات الجديدة للمندوب — مش بيقفل الشاشة */
#driverAlertTray { position: fixed; top: 4.6rem; left: .5rem; right: .5rem; max-width: 30rem; margin: 0 auto; z-index: 45; }
.drv-alert-panel { background: #fff; border: 2px solid #f43f5e; border-radius: 1.1rem; box-shadow: 0 18px 40px -12px rgba(15,23,42,.45); overflow: hidden; }
.drv-alert-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; background: #fff1f2; color: #881337; border-bottom: 1px solid #fecdd3; }
.drv-alert-list { max-height: 42vh; overflow-y: auto; }
.drv-alert-item { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border-bottom: 1px solid #f1f5f9; }
.drv-alert-item:last-child { border-bottom: 0; }
.drv-alert-accept { background: #059669; color: #fff; font-weight: 800; font-size: .72rem; padding: .45rem .65rem; border-radius: .6rem; white-space: nowrap; }
.drv-alert-accept:hover { background: #047857; }
.drv-alert-mini { background: #f1f5f9; color: #334155; font-weight: 700; font-size: .7rem; padding: .4rem .55rem; border-radius: .6rem; white-space: nowrap; }
.drv-alert-mini:hover { background: #e2e8f0; }
.drv-alert-pill { margin-inline-start: auto; display: flex; align-items: center; gap: .4rem; background: #e11d48; color: #fff; font-weight: 800; font-size: .8rem;
  padding: .5rem .9rem; border-radius: 999px; box-shadow: 0 10px 24px -8px rgba(225,29,72,.6); }
.drv-card-flash { animation: drvFlash 1.5s ease; }
@keyframes drvFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px #fda4af; } }

/* المندوب والعميل المسجلين: التطبيق بس من غير الصفحة الرئيسية وأزرارها */
body.app-mode #btnMyAccount, body.app-mode #btnBackToSite, body.app-mode #headerNavLinks { display: none !important; }

/* بعد تثبيت التطبيق: نخفي أزرار «تثبيت التطبيق» */
body.pwa-installed .install-btn { display: none !important; }
.bg-sky-50\/60 { background-color: rgba(240, 249, 255, 0.6); }
.bg-slate-300 { background-color: #cbd5e1; }
.opacity-70 { opacity: 0.7; }
.opacity-75 { opacity: 0.75; }
