    :root {
      --ink: #0E211A;
      --primary: #0B6E4F;
      --primary-700: #08533C;
      --primary-050: #E7F1ED;
      --gold: #B8902A;
      --gold-050: #F7F0DD;
      --bg: #F4F6F4;
      --card: #FFFFFF;
      --line: #E4E8E5;
      --muted: #6A7B73;
      --danger: #C0392B;
      --warn: #B8902A;
      --sidebar-w: 268px;
    }

    * {
      font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
    }

    body {
      background: var(--bg);
      color: var(--ink);
      margin: 0;
    }

    .num {
      font-feature-settings: "tnum";
      direction: ltr;
      unicode-bidi: isolate;
    }

    /* ===== Topbar ===== */
    .topbar {
      height: 62px;
      background: var(--card);
      border-bottom: 1px solid var(--line);
      position: sticky;
      top: 0;
      z-index: 1030;
      display: flex;
      align-items: center;
      padding: 0 20px;
      gap: 16px;
    }

    .topbar .brand-mark {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: #fff;
      border: 1px solid var(--line);
      color: #fff;
      display: grid;
      place-items: center;
      font-size: 18px;
      flex: none;
      overflow: hidden;
      padding: 3px;
    }

    .topbar .brand-mark img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .topbar .brand-name {
      font-weight: 700;
      font-size: 15px;
      line-height: 1.1;
    }

    .topbar .brand-sub {
      font-size: 11px;
      color: var(--muted);
    }

    .top-search {
      max-width: 340px;
      width: 100%;
      background: var(--bg);
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 7px 12px;
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
    }

    .top-search input {
      border: 0;
      background: transparent;
      outline: 0;
      width: 100%;
      font-size: 13px;
      color: var(--ink);
    }

    .icon-btn {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: #fff;
      display: grid;
      place-items: center;
      color: var(--ink);
      position: relative;
    }

    .icon-btn .dot {
      position: absolute;
      top: 8px;
      left: 9px;
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--danger);
    }

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

    .avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--gold-050);
      color: var(--gold);
      display: grid;
      place-items: center;
      font-weight: 700;
      font-size: 14px;
    }

    .role-squares {
      align-items: center;
      gap: 6px;
      padding-left: 10px;
      margin-left: 4px;
      border-left: 1px solid #333;
    }

    .role-square {
      width: 67px;
      height: 34px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: #fff;
      font-size: 10px;
      font-weight: 700;
      text-align: center;
      line-height: 1.1;
      text-decoration: none;
      opacity: 0.85;
      transition: opacity .15s, transform .15s;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
    }

    .role-square:hover {
      opacity: 1;
      transform: translateY(-1px);
      color: #fff;
    }

    .role-square.active {
      opacity: 1;
      box-shadow: 0 0 0 2px #fff, inset 0 0 0 1px rgba(255,255,255,.3);
    }

    /* ===== Layout ===== */
    .layout {
      display: flex;
      align-items: stretch;
      min-height: 100vh;
    }

    .right-container {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .sidebar {
      width: var(--sidebar-w);
      flex: none;
      background: var(--ink);
      color: #D7E2DC;
      min-height: 100vh;
      position: sticky;
      top: 0;
      padding: 14px 12px;
      overflow-y: auto;
      max-height: 100vh;
      transition: width .2s ease;
    }

    .sidebar::-webkit-scrollbar { width: 6px; }
    .sidebar::-webkit-scrollbar-track { background: transparent; }
    .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; }

    #sidebar {
      height: 100vh;
    }

    .toggle-sidebar {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      margin: 0 auto 10px;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: #8FA89E;
      cursor: pointer;
      transition: .15s;
    }

    .toggle-sidebar:hover {
      background: rgba(255, 255, 255, .07);
      color: #fff;
    }

    .toggle-sidebar svg {
      transition: transform .2s ease;
    }

    .sidebar.compact .toggle-sidebar svg {
      transform: scaleX(-1);
    }

    .sidebar.compact {
      width: 74px;
    }

    .sidebar.compact .side-label,
    .sidebar.compact .nav-item span {
      display: none;
    }

    .sidebar.compact .nav-item {
      justify-content: center;
    }

    .side-label {
      font-size: 10.5px;
      letter-spacing: .04em;
      color: #7E948B;
      padding: 14px 12px 6px;
      font-weight: 600;
    }

    a.nav-item { text-decoration: none; }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 9px 12px;
      border-radius: 9px;
      color: #C7D5CE;
      font-size: 13.5px;
      cursor: pointer;
      margin: 0.08rem 0.1rem !important;
      transition: .15s;
      border: 1px solid transparent;
      text-align: right;
    }

    .nav-item i {
      font-size: 16px;
      width: 20px;
      text-align: center;
      color: #8FA89E;
      flex: none;
    }

    .nav-item:hover {
      background: rgba(255, 255, 255, .05);
      color: #fff;
    }

    .nav-item.active {
      background: var(--primary);
      color: #fff;
    }

    .nav-item.active i {
      color: #fff;
    }

    .nav-num {
      margin-inline-start: auto;
      font-size: 11px;
      color: #7E948B;
      background: rgba(255, 255, 255, .06);
      border-radius: 6px;
      padding: 1px 7px;
    }

    .content {
      flex: 1;
      padding: 26px 30px 60px;
      min-width: 0;
    }

    .page-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 22px;
      flex-wrap: wrap;
    }

    .crumb {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 5px;
    }

    .page-title {
      font-size: 23px;
      font-weight: 700;
      margin: 0;
      letter-spacing: -.01em;
    }

    .page-desc {
      font-size: 13px;
      color: var(--muted);
      margin-top: 4px;
      max-width: 640px;
    }

    /* ===== Cards ===== */
    .card-soft {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 14px;
    }

    .card-soft .card-head {
      padding: 15px 18px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .card-head h6 {
      margin: 0;
      font-weight: 600;
      font-size: 14.5px;
    }

    .card-head .hint {
      font-size: 11.5px;
      color: var(--muted);
    }

    .stat {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 18px;
    }

    .stat .ico {
      width: 42px;
      height: 42px;
      border-radius: 11px;
      display: grid;
      place-items: center;
      font-size: 20px;
      margin-bottom: 14px;
    }

    .stat .v {
      font-size: 27px;
      font-weight: 700;
      line-height: 1;
    }

    .stat .l {
      font-size: 12.5px;
      color: var(--muted);
      margin-top: 6px;
    }

    .stat .trend {
      font-size: 11.5px;
      margin-top: 9px;
    }

    .i-green {
      background: var(--primary-050);
      color: var(--primary);
    }

    .i-gold {
      background: var(--gold-050);
      color: var(--gold);
    }

    .i-blue {
      background: #E7EFF6;
      color: #2C6CA8;
    }

    .i-red {
      background: #FBE9E7;
      color: var(--danger);
    }

    /* ===== Tables ===== */
    table.tbl {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }

    table.tbl th {
      text-align: center;
      font-weight: 600;
      color: var(--muted);
      font-size: 11.5px;
      padding: 11px 16px;
      background: #FAFBFA;
      border: 1px solid var(--line);
    }

    table.tbl td {
      padding: 13px 16px;
      border: 1px solid var(--line);
      vertical-align: middle;
      text-align: center;
    }

    table.tbl th.cell-name,
    table.tbl td.cell-name {
      text-align: right;
    }

    table.tbl tbody tr:nth-child(even) td {
      background: #FBFCFB;
    }

    table.tbl tr:hover td {
      background: var(--primary-050);
    }

    /* غلاف تمرير أفقي للجداول العريضة */
    .table-wrap {
      width: 100%;
      overflow-x: auto;
    }

    /* الجداول تملأ عرض الحاوية بالكامل؛ التمرير الأفقي يظهر فقط عند الحاجة الفعلية */
    .table-wrap table.tbl {
      width: 100%;
    }

    /* أرضية عرض فقط للجدول العريض متعدد الأعمدة (التوظيف والفرز) */
    table.tbl.tbl-wide {
      min-width: 900px;
    }

    /* شريحة رقمية موحّدة داخل الجداول */
    .cell-score {
      display: inline-block;
      min-width: 38px;
      text-align: center;
      font-weight: 700;
      padding: 3px 10px;
      border-radius: 30px;
      background: var(--primary-050);
      color: var(--primary);
    }

    .cell-contact {
      line-height: 1.5;
      font-size: 12px;
    }

    .cell-contact .muted {
      color: var(--muted);
    }

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

    .person .pa {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: var(--primary-050);
      color: var(--primary);
      display: grid;
      place-items: center;
      font-size: 12px;
      font-weight: 700;
      flex: none;
    }

    .person small {
      color: var(--muted);
      font-size: 11.5px;
    }

    /* ===== Badges ===== */
    .pill {
      font-size: 11.5px;
      font-weight: 600;
      padding: 3px 10px;
      border-radius: 30px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .pill::before {
      content: "";
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: currentColor;
    }

    .pill-ok {
      background: var(--primary-050);
      color: var(--primary-700);
    }

    .pill-wait {
      background: var(--gold-050);
      color: #8A6D1F;
    }

    .pill-no {
      background: #FBE9E7;
      color: var(--danger);
    }

    .pill-grey {
      background: #EEF1EF;
      color: #5C6B63;
    }

    .pill-blue {
      background: #E7EFF6;
      color: #2C6CA8;
    }

    /* ===== Forms ===== */
    .form-label {
      font-size: 12.5px;
      font-weight: 600;
      margin-bottom: 5px;
    }

    .form-control,
    .form-select {
      border: 1px solid var(--line);
      border-radius: 9px;
      font-size: 13.5px;
      padding: 9px 12px;
    }

    .form-control:focus,
    .form-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-050);
    }

    .form-hint {
      font-size: 11px;
      color: var(--muted);
      margin-top: 4px;
    }

    .btn-primary {
      background: var(--primary);
      border: none;
      border-color:transparent;
      font-weight: 600;
      color:white;
      font-size: 13.5px;
      padding: 9px 18px;
      border-radius: 9px;
    }

    .btn-primary:hover {
      background: var(--primary-700);
    }

    .btn-ghost {
      background: #fff;
      border: 1px solid var(--line);
      color: var(--ink);
      font-weight: 600;
      font-size: 13.5px;
      padding: 9px 16px;
      border-radius: 9px;
    }

    .btn-ghost:hover {
      background: var(--bg);
    }

    .btn-primary.btn-sm,
    .btn-ghost.btn-sm {
      padding: 5px 12px;
      font-size: 12.5px;
      border-radius: 7px;
    }

    /* ===== Confirm Modal ===== */
    .hr-confirm-overlay {
      position: fixed;
      inset: 0;
      background: rgba(14, 33, 26, 0.45);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
      opacity: 0;
      visibility: hidden;
      transition: opacity .18s ease;
    }

    .hr-confirm-overlay.show {
      opacity: 1;
      visibility: visible;
    }

    .hr-confirm-box {
      background: var(--card);
      border-radius: 14px;
      border: 1px solid var(--line);
      width: 100%;
      max-width: 380px;
      padding: 26px;
      text-align: center;
      transform: translateY(10px) scale(.97);
      transition: transform .18s ease;
      box-shadow: 0 20px 50px rgba(14, 33, 26, .18);
    }

    .hr-confirm-overlay.show .hr-confirm-box {
      transform: translateY(0) scale(1);
    }

    .hr-confirm-icon {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      margin: 0 auto 14px;
      font-size: 22px;
    }

    .hr-confirm-icon-primary {
      background: var(--primary-050);
      color: var(--primary);
    }

    .hr-confirm-icon-danger {
      background: #FBEAE7;
      color: var(--danger);
    }

    .hr-confirm-title {
      font-weight: 700;
      font-size: 16px;
      color: var(--ink);
      margin-bottom: 6px;
    }

    .hr-confirm-message {
      font-size: 13.5px;
      color: var(--muted);
      margin-bottom: 22px;
      line-height: 1.6;
    }

    .hr-confirm-actions {
      display: flex;
      gap: 10px;
    }

    .hr-confirm-btn {
      flex: 1;
      border: none;
      border-radius: 9px;
      padding: 10px 0;
      font-weight: 600;
      font-size: 13.5px;
      cursor: pointer;
    }

    .hr-confirm-btn-cancel {
      background: #fff;
      border: 1px solid var(--line);
      color: var(--ink);
    }

    .hr-confirm-btn-cancel:hover {
      background: var(--bg);
    }

    .hr-confirm-btn-primary {
      background: var(--primary);
      color: #fff;
    }

    .hr-confirm-btn-primary:hover {
      background: var(--primary-700);
    }

    .hr-confirm-btn-danger {
      background: var(--danger);
      color: #fff;
    }

    .hr-confirm-btn-danger:hover {
      background: #A5311F;
    }

    .dropzone {
      border: 1.5px dashed var(--line);
      border-radius: 12px;
      background: #FAFBFA;
      padding: 26px;
      text-align: center;
      color: var(--muted);
    }

    .dropzone i {
      font-size: 30px;
      color: var(--primary);
      opacity: .7;
    }

    .section {
      display: none;
    }

    .section.show {
      display: block;
      animation: fade .25s ease;
    }

    @keyframes fade {
      from {
        opacity: 0;
        transform: translateY(6px)
      }

      to {
        opacity: 1;
        transform: none
      }
    }

    .alert-row {
      display: flex;
      align-items: center;
      gap: 13px;
      padding: 13px 6px;
      border-bottom: 1px solid var(--line);
    }

    .alert-row:last-child {
      border-bottom: 0;
    }

    .alert-ic {
      width: 36px;
      height: 36px;
      border-radius: 9px;
      display: grid;
      place-items: center;
      font-size: 17px;
      flex: none;
    }

    .timeline {
      position: relative;
      padding-inline-start: 8px;
    }

    .tl-step {
      position: relative;
      padding: 0 26px 22px 0;
      border-inline-start: 2px solid var(--line);
      margin-inline-start: 9px;
    }

    .tl-step:last-child {
      border-color: transparent;
      padding-bottom: 0;
    }

    .tl-dot {
      position: absolute;
      inset-inline-start: -9px;
      top: 0;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #fff;
      border: 2px solid var(--line);
    }

    .tl-step.done .tl-dot {
      background: var(--primary);
      border-color: var(--primary);
    }

    .tl-step.now .tl-dot {
      border-color: var(--gold);
      background: var(--gold-050);
    }

    .tl-t {
      font-size: 13.5px;
      font-weight: 600;
    }

    .tl-s {
      font-size: 12px;
      color: var(--muted);
    }

    .mini-stat {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
    }

    .progress {
      height: 8px;
      background: #EEF1EF;
      border-radius: 30px;
    }

    .progress-bar {
      background: var(--primary);
    }

    .demo-tag {
      position: fixed;
      bottom: 16px;
      inset-inline-start: 16px;
      z-index: 1040;
      background: var(--ink);
      color: #fff;
      font-size: 11.5px;
      padding: 7px 14px;
      border-radius: 30px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
      display: flex;
      align-items: center;
      gap: 7px;
    }

    @media (max-width:991px) {
      .sidebar {
        position: fixed;
        inset-inline-end: 0;
        z-index: 1029;
        transform: translateX(100%);
        transition: .25s;
        box-shadow: -12px 0 40px rgba(0, 0, 0, .25);
      }

      .sidebar.open {
        transform: none;
      }

      .content {
        padding: 20px 16px 60px;
      }
    }


.media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.cert {
  background: var(--card-bg, #fff);
  border: 1px solid var(--line, #e0e0e0);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: all 0.2s ease;
  margin: 0;
}
.cert.ph {
  border-style: dashed;
  opacity: 0.8;
}
.phbox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted, #666);
  cursor: default;
}
.phbox span {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink, #222);
}
.phbox small {
  font-size: 12px;
  color: var(--muted, #777);
}

/* ============================================================
   Order Detail — لوحة معلومات الطلب (تصميم مُحسّن)
   ============================================================ */

/* ----- بطاقة الرأس (Hero) ----- */
.od-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0B6E4F 0%, #08533C 100%);
  border-radius: 18px;
  padding: 24px 26px;
  color: #fff;
  box-shadow: 0 14px 34px rgba(8, 83, 60, .22);
  margin-bottom: 18px;
}

.od-hero::after {
  content: "";
  position: absolute;
  inset-inline-start: -60px;
  top: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(184, 144, 42, .30) 0%, rgba(184, 144, 42, 0) 70%);
  pointer-events: none;
}

.od-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.od-hero-id {
  display: flex;
  align-items: center;
  gap: 15px;
}

.od-hero-avatar {
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex: none;
  backdrop-filter: blur(2px);
}

.od-hero-crumb {
  font-size: 12px;
  color: rgba(255, 255, 255, .7);
  margin-bottom: 3px;
}

.od-hero-crumb a {
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
}

.od-hero-crumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.od-hero-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.od-hero-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .82);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.od-hero-sub .sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
}

.od-hero-sub i {
  opacity: .8;
  margin-inline-end: 4px;
}

/* شارة الحالة داخل الرأس */
.od-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 30px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
}

.od-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.od-status.is-delivered { background: rgba(255,255,255,.22); }
.od-status.is-cancelled { background: rgba(192, 57, 43, .9); border-color: rgba(255,255,255,.3); }

.od-hero-cancel {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 15px;
  border-radius: 9px;
  cursor: pointer;
  transition: .15s;
}

.od-hero-cancel:hover {
  background: rgba(192, 57, 43, .92);
  border-color: transparent;
  color: #fff;
}

/* شريط التقدّم داخل الرأس */
.od-progress {
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.od-progress-labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, .85);
  margin-bottom: 7px;
}

.od-progress-labels strong {
  color: #fff;
  font-size: 13px;
}

.od-progress-track {
  height: 9px;
  background: rgba(255, 255, 255, .18);
  border-radius: 30px;
  overflow: hidden;
}

.od-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #E6C25A 0%, #B8902A 100%);
  border-radius: 30px;
  transition: width .5s ease;
}

/* ----- شريط الإحصائيات ----- */
.od-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}

.od-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  transition: box-shadow .15s, transform .15s;
}

.od-stat:hover {
  box-shadow: 0 8px 22px rgba(14, 33, 26, .07);
  transform: translateY(-2px);
}

.od-stat .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}

.od-stat .v {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.od-stat .l {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

/* ----- الخط الزمني المُحسّن ----- */
.od-timeline {
  position: relative;
}

.od-step {
  position: relative;
  padding: 0 58px 24px 0;
  min-height: 46px;
}

.od-step::before {
  content: "";
  position: absolute;
  inset-inline-start: 21px;
  top: 44px;
  bottom: -2px;
  width: 2px;
  background: var(--line);
}

.od-step:last-child::before { display: none; }

.od-step.done::before { background: var(--primary); }

/* شارة رقم الخطوة */
.od-badge {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--muted);
  z-index: 1;
}

.od-step.done .od-badge {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.od-step.now .od-badge {
  background: var(--gold-050);
  border-color: var(--gold);
  color: #8A6D1F;
  box-shadow: 0 0 0 4px rgba(184, 144, 42, .14);
}

.od-step-head {
  padding-top: 2px;
  margin-bottom: 12px;
}

.od-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}

.od-step-flag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
}

.od-step.now .od-step-flag {
  background: var(--gold-050);
  color: #8A6D1F;
}

.od-step.done .od-step-flag {
  background: var(--primary-050);
  color: var(--primary-700);
}

.od-step-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* المراحل القادمة (المقفلة) — لا يمكن تنفيذ أي إجراء قبل إكمال المرحلة الحالية */
.od-step.upcoming .od-badge {
  background: #F1F3F2;
}

.od-step.upcoming .od-step-flag {
  background: #EEF1EF;
  color: #7C8B83;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.od-step.upcoming .od-card {
  opacity: 0.6;
  filter: grayscale(0.35);
  pointer-events: none;
  user-select: none;
  position: relative;
}

.od-lock-note {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: #7C8B83;
  background: repeating-linear-gradient(45deg, #F7F8F7, #F7F8F7 10px, #F1F3F2 10px, #F1F3F2 20px);
  border-bottom: 1px solid var(--line);
}

.od-lock-note i { font-size: 14px; }

/* ----- بطاقة الخطوة ----- */
.od-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(14, 33, 26, .04);
  overflow: hidden;
}

.od-card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #FAFBFA;
}

.od-card-head .ttl {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.od-card-head .ttl i {
  color: var(--primary);
  font-size: 16px;
}

.od-card-body {
  padding: 18px;
}

.od-card-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #FAFBFA;
}

.od-cost-label { font-size: 13px; }
.od-cost-label strong { font-size: 16px; color: var(--primary-700); }
.od-cost-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* صورة الطلب */
.od-photo {
  border-radius: 12px;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #FAFBFA;
  padding: 6px;
}

/* ----- لوحة تكليف موظف ----- */
.od-assign {
  background: linear-gradient(180deg, var(--primary-050) 0%, #fff 62%);
  border: 1px solid #D6E5DE;
  border-radius: 13px;
  padding: 16px 18px 18px;
}

.od-assign-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary-700);
  margin-bottom: 15px;
}

.od-assign-title i { font-size: 17px; }

.od-assign-picker {
  max-width: 400px;
  margin-bottom: 16px;
}

.od-assign-picker .form-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

#empDatesWrap {
  max-width: 100%;
}

.od-emp-dates {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.od-emp-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.od-emp-date-name {
  min-width: 160px;
  font-size: 13px;
  font-weight: 600;
}

.od-emp-date-row input[type="date"] {
  width: auto;
  max-width: 180px;
}

.od-emp-date-row input[type="text"] {
  width: auto;
  max-width: 220px;
  flex: 1 1 180px;
}

.od-photo-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
  border: 2px dashed #D6E5DE;
  border-radius: 14px;
  background: var(--primary-050);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color .15s ease;
}

.od-photo-picker:hover {
  border-color: var(--primary-700);
}

.od-photo-preview {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.od-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--primary-700);
  font-size: 14px;
  font-weight: 600;
}

.od-photo-empty i {
  font-size: 34px;
}

.od-assign .ts-wrapper { width: 100%; }

.od-assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 13px;
  align-items: end;
}

.od-assign .form-control,
.od-assign .form-select {
  width: 100%;
  padding: 8px 11px;
  font-size: 13px;
  border-radius: 8px;
}

.od-assign-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.od-assign-actions .btn-primary {
  padding: 9px 24px;
  font-size: 13px;
  border-radius: 9px;
}

/* توحيد ارتفاع الحقول والأزرار في النماذج الأفقية داخل بطاقات الطلب */
.od-card-body form.d-flex .form-control,
.od-card-body form.d-flex .form-select,
.od-card-body form.d-flex .btn-primary,
.od-card-body form.d-flex .btn-ghost {
  height: 40px;
  box-sizing: border-box;
}

.od-card-body form.d-flex .btn-primary,
.od-card-body form.d-flex .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* لوحة تفاصيل العينة + التحليل بالذكاء الاصطناعي (المرحلة الأولى) */
.od-analyze {
  background: linear-gradient(180deg, #FBF6E9 0%, #fff 68%);
  border: 1px solid #ECDFBF;
  border-radius: 12px;
  padding: 14px 16px 16px;
}

.od-analyze .form-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #8A6D1F;
}

.od-analyze .form-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.od-analyze .od-warn {
  color: #8A6D1F;
  font-weight: 600;
}

.od-analyze-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 14px;
}

.od-analyze-btn i { font-size: 16px; }

/* نموذج مضمّن (inline) — الحقول في شبكة متجاوبة بدل سطر لكل حقل */
.form-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.form-inline-grid .span-all {
  grid-column: 1 / -1;
}

.form-inline-grid .form-label {
  font-size: 12.5px;
  margin-bottom: 5px;
}

.form-inline-grid .form-control,
.form-inline-grid .form-select {
  width: 100%;
}

/* صندوق اختيار عميل موجود في صفحة إنشاء الطلب */
.customer-lookup {
  background: linear-gradient(180deg, var(--primary-050) 0%, #fff 70%);
  border: 1px solid #D6E5DE;
  border-radius: 12px;
  padding: 13px 15px 15px;
}

.customer-lookup .form-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-700);
}

.customer-lookup .form-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
}

/* عمود الإجراءات في جدول الموظفين — ضبط تاريخ الانتهاء السريع */
.od-row-actions {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.od-enddate {
  display: flex;
  align-items: center;
  gap: 6px;
}

.od-enddate-lbl {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.od-enddate .form-control-sm {
  height: 34px;
  padding: 5px 9px;
  font-size: 12.5px;
  max-width: 150px;
}

.od-row-actions .btn-primary.btn-sm,
.od-row-actions .btn-ghost.btn-sm {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991px) {
  .od-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
  .od-stats { grid-template-columns: 1fr; }
  .od-step { padding-inline-end: 0; padding-inline-start: 0; }
  .od-step::before, .od-badge { display: none; }
  .od-assign-picker { max-width: 100%; }
  .od-assign-actions { justify-content: stretch; }
  .od-assign-actions .btn-primary { width: 100%; }
}