/* =====================================================================
   نظام إدارة الشحنات — طبقة التنسيق فوق Bootstrap 5
   الخط: Tajawal لكل النصوص والأرقام.
   اللغة البصرية: البوليصة الورقية، وعلامات الطرق، وشريط المسار.
   تعمل في الاتجاهين (rtl/ltr) عبر الخصائص المنطقية.
   ===================================================================== */

:root {
  /* ---- الحبر والفولاذ: كحلي أدفأ قليلاً ليصالح ذهب الشعار ---- */
  --ink:       #0E1B26;
  --steel-900: #12212E;
  --steel-800: #1B3245;
  --steel-700: #244460;
  --steel-600: #2E5878;
  --steel-400: #7A8FA3;
  --steel-200: #B4C2CE;

  /* ---- الأسطح: ورق دافئ بدل الرمادي المزرقّ ---- */
  --rail:      #DFE3E7;
  --paper:     #F6F4F1;
  --card:      #FFFFFF;
  --muted:     #5A6B7A;

  /* ---- الذهب: ملتقط من الشعار وأعمق قليلاً ليقرأ عليه النص ---- */
  --signal:    #D9A441;
  --signal-dk: #A87A22;
  --signal-ink:#3E2C08;

  /* ---- لمسة دافئة للأقسام الهادئة ---- */
  --blush:     #FDEDE5;
  --blush-2:   #F8D3C3;

  --ok:     #16785A;
  --warn:   #B87209;
  --danger: #B7362F;
  --info:   #2A6FD0;

  --radius:   12px;
  --radius-s: 8px;
  --radius-xs: 5px;

  --shadow-sm: 0 1px 2px rgba(14,27,38,.05);
  --shadow:    0 1px 2px rgba(14,27,38,.04), 0 10px 28px -18px rgba(14,27,38,.32);
  --shadow-lg: 0 24px 60px -26px rgba(14,27,38,.5);

  --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --nav-h: 62px;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: .93rem;
  line-height: 1.7;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6, .display-face {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.3;
  text-wrap: balance;   /* يوزّع الكلمات على الأسطر بدل ترك كلمة وحيدة */
}

p { text-wrap: pretty; }

a { text-decoration: none; color: var(--steel-600); }
a:hover { color: var(--steel-800); }

/* الأرقام: نفس الخط، أرقام بعرض ثابت، واتجاه لاتيني معزول */
.mono, .num, .tracking-no {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: .01em;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.text-dim { color: var(--muted); }
.fs-xs { font-size: .74rem; }
.fs-sm { font-size: .82rem; }

/* =====================================================================
   الشريط العلوي (navbar)
   ===================================================================== */
.topnav {
  background: var(--steel-900);
  min-height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.topnav .brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-block: .5rem;
}
.brand-logo {
  height: 46px;
  width: auto;
  flex: none;
  display: block;
  /* هالة خفيفة تفصل الشعار عن الخلفية الكحلية دون تعديل الملف نفسه */
  filter: drop-shadow(0 0 1px rgba(255,255,255,.35));
}
.footer-logo {
  width: 150px;
  height: auto;
  max-width: 62%;
  filter: drop-shadow(0 0 1px rgba(255,255,255,.3));
}
.login-logo { width: 180px; height: auto; max-width: 72%; }
.brand-name  { color: #fff; font-weight: 700; font-size: .98rem; line-height: 1.2; }
.brand-sub   { color: var(--steel-400); font-size: .68rem; line-height: 1.2; }

.topnav .nav-link {
  color: #C4D3E0;
  font-size: .885rem;
  font-weight: 500;
  padding: .45rem .8rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.topnav .nav-link:hover,
.topnav .nav-link:focus-visible { color: #fff; background: rgba(255,255,255,.08); }
.topnav .nav-link.active {
  color: #fff;
  background: rgba(217,164,65,.16);
  box-shadow: inset 0 -2px 0 var(--signal);
}
.topnav .nav-link i { opacity: .8; font-size: .82rem; }

.topnav .dropdown-menu {
  border: 1px solid var(--rail);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  padding: .35rem;
  font-size: .875rem;
  min-width: 210px;
}
.dropdown-item {
  border-radius: var(--radius-xs);
  padding: .45rem .7rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.dropdown-item i { width: 16px; text-align: center; color: var(--steel-400); }
.dropdown-item.active, .dropdown-item:active {
  background: var(--steel-700); color: #fff;
}
.dropdown-item.active i, .dropdown-item:active i { color: var(--signal); }
.dropdown-header {
  font-size: .68rem;
  letter-spacing: .08em;
  color: var(--steel-400);
  text-transform: uppercase;
  padding: .4rem .7rem .2rem;
}

.nav-search .form-control {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  color: #fff;
  width: 165px;
  font-size: .82rem;
}
.nav-search .form-control::placeholder { color: var(--steel-400); }
.nav-search .form-control:focus {
  background: rgba(255,255,255,.14);
  border-color: var(--signal);
  box-shadow: none;
  color: #fff;
}
.nav-search .input-group-text {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.14);
  color: var(--steel-200);
}

.lang-pill {
  border: 1px solid rgba(255,255,255,.18);
  color: #DCE6EF;
  border-radius: 999px;
  padding: .18rem .7rem;
  font-size: .78rem;
  font-weight: 500;
}
.lang-pill:hover { background: rgba(255,255,255,.1); color: #fff; }

.user-chip {
  display: flex; align-items: center; gap: .5rem;
  color: #DCE6EF; font-size: .84rem;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--steel-700); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  flex: none;
}

/* رأس الصفحة الداخلي */
.page-head {
  background: var(--card);
  border-bottom: 1px solid var(--rail);
  padding: .95rem 0;
}
.page-head h1 { font-size: 1.15rem; margin: 0; }
.page-head .sub { font-size: .8rem; color: var(--muted); }

.content { padding-block: 1.4rem 2.5rem; }

/* =====================================================================
   البطاقات والعناصر المشتركة
   ===================================================================== */
.card {
  border: 1px solid var(--rail);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: var(--card);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--rail);
  padding: .8rem 1.1rem;
  font-weight: 700;
  font-size: .94rem;
}
.card-body { padding: 1.1rem; }

.stat {
  background: var(--card);
  border: 1px solid var(--rail);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-s);
  display: grid; place-items: center;
  font-size: 1.02rem;
  flex: none;
}
.stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: .78rem; color: var(--muted); line-height: 1.4; }

/* شارات الحالة */
.st-badge {
  display: inline-block;
  padding: .16rem .62rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.st-slate  { background:#EBEFF4; color:#3E5568; border-color:#D5DEE6; }
.st-indigo { background:#EAEAFA; color:#3F35A5; border-color:#D5D6F3; }
.st-amber  { background:#FDF1DC; color:#8A5307; border-color:#F6E0BB; }
.st-cyan   { background:#DEF3F7; color:#0F616E; border-color:#BEE5EE; }
.st-blue   { background:#E1EDFC; color:#1A4F9C; border-color:#C5DBF8; }
.st-green  { background:#DEF3EA; color:#0D6A4A; border-color:#BCE7D5; }
.st-orange { background:#FCE8DD; color:#984314; border-color:#F7D1BC; }
.st-red    { background:#FBE3E2; color:#992B26; border-color:#F5C7C5; }
.st-purple { background:#F2E6FA; color:#6B2E96; border-color:#E4CFF4; }
.st-teal   { background:#DDF2EF; color:#0D6259; border-color:#BEE6E0; }
.st-gray   { background:#EEF1F4; color:#4A5A69; border-color:#DCE3E9; }

/* =====================================================================
   العنصر المميّز الأول: شريط البوليصة
   ===================================================================== */
.waybill {
  position: relative;
  background: var(--steel-900);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem 1.35rem;
  overflow: hidden;
}
.waybill::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: -7px;
  height: 14px;
  background-image: radial-gradient(circle at 7px 7px, var(--paper) 6px, transparent 6.5px);
  background-size: 18px 14px;
  background-repeat: repeat-x;
}
.wb-label {
  font-size: .66rem;
  letter-spacing: .16em;
  color: var(--signal);
  text-transform: uppercase;
  font-weight: 500;
}
.wb-number {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .07em;
  direction: ltr;
  unicode-bidi: isolate;
  display: block;
  margin-top: .05rem;
  font-variant-numeric: tabular-nums;
}
.wb-meta { font-size: .8rem; color: #94ABC0; margin-top: .4rem; }
.wb-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  border-radius: var(--radius-xs);
  padding: .25rem .65rem;
  font-size: .78rem;
  font-weight: 500;
}
.wb-btn:hover { background: rgba(217,164,65,.28); color: #fff; }

/* =====================================================================
   العنصر المميّز الثاني: شريط المسار
   ===================================================================== */
.route-rail { position: relative; padding-inline-start: 1.7rem; margin: 0; list-style: none; }
.route-rail::before {
  content: '';
  position: absolute;
  inset-block: .6rem;
  inset-inline-start: 6px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--rail) 0 6px, transparent 6px 11px);
}
.route-rail li { position: relative; padding-bottom: 1.2rem; }
.route-rail li:last-child { padding-bottom: 0; }
.waypoint {
  position: absolute;
  inset-inline-start: -1.7rem;
  top: .35rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--rail);
}
.route-rail li.is-current .waypoint {
  border-color: var(--signal);
  box-shadow: 0 0 0 4px rgba(217,164,65,.2);
}
.route-rail li.is-done .waypoint { border-color: var(--ok); }
.wp-title { font-weight: 700; font-size: .9rem; }
.wp-meta  { font-size: .78rem; color: var(--muted); }

/* شريط مراحل الشحنة */
.stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  counter-reset: step;
}
.stepper li {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding-inline: 2px;
}
/* الخط الواصل بين الدوائر */
.stepper li::before {
  content: '';
  position: absolute;
  top: 17px;
  inset-inline-start: calc(-50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: var(--rail);
}
.stepper li:first-child::before { display: none; }
.stepper li.st-done::before,
.stepper li.st-current::before { background: var(--steel-800); }

.stepper .dot {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto .55rem;
  font-size: .8rem;
  border: 2px solid var(--rail);
  background: var(--card);
  color: var(--steel-200);
  transition: background .2s ease, border-color .2s ease;
}
.stepper .lbl {
  display: block;
  font-size: .76rem;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
}

.stepper .st-done .dot {
  background: var(--steel-800);
  border-color: var(--steel-800);
  color: #fff;
}
.stepper .st-done .lbl { color: var(--ink); }

.stepper .st-current .dot {
  border-color: var(--steel-800);
  border-width: 2.5px;
  color: var(--steel-800);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(28,65,102,.1);
}
.stepper .st-current .lbl { color: var(--steel-800); font-weight: 700; }

.stepper.is-halted .dot { border-style: dashed; }

.stepper-halt {
  text-align: center;
  font-size: .82rem;
  color: var(--danger);
  margin: .9rem 0 0;
}

/* على الشاشات الضيقة ينزلق الشريط أفقياً بدل أن تنضغط الأسماء */
@media (max-width: 767.98px) {
  .stepper-wrap { overflow-x: auto; padding-bottom: .4rem; -webkit-overflow-scrolling: touch; }
  .stepper { min-width: 520px; }
  .stepper .lbl { font-size: .7rem; }
}

/* =====================================================================
   الجداول والنماذج والأزرار
   ===================================================================== */
table.dataTable { font-size: .855rem; }
table.dataTable thead th {
  background: #F5F8FA;
  font-weight: 700;
  font-size: .8rem;
  border-bottom: 1px solid var(--rail) !important;
  white-space: nowrap;
}
table.dataTable tbody tr:hover { background: #F8FAFC; }
.table-actions .btn { padding: .15rem .45rem; font-size: .78rem; }
.table > :not(caption) > * > * { padding: .55rem .6rem; }

.form-label { font-size: .82rem; font-weight: 500; margin-bottom: .25rem; color: #33495F; }
.form-control, .form-select {
  border-color: var(--rail);
  border-radius: var(--radius-xs);
  font-size: .875rem;
  padding: .45rem .7rem;
  font-family: var(--font);
}
.form-control:focus, .form-select:focus {
  border-color: var(--steel-600);
  box-shadow: 0 0 0 3px rgba(36,85,126,.13);
}
.form-text { font-size: .74rem; color: #6E8296; }
.form-section-title {
  font-weight: 700;
  font-size: .86rem;
  color: var(--steel-700);
  padding-bottom: .3rem;
  margin-bottom: .85rem;
  border-bottom: 2px solid var(--signal);
  display: inline-block;
}

.btn { border-radius: var(--radius-xs); font-size: .86rem; font-weight: 500; font-family: var(--font); }
.btn-primary { background: var(--steel-700); border-color: var(--steel-700); }
.btn-primary:hover, .btn-primary:focus { background: var(--steel-800); border-color: var(--steel-800); }
.btn-signal {
  background: var(--signal);
  border: 1px solid var(--signal-dk);
  color: var(--signal-ink);
  font-weight: 700;
}
.btn-signal:hover, .btn-signal:focus { background: #D9A238; color: #402E09; }
.btn-lg { font-size: .95rem; padding: .6rem 1.4rem; }

.modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--rail); }
.modal-title { font-size: 1rem; }

/* =====================================================================
   الصفحة التعريفية العامة
   ===================================================================== */
.hero {
  background:
    radial-gradient(1100px 420px at 78% -12%, rgba(217,164,65,.16), transparent 60%),
    linear-gradient(168deg, var(--steel-900) 0%, #0A1B2B 100%);
  color: #fff;
  padding-block: 4.5rem 7rem;
  position: relative;
  overflow: hidden;
}
/* خطوط مائلة خفيفة توحي بمسار الشحن */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -58deg, rgba(255,255,255,.028) 0 1px, transparent 1px 26px);
  pointer-events: none;
}
.hero > .container { position: relative; }
.hero .eyebrow {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .16em;
  color: var(--signal);
  border: 1px solid rgba(217,164,65,.4);
  border-radius: 999px;
  padding: .2rem .85rem;
  margin-bottom: 1.1rem;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: .9rem;
  max-width: 20ch;
}
.hero .lead {
  color: #A9C0D4;
  font-size: 1.03rem;
  max-width: 52ch;
  margin-bottom: 0;
  font-weight: 300;
}

/* بطاقة التتبع الطافية */
.track-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  margin-top: -4.2rem;
  position: relative;
  z-index: 5;
  border-top: 4px solid var(--signal);
}
.track-card h2 { font-size: 1.12rem; margin-bottom: .2rem; }
.track-input {
  text-align: center;
  letter-spacing: .16em;
  font-size: 1.05rem;
  font-weight: 700;
  padding-block: .65rem;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.track-input::placeholder { letter-spacing: .1em; font-weight: 400; opacity: .45; }

.captcha-box {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.captcha-img {
  border: 1px solid var(--rail);
  border-radius: var(--radius-xs);
  background: #fff;
  height: 46px;
  display: block;
}
.captcha-refresh {
  border: 1px solid var(--rail);
  background: #fff;
  border-radius: var(--radius-xs);
  width: 38px; height: 38px;
  color: var(--steel-600);
}
.captcha-refresh:hover { background: var(--paper); }

/* شريط الأرقام */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rail);
  border: 1px solid var(--rail);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-strip > div { background: var(--card); padding: 1.15rem .8rem; text-align: center; }
.stat-strip .n {
  font-size: 1.65rem; font-weight: 800; color: var(--steel-800);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-strip .l { font-size: .76rem; color: var(--muted); }

/* أقسام الصفحة */
.section { padding-block: 3.4rem; }
.section-eyebrow {
  font-size: .72rem; letter-spacing: .14em; color: var(--signal-dk);
  text-transform: uppercase; font-weight: 700; margin-bottom: .4rem;
}
.section h2 { font-size: 1.55rem; margin-bottom: .5rem; max-width: 26ch; }
.section .section-lead { color: var(--muted); max-width: 62ch; }
.section .section-lead.wide { max-width: none; margin-bottom: .85rem; }
.about-title { max-width: 20ch; font-size: 1.75rem !important; }

/* --- الواجهة الرئيسية بالصورة --- */
.hero-photo { background: var(--steel-900); }
.hero-photo .hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-photo .hero-media picture,
.hero-photo .hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-photo .hero-media img { opacity: .38; }
.hero-photo .hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 78% 0%, rgba(217,164,65,.20), transparent 62%),
    linear-gradient(to top, rgba(10,27,43,.97) 4%, rgba(12,29,46,.72) 55%, rgba(12,29,46,.55) 100%);
}
.hero-photo::before { z-index: 1; }
.hero-body { position: relative; z-index: 2; }

.btn-ghost {
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(2px);
}
.btn-ghost:hover, .btn-ghost:focus { background: rgba(255,255,255,.16); color: #fff; }

/* --- أقسام بخلفيات متباينة --- */
.section-tint { background: var(--card); border-block: 1px solid var(--rail); }
.section-blush { background: linear-gradient(180deg, var(--blush), #fff); border-block: 1px solid var(--rail); }
.section-dark {
  background:
    radial-gradient(800px 400px at 15% 0%, rgba(217,164,65,.13), transparent 60%),
    linear-gradient(168deg, var(--steel-900), #0A1B2B);
  color: #C4D3E0;
}
.section-dark .section h2, .section-dark h2 { color: #fff; }

/* --- إطار الصورة الجانبية --- */
.figure-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--rail);
}
.figure-frame picture, .figure-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}
.figure-frame::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: 0;
  width: 46%;
  height: 5px;
  background: var(--signal);
}

/* --- معرض صور داخل بطاقة خدمة --- */
.svc-shot.has-carousel { position: relative; }

/* الشرائح تتراكب داخل إطار البطاقة نفسه، فلا يتغيّر ارتفاع الصف */
.svc-shot.has-carousel .slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease;
  z-index: 1;
}
.svc-shot.has-carousel .slide.is-active { opacity: 1; visibility: visible; }
.svc-shot.has-carousel .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* أول شريحة تحجز الارتفاع حتى لا تنهار البطاقة قبل تحميل الصور */
.svc-shot.has-carousel::before {
  content: '';
  display: block;
  aspect-ratio: 4 / 3;
}
.svc-shot.has-carousel::after { z-index: 2; }

/* نقاط صغيرة فوق الصورة، على الجهة المقابلة للأيقونة */
.svc-shot.has-carousel .dots {
  position: absolute;
  inset-block-end: .8rem;
  inset-inline-end: .75rem;
  z-index: 3;
  display: flex;
  gap: .28rem;
}
.svc-shot.has-carousel .dots button {
  width: 16px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  transition: background .2s ease, width .2s ease;
}
.svc-shot.has-carousel .dots button:hover { background: rgba(255,255,255,.75); }
.svc-shot.has-carousel .dots button.is-active { background: var(--signal); width: 22px; }

.svc-shot.has-carousel .svc-badge { z-index: 3; }

@media (prefers-reduced-motion: reduce) {
  .svc-shot.has-carousel .slide { transition: none; }
}

/* --- بطاقات الخدمات بالصور --- */
.svc-card {
  height: 100%;
  background: var(--card);
  border: 1px solid var(--rail);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.svc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.svc-shot { position: relative; background: var(--rail); }
.svc-shot picture, .svc-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.svc-shot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12,29,46,.55), transparent 55%);
}
.svc-badge {
  position: absolute;
  z-index: 2;
  inset-inline-start: .75rem;
  inset-block-end: .75rem;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius-xs);
  background: var(--signal);
  color: var(--steel-900);
  font-size: .95rem;
}
.svc-text { padding: 1rem 1.1rem 1.2rem; }
.svc-text h3 { font-size: 1rem; margin-bottom: .35rem; }
.svc-text p { font-size: .855rem; color: var(--muted); margin: 0; }

/* --- بطاقات صغيرة --- */
.mini-card {
  height: 100%;
  background: var(--card);
  border: 1px solid var(--rail);
  border-radius: var(--radius-s);
  padding: 1rem;
}
.mini-card > i {
  color: var(--signal-dk);
  font-size: 1.1rem;
  margin-bottom: .5rem;
  display: block;
}
.mini-card h3 { font-size: .93rem; margin-bottom: .2rem; }
.mini-card p  { font-size: .82rem; color: var(--muted); margin: 0; }

/* --- خطوط الشحن --- */
.route-list { list-style: none; padding: 0; margin: 0; }
.route-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .875rem;
  font-weight: 500;
  padding: .55rem .8rem;
  border: 1px dashed var(--steel-200);
  border-radius: var(--radius-xs);
  margin-bottom: .5rem;
  background: var(--card);
}
.route-list i { color: var(--signal-dk); width: 18px; text-align: center; }

/* --- شرائح الميزات --- */
.chip {
  display: inline-flex;
  align-items: center;
  font-size: .8rem;
  font-weight: 500;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: #EAF0F6;
  color: var(--steel-700);
}
.chip i { color: var(--ok); font-size: .72rem; }

/* --- خطوات على خلفية داكنة --- */
.steps-dark .step h3 { color: #fff; }
.steps-dark .step p  { color: #A9C0D4; }
.steps-dark .marker  { background: rgba(255,255,255,.05); }

/* --- بطاقات المكاتب --- */
.office-card {
  background: var(--card);
  border: 1px solid var(--rail);
  border-radius: var(--radius);
  padding: 1.1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.office-card .code {
  font-size: .72rem; font-weight: 800; letter-spacing: .1em;
  color: var(--signal-ink); background: #FDF1DC;
  border-radius: var(--radius-xs); padding: .1rem .5rem;
  display: inline-block; direction: ltr; align-self: flex-start;
}
.office-card h3 { font-size: .97rem; margin: .55rem 0 .15rem; }
.office-card .city { font-size: .82rem; color: var(--steel-600); margin: 0 0 .35rem; font-weight: 500; }
.office-card .addr { font-size: .8rem; color: var(--muted); margin: 0 0 .8rem; line-height: 1.65; }
.office-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: .4rem; }
.office-actions .btn { font-size: .76rem; }
.btn-wa { background: #1FA855; border-color: #1FA855; color: #fff; }
.btn-wa:hover, .btn-wa:focus { background: #188945; border-color: #188945; color: #fff; }

.site-footer {
  background: var(--steel-900);
  color: #A9C0D4;
  padding-block: 2.5rem 1.5rem;
  font-size: .855rem;
}
.site-footer h4 { color: #fff; font-size: .92rem; margin-bottom: .7rem; }
.site-footer a { color: #A9C0D4; }
.site-footer a:hover { color: var(--signal); }
.footer-bar {
  border-top: 1px solid rgba(255,255,255,.09);
  margin-top: 1.8rem; padding-top: 1.1rem;
  font-size: .78rem; color: var(--steel-400);
}

/* =====================================================================
   صفحة نتيجة التتبع
   ===================================================================== */
.track-result-head {
  background: linear-gradient(168deg, var(--steel-900), #0A1B2B);
  color: #fff;
  padding-block: 2.2rem 4.5rem;
}
.track-result-head h1 { color: #fff; font-size: 1.4rem; }
.pull-up { margin-top: -3rem; position: relative; z-index: 2; }

/* =====================================================================
   تسجيل الدخول
   ===================================================================== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 340px at 50% 0%, rgba(217,164,65,.12), transparent 60%),
    var(--steel-900);
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.9rem;
  box-shadow: var(--shadow-lg);
}

/* بطاقة توزيع الشحنات على أنواع النقل */
.mode-stat {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem 0;
}
.mode-stat + .mode-stat { border-top: 1px solid var(--rail); }
.mode-stat .ic {
  width: 34px; height: 34px;
  flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-xs);
  background: #ECF1F6;
  color: var(--steel-700);
  font-size: .9rem;
}
.mode-stat .body { flex: 1; min-width: 0; }
.mode-stat .top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .5rem; margin-bottom: .3rem;
}
.mode-stat .nm { font-size: .875rem; font-weight: 500; }
.mode-stat .val { white-space: nowrap; }
.mode-stat .val .num { font-weight: 700; font-size: .95rem; }
.mode-stat .val small { color: var(--muted); font-size: .74rem; margin-inline-start: .25rem; }
.mode-stat .track {
  height: 5px;
  border-radius: 3px;
  background: var(--rail);
  overflow: hidden;
}
.mode-stat .track span {
  display: block;
  height: 100%;
  background: var(--steel-700);
  border-radius: 3px;
}

/* =====================================================================
   اختيار نوع النقل
   ===================================================================== */

/* مُنتقي نوع النقل في نموذج الشحنة الجديدة */
.mode-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.mode-picker .mode-opt { margin: 0; cursor: pointer; }
.mode-picker input { position: absolute; opacity: 0; pointer-events: none; }
.mode-picker span {
  display: block;
  text-align: center;
  border: 1.5px solid var(--rail);
  border-radius: var(--radius-s);
  padding: .7rem .4rem;
  background: var(--card);
  transition: border-color .15s ease, background .15s ease;
}
.mode-picker i { display: block; font-size: 1.15rem; color: var(--steel-400); margin-bottom: .3rem; }
.mode-picker b { display: block; font-size: .86rem; font-weight: 700; }
.mode-picker small { font-size: .7rem; color: var(--muted); }
.mode-picker input:checked + span {
  border-color: var(--steel-700);
  background: #F2F6FA;
  box-shadow: inset 0 -3px 0 var(--signal);
}
.mode-picker input:checked + span i { color: var(--steel-700); }
.mode-picker input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

/* شريط اختيار النوع في الإعدادات — مفتاح مقسّم */
.mode-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  background: var(--card);
  border: 1px solid var(--rail);
  border-radius: var(--radius);
  padding: .7rem .9rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.mode-switch .lbl {
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
}
.mode-switch .seg {
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--rail);
  border-radius: var(--radius-s);
  padding: 3px;
  gap: 3px;
  overflow: hidden;
}
.mode-switch .seg a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .38rem .95rem;
  border-radius: var(--radius-xs);
  font-size: .86rem;
  font-weight: 500;
  color: var(--steel-700);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.mode-switch .seg a i { font-size: .82rem; color: var(--steel-400); }
.mode-switch .seg a:hover { background: rgba(36,68,96,.07); }
.mode-switch .seg a.active {
  background: var(--steel-800);
  color: #fff;
  box-shadow: 0 1px 3px rgba(14,27,38,.18);
}
.mode-switch .seg a.active i { color: var(--signal); }
.mode-switch .hint {
  font-size: .76rem;
  color: var(--muted);
  margin-inline-start: auto;
}

@media (max-width: 575.98px) {
  .mode-picker { grid-template-columns: 1fr; }
  .mode-picker span { display: flex; align-items: center; gap: .6rem; text-align: start; }
  .mode-picker i { margin: 0; }
  .mode-switch { align-items: stretch; }
  .mode-switch .seg { width: 100%; }
  .mode-switch .seg a { flex: 1; justify-content: center; padding-inline: .4rem; }
  .mode-switch .hint { margin-inline-start: 0; }
}

/* =====================================================================
   مصفوفة الانتقالات في الإعدادات
   ===================================================================== */
.trans-matrix { font-size: .8rem; }
.trans-matrix th, .trans-matrix td { text-align: center; vertical-align: middle; padding: .35rem .3rem; }
.trans-matrix thead th { position: sticky; top: 0; background: #F5F8FA; z-index: 2; }
.trans-matrix .row-head { text-align: start; white-space: nowrap; font-weight: 700; background: #FAFCFD; }
.trans-matrix td.self { background: repeating-linear-gradient(45deg, #F2F5F8 0 4px, #E9EEF3 4px 8px); }
.trans-matrix input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* عيّنة اللون في نموذج الحالة */
.color-swatch {
  width: 100%; height: 30px; border-radius: var(--radius-xs);
  border: 1px solid var(--rail); display: grid; place-items: center;
  font-size: .72rem; cursor: pointer;
}
.color-swatch.selected { outline: 2px solid var(--steel-700); outline-offset: 1px; }

/* =====================================================================
   الطباعة والاستجابة والوصول
   ===================================================================== */
/* ترويسة وتذييل يظهران في الطباعة فقط */
.print-only { display: none; }

.print-head {
  align-items: flex-start;
  gap: 8mm;
  padding-bottom: 3mm;
  border-bottom: 0.6mm solid #000;
  margin-bottom: 5mm;
}
.print-head .logo { height: 16mm; width: auto; }
.print-head .org .nm { font-size: 13pt; font-weight: 800; line-height: 1.15; }
.print-head .org .ln { font-size: 7.5pt; color: #333; line-height: 1.5; }
.print-head .doc { margin-inline-start: auto; text-align: end; }
.print-head .doc .t1 { font-size: 12pt; font-weight: 800; }
.print-head .doc .ln { font-size: 8pt; color: #222; line-height: 1.6; }
.print-head .doc .ln b { font-weight: 500; color: #555; }

.print-foot {
  border-top: 0.4mm solid #000;
  margin-top: 6mm;
  padding-top: 2mm;
  font-size: 7.5pt;
  color: #333;
  display: flex;
  justify-content: space-between;
  gap: 6mm;
}

@media print {
  @page { size: A4 portrait; margin: 12mm 11mm 10mm; }

  html, body {
    background: #fff !important;
    font-size: 9.5pt;
    color: #000;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* كل ما هو تفاعلي يختفي */
  .topnav, .page-head, .site-footer, .no-print,
  .btn, .form-control, .form-select, .nav-tabs,
  .dataTables_filter, .dataTables_length, .dataTables_paginate, .dataTables_info,
  .modal, .swal2-container { display: none !important; }

  .print-only { display: block; }
  .print-head { display: flex; }

  .content, .container, .container-fluid { padding: 0 !important; margin: 0 !important; max-width: none !important; }

  /* البطاقات تصير أقساماً مطبوعة بلا ظلال */
  .card {
    box-shadow: none !important;
    border: 0.3mm solid #666 !important;
    border-radius: 0 !important;
    margin-bottom: 5mm !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .card-header {
    background: #EDEDED !important;
    font-size: 9.5pt;
    padding: 2mm 3mm !important;
    border-bottom: 0.3mm solid #666 !important;
  }
  .card-body { padding: 3mm !important; }

  /* الجداول: ترويسة تتكرّر مع كل صفحة */
  table { width: 100% !important; border-collapse: collapse !important; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  tr, img, canvas, svg { break-inside: avoid; page-break-inside: avoid; }
  th, td {
    border: 0.2mm solid #888 !important;
    padding: 1.6mm 2mm !important;
    font-size: 8.5pt !important;
  }
  thead th { background: #EDEDED !important; font-weight: 700; }

  /* مؤشرات الأرقام تُطبع في صف مضغوط */
  .stat {
    border: 0.3mm solid #888 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 2mm !important;
    break-inside: avoid;
  }
  .stat-value { font-size: 11pt !important; }
  .stat-label { font-size: 7.5pt !important; color: #333 !important; }
  .stat-icon { display: none !important; }

  /* شارات الحالة تُطبع بإطار بدل خلفية ملوّنة قد تبهت */
  .st-badge {
    border: 0.2mm solid #555 !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 8pt !important;
  }

  /* الرسوم البيانية */
  canvas { max-width: 100% !important; height: auto !important; }

  a[href]::after { content: ''; }   /* بلا طباعة الروابط بين قوسين */
  .row { display: flex !important; flex-wrap: wrap !important; }
}

@media (max-width: 991.98px) {
  .figure-frame picture, .figure-frame img { aspect-ratio: 16 / 10; }
  .hero-photo .hero-media img { opacity: .3; }
  .topnav .navbar-collapse {
    background: var(--steel-800);
    margin-top: .5rem;
    border-radius: var(--radius-s);
    padding: .6rem;
  }
  .nav-search .form-control { width: 100%; }
  .hero { padding-block: 3rem 5.5rem; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .track-card { margin-top: -3.4rem; }
}

@media (max-width: 575.98px) {
  .section h2, .about-title, .hero h1 { max-width: none; }
  .about-title { font-size: 1.4rem !important; }
  .brand-logo { height: 38px; }
  .footer-logo { width: 128px; }
  .stat-value { font-size: 1.25rem; }
  .section { padding-block: 2.4rem; }
  .section h2 { font-size: 1.3rem; }
  .hero { padding-block: 2.4rem 4.5rem; }
  .track-card { padding: 1.1rem; }
  .svc-shot picture, .svc-shot img { aspect-ratio: 16 / 9; }
  .office-actions .btn { flex: 1 1 100%; justify-content: center; }
  .wb-number { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: var(--signal); color: var(--steel-900);
  padding: .5rem 1rem; z-index: 2000; border-radius: 0 0 var(--radius-xs) 0;
}
.skip-link:focus { inset-inline-start: 0; }