﻿:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e5ee;
  --text: #1c1f2e;
  --muted: #6b7088;
  --primary: #7c3aed;
  --primary-2: #6d28d9;
  --primary-soft: #efe8fe;
  --accent: #0891b2;
  --success: #059669;
  --success-soft: #e3f7ef;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --warning: #d97706;
  --warning-soft: #fdf3e2;
  --info-soft: #e3f4f8;
  --side-bg: #15122b;
  --side-text: #c9c5e4;
  --side-active: #2a2350;
  --shadow: 0 1px 2px rgba(20, 20, 50, .05), 0 2px 8px rgba(20, 20, 50, .05);
  --radius: 10px;
  --font: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e1a; --surface: #1a1828; --surface-2: #211f33; --border: #2f2c45; --text: #ebeaf5; --muted: #9a97b5;
    --primary: #8b5cf6; --primary-2: #7c3aed; --primary-soft: #2a2350; --accent: #22b8d6;
    --success: #34d399; --success-soft: #11302a; --danger: #f87171; --danger-soft: #3a1a1f; --warning: #fbbf24; --warning-soft: #3a2e14; --info-soft: #123040;
    --side-bg: #0b0a14; --side-active: #241f45; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e1a; --surface: #1a1828; --surface-2: #211f33; --border: #2f2c45; --text: #ebeaf5; --muted: #9a97b5;
  --primary: #8b5cf6; --primary-2: #7c3aed; --primary-soft: #2a2350; --accent: #22b8d6;
  --success: #34d399; --success-soft: #11302a; --danger: #f87171; --danger-soft: #3a1a1f; --warning: #fbbf24; --warning-soft: #3a2e14; --info-soft: #123040;
  --side-bg: #0b0a14; --side-active: #241f45; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
.boot { display: grid; place-items: center; height: calc(100vh / var(--z, 1)); color: var(--muted); }
.num, .money { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ===== layout ===== */
.layout { display: grid; grid-template-columns: 232px 1fr; height: calc(100vh / var(--z, 1)); }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; color: #fff; }
.brand img { width: 38px; height: 38px; }
.brand b { font-size: 17px; display: block; }
.brand small { color: #8f8ab3; font-size: 11px; }
.nav { padding: 6px 10px 16px; flex: 1; }
.nav-group { font-size: 11px; color: #7a75a0; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; font-size: 14px; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-key { font: 600 10px/1 system-ui, sans-serif; padding: 2px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .65; direction: ltr; }
.nav a .nav-key { margin-inline-start: auto; }
.nav a .nav-key + .badge { margin-inline-start: 6px; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset -3px 0 0 #8b5cf6; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .badge { margin-inline-start: auto; }
.side-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; }
.side-foot .who { color: #fff; font-weight: 600; }
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: var(--surface); border-bottom: 1px solid var(--border); min-height: 56px; }
.topbar h1 { font-size: 18px; }
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.content { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }

/* ===== components ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-size: 15px; }
.card-body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.stat { padding: 16px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--primary)); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 7px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: #c9cbe0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-2); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.lg { padding: 12px 20px; font-size: 16px; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { padding: 6px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--info-soft); color: var(--accent); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.nav .badge { background: #dc2626; color: #fff; font-size: 11px; padding: 0 7px; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }
textarea { min-height: 70px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters input[type="search"] { min-width: 220px; }
input.inline { padding: 3px 6px; width: 80px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 9px 12px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t tr.clickable { cursor: pointer; }
table.t td.wrap { white-space: normal; }
table.t tfoot td { font-weight: 700; background: var(--surface-2); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a { text-decoration: none; display: inline-block; }
.tabs button, .tabs a { background: none; border: none; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active, .tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(10, 8, 25, .55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .15s ease-out; }
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1100px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { flex: 1; font-size: 16px; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* toasts */
#toasts { position: fixed; bottom: 20px; left: 20px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.toast { white-space: pre-line; background: #1c1f2e; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 380px; animation: pop .15s; }
.toast.error { background: var(--danger); }
.toast.success { background: #047857; }
.toast.warn { background: #b45309; }

/* autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; top: 100%; inset-inline: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-top: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 50; max-height: 320px; overflow-y: auto; }
.ac-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.ac-item:last-child { border-bottom: none; }
.ac-item.active, .ac-item:hover { background: var(--primary-soft); }

/* login */
.auth-wrap { min-height: calc(100vh / var(--z, 1)); display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 20% 20%, #3b1d8f 0, transparent 45%), radial-gradient(circle at 80% 80%, #0e5f74 0, transparent 45%), #0f0c22; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.auth-card .logo { width: 64px; height: 64px; display: block; margin: 0 auto 10px; }
.auth-card h2 { text-align: center; margin-bottom: 4px; }
.auth-card p { text-align: center; color: var(--muted); margin: 0 0 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; height: calc(100vh - 56px - 40px); }
.pos-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pos-search { display: flex; gap: 8px; }
.pos-search input { font-size: 16px; padding: 10px 14px; }
.pos-autoscan { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 2px 0; font-size: 13px; cursor: pointer; user-select: none; }
.pos-autoscan input { width: 16px; height: 16px; margin: 0; }
.pos-wh, label.f.pos-wh { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 8px 2px 0; font-size: 13px; font-weight: 600; }
.fee-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.fee-box > .btn { align-self: flex-start; }
.fee-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fee-row .fee-name { flex: 1; min-width: 0; }
.fee-row .fee-amt { width: 130px; font-weight: 700; }
.pos-wh select { width: auto; min-width: 160px; padding: 4px 8px; }
.wh-chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.cat-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; flex: none; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; font: inherit; font-size: 13px; color: var(--text); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; overflow-y: auto; align-content: start; padding: 2px; }
.prod { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 104px; transition: border-color .1s, transform .1s; text-align: start; font: inherit; color: var(--text); }
.prod:hover { border-color: var(--primary); transform: translateY(-1px); }
.prod .pn { font-weight: 600; font-size: 14px; line-height: 1.35; flex: 1 0 auto; }
.prod .pp { color: var(--primary); font-weight: 700; font-size: 16px; }
.prod .pq { font-size: 11px; color: var(--muted); }
.prod.out { opacity: .5; }
.cart { display: flex; flex-direction: column; min-height: 0; }
.cart-items { flex: 1; overflow-y: auto; }
.cart-line { padding: 10px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.cart-line .nm { font-weight: 600; }
.cart-line .ctl { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; flex-wrap: wrap; }
.cart-line .ctl input { width: 74px; padding: 3px 6px; text-align: center; }
.cart-line .info-btn { font-size: 17px; color: var(--primary); }
.cart-line .item-note { background: var(--warning-soft); color: var(--text); border-radius: 6px; padding: 3px 8px; white-space: pre-line; }
/* بطاقة الصنف في نقطة البيع */
.pc-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.pc-img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.pc-name { font-size: 18px; font-weight: 700; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.pc-sec { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 0; }
.pc > .pc-sec { margin-top: 10px; }
.pc-h { font-weight: 700; margin-bottom: 6px; }
.pc-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--border); }
.pc-row:last-child { border-bottom: 0; }
.pc-serials { display: flex; flex-wrap: wrap; gap: 4px; max-height: 160px; overflow: auto; }
.pc-serials span { border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.pc-serials span.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.prod { -webkit-touch-callout: none; user-select: none; }
.qty-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 700; color: var(--text); }
.cart-totals { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.cart-totals .line { display: flex; justify-content: space-between; padding: 2px 0; }
.cart-totals .grand { font-size: 22px; font-weight: 800; color: var(--primary); }
.pay-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-opt { border: 2px solid var(--border); background: var(--surface); border-radius: 10px; padding: 12px 8px; cursor: pointer; text-align: center; font: inherit; font-weight: 700; color: var(--text); }
.pay-opt.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.big-total { font-size: 34px; font-weight: 800; text-align: center; color: var(--primary); }
.serial-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 200px; overflow-y: auto; }
.serial-list label { border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; max-width: 46px; background: linear-gradient(to top, var(--primary), #a78bfa); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .bl { font-size: 11px; color: var(--muted); }
.bars .bv { font-size: 11px; font-weight: 600; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.status-steps { display: flex; gap: 4px; flex-wrap: wrap; }

.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 16px; max-height: 340px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 8px; }

/* print frame */
#print-frame { position: fixed; width: 0; height: 0; border: 0; left: -10px; }

html:not(.v-fit) .pos { grid-template-columns: minmax(0, 1fr); height: auto; }
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 250px; z-index: 90; transform: translateX(100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 14px 16px 40px; }
  .topbar { padding: 8px 16px; }
  .g2, .g3, .form-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr; } }

/* زر الشرح "!" */
.help-btn { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  font: 800 11px/1 var(--font); cursor: help; margin-inline: 5px; vertical-align: middle; flex: none; user-select: none; transition: background .15s, color .15s; }
.help-btn:hover, .help-btn:focus-visible { background: var(--primary); color: #fff; outline: none; }
.f-title { display: flex; align-items: center; flex-wrap: wrap; }
.btn .help-btn, .tabs .help-btn, .pay-opt .help-btn, .chip .help-btn { width: 15px; height: 15px; font-size: 10px; }
.btn.primary .help-btn, .btn.success .help-btn, .btn.danger .help-btn, .pay-opt.active .help-btn { background: rgba(255,255,255,.25); color: inherit; border-color: rgba(255,255,255,.4); }
#page-title .help-btn { width: 20px; height: 20px; font-size: 12px; }
.help-ex { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.help-ex ul { margin: 6px 0 0; padding-inline-start: 20px; line-height: 1.9; }

/* صفحة إعدادات الطباعة */
.ps-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ps-list { display: flex; flex-direction: column; padding: 6px; }
.ps-item { text-align: start; background: none; border: none; border-radius: 8px; padding: 10px 12px; font: inherit; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.ps-item:hover { background: var(--surface-2); }
.ps-item.active { background: var(--primary); color: #fff; }
.ps-preview-body { background: #8a8a96; padding: 20px; display: flex; justify-content: center; overflow: auto; max-height: calc(100vh - 170px); border-radius: 0 0 var(--radius) var(--radius); }
#ps-frame { border: 0; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.35); transform-origin: top center; flex: none; }
.ps-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.ps-sec { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--surface); }
.ps-sec > summary { cursor: pointer; padding: 10px 12px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.ps-sec > summary::-webkit-details-marker { display: none; }
.ps-sec > summary::before { content: '◂'; transition: transform .15s; color: var(--muted); }
.ps-sec[open] > summary::before { transform: rotate(-90deg); }
.ps-sec-body { padding: 0 12px 12px; }
.ps-sec textarea { width: 100%; }
@media (max-width: 1200px) { .ps-layout { grid-template-columns: 1fr; } }

/* إعادة تهيئة البرنامج */
.danger-zone { border-color: var(--danger); }
.danger-zone .card-head h3 { color: var(--danger); }
.reset-opt { display: flex; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; cursor: pointer; }
.reset-opt:has(input:checked) { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.reset-opt input { margin-top: 4px; }
.alert-danger { border: 1px solid var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border-radius: 8px; padding: 8px 10px; line-height: 1.7; }
.alert-success { border: 1px solid var(--success, #059669); color: var(--success, #059669); background: color-mix(in srgb, var(--success, #059669) 8%, transparent); border-radius: 8px; padding: 8px 10px; line-height: 1.7; }


/* زر واتساب */
.btn.wa-btn { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa-btn:hover { background: #1ebe5b; }
.btn.wa-btn svg { vertical-align: -3px; }

/* زر احتساب الضريبة في نقطة البيع */
.vat-toggle { cursor: pointer; border: 1px dashed var(--border); border-radius: 8px; padding: 6px 8px !important; margin: 4px 0; align-items: center; }
.vat-toggle input { margin-inline-end: 6px; vertical-align: -2px; }
.vat-toggle b { color: var(--warn, #b45309); }
.vat-toggle.on { border-style: solid; border-color: var(--primary, #7c3aed); }
.vat-toggle.on b { color: var(--primary, #7c3aed); }

/* العناصر المخفية تبقى مخفية حتى مع أنماط الأزرار */
[hidden] { display: none !important; }
.store-box { border: 1px dashed var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.store-box-head { font-weight: 700; margin-bottom: 8px; }
/* الإعداد الأول: استعادة البيانات من نسخة احتياطية (النسخة المحلية) */
.setup-restore { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; }
.setup-restore .err { color: var(--danger); }
.setup-restore select { width: 100%; }
.restore-info { white-space: pre-wrap; text-align: right; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-family: inherit; line-height: 1.7; }
/* نقطة البيع: خيار إرسال الفاتورة على واتساب في نافذة الدفع (واضح وبارز) */
.wa-row { border: 2px solid #25d366; background: rgba(37, 211, 102, .08); border-radius: 12px; padding: 10px 14px; }
.wa-row .check { font-weight: 700; font-size: 15px; color: #16a34a; }
.wa-row .check svg { width: 22px; height: 22px; vertical-align: -5px; color: #25d366; }
.wa-row .check input { width: 20px; height: 20px; }
.wa-row #wa-phone { font-size: 16px; }
.wa-row .wa-hint { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.wa-row .wa-kind { display: flex; gap: 16px; flex-basis: 100%; }
.wa-row .wa-kind .check { font-size: 14px; font-weight: 600; color: inherit; }
.wa-row .wa-kind input { width: 16px; height: 16px; }
/* حسابي ونسيت كلمة المرور */
.forgot-link { text-align: center; margin-top: 12px; font-size: 14px; }
.auth-rights { text-align: center; margin-top: 16px; font-size: 11.5px; line-height: 1.8; color: var(--muted); }
.lic-box { text-align: center; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.lic-machine { font: 700 26px/1.3 Consolas, monospace; letter-spacing: 3px; margin: 4px 0 8px; user-select: all; }
.lic-steps { margin-bottom: 10px; line-height: 1.8; }
.lic-owner { text-align: center; background: var(--surface-2); border-radius: 10px; padding: 8px; margin-bottom: 12px; line-height: 1.9; }
.acc-sec { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.acc-sec h4 { margin: 0 0 6px; }
.rec-code-box { margin-top: 10px; padding: 12px; border: 2px dashed var(--primary, #7c3aed); border-radius: 10px; text-align: center; }
.rec-code { font: 700 24px Consolas, monospace; letter-spacing: 3px; margin: 10px 0; user-select: all; }
/* طريقة الدفع بضغطة (تسليم جهاز الصيانة) */
.pm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pm-tile { display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); border-radius: 10px; padding: 12px 8px; cursor: pointer; font-weight: 700; text-align: center; user-select: none; }
.pm-tile input { position: absolute; opacity: 0; pointer-events: none; }
.pm-tile.on { border-color: var(--primary, #7c3aed); background: rgba(124, 58, 237, .12); color: var(--primary, #7c3aed); }
.pm-tile:hover { border-color: var(--primary, #7c3aed); }
.about { text-align: center; padding: 26px 16px; }
.about-logo { width: 72px; height: 72px; }
.about h2 { margin: 8px 0 2px; }
.about-owner { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px 26px; margin: 14px 0 6px; line-height: 2; }
.about-name { font-size: 18px; font-weight: 700; }
.about-rights { line-height: 1.9; }
.rec-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 12px auto; max-width: 380px; font: 700 18px Consolas, monospace; letter-spacing: 2px; user-select: all; text-align: left; }

.lang-btn { font-weight: 800; font-size: 13px; min-width: 36px; }
.lang-wrap { position: relative; display: inline-block; }
.lang-menu { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; min-width: 130px; display: flex; flex-direction: column; }
.lang-menu[hidden] { display: none; }
.lang-menu button { background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 7px; cursor: pointer; text-align: start; }
.lang-menu button:hover { background: var(--surface-2); }
.lang-menu button.on { font-weight: 700; color: var(--primary); }
/* البنغالية: خطوط تدعم حروفها (موجودة في ويندوز وأندرويد) */
html[lang="bn"] body { font-family: "Nirmala UI", "Noto Sans Bengali", Vrinda, var(--font); }
.auth-card { position: relative; }
.auth-lang { position: absolute; top: 12px; inset-inline-end: 12px; }
/* الإنجليزية (من اليسار لليمين): سهم الرجوع يشير لليسار */
html[dir="ltr"] svg.i-back { transform: scaleX(-1); }

/* اختيار مجلد داخل البرنامج (folder-picker.js) */
.fp-go { display: flex; gap: 6px; margin-bottom: 6px; }
.fp-go input { flex: 1; min-width: 0; }
.fp-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.fp-path { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.fp-note { margin-bottom: 8px; }
.fp-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.fp-group { font-size: 12px; color: var(--muted); padding: 8px 10px 4px; }
.fp-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--text); font: inherit; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: start; }
.fp-item:hover { background: var(--surface-2); }
.fp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-badge { font-size: 11px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

/* بطاقة الدخول من الإنترنت (Cloudflare Tunnel) */
.tun-status { font-size: 15px; margin: 6px 0; }
.tun-links { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; line-height: 2; margin: 8px 0; }
.tun-links a { font-weight: 700; }
label.chk { display: flex; align-items: center; gap: 8px; flex-direction: row; }

/* عداد مساحة Supabase (الإعدادات ← النسخ السحابية) */
.usage-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.usage-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.usage-bar { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: 999px; background: #059669; }
.usage-bar.warn span { background: #d97706; }
.usage-bar.danger span { background: var(--danger); }
.usage-parts { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 8px; }

/* شريط الفترة التجريبية (BillMend) */
.trial-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 16px 0; padding: 8px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 10%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); font-size: 13.5px; }
.trial-bar .btn { margin-inline-start: auto; }
.trial-bar.urgent { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: var(--danger); }

/* العروض والكوبونات ونقاط الولاء في نقطة البيع */
.promo-tag { font-size: 12px; color: #b45309; background: color-mix(in srgb, #f59e0b 12%, transparent); border-radius: 6px; padding: 2px 8px; justify-self: start; }
.disc-box { border: 1px dashed var(--border); border-radius: 10px; padding: 10px 12px; }

/* ===== سندات القبض وحجز البضاعة ===== */
.prod .rsv-q { color: var(--warning); font-weight: 600; }
.cart-totals .rsv-line { color: var(--warning); }
.short-row td { background: var(--warning-soft); border-top: 0; }
.short-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.rsv-clauses { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 10px; line-height: 1.7; }
.rsv-sum { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; border-top: 1px solid var(--border); }
a.rsv-alert { display: block; color: inherit; border-color: var(--warning); background: var(--warning-soft); }
#words { color: var(--muted); min-height: 1.2em; }

/* ===== نقطة البيع على قد الشاشة (2026-10-21، بطلب المالك): لا نزول للصفحة، الأصناف والسلة كلٌّ ينزل لحاله، والدفع ثابت تحت السلة ===== */
html.v-fit .content:has(> .pos) { display: flex; flex-direction: column; overflow: hidden; padding: 12px 16px; }
html.v-fit .pos { flex: 1; min-height: 0; height: auto; grid-template-columns: minmax(0, 1fr) 440px; gap: 14px; }
html.v-fit .prod-grid { flex: 1; min-height: 0; }
.trial-bar { padding: 4px 12px; margin: 6px 16px 0; font-size: 13px; }
.trial-bar .btn { padding: 2px 10px; font-size: 12px; }
.pos-left { gap: 8px; }
.pos-autoscan { margin: 0 2px; }
.prod-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); grid-auto-rows: max-content; }
.cart { overflow: hidden; }
.cart > .card-head { padding: 10px 14px; }
.cart-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; padding: 10px 16px; }
.cart-totals .line { font-size: 14px; }
.cart-totals .vat-toggle, .cart-totals .grand, .cart-totals .rsv-line, .cart-totals .line:has(#inv-disc) { grid-column: 1 / -1; }
.cart-totals .grand { font-size: 26px; padding-top: 6px; border-top: 1px dashed var(--border); margin-top: 4px; }
.cart-totals #inv-disc { width: 120px !important; }
.cart-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 14px 14px; }
.cart-btns .btn { padding: 8px 6px; font-size: 14px; justify-content: center; }
#pay-btn { grid-column: 1 / -1; font-size: 22px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 6px 18px rgba(124, 58, 237, .35); }
#pay-btn .pay-amt { font-weight: 800; direction: ltr; unicode-bidi: isolate; }
#pay-btn .nav-key { font-size: 12px; opacity: .8; }

/* إخفاء علامات الشرح (اختيار المستخدم) */
body.no-help .help-btn { display: none !important; }
/* نقطة البيع: القائمة الجانبية أيقونات فقط، واسم الصفحة يظهر عند الوقوف على الأيقونة */
@media (min-width: 861px) {
  body.pos-mode .layout { grid-template-columns: 64px 1fr; }
  body.pos-mode .brand { justify-content: center; padding: 14px 6px; }
  body.pos-mode .brand > div, body.pos-mode .side-foot { display: none; }
  body.pos-mode .nav { padding: 6px 8px 16px; }
  body.pos-mode .nav-group { font-size: 0; padding: 0; margin: 6px 0; border-top: 1px solid rgba(255,255,255,.07); }
  body.pos-mode .nav a { justify-content: center; padding: 10px 0; position: relative; }
  body.pos-mode .nav a > span:not(.badge), body.pos-mode .nav a .nav-key { display: none; }
  body.pos-mode .nav a svg { width: 20px; height: 20px; }
  body.pos-mode .nav a .badge { position: absolute; top: 2px; inset-inline-end: 6px; font-size: 9px; padding: 1px 4px; margin: 0; }
}

/* ===== الشاشات الصغيرة والقديمة (2026-10-22): السلة تبقى جنب الأصناف، وزر الدفع ظاهر بدون نزول ===== */
html.v-fit.v-mid .pos { grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; }
html.v-mid .prod-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
html.v-mid .prod { padding: 9px; min-height: 88px; gap: 4px; }
html.v-mid .prod .pn { font-size: 13px; }
html.v-mid .prod .pp { font-size: 15px; }
html.v-mid .cart-line .ctl input { width: 58px; }
html.v-mid .chip { padding: 5px 10px; font-size: 12px; }
html.v-fit.v-short .content:has(> .pos) { padding: 8px 12px; }
html.v-short .pos-search input { padding: 7px 12px; font-size: 15px; }
html.v-short .cart > .card-head { padding: 6px 10px; }
html.v-short .cart-line { padding: 6px 12px; }
html.v-short .cart-totals { padding: 6px 12px; gap: 0 14px; }
html.v-short .cart-totals .line { font-size: 13px; }
html.v-short .cart-totals .grand { font-size: 22px; padding-top: 3px; margin-top: 2px; }
html.v-short .cart-btns { padding: 6px 10px 10px; gap: 6px; }
html.v-short .cart-btns .btn { padding: 5px 6px; font-size: 13px; }
html.v-short #pay-btn { font-size: 19px; padding: 9px; }
html.v-short .topbar { min-height: 46px; padding-block: 5px; }

/* ===== وضع المسح في نقطة البيع (2026-10-22): الفاتورة كبيرة مكان مربعات الأصناف ===== */
.scan-inv, .last-box { display: none; }
.pos.scan-mode .cat-chips, .pos.scan-mode .prod-grid, .pos.scan-mode .cart-items { display: none !important; }
.pos.scan-mode .scan-inv { display: block; flex: 1; min-height: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
html:not(.v-fit) .pos.scan-mode .scan-inv { min-height: 280px; }
.pos.scan-mode .last-box { display: flex; flex: 1; min-height: 0; overflow: hidden; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 16px; text-align: center; border-bottom: 1px solid var(--border); }
.last-box .lbl { color: var(--muted); font-size: 13px; }
.last-box .ln { font-size: 22px; font-weight: 700; }
.last-box .lp { font-size: 34px; font-weight: 800; color: var(--primary); }
.last-box .cnt { color: var(--muted); font-size: 14px; margin-top: 8px; }
.scan-inv .cart-line { grid-template-columns: minmax(0, 1fr) auto 130px; align-items: center; padding: 14px 18px; gap: 6px 16px; }
.scan-inv .cart-line .nm { grid-column: 1; grid-row: 1; font-size: 18px; }
.scan-inv .cart-line .ctl { grid-column: 2; grid-row: 1; flex-wrap: nowrap; }
.scan-inv .cart-line .ctl input { font-size: 16px; }
.scan-inv .cart-line > .line-tot { grid-column: 3; grid-row: 1; font-size: 20px; color: var(--primary); text-align: end; }
.scan-inv .cart-line.last { background: rgba(34, 197, 94, .10); }
.scan-inv .just-added { font-size: 12px; color: #22c55e; font-weight: 600; }
.scan-empty { display: grid; place-items: center; height: 100%; min-height: 240px; color: var(--muted); text-align: center; font-size: 20px; line-height: 2; padding: 20px; }
.scan-empty b { font-size: 46px; display: block; }
html.v-mid .scan-inv .cart-line { grid-template-columns: minmax(0, 1fr) 110px; }
html.v-mid .scan-inv .cart-line .ctl { grid-column: 1 / -1; grid-row: 2; }
html.v-mid .scan-inv .cart-line > .line-tot { grid-column: 2; }
html.v-mid .scan-inv .cart-line .nm { font-size: 16px; }
.cart-items .cart-line.last { background: rgba(34, 197, 94, .06); }
@keyframes line-flash { from { background: rgba(34, 197, 94, .38); } }
.cart-line.flash { animation: line-flash .7s ease-out; }

/* ===== مسح الباركود بالكاميرا (2026-10-22) ===== */
.cam-wrap { display: flex; gap: 6px; align-items: stretch; width: 100%; }
.cam-wrap > input { flex: 1; min-width: 0; }
.cam-btn { padding: 4px 10px; font-size: 18px; line-height: 1; flex: none; }
.cam-scan { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; color: #fff; }
.cam-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(0, 0, 0, .7); }
.cam-top .grow { flex: 1; }
.cam-view { flex: 1; position: relative; overflow: hidden; }
.cam-view video { width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: absolute; inset: 41% 7%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); transition: border-color .15s; }
.cam-frame i { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.cam-scan.hit .cam-frame { border-color: #22c55e; }
.cam-bottom { padding: 12px; text-align: center; background: rgba(0, 0, 0, .7); display: flex; flex-direction: column; gap: 4px; }
.cam-hint { font-size: 14px; opacity: .85; }
.cam-last { font-size: 18px; color: #4ade80; font-weight: 700; direction: ltr; min-height: 22px; }

/* خيار «إضافة مباشرة عند المسح» في صف البحث (الوضعين) + اختيار السطر */
.pos-search { flex-wrap: wrap; }
.pos-search .pos-autoscan { margin: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); white-space: nowrap; font-size: 13px; font-weight: 600; }
.pos-search .pos-autoscan:has(input:checked) { border-color: #22c55e; color: #22c55e; }
.cart-line[data-line] { cursor: pointer; }

/* خط السعر الملوّن تحت أصناف السلة + سطر التكلفة للصنف المحدد (1.3.8) */
.cart-line .pm-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.cart-line .pm-bar i { flex: 0 0 46px; height: 6px; border-radius: 4px; background: currentColor; }
.pm-g { color: #22c55e; } .pm-y { color: #eab308; } .pm-r { color: var(--danger); }
.pm-pos { color: #22c55e; }
.cart-line .pm-info { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; background: rgba(148, 163, 184, .12); border: 1px dashed rgba(148, 163, 184, .4); }
.scan-inv .cart-line > .pm-bar, .scan-inv .cart-line > .pm-info { grid-column: 1 / -1; grid-row: auto; }

/* خانة الخصم ظاهرة دائماً لمن عنده pos.discount (1.3.9) */
.cart-line .ctl input.disc-in { width: 64px; }
html.v-mid .cart-line .ctl input.disc-in { width: 52px; }

/* الكاميرا 1.4.0: شريط ضيق + توقف بعد كل مسحة («امسح التالي» / «إعادة المسح») */
.cam-scan.paused .cam-frame { border-color: #22c55e; }
.cam-scan.paused video { filter: brightness(.45); }
.cam-res { display: flex; flex-direction: column; gap: 8px; }
.cam-res-l { font-size: 17px; font-weight: 700; color: #fff; }
.cam-res-b { display: flex; gap: 8px; justify-content: center; }
.cam-res-b .btn { flex: 1; max-width: 260px; padding: 12px 10px; font-size: 16px; }

/* الإعدادات بالمربعات (1.4.1) */
.st-search { max-width: 460px; width: 100%; margin: 0 0 16px; }
.st-group { margin: 0 0 18px; }
.st-group h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.st-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.st-tile:hover { border-color: var(--primary); }
.st-ic { font-size: 26px; line-height: 1; flex: none; }
.st-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-state { font-size: 12px; font-weight: 700; margin-top: 2px; color: var(--muted); }
.st-state.ok { color: #22c55e; } .st-state.no { color: #f59e0b; }
.st-danger { border-color: rgba(239, 68, 68, .5); } .st-danger b { color: var(--danger); }

/* اختيار الشهر والسنة بجانب فترة التاريخ (1.4.2) */
.mp { display: inline-flex; gap: 6px; align-items: center; align-self: flex-end; }
.mp select { width: auto; min-width: 0; padding-inline: 8px; }

/* صفحة الصنف بالتبويبات (1.5.0) */
.pp-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pp-img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--border); flex: none; }
.pp-noimg { display: flex; align-items: center; justify-content: center; font-size: 34px; background: var(--surface-2); }
.pp-title { flex: 1; min-width: 200px; }
.pp-name { font-size: 20px; font-weight: 800; }
.pp-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-tabs { flex-wrap: wrap; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pp-kv { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.pp-kv > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.pp-kv > b { font-size: 18px; }
.pp-kv.pp-main { border-color: var(--primary); } .pp-kv.pp-main > b { color: var(--primary); font-size: 22px; }
.pp-bar { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.pp-bar i { display: block; height: 10px; border-radius: 5px; background: var(--primary); min-width: 2px; }

/* صورة الصنف في مربع نقطة البيع (1.5.0) */
.prod .prod-img { width: 100%; height: 72px; object-fit: contain; background: #fff; border-radius: 8px; margin-bottom: 6px; flex: none; }
html.v-mid .prod .prod-img, html.v-short .prod .prod-img { height: 52px; }

/* مجاميع نقطة البيع المختصرة (1.5.0) */
.cart-totals { display: flex; flex-direction: column; gap: 4px; }
.cart-totals .tot-sub { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.cart-totals .grand { font-size: 34px; border-top: 0; margin-top: 0; padding-top: 0; align-items: baseline; }
.cart-totals .grand > span:first-child { font-size: 20px; }
.tot-chips { display: flex; gap: 8px; }
.tot-chip { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; font-weight: 700; font-size: 13px; background: var(--surface); color: inherit; cursor: pointer; }
.tot-chip.on { border-color: var(--primary); color: var(--primary); }
.tot-chip.vat-chip.on { border-color: #22c55e; color: #22c55e; }
.tot-chip.vat-chip input { position: absolute; opacity: 0; pointer-events: none; width: 0; }
.tot-chip #inv-disc { width: 80px !important; padding: 2px 6px; }
html.v-short .cart-totals .grand { font-size: 26px; }

/* الرئيسية: يحتاج انتباهك + ابدأ هنا (1.5.0) */
.att-card .card-head h3 { margin: 0; }
.att-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.att-row:hover { background: var(--surface-2); }
.att-n { min-width: 34px; height: 28px; padding: 0 8px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; background: var(--c); }
.att-go { margin-inline-start: auto; color: var(--primary); font-weight: 700; white-space: nowrap; }
.att-ok { color: #22c55e; font-weight: 700; }
.start-here { background: linear-gradient(135deg, rgba(124, 58, 237, .16), rgba(14, 165, 233, .10)); border: 1px solid rgba(124, 58, 237, .5); border-radius: 16px; padding: 16px; }
.start-here h3 { margin: 0 0 4px; }
.sh-bar { height: 10px; border-radius: 6px; background: rgba(148, 163, 184, .25); margin: 10px 0 14px; overflow: hidden; }
.sh-bar i { display: block; height: 100%; background: #22c55e; }
.sh-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.sh-step { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.sh-c { width: 28px; height: 28px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; border: 2px solid var(--border); }
.sh-step.done .sh-c { background: #22c55e; border-color: #22c55e; color: #fff; }
.sh-step.done b { text-decoration: line-through; color: var(--muted); }

/* البحث الشامل (Ctrl + K) ونافذة الاختصارات (F1) — 1.5.0 */
.gs-back { position: fixed; inset: 0; background: rgba(5, 4, 15, .6); z-index: 350; display: flex; justify-content: center; align-items: flex-start; padding: 80px 12px 12px; }
.gs-box { width: 760px; max-width: 100%; max-height: calc(100vh / var(--z, 1) - 100px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); overflow: hidden; }
.gs-box.gs-wide { width: 880px; }
.gs-in { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 20px; }
.gs-in input { flex: 1; font-size: 18px; border: 0; background: transparent; color: inherit; outline: 0; box-shadow: none; padding: 4px 0; }
.gs-in .gs-sub { margin-inline-start: auto; }
.gs-res { overflow-y: auto; }
.gs-hint { padding: 18px 16px; color: var(--muted); }
.gs-g { padding: 6px 0; border-bottom: 1px solid var(--border); }
.gs-g h5 { margin: 4px 16px; color: var(--muted); font-size: 12px; }
.gs-r { display: flex; gap: 12px; align-items: center; padding: 8px 16px; color: inherit; text-decoration: none; }
.gs-r.sel, .gs-r:hover { background: rgba(124, 58, 237, .18); }
.gs-ic { width: 24px; text-align: center; font-size: 17px; flex: none; }
.gs-sub { color: var(--muted); font-size: 12px; margin-inline-start: auto; text-align: end; }
.gs-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 16px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); }
kbd.gs-k { border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12px; background: rgba(148, 163, 184, .12); font-family: inherit; white-space: nowrap; }
.gs-keys { display: grid; grid-template-columns: 1fr 1fr; overflow-y: auto; }
.gs-key { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.gs-key kbd { min-width: 78px; text-align: center; }
@media (max-width: 700px) { .gs-keys { grid-template-columns: 1fr; } .gs-btn .nav-key { display: none; } .gs-back { padding-top: 20px; } }

/* الجداول على الجوال: كل سطر بطاقة (1.5.0) — اسم العمود من data-label */
@media screen and (max-width: 700px) {
  .table-wrap { overflow: visible; }
  .table-wrap table.t, .table-wrap table.t tbody, .table-wrap table.t tfoot { display: block; width: 100%; }
  .table-wrap table.t thead { display: none; }
  .table-wrap table.t tr { display: block; border: 1px solid var(--border); border-radius: 12px; margin: 8px; padding: 6px 12px; background: var(--surface); }
  .table-wrap table.t td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; padding: 5px 0; text-align: end; white-space: normal; }
  .table-wrap table.t td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: start; flex: none; max-width: 45%; }
  .table-wrap table.t td[data-label=""]::before { display: none; }
  .table-wrap table.t td[data-label=""] { justify-content: flex-end; }
  .table-wrap table.t td:empty { display: none; }
  .table-wrap table.t tbody td:first-child { font-size: 15px; }
  .table-wrap table.t tfoot tr { background: var(--surface-2); }
}

/* تصوير صورة المنتج (1.5.1) */
.cam-photo .cam-square { inset: auto; top: 50%; left: 50%; width: min(78vw, 62vh); height: min(78vw, 62vh); transform: translate(-50%, -50%); }
.cam-photo .cam-shot { position: absolute; top: 50%; left: 50%; width: min(78vw, 62vh); height: min(78vw, 62vh); transform: translate(-50%, -50%); object-fit: contain; background: #fff; border-radius: 14px; z-index: 2; }
.cam-photo .cam-shot:not([hidden]) ~ .cam-square { display: none; }

/* التقارير: التبويبات في مجموعات + الملخص الجديد (1.5.3) */
.rp-tabs { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 14px; }
.rp-g { display: flex; flex-direction: column; gap: 4px; }
.rp-gl { font-size: 12px; color: var(--muted); font-weight: 700; padding-inline-start: 4px; }
.rp-gb { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.rp-gb button { border: 0; background: transparent; color: var(--text); padding: 7px 12px; border-radius: 9px; font-weight: 600; cursor: pointer; font: inherit; font-size: 14px; }
.rp-gb button:hover { background: var(--surface-2); }
.rp-gb button.active { background: var(--primary); color: #fff; }
.rp-note { background: linear-gradient(135deg, rgba(124, 58, 237, .14), rgba(14, 165, 233, .08)); border: 1px solid rgba(124, 58, 237, .45); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; }
.rp-note h4 { margin: 0 0 6px; } .rp-note ul { margin: 0; padding-inline-start: 18px; } .rp-note li { margin: 3px 0; }
.rp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.rp-k { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--c); border-radius: 14px; padding: 14px; color: inherit; text-decoration: none; }
a.rp-k { cursor: pointer; } a.rp-k:hover { border-color: var(--c); }
.rp-k .l { color: var(--muted); font-size: 13px; } .rp-k .v { font-size: 28px; font-weight: 800; } .rp-k .s { color: var(--muted); font-size: 12px; }
.rp-d { font-size: 13px; font-weight: 700; }
.rp-h { margin: 0 0 10px; font-size: 17px; }
.rp-story { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.rp-step { flex: 1 1 130px; display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 12px; padding: 12px; background: var(--surface-2); }
.rp-step .t { font-size: 13px; color: var(--muted); text-align: center; } .rp-step b { font-size: 22px; } .rp-step .p { font-size: 12px; color: var(--muted); }
.rp-step i { display: block; height: 8px; border-radius: 5px; background: var(--c); margin-top: 6px; align-self: flex-start; }
.rp-final { outline: 2px solid var(--c); }
.rp-op { align-self: center; font-size: 26px; font-weight: 800; color: var(--muted); }
.rp-say { margin-top: 10px; font-weight: 700; }
.rp-chart { width: 100%; height: 240px; direction: ltr; }
.rp-leg { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); } .rp-leg i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-inline-end: 4px; }
.rp-t { width: 100%; border-collapse: collapse; } .rp-t th, .rp-t td { padding: 7px 6px; border-bottom: 1px solid var(--border); text-align: start; } .rp-t th { color: var(--muted); font-size: 12px; font-weight: 600; }
.rp-why { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.8; }
.rp-big { font-size: 15px; line-height: 2.1; } .rp-big b { font-size: 18px; }
.rp-pie { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.rp-donut { width: 150px; height: 150px; transform: rotate(-90deg); flex: none; }
.rp-li { margin: 4px 0; } .rp-li i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }
.rp-cap { font-size: 12px; color: var(--muted); text-align: center; margin: 6px 0 14px; }
@media screen and (max-width: 700px) { .rp-op { display: none; } .rp-k .v { font-size: 22px; } }

/* رسم المبيعات اليومية الواضح (1.5.4) — daychart.js */
.dc-sum { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dc-s { flex: 1 1 150px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.dc-s .l { font-size: 12px; color: var(--muted); } .dc-s b { font-size: 20px; }
.dc { --gut: 48px; }
.dc-wrap { position: relative; margin: 30px var(--gut) 0 0; }
.dc-grid { position: absolute; inset: 0; pointer-events: none; }
.dc-gl { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(148, 163, 184, .16); }
.dc-gl span { position: absolute; right: calc(-1 * var(--gut)); top: -8px; width: calc(var(--gut) - 6px); font-size: 11px; color: var(--muted); text-align: start; }
.dc-avg { position: absolute; left: 0; right: 0; border-top: 2px dashed #f59e0b; z-index: 2; }
.dc-avg span { position: absolute; left: 4px; top: -21px; font-size: 12px; font-weight: 700; color: #f59e0b; background: var(--surface); padding: 0 6px; border-radius: 6px; white-space: nowrap; }
.dc-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 6px; }
.dc-b { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.dc-v { font-size: 11px; font-weight: 700; margin-bottom: 3px; white-space: nowrap; }
.dc-tag { font-size: 13px; line-height: 1; margin-bottom: 1px; }
.dc-bar { width: 100%; max-width: 46px; min-height: 2px; border-radius: 7px 7px 2px 2px; background: #8b5cf6; position: relative; overflow: hidden; }
.dc-bar i { position: absolute; bottom: 0; left: 0; right: 0; background: #10b981; opacity: .9; }
.dc-b.fri .dc-bar { background: #5b21b6; }
.dc-b.best .dc-bar { background: #22c55e; } .dc-b.best .dc-bar i { background: #15803d; }
.dc-b.worst .dc-bar { background: #ef4444; } .dc-b.worst .dc-bar i { background: #991b1b; }
.dc-x { display: flex; gap: 6px; margin: 6px var(--gut) 0 0; }
.dc-x div { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.3; overflow: hidden; }
.dc-x b { display: block; color: var(--text); font-size: 12px; }
.dc-x .fri, .dc-x .fri b { color: #a78bfa; }
.dc.dense .dc-v { font-size: 9px; writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 4px; }
.dc.dense .dc-bars, .dc.dense .dc-x { gap: 3px; }
.dc.dense .dc-x span { font-size: 9px; }
.dc-leg { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.dc-leg i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-inline-end: 5px; }
@media screen and (max-width: 700px) { .dc { --gut: 36px; } .dc-v { font-size: 9px; writing-mode: vertical-rl; transform: rotate(180deg); } .dc-x span { display: none; } }

/* تنبيه التحديث الجديد (1.5.5) */
.upd-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(34, 197, 94, .6); background: linear-gradient(135deg, rgba(34, 197, 94, .16), rgba(14, 165, 233, .08)); color: inherit; text-decoration: none; }
.upd-banner:hover { border-color: #22c55e; }
.upd-ic { font-size: 26px; }
.upd-banner .grow { display: flex; flex-direction: column; gap: 3px; }
.upd-notes { color: var(--muted); }
.st-tile.st-new { border-color: #22c55e; box-shadow: 0 0 0 1px #22c55e inset; }
.st-state.st-new-t { color: #22c55e; }
