/* ROYAL MARKET 0.5.84 — شكل موحّد لكل الشاشات (المالك: «ع قسم الإدخالات حاليًا القائمة ع اليمين، بينما باقي الصفحات القائمة ع اليسار — مفروض يكون موحّد كامل»).
   عرض فقط: لا يتغير أي زر أو حقل أو صلاحية أو منطق. يُحمَّل آخر ملف CSS في index.html وفي mobile-products.html (شاشة الإدخال والاستلام).
   القاعدة الوحدة لكل الشاشات: رأس واحد بمقاس رأس الكاشير (58px): الشعار + ROYAL MARKET + اسم الصفحة + «🛒 الكاشير» يمين، الحالة/الشفت/المستخدم/«☰ القائمة» يسار؛ القائمة لوحة جانبية على اليمين تحت الرأس
   (أول مجموعة ظاهرة والباقي أقسام تنطوي)؛ كل صفحة إدارة تبدأ بنفس العنوان («إدارة المتجر» + العنوان + سطر شرح)؛ نفس الأزرار (غامق للأساسي، أبيض بإطار ذهبي للباقي). */
@media screen{
/* ---------- الرأس الموحّد: نفس مقاس وأماكن رأس شاشة الكاشير (pos.css) بكل الشاشات وبشاشة الإدخال والاستلام ---------- */
#app header.topbar{justify-content:flex-start}
#app header.topbar>.user-box{margin-inline-start:auto}
/* المستخدم و«☰ القائمة» دايمًا آخر شي يسار؛ الشارات الخاصة بكل صفحة (الحالة، الشفت، طلبات الموقع) قبلهم بنفس الخانة */
#app header.topbar>.user-box>#shellUserMenu{order:1}
#app header.topbar>.user-box>#posMenuBtn{order:2}
#app header.topbar>.user-box>#logoutBtn{order:3}
@media(min-width:900px){
 #app.app:not(.pos-mode){padding-top:86px}
 #app:not(.pos-mode) header.topbar{height:58px;min-height:58px;padding:6px clamp(12px,1.5vw,24px);gap:12px;align-items:center}
 #app:not(.pos-mode) header.topbar .brand{font-size:clamp(16px,1.45vw,20px);white-space:nowrap}
 #app:not(.pos-mode) header.topbar>.user-box{display:flex;align-items:center;justify-content:flex-end;gap:8px;font-size:13px}
 /* «☰ القائمة»: نفس زر شاشة الكاشير (كان بلا شكل بشاشات الإدارة) */
 #app:not(.pos-mode) header.topbar #posMenuBtn{align-items:center;min-height:39px;height:auto;padding:6px 10px;background:#fff;color:#414641;border:1px solid #e6dccb;border-radius:10px;font-size:13px;font-weight:700;white-space:nowrap;box-shadow:none;cursor:pointer}
 #app:not(.pos-mode) header.topbar #posMenuBtn:hover,#app:not(.pos-mode) header.topbar #posMenuBtn[aria-expanded="true"]{background:#f7edda;border-color:#dcc28a}
 /* القائمة الجانبية تحت الرأس مباشرة بكل الشاشات (كانت 76 بالإدارة و58 بالكاشير) */
 #app.app.pos-menu-open .tabs{top:58px!important;max-height:calc(100dvh - 58px)!important}
 #onlineOrdersView.order-workspace{height:calc(100dvh - 86px)}
}

/* ---------- عنوان الصفحة الموحّد ---------- */
.ui-hide{display:none!important}
.view>.page-heading.ui-heading{margin-bottom:22px}
.view>.page-heading.ui-heading p:empty{display:none}
#marketingView .mk-head:has(>div.ui-hide){justify-content:flex-end}

/* ---------- أزرار الفلترة تبدأ من اليمين مثل باقي الشاشات (كانت بالنص بالسجل الرقابي وسجل الفواتير) ---------- */
#auditView .aud-filter,#invoicesView .rep-period{justify-content:flex-start}

/* ---------- الأزرار: العروض كانت رمادي/أخضر فاتح لحالها → نفس أزرار باقي الشاشات ---------- */
#offersView>button,#offersView .offer-card button{min-height:46px;padding:12px 18px;border:1px solid #dccbaa;border-radius:11px;background:#fff;color:#704b2d;font-size:15px;font-weight:650;line-height:1.3}
#offersView>button:hover,#offersView .offer-card button:hover{background:#fbf6ec}
#offersView>#newOffer{background:#29251f;color:#fff;border-color:#29251f}
#offersView>#newOffer:hover{background:#704b2d;border-color:#704b2d}
#offersView .offer-card button.offer-del{color:#be123c;border-color:#f3c7cf}
#consignmentView .cv-tools button{min-height:46px;padding:12px 18px;border:1px solid #dccbaa;border-radius:11px;background:#fff;color:#704b2d;font-size:15px;font-weight:650}

/* ---------- شاشة «إدخال واستلام»: نفس رأس ونفس قائمة باقي الشاشات ---------- */
body>header.rx-topbar{display:flex!important;justify-content:space-between;align-items:center;gap:12px;box-sizing:border-box;height:58px;min-height:58px;padding:6px clamp(12px,1.5vw,24px);background:#fffdf9!important;color:#29251f;border-bottom:1px solid #eee9df;box-shadow:none;position:sticky;top:0;z-index:60}
.rx-topbar .rx-start{display:flex;align-items:center;gap:12px;min-width:0}
.rx-topbar .rx-end{display:flex;align-items:center;gap:8px;margin-inline-start:auto;font-size:13px}
.rx-topbar .shell-menu-btn.rx-menu-btn{min-height:39px;padding:6px 10px;border-radius:10px;font-size:13px;color:#414641;max-width:none}
.rx-topbar .rx-brand{display:inline-flex;align-items:center;gap:6px;color:#29251f;font-size:clamp(16px,1.45vw,20px);white-space:nowrap;font-weight:850;letter-spacing:0}
.rx-topbar .rx-brand::before{content:"";flex:none;width:28px;height:28px;border-radius:50%;background:#29251f url('brand/royal-market-logo-128.png') center/cover no-repeat;box-shadow:0 0 0 1px #e0c68b}
.rx-topbar .rx-title,header.topbar .shell-title{color:#665d51;font-size:15px;font-weight:700;white-space:nowrap;border-inline-start:1px solid #e9e1d4;padding-inline-start:10px;line-height:1.4}
.rx-topbar .shell-pos-btn{background:#29251f;color:#fff;min-width:99px}
.rx-topbar .shell-pos-btn:hover{background:#704b2d}
.rx-topbar .shell-menu-btn{background:#fff;color:#29251f;border-color:#e6dccb}
.rx-topbar .shell-menu-btn:hover,.rx-topbar .shell-menu-btn[aria-expanded="true"]{background:#f7edda;border-color:#dcc28a}
/* القائمة: لوحة جانبية يمين تحت الرأس — نفس قائمة الشاشات الثانية */
.rx-topbar .rx-nav-menu{position:static}
.rx-topbar .rx-nav-menu .shell-menu-list{position:fixed;top:58px;bottom:0;inset-inline-start:0;inset-inline-end:auto;width:min(290px,85vw);min-width:0;max-height:none;box-sizing:border-box;overflow:auto;padding:14px;border:1px solid #eee9df;border-radius:0;background:#fff;box-shadow:-12px 12px 35px rgba(40,35,27,.125);z-index:80;gap:5px}
.rx-topbar #inventoryNav{display:flex!important;flex-direction:column;gap:5px;max-height:none;overflow:visible}
.rx-topbar #inventoryNav a,.rx-topbar .rx-nav-menu .shell-menu-list a{display:block;text-align:right;min-height:44px;box-sizing:border-box;padding:10px 14px;border-radius:10px;color:#5c5246;font-size:15px;font-weight:600;line-height:1.5;text-decoration:none;border:0;background:none}
.rx-topbar #inventoryNav a:hover{background:#f6f0e6}
.rx-topbar #inventoryNav a.current{background:#29251f;color:#fff;font-weight:800;box-shadow:inset -3px 0 0 #c39a42}
.rx-topbar #inventoryNav .nav-group{border:0;border-top:1px solid #e9e1d4;border-radius:0;background:none;box-shadow:none;padding:5px 0 0;margin:3px 0 0}
.rx-topbar #inventoryNav .nav-group>summary{cursor:pointer;min-height:44px;box-sizing:border-box;padding:11px 10px;border-radius:8px;font-weight:700;font-size:14px;color:#29251f;line-height:1.5;list-style:inside disclosure-closed}
.rx-topbar #inventoryNav .nav-group[open]>summary{list-style-type:disclosure-open}
.rx-topbar #inventoryNav .nav-group>summary:hover{background:#f7edda}
.rx-topbar #inventoryNav .nav-group-items{display:flex;flex-direction:column;gap:3px;padding:3px 7px 6px 0}
.rx-topbar #inventoryNav .nav-group-items>a{font-size:14px;padding:9px 12px;line-height:27.5px}
/* الألوان: الهوية الذهبية/البنية بدل الأزرق والفيروزي القديم بهالشاشة لحالها */
html:has(>body>header.rx-topbar){background:#faf7f0}
:where(body:has(>header.rx-topbar)) button{background:#29251f;color:#fff}
:where(body:has(>header.rx-topbar)) button.secondary{background:#fff;color:#704b2d;border:1px solid #dccbaa}
:where(body:has(>header.rx-topbar)) #message{background:#f6f0e6;color:#29251f}
body:has(>header.rx-topbar) #save{background:#29251f!important}
body:has(>header.rx-topbar) #existingSummary{background:#fffaf0;border-color:#e6d2a3;color:#5b4520}
body:has(>header.rx-topbar) #existingSummary .es-stock,body:has(>header.rx-topbar) #existingSummary .es-buy{border-color:#efe2c4}
body:has(>header.rx-topbar) #receiveFields{border-color:#e6d2a3;background:#fffdf8}
body:has(>header.rx-topbar) #receiveFields h2{color:#704b2d}
body:has(>header.rx-topbar) #bonusBox{background:#fffdf8;border-color:#e6d2a3}
body:has(>header.rx-topbar) .bonus-box legend{color:#704b2d}
body:has(>header.rx-topbar) #productForm input:focus,body:has(>header.rx-topbar) #productForm select:focus,body:has(>header.rx-topbar) #productForm textarea:focus{border-color:#c39a42;box-shadow:0 0 0 3px rgba(195,154,66,.25)}
body:has(>header.rx-topbar) #saleUnitsDetails[open]>summary .ut-box{background:#29251f;border-color:#29251f}
body:has(>header.rx-topbar) #saleUnitsDetails[open]>summary.units-toggle{border-color:#c39a42;background:#fffaf0}
body:has(>header.rx-topbar) .receive-jumps button{background:#f6f0e6;color:#704b2d}
@media(max-width:640px){
 body>header.rx-topbar{gap:6px;padding:6px 10px}
 .rx-topbar .rx-brand{font-size:0;gap:0}
 .rx-topbar .rx-title{border:0;padding:0;font-size:14px;overflow:hidden;text-overflow:ellipsis}
 .rx-topbar .shell-pos-btn{min-width:0}
}
}

/* ===== 0.5.84 مراجعة المدير ===== */
@media screen{
/* شارات الرأس بشاشة الإدخال والاستلام: نفس «● الخدمة المحلية جاهزة» ونفس زر الشفت وبنفس الخانة (قبل المستخدم) */
.rx-topbar .rx-chip{display:inline-flex;align-items:center;white-space:nowrap;font-size:.78rem;font-weight:700;color:#2f6b4a}
.rx-topbar .rx-chip[data-ready="0"]{color:#b42318}
.rx-topbar .rx-shift-chip{display:inline-flex;align-items:center;box-sizing:border-box;min-height:36px;padding:6px 12px;border:1.5px solid #e6dccb;border-radius:999px;background:#fff;color:#29251f;font-size:13.5px;font-weight:700;white-space:nowrap;text-decoration:none}
.rx-topbar .rx-shift-chip.no-shift{background:#ecfdf5;border-color:#34d399;color:#065f46}
.rx-topbar .rx-shift-chip[hidden]{display:none}
body:has(>header.rx-topbar) main>.page-heading{max-width:760px;margin:0 auto 14px}
body:has(>header.rx-topbar) main>.page-heading small{color:#29251f;font-weight:700;font-size:12px}
body:has(>header.rx-topbar) main>.page-heading h1{font-size:30px;margin:7px 0;color:#29251f}
body:has(>header.rx-topbar) main>.page-heading p{color:#665d51;line-height:1.8;margin:0}

/* المنتجات: «📦 إدخال واستلام» زر عادي (كان رابط تحته خط جوّا زر غامق)، «تالف / كسر» و«دمج صنفين» أزرار عادية (مش برتقالي/غامق) */
#productsView .products-head>a.btn-sm,#productsView .products-head>#wasteBtn,#productsView .products-head>#mergeProdBtn{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:46px;min-height:46px;padding:0 18px;border:1px solid #dccbaa;border-radius:11px;background:#fff;color:#704b2d;font-size:15px;font-weight:650;text-decoration:none;white-space:nowrap;box-shadow:none}
#productsView .products-head>#mergeProdBtn[hidden]{display:none}
#productsView .products-head>a.btn-sm:hover,#productsView .products-head>#wasteBtn:hover,#productsView .products-head>#mergeProdBtn:hover{background:#fbf6ec}
#productsView>.quick-actions>#tobaccoCategories{margin:0}

/* شريط التمرير ظاهر دايمًا (مكانه ثابت)، فالرأس ما بيتزحزح بين صفحة قصيرة وصفحة طويلة */
html{overflow-y:scroll}
}
/* الهاتف (< 900px): نفس الرأس المضغوط بالشاشة الرئيسية وبشاشة الإدخال والاستلام — سطر واحد 58px:
   الشعار + اسم الصفحة + 🛒 يمين، 👤 و«☰ القائمة» يسار؛ شارة الحالة والشفت بتنخفى عالهاتف (الشفت من «الصندوق والشفتات» بالقائمة) */
@media screen and (max-width:899px){
 #app header.topbar{position:fixed;inset:0 0 auto 0;height:58px!important;min-height:58px!important;padding:6px 10px!important;gap:8px!important;align-items:center!important;flex-wrap:nowrap!important;z-index:60}
 #app.app{padding-top:72px!important}
 #app header.topbar>.user-box{flex-wrap:nowrap!important;gap:6px!important;min-width:0}
 #app.app.pos-menu-open .tabs{top:58px!important;max-height:calc(100dvh - 58px)!important}
 #app #permissionNav{display:none!important}
 body>header.rx-topbar{padding:6px 10px!important;gap:8px!important}
 .rx-topbar .rx-start{gap:8px}
 .rx-topbar .rx-end{gap:6px}
}
@media screen and (max-width:640px){
 #app header.topbar .brand,.rx-topbar .rx-brand{font-size:0!important;gap:0}
 header.topbar .shell-title,.rx-topbar .rx-title{display:inline-block!important;font-size:14px;border:0;padding:0;max-width:34vw;overflow:hidden;text-overflow:ellipsis}
 #app header.topbar #posConnectionState,#app header.topbar #shellShiftMenu,.rx-topbar .rx-chip,.rx-topbar .rx-shift-chip{display:none!important}
 #app header.topbar #shellPosBtn,.rx-topbar .shell-pos-btn{min-width:0!important;width:40px;height:36px;padding:0!important;font-size:0!important}
 #app header.topbar #shellPosBtn::before,.rx-topbar .shell-pos-btn::before{content:'🛒';font-size:16px}
 .rx-topbar .shell-pos-btn .rx-label{display:none}
 #app header.topbar #shellUserMenu .shell-menu-btn,.rx-topbar .shell-user .shell-menu-btn{font-size:0!important;padding:6px 12px}
 #app header.topbar #shellUserMenu .shell-menu-btn::before,.rx-topbar .shell-user .shell-menu-btn::before{content:'👤 ▾';font-size:13px}
 #app header.topbar #posMenuBtn,.rx-topbar .shell-menu-btn.rx-menu-btn{min-height:39px;padding:6px 10px;border:1px solid #e6dccb;border-radius:10px;background:#fff;color:#414641;font-size:13px;font-weight:700}
 #app header.topbar #posOrdersShortcut{display:none!important}
}
/* phone cashier empty-cart hint wrapped 1–2 letters per line — the single colspan cell is also td:last-child, so pos.css (max-width:520px) gave it width:50px + line-height:0, and mobile-layout.css made it a flex row. Only the empty row; real cart rows untouched. */
@media (max-width:820px){.app.pos-mode .pos-cart-table tr.empty td{display:block;width:100%;max-width:none;min-width:0;text-align:center;line-height:1.6;white-space:normal;overflow-wrap:normal}.app.pos-mode .pos-cart-table tr.empty td::before{content:none;display:none}}
/* stock14-fix2 (gateway 2026-11-30): phone cart rows overlapped («مجموع/إجراء» labels on «1 ✎»/«حذف», − / + stacked, tall empty card) — pos.css fixed column widths (104/66/50px under 520px) + line-height:0 on qty/last cell fought mobile-layout.css card mode.
   Phone card per row: line 1 = name + unit chip; then one row with the unit switch + «سعر الوحدة»/«إجمالي السطر» (real price-edit buttons, kept, 44px); line 2 = «− [1 ✎] +» | line total | «حذف» (far left). Offer group/remainder rows and hidden offer lines keep offers.css. */
@media (max-width:820px){
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line){display:grid!important;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"prod prod prod" "qty total rm";align-items:center;column-gap:10px;row-gap:8px;margin:8px 0;padding:10px 12px;border:1px solid #e6dccb;border-radius:12px;box-sizing:border-box}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td{display:flex!important;width:auto!important;max-width:none;min-width:0;height:auto!important;padding:0!important;border:0!important;line-height:1.3!important;gap:6px;align-items:center}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td::before{content:none!important;display:none!important}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product{grid-area:prod;flex-wrap:wrap;justify-content:flex-start;column-gap:8px;row-gap:4px}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product strong{flex:0 1 auto;min-width:0;font-size:15px;font-weight:800;line-height:1.35;overflow-wrap:break-word;white-space:normal}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product .cart-unit-tag{flex:0 0 auto}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product .cart-price-edit{display:inline-flex!important;align-items:center;min-height:44px!important;padding:0 6px!important;font-size:12px;line-height:1.2}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product .cart-unit-switch{flex:0 1 auto;order:2;margin:0!important}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product::after{content:'';flex:1 1 100%;height:0;order:1}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product strong,.app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product .cart-unit-tag{order:0}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product .cart-price-edit{order:2}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-product .cart-unit-switch .cart-unit-chip{min-height:44px!important}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-unit-price{display:none!important}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.qty{grid-area:qty;flex-wrap:nowrap;justify-content:flex-start}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.qty button{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;padding:0;font-size:22px;line-height:1}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.qty .touch-quantity{min-width:54px!important;min-height:44px!important;padding:0 6px;font-size:16px;font-weight:800;line-height:1!important}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td.cart-line-total{grid-area:total;justify-content:center;font-size:16px!important;font-weight:800;white-space:nowrap}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td:last-child{grid-area:rm;justify-content:flex-end}
 .app.pos-mode .pos-cart-table #cartBody>tr:not(.empty):not(.offer-group-row):not(.offer-remainder-row):not(.offer-hidden-line)>td:last-child .rm{min-width:56px;min-height:44px;padding:0 10px;font-size:13px;line-height:1.2}
}
/* 0.5.85 «👁 يشوف كميات المخزون»: بلا الصلاحية عمود «كمية» بجدول الأصناف مخفي (body.stock-blind من app.js)، وبطاقة المنتج بتعرض «أضف كمية / جرد» بدل الرصيد. السيرفر ما بيبعث الأرقام أصلًا (lib/stock-visibility.js). */
body.stock-blind .stock-col{display:none!important}
body.cost-blind .cost-col{display:none!important}
body.stock-blind #stockSummary.stk-blind .stk-cards,body.stock-blind #stockSummary.stk-blind .stk-notes{display:none}
#pfBlindStock .pf-blind-title{display:block;font-weight:700;margin-bottom:6px}
#pfBlindStock .pf-blind-title small{font-weight:400;color:#7a6650}
#pfBlindStock .pf-blind-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#pfBlindStock .pf-blind-row label{display:flex;flex-direction:column;gap:4px;font-weight:600}
#pfBlindStock .pf-blind-row input{min-height:44px}
@media (max-width:520px){#pfBlindStock .pf-blind-row{grid-template-columns:1fr}}
