:root {
  --pri: #0f766e; --pri-d: #115e59; --pri-l: #ccfbf1; --acc: #f59e0b;
  --bg: #f1f5f4; --card: #fff; --txt: #0f172a; --mut: #64748b; --line: #e2e8f0;
  --ok: #059669; --err: #dc2626; --warn: #d97706;
  --r: 14px; --sh: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --top: 56px; --nav: 230px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--txt); font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Noto Sans Arabic", system-ui, sans-serif; line-height: 1.5; }
a { color: var(--pri); text-decoration: none; }
h1 { font-size: 1.4rem; margin: 0; } h2 { font-size: 1.05rem; margin: 0 0 12px; }
small, .sm { font-size: .82rem; }
.muted { color: var(--mut); } .pos { color: var(--ok); } .neg { color: var(--err); }
.center { text-align: center; } .nowrap { white-space: nowrap; } .strike td { text-decoration: line-through; }
.grow { flex: 1; min-width: 0; } [hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- إطار الصفحة ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); background: var(--pri); color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 10px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.topbar .brand { color: #fff; font-weight: 700; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.topbar .spacer { flex: 1; } .topbar .who { font-size: .85rem; opacity: .9; }
.logo { width: 34px; height: 34px; border-radius: 50%; background: var(--acc); color: #134e4a; display: grid; place-items: center; font-weight: 800; }
.logo.big { width: 72px; height: 72px; font-size: 2rem; margin: 0 auto 10px; }
.icon-btn { background: transparent; border: 0; color: inherit; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.sidenav { position: fixed; top: var(--top); bottom: 0; right: 0; width: var(--nav); background: #fff; border-left: 1px solid var(--line); padding: 12px 10px; z-index: 25; overflow-y: auto; transition: transform .2s; }
.sidenav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; color: var(--txt); font-weight: 500; margin-bottom: 2px; }
.sidenav a:hover { background: var(--bg); } .sidenav a.active { background: var(--pri-l); color: var(--pri-d); font-weight: 700; }
.nav-backdrop { display: none; }
.main { padding: 18px; margin-right: var(--nav); max-width: 1300px; }
@media (min-width: 901px) { .menu-btn { display: none; } }
@media (max-width: 900px) {
  .sidenav { transform: translateX(100%); box-shadow: -4px 0 20px rgba(0,0,0,.15); }
  .nav-open .sidenav { transform: none; }
  .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
  .main { margin-right: 0; padding: 12px; }
  .topbar .who { display: none; }
}

/* ---------- عناصر عامة ---------- */
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); margin-bottom: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--txt); cursor: pointer; white-space: nowrap; min-height: 42px; }
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; } .btn.primary:hover { background: var(--pri-d); }
.btn.danger { background: #fef2f2; border-color: #fecaca; color: var(--err); }
.btn.danger-text { border: 0; background: none; color: var(--err); }
.btn.sm { padding: 5px 12px; min-height: 34px; font-size: .88rem; }
.btn.lg { padding: 12px 22px; min-height: 50px; font-size: 1.05rem; border-radius: 12px; }
.btn.block { width: 100%; } .btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--txt); min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pri); outline-offset: -1px; border-color: var(--pri); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--pri); flex: none; }
label { display: block; font-size: .9rem; font-weight: 600; color: #334155; }
label > input, label > select, label > textarea, label > .input-scan { margin-top: 5px; font-weight: 400; }
.chk { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form label { margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; gap: 0; } }
.form-actions, .dlg-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dlg-actions.col { flex-direction: column; } .dlg-actions.col .btn { width: 100%; }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 500; border: 1px solid; }
.alert.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.alert.sm { padding: 8px 12px; font-size: .88rem; margin: 8px 0; }
.badge { font-size: .75rem; padding: 2px 10px; border-radius: 20px; vertical-align: middle; }
.badge.err { background: #fee2e2; color: var(--err); }
.hint { font-size: .85rem; margin: -4px 0 10px; }
.empty { text-align: center; color: var(--mut); padding: 30px 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: var(--r); padding: 14px; box-shadow: var(--sh); display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--mut); font-size: .85rem; } .stat b { font-size: 1.35rem; } .stat b.sm { font-size: 1.1rem; } .stat small { color: var(--mut); }
.stat.hl { background: linear-gradient(135deg, var(--pri), var(--pri-d)); color: #fff; } .stat.hl span { color: #ccfbf1; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } .stat b { font-size: 1.1rem; } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; gap: 0; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: right; color: var(--mut); font-weight: 600; font-size: .82rem; padding: 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.card.table-wrap { padding: 6px 10px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; padding: 12px; }
.filters > input, .filters > .input-scan { flex: 1 1 220px; } .filters > select { flex: 0 1 180px; } .filters label { flex: 1 1 140px; }
.input-scan { display: flex; gap: 6px; } .input-scan .icon-btn { background: var(--pri); color: #fff; width: 46px; height: 44px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; background: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--sh); border: 0; font: inherit; text-align: right; color: inherit; width: 100%; flex-wrap: wrap; }
button.list-item { cursor: pointer; } button.list-item:active { background: var(--pri-l); }
.list-item.dim { opacity: .6; }
.li-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; color: inherit; }
.li-main .muted { font-size: .85rem; }
.li-side { display: flex; flex-direction: column; align-items: flex-end; text-align: left; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; padding: 0 4px; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .inline-form input { width: 170px; min-height: 36px; padding: 6px 10px; }
form.inline { display: inline; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.pager a { padding: 6px 12px; background: #fff; border-radius: 8px; box-shadow: var(--sh); } .pager a.active { background: var(--pri); color: #fff; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; }

dialog.dlg { border: 0; border-radius: 18px; padding: 20px; width: min(440px, calc(100vw - 24px)); box-shadow: 0 20px 50px rgba(0,0,0,.3); max-height: calc(100dvh - 24px); overflow-y: auto; }
dialog.dlg label { margin-bottom: 12px; }
dialog::backdrop { background: rgba(15,23,42,.5); backdrop-filter: blur(2px); }

/* ---------- الدخول ---------- */
.login-page { min-height: 100dvh; display: grid; place-items: center; background: linear-gradient(160deg, var(--pri) 0%, #134e4a 100%); padding: 16px; }
.login-page main { width: 100%; display: grid; place-items: center; }
.login-box { background: #fff; border-radius: 20px; padding: 28px 22px; width: min(380px, 100%); text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-box h1 { margin-bottom: 2px; } .login-box label { text-align: right; margin: 14px 0; }
.login-box .btn { margin-top: 8px; }

/* ---------- الأسعار ---------- */
.price-list { display: flex; flex-direction: column; gap: 8px; }
.price-item { background: #fff; border-radius: 12px; box-shadow: var(--sh); padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; border: 2px solid transparent; transition: border-color .2s, background .3s; }
.price-item.dirty { border-color: var(--acc); } .price-item.saved { background: #ecfdf5; }
.pi-name { display: flex; flex-direction: column; color: inherit; min-width: 0; } .pi-name .muted { font-size: .82rem; }
.pi-prices { display: flex; gap: 8px; align-items: flex-end; }
.pi-prices label { font-size: .75rem; color: var(--mut); } .pi-prices input { width: 110px; margin-top: 2px; min-height: 40px; padding: 6px 8px; font-weight: 600; }
.pi-prices .save { min-height: 40px; width: 44px; font-size: 1.1rem; }
.margin { font-size: .78rem; color: var(--mut); grid-column: 1 / -1; }
@media (max-width: 600px) { .price-item { grid-template-columns: 1fr; } .pi-prices input { width: 100%; } .pi-prices label { flex: 1; } }

/* ---------- الماسح بالكاميرا ---------- */
.scan-overlay { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; display: none; flex-direction: column; }
.scan-overlay.open { display: flex; }
.scanning { overflow: hidden; }
.scan-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(0,0,0,.6); }
.scan-head b { flex: 1; font-size: 1rem; }
.scan-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 1.3rem; cursor: pointer; }
.scan-view { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#scanReader { width: 100%; max-width: 720px; border: 0 !important; }
#scanReader video { width: 100% !important; height: auto; object-fit: cover; }
#scanReader img[alt="Info icon"], #scanReader__dashboard, #scanReader__header_message { display: none !important; }
.scan-frame { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.scan-frame i { width: min(80vw, 520px); height: min(45vw, 280px); border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 2000px rgba(0,0,0,.25); position: relative; overflow: hidden; }
.scan-frame i::after { content: ""; position: absolute; left: 6%; right: 6%; height: 2px; background: #f87171; box-shadow: 0 0 10px #f87171; top: 50%; animation: scanline 1.6s ease-in-out infinite; }
@keyframes scanline { 0%,100% { top: 15% } 50% { top: 85% } }
.scan-overlay.hit .scan-frame i { border-color: #34d399; box-shadow: 0 0 0 2000px rgba(16,185,129,.25); }
.scan-overlay.no-live .scan-frame { display: none; }
.scan-fallback { display: none; padding: 20px; text-align: center; }
.scan-overlay.no-live .scan-fallback { display: block; }
.scan-overlay.no-live .scan-view { flex: 0; }
.scan-overlay.no-live .scan-fallback p { color: #cbd5e1; font-size: .9rem; }
.scan-msg { min-height: 52px; padding: 12px 16px; text-align: center; font-weight: 700; font-size: 1.05rem; }
.scan-msg.ok { background: #065f46; } .scan-msg.err { background: #991b1b; }
.scan-manual { display: flex; gap: 8px; padding: 12px; padding-bottom: calc(12px + var(--safe-b)); background: #111; }
.scan-manual input { background: #222; color: #fff; border-color: #444; }

/* ---------- الكاشير ---------- */
.pos-page .main { max-width: none; padding: 0; }
.pick-family { max-width: 560px; margin: 0 auto; padding: 20px 14px; text-align: center; }
.pick-family h1 { font-size: 1.6rem; } .pick-family .list { text-align: right; margin-top: 10px; }
.scan-big { width: 100%; margin: 18px 0; padding: 26px; border-radius: 20px; border: 0; background: linear-gradient(135deg, var(--pri), var(--pri-d)); color: #fff; font: inherit; font-size: 1.25rem; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; box-shadow: 0 10px 24px rgba(15,118,110,.35); }
.scan-big svg { width: 64px; height: 64px; stroke-width: 1.6; }
.scan-big:active { transform: scale(.98); }
.search-box { position: relative; display: flex; gap: 8px; }
.search-box input { min-height: 50px; font-size: 1.05rem; border-radius: 14px; padding-inline: 16px; }

.fam-bar { position: sticky; top: var(--top); z-index: 15; background: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 12px 14px; border-bottom: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.fam-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fam-info b { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fam-info small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-bal { text-align: left; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.fam-bal small { color: var(--mut); font-size: .75rem; } .fam-bal b { font-size: 1.3rem; color: var(--ok); white-space: nowrap; } .fam-bal b.neg { color: var(--err); }
.fam-bar .icon-btn { background: var(--bg); color: var(--pri); }
.bal-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #e2e8f0; }
.bal-meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .25s, background .25s; margin-right: 0; }
.bal-meter i.mid { background: var(--acc); } .bal-meter i.hi { background: var(--err); }
#famNotes { margin: 8px 12px 0; }

.pos-tabs { display: none; }
.pos-body { display: grid; grid-template-columns: 1fr 400px; gap: 0; min-height: calc(100dvh - var(--top) - 70px); }
.pos-items { padding: 12px; padding-bottom: 100px; min-width: 0; }
.pos-cart { background: #fff; border-right: 1px solid var(--line); padding: 12px; padding-bottom: 110px; position: sticky; top: calc(var(--top) + 70px); height: calc(100dvh - var(--top) - 70px); overflow-y: auto; }
.search-box.sticky { position: sticky; top: calc(var(--top) + 70px); z-index: 5; background: var(--bg); padding-bottom: 8px; }
.scan-btn-inline { flex: none; border: 0; border-radius: 14px; background: var(--acc); color: #fff; font: inherit; font-weight: 700; padding: 0 16px; display: flex; align-items: center; gap: 6px; cursor: pointer; min-height: 50px; }
.scan-btn-inline svg { width: 26px; height: 26px; }
.cat-chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chips button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 30px; padding: 7px 16px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--txt); }
.cat-chips button.active { background: var(--pri); color: #fff; border-color: var(--pri); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.prod { position: relative; background: #fff; border: 2px solid transparent; border-radius: 14px; padding: 12px 10px; font: inherit; text-align: right; cursor: pointer; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sh); color: inherit; min-height: 96px; transition: transform .08s; }
.prod:active { transform: scale(.96); }
.prod b { font-size: .98rem; line-height: 1.3; }
.prod .price { color: var(--pri); font-weight: 700; margin-top: auto; }
.prod small { font-size: .75rem; }
.prod.in { border-color: var(--pri); background: #f0fdfa; }
.prod.out { opacity: .7; }
.badge-q { position: absolute; top: -6px; left: -6px; background: var(--pri); color: #fff; font-weight: 700; font-size: .8rem; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.2); }

.cart-title { margin: 4px 0 10px; }
.cart-list { display: flex; flex-direction: column; }
.cart-line { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "info del" "qty tot"; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cl-info { grid-area: info; display: flex; flex-direction: column; min-width: 0; } .cl-info b { font-size: .98rem; }
.cl-qty { grid-area: qty; display: flex; align-items: center; gap: 4px; }
.cl-qty button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font: inherit; font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--txt); }
.cl-qty button.q { width: auto; min-width: 56px; background: #fff; font-size: 1rem; padding: 0 8px; }
.cl-tot { grid-area: tot; text-align: left; font-size: 1.02rem; }
.cl-del { grid-area: del; border: 0; background: none; color: var(--mut); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1rem; justify-self: end; }
.cl-del:hover { background: #fef2f2; color: var(--err); }

.checkout-bar { position: fixed; bottom: 0; left: 0; right: var(--nav); z-index: 18; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.08); display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-bottom: calc(10px + var(--safe-b)); }
.checkout-bar .tot { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.checkout-bar .tot small { color: var(--mut); } .checkout-bar .tot b { font-size: 1.5rem; }
.checkout-bar .btn { min-width: 170px; min-height: 56px; font-size: 1.15rem; }

@media (max-width: 900px) {
  .checkout-bar { right: 0; }
  .pos-tabs { display: flex; position: sticky; top: calc(var(--top) + 66px); z-index: 14; background: #fff; border-bottom: 1px solid var(--line); }
  .pos-tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 700; padding: 12px; color: var(--mut); border-bottom: 3px solid transparent; cursor: pointer; }
  .pos-tabs button.active { color: var(--pri); border-bottom-color: var(--pri); }
  .pill { display: inline-block; background: var(--pri); color: #fff; border-radius: 12px; padding: 0 8px; font-size: .8rem; min-width: 22px; }
  .pos-body { display: block; min-height: 0; }
  .pos-body[data-tab="items"] .pos-cart, .pos-body[data-tab="cart"] .pos-items { display: none; }
  .pos-cart { position: static; height: auto; border: 0; background: transparent; }
  .cart-line { background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; border: 0; box-shadow: var(--sh); }
  .search-box.sticky { top: calc(var(--top) + 66px + 47px); }
  .prod-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
  .cart-title { display: none; }
}
@media (max-width: 380px) { .checkout-bar .btn { min-width: 130px; } .checkout-bar .tot b { font-size: 1.25rem; } .scan-btn-inline span { display: none; } }

.qty-dlg h2 { margin-bottom: 2px; }
.qty-input { display: flex; gap: 8px; margin: 14px 0 10px; }
.qty-input button { width: 60px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 1.6rem; font-weight: 700; cursor: pointer; }
.qty-input input { text-align: center; font-size: 1.8rem; font-weight: 700; min-height: 64px; }
.qty-quick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.qty-quick button { min-width: 52px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.qty-quick button:active { background: var(--pri-l); }
.qty-line { text-align: center; font-weight: 700; font-size: 1.15rem; color: var(--pri); }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sum-row.big b { font-size: 1.4rem; color: var(--pri); }
.done-dlg { text-align: center; }
.done-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 2.6rem; display: grid; place-items: center; margin: 0 auto 10px; animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.3); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.done-dlg .sum-row { text-align: right; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 100px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: #0f172a; color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 600; max-width: calc(100vw - 30px); text-align: center; transition: all .2s; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #065f46; } .toast.err { background: #b91c1c; }

/* ---------- الوصل ---------- */
.receipt { background: #fff; max-width: 380px; margin: 10px auto 16px; padding: 18px; border-radius: 12px; box-shadow: var(--sh); font-size: .9rem; position: relative; }
.r-head { text-align: center; border-bottom: 2px dashed #94a3b8; padding-bottom: 10px; margin-bottom: 10px; display: flex; flex-direction: column; }
.r-head b { font-size: 1.3rem; }
.r-meta div { display: flex; justify-content: space-between; padding: 2px 0; } .r-meta span { color: var(--mut); }
.r-items { margin: 10px 0; font-size: .85rem; } .r-items th, .r-items td { padding: 5px 3px; }
.r-total { display: flex; justify-content: space-between; font-size: 1.25rem; font-weight: 800; border-top: 2px dashed #94a3b8; border-bottom: 2px dashed #94a3b8; padding: 8px 0; margin-bottom: 6px; }
.r-foot { text-align: center; color: var(--mut); margin: 12px 0 0; }
.r-cancel { position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%) rotate(-20deg); font-size: 3rem; font-weight: 900; color: rgba(220,38,38,.35); border: 5px solid rgba(220,38,38,.35); padding: 0 20px; border-radius: 12px; }
.actions-center { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

@media print {
  .topbar, .sidenav, .no-print, .nav-backdrop, .alert { display: none !important; }
  .main { margin: 0; padding: 0; } body { background: #fff; }
  .card, .stat { box-shadow: none; border: 1px solid #ddd; }
  .invoice-page .receipt { box-shadow: none; margin: 0; max-width: 80mm; padding: 2mm; font-size: 11px; }
  @page { margin: 5mm; }
}
