/* RDN Store Panel — قسم الطلبات. يعتمد متغيرات .rsp في panel.css */

.rsp-nav button { position: relative; }
.rsp-nav-badge {
	position: absolute; top: 8px; left: calc(50% - 26px);
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: var(--red); color: #fff; font-size: 11px; font-weight: 800; font-style: normal; line-height: 18px; text-align: center;
	box-shadow: 0 0 0 2px #fff;
}
.rsp-nav-badge:empty { display: none; }
@media (min-width: 900px) { .rsp-nav-badge { position: static; box-shadow: none; } }

.rsp-head-tools { display: flex; gap: 6px; }
.rsp-tool { background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); }
.rsp-tool.is-off { color: var(--muted); background: var(--line); }

/* الدخل */
.rsp-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 720px) { .rsp-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rsp-stat {
	position: relative; overflow: hidden; min-height: 86px; padding: 12px 14px;
	border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.rsp-stat::before { content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 4px; background: var(--tone); }
.rsp-stat span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.rsp-stat strong { display: block; margin-top: 2px; font-size: 22px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rsp-stat strong em { font-style: normal; font-size: 12px; color: var(--muted); }
.rsp-stat small { font-size: 12px; color: var(--muted); }
.rsp-stat--red { --tone: var(--red); }
.rsp-stat--red strong { color: var(--red); }
.rsp-stat--amber { --tone: var(--amber); }
.rsp-stat--green { --tone: var(--green); }
.rsp-stat--ink { --tone: var(--ink); }
.rsp-skel-stat, .rsp-skel-order {
	border: 0; box-shadow: none;
	background: linear-gradient(90deg, #F6ECE3 25%, #FBF4EE 50%, #F6ECE3 75%); background-size: 200% 100%;
	animation: rsp-shimmer 1.2s infinite;
}
.rsp-skel-order { height: 180px; }

/* بطاقات الطلبات */
.rsp-orders { display: grid; gap: 12px; }
@media (min-width: 900px) { .rsp-orders { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.rsp-orders > .rsp-empty { grid-column: 1 / -1; }
.rsp-order {
	padding: 14px; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
	transition: opacity .3s, transform .3s;
}
.rsp-order.is-leaving { opacity: 0; transform: translateX(-30px); }
.rsp-order--processing { border-right: 4px solid var(--red); }
.rsp-order--on-hold { border-right: 4px solid var(--amber); }

.rsp-order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
.rsp-order-head strong { margin-left: 8px; font-size: 18px; font-weight: 800; }
.rsp-order-head time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rsp-status { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--line); color: var(--ink-2); font-size: 11.5px; font-weight: 800; vertical-align: middle; }
.rsp-status--processing { background: var(--red-50); color: var(--red-700); }
.rsp-status--on-hold, .rsp-status--pending { background: var(--amber-50); color: var(--amber-800); }
.rsp-status--completed { background: var(--green-50); color: #11773A; }
.rsp-status--cancelled, .rsp-status--failed, .rsp-status--refunded { background: #EFEAE7; color: var(--muted); }

.rsp-order-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 6px 0 8px; font-size: 13.5px; color: var(--ink-2); }
.rsp-order-who span { font-weight: 700; }
.rsp-order-who a { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.rsp-order-who em { padding: 2px 8px; border-radius: 99px; background: var(--amber-50); color: var(--amber-800); font-style: normal; font-size: 12px; }
.rsp-order-who .rsp-type { font-weight: 800; font-size: 12.5px; }
.rsp-type--dinein { background: #E8F1FF !important; color: #1D4ED8 !important; }
.rsp-type--delivery { background: var(--red-50) !important; color: var(--red-700) !important; }
.rsp-type--pickup { background: var(--green-50) !important; color: #11773A !important; }
.rsp-order-who .rsp-when { background: var(--ink); color: #fff; font-weight: 700; }

.rsp-order-items { margin: 0; padding: 0; list-style: none; cursor: pointer; }
.rsp-order-items li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.rsp-order-items li:first-child { border-top: 0; }
.rsp-order-items b { flex: none; min-width: 30px; font-size: 15px; font-weight: 800; color: var(--red); }
.rsp-order-items div { flex: 1; min-width: 0; }
.rsp-order-items span { font-size: 14.5px; font-weight: 700; }
.rsp-order-items small { display: block; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.rsp-order-items em { font-style: normal; font-weight: 700; white-space: nowrap; }
.rsp-order-note { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--amber-50); color: var(--amber-800); font-size: 13.5px; font-weight: 600; }
.rsp-order-note-block p { color: var(--amber-800); font-weight: 600; }

.rsp-order-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.rsp-order-total strong { display: block; font-size: 19px; font-weight: 800; }
.rsp-order-total small, .rsp-order-total span { font-size: 12px; color: var(--muted); }
.rsp-order-actions { display: flex; align-items: center; gap: 8px; }
.rsp-print { width: 46px; height: 46px; border: 1.5px solid var(--line-2); border-radius: 14px; }
.rsp-print.is-loading { opacity: .5; pointer-events: none; }
.rsp-done svg { width: 18px; height: 18px; }
.rsp-more-wrap { display: flex; justify-content: center; margin-top: 16px; }

/* تفاصيل الطلب */
.rsp-contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 6px; }
.rsp-contact strong { display: block; font-size: 16px; }
.rsp-contact small { color: var(--muted); }
.rsp-contact-btns { display: flex; gap: 6px; }
.rsp-contact-btns .rsp-icon-btn { border: 1.5px solid var(--line-2); }
.rsp-wa { height: 40px; color: #128C4A; border-color: #BFE8CF; text-decoration: none; }
.rsp-kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 14.5px; }
.rsp-kv span { color: var(--muted); }
.rsp-kv-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 18px; }
.rsp-kv-total strong { color: var(--red); }

/* تنبيه طلب جديد */
.rsp-new-order {
	position: fixed; z-index: 120; top: calc(76px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
	display: flex; align-items: center; gap: 10px; padding: 12px 20px; border: 0; border-radius: 16px; cursor: pointer;
	background: var(--red); color: #fff; font: inherit; font-size: 15.5px; font-weight: 800; white-space: nowrap;
	box-shadow: 0 12px 30px rgba(227, 38, 47, .45); animation: rsp-ring 1s ease-in-out infinite alternate;
}
.rsp-new-order svg { width: 22px; height: 22px; }
.rsp-new-order small { font-weight: 600; opacity: .85; }
@keyframes rsp-ring { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.04); } }

/* إعدادات الفاتورة */
.rsp-logo-pick { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.rsp-logo-preview { display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden; border-radius: 16px; border: 2px dashed var(--line-2); background: #FFFBF7; color: var(--muted); }
.rsp-logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.rsp-paper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.rsp-paper label { position: relative; cursor: pointer; }
.rsp-paper input { position: absolute; opacity: 0; }
.rsp-paper span { display: block; padding: 12px; border-radius: 14px; border: 2px solid var(--line-2); text-align: center; }
.rsp-paper b { display: block; font-size: 15px; }
.rsp-paper small { color: var(--muted); }
.rsp-paper input:checked + span { border-color: var(--red); background: var(--red-50); }
.rsp-paper input:focus-visible + span { box-shadow: 0 0 0 4px var(--red-50); }
