﻿/* ===================== QR Menu - التصميم ===================== */
:root {
    --brand: #c2410c;
    --brand-ink: #ffffff;
    --bg: #f6f4f1;
    --surface: #ffffff;
    --ink: #1f1a17;
    --muted: #6f6660;
    --line: #e7e1db;
    --ok: #15803d;
    --warn: #b45309;
    --err: #b91c1c;
    --info: #1d4ed8;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(31,26,23,.06), 0 6px 20px rgba(31,26,23,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
/* خانة غلط (الرسالة بتقول اسمها) */
.invalid, input.invalid, select.invalid, textarea.invalid { border-color: var(--err, #dc2626) !important; box-shadow: 0 0 0 3px rgba(220, 38, 38, .18) !important; }
/* اختيارات كأزرار جنب بعض */
select.seg { display: none !important; }
.seg-group { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-group button { flex: 1 1 auto; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; line-height: 1.35; white-space: normal; text-align: center; }
.seg-group button:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.seg-group button.on { background: color-mix(in srgb, var(--brand) 12%, #fff); border-color: var(--brand); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.seg-group.invalid { border-radius: 10px; }
/* القوايم المنسدلة اللي فاضلة: خط Windows في القايمة اللي بتفتح عشان الكلام العربي مايتقصش */
select { text-overflow: ellipsis; }
select option { font-family: Tahoma, "Segoe UI", Arial, sans-serif; font-size: 14px; padding: 6px 10px; background: #fff; color: #111; }
.field-hint { display: block; font-size: 12px; color: var(--muted, #6b7280); margin-top: 3px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- أزرار ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
    transition: transform .05s, background .15s, border-color .15s;
}
.btn:hover { border-color: #cfc6be; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--err); }
.btn.danger.solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { padding: 13px 22px; font-size: 17px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- حقول ---------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=tel], input[type=date], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: #fff; font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
textarea { resize: vertical; min-height: 70px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; margin: 4px 0 12px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- كروت / جداول ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 18px; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th, table.grid td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
table.grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 700; }
table.grid tr:hover td { background: #faf8f6; }
table.grid tr.selected td { background: color-mix(in srgb, var(--brand) 9%, #fff); }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #eee; display: block; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eee; color: var(--ink); }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.err { background: #fee2e2; color: var(--err); }
.badge.info { background: #dbeafe; color: var(--info); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }

/* ---------- Toast ---------- */
#toasts { position: fixed; inset-inline: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 9999; pointer-events: none; }
.toast { background: #1f1a17; color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 600; animation: pop .2s ease-out; }
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20,16,14,.5); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.modal-back.open { display: flex; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }

/* ---------- تبويبات اللغة داخل النماذج ---------- */
.lang-tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.lang-tabs button { background: none; border: 0; padding: 8px 14px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.lang-tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.lang-pane { display: none; }
.lang-pane.on { display: block; }

/* ================= لوحة التحكم ================= */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #1f1a17; color: #e9e3dd; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { font-size: 20px; font-weight: 800; padding: 4px 10px 16px; color: #fff; display: flex; align-items: center; gap: 8px; }
.sidebar .brand .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--brand); }
.sidebar .rest { padding: 0 10px 14px; font-size: 13px; color: #a8a09a; border-bottom: 1px solid #3a332e; margin-bottom: 10px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: #d6cfc8; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.sidebar nav a:hover { background: #2c2521; color: #fff; }
.sidebar nav a.on { background: var(--brand); color: #fff; }
.sidebar nav .sep { height: 1px; background: #3a332e; margin: 10px 4px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar h1 { font-size: 20px; margin: 0; }
.topbar .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.langs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.langs a { padding: 6px 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.langs a.on { background: var(--brand); color: #fff; }
.main { padding: 22px 24px 60px; min-width: 0; }
.menu-btn { display: none; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alert.err { background: #fee2e2; color: var(--err); }
.alert.warn { background: #fef3c7; color: var(--warn); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 48px; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 2px; }
.bars .b span { font-size: 11px; color: var(--muted); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 250px; z-index: 200; transform: translateX(-110%); transition: transform .2s; }
    [dir=rtl] .sidebar { transform: translateX(110%); }
    .sidebar.open { transform: none !important; }
    .menu-btn { display: inline-flex; }
    .topbar, .main { padding-inline: 14px; }
    .split { grid-template-columns: 1fr; }
}

/* ---------- الكاشير والمطبخ ---------- */
.ops-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: #aaa; }
.live.on i { background: var(--ok); box-shadow: 0 0 0 4px #dcfce7; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid #999; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ticket.s0 { border-top-color: var(--err); animation: flash 1.2s ease-in-out 3; }
.ticket.s1 { border-top-color: var(--info); }
.ticket.s2 { border-top-color: var(--warn); }
.ticket.s3 { border-top-color: var(--ok); }
@keyframes flash { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--err) 30%, transparent); } }
.ticket .th { padding: 12px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; border-bottom: 1px dashed var(--line); }
.ticket .no { font-size: 22px; font-weight: 800; }
.ticket .meta { font-size: 13px; color: var(--muted); }
.ticket .late { color: var(--err); font-weight: 800; }
.ticket ul { list-style: none; margin: 0; padding: 8px 14px; }
.ticket li { padding: 7px 0; border-bottom: 1px solid #f1ece7; display: flex; gap: 10px; align-items: flex-start; }
.ticket li:last-child { border-bottom: 0; }
.ticket li .q { font-weight: 800; min-width: 28px; }
.ticket li .n { flex: 1; font-weight: 700; }
.ticket li .ex { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.ticket li .nt { display: block; font-size: 13px; color: var(--err); font-weight: 700; }
.ticket li.ready .n { text-decoration: line-through; color: var(--muted); }
.ticket .note { margin: 0 14px 8px; padding: 8px 10px; background: #fef3c7; border-radius: 8px; font-size: 13px; font-weight: 600; }
.ticket .tf { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ticket .tf .total { margin-inline-end: auto; font-weight: 800; }
.kds .ticket li { font-size: 17px; }
.kds .ticket .no { font-size: 28px; }
.reqs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.req { display: flex; align-items: center; gap: 10px; background: #fff7ed; border: 1px solid #fed7aa; padding: 8px 12px; border-radius: 10px; font-weight: 700; }
.req.bill { background: #eff6ff; border-color: #bfdbfe; }

/* ---------- QR ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.qr-card .qr { display: flex; justify-content: center; margin: 8px 0; }
.qr-card .qr img, .qr-card .qr canvas { width: 160px; height: 160px; }
.qr-card h3 { margin: 0; font-size: 20px; }
.qr-card .code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }
.qr-card .acts { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.qr-card.off { opacity: .5; }

/* ================= صفحات عامة (دخول / تسجيل / رئيسية) ================= */
.public-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; max-width: 1100px; margin: 0 auto; }
.public-top .logo { font-weight: 800; font-size: 22px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.public-top .logo i { width: 14px; height: 14px; border-radius: 4px; background: var(--brand); display: inline-block; }
.auth-box { max-width: 460px; margin: 30px auto; padding: 0 16px; }
.auth-box .card { padding: 26px; }
.hero { max-width: 1100px; margin: 40px auto; padding: 0 24px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 42px; font-weight: 800; }
.hero p { font-size: 18px; color: var(--muted); }
.hero ul { padding: 0; list-style: none; }
.hero li { padding: 8px 0; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.hero li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); flex: none; }
.phone-mock { background: #1f1a17; border-radius: 34px; padding: 12px; max-width: 300px; margin: 0 auto; box-shadow: 0 30px 60px rgba(0,0,0,.2); }
.phone-mock .screen { background: var(--bg); border-radius: 24px; padding: 16px; min-height: 420px; }
.phone-mock .ln { height: 12px; border-radius: 6px; background: #e3dcd5; margin: 10px 0; }
.phone-mock .it { display: flex; gap: 10px; background: #fff; border-radius: 12px; padding: 10px; margin: 10px 0; }
.phone-mock .it b { width: 48px; height: 48px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 25%, #fff); flex: none; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } .hero h1 { font-size: 30px; } }

/* ================= منيو العميل (موبايل أولًا) ================= */
.m-body { background: var(--bg); padding-bottom: 96px; }
.m-head { background: var(--brand); color: var(--brand-ink); padding: 18px 16px 22px; }
.m-head .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.m-head .rn { display: flex; align-items: center; gap: 12px; }
.m-head .rn img { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; background: #fff; }
.m-head h1 { font-size: 22px; margin: 0; }
.m-head .tbl { display: inline-block; margin-top: 4px; background: rgba(255,255,255,.2); padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.m-head .langs { border-color: rgba(255,255,255,.4); }
.m-head .langs a { color: #fff; }
.m-head .langs a.on { background: #fff; color: var(--brand); }
.m-svc { display: flex; gap: 8px; margin-top: 14px; }
.m-svc .btn { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; flex: 1; }
.m-nav { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 0 4px; box-shadow: 0 6px 10px -10px rgba(0,0,0,.3); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips.sub .chip { padding: 5px 12px; font-size: 13px; }
.chips.sub .chip.on { background: var(--brand); border-color: var(--brand); }
.m-list { padding: 8px 14px; max-width: 760px; margin: 0 auto; }
.m-sec-title { font-size: 18px; font-weight: 800; margin: 18px 0 8px; }
.m-item { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
.m-item .tx { flex: 1; min-width: 0; }
.m-item h3 { font-size: 16px; margin: 0 0 2px; }
.m-item p { margin: 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-item .pr { margin-top: 6px; font-weight: 800; }
.m-item .im { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; flex: none; background: #f0ebe6; }
.m-item.out { opacity: .5; cursor: default; }
.m-item .plus { align-self: flex-end; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; flex: none; }
.cart-bar { position: fixed; inset-inline: 12px; bottom: 12px; z-index: 50; max-width: 736px; margin: 0 auto; }
.cart-bar .btn { width: 100%; justify-content: space-between; padding: 14px 18px; font-size: 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.cart-bar .cnt { background: rgba(255,255,255,.25); padding: 0 10px; border-radius: 999px; }

.sheet-back { position: fixed; inset: 0; background: rgba(20,16,14,.5); z-index: 100; display: none; }
.sheet-back.open { display: block; }
.sheet { position: fixed; inset-inline: 0; bottom: 0; background: #fff; border-radius: 20px 20px 0 0; max-height: 90vh; overflow-y: auto; z-index: 101; transform: translateY(105%); transition: transform .22s ease-out; max-width: 760px; margin: 0 auto; }
.sheet.open { transform: none; }
.sheet .hero-img { width: 100%; height: 220px; object-fit: cover; display: block; border-radius: 20px 20px 0 0; }
.sheet .pad { padding: 18px; }
.sheet h2 { font-size: 21px; }
.opt-group { margin: 16px 0; }
.opt-group h4 { margin: 0 0 8px; font-size: 15px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.opt input { accent-color: var(--brand); width: 18px; height: 18px; }
.opt span:first-of-type { flex: 1; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: #f6f2ee; font-size: 20px; cursor: pointer; }
.qty b { min-width: 40px; text-align: center; }
.sheet-foot { position: sticky; bottom: 0; background: #fff; padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.sheet-foot .btn.primary { flex: 1; justify-content: space-between; }
.cart-line { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line .tx { flex: 1; }
.cart-line small { display: block; color: var(--muted); }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; }
.sum-row.total { font-weight: 800; font-size: 18px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.seg button { flex: 1; padding: 10px; border: 0; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--brand); color: #fff; }

/* ---------- متابعة الطلب ---------- */
.track { max-width: 520px; margin: 0 auto; padding: 18px 14px 40px; }
.steps { display: flex; justify-content: space-between; margin: 26px 0; position: relative; }
.steps::before { content: ""; position: absolute; top: 15px; inset-inline: 16px; height: 3px; background: var(--line); }
.step { position: relative; text-align: center; flex: 1; font-size: 12px; font-weight: 700; color: var(--muted); }
.step i { display: block; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 3px solid var(--line); margin: 0 auto 6px; }
.step.done i { background: var(--brand); border-color: var(--brand); }
.step.done { color: var(--ink); }
.track .big { font-size: 46px; font-weight: 800; text-align: center; }
.track .msg { text-align: center; font-size: 19px; font-weight: 700; }

/* ---------- طباعة ---------- */
@media print {
    .sidebar, .topbar, .no-print, #toasts { display: none !important; }
    .layout { display: block; }
    .main { padding: 0; }
    body { background: #fff; }
    .qr-grid { grid-template-columns: repeat(3, 1fr); }
    .qr-card { break-inside: avoid; border: 1px dashed #999; }
    .qr-card .acts { display: none; }
}

/* ---------- رفع الصور ---------- */
.img-up { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-up img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.img-up label.btn { margin: 0; }
.img-up input[type=file] { display: none; }
.img-up.busy { opacity: .5; pointer-events: none; }
.sub-rows .sr { display: grid; grid-template-columns: 1fr 1fr 1fr 110px 36px; gap: 6px; margin-bottom: 6px; }
.sub-rows .sr input { padding: 8px; }
@media (max-width: 640px) { .sub-rows .sr { grid-template-columns: 1fr 1fr; } }

/* ================= حالة المطعم: مقفول / موقوف ================= */
.closed-banner { margin-top: 12px; background: rgba(0,0,0,.25); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 700; }

/* ================= ثيمات المنيو ================= */
/* داكن */
.theme-dark { --bg: #121110; --surface: #1d1b19; --ink: #f3efe9; --muted: #a59d95; --line: #2f2b28; }
.theme-dark .m-item, .theme-dark .chip, .theme-dark .sheet, .theme-dark .sheet-foot, .theme-dark .card, .theme-dark .opt,
.theme-dark .qty button, .theme-dark .seg button, .theme-dark input, .theme-dark textarea { background: var(--surface); color: var(--ink); border-color: var(--line); }
.theme-dark .chip.on { background: #f3efe9; color: #121110; }
.theme-dark .m-head { background: #1d1b19; border-bottom: 3px solid var(--brand); }
.theme-dark .m-item .im { background: #2a2724; }

/* شبكة: كروت بصور كبيرة، عمودين */
.theme-grid .m-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-grid .m-sec-title { grid-column: 1 / -1; }
.theme-grid .m-item { flex-direction: column-reverse; padding: 0; overflow: hidden; margin: 0; position: relative; gap: 0; }
.theme-grid .m-item .im { width: 100%; height: 140px; border-radius: 0; }
.theme-grid .m-item .tx { padding: 10px 12px 12px; }
.theme-grid .m-item p { -webkit-line-clamp: 2; }
.theme-grid .m-item .plus { position: absolute; top: 104px; inset-inline-end: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
@media (min-width: 700px) { .theme-grid .m-list { grid-template-columns: repeat(3, 1fr); } }

/* أنيق: خط Serif ومساحات واسعة بدون كروت */
.theme-elegant { --bg: #faf7f2; }
.theme-elegant .m-head { background: #faf7f2; color: var(--ink); text-align: center; border-bottom: 1px solid var(--line); }
.theme-elegant .m-head .top { flex-direction: column; gap: 12px; }
.theme-elegant .m-head .rn { flex-direction: column; }
.theme-elegant .m-head h1, .theme-elegant .m-sec-title, .theme-elegant .m-item h3 { font-family: 'Amiri', 'Playfair Display', Georgia, serif; }
.theme-elegant .m-head h1 { font-size: 28px; }
.theme-elegant .m-head .tbl { background: var(--brand); color: #fff; }
.theme-elegant .m-head .langs { border-color: var(--line); }
.theme-elegant .m-head .langs a { color: var(--muted); }
.theme-elegant .m-head .langs a.on { background: var(--brand); color: #fff; }
.theme-elegant .m-svc .btn { background: #fff; color: var(--ink); border-color: var(--line); }
.theme-elegant .closed-banner { background: #fee2e2; color: var(--err); }
.theme-elegant .m-sec-title { text-align: center; font-size: 22px; margin-top: 28px; letter-spacing: .02em; }
.theme-elegant .m-sec-title::after { content: ""; display: block; width: 40px; height: 2px; background: var(--brand); margin: 6px auto 0; }
.theme-elegant .m-item { background: transparent; border: 0; border-bottom: 1px dotted #cfc6bc; border-radius: 0; padding: 14px 0; }
.theme-elegant .m-item .im { width: 72px; height: 72px; border-radius: 50%; }
.theme-elegant .m-item .pr { color: var(--brand); }

/* ================= التقييم بالنجوم ================= */
.stars { display: flex; gap: 6px; justify-content: center; direction: ltr; margin: 10px 0; }
.stars button { background: none; border: 0; font-size: 38px; line-height: 1; cursor: pointer; color: #d6cfc8; padding: 0 2px; }
.stars button.on { color: #f59e0b; }
.star-txt { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }

/* ================= الديليفري: حساب العميل ================= */
.acct-btn { background: rgba(255,255,255,.18); color: inherit; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; max-width: 160px; overflow: hidden; white-space: nowrap; }
.acct-btn img { width: 22px; height: 22px; border-radius: 50%; }
.theme-elegant .acct-btn { border-color: var(--line); color: var(--ink); background: #fff; }
.login-box { background: #faf7f3; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; text-align: center; }
.theme-dark .login-box { background: #26231f; }
.fb-btn { background: #1877f2; border-color: #1877f2; color: #fff; margin-top: 8px; }
.addr { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.addr input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; }
.addr .tx { flex: 1; font-size: 14px; }
.addr .tx small { display: block; color: var(--muted); }
.addr.off { opacity: .5; cursor: not-allowed; }
.my-order { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; }
.my-order .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.my-order .acts { display: flex; gap: 6px; margin-top: 8px; }

/* ================= شاشة الديليفري ================= */
.dl-board { display: grid; grid-template-columns: repeat(5, minmax(250px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 8px; }
.dl-col { background: #efeae4; border-radius: 12px; padding: 8px; min-height: 120px; }
.dl-col h3 { font-size: 14px; margin: 4px 6px 10px; display: flex; justify-content: space-between; }
.dl-col .ticket { margin-bottom: 8px; }
.dl-addr { font-size: 13px; padding: 6px 14px; color: var(--ink); }
.dl-addr a { font-weight: 700; }
.dl-driver { display: flex; gap: 6px; padding: 0 14px 8px; }
.dl-driver select { padding: 6px 8px; font-size: 13px; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 6px; margin-bottom: 6px; }

/* ================= الباقات وطرق الدفع ================= */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.plan { display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; position: relative; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.plan.ro { cursor: default; }
.plan .price { font-size: 20px; font-weight: 800; }
.plan .price small { font-size: 12px; font-weight: 600; color: var(--muted); }
.plan .badge { align-self: flex-start; }
.pay-method { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 8px; }
.pay-method span { font-family: ui-monospace, Consolas, monospace; font-size: 15px; }

/* ================= الموقع العام: الأسعار، الخصوصية، الفوتر ================= */
.top-link { font-weight: 700; color: var(--ink); padding: 6px 8px; }
.public-foot { max-width: 1100px; margin: 40px auto 0; padding: 18px 24px 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.public-foot a { margin-inline-start: 14px; color: var(--muted); font-weight: 600; }
.pricing { max-width: 1100px; margin: 30px auto; padding: 0 24px; text-align: center; }
.pricing h1 { font-size: 34px; margin-bottom: 4px; }
.pricing .card { text-align: start; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; text-align: start; }
.price-card { background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.price-card.pop { border-color: var(--brand); box-shadow: 0 10px 30px color-mix(in srgb, var(--brand) 18%, transparent); }
.price-card h3 { margin: 0; font-size: 20px; }
.price-card .amt { font-size: 30px; font-weight: 800; }
.price-card .amt small { font-size: 13px; color: var(--muted); font-weight: 600; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 6px; flex: 1; }
.price-card li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.feat-list { columns: 2; padding-inline-start: 18px; }
.feat-list li { padding: 4px 0; }
@media (max-width: 640px) { .feat-list { columns: 1; } }
.legal { max-width: 820px; margin: 30px auto; line-height: 1.9; }
.legal h1 { font-size: 28px; }
.legal h3 { margin: 18px 0 4px; font-size: 17px; }

/* ================= معالج تجهيز المطعم ================= */
.setup { margin-bottom: 16px; border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress i { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.setup-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.setup-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.setup-steps li.done { opacity: .6; }
.setup-steps .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.setup-steps li.done .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.setup-steps .tx { flex: 1; display: flex; flex-direction: column; }

/* ================= الترتيب بالسحب ================= */
.drag { cursor: grab; touch-action: none; user-select: none; color: var(--muted); font-weight: 800; padding: 6px 8px; margin-inline-end: 4px; display: inline-block; letter-spacing: -2px; }
.drag:active { cursor: grabbing; }
tr.dragging td { background: color-mix(in srgb, var(--brand) 10%, #fff); }

/* ================= الديليفري: وضع الزحمة، العملاء الجداد، الطيار ================= */
.busy-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 14px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.busy-bar.on { background: #fef3c7; border-color: #f59e0b; }
.busy-bar label { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0; }
.busy-bar select { width: auto; padding: 6px 10px; }
.zone-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.zone-chips .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.zone-chips .chip.on { background: #fff; border-color: var(--ok); color: var(--ok); }
.zone-chips .chip.off { background: #fee2e2; border-color: var(--err); color: var(--err); }
.dl-warn { margin: 6px 14px; padding: 8px 10px; background: #fee2e2; color: #991b1b; border-radius: 8px; font-size: 13px; font-weight: 700; }
.dl-warn a { color: #991b1b; text-decoration: underline; }
.drv { margin-bottom: 12px; border-inline-start: 5px solid var(--warn); }
.drv.on-road { border-inline-start-color: var(--info); }
.drv.done { opacity: .6; border-inline-start-color: var(--ok); }
.drv-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.drv-acts .block { grid-column: 1 / -1; }
.pay-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-pick .plan { align-items: center; padding: 14px; }
.alert.info { background: #dbeafe; color: var(--info); }

/* ================= البراند MeaMenus ================= */
.public-top .logo .mk { width: 30px; height: 30px; display: block; }
.sidebar .brand .mk { width: 26px; height: 26px; display: block; flex: none; }
.side-credit { margin-top: 18px; border-top: 1px solid rgba(255,255,255,.12); padding: 14px 16px; font-size: 11.5px; opacity: .65; line-height: 1.6; }
.side-credit a { color: inherit; text-decoration: underline; }
.public-foot .credit a { margin: 0; color: var(--brand); }
.auth-logo { display: block; height: 40px; width: 176px; max-width: 100%; margin: 0 auto 14px; }
.powered { direction: ltr; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px auto 96px; font-size: 12.5px; color: var(--muted); text-decoration: none; opacity: .85; }
.powered .mk { width: 16px; height: 16px; display: block; }
.powered b { color: var(--ink); }
.theme-dark .powered b { color: #fff; }

/* ================= الديمو في الصفحة الرئيسية ================= */
.demo { max-width: 1100px; margin: 20px auto 40px; padding: 0 24px; text-align: center; }
.demo h2 { font-size: 30px; margin-bottom: 4px; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-top: 18px; text-align: start; }
.demo-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.demo-card .dh { display: flex; gap: 12px; align-items: center; }
.demo-card .dh .ic { font-size: 30px; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 12%, #fff); display: flex; align-items: center; justify-content: center; }
.demo-card h3 { margin: 0; font-size: 19px; }
.demo-body { display: flex; gap: 16px; align-items: flex-start; }
.demo-body .qr { flex: none; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.demo-body .qr img, .demo-body .qr canvas { display: block; width: 150px; height: 150px; }
.demo-body ol { margin: 0; padding-inline-start: 20px; font-size: 14.5px; line-height: 1.8; }
.demo-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
@media (max-width: 560px) { .demo-body { flex-direction: column; align-items: center; } }

/* ================= القايمة الجانبية: مجموعات ================= */
.nav-group { margin: 6px 0 2px; }
.nav-group summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase;
    color: #a8a09a; padding: 8px 12px 4px; display: flex; align-items: center; gap: 6px; user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: "▾"; margin-inline-start: auto; font-size: 11px; transition: transform .15s; }
.nav-group:not([open]) summary::after { transform: rotate(-90deg); }
[dir=rtl] .nav-group:not([open]) summary::after { transform: rotate(90deg); }
.sidebar nav .ni { width: 22px; text-align: center; flex: none; }

/* ================= شاشة المستخدمين: الصلاحيات ================= */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin: 0; }
.perm-group legend { padding: 0 6px; font-weight: 800; }
.perm-group .check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.perm-group .check small { flex-basis: 100%; padding-inline-start: 26px; font-size: 12px; margin-top: -4px; }
.perm-group .check.dis { opacity: .45; }

/* ================= المنيو: شكل المربعات (من غير سكرول طويل) ================= */
.layout-tiles .m-head { padding: 12px 14px 14px; }
.layout-tiles .m-head h1 { font-size: 19px; }
.layout-tiles .m-head .rn img { width: 42px; height: 42px; border-radius: 12px; }
.layout-tiles .m-svc { margin-top: 10px; gap: 6px; }
.layout-tiles .m-svc .btn { padding: 6px 8px; font-size: 13px; }
.layout-tiles .m-nav { padding-top: 10px; }
.layout-tiles #cats { gap: 8px; }
.layout-tiles #cats .chip { display: flex; align-items: center; gap: 7px; padding: 5px 14px 5px 5px; font-size: 14.5px; }
[dir=rtl] .layout-tiles #cats .chip { padding: 5px 5px 5px 14px; }
.layout-tiles #cats .chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: block; }
.layout-tiles .m-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 10px; }
@media (max-width: 340px) { .layout-tiles .m-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) { .layout-tiles .m-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 900px) { .layout-tiles .m-list { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 1100px; } }
.layout-tiles .m-list > .empty { grid-column: 1 / -1; }
.layout-tiles .m-sec-title { display: none; }
.layout-tiles .m-item { flex-direction: column; padding: 0; margin: 0; gap: 0; overflow: hidden; position: relative; border-radius: 14px; }
.layout-tiles .m-item .im, .layout-tiles .m-item .noimg { order: -1; width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 0; display: block; }
.layout-tiles .m-item .noimg { display: flex; align-items: center; justify-content: center; font-size: 34px; background: color-mix(in srgb, var(--brand) 12%, #fff); }
.layout-tiles .m-item .tx { padding: 6px 8px 8px; }
.layout-tiles .m-item h3 { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; margin: 0; }
.layout-tiles .m-item p { display: none; }
.layout-tiles .m-item .pr { margin-top: 2px; font-size: 13px; color: var(--brand); display: inline-block; direction: ltr; }
.layout-tiles .m-item .plus { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; font-size: 19px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.layout-tiles .m-item .qtyb { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--ink); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.theme-dark.layout-tiles .m-item .noimg { background: #2a2622; }
