/* Respark OS · shared by every system page (customer care, inventory, the chooser):
   1) the sidebar «النظام الحالي / تغيير النظام» box, 2) the branded curtain that moves between systems. */

/* ---------- sidebar: current system + switch ---------- */
.sys-box{flex:none;position:relative;overflow:hidden;display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:16px;
  border:1px solid rgba(255,253,249,.12);background:linear-gradient(160deg,rgba(255,253,249,.07),rgba(255,253,249,.02))}
.sys-box::before{content:"";position:absolute;inset:auto -40px -70px auto;width:160px;height:160px;pointer-events:none;
  background:radial-gradient(closest-side,rgba(240,90,24,.32),transparent)}
.sys-box>*{position:relative}
.sys-box[hidden]{display:none}
.sb-cur{display:flex;align-items:center;gap:10px;min-width:0}
.sb-txt{display:flex;flex-direction:column;gap:3px;min-width:0}
.sb-k{font:500 11px/1 "IBM Plex Mono","Tajawal",ui-monospace,monospace;letter-spacing:.06em;color:#aaa39a}
.sb-cur b{font:800 16px/1.2 "Tajawal",system-ui,sans-serif;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sb-ico{flex:none;width:34px;height:34px;border-radius:11px;background:rgba(240,90,24,.16);color:#ff9b6e;display:grid;place-items:center}
.sb-ico svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round;stroke-linecap:round}
.sb-live{flex:none;width:8px;height:8px;border-radius:50%;background:#2fbf8f;margin-inline-start:auto;animation:sbPing 2.4s ease-out infinite}
@keyframes sbPing{0%{box-shadow:0 0 0 0 rgba(47,191,143,.55)}70%{box-shadow:0 0 0 8px rgba(47,191,143,0)}100%{box-shadow:0 0 0 0 rgba(47,191,143,0)}}
.sb-btn{display:flex;align-items:center;justify-content:space-between;gap:8px;text-decoration:none;color:#1a1a1a;background:#fffdf9;
  border-radius:12px;padding:9px 10px 9px 12px;font:800 15px/1.2 "Tajawal",system-ui,sans-serif;position:relative;overflow:hidden;
  transition:transform .25s cubic-bezier(.2,.8,.2,1),box-shadow .25s}
.sb-btn::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent 30%,rgba(240,90,24,.18) 50%,transparent 70%);transform:translateX(120%);transition:transform .8s cubic-bezier(.2,.8,.2,1)}
.sb-btn:hover,.sb-btn:focus-visible{transform:translateY(-1px);box-shadow:0 12px 26px rgba(240,90,24,.28)}
.sb-btn:hover::after{transform:translateX(-120%)}
.sb-arr{flex:none;display:inline-grid;place-items:center;width:28px;height:28px;border-radius:9px;background:#1a1a1a;color:#fff;font-size:15px;transition:transform .55s cubic-bezier(.2,.8,.2,1)}
.sb-btn:hover .sb-arr,.sb-btn:focus-visible .sb-arr{transform:rotate(180deg)}
/* icon rail (761–1100px): the switch becomes one square button */
@media (max-width:1100px) and (min-width:761px){
  .sys-box{padding:6px;width:56px;align-items:center;border-radius:14px}
  .sys-box::before,.sb-cur{display:none}
  .sb-btn{width:44px;height:44px;padding:0;justify-content:center}
  .sb-btn>span:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
}
/* the header shortcut is for phones only (the sidebar is a drawer there) */
.sys-switch{display:none!important}
@media (max-width:760px){.sys-switch{display:inline-flex!important}}

/* ---------- curtain between systems ---------- */
html.rs-arrive::after{content:"";position:fixed;inset:0;z-index:10001;background:#1a1a1a}
.rs-transit{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;overflow:hidden;pointer-events:all;
  background:#1a1a1a;color:#fffdf9;font-family:"Tajawal",system-ui,sans-serif;-webkit-font-smoothing:antialiased;
  clip-path:circle(0px at var(--x,50%) var(--y,50%));transition:clip-path .64s cubic-bezier(.77,0,.18,1)}
.rs-transit.on{clip-path:circle(var(--r,150vmax) at var(--x,50%) var(--y,50%))}
.rs-transit.full{clip-path:inset(0 0 0 0);transition:none}
.rs-transit.full.out{clip-path:inset(0 0 100% 0);transition:clip-path .8s cubic-bezier(.77,0,.18,1)}
.rs-transit::before{content:"";position:absolute;inset:0;opacity:.6;pointer-events:none;background:
  linear-gradient(90deg,transparent calc(25% - 1px),rgba(255,253,249,.07) 25%,transparent calc(25% + 1px),transparent calc(50% - 1px),rgba(255,253,249,.07) 50%,transparent calc(50% + 1px),transparent calc(75% - 1px),rgba(255,253,249,.07) 75%,transparent calc(75% + 1px)),
  radial-gradient(rgba(255,253,249,.11) .6px,transparent .7px) 0 0/12px 12px}
.rs-transit::after{content:"";position:absolute;inset:auto -10% -45% -10%;height:80%;pointer-events:none;background:radial-gradient(55% 60% at 50% 100%,rgba(240,90,24,.34),transparent 70%)}
.rt-ring{position:absolute;width:min(560px,120vw);aspect-ratio:1;border-radius:50%;border:1px dashed rgba(255,253,249,.12);animation:rtSpin 18s linear infinite}
.rt-ring::before{content:"";position:absolute;top:-5px;left:50%;width:9px;height:9px;border-radius:50%;background:#f05a18;box-shadow:0 0 16px rgba(240,90,24,.8)}
@keyframes rtSpin{to{transform:rotate(360deg)}}
.rt-c{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:14px;padding:24px;text-align:center;transition:transform .7s cubic-bezier(.77,0,.18,1),opacity .45s}
.rt-mark{width:64px;height:64px;border-radius:20px;background:linear-gradient(135deg,#c2410c,#f05a18);display:grid;place-items:center;font:900 32px/1 "Tajawal",sans-serif;color:#fff;
  box-shadow:0 18px 50px rgba(240,90,24,.35);opacity:0;transform:scale(.55) rotate(-14deg);transition:transform .6s cubic-bezier(.2,.8,.2,1) .1s,opacity .3s .1s}
.rt-k{direction:ltr;font:500 12px/1 "IBM Plex Mono","Tajawal",ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:#aaa39a;opacity:0;transform:translateY(10px);transition:transform .5s cubic-bezier(.2,.8,.2,1) .16s,opacity .4s .16s}
.rt-t{display:block;font:900 clamp(34px,6.4vw,68px)/1.15 "Tajawal",system-ui,sans-serif;letter-spacing:-.01em;padding:0 .08em;clip-path:inset(0 0 0 100%);transition:clip-path .52s cubic-bezier(.2,.8,.2,1) .2s}
.rt-bar{display:block;width:min(240px,52vw);height:2px;border-radius:2px;background:rgba(255,253,249,.14);overflow:hidden}
.rt-bar i{display:block;height:100%;background:#f05a18;transform:scaleX(0);transform-origin:right;transition:transform 1.6s cubic-bezier(.2,.8,.2,1) .35s}
.rs-transit.on .rt-mark,.rs-transit.full .rt-mark{opacity:1;transform:none}
.rs-transit.on .rt-k,.rs-transit.full .rt-k{opacity:1;transform:none}
.rs-transit.on .rt-t,.rs-transit.full .rt-t{clip-path:inset(0 0 0 0)}
.rs-transit.on .rt-bar i{transform:scaleX(.72)}
.rs-transit.full .rt-bar i{transform:scaleX(1)}
.rs-transit.full:not(.out) *{transition:none}
.rs-transit.out .rt-c{transform:translateY(-70px);opacity:0}
/* what is underneath rises into place as the curtain lifts */
html.rs-revealing .shell>main{animation:rsRise .85s cubic-bezier(.2,.8,.2,1) .1s both}
@media (min-width:761px){html.rs-revealing .shell>.sidebar{animation:rsSide .75s cubic-bezier(.2,.8,.2,1) .04s both}}
@keyframes rsRise{from{opacity:0;transform:translateY(28px) scale(.985)}to{opacity:1;transform:none}}
@keyframes rsSide{from{opacity:0;transform:translateX(22px)}to{opacity:1;transform:none}}
html[dir=ltr].rs-revealing .shell>.sidebar{animation-name:rsSideL}
@keyframes rsSideL{from{opacity:0;transform:translateX(-22px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  html.rs-arrive::after{display:none}
  .rs-transit{display:none}
  .sb-live,.rt-ring{animation:none}
  html.rs-revealing .shell>main,html.rs-revealing .shell>.sidebar{animation:none}
}
