@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;500;600;700&family=Noto+Kufi+Arabic:wght@400;500;600;700&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');

:root {
  --bg: #eef5ef;
  --bg-strong: #ddebdc;
  --card: #fffdf9;
  --card-alt: #f3f8f2;
  --primary: #3f6f52;
  --primary-deep: #2c4c38;
  --primary-soft: #d9ebdc;
  --accent: #2b5f4f;
  --accent-soft: #dfeee5;
  --text: #1a261d;
  --muted: #4f5f57;
  --border: rgba(47, 79, 62, 0.17);
  --shadow: 0 18px 36px rgba(31, 48, 40, 0.12);
  --success-bg: #edf9f0;
  --success-text: #1d5a3f;
  --error-bg: #fff4f2;
  --error-text: #8a3a2d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Tahoma", "Arial", sans-serif;
  background:
    radial-gradient(circle at top, rgba(63, 111, 82, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #edf4ee 100%);
  color: var(--text);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-align: start;
}

[dir="rtl"],
[dir="rtl"] body,
body[dir="rtl"] {
  font-family: "Noto Sans Arabic", "Noto Kufi Arabic", "Segoe UI", "Tahoma", "Arial", sans-serif;
}

[dir="rtl"] body,
body[dir="rtl"] {
  text-align: right;
}

h1, h2, h3, h4 {
  font-family: "Noto Naskh Arabic", "Noto Kufi Arabic", Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: #1b1b1b;
  margin-top: 0;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
body[dir="rtl"] h1,
body[dir="rtl"] h2,
body[dir="rtl"] h3,
body[dir="rtl"] h4 {
  font-family: "Noto Naskh Arabic", "Noto Kufi Arabic", Georgia, "Times New Roman", serif;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  background: linear-gradient(180deg, #13261b 0%, #1d3527 100%);
  color: #edf7f0;
  padding: 18px 0;
  border-bottom: 1px solid rgba(122, 170, 139, 0.35);
}

.customer-page .topbar,
.customer-page .customer-shell,
.customer-page .hidden-on-customer-page {
  display: none !important;
}

.hidden-on-customer-page {
  display: none !important;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lang-toggle {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  color: #edf7f0;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav strong {
  font-family: "Noto Kufi Arabic", "Noto Sans Arabic", "Segoe UI", "Tahoma", "Arial", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #edf7f0;
}

nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* The staff menu's links (staff-nav.js) sit in the nav's row as if they were its own children. */
.staff-links {
  display: contents;
}

nav a {
  color: #edf7f0;
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.88;
}

.page {
  padding-top: 34px;
  padding-bottom: 64px;
}

.scanner-page {
  max-width: 520px;
  margin: 0 auto;
}

.card {
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 26px;
  backdrop-filter: blur(2px);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

.luxury-hero {
  background:
    radial-gradient(circle at top left, rgba(63, 111, 82, 0.12), transparent 26%),
    linear-gradient(135deg, #f7faf7 0%, #edf4ee 50%, #e6efe8 100%);
  border: 1px solid rgba(63, 111, 82, 0.18);
  box-shadow: 0 20px 40px rgba(17, 31, 24, 0.08);
}

.hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -80px;
  bottom: -120px;
  border-radius: 50%;
  background: rgba(63, 111, 82, 0.06);
}

.eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-deep);
  margin-bottom: 10px;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 3.5vw, 3.6rem);
  line-height: 1.03;
  margin-bottom: 12px;
}

.hero-copy p {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 530px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.primary-cta,
.secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 700;
}

.primary-cta {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #f5fbf7;
  box-shadow: 0 12px 24px rgba(44, 76, 56, 0.2);
}

.secondary-cta {
  border: 1px solid rgba(117, 93, 65, 0.2);
  color: var(--text);
  background: rgba(255,255,255,0.3);
}

.mini-stats {
  list-style: none;
  display: flex;
  gap: 12px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.mini-stats li {
  display: flex;
  flex-direction: column;
  min-width: 100px;
  background: rgba(255,255,255,0.26);
  border: 1px solid rgba(117, 93, 65, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
}

.mini-stats strong {
  font-size: 1.05rem;
  font-family: "Noto Sans Arabic", "Noto Kufi Arabic", "Segoe UI", "Tahoma", "Arial", sans-serif;
}

.mini-stats span {
  font-size: 0.76rem;
  color: var(--muted);
}

.wallet-preview {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Sample member card on the home page. Mirrors .premium-card in customer-card.html. */
.sample-card {
  width: min(100%, 430px);
  border-radius: 28px;
  padding: 22px 22px 18px;
  background: linear-gradient(135deg, #0d1d14 0%, #123022 18%, #264a3a 44%, #4c7e66 100%);
  color: #edf7f0;
  box-shadow: 0 30px 58px rgba(10, 25, 18, 0.28);
  border: 1px solid rgba(185, 232, 200, 0.24);
  position: relative;
  overflow: hidden;
}

.sample-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.06), transparent 32%, rgba(255,255,255,0.02));
  pointer-events: none;
}

.sample-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -50px;
  top: -55px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  filter: blur(8px);
  pointer-events: none;
}

.sample-card > * {
  position: relative;
  z-index: 1;
}

.sample-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.sample-brand {
  font-family: "Noto Kufi Arabic", "Noto Sans Arabic", "Segoe UI", "Tahoma", "Arial", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d8efe0;
}

.sample-tier {
  border: 1px solid rgba(212, 238, 220, 0.42);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d9f3de;
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}

/* The hidden attribute always wins over display rules (banners, panels toggled by script). */
[hidden] {
  display: none !important;
}

.sample-banner {
  display: block;
  width: 100%;
  aspect-ratio: 1125 / 369;
  object-fit: cover;
  border-radius: 14px;
  margin: -10px 0 16px;
}

.sample-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.sample-label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(249, 242, 234, 0.68);
  margin-bottom: 10px;
}

.sample-name,
.sample-points {
  font-family: "Noto Naskh Arabic", "Noto Kufi Arabic", Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.05;
}

.sample-points-box {
  text-align: end;
  min-width: 80px;
}

.sample-account {
  margin: 4px 0 0;
}

.sample-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(249, 242, 234, 0.15), rgba(249, 242, 234, 0.35), rgba(249, 242, 234, 0.15));
  margin: 18px 0 16px;
}

.sample-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.sample-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sample-qr-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(242, 247, 242, 0.95);
  border-radius: 18px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(18, 48, 34, 0.08);
}

.sample-qr-frame canvas {
  display: block;
}

.sample-scan {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(223, 239, 228, 0.8);
}

.sample-code {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #dcefe1;
  white-space: nowrap;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 26px;
}

.feature-card {
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(63, 111, 82, 0.14);
  border-radius: 18px;
  box-shadow: 0 10px 20px rgba(31, 48, 40, 0.06);
  padding: 18px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(31, 48, 40, 0.1);
}

.compact-features {
  gap: 14px;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--primary-soft) 0%, #edf3ee 100%);
  color: var(--primary-deep);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.split-flow {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 18px;
}

.membership-card {
  padding-top: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(238,246,240,0.98) 100%);
  border: 1px solid rgba(63, 111, 82, 0.18);
  box-shadow: 0 18px 32px rgba(31, 48, 40, 0.08);
}

.existing-member-card {
  background: linear-gradient(180deg, rgba(251,247,242,0.96) 0%, rgba(245,239,232,0.96) 100%);
  border: 1px solid rgba(117, 93, 65, 0.18);
}

/* Joining alone at the top: one centred column. */
.split-flow.join-only {
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}

/* "Already a member?" lower down the page: the WhatsApp-link note, then the form. */
.member-strip {
  max-width: 860px;
  margin: 0 auto 18px;
  box-sizing: border-box;
  width: 100%;
}

.member-link-note {
  margin: 10px 0 6px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #eaf6ee;
  border: 1px solid rgba(37, 135, 80, 0.25);
  color: #1d5b3a;
  font-size: 0.9rem;
  line-height: 1.6;
}

.card-code-field {
  display: grid;
  gap: 6px;
}

.join-form button,
.secondary-lookup button {
  width: 100%;
}

.join-form .link-like {
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header.compact {
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  margin-bottom: 0;
}

.section-copy {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.96rem;
  max-width: 520px;
}

.compact-copy {
  margin-top: -4px;
}

.join-form {
  margin-top: 10px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-direction: row;
  text-transform: none;
  letter-spacing: normal;
  margin: 18px 0 18px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.checkbox-row span {
  color: var(--muted);
  line-height: 1.5;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(200px, 1fr));
}

.four-col {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  gap: 8px;
  margin-bottom: 12px;
}

[dir="rtl"] label,
body[dir="rtl"] label {
  text-align: right;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  border: 1px solid rgba(117, 93, 65, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Birth date as day / month / year lists of numbers (date-select.js). */
.date-select {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 8px;
  min-width: 0;
}
.date-select select { min-width: 0; width: 100%; }
.lookup-row .date-select { flex: 1 1 220px; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(181, 138, 74, 0.25);
  border-color: var(--primary);
}

button {
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fffaf1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(140, 104, 49, 0.18);
}

button.secondary {
  background: linear-gradient(180deg, #f0e7dc 0%, #e9ddd0 100%);
  color: #2a2117;
  box-shadow: none;
}

.compact-btn {
  padding: 12px 16px;
  min-width: 110px;
  font-size: 0.7rem;
}

button:hover {
  filter: brightness(1.03);
}

.result,
.status-box,
.customer-card,
.stat-box {
  margin-top: 18px;
  border-radius: 14px;
  padding: 16px 18px;
}

.result {
  background: var(--success-bg);
  border: 1px solid rgba(31, 92, 75, 0.2);
  color: var(--success-text);
}

.result.error {
  background: var(--error-bg);
  border-color: rgba(138, 58, 45, 0.25);
  color: var(--error-text);
}

.status-box {
  background: #f7f2eb;
  border: 1px solid var(--border);
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill.success {
  background: rgba(11, 93, 61, 0.12);
  color: #0a5c3e;
  border: 1px solid rgba(11, 93, 61, 0.18);
}

.validated-customer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.validated-customer-header h3 {
  margin: 0;
  font-size: 1.4rem;
}

.validated-customer-body {
  display: grid;
  gap: 10px;
}

.validated-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(121, 90, 58, 0.12);
}

.validated-row span {
  color: var(--muted);
}

.validated-row strong {
  color: var(--text);
}

.hidden {
  display: none;
}

.scanner-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(11, 93, 61, 0.98), rgba(7, 70, 47, 0.98));
  color: #f4fff8;
  border: 1px solid rgba(167, 243, 208, 0.4);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 16px 34px rgba(7, 70, 47, 0.28);
  z-index: 30;
  max-width: calc(100vw - 24px);
  text-align: center;
}

.lookup-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.secondary-lookup {
  margin-top: 10px;
}

.lookup-row input {
  flex: 1;
}

.customer-card {
  background: linear-gradient(135deg, #f6f0e6 0%, #f0e8dc 100%);
  border: 1px solid rgba(181, 138, 74, 0.25);
  color: var(--text);
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.customer-detail-grid ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  border: 1px solid var(--border);
  background: #fffdf9;
  border-radius: 12px;
  padding: 12px 14px;
}

.activity-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.activity-copy {
  font-weight: 600;
  color: var(--text);
}

.empty-state {
  color: var(--muted);
  padding: 12px 0;
}

.customer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(181, 138, 74, 0.2);
  padding-bottom: 12px;
}

.customer-meta h3 {
  margin-bottom: 6px;
}

.points-badge {
  display: inline-block;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #f4fbf5;
  border-radius: 999px;
  font-weight: 700;
  padding: 8px 12px;
  letter-spacing: 0.04em;
}

.stats {
  margin-bottom: 24px;
}

.stat-box {
  background: linear-gradient(180deg, #fffcf8 0%, #f7f0e5 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat-box h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.stat-box strong {
  font-size: 2rem;
  font-family: Georgia, "Times New Roman", serif;
}

.full-width {
  grid-column: 1 / -1;
}

#video {
  width: 100%;
  max-width: 420px;
  background: #111827;
  border-radius: 14px;
  margin-bottom: 12px;
  border: 2px solid rgba(181, 138, 74, 0.4);
}

.scanner-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 480px;
  margin: 0 auto;
}

/* (No forced height: the cards end where their content ends, with the camera on or off.) */

.camera-wrap {
  background: linear-gradient(180deg, #12100f 0%, #2a221d 100%);
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(181, 138, 74, 0.35);
  margin-bottom: 14px;
}

#video {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 260px;
  /* An upright phone camera gives a tall picture: keep it to a band, not most of the page. */
  max-height: 45vh;
  object-fit: cover;
  background: #111827;
  border-radius: 14px;
  margin: 0;
  border: none;
}

.wide-btn {
  width: 100%;
}

.manual-transaction {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  background: linear-gradient(180deg, #fffdf9 0%, #f7f0e4 100%);
  border: 1px solid rgba(121, 90, 58, 0.14);
  border-radius: 18px;
  padding: 16px;
}

.manual-transaction label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.manual-transaction input {
  background: #fff;
  border: 1px solid rgba(121, 90, 58, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
}

.tx-step {
  font-weight: 700;
  color: var(--text);
}

.tx-types {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

button.tx-type {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  text-align: start;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: none;
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
}

button.tx-type .tx-icon {
  width: 44px;
  height: 44px;
  line-height: 0;
}

button.tx-type .tx-icon svg {
  width: 44px;
  height: 44px;
}

button.tx-type .tx-label {
  font-weight: 700;
  line-height: 1.4;
}

button.tx-type.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-deep);
  box-shadow: 0 0 0 3px rgba(63, 111, 82, 0.18);
}

/* Selling gold (we pay the customer) looks different from buying, so the two are never confused. */
button.tx-type.sell {
  border-color: #c9a14a;
  background: #fdf7e8;
}

button.tx-type.sell.selected {
  border-color: #9a6b12;
  background: #f6e7b8;
  color: #5b4300;
  box-shadow: 0 0 0 3px rgba(154, 107, 18, 0.2);
}

button.tx-type .tx-direction {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
}

.confirm-direction {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
}

.confirm-direction.pay-in {
  background: #e3f3e6;
  color: #1d5a3f;
}

.confirm-direction.pay-out {
  background: #f6e7b8;
  color: #5b4300;
}

button.tx-type.redeem.selected {
  border-color: #a4632a;
  background: #fbeedd;
  color: #6b3c12;
  box-shadow: 0 0 0 3px rgba(164, 99, 42, 0.18);
}

.manual-transaction .hidden {
  display: none;
}

.manual-transaction label,
.manual-transaction > * {
  min-width: 0;
}

.tx-amount input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  direction: ltr;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.confirm-box {
  border: 2px solid var(--primary);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f7f2eb;
}

.confirm-row.confirm-points strong {
  font-size: 1.5rem;
}

.confirm-row.confirm-points.plus strong {
  color: var(--success-text);
}

.confirm-row.confirm-points.minus strong {
  color: var(--error-text);
}

.confirm-warning {
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
}

.use-points {
  display: grid;
  gap: 8px;
}

.receipt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 10px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

#salePointsSummary {
  background: linear-gradient(180deg, rgba(11, 93, 61, 0.08), rgba(11, 93, 61, 0.02));
  border-color: rgba(11, 93, 61, 0.2);
  color: #0d5d3d;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(11, 93, 61, 0.04);
}

#scannerResult .result {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.26);
}

.lookup-row.stacked-mobile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

/* "See your balance": phone, then birth date (three lists), then the button, one under the other. */
.lookup-row.secondary-lookup {
  grid-template-columns: 1fr;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th,
.table td {
  text-align: right;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(117, 93, 65, 0.18);
}

.table th {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

.customer-row {
  cursor: pointer;
}

.customer-row:hover {
  background: rgba(181, 138, 74, 0.05);
}

.admin-panels {
  align-items: start;
}

.search-row {
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }

  .page {
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .scanner-page {
    max-width: 100%;
  }

  .nav {
    align-items: flex-start;
    gap: 12px;
  }

  .nav strong {
    font-size: 1.05rem;
  }

  nav {
    gap: 8px;
  }

  nav a {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .lang-toggle {
    align-self: center;
    font-size: 0.58rem;
    padding: 6px 8px;
  }

  .card {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .scanner-layout {
    max-width: 100%;
    gap: 14px;
  }

  .manual-transaction {
    padding: 12px;
  }

  .validated-row {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .validated-customer-header h3 {
    font-size: 1.15rem;
  }

  .lookup-row.stacked-mobile {
    grid-template-columns: 1fr;
  }

  #video {
    min-height: 220px;
  }

  .page {
    padding-top: 18px;
    padding-bottom: 32px;
  }

  .hero-copy h1 {
    font-size: 2.2rem;
    line-height: 1.08;
  }

  .hero {
    padding: 20px 16px 18px;
  }

  .card {
    padding: 18px 16px;
    margin-bottom: 18px;
    border-radius: 16px;
  }

  .two-col,
  .four-col,
  .scanner-layout,
  .feature-grid,
  .hero,
  .split-flow {
    grid-template-columns: 1fr;
  }

  nav {
    font-size: 0.75rem;
    gap: 8px 12px;
    flex-wrap: wrap;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: 2.5rem;
    line-height: 1.04;
  }

  .hero-copy p {
    font-size: 0.98rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .primary-cta,
  .secondary-cta {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .mini-stats li {
    min-width: 0;
    padding: 10px 8px;
  }

  .lookup-row,
  .lookup-row.stacked-mobile,
  .search-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-detail-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 18px 16px;
  }


  label {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
  }

  input,
  select,
  textarea,
  button {
    min-height: 46px;
  }

  button {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .result {
    padding: 12px 14px;
  }

  .membership-card,
  .feature-card {
    padding: 16px 14px;
  }

  .hero-copy h1 {
    font-size: 2.2rem;
  }


  .card {
    padding: 18px 16px;
  }

  .topbar {
    padding: 14px 0;
  }
}

.staff-chip {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.temp-password code {
  display: inline-block;
  margin: 8px 0;
  padding: 8px 14px;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 10px;
  user-select: all;
}

/* Scanner: "scan to join" QR code for customers. */
.join-qr-card {
  display: flex;
  align-items: center;
  gap: 18px;
  grid-column: 1 / -1;
}

.join-qr-card[hidden] {
  display: none;
}

.join-qr {
  flex: 0 0 auto;
  border-radius: 12px;
}

.join-qr-text h2 {
  margin: 4px 0;
}

.join-qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(10, 26, 18, 0.92);
  color: #f2f7f2;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
}

.join-qr-overlay.hidden {
  display: none;
}

.join-qr-large {
  border-radius: 18px;
  background: #f2f7f2;
}

@media (max-width: 560px) {
  .join-qr-card {
    flex-direction: column;
    text-align: center;
  }
}

/* Scanner: register a customer and send their card link. */
.new-customer,
.share-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfaf6;
}

.new-customer.hidden,
.share-panel.hidden {
  display: none;
}

.new-customer label {
  display: grid;
  gap: 4px;
}

.nc-actions,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-message p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.button-link.whatsapp {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: #1f8f4e;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.share-link-btn {
  margin-top: 10px;
}

.phone-check {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9a5b12;
}

.phone-check.ok {
  color: #1d5a3f;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

/* Why no points can be used right now (waiting period, no points, small bill). */
.field-hint.hint-warn {
  font-size: 0.9rem;
  font-weight: 600;
  color: #9a3412;
}

/* Phones and tablets: iPhone zooms into any text box smaller than 16px when it is tapped (and stays zoomed),
   so fields are at least 16px on touch screens. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* The menu (top): the website, the shop's contacts and pages. */
.topline-tools { display: flex; align-items: center; gap: 8px; }
.card-menu { position: relative; }
.card-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-deep);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(63, 111, 82, 0.22);
  white-space: nowrap;
}
.card-menu summary::-webkit-details-marker { display: none; }
.card-menu-list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 220px;
  display: grid;
  padding: 6px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(63, 111, 82, 0.18);
  box-shadow: 0 18px 40px rgba(17, 31, 24, 0.18);
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.92rem;
}
.card-menu-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  text-transform: none !important;
  letter-spacing: normal !important;
}
.card-menu-list a:hover, .card-menu-list a:focus-visible { background: #f2f6f3; }
/* Menu icons: line icons in the shop's green, each network's logo in its own colour. */
.card-menu-list .menu-icon { width: 22px; height: 22px; display: inline-grid; place-items: center; flex: 0 0 22px; color: var(--primary, #3f6f52); }
.card-menu-list .menu-icon svg { width: 20px; height: 20px; }
.card-menu-list .icon-collection { color: #b58a4a; }
.card-menu-list .icon-whatsapp { color: #25d366; }
.card-menu-list .icon-instagram { color: #e1306c; }
.card-menu-list .icon-facebook { color: #1877f2; }
.card-menu-list .icon-tiktok { color: #111111; }
.card-menu-list .icon-snapchat { color: #e6c700; }
.card-menu-list .icon-website { color: #4a6fa5; }
.card-menu-list hr { border: 0; border-top: 1px solid #e7ece8; margin: 4px 6px; }

/* The jewelry website, at the top: the newest pieces' photos, one tap to the catalog. */
.collection-banner {
  width: min(100%, 430px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  text-decoration: none;
  color: #2c2417;
  background: linear-gradient(120deg, #fffaf0 0%, #f7ecd6 55%, #efdcb6 100%);
  border: 1px solid rgba(181, 138, 74, 0.45);
  box-shadow: 0 14px 30px rgba(120, 90, 40, 0.16);
  margin-bottom: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.collection-banner:active { transform: scale(0.98); }
.collection-banner:hover { box-shadow: 0 18px 36px rgba(120, 90, 40, 0.24); }
.cb-pics { display: flex; flex: 0 0 auto; }
.cb-pics:empty { display: none; }
.cb-pics img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid #fffaf0;
  box-shadow: 0 4px 10px rgba(60, 40, 10, 0.18);
  background: #fff;
}
.cb-pics img + img { margin-inline-start: -20px; }
.cb-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.cb-text strong { font-size: 1.05rem; white-space: nowrap; }
.cb-text small { color: #6b5a3e; line-height: 1.45; font-size: 0.86rem; }
.cb-go {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, #c79a4f, #9c7433);
  box-shadow: 0 6px 14px rgba(156, 116, 51, 0.35);
}
body[dir="ltr"] .cb-go { transform: scaleX(-1); }
@media (max-width: 370px) { .cb-pics img + img + img { display: none; } }

/* On the rewards page the menu sits in the dark top bar. */
.topbar .card-menu summary {
  color: #edf7f0;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}
.topbar .card-menu-list { color: var(--text); }
.page > .collection-banner { width: 100%; margin: 0 0 18px; }

/* The shop's Google rating (google-rating.js), under the join form's line. */
.g-rating { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid rgba(117, 93, 65, 0.18); color: var(--text); text-decoration: none; font-size: 0.88rem; }
.g-rating .gr-stars { color: #f2a900; letter-spacing: 1px; }
.g-rating strong { font-weight: 700; }
.g-rating span:last-child { color: var(--muted, #6b746e); }

/* Phones: the open menu spans the screen under its button, so it never runs off either side. */
@media (max-width: 600px) {
  .card-menu-list {
    position: fixed;
    top: auto;
    left: 16px;
    right: 16px;
    min-width: 0;
    margin-top: 8px;
  }
}

/* The shared repairs phone scanning: who is scanning now (red until a name is picked). */
.actor-bar { display: grid; gap: 6px; border: 2px solid rgba(63, 111, 82, 0.35); }
.actor-bar label { display: grid; gap: 6px; font-weight: 700; }
.actor-bar.missing { border-color: #c0392b; background: #fff6f5; }

/* ادّخر ذهبك at the scanner. */
.savings-card { display: grid; gap: 10px; border: 1px solid rgba(201, 154, 62, 0.45); background: linear-gradient(160deg, #fffaf0, #f8eedb); }
.savings-card h3 { margin: 0; color: #7a5413; }
.savings-balance { margin: 0; font-weight: 700; color: #3d2f12; }
.savings-stale { padding: 10px 12px; border-radius: 12px; background: #fff1ef; border: 1px solid #e6b3ab; color: #8a3a2d; font-weight: 600; line-height: 1.6; }
.savings-modes { display: flex; gap: 8px; }
.savings-mode { flex: 1; background: #fff; color: #5b3e0c; border: 1px solid rgba(201, 154, 62, 0.45); box-shadow: none; }
.savings-mode.selected { background: linear-gradient(135deg, #d4a548, #a87a2a); color: #fff; border-color: transparent; }

/* Scanner: search first; the camera, the QR photo, a new customer and the join code as small side-by-side buttons. */
.scan-title { margin: 0 0 10px; font-size: 1.15rem; }
.scan-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.scan-tools button { width: 100%; min-height: 44px; padding: 10px 8px; font-size: 0.85rem; }
.scan-tools button[hidden] { display: none; }
.scan-tools:has(button[hidden]) { grid-template-columns: 1fr; }
.scanner-panel .camera-wrap { margin-top: 10px; }
.scan-status { margin-top: 10px; font-size: 0.85rem; padding: 8px 12px; }

/* No customer found yet: the actions greyed out and locked, with the reason above them. */
.tx-locked { padding: 8px 12px; border-radius: 10px; background: #fff4e6; border: 1px solid #f0c9a8; color: #8a3a2d; font-weight: 700; font-size: 0.85rem; }
.tx-locked[hidden] { display: none; }
.manual-transaction.locked .tx-types { opacity: 0.45; }
.manual-transaction.locked button.tx-type { cursor: not-allowed; }

/* Using points: the bill set out line by line; "collect from the customer now" stands out. */
.bill { display: grid; gap: 4px; }
.bill-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 10px; border-radius: 10px; background: #f7f2eb; font-weight: 600; }
.bill-row strong { font-size: 1.05rem; white-space: nowrap; }
.bill-minus { background: #fff1ee; color: #8a3a2d; }
.bill-collect { margin-top: 4px; padding: 12px; background: #e8f4ec; border: 2px solid #1d6b43; color: #0d4a2c; font-size: 1.05rem; }
.bill-collect strong { font-size: 1.45rem; }
.bill-earn { background: transparent; color: #1d6b43; font-size: 0.9rem; }
.bill-how { padding: 8px 10px; border-radius: 10px; background: #fff8e6; color: #6b4a0a; font-weight: 700; font-size: 0.9rem; text-align: center; }
#salePointsSummary .bill { font-weight: 600; }
