/* ===== الإعدادات: صفحة واحدة بأقسام حسب الصلاحية =====
   تستعمل متغيرات public/unify.css ومكوّنات الموقع (.btn, .inp, .tgl, .lbsearch, .lbchips).
   النوافذ كلها نافذة واحدة #ovSet بأصناف .ov > .sheet > .sh + .sb، فتتبع قاعدة التمرير في القسم 6 من unify.css. */
main.stmain{display:block;width:min(1120px,100%);margin:0 auto;padding:32px 20px 90px;min-height:0;overflow:visible;height:auto}
main.stmain.sel{padding-bottom:190px}
.st{display:grid;grid-template-columns:220px minmax(0,1fr);gap:32px;align-items:start}
.st.solo{grid-template-columns:minmax(0,640px);justify-content:center}

/* ---- الأقسام ---- */
.stnav{position:sticky;top:20px;display:flex;flex-direction:column;gap:4px}
.stnav a{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:46px;padding:6px 14px;border-radius:var(--u-r);color:var(--muted);text-decoration:none;font-size:15px;border:1px solid transparent}
.stnav a:hover{background:var(--raise);color:var(--fg)}
.stnav a[aria-current="page"]{background:color-mix(in srgb,var(--u-acc) 14%,transparent);border-color:color-mix(in srgb,var(--u-acc) 40%,transparent);color:var(--fg)}
.stnav a .t{display:flex;flex-direction:column;min-width:0}
.stnav a b{font-weight:380}
.stnav a small{display:none;font-size:12.5px;color:var(--muted)}
.stnav a em{font-style:normal;font-size:12.5px;color:var(--dim);font-variant-numeric:tabular-nums}
.stnav a em.hot{background:var(--u-acc);color:#001018;border-radius:99px;padding:0 8px;min-width:22px;text-align:center;line-height:22px}
html.light .stnav a em.hot{background:#0a78b8;color:#fff}

/* ---- عناصر مشتركة ---- */
.stsec{display:flex;flex-direction:column;gap:14px;min-width:0}
.sth{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.sth h1{font-size:clamp(26px,4.2vw,34px);font-weight:400;margin:0;line-height:1.3}
.sth .sp{flex:1}
.stgh{font-size:14px;font-weight:380;color:var(--muted);margin:12px 0 0}
.sth4{font-size:14px;font-weight:380;color:var(--muted);margin:16px 0 2px}
.stcard{position:relative;border:1px solid var(--line);border-radius:var(--u-r);background:var(--u-glint),var(--u-card);padding:6px 18px}
.stline{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:8px 0;border-bottom:1px solid var(--line)}
.stline:last-child{border-bottom:0}
.stline .k{color:var(--muted);font-size:14.5px;flex:none}
.stline .v{min-width:0;text-align:end;font-weight:380;overflow-wrap:anywhere}
.stline .inp{min-height:42px;font-size:15px;width:auto;max-width:100%}
.stempty{color:var(--muted);text-align:center;padding:40px 10px;margin:0}
.stcount{font-size:13px;color:var(--dim);margin:0;min-height:0}
.stcount:empty{display:none}
.ltr{direction:ltr;unicode-bidi:isolate;display:inline-block;font-variant-numeric:tabular-nums}
.stcode{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.stcode b{letter-spacing:.08em;font-weight:380}
.stpills{display:flex;gap:6px;flex-wrap:wrap}
.stpill{display:inline-block;font-size:12px;line-height:1.7;padding:0 9px;border-radius:99px;border:1px solid var(--line2);color:var(--muted);white-space:nowrap;font-weight:320}
.stpill.on{border-color:color-mix(in srgb,var(--u-acc) 60%,transparent);color:var(--fg)}
.stpill.no{border-style:dashed;color:var(--dim);opacity:.7}
.stpill.acc{border-color:var(--u-acc);color:var(--u-acc)}
.stpill.ok{border-color:#7fd4b0;color:#7fd4b0}
.stpill.warn{border-color:var(--warn);color:var(--warn)}
html.light .stpill.acc{border-color:#0a78b8;color:#0a78b8}
html.light .stpill.ok{border-color:#17764f;color:#17764f}
.stseg{display:inline-flex;border:1px solid var(--line2);border-radius:var(--u-r);padding:3px;gap:3px;max-width:100%}
.stseg button{min-height:38px;padding:4px 14px;border:0;border-radius:calc(var(--u-r) - 3px);background:transparent;color:var(--muted);font:inherit;font-size:14px;white-space:nowrap;cursor:pointer}
.stseg button[aria-pressed="true"]{background:color-mix(in srgb,var(--u-acc) 16%,transparent);color:var(--fg)}
.lnk{background:none;border:0;padding:4px 2px;color:var(--u-acc);font:inherit;font-size:14px;cursor:pointer;text-align:start;min-height:40px}
html.light .lnk{color:#0a78b8}
.tgl span{display:flex;flex-direction:column;text-align:start;min-width:0}
.tgl span small{font-size:12.5px;color:var(--muted)}
.tgl.mini{width:auto;min-height:40px;padding:0 4px;justify-content:center;margin:0 auto}
.stsw{padding:4px 18px}
.stsw .tgl{min-height:52px;border-bottom:1px solid var(--line)}
.stsw .tgl:last-child{border-bottom:0}

/* ---- المستخدمون ---- */
.sttools{position:sticky;top:0;z-index:12;display:flex;flex-direction:column;gap:10px;padding:10px 0;margin:-10px 0;border-radius:var(--u-r);transition:background .15s,box-shadow .15s}
.sttools.stuck{background:color-mix(in srgb,var(--u-ground) 86%,transparent);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);box-shadow:0 0 0 8px color-mix(in srgb,var(--u-ground) 86%,transparent)}
.stsearch{margin-top:0}
.stchips{margin:0}
.stsel{display:flex;gap:8px;flex-wrap:wrap}
.stsel .inp{flex:1 1 170px;min-height:42px;font-size:14px;width:auto}
.stlist{border:1px solid var(--line);border-radius:var(--u-r);overflow:hidden;background:var(--u-card)}
.stu{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:stretch;border-bottom:1px solid var(--line)}
.stu:last-child{border-bottom:0}
.stu.sel{background:color-mix(in srgb,var(--u-acc) 12%,transparent)}
.stu.off .go{opacity:.55}
.stu .cb{display:grid;place-items:center;min-height:56px;cursor:pointer}
.stu .cb input{width:20px;height:20px;accent-color:var(--u-acc);cursor:pointer}
.stu .go{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,.9fr) minmax(0,1.3fr) minmax(0,.8fr);gap:12px;align-items:center;min-height:56px;padding:6px 14px 6px 6px;background:none;border:0;color:inherit;font:inherit;font-size:14.5px;text-align:start;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.stu button.go:hover{background:var(--raise)}
.stu.hd{background:var(--raise)}
.stu.hd .go{min-height:40px;font-size:13px;color:var(--muted);cursor:default}
.stu.hd .cb{min-height:40px;cursor:default}
.stu .nm{display:flex;flex-direction:column;min-width:0}
.stu .nm .n{display:flex;align-items:center;gap:6px;min-width:0}
.stu .nm b{font-weight:380;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stu .sub{display:none;font-size:12.5px;color:var(--muted)}
.stu .c-t,.stu .c-l{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stu .c-s{display:flex;gap:4px;flex-wrap:wrap}

#stBulk{position:fixed;inset-inline:0;bottom:0;z-index:40;padding:10px 14px calc(12px + env(safe-area-inset-bottom,0px));pointer-events:none}
#stBulk[hidden]{display:none}
#stBulk.fresh .in{pointer-events:none}
#stBulk .in{pointer-events:auto;width:min(960px,100%);margin:0 auto;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 14px;border-radius:var(--u-r);border:1px solid var(--u-acc);background:color-mix(in srgb,var(--u-acc) 12%,var(--u-ground));box-shadow:0 18px 40px rgba(0,0,0,.5)}
html.light #stBulk .in{border-color:#0a78b8;background:#eaf5fb;box-shadow:0 18px 40px rgba(11,22,36,.18)}
#stBulk b{font-weight:380;margin-inline-end:6px}
#stSnack{position:fixed;z-index:70;bottom:calc(24px + env(safe-area-inset-bottom,0px));inset-inline:0;margin:0 auto;width:max-content;max-width:calc(100% - 28px);display:flex;align-items:center;gap:12px;background:var(--fg);color:#132233;border-radius:var(--u-r);padding:9px 16px;font-size:14px;opacity:0;transform:translateY(8px);transition:all .2s;pointer-events:none}
html.light #stSnack{color:#fff}
#stSnack.show{opacity:1;transform:none;pointer-events:auto}
#stSnack button{background:none;border:0;border-inline-start:1px solid currentColor;padding:2px 12px 2px 0;padding-inline-start:12px;padding-inline-end:0;font:inherit;font-weight:380;color:inherit;cursor:pointer;min-height:32px}

.stmx{overflow:auto;max-height:70vh;max-height:calc(100dvh - 330px);min-height:260px;border:1px solid var(--line);border-radius:var(--u-r);background:var(--u-card)}
.stmx table{border-collapse:separate;border-spacing:0;width:100%;font-size:14px}
.stmx th,.stmx td{padding:4px 10px;border-bottom:1px solid var(--line);text-align:center;font-weight:320}
.stmx thead th{position:sticky;top:0;z-index:2;background:var(--u-ground);color:var(--muted);font-size:13px;padding:10px;min-width:104px;line-height:1.4}
.stmx thead th.p{color:var(--dim)}
.stmx tbody th,.stmx thead th:first-child,.stmx tfoot th{position:sticky;inset-inline-start:0;z-index:1;background:var(--u-ground);text-align:start;white-space:nowrap;min-width:190px}
.stmx thead th:first-child{z-index:3}
.stmx tfoot th,.stmx tfoot td{position:sticky;bottom:0;background:var(--u-ground);color:var(--muted);font-variant-numeric:tabular-nums;border-top:1px solid var(--line2);border-bottom:0;padding:10px}
.stmx tfoot th{z-index:2}
.stmx tr.off .lnk{opacity:.6}

/* ---- الطلبات، القوالب، الخدمات، السجل ---- */
.streq{display:flex;flex-direction:column;gap:8px;padding:16px 18px}
.streq .who{font-size:16px;font-weight:380}
.streq small{color:var(--muted);font-size:13px}
.streq p{margin:0}
.streq small.ltr{align-self:flex-start}
.strow{display:flex;gap:8px;flex-wrap:wrap}
.strole{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:14px 18px}
.strole>div{display:flex;flex-direction:column;flex:1 1 220px;min-width:0}
.strole b{font-weight:380;font-size:16px}
.strole small{color:var(--muted);font-size:13.5px}
.stsvc{padding:14px 18px 6px}
.stsvc .h{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap}
.stsvc h2{font-size:18px;margin:0;font-weight:400}
.stsvc .h small{color:var(--muted);font-size:13px}
.staud{padding:6px 18px}
.staud .lbli b{font-weight:380;color:var(--u-acc)}
html.light .staud .lbli b{color:#0a78b8}

/* ---- داخل النافذة ---- */
.stform{display:flex;flex-direction:column;gap:12px}
.stmenu{display:flex;flex-direction:column;gap:8px}
.stmenu .btn{justify-content:flex-start;min-height:52px;white-space:normal;text-align:start}
.stacts{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.stinline{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.stinline .inp{flex:1 1 160px;min-width:0;width:auto}
#stOvB .stline:first-of-type{border-top:0}
#stOvB .stpills{margin-bottom:6px}
#stOvB .tgl{min-height:48px}

@media (max-width:860px){
  main.stmain{padding:20px 14px 70px}
  main.stmain.sel{padding-bottom:230px}
  .st,.st.solo{grid-template-columns:minmax(0,1fr);gap:0}
  .st.in .stnav{display:none}
  .st:not(.in):not(.solo) .stsec{display:none}
  .stnav{position:static;gap:8px}
  .stnav a{min-height:64px;border-color:var(--line);background:var(--u-glint),var(--u-card);font-size:16px}
  .stnav a small{display:block}
  .strole>div{flex:1 1 100%}
  .strole .btn{flex:1 1 0}
  .stnav a em:not(.hot){display:none}
  .sttools{top:var(--hh)}
  .stseg button.wide{display:none}
  .stline{flex-wrap:wrap;gap:6px 16px}
  .stu{grid-template-columns:44px minmax(0,1fr)}
  .stu.hd{display:none}
  .stu .go{grid-template-columns:minmax(0,1fr);min-height:62px;padding-inline-end:12px}
  .stu .c-t,.stu .c-s,.stu .c-l{display:none}
  .stu .sub{display:block}
  .stu .cb{min-height:62px}
  #stBulk{padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px))}
  #stBulk .in .btn{flex:1 1 30%}
  #stSnack{bottom:calc(16px + env(safe-area-inset-bottom,0px))}
}

/* ---- بطاقة المستخدم: ملخص ثم مجموعات مثل شاشات الإعدادات ---- */
.stuhd{display:flex;flex-direction:column;align-items:flex-start;gap:6px;margin-bottom:4px}
.stmeta{margin:0;font-size:13.5px;color:var(--muted)}
.stuhd .lnk{min-height:36px;padding:0}
.stslot:empty{display:none}
.stslot{margin:4px 0 8px}
#stOvB .stgh{margin:6px 4px -6px;font-size:13px;letter-spacing:.01em}
#stOvB .stgh:first-of-type{margin-top:0}
.stgrp{padding:2px 16px}
.stgrp .stline{min-height:52px;padding:6px 0}
.stgrp .tgl{min-height:52px;padding:6px 0;border-bottom:1px solid var(--line);gap:14px}
.stgrp .tgl:last-child,.stgrp .stline:last-child{border-bottom:0}
.stgrp .tgl span small{margin-top:2px;line-height:1.5}
.stgrp .hint.stin,.stgrp p.stin{margin:0;padding:10px 0;border-bottom:1px solid var(--line);font-size:13.5px;color:var(--muted)}
.strowacts{display:flex;gap:18px;flex-wrap:wrap;border-top:1px solid var(--line);padding:2px 0}
.strowacts .lnk{min-height:44px}
.stdanger{border-color:color-mix(in srgb,var(--danger,#e5484d) 45%,var(--line))}
.stdrow{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:60px;padding:8px 0;border-bottom:1px solid var(--line)}
.stdrow:last-child{border-bottom:0}
.stdrow>div{display:flex;flex-direction:column;min-width:0}
.stdrow b{font-weight:380;font-size:15px}
.stdrow small{font-size:12.5px;color:var(--muted);line-height:1.5}
.stdrow .btn{flex:none}
