﻿/* ===== ألوان وخطوط البرنامج ===== */
:root {
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-2: #EEF1F5; --ink: #1F2A37; --muted: #6B7685; --line: #DFE4EA;
  --blue: #1A6FD8; --blue-soft: #E7F0FC; --sky: #0EA5E9; --sky-soft: #E0F4FD;
  --green: #22A55B; --green-soft: #E3F6EB; --red: #E5484D; --red-soft: #FDE8E8;
  --amber: #E8930C; --amber-soft: #FFF4E0; --purple: #7C5CE0; --purple-soft: #EFEAFD;
  --pink-soft: #F7D9DD;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 2px 8px rgba(16,24,40,.05);
  --font: "Cairo", Tahoma, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
form { min-height: 100vh; display: flex; flex-direction: column; }
body.is-pos form { height: 100vh; min-height: 0; overflow: hidden; }

/* ===== الشريط العلوي ===== */
header.top { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 18px; border: 3px solid var(--surface-2); }
.brand-txt { display: grid; line-height: 1.2; }
.brand-txt b { font-size: 18px; font-weight: 800; color: var(--blue); }
.brand-txt small { color: var(--muted); font-size: 12px; }
.clock { color: var(--ink); font-size: 14px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.user { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.user i { color: var(--blue); }
.tbtn { position: relative; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.tbtn:hover { background: var(--surface-2); }
.tbtn.icon { color: var(--blue); border-color: var(--blue); }
.tbtn.amber { background: var(--amber-soft); border-color: var(--amber); color: #A86600; }
.tbtn.blue-o { border-color: var(--blue); color: var(--blue); }
.tbtn.sky { background: var(--sky-soft); border-color: var(--sky); color: #0369A1; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; margin-inline-start: 4px; }
.badge.dot { position: absolute; top: -9px; left: -9px; margin: 0; }
.badge[hidden] { display: none; }
.tbtn.ring { animation: ring .5s ease-in-out 6; background: var(--amber-soft); border-color: var(--amber); }
@keyframes ring { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .tbtn.ring { animation: none; } }
.role-pill { background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.tbtn.logout { color: var(--red); border-color: var(--red-soft); }
/* عناصر بتظهر حسب الدور (الحماية الحقيقية على السيرفر) */
.role-cashier .need-admin,
.role-waiter .need-admin, .role-waiter .need-cashier,
.role-kitchen .need-admin, .role-kitchen .need-cashier, .role-kitchen .need-staff { display: none !important; }
.st-pending { background: var(--amber-soft); color: #A86600; }

/* ===== تابات نوع الطلب ===== */
nav.tabbar { display: flex; gap: 2px; padding: 0 12px; background: var(--surface-2); border-bottom: 2px solid var(--blue); overflow-x: auto; }
nav.tabbar a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; text-decoration: none; font-weight: 600; white-space: nowrap; color: var(--ink); border-radius: 6px 6px 0 0; }
nav.tabbar a:hover { background: var(--surface); }
nav.tabbar a.on { background: var(--blue-soft); color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }

/* ===== صفحات عادية ===== */
main.page { padding: 18px 16px 40px; width: 100%; max-width: 1400px; margin: 0 auto; }
main.pos-main { flex: 1; min-height: 0; }
main.pos-main > div { height: 100%; }
h2.view-title { font-size: 22px; margin: 0 0 4px; font-weight: 800; }
.sub { color: var(--muted); margin: 0 0 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn[disabled], .btn.aspNetDisabled { opacity: .45; cursor: not-allowed; }
.in { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 10px; }
.in:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
label.f.chk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; }
.msg { display: block; color: var(--red); font-weight: 700; }
.msg:empty { display: none; }
.empty { display: block; color: var(--muted); text-align: center; padding: 24px 10px; }
td.empty { display: table-cell; }   /* "مفيش..." جوه جدول: بعرض الجدول كله مش في أول عمود */
.notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.notice.ok { background: var(--green-soft); border: 1px solid var(--green); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-held { background: var(--purple-soft); color: var(--purple); }
.st-new { background: var(--blue-soft); color: var(--blue); }
.st-preparing { background: var(--amber-soft); color: #A86600; }
.st-ready { background: var(--green-soft); color: #167A42; }
.st-done { background: var(--surface-2); color: var(--muted); }
.st-cancelled { background: var(--red-soft); color: var(--red); }

/* ===== شاشة نقطة البيع ===== */
div.pos { display: grid; grid-template-columns: 64px 460px 112px minmax(0,1fr); height: 100%; min-height: 0; }

/* أزرار الإجراءات الجانبية */
.actions { display: flex; flex-direction: column; gap: 10px; padding: 10px 8px; background: var(--surface-2); border-left: 1px solid var(--line); overflow-y: auto; }
.act { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 8px; font-size: 18px; text-decoration: none; border: 0; cursor: pointer; }
.act-unit { width: 48px; height: 48px; flex: none; padding: 0 2px; font-size: 11px; font-weight: 700; border-radius: 8px; background: var(--blue-soft); color: var(--blue); cursor: pointer; }
.act.green  { background: var(--green-soft);  color: var(--green); }
.act.blue   { background: var(--blue-soft);   color: var(--blue); }
.act.red    { background: var(--red-soft);    color: var(--red); }
.act.amber  { background: var(--amber-soft);  color: var(--amber); }
.act.purple { background: var(--purple-soft); color: var(--purple); }
.act.sky    { background: var(--sky-soft);    color: var(--sky); }
.act:hover { filter: brightness(.95); }

/* السلة */
.cart { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.cart-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ord-no { color: var(--muted); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.type-pill { display: inline-flex; gap: 6px; align-items: center; background: var(--blue); color: #fff; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.cart-extra { padding: 8px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.cart-extra .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lines { flex: 1; min-height: 0; overflow-y: auto; }
.line { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--surface-2); text-decoration: none; }
.line:hover { background: var(--surface-2); }
.line.sel { background: var(--blue-soft); box-shadow: inset -4px 0 0 var(--blue); }
.line .ln-name { font-weight: 700; }
.line .ln-name small { display: block; color: var(--muted); font-weight: 400; }
.line .ln-qty { background: var(--surface-2); border-radius: 6px; padding: 2px 10px; font-weight: 800; }
.line .ln-total { font-weight: 800; min-width: 90px; text-align: left; }
.cart-empty { height: 100%; display: grid; place-content: center; text-align: center; color: var(--ink); gap: 4px; }
.cart-empty i { font-size: 44px; color: #3B4552; }
.cart-empty p { margin: 0; font-size: 17px; }
.cart-bottom { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 8px; }
.disc-row { display: grid; grid-template-columns: auto minmax(0,1fr) 64px 40px; gap: 6px; align-items: center; }
.disc-row label { color: var(--muted); font-weight: 600; }
.act-sm { display: grid; place-items: center; width: 40px; height: 36px; border-radius: 6px; background: var(--blue); color: #fff; text-decoration: none; }
.tot { display: grid; gap: 2px; }
.tot div { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.tot .grand { color: var(--ink); font-size: 18px; font-weight: 800; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--line); }
.tot .grand span:last-child { color: var(--blue); }
.cart-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.big { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: 6px; font-weight: 800; font-size: 15px; text-decoration: none; border: 1px solid transparent; }
.big.blue { background: var(--blue); color: #fff; order: 1; }
.big.green { background: var(--green); color: #fff; order: 2; }
.big.outline { background: var(--surface); border-color: var(--line); color: var(--ink); order: 3; }
.big.aspNetDisabled { opacity: .4; cursor: not-allowed; }
.cart .msg { padding: 0 2px; }
.done-box { margin: 10px 14px 0; background: var(--green-soft); border: 1px solid var(--green); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }

/* عمود الأقسام */
.cats { background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; }
.cat { display: grid; place-items: center; gap: 4px; width: 100%; padding: 14px 6px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; color: var(--ink); text-align: center; }
.cat i { font-size: 20px; }
.cat:hover { background: var(--surface-2); }
.cat.on { background: var(--blue-soft); color: var(--blue); box-shadow: inset -3px 0 0 var(--blue); }
.cat-add { display: grid; place-items: center; gap: 4px; padding: 14px 6px; font-weight: 800; text-align: center; text-decoration: none; color: var(--green); background: var(--green-soft, var(--surface-2)); border-bottom: 1px solid var(--line); }
.cat-add i { font-size: 20px; }
.cat-add:hover { filter: brightness(.96); }

/* الأصناف */
.menu { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.keypad { display: grid; grid-template-columns: 1.3fr repeat(11, minmax(0,1fr)) 1fr; gap: 6px; padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.keypad button { height: 56px; border: 0; border-radius: 6px; background: #E2E6EC; font-weight: 800; font-size: 17px; cursor: pointer; }
.keypad button:hover { background: #D6DBE3; }
.keypad .qty-show { background: var(--surface); border: 2px solid var(--blue); border-radius: 6px; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-weight: 800; font-size: 17px; color: var(--blue); }
.keypad .bs { background: var(--pink-soft); color: #9F1D2C; }
.search-row { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; background: var(--surface); }
.search-box input { flex: 1; border: 0; outline: 0; padding: 10px 0; background: transparent; }
.search-clear { width: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; }
.items { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; }
.card .img, .card .cbody { flex: none; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: transform .08s, border-color .15s; }
.card:hover { border-color: var(--blue); }
.card:active { transform: scale(.97); }
.card .img { height: 106px; background: #E9ECF0; display: grid; place-items: center; color: #C3C9D1; font-size: 30px; }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card .cbody { padding: 6px 8px 8px; }
.card .cname { font-weight: 700; line-height: 1.35; }
.card .cprice { color: var(--blue); font-weight: 800; font-size: 13px; }
.card.hide { display: none; }

/* نافذة الدفع */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: min(460px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 18px; }
.modal-b { padding: 16px; display: grid; gap: 12px; }
.bigtotal { text-align: center; background: var(--surface-2); border-radius: 8px; padding: 12px; }
.bigtotal b { display: block; font-size: 30px; color: var(--blue); }
.seg { display: flex; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { flex: 1; text-align: center; padding: 10px; border: 2px solid var(--line); border-radius: 8px; font-weight: 700; cursor: pointer; }
.seg input:checked + label { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.change { display: flex; justify-content: space-between; font-weight: 800; font-size: 16px; }

/* ===== المطبخ ===== */
.board { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; align-items: start; margin-bottom: 14px; }
.col { background: var(--surface-2); border-radius: 10px; padding: 12px; display: grid; gap: 10px; align-content: start; min-height: 160px; }
.col-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-right: 4px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 6px; }
.ticket.t-new { border-right-color: var(--blue); }
.ticket.t-preparing { border-right-color: var(--amber); }
.ticket.t-ready { border-right-color: var(--green); }
.ticket .th { display: flex; justify-content: space-between; align-items: baseline; }
.ticket .no { font-size: 18px; font-weight: 800; }
.meta { font-size: 12px; color: var(--muted); }
.late { color: var(--red); font-weight: 800; }
.ticket ul { margin: 0; padding-right: 18px; }
.note { font-size: 13px; background: var(--amber-soft); padding: 4px 8px; border-radius: 6px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ===== جداول ===== */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t td .in { min-width: 90px; }
table.t img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }

/* ===== الطاولات ===== */
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tbl { border: 2px solid var(--green); background: var(--surface); border-radius: 12px; padding: 14px; display: grid; gap: 6px; align-content: start; min-height: 150px; }
.tbl .tn { font-size: 26px; font-weight: 800; line-height: 1; }
.tbl.busy { border-color: var(--red); background: var(--red-soft); }

/* ===== الكاشير ===== */
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pay-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 8px; }
.pay-card .row3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; }

/* ===== الرئيسية والتقارير ===== */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 8px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 800; font-size: 16px; }
.tile i { font-size: 26px; }
.tile:hover { border-color: var(--blue); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 800; }
.kpi.lead { background: var(--blue); border-color: var(--blue); color: #fff; }
.kpi.lead .k { color: inherit; opacity: .85; }
a.kpi:hover { border-color: var(--blue); transform: translateY(-1px); transition: .15s; }
.kpi.bad { border-color: #F1C4C4; background: #FFF6F6; }
.kpi.bad .v { color: #C62828; }
html[data-theme="dark"] .kpi.bad { background: rgba(198, 40, 40, .12); border-color: rgba(198, 40, 40, .45); }
.rgrid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 14px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 20px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar i { display: block; width: 100%; max-width: 38px; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar.peak i { background: var(--amber); }
.bar b { font-size: 11px; color: var(--muted); white-space: nowrap; }
.xlabels { display: flex; gap: 6px; margin-top: 6px; }
.xlabels span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.hbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; margin-bottom: 10px; }
.hbar .track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--blue); }
.split-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.mgrid { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1.6fr auto; gap: 10px; align-items: end; }
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }

@media (max-width: 1280px) {
  div.pos { grid-template-columns: 60px 380px 96px minmax(0,1fr); }
  .keypad { grid-template-columns: repeat(7, minmax(0,1fr)); }
  .keypad button { height: 44px; }
}
@media (max-width: 960px) {
  body.is-pos form { height: auto; overflow: visible; }
  div.pos { grid-template-columns: minmax(0,1fr); height: auto; }
  .actions { flex-direction: row; flex-wrap: wrap; }
  .cats { display: flex; overflow-x: auto; }
  .cat { min-width: 90px; border-bottom: 0; border-left: 1px solid var(--line); }
  .cat-add { min-width: 90px; flex-shrink: 0; border-bottom: 0; }
  .lines { max-height: 40vh; }
  .board, .rgrid { grid-template-columns: minmax(0,1fr); }
  .mgrid, .sgrid { grid-template-columns: minmax(0,1fr); }
}
@media print { header.top, nav.tabbar { display: none; } }

/* ================================================================
   الشاشات الجديدة: الباك أوفيس والمخازن والخزن والتقارير
   ================================================================ */
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.tbtn.green-o { border-color: var(--green); color: #167A42; background: var(--green-soft); }
.tbtn.office { border-color: var(--blue); background: var(--blue); color: #fff; }
.tbtn.office:hover { filter: brightness(1.08); background: var(--blue); }
.tbtn.lang { font-weight: 800; min-width: 38px; justify-content: center; }
.mark img.mark-img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; background: #fff; }
.neg { color: var(--red); }
.pos { color: #167A42; }
.meta code, code { font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }

/* فورم شبكة مرنة */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; align-items: end; }
.filters { margin: 12px 0; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.filters .f { min-width: 150px; }
.def-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.danger-zone { border-color: var(--red); }

/* تابات أنواع الأذون */
.seg-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.seg-tabs a { text-decoration: none; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.seg-tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* شاشة الصنف والريسبي */
.item-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.img-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; align-items: start; }
.img-prev { width: 140px; height: 140px; border-radius: 10px; background: #E9ECF0; display: grid; place-items: center; color: #C3C9D1; font-size: 40px; overflow: hidden; border: 1px solid var(--line); }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.logo-prev img { object-fit: contain; background: #fff; }
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-cards input { position: absolute; opacity: 0; pointer-events: none; }
.type-cards label { display: grid; gap: 4px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.type-cards label b { font-size: 15px; }
.type-cards label span { color: var(--muted); font-size: 13px; }
.type-cards input:checked + label { border-color: var(--blue); background: var(--blue-soft); }
.recipe.off { opacity: .45; }
.recipe.off::after { content: "الريسبي بتتخصم من المخزن بس لو الصنف مخزني"; display: block; color: var(--muted); font-size: 13px; margin-top: 8px; }
.cost-box { display: grid; gap: 4px; min-width: 260px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-top: 12px; }
.cost-box div { display: flex; justify-content: space-between; gap: 16px; }
.cost-box b { font-size: 16px; }
.pur-foot { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
.switch-on, .switch-off { display: inline-block; text-decoration: none; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.switch-on { background: var(--green-soft); color: #167A42; }
.switch-off { background: var(--surface-2); color: var(--muted); }

/* إدخال السطور */
.ln-table td { padding: 6px; }
.ln-qty { display: flex; gap: 6px; align-items: center; }
.ln-qty .in { max-width: 100px; }
.ln-qty select.ln-u { max-width: 120px; }
.ln-qty select.ln-u[hidden] { display: none; }
.ln-conv { margin-top: 2px; }
.ln-conv:empty { display: none; }
.ln-item.bad { border-color: var(--red); background: var(--red-soft); }

/* نافذة الدفع المتعدد */
.pb-modal { width: min(680px, 100%); }
.bigtotal .meta { display: block; margin-top: 4px; }
.pb-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.pb-rows { display: grid; gap: 8px; }
.pb-row { display: grid; grid-template-columns: 100px minmax(0, 1.4fr) minmax(0, 1fr) auto 36px; gap: 6px; align-items: center; background: var(--surface-2); padding: 6px; border-radius: 8px; }
.pb-row .pb-a { font-size: 17px; font-weight: 800; }
.pb-eq { font-size: 12px; color: var(--muted); white-space: nowrap; }
.pb-sum { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.pb-sum div { display: flex; justify-content: space-between; }
.pb-sum b { font-size: 17px; }
.pb-diff.bad { color: var(--red); }
.pb-diff.good { color: #167A42; }
.pb-cust { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }

/* التقارير والطباعة */
.rep-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.rep-logo { max-height: 56px; max-width: 140px; object-fit: contain; }
.sub-row td { background: var(--surface-2); font-weight: 700; }
.sign-row { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; color: var(--muted); flex-wrap: wrap; }
table.kv th { width: 160px; background: var(--surface-2); }
.voucher table.kv td { font-size: 15px; }
.print-only { display: none; }
@media print {
  .no-print, header.top, nav.tabbar, .sidebar, .filters, .seg-tabs { display: none !important; }
  .print-only { display: flex !important; }
  h3 { break-after: avoid; page-break-after: avoid; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  body, .panel { background: #fff !important; }
  .panel { border: 0; padding: 0; }
  main.page, .back-main { padding: 0 !important; max-width: none; }
  .back-wrap { display: block !important; }
  a { text-decoration: none; color: inherit; }
}

/* البرنترات */
.printer-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; display: grid; gap: 10px; }
.chk-flow { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.chk-flow label { margin-inline-start: 4px; }

/* ألوان البرنامج */
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; width: 40px; height: 40px; cursor: pointer; }
.swatch input[type=radio] { position: absolute; opacity: 0; }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.swatch.custom input { width: 40px; height: 40px; border: 0; padding: 0; border-radius: 50%; cursor: pointer; background: none; }

/* ===== الباك أوفيس: قايمة جانبية ===== */
.back-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); flex: 1; min-height: 0; }
.sidebar { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 10px 8px 30px; overflow-y: auto; }
.sb-home { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 6px; border-radius: 8px; background: var(--blue); color: #fff; text-decoration: none; font-weight: 800; }
.sb-group { margin-bottom: 6px; }
.sb-title { font-size: 12px; font-weight: 800; color: var(--muted); padding: 8px 12px 4px; text-transform: none; }
.sb-title i { color: var(--blue); }
.sidebar a:not(.sb-home) { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; }
.sidebar a:not(.sb-home) i { width: 18px; text-align: center; color: var(--muted); }
.sidebar a:not(.sb-home):hover { background: var(--surface-2); }
.sidebar a.on { background: var(--blue-soft); color: var(--blue); }
.sidebar a.on i { color: var(--blue); }
.back-main { max-width: none; }
.home-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.office-card { border-radius: 14px; padding: 20px; color: #fff; text-decoration: none; display: grid; gap: 6px; min-height: 130px; align-content: center; }
.office-card b { font-size: 22px; }
.office-card span { opacity: .9; }
.office-card.front { background: linear-gradient(135deg, var(--blue), color-mix(in srgb, var(--blue) 60%, #000)); }
.office-card.back { background: linear-gradient(135deg, #334155, #0f172a); }
.home-section { font-size: 15px; font-weight: 800; margin: 18px 0 8px; color: var(--muted); }

@media (max-width: 960px) {
  .back-wrap { grid-template-columns: minmax(0, 1fr); }
  .sidebar { border: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .item-grid, .type-cards { grid-template-columns: minmax(0, 1fr); }
  .pb-row { grid-template-columns: 1fr 1fr; }
}

/* ===== الإنجليزي (من الشمال لليمين) ===== */
[dir=ltr] table.t th { text-align: left; }
[dir=ltr] .line .ln-total { text-align: right; }
[dir=ltr] .line.sel { box-shadow: inset 4px 0 0 var(--blue); }
[dir=ltr] .cat.on { box-shadow: inset 3px 0 0 var(--blue); }
[dir=ltr] .ticket { border-right: 1px solid var(--line); border-left: 4px solid var(--line); }
[dir=ltr] .ticket.t-new { border-left-color: var(--blue); }
[dir=ltr] .ticket.t-preparing { border-left-color: var(--amber); }
[dir=ltr] .ticket.t-ready { border-left-color: var(--green); }
[dir=ltr] .ticket ul, [dir=ltr] .pay-card ul { padding-right: 0; padding-left: 18px; }
[dir=ltr] .item .q { left: auto; right: 8px; }
[dir=ltr] .badge.dot { left: auto; right: -9px; }
[dir=ltr] .actions { border-left: 0; border-right: 1px solid var(--line); }
[dir=ltr] .cart, [dir=ltr] .cats { border-left: 0; border-right: 1px solid var(--line); }
/* ===== اسم البرنامج + منع البيع من غير وردية ===== */
.product-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: #0B4FA8; background: #EAF2FE; padding: 3px 10px 3px 4px; border-radius: 999px; direction: ltr; white-space: nowrap; }
.product-badge img { width: 22px; height: 22px; }
.sb-product { display: flex; align-items: center; justify-content: center; gap: 8px; color: #0B4FA8; font-size: 14px; padding: 4px 0 10px; direction: ltr; }
.sb-product img { width: 30px; height: 30px; }
.sb-product small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.no-shift { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 14px 0; padding: 10px 12px; border-radius: 8px; background: var(--amber-soft); border: 1px solid var(--amber); color: #8A5300; font-weight: 700; font-size: 13px; }
.no-shift i { font-size: 16px; }
.no-shift span { flex: 1; min-width: 160px; }
.btn.amber-btn { background: var(--amber); border-color: var(--amber); color: #fff; }
details.prev summary { cursor: pointer; color: var(--blue); font-weight: 700; font-size: 13px; }
details.prev img { display: block; margin-top: 8px; max-width: 320px; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); background: #fff; }

/* =====================================================================
   الباك أوفيس: تصميم جديد — قايمة جانبية غامقة + محتوى فاتح بكروت ناعمة
   ===================================================================== */
body.is-back { --side-bg: #0F172A; --side-bg2: #111C33; --side-ink: #CBD5E1; --side-muted: #64748B; --side-line: #1E293B; --side-w: 264px; --bo-bg: #F1F4F9; background: var(--bo-bg); }
body.is-back form { min-height: 100vh; }
.bo { display: flex; min-height: 100vh; }

/* ---------- القايمة الجانبية ---------- */
.bo-side { position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg2) 100%); color: var(--side-ink); z-index: 40; transition: width .18s ease; }
.bo-brand { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px; border-bottom: 1px solid var(--side-line); }
.bo-brand img { width: 38px; height: 38px; flex: none; }
.bo-brand-txt { display: grid; line-height: 1.2; min-width: 0; direction: ltr; text-align: start; }
[dir=rtl] .bo-brand-txt { text-align: right; }
.bo-brand-txt b { color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .3px; }
.bo-brand-txt small { color: var(--side-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; }
.bo-collapse { margin-inline-start: auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--side-line); background: transparent; color: var(--side-muted); cursor: pointer; flex: none; }
.bo-collapse:hover { color: #fff; background: rgba(255,255,255,.06); }
[dir=ltr] .bo-collapse i { transform: scaleX(-1); }

.bo-nav { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.bo-nav a { text-decoration: none; }
.bo-dash { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); font-weight: 700; margin-bottom: 8px; }
.bo-dash i { width: 22px; text-align: center; color: #FBBF24; font-size: 16px; }
.bo-dash:hover { background: rgba(255,255,255,.06); color: #fff; }
.bo-dash.on { background: var(--blue); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--blue) 40%, transparent); }
.bo-dash.on i { color: #fff; }

.bo-group { margin-bottom: 4px; }
.bo-group > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 700; color: var(--side-ink); user-select: none; }
.bo-group > summary::-webkit-details-marker { display: none; }
.bo-group > summary:hover { background: rgba(255,255,255,.05); color: #fff; }
.bo-group .g-ic { width: 22px; text-align: center; color: var(--g); font-size: 15px; }
.bo-group .chev { margin-inline-start: auto; font-size: 11px; color: var(--side-muted); transition: transform .15s; }
.bo-group[open] > summary .chev { transform: rotate(180deg); }
.bo-group[data-active] > summary { color: #fff; }
.bo-links { display: grid; gap: 2px; padding: 4px 0 8px; margin-inline-start: 22px; border-inline-start: 1px solid var(--side-line); }
.bo-links a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin-inline-start: 8px; border-radius: 8px; color: #94A3B8; font-size: 13.5px; font-weight: 600; }
.bo-links a i { width: 16px; text-align: center; font-size: 12px; opacity: .8; }
.bo-links a:hover { color: #fff; background: rgba(255,255,255,.05); }
.bo-links a.on { color: #fff; background: color-mix(in srgb, var(--g) 22%, transparent); box-shadow: inset 3px 0 0 var(--g); }
[dir=rtl] .bo-links a.on { box-shadow: inset -3px 0 0 var(--g); }
.bo-links a.on i { color: var(--g); opacity: 1; }
.bo-nav .miss { display: none !important; }

.bo-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--side-line); background: rgba(0,0,0,.15); }
.bo-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), #7C3AED); color: #fff; font-weight: 800; font-size: 13px; }
.bo-user-txt { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.bo-user-txt b { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-user-txt small { color: var(--side-muted); font-size: 11px; }
.bo-user a { color: var(--side-muted); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; }
.bo-user a:hover { color: #fff; background: rgba(255,255,255,.08); }

/* القايمة مصغرة: أيقونات بس */
body.bo-mini { --side-w: 76px; }
body.bo-mini .bo-brand-txt, body.bo-mini .bo-nav span, body.bo-mini .bo-group .chev, body.bo-mini .bo-user-txt, body.bo-mini .bo-user a:first-of-type { display: none; }
body.bo-mini .bo-brand { flex-direction: column; padding: 14px 8px; }
body.bo-mini .bo-collapse { margin: 0; }
body.bo-mini .bo-collapse i { transform: scaleX(-1); }
[dir=ltr] body.bo-mini .bo-collapse i { transform: none; }
body.bo-mini .bo-dash, body.bo-mini .bo-group > summary { justify-content: center; padding: 11px 0; }
body.bo-mini .bo-links { margin: 0; border: 0; }
body.bo-mini .bo-links a { justify-content: center; margin: 0; padding: 8px 0; }
body.bo-mini .bo-user { flex-direction: column; padding: 10px 6px; }

/* ---------- الشريط اللي فوق ---------- */
.bo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bo-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bo-burger { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.bo-back { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink, inherit); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
.bo-back[hidden] { display: none; }
.bo-back:hover { border-color: var(--blue); color: var(--blue); }
html[dir="ltr"] .bo-back:not(.out) i { transform: scaleX(-1); }
.bo-back.out { color: #C62828; border-color: #F1C4C4; }
.bo-back.out:hover { color: #fff; background: #C62828; border-color: #C62828; }
@media (max-width: 700px) { .bo-back span { display: none; } }
html[data-theme="dark"] .bo-back { background: var(--surface); color: inherit; }
.bo-crumb { display: grid; line-height: 1.25; min-width: 0; }
.bo-crumb small { color: var(--muted); font-size: 12px; font-weight: 600; }
.bo-crumb small i { color: var(--blue); }
.bo-crumb b { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-search { position: relative; margin-inline-start: auto; width: min(360px, 36vw); }
/* البحث في الشاشات (كتابة + صوت) */
.qs-find { position: relative; }
.qs-find .qs-ic { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.qs-find input { width: 100%; border: 1px solid var(--line); background: var(--bo-bg, var(--bg)); color: var(--ink); border-radius: 10px; padding: 9px 12px; padding-inline-start: 34px; padding-inline-end: 40px; font: inherit; font-size: 13px; }
.qs-find input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-soft); }
.qs-mic { position: absolute; top: 50%; inset-inline-end: 5px; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--blue); cursor: pointer; font-size: 14px; }
.qs-mic:hover { background: var(--blue-soft); }
.qs-listening .qs-mic { background: var(--red, #EF4444); color: #fff; animation: qsPulse 1.2s infinite; }
@keyframes qsPulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.qs-res { position: absolute; top: calc(100% + 6px); inset-inline: 0; z-index: 60; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 23, 42, .16); padding: 6px; max-height: 60vh; overflow-y: auto; min-width: 280px; }
.qs-res a { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.qs-res a i { color: var(--blue); grid-row: span 2; text-align: center; }
.qs-res a span { font-weight: 700; font-size: 13.5px; }
.qs-res a small { color: var(--muted); font-size: 11.5px; }
.qs-res a.on, .qs-res a:hover { background: var(--blue-soft); }
.qs-note { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.qs-pal { position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.qs-pal[hidden] { display: none; }
.qs-pal-box { width: min(560px, 100%); background: var(--surface, #fff); border-radius: 14px; padding: 12px; box-shadow: 0 24px 60px rgba(15, 23, 42, .3); }
.qs-pal .qs-find input { font-size: 15px; padding-top: 12px; padding-bottom: 12px; }
.qs-pal .qs-ic, .qs-pal .qs-mic { top: 23px; }
.qs-pal .qs-res { position: static; box-shadow: none; border: 0; margin-top: 6px; padding: 0; max-height: 55vh; }
.bo-actions { display: flex; align-items: center; gap: 8px; }
.bo-store { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap; }
.bo-store i { color: var(--blue); }
.bo-store-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }

/* ---------- المحتوى ---------- */
.bo-content { padding: 22px 24px 40px !important; max-width: 1500px; width: 100%; margin: 0; }
.is-back h2.view-title { font-size: 24px; letter-spacing: -.2px; }
.is-back .sub { color: var(--muted); }
.is-back .panel { border: 0; border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06); padding: 18px 20px; }
.is-back .panel h3 { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.is-back .panel h3 > i { color: var(--blue); }
.is-back .filters { border: 0; border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06); padding: 14px 16px; }
.is-back table.t { border-collapse: separate; border-spacing: 0; }
.is-back table.t th { background: #F8FAFC; color: #64748B; font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.is-back table.t th:first-child { border-start-start-radius: 10px; }
.is-back table.t th:last-child { border-start-end-radius: 10px; }
.is-back table.t td { border-bottom: 1px solid #EEF2F7; padding: 10px 12px; }
.is-back table.t tbody tr:hover td { background: #F8FAFF; }
.is-back .kpi { border: 0; border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06); position: relative; overflow: hidden; }
.is-back .kpi::after { content: ""; position: absolute; inset-block: 14px; inset-inline-start: 0; width: 4px; border-radius: 4px; background: var(--blue); opacity: .55; }
.is-back .kpi.lead { background: linear-gradient(135deg, var(--blue), color-mix(in srgb, var(--blue) 70%, #000)); }
.is-back .kpi.lead::after { display: none; }
.is-back .btn { border-radius: 9px; }
.is-back .in { border-radius: 9px; }
.is-back .seg-tabs a { border-radius: 10px; border: 0; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.is-back .tiles .tile { border: 0; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06); }

/* ---------- الموبايل ---------- */
.bo-shade { display: none; }
@media (max-width: 1000px) {
  .bo-side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(110%); transition: transform .2s ease; width: 270px !important; }
  [dir=ltr] .bo-side { transform: translateX(-110%); }
  body.bo-open .bo-side { transform: none; }
  body.bo-open .bo-shade { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
  body.bo-mini .bo-brand-txt, body.bo-mini .bo-nav span, body.bo-mini .bo-user-txt { display: initial; }
  .bo-burger { display: grid; place-items: center; }
  .bo-collapse { display: none; }
  .bo-store { display: none; }
  .bo-search { width: auto; flex: 1; }
  .bo-content { padding: 16px !important; }
}
@media print {
  .bo-side, .bo-top { display: none !important; }
  .bo { display: block; }
  body.is-back { background: #fff; }
  .is-back .panel, .is-back .kpi { box-shadow: none; }
}

/* ---------- لوحة التحكم ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h2 { margin: 0; font-size: 26px; font-weight: 800; }
.dash-head p { margin: 2px 0 0; color: var(--muted); }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.dk { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06); display: grid; gap: 6px; position: relative; overflow: hidden; }
.dk .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); }
.dk .lbl { color: var(--muted); font-size: 13px; font-weight: 700; }
.dk .val { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.dk .delta { font-size: 12px; font-weight: 700; }
.dk .delta.up { color: #16A34A; }
.dk .delta.down { color: var(--red); }
.dk .delta.flat { color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.dash-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dcard { background: #fff; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06); min-width: 0; }
.dcard h3 { margin: 0 0 14px; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.dcard h3 i { color: var(--blue); }
.dcard h3 a { margin-inline-start: auto; font-size: 12px; font-weight: 700; color: var(--blue); text-decoration: none; }
.dchart svg { width: 100%; height: auto; display: block; }
.drow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #E8EDF4; font-size: 14px; }
.drow:last-child { border-bottom: 0; }
.drow .nm { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .sub2 { color: var(--muted); font-size: 12px; }
.dbar { height: 6px; background: #EEF2F7; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.dbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), color-mix(in srgb, var(--blue) 55%, #fff)); border-radius: 99px; }
.dempty { color: var(--muted); text-align: center; padding: 18px 6px; font-size: 13px; }
.dpill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.dpill.ok { background: var(--green-soft); color: #167A42; }
.dpill.warn { background: var(--amber-soft); color: #A86600; }
.dpill.bad { background: var(--red-soft); color: var(--red); }
.dquick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dquick a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: #F8FAFC; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 13px; border: 1px solid #EEF2F7; }
.dquick a:hover { border-color: var(--blue); background: var(--blue-soft); }
.dquick a i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--c); flex: none; }
@media (max-width: 1100px) { .dash-grid, .dash-grid.three { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1350px) { .bo-store { display: none; } .bo-crumb small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

/* ===== عميل التوصيل في شاشة البيع ===== */
.cust-info { font-size: 12px; font-weight: 700; color: #167A42; background: var(--green-soft); border-radius: 8px; padding: 4px 10px; }
.cust-info.new { color: var(--blue); background: var(--blue-soft); }

/* ===== تحذير + توزيع المجموعات على البرنترات ===== */
.notice.warn { background: var(--amber-soft); border: 1px solid var(--amber); color: #7A4A00; }
.cat-box { border: 1px dashed var(--blue); background: var(--blue-soft); border-radius: 10px; padding: 10px 12px; margin-top: 10px; display: grid; gap: 6px; }
.cat-box[hidden] { display: none; }
.cat-box-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cat-chips label { margin: 0; }
.cat-chips input[type=checkbox] { width: 18px; height: 18px; vertical-align: middle; }
.cat-chips > span, .cat-chips > input + label { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-weight: 700; cursor: pointer; }
.kind-note[hidden] { display: none; }

/* ===== الطيارين ===== */
.driver-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); display: inline-grid; place-items: center; color: var(--muted); }
.driver-photo.lg { width: 96px; height: 96px; }

/* ===== الفروع ===== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-2 h4 { margin: 8px 0 6px; }
.branch-pick, .branch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; color: inherit; }
.branch-pick select { border: 0; background: transparent; font: inherit; color: inherit; max-width: 170px; cursor: pointer; outline: none; }
.branch-pick select option { color: #111; }
.price-branches td { vertical-align: middle; }
/* ===== تقرير مقارنة الفروع ===== */
table.cmp td, table.cmp th { white-space: nowrap; }
table.cmp tr.tot-row td { font-weight: 800; background: var(--surface-2); border-top: 2px solid var(--line); }
table.cmp td.cmp-best { color: var(--green); font-weight: 800; }
.cmp-up { color: #167A42; font-weight: 800; }
.cmp-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cmp-top h4 { margin: 0 0 6px; color: var(--blue); }

/* ===== الوضع الليلي (دارك): على الشاشة بس، والطباعة بتفضل أبيض ===== */
.theme-tg { cursor: pointer; }
.theme-tg .fa-sun { display: none; }
@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0F141B; --surface: #171E27; --surface-2: #212A35; --ink: #E6EBF1; --muted: #95A1AF; --line: #2C3642;
    --blue-soft: color-mix(in srgb, var(--blue) 22%, #171E27); --sky-soft: color-mix(in srgb, var(--blue) 18%, #171E27);
    --green-soft: #15301F; --red-soft: #3A1C20; --amber-soft: #3A2A10; --purple-soft: #2A2342; --pink-soft: #3A2228;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.35);
  }
  html[data-theme="dark"] .theme-tg .fa-sun { display: inline-block; }
  html[data-theme="dark"] .theme-tg .fa-moon { display: none; }
  html[data-theme="dark"] .keypad button { background: #2A333F; }
  html[data-theme="dark"] .keypad button:hover { background: #343E4B; }
  html[data-theme="dark"] .card .img, html[data-theme="dark"] .img-prev { background: #212A35; color: #4B5563; }
  html[data-theme="dark"] .bo-top { background: rgba(23,30,39,.92); }
  html[data-theme="dark"] .bo-burger, html[data-theme="dark"] .bo-search input:focus { background: var(--surface); }
  html[data-theme="dark"] .is-back table.t th { background: #1B232D; color: var(--muted); }
  html[data-theme="dark"] .is-back table.t td { border-bottom-color: #26303B; }
  html[data-theme="dark"] .is-back table.t tbody tr:hover td { background: #1D2631; }
  html[data-theme="dark"] .dk, html[data-theme="dark"] .dcard { background: var(--surface); box-shadow: var(--shadow); }
  html[data-theme="dark"] .dk .ic { background: color-mix(in srgb, var(--c) 20%, transparent); }
  html[data-theme="dark"] .drow { border-bottom-color: var(--line); }
  html[data-theme="dark"] .dbar { background: #26303B; }
  html[data-theme="dark"] .dquick a { background: #1B232D; border-color: #26303B; }
  html[data-theme="dark"] svg line[stroke="#E8EDF4"] { stroke: #2C3642; }
  html[data-theme="dark"] svg text[fill="#334155"] { fill: #CBD5E1; }
  html[data-theme="dark"] .product-badge { background: #16263D; color: #8DB8F5; }
  html[data-theme="dark"] .sb-product { color: #8DB8F5; }
  html[data-theme="dark"] .st-pending, html[data-theme="dark"] .st-preparing, html[data-theme="dark"] .tbtn.amber,
  html[data-theme="dark"] .dpill.warn, html[data-theme="dark"] .no-shift { color: #F5B451; }
  html[data-theme="dark"] .notice.warn { color: #F5C779; }
  html[data-theme="dark"] .st-ready, html[data-theme="dark"] .tbtn.green-o, html[data-theme="dark"] .switch-on, html[data-theme="dark"] .pb-diff.good,
  html[data-theme="dark"] .dpill.ok, html[data-theme="dark"] .cust-info, html[data-theme="dark"] .cmp-up { color: #4ADE80; }
  html[data-theme="dark"] .tbtn.sky { color: #7DD3FC; }
  html[data-theme="dark"] .keypad .bs { color: #FCA5A5; }
  html[data-theme="dark"] .branch-pick, html[data-theme="dark"] .branch-pill { background: var(--surface); }
  html[data-theme="dark"] .branch-pick select option { color: var(--ink); background: var(--surface); }
  html[data-theme="dark"] body.is-back { --side-bg: #0B1018; --side-bg2: #0E141E; --side-line: #1C2530; --bo-bg: #0F141B; }
  html[data-theme="dark"] .dk .delta.up { color: #4ADE80; }
  html[data-theme="dark"] img { color-scheme: light; }
}
/* ===== ألوان المجموعات والأصناف ===== */
.cpick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cpick label { cursor: pointer; display: inline-flex; }
.cpick input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.cpick .sw { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); display: grid; place-items: center; }
.cpick .sw.none { background: var(--surface-2); color: var(--muted); font-size: 12px; }
.cpick input[type=radio]:checked + .sw { box-shadow: 0 0 0 2px var(--ink); }
.cpick .cust input[type=color] { width: 34px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.cpick .cust input[type=radio]:checked + input[type=color] { outline: 2px solid var(--ink); outline-offset: 1px; }
.cdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); vertical-align: middle; margin-inline-end: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
/* شاشة البيع */
.cat[style*="--cc"] i { color: var(--cc); }
.cat[style*="--cc"] { box-shadow: inset -4px 0 0 var(--cc); }
[dir=ltr] .cat[style*="--cc"] { box-shadow: inset 4px 0 0 var(--cc); }
.cat.on[style*="--cc"] { background: color-mix(in srgb, var(--cc) 16%, var(--surface)); color: var(--ink); box-shadow: inset -5px 0 0 var(--cc); }
.card[style*="--cc"] { border-top: 4px solid var(--cc); background: color-mix(in srgb, var(--cc) 7%, var(--surface)); }
.card[style*="--cc"]:hover { border-color: var(--cc); }
.card[style*="--cc"] .img { background: color-mix(in srgb, var(--cc) 18%, var(--surface)); color: color-mix(in srgb, var(--cc) 60%, var(--surface)); }
.card[style*="--cc"] .cprice { color: color-mix(in srgb, var(--cc) 75%, var(--ink)); }
.ln-extra { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ===== الإضافات والكومبو ===== */
.chk-flow { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.chk-flow label { margin-inline-start: 4px; }
.combo-tag { display: inline-block; font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); vertical-align: middle; }
.extras-box { border: 2px solid var(--purple); border-radius: 10px; background: var(--purple-soft); padding: 8px 10px; }
.extras-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.extras-head i { color: var(--purple); }
.extras-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.extras-list input { position: absolute; opacity: 0; }
.extras-list label { display: block; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 13px; }
.extras-list input:checked + label { border-color: var(--purple); background: var(--purple); color: #fff; }
.extras-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.line .ln-name small { display: block; }
.notes-box { border-color: var(--amber); background: var(--amber-soft); }
.notes-box .extras-head i { color: var(--amber); }
.notes-box .extras-list input:checked + label { border-color: var(--amber); background: var(--amber); }
.line .ln-name small.ln-note { color: var(--amber); font-weight: 800; }
.ln-dates { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.ln-dates label { display: inline-flex; align-items: center; gap: 4px; }
.ln-dates input { width: 140px; padding: 3px 6px; font-size: 12px; }

/* ===== الكيبورد على الشاشة ===== */
.osk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000; background: var(--surface-2); border-top: 2px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,.18); padding: 8px; user-select: none; }
.osk-row { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.osk-row button { flex: 1 1 0; max-width: 78px; min-width: 0; height: 52px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; }
.osk-row button:active { background: var(--blue-soft); transform: scale(.96); }
.osk-bottom button.osk-w { max-width: 96px; font-size: 16px; }
.osk-bottom .osk-space { flex: 5 1 0; max-width: 460px; font-size: 15px; }
.osk-bottom .osk-ok { background: var(--blue); color: #fff; border-color: var(--blue); }
.osk-row button.on { background: var(--amber-soft); border-color: var(--amber); }
body.osk-open { padding-bottom: 310px; }
body.is-pos.osk-open form { height: calc(100vh - 310px); }

/* ===== الآلة الحاسبة ===== */
.calc { position: fixed; right: 18px; bottom: 18px; z-index: 9100; width: 270px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 10px; user-select: none; }
body.osk-open .calc { bottom: 320px; }
.calc-head { display: flex; justify-content: space-between; align-items: center; cursor: move; margin-bottom: 6px; }
.calc-head button { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.calc-expr { min-height: 18px; text-align: right; color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; direction: ltr; }
.calc-val { text-align: right; font-size: 30px; font-weight: 800; padding: 4px 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-keys button { height: 50px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; }
.calc-keys button:active { transform: scale(.95); }
.calc-keys button.op { background: var(--blue-soft); color: var(--blue); }
.calc-keys button.fn { background: var(--red-soft); color: var(--red); }
.calc-keys button.eq { background: var(--blue); color: #fff; border-color: var(--blue); }
.calc-paste { width: 100%; margin-top: 8px; height: 40px; border: 1px dashed var(--blue); border-radius: 10px; background: transparent; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
.tbtn.on { background: var(--blue); color: #fff; border-color: var(--blue); }
@media print { .osk, .calc { display: none !important; } }
/* ===== مكان شريط التمرير: يمين في العربي، وشمال في الإنجليزي =====
   المتصفح بيحط شريط العنصر على الشمال لو اتجاهه rtl وعلى اليمين لو ltr، فبنعكس اتجاه العنصر اللي بيتمرر
   ونرجّع اتجاه اللي جواه زي ما هو. والصفحة نفسها في الإنجليزي بتتمرر من الفورم عشان شريطها يبقى شمال. */
@media screen {
  [dir=rtl] .actions, [dir=rtl] .lines, [dir=rtl] .cats, [dir=rtl] .items, [dir=rtl] .modal, [dir=rtl] .sidebar, [dir=rtl] .bo-nav { direction: ltr; }
  [dir=ltr] .actions, [dir=ltr] .lines, [dir=ltr] .cats, [dir=ltr] .items, [dir=ltr] .modal, [dir=ltr] .sidebar, [dir=ltr] .bo-nav { direction: rtl; }
  [dir=rtl] .actions > *, [dir=rtl] .lines > *, [dir=rtl] .cats > *, [dir=rtl] .items > *, [dir=rtl] .modal > *, [dir=rtl] .sidebar > *, [dir=rtl] .bo-nav > * { direction: rtl; }
  [dir=ltr] .actions > *, [dir=ltr] .lines > *, [dir=ltr] .cats > *, [dir=ltr] .items > *, [dir=ltr] .modal > *, [dir=ltr] .sidebar > *, [dir=ltr] .bo-nav > * { direction: ltr; }
  /* الصفحة كلها (شاشات البرنامج): بتتمرر من الفورم، عشان الشريط يبقى يمين في العربي وشمال في الإنجليزي في كل المتصفحات */
  html:has(body.is-front), html:has(body.is-back) { height: 100%; overflow: hidden; }
  body.is-front, body.is-back { height: 100%; overflow: hidden; }
  body.is-front > form, body.is-back > form { height: 100%; min-height: 0; overflow-y: auto; }
  [dir=rtl] body.is-front > form, [dir=rtl] body.is-back > form { direction: ltr; }
  [dir=ltr] body.is-front > form, [dir=ltr] body.is-back > form { direction: rtl; }
  [dir=rtl] body.is-front > form > *, [dir=rtl] body.is-back > form > * { direction: rtl; }
  [dir=ltr] body.is-front > form > *, [dir=ltr] body.is-back > form > * { direction: ltr; }
  body.is-pos > form { overflow: hidden; }
}
.edit-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 8px 10px 0; padding: 8px 12px; border-radius: 8px; background: var(--amber-soft); border: 1px solid var(--amber); font-weight: 700; font-size: 13px; }

/* ===== تسوية المخزون ===== */
table.adj input.in { width: 120px; padding: 5px 8px; }
table.adj tr.adj-short td { background: var(--red-soft); }
table.adj tr.adj-excess td { background: var(--green-soft); }
.adj-sum { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; font-size: 15px; }

.reset-list { margin: 0; padding-inline-start: 20px; line-height: 2; }
.reset-list.keep li::marker { color: var(--green); }
html[data-theme="dark"] .qs-find input:focus { background: var(--surface); }
/* خصم الفاتورة: الرقم ونوعه (مبلغ / %) جنب بعض */
.disc-in { display: flex; gap: 6px; }
.disc-in input { flex: 1; min-width: 0; }
.disc-in select { width: 84px; flex: none; }

/* =====================================================================
   الفرونت أوفيس: شريط علوي صف واحد + كروت أصناف بالصورة كاملة
   ===================================================================== */
header.top { flex-wrap: nowrap; gap: 10px; padding: 0 10px; height: 54px; border-bottom: 2px solid var(--blue); }
header.top .mark { width: 34px; height: 34px; font-size: 15px; border-width: 2px; }
header.top .brand-txt b { font-size: 15px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
header.top nav.tabbar { flex: 1; min-width: 0; background: none; border: 0; padding: 0; gap: 2px; align-self: stretch; align-items: center; scrollbar-width: none; }
header.top nav.tabbar::-webkit-scrollbar { display: none; }
header.top nav.tabbar a { padding: 7px 12px; border-radius: 8px; font-size: 13.5px; }
header.top nav.tabbar a.on { box-shadow: none; background: var(--blue); color: #fff; }
header.top nav.tabbar a.on .badge { background: #fff; color: var(--blue); }
/* التابات مش مكفية العرض (شاشة صغيرة أو الإنجليزي): أيقونات بس للتابات اللي مش مفتوحة، واسمها بيظهر لما تقف عليها */
header.top nav.tabbar.compact a:not(.on) { font-size: 0; gap: 0; padding: 7px 10px; }
header.top nav.tabbar.compact a:not(.on) i { font-size: 15px; }
header.top nav.tabbar.compact a:not(.on) .badge { font-size: 11px; margin-inline-start: 4px; }
header.top .top-actions { flex-wrap: nowrap; gap: 6px; margin-inline-start: 0; }
header.top .tbtn { padding: 0 10px; height: 36px; border-radius: 8px; }
header.top .tbtn.icon { width: 36px; padding: 0; justify-content: center; }
header.top .tbtn.icon.sky { color: #0369A1; border-color: var(--sky); }
header.top .tbtn.icon.office { color: #fff; }
header.top .tbtn.icon.logout { color: var(--red); border-color: var(--red-soft); }
header.top .branch-switch, header.top select { height: 36px; }
.top-user { width: 34px; height: 34px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; cursor: default; }
/* القايمة الصغيرة (أدوات) */
.top-more { position: relative; }
.top-more > summary { list-style: none; cursor: pointer; }
.top-more > summary::-webkit-details-marker { display: none; }
.top-more[open] > summary { background: var(--blue); color: #fff; }
.top-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 70; display: grid; grid-template-columns: repeat(4, 36px); gap: 6px; padding: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 23, 42, .16); }
.top-menu .tbtn { width: 36px; padding: 0; justify-content: center; }
@media (max-width: 1500px) {
    header.top .brand-txt { display: none; }
    header.top nav.tabbar a { padding: 7px 10px; }
}
@media (max-width: 900px) {
    header.top { height: auto; flex-wrap: wrap; padding: 6px 10px; }
    header.top nav.tabbar { order: 3; flex-basis: 100%; }
    header.top .top-actions { margin-inline-start: auto; }
}

/* كارت الصنف: الصورة مالية الكارت والاسم والسعر فوقها */
.is-pos .items-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.is-pos .card { position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 12px; background: #1F2A37; box-shadow: 0 2px 6px rgba(16, 24, 40, .14); }
.is-pos .card:hover { box-shadow: 0 0 0 3px var(--blue), 0 2px 6px rgba(16, 24, 40, .14); }
.is-pos .card .img { position: absolute; inset: 0; height: auto; font-size: 42px;
    background: color-mix(in srgb, var(--cc, #64748B) 78%, #0F172A); color: rgba(255, 255, 255, .28); }
.is-pos .card .img img { transition: transform .25s; }
.is-pos .card:hover .img img { transform: scale(1.05); }
.is-pos .card .cbody { position: absolute; inset-inline: 0; bottom: 0; padding: 26px 9px 8px;
    background: linear-gradient(to top, rgba(10, 14, 22, .88) 0%, rgba(10, 14, 22, .55) 55%, rgba(10, 14, 22, 0) 100%); color: #fff; }
.is-pos .card .cname { color: #fff; font-size: 14px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.is-pos .card .cprice { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: #0F172A; font-size: 12.5px; }
.is-pos .card .cprice small { color: var(--muted); }
.is-pos .card .combo-tag { background: var(--purple); color: #fff; }
/* أحجام الصنف: علامة على الكارت + أزرار اختيار الحجم */
.size-tag { display: inline-block; font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 999px; background: var(--amber-soft, #fef3c7); color: var(--amber, #b45309); vertical-align: middle; margin-inline-start: 4px; }
.size-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.size-btn { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 10px 14px; font-size: 15px; }
.size-btn span { font-size: 13px; opacity: .85; }
/* لون الصنف/المجموعة: شريط تحت الكارت */
.is-pos .card[style*="--cc"] { border: 0; background: #1F2A37; }
.is-pos .card[style*="--cc"] .cbody { box-shadow: inset 0 -4px 0 var(--cc); }
.is-pos .card[style*="--cc"] .cprice { color: #0F172A; }
.is-pos .card[style*="--cc"] .img { background: color-mix(in srgb, var(--cc) 78%, #0F172A); color: rgba(255, 255, 255, .28); }

/* مركز التقارير */
.rc-find { position: relative; width: min(320px, 100%); }
.rc-find i { position: absolute; top: 50%; inset-inline-start: 12px; transform: translateY(-50%); color: var(--muted); }
.rc-find input { padding-inline-start: 34px; }
.rc-group { margin-top: 18px; }
.rc-group h3 { font-size: 16px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.rc-group h3 i { color: var(--g); }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rc-card { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .1s; }
.rc-card:hover { border-color: var(--g); transform: translateY(-1px); }
.rc-card > i { width: 42px; height: 42px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: var(--g); background: color-mix(in srgb, var(--g) 14%, var(--surface)); }
.rc-card b { display: block; font-size: 14.5px; }
.rc-card small { color: var(--muted); font-size: 12px; }
.rc-card[hidden], .rc-group[hidden] { display: none; }
.gain { color: var(--green); font-weight: 700; }
/* كشف الحساب التفصيلي: أصناف كل فاتورة تحت سطرها */
.st-detail td { background: var(--surface-2); font-size: 12.5px; padding-top: 4px !important; padding-bottom: 6px !important; }
.st-detail ul { margin: 0; padding-inline-start: 18px; }
/* رصيد أول المدة للخزن */
.open-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.open-box h4 { margin: 0 0 8px; font-size: 14px; }
.open-list { margin: 8px 0 0; padding-inline-start: 18px; font-size: 13px; }
/* الشيكات */
.chq-box { margin-top: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; }
.chq-box h4 { margin: 0 0 4px; font-size: 14px; }
.chq-total { display: flex; gap: 18px; justify-content: flex-end; margin-top: 6px; color: var(--muted); }
.chq-total b { color: var(--ink); }
tr.chq-due td { background: var(--amber-soft) !important; }
.chq-act { border: 2px solid var(--blue); }
.chq-notice { background: var(--amber-soft); border: 1px solid var(--amber); display: block; }
.chq-notice ul { margin: 6px 0 8px; padding-inline-start: 18px; }
.tbtn.chq-alert { color: #A86600; border-color: var(--amber); background: var(--amber-soft); }
.tbtn.lic-alert { color: var(--red); border-color: var(--red); background: var(--red-soft); font-weight: 800; }
/* شريط نسبة جوه الجدول */
.pct-bar { position: relative; height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; min-width: 150px; }
.pct-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: color-mix(in srgb, var(--blue) 28%, var(--surface)); border-radius: 6px; }
.pct-bar span { position: relative; padding-inline-start: 8px; font-weight: 700; font-size: 12.5px; line-height: 22px; }

/* الماركت: البيع بقارئ الباركود (من غير مجموعات ولا كروت أصناف) */
div.pos.scan-mode { grid-template-columns: 64px 460px minmax(0,1fr); }
div.pos.scan-mode .cats, div.pos.scan-mode .search-row, div.pos.scan-mode .items { display: none; }
.scan-panel { margin: 24px auto; width: min(640px, calc(100% - 32px)); background: var(--surface); border: 2px dashed var(--blue); border-radius: 18px; padding: 28px 24px; text-align: center; display: grid; gap: 14px; }
.scan-panel .scan-ic { font-size: 64px; color: var(--blue); }
.scan-panel .scan-in { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: 2px; direction: ltr; padding: 14px; border: 2px solid var(--blue); border-radius: 12px; background: var(--bg); color: var(--text); width: 100%; box-sizing: border-box; }
.scan-panel .scan-in:focus { outline: 4px solid var(--blue-soft); }
.scan-panel .scan-hint { color: var(--muted); font-size: 13px; }
.scan-last .scan-ok { background: var(--green-soft); color: var(--green); border-radius: 10px; padding: 10px 14px; font-size: 18px; }
.scan-last .scan-err { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 14px; font-size: 16px; font-weight: 700; }
@media (max-width: 1280px) { div.pos.scan-mode { grid-template-columns: 60px 380px minmax(0,1fr); } }
@media (max-width: 960px) { div.pos.scan-mode { grid-template-columns: minmax(0,1fr); } }
.scan-panel .scan-in::placeholder { font-size: 18px; font-weight: 600; letter-spacing: 0; }

.scan-found { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.scan-pick { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); text-decoration: none; }
.scan-pick:hover { border-color: var(--blue); background: var(--blue-soft); }
.scan-pick span { color: var(--blue); font-weight: 800; }
.scan-last .scan-hint { color: var(--muted); }

.scan-cust { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; font-weight: 700; }
.scan-cust select { max-width: 320px; }

/* زرار تصدير إكسيل جنب عنوان الشاشة */
.view-title .xls-btn { float: left; margin-top: 2px; font-size: 13px; font-weight: 600; }
html[dir=ltr] .view-title .xls-btn { float: right; }
.view-title .xls-btn i { color: #1d6f42; }
/* البحث عن عميل/مورد وزرار + في كل الشاشات (party.js) */
.party-tools { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.party-tools .party-find { flex: 1; min-width: 140px; }
.party-tools .party-info { font-size: 12px; white-space: nowrap; }
.party-tools .party-info.neg { color: var(--red); }
.overlay.party-modal { z-index: 60; }
.party-modal .modal-b .acts { display: flex; gap: 8px; }
/* مركز التنبيهات (الجرس في الشريط اللي فوق) */
.alerts-pop { position: relative; }
.alerts-pop > summary { list-style: none; cursor: pointer; }
.alerts-pop > summary::-webkit-details-marker { display: none; }
.alerts-pop > summary.al-warn { color: #A86600; border-color: var(--amber); background: var(--amber-soft); }
.alerts-pop > summary.al-bad { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.alerts-panel { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 80; width: min(360px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 10px; display: grid; gap: 6px; }
.alerts-panel .al-head { font-size: 14px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }
.alerts-panel .al-item { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 13px; line-height: 1.5; }
.alerts-panel .al-item:hover { filter: brightness(.97); }
.alerts-panel .al-warn { background: var(--amber-soft); }
.alerts-panel .al-warn i { color: #A86600; }
.alerts-panel .al-bad { background: var(--red-soft); }
.alerts-panel .al-bad i { color: var(--red); }
.alerts-panel .al-none { color: var(--muted); padding: 10px; text-align: center; }
.alerts-panel .al-none i { color: var(--green); }

/* ===== الموبايل (شاشة 600 بكسل أو أقل) — الكمبيوتر مش بيتأثر ===== */
@media (max-width: 600px) {
  /* الشريط اللي فوق: الأزرار بتنزل سطر تاني بدل ما تتقص */
  .bo-top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .bo-search { flex: 1 1 140px; min-width: 0; }
  .bo-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  header.top .top-actions { flex-wrap: wrap; width: 100%; margin-inline-start: 0; }
  header.top .brand-txt b { max-width: 110px; }
  /* لوحة الأرقام في شاشة البيع: خانة الكمية سطر لوحدها */
  .keypad { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .keypad .qty-show { grid-column: 1 / -1; height: 38px; font-size: 15px; }
  .keypad button { height: 42px; font-size: 16px; }
  /* أزرار الصفحات والجداول */
  .view-title { font-size: 20px; }
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  .sgrid, .fgrid { grid-template-columns: minmax(0,1fr); }
}
/* حاجات المطعم بس (طاولات...): بتستخبى في الماركت والقيم بتفضل في الفورم */
.biz-market .rest-only { display: none !important; }

/* شاشة الطاولات: الأصناف اللي على الطاولة */
.tbl-items { list-style: none; margin: 2px 0; padding: 6px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; display: grid; gap: 2px; }
.tbl-items li { display: flex; justify-content: space-between; gap: 8px; }
.tbl-items li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-items li b { white-space: nowrap; color: var(--muted); font-weight: 700; }
.tbl-more > summary { cursor: pointer; font-size: 12px; color: var(--blue); font-weight: 700; list-style: none; }
.tbl-more > summary::-webkit-details-marker { display: none; }
.tbl-more[open] > summary { margin-bottom: 4px; }
/* كاشير الطلبات: الطاولة اللي عليها كذا طلب في كارت واحد */
.pay-card.is-table { border: 2px solid var(--green); }
.pay-card .tbl-orders { font-size: 12px; color: var(--muted); }
/* تقسيم على الأشخاص */
.split-t .sp-h, .split-t .sp-tot { text-align: center; white-space: nowrap; }
.split-t .sp-tot { color: var(--blue); font-size: 15px; }
.split-t .sp-cell { white-space: nowrap; text-align: center; }
.split-t .sp-who { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: inherit; font-weight: 700; cursor: pointer; vertical-align: middle; }
.split-t .sp-q { width: 54px; min-width: 0; padding: 4px; text-align: center; vertical-align: middle; margin-inline-start: 4px; }
.split-t .sp-cell.on .sp-who { background: var(--green); border-color: var(--green); color: #fff; }
.split-t .sp-left { text-align: center; color: var(--green); font-weight: 700; }
.split-t tr.bad .sp-left { color: var(--red); }
.split-t tr.bad td { background: var(--red-soft); }
/* ===== المقاولات (Cn*.aspx) ===== */
.cn-pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.cn-pager .meta { margin-inline-start: 8px; }
.cn-prog { display: inline-block; vertical-align: middle; width: 80px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-inline-end: 6px; }
.cn-prog i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.cn-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.cn-cols > .panel { margin: 0; }
.cn-alerts { display: grid; gap: 8px; }
.cn-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.cn-alert > i { margin-top: 3px; }
.cn-alert.red { background: var(--red-soft); border-color: var(--red); }
.cn-alert.red > i { color: var(--red); }
.cn-alert.amber { background: var(--amber-soft); border-color: var(--amber); }
.cn-alert.amber > i { color: var(--amber); }
.cn-more { margin: 10px 0; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }
.cn-more > summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.cn-quick { flex-wrap: wrap; }
.cn-sum td:last-child { text-align: end; }
@media print { .cn-pager, .cn-quick { display: none !important; } }
.biz-contract .pos-only { display: none !important; }
/* المقاولات بس */
body:not(.biz-contract) .cn-only { display: none !important; }

.bill-t .bill-cum { width: 110px; text-align: center; }
.bill-t tr.bad td { background: var(--red-soft); }
.bill-t tr.over .bill-cum { border-color: var(--amber); }
.att-t tr.off td { opacity: .55; }
.att-t .att-wage { width: 100px; text-align: center; }
.att-t .att-days { min-width: 100px; }
/* المقاولات على الموبايل: الأعمدة المهمة بس في المستخلص والحضور (الخانات اللي بتتكتب تبان من غير سحب) */
@media (max-width: 600px) {
    .bill-t th:nth-child(1), .bill-t td:nth-child(1), .bill-t th:nth-child(3), .bill-t td:nth-child(3),
    .bill-t th:nth-child(4), .bill-t td:nth-child(4), .bill-t th:nth-child(5), .bill-t td:nth-child(5) { display: none; }
    .bill-t td:nth-child(2) { min-width: 120px; }
    .bill-t .bill-cum { width: 80px; }
    .att-t th:nth-child(3), .att-t td:nth-child(3), .att-t th:nth-child(7), .att-t td:nth-child(7) { display: none; }
    .att-t .att-wage { width: 70px; }
    .att-t .att-days { min-width: 82px; }
}
.att-t .att-trade { display: none; }
@media (max-width: 600px) { .att-t .att-trade { display: block; } }
@media (max-width: 600px) {
    .tbl-wrap .t.bill-t th, .tbl-wrap .t.bill-t td, .tbl-wrap .t.att-t th, .tbl-wrap .t.att-t td { padding: 8px 4px; }
    .att-t th:nth-child(6), .att-t td:nth-child(6) { display: none; }
    .att-t .att-days { min-width: 74px; padding-inline: 6px; }
    .att-t .att-wage { width: 62px; padding-inline: 4px; }
}
/* زرار خروج من البرنامج (شاشة الدخول) */
.tbtn.danger { color: #DC2626; border-color: #FCA5A5; }
.tbtn.danger:hover { background: #FEF2F2; }
/* رسائل العملاء: السطر اللي اتبعتله بيبهت */
.wa-list tr.sent td { opacity: .55; }
.wa-list .wa-msg { white-space: pre-wrap; max-width: 520px; font-size: 13px; }

/* محادثات الواتساب */
.wa-inbox { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 14px; align-items: start; }
.wa-inbox > .panel { margin: 0; }
.wa-conv-list { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow: auto; }
.wa-conv { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.wa-conv:hover { background: var(--blue-soft); }
.wa-conv.on { border-color: var(--blue); background: var(--blue-soft); }
.wa-conv small { grid-column: 1 / -1; color: var(--muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-conv .badge { justify-self: start; }
.wa-msgs { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; padding: 6px 2px; }
.wa-b { max-width: 78%; padding: 7px 11px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.wa-b .meta { display: block; font-size: 11px; margin-top: 3px; }
.wa-b.in { align-self: flex-start; background: var(--blue-soft); }
.wa-b.out { align-self: flex-end; background: var(--green-soft); }
.wa-reply { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.wa-reply textarea { flex: 1; }
@media (max-width: 760px) { .wa-inbox { grid-template-columns: 1fr; } .wa-b { max-width: 92%; } }

/* الكول سنتر: رسالة المكالمة الجاية */
.cc-pop { position: fixed; inset-inline-start: 16px; bottom: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.cc-call { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--green); border-radius: 12px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: ccIn .25s ease-out; }
.cc-call > i { font-size: 22px; color: var(--green); animation: ccRing 1s infinite; }
.cc-call > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.cc-call > div span { font-size: 13px; }
@keyframes ccIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ccRing { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-15deg); } 75% { transform: rotate(15deg); } }
@media (max-width: 760px) { .cc-pop { inset-inline: 12px; max-width: none; } }
/* شاشة الكول سنتر */
.cc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.cc-grid > .panel, .cc-grid > div > .panel { margin: 0 0 14px; }
.cc-search { display: flex; gap: 8px; align-items: center; }
.cc-search input { font-size: 20px; letter-spacing: 1px; max-width: 260px; }
.cc-cust h3 { margin: 0 0 4px; }
.cc-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.cc-facts span { font-size: 14px; }
.cc-addr { margin: 6px 0; padding-inline-start: 18px; }
tr.cc-late td { background: var(--red-soft); }
@media (max-width: 980px) { .cc-grid { grid-template-columns: 1fr; } }

/* أصناف شاشة البيع في المطعم: 80 ← 112 بكسل (2026-10-22)، وبعدها أكبر بـ 15% (112 ← 129 بكسل) بطلب المستخدم 2026-10-29 */
.is-pos:not(.biz-market) .items-grid { grid-template-columns: repeat(auto-fill, minmax(var(--pos-card, 129px), 1fr)); gap: 9px; }
.is-pos:not(.biz-market) .card { border-radius: 13px; }
.is-pos:not(.biz-market) .card .img { font-size: 40px; }
.is-pos:not(.biz-market) .card .cbody { padding: 23px 8px 8px; }
.is-pos:not(.biz-market) .card .cname { font-size: var(--pos-name, 12px); line-height: 1.25; }   /* اسم الصنف أصغر 35% من 18.5 (بطلب المستخدم 2026-11-05) */
.is-pos:not(.biz-market) .card .cprice { font-size: 16.5px; margin-top: 3px; padding: 0 9px; }
/* الكمية في سطر الفاتورة بتتغير بالضغط عليها */
.lines .ln-qty { cursor: pointer; border-radius: 6px; padding: 1px 4px; }
.lines .ln-qty:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }
.ln-qty-in { width: 64px; height: 32px; box-shadow: 0 4px 14px rgba(15,23,42,.25); padding: 3px 6px; border: 2px solid var(--blue); border-radius: 6px; font: inherit; font-weight: 800; text-align: center; background: var(--surface); color: var(--ink); }

/* البيوتي سنتر: خانة الباركود والعميل فوق كروت الخدمات والمنتجات (تاتش)، ومن غير الحاجات اللي مالهاش لازمة */
.biz-noscale .no-beauty, .biz-spa .no-beauty { display: none !important; }
.biz-noscale .no-noscale { display: none !important; }   /* من غير صلاحية المنتجات (البيوتي والفلاتر والملابس والأدوات المنزلية؛ النادي الصحي بيفضل فيه) */   /* البيوتي سنتر وفلاتر المياه: من غير باركود الميزان والوزن */
body:not(.biz-beauty) .beauty-only { display: none !important; }
div.pos.beauty-mode .scan-panel { margin: 8px 10px 4px; width: auto; padding: 10px 12px; gap: 8px; border-width: 1px; border-radius: 12px; text-align: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: end; }
div.pos.beauty-mode .scan-panel .scan-ic, div.pos.beauty-mode .scan-panel .scan-hint { display: none; }
div.pos.beauty-mode .scan-panel .scan-in { font-size: 17px; padding: 9px 10px; letter-spacing: 0; }
div.pos.beauty-mode .scan-panel .scan-in::placeholder { font-size: 14px; }
div.pos.beauty-mode .scan-panel .scan-last, div.pos.beauty-mode .scan-panel .scan-found { grid-column: 1 / -1; }
div.pos.beauty-mode .scan-last .scan-ok, div.pos.beauty-mode .scan-last .scan-err { font-size: 14px; padding: 6px 10px; }
div.pos.beauty-mode .scan-found { justify-content: flex-start; }
@media (max-width: 700px) { div.pos.beauty-mode .scan-panel { grid-template-columns: minmax(0, 1fr); } }
/* تصنيع الأثاث: من غير لوحة الأرقام، والسعر والكمية خانات في سطر الفاتورة */
div.pos.fu-mode .keypad, div.pos.fu-mode .scan-panel .scan-last { display: none; }
.lines .fu-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px 64px auto auto; gap: 6px; align-items: center; cursor: default; }
.lines .fu-line .fu-f { display: flex; flex-direction: column; gap: 1px; margin: 0; }
.lines .fu-line .fu-f small { color: var(--muted); font-size: 11px; }
.lines .fu-line .fu-f .in { padding: 5px 6px; font-weight: 800; text-align: center; min-width: 0; width: 100%; }
.lines .fu-line .fu-del { color: var(--red); }
@media (max-width: 700px) { .lines .fu-line { grid-template-columns: minmax(0, 1fr) 84px 56px; } .lines .fu-line .ln-total { grid-column: 1 / 3; } }

/* اسم البرنامج جنب لوجو Quick System (لونه من نوع البرنامج) */
.kind-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: 0;
              color: var(--kc); background: color-mix(in srgb, var(--kc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--kc) 35%, transparent); direction: rtl; }
html[dir=ltr] .kind-badge { direction: ltr; }
.kind-badge i, .bo-kind i { width: 8px; height: 8px; border-radius: 50%; background: var(--kc); flex: none; }
.bo-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: #fff; margin-top: 4px; padding: 1px 10px; border-radius: 999px; white-space: nowrap; direction: rtl; justify-self: start;
           background: color-mix(in srgb, var(--kc) 30%, transparent); border: 1px solid color-mix(in srgb, var(--kc) 60%, transparent); }
[dir=rtl] .bo-kind { justify-self: end; }
html[dir=ltr] .bo-kind { direction: ltr; }
.brand-txt .brand-kind { color: var(--muted); font-size: 11px; font-weight: 700; direction: ltr; text-align: start; }

/* فاتورة المشتريات: سعر البيع اتغيّر عن تكويد الصنف (هيتعدل بعد الحفظ) */
.ln-s.changed { border-color: var(--amber); background: var(--amber-soft); font-weight: 700; }

/* الطاولات: أخضر فاضية، أحمر عليها زباين، أصفر الشيك اتطبع ولسه الفلوس ماتحصّلتش */
.tbl { background: var(--green-soft); }
.tbl.check { border-color: var(--amber); background: var(--amber-soft); }
.tbl .tn .st-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--green); margin-inline-start: 6px; vertical-align: middle; }
.tbl.busy .tn .st-dot { background: var(--red); } .tbl.check .tn .st-dot { background: var(--amber); }
.tbl .tbl-res { font-size: 12.5px; font-weight: 700; color: var(--purple); background: var(--purple-soft); border-radius: 8px; padding: 3px 8px; }
.tbl .tbl-call { font-size: 13px; font-weight: 800; color: #B45309; animation: tc-blink 1s steps(2) infinite; }
@keyframes tc-blink { 50% { opacity: .35; } }
.tbl-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin: 4px 0 10px; }
.tbl-legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-inline-end: 5px; vertical-align: middle; background: var(--green); }
.tbl-legend .l-busy::before { background: var(--red); } .tbl-legend .l-check::before { background: var(--amber); } .tbl-legend .l-res::before { background: var(--purple); }

/* ===== شاشة البيع على الموبايل والتابلت =====
   الأصناف لوحدها والفاتورة لوحدها، والتنقل بينهم من شريط ثابت تحت فيه العدد والإجمالي */
.m-bar, .m-keys { display: none; }
@media screen and (max-width: 960px) {
  body.is-pos > form { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  body.is-pos .pos-main { min-height: 0; overflow: hidden; }
  body.is-pos div.pos { display: flex; flex-direction: column; height: 100%; min-height: 0; }

  /* الشريط اللي فوق: سطرين بالعرض بدل ما ياخد ربع الشاشة، والزيادة بتتسحب بالصباع */
  body.is-pos header.top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 8px; padding: 6px 10px; height: auto; }
  body.is-pos header.top .brand-txt, body.is-pos header.top .top-user { display: none; }
  body.is-pos header.top .mark { width: 36px; height: 36px; }
  body.is-pos header.top .top-actions { flex-wrap: nowrap; width: auto; min-width: 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
  body.is-pos header.top .top-actions > * { flex: none; }
  body.is-pos header.top nav.tabbar { grid-column: 1 / -1; order: 3; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  body.is-pos header.top nav.tabbar > * { flex: none; }

  /* شاشة الأصناف */
  body.is-pos .actions, body.is-pos .cart { display: none; }
  body.is-pos .cats { display: flex; flex: none; overflow-x: auto; overflow-y: hidden; border-inline: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  body.is-pos .cat { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; flex: none; width: auto; min-width: 72px; height: 42px; padding: 0 12px; white-space: nowrap; font-size: 13px; }
  body.is-pos .cat-add { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; flex: none; min-width: 0; height: 42px; padding: 0 12px; white-space: nowrap; font-size: 13px; }
  body.is-pos .menu { flex: 1 1 0; min-height: 0; }
  body.is-pos .items { flex: 1 1 0; min-height: 0; overflow-y: auto; }
  body.is-pos .items-grid, body.is-pos:not(.biz-market) .items-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  body.is-pos .search-row { flex: none; }
  body.is-pos .card .cprice, body.is-pos:not(.biz-market) .card .cprice { font-size: 13.5px; padding: 0 7px; white-space: nowrap; }
  body.is-pos div.pos:not(.scan-mode):not(.fu-mode) .keypad { display: none; }
  body.is-pos.mv-keys div.pos:not(.scan-mode):not(.fu-mode) .keypad { display: grid; }
  body.is-pos .keypad { flex: none; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 6px; }
  body.is-pos .keypad .qty-show { grid-column: 1 / -1; height: 34px; font-size: 15px; }
  body.is-pos .keypad button { height: 38px; font-size: 16px; }
  body.is-pos div.pos:not(.scan-mode) .m-keys { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--blue); font-weight: 800; }
  body.is-pos.mv-keys .m-keys { background: var(--blue); border-color: var(--blue); color: #fff; }

  /* شاشة الفاتورة */
  body.is-pos.mv-cart .cats, body.is-pos.mv-cart .menu { display: none; }
  body.is-pos.mv-cart .actions { display: flex; flex: none; flex-direction: row; flex-wrap: nowrap; gap: 6px; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; border-inline: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  body.is-pos.mv-cart .actions > * { flex: none; }
  body.is-pos.mv-cart .cart { display: flex; flex: 1 1 0; min-height: 0; overflow-y: auto; border-left: 0; }
  body.is-pos .cart > * { flex: none; }
  body.is-pos .lines { flex: 1 1 0; min-height: 130px; max-height: none; }
  body.is-pos .cart-btns small { display: none; }

  /* الشريط اللي تحت */
  body.is-pos .m-bar { display: grid; flex: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 6px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(16, 24, 40, .08); }
  .m-tab { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; min-width: 0; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); font-weight: 800; font-size: 15px; cursor: pointer; white-space: nowrap; }
  .m-tab.on { background: var(--blue); border-color: var(--blue); color: #fff; }
  .m-tab .m-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; }
  .m-tab .m-n[hidden] { display: none; }
  .m-tab .m-t { overflow: hidden; text-overflow: ellipsis; }
}

/* أيقونة الشيشة لمجموعات الأصناف (مش موجودة في Font Awesome): رسمة SVG بلون النص (2026-11-13) */
.fa-shisha::before, .fa-solid.fa-shisha::before { content: "" !important; display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; background-color: currentColor;
    -webkit-mask: url(icons/shisha.svg) no-repeat center / contain; mask: url(icons/shisha.svg) no-repeat center / contain; }

/* اللوجو الجديد (2026-11-22): في الوضع الغامق بيتعرض على كارت أبيض عشان الأزرق يبان */
html[data-theme="dark"] img[src*="quick-logo-full.png"] { background: #fff; border-radius: 14px; padding: 6px 10px; box-sizing: border-box; }
