:root {
  --font-body: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-head: 'Tajawal', 'Cairo', Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  font-family: var(--font-body);
  margin: 0; background: #f6f5f2; color: #222; line-height: 1.75;
  font-size: 15px;
}
h1, h2, h3, h4, .num, .badge, .btn, .stat .num { font-family: var(--font-head); }
h1 { font-weight: 800; letter-spacing: -.01em; }
h2 { font-weight: 800; }
h3 { font-weight: 700; }
.container { max-width: 860px; margin: 0 auto; padding: 16px; }
a { color: #c0392b; }

h1, h2, h3 { margin: .3em 0; }
.muted { color: #777; font-size: .9em; }
.badge {
  display: inline-block; background: #c0392b; color: #fff;
  border-radius: 20px; padding: 2px 14px; font-size: .85em;
}
.flash { padding: 12px 18px; text-align: center; font-weight: bold; }
.flash-success { background: #e6f7e6; color: #1e7e34; }
.flash-error { background: #fdecea; color: #b71c1c; }

/* رأس المتجر */
.store-header { background: #fff; border-bottom: 3px solid #c0392b; padding: 22px 0 14px; }
.store-header h1 { color: #c0392b; }

/* بطاقات المنتجات */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.card .price { color: #c0392b; font-weight: bold; font-size: 1.1em; }
.card .cat { font-size: .8em; color: #999; }
.qty-form { display: flex; gap: 8px; margin-top: 10px; }
.qty-form input[type=number] { width: 64px; }

/* أزرار */
.btn {
  display: inline-block; background: #c0392b; color: #fff !important; border: 0;
  border-radius: 8px; padding: 9px 20px; font-size: 1em; cursor: pointer;
  text-decoration: none; text-align: center;
}
.btn:hover { background: #a93226; }
.btn-gray { background: #666; }
.btn-small { padding: 4px 12px; font-size: .85em; }
.btn-block { display: block; width: 100%; }

/* نماذج */
form.stack label { display: block; margin-top: 12px; font-weight: bold; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #ccc; border-radius: 8px;
  font-size: 1em; font-family: inherit;
}
textarea { min-height: 70px; }

/* جداول */
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: right; }
table.list th { background: #fafafa; }

/* لوحات التحكم */
.dash-nav {
  background: #2c3e50; padding: 0; display: flex; flex-wrap: wrap;
}
.dash-nav a { color: #ecf0f1; padding: 14px 18px; text-decoration: none; }
.dash-nav a:hover { background: #34495e; }
.dash-nav a.active { background: #c0392b; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: #fff; border-radius: 12px; padding: 16px 12px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.stat .lbl { font-size: .82em; color: #666; margin-top: 4px; line-height: 1.3; }
.stat .num { font-size: 1.5em; font-weight: 700; color: #c0392b; white-space: nowrap; letter-spacing: -.02em; }

/* الصفحة الرئيسية للمنصة */
.hero { background: linear-gradient(135deg, #c0392b, #8e2318); color: #fff; padding: 60px 0; text-align: center; }
.hero h1 { font-size: 2.2em; }
.hero p { font-size: 1.15em; opacity: .95; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 30px 0; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.plan-card { background: #fff; border-radius: 12px; padding: 24px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.plan-card .price { font-size: 2em; color: #c0392b; font-weight: bold; }

/* سلة */
.cart-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #ddd; }
.cart-total { font-size: 1.25em; font-weight: bold; text-align: left; margin-top: 12px; }

.status-pill { border-radius: 14px; padding: 2px 12px; font-size: .85em; background: #eee; }
.status-new { background: #fff3cd; }
.status-preparing { background: #cfe2ff; }
.status-ready { background: #d1e7dd; }
.status-delivered { background: #d1e7dd; }
.status-cancelled { background: #f8d7da; }

.qr-box { text-align: center; background: #fff; padding: 24px; border-radius: 12px; }
@media print { .dash-nav, .no-print { display: none; } }

/* ===== تنبيه الطلبات الجديدة + سجل الطلبات + المبيعات ===== */
.dash-nav { align-items: center; }
.dash-nav .nav-spacer { flex: 1; }
.nav-badge {
  background: #e74c3c; color: #fff; border-radius: 999px;
  font-size: .72rem; padding: 1px 7px; margin-inline-start: 4px; font-weight: 700;
}
.sound-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,.25); color: #ecf0f1;
  border-radius: 8px; padding: 6px 10px; margin: 6px 8px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.sound-toggle.is-on { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); }

.alert-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff4e5; border: 1px solid #f5c98a; color: #7a4a12;
  border-radius: 12px; padding: 12px 16px; margin: 14px 0;
}
.alert-bar .alert-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #e67e22; flex: none;
  animation: alertPulse 1.6s infinite;
}
@keyframes alertPulse {
  0% { box-shadow: 0 0 0 0 rgba(230,126,34,.55); }
  70% { box-shadow: 0 0 0 10px rgba(230,126,34,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,126,34,0); }
}
.alert-bar strong { font-size: 1rem; }
.alert-bar .btn { margin-inline-start: auto; }

.order-toast {
  position: fixed; inset-inline: 0; top: 14px; margin: 0 auto; z-index: 90;
  width: min(92vw, 420px); background: #1f2d28; color: #fff;
  border-radius: 14px; padding: 14px 16px; display: none;
  box-shadow: 0 14px 40px rgba(0,0,0,.28); text-align: center;
}
.order-toast.is-on { display: block; animation: toastIn .25s ease-out; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.order-toast strong { display: block; font-size: 1.05rem; margin-bottom: 4px; color: #ffd479; }
.order-toast .ot-line { display: block; font-size: .85rem; opacity: .9; }
.order-toast .ot-name { display: block; font-size: .8rem; opacity: .7; margin-top: 2px; }
.order-toast .ot-go {
  display: inline-block; margin-top: 10px; background: #ffd479; color: #1f2d28 !important;
  border-radius: 9px; padding: 7px 16px; font-weight: 700; font-size: .85rem; text-decoration: none;
}

.filters { margin: 12px 0 16px; display: grid; gap: 8px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  background: #fff; border: 1px solid #dcdcdc; border-radius: 999px;
  padding: 6px 13px; font-size: .85rem; color: #333; text-decoration: none;
}
.chip b { color: #888; font-size: .75rem; }
.chip.is-on { background: #c0392b; border-color: #c0392b; color: #fff; }
.chip.is-on b { color: rgba(255,255,255,.8); }
.chip-lite { background: #f7f7f7; }
.search-form { display: flex; gap: 6px; margin-inline-start: auto; }
.search-form input[type=search] { width: 230px; padding: 7px 10px; border: 1px solid #ccc; border-radius: 8px; }

.table-wrap { overflow-x: auto; background: #fff; border-radius: 12px; }
table.orders-table { min-width: 780px; }
table.orders-table tr.row-new td { background: #fffaf0; }
.items-cell { max-width: 320px; font-size: .88rem; }
.nowrap { white-space: nowrap; }
.inline-status { display: flex; gap: 6px; align-items: center; }
.inline-status select { width: auto; padding: 5px 8px; font-size: .82rem; }
.row-off td { opacity: .55; }

.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, #e05b45, #c0392b); border-radius: 6px 6px 3px 3px; }
.bar-val { font-size: .62rem; color: #888; }
.bar-label { font-size: .62rem; color: #999; white-space: nowrap; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ===== تحسينات الشكل (النسخة 4) ===== */
body { -webkit-font-smoothing: antialiased; }
.dash-nav { position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.dash-nav a { transition: background .15s ease, color .15s ease; }
.card { border: 1px solid #ececec; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card h3 { margin-top: 0; }
.btn { transition: background .15s ease, box-shadow .15s ease, transform .1s ease; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #c0392b; outline-offset: 2px;
}
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=tel]:focus,
input[type=number]:focus, input[type=search]:focus, select:focus, textarea:focus {
  border-color: #c0392b; box-shadow: 0 0 0 3px #fbe9e7;
}
table.list { border-radius: 12px; overflow: hidden; }
table.list tr:hover td { background: #fafafa; }
.stat { display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.stat .num { line-height: 1.2; }
.print-btn { white-space: nowrap; }
.actions-cell { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.actions-cell form { margin: 0; display: flex; align-items: center; gap: 6px; }
.actions-cell select { font-size: 12px; padding: 6px 4px; }
.actions-cell .btn { padding: 6px 10px; font-size: 12px; }
.actions-cell .print-btn, .actions-cell .print-btn.btn-gray {
  background: #fff; color: #333 !important; border: 1px solid #ccc; font-weight: 600;
}
.actions-cell .print-btn:hover { background: #f2f2f2; }
@media (max-width: 640px) {
  .container { padding: 12px; }
  .dash-nav a { padding: 12px 12px; font-size: .9rem; }
}
@media print {
  .dash-nav, .filters, .no-print { display: none !important; }
}

/* ---------- شاشات الدخول ---------- */
.auth-box { max-width: 460px; margin: 5vh auto 40px; }
.auth-box h1 { text-align: center; font-size: 1.45rem; margin: 0 0 16px; letter-spacing: -.01em; }
.auth-box .card { padding: 22px 20px; border-radius: 14px; }
.auth-box .card label { display: block; margin-bottom: 12px; font-weight: 600; }
.auth-box .card input { width: 100%; margin-top: 6px; }
.auth-box > p { text-align: center; margin-top: 16px; color: #666; font-size: .9rem; }
@media (max-width: 560px) {
  .auth-box { margin: 20px auto 30px; }
}

/* ---------- كوبونات + حالة الاشتراك (النسخة 5) ---------- */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; margin-top: 6px; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: .8rem; font-weight: 700; }
.pill-ok { background: #e6f7ec; color: #1b7a43; }
.pill-bad { background: #fdecea; color: #b71c1c; }
.pill-muted { background: #eee; color: #666; }
table.list .row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; justify-content: flex-start; }
table.list .row-actions .btn { padding: 5px 9px; font-size: .78rem; white-space: nowrap; }
table.list th:last-child { width: 1%; white-space: nowrap; }
table.list form.inline { display: contents; }
.btn.danger { color: #b71c1c; border-color: #f0c9c5; background: #fff; }
.btn.danger:hover { background: #fdecea; }
.discount-tag { font-size: .78rem; color: #1b7a43; }
.discount-line { margin: -4px 0 14px; }

.sub-card {
  background: #fff; border: 1px solid #ececec; border-radius: 14px;
  padding: 16px 18px; margin: 14px 0 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  border-inline-start: 5px solid #1b7a43;
}
.sub-card.is-soon { border-inline-start-color: #e6a700; background: #fffdf5; }
.sub-card.is-expired { border-inline-start-color: #c0392b; background: #fdf6f5; }
.sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sub-kicker { display: block; font-size: .78rem; color: #777; }
.sub-state { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; }
.sub-plan { background: #f2f2f2; color: #444; border-radius: 999px; padding: 4px 14px; font-size: .82rem; }
.sub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.sub-item span { display: block; font-size: .78rem; color: #777; }
.sub-item b { font-family: var(--font-head); font-size: 1.05rem; }
.sub-bar { height: 6px; background: #eee; border-radius: 999px; margin-top: 12px; overflow: hidden; }
.sub-bar i { display: block; height: 100%; background: #1b7a43; border-radius: 999px; }
.sub-card.is-soon .sub-bar i { background: #e6a700; }
.sub-note { margin: 10px 0 0; font-size: .88rem; color: #7a4a00; }
.sub-card.is-expired .sub-note { color: #b71c1c; }
@media (max-width: 560px) {
  .sub-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- النسخة 6: حقول المقاسات والإضافات في لوحة التحكم ---------- */
.sub-form {
  border: 1px solid #e8e2d8; border-radius: 14px; padding: 14px 16px; margin: 4px 0 6px;
  background: #fcfbf8;
}
.sub-form legend { font-weight: 700; font-size: 13.5px; color: #4a4436; padding: 0 6px; }
.sub-form .form-row { margin-bottom: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e8e2d8; border-radius: 10px; background: #fff; font-size: 13.5px; }
.check input { accent-color: #1f4b3f; }
.pill-offer { background: #fdecea; color: #a3341f; }
.pill-bad { background: #fdecea; color: #a3341f; }

/* ---------- مواعيد العمل وحالة الطلبات (لوحة التحكم) ---------- */
.hours-state {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; padding: 6px 14px; font-size: .86rem; font-weight: 600;
  background: #eaf6ee; color: #1f6b3a; margin: 4px 0 14px;
}
.hours-state .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.hours-state-closed { background: #fdecea; color: #a3301f; }
.hours-state-busy { background: #fdf3d8; color: #8a6410; }
.switch-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fbf7f0; border: 1px solid #efe6d8; border-radius: 12px;
  padding: 12px 14px; font-size: .9rem; cursor: pointer;
}
.switch-row input { margin-top: 4px; flex: none; }
.switch-row span { line-height: 1.5; }
.hours-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: .9rem; }
.hours-table th {
  text-align: right; font-weight: 600; color: #6b7a74; font-size: .8rem;
  padding: 6px 4px; border-bottom: 1px solid #ece5d9;
}
.hours-table td { padding: 6px 4px; border-bottom: 1px solid #f3ede3; }
.hours-table input[type="time"] { padding: 6px 8px; font-size: .85rem; width: 110px; }
.hours-table input[type="checkbox"] { width: 18px; height: 18px; }

/* ============================================================
   طبقة تحسين الشكل (v9) — لوحة التحكم وصفحات المنصة
   ============================================================ */
:root {
  --ink: #16211d;
  --ink-soft: #5b6a63;
  --line: #e9e3d7;
  --surface: #ffffff;
  --bg: #f6f2ea;
  --brand: #1f4b3f;
  --brand-ink: #14352c;
  --accent: #c0392b;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(22,33,29,.05), 0 2px 8px rgba(22,33,29,.04);
  --shadow-md: 0 4px 12px rgba(22,33,29,.07), 0 12px 32px rgba(22,33,29,.05);
  --ring: 0 0 0 3px rgba(31,75,63,.16);
}

body { background: var(--bg); color: var(--ink); }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; border-radius: var(--radius-sm);
  padding: 11px 20px; font-size: .92rem; font-weight: 700; line-height: 1;
  background: var(--brand); color: #fff; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  font-family: var(--font-head, inherit);
}
.btn:hover { filter: brightness(1.06); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-gray { background: #eef1ee; color: #2c3a34; box-shadow: none; }
.btn.btn-gray, a.btn.btn-gray { color: #2c3a34 !important; }
.btn.btn-gray:hover, a.btn.btn-gray:hover { color: #1f4b3f !important; background: #e4e8e4; }
.btn-gray:hover { background: #e4e8e4; }
.btn-small { padding: 7px 13px; font-size: .82rem; border-radius: 9px; }
.btn.danger, .btn.danger:hover { background: #b3362a; color: #fff; }
.btn-block { width: 100%; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.card .muted { line-height: 1.7; }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=file], select, textarea {
  width: 100%; padding: 11px 13px; font-size: .93rem; color: var(--ink);
  background: #fff; border: 1px solid #dfd8ca; border-radius: var(--radius-sm);
  font-family: inherit; transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
form.stack label { font-weight: 600; font-size: .88rem; color: #3d4b45; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

table.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.list th {
  background: #faf7f1; font-size: .8rem; color: #6b7a74; font-weight: 700;
  padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.list td { padding: 12px; border-bottom: 1px solid #f2ede4; font-size: .9rem; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: #fcfaf5; }
table.list .nowrap { white-space: nowrap; }
.row-off td { opacity: .55; }
.row-new td { background: #fffdf3; }

.dash-nav {
  background: var(--brand-ink); padding: 8px 12px; gap: 4px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.dash-nav a {
  color: rgba(255,255,255,.82); font-size: .86rem; font-weight: 600;
  padding: 9px 13px; border-radius: 999px; text-decoration: none; transition: background .12s ease, color .12s ease;
}
.dash-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.dash-nav a.active { background: #fff; color: var(--brand-ink); }

.stats { gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 14px; box-shadow: var(--shadow-sm); text-align: right;
  display: grid; gap: 4px; font-size: .84rem; color: var(--ink-soft);
}
.stat .num { font-size: 1.5rem; font-weight: 800; color: var(--accent); letter-spacing: -.01em; }

.flash {
  padding: 13px 18px; font-weight: 600; font-size: .9rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.flash-success { background: #eaf7ee; color: #1d6b3a; border-bottom: 1px solid #cfe9d8; }
.flash-error { background: #fdeeec; color: #a3301f; border-bottom: 1px solid #f5d3cc; }

.hero {
  background:
    radial-gradient(1000px 400px at 80% -10%, rgba(255,255,255,.18), transparent 60%),
    linear-gradient(135deg, #1f4b3f 0%, #14352c 60%, #0f2a23 100%);
  padding: 84px 0 76px; text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4.4vw, 3rem); line-height: 1.25; margin-bottom: 12px; }
.hero p { font-size: clamp(.95rem, 2.2vw, 1.1rem); opacity: .92; max-width: 620px; margin: 0 auto 26px; }
.hero .btn { background: #fff; color: var(--brand-ink); padding: 14px 28px; font-size: .98rem; }
.hero .btn:hover { background: #f4f1ea; }

.features { gap: 16px; }
.features .feature, .features > div {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.plans { gap: 18px; }
.plan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 22px; box-shadow: var(--shadow-md); display: grid; gap: 10px;
}
.plan-card .price, .plan-card .num { font-size: 1.9rem; font-weight: 800; color: var(--brand); }

.status-pill {
  display: inline-block; border-radius: 999px; padding: 4px 12px;
  font-size: .76rem; font-weight: 700; background: #eef1ee; color: #45524c;
}
.status-new { background: #fff4d6; color: #8a6410; }
.status-preparing { background: #e3edfd; color: #1f4d8f; }
.status-ready { background: #e2f4ea; color: #1f6b3a; }
.status-delivered { background: #e2f4ea; color: #1f6b3a; }
.status-cancelled { background: #fdeceb; color: #a3301f; }

.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.export-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* هيرو صفحة المنصة (مش المتجر) */
body:not(.shop) .shop-hero {
  background:
    radial-gradient(1000px 420px at 82% -10%, rgba(255,255,255,.16), transparent 62%),
    linear-gradient(135deg, #1f4b3f 0%, #14352c 58%, #0d251f 100%);
  color: #fff; padding: 88px 0 80px; text-align: center;
}
body:not(.shop) .shop-hero h1 { color: #fff; font-size: clamp(1.9rem, 4.6vw, 3.1rem); line-height: 1.24; margin: 0 0 14px; }
body:not(.shop) .shop-hero p { color: rgba(255,255,255,.9); font-size: clamp(.95rem, 2.2vw, 1.1rem); max-width: 640px; margin: 0 auto 26px; line-height: 1.8; }
body:not(.shop) .shop-hero .btn { background: #fff; color: var(--brand-ink); padding: 14px 30px; font-size: 1rem; }
body:not(.shop) .shop-hero .btn:hover { background: #f2efe8; }

.range-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 10px 0 4px; box-shadow: var(--shadow-sm);
}
.range-form label { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: #3d4b45; margin: 0; }
.range-form input[type=date] { width: auto; padding: 8px 10px; font-size: .85rem; }
.range-stats { margin-top: 12px; }

/* v10: ملاحظة العميل في لوحة التحكم */
.order-note{display:flex;gap:6px;align-items:flex-start;margin-top:6px;padding:6px 10px;border-radius:8px;background:#fff7e6;border:1px solid #ffe0a3;border-right:3px solid #e8a400;font-size:12.5px;color:#7a5200;line-height:1.5}
.order-note b{flex:0 0 auto;color:#8a5b00}
.order-note span{flex:1 1 auto;white-space:pre-wrap;word-break:break-word}
.order-note.is-small{font-size:12px;margin-top:8px}

/* v11: شاشة الكاشير (POS) */
.pos-wrap{padding-bottom:40px}
.pos-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.pos-head h1{margin:0}
.pos-grid{display:grid;grid-template-columns:1fr 380px;gap:16px;align-items:start}
.pos-left,.pos-right{background:#fff;border:1px solid #e6e6e6;border-radius:14px;padding:14px}
.pos-tools{display:flex;flex-direction:column;gap:10px;margin-bottom:12px}
.pos-tools input[type=search]{width:100%}
.pos-cats{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1px solid #d8d8d8;background:#fafafa;border-radius:999px;padding:6px 12px;font-size:13px;cursor:pointer;font-family:inherit}
.chip.is-on{background:#1f4b3f;border-color:#1f4b3f;color:#fff}
.pos-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;max-height:calc(100vh - 260px);overflow:auto}
.pos-item{display:flex;flex-direction:column;gap:6px;align-items:flex-start;text-align:right;border:1px solid #e2e2e2;border-radius:12px;padding:10px;background:#fff;cursor:pointer;font-family:inherit;min-height:74px}
.pos-item:hover{border-color:#1f4b3f;box-shadow:0 2px 8px rgba(31,75,63,.12)}
.pos-item-name{font-size:13.5px;font-weight:600;line-height:1.4}
.pos-item-price{font-size:12.5px;color:#1f4b3f;font-weight:700}
.pos-title{margin:0 0 10px}
.pos-lines{display:flex;flex-direction:column;gap:8px;max-height:38vh;overflow:auto}
.pos-line{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;font-size:13px;padding-bottom:6px;border-bottom:1px dashed #eee}
.pl-qty{display:flex;align-items:center;gap:6px}
.pl-btn{width:24px;height:24px;border-radius:8px;border:1px solid #d8d8d8;background:#fafafa;cursor:pointer;font-size:14px;line-height:1;font-family:inherit}
.pl-total{font-weight:700;min-width:52px;text-align:left}
.pos-sums{margin:12px 0;border-top:1px solid #eee;padding-top:10px}
.pos-lbl{display:block;font-size:12.5px;font-weight:700;color:#555;margin:12px 0 6px}
.pos-types{display:flex;gap:8px;flex-wrap:wrap}
.pos-type{flex:1 1 30%;border:1px solid #dcdcdc;border-radius:10px;padding:8px;font-size:13px;cursor:pointer;display:flex;gap:6px;align-items:center}
.pos-type input{accent-color:#1f4b3f}
.pos-type span{display:flex;flex-direction:column}
.pos-type small{color:#777;font-size:11.5px}
.pos-cust{display:flex;flex-direction:column;gap:8px}
.pos-cust-results{border:1px solid #e2e2e2;border-radius:10px;overflow:hidden;max-height:200px;overflow-y:auto}
.pos-cust-row{display:block;width:100%;text-align:right;background:#fff;border:0;border-bottom:1px solid #f0f0f0;padding:8px 10px;cursor:pointer;font-family:inherit;font-size:13px}
.pos-cust-row:hover{background:#f6f8f7}
.pos-cust-picked{display:flex;gap:8px;align-items:center;background:#f2f7f4;border:1px solid #cfe3d7;border-radius:10px;padding:8px 10px;font-size:13px}
.pos-walkin{display:flex;flex-direction:column;gap:6px}
.pos-walkin input{font-size:13px}
.pos-submit{margin-top:14px;padding:12px}
.pos-modal{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;z-index:60;padding:16px}
.pos-modal-card{background:#fff;border-radius:14px;padding:16px;width:100%;max-width:380px;max-height:86vh;overflow:auto}
.pos-modal-card h4{margin:0 0 10px}
.pos-modal-sec{margin-bottom:10px;display:flex;flex-direction:column;gap:6px}
.pos-opt{font-size:13.5px;display:flex;gap:8px;align-items:center}
.pos-modal-acts{display:flex;gap:8px;margin-top:12px}
.pos-modal-acts .btn{flex:1}
@media(max-width:900px){.pos-grid{grid-template-columns:1fr}.pos-items{max-height:none}.pos-right{position:sticky;bottom:0}}
.pos-tag{display:inline-block;background:#eef3f0;color:#1f4b3f;border-radius:6px;padding:1px 6px;font-size:11px;font-weight:700}
.pos-cust-picked[hidden],.pos-walkin[hidden],.pos-cust-results[hidden],#posZoneWrap[hidden]{display:none!important}
.help-details{margin-top:12px;border-top:1px solid #eee;padding-top:10px}
.help-details summary{cursor:pointer;font-weight:700;font-size:13.5px;color:#1f4b3f}
.help-steps{margin:8px 0 0;padding-inline-start:18px;font-size:13px;line-height:1.9;color:#444}
.help-steps code{background:#f3f3f3;padding:1px 5px;border-radius:4px;font-size:12px}

/* v12: بطاقة QR للطباعة */
.qr-page h1{margin-bottom:4px}
.qcard-tools{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin:14px 0}
.qcard-styles{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px;color:#555}
.qcard-actions{display:flex;gap:8px;flex-wrap:wrap}
.qcard-stage{display:flex;justify-content:center;padding:10px 0 4px}
.qcard{width:105mm;height:148mm;border-radius:10px;overflow:hidden;box-shadow:0 8px 28px rgba(0,0,0,.16);display:flex;align-items:center;justify-content:center;background:var(--qc-brand,#1f4b3f)}
.qcard .qc-inner{width:100%;padding:12mm 9mm;text-align:center;display:flex;flex-direction:column;align-items:center;gap:5mm;color:#fff}
.qc-logo{width:22mm;height:22mm;object-fit:contain;background:#fff;border-radius:14px;padding:2mm}
.qc-name{font-size:19px;font-weight:800;line-height:1.35}
.qc-cta{font-size:14px;font-weight:700;letter-spacing:.3px;opacity:.95}
.qc-qr-plate{background:#fff;border-radius:12px;padding:5mm;width:62mm;height:62mm;display:flex;align-items:center;justify-content:center}
.qc-qr{width:100%;height:100%;object-fit:contain;display:block}
.qc-url{font-size:10.5px;opacity:.9;word-break:break-all}
.qc-foot{font-size:10.5px;opacity:.85}
.qcard.style-2{background:#fff;border:3px solid var(--qc-brand,#1f4b3f)}
.qcard.style-2 .qc-inner{color:#1b1b1b}
.qcard.style-2 .qc-name{color:var(--qc-brand,#1f4b3f)}
.qcard.style-2 .qc-cta{color:#444}
.qcard.style-2 .qc-qr-plate{background:#f7f7f7;border:1px solid #e6e6e6}
.qcard.style-2 .qc-url,.qcard.style-2 .qc-foot{color:#666}
.qcard.style-2 .qc-logo{background:transparent}
.qcard.style-3{background:linear-gradient(150deg,var(--qc-brand,#1f4b3f),#101010 85%)}
.qcard.style-3 .qc-name{font-size:21px;letter-spacing:.4px}
.qcard.style-3 .qc-qr-plate{border-radius:6px;box-shadow:0 6px 18px rgba(0,0,0,.35)}
.qcard.style-3 .qc-cta{font-size:15px}
@media print{
  body *{visibility:hidden}
  .qcard-stage,.qcard-stage *{visibility:visible}
  .qcard-stage{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:0}
  .qcard{box-shadow:none;border-radius:0;width:105mm;height:148mm}
  html,body{background:#fff!important}
  .qcard,.qcard *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important}
}
.qcard,.qcard *{-webkit-print-color-adjust:exact;print-color-adjust:exact}

/* v13: الموظفون والصلاحيات */
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:700px){.grid-2{grid-template-columns:1fr}}
.perm-box{border:1px solid #e4e4e4;border-radius:12px;padding:12px 14px;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px}
.perm-box legend{font-weight:700;font-size:13px;color:#1f4b3f;padding:0 6px}
.perm-item{display:flex;gap:8px;align-items:center;font-size:13.5px}
.perm-item input{accent-color:#1f4b3f}
/* v13: أزرار الإجراءات في الجداول تبان واضحة */
.actions-cell .btn-gray,.table-wrap .btn-gray{background:#fff;border:1px solid #d5d5d5;color:#333}
.actions-cell .btn-gray:hover,.table-wrap .btn-gray:hover{background:#f3f5f4;border-color:#1f4b3f;color:#1f4b3f}
.actions-cell .btn-gray,.actions-cell .btn-gray:link,.actions-cell .btn-gray:visited{background:#fff!important;border:1px solid #cfcfcf!important;color:#1b1b1b!important}

/* v14: الاشتراك */
.sub-banner{display:flex;gap:14px;align-items:center;justify-content:space-between;flex-wrap:wrap;background:#fff;border:1px solid #e6e6e6;border-radius:14px;padding:14px 16px;margin-bottom:14px}
.sub-banner div{display:flex;flex-direction:column;gap:3px;font-size:13.5px}
.sub-banner strong{font-size:15px}
.sub-banner span{color:#555}
.sub-banner.is-trial{background:#f2f7f4;border-color:#cfe3d7}
.sub-banner.is-trial strong{color:#1f4b3f}
.sub-banner.is-warn{background:#fff7e6;border-color:#ffe0a3}
.sub-banner.is-warn strong{color:#8a5b00}
.sub-banner.is-blocked{background:#fdecec;border-color:#f5c2c2}
.sub-banner.is-blocked strong{color:#a3231f}
.plans-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-top:10px}
.plan-card{background:#fff;border:1px solid #e6e6e6;border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:10px}
.plan-name{font-weight:800;font-size:16px;color:#1f4b3f}
.plan-price{font-size:24px;font-weight:800}
.plan-price small{font-size:12px;font-weight:500;color:#777}
.plan-feats{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:13px;color:#444}
.plan-feats li::before{content:"✓";color:#1f4b3f;font-weight:800;margin-inline-end:6px}
/* v14: النافيجيشن يفضل في سطر واحد */
@media(min-width:1100px){.dash-nav{gap:2px}.dash-nav a{padding:8px 9px;font-size:13px}}
.sub-cta{margin-inline-start:auto}
.bk-list{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column;gap:6px}
.bk-list li{display:flex;justify-content:space-between;font-size:13.5px;border-bottom:1px dashed #eee;padding-bottom:6px}
.qc-table{font-size:16px;font-weight:800;background:rgba(255,255,255,.16);border:1.5px solid rgba(255,255,255,.5);border-radius:999px;padding:3px 16px}
.qcard.style-2 .qc-table{background:transparent;border-color:currentColor;color:#1f4b3f}
.table-tag{display:inline-block;background:#eef3f0;color:#1f4b3f;border-radius:6px;padding:1px 6px;font-size:11px;font-weight:700}
/* v19: نجوم التقييم في سجل الطلبات */
.order-rate{color:#e0a91b;font-size:13px;letter-spacing:1px}

.type-toggle-row{display:flex;gap:10px;flex-wrap:wrap}
.type-toggle{flex:1 1 180px;display:flex;flex-direction:column;gap:6px;align-items:flex-start;padding:12px 14px;border-radius:12px;border:1px solid #d7e5de;background:#eef7f2}
.type-toggle span{font-size:.9rem;color:#1f6b4a;font-weight:700}
.type-toggle.is-paused{background:#fbeceb;border-color:#efc4c0}
.type-toggle.is-paused span{color:#a33}
.type-toggle .btn{margin-top:2px}

.sched-tag{display:inline-block;background:#e8f0fe;color:#1a4fb0;border-radius:8px;padding:2px 8px;font-weight:700;margin-bottom:4px}

.bar-cell{position:relative;min-width:110px;height:22px;background:#f1ece2;border-radius:8px;overflow:hidden}.bar-cell i{position:absolute;inset:0 auto 0 0;background:#bfdccc}.bar-cell span{position:relative;padding:0 8px;font-weight:700;font-size:.85rem;line-height:22px}
.crop-box{margin:8px 0;padding:10px;border:1px dashed #cdbf9f;border-radius:12px;text-align:center}
.crop-view{max-width:100%;border-radius:10px;cursor:grab;touch-action:none;background:#eee}
.crop-zoom{width:min(320px,100%);display:block;margin:8px auto}
tr.drag-over td{box-shadow:inset 0 3px 0 #1e4d3a}
tr[draggable=true]{cursor:grab}.drag-handle{color:#9a8f78;font-size:1.2rem;padding:0 6px;user-select:none}
.group-card{border:1px solid #e3dccd;border-radius:12px;padding:10px 12px;margin-bottom:10px;background:#fbf8f1}

.site-foot{margin-top:40px;border-top:1px solid #e3dccd;background:#fbf8f1}.site-foot-in{max-width:1100px;margin:0 auto;padding:16px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:.9rem;color:#6b6455}.site-foot-soc a{margin-inline-start:14px;color:#1e4d3a;text-decoration:none;font-weight:700}

.group-head{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-end;margin-bottom:8px}.group-head label{flex:1 1 150px}
.opt-rows{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.opt-row{display:flex;gap:6px;align-items:center}.opt-row input[type=text]{flex:1 1 auto;min-width:0}.opt-row input[type=number]{flex:0 0 96px;width:96px}.opt-row .btn{flex:0 0 auto}

.site-foot-soc{display:flex;gap:10px;align-items:center}.site-foot-soc a.soc-ic{margin:0;width:38px;height:38px;border-radius:50%;background:#e8efe9;color:#1e4d3a;display:inline-flex;align-items:center;justify-content:center;transition:background .15s,color .15s}.site-foot-soc a.soc-ic:hover{background:#1e4d3a;color:#fff}

.site-foot-in{flex-direction:column;align-items:center;text-align:center}
.site-foot-in>span:first-child{width:100%;text-align:center}
.site-foot-soc{justify-content:center}
.qcard .qc-inner{padding:7mm 8mm;gap:3.5mm}.qc-qr-plate{width:58mm;height:58mm}

.bell-link{position:relative;display:inline-flex;align-items:center;gap:2px}
.bell-badge{position:absolute;top:-4px;left:-4px;min-width:17px;height:17px;line-height:17px;font-size:10px;padding:0 4px;text-align:center}
.expiry-bar{background:#c62828;color:#fff;padding:9px 16px;display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;font-weight:700;font-size:14px}
.expiry-bar a{background:#fff;color:#c62828;border-radius:999px;padding:3px 12px;font-size:13px;text-decoration:none}
.ad-banner{display:block;margin:0 0 14px;border-radius:14px;overflow:hidden;box-shadow:0 2px 10px rgba(0,0,0,.08);position:relative}
.ad-banner img{display:block;width:100%;max-height:260px;object-fit:cover}
.ad-tag{position:absolute;top:8px;inset-inline-start:8px;background:rgba(0,0,0,.55);color:#fff;font-size:11px;padding:2px 8px;border-radius:999px}
.note-list .note{background:#fff;border:1px solid #eadfcd;border-radius:12px;padding:12px 14px;margin-bottom:10px}
.note-list .note.unread{border-inline-start:5px solid #1f4b3f;background:#f7fbf8}
.note-list .note.warn{border-inline-start:5px solid #c62828;background:#fff5f5}
.note h4{margin:0 0 4px}.note .when{color:#8a8574;font-size:12px}

/* موقع المنصة التسويقي (v30) */
body.mk{background:#fff}
.mk-in{max-width:1080px;margin:0 auto;padding:0 18px}
.mk-nav{position:sticky;top:0;z-index:20;background:rgba(255,255,255,.94);backdrop-filter:blur(8px);border-bottom:1px solid #eee}
.mk-nav .mk-in{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:62px;flex-wrap:wrap}
.mk-logo{font-weight:800;font-size:1.25rem;color:#1d4a3b}
.mk-nav nav{display:flex;gap:16px;flex-wrap:wrap}
.mk-nav nav a{color:#334;font-size:.92rem}
.mk-acts{display:flex;gap:10px;align-items:center}
.mk-login{font-size:.9rem;color:#1d4a3b;font-weight:700}
.mk-hero{background:linear-gradient(135deg,#143a2f,#1f5a47);color:#fff;padding:64px 0;text-align:center}
.mk-hero h1{font-size:2.1rem;line-height:1.5;margin:0 0 12px;color:#fff}
.mk-hero p{max-width:640px;margin:10px auto;opacity:.92;line-height:1.9}
.mk-cta{background:#fff!important;color:#143a2f!important;font-weight:800}
.mk-ghost{color:#fff;border:1px solid rgba(255,255,255,.5);border-radius:12px;padding:10px 16px;margin-inline-start:8px;display:inline-block}
.mk-sec{padding:44px 0}
.mk-sec h2{text-align:center;margin:0 0 6px}
.mk-alt{background:#f6f2ea}
.mk-steps b{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#1d4a3b;color:#fff}
.mk-final{background:#143a2f;color:#fff;text-align:center}
.mk-final h2{color:#fff}.mk-final .mk-ghost{color:#fff}
details.card{margin:10px 0;cursor:pointer}details.card summary{font-weight:700}
@media(max-width:640px){.mk-hero h1{font-size:1.5rem}.mk-nav nav{order:3;width:100%;justify-content:space-between;gap:6px}.mk-nav nav a{font-size:.8rem}.mk-nav .mk-in{padding-bottom:6px}}
.mk-nav nav a,.mk-login{text-decoration:none}.site-foot-in{display:flex;gap:14px;justify-content:center;align-items:center;flex-wrap:wrap}

/* v31: توحيد شكل الخانات والبطاقات */
form.stack{display:flex;flex-direction:column;gap:16px}
form.stack label{display:flex;flex-direction:column;gap:7px;margin:0;font-weight:700;font-size:.9rem;color:#2d3a35}
input[type=text],input[type=email],input[type=password],input[type=tel],input[type=number],input[type=url],input[type=date],input[type=time],input[type=search],select{
  box-sizing:border-box;width:100%;height:48px;padding:0 14px;border:1.5px solid #d9d2c4;border-radius:12px;background:#fff;font:inherit;font-weight:400;color:#1f2a26;transition:border-color .15s,box-shadow .15s}
textarea{box-sizing:border-box;width:100%;min-height:130px;padding:12px 14px;border:1.5px solid #d9d2c4;border-radius:12px;background:#fff;font:inherit;font-weight:400;line-height:1.7;resize:vertical}
input[type=file]{box-sizing:border-box;width:100%;padding:10px 12px;border:1.5px dashed #cfc7b6;border-radius:12px;background:#faf8f3;font:inherit;font-size:.88rem}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--brand,#1f4b3f);box-shadow:0 0 0 3px rgba(31,75,63,.14)}
form.stack .chk{flex-direction:row;align-items:center;gap:8px;font-weight:600}
form.stack .chk input{width:auto;height:auto}
form.stack .btn{align-self:flex-start;min-width:120px;height:46px}
.features{align-items:stretch;gap:18px}
.features>.card{display:flex;flex-direction:column;gap:6px;padding:22px;min-height:150px;border:1.5px solid #ece5d9;border-radius:16px;box-shadow:0 1px 3px rgba(0,0,0,.04);transition:border-color .15s,transform .15s}
.features>.card:hover{border-color:#1f4b3f;transform:translateY(-2px)}
.features>.card h3{margin:0;font-size:1.05rem;color:#1d4a3b}
.features>.card p{margin:0;line-height:1.8;color:#55625c}
.plans{align-items:stretch}.plan-card{display:flex;flex-direction:column;align-items:center;gap:8px;border:1.5px solid #ece5d9}.plan-card .btn{margin-top:auto;width:100%;box-sizing:border-box}
.mk-logo{display:inline-flex;align-items:center;gap:10px}.mk-logo img{height:38px;width:auto;max-width:140px;object-fit:contain;border-radius:8px}
.nav-logo{height:34px;width:auto;max-width:120px;object-fit:contain;border-radius:8px;background:#fff;padding:3px;margin-inline-end:6px;align-self:center}
.brand-row{display:flex;gap:14px;align-items:center}
.brand-prev{width:84px;height:84px;object-fit:contain;border:1.5px solid #ece5d9;border-radius:14px;background:#fff;display:grid;place-items:center;flex:none;font-size:.78rem;color:#8a948f;text-align:center}
.brand-fav{width:56px;height:56px;border-radius:10px}
.brand-empty{background:#faf8f3;border-style:dashed}
.mk-logo{text-decoration:none}
@media(min-width:900px){.mk-sec .features{grid-template-columns:repeat(3,1fr)}}
.legal{max-width:760px;padding-bottom:40px}.legal h2{font-size:1.15rem;margin:26px 0 6px;color:#1d4a3b}.legal p{line-height:2;color:#3a4540;margin:6px 0}

/* تذاكر الدعم (v32) */
.tk-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:10px;color:inherit;text-decoration:none}
.tk-row-main{display:flex;flex-direction:column;gap:4px;min-width:0}
.tk-badges{display:flex;gap:8px;align-items:center;flex:none}
.tk-st{display:inline-block;border-radius:999px;padding:3px 12px;font-size:.78rem;font-weight:700;background:#eee;color:#444;vertical-align:middle}
.tk-open{background:#fff3d6;color:#8a5a00}.tk-answered{background:#dff3e6;color:#1d6b3c}.tk-closed{background:#e8e8e8;color:#666}
.tk-new{font-style:normal;background:#c62828;color:#fff;border-radius:999px;padding:2px 10px;font-size:.74rem;font-weight:700}
.tk-thread{display:flex;flex-direction:column;gap:12px;margin:16px 0}
.tk-msg{max-width:88%;padding:12px 14px;border-radius:16px;line-height:1.8}
.tk-from-tenant{align-self:flex-start;background:#fff;border:1px solid #e4ddd0}
.tk-from-admin{align-self:flex-end;background:#e9f3ee;border:1px solid #cfe4d8}
.tk-who{font-weight:700;font-size:.82rem;color:#2d4a3f;margin-bottom:4px}.tk-who span{font-weight:400;color:#8a948f;margin-inline-start:8px}
.tk-img{max-width:100%;max-height:260px;border-radius:10px;margin-top:8px;display:block}
.tk-filter{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.tk-filter input[type=search]{flex:1;min-width:220px}.tk-filter select{width:auto;min-width:150px}
.tabs{display:flex;gap:8px;margin:10px 0}.tabs a{padding:8px 16px;border-radius:999px;background:#fff;border:1px solid #e4ddd0;color:#333}.tabs a.on{background:#1f4b3f;color:#fff;border-color:#1f4b3f}
a.note{text-decoration:none}a.note *{text-decoration:none}

/* محتوى الموقع (v33) */
.ct-row{display:flex;gap:10px;align-items:stretch;margin:10px 0;padding:10px;border:1.5px solid #ece5d9;border-radius:14px;background:#fffdf9}
.ct-fields{flex:1;display:flex;flex-direction:column;gap:8px;min-width:0}
.ct-fields textarea{min-height:64px}
.ct-btns{display:flex;flex-direction:column;gap:6px;justify-content:center}
.ct-btns button{width:38px;height:34px;border:1px solid #d9d2c4;background:#fff;border-radius:10px;cursor:pointer;font-size:.9rem}
.ct-btns .ct-del{color:#c62828}

/* ============================================================
   مراجعة تصميم شاملة (النسخة 35): تناسق، موبايل، أخطاء، فوتر
   ============================================================ */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, video, canvas, svg { max-width: 100%; }
::selection { background: #cfe5da; }
h1 { font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem); line-height: 1.35; }
h2 { font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); line-height: 1.4; }
h3 { font-size: 1.05rem; }
p { margin: .5em 0; }
.container { padding-inline: 16px; }

/* جداول: تتلف تلقائياً وتتسحب على الموبايل */
.tw-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border-radius: 12px; }
.tw-auto > table { min-width: 560px; }
table { border-collapse: collapse; }
table th { white-space: nowrap; font-size: .82rem; color: #5b6560; font-weight: 700; }
table td, table th { vertical-align: middle; }
table tbody tr:hover > td, table tr:hover > td { background-color: rgba(31,75,63,.03); }

/* حالات فاضية */
.empty-state, .empty-note {
  text-align: center; color: #7b837f; padding: 28px 16px; background: #fbfaf7;
  border: 1px dashed #d9d4c6; border-radius: 12px; font-size: .95rem; margin: 12px 0;
}
.card > p.muted:only-child { text-align: center; padding: 14px 0; }

/* رسائل التنبيه */
.flash { font-size: .95rem; padding: 11px 16px; border-bottom: 1px solid rgba(0,0,0,.06); }
.alert { border-radius: 10px; padding: 11px 14px; margin: 10px 0; }

/* صفحات الخطأ */
.err-box { text-align: center; max-width: 520px; padding: 8vh 16px 6vh; }
.err-code {
  font-family: var(--font-head); font-weight: 800; font-size: clamp(4rem, 18vw, 7rem); line-height: 1;
  color: #1f4b3f; opacity: .16; letter-spacing: .05em; margin-bottom: -6px;
}
.err-box h1 { margin: 0 0 8px; }
.err-box .btn { margin-top: 10px; }

/* صفحات الدخول */
.auth-box { margin-top: 7vh; }
.auth-box .card { box-shadow: 0 10px 34px rgba(20,53,44,.10); border: 1px solid #ebe6d9; }
.auth-box h1 { margin-bottom: 18px; }
.auth-box .btn { width: 100%; padding: 12px; }

/* الفوتر */
.site-foot-in { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; text-align: center; }
.site-foot-in > span:first-child { width: 100%; order: -1; margin-bottom: 2px; }
.site-foot-in > a { color: #4b5750; text-decoration: none; font-size: .86rem; }
.site-foot-in > a:hover { color: #1f4b3f; text-decoration: underline; }
.site-foot-in > a + a::before { content: ""; }

/* نماذج: ارتفاع وتباعد موحد */
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number],
input[type=url], input[type=search], input[type=date], input[type=time], select, textarea { min-height: 44px; }
textarea { line-height: 1.6; }
label { font-size: .93rem; }
.form-row { gap: 12px; }
input[type=checkbox], input[type=radio] { accent-color: #1f4b3f; width: 18px; height: 18px; min-height: 0; vertical-align: middle; }
button, .btn { min-height: 40px; touch-action: manipulation; }
.btn-small { min-height: 34px; }

/* موبايل */
@media (max-width: 820px) {
  .dash-nav {
    flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 2px; padding: 6px 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .dash-nav::-webkit-scrollbar { display: none; }
  .dash-nav a, .dash-nav button { flex: 0 0 auto; white-space: nowrap; padding: 9px 13px; }
  .dash-nav .nav-logo { height: 30px; flex: 0 0 auto; }
}
@media (max-width: 640px) {
  .container { padding-inline: 12px; }
  .card { padding: 14px; border-radius: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-row { flex-direction: column; grid-template-columns: 1fr; }
  .auth-box { margin-top: 3vh; }
  .alert-bar { font-size: .88rem; padding: 10px 12px; }
  .site-foot-in { padding: 14px 12px; }
  .tw-auto > table { min-width: 520px; }
  .btn, button { font-size: .95rem; }
  .flash { font-size: .88rem; }
}
.dash-nav ~ .container { max-width: 1100px; }
.two-col > *, .card, .stats > * { min-width: 0; }
.bars { overflow-x: auto; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr !important; } .bars { gap: 3px; } }
.nav-branch { background: rgba(255,255,255,.16); color: #fff; font-size: .82rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.nav-branch-sel { width: auto !important; min-height: 34px !important; padding: 4px 10px !important; border-radius: 999px !important; font-size: .82rem; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.nav-branch-sel option { color: #222; }
/* v37: اختيار الفرع للعميل */
.branch-landing{max-width:760px;margin:24px auto;text-align:center}
.branch-landing h1{margin:0 0 4px}
.branch-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:18px}
.branch-card{display:flex;flex-direction:column;gap:6px;align-items:center;padding:20px 14px;background:#fff;border:1px solid #e6dfcf;border-radius:16px;text-decoration:none;color:inherit;box-shadow:0 2px 10px rgba(40,30,10,.05)}
.branch-card:hover{border-color:var(--brand,#1f4b3f);transform:translateY(-2px)}
.branch-card strong{font-size:1.15rem}.branch-card span{color:#6b6455;font-size:.9rem}
.branch-card em{font-style:normal;margin-top:6px;background:var(--brand,#1f4b3f);color:#fff;padding:7px 16px;border-radius:99px;font-weight:700;font-size:.9rem}
.branch-chip{text-decoration:none}.branch-note{background:#f4f1ea;padding:8px 12px;border-radius:10px;margin:0 0 10px}

/* v38: اختيار الفرع في الطلب */
.branch-box{border:2px solid #e6dfcf;background:#fff;border-radius:14px;padding:14px 16px;margin:0 0 14px}
.branch-box.is-set{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#eef6f0;border-color:#b9d8c3}
.branch-box.is-set b{font-size:1.1rem;color:#1f4b3f}.branch-box-t{color:#4c5a50}.branch-box.is-set a{margin-inline-start:auto;font-weight:700}
.branch-required{border-color:#c0392b;background:#fff8f6}
.branch-required legend{font-weight:800;padding:0 8px;font-size:1.05rem}.branch-required .req{color:#c0392b}
.branch-box-hint{margin:0 0 10px;color:#6b6455;font-size:.92rem}
.branch-opt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1.5px solid #e6dfcf;border-radius:12px;margin-top:8px;background:#fff;cursor:pointer}
.branch-opt:has(input:checked){border-color:#1f4b3f;background:#eef6f0}
.branch-opt small{display:block;color:#6b6455}

/* v39: دفع يدوي + تذكير التجديد + إحصائيات الماستر */
.pay-box{border:1.5px solid #e6dfcf;border-radius:14px;padding:12px 14px;margin:0 0 14px;background:#fff}
.pay-box legend{font-weight:800;padding:0 8px}
.pay-num{font-weight:800;color:#1f4b3f;user-select:all}
.pay-proof{margin-top:10px;padding:12px;background:#fff8e6;border:1.5px dashed #e0a100;border-radius:12px}
.pay-proof p{margin:0 0 8px;font-weight:700}
.pay-line{margin-top:4px;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.pay-tag{background:#e8efe9;color:#1f4b3f;font-weight:700;padding:2px 8px;border-radius:99px}
.proof-link{display:inline-flex;color:#1f4b3f;background:#eef6f0;border:1px solid #b9d8c3;border-radius:8px;padding:3px}
.pay-btn{border:0;border-radius:99px;padding:3px 10px;font-size:.78rem;font-weight:700;cursor:pointer;background:#fdecc8;color:#8a5a00}
.pay-btn.is-ok{background:#d9efe0;color:#1e6b43}
.renew-banner{display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;background:#fff3cd;color:#7a5200;padding:10px 16px;font-weight:600}
.renew-banner.is-urgent{background:#fde0dc;color:#9a2a1c}
.renew-banner a{background:#1f4b3f;color:#fff;border-radius:99px;padding:4px 14px;text-decoration:none;font-weight:700}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;margin:10px 0 16px}
.stat-card{background:#fff;border:1px solid #e6dfcf;border-radius:14px;padding:14px 16px}
.stat-card b{display:block;font-size:1.7rem;color:#1f4b3f;line-height:1.2}.stat-card span{color:#6b6455;font-size:.88rem}.stat-card small{display:block;margin-top:4px;color:#8a8372}
.stat-card.warn b{color:#b8620a}.stat-card.bad b{color:#b03a2e}
.rev-chart{display:flex;gap:10px;align-items:flex-end;height:150px;padding:10px 4px 0}
.rev-col{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:4px;font-size:.8rem}
.rev-col i{display:block;width:100%;max-width:56px;background:#1f4b3f;border-radius:8px 8px 0 0;min-height:3px}

.promo-row{display:flex;gap:12px;align-items:center;margin-bottom:10px}.promo-thumb{width:110px;height:56px;object-fit:cover;border-radius:8px}

/* v42: تنبيه المخزون */
.stock-banner{display:flex;gap:12px;align-items:center;justify-content:center;flex-wrap:wrap;background:#ffe9c7;color:#8a4b00;padding:9px 16px;font-weight:700}
.stock-banner a{background:#8a4b00;color:#fff;border-radius:99px;padding:3px 14px;text-decoration:none}
.stock-limit{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}

.auto-hint{background:#fff3cd;color:#7a5200;border-radius:10px;padding:8px 12px;margin:8px 0;font-weight:700}

/* v51: مراجعة */
.btn-block{display:flex;align-items:center;justify-content:center}
.pos-sums .sum-row{display:flex;justify-content:space-between;padding:4px 0;font-size:.92rem}
.pos-sums .sum-row.is-total{font-weight:800;font-size:1.05rem;border-top:1px dashed #e6dfd3;margin-top:6px;padding-top:8px}
.pos-sums .sum-row.is-discount{color:#1b7a43;font-weight:700}
.pos-sums .sum-row[hidden]{display:none}
.pill{white-space:nowrap;display:inline-block}
table.list td .btn.btn-small{margin:2px 0}
td.actions-cell{display:table-cell;white-space:nowrap;vertical-align:middle}
td.actions-cell>form,td.actions-cell>a,td.actions-cell>button{display:inline-flex;vertical-align:middle;margin-inline-end:6px}
table.list td>form:not(.inline){display:flex;gap:6px;align-items:center;flex-wrap:wrap}
table.list td>form:not(.inline) select{width:auto}
table.list td>form:not(.inline){flex-wrap:nowrap}
table.list td>form:not(.inline) .btn{white-space:nowrap}
.admin-subs td:last-child{min-width:210px}
table.list td>a.btn{display:inline-block;margin:4px 6px 0 0}
.slug-status{min-height:22px;font-weight:700;font-size:.92rem}
.slug-status.ok{color:#1b7a3d}.slug-status.bad{color:#b42318}
.slug-alts{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.9rem;margin-bottom:6px}
.slug-alt{min-height:0!important;padding:4px 10px;border-radius:999px;border:1px solid #1f4b3f;background:#fff;color:#1f4b3f;cursor:pointer;font-weight:700}
.slug-alt:hover{background:#1f4b3f;color:#fff}

/* v55: معاينة جوجل */
.seo-prev{background:#fff;border:1px solid #e4e4e4;border-radius:12px;padding:12px 14px;direction:rtl}
.seo-prev .seo-url{display:block;color:#188038;font-size:.8rem;word-break:break-all}
.seo-prev .seo-t{color:#1a0dab;font-size:1.1rem;font-weight:600;margin:2px 0}
.seo-prev .seo-d{color:#4d5156;font-size:.88rem;line-height:1.6}
/* v55: تابات الإعدادات + معاينة الألوان */
.set-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 16px}
.set-tabs a{padding:8px 16px;border-radius:999px;background:#fff;border:1px solid #e3ddd0;color:#333;text-decoration:none;font-weight:700;font-size:.9rem}
.set-tabs a.on{background:#2c3e50;color:#fff;border-color:#2c3e50}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.theme-in{display:flex;align-items:center;gap:10px;margin-top:4px}
.theme-in input[type=color]{width:54px;height:40px;padding:2px;border-radius:10px;flex:none}
.theme-in code{font-size:.85rem;color:#555}
.th-prev{border:1px solid #ddd;border-radius:14px;overflow:hidden;font-size:.9rem}
.th-prev .tp-hero{padding:22px 14px;text-align:center;display:flex;flex-direction:column;gap:10px;align-items:center}
.th-prev .tp-nav{padding:10px 14px;display:flex;gap:6px;flex-wrap:wrap}
.th-prev .tp-nav span{padding:6px 12px;border-radius:8px}
.th-prev .tp-body{padding:14px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.th-prev .tp-btn{display:inline-block;padding:7px 16px;border-radius:9px;font-weight:700}
.th-prev .tp-white{background:#fff}
.th-prev .tp-link{text-decoration:underline;cursor:default}
.row-actions{display:flex;gap:8px;flex-wrap:wrap}
/* v55: تحسينات عامة على الشكل */
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
img{max-width:100%;height:auto}
.mk-hero{padding:76px 0 70px}
.mk-hero h1{font-size:2.4rem;letter-spacing:-.01em;text-wrap:balance}
.mk-hero p{font-size:1.05rem}
.mk-cta{box-shadow:0 8px 22px rgba(0,0,0,.18);border-radius:12px;padding:13px 26px}
.mk-sec{padding:56px 0}
.mk-sec h2{font-size:1.7rem;margin-bottom:18px}
.mk-nav{box-shadow:0 1px 10px rgba(0,0,0,.04)}
.features .card,.plan-card{transition:transform .18s ease,box-shadow .18s ease}
.features .card:hover,.plan-card:hover{transform:translateY(-3px);box-shadow:0 10px 28px rgba(0,0,0,.09)}
.plan-card{border:1px solid #ece6da;border-radius:18px}
details.card summary{cursor:pointer;font-weight:700}
.card{border-radius:16px}
table{border-collapse:collapse}
table th{background:#f3efe6;font-weight:700;white-space:nowrap}
table tbody tr:nth-child(even) td{background:rgba(0,0,0,.018)}
table tbody tr:hover td{background:rgba(0,0,0,.04)}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--brand,#1f4b3f);outline-offset:1px}
.dash-nav a{border-radius:0;font-size:.93rem}
.flash{box-shadow:0 1px 0 rgba(0,0,0,.05)}
@media(max-width:640px){.mk-hero{padding:48px 0}.mk-hero h1{font-size:1.6rem}.mk-sec{padding:38px 0}.container{padding:14px}}

.th-prev .tp-chip{display:inline-block;padding:3px 10px;border-radius:999px;font-weight:700;font-size:.8rem}
.th-prev .tp-hl{padding:0 8px;border-radius:6px}

/* محرر تصميم QR (النسخة 61) */
.qcard{position:relative}
.qc-border{position:absolute;inset:0;pointer-events:none;z-index:2}
.qcard .qc-inner{position:relative;z-index:1}
.qc-img{max-width:100%;height:auto;object-fit:contain;border-radius:8px}
.qdz-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px}
.qdz fieldset{border:1px solid #e6e0d4;border-radius:12px;padding:10px 12px;margin:0;display:flex;flex-direction:column;gap:8px}
.qdz legend{font-weight:800;padding:0 6px}
.qdz label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}
.qdz input[type=text],.qdz select{height:38px;max-width:60%;padding:0 8px;font-size:13px}
.qdz input[type=color]{width:46px;height:34px;padding:2px;min-height:0!important}
.qdz input[type=range]{width:55%}
.qdz input[type=file]{max-width:60%;font-size:12px;height:auto;padding:4px}
.rsz-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;align-items:start}
.rsz-frame-wrap{overflow:auto;max-height:560px;border:1px dashed #cfc7b6;border-radius:10px;background:#eee;padding:8px;text-align:center}
.rsz-frame-wrap iframe{border:0;background:#fff;max-width:100%;box-shadow:0 2px 10px rgba(0,0,0,.2)}
