@font-face { font-family: "Saudi Riyal"; src: url(/fonts/SaudiRiyal-Regular.woff2) format("woff2"); font-weight: 400; unicode-range: U+20C0-20C1, U+E001-E002, U+E900; }
@font-face { font-family: "Saudi Riyal"; src: url(/fonts/SaudiRiyal-Bold.woff2) format("woff2"); font-weight: 700; unicode-range: U+20C0-20C1, U+E001-E002, U+E900; }

:root {
  --brand: #B289F0; --on-brand: #1C1B22; --brand-deep: #7741C8;
  --brand-tint: #F0E7FD; --brand-tint-ink: #7741C8; --signal: #F0A531;
  --surface: #F5F5F8; --raised: #FFFFFF; --separator: #DCDBE3;
  --ink: #1C1B22; --muted: #55535F; --success: #1B7A4E; --danger: #C6303F;
  --r-control: 12px; --r-card: 18px;
  --font: "Saudi Riyal", "Graphik Arabic", "Graphik", "IBM Plex Sans Arabic", -apple-system, system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) {
    --on-brand: #14121A; --brand-deep: #C9ADF7; --brand-tint: #34224F; --brand-tint-ink: #E2D3FB;
    --surface: #0F0F14; --raised: #1C1B24; --separator: #2C2B36;
    --ink: #F2F1F6; --muted: #A6A4B3; --success: #4CC28D; --danger: #F27B88;
  } }
:root[data-theme=dark] {
    --on-brand: #14121A; --brand-deep: #C9ADF7; --brand-tint: #34224F; --brand-tint-ink: #E2D3FB;
    --surface: #0F0F14; --raised: #1C1B24; --separator: #2C2B36;
    --ink: #F2F1F6; --muted: #A6A4B3; --success: #4CC28D; --danger: #F27B88;
  }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 17px; line-height: 22px; background: var(--surface); color: var(--ink); -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h2 { font-size: 22px; line-height: 28px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 20px 0 10px; color: var(--muted); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.caption { font-size: 12px; line-height: 16px; color: var(--muted); margin: 4px 0; }
.err { color: var(--danger); min-height: 22px; margin: 4px 0; font-size: 15px; }

/* الشعار: أربعة أعمدة عدّ يقطعها خط زعفراني */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 34px; }
.logo.sm { font-size: 22px; gap: 8px; }
.mark { position: relative; width: 44px; height: 44px; border-radius: 12px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none; }
.logo.sm .mark { width: 32px; height: 32px; border-radius: 9px; gap: 3px; }
.mark i { width: 4px; height: 55%; background: var(--on-brand); border-radius: 999px; }
.logo.sm .mark i { width: 3px; }
.mark b { position: absolute; width: 70%; height: 4px; background: var(--signal); border-radius: 999px; transform: rotate(-28deg); }
.logo.sm .mark b { height: 3px; }

/* الأزرار والحقول */
.btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-control); cursor: pointer; font-weight: 600; background: var(--surface); }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.danger { background: none; color: var(--danger); border: 1px solid var(--danger); }
.btn.big { min-height: 56px; width: 100%; }
.btn.full { width: 100%; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; color: var(--brand-deep); cursor: pointer; padding: 10px; min-height: 44px; }
.link.danger { color: var(--danger); }
input:not([type=checkbox]):not([type=radio]), select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--separator); border-radius: var(--r-control); background: var(--raised); }
input:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 2px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand-deep); }
label.field { display: block; font-size: 15px; color: var(--muted); }
label.field > input, label.field > select { margin-top: 6px; color: var(--ink); }
.form { display: grid; gap: 12px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.badge { font-size: 12px; line-height: 16px; padding: 4px 10px; border-radius: 999px; background: var(--brand-tint); color: var(--brand-tint-ink); font-weight: 600; white-space: nowrap; }
.badge.warn { background: var(--signal); color: #1C1B22; }
.badge.bad { background: var(--danger); color: #fff; }
.badge.ok { background: var(--success); color: #fff; }

/* الدخول */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--raised); border-radius: var(--r-card); padding: 32px 24px; }
.auth .logo { justify-content: center; }
.tagline { text-align: center; color: var(--muted); margin: 8px 0 24px; }
.auth label { display: block; font-size: 15px; color: var(--muted); margin-bottom: 14px; }
.auth label input { margin-top: 6px; color: var(--ink); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-radius: var(--r-control); padding: 4px; margin-bottom: 16px; }
.seg button { border: 0; background: none; min-height: 40px; border-radius: 9px; cursor: pointer; color: var(--muted); padding: 0 8px; }
.seg button.on { background: var(--raised); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.view .seg { background: var(--separator); }

/* الرأس والتبويبات */
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--raised); border-bottom: 1px solid var(--separator); }
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; min-width: 0; }
.tabs { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; background: var(--raised); border-bottom: 1px solid var(--separator); scrollbar-width: none; }
.tabs button { flex: none; border: 0; background: none; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--brand-tint); color: var(--brand-tint-ink); font-weight: 600; }
.banner { background: var(--signal); color: #1C1B22; padding: 10px 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.banner.bad { background: var(--danger); color: #fff; }
.view { padding: 16px; max-width: 1280px; margin: 0 auto; }
.narrow { max-width: 680px; margin: 0 auto; }

/* الكاشير */
.cashier { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--separator); background: var(--raised); min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip-n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on .chip-n { color: inherit; opacity: .7; }
/* شريط التصنيفات يثبت فوق وأنت تنزل في القائمة */
.menu-nav { position: sticky; top: 0; z-index: 2; background: var(--surface); padding-top: 4px; margin-top: -4px; }
.menu-sec { scroll-margin-top: 64px; margin-bottom: 24px; }
.sec-hd { font-size: 20px; line-height: 26px; margin: 4px 0 12px; display: flex; align-items: center; gap: 10px; }
.sec-hd::after { content: ""; flex: 1; height: 1px; background: var(--separator); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.tile { position: relative; min-height: 148px; border-radius: 22px; background: var(--raised); display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px var(--separator); }
.tile-main { flex: 1; border: 0; background: none; padding: 16px 16px 8px; padding-inline-end: 48px; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: inherit; border-radius: 22px 22px 0 0; }
.tile .n { font-weight: 700; font-size: 18px; line-height: 24px; }
.tile .en { font-size: 14px; line-height: 18px; color: var(--muted); text-align: right; }
.tile .left { font-size: 12px; color: var(--danger); font-weight: 600; }
.tile-x { position: absolute; top: 6px; inset-inline-end: 6px; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; font-size: 0; }
.tile-x::before { content: "×"; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--brand-deep); color: var(--brand-deep); font-size: 20px; line-height: 26px; text-align: center; background: var(--raised); }
.tile-foot { display: flex; align-items: center; gap: 6px; padding: 0 10px 12px 12px; min-height: 60px; }
.foot-add { flex: 1; align-self: stretch; border: 0; background: none; cursor: pointer; }
.price { margin-inline-start: auto; display: flex; flex-direction: column; align-items: center; line-height: 1.1; flex: none; }
.price b { font-size: 18px; }
.price small { font-size: 14px; color: var(--muted); }
.pill { flex: 1 1 auto; min-width: 0; max-width: 140px; display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 4px; border-radius: 999px; background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--brand-deep); }
.pill .num { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; }
.circ { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--brand-deep); background: none; color: var(--brand-deep); font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.circ { position: relative; }
.circ::after { content: ""; position: absolute; inset: -4px; }  /* منطقة لمس 46 نقطة */
.circ:active { background: var(--brand-tint); }
.tile-main:active, .foot-add:active { background: rgb(0 0 0 / .04); }
.tile:has(.tile-main:active) { transform: scale(.985); }
@media (prefers-reduced-motion: no-preference) { .tile { transition: transform .08s; } }
.circ:disabled { opacity: .3; }
.tile.sel { background: var(--brand-tint); box-shadow: inset 0 0 0 2px var(--brand-deep); }
.tile.out { opacity: .45; }
.tile.out button { cursor: default; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; grid-column: 1 / -1; }
.bill { position: sticky; top: 16px; background: var(--raised); border-radius: var(--r-card); padding: 16px; }
.bill-hd { all: unset; display: flex; align-items: baseline; gap: 10px; width: 100%; cursor: default; }
.bill-hd .muted { flex: 1; }
.bill-toggle { display: none; color: var(--brand-deep); font-size: 15px; }
.cart { list-style: none; margin: 8px 0 0; padding: 0; max-height: 38vh; overflow: auto; }
.cart li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--separator); }
.cart .nm { flex: 1; min-width: 0; font-weight: 600; }
.cart .opts { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.cart .qty-n { min-width: 24px; text-align: center; font-weight: 700; }
.step { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--separator); background: none; cursor: pointer; flex: none; font-size: 20px; color: var(--ink); }
.step:disabled { opacity: .3; }
.cust { display: flex; gap: 8px; margin-top: 12px; }
.cust input { min-height: 44px; }
.cust-info { font-size: 15px; margin-top: 6px; }
.line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.total { margin-top: 12px; }
.total strong { font-size: 34px; line-height: 41px; font-variant-numeric: tabular-nums; }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pay .btn { min-height: 60px; font-size: 19px; }
.check.opt { padding: 0 16px; border-bottom: 1px solid var(--separator); min-height: 52px; }

/* نوافذ الدفع */
.pay-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.pay-total strong { font-size: 34px; line-height: 41px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.quick .btn { min-height: 52px; font-variant-numeric: tabular-nums; }
.big-input { font-size: 22px !important; min-height: 56px !important; text-align: center; }
.change-row { margin: 16px 0; font-size: 17px; }
.change-row strong { font-size: 28px; line-height: 34px; color: var(--success); }
.change-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--brand-tint); color: var(--brand-tint-ink); border-radius: var(--r-card); padding: 14px; margin: 8px 0 16px; }
.change-hero strong { font-size: 34px; line-height: 41px; color: var(--ink); }

/* البطاقات والقوائم */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.col h3 { margin-top: 0; }
.card { background: var(--raised); border-radius: var(--r-card); padding: 14px; margin-bottom: 10px; }
.card .hd { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 6px; }
.card .meta { font-size: 13px; color: var(--muted); }
.card ul { margin: 6px 0 10px; padding-inline-start: 18px; }
.card .acts { display: flex; gap: 8px; }
.card .acts .btn { flex: 1; }
.list { list-style: none; margin: 0; padding: 0; background: var(--raised); border-radius: var(--r-card); overflow: hidden; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--separator); min-height: 56px; }
.list li:last-child { border-bottom: 0; }
.list li.tap { cursor: pointer; }
.list li.tap:active { background: var(--surface); }
.list .grow { flex: 1; min-width: 0; }
.list .sub { font-size: 13px; color: var(--muted); }
.off { opacity: .5; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

/* التقارير */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--raised); border-radius: var(--r-card); padding: 16px; }
.stat span { display: block; font-size: 15px; color: var(--muted); }
.stat strong { font-size: 24px; line-height: 32px; font-variant-numeric: tabular-nums; }
.stat.hero { grid-column: 1 / -1; }
.stat.hero strong { font-size: 34px; line-height: 41px; }
.stat.good strong { color: var(--success); }
.stat.loss strong { color: var(--danger); }
.bars { background: var(--raised); border-radius: var(--r-card); padding: 16px; display: flex; align-items: flex-end; gap: 4px; height: 160px; }
.bars div { flex: 1; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.bars-x { display: flex; gap: 4px; padding: 4px 16px 0; font-size: 11px; color: var(--muted); }
.bars-x span { flex: 1; text-align: center; }

/* النافذة المنبثقة */
.sheet { border: 0; padding: 0; border-radius: var(--r-card); background: var(--raised); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: 88dvh; }
.sheet::backdrop { background: rgb(0 0 0 / .4); }
.sheet .sh-hd { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 0 8px; position: sticky; top: 0; background: var(--raised); }
.sheet .sh-hd h2 { margin: 0; padding-inline-start: 8px; }
.sheet .sh-bd { padding: 16px; }
.opt-row, .rec-row { display: grid; grid-template-columns: 1fr 110px 44px; gap: 8px; margin-bottom: 8px; }

/* الإيصال */
.receipt { max-width: 320px; margin: 0 auto; font-size: 15px; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed var(--separator); margin: 10px 0; }
.receipt .qr { display: block; width: 150px; height: 150px; margin: 12px auto; background: #fff; padding: 6px; border-radius: 8px; }
.print-area { display: none; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 160px); background: var(--ink); color: var(--surface); padding: 6px 8px 6px 20px; padding-inline-start: 20px; min-height: 48px; border-radius: 999px; transition: transform .25s; z-index: 10; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; }
.toast > span { padding: 6px 0; }
.toast-act { border: 0; background: var(--brand); color: var(--on-brand); font-weight: 700; min-height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .cashier { grid-template-columns: 1fr; padding-bottom: 8px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .pill .circ { width: 36px; height: 36px; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .bill { position: sticky; bottom: 0; top: auto; border-radius: var(--r-card) var(--r-card) 0 0; margin: 0 -16px -16px; box-shadow: 0 -4px 20px rgb(0 0 0 / .1); }
  .cart { max-height: 36vh; }
  /* على الجوال الفاتورة شريط صغير تحت، وتنفتح بالضغط عشان ما تغطي الأصناف */
  .bill-hd { cursor: pointer; min-height: 32px; }
  .bill-toggle { display: inline; }
  .bill:not(.open) .cart, .bill:not(.open) .cust, .bill:not(.open) .cust-info, .bill:not(.open) .caption { display: none; }
  .bill:not(.open) .total { margin-top: 4px; }
  .bill:not(.open) .total strong { font-size: 28px; line-height: 34px; }
  .menu { padding-bottom: 40px; }
  .board { grid-template-columns: 1fr; }
  #planBadge { display: none; }
}

@media print {
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block !important; color: #000; }
  .print-area .receipt { max-width: 72mm; font-size: 12px; }
  @page { margin: 4mm; }
}

/* إصلاحات */
.btn:not(.primary):not(.danger) { background: var(--raised); border: 1px solid var(--separator); }
.toolbar input { width: auto; flex: 1 1 140px; }
.toolbar .btn { flex: none; }

/* ===== تحسين الشكل: أهدأ وأنظف، اللون للمختار والإجراء بس ===== */
.cashier { gap: 24px; }
.menu-nav { padding-bottom: 14px; }
.chip { border: 0; background: var(--raised); box-shadow: 0 1px 2px rgb(28 27 34 / .06), inset 0 0 0 1px rgb(28 27 34 / .06); font-weight: 600; }
.chip.on { background: var(--ink); color: var(--surface); box-shadow: none; }
.sec-hd { font-size: 22px; line-height: 28px; margin: 8px 0 14px; }
.sec-hd::after { display: none; }
.grid { gap: 14px; }

/* المربع: بدون إطار، ظل خفيف يرفعه عن الخلفية */
.tile { border-radius: 24px; box-shadow: 0 1px 2px rgb(28 27 34 / .06), 0 4px 14px rgb(28 27 34 / .05); transition: background-color .15s, box-shadow .15s; }
.tile-main { padding: 18px 18px 6px; padding-inline-end: 52px; border-radius: 24px 24px 0 0; }
.tile .n { font-size: 18px; }
.tile .en { font-size: 13px; letter-spacing: .1px; }
.tile-foot { padding: 0 12px 12px 16px; min-height: 64px; }

/* المختار: خلفية خزامى فاتحة بدون خط سميك */
.tile.sel { background: var(--brand-tint); box-shadow: 0 0 0 2px var(--brand) inset, 0 4px 14px rgb(119 65 200 / .12); }

/* شريط العدد: كبسولة خزامى مليانة، والدوائر بيضاء */
.pill { height: 48px; padding: 4px; max-width: 136px; background: var(--brand); box-shadow: none; }
.pill .num { color: var(--on-brand); font-size: 19px; }
.circ { width: 40px; height: 40px; border: 0; background: var(--raised); color: var(--ink); font-size: 22px; font-weight: 600; box-shadow: 0 1px 2px rgb(28 27 34 / .12); }
.circ:active { background: var(--surface); }

/* × رمادي هادئ، مو بنفس لون الإجراء */
.tile-x::before { width: 28px; height: 28px; line-height: 27px; font-size: 18px; border: 0; background: rgb(28 27 34 / .08); color: var(--muted); }
.tile-x:active::before { background: rgb(28 27 34 / .16); }

.price b { font-size: 19px; }
.price small { font-size: 13px; }

/* الفاتورة */
.bill { border-radius: 24px; padding: 20px; box-shadow: 0 1px 2px rgb(28 27 34 / .06), 0 8px 24px rgb(28 27 34 / .06); }
.cart li { padding: 12px 0; }
.cart .step { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); font-size: 18px; }
.pay .btn { border-radius: 16px; }

@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .tile, :where(:root:not([data-theme=light])) .chip, :where(:root:not([data-theme=light])) .bill { box-shadow: inset 0 0 0 1px var(--separator); } :where(:root:not([data-theme=light])) .tile.sel { box-shadow: inset 0 0 0 2px var(--brand); } :where(:root:not([data-theme=light])) .tile-x::before { background: rgb(255 255 255 / .1); } :where(:root:not([data-theme=light])) .circ { background: var(--raised); color: var(--ink); } }
:where(:root[data-theme=dark]) .tile, :where(:root[data-theme=dark]) .chip, :where(:root[data-theme=dark]) .bill { box-shadow: inset 0 0 0 1px var(--separator); } :where(:root[data-theme=dark]) .tile.sel { box-shadow: inset 0 0 0 2px var(--brand); } :where(:root[data-theme=dark]) .tile-x::before { background: rgb(255 255 255 / .1); } :where(:root[data-theme=dark]) .circ { background: var(--raised); color: var(--ink); }

/* تعديل من الفاتورة + العدد في نافذة الخيارات */
.cart button.nm { all: unset; flex: 1; min-width: 0; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 2px 0; }
.cart button.nm:focus-visible { outline: 3px solid var(--brand-deep); outline-offset: 2px; }
.cart button.nm:active { opacity: .6; }
.edit-hint { color: var(--brand-deep); font-weight: 500; }
.sheet-qty { display: flex; align-items: center; justify-content: space-between; margin: 16px 0; font-weight: 600; }
.sheet-qty .pill { flex: none; width: 150px; max-width: none; }

/* ===== توازن الدوائر: + و − و × نفس الدائرة ونفس الأيقونة ونفس البعد عن الحواف (16) ===== */
.ic { position: relative; width: 16px; height: 16px; display: block; }
.ic::before, .ic::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2.5px; margin-top: -1.25px; border-radius: 2px; background: currentColor; }
.ic.minus::after { display: none; }
.ic.plus::after { transform: rotate(90deg); }
.ic.x { transform: rotate(45deg); }
.ic.x::after { transform: rotate(90deg); }

.circ { width: 40px; height: 40px; font-size: 0; color: var(--ink); background: var(--raised); border: 0; box-shadow: 0 1px 3px rgb(28 27 34 / .14); }
.tile-x { position: absolute; top: 16px; inset-inline-end: 16px; left: auto; }
[dir=rtl] .tile-x { right: auto; left: 16px; }
.tile-x::before { content: none; }
.tile-x .ic { width: 14px; height: 14px; }
.tile-x { color: var(--muted); }
.tile-main { padding-top: 18px; padding-inline-end: 68px; }
.tile-foot { padding: 0 12px 12px 16px; }
.price { align-self: center; width: 40px; }
.cart .step { font-size: 0; display: grid; place-items: center; color: var(--ink); }
.cart .step .ic { width: 14px; height: 14px; }

/* ===== أسلوب نظيف (مثل تطبيقات Apple ونينجا): كبسولات ناعمة بدون إطارات، والمختار كبسولة مرفوعة داخل مسار ===== */
:root { --track: rgb(28 27 34 / .06); --lift: 0 1px 2px rgb(28 27 34 / .08), 0 2px 8px rgb(28 27 34 / .08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --track: rgb(255 255 255 / .08); --lift: 0 1px 2px rgb(0 0 0 / .4); } }
:root[data-theme=dark] { --track: rgb(255 255 255 / .08); --lift: 0 1px 2px rgb(0 0 0 / .4); }

/* المسار: التبويبات والتصنيفات */
.tabs { background: var(--surface); border: 0; padding: 10px 16px 6px; }
.track { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--track); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.track > button { flex: none; border: 0; background: none; min-height: 36px; padding: 0 14px; border-radius: 999px; color: var(--ink); opacity: .75; font-weight: 500; cursor: pointer; box-shadow: none; display: inline-flex; align-items: center; gap: 6px; }
.track > button.on { opacity: 1; background: var(--raised); color: var(--brand-deep); font-weight: 600; box-shadow: var(--lift); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .track > button.on { background: rgb(255 255 255 / .12); } }
:where(:root[data-theme=dark]) .track > button.on { background: rgb(255 255 255 / .12); }
.menu-nav .track { margin-bottom: 2px; }
.chip.on .chip-n { color: var(--muted); opacity: 1; }

/* المربع: أبيض بدون إطار، المختار ما يتغيّر لونه (الشريط يكفي) */
.tile, .tile.sel { background: var(--raised); box-shadow: var(--lift); min-height: 132px; }
.tile.sel { box-shadow: var(--lift), inset 0 0 0 1.5px rgb(178 137 240 / .55); }

/* شريط العدد: كبسولة بيضاء صغيرة، + دائرة خزامى، − بدون دائرة */
.pill { height: 36px; padding: 3px; max-width: 104px; flex: 0 1 104px; background: var(--raised); box-shadow: var(--lift); gap: 2px; }
.pill .num { color: var(--ink); font-size: 16px; min-width: 20px; }
.circ { width: 30px; height: 30px; box-shadow: none; }
.circ::after { inset: -7px; }   /* منطقة لمس 44 */
.circ .ic { width: 12px; height: 12px; }
.ic::before, .ic::after { height: 2px; margin-top: -1px; }
.circ.fill { background: var(--brand); color: var(--on-brand); }
.circ.plain { background: transparent; color: var(--ink); }
.circ.solo { width: 36px; height: 36px; background: var(--raised); color: var(--ink); box-shadow: var(--lift); }
.circ.solo .ic { width: 13px; height: 13px; }
.tile-foot { min-height: 52px; padding: 0 12px 12px 16px; }
.price { width: 36px; }

/* × بنفس حجم دوائر الشريط، رمادي خفيف */
.tile-x.circ { width: 30px; height: 30px; top: 15px; background: var(--track); color: var(--muted); }
[dir=rtl] .tile-x { left: 15px; }
.tile-x .ic { width: 10px; height: 10px; }
.tile-main { padding-inline-end: 56px; }

/* الفاتورة ونافذة العدد بنفس الكبسولة */
.cart li { gap: 12px; }
.cart .pill { flex: none; }
.sheet-qty .pill { width: 120px; flex: none; height: 40px; }
.sheet-qty .circ { width: 32px; height: 32px; }

/* ===== نفس الأسلوب على كل الشاشات ===== */
body { background: var(--surface); }
.top { background: var(--surface); border: 0; }
.view { padding-top: 12px; }

/* الأزرار كبسولات: الأساسي خزامى مليان، والثانوي أبيض مرفوع */
.btn { border-radius: 999px; padding: 0 20px; }
.btn:not(.primary):not(.danger) { background: var(--raised); border: 0; box-shadow: var(--lift); }
.btn.danger { border: 0; background: rgb(198 48 63 / .1); }
.btn.big { border-radius: 999px; }
.pay .btn { border-radius: 999px; }
details > summary.btn { width: auto; }

/* الحقول: معبّأة رمادي فاتح بدون إطار، مثل حقل البحث في iOS */
input:not([type=checkbox]):not([type=radio]), select { border: 0; background: var(--track); border-radius: 14px; }
input:not([type=checkbox]):not([type=radio]):focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; background: var(--raised); }
.big-input { border-radius: 18px !important; }

/* أي مجموعة اختيارات = مسار + كبسولة مرفوعة */
.seg, .view .seg { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--track); }
.seg button { flex: 1; min-height: 36px; border-radius: 999px; color: var(--ink); opacity: .75; font-weight: 500; }
.seg button.on { opacity: 1; background: var(--raised); color: var(--brand-deep); font-weight: 600; box-shadow: var(--lift); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .seg button.on { background: rgb(255 255 255 / .12); } }
:where(:root[data-theme=dark]) .seg button.on { background: rgb(255 255 255 / .12); }

/* البطاقات والقوائم: بيضاء مرفوعة بدون إطار */
.card, .list, .stat, .bars, .auth-card { border: 0; border-radius: 22px; background: var(--raised); box-shadow: var(--lift); }
.list li { border-bottom: 0; position: relative; }
.list li + li::before { content: ""; position: absolute; top: 0; inset-inline: 16px; height: 1px; background: var(--separator); opacity: .7; }
.board .card .acts .btn { min-height: 40px; }

/* الشارات والكبسولات الصغيرة */
.chip { border: 0; background: var(--track); box-shadow: none; }
.chips .chip { min-height: 36px; }
.chip-x { all: unset; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--track); color: var(--muted); cursor: pointer; margin-inline-start: 4px; }
.chip-x .ic { width: 9px; height: 9px; }
.circ.plain-x { width: 32px; height: 32px; align-self: center; background: var(--track); color: var(--muted); }
.circ.plain-x .ic { width: 11px; height: 11px; }
.opt-row, .rec-row { grid-template-columns: 1fr 110px 32px; align-items: center; }
.check.opt { border-bottom: 0; }

/* النافذة المنبثقة */
.sheet { border-radius: 28px; box-shadow: 0 20px 60px rgb(0 0 0 / .25); }
.sheet::backdrop { background: rgb(0 0 0 / .3); backdrop-filter: blur(2px); }
.sheet .sh-hd { padding: 18px 20px 0 12px; }
.sheet .sh-bd { padding: 16px 20px 20px; }
.sheet .list { box-shadow: none; background: var(--track); }

/* شريط التنبيه (الوردية مقفلة / الاشتراك) كبسولة داخل الصفحة */
.banner { margin: 8px 16px 0; border-radius: 18px; padding: 8px 8px 8px 16px; padding-inline-start: 18px; }
.banner .btn { min-height: 36px; }

/* الدخول */
.auth-card { padding: 32px 24px; }
.auth label input { margin-top: 6px; }

/* الشريط العلوي: بعرض الصفحة في الشاشات الكبيرة، وفي النص في الشاشات الصغيرة */
.tabs { display: block; overflow: visible; }
.tabs .track { display: flex; width: 100%; }
.tabs .track > button { flex: 1 1 0; justify-content: center; white-space: nowrap; }
@media (max-width: 860px) {
  .tabs .track { width: fit-content; max-width: 100%; margin-inline: auto; }
  .tabs .track > button { flex: none; }
}
/* يمنع شريط التصنيفات يوسّع الصفحة في الجوال */
.cashier > *, .menu { min-width: 0; }
.menu-nav .track { max-width: 100%; }

.list li.on { color: var(--brand-deep); font-weight: 600; }

/* الشريط العلوي ثابت وأنت تنزل */
:root { --chrome-h: 112px; }
.chrome { position: sticky; top: 0; z-index: 5; background: rgb(245 245 248 / .85); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .chrome { background: rgb(15 15 20 / .82); } }
:where(:root[data-theme=dark]) .chrome { background: rgb(15 15 20 / .82); }
.chrome .top, .chrome .tabs { background: transparent; }
.chrome .tabs { padding-bottom: 10px; }
.menu-nav { top: var(--chrome-h); background: var(--surface); }
.menu-sec { scroll-margin-top: calc(var(--chrome-h) + 64px); }
.bill { top: calc(var(--chrome-h) + 12px); }
@media (max-width: 860px) { .bill { top: auto; } }
@media (prefers-reduced-transparency: reduce) { .chrome { background: var(--surface); backdrop-filter: none; } }

/* الكاشير والطلبات بعرض الشاشة كامل، والأصناف تاخذ أعمدة أكثر */
.view.wide { max-width: none; padding-inline: 20px; }
.cashier { grid-template-columns: 1fr 320px; gap: 20px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }

/* الفاتورة أخف: خط الإجمالي أصغر وأزرار الدفع أنحف */
.bill { padding: 16px; border-radius: 22px; }
.bill-hd h2 { font-size: 19px; }
.total { margin-top: 10px; }
.total strong { font-size: 28px; line-height: 34px; }
.bill .caption { margin: 2px 0 10px; }
.pay { gap: 8px; }
.pay .btn { min-height: 46px; font-size: 16px; font-weight: 600; }
.bill .link { min-height: 36px; padding: 6px 4px; font-size: 15px; }
.cust input { min-height: 40px; font-size: 15px; }
.cart .nm { font-size: 15px; }
@media (max-width: 860px) {
  .view.wide { padding-inline: 16px; }
  .bill:not(.open) .total strong { font-size: 24px; line-height: 30px; }
}

/* زر الإغلاق دائرة × مثل باقي الدوائر، بدون مربع التركيز */
.sheet:focus { outline: none; }
.sheet .sh-hd { align-items: center; padding: 18px 20px 0 16px; }
.sh-close { width: 32px; height: 32px; }
.circ:focus { outline: none; }
.circ:focus-visible, .btn:focus-visible, .link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 999px; }

/* عدّاد إقفال نافذة الشبكة */
.timer { margin-top: 12px; display: grid; gap: 6px; justify-items: center; }
.timer-bar { width: 100%; height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
.timer-bar i { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 999px; transform-origin: right; animation: drain linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .timer-bar { display: none; } }
/* أزرار بطاقة الطلب: الإجراء الأساسي سطر كامل، والتعديل والإلغاء تحته */
.card .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.card .acts .btn { min-height: 40px; font-size: 15px; padding: 0 12px; }
.card .acts .btn.primary { grid-column: 1 / -1; }

/* شاشة الدخول: خلفية نقش العدّ */
.auth { background: var(--surface) url(/pattern.svg) repeat; background-size: 230px; }
.auth-card { box-shadow: 0 10px 40px rgb(28 27 34 / .12); }

/* الحقل يتبع اتجاه اللي ينكتب فيه، والنص الإرشادي العربي يمين */
input[dir=ltr] { text-align: left; }
input[dir=rtl] { text-align: right; }
/* زر إظهار كلمة السر (العين) دائماً على اليسار داخل الحقل */
.pw { position: relative; display: block; }
label .pw { margin-top: 6px; }
.pw > input { padding-left: 48px !important; margin-top: 0 !important; }
.pw-eye { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pw-eye:active { background: var(--track); }

/* الآيباد والآيفون: الضغط السريع مرتين ما يسوي تكبير، والحقول ما تكبّر الصفحة لما تنضغط */
html, body, button, a, input, select, label, .tile { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }
button { -webkit-user-select: none; user-select: none; }

/* ===== الجوال (لازم تكون آخر شي عشان تغلب إعدادات الشاشات الكبيرة اللي فوق) ===== */
@media (max-width: 860px) {
  .view.wide { padding-inline: 12px; }
  .cashier { grid-template-columns: 1fr; gap: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 124px; }
  .tile-main { padding: 14px 14px 4px; padding-inline-end: 50px; }
  .tile .n { font-size: 16px; line-height: 22px; }
  .tile-foot { padding: 0 10px 10px 14px; min-height: 48px; }
  .tile-x.circ { top: 12px; }
  [dir=rtl] .tile-x { left: 12px; }
  .pill { max-width: 96px; }
  .menu-sec { margin-bottom: 18px; }
  .sec-hd { font-size: 19px; margin: 6px 0 10px; }
  /* الفاتورة شريط تحت الشاشة */
  .bill { position: sticky; bottom: 0; top: auto; z-index: 3; margin: 12px -12px 0; border-radius: 22px 22px 0 0;
    padding: 12px 16px max(14px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 24px rgb(0 0 0 / .18); }
  .bill .total { margin-top: 2px; }
  .bill .pay { margin-top: 6px; }
  .bill:not(.open) .pay + .line, .bill:not(.open) .line.caption { display: none; }
}

/* ===== الشريط العلوي: الباركود + بطاقة الحساب (شعار الشركة، اسمها، واسم الموظف تحته) ===== */
.who { gap: 10px; }
.hdr-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--raised); color: var(--ink); box-shadow: var(--lift); display: grid; place-items: center; cursor: pointer; }
.hdr-btn:active { transform: scale(.95); }
.acct { display: flex; align-items: center; gap: 10px; border: 0; background: var(--raised); box-shadow: var(--lift); border-radius: 999px; padding: 4px 4px 4px 14px; padding-inline-start: 4px; cursor: pointer; color: var(--ink); max-width: 240px; }
.acct-logo { width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 15px; }
.acct-logo img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.acct-logo.big { width: 56px; height: 56px; border-radius: 18px; font-size: 24px; }
.acct-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; text-align: start; }
.acct-txt b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.acct-txt span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.acct-card { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.acct-card .badge { display: inline-block; margin-top: 6px; }
.stack { display: grid; gap: 8px; }
.logo-card { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.logo-card .grow { flex: 1; }
.qr-big { display: block; width: min(260px, 70vw); height: auto; aspect-ratio: 1; margin: 8px auto; background: #fff; padding: 10px; border-radius: 18px; }
.c { text-align: center; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); }
.rc-logo { display: block; width: 56px; height: 56px; object-fit: contain; margin: 0 auto 6px; border-radius: 12px; }
@media (max-width: 480px) {
  .acct { padding-inline-end: 10px; }
  .acct-txt b, .acct-txt span { max-width: 110px; }
  .top .logo.sm { font-size: 0; gap: 0; }   /* في الجوال يكفي شعار حِسبة بدون الكلمة */
}

/* صورة الصنف في التعديل والقائمة */
.photo-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.photo-edit img, .photo-empty { width: 96px; height: 96px; border-radius: 20px; object-fit: cover; flex: none; background: var(--track); }
.photo-empty { display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.photo-acts { display: flex; align-items: center; gap: 8px; }
.thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: none; background: var(--track); }

/* شريط الوردية المقفلة: نص واضح وزر داكن يقرا في الفاتح والداكن */
.banner { color: #1C1B22; }
.banner-sub { font-weight: 500; opacity: .8; }
.banner-btn { flex: none; border: 0; border-radius: 999px; min-height: 36px; padding: 0 18px; background: #1C1B22; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.banner-btn:active { transform: scale(.97); }
@media (max-width: 480px) { .banner-sub { display: none; } }

/* الجوال والآيباد: الشريط ينسحب بالإصبع، وفي النص إذا كفّت الأقسام */
@media (max-width: 860px) {
  .tabs .track { width: fit-content; max-width: 100%; margin-inline: auto; overflow-x: auto; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-padding-inline: 4px; }
  .tabs .track::-webkit-scrollbar { display: none; }
  .tabs .track > button { flex: none; }
}

/* ---------- لوحة الطلبات ---------- */
/* البطاقات أضيق: أكثر من بطاقة في العمود لو فيه مكان */
.board .col { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; align-content: start; }
.board .col > h3, .board .col > .caption { grid-column: 1 / -1; margin-bottom: 0; }
.board .card { margin: 0; padding: 12px; display: flex; flex-direction: column; }
.board .card .hd { font-size: 17px; margin-bottom: 2px; }
/* الأصناف المطلوبة: العدد في دائرة واضحة والاسم عريض والإضافات تحته */
.card ul.oitems { list-style: none; margin: 10px 0 12px; padding: 0; display: grid; gap: 0; flex: 1; align-content: start; }
.oitems li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid rgb(127 127 127 / .14); }
.oitems li:first-child { border-top: 0; padding-top: 2px; }
.oq { flex: none; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-tint-ink); font-weight: 800; font-size: 16px; }
.oitems .on { min-width: 0; padding-top: 3px; }
.oitems .on b { display: block; font-size: 16px; font-weight: 700; line-height: 1.35; }
.oopts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.oopts span { font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--track); color: var(--ink); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .oq { background: rgb(178 137 240 / .22); color: #D9C4FA; } }
:where(:root[data-theme=dark]) .oq { background: rgb(178 137 240 / .22); color: #D9C4FA; }
/* زر التعديل بلون الزعفران */
.btn.saffron, .btn.saffron:not(.primary):not(.danger) { background: var(--signal); color: #1C1B22; border: 0; font-weight: 700; box-shadow: none; }
.btn.saffron:hover { filter: brightness(1.05); }

/* شريط حالات الطلبات: يظهر في الجوال بس */
.ord-seg { display: none; }
@media (max-width: 860px) {
  /* يلصق تحت الشريط العلوي بنفس خلفيته، فما يبان شي من وراه */
  .ord-seg { display: block; position: sticky; top: var(--chrome-h, 0px); z-index: 4; margin: -12px -12px 10px; padding: 2px 12px 10px;
    background: rgb(245 245 248 / .85); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px); }
  .ord-seg .track { display: flex; width: 100%; }
  .ord-seg .track > button { flex: 1 1 0; justify-content: center; white-space: nowrap; padding: 0 8px; }
  .ord-seg .cnt { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
    font-size: 12.5px; font-weight: 700; background: rgb(127 127 127 / .18); }
  .ord-seg button.on .cnt { background: var(--signal); color: #1C1B22; }
  .board .col:not(.on) { display: none; }
  .board .col > h3 { display: none; }
}
@media (max-width: 860px) and (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .ord-seg { background: rgb(15 15 20 / .82); } }
@media (max-width: 860px) { :where(:root[data-theme=dark]) .ord-seg { background: rgb(15 15 20 / .82); } }

/* الزعفراني: لون التعديل والتغيير في كل التطبيق */
:root { --saffron: #F0A531; --saffron-ink: #A3640A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --saffron-ink: #F5B955; } }
:root[data-theme=dark] { --saffron-ink: #F5B955; }
.btn.saffron:disabled { opacity: .45; }
.edit-hint { color: var(--saffron-ink); font-weight: 600; }
/* عدد الطلبات في الشريط العلوي */
.tabs .track > button { gap: 6px; }
.tab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 800; line-height: 1; background: var(--saffron); color: #1C1B22; }
.tab-n[hidden] { display: none; }

/* سطر الفاتورة: «تعديل» كبسولة زعفرانية، وزر حذف السطر كامل */
.cart .line-price { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cart .edit-hint { display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: 999px;
  background: var(--saffron); color: #1C1B22; font-size: 12.5px; font-weight: 700; }
.cart .line-del { flex: none; width: 30px; height: 30px; }
.cart .line-del:hover { background: rgb(220 50 50 / .14); color: #D23B3B; }

/* =========================================================
   نفس شكل الكاشير والطلبات في كل الصفحات
   ========================================================= */
.page { max-width: 1080px; margin: 0 auto; }
.page.mid { max-width: 720px; }
.page-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 12px; min-height: 40px; }
.page-hd h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 22px; }
.page-hd .btn { min-height: 40px; padding: 0 18px; width: auto; }
.page-hd .val { font-size: 19px; }
.hd-n { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 700; background: var(--track); color: var(--muted); }
.page-sub { margin: -6px 0 12px; font-size: 14px; }
.page h3 { font-size: 15px; margin: 22px 4px 8px; }
.page-hd + h3, .fbar + h3, .fbar + div > h3:first-child { margin-top: 6px; }

/* شريط الفلترة بالكبسولات */
.fbar { margin-bottom: 12px; }
.fbar .track { display: flex; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.fbar .track::-webkit-scrollbar { display: none; }
.fbar .track > button { white-space: nowrap; }
.fbar .cnt { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 12.5px; font-weight: 700; background: rgb(127 127 127 / .18); }
.fbar button.on .cnt { background: var(--saffron); color: #1C1B22; }
@media (max-width: 860px) {
  .fbar { position: sticky; top: var(--chrome-h, 0px); z-index: 4; margin: -12px -12px 10px; padding: 2px 12px 10px;
    background: rgb(245 245 248 / .85); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px); }
  .page-hd + .fbar { margin-top: -4px; }
}
@media (max-width: 860px) and (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .fbar { background: rgb(15 15 20 / .82); } }
@media (max-width: 860px) { :where(:root[data-theme=dark]) .fbar { background: rgb(15 15 20 / .82); } }

/* البحث */
input.search { border-radius: 999px; padding-inline: 18px; margin-bottom: 12px; background: var(--track); border: 0; }

/* سطور القوائم: الاسم واضح والقيمة عريضة */
.list .nm { display: block; font-size: 16px; font-weight: 700; line-height: 1.35; }
.list .val { flex: none; font-weight: 700; font-size: 16px; white-space: nowrap; }
.list li.tap:hover .edit-pill { filter: brightness(1.05); }
.list .circ.plain-x { flex: none; }
.edit-pill { flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px;
  background: var(--saffron); color: #1C1B22; font-size: 12.5px; font-weight: 700; }
.qty-pill, .num-pill { flex: none; display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 999px; white-space: nowrap;
  background: var(--brand-tint); color: var(--brand-tint-ink); font-weight: 700; font-size: 14px; }
.qty-pill.low, .qty-pill.minus { background: rgb(214 48 48 / .12); color: #C42F2F; }
.num-pill { background: var(--track); color: var(--ink); }
.list .oq { align-self: center; }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .qty-pill { background: rgb(178 137 240 / .22); color: #D9C4FA; } :where(:root:not([data-theme=light])) .qty-pill.low, :where(:root:not([data-theme=light])) .qty-pill.minus { background: rgb(255 90 90 / .16); color: #FF8F8F; } }
:where(:root[data-theme=dark]) .qty-pill { background: rgb(178 137 240 / .22); color: #D9C4FA; } :where(:root[data-theme=dark]) .qty-pill.low, :where(:root[data-theme=dark]) .qty-pill.minus { background: rgb(255 90 90 / .16); color: #FF8F8F; }
/* كبسولات الحالة (مفتوحة، مطابق، عجز...) */
.state-pill { flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 700; background: var(--track); color: var(--muted); }
.state-pill.ok { background: rgb(36 160 90 / .14); color: #1D8A4C; }
.state-pill.bad { background: rgb(214 48 48 / .12); color: #C42F2F; }
.state-pill.warn { background: var(--saffron); color: #1C1B22; }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .state-pill.ok { color: #5FD08F; } :where(:root:not([data-theme=light])) .state-pill.bad { color: #FF8F8F; } }
:where(:root[data-theme=dark]) .state-pill.ok { color: #5FD08F; } :where(:root[data-theme=dark]) .state-pill.bad { color: #FF8F8F; }

/* بطاقة النماذج */
.form-card { padding: 16px; margin-bottom: 12px; }
.form-card > h3:first-child { margin: 0 0 10px; color: var(--ink); font-size: 16px; font-weight: 700; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
.chip.add { background: var(--brand-tint); color: var(--brand-tint-ink); }
.toolbar.dates input { border-radius: 999px; }
.sheet-facts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.page .stats { gap: 10px; }
.page .stat { border-radius: 20px; }

/* الشاشات الكبيرة: القوائم تصير بطاقات جنب بعض مثل الطلبات */
@media (min-width: 900px) {
  .list.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; background: none; box-shadow: none; border-radius: 0; overflow: visible; }
  .list.cards > li { background: var(--raised); border-radius: 18px; box-shadow: var(--lift); }
  .list.cards > li + li::before { display: none; }
  .list.cards > li.caption { grid-column: 1 / -1; }
  .page .stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
/* السطر الثاني في القوائم سطر واحد مرتب */
.list.cards .sub, .page .list .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .grow { min-width: 0; }
.form-card .form > .err:empty { display: none; }
.form-card .form { margin: 0; }
/* مسافات بين الأقسام: ما تلصق البطاقات ببعض */
.page .list + .card, .page .stats + .card, .page .stats + .list, .page > div + .card { margin-top: 16px; }
.page.mid .stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .page.mid .stats { grid-template-columns: repeat(2, 1fr); } }
/* الصنف بدون صورة: أول حرف بدل المربع الفاضي */
.thumb.empty { display: grid; place-items: center; padding: 0; height: 44px; box-sizing: border-box; line-height: 1; font-weight: 800; font-size: 18px; color: var(--brand-tint-ink); background: var(--brand-tint); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .thumb.empty { background: rgb(178 137 240 / .18); color: #D9C4FA; } }
:where(:root[data-theme=dark]) .thumb.empty { background: rgb(178 137 240 / .18); color: #D9C4FA; }
/* كل الصفحات بعرض الشاشة مثل الكاشير والطلبات */
.page, .page.mid { max-width: none; }
.page.split > .page-hd, .page.split > .page-sub { grid-column: 1 / -1; }
.page.split > .col-a > h3:first-child, .page.split > .col-b > h3:first-child { margin-top: 0; }
@media (min-width: 1000px) {
  /* النماذج والأرقام على جهة، والقائمة على الجهة الثانية */
  .page.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
  .page.split > .col-a, .page.split > .col-b { min-width: 0; }
  .page.split .col-b > .list { max-height: none; }
}
@media (min-width: 1000px) { .page.split .col-a .stats { grid-template-columns: repeat(3, 1fr); } }
.page.split .stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .page.split .stats { grid-template-columns: repeat(2, 1fr); } }
.toolbar.dates { max-width: 620px; }

/* ---------- الوردية والمصروفات ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.kpis.three { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.kpi { background: var(--raised); border-radius: 18px; box-shadow: var(--lift); padding: 12px 14px; min-width: 0; }
.kpi span { display: block; font-size: 13px; color: var(--muted); }
.kpi strong { display: block; font-size: 19px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpis.three { grid-template-columns: repeat(3, 1fr); } .kpis.three .kpi strong { font-size: 15px; } }

/* بطاقة الدرج: الرقم الكبير وتحته كيف انحسب */
.drawer { padding: 18px; background: linear-gradient(135deg, rgb(178 137 240 / .16), rgb(240 165 49 / .08)), var(--raised); }
.drawer-hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drawer-big { font-size: 44px; line-height: 54px; font-weight: 800; margin: 4px 0 12px; letter-spacing: -.5px; }
.eq { display: grid; gap: 6px; padding-top: 12px; border-top: 1px dashed rgb(127 127 127 / .35); }
.eq-row { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); }
.eq-row b { color: var(--ink); font-weight: 700; }
.form-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.form-hd h3 { margin: 0 !important; color: var(--ink); font-size: 16px; font-weight: 700; }

/* أعمدة آخر الورديات */
.spark-card { padding: 14px 16px; margin-bottom: 12px; }
.spark-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 70px; }
.spark i { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--brand); opacity: .85; min-height: 4px; }
.spark i.bad { background: #E0534F; }
/* مربع التاريخ في الورديات السابقة */
.datebox { flex: none; width: 46px; height: 50px; border-radius: 14px; background: var(--track); display: grid; place-content: center; text-align: center; line-height: 1.1; }
.datebox b { font-size: 19px; font-weight: 800; }
.datebox small { font-size: 11px; color: var(--muted); }

/* المصروفات */
.total-pill { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--track); font-weight: 800; font-size: 18px; }
.total-pill small { font-size: 12px; font-weight: 600; color: var(--muted); }
.amount-in { position: relative; }
.amount-in input { font-size: 30px; font-weight: 800; height: 64px; padding-inline-end: 44px; border-radius: 18px; }
.amount-in span { position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted); font-family: 'Saudi Riyal', sans-serif; }
.quick-notes { margin: 10px 0; gap: 6px; }
.quick-notes .chip { min-height: 32px; padding: 0 12px; font-size: 14px; }
.quick-notes .chip.on { background: var(--saffron); color: #1C1B22; }
.form-card .seg { margin: 10px 0 12px; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 30%) 1fr 92px; align-items: center; gap: 10px; font-size: 14px; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hb-t { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 999px; background: var(--saffron); }
.day-group { margin-bottom: 14px; }
.day-hd { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.day-hd b { color: var(--ink); }
.thumb.empty.sm { width: 36px; height: 36px; border-radius: 11px; font-size: 15px; }
.src-pill { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--track); color: var(--muted); white-space: nowrap; }
.src-pill.out { background: rgb(240 165 49 / .16); color: var(--saffron-ink); }
@media (max-width: 560px) { .src-pill { display: none; } .drawer-big { font-size: 38px; } }
.hbar b { text-align: end; }

/* الجهة اليمين ثابتة وأنت تنزل في القائمة (الشاشات الكبيرة) */
@media (min-width: 1000px) {
  .page.split.pin-a > .col-a { position: sticky; top: calc(var(--chrome-h, 0px) + 12px);
    max-height: calc(100dvh - var(--chrome-h, 0px) - 24px); overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; padding-bottom: 4px; }
  .page.split.pin-a > .col-a::-webkit-scrollbar { display: none; }
}
/* رسم الورديات بالشهور */
.spark-card { margin-top: 12px; }
.spark-card .fbar { position: static; margin: 0 0 12px; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.spark-total { font-size: 26px; font-weight: 800; margin: -4px 0 10px; }
.spark { height: 90px; gap: 4px; }
.spark-x { display: flex; gap: 4px; margin-top: 4px; }
.spark-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); min-width: 0; overflow: hidden; }
.month-hd { position: sticky; top: var(--chrome-h, 0px); z-index: 2; padding: 8px 6px; margin: 0 -6px 6px; border-radius: 12px;
  background: rgb(245 245 248 / .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 15px; }
.month-hd b { color: var(--ink); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .month-hd { background: rgb(15 15 20 / .88); } }
:where(:root[data-theme=dark]) .month-hd { background: rgb(15 15 20 / .88); }
.month-group { scroll-margin-top: calc(var(--chrome-h, 0px) + 8px); }

/* ================= الإعدادات ================= */
.set-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { position: sticky; top: calc(var(--chrome-h, 0px) + 12px); }
.set-nav .track { display: flex; flex-direction: column; align-items: stretch; border-radius: 22px; padding: 6px; gap: 2px; width: 100%; }
.set-nav .track > button { justify-content: flex-start; min-height: 42px; padding: 0 16px; white-space: nowrap; }
.set-pane { max-width: 760px; min-width: 0; }
.set-title { font-size: 20px; margin: 0 0 4px; }
.set-group { margin-top: 14px; }
.set-group > h3 { margin: 0 6px 8px; }
.set-card { padding: 4px 16px; }
.set-card > .form, .set-card > form { padding: 12px 0; }
.set-card > * + * { border-top: 1px solid rgb(127 127 127 / .14); }
.set-card > .card { box-shadow: none; background: none; padding-inline: 0; border-radius: 0; margin: 0; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-height: 56px; cursor: default; }
label.set-row { cursor: pointer; }
.set-row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.set-row.col .seg { margin: 0; }
.set-row .nm { font-size: 15.5px; }
.set-row .sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.set-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0; }
.set-acts .btn { width: auto; flex: 1 1 auto; min-height: 42px; padding: 0 18px; }
.set-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.set-hd h3 { margin: 0 6px; }
.set-hd .btn { width: auto; min-height: 38px; padding: 0 16px; }
.chip.feat { background: var(--brand-tint); color: var(--brand-tint-ink); min-height: 30px; font-size: 13px; }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .chip.feat { background: rgb(178 137 240 / .2); color: #D9C4FA; } }
:where(:root[data-theme=dark]) .chip.feat { background: rgb(178 137 240 / .2); color: #D9C4FA; }
/* مفتاح تشغيل بشكل iOS */
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 999px; background: rgb(120 120 128 / .32);
  position: relative; cursor: pointer; transition: background .2s; margin: 0; padding: 0; border: 0; }
input.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / .2); transition: inset-inline-start .2s; }
input.switch:checked { background: #34C759; }
input.switch:checked::after { inset-inline-start: 22px; }
input.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 860px) {
  .set-layout { grid-template-columns: 1fr; gap: 6px; }
  .set-nav { position: sticky; top: var(--chrome-h, 0px); z-index: 4; margin: -12px -12px 4px; padding: 2px 12px 10px;
    background: rgb(245 245 248 / .85); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px); }
  .set-nav .track { flex-direction: row; overflow-x: auto; scrollbar-width: none; border-radius: 999px; padding: 4px; width: fit-content; max-width: 100%; }
  .set-nav .track::-webkit-scrollbar { display: none; }
  .set-nav .track > button { flex: none; min-height: 36px; }
  .set-acts .btn { flex: 1 1 100%; }
}
@media (max-width: 860px) and (prefers-color-scheme: dark) { :where(:root:not([data-theme=light])) .set-nav { background: rgb(15 15 20 / .82); } }
@media (max-width: 860px) { :where(:root[data-theme=dark]) .set-nav { background: rgb(15 15 20 / .82); } }
/* زر دفع واحد يأخذ العرض كله */
.pay.one { grid-template-columns: 1fr !important; }
/* طلبات اليوم بدون مطبخ */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: start; }
.board-grid .card { margin: 0; padding: 12px; }
.board-grid .card.off { opacity: .55; }
/* إيصال 58 مم */
.receipt.w58 { max-width: 230px; margin-inline: auto; font-size: 13px; }
@media print { body.print-58 .print-area .receipt { max-width: 48mm; font-size: 11px; } }
.set-layout > * { min-width: 0; }
.set-nav, .set-nav .track { min-width: 0; }
.set-pane { max-width: 900px; }
/* الخصوصية والأمان */
.set-card .pad { padding: 14px 0; margin: 0; }
.dev-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--track); font-size: 18px; }
.state-pill.sm { height: 20px; padding: 0 8px; font-size: 11px; margin-inline-start: 8px; vertical-align: middle; }
.set-row .state-pill { flex: none; }
.sec-note { margin-top: 14px; padding: 16px 18px; }
.sec-note ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); font-size: 14px; line-height: 1.9; }
/* الباقات */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.plan-card { position: relative; border-radius: 20px; padding: 16px; background: var(--track); display: flex; flex-direction: column; gap: 4px; }
.plan-card.best { background: linear-gradient(160deg, rgb(178 137 240 / .22), rgb(240 165 49 / .1)); box-shadow: inset 0 0 0 1.5px var(--brand); }
.plan-card.cur { box-shadow: inset 0 0 0 1.5px var(--saffron); }
.plan-tag { position: absolute; top: 12px; inset-inline-end: 12px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--brand); color: var(--on-brand); }
.plan-name { font-size: 17px; }
.plan-price strong { font-size: 32px; font-weight: 800; }
.plan-price span { color: var(--muted); font-family: 'Saudi Riyal', inherit; }
.plan-card ul { list-style: none; padding: 0; margin: 10px 0 14px; flex: 1; display: grid; gap: 6px; font-size: 14px; }
.plan-card li::before { content: "✓"; color: #34C759; font-weight: 800; margin-inline-end: 8px; }
.plan-card .btn { width: 100%; }
.sheet:has(.plans) { width: min(820px, calc(100vw - 24px)); }
.banner-note { background: rgb(240 165 49 / .16); color: var(--saffron-ink); border-radius: 14px; padding: 10px 14px; font-weight: 600; margin-bottom: 10px; }
.set-row .btn.sm { width: auto; flex: none; min-height: 34px; padding: 0 16px; font-size: 14px; }
/* تنبيه التجديد والبطاقة */
.banner.renew { background: linear-gradient(90deg, var(--brand), #C9A6F5); color: #1C1B22; }
.banner-acts { display: flex; align-items: center; gap: 8px; flex: none; }
.banner .circ.plain-x { background: rgb(0 0 0 / .12); color: #1C1B22; }
.card-chip { flex: none; min-width: 64px; height: 34px; padding: 0 10px; border-radius: 9px; display: inline-grid; place-items: center;
  font-weight: 800; font-size: 13px; background: linear-gradient(135deg, #2B2A35, #4A4760); color: #fff; letter-spacing: .3px; }
.card-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
/* السطر في الإعدادات: النص ياخذ المساحة والأزرار على الطرف */
.set-row .grow { flex: 1; min-width: 0; }
/* التحقق بخطوتين */
.tfa-hero { text-align: center; padding: 8px 4px 14px; }
.tfa-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--brand-tint); font-size: 30px; }
.tfa-hero p { color: var(--muted); line-height: 1.8; margin: 12px 0 0; }
.tfa-steps { margin: 0 0 12px; padding-inline-start: 20px; line-height: 1.9; font-size: 14.5px; }
.tfa-qr { display: grid; place-items: center; margin: 6px 0 10px; }
.tfa-qr img { width: 190px; height: 190px; background: #fff; padding: 10px; border-radius: 18px; }
.tfa-key { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.tfa-key code { font-size: 15px; letter-spacing: 1px; background: var(--track); padding: 8px 12px; border-radius: 12px; }
.tfa-key .btn { width: auto; min-height: 36px; padding: 0 16px; }
input.otp { font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; }
/* أوقات العمل */
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chip { border: 0; min-height: 44px; border-radius: 14px; background: var(--track); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0 4px; }
.day-chip.on { background: var(--brand); color: var(--on-brand); }
.quick-days .chip { min-height: 30px; font-size: 13px; padding: 0 12px; }
.time-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; }
.time-range label { display: grid; gap: 6px; }
.time-range input { font-size: 20px; font-weight: 700; text-align: center; min-height: 52px; }
.tr-sep { padding-bottom: 14px; color: var(--muted); font-size: 18px; }
.hours-preview { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 12px 14px; margin: 8px 0 4px; border-radius: 14px; background: rgb(178 137 240 / .12); }
.hours-preview b { font-size: 15px; }
@media (max-width: 560px) { .day-chip { font-size: 12px; min-height: 40px; } }
.time-range { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.time-range label, .time-range input { min-width: 0; width: 100%; }
@media (max-width: 560px) {
  .day-chips { grid-template-columns: repeat(4, 1fr); }
  .time-range input { font-size: 17px; padding-inline: 8px; }
}
/* اختيار الساعة */
.tr-col { display: grid; gap: 6px; min-width: 0; }
.tpick { display: flex; align-items: center; gap: 8px; background: var(--track); border-radius: 16px; padding: 6px; min-height: 56px; }
.tp-hm { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: center; }
.tp-hm select { appearance: none; -webkit-appearance: none; border: 0; background: var(--raised); color: var(--ink); font-size: 20px; font-weight: 700;
  min-height: 44px; width: 56px; text-align: center; text-align-last: center; border-radius: 12px; padding: 0; cursor: pointer; font-variant-numeric: tabular-nums; }
.tp-colon { font-size: 20px; font-weight: 800; padding: 0 2px; }
.ampm { display: flex; gap: 2px; background: rgb(127 127 127 / .14); border-radius: 12px; padding: 3px; flex: none; }
.ampm button { border: 0; background: none; color: var(--ink); opacity: .7; min-width: 38px; min-height: 38px; border-radius: 10px; font-weight: 700; font-size: 16px; cursor: pointer; }
.ampm button.on { background: var(--brand); color: var(--on-brand); opacity: 1; }
@media (max-width: 560px) {
  .time-range { grid-template-columns: 1fr; }
  .tr-sep { display: none; }
}

/* المظهر من الإعدادات: تلقائي (حسب الجهاز) أو فاتح أو داكن، وحجم الخط */
:root[data-theme=dark] { color-scheme: dark; }
:root[data-theme=light] { color-scheme: light; }
:root[data-size=sm] body { zoom: .9; }
:root[data-size=lg] body { zoom: 1.1; }
.look-card { margin: 12px 0; } .look-seg button { min-height: 40px; }
#menuSections .menu-sec:last-child { min-height: calc(100dvh - var(--chrome-h, 0px) - 120px); }
.xl-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* ================= الولاء ================= */
.tier-pill { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.tier-pill.t0 { background: #E9D7C6; color: #6B4423; } .tier-pill.t1 { background: #E1E5EC; color: #3B4352; }
.tier-pill.t2 { background: var(--saffron); color: #1C1B22; } .tier-pill.t3, .tier-pill.t4 { background: var(--brand-tint); color: var(--brand-tint-ink); }
.cust-tier { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.link.sm { min-height: 30px; padding: 4px 6px; font-size: 14px; font-weight: 600; }
.rw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip.rw { background: rgb(240 165 49 / .18); color: var(--ink); min-height: 34px; font-size: 13.5px; border: 1px dashed var(--saffron); }
.stamp-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.stamp-dots { display: inline-flex; gap: 3px; }
.stamp-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--separator); }
.stamp-dots i.on { background: var(--brand); border-color: var(--brand); }
.cart li.reward-line { background: rgb(240 165 49 / .08); border-radius: 14px; padding-inline: 10px; }
.rw-pill { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--saffron); color: #1C1B22; }
.cart .free { font-weight: 800; color: #1D8A4C; }
.cust-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; margin-bottom: 10px; }
.cust-hero > div { background: var(--track); border-radius: 16px; padding: 12px; display: grid; gap: 4px; justify-items: start; }
.cust-hero strong { font-size: 22px; }
.tiers { display: grid; gap: 8px; padding: 10px 0; }
.tier-row { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr); gap: 8px; align-items: end; }
.tier-row label { display: grid; gap: 4px; }
.tier-row input { min-width: 0; }
@media (max-width: 560px) { .tier-row { grid-template-columns: auto 1fr 1fr; } .tier-row > input { grid-column: 2 / -1; } .tier-row > .tier-pill { grid-row: span 2; } }
.rc-card { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 10px 0; } .receipt .qr.sm { width: 74px; height: 74px; margin: 0; }

/* ===== مسح باركود العميل وتسجيله ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cust input { flex: 1; min-width: 0; }
.cust .scan-btn { flex: none; width: 44px; height: 44px; align-self: center; background: var(--brand); color: var(--on-brand); }
.ic.scan { width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2M7 12h10'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2M7 12h10'/%3E%3C/svg%3E") center / contain no-repeat; }
.ic.scan::before, .ic.scan::after { display: none; }
.circ.scan-btn .ic.scan { width: 20px; height: 20px; }
.cust-name { font-weight: 700; margin-bottom: 4px; }
.scan-box { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 1; max-height: 52vh; margin: 0 auto 8px; width: 100%; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid rgb(255 255 255 / .9); border-radius: 22px; box-shadow: 0 0 0 999px rgb(0 0 0 / .35); }
label.shot-btn { display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }

/* ===== الفاتورة: الأصناف ورقم العميل تتمرر، والإجمالي وأزرار الدفع ظاهرة دايم ===== */
.bill-body { min-width: 0; }
.bill .bill-body .cart { max-height: none; overflow: visible; }
.bill-body { max-height: calc(100vh - var(--chrome-h, 120px) - 230px); overflow-y: auto; overscroll-behavior: contain; margin-inline: -4px; padding-inline: 4px; }
@media (max-width: 860px) {
  .bill:not(.open) .bill-body { display: none; }
  /* على الجوال: الفاتورة المفتوحة ما تطلع أطول من الشاشة، فأزرار الدفع ما تختفي تحت */
  .bill.open .bill-body { max-height: calc(100dvh - 330px); }
}

/* ===== السيارة ===== */
.car-box { margin-top: 10px; display: grid; gap: 8px; }
.car-row { display: flex; align-items: center; gap: 8px; }
.car-ic { font-size: 20px; }
.car-row .car-in { flex: 1; min-width: 0; min-height: 44px; }
.car-row .car-x { width: 32px; height: 32px; flex: none; }
.car-colors { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.car-colors::-webkit-scrollbar { display: none; }
.car-c { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 8px; border-radius: 999px; border: 0; background: var(--track); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.car-c i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(127 127 127 / .45); }
.car-c.on { background: var(--brand); color: var(--on-brand); }
.car-tag { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: rgb(240 165 49 / .18); color: var(--ink); font-weight: 700; font-size: 14px; }

/* ===== الإعدادات بعرض الشاشة: المجموعات تتوزع على عمودين في الشاشات الكبيرة ===== */
.set-pane { max-width: none; }
@media (min-width: 1180px) {
  .set-pane { columns: 2; column-gap: 16px; }
  .set-pane > * { break-inside: avoid; }
  .set-pane > .set-title, .set-pane > .set-hd { column-span: all; }
  .set-pane > .set-group:first-of-type { margin-top: 0; }
}

/* ===== توحيد المربعات في كل الصفحات: نفس الزوايا والحشو والمسافات ===== */
:root { --r-card: 22px; --box-pad: 16px; --box-gap: 12px; }
.card, .stat, .list, .bars, .bill, .set-card, .tile, .list.cards > li, .page .stat { border-radius: var(--r-card); }
.card, .stat { padding: var(--box-pad); }
.set-card { padding: 4px var(--box-pad); }
.stats, .page .stats { gap: var(--box-gap); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { min-height: 84px; display: flex; flex-direction: column; justify-content: center; }
.board-grid, .list.cards { gap: var(--box-gap); }
.card { margin-bottom: var(--box-gap); }
/* صفوف الأصناف كلها بنفس الارتفاع */
.list.cards > li { min-height: 76px; }
.list.cards .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* المربعات الصغيرة (الأرقام): تملا الصف بالتساوي بدون فراغ */
.page .stats:not(.page.mid .stats):not(.page.split .stats) { display: flex; flex-wrap: wrap; }
.page .stats:not(.page.mid .stats):not(.page.split .stats) > .stat { flex: 1 1 150px; }
.page .stats > .stat.hero { flex-basis: 100%; }
/* الأصناف: الاسم يطلع على سطرين بدل ما ينقص، وكل المربعات نفس الطول */
.list.cards > li { min-height: 84px; }
.list.cards .nm { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
@media (min-width: 861px) { .list.cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.page .stats:not(.page.mid .stats):not(.page.split .stats) > .stat.hero { flex-basis: 100%; }
.car-tag { width: fit-content; max-width: 100%; }
