/* ===== الخط: Cairo محفوظ داخل النظام (رخصة OFL) ===== */
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/cairo-400.woff') format('woff'); }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/cairo-600.woff') format('woff'); }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/cairo-700.woff') format('woff'); }
@font-face { font-family: 'Cairo'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/cairo-800.woff') format('woff'); }

/* ===== الألوان والمقاسات (التصميم المعتمد) ===== */
:root {
  --bg: #F4F6F3;
  --surface: #FFFFFF;
  --line: #E6E9E4;
  --line-strong: #D0D5DD;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --accent: #16A34A;
  --accent-text: #15803D;
  --accent-soft: #EAF7EE;
  --danger: #B42318;
  --danger-soft: #FDECEC;
  --warn: #B54708;
  --warn-soft: #FEF0C7;
  --radius: 14px;
  --font: 'Cairo', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --pop: 0 12px 32px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }
kbd { font-family: inherit; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 2px 7px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h1, h2 { margin: 0; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }

/* ===== أزرار وحقول ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; background: var(--surface); transition: transform .08s, background-color .12s; }
.btn:active { transform: scale(.98); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { border-color: var(--line); background: var(--surface); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-danger-outline { border-color: #F7D4D4; color: var(--danger); background: var(--surface); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.icon-btn-lg { width: 48px; height: 48px; border-radius: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; flex: 1; }
.field > span, .field > legend { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0; }
.field input, .field select, .input { height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px; background: var(--surface); width: 100%; }
.field-row { display: flex; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.form-error { color: var(--danger); font-weight: 700; font-size: 13px; min-height: 18px; margin: 0 0 8px; }
.hint { background: var(--accent-soft); color: var(--accent-text); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.warn { color: var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; font-weight: 700; margin: 2px 0; }
.note { margin: 0 20px 10px; padding: 8px 12px; border-radius: 10px; background: var(--bg); color: var(--ink-2); font-weight: 700; }
.note.is-warn { background: var(--warn-soft); color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 6px 0 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* مجموعة اختيار */
.seg { display: grid; gap: 4px; background: var(--bg); border-radius: 14px; padding: 4px; }
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg label, .seg button { position: relative; display: flex; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span, .seg button { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 11px; font-weight: 700; color: var(--muted); border: 0; background: transparent; }
.seg input:checked + span, .seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 3px rgba(16, 24, 40, .14); }
.seg input:focus-visible + span { outline: 3px solid #2563EB; }

/* ===== الدخول وتسجيل الجهاز ===== */
.auth { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 6px; }
.auth-card > .muted { margin: 0 0 20px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand b { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.brand-mark { display: block; overflow: visible; }

/* ===== شاشة البيع ===== */
.pos { display: grid; grid-template-columns: 84px minmax(0, 1fr) 232px 404px; height: 100vh; height: 100dvh; overflow: hidden; }

.rail { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-logo { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.rail-btn { width: 68px; min-height: 60px; border-radius: 14px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px; }
.rail-btn.active { background: var(--accent-soft); color: var(--accent-text); }
.rail-btn[hidden] { display: none; }
.rail-ic { position: relative; display: inline-flex; }
.rail-ic .count { position: absolute; top: -7px; left: -10px; }
.shift-dot { position: absolute; top: -3px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #F79009; border: 2px solid var(--surface); }
.shift-dot.on { background: var(--accent); }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar { position: relative; width: 42px; height: 42px; border-radius: 50%; background: #FDE7D4; color: #9A3412; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.avatar-dot { position: absolute; bottom: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); }
.avatar-dot.off { background: #F79009; }

.catalog { min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 18px 12px; overflow: hidden; }
.cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cat-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cat-title > div { min-width: 0; }
.cat-title p { margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-actions { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.net-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; white-space: nowrap; }
.net-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.net-pill.off { background: var(--warn-soft); color: var(--warn); }
.net-pill.off .dot { background: #F79009; }
.net-pill.err { background: var(--danger-soft); color: var(--danger); }
.net-pill.err .dot { background: var(--danger); }

.search-row { display: flex; gap: 10px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.cats { display: flex; gap: 8px; overflow-x: auto; padding: 1px; scrollbar-width: none; flex: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; }
.cat .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #F2F4F0; color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.cat[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat[aria-pressed="true"] .n { background: rgba(255, 255, 255, .24); color: #fff; }

.grid-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 2px 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; align-content: start; }
.item { position: relative; display: flex; flex-direction: column; padding: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; text-align: right; box-shadow: var(--shadow); min-height: 188px; }
.item.in-cart { border-color: var(--accent); }
.item .thumb { position: relative; height: 96px; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 34px; font-weight: 800; }
.item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .tag { position: absolute; top: 7px; right: 7px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.item .qty { position: absolute; top: 7px; left: 7px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.item .body { padding: 10px 6px 4px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item .name { font-weight: 700; line-height: 1.45; }
.item .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.item .price { font-size: 16px; font-weight: 800; }
.item .price small { font-size: 11px; font-weight: 400; color: var(--muted); }
.item .plus { width: 30px; height: 30px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.item.out { opacity: .55; }
.empty { text-align: center; color: var(--muted); padding: 40px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 18px; }

/* لوحة الكاشير */
.pad { display: flex; flex-direction: column; gap: 12px; padding: 18px 0 18px 16px; overflow-y: auto; }
.pad-card { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pad-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.close-pad { display: none; width: 36px; height: 36px; }
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: var(--bg); border-radius: 12px; padding: 3px; }
.mode { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 0; }
.mode[aria-pressed="true"] { background: var(--ink); color: #fff; }
.display { height: 64px; border-radius: 14px; background: var(--bg); padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.display-target { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.display-value { font-size: 26px; font-weight: 800; text-align: left; line-height: 1.1; color: var(--muted); }
.display-value.typing { color: var(--ink); }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key { height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fn-list { display: flex; flex-direction: column; gap: 8px; }
.fn { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: space-between; }
.fn span { display: flex; align-items: center; gap: 8px; }
.fn-danger { color: var(--danger); border-color: #F7D4D4; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.cash-card { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cash-card .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; }
.cash-card .big { font-size: 16px; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 2px; }
.quick button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #F9FAF8; font-weight: 700; }

/* الفاتورة */
.invoice { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inv-head { padding: 18px 20px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inv-head p { margin: 4px 0 0; }
.close-inv { display: none; }
.chip-btn { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px 0 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); max-width: 200px; }
.chip-avatar { width: 34px; height: 34px; border-radius: 50%; background: #F2F4F0; color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.chip-avatar.on { background: var(--accent-soft); color: var(--accent-text); }
.chip-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.chip-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.chip-text small { font-size: 11px; color: var(--muted); }
.order-types { margin: 0 20px; }
.order-info { margin: 8px 22px 0; }
.lines { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 8px; }
.line { display: flex; gap: 10px; padding: 10px; border-radius: 16px; border: 1.5px solid #EEF0EC; background: var(--surface); }
.line.sel { border-color: var(--accent); background: var(--accent-soft); }
.line .lthumb { width: 52px; height: 52px; flex: none; border-radius: 12px; border: 0; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.line .lbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.line .ltop, .line .lbot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.line .lname { border: 0; background: transparent; padding: 0; font-weight: 700; text-align: right; }
.line .ltotal { font-size: 15px; font-weight: 800; white-space: nowrap; }
.line .lsub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper { display: flex; align-items: center; gap: 2px; background: var(--bg); border-radius: 12px; padding: 2px; flex: none; }
.stepper button { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); display: flex; align-items: center; justify-content: center; }
.stepper .q { min-width: 28px; text-align: center; font-size: 15px; font-weight: 800; }
.stepper .del { color: var(--danger); }
.lines-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--muted); min-height: 200px; }
.lines-empty b { color: var(--ink); font-size: 15px; }
.done { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.done b { display: block; font-size: 14px; }
.done span { font-size: 12px; line-height: 1.6; }
.summary { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.summary .row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.summary .total { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line-strong); align-items: baseline; font-size: 15px; font-weight: 800; }
.summary .total b { font-size: 30px; font-weight: 800; }
.summary .total small { font-size: 13px; font-weight: 400; color: var(--muted); }
.pays { padding: 0 20px 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pay { min-height: 58px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; }
.pay[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.inv-foot { padding: 0 20px 20px; display: flex; gap: 8px; }
.pad-toggle { display: none; }
.btn-pay { flex: 1; min-height: 62px; border-radius: 16px; justify-content: space-between; padding: 0 20px; font-size: 18px; }
.btn-pay:disabled { background: #E4E7E2; color: var(--muted); }
.pay-l, .pay-r { display: flex; align-items: center; gap: 10px; }
.btn-pay kbd { background: rgba(255, 255, 255, .2); color: inherit; }
.mobile-bar { display: none; }

/* ===== النوافذ ===== */
.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 22px; padding: 20px; box-shadow: var(--pop); color: var(--ink); }
.modal::backdrop { background: rgba(16, 24, 40, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.camera { position: relative; margin: 12px 0; border-radius: 16px; overflow: hidden; background: #0B1220; aspect-ratio: 4 / 3; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera .aim { position: absolute; inset: 22% 12%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }
.camera-msg { position: absolute; inset: auto 0 12px; margin: 0; text-align: center; color: #fff; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); padding: 0 12px; }
.torch { position: absolute; top: 10px; left: 10px; background: rgba(255, 255, 255, .9); }
.manual { display: flex; gap: 8px; }
.manual input { flex: 1; height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px; }
.price-card { margin: 0 0 12px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); }
.price-card .pc-name { font-weight: 800; font-size: 16px; }
.price-card .pc-price { font-size: 30px; font-weight: 800; margin: 4px 0; }
.price-card .pc-meta { font-size: 13px; color: var(--ink-2); }
.price-card.miss { background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.cust-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.cust { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: right; }
.cust small { display: block; color: var(--muted); font-size: 12px; }
.cust .bal { font-size: 12px; font-weight: 700; color: var(--warn); }
.new-cust summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--accent-text); cursor: pointer; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 12px; font-size: 13px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; font-weight: 700; }
.settings-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.steps { padding-inline-start: 20px; line-height: 2; margin: 0; }
.steps svg { vertical-align: middle; }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: var(--pop); animation: toast-in .18s ease-out; }
.toast.ok { background: var(--accent-text); }
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
#print-frame { position: fixed; width: 0; height: 0; border: 0; visibility: hidden; }

/* ===== الشاشات الإدارية (الأصناف، التقارير، التنبيهات) ===== */
.workspace { display: none; min-width: 0; flex-direction: column; gap: 14px; padding: 18px 20px; overflow: hidden; }
.pos.ws-open .workspace { display: flex; grid-column: 2 / -1; }
.pos.ws-open .catalog, .pos.ws-open .pad, .pos.ws-open .invoice, .pos.ws-open .mobile-bar { display: none !important; }
.ws-head { display: flex; align-items: center; gap: 12px; }
.ws-titles p { margin: 4px 0 0; }
.ws-back { display: none; }
.ws-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ws-tools:empty { display: none; }
.ws-search { flex: 1 1 220px; height: 44px; max-width: 360px; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.ws-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; transition: opacity .15s; }
.ws-body.loading { opacity: .55; pointer-events: none; }
.input-sm { height: 44px; width: auto; min-width: 140px; }
.seg-auto { display: inline-flex; flex-wrap: wrap; }
.seg-auto button { padding: 0 14px; flex: none; }
.seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.date-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ws-strip { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.ws-strip b { color: var(--ink); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 18px; }
.empty-state b { font-size: 16px; }
.empty-state .muted { max-width: 420px; line-height: 1.7; }
.link { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 0; }
.me-auto { margin-inline-end: auto; }
.mt { margin-top: 14px; }
.neg { color: var(--danger); }
.plus-q { color: var(--accent-text); }

/* الجداول */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.panel .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBF9; }
.table td { padding: 10px 14px; border-bottom: 1px solid #EEF0EC; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .ta-r { text-align: right; }
.table tr[data-ws] { cursor: pointer; }
.table tr[data-ws]:hover td, .table tr[data-ws]:focus-visible td { background: var(--accent-soft); }
.table tr.inactive td { opacity: .5; }
.table-sm td, .table-sm th { padding: 8px 10px; }
.panel .table th { background: transparent; padding-inline: 6px; }
.panel .table td { padding-inline: 6px; }
.pcell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.block { display: block; }
.pcell small { display: block; color: var(--muted); font-size: 11px; text-align: right; }
.pthumb { width: 36px; height: 36px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-inline-end: 6px; vertical-align: middle; }
.cat-dot.big { width: 16px; height: 16px; border-radius: 5px; margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: #F2F4F0; color: var(--ink-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.is-ok { background: var(--accent-soft); color: var(--accent-text); }
.badge.is-warn { background: var(--warn-soft); color: var(--warn); }
.badge.is-bad { background: var(--danger-soft); color: var(--danger); }

/* بطاقات الأرقام */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.modal .tile { background: var(--bg); border-color: transparent; }
.tile span { font-size: 12px; font-weight: 700; color: var(--muted); }
.tile b { font-size: 22px; font-weight: 800; line-height: 1.2; }
.tile small { font-size: 12px; color: var(--muted); }
.tile-accent { background: var(--accent-soft) !important; }
.tile-accent b { color: var(--accent-text); }
.tile-warn { background: var(--warn-soft) !important; }
.kpis { display: grid; grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)); gap: 10px; }
.kpis .tile { margin: 0; }
.tile.hero b { font-size: 34px; }
.tile.hero b small { font-size: 14px; color: var(--muted); font-weight: 400; }
.delta { font-weight: 700; }
.delta.up { color: var(--accent-text); }
.delta.down { color: var(--danger); }
.note-line { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.warn-line { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 700; }

/* لوحات التقرير والرسوم: لون واحد لكل رسم، والأرقام بلون النص */
.ws-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 15px; font-weight: 800; }
.span-2 { grid-column: span 2; }
.cchart { position: relative; height: 220px; padding: 4px 0 26px; }
.cc-grid { position: absolute; inset: 4px 0 26px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.cc-tick { border-top: 1px solid #EEF0EC; height: 0; position: relative; }
.cc-tick span { position: absolute; top: -9px; left: 0; font-size: 11px; color: var(--muted); background: var(--surface); padding-inline-end: 6px; font-variant-numeric: tabular-nums; }
.cc-bars { position: absolute; inset: 4px 0 0 36px; display: flex; align-items: stretch; gap: 2px; direction: ltr; }
.cc-col { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 26px; outline-offset: -2px; border-radius: 6px; cursor: default; }
.cc-col:hover, .cc-col:focus-visible { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cc-bar { width: 100%; max-width: 24px; min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.cc-col:hover .cc-bar, .cc-col:focus-visible .cc-bar { background: var(--accent-text); }
.cc-label { position: absolute; bottom: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.cc-peak { font-size: 11px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; white-space: nowrap; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; align-items: center; gap: 10px; border-radius: 8px; padding: 2px 4px; }
.hbars li:hover, .hbars li:focus-visible { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.hb-label { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { height: 14px; display: flex; }
.hb-bar { height: 100%; background: var(--accent); border-radius: 4px 0 0 4px; }
.hb-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: left; }
.table-toggle { margin-top: 8px; font-size: 13px; }
.table-toggle summary { cursor: pointer; color: var(--muted); font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.chart-tip { position: fixed; z-index: 60; transform: translate(-50%, -100%); background: var(--ink); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; white-space: nowrap; box-shadow: var(--pop); }
.chart-tip b { font-size: 13px; }
.chart-tip span { opacity: .8; }

/* التنبيهات */
.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.alert.unread { border-color: color-mix(in srgb, var(--accent) 35%, white); box-shadow: inset -3px 0 0 var(--accent); }
.alert .al-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.alert .al-body > span { font-size: 13px; color: var(--ink-2); }
.sev { width: 32px; height: 32px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: #EEF2F6; color: #475467; }
.sev.is-warn { background: var(--warn-soft); color: var(--warn); }
.sev.is-bad { background: var(--danger-soft); color: var(--danger); }
.sev-label { font-weight: 700; }
.sev-label.is-warn { color: var(--warn); }
.sev-label.is-bad { color: var(--danger); }

/* نوافذ الأصناف */
.modal-wide { width: min(680px, calc(100vw - 24px)); }
.code-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.code-chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px 0 10px; height: 32px; border-radius: 999px; background: #F2F4F0; font-size: 13px; font-weight: 700; }
.code-chip.primary { background: var(--accent-soft); color: var(--accent-text); }
.code-chip button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; font-size: 16px; color: inherit; }
.pm-margin { margin: -6px 0 12px; font-weight: 700; color: var(--accent-text); min-height: 18px; }
.pm-margin.neg { color: var(--danger); }
.toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-bottom: 8px; }
.stock-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--bg); border-radius: 14px; padding: 12px 14px; margin: 6px 0 10px; }
.stock-box > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.stock-box b { font-size: 22px; font-weight: 800; }
.stock-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.moves-box summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; color: var(--ink-2); }
.moves { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.moves li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid #EEF0EC; font-size: 13px; }
.moves li:last-child { border-bottom: 0; }
.moves .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-cash_out, .mv-drawer_open { color: var(--warn); font-weight: 700; }
.mv-cash_in { color: var(--accent-text); font-weight: 700; }
h3.sub { font-size: 14px; font-weight: 800; margin: 14px 0 8px; }
.cat-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid #EEF0EC; }
.cat-row .grow { flex: 1; display: flex; flex-direction: column; }
.cat-row small { font-size: 12px; }
.danger { color: var(--danger) !important; }
.cat-form { border-top: 1px solid var(--line); padding-top: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; }
.swatch span { display: block; width: 36px; height: 36px; border-radius: 10px; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid #2563EB; outline-offset: 2px; }
.errors-box { background: var(--warn-soft); border-radius: 12px; padding: 8px 14px; font-size: 13px; color: var(--warn); }
.errors-box summary { font-weight: 800; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.errors-box ul { margin: 4px 0; padding-inline-start: 18px; max-height: 180px; overflow-y: auto; line-height: 1.8; }
#import-result .table-wrap { margin-bottom: 10px; }
.file-drop { position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; margin-bottom: 14px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: #FAFBF9; color: var(--muted); cursor: pointer; }
.file-drop:hover { border-color: var(--accent); }
.file-drop:focus-within { outline: 3px solid #2563EB; outline-offset: 2px; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fd-text { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-text.chosen { color: var(--ink); }

/* الوردية والمرتجع */
.chips { display: flex; gap: 6px; margin: -6px 0 14px; flex-wrap: wrap; }
.chip { min-height: 40px; min-width: 56px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; }
.shift-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.notes-grid label { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 12px; padding: 4px; }
.bill { flex: none; min-width: 44px; height: 38px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.notes-grid input { width: 100%; min-width: 0; height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 8px; background: var(--surface); }
.input-big { font-size: 22px !important; font-weight: 800; height: 54px !important; }
.z-result { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 14px; }
.z-result span { font-weight: 700; }
.z-result b { font-size: 34px; font-weight: 800; }
.z-result b small { font-size: 14px; font-weight: 400; }
.z-result.is-warn { background: var(--warn-soft); color: var(--warn); }
.z-result.is-bad { background: var(--danger-soft); color: var(--danger); }
.sale-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.sale-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: right; }
.sale-row small { display: block; color: var(--muted); font-size: 12px; }
.sale-row .amt { font-weight: 800; display: flex; flex-direction: column; align-items: flex-end; }
.sale-row .amt small { color: var(--warn); font-weight: 700; }
.ret-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; max-height: 320px; overflow-y: auto; }
.ret-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid #EEF0EC; }
.ret-line.off { opacity: .55; }
.rl-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rl-info small { color: var(--muted); font-size: 12px; }
.rl-info .check { min-height: 32px; font-size: 12px; }
.ret-line .stepper button { font-size: 20px; font-weight: 700; }
.ret-line .stepper button:disabled { opacity: .35; }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.menu-item { min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.only-sm { display: none !important; }

/* الزبائن والديون */
.cust-row { display: flex; align-items: center; gap: 6px; }
.cust-row .cust { flex: 1; min-width: 0; }
.cust-head { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-bottom: 8px; }
.cust-bal { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); }
.cust-bal.owes { background: var(--warn-soft); color: var(--warn); }
.cust-bal span { font-weight: 700; font-size: 13px; }
.cust-bal b { font-size: 30px; font-weight: 800; line-height: 1.2; }
.cust-bal b small { font-size: 14px; font-weight: 400; }
.cust-bal > small { color: var(--ink-2); font-size: 12px; }
.cust-actions { flex: 1 1 260px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.cust-actions .btn { flex: 1 1 auto; }
.sub-form { background: var(--bg); border-radius: 14px; padding: 12px 14px 4px; margin: 6px 0 4px; }
.cust-tx { max-height: 340px; overflow-y: auto; }
.moves.stmt li { grid-template-columns: auto 1fr auto 64px; }
.stmt-bal { color: var(--muted); text-align: left; font-variant-numeric: tabular-nums; }
.big-num { font-size: 32px; font-weight: 800; }
.big-num small { font-size: 14px; font-weight: 400; color: var(--muted); }
.modal-actions.wrap { flex-wrap: wrap; }
.field .hint { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); font-weight: 400; background: none; padding: 0; border-radius: 0; }
.mv-debt_payment { color: var(--accent-text); font-weight: 700; }
.mv-expense { color: var(--warn); font-weight: 700; }

/* المشتريات */
.modal-xl { width: min(980px, calc(100vw - 24px)); }
.pu-search-wrap { position: relative; margin-bottom: 10px; }
.pu-results { position: absolute; inset-inline: 0; top: 100%; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.pu-results[hidden] { display: none; }
.pu-res { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; text-align: right; }
.pu-res:hover, .pu-res:focus-visible { background: var(--accent-soft); }
.pu-res small { display: block; }
.pu-table { margin-bottom: 12px; max-height: 320px; overflow-y: auto; }
.cell-in { width: 100%; min-width: 64px; height: 40px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 8px; background: var(--surface); font: inherit; }
.cell-in:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.pu-foot { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.pu-sum { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.pu-sum > div, .pu-sum > label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.pu-sum input { width: 120px; height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 8px; background: var(--surface); font: inherit; }
.pu-sum .grand { border-top: 1px solid var(--line-strong); padding-top: 8px; font-size: 16px; }
.pu-sum .grand b { font-size: 20px; font-weight: 800; }

/* الإعدادات */
.panel h4 { margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: var(--muted); }
.theme-list { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px 4px 6px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; }
.theme-opt .sw { width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 5px var(--s); }
.theme-opt[aria-checked="true"] { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
.dv-mode { max-width: 520px; }
.dv-preview { margin-top: 10px; background: var(--bg); border-radius: 12px; padding: 12px; display: flex; justify-content: center; }
.dv-preview canvas { width: 288px; height: auto; background: #fff; box-shadow: var(--pop); }

/* قفل الشاشة وتبديل المستخدم */
button.avatar { border: 0; padding: 0; cursor: pointer; font: inherit; }
body.locked { overflow: hidden; }
.lock-screen { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft) 0%, var(--bg) 60%); overflow-y: auto; }
.lock-screen[hidden] { display: none; }
.lock-card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lock-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.lock-head h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; }
.lock-head p { margin: 0; }
.lock-logo { width: 56px; height: 56px; border-radius: 18px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 25%, transparent); }
.lock-users { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lock-user { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 14px 6px 8px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; }
.lock-user small { color: var(--muted); font-weight: 400; }
.lock-user[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.lu-av { width: 36px; height: 36px; border-radius: 50%; background: #FDE7D6; color: #B54708; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.lock-pad { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.lock-pad[hidden] { display: none; }
.lock-pad.busy { opacity: .6; pointer-events: none; }
.lock-dots { display: flex; gap: 12px; direction: ltr; min-height: 18px; }
.lock-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); }
.lock-dots span.opt { border-style: dashed; opacity: .6; }
.lock-dots span.on { background: var(--ink); border-color: var(--ink); opacity: 1; }
.lock-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.lock-pad .form-error { min-height: 20px; margin: 0; }
.lock-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; direction: ltr; }
.lock-keys button { height: 64px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-size: 24px; font-weight: 700; box-shadow: 0 1px 0 rgba(16,24,40,.04); }
.lock-keys button:active { transform: scale(.96); background: var(--bg); }
.lock-keys .ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.lock-pass { font-size: 13px; color: var(--muted); }

@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis .hero { grid-column: span 3; }
  .workspace { padding: 14px 16px; }
}

/* ===== تابلت: الأصناف والفاتورة، ولوحة الأرقام نافذة ===== */
@media (max-width: 1279px) {
  .pos { grid-template-columns: 72px minmax(0, 1fr) 360px; }
  .rail-btn { width: 60px; }
  .pad { display: none; position: fixed; inset: auto auto 16px 16px; width: 300px; max-height: calc(100dvh - 32px); z-index: 30; background: var(--bg); padding: 12px; border-radius: 20px; box-shadow: var(--pop); }
  .pos.pad-open .pad { display: flex; }
  .close-pad { display: inline-flex; }
  .pad-toggle { display: inline-flex; }
  .pays { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 16px 10px; }
  .inv-head, .summary { padding-left: 16px; padding-right: 16px; }
  .inv-foot { padding: 0 16px 16px; }
  .btn-pay { padding: 0 14px; font-size: 16px; }
}

/* ===== جوال: الأصناف بعرض الشاشة والفاتورة شريط سفلي ===== */
@media (max-width: 767px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .rail, .hide-sm { display: none; }
  .menu-btn { display: inline-flex; }
  .catalog { padding: 12px 12px 84px; gap: 10px; }
  h1 { font-size: 18px; }
  .net-pill .label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item { min-height: 170px; }
  .item .thumb { height: 80px; }
  .invoice { display: none; position: fixed; inset: 0; z-index: 20; border: 0; }
  .pos.inv-open .invoice { display: flex; }
  .close-inv { display: inline-flex; }
  .pad { inset: auto 8px 8px 8px; width: auto; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; position: fixed; inset: auto 12px 12px 12px; min-height: 60px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; z-index: 10; box-shadow: var(--pop); }
  .mobile-bar b { margin-inline-start: auto; font-size: 17px; }
  .mb-count { min-width: 28px; height: 28px; border-radius: 14px; background: rgba(255, 255, 255, .25); display: flex; align-items: center; justify-content: center; }
  .field-row { flex-direction: column; gap: 0; }
  .chip-btn { max-width: 160px; }
  .menu-item.only-sm { display: flex !important; }
  .pu-foot { grid-template-columns: minmax(0, 1fr); }
  .pos.ws-open .workspace { grid-column: 1; padding: 12px; }
  .ws-back { display: inline-flex; }
  .ws-actions { margin-inline-start: 0; width: 100%; }
  .ws-actions .btn { flex: 1; }
  .ws-search { max-width: none; flex-basis: 100%; }
  .input-sm { flex: 1; min-width: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .hero { grid-column: span 2; }
  .ws-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .tile b { font-size: 19px; }
  .tile.hero b { font-size: 28px; }
  .toggles { grid-template-columns: minmax(0, 1fr); }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shift-actions { grid-template-columns: minmax(0, 1fr); }
  .seg-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .products-table th:nth-child(2), .products-table td:nth-child(2), .products-table th:nth-child(4), .products-table td:nth-child(4) { display: none; }
  .modal { padding: 16px; }
  /* على الجوال تظهر الرسائل أعلى الشاشة حتى لا تغطي أزرار الدفع */
  .toast-wrap { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
}

/* ===== حول النظام ===== */
.about { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.about b { color: var(--ink, inherit); }
.about a { color: var(--accent-text); font-weight: 700; text-decoration: none; }
.about-logo { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* ===== الاشتراك ===== */
.auth-alt { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.auth-alt a { color: var(--accent-text); font-weight: 700; text-decoration: none; }
.login-support { margin-bottom: 10px; }
.sub-pill { border: 0; border-radius: 999px; min-height: 36px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sub-pill[hidden] { display: none; }
.sub-pill.sp-info { background: var(--accent-soft); color: var(--accent-text); }
.sub-pill.sp-warn { background: #FEF0C7; color: #93370D; }
.sub-pill.sp-bad { background: #FEE4E2; color: #B42318; }
.plan-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.plan-list:empty { display: none; }
.plan-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card .price { font-size: 18px; font-weight: 800; }
.plan-card .price small { font-size: 12px; color: var(--muted); font-weight: 600; }
body.blocked { overflow: hidden; }
.blocked-screen { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft) 0%, var(--bg) 60%); overflow-y: auto; }
.blocked-screen[hidden] { display: none; }
.blocked-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.blocked-card h2 { margin: 4px 0 0; font-size: 22px; font-weight: 800; }
.blocked-card p { margin: 0; line-height: 1.7; }
.blocked-card .btn { margin-top: 2px; }
#sub-pill { margin-inline-start: auto; }
.empty.onboard { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); }
.empty.onboard[hidden] { display: none; }
.empty.onboard b { font-size: 18px; color: var(--ink); }
a.btn { text-decoration: none; }
@media (max-width: 767px) {
  .cat-head { flex-wrap: wrap; }
  .cat-title { flex: 1 1 0; min-width: 0; }
  .cat-title p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #sub-pill { order: 5; flex-basis: 100%; min-height: 34px; font-size: 12px; }
}

/* ===== صفحة التسجيل ===== */
.signup-page { background: radial-gradient(1200px 700px at 80% -10%, var(--accent-soft) 0%, var(--bg) 55%); min-height: 100dvh; }
.signup { max-width: 1040px; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 16px 40px; display: grid; grid-template-columns: 1fr 420px; gap: 28px 40px; align-items: start; }
.signup-hero { padding-top: 24px; }
.signup-hero h1 { font-size: clamp(28px, 4.2vw, 44px); font-weight: 800; line-height: 1.25; margin: 18px 0 10px; }
.signup-hero .lead { font-size: 17px; color: var(--ink-2); line-height: 1.8; margin: 0 0 18px; max-width: 520px; }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.perks li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.perks li::before { content: ''; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat; }
.signup-card { max-width: none; }
.signup-card h2 { margin: 0 0 14px; font-size: 22px; }
.signup-plans { grid-column: 1 / -1; }
.signup-plans h2 { font-size: 20px; margin: 8px 0 4px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-left: 70px; }
.pw-toggle { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--accent-text); font: inherit; font-size: 13px; font-weight: 700; padding: 6px 8px; cursor: pointer; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 860px) {
  .signup { grid-template-columns: 1fr; gap: 20px; }
  .signup-hero { padding-top: 4px; }
  .signup-hero h1 { margin-top: 14px; }
}
