:root {
  --green: #147041;
  --green-d: #0c4a2b;
  --green-dd: #08331d;
  --green-l: #e6f2eb;
  --green-m: #bfdccb;
  --amber: #ffac2a;
  --amber-d: #e08f0a;
  --amber-l: #fff3dc;
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #1c2a22;
  --muted: #7a857f;
  --line: #e7ebe8;
  --red: #d64545;
  --red-l: #fdeaea;
  --blue: #2f7de1;
  --shadow: 0 1px 2px rgba(12,74,43,.06), 0 6px 20px rgba(12,74,43,.06);
  --r: 14px;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; overflow: hidden; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: plaintext; }

.app { display: flex; height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar { width: 236px; background: linear-gradient(175deg, var(--green) 0%, var(--green-d) 62%, var(--green-dd) 100%); color: #fff; display: flex; flex-direction: column; padding: 18px 12px; flex: none; position: relative; overflow: hidden; }
.sidebar::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,172,42,.22), transparent 65%); bottom: -90px; left: -90px; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 44px; height: 44px; border-radius: 12px; background: #fff; padding: 3px; }
.brand b { display: block; font-size: 17px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--green-m); }
.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; position: relative; z-index: 1; }
.nav-label { font-size: 11px; color: var(--green-m); opacity: .7; padding: 12px 12px 4px; letter-spacing: .5px; }
.nav button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #d6eadf; font-weight: 600; text-align: right; transition: .15s; position: relative; }
.nav button:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav button.active { background: #fff; color: var(--green); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.nav button.active::before { content: ''; position: absolute; right: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px 0 0 4px; background: var(--amber); }
.nav .badge { margin-right: auto; background: var(--amber); color: #3a2500; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.side-user { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.1); border-radius: 14px; padding: 10px; margin-top: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--amber); color: #3a2500; display: grid; place-items: center; font-weight: 800; flex: none; }
.side-user small { color: var(--green-m); display: block; font-size: 11.5px; }

/* ---------- Topbar ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: var(--card); border-bottom: 1px solid var(--line); flex: none; }
.topbar h1 { font-size: 20px; font-weight: 800; }
.topbar .sub { color: var(--muted); font-size: 12.5px; }
.top-spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; font-weight: 600; transition: .15s; }
button.chip:hover { border-color: var(--green-m); background: var(--green-l); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(20,112,65,.18); }
.chip.off .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(214,69,69,.18); }
.chip.warn .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(255,172,42,.25); }
.add-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(12,74,43,.18); padding: 6px; min-width: 200px; z-index: 30; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; font-weight: 600; text-align: right; }
.menu button:hover { background: var(--green-l); color: var(--green); }

/* ---------- Buttons / fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 12px; font-weight: 700; transition: .15s; white-space: nowrap; }
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(20,112,65,.28); }
.btn.primary:hover { background: var(--green-d); }
.btn.amber { background: var(--amber); color: #3a2500; box-shadow: 0 6px 14px rgba(255,172,42,.35); }
.btn.amber:hover { background: var(--amber-d); }
.btn.ghost { background: var(--green-l); color: var(--green); }
.btn.ghost:hover { background: var(--green-m); }
.btn.line { border: 1.5px solid var(--line); background: #fff; }
.btn.line:hover { border-color: var(--green); color: var(--green); }
.btn.danger { background: var(--red-l); color: var(--red); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { padding: 15px 22px; font-size: 17px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: #3d4b43; }
.inp { width: 100%; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; outline: none; transition: .15s; }
.inp:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(20,112,65,.12); }
.search { position: relative; }
.search svg { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .inp { padding-right: 42px; }
.row { display: flex; gap: 12px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.view { flex: 1; overflow: auto; padding: 20px 22px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-head h2 { font-size: 20px; flex: 1; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; height: 100%; padding: 18px 22px; }
.catalog { display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 12px; }
.scan-row { display: flex; gap: 10px; }
.scan-row .search { flex: 1; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; flex: none; }
.cats::-webkit-scrollbar, .nav::-webkit-scrollbar { height: 0; width: 0; }
.cat { display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 99px; font-weight: 700; white-space: nowrap; transition: .15s; }
.cat:hover { border-color: var(--green-m); }
.cat.active { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(20,112,65,.25); }
.products { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; align-content: start; padding: 2px 2px 14px; }
.pcard { background: #fff; border-radius: 16px; padding: 12px; text-align: right; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); border: 2px solid transparent; transition: .12s; position: relative; }
.pcard:hover { border-color: var(--green); transform: translateY(-2px); }
.pcard:active { transform: scale(.97); }
.pcard .pic { height: 74px; border-radius: 12px; background: linear-gradient(135deg, var(--green-l), #fff7e6); display: grid; place-items: center; font-size: 40px; }
.pcard .nm { font-weight: 700; font-size: 14px; line-height: 1.3; min-height: 36px; }
.pcard .pr { display: flex; align-items: baseline; gap: 6px; }
.pcard .pr b { color: var(--green); font-size: 16px; }
.pcard .pr s { color: var(--muted); font-size: 12px; }
.pcard .stk { font-size: 11.5px; color: var(--muted); }
.pcard.out { opacity: .5; pointer-events: none; }
.tag { position: absolute; top: 8px; left: 8px; background: var(--amber); color: #3a2500; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.tag.red { background: var(--red); color: #fff; }

.cart { background: #fff; border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cart-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cart-head b { font-size: 16px; flex: 1; }
.cart-cust { padding: 10px 16px; border-bottom: 1px dashed var(--line); display: flex; gap: 8px; }
.cart-items { flex: 1; overflow: auto; padding: 6px 12px; }
.empty { display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px 20px; gap: 6px; }
.empty .big { font-size: 46px; }
.line-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.line-item .pic { width: 44px; height: 44px; border-radius: 12px; background: var(--green-l); display: grid; place-items: center; font-size: 24px; }
.line-item .nm { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.line-item .sub { font-size: 12px; color: var(--muted); }
.line-item .sub em { color: var(--green); font-style: normal; font-weight: 700; }
.line-item .tot { text-align: left; font-weight: 800; }
.qty { display: inline-flex; align-items: center; background: var(--bg); border-radius: 10px; margin-top: 4px; }
.qty button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; }
.qty button:hover { background: var(--green-l); color: var(--green); }
.qty b { min-width: 26px; text-align: center; font-size: 14px; }
.cart-foot { border-top: 1px solid var(--line); padding: 12px 16px 16px; background: #fcfdfc; }
.sum { display: flex; justify-content: space-between; padding: 3px 0; color: #4d5b53; font-size: 14px; }
.sum.disc { color: var(--green); font-weight: 700; }
.sum.total { font-size: 22px; font-weight: 800; color: var(--text); padding-top: 8px; margin-top: 4px; border-top: 2px dashed var(--line); }
.sum.total span:last-child { color: var(--green); }
.kbd { background: rgba(0,0,0,.12); padding: 0 6px; border-radius: 6px; font-size: 11px; margin-right: 4px; }
.scan-beam { position: fixed; inset: 0; pointer-events: none; z-index: 60; display: none; }
.scan-beam.on { display: block; }
.scan-beam::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #ff3b3b, transparent); box-shadow: 0 0 18px #ff3b3b; animation: beam .7s ease-out; }
@keyframes beam { from { top: 12%; opacity: 1 } to { top: 88%; opacity: .2 } }

/* ---------- Tables / KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: flex; gap: 14px; align-items: center; }
.kpi .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--green-l); color: var(--green); flex: none; }
.kpi .ic.a { background: var(--amber-l); color: var(--amber-d); }
.kpi .ic.r { background: var(--red-l); color: var(--red); }
.kpi .ic.b { background: #e8f1fd; color: var(--blue); }
.kpi small { color: var(--muted); font-weight: 600; display: block; }
.kpi b { font-size: 22px; }
.kpi .d { font-size: 12px; color: var(--green); font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th { text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 10px 12px; background: #fafbfa; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fbfdfc; }
.tbl { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.tbl-scroll { max-height: calc(100vh - 250px); overflow: auto; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--green-l); color: var(--green); }
.pill.a { background: var(--amber-l); color: var(--amber-d); }
.pill.r { background: var(--red-l); color: var(--red); }
.pill.g { background: #eef0ee; color: #5d6a63; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.bar.low i { background: var(--amber); } .bar.out i { background: var(--red); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cat-card { text-align: center; padding: 22px 14px; }
.cat-card .big { font-size: 42px; margin-bottom: 6px; }
.offer-card { display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.offer-card .val { font-size: 34px; font-weight: 800; color: var(--green); line-height: 1; }
.offer-card::before { content: ''; position: absolute; top: -30px; left: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--amber-l); }
.offer-card > * { position: relative; }
.switch { width: 44px; height: 24px; background: #cfd6d2; border-radius: 99px; position: relative; transition: .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch.on { background: var(--green); } .switch.on::after { right: 23px; }

/* ---------- Charts ---------- */
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
.hbar { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13.5px; }
.hbar .lb { width: 120px; font-weight: 600; }
.hbar .bar { flex: 1; height: 10px; }
.hbar .v { width: 78px; text-align: left; font-weight: 700; }
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; }
.legend b { margin-right: auto; }

/* ---------- Hardware / shift ---------- */
.hw { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.hw-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hw-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--green-l); color: var(--green); display: grid; place-items: center; }
.hw-ic svg { width: 26px; height: 26px; }
.hw-head b { display: block; font-size: 16px; }
.hw-head small { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-anim { height: 88px; border-radius: 14px; background: linear-gradient(135deg, var(--green-l), #fff7e6); display: grid; place-items: center; position: relative; overflow: hidden; }
.drawer-box { width: 150px; height: 56px; background: var(--green-d); border-radius: 10px; position: relative; }
.drawer-box i { position: absolute; inset: auto 8px -22px; height: 34px; background: var(--green); border-radius: 0 0 10px 10px; transform: translateY(-26px); transition: .45s cubic-bezier(.3,1.5,.5,1); display: block; }
.drawer-anim.open .drawer-box i { transform: translateY(0); }
.drawer-anim.open .drawer-box i::after { content: '💵💵💵'; position: absolute; top: -18px; right: 20px; font-size: 18px; }
.cash-big { font-size: 34px; font-weight: 800; color: var(--green); }
.move { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.move .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.move .ic.in { background: var(--green-l); color: var(--green); } .move .ic.out { background: var(--red-l); color: var(--red); }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8,51,29,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; }
.modal-backdrop[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: translateY(14px) scale(.97); opacity: 0 } }
.modal { background: #fff; border-radius: 22px; width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: pop .2s; }
.nofx, .nofx .modal { animation: none; }
.modal.rmodal { width: min(420px, 100%); }
.modal.wide { width: min(780px, 100%); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { flex: 1; font-size: 18px; }
.x { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); }
.x:hover { background: var(--red-l); color: var(--red); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fcfdfc; border-radius: 0 0 22px 22px; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 38px; height: 38px; border-radius: 10px; background: var(--bg); font-size: 20px; border: 2px solid transparent; }
.emoji-pick button.on { border-color: var(--green); background: var(--green-l); }
.pay-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pay-tabs button { padding: 14px 8px; border-radius: 14px; border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; }
.pay-tabs button.on { border-color: var(--green); background: var(--green-l); color: var(--green); }
.pay-tabs .e { font-size: 26px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.quick button { padding: 8px 14px; border-radius: 10px; background: var(--amber-l); color: #7a4d00; font-weight: 800; }
.quick button:hover { background: var(--amber); }
.change { display: flex; justify-content: space-between; align-items: center; background: var(--green-l); color: var(--green); padding: 14px 16px; border-radius: 14px; font-weight: 800; font-size: 18px; margin-top: 14px; }
.change.bad { background: var(--red-l); color: var(--red); }
.due { text-align: center; padding: 6px 0 16px; }
.due small { color: var(--muted); display: block; }
.due b { font-size: 40px; color: var(--green); }
.success { text-align: center; padding: 6px 0 4px; }
.success .ok { width: 60px; height: 60px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin: 0 auto 8px; }
.success .ok svg { width: 32px; height: 32px; stroke-width: 3; }
.status-line { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.cam { width: 100%; aspect-ratio: 4/3; background: #0b1410; border-radius: 16px; display: grid; place-items: center; color: #9fb7a9; position: relative; overflow: hidden; text-align: center; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam .frame { position: absolute; inset: 20%; border: 3px solid var(--amber); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }

/* ---------- Receipt ---------- */
.receipt { width: 300px; margin: 0 auto; background: #fff; padding: 14px 12px; font-family: 'Courier New', 'IBM Plex Sans Arabic', monospace; font-size: 12.5px; color: #000; border: 1px dashed #bbb; line-height: 1.5; }
.receipt.w58 { width: 220px; font-size: 11.5px; }
.receipt .c { text-align: center; }
.receipt .logo { width: 54px; height: 54px; display: block; margin: 0 auto 4px; filter: grayscale(1) contrast(1.4); }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 7px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .big { font-size: 16px; font-weight: 800; }
.receipt .qr { display: grid; place-items: center; margin: 8px 0 2px; }
.receipt .qr svg, .receipt .qr img { width: 110px; height: 110px; image-rendering: pixelated; }
.receipt table td, .receipt table th { padding: 1px 0; border: 0; background: none; position: static; font-size: inherit; color: #000; }
.receipt table th { border-bottom: 1px dashed #000; }
#printArea { display: none; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 22px; left: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { background: var(--green-dd); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.25); display: flex; gap: 10px; align-items: center; font-weight: 600; animation: pop .25s; border-right: 5px solid var(--amber); max-width: 380px; }
.toast.err { border-right-color: var(--red); }


/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 70; background: linear-gradient(160deg, var(--green) 0%, var(--green-d) 60%, var(--green-dd) 100%); display: grid; place-items: center; padding: 20px; }
.login[hidden] { display: none; }
.login-card { background: #fff; border-radius: 26px; padding: 30px 34px; width: min(460px, 100%); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-card img { width: 72px; height: 72px; border-radius: 18px; }
.login-card h2 { margin: 8px 0 2px; } .login-card p { color: var(--muted); margin-bottom: 18px; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.user-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border-radius: 18px; border: 2px solid var(--line); transition: .15s; }
.user-card:hover { border-color: var(--green); background: var(--green-l); transform: translateY(-2px); }
.user-card .avatar { width: 52px; height: 52px; font-size: 20px; } .user-card small { color: var(--muted); }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--green-m); } .pin-dots i.on { background: var(--green); border-color: var(--green); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 270px; margin: 0 auto; }
.numpad button { height: 58px; border-radius: 16px; background: var(--bg); font-size: 22px; font-weight: 800; } .numpad button:hover { background: var(--green-l); color: var(--green); } .numpad button:active { transform: scale(.95); }
/* ---------- online orders ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kcol { background: #eef2ef; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 260px; }
.khead { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.ocard { background: #fff; border-radius: 14px; padding: 13px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 9px; border: 2px solid transparent; }
.ocard.fresh { border-color: var(--amber); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(255,172,42,.25); } }
.oitems { display: flex; flex-direction: column; gap: 4px; background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.notice { display: flex; gap: 10px; align-items: center; background: var(--amber-l); color: #7a4d00; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; font-size: 13.5px; }
.qin { width: 44px; text-align: center; border: 0; background: transparent; font-weight: 800; font-size: 14px; outline: none; }
.qin:focus { background: #fff; border-radius: 8px; box-shadow: 0 0 0 2px var(--green); }


/* ---------- scan dialog ---------- */
.scanbox { height: 190px; border-radius: 18px; background: linear-gradient(135deg, var(--green-l), #fff7e6); display: grid; place-items: center; position: relative; overflow: hidden; color: var(--green); }
.scanbox svg { width: 56px; height: 56px; opacity: .55; }
.scanbox .corners { position: absolute; inset: 26px 60px; border: 3px solid var(--green); border-radius: 18px; opacity: .6; }
.scanbox .laser { position: absolute; left: 60px; right: 60px; height: 3px; background: linear-gradient(90deg, transparent, #ff3b3b, transparent); box-shadow: 0 0 14px #ff3b3b; animation: laser 1.6s ease-in-out infinite alternate; }
@keyframes laser { from { top: 34px } to { top: 154px } }
.scanned { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.scanned .pic { width: 92px; height: 92px; border-radius: 24px; background: linear-gradient(135deg, var(--green-l), #fff7e6); display: grid; place-items: center; font-size: 52px; }
.scanned .nm { font-size: 20px; }
.scanned .price { font-size: 30px; font-weight: 800; color: var(--green); }
.scanned .price small { font-size: 13px; color: var(--muted); font-weight: 600; } .scanned .price s { font-size: 14px; color: var(--muted); }
.qtybig { display: flex; align-items: center; gap: 6px; background: var(--bg); border-radius: 16px; padding: 6px; margin: 4px 0; }
.qtybig button { width: 48px; height: 48px; border-radius: 12px; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); }
.qtybig button:hover { background: var(--green-l); color: var(--green); }
.qtybig input { width: 80px; text-align: center; border: 0; background: transparent; font-size: 28px; font-weight: 800; outline: none; }


/* ---------- home / catalog / landing ---------- */
.home-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; min-height: 0; overflow: auto; padding-bottom: 8px; }
.scan-hero { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: center; background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 20px 24px; }
.scan-hero h2 { font-size: 24px; margin-bottom: 4px; } .scan-hero p { color: var(--muted); margin-bottom: 14px; }
.scanbox.sm { height: 150px; }
.scanbox.sm .corners { inset: 22px 40px; } .scanbox.sm .laser { left: 40px; right: 40px; animation-name: laser2; }
@keyframes laser2 { from { top: 28px } to { top: 118px } }
.home-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-content: start; }
.catalogpage { grid-template-columns: minmax(0, 1fr); }
.cartbar { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--green-dd); color: #fff; border-radius: 18px; padding: 10px 12px 10px 18px; display: flex; align-items: center; gap: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.cartbar[hidden] { display: none; }
body.cashier .adm { display: none !important; }
.login-card.wide { width: min(800px, 100%); }
.tagline { display: block; color: var(--muted); margin-bottom: 18px; }
.tiles-title { font-weight: 800; color: var(--green); margin: 4px 0 10px; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 16px; background: var(--green-l); color: var(--green-d); font-weight: 700; font-size: 13px; }
.tile svg { width: 24px; height: 24px; }


/* ---------- dedicated scan page ---------- */
.scanpage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; height: 100%; padding: 18px 22px; }
.sp-main { display: flex; flex-direction: column; gap: 14px; min-height: 0; min-width: 0; }
.sp-tools { display: flex; gap: 10px; } .sp-tools .search { flex: 1; }
.sp-last { display: flex; align-items: center; gap: 22px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 18px 24px; min-height: 160px; flex: none; }
.sp-last .pic { width: 104px; height: 104px; border-radius: 26px; background: linear-gradient(135deg, var(--green-l), #fff7e6); display: grid; place-items: center; font-size: 58px; flex: none; }
.sp-last .info { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-last .info small { color: var(--muted); } .sp-last .nm { font-size: 24px; }
.sp-last .price { font-size: 34px; font-weight: 800; color: var(--green); line-height: 1.1; }
.sp-last .price small { font-size: 14px; color: var(--muted); font-weight: 600; } .sp-last .price s { font-size: 15px; color: var(--muted); font-weight: 600; }
.sp-last .ltot { text-align: center; padding-right: 8px; } .sp-last .ltot small { display: block; color: var(--muted); } .sp-last .ltot b { font-size: 26px; }
.sp-list { flex: 1; min-height: 0; display: flex; flex-direction: column; } .sp-list .tbl-scroll { max-height: none; flex: 1; }
tr.hl td { background: var(--amber-l) !important; }
.sp-list .qty { margin: 0; }
.sp-side { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 11px; overflow: auto; min-height: 0; }
.sp-cust { display: flex; gap: 6px; } .sp-cust select { padding: 8px 12px; }
.sp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .sp-two .sp-stat { flex-direction: column; align-items: flex-start; padding: 9px 12px; gap: 0; } .sp-two .sp-stat b { font-size: 22px; }
.sp-block label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.chosen { display: flex; justify-content: space-between; align-items: center; background: var(--green-l); color: var(--green-d); border-radius: 10px; padding: 8px 12px; }
.sp-sum { border-top: 1px dashed var(--line); padding-top: 8px; }
.sp-total { padding: 12px 8px; } .sp-total b { font-size: 36px; }
.sp-stat { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--bg); border-radius: 14px; }
.sp-stat small { color: var(--muted); font-weight: 700; } .sp-stat b { font-size: 26px; }
.sp-total { text-align: center; background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; border-radius: 18px; padding: 20px 10px; }
.sp-total small { display: block; opacity: .8; } .sp-total b { font-size: 44px; line-height: 1.1; } .sp-total span { margin-right: 6px; opacity: .8; }

.prow { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }


/* ---------- landing / login (v2) ---------- */
.login { display: grid; grid-template-columns: 1.15fr 1fr; padding: 0; background: #fff; place-items: stretch; }
.lg-brand { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--green) 0%, var(--green-d) 62%, var(--green-dd) 100%); color: #fff; display: grid; place-items: center; padding: 40px; }
.lg-orb { position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255,172,42,.28), transparent 65%); bottom: -150px; left: -120px; }
.lg-orb.o2 { width: 340px; height: 340px; top: -120px; right: -100px; bottom: auto; left: auto; background: radial-gradient(circle, rgba(255,255,255,.12), transparent 65%); }
.lg-brand-in { position: relative; max-width: 520px; text-align: center; }
.lg-logo { width: 104px; height: 104px; border-radius: 28px; background: #fff; padding: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.lg-brand h1 { font-size: 40px; margin: 18px 0 4px; font-weight: 800; }
.lg-brand p { color: var(--green-m); font-size: 17px; }
.lg-secs { margin-top: 34px; } .lg-secs small { display: block; color: var(--green-m); font-weight: 700; margin-bottom: 12px; letter-spacing: .3px; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lg-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); font-size: 13px; font-weight: 600; }
.lg-chips svg { width: 15px; height: 15px; opacity: .85; }
.lg-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; gap: 22px; background: var(--bg); overflow: auto; }
.lg-box { width: min(380px, 100%); }
.lg-box h2 { font-size: 28px; margin-bottom: 4px; }
.lg-sub { color: var(--muted); margin-bottom: 22px; }
.lg-users { display: flex; flex-direction: column; gap: 10px; }
.lg-user { display: flex; align-items: center; gap: 14px; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; text-align: right; transition: .15s; }
.lg-user:hover { border-color: var(--green); box-shadow: 0 8px 22px rgba(20,112,65,.15); transform: translateX(-3px); }
.lg-user .avatar { width: 46px; height: 46px; font-size: 18px; }
.lg-user div { flex: 1; } .lg-user b { display: block; font-size: 16px; } .lg-user small { color: var(--muted); }
.lg-arrow { transform: rotate(90deg); color: var(--green); }
.lg-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; margin-bottom: 18px; } .lg-back svg { transform: rotate(90deg); width: 16px; height: 16px; } .lg-back:hover { color: var(--green); }
.lg-who { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; } .lg-who .avatar { width: 54px; height: 54px; font-size: 22px; } .lg-who b { display: block; font-size: 20px; } .lg-who small { color: var(--muted); }
.lg-box .numpad { max-width: none; }
.lg-box .numpad button { background: #fff; border: 2px solid var(--line); box-shadow: 0 2px 6px rgba(12,74,43,.06); }
.lg-box .numpad button:hover { border-color: var(--green); } .lg-box .pin-dots { justify-content: flex-start; }
.lg-foot { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } .lg-brand { padding: 24px; } .lg-secs { display: none; } .lg-brand h1 { font-size: 28px; margin-top: 10px; } .lg-logo { width: 72px; height: 72px; } }


/* ---------- home / orders v2 ---------- */
.home-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.home-head > div { flex: 1; } .home-head h2 { font-size: 24px; } .home-head p { color: var(--muted); }
button.kpi { text-align: right; width: 100%; border: 0; cursor: pointer; transition: .15s; font: inherit; }
button.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(12,74,43,.12); }
.home-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 14px; align-items: start; }
.op { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: right; border-radius: 10px; }
.op:hover { background: var(--green-l); } .op:last-child { border-bottom: 0; }
.opi { width: 36px; height: 36px; border-radius: 11px; background: var(--bg); display: grid; place-items: center; font-size: 18px; }
.seg { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { padding: 7px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button em { font-style: normal; background: var(--bg); border-radius: 99px; padding: 0 7px; font-size: 12px; margin-right: 4px; }
.seg button.on { background: var(--green); color: #fff; } .seg button.on em { background: rgba(255,255,255,.22); }
.sp-ord { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; color: var(--green-d); } .sp-ord small { color: var(--muted); font-weight: 600; }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } }


.tabs { display: inline-flex; gap: 6px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 4px; margin-inline-end: auto; }
.tabs button { padding: 9px 18px; border-radius: 11px; font-weight: 800; color: var(--muted); position: relative; }
.tabs button em { font-style: normal; background: var(--bg); border-radius: 99px; padding: 0 8px; font-size: 12px; margin-right: 4px; }
.tabs button.on { background: var(--green); color: #fff; box-shadow: 0 6px 14px rgba(20,112,65,.25); } .tabs button.on em { background: rgba(255,255,255,.22); }
.dotnew { position: absolute; top: 6px; left: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(255,172,42,.3); }

.seg.pm { display: flex; } .seg.pm button { flex: 1; padding: 7px 4px; font-size: 13px; }


/* ---------- tables v2 + compact scan panel ---------- */
.pager { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fcfdfc; flex-wrap: wrap; }
.pg-info { color: var(--muted); font-size: 13px; flex: 1; }
.pgs { display: flex; gap: 4px; align-items: center; }
.pgs button { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; font-weight: 700; background: #fff; border: 1.5px solid var(--line); }
.pgs button:hover:not(:disabled) { border-color: var(--green); color: var(--green); } .pgs button.on { background: var(--green); border-color: var(--green); color: #fff; } .pgs button:disabled { opacity: .4; cursor: not-allowed; }
.pg-size { width: 76px !important; padding: 6px 10px !important; }
.tbl-scroll { max-height: calc(100vh - 300px); }
tr.rowlink { cursor: pointer; } tr.rowlink:hover td { background: var(--green-l); }
tr.fresh-row td { background: #fffaf0; }
.pic-sm { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--green-l); font-size: 22px; }
.rl { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); }
.sp-side { padding: 12px; gap: 0; overflow: hidden; }
.sp-scroll { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; padding-bottom: 8px; }
.sp-foot { flex: none; border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 7px; }
.sp-side .sp-ord { font-size: 14px; } .sp-side .sp-cust select { padding: 6px 10px; font-size: 14px; }
.sp-two { gap: 6px; } .sp-two .sp-stat { padding: 6px 10px; } .sp-two .sp-stat b { font-size: 18px; } .sp-two .sp-stat small { font-size: 12px; }
.sp-side .sp-block label { margin-bottom: 3px; font-size: 12px; }
.sp-side .sp-sum .sum { font-size: 13px; padding: 1px 0; }
.sp-side .sp-total { padding: 8px 6px; border-radius: 14px; } .sp-side .sp-total b { font-size: 30px; } .sp-side .sp-total small { font-size: 12px; }
.sp-foot .btn.lg { padding: 10px 16px; font-size: 16px; } .sp-foot .seg.pm button { padding: 5px 2px; font-size: 12.5px; } .sp-foot .btn.sm { padding: 5px 8px; font-size: 12.5px; }


/* ---------- table tools + stats strip ---------- */
.tbar { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px 14px; margin-bottom: 10px; }
.tbar .search { width: 290px; } .tbar .search .inp { padding-top: 8px; padding-bottom: 8px; }
.fl { display: flex; flex-direction: column; gap: 3px; } .fl span { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.fl .inp { padding: 7px 10px; min-width: 120px; font-size: 14px; } .fl .inp[type=date] { min-width: 140px; }
.statstrip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.st { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 8px 14px; min-width: 120px; border-right: 4px solid var(--green); }
.st:nth-child(even) { border-right-color: var(--amber); }
.st small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; } .st b { font-size: 17px; }

.topbar { flex-wrap: wrap; row-gap: 8px; } .topbar h1, .topbar .chip, .topbar .btn { white-space: nowrap; }


/* ---------- live login / shimmer ---------- */
.shimmer-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.shimmer-list i { height: 46px; border-radius: 12px; background: linear-gradient(90deg, #e9ece9 25%, #f6f8f6 50%, #e9ece9 75%); background-size: 200% 100%; animation: shim 1.2s infinite linear; }
@keyframes shim { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.lg-err { background: var(--red-l); color: var(--red); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; }
.lg-note { display: flex; gap: 8px; align-items: center; background: var(--green-l); color: var(--green-d); border-radius: 12px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; }
.lg-link { color: var(--green); font-weight: 700; text-align: center; padding: 6px; width: 100%; } .lg-link:hover { text-decoration: underline; }

.chk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chk { display: flex; align-items: center; gap: 7px; font-weight: 700; background: var(--bg); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.prev { background: var(--green-l); color: var(--green-d); border-radius: 12px; padding: 9px 14px; font-size: 13.5px; }
@media (max-width: 700px) { .chk-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- camera scanner ---------- */
.camwrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
#camView { width: 100%; min-height: 260px; background: #0b1410; border-radius: 16px; overflow: hidden; display: grid; place-items: center; color: #9fb7a9; text-align: center; }
#camView video { border-radius: 16px; }
.camph svg { width: 44px; height: 44px; opacity: .7; }
.cammsg { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--green-l); color: var(--green-d); font-weight: 700; min-height: 42px; }
.cammsg.bad { background: var(--red-l); color: var(--red); }
.camopts { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 800px) { .camwrap { grid-template-columns: 1fr; } }

.clr-row { display: flex; gap: 8px; } .clr-row .btn { flex: 1; }

/* ---------- scan page: responsive fix ---------- */
.sp-main { overflow: auto; padding-bottom: 4px; }
.sp-tools { flex-wrap: wrap; } .sp-tools .search { flex: 1 1 240px; min-width: 0; }
.sp-last { flex-wrap: wrap; gap: 12px 18px; padding: 14px 20px; min-height: 0; }
.sp-last .info { flex: 1 1 230px; }
.sp-last .nm { font-size: clamp(17px, 2vw, 24px); overflow-wrap: anywhere; line-height: 1.3; }
.sp-last .price { font-size: clamp(24px, 3vw, 34px); }
.sp-last .qtybig { flex: none; } .sp-last .ltot { flex: none; }
.sp-list { flex: 1 0 240px; }
.sp-acts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sp-acts > .btn:nth-child(-n+3) { grid-column: span 2; }
.sp-acts > .btn:nth-child(4) { grid-column: span 3; }
.clr-row { display: contents; }
.clr-row .btn { grid-column: span 3; } .clr-row .btn:nth-child(2) { grid-column: span 6; }
.sp-acts .btn { padding: 6px 4px; font-size: 12.5px; gap: 5px; white-space: nowrap; } .sp-acts .btn svg { width: 16px; height: 16px; }
@media (max-width: 1100px) {
  .scanpage { grid-template-columns: minmax(0, 1fr) 290px; padding: 14px; gap: 12px; }
  .sp-last .pic { width: 72px; height: 72px; font-size: 40px; border-radius: 20px; }
  .sp-last .qtybig button { width: 42px; height: 42px; } .sp-last .qtybig input { width: 64px; font-size: 24px; }
}
@media (max-width: 1100px) {
  .sp-list th, .sp-list td { padding: 9px 7px; }
  .sp-list th:first-child, .sp-list td:first-child { display: none; }
  .sp-list td:nth-child(2) { min-width: 170px; } .sp-list table { min-width: 470px; }
}
@media (max-width: 720px) {
  .scanpage { grid-template-columns: 1fr; height: auto; }
  .sp-main { overflow: visible; }
  .sp-side { overflow: visible; } .sp-scroll { overflow: visible; }
  .sp-list { flex: none; } .sp-list .tbl-scroll { max-height: 340px; }
}

@media print {
  body { overflow: visible; background: #fff; }
  .app, .modal-backdrop, .toasts, .scan-beam, .login { display: none !important; }
  #printArea { display: block !important; }
  #printArea .receipt { border: 0; width: 100%; margin: 0; }
  @page { margin: 0; }
}
@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
  .chart-grid { grid-template-columns: 1fr; }
  .sidebar { width: 76px; } .brand div, .nav button span, .nav-label, .side-user div:last-child, .nav .badge { display: none; }
  .nav button { justify-content: center; } .nav button.active::before { display: none; }
}

/* ---------- الحسابات: قائمة الدخل والتدفق ---------- */
.tbl-simple { border-collapse: collapse; margin: 6px 0 10px; }
.tbl-simple td { padding: 9px 4px; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.tbl-simple td.num { text-align: left; white-space: nowrap; }
.tbl-simple tr.sum-row td { background: var(--green-l); border-bottom: 1px solid var(--line); padding-inline: 10px; }
.tbl-simple tr.sum-row td:first-child { border-radius: 0 10px 10px 0; } .tbl-simple tr.sum-row td:last-child { border-radius: 10px 0 0 10px; }

/* قفل الشاشة */
.lockscreen { position: fixed; inset: 0; z-index: 9999; background: linear-gradient(160deg, #0d4f2e, #147041 60%, #1c8a52); display: grid; place-items: center; padding: 16px; }
.lockcard { background: var(--card, #fff); border-radius: 22px; padding: 28px 24px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.lockcard img { align-self: center; }
.lockcard h2 { margin: 4px 0 0; }
.lockcard p { margin: 0 0 6px; color: var(--muted); }

/* ملصقات الباركود */
.lbl { background: #fff; color: #000; border: 1px dashed #bbb; border-radius: 4px; padding: 1.5mm 2mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; box-sizing: border-box; font-family: 'IBM Plex Sans Arabic', sans-serif; }
.lbl .bc { width: 100%; height: 9mm; fill: #000; }
.lbl-shop { font-size: 7px; font-weight: 700; opacity: .75; }
.lbl-name { font-size: 9px; font-weight: 700; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.lbl-code { font-size: 8px; letter-spacing: 1px; direction: ltr; }
.lbl-price { font-size: 13px; font-weight: 800; }
.lbl-price small { font-size: 8px; font-weight: 600; }
.lbl-38x25 { width: 38mm; height: 25mm; } .lbl-50x30 { width: 50mm; height: 30mm; } .lbl-58roll { width: 54mm; height: 34mm; } .lbl-a4 { width: 64mm; height: 33mm; }
.lbl-50x30 .bc, .lbl-58roll .bc, .lbl-a4 .bc { height: 11mm; }
.lbl-prev { display: inline-block; transform: scale(1.6); transform-origin: top right; margin: 6px 0 40px; }
.lbl-sheet.roll .lbl { border: 0; page-break-after: always; break-after: page; }
.lbl-sheet.a4 { display: grid; grid-template-columns: repeat(3, 64mm); gap: 0 2mm; }
.lbl-sheet.a4 .lbl { border-color: #eee; break-inside: avoid; }

/* صلاحيات الموظف */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
.perm { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14px; background: var(--card, #fff); }
.perm input { margin-top: 3px; accent-color: var(--green); }
.perm:has(input:checked) { border-color: var(--green); background: var(--green-l); }

/* الرئيسية: صفوف مؤشرات منتظمة */
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.k6 .kpi b, .kpis.k5 .kpi b { font-size: clamp(15px, 1.4vw, 22px); overflow-wrap: anywhere; display: block; line-height: 1.25; }
.kpis.k6 .kpi > div:last-child, .kpis.k5 .kpi > div:last-child { min-width: 0; }
@media (max-width: 1400px) { .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpis.k6, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== مشهد شاشة الدخول المتحرك ===== */
.lgfx { position: relative; margin: 26px auto 0; width: min(500px, 100%); }
.lgfx-stage { position: relative; height: 230px; display: flex; align-items: flex-end; justify-content: center; gap: 46px; }
.lgfx-float { position: absolute; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(4px); animation: lgFloat 7s ease-in-out infinite; z-index: 0; }
.lgfx-float.f1 { top: -6px; right: 2%; } .lgfx-float.f2 { top: 70px; left: -4%; animation-delay: -2s; } .lgfx-float.f3 { top: 18px; left: 18%; animation-delay: -4s; width: 36px; height: 36px; } .lgfx-float.f4 { top: 96px; right: -5%; animation-delay: -5.5s; width: 38px; height: 38px; }
@keyframes lgFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(5deg); } }

/* المنتج والباركود والليزر */
.lgfx-product { --pc: #e9f5ff; position: relative; z-index: 2; width: 104px; height: 128px; border-radius: 16px; background: #fff; box-shadow: 0 14px 30px rgba(0,0,0,.25); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.lgfx-pic { width: 100%; flex: 1; border-radius: 10px; background: var(--pc); display: grid; place-items: center; transition: background .3s; }
.lgfx-pic svg { width: 40px; height: 40px; }
.lgfx-bc { display: flex; gap: 2px; height: 26px; align-items: stretch; }
.lgfx-bc i { width: 2px; background: #1c2a22; } .lgfx-bc i:nth-child(3n) { width: 4px; } .lgfx-bc i:nth-child(4n+1) { width: 1px; }
.lgfx-laser { position: absolute; left: -10px; right: -10px; height: 2px; top: 0; background: #ff3b30; box-shadow: 0 0 10px 3px rgba(255,59,48,.65); opacity: 0; border-radius: 2px; }
.lgfx-product.scan .lgfx-laser { animation: lgLaser .7s ease-in-out; }
.lgfx-product.scan { animation: lgBeep .7s ease; }
@keyframes lgLaser { 0% { top: 70%; opacity: 0; } 15% { opacity: 1; } 50% { top: 98%; opacity: 1; } 85% { opacity: 1; } 100% { top: 70%; opacity: 0; } }
@keyframes lgBeep { 60% { box-shadow: 0 14px 30px rgba(0,0,0,.25), 0 0 0 6px rgba(255,172,42,.45); } }

/* الصنف الطائر للفاتورة */
.lgfx-fly { position: absolute; z-index: 4; right: calc(50% + 70px); bottom: 110px; display: flex; align-items: center; gap: 4px; background: var(--amber); color: #2a1a00; font-weight: 800; padding: 4px 10px 4px 6px; border-radius: 999px; box-shadow: 0 8px 20px rgba(0,0,0,.25); opacity: 0; pointer-events: none; }
.lgfx-fly svg { width: 20px; height: 20px; background: #fff; border-radius: 50%; padding: 2px; }
.lgfx-fly.go { animation: lgFly .75s cubic-bezier(.5,.1,.3,1) forwards; }
@keyframes lgFly { 0% { opacity: 0; transform: translate(0, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-20px, -26px) scale(1); } 100% { opacity: 0; transform: translate(-150px, -10px) scale(.7); } }

/* جهاز الكاشير */
.lgfx-pos { position: relative; z-index: 3; width: 210px; display: flex; flex-direction: column; align-items: center; }
.lgfx-screen { position: relative; z-index: 2; width: 100%; height: 150px; border-radius: 16px; background: #0f2a1c; border: 6px solid #1d3a2a; box-shadow: 0 18px 36px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06); padding: 8px 10px; display: flex; flex-direction: column; text-align: right; color: #e8f5ee; font-size: 11px; }
.lgfx-sh { display: flex; justify-content: space-between; align-items: center; color: var(--green-m); font-weight: 700; margin-bottom: 4px; }
.lgfx-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; animation: lgPulse 1.6s infinite; }
@keyframes lgPulse { 50% { opacity: .35; } }
.lgfx-rows { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 3px; }
.lgfx-row { display: flex; justify-content: space-between; gap: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.06); animation: lgRow .45s ease both; white-space: nowrap; }
.lgfx-row span { overflow: hidden; text-overflow: ellipsis; } .lgfx-row b { color: #fff; font-variant-numeric: tabular-nums; }
.lgfx-row:last-child { background: rgba(255,172,42,.22); }
.lgfx-row.out { animation: lgOut .4s ease forwards; }
@keyframes lgRow { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes lgOut { to { opacity: 0; transform: translateY(-8px); } }
.lgfx-tot { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed rgba(255,255,255,.2); padding-top: 4px; margin-top: 4px; }
.lgfx-tot small { color: var(--green-m); } .lgfx-tot b { font-size: 20px; color: var(--amber); font-variant-numeric: tabular-nums; }
.lgfx-base { width: 70px; height: 18px; background: linear-gradient(#1d3a2a, #13281c); border-radius: 0 0 10px 10px; }
.lgfx-base::after { content: ''; display: block; width: 130px; height: 8px; margin: 0 -30px; background: #13281c; border-radius: 6px; position: relative; top: 18px; }

/* الفاتورة المطبوعة */
.lgfx-receipt { position: absolute; z-index: 1; top: 0; left: 50%; width: 110px; transform: translate(-50%, 10px); background: #fff; color: #1c2a22; border-radius: 6px 6px 0 0; padding: 8px 10px 14px; font-size: 10px; display: flex; flex-direction: column; gap: 4px; align-items: center; opacity: 0;
  -webkit-mask: linear-gradient(#000 calc(100% - 6px), transparent 0) top, radial-gradient(circle 4px at 6px 100%, transparent 98%, #000) bottom / 12px 6px repeat-x; box-shadow: 0 10px 20px rgba(0,0,0,.2); }
.lgfx-receipt b { font-size: 11px; color: var(--green); } .lgfx-receipt i { display: block; width: 100%; height: 4px; border-radius: 3px; background: #e3ebe6; } .lgfx-receipt i:nth-of-type(2) { width: 70%; }
.lgfx-receipt span { font-weight: 800; font-size: 13px; } .lgfx-receipt em { font-style: normal; color: var(--green); font-weight: 700; }
.lgfx-receipt.print { animation: lgPrint 1.6s cubic-bezier(.3,.7,.3,1) forwards; }
@keyframes lgPrint { 0% { opacity: 1; transform: translate(-50%, 40px); } 100% { opacity: 1; transform: translate(-50%, -112px) rotate(-3deg); } }

/* شارات الميزات */
.lgfx-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.lgfx-chips span { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; animation: lgChip 8s infinite; }
.lgfx-chips .c2 { animation-delay: 2s; } .lgfx-chips .c3 { animation-delay: 4s; } .lgfx-chips .c4 { animation-delay: 6s; }
@keyframes lgChip { 0%, 22%, 100% { background: rgba(255,255,255,.1); transform: none; } 6%, 16% { background: rgba(255,172,42,.9); color: #2a1a00; transform: translateY(-3px); border-color: transparent; } }

@media (max-width: 900px) { .lgfx { display: none; } }
@media (prefers-reduced-motion: reduce) { .lgfx *, .lgfx *::after { animation: none !important; } }

/* حقل الباركود بالمسح فقط */
.sku-box { display: flex; align-items: center; gap: 4px; border: 2px dashed var(--green); border-radius: 12px; padding: 2px 6px; background: var(--green-l); animation: skuWait 1.6s ease-in-out infinite; }
.sku-box .inp { border: 0; background: transparent; box-shadow: none; padding: 8px 4px; font-weight: 800; letter-spacing: 1px; cursor: default; }
.sku-box .inp:focus { outline: none; }
.sku-box .sku-ic { color: var(--green); display: grid; place-items: center; }
.sku-box.has { border-style: solid; background: #fff; animation: none; }
.sku-box.bad { border-color: var(--red); background: var(--red-l); }
.sku-box.flash { animation: skuFlash .6s ease; }
@keyframes skuWait { 50% { border-color: var(--amber); } }
@keyframes skuFlash { 30% { box-shadow: 0 0 0 5px rgba(20,112,65,.25); } }
.sku-cam { margin-top: 8px; border-radius: 12px; overflow: hidden; max-width: 360px; }
