/* ─────────────────────────────────────────────────────────────
   رواسي مدار — نظام التصميم
   هوية: أسود + أصفر لافتات، زجاج داكن فوق خلفية «المدار» الظاهرة.
   الهيكل: شريط جانبي زجاجي يميناً + محتوى بعرض مقروء، وعلى الجوال شريط سفلي.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #050506;
  --ink: #F6F3EA;
  --ink-2: #C9C5BA;
  --muted: #8F8B82;
  --yellow: #FFC400;
  --yellow-2: #FFD84D;
  --yellow-ink: #141005;
  --yellow-soft: rgba(255, 196, 0, .14);
  --glass: rgba(16, 16, 18, .58);
  --glass-2: rgba(22, 22, 25, .72);
  --glass-3: rgba(10, 10, 12, .82);
  --stroke: rgba(255, 255, 255, .085);
  --stroke-2: rgba(255, 255, 255, .14);
  --stroke-y: rgba(255, 196, 0, .38);
  --good: #3DDC97; --good-bg: rgba(61, 220, 151, .13);
  --warn: #FFB020; --warn-bg: rgba(255, 176, 32, .14);
  --bad: #FF6B6B;  --bad-bg: rgba(255, 107, 107, .13);
  --info: #74B9FF; --info-bg: rgba(116, 185, 255, .13);
  --f-display: "Readex Pro", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Readex Pro", Tahoma, "Segoe UI", sans-serif;
  --r-lg: 22px; --r: 16px; --r-sm: 11px;
  --blur: saturate(150%) blur(22px);
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, .9);
  --side: 272px;
  --bg-image: url("../img/bg-desktop.jpg");
  --bg-image-m: url("../img/bg-mobile.jpg");
  --bg-dim: .55;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.7; direction: rtl;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}

/* الخلفية الظاهرة في كل الموقع */
.backdrop { position: fixed; inset: 0; z-index: -2; background: #050506 var(--bg-image) center/cover no-repeat; transform: translateZ(0); }
.backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,5,6, calc(var(--bg-dim) - .2)), rgba(5,5,6, var(--bg-dim))); }
@media (max-width: 760px) { .backdrop { background-image: var(--bg-image-m); } }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; margin: 0; line-height: 1.35; text-wrap: balance; }
p { margin: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.y { color: var(--yellow); }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--yellow); color: var(--yellow-ink); }
[hidden] { display: none !important; }

/* ── الزجاج ── */
.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06); }
.glass-2 { background: var(--glass-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--stroke); border-radius: var(--r); }
.card { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--stroke); border-radius: var(--r-lg); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card-h h3 .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--yellow-soft); color: var(--yellow); }
.card.pad-0 { padding: 0; overflow: hidden; }
.card.hl { border-color: var(--stroke-y); box-shadow: var(--shadow), 0 0 0 1px rgba(255,196,0,.12), 0 0 40px -12px rgba(255,196,0,.35); }

/* ── الهيكل ── */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 14px 18px 0; padding-right: max(14px, env(safe-area-inset-right, 0px)); }
.side-in { height: 100%; display: flex; flex-direction: column; padding: 18px 12px; overflow-y: auto; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255,196,0,.25), 0 8px 24px -8px rgba(255,196,0,.5); }
.brand b { font-family: var(--f-display); font-size: 18px; display: block; line-height: 1.2; }
.brand span { font-size: 11.5px; color: var(--muted); }
.nav-group { margin-top: 10px; }
.nav-group > small { display: block; padding: 8px 12px 4px; color: var(--muted); font-size: 11.5px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; position: relative; transition: background .2s, color .2s; }
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.nav a.on { background: linear-gradient(90deg, rgba(255,196,0,.06), rgba(255,196,0,.18)); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,196,0,.22); }
.nav a.on svg { color: var(--yellow); opacity: 1; }
.nav a.on::before { content: ""; position: absolute; right: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--yellow); box-shadow: 0 0 12px var(--yellow); }
.nav .count { margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--yellow); color: var(--yellow-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--stroke); }

.main { min-width: 0; padding: 18px 24px 40px; padding-left: max(24px, env(safe-area-inset-left, 0px)); }
.topbar { position: sticky; top: max(10px, env(safe-area-inset-top, 0px)); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; margin-bottom: 22px; }
.topbar .title { min-width: 0; flex: 1; }
.topbar .title h1 { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .crumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.topbar .actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.04); border: 1px solid var(--stroke); color: var(--ink-2); cursor: pointer; transition: .2s; }
.icon-btn:hover { color: var(--ink); border-color: var(--stroke-2); background: rgba(255,255,255,.07); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 7px; left: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--yellow); color: var(--yellow-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 3px #0b0b0d; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border-radius: 14px; border: 1px solid var(--stroke); background: rgba(255,255,255,.03); }
.me b { font-size: 13.5px; display: block; line-height: 1.2; }
.me span { font-size: 11.5px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-family: var(--f-display); background: linear-gradient(140deg, #FFD84D, #FF9F00); color: var(--yellow-ink); flex: none; font-size: 14px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.avatar.ghost { background: rgba(255,255,255,.08); color: var(--ink); }

.page { display: grid; gap: 18px; max-width: 1320px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }

/* ── الأزرار ── */
.btn { --h: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 18px; border-radius: 13px; border: 1px solid var(--stroke-2); background: rgba(255,255,255,.05); color: var(--ink); font: 600 14.5px var(--f-body); cursor: pointer; white-space: nowrap; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.22); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: linear-gradient(180deg, #FFD84D, #FFC400 55%, #F5B300); color: var(--yellow-ink); border-color: rgba(255,214,77,.9); box-shadow: 0 10px 24px -10px rgba(255,196,0,.75), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.primary:hover { background: linear-gradient(180deg, #FFE27A, #FFCB1A 55%, #FFBB00); box-shadow: 0 12px 30px -10px rgba(255,196,0,.9), inset 0 1px 0 rgba(255,255,255,.55); }
.btn.good { background: var(--good-bg); border-color: rgba(61,220,151,.45); color: var(--good); }
.btn.bad { background: var(--bad-bg); border-color: rgba(255,107,107,.4); color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.btn.sm { --h: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 11px; }
.btn.lg { --h: 52px; padding: 0 24px; font-size: 16px; border-radius: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ── الشارات ── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: rgba(255,255,255,.07); color: var(--ink-2); border: 1px solid transparent; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.plain::before { display: none; }
.badge.brand { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(255,196,0,.25); }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid var(--stroke); font-size: 12.5px; color: var(--ink-2); }

/* ── الأرقام الرئيسية ── */
.stat { position: relative; overflow: hidden; }
.stat .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .k svg { width: 16px; height: 16px; color: var(--yellow); }
.stat .v { font-family: var(--f-display); font-size: 30px; font-weight: 600; line-height: 1.25; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.hero { background: linear-gradient(150deg, rgba(255,196,0,.22), rgba(255,196,0,.04) 60%), var(--glass); border-color: rgba(255,196,0,.3); }
.stat.hero .v { color: var(--yellow-2); }
.stat .spark { position: absolute; inset: auto 0 0 0; height: 44px; opacity: .6; }

/* ── الجداول ── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.t th { text-align: right; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--stroke); white-space: nowrap; background: rgba(0,0,0,.18); }
.t td { padding: 13px 16px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: rgba(255,255,255,.035); }
.t tr.link { cursor: pointer; }
.t .code { font-family: var(--f-display); font-weight: 600; color: var(--yellow-2); direction: ltr; unicode-bidi: isolate; }
.t td.num, .t th.num { text-align: left; }

/* ── قوائم ── */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--stroke); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.05); border: 1px solid var(--stroke); flex: none; color: var(--yellow); }
.li .ico svg { width: 19px; height: 19px; }
.li .body { flex: 1; min-width: 0; }
.li .body b { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .body span { font-size: 12.5px; color: var(--muted); }
a.li:hover .body b { color: var(--yellow-2); }

/* ── النماذج ── */
.form { display: grid; gap: 16px; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--stroke-2);
  background: rgba(0,0,0,.35); color: var(--ink); font: 500 15px var(--f-body); transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 18px 21px, 13px 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 34px; }
.input:focus { outline: none; border-color: rgba(255,196,0,.7); box-shadow: 0 0 0 4px rgba(255,196,0,.14); background: rgba(0,0,0,.5); }
.input::placeholder { color: #6d6a63; }
.input.ltr { direction: ltr; text-align: right; }
.input-group { position: relative; }
.input-group .suffix { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.err { color: var(--bad); font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--yellow); }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid var(--stroke); flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: .2s; }
.seg input:checked + span { background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 6px 16px -8px rgba(255,196,0,.8); }
.seg input:focus-visible + span { outline: 2px solid var(--yellow); }

.drop { position: relative; display: grid; place-items: center; gap: 6px; text-align: center; padding: 22px 16px; border-radius: var(--r); border: 1.5px dashed rgba(255,196,0,.35); background: rgba(255,196,0,.04); color: var(--ink-2); cursor: pointer; transition: .2s; }
.drop:hover, .drop.over { border-color: var(--yellow); background: rgba(255,196,0,.08); }
.drop svg { width: 28px; height: 28px; color: var(--yellow); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .picked { font-size: 12.5px; color: var(--yellow-2); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumbs a, .thumbs .th { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--stroke); background: rgba(0,0,0,.3); max-width: 100%; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.thumbs a:hover img { transform: scale(1.05); }
.thumbs .tag { position: absolute; bottom: 6px; right: 6px; padding: 1px 8px; border-radius: 99px; font-size: 11px; background: rgba(0,0,0,.65); }
.thumbs .del { position: absolute; top: 6px; left: 6px; }

/* ── شريط التقدم ── */
.steps { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; position: relative; }
.step { display: grid; justify-items: center; gap: 8px; text-align: center; position: relative; }
.step .b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--stroke-2); background: rgba(0,0,0,.45); color: var(--muted); font: 600 13px var(--f-display); position: relative; z-index: 1; transition: .3s; }
.step .b svg { width: 16px; height: 16px; }
.step span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.step::after { content: ""; position: absolute; top: 17px; right: calc(50% + 20px); width: calc(100% - 34px); height: 2px; background: var(--stroke-2); border-radius: 2px; }
.step:last-child::after { display: none; }
.step.done .b { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.step.done::after { background: linear-gradient(270deg, var(--yellow), rgba(255,196,0,.4)); }
.step.done span { color: var(--ink-2); }
.step.now .b { border-color: var(--yellow); color: var(--yellow); box-shadow: 0 0 0 5px rgba(255,196,0,.14), 0 0 22px rgba(255,196,0,.5); animation: pulse 2.2s infinite; }
.step.now span { color: var(--ink); font-weight: 600; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(255,196,0,.05), 0 0 26px rgba(255,196,0,.6); } }

/* ── الخط الزمني ── */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 26px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.tl::before { content: ""; position: absolute; right: 12px; top: 22px; bottom: 0; width: 1.5px; background: var(--stroke-2); }
.tl:last-child::before { display: none; }
.tl .d { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,196,0,.12); border: 1px solid rgba(255,196,0,.35); }
.tl .d i { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.tl.muted .d { background: rgba(255,255,255,.05); border-color: var(--stroke-2); }
.tl.muted .d i { background: var(--muted); box-shadow: none; }
.tl b { font-weight: 600; font-size: 14px; }
.tl span { font-size: 12px; color: var(--muted); display: block; }

/* ── رسائل ── */
.flash { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 15px; font-weight: 500; animation: drop .35s ease; }
.flash svg { width: 20px; height: 20px; flex: none; }
.flash.ok { background: rgba(61,220,151,.12); border: 1px solid rgba(61,220,151,.35); color: #b8f5d9; }
.flash.no { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.38); color: #ffd0d0; }
.flash.info { background: rgba(255,196,0,.1); border: 1px solid rgba(255,196,0,.32); color: #ffe9a8; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

.note { padding: 12px 14px; border-radius: 13px; background: rgba(255,196,0,.08); border: 1px solid rgba(255,196,0,.22); color: #f3e3b0; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.note svg { width: 18px; height: 18px; color: var(--yellow); flex: none; margin-top: 3px; }
.note.bad { background: var(--bad-bg); border-color: rgba(255,107,107,.35); color: #ffd0d0; }
.note.bad svg { color: var(--bad); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty .ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(255,196,0,.18), transparent 70%); border: 1px dashed rgba(255,196,0,.35); color: var(--yellow); }
.empty .ring svg { width: 26px; height: 26px; }
.empty b { color: var(--ink); font-size: 15px; }

/* ── تفاصيل ومفاتيح ── */
.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--stroke); font-size: 14px; }
.kv > div:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: left; }
.kv .total { font-size: 17px; }
.kv .total b { color: var(--yellow-2); font-family: var(--f-display); }

.money-hero { display: grid; gap: 4px; padding: 16px; border-radius: 16px; background: linear-gradient(140deg, rgba(255,196,0,.18), rgba(255,196,0,.03)); border: 1px solid rgba(255,196,0,.28); }
.money-hero span { font-size: 12.5px; color: var(--ink-2); }
.money-hero b { font-family: var(--f-display); font-size: 28px; color: var(--yellow-2); font-variant-numeric: tabular-nums; }

/* بطاقات الطلبات (كانبان) */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.lane { min-width: 0; padding: 12px; scroll-snap-align: start; display: grid; gap: 10px; align-content: start; }
.lane-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 6px; font-weight: 600; font-size: 13.5px; }
.lane-h .n { font-size: 12px; color: var(--muted); }
.ocard { display: grid; gap: 8px; padding: 14px; border-radius: 15px; background: rgba(0,0,0,.35); border: 1px solid var(--stroke); transition: .2s; }
.ocard:hover { border-color: rgba(255,196,0,.4); transform: translateY(-2px); background: rgba(0,0,0,.45); }
.ocard .code { font: 600 12.5px var(--f-display); color: var(--yellow-2); direction: ltr; unicode-bidi: isolate; }
.ocard b { font-size: 14.5px; line-height: 1.5; }
.ocard .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* شبكة صور التصميم */
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.design { display: grid; gap: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--stroke); background: rgba(0,0,0,.35); }
.design .pv { aspect-ratio: 4/3; background: repeating-conic-gradient(rgba(255,255,255,.03) 0 25%, transparent 0 50%) 0 0/20px 20px, #0c0c0e; display: grid; place-items: center; overflow: hidden; }
.design .pv img { width: 100%; height: 100%; object-fit: contain; }
.design .pv svg { width: 40px; height: 40px; color: var(--muted); }
.design .ft { padding: 10px 12px; display: grid; gap: 8px; }
.design.approved { border-color: rgba(61,220,151,.5); }
.design.sent { border-color: rgba(255,176,32,.5); }

/* النجوم */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { display: none; }
.stars label { cursor: pointer; color: #4b4943; transition: .15s; }
.stars label svg { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--yellow); filter: drop-shadow(0 0 8px rgba(255,196,0,.6)); }
.stars-static svg { width: 16px; height: 16px; fill: var(--yellow); stroke: none; }
.stars-static .off { fill: #4b4943; }

/* المحادثة */
.chat { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: rgba(255,255,255,.06); border: 1px solid var(--stroke); justify-self: end; }
.msg.mine { justify-self: start; border-radius: 16px 16px 4px 16px; background: rgba(255,196,0,.13); border-color: rgba(255,196,0,.3); }
.msg .who { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; }
.msg p { white-space: pre-wrap; font-size: 14px; }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }

/* النوافذ */
dialog.modal { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: min(560px, calc(100vw - 24px)); width: 100%; }
dialog.modal::backdrop { background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.modal .card { background: rgba(18,18,21,.86); }
dialog.modal[open] .card { animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-h h3 { font-size: 18px; }

/* تبويبات */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 15px; background: rgba(0,0,0,.35); border: 1px solid var(--stroke); overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { flex: none; padding: 8px 15px; border-radius: 11px; font: 600 13.5px var(--f-body); color: var(--ink-2); background: none; border: 0; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.tabs a.on, .tabs button.on { background: rgba(255,255,255,.1); color: var(--ink); box-shadow: inset 0 0 0 1px var(--stroke-2); }
.tabs .n { font-size: 11.5px; padding: 0 7px; border-radius: 99px; background: rgba(255,196,0,.2); color: var(--yellow-2); }

/* شريط الأدوات */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-right: 42px; }

/* الصفحات المستقلة (الدخول، المتابعة، التثبيت) */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.solo-in { width: 100%; max-width: 460px; }
.solo-in.wide { max-width: 760px; }
.auth-card { padding: 30px 28px; }
.hero-logo { display: grid; justify-items: center; gap: 10px; text-align: center; margin-bottom: 22px; }
.hero-logo img { width: 74px; height: 74px; border-radius: 22px; box-shadow: 0 0 0 1px rgba(255,196,0,.3), 0 18px 50px -12px rgba(255,196,0,.6); }
.hero-logo h1 { font-size: 28px; }
.hero-logo p { color: var(--muted); font-size: 14px; }

/* الجوال: شريط سفلي */
.mbar, .mtop { display: none; }
.sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: .25s; }
.sheet { position: fixed; inset: auto 0 0 0; z-index: 61; padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); border-radius: 26px 26px 0 0; transform: translateY(105%); transition: transform .32s cubic-bezier(.2,.9,.3,1); max-height: 82vh; overflow-y: auto; }
.sheet .grab { width: 44px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.25); margin: 0 auto 14px; }
.sheet-open .sheet-bg { opacity: 1; pointer-events: auto; }
.sheet-open .sheet { transform: none; }
.sheet .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet .tiles a { display: grid; justify-items: center; gap: 8px; padding: 16px 6px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--stroke); font-size: 12.5px; font-weight: 600; text-align: center; }
.sheet .tiles a svg { width: 24px; height: 24px; color: var(--yellow); }

.install-pill { display: none; }
.install-pill.show { display: inline-flex; }

/* الطباعة */
@media print {
  .side, .topbar, .mbar, .mtop, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
  .backdrop { display: none; }
  .card { background: #fff; color: #000; border: 1px solid #ddd; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ── استجابة ── */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .topbar { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; margin: 0 -16px 16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: rgba(8,8,10,.62); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--stroke); }
  .mtop img { width: 34px; height: 34px; border-radius: 10px; }
  .mtop h1 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); padding: 6px; border-radius: 22px; background: rgba(14,14,16,.78); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--stroke-2); box-shadow: 0 18px 40px -12px rgba(0,0,0,.9); }
  .mbar a, .mbar button { display: grid; justify-items: center; gap: 3px; padding: 7px 2px; border-radius: 16px; font: 600 11px var(--f-body); color: var(--muted); background: none; border: 0; position: relative; }
  .mbar svg { width: 22px; height: 22px; }
  .mbar .on { color: var(--yellow); background: rgba(255,196,0,.1); }
  .mbar .fab { margin-top: -26px; }
  .mbar .fab span.c { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(180deg, #FFD84D, #FFC400); color: var(--yellow-ink); box-shadow: 0 10px 26px -6px rgba(255,196,0,.8), 0 0 0 5px rgba(8,8,10,.9); }
  .mbar .pill { position: absolute; top: 3px; left: calc(50% - 22px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--yellow); color: var(--yellow-ink); font-size: 10.5px; display: grid; place-items: center; }
  .g3 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; border-radius: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .g2, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .g2.keep1, .fields, .fields.three { grid-template-columns: minmax(0, 1fr); }
  .stat .v { font-size: 24px; }
  .steps { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
  .step span { font-size: 10px; }
  .step .b { width: 28px; height: 28px; font-size: 11px; }
  .step::after { top: 14px; right: calc(50% + 16px); width: calc(100% - 28px); }
  .hide-m { display: none !important; }
  .t th, .t td { padding: 11px 12px; }
  .btn { --h: 46px; }
  .msg { max-width: 92%; }
  .board { grid-auto-columns: 84%; }
}
@media (min-width: 981px) { .show-m { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* إشعار قصير + مؤشر التحميل */
#toast { position: fixed; z-index: 90; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 14px; background: rgba(20,20,22,.92); border: 1px solid rgba(255,196,0,.35); color: var(--ink); font-weight: 600; font-size: 14px; transition: .25s; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 981px) { #toast { bottom: 28px; } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.i { flex: none; }

/* خط سير الطلبات */
.pipe { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.pipe-i { position: relative; display: grid; gap: 4px; padding: 12px 10px 10px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid var(--stroke); text-align: center; transition: .2s; min-width: 0; }
.pipe-i:hover { border-color: rgba(255,196,0,.45); transform: translateY(-2px); }
.pipe-n { font: 600 24px var(--f-display); color: var(--muted); line-height: 1.2; }
.pipe-l { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.pipe-i.has .pipe-n { color: var(--ink); }
.pipe-i.has.t-warn .pipe-n { color: var(--warn); }
.pipe-i.has.t-brand .pipe-n { color: var(--yellow); }
.pipe-i.has.t-warn { background: linear-gradient(180deg, rgba(255,176,32,.12), rgba(0,0,0,.3)); }
.pipe-i.has.t-brand { background: linear-gradient(180deg, rgba(255,196,0,.12), rgba(0,0,0,.3)); }
@media (max-width: 1180px) { .pipe { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pipe-n { font-size: 20px; } }

/* أعمدة التحصيل */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: end; height: 220px; padding-top: 6px; }
.bar-col { height: 100%; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; gap: 6px; min-width: 0; }
.bar-col .bar { align-self: end; width: min(46px, 100%); border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #FFD84D, rgba(255,196,0,.25)); box-shadow: 0 0 24px -6px rgba(255,196,0,.6); }
.bar-col:last-child .bar { background: linear-gradient(180deg, #FFE27A, #FFC400); }
.bar-v { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.bar-l { font-size: 12.5px; color: var(--ink-2); }
.bar-s { font-size: 11px; color: var(--muted); }
@media (min-width: 981px) { .sheet, .sheet-bg { display: none !important; } }
.sheet { visibility: hidden; transition: transform .32s cubic-bezier(.2,.9,.3,1), visibility 0s .32s; }
.sheet-open .sheet { visibility: visible; transition: transform .32s cubic-bezier(.2,.9,.3,1); }
.receipt-th { width: 92px; height: 120px; flex: none; border-radius: 12px; overflow: hidden; border: 1px solid var(--stroke); background: rgba(0,0,0,.35); display: grid; place-items: center; color: var(--yellow); }
.receipt-th img { width: 100%; height: 100%; object-fit: cover; }
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.pcard { transition: .2s; display: block; }
.pcard:hover { border-color: rgba(255,196,0,.4); transform: translateY(-2px); }
.pcard.pending { border-color: rgba(255,176,32,.45); }
.pcard.suspended { opacity: .6; }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 12px; border-top: 1px solid var(--stroke); text-align: center; }
.pstats b { display: block; font: 600 17px var(--f-display); }
.pstats span { font-size: 11.5px; color: var(--muted); }
.meter { display: inline-block; width: 70px; height: 7px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; vertical-align: middle; margin-inline-end: 8px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #FFC400, #FFE27A); border-radius: 9px; }
.warn-t { color: var(--warn); }
.bg-preview { aspect-ratio: 16/9; max-width: 100%; border-radius: 14px; background: #000 center/cover; border: 1px solid var(--stroke); display: grid; place-items: end start; padding: 10px; }
.bg-preview span { font-size: 12px; padding: 2px 10px; border-radius: 99px; background: rgba(0,0,0,.6); }
.alert-li.unread .body b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-inline-start: 8px; box-shadow: 0 0 8px var(--yellow); vertical-align: middle; }
.alert-li:not(.unread) { opacity: .7; }
/* بوابة الشريك */
.wallet-hero .v { margin: 4px 0 8px; }
.wallet-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255,196,0,.2); }
.wallet-row span { display: block; font-size: 12px; color: var(--ink-2); }
.wallet-row b { font: 600 16px var(--f-display); }
.jobs { display: grid; gap: 10px; }
.job { display: flex; align-items: center; gap: 12px; padding: 13px; border-radius: 16px; background: rgba(0,0,0,.32); border: 1px solid var(--stroke); transition: .2s; min-width: 0; }
.job:hover { border-color: rgba(255,196,0,.4); }
.job.offered { border-color: rgba(255,196,0,.45); background: linear-gradient(90deg, rgba(255,196,0,.03), rgba(255,196,0,.1)); }
.job.returned { border-color: rgba(255,107,107,.45); }
.job .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--yellow-soft); color: var(--yellow); flex: none; }
.job .body { flex: 1; min-width: 0; }
.job .body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .body span { font-size: 12.5px; color: var(--muted); }
.job .end { display: grid; justify-items: end; gap: 4px; flex: none; }
.job .end b { font: 600 15px var(--f-display); color: var(--yellow-2); }
@media (max-width: 640px) { .wallet-row b { font-size: 14px; } .job .end .badge { display: none; } }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-slot { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--stroke); }
.photo-slot.ok { border-color: rgba(61,220,151,.45); }
.design-big { display: grid; place-items: center; border-radius: 16px; overflow: hidden; background: repeating-conic-gradient(rgba(255,255,255,.03) 0 25%, transparent 0 50%) 0 0/20px 20px, #0c0c0e; border: 1px solid var(--stroke); max-width: 100%; }
.design-big img { width: 100%; max-height: 520px; object-fit: contain; }
.thumbs .th form.del { position: absolute; top: 6px; left: 6px; }
/* صفحة العميل */
.track-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.track-head img { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255,196,0,.3), 0 10px 30px -10px rgba(255,196,0,.6); }
.track-head b { display: block; font-family: var(--f-display); font-size: 16px; }
.track-head span { font-size: 12.5px; color: var(--muted); }
.bank { display: grid; gap: 0; border-radius: 14px; border: 1px solid var(--stroke); overflow: hidden; }
.bank > div { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--stroke); background: rgba(0,0,0,.25); flex-wrap: wrap; }
.bank > div:last-child { border-bottom: 0; }
.bank span { color: var(--muted); font-size: 13px; min-width: 80px; }
.bank b { flex: 1; font-weight: 600; word-break: break-all; }
.perk { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px 8px; border-radius: 16px; background: rgba(0,0,0,.3); border: 1px solid var(--stroke); }
.perk svg { width: 24px; height: 24px; color: var(--yellow); }
.perk b { font-size: 14px; }
.perk span { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .perk { padding: 10px 4px; } .perk span { display: none; } }
@media (max-width: 640px) { .ohead { flex-direction: column; align-items: stretch !important; } .ohead > .grow { flex: none; } .ohead .money-hero { min-width: 0 !important; } }
.icon-btn .dot { top: -6px; left: -6px; }
