/* ============================================================
   لوحة التحكم — مطعم و نادي كلية الآداب
   ============================================================ */

.admin-body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(217,165,90,.08), transparent 60%),
    var(--cream);
}

/* ---------- شاشة الدخول ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 34px 28px; text-align: center;
}
.login-logo {
  width: 74px; height: 74px; margin: 0 auto 16px;
  border-radius: 20px; display: grid; place-items: center; font-size: 36px;
  background: #fff; overflow: hidden;
  color: #fff; box-shadow: var(--shadow-md);
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { font-size: 22px; color: var(--brand-800); }
.login-card p { color: var(--muted); font-size: 14px; margin: 4px 0 24px; }

.field { text-align: right; margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 15px; background: var(--cream);
  outline: none; transition: .15s; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--brand-500); background: #fff;
  box-shadow: 0 0 0 3px rgba(143,63,180,.12);
}
.field textarea { resize: vertical; min-height: 70px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border: 0; border-radius: 12px;
  font-weight: 700; font-size: 15px; transition: .18s; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--brand-600), var(--brand-700)); color: #fff; box-shadow: 0 8px 20px rgba(98,22,130,.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(98,22,130,.36); }
.btn-block { width: 100%; }
.back-to-menu { margin-top: 10px; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand-500); color: var(--brand-700); }
.btn-danger { background: #fdecec; color: #c0392b; border: 1px solid #f6cfcf; }
.btn-danger:hover { background: #fbdcdc; }
.btn-warn { background: #fff5e6; color: #b9791b; border: 1px solid #f4e2c2; }
.btn-warn:hover { background: #fdecc8; }
.btn-success { background: linear-gradient(135deg, var(--brand-600), var(--brand-700)); color: #fff; box-shadow: 0 6px 16px rgba(98,22,130,.26); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(98,22,130,.34); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-gold { background: var(--gold-500); color: var(--brand-900); }
.btn-gold:hover { background: var(--gold-400); }

.login-error {
  background: #fdecec; color: #c0392b; border: 1px solid #f6cfcf;
  border-radius: 10px; padding: 10px; font-size: 14px; margin-bottom: 14px;
  display: none;
}
.login-error.show { display: block; }
.login-hint { font-size: 12px; color: var(--muted); margin-top: 16px; }
.remember-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  margin: 4px 0 16px; cursor: pointer; user-select: none;
}
.remember-row input { width: 17px; height: 17px; accent-color: var(--brand-600); cursor: pointer; }

/* ---------- التخطيط بعد الدخول ---------- */
.admin-shell { display: none; }
.admin-shell.show { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-700));
  color: #fff; border-bottom: 3px solid var(--gold-500);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.topbar .logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; overflow: hidden; display: grid; place-items: center; font-size: 22px; }
.topbar .logo img { width: 100%; height: 100%; object-fit: cover; }
.topbar h1 { font-size: 18px; font-weight: 800; }
.topbar .sub { font-size: 12px; color: var(--gold-glow); }
.topbar-actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.tb-btn {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.tb-btn:hover { background: rgba(255,255,255,.26); }
.tb-btn.save { background: var(--gold-500); color: var(--brand-900); border-color: transparent; }
.tb-btn.save:hover { background: var(--gold-400); }
.tb-btn.logout-btn { background: rgba(192,57,43,.92); border-color: transparent; cursor: pointer; font-family: inherit; }
.tb-btn.logout-btn:hover { background: #b23127; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }

/* تبويبات */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-weight: 700; color: var(--muted); font-size: 14px; transition: .15s;
}
.tab.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

.panel { display: none; }
.panel.active { display: block; }

/* شريط أدوات القسم */
.panel-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 20px; color: var(--brand-800); }
.panel-head .spacer { flex: 1; }

/* بطاقة فئة */
.cat-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden;
}
.cat-card-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(135deg, #f8f1fb, #f7ecdc); border-bottom: 1px solid var(--line);
}
.cat-card-head .emoji {
  width: 42px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 22px;
}
.cat-card-head .info { flex: 1; min-width: 0; }
.cat-card-head .info .nm { font-weight: 800; font-size: 16px; color: var(--brand-800); }
.cat-card-head .info .nt { font-size: 12px; color: var(--muted); }
.cat-card-head .acts { display: flex; gap: 6px; flex-wrap: wrap; }

.cat-items { padding: 8px; }
.row-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 10px; transition: .12s;
}
.row-item:hover { background: var(--cream); }
.row-item + .row-item { border-top: 1px solid #f1e7d7; }
.row-item .grab { color: #c9b99f; cursor: grab; font-size: 18px; }
.row-item .ri-body { flex: 1; min-width: 0; }
.row-item .ri-name { font-weight: 700; font-size: 15px; }
.row-item .ri-name.off { text-decoration: line-through; color: var(--muted); }
.row-item .ri-desc { font-size: 12px; color: var(--muted); }
.row-item .ri-price {
  font-weight: 800; color: var(--brand-700); font-size: 15px;
  background: #eafbef; border: 1px solid #cfeed7; border-radius: 8px; padding: 4px 10px; white-space: nowrap;
}
.row-item .ri-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; font-size: 15px; transition: .15s;
}
.icon-btn:hover { border-color: var(--brand-500); background: var(--cream); }
.icon-btn.del:hover { border-color: #e88; background: #fdecec; }
/* زر أيقونة بنص بدل الإيموجي (حذف / تعديل / عرض) */
.icon-btn.txt { width: auto; padding: 0 14px; font-size: 13px; font-weight: 800; color: var(--ink); }
.icon-btn.txt.del { color: #c0392b; }

.add-item-row { padding: 8px 12px; }

.mini-empty { text-align: center; color: var(--muted); padding: 20px; font-size: 14px; }

/* مفتاح تبديل */
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: #d5c7b0; border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch .track::before {
  content: ""; position: absolute; height: 20px; width: 20px; right: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .track { background: var(--brand-500); }
.switch input:checked + .track::before { transform: translateX(-18px); }

/* رفع الصور */
.img-upload { display: flex; gap: 14px; align-items: center; }
.img-preview {
  width: 92px; height: 92px; flex: none; border-radius: 14px;
  border: 1px dashed var(--line); background: var(--cream);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .ph { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.4; }
.img-preview.loading::after {
  content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.7);
  background-image: radial-gradient(circle, transparent 60%, transparent);
}
.img-preview.loading .spin {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid #d9c9e4; border-top-color: var(--brand-600); animation: spin 1s linear infinite;
}
.img-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.img-actions label.btn { cursor: pointer; }
.img-hint { font-size: 11px; color: var(--muted); }

/* صورة مصغّرة في صف الصنف */
.ri-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--cream);
}
.ri-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- مودال ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(62,15,84,.45); backdrop-filter: blur(3px);
  display: none; place-items: center; z-index: 60; padding: 18px;
}
.modal-overlay.show { display: grid; }
.modal {
  width: 100%; max-width: 460px; background: #fff; border-radius: 18px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  padding: 16px 20px; background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: #fff; display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 17px; }
.modal-head .x { background: rgba(255,255,255,.2); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; font-size: 18px; cursor: pointer; }
.modal-body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* إشعار (توست) */
.toast {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 90;
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 12px;
  font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg);
  transform: translateY(120px); opacity: 0; transition: .3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok { background: #1b8a3f; }
.toast.err { background: #c0392b; }
.toast.warn { background: #b9821b; }

/* لافتة حالة */
.status-banner {
  display: flex; align-items: center; gap: 8px;
  background: #fff8e6; border: 1px solid #f2e2b8; color: #8a6d1b;
  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 18px;
}
.status-banner.ok { background: #eafbef; border-color: #cfeed7; color: var(--brand-700); }

/* شارة عدد الطلبات الجديدة على التبويب */
.tab-badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 5px; margin-inline-start: 4px; border-radius: 999px;
  background: #e23b3b; color: #fff; font-size: 12px; font-weight: 800;
  animation: badgePulse 1.4s ease-in-out infinite;
}
@keyframes badgePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.sound-toggle { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }

/* ---------- فلاتر الطلبات ---------- */
.order-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.ofilter {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; transition: .15s;
}
.ofilter:hover { border-color: var(--brand-500); }
.ofilter.active { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* ---------- بطاقة الطلب ---------- */
.order-card {
  background: var(--paper); border: 1px solid var(--line);
  border-inline-start: 5px solid var(--brand-500);
  border-radius: 16px; box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 14px;
}
.order-card.st-new { border-inline-start-color: #e23b3b; background: #fffaf9; }
.order-card.st-confirmed { border-inline-start-color: #2f7bd6; }
.order-card.st-preparing { border-inline-start-color: #d99a1b; }
.order-card.st-ready { border-inline-start-color: #16a34a; }
.order-card.st-delivered { border-inline-start-color: #6b7280; opacity: .8; }
.order-card.st-cancelled { border-inline-start-color: #9ca3af; opacity: .65; }

.oc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.oc-num { font-weight: 800; font-size: 15px; color: var(--brand-800); direction: ltr; }
.oc-time { font-size: 12px; color: var(--muted); }
.oc-badge {
  margin-inline-start: auto; font-size: 12px; font-weight: 800; color: #fff;
  padding: 3px 12px; border-radius: 999px; background: var(--brand-500);
}
.oc-badge.st-new { background: #e23b3b; }
.oc-badge.st-confirmed { background: #2f7bd6; }
.oc-badge.st-preparing { background: #d99a1b; }
.oc-badge.st-ready { background: #16a34a; }
.oc-badge.st-delivered { background: #6b7280; }
.oc-badge.st-cancelled { background: #9ca3af; }

.oc-cust { font-size: 14px; color: var(--ink); display: grid; gap: 3px; margin-bottom: 10px; }
.oc-cust a { color: var(--brand-700); font-weight: 700; }
.oc-items {
  background: var(--cream); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 10px;
}
.oc-item { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; }
.oc-item + .oc-item { border-top: 1px dashed #e8dbc4; }
.oc-total { text-align: end; font-size: 15px; margin-bottom: 12px; }
.oc-total b { color: var(--brand-700); font-size: 17px; }

.oc-disc { text-align: end; font-size: 13px; font-weight: 700; color: #e5484d; margin-bottom: 6px; }

/* ======= تبويب الخصومات ======= */
.disc-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px; background: #f8f1fb; border: 1px solid #e6dbef; border-radius: 12px; margin-bottom: 16px;
}
.disc-toggle-label { font-size: 15px; font-weight: 800; color: var(--brand-800); }
.disc-toggle-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
#panel-discounts .field { margin-bottom: 14px; }
#panel-discounts .field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--ink); }
#panel-discounts input, #panel-discounts select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px;
  font-family: inherit; font-size: 15px; background: #fff; color: var(--ink); outline: none; transition: .15s;
}
#panel-discounts input:focus, #panel-discounts select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(143,63,180,.12); }
.disc-preview { margin-top: 6px; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.disc-preview.on { background: #eafbef; border: 1px solid #cfeed7; color: var(--brand-800); }
.disc-preview.off { background: #f3f4f6; border: 1px solid #e5e7eb; color: var(--muted); }

/* بطاقات الخصومات المتعددة */
.disc-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
  border-inline-start: 5px solid #d9c9e4; transition: .18s;
}
.disc-card.on { border-inline-start-color: var(--brand-500); background: #fffdff; }
.disc-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.disc-card-title { font-size: 15px; font-weight: 800; color: var(--brand-800); flex: 1; }
.disc-card .dc-del { margin-inline-start: 4px; }
.disc-card-body .field { margin-bottom: 12px; }
.disc-card-body .field:last-child { margin-bottom: 0; }

/* قائمة الزبائن المميزين */
.loyal-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  border-inline-start: 5px solid #d9c9e4; transition: .18s;
}
.loyal-row.on { border-inline-start-color: var(--brand-500); background: #fffdff; }
.loyal-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.loyal-tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: var(--brand-700);
  background: #eafbef; border: 1px solid #cfeed7; border-radius: 999px; padding: 1px 8px;
}
.loyal-ctrl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-inline-start: auto; }
.loyal-pct { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
#panel-discounts .loyal-pct .lc-pct { width: 72px; text-align: center; padding: 8px; font-weight: 800; }
.loyal-ctrl .lc-wa { white-space: nowrap; }

/* ======= طباعة تذكرة الطلب — طابعة حرارية 80مم (XPrinter) ======= */
#printArea { display: none; }
/* قاعدة @page (مقاس 80مم) تُحقن من admin.js وقت طباعة التذكرة فقط،
   حتى لا تتأثر الطباعة العادية للوحة (Ctrl+P) بمقاس الورق الحراري */
@media print {
  /* عند وضع الطباعة نُخفي كل الصفحة ونُظهر التذكرة فقط */
  body.receipt-mode > :not(#printArea) { display: none !important; }
  body.receipt-mode #printArea { display: block !important; }
}
#printArea {
  direction: rtl; width: 72mm; padding: 3mm 2mm 5mm;
  background: #fff; color: #000;
  font-family: "Cairo", "Segoe UI", sans-serif; font-size: 12.5px; line-height: 1.5;
  text-align: center;
}
/* ترويسة الفاتورة */
#printArea .rc-name { font-size: 29px; font-weight: 900; line-height: 1.15; letter-spacing: -.3px; }
#printArea .rc-tag { font-size: 16px; font-weight: 800; margin-top: .8mm; }
#printArea .rc-addr { font-size: 11px; font-weight: 700; margin-top: 1mm; }
/* الرقم التسلسلي — يبدأ من ١ ويزيد مع كل فاتورة جديدة */
#printArea .rc-serial { font-size: 34px; font-weight: 900; line-height: 1.1; margin: 2mm 0 2.5mm; }
/* أسطر المعلومات: العمود الأول يمين والثاني يسار */
#printArea .rc-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; font-weight: 700; margin-bottom: .8mm; }
#printArea .rc-meta span:last-child { text-align: left; }
#printArea .rc-line { text-align: right; font-size: 12px; font-weight: 700; margin-bottom: .8mm; }
/* جدول المواد */
#printArea .rc-table {
  width: 100%; border-collapse: collapse; margin-top: 2mm;
  font-size: 12.5px; font-weight: 700; table-layout: fixed;
}
#printArea .rc-table th,
#printArea .rc-table td { border: 1px solid #000; padding: .8mm 1mm; text-align: center; }
#printArea .rc-table th { font-weight: 800; }
#printArea .rc-table .rc-t-name { width: 40%; text-align: right; word-wrap: break-word; }
#printArea .rc-table th:nth-child(2), #printArea .rc-table td:nth-child(2) { width: 13%; }
#printArea .rc-table th:nth-child(3), #printArea .rc-table td:nth-child(3) { width: 22%; }
/* أسطر المجاميع — امتداد للجدول بنفس الإطار */
#printArea .rc-sum {
  font-size: 15px; font-weight: 900;
  border: 1px solid #000; border-top: 0; padding: .8mm 1mm;
}
/* أرقام الهواتف والسطر الأخير */
#printArea .rc-phones { font-size: 14px; font-weight: 800; margin-top: 3mm; }
#printArea .rc-foot { font-size: 10px; font-weight: 700; margin-top: 2.5mm; }

.oc-actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.oc-actions-row .oc-advance { flex: 1; min-width: 150px; font-weight: 800; }
.oc-actions-row .oc-cancel { font-weight: 800; }
.oc-final {
  flex: 1; min-width: 150px; text-align: center; font-weight: 800; font-size: 14px;
  padding: 10px; border-radius: 10px;
}
.oc-final.done { color: var(--brand-700); background: #eafbef; border: 1px solid #cfeed7; }
.oc-final.cancelled { color: #c0392b; background: #fdecec; border: 1px solid #f6cfcf; }
.oc-danger { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.oc-danger .oc-del { font-weight: 800; }

@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
  .row-item { flex-wrap: wrap; }
  .row-item .ri-body { flex-basis: 60%; }
}

/* ============================================================
   زر المتجر + بحث المنيو + التقارير
   ============================================================ */
.tb-btn.store-toggle { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.32); font-weight: 800; }
.tb-btn.store-toggle:hover { background: rgba(255,255,255,.3); }
.tb-btn.store-toggle.closed { background: #c0392b; border-color: #c0392b; }
.tb-btn.store-toggle.closed:hover { background: #b23127; }

.menu-search {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; margin-bottom: 12px;
}
.menu-search input { flex: 1; border: 0; outline: none; font-family: inherit; font-size: 15px; background: transparent; color: var(--ink); }
.menu-search .ms-ico { color: var(--brand-600); }
.menu-search .ms-clear { border: 0; background: var(--cream); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; color: var(--muted); font-weight: 800; }
.reorder-hint {
  font-size: 12px; color: var(--muted);
  background: #f8f1fb; border: 1px solid #e3d5ec; border-radius: 10px;
  padding: 8px 12px; margin-bottom: 14px; line-height: 1.6;
}

.report-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rstat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm); padding: 16px 12px; text-align: center;
}
.rstat.green { background: linear-gradient(135deg, #eafaf0, #e2f6ea); border-color: #c9ead4; }
.rstat .rs-ico { font-size: 24px; }
.rstat .rs-val { font-size: 22px; font-weight: 900; color: var(--brand-800); margin-top: 4px; line-height: 1.15; }
.rstat .rs-lbl { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.report-sub { margin: 24px 0 12px; font-size: 16px; color: var(--brand-800); }
.report-status { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.rstatus-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.rstatus-row + .rstatus-row { border-top: 1px solid var(--line); }
.rstatus-row .rr-count { color: var(--muted); font-size: 13px; }
.rstatus-row b { margin-inline-start: auto; color: var(--brand-700); font-size: 15px; white-space: nowrap; }

/* مطابقة الصندوق */
.rstatus-row.cash-total { background: #f8f1fb; font-weight: 800; }
.rstatus-row.cash-total b { font-size: 17px; color: var(--brand-800); }
.rstatus-row.cash-warn { background: #fff8ec; }
.rstatus-row.cash-warn b { color: #8a5a00; }
.cash-check { margin-top: 12px; }
.cash-check label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); max-width: 320px; }
.cash-check input {
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 16px; font-weight: 800; background: #fff; color: var(--ink); outline: none;
}
.cash-check input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(143,63,180,.12); }
.cash-diff { margin-top: 12px; padding: 13px 15px; border-radius: 14px; font-size: 13.5px; line-height: 1.75; font-weight: 600; }
.cash-diff.ok { background: #eafaf0; border: 1px solid #c9ead4; color: var(--brand-800); }
.cash-diff.more { background: #fff7e6; border: 1px solid #f5d99a; color: #8a5a00; }
.cash-diff.less { background: #fdeeee; border: 1px solid #f3c9c9; color: #9b2c2c; }
.cash-diff .cd-head { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.cash-diff .cd-why { font-weight: 800; margin-top: 4px; }
.cash-diff ul { margin: 4px 18px 0; }
.cash-diff li { margin-bottom: 3px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* حالة الحفظ التلقائي */
.save-status {
  font-size: 12px; font-weight: 800; padding: 7px 13px; border-radius: 999px;
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.26);
  display: inline-flex; align-items: center; gap: 5px; transition: background .2s; white-space: nowrap;
}
.save-status.saving { background: #d99a1b; border-color: transparent; }
.save-status.local { background: #b9821b; border-color: transparent; }
.save-status.failed { background: #c0392b; border-color: transparent; font-weight: 800; }

/* فلتر الفترة المخصّصة في التقارير */
.report-range {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 20px; padding: 12px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.report-range label { font-size: 13px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.report-range input[type="date"] {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  font-family: inherit; font-size: 14px; background: var(--cream); color: var(--ink);
}
.report-range input[type="date"]:focus { outline: none; border-color: var(--brand-500); }

/* لمسات احترافية + حركات ناعمة */
.panel.active { animation: panelIn .38s cubic-bezier(.2,.7,.2,1); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.tab { position: relative; transition: transform .15s, background .15s, color .15s; }
.tab:not(.active):hover { transform: translateY(-1px); border-color: var(--brand-500); color: var(--brand-700); }
.tab.active { animation: tabPop .3s cubic-bezier(.2,.8,.2,1.3); }
@keyframes tabPop { 0% { transform: scale(.94); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
.rstat { transition: transform .2s, box-shadow .2s; }
.rstat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-card, .order-card { transition: box-shadow .2s, transform .2s, border-color .2s; }
.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.topbar { box-shadow: 0 6px 20px rgba(98,22,130,.18); }

@media (prefers-reduced-motion: reduce) {
  .panel.active, .tab.active { animation: none; }
}

/* ============================================================
   الزبائن
   ============================================================ */
.cust-count { font-size: 13px; font-weight: 800; color: var(--brand-700); background: #eafaf0; border: 1px solid #c9ead4; border-radius: 999px; padding: 6px 14px; }
.cust-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow-sm); margin-bottom: 10px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cust-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #e3d5ec; }
.cust-avatar {
  width: 46px; height: 46px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
}
.cust-avatar.big { width: 56px; height: 56px; font-size: 24px; }
.cust-info { flex: 1; min-width: 0; }
.cust-name { font-weight: 800; font-size: 15px; }
.cust-phone { font-size: 13px; color: var(--muted); }
.cust-nums { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cust-stat {
  font-size: 12px; font-weight: 800; white-space: nowrap;
  background: var(--cream); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 4px 10px;
}
.cust-stat.green { background: #eafbef; border-color: #cfeed7; color: var(--brand-700); }
.cust-stat.money { background: #eef5ff; border-color: #d5e4fb; color: #2f6fd0; }

.cust-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cust-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cust-sub { font-size: 15px; color: var(--brand-800); margin-bottom: 10px; }
.cust-orders { display: grid; gap: 10px; }
.cust-order { background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.co-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.co-top b { direction: ltr; }
.co-date { margin-inline-start: auto; font-size: 12px; color: var(--muted); }
.co-items { font-size: 13px; color: var(--ink); margin-top: 6px; line-height: 1.5; }
.co-driver { font-size: 12px; color: var(--muted); margin-top: 4px; }   /* سطر رقم الطاولة في سجل الزبون */
.co-money { text-align: end; margin-top: 6px; color: var(--brand-700); font-size: 15px; }

.cust-addr { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-stat.red { background: #fdecec; border-color: #f6cfcf; color: #c0392b; }
.cust-stat.amber { background: #fff5e6; border-color: #f4e2c2; color: #b9791b; }
.cust-addr-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: #f8f1fb; border: 1px solid #e3d5ec; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 14px; line-height: 1.6;
}
.cust-addr-box .ca-ico { font-size: 20px; }
.cust-addr-box b { color: var(--brand-800); }
.cust-since { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.cust-since b { color: var(--ink); }
.cust-contact {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center;
  font-size: 18px; border: 1px solid var(--line); transition: transform .15s;
}
.cust-contact:hover { transform: translateY(-2px); }
.cust-contact.call { background: #eef5ff; border-color: #d5e4fb; }
.cust-contact.wa { background: #e7f9ee; border-color: #bfe9cf; }

@media (max-width: 560px) {
  .cust-row { flex-wrap: wrap; }
  .cust-nums { width: 100%; justify-content: flex-start; }
  .cust-addr { white-space: normal; }
}
