/* Orders: screenshot-inspired reference design, presentation only.
   Status and progress are derived from server-returned orders in legacy-app.js. */
#ordersView #ordersList .orders-modern-list{
  display:grid!important;gap:16px!important;
}
#ordersView #ordersList .orders-modern-card{
  position:relative!important;display:grid!important;
  grid-template-columns:clamp(45px,10vw,65px) minmax(0,1fr) auto!important;
  grid-auto-rows:auto!important;
  align-items:center!important;column-gap:11px!important;row-gap:13px!important;
  min-width:0!important;padding:16px 14px!important;
  border:1px solid #34323b!important;border-inline-start:5px solid #ffc21d!important;
  border-radius:23px!important;background:#16161c!important;
  color:#f9f9fd!important;box-shadow:0 10px 24px #0004!important;
  overflow:hidden!important;
}
#ordersView #ordersList .orders-game-icon{
  grid-column:1!important;border-radius:17px!important;
  background:#111115!important;border-color:#28272d!important;
  width:clamp(45px,10vw,65px)!important;height:clamp(45px,10vw,65px)!important;
}
#ordersView #ordersList .orders-card-main{grid-column:2!important}
#ordersView #ordersList .orders-card-title{
  font-weight:850!important;font-size:clamp(14px,3.8vw,20px)!important;
  color:#fff!important;white-space:normal!important;
}
#ordersView #ordersList .orders-card-meta{
  color:#b3b3bd!important;font-size:clamp(10px,2.65vw,13px)!important;
  white-space:normal!important;line-height:1.7!important;
}
#ordersView #ordersList .orders-card-side{grid-column:3!important;align-items:flex-end!important}
#ordersView #ordersList .orders-card-side>strong{
  color:#fff!important;font-size:clamp(13px,3.1vw,19px)!important;
}
#ordersView #ordersList .orders-status{
  background:rgba(250,188,14,.11)!important;border:1px solid #906b18!important;
  color:#ffc635!important;font-size:11px!important;border-radius:99px!important;
  padding:7px 10px!important;
}
#ordersView #ordersList .orders-status-completed{
  background:#14372d!important;border-color:#3e8a70!important;color:#9af4d1!important;
}
#ordersView #ordersList .orders-status-refunded{
  background:#3a2427!important;border-color:#9a5663!important;color:#ffb9bc!important;
}
#ordersView #ordersList .orders-mini-progress{
  grid-column:1/-1;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;margin:0;padding:0 0 2px;
}
#ordersView #ordersList .orders-mini-progress span{
  display:block;height:9px;min-width:0;background:#383b48;border-radius:20px;
}
#ordersView #ordersList .orders-mini-progress span.is-on{background:#ffbf13}
#ordersView #ordersList .orders-extra-details{
  grid-column:1/-1!important;min-width:0!important;padding-top:11px!important;
  border-top:1px solid #38353a!important;
}
#ordersView #ordersList .orders-extra-details>summary{
  color:#efc35d!important;font-weight:750!important;
}
#ordersView #ordersList .orders-detail-body{
  padding:13px 0 1px!important;display:grid!important;gap:12px!important;
  color:#dfd6c9!important;
}
#ordersView #ordersList .orders-track-panel{
  position:relative;isolation:isolate;overflow:hidden;
  border:1px solid #846316;border-radius:24px;
  padding:clamp(15px,4vw,29px);
  background:radial-gradient(ellipse at 25% 0%,rgba(130,92,25,.22),transparent 70%),
             linear-gradient(137deg,#322916,#1c1c20 82%);
  box-shadow:inset 0 1px 0 #ffffff10;
  direction:rtl;
}
#ordersView #ordersList .orders-track-head{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;min-width:0;
}
#ordersView #ordersList .orders-track-heading{min-width:0;flex:1}
#ordersView #ordersList .orders-track-eyebrow{
  display:block;font-size:clamp(12px,3vw,16px);font-weight:700;color:#aaa4a5;
}
#ordersView #ordersList .orders-track-title{
  display:block;margin:3px 0 0;
  font-size:clamp(24px,7vw,43px)!important;line-height:1.3!important;
  font-weight:900;color:#ffbf16!important;
}
#ordersView #ordersList .orders-track-symbol{
  display:grid;place-items:center;flex:0 0 auto;
  width:clamp(56px,15vw,91px);height:clamp(56px,15vw,91px);
  border-radius:50%;border:3px solid #ae8012;
  background:#584418;box-shadow:0 0 0 7px #bc881423,inset 0 0 0 4px #241f20;
}
#ordersView #ordersList .orders-track-symbol svg{
  display:block;width:52%;height:52%;stroke:#ffc21d;stroke-width:2.2;
  stroke-linecap:round;stroke-linejoin:round;fill:none;
}
#ordersView #ordersList .orders-track-note{
  font-size:clamp(12px,3.15vw,17px);line-height:1.8;
  margin:18px 0 24px;color:#ddd8d4;
}
#ordersView #ordersList .orders-track-steps{
  --track-progress:25%;
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
  position:relative;gap:2px;direction:rtl;
  padding:0!important;margin:0 0 22px!important;
}
#ordersView #ordersList .orders-track-steps::before{
  content:"";position:absolute;z-index:0;
  top:18px;right:9%;left:9%;height:5px;border-radius:10px;
  background:linear-gradient(to left,#ffbd16 0 var(--track-progress),
    #30323d var(--track-progress) 100%);
}
#ordersView #ordersList .orders-track-step{
  display:flex;flex-direction:column;align-items:center;
  min-width:0;gap:8px;position:relative;z-index:1;
  text-align:center;color:#818494;
}
#ordersView #ordersList .orders-track-node{
  display:grid;place-items:center;
  width:39px;height:39px;border-radius:50%;
  background:#282b39;border:2px solid #282b39;color:#9ea3b5;
  box-sizing:border-box;font:800 19px/1 system-ui,sans-serif;
}
#ordersView #ordersList .orders-track-step.is-on .orders-track-node{
  color:#1a1a1f;background:#ffc01a;border-color:#ffc01a;
}
#ordersView #ordersList .orders-track-step.is-current .orders-track-label{
  color:#fff;font-weight:900;
}
#ordersView #ordersList .orders-track-label{
  font-size:clamp(8px,2vw,12px);line-height:1.45;
  font-weight:750;overflow-wrap:anywhere;
}
#ordersView #ordersList .orders-track-refresh{
  display:flex;width:100%;align-items:center;justify-content:center;gap:8px;
  min-height:53px;padding:12px 15px;
  border:2px solid #906d1a;border-radius:18px;
  background:rgba(128,89,12,.20);color:#ffc928;
  font-family:inherit;font-weight:900;font-size:clamp(14px,4vw,20px);line-height:1.2;cursor:pointer;
}
#ordersView #ordersList .orders-track-refresh svg{
  width:22px;height:22px;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;fill:none;
}
#ordersView #ordersList .orders-track-refresh:disabled{opacity:.6;cursor:progress}
#ordersView #ordersList .orders-track-panel[data-progress-state="completed"]{
  border-color:#37765c;background:linear-gradient(140deg,#173c31,#151e22);
}
#ordersView #ordersList .orders-track-panel[data-progress-state="completed"] .orders-track-title{color:#a7f6d0!important}
#ordersView #ordersList .orders-track-panel[data-progress-state="completed"] .orders-track-symbol{
  border-color:#4b9d78;background:#204b3b;
}
#ordersView #ordersList .orders-track-panel[data-progress-state="completed"] .orders-track-symbol svg{stroke:#a7f6d0}
#ordersView #ordersList .orders-track-panel[data-progress-state="refunded"]{
  border-color:#79515c;background:linear-gradient(140deg,#3d222a,#211c23);
}
#ordersView #ordersList .orders-track-panel[data-progress-state="refunded"] .orders-track-title{color:#ffb8bd!important}
#ordersView #ordersList .orders-track-panel[data-progress-state="refunded"] .orders-track-symbol{
  border-color:#ac586c;background:#52303b;
}
#ordersView #ordersList .orders-track-panel[data-progress-state="refunded"] .orders-track-symbol svg{stroke:#ffb8bd}
#ordersView #ordersList .orders-track-panel[data-progress-state="completed"] .orders-track-steps::before{background:#69cba4}
#ordersView #ordersList .orders-track-panel[data-progress-state="completed"] .orders-track-step.is-on .orders-track-node{background:#76e2b4;border-color:#76e2b4}
#ordersView #ordersList .orders-track-panel[data-progress-state="refunded"] .orders-track-steps::before{background:#34303b}
#ordersView #ordersList .orders-track-meta{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;
}
#ordersView #ordersList .orders-track-meta>div{
  min-width:0;padding:12px;background:#1c1c23;
  border:1px solid #343440;border-radius:13px;
}
#ordersView #ordersList .orders-track-meta span{
  display:block;color:#a3a5b1;font-size:11px;margin-bottom:4px;
}
#ordersView #ordersList .orders-track-meta strong{
  display:block;color:#f7f7fa;font-size:13px;font-weight:800;
  overflow-wrap:anywhere;
}
#ordersView #ordersList .orders-complaint{
  display:flex;width:100%;min-height:47px;align-items:center;justify-content:center;
  gap:8px;border:1px solid #326c52;border-radius:14px;
  background:#163728;color:#a4ebc9;font-size:14px;font-weight:850;
  text-decoration:none!important;padding:12px 14px;box-sizing:border-box;
}
#ordersView #ordersList .orders-detail-actions{
  display:flex!important;align-items:center;gap:8px;flex-wrap:wrap!important;
}
#ordersView #ordersList .orders-card-note{margin:0!important}
#ordersView #ordersList .orders-manual-handover{grid-column:auto;margin:0!important}
@media(max-width:540px){
  #ordersView #ordersList .orders-modern-card{padding:13px 11px!important;column-gap:8px!important}
  #ordersView #ordersList .orders-track-panel{border-radius:20px}
  #ordersView #ordersList .orders-track-note{margin:13px 0 17px}
  #ordersView #ordersList .orders-track-steps::before{top:13px;height:4px}
  #ordersView #ordersList .orders-track-node{width:29px;height:29px;font-size:15px}
  #ordersView #ordersList .orders-track-steps{margin-bottom:17px!important}
  #ordersView #ordersList .orders-track-refresh{min-height:48px;border-radius:14px}
}
@media(max-width:350px){
  #ordersView #ordersList .orders-modern-card{grid-template-columns:40px minmax(0,1fr)!important}
  #ordersView #ordersList .orders-card-side{
    grid-column:2!important;grid-row:auto!important;
    flex-direction:row!important;align-items:center!important;justify-content:space-between!important;
  }
  #ordersView #ordersList .orders-mini-progress,
  #ordersView #ordersList .orders-extra-details{grid-column:1/-1!important}
  #ordersView #ordersList .orders-track-meta{grid-template-columns:1fr!important}
}
@media(prefers-reduced-motion:reduce){
  #ordersView #ordersList *{transition:none!important;animation:none!important}
}

/* Entire order card is the disclosure target; no separate summary arrow/text. */
#ordersView #ordersList .orders-modern-card{
  cursor:pointer!important;
  -webkit-tap-highlight-color:transparent;
}
#ordersView #ordersList .orders-modern-card:focus-visible{
  outline:2px solid #ffc21d!important;
  outline-offset:3px!important;
}
#ordersView #ordersList .orders-modern-card.orders-card-expanded{
  border-color:#916f23!important;
}
#ordersView #ordersList .orders-extra-details>summary,
#ordersView #ordersList .orders-extra-details>summary::after{
  display:none!important;
}
#ordersView #ordersList .orders-extra-details:not([open]){
  display:none!important;
}
#ordersView #ordersList .orders-extra-details[open]{
  cursor:default!important;
}
#ordersView #ordersList .orders-detail-body,
#ordersView #ordersList .orders-detail-body button,
#ordersView #ordersList .orders-detail-body a{
  cursor:auto;
}
#ordersView #ordersList .orders-detail-body button{cursor:pointer}
#ordersView #ordersList .orders-detail-body a{cursor:pointer}

/* Order acceptance/completion palette. Presentation only: data-order-status
   comes from the existing backend and is never modified by these rules. */
#ordersView #ordersList .orders-modern-card[data-order-status="completed"]{
  border-color:#27654c!important;
  border-inline-start-color:#35da93!important;
  background:linear-gradient(135deg,#13291f,#14181b 67%)!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"].orders-card-expanded{
  border-color:#39bd82!important;
  border-inline-start-color:#49e6a1!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"]:focus-visible{
  outline-color:#58eab1!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-mini-progress span.is-on{
  background:#3ade9a!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-track-panel{
  border-color:#3d9c75!important;
  background:radial-gradient(ellipse at 22% 0%,rgba(54,177,122,.22),transparent 70%),
    linear-gradient(135deg,#153b2a,#151b1a 82%)!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-track-title{
  color:#79f4b7!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-track-symbol{
  border-color:#39bf83!important;
  background:#205039!important;
  box-shadow:0 0 0 7px #32c98022,inset 0 0 0 4px #182820!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-track-symbol svg{
  stroke:#91ffd0!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-track-steps::before{
  background:#3cd99a!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-track-step.is-on .orders-track-node{
  background:#43dda0!important;border-color:#43dda0!important;color:#102e20!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-track-refresh{
  background:#1c4835!important;border-color:#3dbe83!important;color:#a1fbd2!important;
}
/* Rejected/refunded orders turn red, rather than keeping the yellow waiting bar. */
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"]{
  border-color:#854250!important;
  border-inline-start-color:#f46e86!important;
  background:linear-gradient(135deg,#332027,#1b191e 74%)!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"].orders-card-expanded{
  border-color:#dd6a7e!important;border-inline-start-color:#ff7c94!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"]:focus-visible{
  outline-color:#ff889e!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-mini-progress span.is-on{
  background:#ec6c81!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-panel{
  border-color:#a75b6a!important;
  background:linear-gradient(140deg,#442630,#211b22)!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-title{
  color:#ffb4c3!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-symbol{
  border-color:#d5677d!important;background:#542c38!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-symbol svg{
  stroke:#ffb4c3!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-steps::before{
  background:#38303c!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-step.is-on .orders-track-node{
  background:#e87487!important;border-color:#e87487!important;color:#2b151e!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-refresh{
  background:#48262f!important;border-color:#a75b6a!important;color:#ffb4c3!important;
}

/* Approved (top-up accepted) is BLUE, distinct from completed delivery GREEN.
   Approval remains a database-driven status; nothing here changes the backend. */
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"]{
  border-color:#315b94!important;
  border-inline-start-color:#4ca7ff!important;
  background:linear-gradient(135deg,#132641,#151b28 75%)!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"].orders-card-expanded{
  border-color:#438cdb!important;border-inline-start-color:#68baff!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"]:focus-visible{
  outline-color:#70c5ff!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-status{
  background:#183b66!important;border-color:#427db7!important;color:#b1dcff!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-mini-progress span.is-on{
  background:#4faeff!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-panel{
  border-color:#468bc8!important;
  background:radial-gradient(ellipse at 22% 0%,rgba(54,136,228,.25),transparent 70%),
    linear-gradient(135deg,#163557,#17202d 83%)!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-title{
  color:#89caff!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-symbol{
  border-color:#4aabf7!important;background:#1b4d7b!important;
  box-shadow:0 0 0 7px #4caaff22,inset 0 0 0 4px #10253a!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-symbol svg{
  stroke:#a2deff!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-steps::before{
  background:#4da9fa!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-step.is-on .orders-track-node{
  background:#62b9ff!important;border-color:#62b9ff!important;color:#0c2945!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-refresh{
  background:#1c4267!important;border-color:#4b9ddc!important;color:#b5e3ff!important;
}

/* Wallet top-ups have two decisions only: approval or rejection.
   Purchase orders retain their five independent progress steps. */
#ordersView #ordersList .orders-mini-progress[data-stage-count="2"]{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
#ordersView #ordersList .orders-track-steps[data-stage-count="2"]{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
#ordersView #ordersList .orders-track-steps[data-stage-count="2"]::before{
  left:25%!important;right:25%!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-track-steps[data-stage-count="2"]::before{
  background:#ea738a!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-track-steps[data-stage-count="2"]::before{
  background:#4da9fa!important;
}

/* Order detail popup: a native modal in the top layer, not a disclosure below
   the order card. The body scrolls INSIDE the popup on smaller phones. */
#ordersView #ordersList .orders-view-dialog:not([open]){
  display:none!important;
}
#ordersView #ordersList .orders-view-dialog[open]{
  display:block!important;
  position:fixed!important;
  inset:0!important;
  width:min(94vw,560px)!important;
  max-width:560px!important;
  max-height:min(88dvh,820px)!important;
  height:auto!important;
  padding:14px 15px max(18px,env(safe-area-inset-bottom))!important;
  margin:auto!important;
  border:1px solid #656273!important;
  border-radius:23px!important;
  background:#15151d!important;
  box-sizing:border-box!important;
  color:#faf9ff!important;
  box-shadow:0 26px 100px rgba(0,0,0,.78)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  direction:rtl!important;
  text-align:right!important;
  cursor:default!important;
}
#ordersView #ordersList .orders-view-dialog::backdrop{
  background:rgba(2,3,11,.84);
  backdrop-filter:blur(5px);
  -webkit-backdrop-filter:blur(5px);
}
#ordersView #ordersList .orders-modal-head{
  position:sticky;
  top:-14px;
  z-index:3;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 0 14px;
  margin-bottom:5px;
  background:#15151d;
  border-bottom:1px solid #393946;
}
#ordersView #ordersList .orders-modal-heading{
  min-width:0;display:grid;gap:3px;
}
#ordersView #ordersList .orders-modal-heading small{
  color:#a4a8ba;font-size:12px;font-weight:650;
}
#ordersView #ordersList .orders-modal-heading strong{
  color:#fff;font-size:clamp(16px,4vw,21px);font-weight:850;
  line-height:1.5;overflow-wrap:anywhere;
}
#ordersView #ordersList .orders-modal-close{
  display:grid!important;
  place-items:center!important;
  flex:0 0 auto!important;
  width:43px!important;
  height:43px!important;
  min-width:43px!important;
  min-height:43px!important;
  padding:0!important;
  border-radius:13px!important;
  border:1px solid #5a5c6a!important;
  background:#292a36!important;
  color:#fff!important;
  font:700 29px/1 system-ui,sans-serif!important;
  cursor:pointer!important;
  -webkit-tap-highlight-color:transparent;
}
#ordersView #ordersList .orders-modal-close:focus-visible{
  outline:2px solid #ffc122;
  outline-offset:3px;
}
#ordersView #ordersList .orders-view-dialog .orders-extra-details{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  padding:0!important;
  border:0!important;
  margin:0!important;
}
#ordersView #ordersList .orders-view-dialog .orders-detail-body{
  padding:5px 0 0!important;
}
#ordersView #ordersList .orders-modern-card[data-order-phase="approved"] .orders-view-dialog{
  border-color:#4a96d4!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="completed"] .orders-view-dialog{
  border-color:#3db885!important;
}
#ordersView #ordersList .orders-modern-card[data-order-status="refunded"] .orders-view-dialog{
  border-color:#b36376!important;
}
@media(max-width:540px){
  #ordersView #ordersList .orders-view-dialog[open]{
    width:calc(100vw - 20px)!important;
    max-height:calc(100dvh - 46px)!important;
    padding:11px 11px max(16px,env(safe-area-inset-bottom))!important;
    border-radius:19px!important;
  }
  #ordersView #ordersList .orders-modal-head{
    top:-11px;padding:8px 1px 11px;
  }
  #ordersView #ordersList .orders-track-panel{
    padding:clamp(13px,3.6vw,22px)!important;
  }
}
@media(prefers-reduced-motion:no-preference){
  #ordersView #ordersList .orders-view-dialog[open]{
    animation:orders-modal-appear .16s ease-out both;
  }
  @keyframes orders-modal-appear{
    from{opacity:.65;transform:translateY(12px) scale(.985)}
    to{opacity:1;transform:translateY(0) scale(1)}
  }
}

/* Three customer-facing stages, with room for each Arabic label. */
#ordersView #ordersList .orders-track-steps[data-stage-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px}
#ordersView #ordersList .orders-track-steps[data-stage-count="3"]::before{left:16.666%;right:16.666%}
#ordersView #ordersList .orders-track-steps[data-stage-count="3"] .orders-track-label{white-space:normal;line-height:1.7;font-size:12px}
