/* ============================================================
   شركاء رواج — auth, onboarding and the partner dashboard
   ============================================================ */
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ================= auth ================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-main { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 64px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 0; }
.auth-form { width: min(420px, 100%); }
.auth-form h1 { font-size: 1.8rem; font-weight: 800; }
.auth-form > p { color: var(--muted); margin: 8px 0 28px; }
.btn-google { width: 100%; min-height: 50px; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 600; font-family: var(--f-head); cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s; }
.btn-google:hover { border-color: #CFCBE3; background: #FBFAFF; box-shadow: var(--sh-sm); }
.btn-google svg { width: 20px; height: 20px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .82rem; margin: 22px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 46px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; cursor: pointer; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.pw-toggle svg { width: 18px; height: 18px; }
.auth-switch { text-align: center; margin-top: 22px; color: var(--muted); font-size: .92rem; }
.auth-switch a { color: var(--brand); font-weight: 700; }
.auth-side { position: relative; overflow: hidden; isolation: isolate; background: var(--night); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-side .aurora { position: absolute; inset: 0; z-index: -1; }
.auth-side .aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; animation: drift 16s ease-in-out infinite alternate; }
.auth-side .aurora i:nth-child(1) { width: 420px; height: 420px; background: #5B4DF5; top: -120px; inset-inline-end: -80px; }
.auth-side .aurora i:nth-child(2) { width: 360px; height: 360px; background: #F43F5E; bottom: -140px; inset-inline-start: -60px; opacity: .35; }
@keyframes drift { 50% { transform: translate(40px, 30px) scale(1.1); } }
.auth-side h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); font-weight: 800; max-width: 460px; }
.auth-side h2 em { font-style: normal; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-side > p { color: rgba(255, 255, 255, .7); margin-top: 14px; max-width: 440px; }
.auth-perks { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.auth-perks li { display: flex; gap: 14px; align-items: center; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: 14px 16px; }
.auth-perks .ap-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(245, 182, 66, .14); color: #FFD27A; flex-shrink: 0; }
.auth-perks .ap-ic svg { width: 20px; height: 20px; }
.auth-perks b { display: block; font-family: var(--f-head); }
.auth-perks span { font-size: .84rem; color: rgba(255, 255, 255, .65); }
.auth-badges { display: flex; gap: 10px; margin-top: 30px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }
.lang-chip { border: 1px solid var(--line); background: #fff; border-radius: 10px; height: 36px; padding: 0 12px; font-weight: 700; font-size: .8rem; cursor: pointer; }
.lang-chip:hover { background: var(--brand-50); }

/* ================= onboarding ================= */
.ob { min-height: 100vh; background: radial-gradient(1200px 500px at 50% -10%, #ECE9FF 0%, transparent 70%), var(--bg); display: flex; flex-direction: column; }
.ob-top { display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(16px, 4vw, 40px); }
.ob-main { flex: 1; display: flex; justify-content: center; padding: 10px 16px 60px; }
.ob-card { width: min(640px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh); padding: clamp(22px, 4vw, 40px); }
.ob-progress { display: flex; gap: 8px; margin-bottom: 28px; }
.ob-progress i { flex: 1; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; position: relative; }
.ob-progress i::after { content: ""; position: absolute; inset: 0; background: var(--grad-brand); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease); }
[dir="ltr"] .ob-progress i::after { transform-origin: left; }
.ob-progress i.done::after { transform: scaleX(1); }
.ob-step { display: none; animation: stepIn .5s var(--ease); }
.ob-step.on { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } }
.ob-step h1 { font-size: 1.5rem; font-weight: 800; }
.ob-step > p { color: var(--muted); margin: 6px 0 24px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-opt { position: relative; cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt .to-card { border: 2px solid var(--line); border-radius: 20px; padding: 22px; height: 100%; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.type-opt:hover .to-card { transform: translateY(-2px); border-color: #CFCBE3; }
.type-opt input:checked + .to-card { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91, 77, 245, .12); }
.type-opt input:focus-visible + .to-card { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.to-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); margin-bottom: 14px; }
.to-ic svg { width: 26px; height: 26px; }
.type-opt input:checked + .to-card .to-ic { background: var(--grad-brand); color: #fff; }
.to-card b { font-family: var(--f-head); font-size: 1.05rem; display: block; }
.to-card span { color: var(--muted); font-size: .86rem; }
.to-check { position: absolute; top: 14px; inset-inline-end: 14px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: .2s; }
.type-opt input:checked + .to-card .to-check { background: var(--brand); border-color: var(--brand); }
.to-check svg { width: 14px; height: 14px; color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line); font-weight: 600; font-size: .86rem; cursor: pointer; transition: .2s; user-select: none; }
.chip-opt input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.chip-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.ob-actions { display: flex; gap: 10px; margin-top: 26px; }
.ob-actions .btn-primary, .ob-actions .btn-grad { flex: 1; }
.terms-box { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #FBFAFF; max-height: 210px; overflow: auto; font-size: .86rem; color: var(--ink-2); margin-bottom: 18px; }
.terms-box h4 { font-size: .9rem; margin: 10px 0 4px; }
.terms-box h4:first-child { margin-top: 0; }
.ob-done { text-align: center; padding: 16px 0; }
.done-check { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad-brand); box-shadow: var(--sh-brand); animation: pop .6s var(--ease); }
.done-check svg { width: 42px; height: 42px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: drawCheck .5s .35s var(--ease) forwards; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
@media (max-width: 520px) { .type-grid { grid-template-columns: 1fr; } }

/* ================= app shell ================= */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; background: #fff; border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 4px; overflow-y: auto;
}
.side .logo { padding: 4px 8px 18px; color: var(--ink); }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2);
  font-weight: 600; font-size: .92rem; transition: background .2s, color .2s; position: relative;
}
.side-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.side-link:hover { background: var(--line-2); color: var(--ink); }
.side-link.active { background: var(--brand-50); color: var(--brand-700); }
.side-link.active::before { content: ""; position: absolute; inset-inline-start: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
[dir="rtl"] .side-link.active::before { border-radius: 4px 0 0 4px; }
.side-link .dot[hidden] { display: none; }
.side-link .dot { margin-inline-start: auto; min-width: 20px; height: 20px; border-radius: 99px; background: var(--rose); color: #fff; font-size: .7rem; display: grid; place-items: center; padding: 0 6px; }
.side-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.side-promo { margin-top: auto; border-radius: 18px; padding: 16px; background: linear-gradient(150deg, #17132F, #0B0918); color: #fff; position: relative; overflow: hidden; }
.side-promo::after { content: ""; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: #5B4DF5; filter: blur(50px); opacity: .6; top: -50px; inset-inline-end: -40px; }
.side-promo b { display: block; font-family: var(--f-head); position: relative; z-index: 1; }
.side-promo span { font-size: .8rem; color: rgba(255, 255, 255, .7); position: relative; z-index: 1; }
.side-promo .btn { margin-top: 12px; width: 100%; position: relative; z-index: 1; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 32px);
  background: rgba(246, 245, 251, .82); backdrop-filter: blur(12px) saturate(1.3); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 1.25rem; font-weight: 800; }
.topbar .tb-mlogo { display: none; }
.tb-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.bal-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-family: var(--f-head); font-size: .88rem; transition: border-color .2s; }
.bal-chip:hover { border-color: var(--gold); }
.bal-chip i { width: 26px; height: 26px; border-radius: 50%; background: var(--grad-gold); display: grid; place-items: center; color: #3A2400; }
.bal-chip i svg { width: 14px; height: 14px; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); background: var(--grad-brand); color: #fff; font-weight: 800; font-family: var(--f-head); display: grid; place-items: center; cursor: pointer; overflow: hidden; padding: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh-lg); padding: 8px; display: none; z-index: 60; }
.menu.open { display: block; animation: toastIn .2s var(--ease); }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head b { display: block; font-size: .92rem; }
.menu-head span { font-size: .78rem; color: var(--muted); word-break: break-all; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: .88rem; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--line-2); }
.menu svg { width: 18px; height: 18px; color: var(--muted); }
.content { padding: 8px clamp(16px, 3vw, 32px) 48px; width: 100%; max-width: 1280px; }
.bottom-nav { display: none; }
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar .tb-mlogo { display: inline-flex; }
  .topbar h1 { display: none; }
  .content { padding-bottom: 110px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 10px; bottom: 10px; z-index: 40;
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-lg);
    padding: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 16px; font-size: .68rem; font-weight: 700; color: var(--muted); position: relative; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--brand); background: var(--brand-50); }
  .bal-chip span.lbl { display: none; }
}
@media (max-width: 420px) { .bal-chip { padding-inline-end: 10px; font-size: .8rem; } }

/* ================= page bits ================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 22px; }
.page-head h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-sm); }
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font-size: 1.02rem; font-weight: 700; }
.card-h .sub { color: var(--muted); font-size: .82rem; }
.card-h .end { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: 1.7fr 1fr; }
@media (max-width: 1100px) { .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .g-2, .g-3 { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-ic { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty-ic svg { width: 28px; height: 28px; }
.empty b { display: block; color: var(--ink); font-family: var(--f-head); margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* hero banner */
.welcome {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-xl); padding: 26px clamp(20px, 3vw, 30px);
  background: linear-gradient(130deg, #17132F 0%, #241B57 55%, #3A1F4F 100%); color: #fff; margin-bottom: 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center;
}
.welcome::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: #5B4DF5; filter: blur(90px); opacity: .55; top: -220px; inset-inline-end: -80px; z-index: -1; }
.welcome::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; background: #F5B642; filter: blur(100px); opacity: .22; bottom: -200px; inset-inline-start: 20%; z-index: -1; }
.welcome > div { min-width: 0; }
.welcome h2 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 800; }
.welcome p { color: rgba(255, 255, 255, .72); margin-top: 6px; }
.welcome .rate-pill svg { width: 14px; height: 14px; }
.welcome .rate-pill { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; background: rgba(245, 182, 66, .16); color: #FFD27A; border: 1px solid rgba(245, 182, 66, .35); padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .8rem; margin-bottom: 10px; }
.link-box { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 6px 6px 6px 14px; margin-top: 16px; max-width: 560px; }
[dir="rtl"] .link-box { padding: 6px 14px 6px 6px; }
.link-box code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; color: #E9E5FF; }
.link-box .btn { min-height: 38px; }
.welcome-qr { background: #fff; border-radius: 18px; padding: 10px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); cursor: pointer; transition: transform .3s var(--ease); }
.welcome-qr:hover { transform: scale(1.04) rotate(-1deg); }
.welcome-qr svg { width: 112px; height: 112px; }
@media (max-width: 680px) { .welcome { grid-template-columns: 1fr; } .welcome-qr { display: none; } }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; position: relative; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.kpi-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; font-size: .84rem; }
.kpi-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ic svg { width: 18px; height: 18px; }
.kpi-val { font-family: var(--f-head); font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 800; margin: 12px 0 4px; letter-spacing: -.01em; }
.kpi-delta { font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: #067A5E; } .kpi-delta.down { color: #BE123C; } .kpi-delta.flat { color: var(--muted); }
.kpi-delta svg { width: 13px; height: 13px; }
.kpi-delta small { color: var(--muted); font-weight: 500; }
.kpi.k-money { background: linear-gradient(150deg, #FFFDF5, #FFF6DD); border-color: #F6E3B0; }
.kpi.k-money::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: var(--gold); filter: blur(50px); opacity: .25; top: -40px; inset-inline-end: -30px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .kpis { gap: 10px; } .kpi { padding: 14px; } }

/* segmented tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--line-2); border-radius: 12px; }
.tabs button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--muted); transition: .2s; white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--sh-sm); }
.tabs-scroll { overflow-x: auto; max-width: 100%; }

/* chart */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: #EEECF5; stroke-width: 1; }
.chart-axis text { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-cross { stroke: #C9C4E0; stroke-width: 1; stroke-dasharray: 3 3; }
.chart-dot { fill: var(--brand); stroke: #fff; stroke-width: 2.5; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 12px; font-size: .78rem;
  box-shadow: var(--sh-lg); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .15s;
}
.chart-tip b { display: block; font-family: var(--f-head); font-size: .95rem; }
.chart-sum { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-sum div span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.chart-sum div b { font-family: var(--f-head); font-size: 1.35rem; }

/* milestone card */
.ms-card { display: flex; gap: 18px; align-items: center; }
.ms-card .badge-svg { flex-shrink: 0; }
.ms-card h4 { font-size: 1rem; }
.ms-card p { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.progress { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--grad-gold); width: 0; transition: width 1.2s var(--ease); }
.progress-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* balances */
.bal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bal { border-radius: 16px; padding: 14px; background: var(--line-2); }
.bal span { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.bal b { display: block; font-family: var(--f-head); font-size: 1.25rem; margin-top: 4px; }
.bal.big { grid-column: 1 / -1; background: linear-gradient(140deg, #17132F, #2A1F5E); color: #fff; padding: 18px; position: relative; overflow: hidden; }
.bal.big::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: var(--gold); filter: blur(60px); opacity: .3; bottom: -80px; inset-inline-end: -40px; }
.bal.big span { color: rgba(255, 255, 255, .7); }
.bal.big b { font-size: 2rem; }
.bal.big .btn { margin-top: 12px; position: relative; z-index: 1; }

/* lists & tables */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); }
.li:last-child { border-bottom: 0; }
.li-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--mint-50); color: var(--mint); }
.li-ic svg { width: 18px; height: 18px; }
.li-ic img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.li-main { min-width: 0; flex: 1; }
.li-main b { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main span { font-size: .78rem; color: var(--muted); }
.li-end { text-align: end; flex-shrink: 0; }
.li-end b { font-family: var(--f-head); display: block; }
.li-end span { font-size: .75rem; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.table th { text-align: start; font-size: .75rem; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FBFAFF; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; direction: ltr; unicode-bidi: isolate; }

/* apps catalogue */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.app-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s; cursor: pointer; text-align: start; padding: 0; font: inherit; color: inherit; }
.app-card:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.app-cover { height: 110px; background: linear-gradient(130deg, #241B57, #5B4DF5 60%, #F43F5E); position: relative; }
.app-cover::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .18) 1px, transparent 1px); background-size: 14px 14px; }
.app-icon { width: 68px; height: 68px; border-radius: 20px; background: #fff; border: 4px solid #fff; box-shadow: var(--sh); margin: -38px 18px 0; position: relative; z-index: 1; overflow: hidden; display: grid; place-items: center; font-family: var(--f-head); font-weight: 800; font-size: 1.5rem; color: var(--brand); }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-body { padding: 12px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.app-body h3 { font-size: 1.1rem; }
.app-body p { color: var(--muted); font-size: .88rem; margin-top: 4px; flex: 1; }
.app-stats { display: flex; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: .8rem; color: var(--muted); }
.app-stats b { color: var(--ink); font-family: var(--f-head); }
.app-detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.app-detail-head .app-icon { margin: 0; width: 64px; height: 64px; }
.qr-panel { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--line-2); border-radius: 18px; padding: 16px; margin: 16px 0; }
.qr-panel .qr { background: #fff; padding: 8px; border-radius: 14px; }
.qr-panel .qr svg { width: 132px; height: 132px; }
.qr-actions { display: flex; flex-direction: column; gap: 8px; }
.copy-field { display: flex; gap: 8px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 5px 5px 5px 12px; background: #fff; }
[dir="rtl"] .copy-field { padding: 5px 12px 5px 5px; }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; font-size: .82rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.store-links { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .qr-panel { grid-template-columns: 1fr; justify-items: center; text-align: center; } .qr-actions { width: 100%; } }

/* wallet */
.method { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 16px; }
.method + .method { margin-top: 10px; }
.method.def { border-color: var(--brand-100); background: #FBFAFF; }
.m-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font-weight: 800; font-family: var(--f-head); font-size: .8rem; }
.m-bank { background: #E8F1FF; color: #1D4ED8; }
.m-paypal { background: #E6F0FF; color: #003087; }
.m-usdt { background: #E3F7EF; color: #0F9D6E; }
.m-ic svg { width: 20px; height: 20px; }
.method-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.method-types label { cursor: pointer; }
.method-types input { position: absolute; opacity: 0; }
.method-types div { border: 2px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; font-weight: 700; font-size: .84rem; transition: .2s; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.method-types input:checked + div { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.method-types input:focus-visible + div { outline: 2px solid var(--brand); outline-offset: 2px; }

/* milestones page */
.ms-hero { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.ms-hero .count { font-family: var(--f-head); font-size: 3rem; font-weight: 900; line-height: 1; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.ms-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 14px 18px; text-align: center; position: relative; transition: transform .35s var(--ease), box-shadow .35s; }
.ms-tile:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.ms-tile.got { background: linear-gradient(170deg, #FFFDF5, #fff 60%); border-color: #F6E3B0; }
.ms-tile .badge-svg { margin: 0 auto 10px; }
.ms-tile b { display: block; font-family: var(--f-head); }
.ms-tile span { font-size: .8rem; color: var(--muted); }
.ms-tile .gift { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .76rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--gold-50); color: #9A6200; }
.ms-tile .gift svg { width: 13px; height: 13px; }
.ms-tile .state { position: absolute; top: 12px; inset-inline-end: 12px; }
@media (max-width: 560px) { .ms-hero { grid-template-columns: 1fr; text-align: center; } .ms-hero .badge-svg { margin: 0 auto; } }

/* support chat */
.tk-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.tk-item { display: block; width: 100%; text-align: start; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; cursor: pointer; transition: border-color .2s, background .2s; font: inherit; color: inherit; }
.tk-item + .tk-item { margin-top: 8px; }
.tk-item:hover { border-color: #CFCBE3; }
.tk-item.on { border-color: var(--brand); background: #FBFAFF; }
.tk-item b { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.tk-item b .pill { margin-inline-start: auto; }
.tk-item p { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.chat { display: flex; flex-direction: column; height: min(620px, calc(100vh - 200px)); padding: 0; overflow: hidden; }
.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.chat-head h3 { font-size: 1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: #FBFAFE; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; white-space: pre-wrap; word-wrap: break-word; }
.msg small { display: block; font-size: .7rem; opacity: .65; margin-top: 4px; }
.msg.me { align-self: flex-start; background: var(--brand); color: #fff; border-end-start-radius: 4px; }
.msg.them { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-end-end-radius: 4px; }
.msg.them .who { font-size: .72rem; font-weight: 700; color: var(--brand); display: block; margin-bottom: 2px; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-form textarea { flex: 1; min-height: 46px; max-height: 140px; resize: none; }
@media (max-width: 900px) { .tk-layout { grid-template-columns: 1fr; } .chat { height: 70vh; } }
