/* خط Cairo جوه البرنامج (مش محتاج نت) — نفس الشكل على ويندوز 7 و 10. الترخيص: fonts/OFL.txt */
@font-face { font-family: 'Cairo'; font-weight: 400; font-display: block; src: url(fonts/cairo-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: block; src: url(fonts/cairo-arabic-600-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: block; src: url(fonts/cairo-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Cairo'; font-weight: 800; font-display: block; src: url(fonts/cairo-arabic-800-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: 'Cairo'; font-weight: 400; font-display: block; src: url(fonts/cairo-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-weight: 600; font-display: block; src: url(fonts/cairo-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-weight: 700; font-display: block; src: url(fonts/cairo-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cairo'; font-weight: 800; font-display: block; src: url(fonts/cairo-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #eef0f2;
  --panel: #ffffff;
  --soft: #f6f7f8;
  --line: #e1e4e8;
  --line-strong: #c9ced4;
  --text: #1b1f24;
  --muted: #66707b;
  --brand: #d32f2f;        /* لون البرنامج (النقطة الحمرا) */
  --accent: #0f7a5c;       /* الدفع والتأكيد */
  --accent-dark: #0b5f47;
  --accent-bg: #e3f4ee;
  --warn: #8a5300;
  --warn-bg: #fdf1dc;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --dark: #1e2329;         /* الشريط اللي فوق */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.22);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 20px; font-size: 14px; }
button { font: inherit; font-weight: 600; padding: 7px 14px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); cursor: pointer; color: var(--text); transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; }
button:hover { border-color: var(--line-strong); background: var(--soft); }
button:active { transform: scale(.97); }
button:focus-visible { outline: 3px solid rgba(15,122,92,.35); outline-offset: 1px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(15,122,92,.3); }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-bg); border-color: #f0c9c6; }
button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; font-weight: 400; }
button.big { padding: 11px 14px; font-size: 17px; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(15,122,92,.2); border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: var(--muted); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 400; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
kbd { font-family: Consolas, monospace; font-size: 11px; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-right: 6px; opacity: .7; font-weight: 400; }
.view { height: 100%; }
h1, h2, h3 { font-weight: 800; }

/* النقطة الحمرا (لحد ما يبقى فيه لوجو) */
.dot { display: inline-block; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 6px rgba(211,47,47,.12); }
.dot.small { width: 14px; height: 14px; align-self: center; box-shadow: 0 0 0 3px rgba(211,47,47,.25); }

/* الدخول */
#view-login { display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #1e2329 0, #2a3139 45%, var(--bg) 45.1%); }
.login-card { width: 390px; background: var(--panel); border-radius: 18px; padding: 30px 30px 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); }
.brand-mark { display: flex; justify-content: center; min-height: 56px; align-items: center; }
.brand-mark img { max-height: 80px; max-width: 220px; }
.login-card h1 { margin: 0; font-size: 26px; text-align: center; letter-spacing: .3px; }
.login-card p { margin: 0 0 6px; text-align: center; }

/* شاشة البيع */
#view-pos { display: grid; grid-template-rows: auto 1fr auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 7px 14px; background: var(--dark); color: #fff; gap: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.topbar .who { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.topbar .who strong { font-size: 16px; }
.topbar .who .muted { color: #aab1ba; }
.top-logo { height: 32px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; }
.topbar .status { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar .status > button:not(.badge) { padding: 4px 12px; background: transparent; color: #e6e8eb; border-color: #3a414a; font-weight: 600; }
.topbar .status > button:not(.badge):hover { background: #2d343c; border-color: #4a525c; }
.topbar #btn-sync { margin-right: 8px; }
.topbar #btn-logout { color: #ffb4ae; }
.badge { padding: 3px 11px; border-radius: 999px; font-size: 13px; border: 0; font-weight: 600; }
.badge.ok { background: var(--accent-bg); color: var(--accent); }
.badge.off { background: var(--danger-bg); color: var(--danger); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.idle { background: #e9ebee; color: var(--muted); }
.topbar .who button.badge { cursor: pointer; }
.update-bar { display: block; width: 100%; border: 0; border-radius: 0; background: #2f7d32; color: #fff; padding: 8px 14px; font-size: 15px; text-align: center; }
.update-bar:hover { background: #1f5f23; }

.pos { display: grid; grid-template-columns: 420px 1fr; min-height: 0; }
.cart { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px; gap: 8px; min-height: 0; position: relative; }
.scan { font-size: 17px; padding: 10px 12px; border-width: 2px; border-color: var(--line-strong); background: var(--soft); }
.scan:focus { background: #fff; }
.search-results { position: absolute; top: 62px; right: 12px; left: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); z-index: 5; max-height: 320px; overflow: auto; box-shadow: var(--shadow-lg); }
.search-results button { display: flex; justify-content: space-between; width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: right; font-weight: 400; }
.customer-btn { text-align: right; background: var(--soft); font-weight: 600; }
.cart-lines { flex: 1; overflow: auto; margin: 0 -4px; padding: 0 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c5cad1; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #a9b0b9; }
::-webkit-scrollbar-track { background: transparent; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 7px 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.line:first-child { border-color: #b9dccf; background: #f7fcfa; }
.line .name { font-weight: 700; font-size: 15px; }
.line .meta { font-size: 13px; color: var(--muted); direction: rtl; }
.line .qty { display: flex; gap: 4px; align-items: center; }
.line .qty button { width: 38px; height: 36px; padding: 0; font-size: 18px; font-weight: 800; border-radius: 9px; background: var(--soft); }
.line .qty input { width: 58px; height: 36px; text-align: center; padding: 4px; font-weight: 800; font-size: 16px; cursor: pointer; border-radius: 9px; }
.line .sum { font-weight: 800; text-align: left; font-size: 17px; }
.line .del { color: var(--danger); border: 0; background: none; padding: 2px 8px; font-size: 13px; align-self: center; }
.line .del:hover { background: var(--danger-bg); }
.empty { color: var(--muted); text-align: center; padding: 48px 10px; }
.totals { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.row { display: flex; justify-content: space-between; gap: 10px; }
.totals .row:not(.grand) { color: var(--muted); font-size: 14px; }
.totals .row:not(.grand) span:last-child { color: var(--text); font-weight: 600; }
.totals .grand { font-size: 28px; font-weight: 800; padding-top: 6px; border-top: 1px dashed var(--line-strong); margin-top: 4px; color: var(--accent); }
.offer-tag { font-size: 12px; color: #2f6b12; background: #e8f3dc; border-radius: 6px; padding: 0 8px; display: inline-block; margin-top: 3px; font-weight: 600; }

.catalog { display: flex; flex-direction: column; padding: 12px; gap: 10px; min-height: 0; }
.categories { display: flex; gap: 6px; flex-wrap: wrap; }
.categories button { border-radius: 999px; padding: 6px 16px; border: 1px solid var(--line); border-bottom: 3px solid var(--cat, var(--line-strong)); font-weight: 700; box-shadow: var(--shadow); }
.categories button.active { background: var(--cat, var(--accent)); color: #fff; border-color: var(--cat, var(--accent)); }
.subcats { padding: 6px; background: #e3e6ea; border-radius: 12px; }
.subcats button { padding: 3px 14px; font-size: 14px; box-shadow: none; }
.products { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding: 2px 2px 8px; }
.product { position: relative; background: var(--panel); border: 1px solid var(--line); border-top: 5px solid var(--cat, var(--line-strong)); border-radius: 14px; padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; min-height: 108px; justify-content: space-between; box-shadow: var(--shadow); }
.product:hover { border-color: var(--cat, var(--line-strong)); background: #fff; box-shadow: 0 4px 14px rgba(16,24,40,.1); }
.product img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.product .pname { font-weight: 700; font-size: 14px; line-height: 1.35; flex: 1; display: flex; align-items: center; }
.product .price { color: var(--text); font-size: 15px; font-weight: 800; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; }

.actions { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr; gap: 8px; padding: 10px 14px; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(16,24,40,.04); }
.actions button { padding: 13px 8px; font-size: 16px; font-weight: 700; }
.actions button.primary { font-size: 20px; font-weight: 800; }
.actions button.danger { border-color: #f0c9c6; }

/* النوافذ */
.modal { position: fixed; inset: 0; background: rgba(15,20,26,.55); display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal-box { background: var(--panel); border-radius: 18px; width: min(880px, 94vw); max-height: 92vh; overflow: auto; padding: 0 22px 20px; box-shadow: var(--shadow-lg); }
.modal-head { position: sticky; top: 0; z-index: 2; background: var(--panel); display: flex; justify-content: space-between; align-items: center; margin: 0 -22px 14px; padding: 14px 22px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-head button { border: 0; font-size: 18px; width: 36px; height: 36px; padding: 0; border-radius: 50%; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.card h3 { margin: 0; font-size: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pay-grand { font-size: 38px; font-weight: 800; text-align: center; margin: 0 0 10px; color: var(--accent); background: var(--accent-bg); border-radius: 14px; padding: 4px 0; }
.pay-layout { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { font-weight: 700; min-width: 76px; }
.pay-methods { display: flex; flex-direction: column; gap: 8px; }
.pay-method { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: center; font-weight: 700; }
.pay-method input { font-size: 19px; font-weight: 800; }
.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th, .list td { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; }
.list th { color: var(--muted); font-weight: 700; background: var(--soft); }
.list tbody tr:hover td { background: #fafbfc; }
.st-synced { color: var(--accent); }
.st-pending { color: var(--warn); }
.st-error { color: var(--danger); }
div.st-error, p.st-error { background: var(--danger-bg); border: 1px solid #f3cdc9; border-radius: var(--radius); padding: 7px 12px; }
div.st-synced { background: var(--accent-bg); border-radius: var(--radius); padding: 7px 12px; font-weight: 700; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: #23282e; color: #fff; padding: 10px 20px; border-radius: 12px; z-index: 30; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 80vw; }
.toast.err { background: var(--danger); }
.logo-preview { max-height: 70px; max-width: 200px; }
.cat-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.mapping { display: grid; grid-template-columns: 1fr 120px; gap: 6px; align-items: center; }
.days { display: flex; gap: 10px; flex-wrap: wrap; }
.offer-items { display: flex; flex-wrap: wrap; gap: 6px; }
.offer-items span { background: #eceef1; border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.offer-items button { border: 0; background: none; color: var(--danger); padding: 0 4px; }
.shift-table input { width: 120px; }
.report-pre { white-space: pre-wrap; font-family: inherit; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; max-height: 50vh; overflow: auto; }

/* لوحة الأرقام */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.numpad button { padding: 12px 0; font-size: 22px; font-weight: 800; background: var(--soft); border-radius: 12px; }
.numpad button:hover { background: #eceef1; }
.numpad button.wide { grid-column: span 2; font-size: 18px; }
.numpad button.np-ok { background: var(--accent); color: #fff; border-color: var(--accent); }
.numpad button.np-del { color: var(--danger); }

/* تأكيد الفاتورة الكبير */
.success { position: fixed; inset: 0; background: rgba(12,98,74,.95); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 40; gap: 10px; cursor: pointer; }
.success .check { width: 150px; height: 150px; border-radius: 50%; background: #fff; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 96px; font-weight: 900; line-height: 1; box-shadow: 0 0 0 14px rgba(255,255,255,.15); }
.success .title { font-size: 32px; font-weight: 800; }
.success .ref { font-size: 18px; opacity: .9; }
.success .change { margin-top: 10px; background: #fff; color: var(--text); border-radius: 18px; padding: 12px 44px; text-align: center; box-shadow: var(--shadow-lg); }
.success .change .lbl { font-size: 18px; color: var(--muted); font-weight: 700; }
.success .change .amt { font-size: 60px; font-weight: 800; color: var(--brand); line-height: 1.2; }
.success .hint { font-size: 14px; opacity: .8; margin-top: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .success .check { animation: pop .35s ease-out; }
  .modal-box { animation: rise .16s ease-out; }
  @keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ربط Dropbox */
details.adv { margin-top: 4px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.cloud-code { border: 2px dashed var(--accent); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.cloud-code .code { font-size: 34px; font-weight: 900; letter-spacing: 6px; text-align: center; font-family: Consolas, monospace; background: #f3f7f5; border-radius: 8px; padding: 6px 0; }
.cloud-code input { font-family: Consolas, monospace; font-size: 15px; }

/* لوحة الأجهزة */
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.dev-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; border-top: 5px solid #bbb; box-shadow: var(--shadow); }
.dev-card.on { border-top-color: #1f9d55; } .dev-card.late { border-top-color: #e0a800; } .dev-card.off { border-top-color: #d32f2f; }
.dev-card .head { display: flex; align-items: center; gap: 8px; }
.dev-card .head img { height: 30px; max-width: 70px; object-fit: contain; }
.dev-card .head b { font-size: 16px; flex: 1; }
.dev-card .no { background: var(--dark); color: #fff; border-radius: 6px; padding: 0 8px; font-size: 13px; font-weight: 700; }
.dev-card .seen { font-size: 12px; color: var(--muted); }
.dev-card .kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.dev-card .kv span { color: var(--muted); }
.dev-card .stat { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.dev-card .stat span { background: var(--soft); border-radius: 6px; padding: 1px 8px; }
.dev-card .stat .bad { background: #fde8e8; color: #b71c1c; }
.dev-card .pend { font-size: 12px; color: #8a6d00; background: #fff7d6; border-radius: 6px; padding: 3px 7px; }
/* نقطة الحالة (لوحة الأجهزة) — اسم مختلف عن .dot بتاعة اللوجو */
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #bbb; }
.sdot.on { background: #1f9d55; } .sdot.late { background: #e0a800; } .sdot.off { background: #d32f2f; }

/* ---------- برنامج الزيارات ---------- */
:root { --gold: #b7791f; --gold-bg: #fff6e5; --gold-line: #f0d39a; --violet: #5b3fd1; --violet-bg: #f1edff; }
.loyalty-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: linear-gradient(135deg, #fff 0%, var(--violet-bg) 100%); display: flex; flex-direction: column; gap: 6px; }
.loyalty-card.empty-card { padding: 0; background: none; border-style: dashed; border-color: var(--line-strong); }
.ly-add { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: right; padding: 8px 12px; border-radius: 14px; }
.ly-add:hover { background: var(--violet-bg); }
.ly-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--violet); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.ly-txt { display: flex; flex-direction: column; line-height: 1.3; }
.ly-txt small { color: var(--muted); font-weight: 400; }
.ly-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ly-phone { direction: ltr; unicode-bidi: isolate; font-size: 13px; }
.ly-x { border: 0; background: none; color: var(--muted); padding: 2px 6px; }
.ly-dots { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ly-dots i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c8bdf3; background: #fff; display: inline-block; transition: background .2s; }
.ly-dots i.on { background: var(--violet); border-color: var(--violet); box-shadow: inset 0 0 0 3px #fff; }
.ly-count { margin-inline-start: auto; font-weight: 800; color: var(--violet); }
.ly-msg small { color: var(--muted); }
.ly-gift { font-weight: 800; color: var(--gold); }
.loyalty-card.eligible { background: linear-gradient(135deg, #fff 0%, var(--gold-bg) 100%); border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(183,121,31,.12); }
.loyalty-card.eligible .ly-dots i.on { background: var(--gold); border-color: var(--gold); }
.loyalty-card.eligible .ly-count { color: var(--gold); }
.loyalty-card button.ly-on { background: var(--gold-bg); border-color: var(--gold); color: #7a4d0b; }
.loyalty-card button.primary, .loyalty-card button.ly-on { width: 100%; }
.ly-warn { font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 3px 8px; }
.offer-tag.ly-tag { color: #7a4d0b; background: var(--gold-bg); }
.ly-phone-input { font-size: 24px !important; text-align: center; letter-spacing: 1px; }
.ly-found { min-height: 26px; font-size: 15px; }
.ly-new { color: var(--violet); font-weight: 700; }
.ly-success { background: rgba(255,255,255,.14); border-radius: 14px; padding: 8px 22px; font-size: 22px; font-weight: 800; display: flex; flex-direction: column; align-items: center; letter-spacing: 3px; }
.ly-success small { font-size: 15px; letter-spacing: 0; opacity: .9; font-weight: 600; }
.ly-summary { background: var(--violet-bg); color: #3b2a8a; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-weight: 600; }
.ly-stamps { color: var(--violet); letter-spacing: 2px; white-space: nowrap; }
.picker { display: flex; flex-direction: column; gap: 6px; }
#btn-loyalty.on { box-shadow: inset 0 -3px 0 #8b74ff; }
.tabs { display: flex; gap: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 0; background: none; }
.tabs button.active { background: #fff; box-shadow: var(--shadow); color: var(--violet); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.stats span { color: var(--muted); font-size: 13px; }
.stats strong { font-size: 24px; }
.ly-summary + .card, .card + .card { margin-top: 10px; }

/* ---------- أزرار الدفع ---------- */
.actions { grid-template-columns: 2.6fr 1fr 1fr 1fr 1fr 1fr; }
.quick-pay { display: flex; gap: 8px; min-width: 0; }
.quick-pay button { flex: 1; min-width: 0; padding: 13px 6px; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-pay button.primary { flex: 1.4; font-size: 19px; }
.quick-pay button.qp { background: var(--accent-bg); border-color: #b9e1d3; color: var(--accent-dark); }
.quick-pay button.qp:hover { background: #d3ede3; }
.pay-method .pm-name { min-width: 120px; text-align: right; background: var(--soft); }
.pay-method .pm-name:hover { background: var(--accent-bg); border-color: var(--accent); }

/* ---------- لوحة الإدارة ---------- */
#view-admin { display: grid; grid-template-rows: auto 1fr; }
.adm-role { background: #3a2f7a; color: #e6e0ff; border: 0; }
.adm-sync { color: #aab1ba; font-size: 13px; margin-left: 6px; }
.admin { display: grid; grid-template-columns: 200px 1fr; min-height: 0; }
.adm-nav { background: var(--panel); border-left: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.adm-nav button { display: flex; align-items: center; gap: 10px; text-align: right; border: 0; background: none; padding: 10px 12px; font-size: 15px; border-radius: 10px; color: var(--text); }
.adm-nav button span { width: 22px; text-align: center; opacity: .75; }
.adm-nav button:hover { background: var(--soft); }
.adm-nav button.active { background: var(--accent-bg); color: var(--accent-dark); }
.adm-nav button[data-tab="cashiers"] { margin-top: 12px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: 14px; }
.adm-main { overflow: auto; padding: 16px 20px 30px; }
.adm-head { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.adm-day { flex-direction: row; align-items: center; gap: 8px; }
.adm-day input { width: auto; }
.kpis { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-weight: 600; font-size: 14px; }
.kpi strong { font-size: 28px; font-weight: 800; line-height: 1.3; }
.kpi small { color: var(--muted); }
.kpi.main { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); color: #fff; border: 0; }
.kpi.main span, .kpi.main small { color: rgba(255,255,255,.8); }
.kpi.main strong { font-size: 34px; }
.adm-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 90px 70px; align-items: center; gap: 10px; }
.bar { background: var(--soft); border-radius: 999px; height: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 600; }
.pill.on { background: var(--accent-bg); color: var(--accent-dark); }
.pill.ly { background: #f1edff; color: #5b3fd1; }
.adm-filters { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.adm-filters select { width: 220px; }
.adm-filters input { flex: 1; }
td.items { max-width: 280px; font-size: 13px; color: var(--muted); }

.pill.extras { background: var(--warn-bg); color: var(--warn); }
.extras-row td { background: var(--warn-bg); }

/* المرتجعات */
.nav-count { margin-inline-start: auto; background: var(--danger); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; line-height: 20px; }
.ret-lines input { width: 90px; }
.ret-total { font-size: 20px; margin: 10px 0; }
.ret-warn { background: var(--danger-bg); border: 1px solid #f3cdc9; border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; }
.ret-actions { display: flex; gap: 6px; }
.ret-actions button { padding: 6px 12px; }
.pill.ret-pending { background: #fff4e0; color: #8a5a00; }
.pill.ret-approved { background: var(--accent-bg); color: var(--accent-dark); }
.pill.ret-rejected { background: var(--danger-bg); color: var(--danger); }

/* السحب للتمرير: التمرير بنتحكم فيه من البرنامج (شاشات تاتش بتبعت اللمس كماوس) */
.products, .cart-lines { touch-action: none; overscroll-behavior: contain; }
.products.dragging, .cart-lines.dragging { cursor: grabbing; user-select: none; }
.products.dragging * , .cart-lines.dragging * { pointer-events: none; }
