/* ============================================================
   REZOVA — لوحة التحكم وبوابة الدليفري (أسود · ذهبي)
   تُبنى فوق متغيّرات style.css. الكتلة أدناه تربط الأسماء
   القديمة (green/cream/paper/lime) بلوحة الذهب الجديدة،
   ثم يأتي قسم «تجاوزات الثيم» في نهاية الملف لضبط الحالات
   التي كان الأخضر فيها خلفية لا لون نص.
   ============================================================ */

:root {
  --paper: var(--surface);
  --cream: rgba(255, 255, 255, .035);

  --green-500: var(--gold-500);
  --green-600: var(--gold-600);
  --green-700: var(--gold-300);   /* يُستخدم كلون نص/أرقام */
  --green-800: var(--gold-100);   /* يُستخدم كلون عناوين */
  --green-900: #14100a;           /* نص داكن فوق الذهب */

  --lime-500: var(--gold-500);
  --lime-400: var(--gold-300);
  --lime-glow: var(--gold-200);

  --shadow-sm: var(--sh-sm);
  --shadow-md: var(--sh-md);
  --shadow-lg: var(--sh-lg);
}

/* ============================================================
   لوحة التحكم — REZOVA
   ============================================================ */

.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; }
.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: var(--surface-2); 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(--green-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(--green-500); background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(212,175,55,.14);
}
.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(--green-600), var(--green-700)); color: #fff; box-shadow: 0 8px 20px rgba(212,175,55,.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(212,175,55,.36); }
.btn-block { width: 100%; }
.back-to-menu { margin-top: 10px; }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--green-500); color: var(--green-700); }
.btn-danger { background: rgba(224,90,82,.12); color: #ef7169; border: 1px solid rgba(224,90,82,.38); }
.btn-danger:hover { background: rgba(224,90,82,.2); }
.btn-warn { background: rgba(212,175,55,.14); color: var(--gold-300); border: 1px solid rgba(212,175,55,.36); }
.btn-warn:hover { background: rgba(212,175,55,.24); }
.btn-success { background: linear-gradient(135deg, var(--green-600), var(--green-700)); color: #fff; box-shadow: 0 6px 16px rgba(212,175,55,.26); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(212,175,55,.34); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-lime { background: var(--lime-500); color: var(--green-900); }
.btn-lime:hover { background: var(--lime-400); }

.login-error {
  background: rgba(224,90,82,.12); color: #ef7169; border: 1px solid rgba(224,90,82,.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(--green-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(--green-800), var(--green-700));
  color: #fff; border-bottom: 3px solid var(--lime-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(--surface-2); 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(--lime-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(--lime-500); color: var(--green-900); border-color: transparent; }
.tb-btn.save:hover { background: var(--lime-400); }
.tb-btn.logout-btn { background: rgba(224,90,82,.9); 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(--surface-2); font-weight: 700; color: var(--muted); font-size: 14px; transition: .15s;
}
.tab.active { background: var(--green-600); color: #fff; border-color: var(--green-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(--green-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, rgba(212,175,55,.10), rgba(212,175,55,.07)); border-bottom: 1px solid var(--line);
}
.cat-card-head .emoji {
  width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); 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(--green-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 rgba(212,175,55,.12); }
.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: var(--green-700); font-size: 15px;
  background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.30); 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(--surface-2); display: grid; place-items: center; font-size: 15px; transition: .15s;
}
.icon-btn:hover { border-color: var(--green-500); background: var(--cream); }
.icon-btn.del:hover { border-color: #e88; background: rgba(224,90,82,.12); }
/* زر أيقونة بنص بدل الإيموجي (حذف / تعديل / عرض) */
.icon-btn.txt { width: auto; padding: 0 14px; font-size: 13px; font-weight: 800; color: var(--ink); }
.icon-btn.txt.del { color: #ef7169; }

.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: #f4eee1; border-radius: 50%; transition: .2s;
}
.switch input:checked + .track { background: var(--green-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(6,5,4,.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(--green-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(4,4,3,.74); 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(--surface-2); 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(--green-700), var(--green-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: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.3); color: var(--gold-300);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 18px;
}
.status-banner.ok { background: rgba(212,175,55,.10); border-color: rgba(212,175,55,.30); color: var(--green-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: var(--surface-2); 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(--green-500); }
.ofilter.active { background: var(--green-600); color: #fff; border-color: var(--green-600); }

/* ---------- بطاقة الطلب ---------- */
.order-card {
  background: var(--paper); border: 1px solid var(--line);
  border-inline-start: 5px solid var(--green-500);
  border-radius: 16px; box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 14px;
}
.order-card.st-new { border-inline-start-color: #e23b3b; background: var(--surface-2); }
.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(--green-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(--green-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(--green-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 rgba(212,175,55,.18); }
.oc-total { text-align: end; font-size: 15px; margin-bottom: 12px; }
.oc-total b { color: var(--green-700); font-size: 17px; }

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

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

/* بطاقات الخصومات المتعددة */
.disc-card {
  background: var(--surface-2); 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(--green-500); background: var(--surface-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(--green-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: var(--surface-2); 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(--green-500); background: var(--surface-2); }
.loyal-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.loyal-tag {
  display: inline-block; font-size: 11px; font-weight: 800; color: var(--green-700);
  background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.30); 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; }
.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(--surface-2); color: var(--ink);
}
.oc-controls select:focus { outline: none; border-color: var(--green-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: var(--green-700); background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.30); }
.oc-final.cancelled { color: #ef7169; background: rgba(224,90,82,.12); border: 1px solid rgba(224,90,82,.38); }
.oc-final.wait { color: var(--gold-300); background: rgba(212,175,55,.14); border: 1px solid rgba(212,175,55,.36); }
.oc-danger { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; justify-content: flex-end; }
.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(212,175,55,.10); 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(--surface-2); direction: ltr;
}
.dr-pass input:focus { outline: none; border-color: var(--green-500); }
.dr-stat {
  font-size: 12px; font-weight: 700; color: var(--green-700);
  background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.30); 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(--green-700); 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(90,150,230,.14); color: #7fb0f0; border: 1px solid rgba(90,150,230,.40); }
.da-btn.map { background: rgba(212,175,55,.14); color: var(--gold-300); border: 1px solid rgba(212,175,55,.36); }
.da-btn.wa { background: rgba(87,201,138,.12); color: #5ec98d; border: 1px solid rgba(87,201,138,.35); }
.da-btn.wa:hover { background: rgba(87,201,138,.2); }
.da-btn.done { background: linear-gradient(135deg, var(--green-600), var(--green-700)); color: #fff; box-shadow: 0 8px 20px rgba(212,175,55,.3); }
.da-btn.done:hover { transform: translateY(-2px); }
.da-btn.done:disabled { opacity: .7; }
.da-done-tag { flex: 1; text-align: center; padding: 12px; color: var(--green-700); font-weight: 800; background: rgba(212,175,55,.10); 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(--surface-2); 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(--green-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: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.30); 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, rgba(212,175,55,.10), rgba(212,175,55,.06)); border-color: rgba(212,175,55,.30); }
.rstat .rs-ico { font-size: 24px; }
.rstat .rs-val { font-size: 22px; font-weight: 900; color: var(--green-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(--green-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(--green-700); font-size: 15px; white-space: nowrap; }
.dr-stat.money { background: rgba(90,150,230,.14); border-color: rgba(90,150,230,.40); color: #7fb0f0; }
.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; }

/* فلتر الفترة المخصّصة في التقارير */
.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(--green-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(--green-500); color: var(--green-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, .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 20px 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: var(--green-700); background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.30); 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,.35); }
.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(--green-600), var(--green-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: rgba(212,175,55,.10); border-color: rgba(212,175,55,.30); color: var(--green-700); }
.cust-stat.money { background: rgba(90,150,230,.14); border-color: rgba(90,150,230,.40); color: #7fb0f0; }

.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(--green-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(--green-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: rgba(224,90,82,.12); border-color: rgba(224,90,82,.38); color: #ef7169; }
.cust-stat.amber { background: rgba(212,175,55,.14); border-color: rgba(212,175,55,.36); color: var(--gold-300); }
.cust-addr-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(212,175,55,.10); border: 1px solid rgba(212,175,55,.30); 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(--green-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: rgba(90,150,230,.14); border-color: rgba(90,150,230,.40); }
.cust-contact.wa { background: rgba(87,201,138,.12); border-color: rgba(87,201,138,.35); }

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


/* ============================================================
   تجاوزات الثيم — المواضع التي كان الأخضر فيها خلفية
   ============================================================ */

.admin-body {
  background:
    radial-gradient(900px 520px at 100% -10%, rgba(212, 175, 55, .10), transparent 62%),
    radial-gradient(700px 420px at -8% 108%, rgba(212, 175, 55, .06), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  color-scheme: dark;   /* منتقي التاريخ والقوائم الأصلية بالوضع الداكن */
}

/* الشريط العلوي */
.topbar {
  background: linear-gradient(180deg, #16120d, #0d0b09);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55);
}
.topbar::after {
  content: ""; display: block; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-600), transparent);
}
.topbar h1 { color: var(--gold-100); }
.topbar .sub { color: var(--muted); }
.topbar .logo {
  background: radial-gradient(circle at 40% 32%, #1f1a12, #0c0a08);
  border: 1px solid var(--line-2); border-radius: 50%; padding: 3px;
}
.topbar .logo img { object-fit: contain; }
.tb-btn { background: rgba(212, 175, 55, .09); border-color: var(--line-2); color: var(--gold-200); }
.tb-btn:hover { background: rgba(212, 175, 55, .2); border-color: var(--line-3); }
.tb-btn.save, .btn-lime { background: var(--gold-grad); color: #14100a; border-color: transparent; }
.tb-btn.store-toggle { background: rgba(212, 175, 55, .12); border-color: var(--line-2); color: var(--gold-200); }
.tb-btn.store-toggle:hover { background: rgba(212, 175, 55, .24); }
.save-status { background: rgba(212, 175, 55, .1); border-color: var(--line-2); color: var(--gold-200); }

/* شاشة الدخول */
.login-card { background: linear-gradient(180deg, #17130e, #0c0a08); }
.login-logo {
  background: radial-gradient(circle at 40% 32%, #1f1a12, #0c0a08);
  border: 1px solid var(--line-2); border-radius: 50%; padding: 6px;
}
.login-logo img { object-fit: contain; }
.login-card h1 { font-family: var(--font-display); color: var(--gold-100); }

/* الحقول */
.field input, .field textarea, .field select,
#panel-discounts input, #panel-discounts select,
.oc-controls select, .dr-pass input, .report-range input[type="date"] {
  background: rgba(0, 0, 0, .42);
  border-color: var(--line);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { background: rgba(0, 0, 0, .55); }
.field input::placeholder, .field textarea::placeholder { color: #6b6255; }

/* الأزرار الأساسية */
.btn-primary, .btn-success, .da-btn.done {
  background: var(--gold-grad); color: #14100a;
  box-shadow: 0 10px 26px rgba(212, 175, 55, .26);
}
.btn-primary:hover, .btn-success:hover { box-shadow: 0 14px 32px rgba(212, 175, 55, .4); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-3); color: var(--gold-200); background: rgba(212, 175, 55, .08); }
.btn-danger { color: #ef7169; }
.icon-btn { background: rgba(255, 255, 255, .04); }
.icon-btn:hover { background: rgba(212, 175, 55, .12); border-color: var(--line-3); }

/* التبويبات والفلاتر */
.tab { background: rgba(255, 255, 255, .03); color: var(--ink-2); }
.tab.active, .ofilter.active {
  background: var(--gold-grad); color: #14100a; border-color: transparent;
  box-shadow: 0 6px 18px rgba(212, 175, 55, .26);
}
.ofilter { background: rgba(255, 255, 255, .03); color: var(--ink-2); }
.panel-head h2, .report-sub, .cust-sub { font-family: var(--font-display); color: var(--gold-100); }

/* المودال */
.modal { background: linear-gradient(180deg, #17130e, #0c0a08); border: 1px solid var(--line-2); }
.modal-head {
  background: linear-gradient(90deg, rgba(212, 175, 55, .14), rgba(212, 175, 55, .04));
  border-bottom: 1px solid var(--line-2); color: var(--gold-100);
}
.modal-head h3 { font-family: var(--font-display); }
.modal-head .x { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: var(--ink-2); }
.modal-head .x:hover { border-color: var(--danger); color: var(--danger); }

/* بطاقات الفئات والطلبات */
.cat-card-head { background: linear-gradient(90deg, rgba(212, 175, 55, .10), transparent); }
.cat-card-head .emoji { background: radial-gradient(circle at 38% 30%, #241e15, #100d0a); }
.order-card.st-new { background: linear-gradient(90deg, rgba(226, 59, 59, .09), var(--surface)); }
.oc-badge { background: var(--gold-grad); color: #14100a; }
.oc-num { font-family: ui-monospace, monospace; }

/* الزبائن */
.cust-avatar { background: var(--gold-grad); color: #14100a; }

/* الإشعار */
.toast {
  background: var(--surface-3); color: var(--ink);
  border: 1px solid var(--line-2);
}
.toast.ok { background: #14532d; border-color: rgba(87, 201, 138, .5); color: #d9f7e5; }
.toast.err { background: #4a1512; border-color: rgba(224, 90, 82, .5); color: #ffdedb; }
.toast.warn { background: #3a2c08; border-color: var(--line-2); color: var(--gold-100); }

/* مفتاح التبديل */
.switch input:checked + .track { background: var(--gold-600); }

/* أرقام الإحصاءات */
.dstat .ds-num, .rstat .rs-val { color: var(--gold-200); }
