/* =========================================================
   لوحة الإدارة — تصميم بروح Larkon: أرضية رمادية دافئة، بطاقات بيضاء ناعمة،
   قائمة داكنة، ولون تمييز برتقالي (قابل للتغيير). وضع داكن كامل.
   الشكل يأتي من سمات <html>: data-bs-theme / data-accent / data-menu / data-topbar / data-size / data-layout / data-width
   ========================================================= */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/plex-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("../fonts/plex-arabic-500.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/plex-arabic-600.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/plex-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/plex-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AA; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/plex-latin-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AA; }

/* ---------- الألوان ---------- */
:root {
  --accent: #ff6c2f; --accent-rgb: 255, 108, 47;
  --ink: #2a3342;        /* النص الأساسي */
  --ink-2: #4a5568;      /* نص ثانوي داكن */
  --muted: #7b8798;
  --muted-2: #a8b1bd;
  --line: #eaedf1;
  --line-2: #dfe3e9;
  --surface: #ffffff;
  --surface-2: #fbfbfc;  /* رؤوس الجداول وخلفيات خفيفة داخل البطاقات */
  --ground: #f6f4f3;
  --hover: rgba(42, 51, 66, .05);
  --shadow: 0 1px 2px rgba(31, 41, 55, .04), 0 4px 14px rgba(31, 41, 55, .04);
  --shadow-pop: 0 12px 32px rgba(31, 41, 55, .14), 0 2px 6px rgba(31, 41, 55, .06);
  --success: #1a8a5c; --success-soft: #e6f5ee;
  --danger: #c93a3a;  --danger-soft: #fcecec; --danger-line: #efc2c2;
  --warn: #a35a00;    --warn-soft: #fdf1df;   --warn-line: #ecd3a6;
  --tip-bg: #fbf7ec;  --tip-line: #c99a2e;

  --accent-strong: color-mix(in srgb, var(--accent) 82%, #000);
  --accent-text: color-mix(in srgb, var(--accent) 78%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 35%, var(--surface));

  /* القائمة (داكنة افتراضيًا) */
  --side-bg: #262d34; --side-ink: #9aa1b0; --side-hover: #ffffff; --side-hover-bg: rgba(255, 255, 255, .05);
  --side-title: #6c7484; --side-active: #ffffff; --side-active-bg: rgba(255, 255, 255, .08); --side-mark: var(--accent); --side-border: transparent;
  /* الشريط العلوي (فاتح افتراضيًا) */
  --top-bg: var(--surface); --top-ink: var(--ink); --top-muted: var(--muted); --top-field: var(--ground); --top-line: var(--line);

  --side-w: 264px; --side-w-sm: 76px; --top-h: 68px;
  --radius: .75rem;

  --bs-body-font-family: "Plex Arabic", Tahoma, "Segoe UI", sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--surface);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--line-2);
  --bs-primary: var(--accent);
  --bs-primary-rgb: var(--accent-rgb);
  --bs-link-color: var(--accent-text);
  --bs-link-color-rgb: var(--accent-rgb);
  --bs-link-hover-color: var(--accent-strong);
  --bs-border-radius: .5rem;
  --bs-border-radius-lg: var(--radius);
}
:root[data-accent="blue"]   { --accent: #2f6fed; --accent-rgb: 47, 111, 237; }
:root[data-accent="teal"]   { --accent: #1f7a8c; --accent-rgb: 31, 122, 140; }
:root[data-accent="green"]  { --accent: #1f9d6b; --accent-rgb: 31, 157, 107; }
:root[data-accent="violet"] { --accent: #7a4fe0; --accent-rgb: 122, 79, 224; }
:root[data-accent="rose"]   { --accent: #e0457b; --accent-rgb: 224, 69, 123; }

:root[data-bs-theme="dark"] {
  --ink: #dfe5ec; --ink-2: #b8c2cd; --muted: #8e9aa8; --muted-2: #66717e;
  --line: #333b44; --line-2: #3b444e;
  --surface: #262c33; --surface-2: #2b3239; --ground: #1d2227;
  --hover: rgba(255, 255, 255, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .45);
  --success: #4cc790; --success-soft: #1d3a2f;
  --danger: #f07575;  --danger-soft: #3d2526; --danger-line: #6b3335;
  --warn: #f0b04f;    --warn-soft: #3a2f1c;   --warn-line: #6a5223;
  --tip-bg: #33301f;  --tip-line: #b08a2c;
  --accent-text: color-mix(in srgb, var(--accent) 70%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 45%, var(--surface));
  --side-bg: #20262c; --side-border: #2c333a;
  --bs-body-bg: var(--surface);
  --bs-secondary-bg: var(--surface-2);
}
/* القائمة الفاتحة والملوّنة */
:root[data-menu="light"] {
  --side-bg: var(--surface); --side-ink: #6b7385; --side-hover: var(--accent-text); --side-hover-bg: var(--accent-soft);
  --side-title: #9aa2b1; --side-active: var(--accent-text); --side-active-bg: var(--accent-soft); --side-border: var(--line);
}
:root[data-bs-theme="dark"][data-menu="light"] { --side-bg: var(--surface); --side-ink: #a7b1bd; --side-title: #76808d; }
:root[data-menu="brand"] {
  --side-bg: color-mix(in srgb, var(--accent) 88%, #000); --side-ink: rgba(255, 255, 255, .78); --side-hover: #fff; --side-hover-bg: rgba(255, 255, 255, .12);
  --side-title: rgba(255, 255, 255, .55); --side-active: #fff; --side-active-bg: rgba(0, 0, 0, .16); --side-mark: #fff;
}
/* الشريط العلوي الداكن */
:root[data-topbar="dark"] { --top-bg: #262d34; --top-ink: #e6ebf0; --top-muted: #9aa1b0; --top-field: rgba(255, 255, 255, .07); --top-line: #2f373f; }
:root[data-bs-theme="dark"][data-topbar="dark"] { --top-bg: #20262c; }

/* ---------- أساس ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-size: .9375rem; background: var(--ground); color: var(--ink); }
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; color: var(--ink); }
a { text-underline-offset: .2em; }
.num, .table td.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; fill: currentColor; }
kbd { font-family: inherit; font-size: .72rem; padding: .08rem .38rem; border-radius: .3rem; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); box-shadow: inset 0 -1px 0 var(--line-2); }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -3rem; z-index: 2000; background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: .5rem; }
.skip-link:focus { top: .75rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.btn-primary { --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-strong); --bs-btn-hover-border-color: var(--accent-strong); --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-border-color: var(--accent-strong); --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); --bs-btn-focus-shadow-rgb: var(--accent-rgb); font-weight: 500; }
.btn-outline-primary { --bs-btn-color: var(--accent-text); --bs-btn-border-color: var(--accent); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent); --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent); --bs-btn-focus-shadow-rgb: var(--accent-rgb); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line-2); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--muted-2); --bs-btn-active-bg: var(--hover); --bs-btn-active-color: var(--ink); }
.btn-light { --bs-btn-bg: var(--surface-2); --bs-btn-border-color: var(--line-2); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: var(--line-2); --bs-btn-hover-color: var(--ink); }
.btn-link { --bs-btn-color: var(--accent-text); --bs-btn-hover-color: var(--accent-strong); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .18); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-control, .form-select { border-color: var(--line-2); }
.form-control::placeholder { color: var(--muted-2); }
.form-label { font-weight: 500; color: var(--ink-2); }
.text-secondary { color: var(--muted) !important; }
.table-light, .bg-light { --bs-table-bg: var(--surface-2); background-color: var(--surface-2) !important; color: var(--ink); }
.alert { border-radius: .65rem; }
.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--hover); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-link-active-bg: var(--accent-soft); --bs-dropdown-link-active-color: var(--accent-text); --bs-dropdown-border-radius: var(--radius); --bs-dropdown-font-size: .9rem; box-shadow: var(--shadow-pop); }
.dropdown-item { display: flex; align-items: center; gap: .6rem; padding-block: .45rem; }
.dropdown-item .ic { color: var(--muted); }
.modal { --bs-modal-bg: var(--surface); --bs-modal-border-color: var(--line); --bs-modal-border-radius: 1rem; }
.offcanvas { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--ink); }

/* ---------- الهيكل ---------- */
.app { min-height: 100vh; }
.app-main { margin-inline-start: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin .2s ease; }
.app-content { padding: 1.5rem; width: 100%; flex: 1 0 auto; }
:root[data-width="boxed"] .app-content { max-width: 1320px; margin-inline: auto; }
.app-content:focus { outline: none; }
.app-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.5rem; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--line); }
.app-footer .btn-link { color: var(--muted); font-size: .82rem; text-decoration: none; display: inline-flex; gap: .35rem; align-items: center; }

/* القائمة الجانبية */
.app-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1045; width: var(--side-w); background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; border-inline-end: 1px solid var(--side-border); transition: width .2s ease, transform .25s ease; }
.brand { height: var(--top-h); flex: none; display: flex; align-items: center; justify-content: space-between; padding-inline: 1.25rem .75rem; }
.brand-link { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--side-mark); color: var(--side-bg); display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; }
:root[data-menu="dark"] .brand-mark, :root[data-menu="light"] .brand-mark { color: #fff; }
.brand-text { display: grid; line-height: 1.25; min-width: 0; }
.brand-text strong { color: var(--side-active); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-menu="light"] .brand-text strong { color: var(--ink); }
.brand-text small { color: var(--side-title); font-size: .74rem; }
.app-sidebar .brand-close { display: none; color: var(--side-ink); }
.side-scroll { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: .25rem .85rem 2rem; scrollbar-width: thin; scrollbar-color: rgba(127, 127, 127, .3) transparent; }
.side-title { display: flex; align-items: center; gap: .4rem; font-size: .74rem; font-weight: 600; color: var(--side-title); padding: 1.1rem .7rem .45rem; }
.side-title-ic { width: .95rem; height: .95rem; color: #f5b335; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-item { position: relative; }
.side-link { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .58rem .7rem; border: 0; border-radius: .6rem; background: none; color: var(--side-ink); font: inherit; font-size: .925rem; text-align: start; text-decoration: none; cursor: pointer; transition: color .15s, background-color .15s; }
.side-link .ic { width: 22px; height: 22px; }
.side-link:hover, .side-link:focus-visible { color: var(--side-hover); background: var(--side-hover-bg); }
.side-link.active { color: var(--side-active); background: var(--side-active-bg); font-weight: 600; }
.side-link.active .ic, .side-link.active-parent .ic { color: var(--side-mark); }
.side-link.active-parent { color: var(--side-active); }
.side-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-caret { width: 15px; height: 15px; opacity: .7; transition: transform .2s ease; }
.has-sub.open > .side-link .side-caret { transform: rotate(180deg); }
.side-fav .ic { width: 16px; height: 16px; color: #f5b335; margin-inline: 3px; }
.side-badge { flex: none; min-width: 1.4rem; padding: .05rem .4rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.side-sub { list-style: none; margin: 0; padding: .1rem 0 .4rem; display: none; }
.has-sub.open > .side-sub { display: block; }
.side-sub-title { display: none; }
.side-sub a { display: block; position: relative; padding: .42rem .7rem; padding-inline-start: 3.2rem; border-radius: .5rem; color: var(--side-ink); font-size: .885rem; text-decoration: none; }
.side-sub a::before { content: ""; position: absolute; inset-inline-start: 1.75rem; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: currentColor; opacity: .45; transition: transform .15s; }
.side-sub a:hover, .side-sub a:focus-visible { color: var(--side-hover); }
.side-sub a.active { color: var(--side-active); font-weight: 600; }
.side-sub a.active::before { opacity: 1; background: var(--side-mark); transform: scale(1.5); }
.side-backdrop { position: fixed; inset: 0; z-index: 1044; background: rgba(15, 20, 25, .45); }

/* القائمة المصغّرة: أيقونات فقط، والقائمة الفرعية تطفو عند المرور */
@media (min-width: 992px) {
  :root[data-size="condensed"], :root[data-size="hover"] { --side-cur: var(--side-w-sm); }
  :root[data-size="condensed"] .app-main, :root[data-size="hover"] .app-main { margin-inline-start: var(--side-w-sm); }
  :root[data-size="condensed"] .app-sidebar, :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) { width: var(--side-w-sm); }
  :root[data-size="condensed"] .app-sidebar :is(.brand-text, .side-text, .side-caret, .side-title span, .side-badge),
  :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) :is(.brand-text, .side-text, .side-caret, .side-title span, .side-badge) { display: none; }
  :root[data-size="condensed"] .brand, :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) .brand { justify-content: center; padding-inline: 0; }
  :root[data-size="condensed"] .side-scroll, :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) .side-scroll { padding-inline: .7rem; }
  :root[data-size="condensed"] .side-title, :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) .side-title { padding: .6rem 0; justify-content: center; }
  :root[data-size="condensed"] .side-title::after, :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) .side-title::after { content: ""; width: 22px; height: 1px; background: var(--side-title); opacity: .35; }
  :root[data-size="condensed"] .side-title-ic { display: none; }
  :root[data-size="condensed"] .side-link, :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) .side-link { justify-content: center; padding-inline: 0; }
  :root[data-size="hover"] .app-sidebar:not(:hover):not(:focus-within) .side-sub { display: none; }
  :root[data-size="hover"] .app-sidebar:hover, :root[data-size="hover"] .app-sidebar:focus-within { box-shadow: var(--shadow-pop); }

  :root[data-size="condensed"] .side-scroll { overflow: visible; }
  :root[data-size="condensed"] .side-sub { display: none; position: absolute; inset-inline-start: calc(100% + .7rem); top: 0; z-index: 10; min-width: 220px; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
  :root[data-size="condensed"] .side-sub::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: -1.1rem; width: 1.1rem; }
  :root[data-size="condensed"] .side-item:hover > .side-sub, :root[data-size="condensed"] .side-item:focus-within > .side-sub { display: block; }
  :root[data-size="condensed"] .side-sub-title { display: block; padding: .35rem .7rem .45rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
  :root[data-size="condensed"] .side-sub a { color: var(--ink); padding-inline-start: .7rem; }
  :root[data-size="condensed"] .side-sub a::before { display: none; }
  :root[data-size="condensed"] .side-sub a:hover { background: var(--hover); color: var(--ink); }
  :root[data-size="condensed"] .side-sub a.active { color: var(--accent-text); background: var(--accent-soft); }
  :root[data-size="condensed"] .side-link[data-tip]:hover::after { content: attr(data-tip); position: absolute; inset-inline-start: calc(100% + .7rem); top: 50%; transform: translateY(-50%); z-index: 10; white-space: nowrap; padding: .35rem .7rem; border-radius: .5rem; background: var(--ink); color: var(--surface); font-size: .82rem; font-weight: 500; pointer-events: none; }

  /* مخفية: تظهر كطبقة عند الضغط على زر القائمة */
  :root[data-size="hidden"] .app-main { margin-inline-start: 0; }
  :root[data-size="hidden"]:not(.side-open) .app-sidebar { transform: translateX(100%); visibility: hidden; }
  :root[data-size="hidden"].side-open .app-sidebar { box-shadow: var(--shadow-pop); }

  /* القائمة العلوية */
  :root[data-layout="horizontal"] .app-sidebar, :root[data-layout="horizontal"] [data-side-button] { display: none; }
  :root[data-layout="horizontal"] .app-main { margin-inline-start: 0; }
  :root[data-layout="horizontal"] .app-hnav { display: block; }
  :root[data-layout="horizontal"] .tb-brand { display: flex; }
}
@media (max-width: 991.98px) {
  .app-main { margin-inline-start: 0; }
  .app-sidebar { width: min(300px, 86vw); transform: translateX(100%); visibility: hidden; }
  .side-open .app-sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .app-sidebar .brand-close { display: inline-grid; }
  .app-content { padding: 1rem 16px 2rem; }
  .app-footer { padding-inline: 16px; }
}
.side-open .app-sidebar { visibility: visible; }
.side-open .app-sidebar .brand-close { display: inline-grid; }
.side-open body { overflow: hidden; }
@media (min-width: 992px) { .side-open:not([data-size="hidden"]) body { overflow: auto; } }

/* الشريط العلوي */
.app-topbar { position: sticky; top: 0; z-index: 1030; height: var(--top-h); display: flex; align-items: center; gap: .6rem; padding-inline: 1.25rem; background: var(--top-bg); color: var(--top-ink); border-bottom: 1px solid var(--top-line); }
.tb-brand { display: none; align-items: center; gap: .6rem; text-decoration: none; color: inherit; font-weight: 700; }
.tb-title { flex: 1 1 auto; min-width: 0; display: grid; gap: .05rem; }
.tb-crumb { font-size: .74rem; color: var(--top-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-crumb a { color: inherit; text-decoration: none; }
.tb-crumb a:hover { color: var(--accent-text); }
.tb-h { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.page-title { font-size: 1.12rem; font-weight: 700; margin: 0; color: var(--top-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-form { display: contents; }
.fav-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--top-muted); flex: none; }
.fav-btn:hover { background: var(--hover); color: #e6a117; }
.fav-btn .ic { width: 18px; height: 18px; }
.fav-btn .fav-on, .fav-btn.on .fav-off { display: none; }
.fav-btn.on .fav-on { display: block; color: #f5a524; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: none; color: var(--top-muted); position: relative; text-decoration: none; transition: background-color .15s, color .15s; }
.icon-btn:hover, .icon-btn:focus-visible, .icon-btn[aria-expanded="true"] { background: var(--hover); color: var(--top-ink); }
:root[data-topbar="dark"] .app-topbar .icon-btn:hover { background: rgba(255, 255, 255, .08); }
.icon-btn .ic { width: 23px; height: 23px; }
.icon-btn-accent { color: var(--accent); }
.icon-btn-accent:hover, .icon-btn-accent[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.app-sidebar .icon-btn { color: var(--side-ink); }
.d-lg-inline-grid { display: none !important; }
@media (min-width: 992px) { .d-lg-inline-grid { display: inline-grid !important; } }
.d-sm-inline-grid { display: none !important; }
@media (min-width: 576px) { .d-sm-inline-grid { display: inline-grid !important; } }
.when-dark, :root[data-bs-theme="dark"] .when-light { display: none; }
:root[data-bs-theme="dark"] .when-dark { display: block; }
.when-vertical { display: block; } .when-horizontal { display: none; }
:root[data-layout="horizontal"] .when-vertical { display: none; } :root[data-layout="horizontal"] .when-horizontal { display: block; }

.tb-search { display: flex; align-items: center; gap: .55rem; width: clamp(220px, 26vw, 360px); height: 40px; padding-inline: .85rem .5rem; border: 1px solid transparent; border-radius: .65rem; background: var(--top-field); color: var(--top-muted); font: inherit; font-size: .86rem; text-align: start; }
.tb-search:hover { border-color: var(--top-line); }
.tb-search .ic { width: 18px; height: 18px; }
.tb-search-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-kbd { direction: ltr; white-space: nowrap; }
.tb-actions { display: flex; align-items: center; gap: .15rem; }
@media (max-width: 1199.98px) { .tb-search { width: 40px; padding: 0; justify-content: center; border-radius: 50%; background: none; } .tb-search-text, .tb-kbd { display: none; } .tb-search .ic { width: 22px; height: 22px; } }
@media (max-width: 575.98px) { .app-topbar { padding-inline: .5rem; gap: .25rem; } .icon-btn { width: 36px; height: 36px; } .tb-crumb { display: none; } .page-title { font-size: 1rem; } .fav-btn { display: none; } }

.bell .badge { position: absolute; top: 3px; inset-inline-start: 1px; font-size: .62rem; padding: .22em .45em; border: 2px solid var(--top-bg); }
.btn-help { display: inline-flex; align-items: center; gap: .35rem; height: 36px; padding-inline: .7rem; margin-inline: .2rem; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: .85rem; }
.btn-help .ic { width: 18px; height: 18px; }
.btn-help:hover, .btn-help:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 767.98px) { .btn-help { width: 36px; padding: 0; justify-content: center; } .btn-help-text { display: none; } }
.user-btn { display: flex; align-items: center; gap: .5rem; height: 44px; padding: 0 .3rem; margin-inline-start: .25rem; border: 0; border-radius: 999px; background: none; color: var(--top-ink); font: inherit; }
.user-btn:hover { background: var(--hover); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: .9rem; flex: none; }
.user-name { font-size: .88rem; font-weight: 500; max-width: 9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--top-ink); }
.user-caret { width: 14px; height: 14px; color: var(--top-muted); }
@media (max-width: 767.98px) { .user-name, .user-caret { display: none; } }

.dd-head { padding: .7rem 1rem; font-weight: 600; border-bottom: 1px solid var(--line); }
.dd-foot { display: block; padding: .6rem 1rem; text-align: center; border-top: 1px solid var(--line); font-size: .86rem; font-weight: 500; text-decoration: none; color: var(--accent-text); }
.dd-empty { padding: 1.25rem 1rem; margin: 0; color: var(--muted); font-size: .88rem; text-align: center; }
.user-menu { min-width: 250px; padding-top: 0; }
.notif-menu { width: min(370px, 94vw); padding: 0; overflow: hidden; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: .7rem; padding: .7rem 1rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--hover); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .5rem; flex: none; background: transparent; }
.notif-item.unread .notif-dot { background: var(--accent); }
.notif-text { display: grid; gap: .1rem; min-width: 0; font-size: .86rem; }
.notif-text strong { font-weight: 600; }
.notif-item:not(.unread) .notif-text strong { font-weight: 500; color: var(--ink-2); }
.notif-text span { color: var(--muted); }
.notif-text small { color: var(--muted-2); font-size: .75rem; justify-self: start; }
.quick-menu { width: min(390px, 94vw); padding: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; padding: .6rem; }
.quick-tile { display: grid; justify-items: center; gap: .35rem; padding: .75rem .35rem; border-radius: .65rem; color: var(--ink); text-decoration: none; font-size: .8rem; text-align: center; line-height: 1.3; }
.quick-tile .ic { width: 28px; height: 28px; color: var(--accent); }
.quick-tile:hover, .quick-tile:focus-visible { background: var(--accent-soft); color: var(--accent-text); }

/* القائمة العلوية */
.app-hnav { display: none; position: sticky; top: var(--top-h); z-index: 1020; background: var(--side-bg); border-bottom: 1px solid var(--side-border); }
.hnav-list { list-style: none; margin: 0; padding: 0 1rem; display: flex; flex-wrap: wrap; gap: .15rem; }
:root[data-width="boxed"] .hnav-list { max-width: 1320px; margin-inline: auto; }
.hnav-link { display: flex; align-items: center; gap: .5rem; height: 50px; padding-inline: .85rem; border: 0; background: none; color: var(--side-ink); font: inherit; font-size: .9rem; text-decoration: none; position: relative; white-space: nowrap; }
.hnav-link .ic { width: 20px; height: 20px; }
.hnav-link:hover, .hnav-link[aria-expanded="true"] { color: var(--side-hover); }
.hnav-link.active { color: var(--side-active); font-weight: 600; }
.hnav-link.active::after { content: ""; position: absolute; inset-inline: .85rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--side-mark); }
.hnav-link.active .ic { color: var(--side-mark); }
.hnav-caret { width: 13px !important; height: 13px !important; opacity: .7; }
.hnav-menu { min-width: 220px; }
.hnav-mega { padding: .75rem; min-width: 240px; }
.hnav-mega.wide { display: none; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .25rem 1rem; width: min(860px, 92vw); }
.hnav-mega.wide.show { display: grid; }
.mega-col { display: grid; align-content: start; gap: 1px; }
.mega-title { display: flex; align-items: center; gap: .45rem; padding: .35rem .6rem .45rem; font-size: .8rem; font-weight: 700; color: var(--muted); }
.mega-title .ic { width: 18px; height: 18px; color: var(--accent); }
.mega-link { display: block; padding: .38rem .6rem; border-radius: .45rem; color: var(--ink); text-decoration: none; font-size: .88rem; }
.mega-link:hover { background: var(--hover); }
.mega-link.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

/* لوحة التخصيص */
.customizer { --bs-offcanvas-width: 360px; }
.customizer .offcanvas-title { display: flex; align-items: center; gap: .5rem; }
.customizer .offcanvas-title .ic { color: var(--accent); }
.customizer .offcanvas-header { border-bottom: 1px solid var(--line); }
.cz-intro { font-size: .85rem; color: var(--muted); }
.cz-group { margin-bottom: 1.35rem; }
.cz-group legend { font-size: .9rem; font-weight: 700; margin-bottom: .2rem; }
.cz-hint { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.cz-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.cz-layout, .cz-topbar, .cz-width { grid-template-columns: repeat(2, 1fr); }
.cz-size { grid-template-columns: repeat(2, 1fr); }
.cz-accent { grid-template-columns: repeat(6, 1fr); }
.cz-radio { position: absolute; opacity: 0; pointer-events: none; }
.cz-opt { display: grid; justify-items: center; gap: .35rem; padding: .6rem .35rem; border: 1px solid var(--line-2); border-radius: .65rem; font-size: .78rem; text-align: center; cursor: pointer; color: var(--ink-2); line-height: 1.3; transition: border-color .15s, background-color .15s; }
.cz-opt:hover { border-color: var(--muted-2); }
.cz-opt .ic { width: 24px; height: 24px; color: var(--muted); }
.cz-radio:checked + .cz-opt { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.cz-radio:checked + .cz-opt .ic { color: var(--accent); }
.cz-radio:focus-visible + .cz-opt { outline: 2px solid var(--accent); outline-offset: 2px; }
.cz-accent .cz-opt { padding: .45rem .1rem; font-size: .68rem; }
.cz-swatch { width: 26px; height: 26px; border-radius: 50%; display: block; }
.cz-swatch[data-swatch="orange"] { background: #ff6c2f; } .cz-swatch[data-swatch="blue"] { background: #2f6fed; } .cz-swatch[data-swatch="teal"] { background: #1f7a8c; }
.cz-swatch[data-swatch="green"] { background: #1f9d6b; } .cz-swatch[data-swatch="violet"] { background: #7a4fe0; } .cz-swatch[data-swatch="rose"] { background: #e0457b; }
.cz-radio:checked + .cz-opt .cz-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
.cz-preview { display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 9px 1fr; width: 64px; height: 40px; border-radius: .35rem; overflow: hidden; border: 1px solid var(--line-2); background: var(--ground); }
.cz-preview i:first-child { grid-row: 1 / 3; background: #262d34; }
.cz-preview i:last-child { background: var(--surface); border-bottom: 1px solid var(--line-2); }
.cz-p-menu-light i:first-child { background: var(--surface); border-inline-end: 1px solid var(--line-2); }
.cz-p-menu-brand i:first-child { background: var(--accent); }
.cz-p-topbar-dark i:last-child { background: #262d34; }
.cz-p-size-condensed, .cz-p-size-hover { grid-template-columns: 14% 1fr; }
.cz-p-size-hidden { grid-template-columns: 0 1fr; }
.cz-p-width-boxed { padding-inline: 10px; background: var(--line); }
.cz-p-width-boxed i:first-child { background: var(--ground); }
.cz-foot { display: grid; gap: .5rem; padding: 1rem; border-top: 1px solid var(--line); }
.cz-foot .btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }

/* البحث السريع */
.palette .modal-dialog { margin-top: 9vh; }
.palette .modal-content { overflow: hidden; box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.palette-head { display: flex; align-items: center; gap: .7rem; padding: .35rem 1.1rem; border-bottom: 1px solid var(--line); }
.palette-head > .ic { width: 22px; height: 22px; color: var(--muted); }
.palette-input { flex: 1; min-width: 0; height: 56px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 1.05rem; outline: none; }
.palette-input::-webkit-search-cancel-button { display: none; }
.palette-body { max-height: min(60vh, 520px); overflow-y: auto; padding: .4rem .5rem .6rem; overscroll-behavior: contain; }
.pal-group { padding: .6rem .7rem .3rem; font-size: .75rem; font-weight: 700; color: var(--muted); }
.pal-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .7rem; border-radius: .6rem; color: var(--ink); text-decoration: none; cursor: pointer; }
.pal-item.sel { background: var(--accent-soft); }
.pal-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: .55rem; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.pal-ic .ic { width: 20px; height: 20px; }
.pal-item.sel .pal-ic { background: var(--surface); color: var(--accent); border-color: var(--accent-line); }
.pal-text { display: grid; min-width: 0; flex: 1; line-height: 1.35; }
.pal-text strong { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-text small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-text mark { padding: 0; background: none; color: var(--accent-text); font-weight: 700; }
.pal-kind { font-size: .72rem; color: var(--muted); flex: none; direction: ltr; }
.pal-item.sel .pal-kind { color: var(--accent-text); }
.pal-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.palette-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; padding: .6rem 1.1rem; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .76rem; color: var(--muted); }
.palette-foot kbd { margin-inline: 1px; }
.palette-status { margin-inline-start: auto; }
@media (max-width: 575.98px) { .palette .modal-dialog { margin: .5rem; } .palette-foot span:not(.palette-status) { display: none; } }

.kbd-h { font-size: .9rem; font-weight: 700; margin-bottom: .6rem; }
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; align-items: center; }
.kbd-list dt { font-weight: 400; white-space: nowrap; direction: ltr; text-align: end; }
.kbd-list dd { margin: 0; font-size: .9rem; }
#shortcutsTitle { display: flex; align-items: center; gap: .5rem; }
#shortcutsTitle .ic { color: var(--accent); }
.ui-toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 2000; max-width: min(92vw, 460px); padding: .65rem 1.1rem; border-radius: .7rem; background: var(--ink); color: var(--surface); font-size: .88rem; box-shadow: var(--shadow-pop); }

/* ---------- عناصر الصفحات ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { padding: .95rem 1.15rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.panel-head h2 { font-size: 1rem; font-weight: 600; margin: 0; flex: 1; }
.panel-body { padding: 1.15rem; }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--line); --bs-list-group-color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.stat { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.15rem; display: grid; grid-template-columns: 1fr auto; align-content: start; gap: .25rem .75rem; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.stat > :not(.stat-ic) { grid-column: 1; }
a.stat:hover { border-color: var(--accent-line); }
.stat .label { color: var(--muted); font-size: .86rem; }
.stat .value { font-size: 1.55rem; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.3; }
.stat .note { color: var(--muted); font-size: .8rem; }
.stat .note.up { color: var(--success); } .stat .note.down { color: var(--danger); }
.stat-ic { grid-column: 2; grid-row: 1 / span 3; width: 52px; height: 52px; border-radius: .8rem; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-ic .ic { width: 28px; height: 28px; }
.stat.warn .stat-ic { background: var(--warn-soft); color: var(--warn); }
.stat.warn .value { color: var(--warn); }
.stat.warn { border-color: var(--warn-line); }
.stat.danger .stat-ic { background: var(--danger-soft); color: var(--danger); }
.stat.danger { border-color: var(--danger-line); }
.stat.danger .value { color: var(--danger); }

.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line); --bs-table-hover-bg: var(--hover); --bs-table-striped-bg: var(--surface-2); margin: 0; }
.table > thead th { font-weight: 600; color: var(--muted); font-size: .8rem; background: var(--surface-2); border-bottom-width: 1px; white-space: nowrap; }
.table td, .table th { padding: .65rem .9rem; vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.table a:not(.btn) { text-decoration: none; font-weight: 500; }
.table a:not(.btn):hover { text-decoration: underline; }
.panel > .table-wrap:last-child, .panel > .table:last-child { border-radius: 0 0 var(--radius) var(--radius); }

.pill { display: inline-block; font-size: .75rem; padding: .12rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; font-weight: 500; }
.pill.off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.nav-pills { --bs-nav-pills-border-radius: .55rem; gap: .25rem; }
.nav-pills .nav-link { color: var(--ink-2); }
.nav-pills .nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-pills .nav-link.active { background: var(--accent); color: #fff; }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--accent-text); --bs-nav-tabs-link-active-border-color: var(--line) var(--line) var(--surface); --bs-nav-tabs-border-color: var(--line); }
.nav-link { color: var(--ink-2); }
.page-link { color: var(--accent-text); }
.active > .page-link, .page-link.active { background-color: var(--accent); border-color: var(--accent); }

.json-diff { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-word; color: var(--muted); max-width: 420px; margin: 0; }

/* ---------- صفحات الدخول ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 24px 16px; background: var(--ground); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 2.1rem 1.85rem; box-shadow: var(--shadow); }
.auth-card .mark { width: 46px; height: 46px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; margin-bottom: 1.1rem; }
.auth-card h1 { font-size: 1.3rem; margin-bottom: .25rem; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; }
.qr-box { display: grid; place-items: center; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: .5rem; }
.qr-box img, .qr-box svg { width: 200px; height: 200px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; direction: ltr; word-break: break-all; background: var(--ground); border-radius: .4rem; padding: .5rem .75rem; text-align: center; }

/* ---------- صفحة الخطأ ---------- */
.error-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; text-align: center; }
.error-wrap .code { font-size: 3.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1; }
.error-wrap p { color: var(--muted); max-width: 42ch; margin: .75rem auto 1.5rem; }
.ref { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: .4rem; padding: .2rem .6rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* معالج التثبيت */
.install-card { max-width: 560px; }

/* المنتجات */
.tree-indent { display: inline-block; }
.tree-indent[data-depth="1"] { width: 1.25rem; } .tree-indent[data-depth="2"] { width: 2.5rem; } .tree-indent[data-depth="3"] { width: 3.75rem; } .tree-indent[data-depth="4"] { width: 5rem; }
.tree-indent:not([data-depth="0"])::before { content: "└"; color: var(--line); margin-inline-end: .35rem; }
.swatch { display: inline-block; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 1px solid var(--line); vertical-align: middle; background: #fff; }
.size-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.size-cell { border: 1px solid var(--line); border-radius: .45rem; padding: .5rem; display: grid; gap: .25rem; }
.size-cell.off { background: var(--ground); opacity: .75; }
.size-new { max-width: 160px; }
.nav-pills .nav-link { color: var(--muted); }
.nav-pills .nav-link.active { background: var(--accent); color: #fff; }
.thumb { width: 44px; height: 44px; border-radius: .35rem; object-fit: cover; border: 1px solid var(--line); background: var(--ground); display: inline-block; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.gallery figcaption { padding: .4rem .5rem; font-size: .8rem; display: flex; gap: .4rem; align-items: center; justify-content: space-between; }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: start; white-space: nowrap; }
.matrix .has { color: var(--accent); font-weight: 600; }
.d-contents { display: contents; }
.sku-pieces { width: 5.5rem; }
.sku-status { width: 7rem; }
.bc-input { min-width: 8rem; }
.bc-source { width: 5.5rem; }
.btn-close-sm { width: .5em; height: .5em; padding: .15em; vertical-align: middle; margin-inline-start: .25rem; }
fieldset[disabled] .form-control, fieldset[disabled] .form-select { background-color: var(--ground); }

.error-trace { white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; background: var(--ground); padding: .75rem; border-radius: 6px; }

/* المخزون والاستلام */
.qty-input { width: 3.6rem; min-width: 3.6rem; text-align: center; padding-inline: .25rem; }
.price-input { width: 5rem; min-width: 5rem; text-align: center; padding-inline: .25rem; }
.fx-input { width: 4rem; min-width: 4rem; text-align: center; padding-inline: .25rem; }
.cur-select { width: 4.9rem; min-width: 4.9rem; }
.loc-select { width: 5rem; min-width: 5rem; }
.receipt-lines td, .receipt-lines th { white-space: nowrap; padding-inline: .35rem; }
.receipt-lines tbody td:first-child { white-space: normal; min-width: 9rem; }
.matrix th, .matrix td { white-space: nowrap; }
.stat .fs-4 { font-weight: 600; }
.stat-chip { display: inline-flex; align-items: baseline; gap: .5rem; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 10px; }
.stat-chip strong { font-size: 1.25rem; }

/* المساعدة */
.help-panel { --bs-offcanvas-width: min(560px, 100vw); }
.help-body { font-size: .95rem; line-height: 1.8; }
.help-intro { font-size: 1rem; color: var(--ink); background: var(--accent-soft); border-radius: .5rem; padding: .75rem 1rem; }
.help-sec { margin-top: 1.25rem; }
.help-sec h3 { font-size: 1rem; font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: .35rem; margin-bottom: .6rem; }
.help-sec ul, .help-sec ol { padding-inline-start: 1.25rem; margin-bottom: .5rem; }
.help-sec li { margin-bottom: .3rem; }
.help-fields dt { font-weight: 700; margin-top: .6rem; }
.help-fields dd { margin: .1rem 0 0; color: var(--ink-2); }
.help-example p { background: var(--tip-bg); border-inline-start: 3px solid var(--tip-line); padding: .6rem .9rem; border-radius: .35rem; }
.help-faq { border: 1px solid var(--line); border-radius: .4rem; padding: .5rem .75rem; margin-bottom: .5rem; }
.help-faq summary { cursor: pointer; font-weight: 600; }
.help-faq p { margin: .5rem 0 0; }
.help-inline { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: .75rem 1rem; }
.help-inline > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.auth-help { width: 100%; max-width: 400px; margin-top: 1rem; }
.plain-help { max-width: 760px; margin: 1.5rem auto; padding: 0 16px; }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.flow-steps { display: flex; list-style: none; margin: 0; padding: .6rem 1.25rem; gap: .4rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; counter-reset: st; }
.flow-steps li { counter-increment: st; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.flow-steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1px solid var(--line); font-size: .75rem; }
.flow-steps li:not(:last-child)::after { content: '←'; margin-inline-start: .4rem; color: var(--line); }
.flow-steps li.done { color: var(--accent); }
.flow-steps li.done::before { background: var(--accent); color: #fff; border-color: var(--accent); content: '✓'; }
.flow-steps li.current { color: var(--ink); font-weight: 700; }
.flow-steps li.current::before { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* جدول تكاليف الاستيراد وتوزيعها */
.cost-grid td, .cost-grid th { white-space: nowrap; padding-inline: .3rem; }
.cost-grid select.form-select-sm { min-width: 6.5rem; }
.cost-grid tbody#newCosts tr:first-child td { border-top: 2px dashed var(--line); }
.alloc td, .alloc th { white-space: nowrap; padding-inline: .35rem; }
.alloc .landed { color: var(--accent); font-weight: 700; }

/* جدول الألوان × المقاسات */
.vgrid th, .vgrid td { white-space: nowrap; }
.vgrid .vcell { min-width: 5.5rem; padding: .35rem .25rem; }
.vcell-box { display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; padding: .2rem .35rem; border-radius: .35rem; }
.vcell-box .form-check-input { width: 1.25rem; height: 1.25rem; margin: 0; cursor: pointer; }
.vcell.was-off .vcell-box { background: var(--ground); }
.vcell.was-off::after { content: 'موقوف'; display: block; font-size: .7rem; color: var(--muted); }
.vcell-lock { color: var(--warn); font-size: .6rem; }
.vcell-bc { font-size: .68rem; color: var(--muted); letter-spacing: .02em; }
.vpieces input { width: 4.5rem; margin-inline: auto; text-align: center; }
.toggle-all { font-size: .75rem; text-decoration: none; }
.vmore > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.vbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; background: var(--ground); border: 1px solid var(--line); border-radius: .5rem; padding: .5rem .75rem; }
.barcode-sample { background: var(--ground); border: 1px dashed var(--line); border-radius: .5rem; padding: .75rem 1rem; }
.vpieces input::placeholder { color: var(--muted-2); font-weight: 400; }
.vpieces input:not(:placeholder-shown) { font-weight: 700; color: var(--accent); border-color: var(--accent); }

/* الجرد */
.scope-options { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.scope-opt { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: .5rem; padding: .75rem; cursor: pointer; }
.scope-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.scope-opt small { display: block; color: var(--muted); }
.scope-opt > span { flex: 1; }
.count-input { width: 6rem; font-size: 1.1rem; text-align: center; font-weight: 600; }
.count-sheet tr.counted-row { background: var(--success-soft); }
.count-sheet tr.recount-row { background: var(--danger-soft); }
.sticky-actions { position: sticky; bottom: 0; background: var(--ground); padding: .6rem 0; z-index: 5; border-top: 1px solid var(--line); margin-bottom: 1rem; }
tr.diff-short td:nth-child(5) { color: var(--danger); }
tr.diff-over td:nth-child(5) { color: var(--success); }
.reason-input { min-width: 11rem; }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* الأسعار */
.price-cells { display: flex; flex-wrap: wrap; gap: .6rem; }
.price-cell { border: 1px solid var(--line); border-radius: .5rem; padding: .35rem .5rem; min-width: 8.5rem; background: var(--surface); }
.price-cell.no-price { border-color: var(--danger-line); background: var(--danger-soft); }
.price-cell.is-manual { border-color: var(--warn-line); }
.price-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .15rem; }
.price-in { width: 6.5rem; text-align: center; font-weight: 600; }
.price-in::placeholder { color: var(--muted-2); font-weight: 400; }
.price-in.is-own { border-color: var(--accent); }
.price-hints { display: flex; flex-wrap: wrap; gap: .15rem .5rem; font-size: .72rem; margin-top: .2rem; }
.price-grid .pg-model { min-width: 9rem; }

/* الطلبات */
.order-lines td:first-child { min-width: 15rem; }
.order-lines .qty-input { min-width: 4.5rem; }

/* الطباعة: الفاتورة وقائمة التجهيز تُطبع بلا قوائم */
.print-only { display: none; }
@media print {
  .app-sidebar, .app-topbar, .app-hnav, .app-footer, .side-backdrop, .skip-link, .no-print, .help-panel, .alert, .sales-tabs, nav.nav-pills { display: none !important; }
  .print-only { display: block; }
  .app, .app-main, .app-content { display: block !important; margin: 0 !important; padding: 0 !important; max-width: none !important; background: #fff !important; }
  .panel, .stat { box-shadow: none !important; }
  body { background: #fff !important; font-size: 12pt; }
  .panel { border: 0 !important; box-shadow: none !important; }
  .table-wrap { overflow: visible !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .qty-input { border: 0 !important; }
}
.invoice-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.invoice-head .company { font-size: 1.4rem; font-weight: 700; }
.invoice-total { font-size: 1.35rem; font-weight: 700; }
.picked-short { background: var(--warn-soft); }

/* المحاسبة */
.acc-group td { font-weight: 600; background: var(--ground); }
.acc-total td, .acc-total th { font-weight: 700; border-top: 2px solid var(--line); }
.acc-grand td { font-weight: 700; font-size: 1.05rem; background: var(--accent-soft); }
.fs-amount { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.fs-neg, .table td.fs-neg, .table .fs-neg { color: var(--danger); }
.jl-table input.form-control, .jl-table select.form-select { min-width: 0; }
.jl-table td { padding: .35rem .4rem; }
@media (max-width: 575.98px) {
  .jl-table thead { display: none; }
  .jl-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .jl-table td { border: 0; padding: 0; }
  .jl-table td.jl-acc, .jl-table td.jl-memo { grid-column: 1 / -1; }
  .jl-table tfoot tr { display: flex; justify-content: space-between; }
}
.jl-w-acc { width: 38%; } .jl-w-amt { width: 15%; }

/* نقطة البيع */
.pos-total { font-size: 1.9rem; color: var(--accent); }
.pos-change { font-size: 1.15rem; font-weight: 600; min-height: 1.6rem; }
.pos-w-qty { width: 90px; }
.pos-disc { min-width: 120px; max-width: 150px; }
.pos-lines td { padding: .45rem .5rem; }
@media (max-width: 767.98px) {
  .pos-lines thead { display: none; }
  .pos-lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .35rem; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
  .pos-lines td { border: 0; padding: 0; }
  .pos-lines td.pos-item { grid-column: 1 / -1; }
}

/* أشرطة التقارير والرسم */
svg .bar { fill: var(--accent); opacity: .75; }
svg .bar-neg { fill: var(--danger); opacity: .7; }
svg .bar-muted { fill: var(--line); }
.chart-days { width: 100%; height: 120px; display: block; }
.chart-days text { font-size: 10px; fill: var(--muted); }

/* الإشعارات والشعار */
.bell { position: relative; }
.bell .badge { position: absolute; top: -.35rem; inset-inline-start: -.45rem; font-size: .65rem; }
.notif-unread { background: var(--accent-soft); }
.company-logo { max-height: 64px; max-width: 180px; object-fit: contain; }
.letterhead { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.letterhead .lh-text { line-height: 1.4; }
.letterhead .lh-name { font-weight: 700; font-size: 1.1rem; }

/* طلبات تسجيل المتجر */
.signup-card { border: 1px solid var(--line); border-radius: .5rem; padding: .75rem 1rem; margin-bottom: .75rem; background: var(--surface); }
.signup-card:last-of-type { margin-bottom: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .15rem .75rem; max-height: 220px; overflow: auto; }
.limit-input { width: 9rem; flex: 0 0 auto; }
@media (max-width: 575.98px) { .limit-input { width: 6.5rem; } }

/* النسخ الاحتياطي */
.bk-restore { display: inline-block; vertical-align: top; }
.bk-restore > summary { list-style: none; }
.bk-restore > summary::-webkit-details-marker { display: none; }
.bk-restore-form { min-width: 260px; max-width: 340px; white-space: normal; text-align: start; margin-top: .5rem; padding: .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); }

/* ترحيل البيانات */
.step-no { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent-soft); font-size: .9rem; margin-inline-end: .35rem; }
.import-preview td ul { min-width: 220px; }
.readiness-list { list-style: none; margin: 0; padding: 0; }
.readiness-list li { display: flex; gap: .75rem; align-items: center; padding: .65rem 1rem; border-top: 1px solid var(--line); }
.readiness-list li:first-child { border-top: 0; }
.readiness-icon { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-weight: 700; background: var(--ground); flex: none; }
.readiness-fail { background: var(--danger-soft); }

.tb-brand .brand-mark { background: var(--accent); color: #fff; width: 34px; height: 34px; font-size: 1rem; }
@media print {
  :root, :root[data-bs-theme="dark"] { --ink: #111; --ink-2: #333; --muted: #555; --line: #ccc; --line-2: #bbb; --surface: #fff; --surface-2: #f4f4f4; --ground: #fff; --bs-body-bg: #fff; --bs-body-color: #111; color-scheme: light; }
}

/* الوسوم */
.tag-list { display: inline-flex; flex-wrap: wrap; gap: .25rem; vertical-align: middle; }
.tag { --tg: #6b7385; display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 500; line-height: 1.6; white-space: nowrap; text-decoration: none !important;
       color: color-mix(in srgb, var(--tg) 80%, var(--ink)); background: color-mix(in srgb, var(--tg) 13%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tg) 28%, var(--surface)); }
a.tag:hover { background: color-mix(in srgb, var(--tg) 22%, var(--surface)); }
.tag-blue { --tg: #2f6fed; } .tag-teal { --tg: #1f7a8c; } .tag-green { --tg: #1f9d6b; } .tag-orange { --tg: #e8690b; }
.tag-red { --tg: #d23c3c; } .tag-violet { --tg: #7a4fe0; } .tag-pink { --tg: #d6457f; }
:root[data-bs-theme="dark"] .tag { color: color-mix(in srgb, var(--tg) 55%, #fff); }
.tag-colors { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag-colors label { cursor: pointer; }
.tag-colors .cz-radio:checked + label { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--tg); font-weight: 700; }
.tag-colors .cz-radio:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-actions { display: inline-block; text-align: start; position: relative; }
.tag-actions > summary { list-style: none; }
.tag-actions > summary::-webkit-details-marker { display: none; }
.tag-actions-body { position: absolute; inset-inline-end: 0; top: 100%; z-index: 20; width: min(320px, 80vw); margin-top: .35rem; padding: .85rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface); box-shadow: var(--shadow-pop); white-space: normal; }
.tags-box .panel-head .tag-list { flex: 0 1 auto; }
td .tag-list { margin-top: .2rem; }
/* محرر الوسوم (شارات + خانة) */
.tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-height: 31px; padding: .2rem .4rem; border: 1px solid var(--line-2); border-radius: var(--bs-border-radius); background: var(--bs-body-bg); cursor: text; flex: 1 1 14rem; min-width: 0; }
.tag-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .18); }
.tag-editor input { flex: 1; min-width: 6rem; width: 6rem; border: 0; outline: 0; background: none; color: var(--ink); font-size: .875rem; padding: .1rem .2rem; }
.tag-editor .tag button { border: 0; background: none; color: inherit; padding: 0 0 0 .1rem; line-height: 1; font-size: .9rem; opacity: .7; }
.tag-editor .tag button:hover { opacity: 1; }
@media (min-width: 768px) { .table-wrap:has(.tags-table) { overflow: visible; } }

/* ---------- نقطة البيع (شاشة البيع) ---------- */
.pos-app { --pos-order-w: 400px; }
.pos-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; padding: .6rem .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pos-bar-reg { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.pos-bar-reg strong { display: block; font-size: 1rem; }
.pos-bar-reg small { color: var(--muted); font-size: .78rem; }
.pos-bar-ic { width: 40px; height: 40px; border-radius: .7rem; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.pos-bar-ic .ic { width: 24px; height: 24px; }
.pos-bar-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-inline-start: auto; align-items: center; }
.pos-bar-actions .btn { display: inline-flex; align-items: center; gap: .3rem; }
.pos-bar-actions .btn .ic { width: 18px; height: 18px; }
.pos-parked { min-width: 300px; }
.pos-parked .dropdown-item { gap: 1rem; }
.when-full, .pos-focus .when-normal { display: none; }
.pos-focus .when-full { display: inline-block; }

.pos-screen { display: grid; grid-template-columns: minmax(0, 1fr) var(--pos-order-w); gap: 1rem; align-items: start; }
.pos-catalog { min-width: 0; }
.pos-search { position: sticky; top: calc(var(--top-h) + .5rem); z-index: 5; display: flex; align-items: center; gap: .5rem; padding: .35rem .35rem .35rem .35rem; padding-inline-start: .9rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: .8rem; box-shadow: var(--shadow); margin-bottom: .75rem; }
.pos-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .15); }
.pos-search > .ic { width: 20px; height: 20px; color: var(--muted); }
.pos-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font-size: 1rem; height: 42px; }
.pos-search input::-webkit-search-cancel-button { cursor: pointer; }
.pos-cats { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .6rem; scrollbar-width: thin; }
.pos-cat { flex: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: .32rem .85rem; font-size: .85rem; white-space: nowrap; }
.pos-cat span { color: var(--muted); font-size: .75rem; margin-inline-start: .2rem; }
.pos-cat:hover { border-color: var(--accent-line); }
.pos-cat.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pos-cat.active span { color: rgba(255, 255, 255, .8); }

.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .6rem; }
.pos-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: .75rem; background: var(--surface); color: var(--ink); text-align: start; overflow: hidden; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; cursor: pointer; font: inherit; }
.pos-card:hover { border-color: var(--accent-line); }
.pos-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pos-card:active, .pos-card.added { transform: scale(.97); border-color: var(--accent); }
.pos-card.no-price { opacity: .6; }
.pos-card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface-2); }
.pos-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pos-card-ph { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2rem; font-weight: 700; color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
.pos-card-stock { position: absolute; top: .35rem; inset-inline-end: .35rem; min-width: 1.6rem; padding: .05rem .4rem; border-radius: 999px; background: rgba(20, 24, 30, .72); color: #fff; font-size: .7rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.pos-card-body { display: grid; gap: .1rem; padding: .45rem .55rem .55rem; }
.pos-card-name { font-size: .82rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.2em; }
.pos-card-meta { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-card-price { font-size: .9rem; font-weight: 700; color: var(--accent-text); }
.pos-card-price small { font-weight: 400; font-size: .7rem; color: var(--muted); }
.pos-none { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2rem 1rem; margin: 0; }

.pv-head { margin-bottom: .75rem; }
.pv-list { display: grid; gap: .5rem; }
.pv-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .65rem; }
.pv-name { min-width: 9rem; flex: 1; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.pv-name small { width: 100%; }
.pv-units { display: flex; flex-wrap: wrap; gap: .4rem; }
.pv-btn { display: grid; justify-items: center; gap: 0; min-width: 6.2rem; padding: .35rem .6rem; border: 1px solid var(--accent-line); border-radius: .6rem; background: var(--accent-soft); color: var(--ink); font: inherit; font-size: .78rem; line-height: 1.35; transition: transform .1s; }
.pv-btn strong { font-size: .95rem; color: var(--accent-text); }
.pv-btn small { color: var(--muted); font-size: .7rem; }
.pv-btn:hover { border-color: var(--accent); }
.pv-btn.added { transform: scale(.94); background: var(--accent); color: #fff; }
.pv-btn.added strong, .pv-btn.added small { color: #fff; }
.pv-btn:disabled { opacity: .5; }
.swatch-sm { width: .85rem; height: .85rem; }

.pos-order { position: sticky; top: calc(var(--top-h) + .5rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: calc(100vh - var(--top-h) - 1.5rem); display: flex; flex-direction: column; overflow: hidden; }
.pos-order-inner { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.pos-order-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem .5rem; }
.pos-order-title h2 { font-size: 1rem; margin: 0; }
.pos-order-title h2 .ltr { font-size: .8rem; color: var(--muted); font-weight: 500; }
.pos-customer { display: flex; align-items: center; gap: .6rem; margin: 0 1rem .5rem; padding: .5rem .6rem; border-radius: .65rem; background: var(--surface-2); border: 1px solid var(--line); }
.pos-customer .avatar { width: 34px; height: 34px; }
.pos-customer .avatar .ic { width: 20px; height: 20px; }
.pos-customer-text { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.pos-customer-text strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-customer-text small { color: var(--muted); font-size: .74rem; }
.pos-lines-form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.pos-lines-list { overflow-y: auto; padding: 0 1rem; flex: 1 1 auto; min-height: 90px; overscroll-behavior: contain; }
.pos-line { padding: .55rem 0; border-bottom: 1px dashed var(--line-2); }
.pos-line:last-child { border-bottom: 0; }
.pos-line-top { display: flex; gap: .5rem; align-items: flex-start; }
.pos-line-name { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.pos-line-name strong { font-size: .86rem; }
.pos-line-name small { color: var(--muted); font-size: .74rem; display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.pos-line-x { border: 0; background: var(--danger-soft); color: var(--danger); width: 24px; height: 24px; border-radius: 50%; line-height: 1; font-size: 1rem; flex: none; }
.pos-line-bottom { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.pos-unit { width: auto; max-width: 7.5rem; }
.pos-unit-label { font-size: .78rem; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: .4rem; padding: .15rem .45rem; }
.pos-qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: .55rem; overflow: hidden; }
.pos-qty button { width: 30px; height: 30px; border: 0; background: var(--surface-2); color: var(--ink); font-size: 1.05rem; line-height: 1; }
.pos-qty button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-text); }
.pos-qty button:disabled { opacity: .4; }
.pos-qty input { width: 2.8rem; height: 30px; border: 0; text-align: center; background: var(--surface); color: var(--ink); font-weight: 600; }
.pos-line-total { margin-inline-start: auto; display: grid; text-align: end; line-height: 1.25; }
.pos-line-total > span { font-weight: 700; }
.pos-line-total small { color: var(--muted); font-size: .7rem; }
.pos-line-disc { margin-top: .25rem; }
.pos-line-disc summary { font-size: .74rem; color: var(--accent-text); cursor: pointer; width: max-content; }
.pos-line-disc .pos-disc { max-width: 11rem; margin-top: .3rem; }
.pos-empty { text-align: center; color: var(--muted); padding: 1.5rem .5rem; }
.pos-empty .ic { width: 42px; height: 42px; color: var(--muted-2); }
.pos-empty p { margin: .4rem 0 0; font-size: .86rem; }
.pos-order-disc { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .5rem 1rem; border-top: 1px solid var(--line); }
.pos-order-disc .input-group { width: 9.5rem; }
.pos-pay { padding: .75rem 1rem 1rem; border-top: 1px solid var(--line); background: var(--surface-2); flex: none; }
.pos-sums { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; margin: 0 0 .5rem; font-size: .86rem; }
.pos-sums dt { font-weight: 400; color: var(--muted); }
.pos-sums dd { margin: 0; text-align: end; }
.pos-sums .pos-grand { font-size: 1rem; color: var(--ink); font-weight: 700; align-self: center; }
.pos-sums dd.pos-grand { font-size: 1.6rem; color: var(--accent-text); }
.pos-quick { display: flex; gap: .35rem; margin-bottom: .5rem; }
.pos-quick .btn { flex: 1; }
.pos-pay-btn { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-weight: 600; }
.pos-mixed summary { color: var(--accent-text); cursor: pointer; }
.pos-jump { display: none; }
.is-busy .pos-order { opacity: .85; }
.ui-toast.bad { background: var(--danger); color: #fff; }

@media (max-width: 1199.98px) { .pos-app { --pos-order-w: 360px; } .pos-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); } }
@media (max-width: 991.98px) {
  .pos-screen { grid-template-columns: 1fr; }
  .pos-order { position: static; max-height: none; }
  .pos-lines-list { max-height: none; }
  .pos-search { top: calc(var(--top-h) + .25rem); }
  .pos-jump { display: flex; position: fixed; bottom: 1rem; inset-inline: 1rem; z-index: 1035; justify-content: center; align-items: center; gap: .5rem; padding: .75rem 1rem; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-pop); }
  .pos-jump .ic { width: 20px; height: 20px; }
  .pos-app { padding-bottom: 4.5rem; }
}
@media (max-width: 575.98px) { .pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; } .pos-card-body { padding: .35rem .4rem .45rem; } .pos-card-name { font-size: .76rem; } .pos-bar-actions { margin-inline-start: 0; } }

/* وضع التركيز / ملء الشاشة: شاشة البيع وحدها */
.pos-focus .app-sidebar, .pos-focus .app-topbar, .pos-focus .app-hnav, .pos-focus .app-footer, .pos-focus .side-backdrop { display: none !important; }
.pos-focus .app-main { margin-inline-start: 0 !important; }
.pos-focus .app-content { max-width: none !important; padding: .75rem; }
.pos-focus .pos-search, .pos-focus .pos-order { top: .75rem; }
.pos-focus .pos-order { max-height: calc(100vh - 6.2rem); }
.pos-focus .pos-bar { margin-bottom: .75rem; }
@media (min-width: 1400px) { .pos-focus .pos-app { --pos-order-w: 440px; } }
/* شاشة البيع تملأ ارتفاع الشاشة: البطاقات تتمرر داخل عمودها، والفاتورة ثابتة بزر الدفع ظاهرًا دائمًا */
@media (min-width: 992px) {
  .pos-app { display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - 2.5rem); min-height: 560px; }
  .pos-bar { flex: none; }
  .pos-screen { flex: 1 1 auto; min-height: 0; align-items: stretch; }
  .pos-catalog { display: flex; flex-direction: column; min-height: 0; }
  .pos-search { position: static; flex: none; }
  .pos-cats { flex: none; }
  .pos-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; padding: 2px; padding-inline-end: 4px; overscroll-behavior: contain; scrollbar-width: thin; }
  .pos-order { position: static; max-height: none; height: 100%; }
  :root[data-layout="horizontal"] .pos-app { height: calc(100vh - var(--top-h) - 50px - 2.5rem); }
  .pos-focus .pos-app { height: calc(100vh - 1.5rem); }
  .pos-focus .pos-order { max-height: none; }
}
.pos-pay #cash { font-size: 1.1rem; padding-block: .4rem; }
.pos-grid { grid-auto-rows: max-content; }
.pos-cash { display: flex; align-items: center; gap: .6rem; }
.pos-cash label { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.pos-cash input { flex: 1; }
.pos-pay .pos-change { min-height: 1.4rem; font-size: 1rem; }
.pos-sums dd.pos-grand { font-size: 1.45rem; }
.pv-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.pv-tab { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: .3rem .9rem; font-size: .86rem; }
.pv-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pv-table { border-collapse: separate; border-spacing: .3rem; margin-inline: -.3rem; }
.pv-table thead th { text-align: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.pv-table tbody th { white-space: nowrap; font-size: .85rem; font-weight: 600; padding-inline-end: .5rem; }
.pv-table tbody th .swatch { margin-inline-end: .3rem; }
.pv-table td { text-align: center; }
.pv-table .pv-btn { min-width: 3.6rem; padding: .3rem .4rem; }
.pv-table .pv-btn strong { font-size: .95rem; }
.pv-na { color: var(--muted-2); }
.pos-order-disc { display: block; }
.pos-order-disc summary { color: var(--accent-text); cursor: pointer; }
.pos-order-disc-body { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .35rem; }
.pos-customer { padding: .35rem .5rem; }
.pos-order-head { padding-bottom: .35rem; }

/* دفاتر الشيكات: شبكة الأوراق */
.leaf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .35rem; direction: ltr; }
.leaf { display: block; text-align: center; font-size: .78rem; font-variant-numeric: tabular-nums; padding: .28rem .2rem; border-radius: .4rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); text-decoration: none; }
.leaf.free.next { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.leaf.used { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.leaf.done { background: var(--success-soft); border-color: transparent; color: var(--success); }
.leaf.bad { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.leaf.void { background: var(--surface-2); color: var(--muted-2); text-decoration: line-through; border-style: dashed; }
a.leaf:hover { filter: brightness(.96); }
.leaf-legend { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.leaf-legend .leaf { display: inline-block; padding: .05rem .5rem; font-size: .72rem; }
.leaf-progress { width: 4.5rem; height: .45rem; vertical-align: middle; accent-color: var(--accent); }
/* المبلغ بالحروف في السندات */
.amount-words { display: inline-block; padding: .35rem .8rem; border-radius: .5rem; background: var(--surface-2); border: 1px dashed var(--line-2); font-size: .92rem; }
/* روابط الوصول لموقع العميل */
.map-links { display: inline-flex; gap: .35rem; align-items: center; margin-inline-start: .25rem; }
.map-links a { text-decoration: none; }
.nearby-go { white-space: nowrap; }
@media (max-width: 767.98px) { .nearby-go { white-space: normal; } .nearby-go .btn { margin-bottom: .25rem; } }
/* المندوبون: التقدم نحو الهدف */
.target-progress { width: 4.5rem; height: .5rem; vertical-align: middle; accent-color: var(--accent); }
.target-progress.wide { width: 100%; display: block; margin: .3rem 0 .2rem; }
.target-progress.done { accent-color: var(--success); }
.reps-table td { vertical-align: top; }
.stat.ok .value { color: var(--success); }
.stat.ok { border-color: color-mix(in srgb, var(--success) 35%, var(--surface)); }
/* تسجيل زيارة: أزرار النتيجة */
.visit-outcomes { display: flex; flex-wrap: wrap; gap: .35rem; }
.visit-outcomes .btn { flex: 1 1 auto; min-width: 6.5rem; }
/* شرائح خصم الكمية */
.tier-box { border: 1px dashed var(--line-2); border-radius: .6rem; padding: .75rem; background: var(--surface-2); }
.tier-row .form-control { max-width: 7rem; }
.qty-hint { display: flex; gap: .5rem; align-items: center; padding: .5rem .75rem; border-radius: .6rem; background: var(--accent-soft); color: var(--accent-text); font-size: .9rem; }

/* ---------- الإدخال على مراحل (wizard.js) ---------- */
.wz-bar { list-style: none; margin: 0 0 1rem; padding: .35rem; display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.wz-item { flex: 1 0 auto; display: flex; align-items: center; min-width: 0; }
.wz-item + .wz-item::before { content: ""; flex: 1 1 1.25rem; min-width: .5rem; height: 2px; background: var(--line-2); margin: 0 .15rem; }
.wz-item.is-done + .wz-item::before, .wz-item.is-done + .wz-item.is-current::before { background: var(--success); }
.wz-dot { display: flex; align-items: center; gap: .4rem; border: 0; background: none; padding: .45rem .45rem; border-radius: .5rem; color: var(--muted); font: inherit; white-space: nowrap; cursor: pointer; }
.wz-dot:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.wz-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wz-n { width: 1.75rem; height: 1.75rem; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .85rem;
  border: 1.5px solid var(--line-2); background: var(--surface); font-variant-numeric: tabular-nums; }
.wz-t { font-size: .9rem; font-weight: 500; }
.wz-item.is-current .wz-dot { color: var(--ink); }
.wz-item.is-current .wz-n { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.wz-item.is-current .wz-t { font-weight: 600; }
.wz-item.is-done .wz-n { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.wz-item.is-done .wz-dot { color: var(--ink-2); }
.wz-item.is-locked .wz-dot { opacity: .45; cursor: not-allowed; }
.wz-on [data-step][hidden] { display: none !important; }
.wz-on [data-step]:focus { outline: none; }
.wz-hint { margin: 0 0 .75rem; padding: .55rem .8rem; border-inline-start: 3px solid var(--accent); background: var(--accent-soft); border-radius: .4rem; color: var(--ink-2); font-size: .9rem; }
.wz-nav { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: var(--ground); padding: .6rem 0; border-top: 1px solid var(--line); margin-bottom: 1rem; }
.wz-count { color: var(--muted); font-size: .85rem; margin-inline-end: auto; font-variant-numeric: tabular-nums; }
.wz-prev + .wz-count { margin-inline-start: .25rem; }
.wz-final { display: flex; gap: .5rem; flex-wrap: wrap; }
.wz-final[hidden] { display: none; }
.wz-review { display: grid; gap: .75rem; }
.wz-rv { border: 1px solid var(--line); border-radius: .6rem; background: var(--surface); }
.wz-rv-head { display: flex; align-items: center; justify-content: space-between; padding: .5rem .9rem; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: .6rem .6rem 0 0; }
.wz-rv-head h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.wz-dl { display: grid; grid-template-columns: minmax(8rem, 30%) 1fr; gap: .35rem 1rem; margin: 0; padding: .7rem .9rem; font-size: .9rem; }
.wz-dl dt { color: var(--muted); font-weight: 500; }
.wz-dl dd { margin: 0; overflow-wrap: anywhere; }
.wz-empty { margin: 0; padding: .7rem .9rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 767.98px) {
  .wz-item:not(.is-current) .wz-t { display: none; }
  .wz-item { flex: 0 0 auto; }
  .wz-item + .wz-item::before { flex: 0 0 .9rem; }
  .wz-dl { grid-template-columns: 1fr; gap: 0; }
  .wz-dl dd { margin-bottom: .45rem; }
  .wz-count { display: none; }
  .wz-next { flex: 1; }
}
@media print { .wz-bar, .wz-nav { display: none !important; } .wz-on [data-step][hidden] { display: block !important; } }
.panel > .wz-hint { margin: .9rem 1.15rem 0; }
.panel > .wz-review { padding: 1.15rem; }
.panel > .wz-hint + .wz-review { padding-top: .9rem; }
.form-sub { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin: .5rem 0 0; padding-bottom: .35rem; border-bottom: 1px dashed var(--line-2); }
.row > .col-12:first-child > .form-sub { margin-top: 0; }
.panel .wz-nav { background: var(--surface); }
.col-12 > .wz-hint { margin-bottom: 0; }
.wz-static .wz-dot { cursor: default; }
.wz-static .wz-item.is-locked .wz-dot { opacity: .6; cursor: default; }
.wz-static .wz-dot:hover { background: none !important; color: inherit; }
.pos-count { margin: -.35rem 0 .6rem; padding-inline-start: .9rem; font-size: .82rem; color: var(--muted); }
.pv-btn.pv-hit { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.pv-btn.pv-hit strong, .pv-btn.pv-hit small { color: #fff; }
.carton-box { border: 1px dashed var(--line-2); border-radius: .6rem; padding: .8rem .9rem; background: var(--surface-2); }
.pos-carton { color: var(--accent-text); font-weight: 600; }
.pv-tab.pv-tab-carton:not(.active) { border-style: dashed; }

/* صور الألوان (نقطة البيع والطلبات) */
.pv-layout.has-gallery { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 768px) { .pv-layout.has-gallery { grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); } }
.pv-main { min-width: 0; }
.cg-main { position: relative; aspect-ratio: 1 / 1; border-radius: .75rem; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.cg-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-cap { position: absolute; bottom: .45rem; inset-inline-start: .45rem; max-width: calc(100% - .9rem); padding: .1rem .6rem; border-radius: 999px; background: rgba(20, 24, 30, .72); color: #fff; font-size: .75rem; font-weight: 600; }
.cg-cap:empty { display: none; }
.cg-thumbs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.cg-thumb { width: 3rem; height: 3rem; padding: 0; border: 2px solid var(--line); border-radius: .5rem; overflow: hidden; background: var(--surface-2); }
.cg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-thumb.cg-mine { border-color: var(--accent-line); }
.cg-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cg-color { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid transparent; background: none; color: inherit; font: inherit; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.cg-color:hover { background: var(--surface-2); }
.cg-color.cg-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.pv-table tbody th .cg-color .swatch, .oc-table .cg-color .swatch { margin: 0; }

/* بطاقات الموديلات في إدخال الطلب */
.oc-search { position: static; box-shadow: none; }
.oc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
@media (max-width: 575.98px) { .oc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; } }
.oc-head { margin-bottom: .75rem; }
.oc-table { border-collapse: separate; border-spacing: .3rem; margin-inline: -.3rem; }
.oc-table thead th { text-align: center; font-size: .78rem; color: var(--muted); font-weight: 600; }
.oc-table tbody th { white-space: nowrap; padding-inline-end: .4rem; }
.oc-table td { text-align: center; vertical-align: top; min-width: 7.2rem; }
.oc-step { display: flex; align-items: center; justify-content: center; gap: .2rem; }
.oc-step input { width: 3.2rem; text-align: center; font-variant-numeric: tabular-nums; }
.oc-btn { width: 2.1rem; height: 2.2rem; flex: none; border: 1px solid var(--line-2); border-radius: .5rem; background: var(--surface); color: var(--ink); font-size: 1.15rem; line-height: 1; padding: 0; }
.oc-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.oc-avail, .oc-incell { display: block; font-size: .7rem; color: var(--muted); margin-top: .15rem; }
.oc-incell { color: var(--accent-text); font-weight: 600; }
.oc-foot { position: sticky; bottom: -1rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .75rem; padding: .7rem 0; background: var(--surface); border-top: 1px solid var(--line); }
.oc-codes > summary { list-style: none; cursor: pointer; }
.oc-codes > summary::-webkit-details-marker { display: none; }
.oc-codes > summary h2::before { content: '+ '; color: var(--muted); }
.oc-codes[open] > summary h2::before { content: '− '; }
@media (max-width: 767.98px) {
  .pv-layout.has-gallery .cg { display: flex; gap: .5rem; align-items: flex-start; }
  .pv-layout.has-gallery .cg-main { width: 42%; max-width: 170px; flex: none; }
  .pv-layout.has-gallery .cg-thumbs { margin-top: 0; }
  .oc-table td { min-width: 6.4rem; }
  .oc-btn { width: 1.9rem; height: 2.1rem; }
  .oc-step input { width: 2.6rem; padding-inline: .2rem; }
}
#ocModal .oc-head { display: none; }

/* ---------- رأس الطلب المختصر ---------- */
.oh-back { font-size: .9rem; }
.order-head { padding: .9rem 1.1rem .8rem; }
.oh-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.oh-main { min-width: 0; }
.oh-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.oh-cust { display: flex; align-items: center; gap: .35rem .6rem; flex-wrap: wrap; font-size: .9rem; }
.oh-cust > .ic { width: 18px; height: 18px; color: var(--muted); }
.oh-cust > a:first-of-type, .oh-cust > span { font-weight: 600; }
.oh-call { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .55rem; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: .8rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.oh-call .ic { width: 15px; height: 15px; }
.oh-total { text-align: end; flex: none; line-height: 1.2; }
.oh-total small { display: block; color: var(--muted); font-size: .72rem; }
.oh-total strong { font-size: 1.15rem; color: var(--accent-text); }
.oh-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem; }
.oh-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .55rem; border-radius: 999px; background: var(--ground); border: 1px solid var(--line); font-size: .76rem; color: var(--ink-2); max-width: 100%; }
.oh-k { color: var(--muted); }
.oh-notes { margin-top: .45rem; display: grid; gap: .15rem; }
.flow-steps.flow-mini { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .25rem; padding: .7rem 0 0; border: 0; counter-reset: none; }
.flow-mini li { display: block; font-size: .68rem; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: .55rem; position: relative; }
.flow-mini li::before { content: ''; position: absolute; top: 0; inset-inline: 0; width: auto; height: 4px; border: 0; border-radius: 999px; background: var(--line); }
.flow-mini li::after { display: none; }
.flow-mini li.done { color: var(--accent-text); }
.flow-mini li.done::before { background: var(--accent); content: ''; }
.flow-mini li.current { color: var(--ink); font-weight: 700; }
.flow-mini li.current::before { background: linear-gradient(90deg, var(--accent) 50%, var(--accent-line) 50%); background-size: 200% 100%; animation: flowPulse 2.4s ease-in-out infinite; }
@keyframes flowPulse { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* ---------- صورة الصنف داخل الأسطر + التكبير ---------- */
.line-item { display: flex; align-items: flex-start; gap: .6rem; }
.line-info { min-width: 0; flex: 1; }
.sku-thumb { flex: none; width: 46px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: .55rem; overflow: hidden; background: var(--surface-2); cursor: zoom-in; position: relative; }
.sku-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.sku-thumb:hover img { transform: scale(1.06); }
.sku-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sku-thumb.is-empty { display: grid; place-items: center; cursor: default; color: var(--accent); font-weight: 700; background: var(--accent-soft); border-color: transparent; }
.cg-zoom { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
@media print { .sku-thumb { display: none !important; } }
.zoom { position: fixed; inset: 0; z-index: 2000; display: grid; grid-template-rows: 1fr auto auto; background: rgba(10, 12, 16, var(--zoom-bg, .92)); opacity: 0; transition: opacity .22s ease; touch-action: none; }
.zoom.open { opacity: 1; }
.zoom.closing { opacity: 0; transition-duration: .2s; }
.zoom-stage { position: relative; overflow: hidden; display: grid; place-items: center; padding: 3.2rem .75rem .5rem; }
.zoom-stage img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: .5rem; user-select: none; will-change: transform; cursor: zoom-in; }
.zoom.zoomed .zoom-stage img { cursor: grab; border-radius: 0; }
.zoom-close { position: absolute; top: max(.75rem, env(safe-area-inset-top)); inset-inline-end: .75rem; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.6rem; line-height: 1; }
.zoom-close:focus-visible { outline: 2px solid #fff; }
.zoom-cap { color: #fff; text-align: center; font-size: .9rem; padding: .25rem 1rem; }
.zoom-hint { color: rgba(255, 255, 255, .55); text-align: center; font-size: .72rem; padding: 0 1rem max(.9rem, env(safe-area-inset-bottom)); }
.zoom.zoomed .zoom-hint { visibility: hidden; }
:root.zoom-on body { overflow: hidden; }

/* ---------- بطاقات الموديلات (الطلب) ---------- */
.oc-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .85rem; }
.oc-card { border-radius: 1rem; transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s, border-color .2s; }
.oc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.oc-card:active { transform: scale(.965); transition-duration: .12s; }
.oc-card.is-in { border-color: var(--accent-line); }
.oc-img { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.oc-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.oc-card:hover .oc-img img { transform: scale(1.04); }
.oc-img:has(img)::after { content: ''; position: absolute; inset: auto 0 0; height: 35%; background: linear-gradient(to top, rgba(0, 0, 0, .18), transparent); pointer-events: none; }
.oc-in { position: absolute; top: .45rem; inset-inline-start: .45rem; z-index: 1; display: inline-flex; align-items: center; gap: .2rem; padding: .15rem .55rem .15rem .45rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 600; box-shadow: 0 4px 12px rgba(var(--accent-rgb), .35); animation: ocPop .55s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
.oc-in .ic { width: 14px; height: 14px; }
.oc-body { display: grid; gap: .3rem; padding: .6rem .7rem .7rem; }
.oc-name { min-height: 0; font-size: .9rem; }
.oc-meta { font-size: .72rem; }
.oc-dots { display: flex; align-items: center; gap: .2rem; }
.oc-dots .swatch { width: .8rem; height: .8rem; box-shadow: 0 0 0 1px var(--surface); }
.oc-dots small { color: var(--muted); font-size: .68rem; margin-inline-start: .15rem; }
.oc-price { color: var(--accent-text); font-size: .85rem; }
.oc-price strong { font-size: 1.12rem; font-weight: 700; }
.oc-price small { color: var(--muted); font-size: .7rem; }
.oc-stock { display: grid; gap: .2rem; font-size: .7rem; color: var(--muted); }
.oc-meter { display: block; height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.oc-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--success); transform-origin: right center; animation: ocMeter .9s cubic-bezier(.2, .8, .2, 1) .35s both; }
.lvl-high .oc-meter i { width: 100%; }
.lvl-mid .oc-meter i { width: 55%; }
.lvl-low .oc-meter i { width: 18%; background: var(--warn); }
.lvl-low { color: var(--warn); }
.lvl-out .oc-meter i { width: 0; }
@keyframes ocMeter { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ocPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ocIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.oc-grid .oc-card { animation: ocIn .5s cubic-bezier(.2, .8, .2, 1) both; }
.oc-grid .oc-card:nth-child(2) { animation-delay: .04s; } .oc-grid .oc-card:nth-child(3) { animation-delay: .08s; } .oc-grid .oc-card:nth-child(4) { animation-delay: .12s; }
.oc-grid .oc-card:nth-child(5) { animation-delay: .16s; } .oc-grid .oc-card:nth-child(6) { animation-delay: .2s; } .oc-grid .oc-card:nth-child(7) { animation-delay: .24s; }
.oc-grid .oc-card:nth-child(n+8) { animation-delay: .28s; }
@media (max-width: 575.98px) { .oc-body { padding: .5rem .55rem .6rem; } .oc-price strong { font-size: 1rem; } }
@media (prefers-reduced-motion: reduce) {
  .oc-grid .oc-card, .oc-in, .oc-meter i, .flow-mini li.current::before { animation: none !important; }
  .oc-card, .oc-img img, .sku-thumb img { transition: none !important; }
}

/* نسبة الهدف في بطاقة المبيعات (العرض يضبطه السكربت) */
.stat-progress { grid-column: 1; display: block; height: 6px; border-radius: 999px; overflow: hidden; background: var(--line); margin-top: .35rem; }
.stat-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
@media (max-width: 575.98px) { .oc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; } }

/* ---------- المرحلة التالية مقفلة ---------- */
.wz-nav .wz-lock { color: var(--warn); font-weight: 600; }
.wz-nav .wz-next:disabled { opacity: .55; }

/* ---------- استلام البضاعة: المسح السريع ---------- */
.gr-scan .panel-body { padding-top: .9rem; }
.gr-scan-form { position: static; margin-bottom: .5rem; box-shadow: none; }
.gr-scan-form input { font-size: 1.05rem; }
.gr-scan-msg { color: var(--muted); min-height: 1.4em; transition: color .2s; }
.gr-scan-msg.is-ok { color: var(--success); font-weight: 600; }
.gr-scan-msg.is-bad { color: var(--danger); font-weight: 600; }
.gr-recent { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.gr-recent:empty { display: none; }
.gr-recent-item { display: flex; align-items: center; gap: .6rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--surface-2); animation: grIn .35s cubic-bezier(.3, 1.4, .5, 1) both; }
.gr-recent-item:first-child { border-color: var(--success); background: var(--success-soft); }
.gr-recent-item img, .gr-recent-ph { width: 36px; height: 36px; border-radius: .45rem; object-fit: cover; flex: none; }
.gr-recent-ph { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.gr-recent-t { display: grid; min-width: 0; flex: 1; line-height: 1.25; }
.gr-recent-t small { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-recent-q { font-weight: 700; color: var(--success); font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes grIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.oc-in.oc-po { background: var(--ink-2); box-shadow: none; }
.gr-common { padding-top: .25rem; border-top: 1px dashed var(--line); margin-top: .5rem !important; }
.gr-savebar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; position: sticky; bottom: 0; background: var(--surface); z-index: 2; }
.gr-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.gr-bulk .price-input { width: 7rem; }
input.is-filled { background: var(--success-soft); }
@media (prefers-reduced-motion: reduce) { .gr-recent-item { animation: none; } }

/* ---------- صور الموديل حسب اللون ---------- */
.img-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.img-color { position: relative; border: 1px solid var(--line); border-radius: .8rem; padding: .65rem; background: var(--surface); }
.img-color.is-empty { border-style: dashed; background: var(--surface-2); }
.img-color-head { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.img-color-head .ic { width: 18px; height: 18px; color: var(--accent); }
.img-color-head .small { margin-inline-start: auto; }
.img-color-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.img-thumb { position: relative; margin: 0; }
.img-thumb .sku-thumb { width: 64px; height: 64px; }
.img-del { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: .9rem; line-height: 1; padding: 0; box-shadow: 0 0 0 2px var(--surface); }
.img-add-btn { display: grid; place-items: center; gap: .1rem; width: 64px; height: 64px; border: 1.5px dashed var(--accent-line); border-radius: .55rem; color: var(--accent-text); font-size: .72rem; cursor: pointer; background: var(--accent-soft); transition: transform .15s; }
.img-add-btn .ic { width: 22px; height: 22px; }
.img-add-btn:hover { transform: scale(1.04); }
.img-add-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.img-uploading { display: none; color: var(--accent-text); margin-top: .4rem; }
.img-color.is-uploading .img-uploading { display: block; }
.img-color.is-uploading .img-add-btn { opacity: .5; pointer-events: none; }

/* ---------- الأسعار في صفحة الموديل ---------- */
.price-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.price-quick-cell { padding: .65rem .75rem; border: 1px solid var(--line); border-radius: .7rem; background: var(--surface-2); }
.price-quick-cell.is-main { border-color: var(--accent-line); background: var(--accent-soft); }
.price-quick-cell .form-control { font-size: 1.05rem; font-weight: 600; }

/* ---------- تحديث النظام ---------- */
.upd-ver { font-size: .9rem; color: var(--muted); }
.upd-ver strong { color: var(--ink); font-size: 1.05rem; }
.upd-drop { display: grid; justify-items: center; gap: .35rem; padding: 2rem 1rem; border: 2px dashed var(--accent-line); border-radius: 1rem; background: var(--accent-soft); text-align: center; cursor: pointer; transition: background .15s, transform .15s; }
.upd-drop:hover { transform: translateY(-1px); }
.upd-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.upd-drop > .ic { width: 40px; height: 40px; color: var(--accent); }
.upd-upload.is-uploading .upd-drop { opacity: .55; pointer-events: none; }
.upd-upload.is-uploading .img-uploading { display: block; }
.upd-from-to { display: flex; align-items: baseline; gap: .6rem; font-size: 1.6rem; margin-bottom: .6rem; color: var(--muted); }
.upd-from-to strong { color: var(--accent-text); font-size: 2rem; }
.upd-facts { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.upd-facts li { display: flex; align-items: flex-start; gap: .5rem; }
.upd-facts .ic { width: 20px; height: 20px; color: var(--muted); flex: none; margin-top: .1rem; }
.upd-facts li.ok { color: var(--success); font-weight: 600; }
.upd-facts li.ok .ic { color: var(--success); }
.upd-confirm .form-control { max-width: 260px; }
.upd-done { border-color: var(--success); background: var(--success-soft); }
.upd-done .ic { width: 22px; height: 22px; color: var(--success); vertical-align: -4px; }
.upd-rb > summary { list-style: none; }
.upd-rb > summary::-webkit-details-marker { display: none; }
.upd-db > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.upd-db > summary::-webkit-details-marker { display: none; }
.upd-db > summary h2::before { content: "▸"; display: inline-block; margin-inline-end: .4rem; transition: transform .15s; font-size: .8em; }
[dir="rtl"] .upd-db > summary h2::before { content: "◂"; }
.upd-db[open] > summary h2::before { transform: rotate(90deg); }
[dir="rtl"] .upd-db[open] > summary h2::before { transform: rotate(-90deg); }
.upd-db:not([open]) > summary { border-bottom: 0; }
/* السرية المشكّلة: تركيبتها تحت اسم الصنف */
.pack-comp { display: block; color: var(--bs-secondary-color); font-size: .78em; letter-spacing: .01em; }
.pv-comp { background: var(--bs-tertiary-bg); border-radius: .5rem; padding: .35rem .6rem; }
.pv-comp .ltr { font-weight: 600; }
.pack-box { border: 1px solid var(--bs-border-color); border-radius: .75rem; padding: .9rem 1rem; }
.pack-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem; }
.pack-mode { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--bs-border-color); border-radius: .6rem; padding: .6rem .75rem; cursor: pointer; }
.pack-mode:has(input:checked) { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 7%, transparent); }
.pack-mode small { display: block; color: var(--bs-secondary-color); }
.pack-comp-edit { margin-top: .8rem; }
.pack-sizes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.pack-size { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-weight: 600; }
.pack-size input { width: 4.2rem; text-align: center; }
.pack-total { padding-bottom: .35rem; }
/* الاستلام السريع */
.qm-step .panel-head h2 { display: flex; align-items: center; gap: .55rem; }
.qm-num { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--bs-primary); color: #fff; font-size: .95rem; font-weight: 700; }
.qm-tools { display: grid; grid-template-columns: 2fr 1fr; gap: .6rem; margin-bottom: .4rem; }
.qm-tools .oc-search { margin-bottom: 0; }
.qm-scan { position: relative; display: flex; align-items: center; }
.qm-scan .ic { position: absolute; inset-inline-start: .7rem; width: 1.1rem; height: 1.1rem; color: var(--bs-secondary-color); }
.qm-scan input { width: 100%; border: 1px dashed var(--bs-border-color); border-radius: .6rem; padding: .55rem .8rem .55rem .8rem; padding-inline-start: 2.2rem; background: var(--bs-body-bg); color: var(--bs-body-color); }
.qm-scan-msg:empty { display: none; }
.qm-grid { max-height: 26rem; overflow: auto; padding: .15rem; }
.oc-card.is-loading { opacity: .55; }
.qm-lines { display: grid; gap: .9rem; }
.qm-lines:not(:empty) { margin-bottom: 1.1rem; padding-bottom: 1.1rem; border-bottom: 1px dashed var(--bs-border-color); }
.qm-block { border: 1.5px solid var(--bs-primary); border-radius: .9rem; padding: .85rem 1rem; background: var(--bs-body-bg); scroll-margin-top: 5rem; }
.qm-block.is-empty { border-color: var(--bs-border-color); }
.qm-block.flash { animation: qmFlash .9s ease; }
@keyframes qmFlash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bs-primary) 45%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.qm-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.qm-thumb { width: 3.2rem; height: 3.2rem; border-radius: .6rem; overflow: hidden; flex: none; background: var(--bs-tertiary-bg); display: grid; place-items: center; font-weight: 700; color: var(--bs-primary); }
.qm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.qm-title { flex: 1; min-width: 0; }
.qm-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem .9rem; }
.qm-color { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .5rem; border-radius: .6rem; background: var(--bs-tertiary-bg); }
.qm-cname { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; white-space: nowrap; }
.qm-stepper { display: inline-flex; align-items: center; gap: .2rem; }
.qm-btn { width: 2.1rem; height: 2.1rem; border-radius: .5rem; border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); color: var(--bs-body-color); font-size: 1.1rem; line-height: 1; }
.qm-btn:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.qm-qty { width: 3.6rem; text-align: center; font-weight: 700; padding: .3rem .2rem; }
.qm-qty.has-qty { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 8%, var(--bs-body-bg)); }
.qm-qty.flash { animation: qmFlash .9s ease; }
.qm-table { border-collapse: separate; border-spacing: .3rem; }
.qm-table th { font-weight: 600; text-align: center; white-space: nowrap; }
.qm-table tbody th { text-align: start; padding-inline-end: .5rem; }
.qm-table .qm-btn { width: 1.8rem; height: 1.8rem; }
.qm-table .qm-qty { width: 3rem; }
.qm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px dashed var(--bs-border-color); }
.qm-price { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.qm-price input { width: 7.5rem; }
.qm-sub { font-weight: 600; color: var(--bs-secondary-color); }
.qm-block:not(.is-empty) .qm-sub { color: var(--bs-body-color); }
.qm-more { margin-top: .5rem; }
.qm-more > summary { cursor: pointer; color: var(--bs-secondary-color); font-size: .875rem; }
.qm-more-body { padding: .6rem 0 .2rem; }
.qm-narrow { max-width: 8rem; }
.qm-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
          margin-top: 1rem; padding: .8rem 1rem; border-radius: .9rem; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); box-shadow: 0 -6px 18px rgba(0,0,0,.06); }
.qm-total { display: flex; flex-direction: column; }
.qm-total strong { font-size: 1.15rem; }
.qm-actions { display: flex; align-items: center; gap: .5rem; }
@media (max-width: 575.98px) {
  .qm-tools { grid-template-columns: 1fr; }
  .qm-bar { padding: .7rem .8rem; }
  .qm-actions { width: 100%; justify-content: space-between; }
  .qm-actions .btn-lg { flex: 1; }
}
.qm-tools > * { min-width: 0; } .qm-tools .pos-search input { min-width: 0; width: 100%; }
.qm-lines > *, .qm-block .table-wrap { min-width: 0; }
@media (max-width: 575.98px) {
  .qm-table .qm-btn { display: none; }
  .qm-table .qm-qty { width: 2.9rem; }
  .qm-colors { grid-template-columns: 1fr; }
}
/* الإضافة السريعة للموديل */
.pq-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; align-items: start; padding: .55rem 0; border-bottom: 1px dashed var(--bs-border-color); }
.pq-row:last-child { border-bottom: 0; }
.pq-label { font-weight: 700; padding-top: .45rem; }
.pq-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.pq-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border: 1.5px solid var(--bs-border-color); border-radius: 2rem; cursor: pointer; user-select: none; font-weight: 600; background: var(--bs-body-bg); }
.pq-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pq-chip:has(input:checked) { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 10%, var(--bs-body-bg)); color: var(--bs-primary); }
.pq-chip:has(input:focus-visible) { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.pq-chip .swatch { width: .95rem; height: .95rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.pq-size { min-width: 3.2rem; justify-content: center; }
.pq-seg { display: inline-flex; border: 1.5px solid var(--bs-border-color); border-radius: .6rem; overflow: hidden; margin-bottom: .55rem; }
.pq-seg label { padding: .45rem .9rem; cursor: pointer; font-weight: 600; }
.pq-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pq-seg label:has(input:checked) { background: var(--bs-primary); color: #fff; }
.pq-inline { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.pq-inline input { width: 5.5rem; }
.pq-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.pq-price { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; }
.pq-price small { font-weight: 400; color: var(--bs-secondary-color); }
.pq-sale label { display: inline-flex; align-items: center; gap: .35rem; }
.pq-money { position: relative; display: flex; align-items: center; }
.pq-money input { font-size: 1.25rem; font-weight: 700; padding-inline-end: 2rem; }
.pq-money b { position: absolute; inset-inline-end: .75rem; color: var(--bs-secondary-color); font-weight: 600; }
.pq-margin { min-height: 1.1em; color: var(--bs-success) !important; }
.pq-grid { border-collapse: separate; border-spacing: .3rem; }
.pq-grid th { font-weight: 600; text-align: center; white-space: nowrap; }
.pq-grid tbody th { text-align: start; padding-inline-end: .6rem; }
.pq-grid .swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; }
.pq-qty { width: 3.8rem; text-align: center; font-weight: 700; }
.pq-qty.has-qty { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 8%, var(--bs-body-bg)); }
.pq-have { display: block; font-size: .7rem; color: var(--bs-secondary-color); text-align: center; white-space: nowrap; margin-top: .1rem; }
.pq-qty.pq-changed { border-color: var(--bs-warning); background: color-mix(in srgb, var(--bs-warning) 12%, var(--bs-body-bg)); }
.pq-more > summary { cursor: pointer; color: var(--bs-secondary-color); }
.pq-kbd { font-size: .65rem; background: rgba(255,255,255,.22); color: inherit; margin-inline-start: .35rem; }
@media (max-width: 575.98px) {
  .pq-row { grid-template-columns: 1fr; gap: .35rem; }
  .pq-label { padding-top: 0; }
  .pq-kbd { display: none; }
}
.pq-done:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.pq-money { gap: .5rem; }
.pq-money input { flex: 1; padding-inline-end: .75rem; }
.pq-money b { position: static; }

/* أنواع السرايا الجاهزة (0.52) */
.pt-row { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; padding-bottom: .9rem; border-bottom: 1px dashed var(--bs-border-color); }
.pt-row.off { opacity: .6; }
.pt-row.pt-new { border-bottom: 0; padding-bottom: 0; background: var(--bs-tertiary-bg); padding: .75rem; border-radius: .6rem; }
.pt-name { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 14rem; max-width: 22rem; min-width: 0; }
.pt-end { display: flex; align-items: center; gap: .75rem; margin-inline-start: auto; padding-bottom: .2rem; }
.pq-tpl { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.pq-tpl select { width: auto; min-width: 14rem; max-width: 100%; }
.pq-tpl-text { font-weight: 600; }
.pq-custom { margin-top: .75rem; }
.pq-save-tpl { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.pq-save-tpl input[type=text] { width: 16rem; max-width: 100%; }
.pack-tpls { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.pack-tpl { display: flex; gap: .5rem; align-items: center; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .4rem .7rem; cursor: pointer; }
.pack-tpl:has(input:checked) { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 7%, var(--bs-body-bg)); }
.pack-tpl small { color: var(--bs-secondary-color); }
.pq-confirm-list { padding-inline-start: 1.2rem; margin-bottom: .75rem; font-weight: 600; }

/* نافذة الكميات (0.55) */
.ps-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.ps-wh { display: flex; gap: .5rem; align-items: center; }
.ps-wh select { width: auto; max-width: 100%; }
.ps-table th, .ps-table td { text-align: center; vertical-align: middle; white-space: nowrap; }
.ps-table tbody th, .ps-table tfoot th { text-align: start; }
.ps-table td strong { font-size: 1.05rem; }
.ps-table .ps-packcol { background: color-mix(in srgb, var(--bs-primary) 7%, var(--bs-body-bg)); }
.ps-table .ps-sum { font-weight: 700; }
.ps-table tfoot { border-top: 2px solid var(--bs-border-color); }
.ps-zero { color: var(--bs-tertiary-color); }
.ps-pcs { color: var(--bs-secondary-color); }
.ps-table .swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; }
.btn-stock { white-space: nowrap; }

/* شريط المقاسات والأنماط (0.56) */
.strip-patterns { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .5rem; }
.strip-patterns .btn { padding: .15rem .55rem; font-weight: 600; }
.strip-toggle { border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); color: var(--bs-body-color); border-radius: 999px; min-width: 3rem; padding: .1rem .5rem; font-weight: 700; font-size: .85rem; cursor: pointer; }
[data-strip-cell].is-on .strip-toggle, .pq-cell.is-on .strip-toggle { border-color: var(--bs-primary); background: var(--bs-primary); color: #fff; }
.pattern-chip { display: inline-flex; gap: .4rem; align-items: center; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .25rem .55rem; }
.pattern-new { width: 10rem; }
.pq-tpls { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .5rem; }
.pq-tpl-btn { border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); border-radius: .5rem; padding: .25rem .6rem; font-size: .85rem; cursor: pointer; color: var(--bs-body-color); }
.pq-tpl-btn.is-on { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 10%, var(--bs-body-bg)); font-weight: 700; }
.pq-strip-msg { min-height: 1.2em; }

/* ترتيب المقاسات بالسحب (0.57) */
.size-cell { position: relative; background: var(--bs-body-bg); user-select: none; cursor: grab; }
.size-top { display: flex; align-items: center; gap: .4rem; }
.size-grip { touch-action: none; cursor: grab; color: var(--bs-secondary-color); font-weight: 700; letter-spacing: -.15em; padding: 0 .15rem; }
.size-cell.is-dragging { opacity: .35; }
.size-ghost { position: fixed; z-index: 1080; pointer-events: none; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.18); transform: rotate(-2deg); }
.size-moves { display: flex; justify-content: space-between; }
.size-moves .btn { text-decoration: none; font-size: 1rem; line-height: 1; }

/* أكثر من مجموعة مقاسات (0.58) */
.pq-xg { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; }
.pq-chips-sm .pq-chip { padding: .2rem .6rem; font-size: .85rem; }
.pq-glabel { flex-basis: 100%; color: var(--bs-secondary-color); font-weight: 600; margin-top: .25rem; }
.pq-gsec + .pq-gsec { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--bs-border-color); }
.pq-gsec-title { font-weight: 700; margin-bottom: .35rem; }
.pd-zone { border-color: color-mix(in srgb, var(--bs-danger) 35%, var(--bs-border-color)); }
.pd-zone .panel-head h2 { color: var(--bs-danger); }
.pd-code { width: 9rem; }

/* الصنف بالقطعة (0.61): الصور بالسحب، الكمية الإجمالية والألوان */
.pp-images { display: flex; flex-wrap: wrap; gap: .6rem; min-height: 6.5rem; padding: .4rem; border: 1.5px dashed transparent; border-radius: .75rem; transition: border-color .15s, background-color .15s; }
.pp-images.pp-drop { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 6%, var(--bs-body-bg)); }
.pp-img { position: relative; width: 6.5rem; height: 6.5rem; margin: 0; border-radius: .6rem; overflow: hidden; border: 1.5px solid var(--bs-border-color); background: var(--bs-tertiary-bg); cursor: grab; }
.pp-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pp-img.pp-main { border-color: var(--bs-primary); border-width: 2px; }
.pp-img.pp-dragging { opacity: .4; }
.pp-img.pp-over { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.pp-img:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.pp-badge { position: absolute; inset-inline-start: .3rem; bottom: .3rem; font-size: .68rem; font-weight: 700; padding: .05rem .4rem; border-radius: 1rem; background: var(--bs-primary); color: #fff; }
.pp-x { position: absolute; inset-inline-end: .25rem; top: .25rem; width: 1.6rem; height: 1.6rem; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 1.05rem; line-height: 1; }
.pp-x:hover, .pp-x:focus-visible { background: var(--bs-danger); }
.pp-add-img { width: 6.5rem; height: 6.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; border: 1.5px dashed var(--bs-border-color); border-radius: .6rem; background: var(--bs-body-bg); color: var(--bs-secondary-color); font-size: .8rem; font-weight: 600; }
.pp-add-img .ic { width: 1.6rem; height: 1.6rem; }
.pp-add-img:hover, .pp-add-img:focus-visible { border-color: var(--bs-primary); color: var(--bs-primary); }
.pp-total { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: .35rem; flex-wrap: wrap; }
.pp-total input { width: 9rem; font-size: 1.5rem; font-weight: 800; text-align: center; }
.pp-total b { font-weight: 600; color: var(--bs-secondary-color); }
.pp-new-color { border-style: dashed; color: var(--bs-primary); }
.pp-color-form:not([hidden]) { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .6rem; padding: .6rem; border-radius: .6rem; background: var(--bs-tertiary-bg); }
.pp-color-form [data-pp-cname] { width: 11rem; }
.pp-ccode { width: 5.5rem; }
.pp-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem 1rem; margin-top: .9rem; }
.pp-row { display: grid; grid-template-columns: 1fr 6rem; grid-template-rows: auto auto; align-items: center; column-gap: .6rem; padding: .45rem .6rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; }
.pp-cname { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; min-width: 0; }
.pp-cname .swatch { width: .95rem; height: .95rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex: none; }
.pp-qty { font-size: 1.2rem; font-weight: 800; text-align: center; }
.pp-note { grid-column: 1 / -1; font-size: .75rem; color: var(--bs-secondary-color); }
.pp-note:empty { display: none; }
.pp-note.pp-change { color: var(--bs-warning-text-emphasis); font-weight: 600; }
.pp-sum { margin-top: .75rem; font-weight: 700; }
.pq-margin.bad { color: var(--bs-danger) !important; }
@media (max-width: 575.98px) {
  .pp-img, .pp-add-img { width: 5.2rem; height: 5.2rem; }
  .pp-rows { grid-template-columns: 1fr; }
}

/* تحويل السرايا إلى القطعة (0.62) */
.tp-table td { vertical-align: middle; }
.tp-blocked td:not(:last-child) { opacity: .55; }
.tp-price input { width: 6rem; }

/* جدول المنتجات السريع (0.62) */
.ps-wrap { max-height: calc(100vh - 14rem); overflow: auto; }
.ps-table { margin: 0; }
.ps-table thead th { position: sticky; top: 0; z-index: 2; background: var(--bs-body-bg); box-shadow: inset 0 -1px 0 var(--bs-border-color); }
.ps-table td { vertical-align: middle; padding-top: .3rem; padding-bottom: .3rem; }
.ps-img-col { width: 4.2rem; }
.ps-name-col { min-width: 14rem; }
.ps-num-col { width: 8.5rem; }
.ps-st-col { width: 4.5rem; }
.ps-img { width: 3.4rem; height: 3.4rem; padding: 0; border: 1.5px dashed var(--bs-border-color); border-radius: .5rem; background: var(--bs-tertiary-bg); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: .68rem; color: var(--bs-secondary-color); }
.ps-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-img:has(img) { border-style: solid; }
.ps-img:hover, .ps-img:focus-visible { border-color: var(--bs-primary); color: var(--bs-primary); }
.ps-img.ps-loading { opacity: .45; }
.ps-table input.num { text-align: center; font-weight: 700; }
.ps-unit { display: block; font-size: .7rem; color: var(--bs-secondary-color); text-align: center; }
.ps-pill { font-size: .68rem; margin-top: .2rem; display: inline-block; }
.ps-st { text-align: center; font-weight: 800; }
.ps-st.ps-ok { color: var(--bs-success); }
.ps-st.ps-bad { color: var(--bs-danger); cursor: help; }
.ps-st.ps-saving { color: var(--bs-secondary-color); }
.ps-new td { background: color-mix(in srgb, var(--bs-primary) 5%, var(--bs-body-bg)); }
.ps-drop td { background: color-mix(in srgb, var(--bs-primary) 10%, var(--bs-body-bg)); }
.ps-added td { animation: ps-flash 1.2s ease-out; }
@keyframes ps-flash { from { background: color-mix(in srgb, var(--bs-success) 18%, var(--bs-body-bg)); } }
@media (prefers-reduced-motion: reduce) { .ps-added td { animation: none; } }
.ps-code-col { width: 8rem; }
.ps-links { display: block; font-size: .72rem; margin-top: .15rem; }
.ps-table input[readonly] { background: var(--bs-tertiary-bg); cursor: not-allowed; }
.ps-qty-ro { text-align: center; color: var(--bs-secondary-color); }
.ps-qbtn { width: 100%; }
.ps-sub > td { background: var(--bs-tertiary-bg); }
.ps-colors { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: flex-end; }
.ps-color { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.ps-color small { display: block; font-weight: 400; font-size: .7rem; color: var(--bs-secondary-color); }
.ps-color input { width: 5.5rem; }
.ps-color .swatch { width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex: none; }

/* =========================================================
   الطلب السريع (0.65): شاشة العميل، والكتالوج والسلة بنوافذ منزلقة من الأسفل.
   ========================================================= */
.qo { --qo-ease: cubic-bezier(.32, .72, 0, 1); --qo-pop: cubic-bezier(.3, 1.5, .5, 1); max-width: 980px; margin-inline: auto; padding-bottom: 6rem; }
.qo-head { position: sticky; top: var(--top-h); z-index: 5; padding: .25rem 0 .75rem; background: var(--ground); }
.qo-title { font-size: 1.35rem; font-weight: 800; margin: .25rem 0 .6rem; }
.qo-search { position: relative; }
.qo-search .ic { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.qo-search input { width: 100%; height: 3rem; padding-inline: 2.7rem 1rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 1rem; box-shadow: var(--shadow); }
.qo-search input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.qo-foot { text-align: center; font-size: .82rem; margin: 1.5rem 0 0; }
.qo-none, .qo-retry { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.qo-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.qo-empty .ic { width: 48px; height: 48px; color: var(--accent); }
.qo-avatar { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: 1.15rem; }

/* شاشة العملاء */
.qo-clist { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.qo-citem { position: relative; }
.qo-ccard { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .18s var(--qo-ease), box-shadow .18s; -webkit-tap-highlight-color: transparent; }
.qo-ccard:active { transform: scale(.985); }
.qo-ccard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qo-cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.qo-cbody strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qo-cbody small { color: var(--muted); }
.qo-ctag { font-size: .74rem; color: var(--ink-2); }
.qo-ctag.warn { color: var(--warn); font-weight: 700; }
.qo-chev { color: var(--muted-2); font-size: 1.6rem; line-height: 1; }
.qo-citem:has(.qo-repeat) .qo-ccard { padding-bottom: 2.6rem; }
.qo-repeat { position: absolute; inset-inline-start: 4.45rem; bottom: .6rem; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--surface); color: var(--accent-text); font-size: .78rem; font-weight: 700; }
.qo-repeat .ic { width: 15px; height: 15px; }
.qo-repeat.busy { opacity: .6; }

/* رأس العميل في شاشة الطلب */
.qo-who { display: flex; align-items: center; gap: .65rem; padding: .55rem .25rem .75rem; }
.qo-back { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font-size: 1.6rem; text-decoration: none; transform: scaleX(-1); }
.qo-who-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qo-who-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qo-who-body small { color: var(--muted); }
.qo-flag { display: inline-flex; align-items: center; gap: .25rem; padding: .25rem .55rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: .72rem; font-weight: 700; }
.qo-flag .ic { width: 15px; height: 15px; }
.qo-tools { position: sticky; top: var(--top-h); z-index: 5; padding: .25rem 0 .6rem; background: var(--ground); }
.qo-cats { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 0 .1rem; scrollbar-width: none; }
.qo-cats::-webkit-scrollbar { display: none; }
.qo-chip { flex: none; padding: .4rem .9rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .85rem; font-weight: 600; transition: background .15s, color .15s, transform .15s var(--qo-pop); }
.qo-chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.qo-chip:active { transform: scale(.94); }

/* بطاقات الموديلات */
.qo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .7rem; }
.qo-card { display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: start; overflow: hidden; color: var(--ink); animation: qoCardIn .38s var(--qo-ease) both; transition: transform .16s var(--qo-ease); -webkit-tap-highlight-color: transparent; }
.qo-card:active { transform: scale(.97); }
.qo-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes qoCardIn { from { opacity: 0; transform: translateY(8px); } }
.qo-img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; background: var(--surface-2); overflow: hidden; }
.qo-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.qo-img img.in { opacity: 1; }
.qo-ph { font-size: 2.2rem; font-weight: 800; color: var(--accent-line); }
.qo-badge { position: absolute; top: .5rem; inset-inline-start: .5rem; padding: .15rem .5rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .74rem; font-weight: 800; box-shadow: 0 4px 12px rgba(var(--accent-rgb), .35); animation: qoPop .35s var(--qo-pop) both; }
@keyframes qoPop { from { transform: scale(.6); opacity: 0; } }
.qo-card .qo-cbody { padding: .6rem .7rem .7rem; gap: .2rem; }
.qo-name { font-weight: 700; font-size: .92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qo-meta { display: flex; align-items: center; justify-content: space-between; gap: .4rem; font-size: .74rem; color: var(--muted); }
.qo-dots { display: inline-flex; gap: 2px; }
.qo-dots .swatch { width: .7rem; height: .7rem; }
.qo-price strong { font-size: 1.05rem; }
.qo-price small { color: var(--muted); font-size: .72rem; }
.qo-stock { font-size: .72rem; color: var(--muted); }
.qo-stock.lvl-low { color: var(--warn); }
.qo-stock.lvl-out { color: var(--danger); }

/* هيكل التحميل (Skeleton) */
.sk { position: relative; overflow: hidden; background: color-mix(in srgb, var(--ink) 7%, var(--surface)); border-radius: 8px; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent); animation: skShine 1.3s ease-in-out infinite; }
@keyframes skShine { to { transform: translateX(-100%); } }
.qo-card.is-sk { animation: none; pointer-events: none; padding-bottom: .7rem; gap: .45rem; }
.qo-card.is-sk .qo-img { border-radius: 0; }
.sk-line { display: block; height: .8rem; margin-inline: .7rem; }
.sk-line.short { width: 45%; }
.qo-msk { display: grid; gap: .7rem; }
.sk-hero { display: block; height: 11rem; border-radius: 14px; }
.sk-row { display: block; height: 3.4rem; border-radius: 12px; }

/* شريط السلة */
.qo-cartbar { position: fixed; z-index: 1035; inset-inline: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: .75rem; max-width: 640px; margin-inline: auto; padding: .55rem .6rem .55rem 1rem; border: 0; border-radius: 18px; background: var(--ink); color: #fff; box-shadow: 0 14px 34px rgba(17, 24, 39, .28); transform: translateY(140%); transition: transform .4s var(--qo-ease); text-align: start; }
html[data-shell] .qo-cartbar { bottom: calc(var(--rt-h, 64px) + 1.1rem + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { html[data-shell] .qo-cartbar { bottom: 1rem; } }
.qo-cartbar.show { transform: none; }
.qo-cartbar.bump .qo-cart-ic { animation: qoBump .45s var(--qo-pop); }
@keyframes qoBump { 40% { transform: scale(1.25) rotate(-8deg); } }
.qo-cart-ic { position: relative; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 13px; background: rgba(255, 255, 255, .12); }
.qo-cart-ic .ic { width: 22px; height: 22px; }
.qo-cart-ic b { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem; border-radius: 999px; background: var(--accent); font-size: .72rem; line-height: 1.25rem; text-align: center; }
.qo-cart-sum { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.qo-cart-sum strong { font-size: 1.05rem; }
.qo-cart-sum small { opacity: .7; font-size: .74rem; }
.qo-cart-go { padding: .6rem .95rem; border-radius: 13px; background: var(--accent); font-weight: 800; font-size: .9rem; }

/* النوافذ المنزلقة */
html.qo-lock, html.qo-lock body { overflow: hidden; }
.qo-sheet { position: fixed; inset: 0; z-index: 1060; }
.qo-backdrop { position: absolute; inset: 0; background: rgba(15, 20, 28, .45); opacity: 0; transition: opacity .3s ease; }
.qo-sheet.open .qo-backdrop { opacity: 1; }
.qo-panel { position: absolute; inset-inline: 0; bottom: 0; display: flex; flex-direction: column; max-height: 88vh; max-width: 720px; margin-inline: auto; border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: 0 -10px 40px rgba(15, 20, 28, .2); transform: translateY(100%); transition: transform .38s var(--qo-ease); padding-bottom: env(safe-area-inset-bottom); }
.qo-panel.tall { height: 92vh; max-height: 92vh; }
.qo-sheet.open .qo-panel { transform: none; }
.qo-panel.dragging { transition: none; }
.qo-handle { display: grid; place-items: center; height: 1.4rem; flex: none; cursor: grab; }
.qo-handle span { width: 2.6rem; height: 5px; border-radius: 9px; background: var(--line-2); }
.qo-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem .4rem; }
.qo-panel-head h2 { font-size: 1.15rem; font-weight: 800; margin: 0; }
.qo-x { width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 1.4rem; line-height: 1; }
.qo-panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 1rem 1rem; }
.qo-panel-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid var(--line); }
.qo-panel-foot .btn { min-width: 7rem; }

/* نافذة الموديل */
.qo-imgs { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -1rem .6rem; padding: 0 1rem; scrollbar-width: none; }
.qo-imgs::-webkit-scrollbar { display: none; }
.qo-imgs img { flex: none; width: 72%; max-width: 15rem; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; scroll-snap-align: start; background: var(--surface-2); }
.qo-imgs img:only-child { width: 100%; max-width: none; aspect-ratio: 16 / 10; }
.qo-mhead h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .1rem; }
.qo-hint { color: var(--muted); font-size: .85rem; margin: .35rem 0 .6rem; }
.qo-seg { display: flex; gap: .25rem; padding: .25rem; margin: .6rem 0; border: 0; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.qo-seg label, .qo-seg button { flex: 1; margin: 0; }
.qo-seg input { position: absolute; opacity: 0; pointer-events: none; }
.qo-seg span, .qo-seg button { display: block; padding: .55rem .4rem; border: 0; border-radius: 11px; background: none; color: var(--ink-2); font-weight: 700; font-size: .86rem; text-align: center; transition: background .2s, color .2s, box-shadow .2s; cursor: pointer; }
.qo-seg input:checked + span, .qo-seg button.on { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow); }
.qo-seg input:focus-visible + span { outline: 2px solid var(--accent); }
.qo-color { padding: .65rem 0; border-top: 1px solid var(--line); }
.qo-color h3 { display: flex; align-items: center; gap: .45rem; font-size: .95rem; font-weight: 800; margin: 0 0 .5rem; }
.qo-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr)); gap: .5rem; }
.qo-cells.one { grid-template-columns: minmax(0, 15rem); }
.qo-cell { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem; border: 1.5px solid var(--line); border-radius: 14px; transition: border-color .2s, background .2s; }
.qo-cell.has { border-color: var(--accent-line); background: var(--accent-soft); }
.qo-cell.none { opacity: .45; }
.qo-size { font-weight: 800; font-size: .9rem; }
.qo-avail { color: var(--muted); font-size: .72rem; }
.qo-step { display: flex; align-items: center; gap: .25rem; }
.qo-step button { width: 2.5rem; height: 2.5rem; flex: none; border: 0; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); font-size: 1.35rem; font-weight: 700; line-height: 1; transition: transform .12s var(--qo-pop), background .15s; -webkit-tap-highlight-color: transparent; }
.qo-step button:last-child { background: var(--accent); color: #fff; box-shadow: none; }
.qo-step button:active { transform: scale(.88); }
.qo-step button.pop { animation: qoPop .3s var(--qo-pop); }
.qo-step button:disabled { opacity: .35; }
.qo-step input { width: 3.2rem; height: 2.5rem; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 1.2rem; font-weight: 800; text-align: center; }
.qo-step input:focus { outline: 2px solid var(--accent-line); background: var(--surface); }
.qo-step.max input { animation: qoShake .35s; color: var(--warn); }
@keyframes qoShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.qo-step.sm button { width: 2.1rem; height: 2.1rem; font-size: 1.15rem; }
.qo-step.sm input { width: 2.6rem; height: 2.1rem; font-size: 1rem; }

/* المراجعة */
.qo-lines { list-style: none; margin: 0 0 .75rem; padding: 0; }
.qo-line { position: relative; display: grid; grid-template-columns: 3.2rem 1fr auto auto; align-items: center; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); background: var(--surface); transition: transform .2s var(--qo-ease), opacity .25s; touch-action: pan-y; }
.qo-line.going { opacity: .35; }
.qo-limg { width: 3.2rem; height: 3.2rem; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.qo-limg img { width: 100%; height: 100%; object-fit: cover; }
.qo-limg .qo-ph { font-size: 1.2rem; }
.qo-lbody { min-width: 0; display: flex; flex-direction: column; }
.qo-lbody strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qo-lbody small { color: var(--muted); font-size: .75rem; }
.qo-lbody .swatch { width: .7rem; height: .7rem; }
.qo-ltotal { font-weight: 800; font-size: .85rem; }
.qo-del { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: var(--danger-soft); color: var(--danger); font-size: 1.2rem; line-height: 1; }
.qo-empty-line { padding: 1.5rem 0; text-align: center; color: var(--muted); }
.qo-opts .form-control, .qo-opts .form-select { border-radius: 12px; }
.qo-disc { margin-top: .75rem; }
.qo-disc summary { color: var(--accent-text); font-weight: 700; font-size: .88rem; cursor: pointer; }
.qo-totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem .75rem; margin: 1rem 0; padding: .8rem 1rem; border-radius: 14px; background: var(--surface-2); }
.qo-totals dt { font-weight: 500; color: var(--ink-2); }
.qo-totals dd { margin: 0; text-align: end; }
.qo-totals .big { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.qo-send { border-radius: 14px; padding-block: .85rem; font-weight: 800; position: sticky; bottom: 0; }
.qo-send.busy { opacity: .75; }

/* بعد الإرسال */
.qo-done { position: fixed; inset: 0; z-index: 1070; display: grid; place-items: center; padding: 1.5rem; background: color-mix(in srgb, var(--ground) 92%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.qo-done.show { opacity: 1; }
.qo-done-card { width: min(100%, 24rem); padding: 1.75rem 1.25rem 1rem; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-pop); text-align: center; transform: scale(.94); transition: transform .45s var(--qo-pop); }
.qo-done.show .qo-done-card { transform: none; }
.qo-done-card h2 { font-size: 1.25rem; font-weight: 800; margin: .75rem 0 .3rem; }
.qo-done-card p { color: var(--muted); }
.qo-check { width: 4.5rem; height: 4.5rem; }
.qo-check circle { fill: var(--success-soft); stroke: var(--success); stroke-width: 2.5; }
.qo-check path { fill: none; stroke: var(--success); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.qo-done.show .qo-check path { animation: qoDraw .5s .2s ease-out forwards; }
@keyframes qoDraw { to { stroke-dashoffset: 0; } }
.qo-toast { position: fixed; z-index: 1080; inset-inline: 1rem; bottom: calc(6.5rem + env(safe-area-inset-bottom)); max-width: 30rem; margin-inline: auto; padding: .75rem 1rem; border-radius: 14px; background: var(--danger); color: #fff; font-weight: 600; box-shadow: var(--shadow-pop); transform: translateY(1rem); opacity: 0; transition: transform .3s var(--qo-ease), opacity .3s; }
.qo-toast.show { transform: none; opacity: 1; }

@media (max-width: 575.98px) {
  .qo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .qo-head, .qo-tools { top: var(--top-h); }
}
@media (prefers-reduced-motion: reduce) {
  .qo *, .qo *::before, .qo *::after { animation: none !important; transition: none !important; }
  .qo-img img { opacity: 1; }
  .qo-check path { stroke-dashoffset: 0; }
}

/* صفحة لا يوجد اتصال (0.65) */
.app-offline { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 2rem 1.5rem; text-align: center; background: var(--ground); color: var(--ink); }
.app-offline h1 { font-size: 1.35rem; font-weight: 800; margin: .5rem 0 0; }
.app-offline p { color: var(--muted); max-width: 22rem; }
.ao-ic { width: 5rem; height: 5rem; fill: none; stroke: var(--muted-2); stroke-width: 4; stroke-linecap: round; }
.ao-ic circle { fill: var(--muted-2); stroke: none; }
.ao-ic .ao-x { stroke: var(--danger); }

/* التطبيق (0.65): شريط التحميل، هيكل الصفحة، تنبيه الاتصال، والتثبيت */
.nav-progress { position: fixed; top: 0; inset-inline: 0; z-index: 2000; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat; opacity: 0; transition: opacity .2s; pointer-events: none; }
.nav-progress.on { opacity: 1; animation: navRun 1.1s ease-in-out infinite; }
@keyframes navRun { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.nav-skeleton { position: fixed; inset: var(--top-h) 0 0; z-index: 1020; display: flex; flex-direction: column; gap: .7rem; padding: 1rem; background: var(--ground); opacity: 0; visibility: hidden; transition: opacity .2s ease; }
.nav-skeleton.on { opacity: 1; visibility: visible; }
.nav-skeleton .ns-title { display: block; width: 45%; height: 1.5rem; border-radius: 9px; }
.nav-skeleton .ns-sub { display: block; width: 70%; height: .9rem; margin-bottom: .4rem; }
.ns-card { display: flex; align-items: center; gap: .8rem; padding: .85rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.ns-av { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 14px; }
.ns-lines { flex: 1; display: grid; gap: .45rem; }
.ns-lines .sk { display: block; height: .8rem; }
.ns-lines .sk.short { width: 55%; }
.net-toast { position: fixed; z-index: 2010; inset-inline: 1rem; top: calc(.75rem + env(safe-area-inset-top)); max-width: 28rem; margin-inline: auto; padding: .7rem 1rem; border-radius: 14px; background: var(--success); color: #fff; font-weight: 600; text-align: center; box-shadow: var(--shadow-pop); transform: translateY(-140%); transition: transform .35s cubic-bezier(.32, .72, 0, 1); }
.net-toast.bad { background: var(--ink); }
.net-toast.on { transform: none; }
.install-banner { display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; margin-bottom: 1rem; border-radius: 16px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.install-banner img { width: 2.75rem; height: 2.75rem; border-radius: 12px; flex: none; }
.install-banner div { flex: 1; min-width: 0; }
.install-banner strong { display: block; }
.install-banner small { color: var(--ink-2); }
.ios-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.ios-steps li { counter-increment: s; display: flex; gap: .7rem; align-items: center; }
.ios-steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; }
.ios-share { display: inline-block; width: 1.2rem; height: 1.2rem; vertical-align: -3px; }
@media (prefers-reduced-motion: reduce) { .nav-progress.on { animation: none; background: var(--accent); } .net-toast { transition: none; } }

/* ---------- الإعدادات › تطبيق المندوب (0.66) ---------- */
.ra-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .ra-layout { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; } .ra-preview { position: sticky; top: calc(var(--top-h) + 1rem); } }
.ra-groups { display: grid; gap: .75rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ra-group { margin: 0; padding: 0; border: 0; }
.ra-group legend { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: .35rem; float: none; }
.ra-item { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; }
.ra-item .form-check-input { margin-top: .2rem; flex: none; }
.ra-item label { font-size: .9rem; cursor: pointer; }
.ra-item small { display: block; font-size: .72rem; color: var(--muted); }
.ra-item.is-noperm label { color: var(--muted); }
.ra-cards { display: grid; gap: .6rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ra-phone { border: 8px solid #1f2630; border-radius: 28px; background: var(--ground); overflow: hidden; min-height: 380px; display: flex; flex-direction: column; }
.ra-phone-head { padding: .7rem .9rem; font-weight: 700; background: var(--surface); border-bottom: 1px solid var(--line); }
.ra-tiles { list-style: none; margin: 0; padding: .7rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; flex: 1; align-content: start; }
.ra-tiles li { background: var(--surface); border-radius: .6rem; padding: .55rem .3rem; font-size: .68rem; text-align: center; line-height: 1.3; box-shadow: var(--shadow); }
.ra-tiles li.is-noperm { opacity: .45; text-decoration: line-through; }
.ra-phone-bar { display: grid; grid-template-columns: repeat(5, 1fr); font-size: .6rem; text-align: center; padding: .55rem .2rem; background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); }
.ra-phone-bar b { color: var(--accent-text); }

/* ---------- المخزون › توزيع مصاريف على القطع (0.66) ---------- */
.cs-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 992px) { .cs-layout { grid-template-columns: minmax(0, 1fr) 330px; } .cs-side { position: sticky; top: calc(var(--top-h) + 1rem); } }
.cs-tools { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1rem .75rem; }
.cs-tools input[type=search] { flex: 1 1 200px; }
.cs-tools select { flex: 0 1 200px; }
.cs-table { max-height: 62vh; overflow: auto; }
.cs-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.cs-chk { width: 2.5rem; }
.cs-table label { cursor: pointer; }
.cs-table tr.is-on { background: var(--accent-soft); }
.cs-new { color: var(--muted); }
tr.is-on .cs-new { color: var(--success); font-weight: 700; }
.cs-sum { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0; padding: .75rem; border-radius: .6rem; background: var(--ground); }
.cs-sum div { display: flex; flex-direction: column; }
.cs-sum dt { font-size: .75rem; font-weight: 500; color: var(--muted); }
.cs-sum dd { margin: 0; font-weight: 700; font-size: 1.05rem; }
.cs-sum .cs-sum-main { grid-column: 1 / -1; padding-top: .5rem; border-top: 1px solid var(--line); }
.cs-sum .cs-sum-main dd { font-size: 1.5rem; color: var(--accent-text); }
.cs-facts { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cs-facts div { display: flex; flex-direction: column; gap: .15rem; padding: .75rem; border-radius: .6rem; background: var(--ground); }
.cs-facts span { font-size: .78rem; color: var(--muted); }
.cs-facts strong { font-size: 1.1rem; }
.cs-facts .cs-facts-main strong { color: var(--accent-text); font-size: 1.35rem; }

/* ---------- منتجات تطبيق المندوب (0.67) ---------- */
.rc-head { position: sticky; top: var(--top-h); z-index: 5; margin: 0 -.25rem .6rem; padding: .25rem .25rem .5rem; background: var(--ground); }
.rc-search .form-control, .rc-search input { height: 40px; }
.rc-chips { display: flex; gap: .35rem; overflow-x: auto; padding: .5rem 0 .1rem; scrollbar-width: none; }
.rc-chips::-webkit-scrollbar { display: none; }
.rc-chip { flex: none; height: 30px; padding: 0 .75rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.rc-chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.rc-bar { display: flex; align-items: center; gap: .5rem; margin-top: .45rem; }
.rc-count { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.rc-sort { display: flex; margin-inline-start: auto; padding: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.rc-sort button { height: 26px; padding: 0 .6rem; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: .72rem; font-weight: 700; }
.rc-sort button.active { background: var(--accent); color: #fff; }
.rc-body { padding-top: 0; }
.rc-gallery { position: relative; margin: 0 -1rem .8rem; }
.rc-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rc-track::-webkit-scrollbar { display: none; }
.rc-slide { flex: none; width: 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; max-height: 46vh; background: var(--surface-2); }
.rc-slide img { width: 100%; height: 100%; object-fit: contain; }
.rc-gdots { position: absolute; bottom: .6rem; left: 50%; transform: translateX(-50%); display: flex; gap: .3rem; padding: .25rem .45rem; border-radius: 999px; background: rgba(0, 0, 0, .35); }
.rc-gdots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: width .2s; }
.rc-gdots span.on { width: 16px; border-radius: 3px; background: #fff; }
.rc-noimg { display: grid; place-items: center; height: 9rem; margin: 0 -1rem .8rem; background: var(--accent-soft); color: var(--accent-text); font-size: 3rem; font-weight: 800; }
.rc-mhead h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 .25rem; }
.rc-sub { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .8rem; color: var(--muted); }
.rc-tag { padding: .1rem .5rem; border-radius: 999px; background: var(--ground); color: var(--ink-2); }
.rc-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem; margin: .8rem 0 .2rem; padding: .7rem .9rem; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.rc-price strong { font-size: 1.6rem; font-weight: 800; }
.rc-instock { margin-inline-start: auto; font-size: .8rem; font-weight: 700; color: var(--success); }
.rc-h { font-size: .95rem; font-weight: 800; margin: 1rem 0 .5rem; }
.rc-colors { display: grid; gap: .5rem; }
.rc-color { padding: .65rem .75rem; border-radius: 14px; background: var(--ground); }
.rc-color.none { opacity: .55; }
.rc-ctop { display: flex; align-items: center; gap: .5rem; }
.rc-ctop .swatch { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.rc-ctotal { margin-inline-start: auto; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.rc-sizes { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.rc-size { display: flex; flex-direction: column; align-items: center; min-width: 3rem; padding: .25rem .45rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); line-height: 1.2; }
.rc-size b { font-size: .8rem; }
.rc-size small { font-size: .7rem; color: var(--success); font-weight: 700; }
.rc-size.none small { color: var(--muted); }
.rc-desc { font-size: .9rem; color: var(--ink-2); white-space: pre-line; }
.rc-foot .btn { flex: 1; }

/* ---------- سند القبض في تطبيق المندوب (0.67) ---------- */
.rx { --rx-ease: cubic-bezier(.32, .72, 0, 1); --rx-pop: cubic-bezier(.3, 1.5, .5, 1); max-width: 640px; margin-inline: auto; padding-bottom: 7rem; }
.rx-title { font-size: 1.35rem; font-weight: 800; margin: .25rem 0 .6rem; }
.rx-pick .qo-search { margin-bottom: .6rem; }
.rx-empty { color: var(--muted); padding: 2rem 0; text-align: center; }
.rx-who { display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; margin-bottom: .75rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.rx-who-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rx-who-body strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-who-body small { color: var(--muted); font-size: .78rem; }
.rx-late { color: var(--danger); }
.rx-note { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem .85rem; margin-bottom: .75rem; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: .82rem; }
.rx-note .ic { flex: none; width: 20px; height: 20px; }
.rx-total { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: 1.1rem 1rem 1rem; margin-bottom: .85rem; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #3fd88a 0%, transparent 55%), linear-gradient(140deg, #19b866, #0e8a4e); box-shadow: 0 14px 28px rgba(14, 138, 78, .28); }
.rx-total::after { content: ''; position: absolute; inset-inline-start: -50px; top: -60px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.rx-total-label { font-size: .85rem; opacity: .9; }
.rx-total-value { font-size: 2.3rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rx-total-parts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem; min-height: 1.4rem; }
.rx-pill { padding: .1rem .55rem; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: .74rem; font-weight: 600; animation: rxPop .3s var(--rx-pop) both; }
.rx-card { padding: .9rem; margin-bottom: .75rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.rx-card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.rx-card-head h2 { font-size: 1rem; font-weight: 800; margin: 0; }
.rx-sub { margin-inline-start: auto; font-size: .78rem; color: var(--muted); font-weight: 600; }
.rx-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.rx-ic .ic { width: 19px; height: 19px; }
.rx-green { background: linear-gradient(145deg, #2fcf74, #13924a); } .rx-blue { background: linear-gradient(145deg, #4f94ff, #1d5fe0); }
.rx-violet { background: linear-gradient(145deg, #9b7bff, #6a3fe0); } .rx-amber { background: linear-gradient(145deg, #ffc84a, #f08c00); }
.rx-money { display: flex; align-items: center; gap: .4rem; padding: 0 .9rem; border-radius: 14px; background: var(--ground); border: 2px solid transparent; transition: border-color .15s; }
.rx-money:focus-within { border-color: var(--accent); background: var(--surface); }
.rx-money input { flex: 1; min-width: 0; height: 58px; border: 0; background: none; font-size: 1.7rem !important; font-weight: 800; color: var(--ink); outline: none; }
.rx-money span { font-size: 1.2rem; font-weight: 700; color: var(--muted); }
.rx-money.small input { height: 48px; font-size: 1.3rem !important; }
.rx-quick { display: flex; gap: .4rem; margin-top: .6rem; overflow-x: auto; scrollbar-width: none; }
.rx-chip { flex: none; display: flex; gap: .35rem; align-items: baseline; padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: .8rem; }
.rx-chip b { color: var(--ink); }
.rx-chip:active { transform: scale(.95); }
.rx-chlist { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .55rem; }
.rx-ch { position: relative; animation: rxIn .35s var(--rx-pop) both; }
.rx-ch.fresh { animation: rxIn .45s var(--rx-pop) both; }
.rx-ch.out { animation: rxOut .22s ease both; }
.rx-ch-body { width: 100%; display: flex; flex-direction: column; gap: .2rem; padding: .75rem .9rem .7rem; border: 0; border-radius: 14px; text-align: start; color: #14325c;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .0) 0 10px, rgba(255, 255, 255, .25) 10px 11px), linear-gradient(135deg, #e3eeff, #cfe0ff); box-shadow: inset 0 0 0 1px rgba(29, 95, 224, .18); }
.rx-ch-top { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; font-weight: 700; padding-inline-end: 1.8rem; }
.rx-ch-no { opacity: .75; }
.rx-ch-amt { font-size: 1.35rem; font-weight: 800; }
.rx-ch-bot { display: flex; justify-content: space-between; gap: .5rem; font-size: .74rem; opacity: .8; border-top: 1px dashed rgba(20, 50, 92, .25); padding-top: .3rem; }
.rx-ch-x { position: absolute; top: .45rem; inset-inline-end: .45rem; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .8); color: var(--danger); font-size: 1.1rem; line-height: 1; }
.rx-add { width: 100%; height: 50px; border: 2px dashed var(--accent-line); border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; }
.rx-add span { font-size: 1.3rem; vertical-align: -2px; margin-inline-end: .2rem; }
.rx-add:active { transform: scale(.98); }
.rx-toggle { margin-inline-start: auto; border: 0; background: none; color: var(--accent-text); font-weight: 700; font-size: .85rem; }
.rx-tbody { animation: rxIn .3s var(--rx-ease) both; }
.rx-insts { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; }
.rx-inst { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .6rem .7rem; border-radius: 14px; border: 2px solid var(--line); background: var(--ground); text-align: start; color: var(--ink); transition: border-color .15s, background .15s, transform .15s var(--rx-pop); }
.rx-inst.on { border-color: #f08c00; background: #fff5e0; }
.rx-inst:active { transform: scale(.96); }
.rx-inst-top { display: flex; width: 100%; justify-content: space-between; gap: .3rem; font-size: .76rem; }
.rx-inst-when { color: var(--muted); }
.rx-inst.late .rx-inst-when { color: var(--danger); font-weight: 700; }
.rx-inst-amt { font-size: 1.05rem; font-weight: 800; }
.rx-inst small { font-size: .68rem; color: var(--muted); }
.rx-hint { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }
.rx-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 1040; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.rx-go { display: block; width: 100%; max-width: 640px; margin-inline: auto; height: 54px; border-radius: 16px; font-weight: 800; font-size: 1.1rem; }
.rx-go:not(:disabled) { animation: rxPop .3s var(--rx-pop) both; }
.rx-chform { display: grid; gap: .6rem; }
.rx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.rx-err { margin: 0; padding: .5rem .7rem; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: .85rem; }
.rx-chfoot .btn { flex: 1; min-width: 0 !important; font-size: .95rem; }
.rx-cf-who { font-weight: 800; margin-bottom: .4rem; }
.rx-cf { margin: 0; border-radius: 14px; background: var(--ground); overflow: hidden; }
.rx-cf div { display: flex; justify-content: space-between; padding: .6rem .85rem; border-bottom: 1px solid var(--line); }
.rx-cf dt { font-weight: 500; } .rx-cf dd { margin: 0; font-weight: 700; }
.rx-cf .rx-cf-total { background: var(--success-soft); color: var(--success); font-size: 1.1rem; border: 0; }
@keyframes rxIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes rxOut { to { opacity: 0; transform: translateX(-30px) scale(.95); } }
@keyframes rxPop { from { opacity: 0; transform: scale(.9); } }
@media (min-width: 992px) { .rx-bar { position: sticky; bottom: 0; margin-top: 1rem; border-radius: 16px; } }
:root[data-shell] .rx-bar { bottom: calc(var(--rt-h, 0px) + env(safe-area-inset-bottom)); padding-bottom: .7rem; }
@media (min-width: 992px) { :root[data-shell] .rx-bar { bottom: 0; } }
@media (prefers-reduced-motion: reduce) { .rx-ch, .rx-pill, .rx-go, .rx-tbody { animation: none !important; } }

/* بعد إصدار السند: علامة نجاح متحركة */
.rx-done { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.4rem 1rem 1.1rem; margin-bottom: 1rem; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); text-align: center; animation: rxIn .4s var(--rx-pop, ease) both; }
.rx-done h2 { font-size: 1.25rem; font-weight: 800; margin: .3rem 0 0; }
.rx-done p { color: var(--muted); margin: 0; }
.rx-done .rx-done-amt { font-size: 1.8rem; font-weight: 800; color: var(--success); }
.rx-done-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; width: 100%; margin-top: .6rem; }
.rx-done .qo-check path { animation: qoDraw .5s .25s ease-out forwards; }
.rx-done .qo-check { animation: rxPop .45s cubic-bezier(.3, 1.5, .5, 1) both; }

/* ---------- عهدتي في تطبيق المندوب (0.67) ---------- */
.cu { max-width: 720px; margin-inline: auto; padding-bottom: 1rem; }
.cu-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .2rem; padding: 1.15rem 1.2rem; margin-bottom: .8rem; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #4fe0cf 0%, transparent 55%), linear-gradient(140deg, #17b3a3, #0b746c); box-shadow: 0 14px 28px rgba(11, 116, 108, .28); }
.cu-hero.is-late { background: radial-gradient(120% 140% at 0% 0%, #ffd56a 0%, transparent 55%), linear-gradient(140deg, #f5a20b, #d06a00); box-shadow: 0 14px 28px rgba(208, 106, 0, .28); }
.cu-hero::after { content: ''; position: absolute; inset-inline-end: -40px; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.cu-hero-label { font-size: .88rem; opacity: .92; }
.cu-hero-value { font-size: 2.1rem; font-weight: 800; line-height: 1.15; }
.cu-split { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .5rem; }
.cu-split span { display: flex; flex-direction: column; padding: .5rem .7rem; border-radius: 14px; background: rgba(255, 255, 255, .16); }
.cu-split b { font-size: 1.05rem; } .cu-split small { font-size: .74rem; opacity: .9; }
.cu-hero-note { position: relative; z-index: 1; margin-top: .45rem; font-size: .8rem; font-weight: 600; }
.cu-hand { width: 100%; height: 52px; border-radius: 16px; font-weight: 800; margin-bottom: .8rem; }
.cu-pending { display: flex; gap: .7rem; align-items: center; padding: .8rem .9rem; margin-bottom: .8rem; border-radius: 16px; background: var(--warn-soft); color: var(--warn); text-decoration: none; }
.cu-pending:hover { color: var(--warn); }
.cu-steps { display: flex; gap: 4px; flex: none; }
.cu-steps i { width: 10px; height: 10px; border-radius: 50%; background: rgba(163, 90, 0, .25); }
.cu-steps i.on { background: var(--warn); }
.cu-steps i:last-child { animation: cuPulse 1.4s ease-in-out infinite; }
@keyframes cuPulse { 50% { background: var(--warn); } }
.cu-pending-body { display: flex; flex-direction: column; } .cu-pending-body small { font-size: .76rem; opacity: .85; }
.cu-h { display: flex; align-items: center; gap: .5rem; font-size: 1.02rem; font-weight: 800; margin: 1rem 0 .6rem; }
.cu-empty { display: flex; gap: .5rem; align-items: center; padding: .9rem 1rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); }
.cu-empty .ic { width: 22px; height: 22px; color: var(--success); }
.cu-list { display: grid; gap: .65rem; }
.cu-card { padding: .75rem .85rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); animation: rxIn .35s cubic-bezier(.32, .72, 0, 1) both; }
.cu-card-main { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.cu-card-main:hover { color: var(--ink); }
.cu-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cu-card-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cu-card-body small { font-size: .74rem; color: var(--muted); }
.cu-amt { font-size: 1.05rem; }
.cu-parts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.cu-part { padding: .2rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.cu-part.cash { background: var(--success-soft); color: var(--success); }
.cu-part.chq { background: #e3eeff; color: #1d4fb0; }
.cu-part.tr { background: #efe8ff; color: #5b34c9; }
.cu-card-foot { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; padding-top: .55rem; border-top: 1px dashed var(--line); }
.cu-form { padding: 1rem; }
.pill.ok { background: var(--success-soft); color: var(--success); }

/* ---------- اتفاقات الدفعات (0.67) ---------- */
.rx, .cu, .pl { --qo-ease: cubic-bezier(.32, .72, 0, 1); --qo-pop: cubic-bezier(.3, 1.5, .5, 1); }
.pl { max-width: 760px; margin-inline: auto; padding-bottom: 1rem; }
.pl .rh-rose, .pl .rh-amber, .pl .rh-blue { --on: #fff; }
.pl .rh-rose { --c1: #ff7d93; --c2: #e0244a; } .pl .rh-amber { --c1: #ffc84a; --c2: #f08c00; } .pl .rh-blue { --c1: #4f94ff; --c2: #1d5fe0; }
.pl-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .8rem; }
.pl-stat { display: flex; flex-direction: column; padding: .7rem .75rem; border-radius: 16px; color: #fff; background: linear-gradient(150deg, var(--c1), var(--c2)); box-shadow: 0 8px 18px color-mix(in srgb, var(--c2) 25%, transparent); }
.pl-stat small { font-size: .74rem; opacity: .92; } .pl-stat b { font-size: 1.05rem; } .pl-stat span { font-size: .7rem; opacity: .9; }
.pl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.pl-tabs { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pl-tabs a { padding: .35rem .9rem; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: .85rem; text-decoration: none; }
.pl-tabs a.on { background: var(--ink); color: var(--surface); }
.pl-rep { min-width: 9rem; }
.pl-new { margin-inline-start: auto; border-radius: 999px; font-weight: 700; }
.pl-status { margin: .2rem 0 .7rem; width: max-content; }
.pl-status a { display: inline-block; height: 26px; line-height: 26px; padding: 0 .7rem; border-radius: 999px; color: var(--muted); font-size: .76rem; font-weight: 700; text-decoration: none; }
.pl-status a.active { background: var(--accent); color: #fff; }
.pl-h { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 800; margin: 1rem 0 .55rem; }
.pl-h-late { color: #e0244a; } .pl-h-today { color: #c46a00; }
.pl-list { display: grid; gap: .6rem; }
.pl-due { padding: .7rem .8rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); border-inline-start: 4px solid var(--line-2); animation: rxIn .35s cubic-bezier(.32, .72, 0, 1) both; }
.pl-due.pl-late { border-inline-start-color: #e0244a; } .pl-due.pl-today { border-inline-start-color: #f08c00; } .pl-due.pl-tomorrow, .pl-due.pl-week { border-inline-start-color: #1d5fe0; }
.pl-due-main { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.pl-due-main:hover { color: var(--ink); }
.pl-due-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-due-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-due-body small { font-size: .74rem; color: var(--muted); }
.pl-due-end { display: flex; flex-direction: column; align-items: flex-end; }
.pl-due-end b { font-size: 1.05rem; }
.pl-when { font-size: .72rem; font-weight: 700; color: var(--muted); }
.pl-late .pl-when { color: #e0244a; } .pl-today .pl-when { color: #c46a00; }
.pl-due-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .55rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.pl-due-actions .ic { width: 16px; height: 16px; }
.pl-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); text-align: center; }
.pl-empty .ic { width: 40px; height: 40px; color: var(--success); }
.pl-plan { display: flex; flex-direction: column; gap: .35rem; padding: .8rem .9rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.pl-plan:hover { color: var(--ink); }
.pl-plan-top, .pl-plan-foot { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.pl-plan-foot { font-size: .76rem; color: var(--muted); }
.pl-bar { display: block; height: 8px; border-radius: 999px; background: var(--ground); overflow: hidden; }
.pl-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #2fcf74, #13924a); transition: width .9s cubic-bezier(.32, .72, 0, 1); }
.ps-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; margin-bottom: .8rem; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #ffd56a 0%, transparent 55%), linear-gradient(140deg, #f5a20b, #d06a00); box-shadow: 0 14px 28px rgba(208, 106, 0, .26); }
.ps-hero a { color: #fff; }
.ps-hero-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.ps-who { font-size: 1.1rem; font-weight: 800; }
.ps-no { font-size: .78rem; opacity: .95; }
.ps-no .pill { background: rgba(255, 255, 255, .25); color: #fff; }
.ps-hero strong { font-size: 1.6rem; font-weight: 800; } .ps-hero strong small { font-size: .85rem; font-weight: 600; opacity: .9; }
.ps-next { font-size: .8rem; font-weight: 600; } .ps-next.late { padding: .1rem .5rem; border-radius: 999px; background: rgba(150, 0, 30, .35); width: max-content; }
.ps-ring { position: relative; flex: none; width: 88px; height: 88px; display: grid; place-items: center; }
.ps-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ps-ring circle { fill: none; stroke-width: 8; }
.ps-ring .rh-ring-bg { stroke: rgba(255, 255, 255, .25); }
.ps-ring .rh-ring-fg { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.32, .72, 0, 1); }
.ps-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.ps-actions .btn { flex: 1 1 8rem; border-radius: 14px; font-weight: 700; }
.ps-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.ps-timeline::before { content: ''; position: absolute; top: 12px; bottom: 12px; inset-inline-start: 17px; width: 2px; background: var(--line-2); }
.ps-item { position: relative; display: flex; gap: .8rem; padding-bottom: .7rem; }
.ps-dot { position: relative; z-index: 1; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface); color: var(--muted); box-shadow: 0 0 0 2px var(--line-2); }
.ps-item.is-paid .ps-dot { background: #13924a; color: #fff; box-shadow: none; }
.ps-item.is-part .ps-dot { background: #fff3d6; color: #a15c00; box-shadow: 0 0 0 2px #f5a20b; }
.ps-item.is-late .ps-dot { background: #e0244a; color: #fff; box-shadow: 0 0 0 4px rgba(224, 36, 74, .18); }
.ps-item.is-today .ps-dot { background: #f08c00; color: #fff; box-shadow: 0 0 0 4px rgba(240, 140, 0, .2); }
.ps-body { flex: 1; min-width: 0; padding: .55rem .75rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.ps-item.is-paid .ps-body { opacity: .75; }
.ps-top { display: flex; justify-content: space-between; gap: .5rem; }
.ps-body small { color: var(--muted); font-size: .76rem; }
.ps-item.is-late .ps-body small { color: #e0244a; font-weight: 700; }
.ps-link { display: inline-block; margin-top: .3rem; margin-inline-end: .4rem; padding: .1rem .5rem; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: .72rem; text-decoration: none; }
.pf-step { display: flex; align-items: center; height: 48px; border-radius: 14px; background: var(--ground); overflow: hidden; }
.pf-step button { width: 48px; height: 100%; border: 0; background: none; font-size: 1.4rem; font-weight: 700; color: var(--accent-text); }
.pf-step output { flex: 1; text-align: center; font-size: 1.3rem; font-weight: 800; }
.pf-freq { margin-top: .3rem; }
.pf-rows { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .45rem; }
.pf-row { position: relative; display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border-radius: 14px; background: var(--ground); animation: rxIn .3s cubic-bezier(.32, .72, 0, 1) both; flex-wrap: wrap; }
.pf-seq { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-weight: 800; font-size: .8rem; color: var(--accent-text); }
.pf-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: 1.2fr 1fr; gap: .4rem; }
.pf-fields .form-control { height: 42px; }
.pf-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface); color: var(--danger); font-size: 1.1rem; }
.pf-x:disabled { opacity: .3; }
.pf-paid { width: 100%; padding-inline-start: 2.3rem; font-size: .72rem; color: var(--success); font-weight: 700; }

/* ---------- الإعدادات › المدن (0.68) ---------- */
.ct-list { list-style: none; margin: 0; padding: 0; }
.ct-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .6rem 1rem; border-top: 1px solid var(--line); }
.ct-row.is-off { background: var(--ground); }
.ct-row.is-off input[name=name] { color: var(--muted); }
.ct-edit { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; flex: 1 1 18rem; }
.ct-edit input[name=name] { flex: 1 1 10rem; max-width: 18rem; }
.ct-count { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.ct-merge summary { font-size: .8rem; color: var(--danger); cursor: pointer; }
.ct-merge form { display: flex; gap: .4rem; margin-top: .4rem; }

/* ---------- عميل جديد من الجوال (0.68) ---------- */
.nc-photo { padding: .5rem; }
.nc-shot { display: block; position: relative; overflow: hidden; height: 170px; border-radius: 14px; background: var(--ground); cursor: pointer; border: 2px dashed var(--line-2); }
.nc-shot img { width: 100%; height: 100%; object-fit: cover; }
.nc-shot-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; color: var(--muted); }
.nc-shot-empty .ic { width: 38px; height: 38px; color: var(--accent); }
.nc-shot-empty b { color: var(--ink); }
.nc-gps { display: flex; align-items: center; gap: .6rem; width: 100%; margin-top: .75rem; padding: .7rem .8rem; border: 0; border-radius: 14px; background: #e8f1ff; color: #1d4fb0; font-weight: 700; text-align: start; }
.nc-gps-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #1d5fe0; color: #fff; flex: none; }
.nc-gps-ic .ic { width: 19px; height: 19px; }
.nc-gps.busy .nc-gps-ic { animation: cuPulse 1s infinite; }
.nc-gps.ok { background: var(--success-soft); color: var(--success); }
.nc-gps.ok .nc-gps-ic { background: var(--success); }
.rx-chphoto { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 54px; border-radius: 12px; border: 2px dashed var(--line-2); background: var(--ground); color: var(--muted); font-size: .85rem; font-weight: 700; cursor: pointer; overflow: hidden; }
.rx-chphoto img { width: 100%; max-height: 160px; object-fit: cover; }
.rx-chphoto .ic { width: 20px; height: 20px; color: #1d5fe0; }
.rx-ch-thumb { position: absolute; bottom: .55rem; inset-inline-end: .55rem; width: 42px; height: 30px; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 2px #fff; }
.rx-ch-body { position: relative; }
.cheque-photo { max-width: 100%; width: 260px; border-radius: 10px; box-shadow: var(--shadow); }
.vs-form { padding: .8rem 1rem 1rem; }
.vs-outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin: 0 0 .6rem; padding: 0; border: 0; }
.vs-outcomes legend { float: none; }
.vs-outcomes input { position: absolute; opacity: 0; pointer-events: none; }
.vs-outcomes span { display: block; padding: .65rem .5rem; border-radius: 12px; background: var(--ground); text-align: center; font-weight: 700; font-size: .85rem; border: 2px solid transparent; }
.vs-outcomes input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.vs-outcomes input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- ملف العميل في تطبيق المندوب (0.68) ---------- */
.cp { max-width: 720px; margin-inline: auto; padding-bottom: 1rem; }
.cp-hero { position: relative; overflow: hidden; border-radius: 22px; margin-bottom: .8rem; background: linear-gradient(140deg, #ff8a4c, #f0461c); color: #fff; box-shadow: 0 14px 28px rgba(240, 70, 28, .25); }
.cp-hero.has-photo { min-height: 190px; }
.cp-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cp-hero.has-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .65)); }
.cp-hero-body { position: relative; z-index: 1; display: flex; align-items: center; gap: .8rem; padding: 1.1rem 1.1rem; }
.cp-hero.has-photo .cp-hero-body { position: absolute; inset-inline: 0; bottom: 0; }
.cp-avatar { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; background: rgba(255, 255, 255, .22); }
.cp-hero h1 { font-size: 1.3rem; font-weight: 800; margin: 0; }
.cp-hero small { opacity: .92; font-size: .8rem; }
.cp-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin-bottom: .8rem; }
.cp-act { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .7rem .2rem .6rem; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-size: .76rem; font-weight: 700; }
.cp-act:hover { color: var(--ink); }
.cp-act:active { transform: scale(.95); }
.cp-act:disabled { opacity: .6; }
.cp-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .8rem; }
.cp-money div { display: flex; flex-direction: column; padding: .65rem .75rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.cp-money small { font-size: .74rem; color: var(--muted); } .cp-money b { font-size: 1rem; }
.cp-money .late b { color: #e0244a; } .cp-money .ok b { color: var(--success); }
.cp-plan { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; margin-bottom: .8rem; border-radius: 16px; background: #fff5e0; color: #8a4e00; text-decoration: none; }
.cp-plan:hover { color: #8a4e00; }
.cp-plan.late { background: #ffe8ec; color: #b8143a; }
.cp-plan.soft { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cp-plan .ic { width: 24px; height: 24px; }
.cp-plan-body { flex: 1; display: flex; flex-direction: column; } .cp-plan-body small { font-size: .76rem; opacity: .85; }
.cp-sub { font-size: .8rem; color: var(--muted); margin: -.2rem 0 .45rem; }
.cp-sugs { display: flex; gap: .6rem; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: .6rem; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cp-sugs::-webkit-scrollbar { display: none; }
.cp-sug { flex: 0 0 138px; scroll-snap-align: start; display: flex; flex-direction: column; gap: .15rem; padding: .5rem; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.cp-sug:hover { color: var(--ink); }
.cp-sug-img { display: grid; place-items: center; height: 100px; border-radius: 12px; overflow: hidden; background: var(--accent-soft); color: var(--accent-text); font-size: 1.6rem; margin-bottom: .2rem; }
.cp-sug-img img { width: 100%; height: 100%; object-fit: cover; }
.cp-sug strong { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-sug span.num { font-size: .82rem; font-weight: 800; color: var(--accent-text); }
.cp-sug small { font-size: .68rem; color: var(--muted); line-height: 1.3; }
.cp-foot { margin-top: 1rem; font-size: .8rem; color: var(--muted); }
.qo-toast.ok { background: var(--success); }

/* ---------- خط سير اليوم (0.68) ---------- */
.dr { max-width: 720px; margin-inline: auto; padding-bottom: 1rem; }
.dr-hero { display: flex; align-items: center; gap: .8rem; padding: 1.1rem 1.2rem; margin-bottom: .7rem; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #7fb4ff 0%, transparent 55%), linear-gradient(140deg, #3b82f6, #1d4fb0); box-shadow: 0 14px 28px rgba(29, 79, 176, .28); }
.dr-hero > div { flex: 1; display: flex; flex-direction: column; }
.dr-hero-label { font-size: .85rem; opacity: .9; } .dr-hero strong { font-size: 1.7rem; font-weight: 800; } .dr-hero small { font-size: .78rem; opacity: .9; }
.dr-go { font-weight: 800; border-radius: 14px; white-space: nowrap; color: #1d4fb0 !important; }
.dr-go .ic { width: 18px; height: 18px; }
.dr-chips { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; margin-bottom: .7rem; }
.dr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; counter-reset: none; }
.dr-item { display: flex; gap: .65rem; padding: .7rem .75rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); animation: rxIn .35s cubic-bezier(.32, .72, 0, 1) both; }
.dr-item.done { opacity: .6; }
.dr-n { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(145deg, #4f94ff, #1d5fe0); }
.dr-item.done .dr-n { background: var(--success); }
.dr-body { flex: 1; min-width: 0; }
.dr-top { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.dr-top:hover { color: var(--ink); }
.dr-top small { font-size: .75rem; color: var(--muted); }
.dr-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.dr-tag { padding: .12rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--ground); color: var(--ink-2); }
.dr-tag.plan { background: #fff3d6; color: #a15c00; } .dr-tag.plan.late, .dr-tag.debt { background: #ffe5ea; color: #c01d43; }
.dr-tag.cart { background: var(--accent-soft); color: var(--accent-text); } .dr-tag.ok { background: var(--success-soft); color: var(--success); }
.dr-acts { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- مسح الباركود وإرسال الأصناف (0.68) ---------- */
.rc-searchrow { display: flex; gap: .45rem; align-items: center; }
.rc-searchrow .rc-search { flex: 1; min-width: 0; }
.rc-iconbtn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; box-shadow: var(--shadow); }
.rc-iconbtn .ic { width: 22px; height: 22px; }
.rc-iconbtn.on { background: var(--success); border-color: var(--success); color: #fff; }
.rc-iconbtn[hidden] { display: none; }
.qo-tools { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.qo-tools .qo-search { flex: 1 1 0; min-width: 0; }
.qo-tools .qo-cats { flex-basis: 100%; }
.rc-selecting .qo-card { position: relative; }
.rc-selecting .qo-card::after { content: ''; position: absolute; top: .5rem; inset-inline-start: .5rem; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 2px var(--line-2); }
.rc-selecting .qo-card.sel { box-shadow: 0 0 0 3px var(--success), var(--shadow); }
.rc-selecting .qo-card.sel::after { content: '✓'; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--success); box-shadow: none; }
.rc-selhint { margin: .4rem 0 0; font-size: .8rem; color: var(--success); font-weight: 700; text-align: center; }
.rc-sharebar { position: fixed; z-index: 1040; inset-inline: 0; bottom: 0; display: flex; gap: .5rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); animation: rxIn .3s cubic-bezier(.32, .72, 0, 1) both; }
.rc-sharebar .btn-success { flex: 1; font-weight: 800; border-radius: 14px; }
:root[data-shell] .rc-sharebar { bottom: calc(var(--rt-h, 0px) + env(safe-area-inset-bottom)); padding-bottom: .7rem; }
@media (min-width: 992px) { :root[data-shell] .rc-sharebar { bottom: 0; } }
.scan { position: fixed; inset: 0; z-index: 1090; background: #000; }
.scan video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; top: 50%; left: 50%; width: min(78vw, 320px); height: 170px; transform: translate(-50%, -50%); border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); border: 3px solid rgba(255, 255, 255, .9); overflow: hidden; }
.scan-frame i { position: absolute; inset-inline: 8%; height: 2px; top: 50%; background: #ff6c2f; box-shadow: 0 0 12px #ff6c2f; animation: scanLine 1.6s ease-in-out infinite; }
@keyframes scanLine { 0%, 100% { transform: translateY(-60px); } 50% { transform: translateY(60px); } }
.scan-msg { position: absolute; bottom: calc(2rem + env(safe-area-inset-bottom)); inset-inline: 1rem; margin: 0; padding: .7rem 1rem; border-radius: 14px; background: rgba(0, 0, 0, .6); color: #fff; text-align: center; font-weight: 700; }
.scan-x { position: absolute; top: calc(1rem + env(safe-area-inset-top)); inset-inline-end: 1rem; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); font-size: 1.6rem; line-height: 1; }

/* ---------- العمل بدون إنترنت (0.68) ---------- */
.ob-pill { position: fixed; z-index: 1045; left: 50%; transform: translateX(-50%); bottom: calc(var(--rt-h, 0px) + 12px + env(safe-area-inset-bottom)); padding: .45rem .9rem; border: 0; border-radius: 999px; background: #1d4fb0; color: #fff; font-size: .8rem; font-weight: 700; box-shadow: var(--shadow-pop); white-space: nowrap; }
.ob-pill.bad { background: var(--danger); }
.ob-pill[hidden] { display: none; }
.ob-toast { position: fixed; z-index: 1085; inset-inline: 1rem; top: calc(env(safe-area-inset-top) + 76px); max-width: 30rem; margin-inline: auto; padding: .7rem 1rem; border-radius: 14px; background: var(--ink); color: var(--surface); font-weight: 700; box-shadow: var(--shadow-pop); transform: translateY(-.8rem); opacity: 0; transition: transform .3s, opacity .3s; text-align: center; }
.ob-toast.show { transform: none; opacity: 1; }
.ob-toast.ok { background: var(--success); color: #fff; } .ob-toast.bad { background: var(--danger); color: #fff; }
.qo-pend { margin: .5rem 0 0; padding: .5rem .8rem; border-radius: 12px; background: #e8f1ff; color: #1d4fb0; font-size: .82rem; font-weight: 700; text-align: center; }
.oq-body { background: #f6f4f3; font-family: "Plex Arabic", Tahoma, sans-serif; }
.oq { max-width: 420px; margin: 18vh auto 0; padding: 1.5rem; text-align: center; }
.oq-ic { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: #e6f5ee; color: #1a8a5c; font-size: 2.2rem; font-weight: 800; }
.oq h1 { font-size: 1.3rem; font-weight: 800; }
.oq p { color: #5b6573; margin-bottom: 1.4rem; }

/* ===== تعديل المنتجات بالبطاقات (0.69) ===== */
.pe { max-width: 64rem; margin-inline: auto; }
.pe-head { position: sticky; top: 0; z-index: 5; display: grid; gap: .55rem; padding: .25rem 0 .6rem; background: var(--ground); }
.pe-chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; }
.pe-chips::-webkit-scrollbar { display: none; }
.pe-chips span { opacity: .65; font-weight: 500; margin-inline-start: .15rem; }
.pe-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: .8rem; }
.pe-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.pe-card.noimg { border-color: var(--accent-line); }
.pe-strip { display: flex; gap: .45rem; padding: .6rem; overflow-x: auto; scroll-snap-type: x proximity; background: var(--surface-2, rgba(127,127,127,.06)); scrollbar-width: thin; }
.pe-img { position: relative; flex: none; width: 6.4rem; height: 8rem; border-radius: 12px; overflow: hidden; background: var(--line); scroll-snap-align: start; cursor: pointer; outline-offset: 2px; }
.pe-img.main { width: 7.4rem; box-shadow: 0 0 0 2px var(--accent); }
.pe-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pe-badge { position: absolute; inset-inline-start: .3rem; top: .3rem; padding: .05rem .4rem; border-radius: 6px; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 700; }
.pe-img.pending img { opacity: .45; filter: saturate(.4); }
.pe-prog { position: absolute; inset-inline: .4rem; bottom: .45rem; height: 5px; border-radius: 3px; background: rgba(255,255,255,.7); overflow: hidden; }
.pe-prog i { display: block; height: 100%; width: 4%; background: var(--accent); transition: width .2s; }
.pe-imgmenu { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: .35rem; padding: .4rem; background: rgba(15, 18, 25, .62); animation: pe-in .15s ease-out; }
.pe-act { display: block; padding: .4rem .3rem; border-radius: 8px; background: #fff; color: #1d2330; font-size: .74rem; font-weight: 700; text-align: center; }
.pe-act.del { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.7); }
.pe-act.del.sure { background: #d63939; border-color: var(--danger); }
.pe-add { flex: none; width: 6.4rem; height: 8rem; border: 2px dashed var(--accent-line); border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; font-size: .8rem; font-weight: 700; }
.pe-card.noimg .pe-add { width: 100%; flex: 1; height: 6.5rem; flex-direction: row; gap: .5rem; font-size: .95rem; }
.pe-add-plus { font-size: 2rem; line-height: 1; font-weight: 400; }
.pe-add:active { transform: scale(.97); }
.pe-body { padding: .7rem .85rem .85rem; display: grid; gap: .55rem; }
.pe-meta { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .75rem; color: var(--muted); }
.pe-code { font-weight: 700; color: var(--ink-2); direction: ltr; }
.pe-field { display: grid; gap: .2rem; margin: 0; }
.pe-label { font-size: .72rem; color: var(--ink-2); font-weight: 600; }
.pe-box { position: relative; display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.pe-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pe-box input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .6rem .75rem; font-size: 16px; color: var(--ink); outline: 0; }
.pe-name .pe-box input { font-weight: 700; }
.pe-price .pe-box input { font-size: 1.25rem; font-weight: 800; direction: ltr; text-align: right; letter-spacing: .01em; }
.pe-card.noprice .pe-price .pe-box { border-style: dashed; border-color: var(--accent-line); }
.pe-suffix { padding-inline-end: .2rem; font-weight: 700; color: var(--ink-2); }
.pe-state { width: 1.6rem; flex: none; display: flex; justify-content: center; margin-inline-end: .35rem; }
.pe-box.saving .pe-state::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: pe-spin .7s linear infinite; }
.pe-box.ok { border-color: var(--success); }
.pe-box.ok .pe-state::before { content: "✓"; color: var(--success); font-weight: 900; animation: pe-pop .3s ease-out; }
.pe-box.err { border-color: var(--danger); }
.pe-box.err .pe-state::before { content: "!"; color: var(--danger); font-weight: 900; }
.pe-toast { position: fixed; inset-inline: 1rem; bottom: calc(5.2rem + env(safe-area-inset-bottom)); z-index: 1070; margin-inline: auto; max-width: 26rem; padding: .7rem 1rem; border-radius: 12px; background: #1d2330; color: #fff; font-size: .88rem; font-weight: 600; text-align: center; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.pe-toast.show { opacity: 1; transform: none; }
.pe-toast.bad { background: #b42318; }
@keyframes pe-spin { to { transform: rotate(360deg); } }
@keyframes pe-pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pe-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 575.98px) { .pe-list { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pe-box.ok .pe-state::before, .pe-imgmenu { animation: none; } .pe-toast { transition: none; } }

/* ===== الطلب السريع 0.73: شريط سلة أوضح، نافذة موديل مضغوطة (مشكّل / لون محدد)، سلة مجمّعة بالموديل ===== */
.qo.has-cart { padding-bottom: 9rem; }
.qo-cartbar { padding: .5rem .55rem .5rem 1.1rem; gap: .7rem; min-height: 3.6rem; border-radius: 16px; background: var(--accent); color: #fff; box-shadow: 0 12px 28px rgba(var(--accent-rgb), .38); }
.qo-cart-n { flex: none; display: grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 .4rem; border-radius: 12px; background: #fff; color: var(--accent-text); font-weight: 800; font-size: 1.05rem; }
.qo-cartbar.bump .qo-cart-n { animation: qoBump .45s var(--qo-pop); }
.qo-cart-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; text-align: start; }
.qo-cart-txt strong { font-size: 1rem; font-weight: 800; }
.qo-cart-txt small { opacity: .85; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qo-cart-total { flex: none; font-size: 1.1rem; font-weight: 800; }
.qo-panel { max-height: 90vh; max-height: 90dvh; }
.qo-panel.tall { height: 92vh; height: 92dvh; max-height: 92dvh; }
.qo-panel-body { min-height: 0; -webkit-overflow-scrolling: touch; }
.qo-panel-foot { flex-wrap: wrap; gap: .5rem .75rem; }
.qo-msum { flex: 1; min-width: 0; font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.qo-add { min-width: 9rem; border-radius: 14px; font-weight: 800; }
.qo-add.busy { opacity: .7; }

.qo-mhead { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .7rem; margin: 0 -1rem; padding: .1rem 1rem .6rem; background: var(--surface); }
.qo-mthumb { flex: none; width: 3.5rem; height: 3.5rem; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.qo-mthumb img { width: 100%; height: 100%; object-fit: cover; }
.qo-mthumb .qo-ph { font-size: 1.3rem; }
.qo-mthumb[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.qo-mtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qo-mtitle h2 { font-size: 1.05rem; font-weight: 800; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qo-mtitle span { font-size: .78rem; color: var(--muted); }
.qo-imgs img { width: 46%; max-width: 11rem; }
.qo-imgs img:only-child { width: 60%; max-width: 14rem; aspect-ratio: 4 / 5; }
.qo-seg.qo-units, .qo-seg.qo-modes { margin: .35rem 0; }
.qo-hint { margin: .3rem 0 .55rem; font-size: .8rem; }

/* مشكّل: خانة لكل مقاس */
.qo-mix { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.9rem, 1fr)); gap: .45rem; }
.qo-mix.one { grid-template-columns: minmax(0, 15rem); justify-content: center; }
.qo-mcell { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .45rem .3rem; border: 1.5px solid var(--line); border-radius: 14px; transition: border-color .2s, background .2s; }
.qo-mcell.has { border-color: var(--accent-line); background: var(--accent-soft); }
.qo-mcell.none { opacity: .45; }
.qo-mix .qo-step { gap: .15rem; }
.qo-mix .qo-step button { width: 2.1rem; height: 2.3rem; font-size: 1.2rem; }
.qo-mix .qo-step input { width: 2.4rem; height: 2.3rem; font-size: 1.1rem; }
.qo-mix.one .qo-step button { width: 3rem; height: 3rem; }
.qo-mix.one .qo-step input { width: 4rem; height: 3rem; font-size: 1.35rem; }

/* لون محدد: صف لكل لون (مقاس واحد) */
.qo-crows { display: grid; gap: .35rem; }
.qo-crow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .6rem; border: 1.5px solid var(--line); border-radius: 13px; }
.qo-crow.has { border-color: var(--accent-line); background: var(--accent-soft); }
.qo-crow.none { opacity: .45; }
.qo-cname { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .4rem; font-weight: 700; }
.qo-cname small { grid-column: 2; color: var(--muted); font-weight: 500; font-size: .72rem; }
/* لون محدد: جدول الألوان × المقاسات */
.qo-tbl-wrap { overflow-x: auto; margin: 0 -1rem; padding: 0 1rem; }
.qo-tbl { width: 100%; border-collapse: separate; border-spacing: 0 .3rem; }
.qo-tbl thead th { padding: 0 .15rem .1rem; font-size: .8rem; font-weight: 800; text-align: center; color: var(--ink-2); }
.qo-tbl thead th:first-child { text-align: start; }
.qo-tbl tbody th { padding: .2rem .35rem .2rem 0; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.qo-tbl tbody th .swatch { margin-inline-end: .3rem; vertical-align: -1px; }
.qo-tbl td { padding: 0 .15rem; text-align: center; vertical-align: top; }
.qo-tbl td input { width: 100%; min-width: 2.6rem; height: 2.5rem; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1.05rem; font-weight: 800; text-align: center; }
.qo-tbl td input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.qo-tbl td.has input { border-color: var(--accent-line); background: var(--accent-soft); }
.qo-tbl td small { display: block; font-size: .66rem; color: var(--muted); line-height: 1.3; }
.qo-tbl td.none { color: var(--muted-2); line-height: 2.5rem; }
.qo-tbl td.max input { animation: qoShake .35s; color: var(--warn); }

/* السلة: مجمّعة بالموديل */
.qo-group { list-style: none; padding: .35rem 0 .5rem; border-bottom: 1px solid var(--line); }
.qo-ghead { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .2rem 0; border: 0; background: none; color: var(--ink); text-align: start; }
.qo-ghead .qo-limg { width: 2.7rem; height: 2.7rem; flex: none; }
.qo-gname { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.qo-gname strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qo-gname small { color: var(--accent-text); font-size: .72rem; }
.qo-gtotal { font-size: .95rem; }
.qo-glines { list-style: none; margin: .2rem 0 0; padding: 0; }
.qo-glines .qo-line { grid-template-columns: 1fr auto auto; grid-template-areas: "body step del" "body total del"; row-gap: 0; padding: .45rem .1rem .45rem 0; border-bottom: 0; border-top: 1px dashed var(--line); }
.qo-glines .qo-lbody { grid-area: body; }
.qo-glines .qo-step { grid-area: step; }
.qo-glines .qo-ltotal { grid-area: total; text-align: center; font-size: .74rem; color: var(--muted); font-weight: 700; }
.qo-glines .qo-del { grid-area: del; }
.qo-lwhat { display: flex; align-items: center; gap: .35rem; font-size: .9rem; }
.qo-lsize { padding: 0 .4rem; border-radius: 6px; background: var(--surface-2); font-weight: 800; font-size: .8rem; }
.qo-lbody small { line-height: 1.35; }
.qo-mixdot { display: inline-flex; }
.qo-mixdot .swatch { width: .7rem; height: .7rem; margin-inline-start: -.25rem; box-shadow: 0 0 0 1.5px var(--surface); }
.qo-mixdot .swatch:first-child { margin-inline-start: 0; }

/* سعر خاص للسطر في الطلب (0.74) */
.qo-lprice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; margin-top: .15rem; padding: .1rem .45rem; border: 1px dashed transparent; border-radius: 8px; background: none; color: var(--ink-2); font-size: .78rem; text-align: start; align-self: flex-start; }
button.qo-lprice { border-color: var(--line-2); cursor: pointer; }
button.qo-lprice:active { background: var(--surface-2); }
.qo-lprice strong { color: var(--ink); font-size: .85rem; }
.qo-lprice s { color: var(--muted); font-size: .72rem; }
.qo-lprice.manual { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); }
.qo-ptag { padding: 0 .35rem; border-radius: 6px; background: var(--accent); color: #fff; font-size: .66rem; font-weight: 800; }
.qo-pedit { color: var(--accent-text); font-size: .8rem; }
.qo-pform { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .3rem; }
.qo-pform input { width: 6.5rem; height: 2.3rem; padding: 0 .5rem; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1.05rem; font-weight: 800; text-align: center; }
.qo-pform input:focus { outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.qo-pform .btn-sm { padding: .3rem .6rem; }
.qo-pform.busy { opacity: .6; pointer-events: none; }
.qo-pnote { flex-basis: 100%; color: var(--muted); font-size: .7rem; }

/* سعر البيع مع الكمية في نافذة الموديل (0.77) */
.qo-mprice { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .15rem .6rem; margin: .7rem 0 .2rem; padding: .45rem .6rem; border: 1.5px dashed var(--line-2); border-radius: 12px; }
.qo-mprice label { font-weight: 700; font-size: .85rem; margin: 0; }
.qo-mprice input { width: 100%; max-width: 8rem; justify-self: end; height: 2.4rem; padding: 0 .5rem; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1.1rem; font-weight: 800; text-align: center; }
.qo-mprice input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.qo-mprice small { grid-column: 1 / -1; color: var(--muted); font-size: .7rem; }
.qo-mprice.manual { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); }
.qo-reopened { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; padding: .55rem .8rem; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: .85rem; font-weight: 600; }
.qo-reopened .ic { width: 20px; height: 20px; flex: none; }

/* 0.79: إيقاف الموديل من العرض من القائمة */
.p-toggle { display: block; margin-top: .2rem; }
.p-toggle .btn { font-size: .78rem; text-decoration: none; display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }
.p-toggle .ic { width: 1rem; height: 1rem; }

/* 0.81: زر إغلاق رسالة إرسال الطلب */
.qo-done { cursor: pointer; }
.qo-done-card { position: relative; cursor: auto; }
.qo-done-x { position: absolute; top: .5rem; inset-inline-end: .5rem; }

/* 0.82: لون لكل حالة طلب (بطاقات الطلبات وعرض الطلب للمندوب) */
.o-st { --st: #8a94a3; }
.o-st-pending_approval { --st: #e0244a; }
.o-st-approved { --st: #1d5fe0; }
.o-st-preparing { --st: #e88400; }
.o-st-ready { --st: #0d9488; }
.o-st-dispatched { --st: #6a3fe0; }
.o-st-completed { --st: #13924a; }
.o-st-on_hold { --st: #b45309; }
.o-st-rejected, .o-st-canceled { --st: #a0a7b1; }
table tr.o-st > td:first-child { box-shadow: inset -4px 0 0 var(--st); }
tr.o-st .o-status .pill:first-child, .rh-list li.o-st .pill { background: color-mix(in srgb, var(--st) 14%, var(--surface)); color: color-mix(in srgb, var(--st) 80%, var(--ink)); border-color: transparent; }
.o-act { white-space: nowrap; }
.o-pick { display: inline-flex; align-items: center; gap: .3rem; }
.o-pick .ic { width: 16px; height: 16px; }

/* طلبات عميل واحد */
.oc-cust { display: flex; align-items: center; gap: .75rem; }
.oc-cust-av, .c-av span { display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 14px; font-weight: 800; font-size: 1.1rem;
  color: var(--accent-text); background: var(--accent-soft); }
.oc-cust-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.oc-cust-body small { color: var(--muted); }

/* قائمة العملاء */
.m-customers .c-av, .m-customers .c-m { display: none; }
.c-k { color: var(--muted); }
.c-last { white-space: nowrap; }
.c-open { display: inline-block; padding: 0 .45rem; border-radius: 999px; font-weight: 700; color: #1d5fe0; background: color-mix(in srgb, #1d5fe0 12%, var(--surface)); text-decoration: none; }
.c-order { display: none; }

/* ملف العميل */
.cp-owner { display: flex; align-items: center; gap: .3rem; margin-top: .15rem; }
.cp-owner .ic { width: 15px; height: 15px; }
.cp-orders-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cp-orders-h .cu-h { margin-bottom: .6rem; }
.rh-list li.o-st { box-shadow: inset -4px 0 0 var(--st); }

/* عرض الطلب للمندوب */
.ro { max-width: 640px; margin-inline: auto; }
.ro-head { position: relative; padding: 1rem 1.1rem; border-radius: 20px; background: color-mix(in srgb, var(--st) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--st) 28%, var(--surface)); border-inline-start: 6px solid var(--st); }
.ro-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ro-no { font-weight: 700; color: var(--ink-2, var(--ink)); }
.ro-pill { padding: .2rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 800; color: #fff; background: var(--st); }
.ro-total { display: block; font-size: 2rem; font-weight: 800; line-height: 1.2; margin-top: .35rem; }
.ro-sub { font-size: .82rem; color: var(--muted); }
.ro-next { margin: .55rem 0 0; font-size: .88rem; font-weight: 600; color: color-mix(in srgb, var(--st) 75%, var(--ink)); }
.ro-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin: .8rem 0 0; padding-top: .7rem; border-top: 1px dashed color-mix(in srgb, var(--st) 30%, var(--surface)); }
.ro-who dt { font-size: .72rem; font-weight: 500; color: var(--muted); }
.ro-who dd { margin: 0; font-weight: 700; }
.ro-why { margin-top: .7rem; padding: .65rem .85rem; border-radius: 14px; font-size: .86rem; background: var(--danger-soft); color: var(--danger); }
.ro-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.ro-actions form { display: contents; }
.ro-actions .btn { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 46px; border-radius: 14px; font-weight: 700; }
.ro-actions .btn .ic { width: 18px; height: 18px; }
.ro-list { list-style: none; margin: 0; padding: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.ro-item + .ro-item { border-top: 1px solid var(--line); }
.ro-item summary { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; cursor: pointer; list-style: none; }
.ro-item summary::-webkit-details-marker { display: none; }
.ro-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ro-item-body strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ro-item-body small { color: var(--muted); }
.ro-item-total { font-size: 1rem; white-space: nowrap; }
.ro-item summary::after { content: '‹'; flex: none; font-size: 1.3rem; line-height: 1; color: var(--muted); transition: transform .2s; }
.ro-item details[open] summary::after { transform: rotate(-90deg); }
.ro-item details[open] summary { background: var(--hover); }
.ro-colors { list-style: none; margin: 0; padding: .3rem .85rem .7rem; }
.ro-colors li { display: flex; align-items: baseline; gap: .45rem; padding: .3rem 0; font-size: .86rem; }
.ro-cname { font-weight: 700; min-width: 4.5rem; }
.ro-sizes { display: flex; flex-wrap: wrap; gap: .25rem .4rem; }
.ro-sizes span { padding: .05rem .45rem; border-radius: 8px; background: var(--surface-2, var(--ground)); }
.ro-note { margin: 0 .85rem .7rem; font-size: .8rem; color: var(--muted); }
.ro-empty { padding: 1rem; text-align: center; color: var(--muted); }
.ro-notes { margin-top: .8rem; font-size: .88rem; }
.m-customers .c-rep .c-k { display: none; }
.ro-noedit { margin: .7rem 0 0; padding: .6rem .85rem; border-radius: 14px; font-size: .84rem; background: var(--surface-2, var(--ground)); color: var(--muted); }
.qo-reopened b.ltr { white-space: nowrap; }
.ro-actions .ltr { white-space: nowrap; }

/* ملخص الموديل: متاح + طلبات مفتوحة + مباع (0.84) */
.ps-flow { margin-bottom: 1rem; }
.ps-flow-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.ps-flow-tiles > div { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .45rem .6rem; display: flex; flex-direction: column; gap: .1rem; }
.ps-flow-tiles span { font-size: .8rem; color: var(--bs-secondary-color); }
.ps-flow-tiles b { font-size: 1.35rem; line-height: 1.2; }
.ps-flow-tiles .ps-flow-total { border-color: var(--bs-primary); background: color-mix(in srgb, var(--bs-primary) 7%, var(--bs-body-bg)); }
.ps-flow-tiles .ps-flow-total b { color: var(--bs-primary); }
.ps-flow-note { margin: .4rem 0 0; }
.ps-grid-h { font-size: .95rem; font-weight: 700; margin: 0 0 .5rem; }
@media (max-width: 575.98px) { .ps-flow-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* طلبات الموديل في نافذة الكميات (0.85) */
.ps-orders { display: grid; gap: .5rem; margin-bottom: 1rem; }
.ps-od { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .45rem .7rem; }
.ps-od > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.ps-od[open] > summary { margin-bottom: .5rem; }
.ps-od-n { background: var(--bs-secondary-bg); border-radius: 999px; padding: 0 .55rem; font-size: .85rem; }
.ps-ord { margin: 0; }
.ps-ord th, .ps-ord td { white-space: nowrap; vertical-align: middle; }
.ps-ord .ps-sum { text-align: end; font-weight: 700; }
.ps-ord-st { color: var(--st); font-weight: 600; }
.ps-ord tfoot { border-top: 2px solid var(--bs-border-color); }
.ps-od .table-wrap { max-height: 22rem; overflow: auto; }

/* مسح عميل تجربة (0.86) */
.cu-purge { margin-top: 1rem; padding: .75rem; border: 1px solid color-mix(in srgb, var(--bs-danger) 40%, transparent); border-radius: .5rem; background: color-mix(in srgb, var(--bs-danger) 5%, var(--bs-body-bg)); }
.cu-purge h3 { font-size: .95rem; font-weight: 700; margin: 0 0 .35rem; color: var(--bs-danger-text-emphasis); }
.cu-purge-list { margin: 0 0 .6rem; padding-inline-start: 1.1rem; }
.cu-purge-row { display: flex; gap: .5rem; }
.cu-purge-row input { max-width: 12rem; }
.cu-purge-row .btn { white-space: nowrap; }

/* المصاريف (0.87) */
.ex-grid { display: grid; gap: .6rem .75rem; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; }
.ex-f { grid-column: span 12; min-width: 0; }
@media (min-width: 768px) {
  .ex-type { grid-column: span 3; } .ex-amt { grid-column: span 2; } .ex-src { grid-column: span 3; } .ex-date { grid-column: span 2; }
  .ex-notes { grid-column: span 6; } .ex-center { grid-column: span 2; } .ex-file { grid-column: span 3; } .ex-go { grid-column: span 2; }
  .ex-go:only-child, .ex-grid:not(:has(.ex-center)) .ex-file { grid-column: span 4; }
}
.ex-amt input { font-size: 1.15rem; font-weight: 700; }
.ex-bytype { list-style: none; margin: 0; display: grid; gap: .45rem; }
.ex-bytype li { display: grid; grid-template-columns: minmax(6rem, 12rem) 1fr auto; gap: .75rem; align-items: center; }
.ex-bar { width: 100%; height: .55rem; accent-color: var(--accent); }
.ex-table tr.ex-off td { opacity: .55; }
.ex-act { text-align: end; }
.ex-act > form, .ex-act > details { display: inline-flex; vertical-align: top; margin: .1rem 0 .1rem .35rem; }
.ex-cancel > summary { list-style: none; }
.ex-cancel > summary::-webkit-details-marker { display: none; }
.ex-cancel { flex-direction: column; }
.ex-cancel[open] form { display: flex; gap: .35rem; margin-top: .35rem; min-width: 14rem; }
.ex-reps { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.ex-rep { display: flex; gap: .6rem; align-items: center; padding: .55rem .75rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; cursor: pointer; }
.ex-rep:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ex-rep span { display: flex; flex-direction: column; } .ex-rep small { color: var(--bs-secondary-color); }
.ho-exp td:first-child { white-space: nowrap; }
#cost_per_piece[readonly], [data-pq-cost][readonly], [data-pp-cost][readonly], [data-ps-f="cost"][readonly], [data-ps-nf="cost"][readonly] { background: var(--bs-tertiary-bg); cursor: not-allowed; }
@media (max-width: 575.98px) { .ex-bytype li { grid-template-columns: 1fr auto; } .ex-bytype .ex-bar { grid-column: 1 / -1; grid-row: 2; } }
.ex-approve { display: flex; gap: .35rem; align-items: center; }
.ex-approve select { min-width: 11rem; max-width: 16rem; }
@media (max-width: 767.98px) { .ex-act { text-align: start; } .ex-act > form.ex-approve { display: flex; width: 100%; } .ex-approve select { flex: 1; max-width: none; } }
/* نموذج مصروف المندوب (0.89) */
.ex-repform .panel-head h2 { display: flex; align-items: center; gap: .4rem; }
.ex-repform .panel-head .ic { width: 1.4rem; height: 1.4rem; color: var(--accent); }
.ex-chips { display: flex; flex-wrap: wrap; gap: .45rem; border: 0; padding: 0; margin: 0 0 1rem; }
.ex-chips legend { width: 100%; float: none; font-size: inherit; margin-bottom: .45rem; }
.ex-chip { position: relative; cursor: pointer; }
.ex-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ex-chip span { display: inline-block; padding: .55rem .95rem; border: 1.5px solid var(--bs-border-color); border-radius: 999px; font-weight: 600; background: var(--bs-body-bg); transition: background .15s, border-color .15s; }
.ex-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.ex-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-bigamt { display: flex; align-items: center; gap: .5rem; }
.ex-bigamt input { font-size: 1.9rem; font-weight: 800; padding: .45rem .8rem; text-align: center; }
.ex-bigamt b { font-size: 1.5rem; color: var(--bs-secondary-color); }
.ex-row2 { display: grid; grid-template-columns: 1fr; gap: 0 .75rem; }
@media (min-width: 576px) { .ex-row2 { grid-template-columns: 1fr 1fr; } }
.ex-mine-h { font-size: 1.1rem; font-weight: 700; margin: .25rem 0 .6rem; }
.ex-filter > summary { cursor: pointer; font-size: .9rem; color: var(--bs-secondary-color); }
/* صفحة صلاحيات المستخدم (0.89) */
.pu-legend { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; }
.pu-list { display: grid; gap: .5rem; }
.pu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem 1rem; align-items: center; padding: .55rem .75rem; border: 1px solid var(--bs-border-color); border-radius: .65rem; }
.pu-row.is-direct, .pu-table tr.is-direct > td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pu-name { display: flex; flex-direction: column; min-width: 0; }
.pu-name small { color: var(--bs-secondary-color); font-size: .75rem; text-align: start; }
.pu-seg { display: inline-flex; border: 1px solid var(--bs-border-color); border-radius: .55rem; overflow: hidden; }
.pu-seg label { position: relative; margin: 0; cursor: pointer; }
.pu-seg label + label { border-inline-start: 1px solid var(--bs-border-color); }
.pu-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pu-seg span { display: block; padding: .4rem .8rem; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.pu-seg small { font-weight: 400; color: var(--bs-secondary-color); }
.pu-seg input:checked + span { background: var(--bs-secondary-bg); }
.pu-seg .is-allow input:checked + span { background: var(--success, #198754); color: #fff; }
.pu-seg .is-deny input:checked + span { background: var(--danger, #dc3545); color: #fff; }
.pu-seg input:checked + span small { color: inherit; }
.pu-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.pu-res { white-space: nowrap; font-size: .85rem; }
.pu-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.pu-tools input[type=search] { flex: 1 1 16rem; }
.pu-filter { display: flex; flex-wrap: wrap; gap: .35rem; }
.pu-table td:first-child label { font-weight: 600; margin: 0; }
@media (max-width: 767.98px) {
  .pu-row { grid-template-columns: 1fr auto; }
  .pu-seg { grid-column: 1 / -1; grid-row: 2; width: 100%; } .pu-seg label { flex: 1; text-align: center; }
  .pu-res { grid-column: 2; grid-row: 1; }
}
/* سعر التكلفة في كتالوج المندوب (0.90) */
.rc-cost-mini { display: block; font-size: .72rem; color: var(--bs-secondary-color); }
.rc-cost { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin: .5rem 0 .75rem; padding: .6rem .75rem; border-radius: .75rem; background: var(--bs-tertiary-bg); }
.rc-cost-l { font-weight: 600; }
.rc-cost-f { display: flex; gap: .4rem; flex: 1 1 12rem; }
.rc-cost-f input { max-width: 9rem; font-weight: 700; }
.rc-cost-msg { width: 100%; } .rc-cost-msg.ok { color: var(--success, #198754); } .rc-cost-msg.bad { color: var(--danger, #dc3545); }
/* تكلفة التوصيل في الطلب السريع (0.91) */
.qo-fee-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.qo-fee-amt { display: flex; align-items: center; gap: .35rem; flex: 0 1 9rem; }
.qo-fee-amt input { font-weight: 700; font-size: 1.1rem; }
.qo-fee-payer { flex: 1 1 12rem; margin: 0; }
.share-msg.ok { color: var(--success, #198754); } .share-msg.bad { color: var(--danger, #dc3545); }
/* التحويل والصرافة (0.93) */
.ct-exch { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.ct-exch-card { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; border-radius: .8rem; border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); color: inherit; text-decoration: none; }
.ct-exch-card:hover { border-color: var(--accent); }
.ct-exch-name { font-weight: 600; }
.ct-exch-card b { font-size: 1.35rem; }
.ct-exch-card small { color: var(--bs-secondary-color); }
.ct-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: start; }
.ct-swap { margin-top: 1.75rem; }
.ct-amounts { display: grid; gap: .6rem .75rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-top: .75rem; align-items: start; }
.ct-big { font-size: 1.2rem; font-weight: 700; }
.ct-table tr.ct-off td { opacity: .55; }
@media (max-width: 575.98px) { .ct-route { grid-template-columns: 1fr; } .ct-swap { margin: 0; justify-self: center; } }
.ct-table { min-width: 46rem; } .ct-table td:first-child .ltr { white-space: nowrap; }

/* لوحات الإدارة في الرئيسية (0.94) */
.dash-count { display: inline-block; min-width: 1.7rem; padding: .05rem .5rem; margin-inline-start: .35rem; border-radius: 999px; background: var(--line); color: var(--muted); font-size: .85rem; text-align: center; font-variant-numeric: tabular-nums; }
.dash-count.on { background: var(--accent); color: #fff; }
.dash-extra { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .75rem 1.15rem; border-top: 1px solid var(--line); }
.dash-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border: 1px solid var(--warn-line); background: var(--warn-soft); color: var(--warn); border-radius: 999px; font-size: .85rem; text-decoration: none; }
.dash-chip:hover { border-color: var(--warn); }
.dash-sales-all { display: grid; gap: .2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.dash-sales-all b { font-size: 2.1rem; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.dash-sales-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-top: 1rem; }
.dash-sales-split > div { display: grid; gap: .1rem; }
.dash-sales-split b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
