:root {
  --bg: #090a0a;
  --bg-2: #0f1111;
  --card: #131616;
  --card-2: #181c1c;
  --line: #232929;
  --line-2: #2e3636;
  --text: #e9eeed;
  --muted: #8b9796;
  --accent: #1fae9b;
  --accent-hi: #34d1bb;
  --accent-lo: #0e5e54;
  --warn: #e0a83a;
  --bad: #e25c5c;
  --ok: #3cc480;
  --info: #5aa7e6;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --display: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(31, 174, 155, .12), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(31, 174, 155, .06), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before { /* ملمس خفيف يشبه الشعار */
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0 0 .5em; letter-spacing: 0; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.page { flex: 1; padding-top: 28px; padding-bottom: 64px; }

/* ---------- الهيدر ---------- */
.announce {
  background: linear-gradient(90deg, var(--accent-lo), var(--accent), var(--accent-lo));
  color: #fff; text-align: center; font-size: .9rem; padding: 6px 16px; font-weight: 600;
}
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(9, 10, 10, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-size: 1.25rem; font-weight: 900; letter-spacing: .5px; white-space: nowrap; }
.brand img { width: 42px; height: 42px; border-radius: 50%; }
.brand b { color: var(--accent); }
.links { display: flex; gap: 4px; flex: 1; }
.links a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.links a:hover, .links a.active { color: var(--text); background: var(--card); }
.actions { display: flex; align-items: center; gap: 8px; }
.cart-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--text); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); }
.cart-btn .count { background: var(--accent); color: #031512; border-radius: 99px; min-width: 22px; text-align: center; font-weight: 700; font-size: .8rem; padding: 0 6px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.inline { display: inline; margin: 0; }

/* ---------- الأزرار والنماذج ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #031512; border: 1px solid var(--accent);
  padding: 10px 18px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-hi); color: #031512; box-shadow: 0 6px 20px rgba(31, 174, 155, .3); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-hi); box-shadow: none; }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(226, 92, 92, .45); }
.btn.danger:hover { background: rgba(226, 92, 92, .12); box-shadow: none; }
.btn.sm { padding: 6px 12px; font-size: .88rem; border-radius: 9px; }
.btn.lg { padding: 14px 26px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: .84rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 174, 155, .18); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.file-drop {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 22px; cursor: pointer; color: var(--muted);
}
.file-drop:hover { border-color: var(--accent); color: var(--text); }
.file-drop input { display: none; }

/* ---------- عناصر عامة ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 18px; }
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert.ok { background: rgba(60, 196, 128, .08); border-color: rgba(60, 196, 128, .35); color: #9ee7c0; }
.alert.error { background: rgba(226, 92, 92, .08); border-color: rgba(226, 92, 92, .35); color: #f2a9a9; }
.alert.info { background: rgba(90, 167, 230, .08); border-color: rgba(90, 167, 230, .35); color: #b5d6f3; }
.alert.warn { background: rgba(224, 168, 58, .08); border-color: rgba(224, 168, 58, .35); color: #f0d197; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.badge.warn { color: var(--warn); border-color: rgba(224, 168, 58, .4); background: rgba(224, 168, 58, .08); }
.badge.info { color: var(--info); border-color: rgba(90, 167, 230, .4); background: rgba(90, 167, 230, .08); }
.badge.accent { color: var(--accent-hi); border-color: rgba(31, 174, 155, .45); background: rgba(31, 174, 155, .1); }
.badge.ok { color: var(--ok); border-color: rgba(60, 196, 128, .4); background: rgba(60, 196, 128, .08); }
.badge.bad { color: var(--bad); border-color: rgba(226, 92, 92, .4); background: rgba(226, 92, 92, .08); }
.badge.muted { color: var(--muted); border-color: var(--line-2); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 44px 0 18px; }
.section-head h2 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- الواجهة ---------- */
.hero {
  display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 32px;
  padding: 36px 0 12px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 540px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero-logo { position: relative; justify-self: center; width: min(340px, 80%); }
.hero-logo::before { content: ''; position: absolute; inset: -12%; border-radius: 50%; background: radial-gradient(circle, rgba(31, 174, 155, .28), transparent 65%); filter: blur(20px); }
.hero-logo img { position: relative; border-radius: 50%; box-shadow: var(--shadow); }
.trust { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: .9rem; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 18px; height: 18px; color: var(--accent); }

.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cat {
  display: flex; flex-direction: column; gap: 10px; padding: 20px;
  background: linear-gradient(160deg, var(--card-2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: border-color .15s, transform .15s;
}
.cat:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.cat .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(31, 174, 155, .12); color: var(--accent); }
.cat .ic svg { width: 26px; height: 26px; }
.cat b { font-family: var(--display); font-size: 1.15rem; }
.cat small { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.product {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .15s, transform .15s;
}
.product:hover { border-color: var(--line-2); transform: translateY(-2px); }
.product .thumb { aspect-ratio: 16/10; background: linear-gradient(135deg, #111515, #0b0d0d); display: grid; place-items: center; color: var(--accent-lo); overflow: hidden; }
.product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product .thumb svg { width: 64px; height: 64px; color: rgba(31, 174, 155, .35); }
.product .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product h3 { margin: 0; font-size: 1.05rem; }
.product h3 a { color: var(--text); }
.product .desc { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { font-family: var(--display); font-weight: 900; font-size: 1.25rem; color: var(--accent-hi); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); font-weight: 500; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent); color: #031512; border-color: var(--accent); }

.product-page { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
.product-page .media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); aspect-ratio: 16/10; display: grid; place-items: center; }
.product-page .media img { width: 100%; height: 100%; object-fit: cover; }
.product-page .media svg { width: 120px; height: 120px; color: rgba(31, 174, 155, .3); }
.product-page .desc { white-space: pre-line; color: #c9d3d2; }
.qty { display: flex; gap: 10px; align-items: center; }
.qty input { width: 90px; }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; background: var(--bg-2); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .015); }
.t-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.summary { display: grid; gap: 10px; }
.summary .line { display: flex; justify-content: space-between; gap: 12px; }
.summary .total { border-top: 1px solid var(--line); padding-top: 12px; font-weight: 700; font-size: 1.1rem; }

.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.auth-wrap { max-width: 460px; margin: 20px auto; }
.auth-wrap .logo { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; }

/* ---------- الدفع ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab { flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.tab.active { border-color: var(--accent); color: var(--text); background: rgba(31, 174, 155, .1); }
.bank-box { display: grid; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 18px; }
.bank-box .line { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.secure-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .86rem; margin-top: 14px; }
.secure-note svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.mysr-form { direction: ltr; }

/* ---------- الفوتر ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: .9rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- لوحة الإدارة ---------- */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin aside { background: var(--bg-2); border-left: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin aside .brand { margin: 0 6px 22px; }
.admin aside nav a { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 10px 12px; border-radius: 10px; margin-bottom: 2px; font-weight: 500; }
.admin aside nav a svg { width: 18px; height: 18px; }
.admin aside nav a:hover { background: var(--card); color: var(--text); }
.admin aside nav a.active { background: rgba(31, 174, 155, .12); color: var(--accent-hi); }
.admin aside .pill { margin-inline-start: auto; background: var(--warn); color: #1a1100; border-radius: 99px; font-size: .75rem; padding: 0 7px; font-weight: 700; }
.admin main { padding: 26px clamp(16px, 3vw, 36px) 60px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-top h1 { margin: 0; font-size: 1.6rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat small { color: var(--muted); display: block; margin-bottom: 4px; }
.stat b { font-family: var(--display); font-size: 1.6rem; }
.stat.hl { border-color: rgba(31, 174, 155, .45); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.receipt-frame { width: 100%; min-height: 520px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.receipt-img { border-radius: 12px; border: 1px solid var(--line); max-height: 640px; object-fit: contain; background: #fff; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 220px; }

/* ---------- الجوال ---------- */
@media (max-width: 960px) {
  .cats { grid-template-columns: repeat(2, 1fr); }
  .two-col, .product-page { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; }
  .hero .cta, .trust { justify-content: center; }
  .hero-logo { order: -1; width: 200px; }
  .admin { grid-template-columns: 1fr; }
  .admin aside { position: static; height: auto; border-left: none; border-bottom: 1px solid var(--line); }
  .admin aside nav { display: flex; overflow-x: auto; gap: 4px; }
  .admin aside nav a { white-space: nowrap; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .links { display: none; position: absolute; top: 68px; right: 0; left: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  body.nav-open .links { display: flex; }
  .nav { gap: 10px; }
  .actions .hide-sm { display: none; }
  .brand span { display: none; }
  .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 8px; }
}

/* ---------- ديسكورد ---------- */
.discord-btn { background: #5865f2; border-color: #5865f2; color: #fff; }
.discord-btn:hover { background: #6d78f5; color: #fff; box-shadow: 0 6px 20px rgba(88, 101, 242, .35); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
