@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5f7;
  --surf: #eaecf0;
  --card: #ffffff;
  --bdr: #d8dce5;
  --acc: #6c47ff;
  --acc2: #00a87a;
  --text: #1a1d23;
  --muted: #6b7280;
  --grn: #16a34a;
  --red: #dc2626;
  --warn: #d97706;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  min-height: 100vh;
}

.page { display: none; }
.page.active { display: block; }

/* ── NAVBAR ── */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--bdr);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17px;
  color: var(--acc);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.logo-box {
  width: 32px; height: 32px;
  background: var(--acc);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.nav-r { display: flex; align-items: center; gap: 7px; }
.nbtn {
  background: none;
  border: 1px solid var(--bdr);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  transition: all .18s;
}
.nbtn:hover { border-color: var(--acc); color: var(--acc); }
.nbtn.act { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.uinfo { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.udot { width: 8px; height: 8px; background: var(--grn); border-radius: 50%; }

/* ── TOAST ── */
.toast {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  background: var(--grn);
  color: #fff;
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 13px;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateX(-50%) translateY(-6px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #6c47ff 0%, #4f32cc 100%);
  padding: 50px 24px 40px;
  text-align: center;
  color: #fff;
}
.hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.hero h1 span { color: #ffd700; }
.hero p { font-size: 14px; opacity: .85; }

/* ── SECTION ── */
.store-area { padding: 24px 20px; max-width: 900px; margin: 0 auto; }
.sec-title {
  font-size: 16px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.sec-title::before {
  content: '';
  width: 4px; height: 20px;
  background: var(--acc);
  border-radius: 2px;
  display: block;
}

/* ── PRODUCT CARD ── */
.prod-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 14px;
  overflow: hidden;
  max-width: 400px;
  margin: 0 auto;
  transition: box-shadow .2s, transform .2s;
}
.prod-card:hover { box-shadow: 0 8px 24px rgba(108,71,255,.12); transform: translateY(-2px); }
.prod-img-area {
  width: 100%; height: 220px;
  overflow: hidden;
  background: var(--surf);
  display: flex; align-items: center; justify-content: center;
}
.prod-img-area img { width: 100%; height: 100%; object-fit: cover; }
.prod-img-placeholder { font-size: 70px; }
.prod-body { padding: 16px; }
.prod-name { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.prod-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.65; }
.prod-price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.price-n { font-size: 20px; font-weight: 700; color: var(--acc); }
.price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.add-btn {
  width: 100%;
  background: var(--acc); color: #fff;
  font-weight: 700; border: none;
  border-radius: 9px; padding: 11px;
  cursor: pointer; font-family: 'Cairo', sans-serif; font-size: 14px;
  transition: opacity .2s;
}
.add-btn:hover { opacity: .88; }
.no-prod { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px; }
.no-prod .np-icon { font-size: 48px; margin-bottom: 12px; }

/* ── AUTH ── */
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
  background: var(--bg);
}
.auth-box {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%; max-width: 380px;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
}
.auth-box h2 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.fgrp { margin-bottom: 14px; }
.fgrp label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
.fgrp input {
  width: 100%;
  background: var(--surf); border: 1px solid var(--bdr); color: var(--text);
  padding: 10px 12px; border-radius: 8px;
  font-family: 'Cairo', sans-serif; font-size: 14px;
  transition: border-color .18s;
}
.fgrp input:focus { outline: none; border-color: var(--acc); }
.asbtn {
  width: 100%; background: var(--acc); color: #fff;
  font-weight: 700; border: none; border-radius: 9px; padding: 12px;
  cursor: pointer; font-family: 'Cairo', sans-serif; font-size: 15px; margin-top: 4px;
  transition: opacity .2s;
}
.asbtn:hover { opacity: .9; }
.errmsg {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--red);
  padding: 8px 12px; border-radius: 7px; font-size: 13px; margin-bottom: 12px; display: none;
}
.aswitch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.aswitch a { color: var(--acc); cursor: pointer; }
.aswitch a:hover { text-decoration: underline; }
.back-lnk { text-align: center; margin-top: 10px; font-size: 12px; color: var(--muted); cursor: pointer; }
.back-lnk:hover { color: var(--acc); }

/* ── CART ── */
.cart-area { padding: 24px 20px; max-width: 640px; margin: 0 auto; }
.cart-item {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: 11px; padding: 12px 14px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
}
.ci-thumb {
  width: 54px; height: 54px; border-radius: 9px;
  overflow: hidden; background: var(--surf);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.ci-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ci-info { flex: 1; }
.ci-name { font-weight: 600; font-size: 14px; }
.ci-price { font-size: 12px; color: var(--acc); margin-top: 2px; font-family: 'IBM Plex Mono', monospace; }
.qty-row { display: flex; align-items: center; gap: 6px; }
.qbtn {
  background: var(--surf); border: 1px solid var(--bdr); color: var(--text);
  width: 26px; height: 26px; border-radius: 5px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.qbtn:hover { border-color: var(--acc); }
.qnum { font-size: 14px; min-width: 20px; text-align: center; font-family: 'IBM Plex Mono', monospace; }
.rm-btn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 16px; padding: 4px; }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px; }
.summary-box {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: 12px; padding: 16px; margin-top: 16px;
}
.sum-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.sum-row.tot {
  font-weight: 700; font-size: 16px;
  border-top: 1px solid var(--bdr); padding-top: 12px; margin-top: 4px;
}
.chk-btn {
  width: 100%; background: var(--acc); color: #fff;
  font-weight: 700; border: none; border-radius: 10px; padding: 13px;
  cursor: pointer; font-family: 'Cairo', sans-serif; font-size: 15px; margin-top: 14px;
  transition: opacity .2s;
}
.chk-btn:hover { opacity: .9; }

/* ── PAYMENT ── */
.pay-area { padding: 24px 20px; max-width: 480px; margin: 0 auto; }
.pay-card { background: var(--card); border: 1px solid var(--bdr); border-radius: 14px; padding: 22px; }
.amt-box {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 10px; padding: 16px; text-align: center; margin-bottom: 16px;
}
.amt-lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.amt-big { font-family: 'IBM Plex Mono', monospace; font-size: 22px; color: #1d4ed8; font-weight: 600; }
.amt-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.addr-box {
  background: var(--surf); border: 1px solid var(--bdr);
  border-radius: 9px; padding: 14px; text-align: center; margin-bottom: 14px;
}
.addr-lbl { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.qr-box {
  width: 120px; height: 120px;
  background: #fff; border-radius: 8px;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bdr);
}
.addr-txt {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--acc2); word-break: break-all; line-height: 1.7; margin-top: 6px;
}
.copy-btn {
  background: none; border: 1px solid var(--bdr); color: var(--muted);
  border-radius: 6px; padding: 4px 12px; cursor: pointer;
  font-size: 12px; font-family: 'Cairo', sans-serif; margin-top: 8px;
  transition: all .18s;
}
.copy-btn:hover { border-color: var(--acc2); color: var(--acc2); }
.timer-txt {
  font-family: 'IBM Plex Mono', monospace; color: var(--red);
  font-size: 15px; text-align: center; margin: 12px 0; font-weight: 600;
}
.step-list { list-style: none; margin-bottom: 14px; }
.step-list li { display: flex; gap: 10px; margin-bottom: 9px; font-size: 13px; color: var(--muted); align-items: flex-start; }
.sn {
  background: var(--acc); color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}
.cfm-btn {
  width: 100%; background: var(--grn); color: #fff;
  font-weight: 700; border: none; border-radius: 10px; padding: 13px;
  cursor: pointer; font-family: 'Cairo', sans-serif; font-size: 15px;
  transition: opacity .2s;
}
.cfm-btn:hover { opacity: .9; }

/* ── SUCCESS ── */
.suc-wrap { text-align: center; padding: 80px 24px; }
.suc-icon { font-size: 64px; margin-bottom: 16px; }
.suc-wrap h2 { font-size: 24px; font-weight: 700; color: var(--grn); margin-bottom: 10px; }
.suc-wrap p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.oid-chip {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--surf); border: 1px solid var(--bdr);
  padding: 9px 20px; border-radius: 9px;
  display: inline-block; color: var(--acc); font-size: 13px;
}

/* ── ADMIN ── */
.adm-area { padding: 20px; max-width: 800px; margin: 0 auto; }
.adm-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.adm-badge {
  background: #eff6ff; color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.adm-card {
  background: var(--card); border: 1px solid var(--bdr);
  border-radius: 12px; padding: 18px; margin-bottom: 14px;
}
.adm-card h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.afgrp { margin-bottom: 0; }
.afgrp.full { grid-column: 1 / -1; }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.afgrp label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.afgrp input, .afgrp textarea, .afgrp select {
  width: 100%;
  background: var(--surf); border: 1px solid var(--bdr); color: var(--text);
  padding: 9px 11px; border-radius: 8px;
  font-family: 'Cairo', sans-serif; font-size: 13px;
  transition: border-color .18s;
}
.afgrp input:focus, .afgrp textarea:focus { outline: none; border-color: var(--acc); }
.afgrp textarea { resize: vertical; min-height: 60px; }
.adm-acts { display: flex; gap: 8px; margin-top: 14px; }
.save-btn {
  flex: 1; background: var(--acc); color: #fff;
  font-weight: 700; border: none; border-radius: 8px; padding: 10px;
  cursor: pointer; font-family: 'Cairo', sans-serif; font-size: 13px;
  transition: opacity .2s;
}
.save-btn:hover { opacity: .9; }
.del-btn {
  background: #fef2f2; color: var(--red);
  border: 1px solid #fecaca; border-radius: 8px;
  padding: 10px 16px; cursor: pointer; font-size: 13px; font-family: 'Cairo', sans-serif;
  transition: background .18s;
}
.del-btn:hover { background: #fee2e2; }

/* Image Upload */
.img-upload-area {
  border: 2px dashed var(--bdr); border-radius: 10px;
  padding: 20px; text-align: center; cursor: pointer;
  transition: border-color .2s; position: relative; background: var(--surf);
}
.img-upload-area:hover { border-color: var(--acc); background: #f5f3ff; }
.img-upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.img-preview-box {
  width: 100%; height: 160px; border-radius: 9px;
  overflow: hidden; margin-bottom: 8px;
  background: var(--surf); border: 1px solid var(--bdr);
}
.img-preview-box img { width: 100%; height: 100%; object-fit: cover; }
.upload-icon { font-size: 30px; margin-bottom: 6px; }
.upload-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.upload-hint { font-size: 11px; color: var(--muted); }
.rm-img-btn {
  background: #fef2f2; color: var(--red);
  border: 1px solid #fecaca; border-radius: 6px;
  padding: 5px 14px; cursor: pointer; font-size: 12px;
  font-family: 'Cairo', sans-serif;
}

/* Prod Preview */
.prod-prev {
  background: var(--surf); border: 1px solid var(--bdr);
  border-radius: 9px; padding: 12px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 12px;
}
.pp-img {
  width: 52px; height: 52px; border-radius: 8px;
  overflow: hidden; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.pp-img img { width: 100%; height: 100%; object-fit: cover; }
.pp-name { font-weight: 600; font-size: 14px; }
.pp-price { font-family: 'IBM Plex Mono', monospace; color: var(--acc); font-size: 12px; margin-top: 2px; }
.pp-st { font-size: 12px; margin-top: 2px; }
.on-st { color: var(--grn); } .off-st { color: var(--red); }

/* Wallet */
.wallet-row {
  background: var(--surf); border: 1px solid var(--bdr);
  border-radius: 9px; padding: 11px 14px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.wallet-addr {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--acc2); word-break: break-all; flex: 1; line-height: 1.6;
}

/* Orders */
.ord-row {
  background: var(--surf); border: 1px solid var(--bdr);
  border-radius: 9px; padding: 10px 14px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.or-name { font-weight: 600; font-size: 13px; }
.or-id { font-family: 'IBM Plex Mono', monospace; color: var(--acc); font-size: 10px; }
.or-amt { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--acc2); font-weight: 600; }
.ostag { padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.os-p { background: #fffbeb; color: var(--warn); border: 1px solid #fde68a; }
.os-d { background: #f0fdf4; color: var(--grn); border: 1px solid #bbf7d0; }
.no-orders { color: var(--muted); text-align: center; padding: 20px; font-size: 13px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box { background: var(--surf); border-radius: 9px; padding: 14px; text-align: center; border: 1px solid var(--bdr); }
.stat-val { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 600; color: var(--acc); }
.stat-val.green { color: var(--acc2); }
.stat-val.blue { color: #2563eb; }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Responsive */
@media (max-width: 520px) {
  .navbar { padding: 10px 14px; }
  .nbtn { padding: 5px 9px; font-size: 12px; }
  .logo span { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .ord-row { flex-wrap: wrap; }
}
