/* ============================================================
   لوحة التحكم — ريزوفا
   ============================================================ */

/* ============================================================
   ثيم ريزوفا — أسود فاخر · ذهبي · أخضر زمردي
   الألوان من دليل هوية REZOVA:
   #121212 أسود · #D4AF37 ذهبي · #0F5C4D زمردي · #F7F4ED عاجي
   ============================================================ */

:root {
  --brand-900: #06110D;   /* أسود مخضرّ — أعمق درجة */
  --brand-800: #0C3A2D;   /* زمردي داكن — لون الهيدر */
  --brand-700: #12513E;   /* زمردي */
  --brand-600: #17654E;   /* زمردي فاتح — الأزرار */
  --brand-500: #2E8F70;   /* زمردي ناعم */
  --gold-500: #D4AF37;    /* ذهبي ريزوفا — لون التمييز */
  --gold-400: #E8C86A;    /* ذهبي فاتح */
  --gold-glow: #F5E3A8;   /* توهّج ذهبي */

  --cream: #0A0A0B;       /* خلفية الصفحة (كانت فاتحة — صارت سوداء) */
  --paper: #141518;       /* خلفية البطاقات */
  --paper-2: #1C1D21;     /* طبقة أعلى قليلاً (حقول · أقسام داخلية) */
  --ink: #F7F4ED;         /* لون النص */
  --muted: #9C9486;       /* نص ثانوي */
  --line: rgba(212, 175, 55, .18);  /* حدود ذهبية خافتة */
  --line-2: rgba(255, 255, 255, .07);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, .55);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .65);
  --glow-gold: 0 0 24px rgba(212, 175, 55, .28);

  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 900px;

  --font: "Cairo", "Tajawal", "Segoe UI", system-ui, sans-serif;
  --font-display: "Cinzel", "El Messiri", var(--font);
}

.admin-body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(212,175,55,.10), transparent 60%),
    var(--cream);
}

/* ---------- شاشة الدخول ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 620px at 50% -12%, rgba(15,92,77,.38), transparent 62%),
    radial-gradient(700px 500px at 50% 112%, rgba(212,175,55,.10), transparent 60%),
    var(--brand-900);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--paper); border: 1px solid rgba(212,175,55,.38);
  border-radius: 22px; box-shadow: var(--shadow-lg), var(--glow-gold);
  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: linear-gradient(135deg, var(--gold-400), var(--gold-500)); overflow: hidden;
  color: var(--brand-900); box-shadow: var(--shadow-md), var(--glow-gold);
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { font-size: 22px; color: var(--gold-500); }
.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(--paper-2);
  outline: none; transition: .15s; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold-500); background: var(--paper-2);
  box-shadow: 0 0 0 3px rgba(212,175,55,.18);
}
.field textarea { resize: vertical; min-height: 70px; }
select option { background: var(--paper-2); color: var(--ink); }

.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(--gold-400), var(--gold-500)); color: var(--brand-900); box-shadow: 0 8px 20px rgba(212,175,55,.26); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(212,175,55,.38); }
.btn-block { width: 100%; }
.back-to-menu { margin-top: 10px; }
.btn-ghost { background: var(--paper-2); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold-500); color: var(--gold-400); }
.btn-danger { background: rgba(226,59,59,.14); color: #FF9A93; border: 1px solid rgba(226,59,59,.38); }
.btn-danger:hover { background: rgba(226,59,59,.24); }
.btn-warn { background: rgba(217,154,27,.14); color: #F0C674; border: 1px solid rgba(217,154,27,.38); }
.btn-warn:hover { background: rgba(217,154,27,.24); }
.btn-success { background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,.55); }
.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: rgba(226,59,59,.14); color: #FF9A93; border: 1px solid rgba(226,59,59,.38);
  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(--gold-500); 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: var(--brand-900); 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: var(--paper); 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(--gold-500); }
.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, #17241F, #1C1D21); border-bottom: 1px solid var(--line);
}
.cat-card-head .emoji {
  width: 42px; height: 42px; border-radius: 12px; background: var(--brand-900); 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(--gold-400); }
.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: rgba(212,175,55,.07); }
.row-item + .row-item { border-top: 1px solid var(--line-2); }
.row-item .grab { color: var(--muted); 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: #6FE3B4; font-size: 15px;
  background: rgba(46,143,112,.15); border: 1px solid rgba(46,143,112,.38); 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: var(--paper-2); display: grid; place-items: center; font-size: 15px; transition: .15s;
}
.icon-btn:hover { border-color: var(--gold-500); background: rgba(212,175,55,.10); }
.icon-btn.del:hover { border-color: rgba(226,59,59,.55); background: rgba(226,59,59,.16); }
/* زر أيقونة بنص بدل الإيموجي (حذف / تعديل / عرض) */
.icon-btn.txt { width: auto; padding: 0 14px; font-size: 13px; font-weight: 800; color: var(--ink); }
.icon-btn.txt.del { color: #FF9A93; }

.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: rgba(255,255,255,.16); 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(--paper-2);
  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(0,0,0,.6);
  background-image: radial-gradient(circle, transparent 60%, transparent);
}
.img-preview.loading .spin {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.14); border-top-color: var(--gold-500); 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(--paper-2);
}
.ri-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- مودال ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.72); 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: var(--paper); border-radius: 18px;
  box-shadow: var(--shadow-lg), var(--glow-gold); 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(--brand-700); 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: rgba(217,154,27,.12); border: 1px solid rgba(217,154,27,.32); color: #F0C674;
  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 18px;
}
.status-banner.ok { background: rgba(46,143,112,.14); border-color: rgba(46,143,112,.38); color: #6FE3B4; }

/* شارة عدد الطلبات الجديدة على التبويب */
.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: var(--paper); 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(--gold-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: #1B1315; }
.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(--gold-400); 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: #b32a2a; }
.oc-badge.st-confirmed { background: #2560a8; }
.oc-badge.st-preparing { background: #96690c; }
.oc-badge.st-ready { background: #0f7333; }
.oc-badge.st-delivered { background: #525a66; }
.oc-badge.st-cancelled { background: #5f6773; }

.oc-cust { font-size: 14px; color: var(--ink); display: grid; gap: 3px; margin-bottom: 10px; }
.oc-cust a { color: var(--gold-400); font-weight: 700; }
.oc-items {
  background: var(--paper-2); 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 var(--line-2); }
.oc-total { text-align: end; font-size: 15px; margin-bottom: 12px; }
.oc-total b { color: var(--gold-400); font-size: 17px; }

/* تأمين الصواني (لوحة التحكم + بوابة الدليفري) */
.oc-tray {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: rgba(212,175,55,.09); border: 1px solid rgba(212,175,55,.24); border-radius: 10px;
  padding: 8px 11px; margin-bottom: 12px; font-size: 12.5px; font-weight: 700; color: var(--gold-400);
}
.oc-tray.returned { background: rgba(46,143,112,.14); border-color: rgba(46,143,112,.38); }
.oc-tray .tr-wait { color: #F0C674; }
.oc-tray .tr-done { color: #6FE3B4; }
.oc-collect b { color: var(--gold-400); font-size: 14px; }
.oc-tray-note { margin-top: 5px; font-size: 11.5px; font-weight: 700; color: #F0C674; }
.da-btn.tray-return { background: rgba(217,154,27,.14); color: #F0C674; border: 1px solid rgba(217,154,27,.38); }
.da-btn.tray-return:hover { background: rgba(217,154,27,.24); }
.da-btn.tray-return:disabled { opacity: .7; }
.da-done-tag.tray { background: rgba(212,175,55,.12); color: var(--gold-400); }
.oc-disc { text-align: end; font-size: 13px; font-weight: 700; color: #FF8A8F; margin-bottom: 6px; }

/* ======= تبويب الخصومات ======= */
.disc-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px; background: var(--paper); border: 1px solid rgba(212,175,55,.28); border-radius: 12px; margin-bottom: 16px;
}
.disc-toggle-label { font-size: 15px; font-weight: 800; color: var(--gold-400); }
.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: var(--paper-2); color: var(--ink); outline: none; transition: .15s;
}
#panel-discounts input:focus, #panel-discounts select:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.disc-preview { margin-top: 6px; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; }
.disc-preview.on { background: rgba(46,143,112,.14); border: 1px solid rgba(46,143,112,.38); color: #6FE3B4; }
.disc-preview.off { background: rgba(255,255,255,.05); border: 1px solid var(--line-2); color: var(--muted); }

/* بطاقات الخصومات المتعددة */
.disc-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
  border-inline-start: 5px solid rgba(255,255,255,.14); transition: .18s;
}
.disc-card.on { border-inline-start-color: var(--brand-500); background: var(--paper-2); }
.disc-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.disc-card-title { font-size: 15px; font-weight: 800; color: var(--gold-400); 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: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
  border-inline-start: 5px solid rgba(255,255,255,.14); transition: .18s;
}
.loyal-row.on { border-inline-start-color: var(--brand-500); background: var(--paper-2); }
.loyal-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.loyal-tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: #6FE3B4;
  background: rgba(46,143,112,.15); border: 1px solid rgba(46,143,112,.38); 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; }

/* ======= فاتورة الطابعة الحرارية =======
   تنسيقاتها كلها في receipt.css ويُحمَّل داخل إطار مستقل وقت الطباعة
   (انظر printOrder في admin.js) — فلا يبقى منها شيء في هذا الملف. */

/* أجور التوصيل + المطلوب من الزبون في بطاقة الطلب */
.oc-delivery { text-align: end; font-size: 13px; font-weight: 700; color: #6FE3B4; margin-bottom: 4px; }
.oc-grand {
  text-align: end; font-size: 14px; font-weight: 800; color: var(--gold-400);
  background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.26); border-radius: 10px; padding: 8px 12px; margin-top: 6px;
}
.oc-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.oc-controls label { flex: 1; min-width: 140px; font-size: 12px; font-weight: 700; color: var(--muted); display: grid; gap: 4px; }
.oc-controls select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 700; background: var(--paper-2); color: var(--ink);
}
.oc-controls select:focus { outline: none; border-color: var(--gold-500); }
.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: #6FE3B4; background: rgba(46,143,112,.15); border: 1px solid rgba(46,143,112,.38); }
.oc-final.cancelled { color: #FF9A93; background: rgba(226,59,59,.15); border: 1px solid rgba(226,59,59,.38); }
.oc-final.wait { color: #F0C674; background: rgba(217,154,27,.15); border: 1px solid rgba(217,154,27,.38); }
.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; }

/* ---------- صف الدليفري ---------- */
.driver-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow-sm); margin-bottom: 10px;
}
.dr-avatar { width: 44px; height: 44px; flex: none; border-radius: 12px; background: rgba(46,143,112,.16); display: grid; place-items: center; font-size: 22px; }
.dr-info { flex: 1; min-width: 120px; }
.dr-name { font-weight: 800; font-size: 15px; }
.dr-phone { font-size: 13px; color: var(--muted); }
.dr-pass { display: grid; gap: 3px; font-size: 11px; font-weight: 800; color: var(--muted); }
.dr-pass input {
  width: 140px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--paper-2); direction: ltr;
}
.dr-pass input:focus { outline: none; border-color: var(--gold-500); }
.dr-stat {
  font-size: 12px; font-weight: 700; color: #6FE3B4;
  background: rgba(46,143,112,.15); border: 1px solid rgba(46,143,112,.38); border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}

/* ---------- بوابة الدليفري ---------- */
.driver-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.dstat {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm); padding: 16px 10px; text-align: center;
}
.dstat .ds-num { font-size: 30px; font-weight: 900; color: var(--gold-500); line-height: 1; }
.dstat .ds-lbl { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 6px; }

.oc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.da-btn {
  flex: 1; min-width: 120px; text-align: center;
  padding: 12px; border: 0; border-radius: 12px; font-family: inherit;
  font-weight: 800; font-size: 14px; transition: .15s; cursor: pointer;
}
.da-btn.call { background: rgba(47,111,208,.16); color: #86B4F5; border: 1px solid rgba(47,111,208,.38); }
.da-btn.map { background: rgba(217,154,27,.15); color: #F0C674; border: 1px solid rgba(217,154,27,.38); }
.da-btn.wa { background: rgba(18,140,74,.16); color: #4ADE80; border: 1px solid rgba(18,140,74,.40); }
.da-btn.wa:hover { background: rgba(18,140,74,.26); }
.da-btn.done { background: linear-gradient(135deg, var(--brand-600), var(--brand-700)); color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.da-btn.done:hover { transform: translateY(-2px); }
.da-btn.done:disabled { opacity: .7; }
.da-done-tag { flex: 1; text-align: center; padding: 12px; color: #6FE3B4; font-weight: 800; background: rgba(46,143,112,.15); border-radius: 12px; }

@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
  .row-item { flex-wrap: wrap; }
  .row-item .ri-body { flex-basis: 60%; }
  .oc-controls label { min-width: 100%; }
  .dr-stat { display: none; }
  .da-btn { min-width: 100%; }
}

/* ============================================================
   زر المتجر + بحث المنيو + التقارير
   ============================================================ */
.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: var(--paper); 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(--gold-500); }
.menu-search .ms-clear { border: 0; background: rgba(255,255,255,.07); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; color: var(--muted); font-weight: 800; }
.reorder-hint {
  font-size: 12px; color: var(--muted);
  background: rgba(212,175,55,.07); border: 1px solid rgba(212,175,55,.20); 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, #16302A, #12241F); border-color: rgba(46,143,112,.38); }
.rstat .rs-ico { font-size: 24px; }
.rstat .rs-val { font-size: 22px; font-weight: 900; color: var(--gold-500); 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(--gold-500); }
.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(--gold-400); font-size: 15px; white-space: nowrap; }
.dr-stat.money { background: rgba(47,111,208,.16); border-color: rgba(47,111,208,.38); color: #86B4F5; }

/* مطابقة الصندوق */
.rstatus-row.cash-total { background: rgba(212,175,55,.10); font-weight: 800; }
.rstatus-row.cash-total b { font-size: 17px; color: var(--gold-500); }
.rstatus-row.cash-warn { background: rgba(217,154,27,.12); }
.rstatus-row.cash-warn b { color: #F0C674; }
.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: var(--paper-2); color: var(--ink); outline: none;
}
.cash-check input:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.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: rgba(46,143,112,.14); border: 1px solid rgba(46,143,112,.38); color: #6FE3B4; }
.cash-diff.more { background: rgba(217,154,27,.13); border: 1px solid rgba(217,154,27,.36); color: #F0C674; }
.cash-diff.less { background: rgba(226,59,59,.13); border: 1px solid rgba(226,59,59,.36); color: #FF9A93; }
.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(--paper-2); color: var(--ink);
}
.report-range input[type="date"]:focus { outline: none; border-color: var(--gold-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(--gold-500); color: var(--gold-400); }
.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, .driver-row { transition: box-shadow .2s, transform .2s, border-color .2s; }
.order-card:hover, .driver-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.topbar { box-shadow: 0 6px 24px rgba(0,0,0,.55); }

@media (prefers-reduced-motion: reduce) {
  .panel.active, .tab.active { animation: none; }
}

/* ============================================================
   الزبائن
   ============================================================ */
.cust-count { font-size: 13px; font-weight: 800; color: #6FE3B4; background: rgba(46,143,112,.15); border: 1px solid rgba(46,143,112,.38); 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: rgba(212,175,55,.38); }
.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: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 4px 10px;
}
.cust-stat.green { background: rgba(46,143,112,.15); border-color: rgba(46,143,112,.38); color: #6FE3B4; }
.cust-stat.money { background: rgba(47,111,208,.16); border-color: rgba(47,111,208,.38); color: #86B4F5; }

.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(--gold-500); margin-bottom: 10px; }
.cust-orders { display: grid; gap: 10px; }
.cust-order { background: var(--paper-2); 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(--gold-400); 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: rgba(226,59,59,.15); border-color: rgba(226,59,59,.38); color: #FF9A93; }
.cust-stat.amber { background: rgba(217,154,27,.15); border-color: rgba(217,154,27,.38); color: #F0C674; }
.cust-addr-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--paper-2); border: 1px solid rgba(212,175,55,.22); 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(--gold-400); }
.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: rgba(47,111,208,.16); border-color: rgba(47,111,208,.38); }
.cust-contact.wa { background: rgba(18,140,74,.16); border-color: rgba(18,140,74,.40); }

@media (max-width: 560px) {
  .cust-row { flex-wrap: wrap; }
  .cust-nums { width: 100%; justify-content: flex-start; }
  .cust-addr { white-space: normal; }
}

/* ============================================================
   محرّر خيارات الصنف (الحجم · الوجبة · الإضافات)
   ============================================================ */
.opt-editor > label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.opt-tpl {
  width: auto; min-width: 210px;
  padding: 6px 10px !important;
  font-size: 12px !important; font-weight: 700;
  border-radius: 9px !important;
}
#itemOptions {
  width: 100%;
  font-family: ui-monospace, "Consolas", "Cairo", monospace;
  font-size: 13px; line-height: 1.9;
  direction: rtl; text-align: start;
  resize: vertical; min-height: 92px;
}
.opt-help {
  margin-top: 7px; padding: 9px 11px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 11.5px; line-height: 1.95; color: var(--muted);
}
.opt-help code {
  background: rgba(212,175,55,.12); color: var(--gold-400);
  padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
}
.opt-preview { margin-top: 9px; }
.opt-preview:empty { display: none; }
.opv-none, .opv-warn { font-size: 12px; color: var(--muted); }
.opv-warn { color: #F0C674; }
.opv-g {
  padding: 8px 11px; margin-bottom: 6px;
  background: rgba(212,175,55,.05);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.opv-g > b { font-size: 12.5px; color: var(--ink); }
.opv-tag {
  font-size: 10px; font-weight: 800; padding: 2px 7px;
  border-radius: 999px; margin-inline-start: 7px;
}
.opv-tag.req { background: rgba(212,175,55,.16); color: var(--gold-400); }
.opv-tag.opt { background: rgba(255,255,255,.07); color: var(--muted); }
.opv-cs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.opv-c {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line-2);
  border-radius: 8px; padding: 4px 9px;
  font-size: 11.5px; font-weight: 700; color: var(--ink);
}
.opv-c i { font-style: normal; font-weight: 800; color: var(--gold-400); font-size: 11px; }
.opv-range {
  margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.opv-range b { color: var(--gold-400); }

/* شارة الخيارات في قائمة الأصناف */
.ri-optbadge {
  display: inline-block; margin-inline-start: 7px;
  background: rgba(212,175,55,.14); color: var(--gold-400);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px;
  font-size: 10.5px; font-weight: 800; vertical-align: middle;
}
.ri-nameen {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--gold-500); opacity: .8; text-transform: uppercase;
  margin-top: 1px;
}
/* الخيارات داخل بطاقة الطلب */
.oc-opt {
  display: block; font-style: normal;
  font-size: 11px; font-weight: 700; color: var(--gold-400);
  margin-top: 2px;
}

/* فرق السعر في معاينة الخيارات: عزل ثنائي الاتجاه كي تبقى الإشارة قبل الرقم */
.opv-c i { direction: ltr; unicode-bidi: isolate; }
