/* ============ VibloShop — التصميم ============ */
:root {
  --bg: #0a0c0f;
  --surface: #111418;
  --surface-2: #171b21;
  --surface-3: #1e232b;
  --border: #242a33;
  --border-2: #2f3640;
  --text: #e9ecef;
  --muted: #8a93a0;
  --dim: #5d6672;
  --kick: #53fc18;
  --kick-soft: rgba(83, 252, 24, .12);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, .12);
  --red: #f04646;
  --red-soft: rgba(240, 70, 70, .12);
  --blue: #4f8cff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -12px rgba(0,0,0,.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: 'Cairo', system-ui, sans-serif; font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(60rem 30rem at 85% -10%, rgba(83,252,24,.07), transparent 60%),
                    radial-gradient(50rem 30rem at -10% 10%, rgba(79,140,255,.05), transparent 60%);
  background-attachment: fixed;
}
img { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- الشريط العلوي ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(10,12,15,.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; text-decoration: none; color: var(--text); letter-spacing: .2px; }
.brand b { color: var(--kick); }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--kick); color: #000; display: grid; place-items: center; font-weight: 900; font-size: 1.1rem; box-shadow: 0 0 24px rgba(83,252,24,.35); }
.user-chip { display: flex; align-items: center; gap: .75rem; }
.balance { display: flex; align-items: center; gap: .45rem; padding: .35rem .85rem; border-radius: 999px; background: var(--gold-soft); border: 1px solid rgba(251,191,36,.25); color: var(--gold); font-weight: 800; }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 60%, #b45309); box-shadow: 0 0 0 1.5px rgba(0,0,0,.25) inset; flex-shrink: 0; }
.profile { display: flex; align-items: center; gap: .55rem; padding: .25rem .25rem .25rem .7rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.profile .name { font-weight: 700; font-size: .9rem; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.tag-admin { font-size: .7rem; font-weight: 800; padding: .05rem .45rem; border-radius: 6px; background: var(--gold-soft); color: var(--gold); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); text-decoration: none; transition: .15s; }
.icon-btn:hover { color: var(--red); border-color: rgba(240,70,70,.4); }

/* ---------- التبويبات ---------- */
.nav { border-bottom: 1px solid var(--border); background: rgba(10,12,15,.6); position: sticky; top: 64px; z-index: 19; backdrop-filter: blur(14px); }
.tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; white-space: nowrap; transition: .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--kick); border-bottom-color: var(--kick); }
main.container { padding-top: 1.5rem; padding-bottom: 3rem; }

/* ---------- عناصر عامة ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: .5rem; }
.page-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-title h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.3; }
.page-title p { color: var(--muted); }
.notice { display: flex; align-items: center; gap: .7rem; padding: .85rem 1.1rem; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--kick-soft), transparent); border: 1px solid rgba(83,252,24,.25); margin-bottom: 1.25rem; font-weight: 600; }
.error { padding: .85rem 1.1rem; border-radius: var(--radius-sm); background: var(--red-soft); border: 1px solid rgba(240,70,70,.35); color: #ff9b9b; font-weight: 700; margin: 1rem auto; max-width: 1180px; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; border: 1px dashed var(--border-2); border-radius: var(--radius); grid-column: 1 / -1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.2rem; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 800; transition: .15s; text-decoration: none; }
.btn-primary { background: var(--kick); color: #000; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 0 24px rgba(83,252,24,.3); }
.btn-ghost { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--red-soft); border-color: rgba(240,70,70,.35); color: #ff8a8a; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.05rem; }
.mini { display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .75rem; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2); font-weight: 700; font-size: .82rem; transition: .15s; white-space: nowrap; }
.mini.ok { background: var(--kick-soft); border-color: rgba(83,252,24,.35); color: var(--kick); }
.mini.ok:hover { background: var(--kick); color: #000; }
.mini.no { background: var(--red-soft); border-color: rgba(240,70,70,.35); color: #ff8a8a; }
.mini.no:hover { background: var(--red); color: #fff; }
.mini.edit:hover { border-color: var(--blue); color: var(--blue); }

label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: .35rem; }
input, select, textarea { width: 100%; padding: .7rem .85rem; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--bg); color: var(--text); outline: none; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--kick); box-shadow: 0 0 0 3px var(--kick-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.switch { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--bg); color: var(--text); font-size: .92rem; margin: 0; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--kick); }

/* ---------- صفحة الزائر ---------- */
.hero { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 3rem 1.25rem; text-align: center; }
.hero-in { max-width: 760px; }
.pill { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .9rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); font-size: .85rem; font-weight: 700; margin-bottom: 1.4rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.25; margin-bottom: 1rem; }
.hero h1 span { color: var(--kick); }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 2rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 3.5rem; text-align: right; }
.feature { padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.feature .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--kick-soft); color: var(--kick); margin-bottom: .8rem; }
.feature b { display: block; margin-bottom: .2rem; }
.feature span { color: var(--muted); font-size: .9rem; }

/* ---------- البث ---------- */
.live { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem; border-radius: 8px; font-size: .8rem; font-weight: 800; }
.live.on { background: var(--red); color: #fff; }
.live.off { background: var(--surface-3); color: var(--muted); }
.live.on::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.watch-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.25rem; align-items: start; }
.player { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius-sm); background: #000; display: block; }
.stream-meta { margin-top: .8rem; color: var(--muted); font-size: .92rem; min-height: 1.4em; }
.reward { text-align: center; }
.ring { position: relative; width: 190px; height: 190px; margin: .5rem auto 1rem; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--kick); stroke-linecap: round; transition: stroke-dashoffset 1s linear; filter: drop-shadow(0 0 6px rgba(83,252,24,.45)); }
.ring.paused .bar { stroke: var(--dim); filter: none; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-center b { font-size: 2rem; font-weight: 900; line-height: 1.1; }
.ring-center span { color: var(--muted); font-size: .8rem; }
.watch-status { font-weight: 700; font-size: .92rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.watch-status.on { color: var(--kick); background: var(--kick-soft); }
.watch-status.off { color: var(--gold); background: var(--gold-soft); }
.rule { margin-top: .8rem; color: var(--muted); font-size: .88rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.stat { padding: .75rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); text-align: right; }
.stat span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; }
.stat b { font-size: 1.15rem; font-weight: 800; }

/* ---------- المتجر ---------- */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.1rem; }
.item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s; }
.item:hover { transform: translateY(-3px); border-color: rgba(83,252,24,.4); box-shadow: 0 16px 36px -16px rgba(83,252,24,.25); }
.item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--surface-3); }
.item .info { padding: 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.item .info b { font-size: 1.02rem; }
.item .cost { color: var(--gold); font-weight: 900; font-size: 1.1rem; }
.item .stock { font-size: .8rem; color: var(--muted); }
.item button { margin-top: .6rem; padding: .7rem; border: 0; border-radius: var(--radius-sm); background: var(--kick); color: #000; font-weight: 800; transition: .15s; }
.item button:hover { filter: brightness(1.08); }
.item button:disabled { background: var(--surface-3); color: var(--dim); cursor: not-allowed; }

/* ---------- القوائم ---------- */
.list { display: grid; gap: .55rem; }
.order { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .9rem; transition: border-color .15s; }
.order:hover { border-color: var(--border-2); }
.order .grow { flex: 1; min-width: 160px; }
.order small { color: var(--muted); }
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.st { padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.st.pending { background: var(--gold-soft); color: var(--gold); }
.st.completed { background: var(--kick-soft); color: var(--kick); }
.st.rejected { background: var(--red-soft); color: #ff8a8a; }
.rank { width: 36px; text-align: center; font-weight: 900; font-size: 1.1rem; color: var(--muted); }
.order.me-row { border-color: rgba(83,252,24,.5); background: linear-gradient(90deg, var(--kick-soft), var(--surface-2)); }

/* ---------- الدردشة ---------- */
.chat { height: 480px; overflow-y: auto; display: flex; flex-direction: column; gap: .65rem; padding: 1rem; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.msg { display: flex; gap: .6rem; align-items: flex-start; }
.msg img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex-shrink: 0; }
.msg .body { background: var(--surface-2); padding: .5rem .8rem; border-radius: 4px 12px 12px 12px; max-width: 80%; word-wrap: break-word; border: 1px solid var(--border); }
.msg.mine .body { background: rgba(83,252,24,.08); border-color: rgba(83,252,24,.2); }
.msg .name { font-weight: 800; color: var(--kick); font-size: .82rem; }
.msg.admin .name { color: var(--gold); }
.msg .tools { margin-right: auto; display: flex; gap: .3rem; opacity: 0; transition: .15s; }
.msg:hover .tools { opacity: 1; }
.chat-form { display: flex; gap: .6rem; margin-top: .8rem; }

/* ---------- لوحة التحكم ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.25rem; align-items: start; }
.subtabs { display: flex; flex-direction: column; gap: .25rem; position: sticky; top: 130px; }
.subtabs button { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--muted); font-weight: 700; text-align: right; }
.subtabs button:hover { background: var(--surface-2); color: var(--text); }
.subtabs button.active { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.subtabs button.active .i { color: var(--kick); }
.count-badge { margin-right: auto; min-width: 22px; padding: 0 .4rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 800; text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { padding: 1rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.kpi span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.kpi b { display: block; font-size: 1.5rem; font-weight: 900; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search .i { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); color: var(--dim); }
.search input { padding-right: 2.4rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { text-align: right; font-size: .78rem; color: var(--muted); font-weight: 800; padding: .75rem .9rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
td { padding: .6rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.015); }
.user-cell { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.user-cell img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.pts-edit { display: flex; gap: .35rem; align-items: center; }
.pts-edit input { width: 110px; padding: .4rem .6rem; font-weight: 800; color: var(--gold); }
.danger-zone { margin-top: 1.25rem; padding: 1.1rem; border-radius: var(--radius); border: 1px solid rgba(240,70,70,.35); background: linear-gradient(180deg, rgba(240,70,70,.06), transparent); }
.danger-zone h3 { color: #ff8a8a; font-size: 1rem; margin-bottom: .3rem; }
.danger-zone p { color: var(--muted); font-size: .9rem; margin-bottom: .9rem; }
.pager { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }

/* رفع الصورة */
.uploader { display: flex; align-items: center; gap: 1rem; padding: .8rem; border: 1.5px dashed var(--border-2); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; transition: .15s; margin: 0; color: var(--text); font-size: .92rem; }
.uploader:hover, .uploader.drag { border-color: var(--kick); background: var(--kick-soft); }
.uploader img { width: 72px; height: 72px; border-radius: 9px; object-fit: cover; background: var(--surface-3); }
.uploader .ph { width: 72px; height: 72px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.uploader small { display: block; color: var(--muted); font-weight: 600; }

/* ---------- نوافذ وتنبيهات ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; animation: fade .15s; }
.modal .panel { width: 100%; max-width: 400px; animation: pop .2s; }
.buy-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.2rem; }
.buy-head img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--surface-3); }
.buy-head h3 { font-size: 1.1rem; }
.modal-actions { display: grid; grid-template-columns: 1fr auto; gap: .6rem; margin-top: 1.1rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: .8rem 1.3rem; border-radius: 12px; font-weight: 800; box-shadow: 0 16px 40px rgba(0,0,0,.6); z-index: 60; animation: pop .2s; color: #fff; }

/* ---------- الهاتف ---------- */
@media (max-width: 900px) {
  .watch-grid, .admin-layout { grid-template-columns: 1fr; }
  .subtabs { flex-direction: row; overflow-x: auto; position: static; }
  .subtabs button { white-space: nowrap; }
  .count-badge { margin-right: .3rem; }
}
@media (max-width: 560px) {
  .profile .name, .brand span:last-child { display: none; }
  .profile { padding: .25rem; }
  .tabs button { padding: .8rem .7rem; font-size: .9rem; }
  .msg .tools { opacity: 1; }
}
