:root {
  --blue: #1a7ae6;
  --blue-dark: #0e57b5;
  --blue-light: #4fb5f7;
  --orange: #f0932b;
  --orange-ink: #b45a08;
  --ink: #1b1d22;
  --muted: #5d6573;
  --line: #e3e8ef;
  --bg: #f3f7fc;
  --card: #fff;
  --danger: #d23b3b;
  --ok: #1f9d55;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(16, 60, 120, 0.08);
  --font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Header + logo ---------- */
.site-header {
  background: radial-gradient(circle at 20% 15%, var(--h1, #63c1fb) 0%, var(--h2, #1567d6) 100%);
  display: flex;
  justify-content: center;
}
.logo-link { display: block; line-height: 0; }
#logo {
  display: block;
  height: clamp(190px, 46vw, 300px);
  width: auto;
  object-fit: contain;
}

/* ---------- Search ---------- */
.search-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(var(--h2, #1567d6), var(--h2, #1567d6)) top / 100% 50% no-repeat, var(--bg);
  padding: 10px 14px 12px;
}
.search-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}
.search-inner input {
  width: 100%;
  height: 54px;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0 52px 0 46px;
  font-size: 17px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(10, 60, 130, 0.2);
  outline: none;
  -webkit-appearance: none;
}
.search-inner input:focus { border-color: var(--orange); }
.search-inner input::-webkit-search-cancel-button { display: none; }
.search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  fill: var(--blue);
  pointer-events: none;
}
.search-clear {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #eef3f9;
  cursor: pointer;
  font-size: 15px;
}

.demo-banner {
  background: #fff4d6;
  color: #6b4a00;
  font-size: 14px;
  text-align: center;
  padding: 6px 12px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 14px 32px;
  flex: 1;
}
.result-info { color: var(--muted); font-size: 14px; margin: 2px 4px 10px; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.site-footer a { color: var(--muted); }

/* ---------- Grid + cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 60, 120, 0.14); }
.card:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.card-img {
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-name { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.4; }
.price {
  font-weight: 800;
  color: var(--orange-ink);
  font-size: 20px;
  line-height: 1.3;
  direction: rtl;
}
.price .cur { font-size: 0.7em; font-weight: 700; margin-inline-start: 3px; }
.code {
  align-self: flex-start;
  direction: ltr;
  font-size: 13px;
  font-weight: 700;
  background: #e9f3fe;
  color: var(--blue-dark);
  border-radius: 8px;
  padding: 1px 8px;
  letter-spacing: 0.3px;
}
.card-desc {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
mark { background: #ffe7c2; color: inherit; border-radius: 3px; }

/* ---------- Empty / loading ---------- */
.empty {
  text-align: center;
  padding: 56px 16px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
}
.empty .big { font-size: 46px; display: block; margin-bottom: 6px; }
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #e8eef6 25%, #f4f8fc 50%, #e8eef6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  aspect-ratio: 3 / 4.2;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Buttons + forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  background: var(--blue);
  color: var(--on-primary, #fff);
  white-space: nowrap;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange); filter: brightness(0.92); }
.btn-light { background: #e9f1fb; color: var(--blue-dark); }
.btn-light:hover { background: #d9e8f9; }
.btn-danger { background: #fde8e8; color: var(--danger); }
.btn-danger:hover { background: #f9d3d3; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #b52c2c; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 15px; }
.field .hint { color: var(--muted); font-size: 13px; }
.input {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid #cdd6e2;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  background: #fff;
  outline: none;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 122, 230, 0.15); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.input.ltr { direction: ltr; text-align: right; }
.field.has-error .input, .field.has-error .dropzone { border-color: var(--danger); }
.err { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 0; }
.err:empty { display: none; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row .input { flex: 1; min-width: 0; }
.form-error {
  background: #fde8e8;
  color: #8f1d1d;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-weight: 600;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 180px;
  border: 2px dashed #b7c6da;
  border-radius: 14px;
  background: #f7faff;
  cursor: pointer;
  text-align: center;
  padding: 12px;
  color: var(--muted);
  position: relative;
}
.dropzone.drag { border-color: var(--blue); background: #eaf3ff; }
.dropzone img { max-height: 260px; width: auto; max-width: 100%; object-fit: contain; border-radius: 8px; background: #fff; }
.dropzone .dz-title { font-weight: 700; color: var(--blue-dark); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Dialogs ---------- */
.dialog {
  border: 0;
  padding: 0;
  border-radius: 20px;
  width: min(640px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  color: var(--ink);
}
.dialog::backdrop { background: rgba(10, 25, 50, 0.55); }
.dialog-inner { padding: 18px; }
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.dialog-head h2 { margin: 0; font-size: 19px; }
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: #eef3f9;
  font-size: 18px;
  cursor: pointer;
  flex: none;
}
.dialog-foot {
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: #fff;
}
.dialog-foot .btn { flex: 1; }
.dialog-confirm { width: min(420px, calc(100vw - 32px)); }
.dialog-confirm p { margin: 0 0 4px; font-size: 17px; }

.detail-img {
  background: #fff;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}
.detail-img img { max-height: 70vh; width: auto; max-width: 100%; object-fit: contain; display: block; }
.detail-body { padding: 16px 18px 20px; }
.detail-body h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.4; }
.detail-body .price { font-size: 26px; }
.detail-desc { white-space: pre-wrap; margin: 12px 0 0; font-size: 16px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.detail-actions { display: flex; gap: 10px; margin-top: 16px; }
.dialog-product .icon-btn.close-float {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 600px) {
  .dialog-product, .dialog-form {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
}

.success { text-align: center; padding: 30px 18px; }
.success .tick {
  width: 72px; height: 72px; border-radius: 50%;
  background: #e2f6ea; color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 38px; font-weight: 800; margin-bottom: 8px;
}
.success h3 { margin: 0 0 18px; font-size: 20px; }
.success .actions { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 0 auto; }

/* ---------- Admin ---------- */
.panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 18px;
  margin-bottom: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 20px; }
.login-box { max-width: 420px; margin: 24px auto; }
.admin-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.admin-top h1 { margin: 0; font-size: 22px; }
.admin-top .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-search { margin-bottom: 12px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.admin-item img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.admin-item .info { min-width: 0; }
.admin-item .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-item .price { font-size: 16px; }
.admin-item .btns { display: flex; gap: 6px; }
@media (max-width: 520px) {
  .admin-item { grid-template-columns: 56px 1fr; }
  .admin-item img { width: 56px; height: 56px; }
  .admin-item .btns { grid-column: 1 / -1; }
  .admin-item .btns .btn { flex: 1; }
}
.logo-preview {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.logo-preview img { width: 110px; height: 110px; object-fit: contain; border-radius: 12px; background: #1a7ae6; }

.toast {
  position: fixed;
  margin: 0;
  border: 0;
  inset: auto;
  top: auto;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #1b1d22;
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  z-index: 1000;
  font-weight: 600;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.toast.error { background: var(--danger); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auto-processing status ---------- */
.proc {
  margin-top: 8px;
  background: #f2f8ff;
  border: 1px solid #cfe3fb;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.proc-title { font-weight: 800; color: var(--blue-dark); display: flex; align-items: center; gap: 8px; }
.proc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proc-line.ok { color: var(--ok); font-weight: 600; }
.proc-line.bad { color: #8f1d1d; font-weight: 600; justify-content: space-between; }
.proc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.dot-spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2.5px solid #bcd6f5; border-top-color: var(--blue);
  animation: spin 0.8s linear infinite;
}

/* ---------- Stock / quantity ---------- */
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stock {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 8px;
  white-space: nowrap;
}
.stock-ok { background: #e3f6ea; color: #17733f; }
.stock-low { background: #fff1d6; color: #8a4b00; }
.stock-out { background: #fde4e4; color: #a12121; }
.card.is-out .card-img img { opacity: 0.55; filter: grayscale(0.4); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filter-row { display: flex; gap: 8px; margin: -4px 0 12px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid #cdd6e2;
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.chip.on { border-color: var(--blue); background: #e9f3fe; color: var(--blue-dark); }
.admin-item.low { border-color: #f3c27a; background: #fffaf0; }
.qty-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.qty-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid #cdd6e2;
  background: #fff;
  font-size: 18px; font-weight: 800;
  cursor: pointer;
  line-height: 1;
}
.qty-btn:active { background: #e9f3fe; }
.qty-val { min-width: 34px; text-align: center; font-weight: 800; font-size: 16px; }
.stock-alert {
  background: #fff4e0;
  border: 1.5px solid #f3c27a;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stock-alert .sa-title { font-weight: 800; color: #7a4100; font-size: 16px; }
.stock-alert .sa-list { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: #5b3a07; }
.stock-alert .btn { align-self: flex-start; }

/* ---------- Background style picker ---------- */
.bg-styles { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bg-styles > span { font-weight: 700; color: var(--blue-dark); }

/* ---------- Product display polish ---------- */
.card-img { padding: 0; background: #fff; overflow: hidden; }
.card-img img { transition: transform 0.25s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.detail-img { background: #fff; }
.detail-img img { max-height: min(70vh, 640px); }


/* ---------- Multi-store platform ---------- */
.muted { color: var(--muted); font-weight: 400; }
.ltr-text { direction: ltr; unicode-bidi: isolate; }
.no-price { font-size: 15px; color: var(--muted); font-weight: 700; }
.footer-links a { color: var(--muted); }
.who { color: var(--muted); font-size: 14px; margin-top: 2px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; scrollbar-width: none; }
.tab {
  flex: none; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 700;
  background: #fff; color: var(--muted); border: 1.5px solid var(--line);
}
.tab.on { background: var(--blue); color: var(--on-primary, #fff); border-color: var(--blue); }
.code-input { font-size: 28px; letter-spacing: 10px; text-align: center !important; font-weight: 800; }
.login-store { display: flex; align-items: center; gap: 12px; background: #f6f8fb; border-radius: 12px; padding: 10px; margin-bottom: 14px; }
.login-store img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.login-store b { display: block; font-size: 17px; }
.login-store span { color: var(--muted); font-size: 13px; }
.login-links { text-align: center; margin: 14px 0 0; font-size: 14px; }
.linkish { background: none; border: 0; color: var(--blue-dark); cursor: pointer; font-weight: 700; padding: 0; text-decoration: underline; }
.notif-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  background: #eef4ff; border: 1.5px solid #c9dafc; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600;
}
.inv-list { display: flex; flex-direction: column; gap: 8px; }
.inv-row {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff;
}
.inv-row.low { border-color: #f3c27a; background: #fffaf0; }
.inv-row.saving { opacity: 0.7; }
.inv-row img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.inv-row .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-row .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.inv-row .info { min-width: 0; }
.qty-edit { display: flex; align-items: center; gap: 4px; }
.qty-input { width: 70px; min-height: 40px; text-align: center !important; padding: 6px; font-weight: 800; font-size: 17px; }
@media (max-width: 520px) {
  .inv-row { grid-template-columns: 44px 1fr; }
  .inv-row img { width: 44px; height: 44px; }
  .qty-edit { grid-column: 1 / -1; justify-content: center; }
}
.member { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: #fff; }
.member.revoked { background: #fafafa; opacity: 0.85; }
.member-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 12px; }
.perm { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.perm input { width: 18px; height: 18px; accent-color: var(--blue); }
.member-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.secret { font-size: 22px; font-weight: 800; background: #f3f6fa; border: 1.5px dashed #b7c6da; border-radius: 10px; padding: 10px; text-align: center; user-select: all; }
.perm-note { background: #f6f8fb; border-radius: 10px; padding: 8px 12px; color: var(--muted); font-weight: 600; }
.dropzone.locked { cursor: default; }
.input[readonly] { background: #f5f7fa; color: #4a5160; }
.log { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.log-when { color: var(--muted); font-size: 13px; }
.log-target { background: #f1f4f8; border-radius: 6px; padding: 0 6px; margin-inline-start: 4px; }
.log-detail { display: inline-block; margin-inline-start: 6px; font-weight: 700; color: var(--blue-dark); }
@media (max-width: 560px) { .log-row { grid-template-columns: 1fr; gap: 2px; } }
.switch-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch-row input { width: 22px; height: 22px; accent-color: var(--blue); flex: none; margin-top: 3px; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.store-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.store-card.off { opacity: 0.75; background: #fafafa; }
.sc-head { display: flex; gap: 12px; align-items: center; }
.sc-head img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); }
.sc-head h3 { margin: 0 0 4px; font-size: 18px; }
.sc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.sc-info { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: #3a4150; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-pick { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-weight: 700; font-size: 14px; }
.theme-pick input { accent-color: var(--blue); }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 3px solid; display: inline-flex; align-items: center; justify-content: center; }
.swatch i { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Home hub ---------- */
.hub-title { text-align: center; font-size: 22px; margin: 6px 0 16px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; max-width: 760px; margin: 0 auto; }
.hub-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 0 0 14px; overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hub-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16, 60, 120, 0.16); }
.hub-logo { width: 100%; aspect-ratio: 1 / 1; background: radial-gradient(circle at 30% 20%, var(--c1), var(--c2)); display: flex; align-items: center; justify-content: center; }
.hub-logo img { width: 100%; height: 100%; object-fit: contain; }
.hub-name { font-weight: 800; font-size: 16px; text-align: center; padding: 0 10px; line-height: 1.4; }
.hub-go { font-size: 14px; font-weight: 700; color: var(--co, #fff); background: var(--cp); padding: 6px 14px; border-radius: 999px; }
.hub-login { text-align: center; margin: 26px 0 6px; }

/* أعضاء المتاجر ما بيشوفوا روابط باقي المتاجر */
.member-mode .footer-links a[href="#/"] { display: none; }

/* ---------- الكاشير بالصورة */
.cam-btn { font-size: 1.15rem; padding: 16px; position: relative; }
.cam-btn.disabled { opacity: .55; pointer-events: none; }
#shotBox:not(:empty) { margin-top: 12px; }
.shot-msg, .shot-ok, .shot-choose, .shot-none { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fafcff; }
.shot-ok { border-color: #34c27a; background: #effbf4; }
.shot-none { border-color: #f0b24b; background: #fff8ec; }
.shot-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; }
.pick-list { display: grid; gap: 8px; margin-top: 8px; }
.admin-item.pick { width: 100%; text-align: start; font: inherit; cursor: pointer; background: #fff; grid-template-columns: 64px 1fr; }
.admin-item.pick:hover { border-color: var(--blue); }
.chip-sm { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #e9f3fe; color: var(--blue-dark); font-size: .8rem; font-weight: 700; }
.manual { margin-top: 12px; }
.manual summary { cursor: pointer; font-weight: 700; color: var(--blue-dark); padding: 6px 0; }
.manual .input { margin-top: 6px; }
.cart-line { display: grid; grid-template-columns: 48px 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cart-line.low { background: #fff3f3; }
.cart-line img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.cart-line .info { min-width: 0; }
.cart-line .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .85rem; }
.cart-line .qty { display: flex; gap: 4px; align-items: center; }
.qty-in { width: 56px; text-align: center; padding: 6px 4px; }
.line-total { font-weight: 700; white-space: nowrap; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; padding: 12px 0; }
@media (max-width: 560px) {
  .cart-line { grid-template-columns: 44px 1fr auto; }
  .cart-line .qty { grid-column: 2; }
  .cart-line .line-total { grid-column: 3; grid-row: 1; }
  .cart-line .icon-btn { grid-column: 3; grid-row: 2; }
}
.sale { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.sale summary { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 12px; cursor: pointer; align-items: center; }
.sale.void { opacity: .65; }
.sale-total { font-weight: 800; }
.sale-items { padding: 0 12px 12px; }
.sale-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.sale-table td { padding: 6px 4px; border-top: 1px solid var(--line); }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ref-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 6px; text-align: center; background: #fff; }
.ref-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.ref-grid figcaption { font-size: .8rem; display: grid; gap: 4px; }
.form-note { background: #fff8ec; border: 1px solid #f0b24b; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; }
