/* ================= فاست باي - الأنماط المخصصة ================= */

:root {
    padding-top: env(safe-area-inset-top, 0px);
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); }

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background-color: rgb(var(--b-page, 248 250 252));
    color: rgb(var(--t-slate-800, 30 41 59));
    overflow-x: hidden;
}

.num {
    font-family: 'Cairo', sans-serif;
    font-variant-numeric: tabular-nums;
}

/* ================= البطاقات ================= */
.section-card {
    background: rgb(var(--b-white, 255 255 255));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.section-card:hover {
    border-color: rgb(var(--c-slate-300, 203 213 225));
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

/* ================= التنقل ================= */
.nav-item.active {
    background-color: rgb(var(--b-blue-50, 239 246 255));
    color: rgb(var(--t-blue-600, 37 99 235));
    font-weight: 700;
    border-right: 3px solid #2563eb;
}

/* شريط التنقل السفلي للجوال */
.mobile-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-nav-item {
    color: rgb(var(--t-slate-500, 100 116 139));
}
.mobile-nav-item.active {
    color: rgb(var(--t-blue-600, 37 99 235));
    font-weight: 700;
}
.mobile-nav-item.active svg {
    stroke: #2563eb;
}

/* ================= الجداول ================= */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgb(var(--c-slate-300, 203 213 225)) transparent;
}
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: rgb(var(--b-slate-300, 203 213 225)); border-radius: 3px; }
.table-scroll table { min-width: 740px; }

tbody tr:hover { background-color: rgb(var(--b-slate-50, 248 250 252)); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* مؤشر حالة المزامنة مع Google Sheets */
.sync-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    vertical-align: middle;
}
.sync-dot.ok { background: #10b981; }
.sync-dot.unconfirmed { background: #f59e0b; }
.sync-dot.pending { background: rgb(var(--b-slate-400, 148 163 184)); }
.sync-dot.failed { background: #e11d48; }

/* ================= الإشعارات المنبثقة (Toast) ================= */
#toastContainer {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: calc(100vw - 2rem);
}
.toast-item {
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.toast-item.show {
    transform: translateX(0);
}

/* ================= التحليل الشهري ================= */
:root {
    --series-profit: #2a78d6;   /* الفئة 1: أزرق */
    --series-expense: #eb6834;  /* الفئة 2: برتقالي */
    --series-net: #1baf7a;      /* الفئة 3: أخضر مائي */
    --chart-surface: #ffffff;
    --chart-grid: #ecebe8;
    --chart-axis: #c9c8c3;
    --chart-text: #52514e;
    --chart-muted: #8a8984;
    --chart-ink: #0b0b0b;
    --chart-track: #fde4d8;
}
html[data-theme="dark"] {
    --series-profit: #4b93ec;
    --series-expense: #f07e4f;
    --series-net: #2cc790;
    --chart-surface: #111a2e;
    --chart-grid: #222e47;
    --chart-axis: #3a4866;
    --chart-text: #a8b3c5;
    --chart-muted: #7c8aa3;
    --chart-ink: #f1f5f9;
    --chart-track: #412b2f;
}

.ana-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 0.875rem;
    background: rgb(var(--b-white, 255 255 255));
}
.ana-tile-hero {
    background: rgb(var(--b-slate-50, 248 250 252));
    border-color: rgb(var(--c-slate-300, 203 213 225));
}
.ana-tile-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--chart-text);
}
.ana-tile-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--chart-ink);
    line-height: 1.15;
}
.ana-tile-hero .ana-tile-value { font-size: 2.25rem; }
.ana-tile-value small { font-size: 0.9rem; font-weight: 700; color: var(--chart-muted); }
.ana-delta { font-size: 0.7rem; font-weight: 700; min-height: 1rem; }
.ana-delta.good { color: rgb(var(--t-emerald-700, 4 120 87)); }
.ana-delta.bad { color: rgb(var(--t-rose-700, 190 18 60)); }
.ana-delta.flat { color: rgb(var(--t-slate-500, 100 116 139)); }

/* مفتاح اللون بجانب النص (النص نفسه لا يأخذ لون السلسلة) */
.ana-key {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 3px;
    flex-shrink: 0;
}
.ana-key-line { height: 3px; width: 0.9rem; border-radius: 2px; }

/* مؤشر "مباشر" */
.live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #10b981;
    position: relative;
}
.live-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: inherit;
    animation: live-pulse 1.8s ease-out infinite;
}
.live-dot.off { background: rgb(var(--b-slate-400, 148 163 184)); }
.live-dot.off::after { animation: none; }
@keyframes live-pulse {
    from { transform: scale(1); opacity: 0.7; }
    to { transform: scale(2.8); opacity: 0; }
}

.ana-range-btn.active {
    background: rgb(var(--b-white, 255 255 255));
    color: rgb(var(--t-slate-900, 15 23 42));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* الرسم البياني */
.ana-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.ana-chart text { font-family: 'IBM Plex Sans Arabic', sans-serif; }
.ana-bar {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transform: scaleY(0);
    transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0ms);
}
.ana-chart.in .ana-bar { transform: scaleY(1); }
.ana-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.2s ease-in-out 0.35s;
}
.ana-chart.in .ana-line { stroke-dashoffset: 0; }
.ana-dot {
    opacity: 0;
    transition: opacity 0.3s ease var(--d, 0ms);
}
.ana-chart.in .ana-dot { opacity: 1; }
.ana-band { fill: transparent; cursor: pointer; }
/* تغيير الشهر المختار فقط: بدون إعادة الحركة */
.ana-chart.static .ana-bar, .ana-chart.static .ana-line, .ana-chart.static .ana-dot { transition: none !important; animation: none !important; }
.ana-band.selected { fill: rgb(var(--c-slate-100, 241 245 249)); }
.ana-band:hover { fill: rgb(var(--c-slate-50, 248 250 252)); }

.ana-tooltip {
    position: absolute;
    top: 0;
    z-index: 10;
    min-width: 11rem;
    padding: 0.6rem 0.75rem;
    background: rgb(var(--b-white, 255 255 255));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.18);
    font-size: 0.72rem;
    pointer-events: none;
    transform: translateX(-50%);
}
.ana-tooltip-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.1rem 0; }

/* أشرطة البنود */
.ana-cat-track { height: 0.6rem; background: var(--chart-track); border-radius: 9999px; overflow: hidden; }
.ana-cat-fill {
    height: 100%;
    width: 0;
    background: var(--series-expense);
    border-radius: 9999px;
    transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0ms);
}

/* التحليل */
.ana-insight {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.75rem;
    line-height: 1.6;
    color: rgb(var(--t-slate-700, 51 65 85));
    opacity: 0;
    transform: translateY(6px);
    animation: ana-fade-up 0.5s ease forwards var(--d, 0ms);
}
.ana-insight-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: rgb(var(--b-white, 255 255 255));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
}
@keyframes ana-fade-up {
    to { opacity: 1; transform: translateY(0); }
}

#ana-table-body tr.selected { background: rgb(var(--b-slate-100, 241 245 249)); }

@media (prefers-reduced-motion: reduce) {
    .ana-bar, .ana-line, .ana-dot, .ana-cat-fill, .ana-insight, .live-dot::after {
        transition: none !important;
        animation: none !important;
    }
    .ana-bar { transform: scaleY(1); }
    .ana-line { stroke-dashoffset: 0; }
    .ana-dot, .ana-insight { opacity: 1; transform: none; }
}

/* الأرقام السالبة تبقى بالإشارة في أولها داخل الصفحة العربية */
.ana-tile-value > span:first-child,
bdi.ltr-num {
    direction: ltr;
    unicode-bidi: isolate;
}

@media (max-width: 639px) {
    .ana-tile { padding: 0.65rem; gap: 0.2rem; }
    .ana-tile-label { font-size: 0.68rem; }
    .ana-tile-value, .ana-tile-hero .ana-tile-value { font-size: 1.15rem; }
    .ana-tile-value small { font-size: 0.7rem; }
    .ana-delta { font-size: 0.62rem; line-height: 1.4; }
}

/* ================= الحاسبة (الواجهة الرئيسية) ================= */
.calc-step {
    opacity: 0;
    transform: translateY(10px);
    animation: calc-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes calc-in {
    to { opacity: 1; transform: translateY(0); }
}
/* الحركة بتضل ماسكة transform فكل بطاقة طبقة لحالها، والبطاقة اللي بعدها كانت تغطي قائمة الزبائن المفتوحة:
   البطاقة اللي فيها القائمة بتطلع فوق */
.calc-step:has(.cust-dropdown:not(.hidden)) { position: relative; z-index: 30; }

.calc-step-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: rgb(var(--t-slate-900, 15 23 42));
}
.calc-step-num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.5rem;
    background: rgb(var(--b-slate-900, 15 23 42));
    color: rgb(var(--t-inv, 255 255 255));
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', sans-serif;
}

.calc-label { display: block; font-size: 0.72rem; font-weight: 700; color: rgb(var(--t-slate-600, 71 85 105)); margin-bottom: 0.3rem; }
.calc-label-sm { display: block; font-size: 0.66rem; font-weight: 600; color: rgb(var(--t-slate-500, 100 116 139)); margin-bottom: 0.2rem; }
.calc-input {
    width: 100%;
    font-size: 0.875rem;
    font-weight: 700;
    color: rgb(var(--t-slate-800, 30 41 59));
    background: rgb(var(--b-white, 255 255 255));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.calc-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.calc-amount { font-size: 1.6rem; font-weight: 800; padding: 0.55rem 0.85rem; }
.calc-input-sm {
    width: 100%;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgb(var(--b-white, 255 255 255));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 0.5rem;
    padding: 0.4rem 0.5rem;
    outline: none;
}
.calc-input-sm:focus { border-color: #3b82f6; }

/* شبكة المصادر */
.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 0.5rem;
    max-height: 13.5rem;
    overflow-y: auto;
    padding: 2px;
    scrollbar-width: thin;
}
.source-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 0.75rem;
    background: rgb(var(--b-white, 255 255 255));
    text-align: right;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.source-chip:hover { border-color: rgb(var(--c-slate-300, 203 213 225)); background: rgb(var(--b-slate-50, 248 250 252)); }
.source-chip:active { transform: scale(0.97); }
.source-chip-name { font-size: 0.78rem; font-weight: 800; color: rgb(var(--t-slate-900, 15 23 42)); }
.source-chip-rate { font-size: 0.65rem; font-weight: 600; color: rgb(var(--t-slate-500, 100 116 139)); font-family: 'Cairo', sans-serif; }
.source-chip.active {
    border-color: #2563eb;
    background: rgb(var(--b-blue-50, 239 246 255));
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    animation: chip-pop 0.25s ease;
}
@keyframes chip-pop {
    50% { transform: scale(1.04); }
}

/* أزرار مجزأة */
.seg {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgb(var(--b-slate-100, 241 245 249));
    border-radius: 0.875rem;
}
.seg-btn {
    padding: 0.6rem 0.5rem;
    border-radius: 0.65rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: rgb(var(--t-slate-500, 100 116 139));
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.seg-btn.active { background: rgb(var(--b-white, 255 255 255)); color: rgb(var(--t-slate-900, 15 23 42)); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.seg-sm .seg-btn { padding: 0.4rem 0.9rem; font-size: 0.75rem; }

.provider-chip {
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    background: rgb(var(--b-white, 255 255 255));
    font-size: 0.75rem;
    font-weight: 800;
    color: rgb(var(--t-slate-600, 71 85 105));
    transition: all 0.15s ease;
    animation: calc-in 0.3s ease forwards;
}
/* الأجهزة المسجّلة (admin.js renderSessionList) */
.dev-user { display: flex; align-items: baseline; gap: 0.4rem; font-size: 0.8rem; font-weight: 900; color: rgb(var(--t-slate-800, 30 41 59)); }
.dev-user span { font-size: 0.68rem; font-weight: 700; color: rgb(var(--t-slate-400, 148 163 184)); }
.dev-row { display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem 0.75rem; border-radius: 0.8rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); font-size: 0.8rem; }
.dev-row.current { border-color: rgb(var(--c-emerald-200, 167 243 208)); background: rgb(var(--b-emerald-50, 236 253 245)); }
.dev-ic { width: 2.1rem; height: 2.1rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 0.65rem; background: rgb(var(--b-slate-100, 241 245 249)); font-size: 1.05rem; }
.dev-badge { display: inline-block; margin-inline-start: 0.25rem; padding: 0.05rem 0.45rem; border-radius: 9999px; background: rgb(var(--b-emerald-100, 209 250 229)); color: rgb(var(--t-emerald-700, 4 120 87)); font-size: 0.62rem; font-weight: 900; vertical-align: middle; }
.dev-out { flex-shrink: 0; padding: 0.4rem 0.75rem; border-radius: 0.6rem; background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); font-size: 0.72rem; font-weight: 800; transition: background-color 0.15s ease; }
.dev-out:hover { background: rgb(var(--b-rose-100, 255 228 230)); }
/* جاهزية الدفع (position.js renderPayoutReadiness) */
.pr-badge { font-size: 0.7rem; font-weight: 800; padding: 0.2rem 0.6rem; border-radius: 9999px; white-space: nowrap; }
.pr-badge.short { background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); }
.pr-badge.ok { background: rgb(var(--b-emerald-50, 236 253 245)); color: rgb(var(--t-emerald-700, 4 120 87)); }
.pr-row { border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-inline-start: 4px solid var(--acc); border-radius: 0.85rem; background: rgb(var(--b-white, 255 255 255)); overflow: hidden; }
.pr-row.is-short { border-color: rgb(var(--c-rose-200, 254 205 211)); border-inline-start-color: var(--acc); }
.pr-sum { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(6.5rem, 1fr) 1fr 1fr minmax(7rem, 1.2fr) auto; align-items: center; gap: 0.5rem; padding: 0.65rem 0.8rem; }
.pr-sum::-webkit-details-marker { display: none; }
.pr-sum:hover { background: rgb(var(--b-slate-50, 248 250 252)); }
.pr-name { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.pr-cur { font-size: 0.65rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); }
.pr-num { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pr-num small { font-size: 0.65rem; color: rgb(var(--t-slate-400, 148 163 184)); font-weight: 700; }
.pr-num b { font-size: 0.82rem; font-weight: 900; color: rgb(var(--t-slate-900, 15 23 42)); white-space: nowrap; }
.pr-state { font-size: 0.75rem; font-weight: 900; white-space: nowrap; }
.pr-state.short { color: rgb(var(--t-rose-700, 190 18 60)); }
.pr-state.ok { color: rgb(var(--t-emerald-700, 4 120 87)); }
.pr-state.none { color: rgb(var(--t-slate-500, 100 116 139)); font-weight: 700; font-size: 0.7rem; white-space: normal; }
.pr-caret { color: rgb(var(--t-slate-400, 148 163 184)); font-size: 0.8rem; transition: transform 0.15s ease; }
.pr-row[open] .pr-caret { transform: rotate(180deg); }
.pr-break { padding: 0 0.8rem 0.4rem; font-size: 0.7rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); }
.pr-items { display: grid; gap: 1px; background: rgb(var(--c-slate-100, 241 245 249)); border-top: 1px solid rgb(var(--c-slate-100, 241 245 249)); }
.pr-item { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.5rem 0.8rem; background: rgb(var(--b-white, 255 255 255)); font-size: 0.75rem; font-weight: 700; color: rgb(var(--t-slate-700, 51 65 85)); text-align: right; }
.pr-item:hover { background: rgb(var(--b-blue-50, 239 246 255)); color: rgb(var(--t-blue-800, 30 64 175)); }
@media (max-width: 639px) {
    .pr-sum { grid-template-columns: 1fr 1fr auto; grid-template-areas: "name state caret" "need have have"; row-gap: 0.4rem; }
    .pr-name { grid-area: name; }
    .pr-state { grid-area: state; justify-self: end; }
    .pr-caret { grid-area: caret; }
    .pr-num:nth-of-type(2) { grid-area: need; }
    .pr-num:nth-of-type(3) { grid-area: have; }
}
/* زبون جديد بسحب USDT واستقبال الجنيه: كيف بيستلم (calculator.js setNewPayout) */
.np-box { display: grid; gap: 0.5rem; padding: 0.75rem; border-radius: 0.75rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.np-box.hidden { display: none; }
.np-box .provider-chip { padding: 0.35rem 0.8rem; }
/* كرّر آخر حوالة (calculator.js renderCalcRepeat) */
.calc-repeat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-top: -0.35rem; }
.calc-repeat-label { font-size: 0.7rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); }
.repeat-chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.3rem 0.7rem; border-radius: 9999px; border: 1px solid rgb(var(--c-blue-200, 191 219 254)); background: rgb(var(--b-blue-50, 239 246 255)); color: rgb(var(--t-blue-800, 30 64 175)); font-size: 0.72rem; font-weight: 800; transition: background-color 0.15s ease, border-color 0.15s ease; }
.repeat-chip:hover { background: rgb(var(--b-blue-100, 219 234 254)); border-color: rgb(var(--c-blue-300, 147 197 253)); }
.repeat-chip.active, .repeat-chip.active:hover { background: rgb(37 99 235); border-color: rgb(37 99 235); color: #fff; }
.provider-chip.active { background: rgb(var(--b-slate-900, 15 23 42)); border-color: rgb(var(--c-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); }

/* بطاقة النتيجة */
.calc-result {
    border-radius: 1.25rem;
    padding: 1.5rem;
    color: rgb(var(--t-inv, 255 255 255));
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(59, 130, 246, 0.22), transparent 55%),
        radial-gradient(90% 80% at 0% 100%, rgba(16, 185, 129, 0.16), transparent 55%),
        rgb(var(--b-slate-900, 15 23 42));
    border: 1px solid rgb(var(--c-slate-800, 30 41 59));
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.45);
}
.res-big {
    font-size: 2.75rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    direction: ltr;
    unicode-bidi: isolate;
}
@media (min-width: 640px) { .res-big { font-size: 3.25rem; } }
.res-big.bump { animation: res-bump 0.35s ease; }
@keyframes res-bump {
    40% { transform: scale(1.04); color: #a7f3d0; }
}

.split-bar {
    display: flex;
    gap: 2px;
    height: 0.6rem;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}
.split-seg { height: 100%; width: 0; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.split-client { background: rgb(var(--b-slate-200, 226 232 240)); }
.split-cost { background: #fbbf24; }
.split-profit { background: #34d399; }
.split-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; display: inline-block; }

.save-btn {
    position: relative;
    width: 100%;
    padding: 0.95rem;
    border-radius: 0.9rem;
    background: rgb(var(--b-white, 255 255 255));
    color: rgb(var(--t-slate-900, 15 23 42));
    font-weight: 900;
    font-size: 0.95rem;
    transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.save-btn:hover:not(:disabled) { transform: translateY(-1px); }
.save-btn:active:not(:disabled) { transform: scale(0.98); }
.save-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.save-btn.done { background: #10b981; color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* آخر الحوالات */
.recent-item { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0; font-size: 0.75rem; }
.recent-item.new { animation: recent-in 0.6s ease; }
@keyframes recent-in {
    from { opacity: 0; transform: translateX(-12px); background: rgb(var(--b-emerald-50, 236 253 245)); }
    to { opacity: 1; transform: translateX(0); background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .calc-step, .provider-chip, .source-chip.active, .res-big.bump, .recent-item.new { animation: none !important; opacity: 1; transform: none; }
    .split-seg { transition: none; }
}

/* شريط النتيجة السريع: فوق شريط التنقل على الجوال */
.mobile-result-bar {
    position: fixed;
    inset-inline: 0.75rem;
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem 0.6rem 0.6rem;
    border-radius: 1rem;
    background: rgb(var(--b-slate-900, 15 23 42));
    box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.6);
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}
.mobile-result-bar.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
@media (min-width: 768px) {
    .mobile-result-bar { bottom: 1rem; inset-inline: 1.5rem; }
}

/* ================= خطوة الزبون وطريقة الاستلام ================= */
.payout-box {
    padding: 0.85rem;
    border-radius: 0.9rem;
    background: rgb(var(--b-slate-50, 248 250 252));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
}
.other-box {
    padding: 0.85rem;
    border-radius: 0.9rem;
    background: rgb(var(--b-amber-50, 255 251 235));
    border: 1px dashed #f59e0b;
    animation: calc-in 0.3s ease forwards;
}
.source-chip-other { border-style: dashed; }
.rate-pill {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgb(var(--t-slate-300, 203 213 225));
}
.rate-pill b { color: #fff; font-weight: 800; }

/* ================= الفاتورة ================= */
#receiptModal:not(.hidden) .receipt-shell { animation: receipt-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes receipt-in {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.receipt-btn {
    padding: 0.8rem;
    border-radius: 0.9rem;
    font-weight: 900;
    font-size: 0.85rem;
    transition: transform 0.15s ease, opacity 0.2s ease;
}
.receipt-btn:active { transform: scale(0.97); }
.receipt-btn:disabled { opacity: 0.6; }

/* الورقة نفسها: دايماً فاتحة (حتى بالوضع الداكن، لأنها صورة بتنبعت للزبون)، فألوانها ثابتة */
.receipt-paper {
    background: #ffffff;
    color: #0f172a;
    border-radius: 1.25rem;
    overflow: hidden;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    direction: rtl;
}
/* الرأس: غامق بلمسة ذهبي الشعار */
.rc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.05rem 1.25rem;
    color: #fff;
    background:
        radial-gradient(120% 160% at 100% 0%, rgba(212, 168, 58, 0.26), transparent 55%),
        radial-gradient(90% 120% at 0% 100%, rgba(59, 130, 246, 0.16), transparent 60%),
        linear-gradient(135deg, #0b1220, #131f38);
}
.rc-brand { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.rc-logo {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.85rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #0b0b0b;
    box-shadow: 0 0 0 1px rgba(212, 168, 58, 0.5), 0 6px 16px -6px rgba(0, 0, 0, 0.6);
}
.rc-logo img { width: 100%; height: 100%; object-fit: contain; }
.rc-company { font-size: 1rem; font-weight: 800; line-height: 1.3; }
.rc-sub { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.14em; color: #e0bd68; margin-top: 0.1rem; }
.rc-doc {
    flex-shrink: 0;
    padding: 0.3rem 0.7rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(224, 189, 104, 0.35);
    font-size: 0.68rem;
    font-weight: 800;
    color: #f1e3bd;
}
/* المبلغ بالنص مع أيقونة الحالة بلونها */
.rc-hero { text-align: center; padding: 1.4rem 1.25rem 1.2rem; background: linear-gradient(180deg, #f8fafc, #ffffff); }
.rc-tone-ok { --tone: #059669; --tone-soft: #d1fae5; --tone-ring: #ecfdf5; }
.rc-tone-wait { --tone: #d97706; --tone-soft: #fef3c7; --tone-ring: #fffbeb; }
.rc-tone-part { --tone: #0284c7; --tone-soft: #e0f2fe; --tone-ring: #f0f9ff; }
.rc-tone-bad { --tone: #e11d48; --tone-soft: #ffe4e6; --tone-ring: #fff1f2; }
.rc-tone-info { --tone: #475569; --tone-soft: #e2e8f0; --tone-ring: #f1f5f9; }
.rc-check {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tone-soft);
    color: var(--tone);
    box-shadow: 0 0 0 6px var(--tone-ring);
}
.rc-check svg { width: 1.45rem; height: 1.45rem; }
.rc-amount-label { font-size: 0.72rem; color: #64748b; font-weight: 700; }
.rc-amount-value {
    margin-top: 0.1rem;
    font-size: 2.35rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #0b1220;
    font-family: 'Cairo', sans-serif;
    direction: ltr;
    unicode-bidi: isolate;
}
.rc-party { margin-top: 0.15rem; font-size: 0.8rem; color: #475569; }
.rc-party b { color: #0f172a; font-weight: 800; }
.rc-status {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.15rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 800;
}
/* التفاصيل بصندوق فاتح */
.rc-details {
    margin: 0 1.25rem;
    padding: 0.2rem 0.9rem;
    border-radius: 0.9rem;
    background: #f8fafc;
    border: 1px solid #edf1f6;
}
.rc-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.78rem;
}
.rc-row:last-child { border-bottom: 0; }
.rc-row span:first-child { color: #64748b; }
.rc-row span:last-child { font-weight: 700; text-align: left; white-space: nowrap; }
/* التاريخ ورقم الإيصال */
.rc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0.6rem 1.25rem 0; }
.rc-meta div { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.75rem; border-radius: 0.75rem; border: 1px solid #edf1f6; }
.rc-meta span { font-size: 0.62rem; font-weight: 700; color: #7d8aa0; }
.rc-meta b { font-size: 0.75rem; font-weight: 800; color: #0f172a; }
.rc-foot { padding: 0.95rem 1.25rem 1.05rem; text-align: center; }
.rc-thanks { font-size: 0.78rem; font-weight: 800; color: #334155; }
.rc-issued { margin-top: 0.2rem; font-size: 0.62rem; color: #7d8aa0; }
/* خط ذهبي آخر الورقة */
.rc-bar { height: 5px; background: linear-gradient(90deg, #8a6a1f, #e9c66b, #b8892c, #f3d98b, #8a6a1f); }

/* ================= البطاقة الحيّة: سعر الشاشة + المزامنة ================= */
.live-card {
    --live-color: rgb(var(--t-emerald-700, 4 120 87));
    --live-soft: rgb(var(--b-emerald-100, 209 250 229));
    --live-halo: rgb(var(--b-emerald-50, 236 253 245));
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.4rem 0.55rem 0.4rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    background: rgb(var(--b-white, 255 255 255));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.live-card:hover { border-color: rgb(var(--c-slate-300, 203 213 225)); box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.2); }
.live-card:active { transform: scale(0.98); }
.live-card[data-state="syncing"] { --live-color: rgb(var(--t-blue-700, 29 78 216)); --live-soft: rgb(var(--b-blue-100, 219 234 254)); --live-halo: rgb(var(--b-blue-50, 239 246 255)); }
.live-card[data-state="pending"],
.live-card[data-state="error"] { --live-color: rgb(var(--t-rose-700, 190 18 60)); --live-soft: rgb(var(--b-rose-100, 255 228 230)); --live-halo: rgb(var(--b-rose-50, 255 241 242)); border-color: rgb(var(--c-rose-200, 254 205 211)); }
.live-card[data-state="rate-error"] { --live-color: rgb(var(--t-amber-700, 180 83 9)); --live-soft: rgb(var(--b-amber-100, 254 243 199)); --live-halo: rgb(var(--b-amber-50, 255 251 235)); border-color: rgb(var(--c-amber-200, 253 230 138)); }
.live-card[data-state="disabled"] { --live-color: rgb(var(--t-slate-500, 100 116 139)); --live-soft: rgb(var(--b-slate-200, 226 232 240)); --live-halo: rgb(var(--b-slate-50, 248 250 252)); }

.live-card-dot {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 9999px;
    background: var(--live-halo);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}
.live-card-rate { display: flex; flex-direction: column; line-height: 1.1; text-align: right; }
.live-card-label { font-size: 0.62rem; color: rgb(var(--t-slate-400, 148 163 184)); font-weight: 700; }
.live-card-value { font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 1.1rem; color: rgb(var(--t-slate-900, 15 23 42)); }
.live-card-value small { font-size: 0.7rem; color: rgb(var(--t-slate-500, 100 116 139)); font-weight: 700; }
.live-lock { font-size: 0.65rem; margin-inline-start: 0.2rem; }
.live-card-sep { width: 1px; height: 1.9rem; background: rgb(var(--b-slate-200, 226 232 240)); }
.live-card-status { display: flex; align-items: center; gap: 0.45rem; color: var(--live-color); transition: color 0.3s ease; }
.live-icon {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 900;
    background: var(--live-soft);
    transition: background-color 0.3s ease;
}
.live-card[data-state="syncing"] .live-icon { animation: spin 0.9s linear infinite; }
.live-card-texts { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.live-card-text { font-size: 0.75rem; font-weight: 800; }
.live-card-time { font-size: 0.62rem; color: rgb(var(--t-slate-400, 148 163 184)); font-weight: 600; }
.live-card-time:empty { display: none; }

.live-card.just-updated { animation: live-flash 1.2s ease-out; }
@keyframes live-flash {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); border-color: rgb(var(--c-emerald-300, 110 231 183)); }
    100% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

.live-dot.busy { background: #3b82f6; }
.live-dot.manual { background: #f59e0b; }
.live-dot.manual::after { animation: none; }
.spinning { animation: spin 0.9s linear infinite; }

@media (max-width: 639px) {
    .live-card { gap: 0.5rem; padding: 0.3rem 0.4rem 0.3rem 0.6rem; }
    .live-card-label, .live-card-texts { display: none; }
    .live-card-dot { width: 1.4rem; height: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    .live-card.just-updated, .live-card[data-state="syncing"] .live-icon { animation: none; }
}

/* صناديق الأسعار في الإعدادات */
.rate-box {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.6rem;
    background: rgb(var(--b-white, 255 255 255));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
}
.rate-box span { font-size: 0.68rem; color: rgb(var(--t-slate-500, 100 116 139)); }
.rate-box b { font-family: ui-monospace, monospace; font-size: 0.9rem; color: rgb(var(--t-slate-900, 15 23 42)); }

/* ================= إدارة الزبائن وملف الزبون ================= */
.cust-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 0.7rem;
    background: rgb(var(--b-indigo-100, 224 231 255));
    color: rgb(var(--t-indigo-800, 55 48 163));
    font-weight: 900;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cust-count-pill {
    display: inline-flex;
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    background: rgb(var(--b-blue-50, 239 246 255));
    color: rgb(var(--t-blue-700, 29 78 216));
    font-weight: 800;
    font-size: 0.75rem;
    transition: background-color 0.15s ease;
}
tr:hover .cust-count-pill { background: rgb(var(--b-blue-100, 219 234 254)); }

#customerModal:not(.hidden) .cust-sheet { animation: sheet-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}
.cust-sheet { max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (min-width: 640px) { .cust-sheet { max-height: calc(100vh - 3rem); } }

.cp-head {
    position: relative;
    padding: 1.4rem 1.25rem 1.2rem;
    color: rgb(var(--t-inv, 255 255 255));
    background:
        radial-gradient(110% 90% at 100% 0%, rgba(99, 102, 241, 0.28), transparent 55%),
        radial-gradient(90% 80% at 0% 100%, rgba(16, 185, 129, 0.18), transparent 55%),
        rgb(var(--b-slate-900, 15 23 42));
}
.cp-close {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: background-color 0.15s ease;
}
.cp-close:hover { background: rgba(255, 255, 255, 0.2); }
.cp-avatar {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cp-chip { padding: 0.25rem 0.65rem; border-radius: 9999px; background: rgba(255, 255, 255, 0.1); color: rgb(var(--t-slate-200, 226 232 240)); }

.cp-tile {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.8rem;
    border-radius: 0.9rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    background: rgb(var(--b-white, 255 255 255));
    opacity: 0;
    transform: translateY(8px);
    animation: calc-in 0.45s ease forwards var(--d, 0ms);
}
.cp-tile-hero { background: rgb(var(--b-emerald-50, 236 253 245)); border-color: rgb(var(--c-emerald-200, 167 243 208)); }
.cp-tile-label { font-size: 0.68rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); }
.cp-tile-value { font-size: 1.45rem; font-weight: 900; color: rgb(var(--t-slate-900, 15 23 42)); line-height: 1.15; }
.cp-tile-value small { font-size: 0.75rem; color: rgb(var(--t-slate-500, 100 116 139)); font-weight: 700; }
.cp-tile-text { font-size: 0.95rem; font-family: 'IBM Plex Sans Arabic', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-tile-sub { font-size: 0.65rem; color: rgb(var(--t-slate-400, 148 163 184)); font-weight: 600; min-height: 0.9rem; }

/* أعمدة الربح الشهري: عمود ≤ 24px بزوايا علوية دائرية وقاعدة مستقيمة */
.cp-bars { display: flex; align-items: flex-end; gap: 2px; height: 6.5rem; }
.cp-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 0.3rem; cursor: default; }
.cp-bar {
    width: 100%;
    max-width: 24px;
    height: 0;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    background: rgb(var(--b-blue-300, 147 197 253));
    transition: height 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0ms);
}
.cp-bar.current { background: #2563eb; }
.cp-bar-col:hover .cp-bar { background: #1d4ed8; }
.cp-in .cp-bar { height: var(--h); }
.cp-bar-label { font-size: 0.6rem; color: rgb(var(--t-slate-400, 148 163 184)); height: 0.8rem; white-space: nowrap; }

.cp-action { padding: 0.7rem; border-radius: 0.8rem; font-size: 0.78rem; font-weight: 800; transition: transform 0.15s ease, filter 0.15s ease; }
.cp-action:hover { filter: brightness(0.96); }
.cp-action:active { transform: scale(0.98); }

.cp-timeline { position: relative; display: flex; flex-direction: column; gap: 0.4rem; }
.cp-tx {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 0.8rem;
    background: rgb(var(--b-white, 255 255 255));
    opacity: 0;
    transform: translateY(6px);
    animation: calc-in 0.4s ease forwards var(--d, 0ms);
}
.cp-tx.cancelled { background: rgb(var(--b-slate-50, 248 250 252)); }
.cp-tx.cancelled .cp-tx-amount { color: rgb(var(--t-slate-400, 148 163 184)); text-decoration: line-through; }
.cp-tx-dot { width: 0.6rem; height: 0.6rem; border-radius: 9999px; flex-shrink: 0; }
.cp-tx-receipt { width: 2rem; height: 2rem; border-radius: 0.6rem; background: rgb(var(--b-slate-100, 241 245 249)); flex-shrink: 0; transition: background-color 0.15s ease; }
.cp-tx-receipt:hover { background: rgb(var(--b-slate-200, 226 232 240)); }
/* نوع الحركة في ملف الزبون: حوالة / إيداع USDT / سحب USDT */
.cp-kind { display: inline-block; font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 0.6rem; font-weight: 800; padding: 0.1rem 0.45rem; border-radius: 9999px; margin-inline-end: 0.35rem; vertical-align: middle; }
.cp-kind.tx { background: rgb(var(--b-blue-50, 239 246 255)); color: rgb(var(--t-blue-700, 29 78 216)); }
.cp-kind.deposit { background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); }
.cp-kind.withdraw { background: rgb(var(--b-emerald-50, 236 253 245)); color: rgb(var(--t-emerald-700, 4 120 87)); }
.cp-kind.send { background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); }
.cp-kind.receive { background: rgb(var(--b-emerald-50, 236 253 245)); color: rgb(var(--t-emerald-700, 4 120 87)); }
.cp-usdt { background: linear-gradient(135deg, rgb(var(--b-teal-50, 240 253 250)), rgb(var(--b-white, 255 255 255)) 70%); border-color: rgb(var(--c-teal-200, 153 246 228)); }
.cp-egp { background: linear-gradient(135deg, rgb(var(--b-red-50, 254 242 242)), rgb(var(--b-white, 255 255 255)) 70%); border-color: rgb(var(--c-red-200, 254 202 202)); }
.cp-usdt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.35rem; }
@media (min-width: 640px) { .cp-usdt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cp-usdt-grid > div { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.cp-usdt-grid span { font-size: 0.65rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); }
.cp-usdt-grid b { font-size: 1rem; font-weight: 900; }

@media (prefers-reduced-motion: reduce) {
    .cp-tile, .cp-tx, #customerModal:not(.hidden) .cust-sheet { animation: none; opacity: 1; transform: none; }
    .cp-bar { transition: none; }
}

/* ================= قائمة اختيار الزبون + واتساب ================= */
.cust-dropdown {
    position: absolute;
    z-index: 25;
    top: 100%;
    inset-inline: 0;
    margin-top: 0.3rem;
    max-height: 18rem;
    overflow-y: auto;
    background: rgb(var(--b-white, 255 255 255));
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-radius: 0.9rem;
    box-shadow: 0 16px 36px -12px rgba(15, 23, 42, 0.25);
    padding: 0.3rem;
    animation: calc-in 0.18s ease forwards;
}
.cust-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.65rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.cust-option:hover, .cust-option.active { background: rgb(var(--b-slate-100, 241 245 249)); }
.cust-mark { background: rgb(var(--b-yellow-200, 254 240 138)); color: inherit; border-radius: 3px; padding: 0 1px; }

.wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    border-radius: 0.6rem;
    background: rgb(var(--b-green-100, 220 252 231));
    color: rgb(var(--t-green-700, 21 128 61));
    font-size: 0.72rem;
    font-weight: 800;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.wa-btn:hover { background: rgb(var(--b-green-200, 187 247 208)); }
.wa-btn:active { transform: scale(0.96); }
.wa-btn.wa-missing { background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-400, 148 163 184)); }
.wa-btn.wa-missing:hover { background: rgb(var(--b-slate-200, 226 232 240)); color: rgb(var(--t-slate-500, 100 116 139)); }
.cp-head .wa-btn { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.cp-head .wa-btn.wa-missing { background: rgba(255, 255, 255, 0.1); color: rgb(var(--t-slate-300, 203 213 225)); }
.cp-tx-receipt { width: auto; padding: 0 0.65rem; font-size: 0.7rem; font-weight: 800; color: rgb(var(--t-slate-700, 51 65 85)); }

/* ================= تكلفة وربح كل دولة ================= */
.source-chip-cost { font-size: 0.6rem; font-weight: 600; color: rgb(var(--t-slate-400, 148 163 184)); }
.source-chip.active .source-chip-cost { color: rgb(var(--t-blue-500, 59 130 246)); }
.unit-toggle {
    display: inline-flex;
    gap: 1px;
    padding: 1px;
    border-radius: 0.4rem;
    background: rgb(var(--b-slate-200, 226 232 240));
    margin-bottom: 0.2rem;
}
.unit-toggle button {
    min-width: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 0.3rem;
    font-size: 0.65rem;
    font-weight: 800;
    color: rgb(var(--t-slate-500, 100 116 139));
    line-height: 1.2rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.unit-toggle button.active { background: rgb(var(--b-white, 255 255 255)); color: rgb(var(--t-slate-900, 15 23 42)); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }

/* ================= التجار ================= */
.trader-card {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    background: rgb(var(--b-white, 255 255 255));
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    animation: calc-in 0.4s ease forwards var(--d, 0ms);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.trader-card:hover { border-color: rgb(var(--c-slate-300, 203 213 225)); box-shadow: 0 8px 22px -12px rgba(15, 23, 42, 0.25); }

.bal-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    border: 1px solid transparent;
}
.bal-chip b { font-family: 'Cairo', sans-serif; font-weight: 900; }
.bal-chip-label { font-size: 0.65rem; font-weight: 700; }
.bal-chip.mine { background: rgb(var(--b-emerald-50, 236 253 245)); color: rgb(var(--t-emerald-700, 4 120 87)); border-color: rgb(var(--c-emerald-200, 167 243 208)); }
.bal-chip.his { background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); border-color: rgb(var(--c-rose-200, 254 205 211)); }
.bal-chip.zero { background: rgb(var(--b-slate-50, 248 250 252)); color: rgb(var(--t-slate-500, 100 116 139)); border-color: rgb(var(--c-slate-200, 226 232 240)); }
.bal-chip.big { font-size: 0.95rem; padding: 0.35rem 0.7rem; }

.cur-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 639px) {
    .cur-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cur-tabs .cur-tab { min-width: 0; }
    .cur-tabs .bal-chip.big { display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; }
    .cur-tabs .cur-add { width: 100%; align-self: stretch; min-height: 3.6rem; text-align: center; }
}
.cur-tab {
    text-align: right;
    padding: 0.4rem;
    border-radius: 0.9rem;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.cur-tab:hover { background: rgb(var(--b-slate-50, 248 250 252)); }
.cur-tab.active { border-color: rgb(var(--c-slate-900, 15 23 42)); background: rgb(var(--b-slate-50, 248 250 252)); }
.cur-add { align-self: center; font-size: 0.75rem; font-weight: 700; border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); border-radius: 0.6rem; padding: 0.4rem 0.6rem; background: rgb(var(--b-white, 255 255 255)); color: rgb(var(--t-slate-500, 100 116 139)); }

.kind-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.7rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    background: rgb(var(--b-white, 255 255 255));
    font-size: 0.75rem;
    font-weight: 800;
    color: rgb(var(--t-slate-700, 51 65 85));
    text-align: right;
    transition: all 0.15s ease;
}
.kind-btn span { font-size: 0.62rem; font-weight: 700; }
.kind-btn.mine span { color: rgb(var(--t-emerald-600, 5 150 105)); }
.kind-btn.his span { color: rgb(var(--t-rose-600, 225 29 72)); }
.kind-btn.active { border-color: rgb(var(--c-slate-900, 15 23 42)); background: rgb(var(--b-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); }
.kind-btn.active span { color: rgb(var(--t-slate-300, 203 213 225)); }

.tm-preview { padding: 0.75rem; border-radius: 0.8rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); font-size: 0.78rem; }

/* لون النص صريح: الكشف بيضل فاتح بالوضع الداكن، فما بنورث لون نص الصفحة الفاتح */
.statement-paper { border-radius: 1rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); overflow: hidden; background: rgb(var(--b-white, 255 255 255)); color: #1e293b; }
.st-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem; background: rgb(var(--b-slate-900, 15 23 42)); }
.st-party { display: flex; align-items: center; gap: 0.7rem; min-width: 0; flex: 1 1 0; }
.st-party:last-child { justify-content: flex-end; }
.st-logo { width: 3rem; height: 3rem; border-radius: 0.85rem; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.12); color: #fff; font-weight: 900; font-size: 1.2rem; }
.st-logo img { width: 100%; height: 100%; object-fit: contain; background: rgb(var(--b-white, 255 255 255)); }
.st-title { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.7rem 1.25rem; font-size: 0.8rem; color: rgb(var(--t-slate-600, 71 85 105)); border-bottom: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.st-title b { color: rgb(var(--t-slate-900, 15 23 42)); font-weight: 900; font-size: 0.9rem; }
.st-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; padding: 1rem 1.25rem; background: rgb(var(--b-slate-50, 248 250 252)); border-bottom: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.st-summary div { display: flex; flex-direction: column; gap: 0.2rem; }
.st-summary span { font-size: 0.75rem; color: rgb(var(--t-slate-500, 100 116 139)); font-weight: 700; }
.st-summary b { font-size: 1rem; font-weight: 900; }
.st-final b { font-size: 1.15rem; }

/* حركات الكشف: على الكمبيوتر جدول (الحركة، المبلغ، العمولة، الأثر، الرصيد)، وعلى الجوال سطرين لكل حركة */
.st-cols { display: none; }
.st-day { padding: 0 1.25rem; }
.st-day-head { display: flex; justify-content: space-between; padding: 0.8rem 0 0.45rem; font-size: 0.8rem; font-weight: 800; color: rgb(var(--t-slate-600, 71 85 105)); border-bottom: 1px dashed rgb(var(--c-slate-200, 226 232 240)); }
.st-row {
    display: grid;
    /* الجوال: الوصف بعرض السطر كله، وتحته المبلغ والرصيد والأزرار (كان الوصف محشور بعمود ضيق) */
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title title" "eff act" "bal act";
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgb(var(--c-slate-100, 241 245 249));
    font-size: 0.875rem;
}
.st-c-title { grid-area: title; min-width: 0; }
.st-title-line { color: rgb(var(--t-slate-800, 30 41 59)); line-height: 1.5; }
.st-title-line .sv-logos { vertical-align: middle; }
.st-detail-m { font-size: 0.78rem; color: rgb(var(--t-slate-500, 100 116 139)); margin-top: 0.1rem; }
.st-profit { font-size: 0.78rem; font-weight: 800; color: rgb(var(--t-emerald-700, 4 120 87)); margin-top: 0.1rem; }
.st-c-amt, .st-c-fee { display: none; }
.st-c-eff { grid-area: eff; font-size: 0.95rem; white-space: nowrap; }
.st-c-bal { grid-area: bal; font-size: 0.72rem; color: rgb(var(--t-slate-400, 148 163 184)); }
.st-row-actions { grid-area: act; display: flex; gap: 0.25rem; opacity: 0.35; transition: opacity 0.15s ease; }
.st-row:hover .st-row-actions { opacity: 1; }
.st-row-actions button { width: 2rem; height: 2rem; border-radius: 0.5rem; background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-600, 71 85 105)); font-size: 0.85rem; }
.st-row-actions button:hover { background: rgb(var(--b-slate-200, 226 232 240)); }
@media (min-width: 768px) {
    .st-cols, .st-row { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.15fr) 4.25rem; grid-template-areas: none; }
    .st-cols { display: grid; column-gap: 0.75rem; padding: 0.6rem 1.25rem; font-size: 0.72rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); background: rgb(var(--b-white, 255 255 255)); border-bottom: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
    .st-cols span:not(:first-child) { text-align: left; }
    .st-row > * { grid-area: auto; }
    .st-detail-m { display: none; }
    .st-c-amt, .st-c-fee, .st-c-eff, .st-c-bal { display: block; text-align: left; }
    .st-c-amt { font-weight: 700; color: rgb(var(--t-slate-700, 51 65 85)); }
    .st-c-fee { font-size: 0.8rem; color: rgb(var(--t-slate-600, 71 85 105)); }
    .st-fee-how { display: block; font-size: 0.68rem; color: rgb(var(--t-slate-400, 148 163 184)); }
    .st-c-bal { font-size: 0.8rem; font-weight: 700; }
    .st-bal-label { display: none; }
    .st-row-actions { justify-content: flex-end; }
}
.st-fee-how { font-size: 0.7rem; color: rgb(var(--t-slate-400, 148 163 184)); }
@media (max-width: 639px) {
    .st-summary { grid-template-columns: 1fr 1fr; padding: 0.85rem 1rem; }
    .st-final { grid-column: span 2; }
    .st-day { padding: 0 1rem; }
    .st-head, .st-title { padding-left: 1rem; padding-right: 1rem; }
    .st-row-actions { opacity: 1; }
}
.kind-btn:not(.mine):not(.his) span { color: rgb(var(--t-slate-500, 100 116 139)); }

/* ================= صفحة التجار (traders.js) ================= */
/* أزرار بسطر بيتمرر أفقياً (فلتر التجار وفترة الكشف) */
.tv-scroll { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.1rem; }
.tv-scroll::-webkit-scrollbar { display: none; }
.tf-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.85rem; border-radius: 9999px; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); font-size: 0.78rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); white-space: nowrap; transition: all 0.15s ease; }
.tf-chip b { font-size: 0.65rem; padding: 0.05rem 0.4rem; border-radius: 9999px; background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-500, 100 116 139)); }
.tf-chip:hover { border-color: rgb(var(--c-slate-400, 148 163 184)); }
.tf-chip.active { background: rgb(var(--b-slate-900, 15 23 42)); border-color: rgb(var(--c-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); }
.tf-chip.active b { background: rgba(255, 255, 255, 0.18); color: inherit; }
.tf-chip.mine:not(.active) b { background: rgb(var(--b-emerald-50, 236 253 245)); color: rgb(var(--t-emerald-700, 4 120 87)); }
.tf-chip.his:not(.active) b { background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); }
/* رأس حساب التاجر (نفس شكل ملف الزبون الغامق) وزر الرجوع */
.tv-head { border-radius: 1.25rem; }
.tv-back { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.35rem 0.8rem; border-radius: 9999px; background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 0.75rem; font-weight: 800; transition: background-color 0.15s ease; }
.tv-back:hover { background: rgba(255, 255, 255, 0.2); }
/* المعلومات وملخص الجملة: مربع صغير بعنوان وقيمة */
.ti-item { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.8rem 1rem; border-radius: 0.8rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.ti-item > span { font-size: 0.75rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); }
.ti-item > b { font-size: 0.88rem; font-weight: 800; color: rgb(var(--t-slate-900, 15 23 42)); overflow-wrap: anywhere; }
/* سطر حركة جملة */
.tw-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid rgb(var(--c-slate-100, 241 245 249)); font-size: 0.875rem; }
.tw-row:last-child { border-bottom: 0; }
.tw-row:hover .st-row-actions { opacity: 1; }
@media (max-width: 639px) {
    .tw-row .st-row-actions { opacity: 1; }
    /* الجوال: الوصف بعرض السطر، وتحته المبلغ والأزرار (زي الكشف) */
    .tw-row { flex-wrap: wrap; row-gap: 0.4rem; }
    .tw-row > :first-child { flex-basis: 100%; }
    .tw-row > .text-left { flex: 1; text-align: right; }
}
/* ملخص الجملة: سطر لكل رقم (كانت الجملة الطويلة تنكسر بالنص) */
.tw-sum { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; font-weight: 700; color: rgb(var(--t-slate-600, 71 85 105)); }
.tw-sum.text-emerald-700 { color: rgb(var(--t-emerald-700, 4 120 87)); }
.tw-sum b { font-weight: 900; white-space: nowrap; color: inherit; }
.ti-item bdi { white-space: nowrap; }
@media (max-width: 639px) { .ti-item { padding: 0.7rem 0.75rem; } }

/* كرت التاجر بالقائمة: أوسع وخط أوضح */
.trader-card { padding: 1.25rem; border-radius: 1.25rem; }
.tc-avatar { width: 3.25rem; height: 3.25rem; border-radius: 1rem; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgb(var(--b-indigo-100, 224 231 255)); color: rgb(var(--t-indigo-800, 55 48 163)); font-size: 1.35rem; font-weight: 900; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.tc-services { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.tc-service { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; padding: 0.3rem 0.65rem 0.3rem 0.4rem; border-radius: 9999px; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); font-size: 0.78rem; font-weight: 700; color: rgb(var(--t-slate-700, 51 65 85)); }
/* تبويبات حساب التاجر: أكبر من seg-sm */
.tv-tabs .seg-btn { padding: 0.75rem 0.5rem; font-size: 0.9rem; white-space: nowrap; }
@media (max-width: 639px) {
    .tv-tabs .seg-btn { padding: 0.65rem 0.2rem; font-size: 0.8rem; }
    /* اسم التاجر الطويل بسطرين بدل ما ينقص */
    .tv-head h3 { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.45; }
    /* الكشف (وصورته): الأسماء كاملة بدل "أطلس للصرا…" */
    .st-head .truncate { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
    .st-head .st-logo { width: 2.4rem; height: 2.4rem; }
}

/* شعار الخدمة: مربع أبيض دايماً (حتى بالوضع الداكن، الشعارات السودا زي تيك توك بتبين) */
.sv-logos { display: inline-flex; align-items: center; }
.sv-logos .sv-logo + .sv-logo { margin-inline-start: -0.3rem; }
.sv-logo { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: #fff; border: 1px solid #e2e8f0; overflow: hidden; vertical-align: middle; }
.sv-logo svg { width: 64%; height: 64%; }
.sv-logo img { width: 100%; height: 100%; object-fit: contain; }
.sv-logo.sm { width: 1.5rem; height: 1.5rem; border-radius: 0.4rem; }
.sv-logo.md { width: 2.1rem; height: 2.1rem; border-radius: 0.55rem; }
.sv-logo.lg { width: 3rem; height: 3rem; border-radius: 0.8rem; }
.sv-logo-empty { font-size: 1.3rem; color: #64748b; }
/* نافذة الخدمة: اختيار الشعار */
.sv-logo-box { padding: 0.75rem; border-radius: 0.85rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-slate-50, 248 250 252)); }
.sv-brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: 0.4rem; max-height: 14rem; overflow-y: auto; }
.sv-brand { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.45rem 0.25rem; border-radius: 0.7rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); font-size: 0.65rem; font-weight: 700; color: rgb(var(--t-slate-600, 71 85 105)); text-align: center; line-height: 1.2; }
.sv-brand:hover:not(:disabled) { border-color: rgb(var(--c-slate-400, 148 163 184)); }
.sv-brand.active { border-color: rgb(var(--c-slate-900, 15 23 42)); box-shadow: 0 0 0 1px rgb(var(--c-slate-900, 15 23 42)); color: rgb(var(--t-slate-900, 15 23 42)); }
.sv-brand.auto { border-style: dashed; border-color: rgb(var(--c-emerald-400, 52 211 153)); }
.sv-brand:disabled { opacity: 0.55; cursor: not-allowed; }
/* نافذة الحركة: الخدمات أزرار بشعاراتها */
.tm-svc { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.8rem 0.45rem 0.5rem; border-radius: 0.75rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); font-size: 0.78rem; font-weight: 800; color: rgb(var(--t-slate-700, 51 65 85)); transition: all 0.15s ease; }
.tm-svc:hover { border-color: rgb(var(--c-slate-400, 148 163 184)); }
.tm-svc.active { border-color: rgb(var(--c-slate-900, 15 23 42)); box-shadow: 0 0 0 1px rgb(var(--c-slate-900, 15 23 42)); color: rgb(var(--t-slate-900, 15 23 42)); }

/* الإعدادات ← إشعارات الجوال: خطوات مرقّمة */
.push-steps { counter-reset: pstep; display: flex; flex-direction: column; gap: 0.9rem; }
.push-steps li { counter-increment: pstep; position: relative; padding-inline-start: 2.1rem; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.75rem; color: rgb(var(--t-slate-600, 71 85 105)); line-height: 1.6; }
.push-steps li::before { content: counter(pstep); position: absolute; inset-inline-start: 0; top: 0; width: 1.5rem; height: 1.5rem; border-radius: 9999px; background: rgb(var(--b-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); font-size: 0.72rem; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.push-steps b { color: rgb(var(--t-slate-900, 15 23 42)); font-size: 0.82rem; }
.push-steps code { direction: ltr; unicode-bidi: isolate; font-size: 0.7rem; padding: 0 0.25rem; border-radius: 0.3rem; background: rgb(var(--b-slate-100, 241 245 249)); }

/* ================= التحميل: الشيمر (cache.js) ================= */
/* النسخة المحفوظة معروضة لحد ما يوصل الشيت (body.data-stale): البيانات باهتة شوي وعليها لمعة بتمر.
   أول مرة على الجهاز (body.data-loading): نفس اللمعة فوق أسطر فاضية (.skel-line). بدون نت (data-offline): باهتة بدون لمعة */
@keyframes data-shimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }
:is(#page-transactions, #page-usdt, #page-egp, #page-accounts, #page-expenses, #page-traders, #page-customers, #page-reports, #page-position) { position: relative; }
body:is(.data-stale, .data-loading) :is(#page-transactions, #page-usdt, #page-egp, #page-accounts, #page-expenses, #page-traders, #page-customers, #page-reports, #page-position)::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    border-radius: 1.25rem;
    background: linear-gradient(100deg, transparent 38%, var(--shimmer, rgba(255, 255, 255, 0.6)) 50%, transparent 62%);
    background-size: 260% 100%;
    animation: data-shimmer 1.5s ease-in-out infinite;
}
body.data-stale :is(#page-transactions, #page-usdt, #page-egp, #page-accounts, #page-expenses, #page-traders, #page-customers, #page-reports, #page-position) > * { opacity: 0.72; transition: opacity 0.35s ease; }
body.data-offline :is(#page-transactions, #page-usdt, #page-egp, #page-accounts, #page-expenses, #page-traders, #page-customers, #page-reports, #page-position)::after { animation: none; background: none; }
html[data-theme="dark"] { --shimmer: rgba(255, 255, 255, 0.07); }
html.motion-off body :is(#page-transactions, #page-usdt, #page-egp, #page-accounts, #page-expenses, #page-traders, #page-customers, #page-reports, #page-position)::after { animation: none; background: none; }
@media (prefers-reduced-motion: reduce) { body :is(#page-transactions, #page-usdt, #page-egp, #page-accounts, #page-expenses, #page-traders, #page-customers, #page-reports, #page-position)::after { animation: none; background: none; } }
.skel-list { display: flex; flex-direction: column; gap: 0.65rem; padding: 0.4rem 0; }
.skel-line { display: block; height: 0.8rem; border-radius: 0.4rem; background: rgb(var(--b-slate-100, 241 245 249)); }
/* اللي تغيّر بعد التحديث بيومض لحظة */
@keyframes row-changed { 0% { background-color: rgba(250, 204, 21, 0.35); } 100% { background-color: transparent; } }
.row-changed { animation: row-changed 1.8s ease-out; }

/* ما في إنترنت (cache.js): شريط بأيقونة واي فاي، الأقواس بتنور وحدة ورا وحدة كأنها بتدوّر على شبكة، والخط فوقها ثابت */
.offline-banner { display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 1rem; border-radius: 1.1rem; border: 1px solid rgb(var(--c-amber-200, 253 230 138)); background: rgb(var(--b-amber-50, 255 251 235)); animation: offline-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
.offline-banner.hidden { display: none; }
@keyframes offline-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.offline-icon { width: 3rem; height: 3rem; flex-shrink: 0; border-radius: 1rem; display: flex; align-items: center; justify-content: center; background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-amber-200, 253 230 138)); animation: offline-float 3.2s ease-in-out infinite; }
.offline-icon svg { width: 1.9rem; height: 1.9rem; }
.offline-icon .ow { stroke: rgb(var(--t-slate-500, 100 116 139)); stroke-width: 3.2; opacity: 0.18; animation: offline-wave 2.4s ease-in-out infinite; }
.offline-icon .ow2 { animation-delay: 0.3s; }
.offline-icon .ow3 { animation-delay: 0.6s; }
.offline-icon .ow-dot { fill: rgb(var(--t-slate-500, 100 116 139)); }
.offline-icon .ow-slash { stroke: rgb(var(--t-rose-500, 244 63 94)); stroke-width: 3.4; }
@keyframes offline-wave { 0%, 100% { opacity: 0.18; } 30%, 55% { opacity: 0.95; } }
@keyframes offline-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
html.motion-off .offline-icon, html.motion-off .offline-icon .ow { animation: none; }
html.motion-off .offline-icon .ow { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .offline-icon, .offline-icon .ow { animation: none; } .offline-icon .ow { opacity: 0.6; } }

/* "مين عدّل قبلي" (conflicts.js) */
.conflict-icon { width: 2.5rem; height: 2.5rem; flex-shrink: 0; border-radius: 0.9rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; background: rgb(var(--b-amber-50, 255 251 235)); border: 1px solid rgb(var(--c-amber-200, 253 230 138)); }
.conflict-diff { border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-radius: 0.8rem; overflow: hidden; }
.conflict-diff th { text-align: right; padding: 0.5rem 0.7rem; font-size: 0.68rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); background: rgb(var(--b-slate-50, 248 250 252)); border-bottom: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.conflict-diff td { padding: 0.5rem 0.7rem; border-bottom: 1px solid rgb(var(--c-slate-100, 241 245 249)); vertical-align: top; overflow-wrap: anywhere; }
.conflict-diff tr:last-child td { border-bottom: 0; }

/* فلتر الحالات في السجل: زر تشغيل/إيقاف لكل حالة */
.status-toggle { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.4rem 0.7rem; border-radius: 9999px; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); font-size: 0.75rem; font-weight: 800; color: rgb(var(--t-slate-400, 148 163 184)); transition: all 0.15s ease; }
.status-toggle .sw { position: relative; width: 1.75rem; height: 1rem; border-radius: 9999px; background: rgb(var(--b-slate-300, 203 213 225)); flex-shrink: 0; transition: background-color 0.15s ease; }
.status-toggle .sw::after { content: ''; position: absolute; top: 2px; right: 2px; width: calc(1rem - 4px); height: calc(1rem - 4px); border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25); transition: transform 0.15s ease; }
.status-toggle .cnt { font-size: 0.65rem; padding: 0.05rem 0.4rem; border-radius: 9999px; background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-400, 148 163 184)); }
.status-toggle.on { color: rgb(var(--t-slate-900, 15 23 42)); border-color: rgb(var(--c-slate-300, 203 213 225)); }
.status-toggle.on .sw { background: var(--c); }
.status-toggle.on .sw::after { transform: translateX(-0.75rem); }
.status-toggle.on .cnt { color: rgb(var(--t-slate-700, 51 65 85)); }
.status-toggle:hover { border-color: rgb(var(--c-slate-400, 148 163 184)); }

/* حقول الأرقام بدون أسهم الزيادة والنقصان (تُكتب القيمة بالكيبورد فقط) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ================= الحسابات والمحافظ ================= */
/* لون كل نوع: جوال باي أخضر فاتح، بال باي بنفسجي غامق، مالشات بنفسجي فاتح، بنك فلسطين بنفسجي وسط */
.acc-card {
    position: relative;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgb(var(--c-slate-200, 226 232 240));
    border-top: 4px solid var(--acc);
    background: rgb(var(--b-white, 255 255 255));
    cursor: pointer;
    opacity: 0;
    transform: translateY(8px);
    animation: calc-in 0.4s ease forwards var(--d, 0ms);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.acc-card:hover { box-shadow: 0 8px 22px -12px rgba(15, 23, 42, 0.25); }
.acc-card.active { box-shadow: 0 0 0 2px var(--acc); }
.acc-chip { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 9999px; background: var(--acc-soft); color: var(--acc-ink); font-size: 0.68rem; font-weight: 800; }
.acc-balance { font-size: 1.15rem; font-weight: 900; color: rgb(var(--t-slate-900, 15 23 42)); font-family: 'Cairo', sans-serif; direction: ltr; text-align: right; }
.acc-balance.usd { font-size: 0.95rem; color: rgb(var(--t-slate-600, 71 85 105)); }
.acc-balance.neg { color: rgb(var(--t-rose-700, 190 18 60)); }
.acc-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--acc); flex-shrink: 0; vertical-align: middle; }

/* نافذة الدفع */
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.7rem; border-radius: 0.8rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.pay-summary div { display: flex; flex-direction: column; gap: 0.15rem; }
.pay-summary span { font-size: 0.65rem; color: rgb(var(--t-slate-500, 100 116 139)); font-weight: 700; }
.pay-summary b { font-size: 0.85rem; font-weight: 900; font-family: 'Cairo', sans-serif; }
.pay-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: 0.75rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-right: 4px solid var(--acc); font-size: 0.75rem; }
.pay-input { width: 6.5rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-radius: 0.5rem; padding: 0.45rem 0.5rem; font-weight: 800; font-size: 0.85rem; outline: none; flex-shrink: 0; }
.pay-input:focus { border-color: #3b82f6; }

/* بطاقة رصيد USDT */
.usdt-hero { padding: 1rem 1.1rem; border-radius: 1rem; background: linear-gradient(135deg, rgb(var(--b-slate-900, 15 23 42)), #134e4a); color: rgb(var(--t-inv, 255 255 255)); transition: background 0.3s; }
/* رصيد USDT الإجمالي: موجب = بطاقة خضرا خفيفة، سالب = حمرا خفيفة شفافة (صفر بيضل الغامق) */
.usdt-hero:is(.pos, .neg) { color: #0f172a; border: 1px solid; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.usdt-hero.pos { background: linear-gradient(135deg, rgb(16 185 129 / 0.16), rgb(16 185 129 / 0.07)); border-color: rgb(16 185 129 / 0.3); }
.usdt-hero.neg { background: linear-gradient(135deg, rgb(244 63 94 / 0.14), rgb(244 63 94 / 0.06)); border-color: rgb(244 63 94 / 0.3); }
.usdt-hero:is(.pos, .neg) .text-slate-300, .usdt-hero:is(.pos, .neg) .text-slate-400 { color: #64748b; }
.usdt-hero:is(.pos, .neg) button:hover { color: #0f172a; }
.usdt-hero.pos #usdt-balance { color: #047857; }
.usdt-hero.neg #usdt-balance { color: #be123c; }
html[data-theme="dark"] .usdt-hero:is(.pos, .neg) { color: #f1f5f9; }
html[data-theme="dark"] .usdt-hero.pos { background: linear-gradient(135deg, rgb(16 185 129 / 0.2), rgb(16 185 129 / 0.08)); }
html[data-theme="dark"] .usdt-hero.neg { background: linear-gradient(135deg, rgb(244 63 94 / 0.2), rgb(244 63 94 / 0.08)); }
html[data-theme="dark"] .usdt-hero:is(.pos, .neg) :is(.text-slate-300, .text-slate-400) { color: #94a3b8; }
html[data-theme="dark"] .usdt-hero:is(.pos, .neg) button:hover { color: #fff; }
html[data-theme="dark"] .usdt-hero.pos #usdt-balance { color: #6ee7b7; }
html[data-theme="dark"] .usdt-hero.neg #usdt-balance { color: #fda4af; }
/* بطاقة رصيد الجنيه */
.egp-hero { padding: 1rem 1.1rem; border-radius: 1rem; background: linear-gradient(135deg, rgb(var(--b-slate-900, 15 23 42)), #7f1d1d); color: rgb(var(--t-inv, 255 255 255)); }

/* شريط الجوال: 10 صفحات، يتمرر أفقياً */
.mobile-nav { overflow-x: auto; scrollbar-width: none; }
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav-item { flex: 1 0 3.6rem; }

/* ================= الدخول والصلاحيات ================= */
.login-bg { background: radial-gradient(circle at 30% 20%, #1e293b, #0f172a 70%); }
body.locked { overflow: hidden; }
/* بدون صلاحية الحذف: لا تظهر أزرار الحذف. بدون رؤية الأرباح: تختفي أرقام الربح */
body.no-delete [data-action^="delete-"] { display: none !important; }
body.no-profit .profit-only { display: none !important; }

/* الصورة الشخصية: صورة أو أول حرف من الاسم */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 9999px; overflow: hidden; background: rgb(var(--b-slate-200, 226 232 240)); color: #fff; font-size: 0.85rem; font-weight: 900; line-height: 1; user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 1.9rem; height: 1.9rem; font-size: 0.8rem; }
.avatar-md { width: 2.4rem; height: 2.4rem; font-size: 1rem; }
.avatar-lg { width: 2.8rem; height: 2.8rem; font-size: 1.15rem; }
.avatar-xl { width: 5rem; height: 5rem; font-size: 2rem; }
.user-chip { display: inline-flex; padding: 2px; border-radius: 9999px; border: 2px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: rgb(var(--c-blue-300, 147 197 253)); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
.user-menu { position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 30; min-width: 14rem; padding: 0.35rem; border-radius: 0.8rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); box-shadow: 0 12px 30px -12px rgba(15, 23, 42, 0.35); }
.user-menu-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.55rem 0.7rem; margin-bottom: 0.3rem; border-bottom: 1px solid rgb(var(--c-slate-100, 241 245 249)); }
.user-menu-head b { display: block; font-size: 0.85rem; font-weight: 900; color: rgb(var(--t-slate-900, 15 23 42)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 9.5rem; }
.user-menu-head small { display: block; font-size: 0.68rem; font-weight: 600; color: rgb(var(--t-slate-400, 148 163 184)); direction: ltr; text-align: right; }
.photo-btn { display: inline-flex; align-items: center; gap: 0.3rem; cursor: pointer; padding: 0.45rem 0.75rem; border-radius: 0.6rem; background: rgb(var(--b-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); font-size: 0.72rem; font-weight: 800; transition: filter 0.15s ease; }
.photo-btn:hover { filter: brightness(1.15); }
.photo-btn-ghost { background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-600, 71 85 105)); }
.photo-btn-ghost:hover { filter: none; background: rgb(var(--b-slate-200, 226 232 240)); }
.user-menu button { display: block; width: 100%; text-align: right; padding: 0.5rem 0.65rem; border-radius: 0.5rem; font-size: 0.75rem; font-weight: 700; }
.user-menu button:hover { background: rgb(var(--b-slate-100, 241 245 249)); }

.perm-check { display: flex; align-items: flex-start; gap: 0.45rem; padding: 0.5rem 0.6rem; border-radius: 0.6rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); cursor: pointer; font-weight: 700; color: rgb(var(--t-slate-700, 51 65 85)); }
.perm-check:has(input:checked) { border-color: rgb(var(--c-slate-900, 15 23 42)); background: rgb(var(--b-slate-50, 248 250 252)); }
.perm-check input { margin-top: 0.1rem; }
.perm-check small { display: block; font-size: 0.6rem; font-weight: 600; color: rgb(var(--t-slate-400, 148 163 184)); }

/* رقم حوالة / USDT في حركات الحسابات: يفتح سجلها */
.ref-link { color: rgb(var(--t-blue-700, 29 78 216)); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.ref-link:hover { color: rgb(var(--t-blue-900, 30 58 138)); }

/* قائمة "المزيد" في شريط الجوال */
.mnav-more-menu { position: fixed; bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); left: 0.75rem; right: 0.75rem; z-index: 45; display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; padding: 0.5rem; border-radius: 1rem; background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); box-shadow: 0 -10px 30px -12px rgba(15, 23, 42, 0.35); }
.mnav-more-menu.hidden { display: none; }
.mnav-more-item { padding: 0.7rem 0.6rem; border-radius: 0.7rem; background: rgb(var(--b-slate-50, 248 250 252)); font-size: 0.75rem; font-weight: 800; color: rgb(var(--t-slate-700, 51 65 85)); text-align: right; }
.mnav-more-item:active { background: rgb(var(--b-slate-200, 226 232 240)); }
.mobile-nav-item.hidden { display: none; }

/* أزرار فرعية داخل الإعدادات: الإعدادات العامة / المستخدمون والصلاحيات */
.settings-subnav { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 0.8rem; background: rgb(var(--b-slate-100, 241 245 249)); }
.subnav-btn { padding: 0.5rem 0.9rem; border-radius: 0.6rem; font-size: 0.78rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); }
.subnav-btn.active { background: rgb(var(--b-white, 255 255 255)); color: rgb(var(--t-slate-900, 15 23 42)); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.subnav-btn.hidden { display: none; }
/* تابات الإعدادات (settings.js setSettingsTab): نص بس (بطلب عماد، رسمي بدون أيقونات)، والخمسة بسطر واحد حتى عالجوال */
.stabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.3rem; padding: 0.3rem; border-radius: 1rem; background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.stab-btn { min-width: 0; padding: 0.7rem 0.25rem; border-radius: 0.75rem; font-size: 0.82rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color 0.15s ease, color 0.15s ease; }
.stab-btn:hover { background: rgb(var(--b-slate-50, 248 250 252)); color: rgb(var(--t-slate-800, 30 41 59)); }
.stab-btn.active, .stab-btn.active:hover { background: rgb(var(--b-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); }
.stab-btn:focus:not(:focus-visible) { outline: none; }
@media (max-width: 639px) { .stab-btn { font-size: 0.68rem; padding: 0.6rem 0.05rem; } .stabs { gap: 0.15rem; padding: 0.25rem; } }
.stab-off { display: none !important; }
.stab-in { animation: stab-in 0.28s ease-out backwards; }
@keyframes stab-in { from { opacity: 0; transform: translateY(6px); } }

/* نافذة إرسال على واتساب */
.wa-preview-wrap { display: flex; justify-content: center; align-items: center; min-height: 8rem; max-height: 16rem; overflow: hidden; border-radius: 0.8rem; background: rgb(var(--b-slate-100, 241 245 249)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.wa-preview-wrap img { max-height: 16rem; width: auto; }
.wa-preview-wrap.loading img { display: none; }
.wa-preview-wrap.loading { background: linear-gradient(90deg, rgb(var(--b-slate-100, 241 245 249)), rgb(var(--b-slate-200, 226 232 240)), rgb(var(--b-slate-100, 241 245 249))); background-size: 200% 100%; animation: wa-shimmer 1.2s linear infinite; }
@keyframes wa-shimmer { to { background-position: -200% 0; } }
.wa-steps { display: flex; flex-direction: column; gap: 0.5rem; }
.wa-steps li { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: rgb(var(--t-slate-700, 51 65 85)); }
.wa-num { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: rgb(var(--b-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; flex-shrink: 0; }
.wa-status.ok { color: rgb(var(--t-emerald-700, 4 120 87)); }
.wa-status.warn { color: rgb(var(--t-amber-700, 180 83 9)); }
#wa-copy-btn { transition: background-color 0.2s, color 0.2s; min-width: 6.5rem; }
#wa-copy-btn.wa-copied { background: rgb(var(--b-emerald-100, 209 250 229)); color: rgb(var(--t-emerald-700, 4 120 87)); }
#wa-copy-btn:disabled { opacity: 0.7; cursor: wait; }
.wa-steps kbd { font-family: inherit; direction: ltr; display: inline-block; padding: 0.05rem 0.4rem; border-radius: 0.35rem; border: 1px solid rgb(var(--c-slate-300, 203 213 225)); border-bottom-width: 2px; background: rgb(var(--b-white, 255 255 255)); font-weight: 800; }

/* ================= البحث الشامل (search.js) ================= */
.search-btn { display: inline-flex; align-items: center; gap: 0.4rem; height: 2.5rem; padding: 0 0.75rem; border-radius: 0.9rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); color: rgb(var(--t-slate-500, 100 116 139)); font-size: 0.75rem; font-weight: 800; transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
.search-btn:hover { border-color: rgb(var(--c-slate-300, 203 213 225)); color: rgb(var(--t-slate-900, 15 23 42)); box-shadow: 0 6px 18px -8px rgb(15 23 42 / 0.2); }
kbd { font-family: inherit; direction: ltr; display: inline-block; padding: 0 0.35rem; border-radius: 0.35rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-bottom-width: 2px; background: rgb(var(--b-slate-50, 248 250 252)); color: rgb(var(--t-slate-500, 100 116 139)); font-size: 0.62rem; font-weight: 800; margin: 0 0.1rem; }
.search-group { padding: 0.5rem 0.6rem 0.25rem; font-size: 0.65rem; font-weight: 800; color: rgb(var(--t-slate-400, 148 163 184)); }
.search-item { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.55rem 0.6rem; border-radius: 0.7rem; font-size: 0.8rem; color: rgb(var(--t-slate-800, 30 41 59)); transition: background-color 0.12s ease; }
.search-item:hover, .search-item.active { background: rgb(var(--b-slate-100, 241 245 249)); }
.search-item.active { box-shadow: inset -3px 0 0 #3b82f6; }
.search-icon { width: 2rem; height: 2rem; border-radius: 0.6rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgb(var(--b-slate-100, 241 245 249)); font-size: 0.95rem; }
.search-empty { padding: 1.5rem 1rem; text-align: center; font-size: 0.75rem; color: rgb(var(--t-slate-400, 148 163 184)); }

/* ================= الرقابة: قفل الأيام، سجل التعديلات، الرصيد القليل ================= */
.lock-mark { font-size: 0.65rem; opacity: 0.75; cursor: help; }
.edit-item { padding: 0.7rem 0.8rem; border-radius: 0.8rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); }
.edit-old { color: rgb(var(--t-rose-700, 190 18 60)); text-decoration: line-through; text-decoration-color: rgb(225 29 72 / 0.4); }
.edit-new { color: rgb(var(--t-emerald-700, 4 120 87)); font-weight: 800; }
.low-chip { display: inline-block; margin-inline-start: 0.3rem; padding: 0.1rem 0.45rem; border-radius: 9999px; background: rgb(var(--b-amber-100, 254 243 199)); color: rgb(var(--t-amber-800, 146 64 14)); font-size: 0.62rem; font-weight: 800; }
.acc-card.low { border-color: rgb(var(--c-amber-300, 252 211 77)); box-shadow: 0 0 0 3px rgb(245 158 11 / 0.14); }
.acc-card.low .acc-balance { color: rgb(var(--t-amber-700, 180 83 9)); }

/* ================= المركز المالي والديون (position.js) ================= */
.pos-hero {
    position: relative;
    overflow: hidden;
    padding: 1.4rem 1.4rem 1.2rem;
    border-radius: 1.25rem;
    color: #fff;
    background:
        radial-gradient(110% 120% at 100% 0%, rgba(212, 168, 58, 0.22), transparent 55%),
        radial-gradient(90% 100% at 0% 100%, rgba(16, 185, 129, 0.18), transparent 55%),
        linear-gradient(135deg, #0b1220, #14213d);
    box-shadow: 0 16px 36px -18px rgba(15, 23, 42, 0.6);
}
.pos-net { font-size: 2.6rem; font-weight: 900; line-height: 1.15; letter-spacing: -0.02em; margin-top: 0.2rem; }
@media (min-width: 640px) { .pos-net { font-size: 3.1rem; } }
.pos-tile { display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem; border-radius: 1rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); }
.pos-tile span { font-size: 0.72rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); }
.pos-tile b { font-size: 1.5rem; font-weight: 900; }
.pos-tile small { font-size: 0.65rem; color: rgb(var(--t-slate-400, 148 163 184)); }
.pos-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px dashed rgb(var(--c-slate-200, 226 232 240)); font-size: 0.8rem; }
.pos-row:last-of-type { border-bottom: 0; }
.debt-row { padding: 0.75rem 0.85rem; border-radius: 0.9rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-slate-50, 248 250 252)); }
.debt-chip { font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 9999px; background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); color: rgb(var(--t-slate-600, 71 85 105)); transition: border-color 0.15s ease, color 0.15s ease; }
.debt-chip:hover { border-color: #3b82f6; color: rgb(var(--t-blue-700, 29 78 216)); }


/* ================= البنك (IBAN)، نسخ رقم التحويل، وتفاصيل الحوالة (transactions.js) ================= */
.iban-hint { display: block; min-height: 1rem; margin-top: 0.25rem; font-size: 0.65rem; font-weight: 700; color: rgb(var(--t-slate-400, 148 163 184)); }
.iban-hint.ok { color: rgb(var(--t-emerald-700, 4 120 87)); }
.iban-hint.bad { color: rgb(var(--t-rose-700, 190 18 60)); }
input:disabled[id$="_iban"] { opacity: 0.6; cursor: not-allowed; }

.copy-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; flex-shrink: 0; border-radius: 0.5rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); color: rgb(var(--t-slate-500, 100 116 139)); transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease; }
.copy-btn svg { width: 0.85rem; height: 0.85rem; }
.copy-btn:hover { color: rgb(var(--t-blue-700, 29 78 216)); border-color: rgb(var(--c-blue-300, 147 197 253)); }
.copy-btn.copied { color: rgb(var(--t-emerald-700, 4 120 87)); border-color: rgb(var(--c-emerald-300, 110 231 183)); background: rgb(var(--b-emerald-50, 236 253 245)); }

.copy-menu { position: fixed; z-index: 80; min-width: 13rem; max-width: calc(100vw - 1rem); padding: 0.3rem; border-radius: 0.8rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); box-shadow: 0 12px 30px -12px rgba(15, 23, 42, 0.35); animation: copy-menu-in 0.14s ease-out; }
@keyframes copy-menu-in { from { opacity: 0; transform: translateY(-4px); } }
html.motion-off .copy-menu { animation: none; }
.copy-menu-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; padding: 0.5rem 0.6rem; border-radius: 0.55rem; font-size: 0.75rem; color: rgb(var(--t-slate-800, 30 41 59)); text-align: right; }
.copy-menu-item bdi { color: rgb(var(--t-slate-500, 100 116 139)); font-size: 0.7rem; }
.copy-menu-item:hover { background: rgb(var(--b-slate-100, 241 245 249)); }
.copy-menu-item.all { flex-direction: column; align-items: flex-start; gap: 0.1rem; margin-top: 0.2rem; border-top: 1px solid rgb(var(--c-slate-100, 241 245 249)); border-radius: 0 0 0.55rem 0.55rem; }
.copy-menu-item.all bdi { font-size: 0.62rem; }

.txd-card { padding: 0; overflow: hidden; }
.txd-head { padding: 1.1rem 1.25rem 1rem; border-bottom: 1px solid rgb(var(--c-slate-100, 241 245 249)); background: rgb(var(--b-slate-50, 248 250 252)); }
.txd-name { font-size: 1.05rem; font-weight: 900; color: rgb(var(--t-slate-900, 15 23 42)); text-align: right; }
.txd-name:hover { color: rgb(var(--t-blue-700, 29 78 216)); text-decoration: underline; }
.txd-amount { font-size: 1.6rem; font-weight: 900; line-height: 1.2; color: rgb(var(--t-slate-900, 15 23 42)); }
.txd-body { padding: 0.9rem 1.25rem 1rem; display: flex; flex-direction: column; gap: 0.9rem; }
.txd-title { font-size: 0.68rem; font-weight: 800; color: rgb(var(--t-slate-400, 148 163 184)); margin-bottom: 0.2rem; }
.txd-row { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.42rem 0; border-bottom: 1px dashed rgb(var(--c-slate-200, 226 232 240)); font-size: 0.78rem; }
.txd-row:last-child, .profit-only:last-child .txd-row { border-bottom: 0; }
.txd-label { color: rgb(var(--t-slate-500, 100 116 139)); white-space: nowrap; }
.txd-value { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; color: rgb(var(--t-slate-800, 30 41 59)); text-align: left; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.txd-iban { font-size: 0.72rem; word-break: break-all; }
/* المبلغ بالسطر بيفتح الفاتورة */
.amount-link { font: inherit; color: inherit; text-align: inherit; border-radius: 0.35rem; cursor: pointer; text-decoration: underline dotted rgb(148 163 184 / 0.7); text-underline-offset: 4px; transition: color 0.15s ease; }
.amount-link:hover { color: rgb(var(--t-blue-700, 29 78 216)); text-decoration: underline; }
.txd-stack { flex-direction: column; align-items: stretch; gap: 0.3rem; }
.txd-stack .txd-value { justify-content: space-between; flex-wrap: nowrap; }
.txd-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: rgb(var(--t-slate-400, 148 163 184)); border-radius: 0.35rem; padding: 0.1rem 0.25rem; }
.txd-link:hover { color: rgb(var(--t-blue-700, 29 78 216)); background: rgb(var(--b-blue-50, 239 246 255)); text-decoration: underline; }
.txd-copy-all { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; padding: 0.4rem 0.7rem; border-radius: 0.6rem; font-size: 0.7rem; font-weight: 800; color: rgb(var(--t-blue-700, 29 78 216)); background: rgb(var(--b-blue-50, 239 246 255)); }
.txd-copy-all svg { width: 0.85rem; height: 0.85rem; }
.txd-copy-all.copied { color: rgb(var(--t-emerald-700, 4 120 87)); background: rgb(var(--b-emerald-50, 236 253 245)); }
.txd-audit { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.68rem; color: rgb(var(--t-slate-400, 148 163 184)); }
.txd-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.85rem 1.25rem; border-top: 1px solid rgb(var(--c-slate-100, 241 245 249)); }
.txd-actions > button:not(.wa-btn) { flex: 1 1 auto; padding: 0.55rem 0.9rem; border-radius: 0.65rem; font-size: 0.75rem; font-weight: 800; transition: background-color 0.15s ease; }
.txd-actions .wa-btn { padding: 0.55rem 0.8rem; }

/* رسالة الفاتورة بنافذة واتساب، ونسخة الجوال (زر مشاركة واحد بدل خطوات النسخ واللصق) */
.wa-msg { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.6rem; border-radius: 0.7rem; border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); background: rgb(var(--b-slate-50, 248 250 252)); }
.wa-msg-text { flex: 1; font-size: 0.72rem; line-height: 1.6; color: rgb(var(--t-slate-700, 51 65 85)); white-space: pre-wrap; }
#wa-copy-msg.wa-copied { color: rgb(var(--t-emerald-700, 4 120 87)); background: rgb(var(--b-emerald-50, 236 253 245)); }
#waShareModal.wa-phone.wa-can-share .wa-steps,
#waShareModal.wa-phone.wa-can-share #wa-open,
#waShareModal.wa-phone.wa-can-share #wa-copy-btn { display: none; }
#waShareModal.wa-phone.wa-can-share #wa-share-native { order: -1; width: 100%; padding: 0.75rem; border-radius: 0.75rem; font-size: 0.875rem; color: #fff; background: #10b981; }

/* ================= الإشعارات (notify.js) ================= */
.notify-btn { position: relative; padding: 0 0.7rem; }
.notify-badge { position: absolute; top: -0.4rem; left: -0.4rem; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: 9999px; background: #e11d48; color: #fff; font-size: 0.62rem; font-weight: 900; line-height: 1.15rem; text-align: center; box-shadow: 0 0 0 2px rgb(var(--b-white, 255 255 255)); }
.notify-list { max-height: min(65vh, 34rem); overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.6rem; }
.notify-empty { padding: 2rem 1rem; text-align: center; font-size: 0.75rem; color: rgb(var(--t-slate-400, 148 163 184)); line-height: 1.8; }
.notify-thread { padding: 0.6rem; border-radius: 0.9rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); }
.notify-msg { padding: 0.55rem 0.65rem; border-radius: 0.7rem; }
.notify-msg.unread { background: rgb(var(--b-blue-50, 239 246 255)); box-shadow: inset -3px 0 0 #3b82f6; }
.notify-msg.mine { background: rgb(var(--b-slate-50, 248 250 252)); }
.notify-meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: rgb(var(--t-slate-800, 30 41 59)); }
.notify-meta b { font-weight: 900; }
.notify-at { margin-inline-start: auto; font-size: 0.62rem; font-weight: 600; color: rgb(var(--t-slate-400, 148 163 184)); direction: ltr; unicode-bidi: isolate; }
.notify-read .notify-at { margin-inline-start: 0; }
.notify-del { font-size: 0.7rem; line-height: 1; padding: 0.2rem 0.3rem; border-radius: 0.4rem; opacity: 0.45; filter: grayscale(1); transition: opacity 0.15s ease, background-color 0.15s ease; }
.notify-del:hover, .notify-del:focus-visible { opacity: 1; filter: none; background: rgb(var(--b-rose-50, 255 241 242)); }
.notify-at[title] { cursor: help; }
.notify-imp { font-size: 0.6rem; font-weight: 800; padding: 0.05rem 0.4rem; border-radius: 9999px; background: rgb(var(--b-amber-100, 254 243 199)); color: rgb(var(--t-amber-800, 146 64 14)); }
.notify-text { margin-top: 0.25rem; font-size: 0.8rem; line-height: 1.7; color: rgb(var(--t-slate-700, 51 65 85)); white-space: pre-wrap; overflow-wrap: anywhere; }
.notify-replies { margin-top: 0.35rem; margin-inline-start: 0.9rem; padding-inline-start: 0.6rem; border-inline-start: 2px solid rgb(var(--c-slate-200, 226 232 240)); display: flex; flex-direction: column; gap: 0.3rem; }
.notify-read { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.65rem; color: rgb(var(--t-slate-500, 100 116 139)); }
.notify-read .ok { color: rgb(var(--t-emerald-700, 4 120 87)); font-weight: 700; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.notify-reply-btn { font-size: 0.68rem; font-weight: 800; padding: 0.3rem 0.65rem; border-radius: 0.55rem; color: rgb(var(--t-blue-700, 29 78 216)); background: rgb(var(--b-blue-50, 239 246 255)); }
.notify-reply-btn:hover { background: rgb(var(--b-blue-100, 219 234 254)); }
.notify-reply-box { margin-top: 0.5rem; }
.notify-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.7rem 1rem; border-top: 1px solid rgb(var(--c-slate-100, 241 245 249)); }
.notify-foot button { font-size: 0.7rem; font-weight: 800; padding: 0.4rem 0.7rem; border-radius: 0.6rem; background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-700, 51 65 85)); }
.notify-foot button:disabled { opacity: 0.75; cursor: default; }
.notify-alert { border: 2px solid rgb(var(--c-amber-300, 252 211 77)); }

/* ================= تعديل ± على المسلّم بالحاسبة (calculator.js، بطاقة النتيجة الغامقة) ================= */
.calc-adjust { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.8rem; }
.calc-adj-steps { display: inline-flex; gap: 0.25rem; }
.calc-adj-btn { min-width: 2.1rem; padding: 0.35rem 0.5rem; border-radius: 0.65rem; font-size: 0.75rem; font-weight: 800; line-height: 1.2; color: #e2e8f0; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease; }
.calc-adj-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.22); }
.calc-adj-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.calc-adj-cents { color: #fcd34d; background: rgba(252, 211, 77, 0.1); border-color: rgba(252, 211, 77, 0.3); padding-inline: 0.65rem; }
.calc-adj-cents:hover:not(:disabled) { background: rgba(252, 211, 77, 0.18); border-color: rgba(252, 211, 77, 0.45); }
.calc-adj-reset { margin-inline-start: auto; min-width: 2rem; font-size: 0.9rem; }
.calc-adjust-note { margin-top: 0.45rem; font-size: 0.72rem; color: #94a3b8; }

/* ================= الحسابات الجاهزة (ready.js) ================= */
.ready-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); align-items: start; }
.ready-card { display: flex; flex-direction: column; gap: 0.85rem; padding: 1.1rem 1.15rem 0.9rem; border-radius: 1.15rem; background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 26px -20px rgb(15 23 42 / 0.3); transition: box-shadow 0.2s ease, border-color 0.2s ease; }
.ready-card:hover { border-color: rgb(var(--c-slate-300, 203 213 225)); box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 16px 34px -20px rgb(15 23 42 / 0.38); }
.ready-card.is-paused { background: rgb(var(--b-slate-50, 248 250 252)); border-style: dashed; }
.ready-card.is-paused > :not(.ready-head) { opacity: 0.5; }
.ready-head { display: flex; align-items: flex-start; gap: 0.75rem; }
.ready-icon { width: 2.6rem; height: 2.6rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 0.85rem; background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-500, 100 116 139)); }
.ready-icon svg { width: 1.3rem; height: 1.3rem; }
.ready-flag { font-size: 1.5rem; line-height: 1; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-100, 241 245 249)); }
.ready-name { font-family: 'Cairo', sans-serif; font-size: 1.02rem; font-weight: 800; line-height: 1.45; color: rgb(var(--t-slate-900, 15 23 42)); overflow-wrap: anywhere; }
.ready-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.15rem; }
.ready-meta:not(:has(span)) { display: none; }
.ready-cat, .ready-paused { font-size: 0.68rem; font-weight: 800; padding: 0.1rem 0.55rem; border-radius: 9999px; }
.ready-cat { background: rgb(var(--b-blue-50, 239 246 255)); color: rgb(var(--t-blue-700, 29 78 216)); }
.ready-paused { background: rgb(var(--b-amber-100, 254 243 199)); color: rgb(var(--t-amber-800, 146 64 14)); }
.ready-tools { display: flex; gap: 0.1rem; margin-inline-start: auto; margin-top: -0.2rem; margin-inline-end: -0.35rem; flex-shrink: 0; }
.ready-tools button { width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 0.6rem; color: rgb(var(--t-slate-400, 148 163 184)); transition: background-color 0.15s ease, color 0.15s ease; }
.ready-tools button:hover { background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-700, 51 65 85)); }
.ready-tools button[data-action="delete-ready"]:hover { background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-600, 225 29 72)); }
.ready-tools svg { width: 1rem; height: 1rem; }
.ready-details { position: relative; padding: 0.8rem 0.95rem; padding-inline-end: 2.7rem; border-radius: 0.85rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.ready-text { margin: 0; font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 0.86rem; font-weight: 500; line-height: 1.85; color: rgb(var(--t-slate-800, 30 41 59)); white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; font-variant-numeric: tabular-nums; max-height: 14rem; overflow-y: auto; }
.ready-copy-mini { position: absolute; top: 0.6rem; inset-inline-end: 0.6rem; }
.ready-terms { padding: 0.6rem 0.85rem; border-radius: 0.8rem; background: rgb(var(--b-amber-50, 255 251 235)); border: 1px solid rgb(var(--c-amber-200, 253 230 138)); }
.ready-terms-label { display: block; font-size: 0.66rem; font-weight: 800; color: rgb(var(--t-amber-700, 180 83 9)); margin-bottom: 0.15rem; }
.ready-terms p { font-size: 0.78rem; line-height: 1.75; color: rgb(var(--t-amber-900, 120 53 15)); white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; }
.ready-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ready-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; padding: 0.65rem 0.9rem; border-radius: 0.8rem; font-size: 0.8rem; font-weight: 800; transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease; }
.ready-btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.ready-btn:active:not(:disabled) { transform: scale(0.97); }
.ready-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ready-btn-copy { background: rgb(var(--b-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); }
.ready-btn-copy:hover:not(:disabled) { background: rgb(var(--b-slate-800, 30 41 59)); }
.quote-copy.copied, .quote-copy.copied:hover { background: rgb(var(--b-emerald-600, 5 150 105)); color: #fff; }
.ready-btn-copy.copied { background: rgb(var(--b-emerald-600, 5 150 105)); color: #fff; }
.ready-btn-wa { background: #16a34a; color: #fff; box-shadow: 0 6px 16px -10px rgb(22 163 74 / 0.8); }
.ready-btn-wa:hover:not(:disabled) { background: #15803d; }
.ready-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.35rem 0.75rem; padding-top: 0.65rem; border-top: 1px solid rgb(var(--c-slate-100, 241 245 249)); }
.ready-usage { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.45rem; font-size: 0.7rem; font-weight: 600; color: rgb(var(--t-slate-500, 100 116 139)); }
.ready-usage span { display: inline-flex; align-items: center; gap: 0.25rem; }
.ready-usage svg { width: 0.8rem; height: 0.8rem; opacity: 0.7; }
.ready-usage b { font-weight: 800; color: rgb(var(--t-slate-700, 51 65 85)); }
.ready-usage i { font-style: normal; color: rgb(var(--t-slate-300, 203 213 225)); }
.ready-added { font-size: 0.62rem; font-weight: 500; color: rgb(var(--t-slate-300, 203 213 225)); white-space: nowrap; }
.ready-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 3rem 1.5rem; text-align: center; border-radius: 1.25rem; border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); background: rgb(var(--b-white, 255 255 255)); font-size: 0.8rem; color: rgb(var(--t-slate-500, 100 116 139)); }
.ready-empty b { font-size: 0.95rem; color: rgb(var(--t-slate-800, 30 41 59)); }
.ready-empty span:not(.ready-empty-icon) { max-width: 26rem; line-height: 1.8; }
.ready-empty-icon { width: 3.2rem; height: 3.2rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 1rem; background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-400, 148 163 184)); margin-bottom: 0.3rem; }
.ready-empty-icon svg { width: 1.6rem; height: 1.6rem; }
.ready-empty .ready-btn { padding-inline: 1.4rem; }
.ready-preview { border-radius: 0.8rem; border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); background: rgb(var(--b-slate-50, 248 250 252)); padding: 0.6rem 0.8rem; }
.ready-preview-label { display: block; font-size: 0.66rem; font-weight: 800; color: rgb(var(--t-slate-400, 148 163 184)); margin-bottom: 0.25rem; }
.ready-preview pre { margin: 0; font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 0.76rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; max-height: 10rem; overflow-y: auto; color: rgb(var(--t-slate-700, 51 65 85)); }

/* ================= الدفعة الثانية (2026-10-19): الكلمات والانتهاء بالحسابات الجاهزة، حد الحوالة، الإشعارات اليومية ================= */
.ready-token { background: rgb(var(--b-blue-50, 239 246 255)); color: rgb(var(--t-blue-700, 29 78 216)); border-radius: 0.35rem; padding: 0 0.3rem; font-size: 0.85em; font-weight: 700; }
.ready-tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.ready-token-chip { padding: 0.25rem 0.55rem; border-radius: 9999px; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); font-size: 0.7rem; font-weight: 700; color: rgb(var(--t-slate-600, 71 85 105)); transition: border-color 0.15s ease, color 0.15s ease; }
.ready-token-chip:hover { border-color: rgb(var(--c-blue-300, 147 197 253)); color: rgb(var(--t-blue-700, 29 78 216)); }
.ready-expired, .ready-expiry { font-size: 0.68rem; font-weight: 800; padding: 0.1rem 0.55rem; border-radius: 9999px; }
.ready-expired { background: rgb(var(--b-rose-100, 255 228 230)); color: rgb(var(--t-rose-700, 190 18 60)); }
.ready-expiry { background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-600, 71 85 105)); }
.ready-card.is-paused > .ready-renew { opacity: 1; }
.ready-renew { width: 100%; padding: 0.65rem; border-radius: 0.8rem; font-size: 0.8rem; font-weight: 800; background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); border: 1px dashed rgb(var(--c-rose-300, 253 164 175)); }
.ready-renew:hover { background: rgb(var(--b-rose-100, 255 228 230)); }

.calc-limit-note { margin-top: 0.45rem; font-size: 0.72rem; font-weight: 700; color: #fcd34d; }
.approval-chip { display: inline-flex; align-items: center; gap: 0.2rem; margin-top: 0.3rem; padding: 0.15rem 0.55rem; border-radius: 9999px; font-size: 0.66rem; font-weight: 800; background: rgb(var(--b-amber-100, 254 243 199)); color: rgb(var(--t-amber-800, 146 64 14)); }
.approval-chip.manager { background: rgb(var(--b-emerald-600, 5 150 105)); color: #fff; cursor: pointer; }
.approval-chip.manager:hover { filter: brightness(1.08); }
.approval-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 0.7rem; font-size: 0.72rem; font-weight: 700; background: rgb(var(--b-amber-50, 255 251 235)); color: rgb(var(--t-amber-800, 146 64 14)); border: 1px solid rgb(var(--c-amber-200, 253 230 138)); }
.approval-box .approval-chip { margin-top: 0; }
.approval-banner { border-radius: 1rem; border: 1px solid rgb(var(--c-amber-200, 253 230 138)); background: rgb(var(--b-amber-50, 255 251 235)); padding: 0.75rem 1rem; }
.approval-banner-head { font-size: 0.8rem; font-weight: 800; color: rgb(var(--t-amber-800, 146 64 14)); margin-bottom: 0.35rem; }
.approval-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0; border-top: 1px solid rgb(var(--c-amber-200, 253 230 138)); font-size: 0.78rem; color: rgb(var(--t-slate-700, 51 65 85)); }
.approval-row .approval-chip { margin-top: 0; flex-shrink: 0; }

.daily-push { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem 1rem; border-radius: 0.9rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-slate-50, 248 250 252)); }
.daily-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.78rem; }
.daily-row b { display: block; color: rgb(var(--t-slate-800, 30 41 59)); }
.daily-row small { display: block; font-size: 0.68rem; color: rgb(var(--t-slate-400, 148 163 184)); }
.daily-test-btn { padding: 0.45rem 0.7rem; border-radius: 0.6rem; font-size: 0.7rem; font-weight: 800; background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); color: rgb(var(--t-slate-700, 51 65 85)); }
.daily-test-btn:hover { border-color: rgb(var(--c-slate-400, 148 163 184)); }

/* ================= كشف حساب الزبون (customers.js) ================= */
.cst-cols { display: none; }
/* الجوال: العنوان، وتحته المبلغ والمدفوع فوق بعض يمين، والباقي يسار */
.cst-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title title" "amt left" "paid left"; gap: 0.2rem 0.75rem; padding: 0.7rem 1.25rem; border-bottom: 1px solid rgb(var(--c-slate-100, 241 245 249)); font-size: 0.78rem; color: rgb(var(--t-slate-700, 51 65 85)); }
.cst-row:last-child { border-bottom: 0; }
.cst-c { white-space: nowrap; }
.cst-c-amt { grid-area: amt; }
.cst-c-paid { grid-area: paid; }
.cst-c-left { grid-area: left; align-self: center; text-align: left; font-size: 0.82rem; }
.cst-title { grid-area: title; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; }
.cst-title b { color: rgb(var(--t-slate-900, 15 23 42)); font-weight: 800; }
.cst-title span { font-size: 0.7rem; color: rgb(var(--t-slate-400, 148 163 184)); }
.cst-lbl { color: rgb(var(--t-slate-400, 148 163 184)); font-size: 0.68rem; }
@media (min-width: 640px) {
    .cst-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0.75rem; padding: 0.55rem 1.25rem; font-size: 0.7rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); background: rgb(var(--b-slate-50, 248 250 252)); border-bottom: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
    .cst-row { grid-template-columns: 2fr 1fr 1fr 1fr; grid-template-areas: none; align-items: center; }
    .cst-title, .cst-c-amt, .cst-c-paid, .cst-c-left { grid-area: auto; }
    .cst-c-left { text-align: start; font-size: inherit; }
    .cst-title { flex-direction: column; align-items: flex-start; justify-content: center; }
    .cst-lbl { display: none; }
}

/* ================= الدفعة الثالثة (2026-10-21): التتبّع، VIP، تنبيهات الاحتيال ================= */
.txd-track { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.7rem; border-radius: 0.7rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.txd-track bdi { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.72rem; color: rgb(var(--t-slate-600, 71 85 105)); }
.txd-track-open { font-size: 0.72rem; font-weight: 800; color: rgb(var(--t-blue-700, 29 78 216)); padding: 0.2rem 0.5rem; border-radius: 0.5rem; }
.txd-track-open:hover { background: rgb(var(--b-blue-50, 239 246 255)); }
.calc-vip-note { margin-top: 0.45rem; font-size: 0.74rem; font-weight: 800; color: #fcd34d; }

/* ================= شرائح الدولة حسب المبلغ (countries.js + calculator.js) ================= */
.calc-tier-note { margin-top: 0.45rem; font-size: 0.72rem; font-weight: 700; color: #cbd5e1; }
.calc-tier-reset { margin-inline-start: 0.35rem; padding: 0.1rem 0.5rem; border-radius: 9999px; font-size: 0.68rem; font-weight: 800; color: #0f172a; background: #fcd34d; }
.calc-tier-reset:hover { filter: brightness(1.06); }
.ct-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.4rem 0.75rem; align-items: center; }
.ct-grid .ct-from, .ct-grid .ct-del { display: none; }
.ct-h { font-weight: 700; color: rgb(var(--t-slate-700, 51 65 85)); }
.ct-box.has-tiers .ct-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr) minmax(0, 1fr) 1.6rem; gap: 0.4rem; }
.ct-box.has-tiers .ct-from, .ct-box.has-tiers .ct-del { display: block; }
.ct-box.has-tiers .ct-h { font-size: 0.66rem; color: rgb(var(--t-slate-500, 100 116 139)); }
.ct-first { font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); padding-inline-start: 0.6rem; white-space: nowrap; }
.ct-mode { flex: none; width: 4.4rem; }
.ct-mode-line { display: none; }
.ct-box.has-tiers .ct-mode-line { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; font-weight: 700; color: rgb(var(--t-slate-700, 51 65 85)); }
.ct-box.has-tiers .ct-mode-line .ct-mode { padding-block: 0.3rem; }
.ct-unit0 { display: none; }
.ct-box.has-tiers .ct-unit0 { display: block; }
.ct-box.has-tiers #c_cost_value { padding-inline-end: 1.35rem; }
.ct-grid .ct-in { padding-inline-end: 1.35rem; }
.ct-suffix { position: absolute; inset-inline-end: 0.55rem; top: 50%; transform: translateY(-50%); font-size: 0.7rem; font-weight: 700; color: rgb(var(--t-slate-400, 148 163 184)); pointer-events: none; }
.ct-x { width: 1.6rem; height: 1.6rem; border-radius: 0.5rem; color: rgb(var(--t-slate-400, 148 163 184)); font-size: 0.75rem; }
.ct-x:hover { color: rgb(var(--t-rose-600, 225 29 72)); background: rgb(var(--b-rose-50, 255 241 242)); }
.ct-chip { display: inline-block; margin-inline-start: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 9999px; font-size: 0.62rem; font-weight: 800; vertical-align: middle; background: rgb(var(--b-blue-50, 239 246 255)); color: rgb(var(--t-blue-700, 29 78 216)); cursor: help; }
.flag-chip { display: inline-flex; align-items: center; gap: 0.2rem; margin-top: 0.3rem; padding: 0.15rem 0.55rem; border-radius: 9999px; font-size: 0.66rem; font-weight: 800; background: rgb(var(--b-rose-100, 255 228 230)); color: rgb(var(--t-rose-700, 190 18 60)); }
.flag-chip.manager { cursor: pointer; }
.flag-chip.manager:hover { filter: brightness(0.96); }
.flag-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; padding: 0.5rem 0.7rem; border-radius: 0.7rem; font-size: 0.72rem; font-weight: 700; background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-800, 159 18 57)); border: 1px solid rgb(var(--c-rose-200, 254 205 211)); }
.flag-box .flag-chip { margin-top: 0; background: rgb(var(--b-white, 255 255 255)); }
.fraud-icon { font-size: 1.9rem; line-height: 1; animation: fraud-shake 0.6s ease 0.15s both; }
@keyframes fraud-shake { 20%, 60% { transform: rotate(-10deg); } 40%, 80% { transform: rotate(10deg); } }
.fraud-reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.fraud-reasons li { padding: 0.6rem 0.75rem; border-radius: 0.75rem; font-size: 0.8rem; font-weight: 700; line-height: 1.6; background: rgb(var(--b-amber-50, 255 251 235)); color: rgb(var(--t-amber-900, 120 53 15)); border: 1px solid rgb(var(--c-amber-200, 253 230 138)); }
html.motion-off .fraud-icon { animation: none; }

/* ================= دفعة 2026-10-23: النسخ والعكس بالحاسبة، حدود المحافظ، إشعار التحويل، المتأخرة، القائمة السوداء ================= */
/* الحاسبة: "نسخ" جنب الحفظ (الكرت غامق دايماً) */
.calc-actions { display: flex; gap: 0.5rem; align-items: stretch; }
.calc-actions .save-btn { flex: 1; width: auto; }
.calc-copy-btn { flex: none; padding: 0 1rem; border-radius: 0.9rem; font-size: 0.8rem; font-weight: 800; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); transition: background 0.15s ease; white-space: nowrap; }
.calc-copy-btn:hover { background: rgba(255, 255, 255, 0.18); }
.calc-copy-btn.copied, .calc-copy-btn.copied:hover, .mrb-copy.copied { background: #059669; border-color: #059669; color: #fff; }

/* الحاسبة بالعكس: رابط خفيف تحت المبلغ */
.calc-rev-link { font-size: 0.72rem; font-weight: 700; color: rgb(var(--t-slate-400, 148 163 184)); text-decoration: underline dotted; text-underline-offset: 3px; }
.calc-rev-link:hover { color: rgb(var(--t-blue-600, 37 99 235)); }
.calc-rev-box { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; padding: 0.45rem 0.55rem; border-radius: 0.75rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); }
.calc-rev-label { font-size: 0.72rem; font-weight: 800; color: rgb(var(--t-slate-600, 71 85 105)); white-space: nowrap; }
.calc-rev-field { position: relative; flex: 1; min-width: 6.5rem; }
.calc-rev-field input { width: 100%; padding: 0.4rem 1.6rem 0.4rem 0.6rem; padding-inline-end: 1.6rem; border-radius: 0.55rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); font-weight: 800; font-size: 0.85rem; outline: none; }
.calc-rev-field input:focus { border-color: rgb(var(--c-blue-500, 59 130 246)); }
.calc-rev-field span { position: absolute; inset-inline-end: 0.55rem; top: 50%; transform: translateY(-50%); font-size: 0.75rem; font-weight: 800; color: rgb(var(--t-slate-400, 148 163 184)); pointer-events: none; }
.calc-rev-go { padding: 0.4rem 0.8rem; border-radius: 0.55rem; font-size: 0.75rem; font-weight: 800; background: rgb(var(--b-slate-900, 15 23 42)); color: rgb(var(--t-inv, 255 255 255)); }
.calc-rev-x { width: 1.7rem; height: 1.7rem; border-radius: 0.5rem; font-size: 0.75rem; color: rgb(var(--t-slate-400, 148 163 184)); }
.calc-rev-x:hover { background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-700, 51 65 85)); }
.calc-rev-note { margin-top: 0.35rem; font-size: 0.72rem; font-weight: 700; color: rgb(var(--t-emerald-700, 4 120 87)); }

/* حدود المحافظ بكرت الحساب */
.wl-box { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.35rem; }
.wl-row { font-size: 0.66rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); }
.wl-row b { color: rgb(var(--t-slate-800, 30 41 59)); }
.wl-row i { display: block; height: 4px; margin-top: 2px; border-radius: 9999px; background: linear-gradient(to left, var(--acc, #64748b) var(--p), rgb(var(--b-slate-200, 226 232 240)) var(--p)); }
.wl-row.near i { background: linear-gradient(to left, #f59e0b var(--p), rgb(var(--b-slate-200, 226 232 240)) var(--p)); }
.wl-row.full, .wl-row.full b { color: rgb(var(--t-rose-700, 190 18 60)); }
.wl-row.full i { background: #e11d48; }

/* لصق إشعار التحويل */
.nt-match { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 0.75rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); text-align: right; transition: border-color 0.15s ease, background 0.15s ease; }
.nt-match:hover { border-color: rgb(var(--c-blue-400, 96 165 250)); background: rgb(var(--b-blue-50, 239 246 255)); }
.nt-match.strong { border-color: rgb(var(--c-emerald-300, 110 231 183)); background: rgb(var(--b-emerald-50, 236 253 245)); }
.nt-pick { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.45rem 0.8rem; border-radius: 0.6rem; font-size: 0.75rem; font-weight: 800; cursor: pointer; background: rgb(var(--b-blue-50, 239 246 255)); color: rgb(var(--t-blue-800, 30 64 175)); border: 1px solid rgb(var(--c-blue-200, 191 219 254)); }
.nt-pick:hover { background: rgb(var(--b-blue-100, 219 234 254)); }
.nt-ocr { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; border-radius: 0.7rem; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); font-size: 0.72rem; }
.nt-ocr img { width: 3rem; height: 3rem; object-fit: cover; object-position: top; border-radius: 0.45rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); flex: none; }
.nt-why { display: block; font-size: 0.62rem; font-weight: 800; color: rgb(var(--t-emerald-700, 4 120 87)); }

/* الحوالة المتأخرة */
tr.row-late > td { background: rgb(var(--b-orange-50, 255 247 237)); }
tr.row-late > td:first-child { box-shadow: inset -3px 0 0 #f97316; }
.late-chip { display: inline-flex; margin-top: 0.3rem; padding: 0.12rem 0.5rem; border-radius: 9999px; font-size: 0.64rem; font-weight: 800; background: rgb(var(--b-orange-100, 255 237 213)); color: rgb(var(--t-orange-800, 154 52 18)); }
.late-banner { border-radius: 1rem; border: 1px solid rgb(var(--c-orange-200, 254 215 170)); background: rgb(var(--b-orange-50, 255 247 237)); padding: 0.75rem 1rem; }
.late-banner-head { font-size: 0.8rem; font-weight: 800; color: rgb(var(--t-orange-800, 154 52 18)); margin-bottom: 0.35rem; }
.late-banner-head span { font-size: 0.7rem; font-weight: 600; color: rgb(var(--t-orange-700, 194 65 12)); }
.late-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.4rem 0; border-top: 1px solid rgb(var(--c-orange-200, 254 215 170)); font-size: 0.78rem; color: rgb(var(--t-slate-700, 51 65 85)); text-align: right; }
.late-row:hover b { text-decoration: underline; }
.late-ago { flex: none; font-size: 0.7rem; font-weight: 800; color: rgb(var(--t-orange-700, 194 65 12)); }

/* القائمة السوداء */
.black-note { margin: 0; padding: 0.5rem 0.7rem; border-radius: 0.65rem; font-size: 0.75rem; font-weight: 800; background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); border: 1px solid rgb(var(--c-rose-300, 253 164 175)); }
.black-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; }
@media (max-width: 520px) { .black-add { grid-template-columns: 1fr auto; } .black-add > :first-child { grid-column: 1 / -1; } }
.black-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.6rem; border-radius: 0.6rem; font-size: 0.75rem; background: rgb(var(--b-rose-50, 255 241 242)); border: 1px solid rgb(var(--c-rose-100, 255 228 230)); }

/* ================= دفعة 2026-10-24: المصاريف الثابتة، QR الفاتورة، هدف الشهر، سجل الأسعار، الزبون الدايم ================= */
.rec-form { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.7fr) auto; gap: 0.6rem; align-items: end; padding: 0.85rem; border-radius: 0.9rem; border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); background: rgb(var(--b-slate-50, 248 250 252)); }
.rec-form-title { grid-column: 1 / -1; font-size: 0.75rem; font-weight: 800; color: rgb(var(--t-slate-700, 51 65 85)); }
.rec-f { min-width: 0; }
.rec-f label { display: block; margin-bottom: 0.25rem; font-size: 0.68rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); }
.rec-f input { min-width: 0; }
.rec-actions { display: flex; gap: 0.4rem; }
@media (max-width: 640px) {
    .rec-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rec-f-name { grid-column: 1 / -1; }
    .rec-actions { grid-column: 1 / -1; }
    .rec-actions button { flex: 1; }
}
.rec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.6rem 0.75rem; border-radius: 0.75rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-slate-50, 248 250 252)); font-size: 0.8rem; }
.rec-row.off > :not(.status-toggle):not(button) { opacity: 0.5; }
.rec-row > .min-w-0 { flex: 1 1 13rem; }

.rc-foot.has-qr { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; text-align: right; }
.rc-qr { flex: none; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.rc-qr svg { width: 64px; height: 64px; display: block; padding: 3px; background: #fff; border-radius: 6px; border: 1px solid #e2e8f0; }
.rc-qr span { font-size: 0.55rem; font-weight: 700; color: #7d8aa0; }

.goal-num { font-size: 1.35rem; font-weight: 900; color: rgb(var(--t-slate-900, 15 23 42)); }
.goal-bar { position: relative; height: 12px; margin: 0.6rem 0 0.5rem; border-radius: 9999px; background: rgb(var(--b-slate-100, 241 245 249)); overflow: hidden; }
.goal-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 9999px; background: #10b981; transition: width 0.6s ease; }
.goal-bar i.behind { background: #f59e0b; }
.goal-bar i.done { background: linear-gradient(90deg, #10b981, #059669); }
.goal-today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: rgb(var(--c-slate-500, 100 116 139)); opacity: 0.6; }

.rl-chart { width: 100%; height: auto; display: block; }
.rl-grid { stroke: var(--chart-grid); stroke-width: 1; }
.rl-tick { fill: var(--chart-muted); font-size: 10px; font-family: inherit; }
.rl-band { fill: rgba(59, 130, 246, 0.14); }
.rl-line { fill: none; stroke: #2563eb; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.rl-dot { fill: var(--chart-surface); stroke: #2563eb; stroke-width: 1.6; }

.calc-loyal-note { margin-top: 0.45rem; font-size: 0.74rem; font-weight: 800; color: #f9a8d4; }
.calc-loyal-note.muted { color: #94a3b8; font-weight: 700; }
.calc-loyal-skip { margin-inline-start: 0.35rem; padding: 0.1rem 0.5rem; border-radius: 9999px; font-size: 0.66rem; font-weight: 800; color: #fff; background: rgba(255, 255, 255, 0.14); }
.loyal-box { margin-top: 0.6rem; padding: 0.45rem 0.7rem; border-radius: 0.7rem; font-size: 0.72rem; font-weight: 700; background: rgb(var(--b-pink-50, 253 242 248)); color: rgb(var(--t-pink-800, 157 23 77)); border: 1px solid rgb(var(--c-pink-200, 251 207 232)); }

/* ================= محافظ USDT (usdt.js، 2026-10-24) ================= */
/* محافظ USDT: بطاقات زجاج بلون شعار المحفظة (--uw)، 2–3 بالسطر على الكمبيوتر (--uw-cols من renderUsdtWallets) */
.uw-grid { display: grid; gap: 0.85rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 520px) { .uw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .uw-grid { grid-template-columns: repeat(var(--uw-cols, 3), minmax(0, 1fr)); } }
.uw-card {
    --uw-ink: color-mix(in srgb, var(--uw, #64748b) 58%, #111827);
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; flex-direction: column; gap: 0.95rem;
    min-height: 10.75rem; padding: 1.05rem 1.1rem 0.95rem; border-radius: 1.35rem;
    background:
        radial-gradient(90% 110% at 0% 100%, color-mix(in srgb, var(--uw, #64748b) 13%, transparent) 0%, transparent 62%),
        linear-gradient(160deg, color-mix(in srgb, var(--uw, #64748b) 11%, rgb(var(--b-white, 255 255 255))) 0%, rgb(var(--b-white, 255 255 255)) 72%);
    border: 1px solid color-mix(in srgb, var(--uw, #64748b) 26%, rgb(var(--c-slate-200, 226 232 240)));
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8), 0 8px 20px -18px color-mix(in srgb, var(--uw, #64748b) 45%, transparent);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* كرة لون الشعار مغبّشة ورا الشعار، ولمعة زجاج مايلة */
.uw-card::before { content: ''; position: absolute; z-index: -1; width: 11rem; height: 11rem; border-radius: 50%; top: -5.5rem; inset-inline-start: -3.5rem; background: var(--uw, #64748b); opacity: 0.24; filter: blur(44px); pointer-events: none; }
.uw-card::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(115deg, rgb(255 255 255 / 0.6) 0%, rgb(255 255 255 / 0) 36%, rgb(255 255 255 / 0) 66%, rgb(255 255 255 / 0.28) 100%); pointer-events: none; }
.uw-card:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8), 0 12px 24px -18px color-mix(in srgb, var(--uw, #64748b) 55%, transparent); }
.uw-card.low { border-color: #fb923c; }
.uw-card .uw-logo { box-shadow: 0 4px 10px -6px color-mix(in srgb, var(--uw, #64748b) 55%, transparent), 0 0 0 1px rgb(255 255 255 / 0.7); }
.uw-top { display: flex; align-items: center; gap: 0.7rem; }
.uw-title { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.uw-title b { font-size: 0.98rem; font-weight: 900; color: rgb(var(--t-slate-900, 15 23 42)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uw-title span { font-size: 0.7rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uw-main-chip { flex: none; align-self: flex-start; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.62rem; font-weight: 800; color: var(--uw-ink); background: color-mix(in srgb, var(--uw, #64748b) 15%, rgb(255 255 255 / 0.7)); border: 1px solid color-mix(in srgb, var(--uw, #64748b) 34%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* الرصيد بصندوق زجاج: موجب أخضر خفيف، سالب أحمر خفيف، صفر محايد */
.uw-bal { padding: 0; }
.uw-bal-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.66rem; font-weight: 800; color: rgb(var(--t-slate-500, 100 116 139)); }
.uw-low { font-style: normal; padding: 0.05rem 0.45rem; border-radius: 9999px; font-size: 0.6rem; background: rgb(var(--b-orange-100, 255 237 213)); color: rgb(var(--t-orange-800, 154 52 18)); }
.uw-amount { display: flex; align-items: baseline; gap: 0.35rem; margin-top: 0.1rem; font-size: 1.85rem; font-weight: 900; line-height: 1.1; color: rgb(var(--t-slate-900, 15 23 42)); letter-spacing: -0.01em; }
.uw-amount small { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; color: var(--uw-ink); }
.uw-amount.neg { color: rgb(var(--t-rose-600, 225 29 72)); }
.uw-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.uw-nets { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; color: rgb(var(--t-slate-400, 148 163 184)); }
.uw-actions { display: flex; flex: none; gap: 0.35rem; }
.uw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; height: 2.05rem; padding: 0 0.85rem; border-radius: 0.8rem; font-size: 0.74rem; font-weight: 800; color: rgb(var(--t-slate-800, 30 41 59)); background: rgb(255 255 255 / 0.62); border: 1px solid rgb(255 255 255 / 0.85); box-shadow: 0 1px 2px rgb(15 23 42 / 0.07), inset 0 1px 0 rgb(255 255 255 / 0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background 0.15s ease, box-shadow 0.15s ease; }
.uw-btn:hover { background: rgb(255 255 255 / 0.95); box-shadow: 0 3px 10px -4px color-mix(in srgb, var(--uw, #64748b) 70%, transparent), inset 0 1px 0 rgb(255 255 255 / 0.9); }
.uw-btn:not(.uw-icon) svg { color: var(--uw-ink); }
.uw-btn.uw-icon { width: 2.05rem; padding: 0; color: rgb(var(--t-slate-500, 100 116 139)); }
.uw-btn.uw-icon:hover { color: rgb(var(--t-slate-900, 15 23 42)); }
.uw-btn svg { width: 0.95rem; height: 0.95rem; }
/* نافذة النسخ */
.uwc-card { --uw-ink: color-mix(in srgb, var(--uw, #64748b) 58%, #111827); padding: 0; }
.uwc-head { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: 0.75rem; padding: 1.1rem 1.15rem; background: linear-gradient(160deg, color-mix(in srgb, var(--uw, #64748b) 16%, rgb(var(--b-white, 255 255 255))) 0%, rgb(var(--b-white, 255 255 255)) 85%); border-bottom: 1px solid color-mix(in srgb, var(--uw, #64748b) 20%, rgb(var(--c-slate-200, 226 232 240))); }
.uwc-head::before { content: ''; position: absolute; z-index: -1; width: 10rem; height: 10rem; border-radius: 50%; top: -5rem; inset-inline-start: -3rem; background: var(--uw, #64748b); opacity: 0.22; filter: blur(40px); }
.uwc-head .uw-logo { box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--uw, #64748b) 75%, transparent); }
.uwc-close { flex: none; width: 2rem; height: 2rem; border-radius: 9999px; color: rgb(var(--t-slate-500, 100 116 139)); background: rgb(255 255 255 / 0.6); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.uwc-close:hover { color: rgb(var(--t-slate-900, 15 23 42)); }
.uwc-list { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem; }
.uwc-row { display: flex; align-items: center; gap: 0.7rem; width: 100%; padding: 0.7rem 0.8rem; border-radius: 0.95rem; text-align: start; background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease; }
.uwc-row:hover { border-color: color-mix(in srgb, var(--uw, #64748b) 55%, rgb(var(--c-slate-200, 226 232 240))); background: color-mix(in srgb, var(--uw, #64748b) 7%, rgb(var(--b-white, 255 255 255))); }
.uwc-tag { flex: none; min-width: 3.4rem; padding: 0.3rem 0.45rem; border-radius: 0.6rem; text-align: center; font-size: 0.64rem; font-weight: 900; letter-spacing: 0.03em; color: var(--uw-ink); background: color-mix(in srgb, var(--uw, #64748b) 14%, rgb(var(--b-white, 255 255 255))); border: 1px solid color-mix(in srgb, var(--uw, #64748b) 28%, transparent); }
.uwc-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.1rem; }
.uwc-body small { font-size: 0.64rem; font-weight: 700; color: rgb(var(--t-slate-500, 100 116 139)); }
.uwc-body bdi { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; font-weight: 700; color: rgb(var(--t-slate-900, 15 23 42)); text-align: left; word-break: break-all; line-height: 1.35; }
.uwc-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 0.65rem; font-size: 0.9rem; color: rgb(var(--t-slate-600, 71 85 105)); background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); }
.uwc-ico svg { width: 1rem; height: 1rem; display: block; }
.uwc-all svg { width: 0.95rem; height: 0.95rem; }
.uwc-ico .ok { display: none; }
.uwc-row.copied { background: rgb(var(--b-emerald-50, 236 253 245)); border-color: #34d399; }
.uwc-row.copied .uwc-ico { color: #fff; background: #10b981; border-color: #10b981; }
.uwc-row.copied .uwc-ico .c { display: none; }
.uwc-row.copied .uwc-ico .ok { display: inline; }
.uwc-all { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; margin-top: 0.15rem; padding: 0.6rem; border-radius: 0.85rem; font-size: 0.74rem; font-weight: 800; color: rgb(var(--t-slate-600, 71 85 105)); border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); transition: background 0.15s ease; }
.uwc-all:hover { background: rgb(var(--b-slate-50, 248 250 252)); }
.uwc-all.copied { color: rgb(var(--t-emerald-700, 4 120 87)); border-color: #34d399; background: rgb(var(--b-emerald-50, 236 253 245)); }
.uw-logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 0.55rem; overflow: hidden; background: #fff; }
.uw-logo svg { width: 100%; height: 100%; display: block; }
img.uw-logo { object-fit: cover; }
.uw-logo.xs { width: 1.15rem; height: 1.15rem; border-radius: 0.3rem; }
.uw-logo.sm { width: 1.5rem; height: 1.5rem; border-radius: 0.4rem; }
.uw-logo.lg { width: 2.75rem; height: 2.75rem; border-radius: 0.7rem; }
.uw-letter { background: #64748b; color: #fff; font-weight: 900; font-size: 0.85rem; }
.uw-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.uw-chip { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; padding: 0.3rem 0.65rem 0.3rem 0.35rem; padding-inline: 0.35rem 0.7rem; border-radius: 0.7rem; font-size: 0.75rem; font-weight: 800; color: rgb(var(--t-slate-600, 71 85 105)); background: rgb(var(--b-white, 255 255 255)); border: 1.5px solid rgb(var(--c-slate-200, 226 232 240)); transition: border-color 0.15s ease, background 0.15s ease; }
.uw-chip:hover { border-color: rgb(var(--c-slate-400, 148 163 184)); }
.uw-chip.active { border-color: rgb(var(--c-slate-900, 15 23 42)); background: rgb(var(--b-slate-50, 248 250 252)); color: rgb(var(--t-slate-900, 15 23 42)); box-shadow: 0 0 0 1px rgb(var(--c-slate-900, 15 23 42)); }

.dev-out-all { width: 100%; margin-top: 0.25rem; padding: 0.55rem; border-radius: 0.7rem; font-size: 0.75rem; font-weight: 800; color: rgb(var(--t-rose-700, 190 18 60)); background: rgb(var(--b-rose-50, 255 241 242)); border: 1px dashed rgb(var(--c-rose-200, 254 205 211)); }
.dev-out-all:hover { background: rgb(var(--b-rose-100, 255 228 230)); }

.cash-count-btn { flex-shrink: 0; padding: 0.35rem 0.55rem; border-radius: 0.5rem; font-size: 0.7rem; font-weight: 800; color: rgb(var(--t-amber-800, 146 64 14)); background: rgb(var(--b-amber-50, 255 251 235)); border: 1px solid rgb(var(--c-amber-200, 253 230 138)); white-space: nowrap; }
.cash-count-btn.active { background: rgb(var(--b-amber-100, 254 243 199)); }
.cash-count { border: 1px dashed rgb(var(--c-amber-300, 252 211 77)); background: rgb(var(--b-amber-50, 255 251 235) / 0.6); border-radius: 0.75rem; padding: 0.6rem; }
.cash-count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: 0.4rem; }
.cash-den { display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem; background: rgb(var(--b-white, 255 255 255)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-radius: 0.6rem; padding: 0.35rem 0.4rem; text-align: center; }
.cash-den-v { font-size: 0.68rem; font-weight: 900; color: rgb(var(--t-slate-700, 51 65 85)); }
.cash-den input { width: 100%; text-align: center; font-weight: 800; font-size: 0.9rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-radius: 0.45rem; padding: 0.25rem; background: rgb(var(--b-slate-50, 248 250 252)); color: rgb(var(--t-slate-900, 15 23 42)); }
.cash-den input:focus { outline: none; border-color: rgb(var(--c-amber-400, 251 191 36)); }
.cash-den-sum { font-size: 0.62rem; color: rgb(var(--t-slate-500, 100 116 139)); min-height: 0.8rem; }
.cash-count-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; font-size: 0.75rem; color: rgb(var(--t-slate-600, 71 85 105)); }

/* طرق صفحة الزبائن (settings.js) */
.pm-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem; border-radius: 0.8rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); }
.pm-row.off { opacity: 0.55; }
.pm-initial { font-weight: 900; color: rgb(var(--t-slate-700, 51 65 85)); display: inline-grid; place-items: center; }
.pm-brand { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.5rem 0.25rem; border-radius: 0.7rem; border: 1.5px solid rgb(var(--c-slate-200, 226 232 240)); font-size: 0.65rem; font-weight: 800; color: rgb(var(--t-slate-600, 71 85 105)); }
.pm-brand.on { border-color: rgb(var(--c-slate-900, 15 23 42)); background: rgb(var(--b-slate-50, 248 250 252)); color: rgb(var(--t-slate-900, 15 23 42)); }
.pm-chip { padding: 0.35rem 0.6rem; border-radius: 0.6rem; font-size: 0.72rem; font-weight: 800; background: rgb(var(--b-slate-100, 241 245 249)); color: rgb(var(--t-slate-700, 51 65 85)); }
.pm-chip.on { background: rgb(var(--b-emerald-50, 236 253 245)); color: rgb(var(--t-emerald-800, 6 95 70)); box-shadow: inset 0 0 0 1px rgb(var(--c-emerald-300, 110 231 183)); }
.pm-chip b { margin-inline-start: 0.2rem; color: rgb(var(--t-slate-400, 148 163 184)); }
.pm-switches { display: grid; grid-template-columns: 1fr; gap: 0.4rem; }
@media (min-width: 640px) { .pm-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pm-switch { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.6rem; border-radius: 0.7rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); }
.pm-switch b { display: block; font-size: 0.78rem; font-weight: 800; color: rgb(var(--t-slate-900, 15 23 42)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-switch small { display: block; font-size: 0.65rem; color: rgb(var(--t-slate-500, 100 116 139)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-switch.off { opacity: 0.6; }
.pm-switch .status-toggle { flex-shrink: 0; }
.pm-chip.off { background: rgb(var(--b-rose-50, 255 241 242)); color: rgb(var(--t-rose-700, 190 18 60)); box-shadow: inset 0 0 0 1px rgb(var(--c-rose-200, 254 205 211)); }

/* وين بتربح أكتر (reports.js renderInsightsPage) */
.insight-tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.4rem; }
.insight-tips li { font-size: 0.8rem; color: rgb(var(--t-slate-700, 51 65 85)); background: rgb(var(--b-slate-50, 248 250 252)); border: 1px solid rgb(var(--c-slate-200, 226 232 240)); border-radius: 0.7rem; padding: 0.55rem 0.75rem; line-height: 1.6; }
.insight-tips b { color: rgb(var(--t-slate-900, 15 23 42)); }
.hm-wrap { overflow-x: auto; padding-bottom: 0.25rem; }
.hm { display: grid; gap: 3px; min-width: max-content; direction: rtl; }
.hm-h { font-size: 0.6rem; font-weight: 800; color: rgb(var(--t-slate-400, 148 163 184)); text-align: center; align-self: end; }
.hm-d { font-size: 0.68rem; font-weight: 800; color: rgb(var(--t-slate-600, 71 85 105)); display: flex; align-items: center; position: sticky; right: 0; background: rgb(var(--b-white, 255 255 255)); padding-inline-start: 0.2rem; z-index: 1; }
.hm-c { height: 1.9rem; border-radius: 0.4rem; background: rgb(16 185 129 / var(--a, 0)); box-shadow: inset 0 0 0 1px rgb(var(--c-slate-200, 226 232 240) / 0.7); font-size: 0.62rem; font-weight: 800; color: rgb(var(--t-slate-900, 15 23 42)); display: grid; place-items: center; }
.ib { display: grid; gap: 0.35rem; }
.ib-row { display: grid; grid-template-columns: 4.2rem 1fr auto; align-items: center; gap: 0.6rem; font-size: 0.72rem; }
.ib-l { font-weight: 800; color: rgb(var(--t-slate-600, 71 85 105)); }
.ib-v { font-weight: 800; color: rgb(var(--t-slate-700, 51 65 85)); white-space: nowrap; }
.ib-bar { display: block; height: 0.55rem; border-radius: 999px; background: rgb(var(--b-slate-100, 241 245 249)); overflow: hidden; }
.ib-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #34d399); }
.ib-mini { display: inline-block; width: 4rem; vertical-align: middle; }

/* ================= الوضع الداكن ================= */
/* الألوان نفسها متغيرات (build/tailwind.config.js) وبتتحول لحالها، وهون بس اللي إله شكل خاص بالداكن.
   <html data-theme="dark"> بيتحط من js/theme.js (ومن سكربت صغير بأول index.html قبل أول رسم) */
html[data-theme="dark"] .modal { background-color: rgb(2 6 23 / 0.72); }
/* بطاقات محافظ USDT: الزجاج أغمق واللون أفتح */
html[data-theme="dark"] :is(.uw-card, .uwc-card) { --uw-ink: color-mix(in srgb, var(--uw, #64748b) 78%, #ffffff); }
html[data-theme="dark"] .uw-card { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 10px 22px -18px rgb(0 0 0 / 0.7); }
html[data-theme="dark"] .uw-card:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 12px 24px -18px color-mix(in srgb, var(--uw, #64748b) 35%, transparent); }
html[data-theme="dark"] .uw-card::before { opacity: 0.3; }
html[data-theme="dark"] .uw-card::after { opacity: 0.1; }
html[data-theme="dark"] .uw-card .uw-logo { box-shadow: 0 4px 10px -6px color-mix(in srgb, var(--uw, #64748b) 45%, transparent), 0 0 0 1px rgb(255 255 255 / 0.08); }
html[data-theme="dark"] :is(.uw-btn, .uwc-close) { background: rgb(255 255 255 / 0.06); border-color: rgb(255 255 255 / 0.1); box-shadow: none; }
html[data-theme="dark"] .uw-btn:hover { background: rgb(255 255 255 / 0.12); }
html[data-theme="dark"] .uw-main-chip { background: color-mix(in srgb, var(--uw, #64748b) 18%, transparent); }
/* الزر الأساسي (bg-slate-900) بيقلب فاتح بالداكن، فنصه بيقلب غامق */
html[data-theme="dark"] .bg-slate-900.text-white { color: rgb(var(--t-inv, 255 255 255)); }
html[data-theme="dark"] .section-card { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.03), 0 12px 30px -20px rgb(0 0 0 / 0.8); }
/* الخانات أغمق شوي من البطاقة اللي هي فيها */
html[data-theme="dark"] :is(.field, .calc-input, .calc-input-sm, .pay-input, input.bg-white, select.bg-white, textarea.bg-white) { background-color: rgb(12 19 35); }
html[data-theme="dark"] ::placeholder { color: rgb(95 109 135); }
html[data-theme="dark"] ::selection { background: rgb(59 130 246 / 0.4); }
/* الزر المختار بالمجموعات أفتح من خلفيتها (بالفاتح كان أبيض) */
html[data-theme="dark"] :is(.seg-btn.active, .unit-toggle button.active, .subnav-btn.active, .ana-range-btn.active) { background: rgb(51 66 95); color: #f8fafc; box-shadow: 0 1px 3px rgb(0 0 0 / 0.45); }
/* شارة نوع الحساب/المحفظة: من لون النوع نفسه */
html[data-theme="dark"] .acc-chip { background: color-mix(in srgb, var(--acc) 24%, transparent); color: color-mix(in srgb, var(--acc) 50%, #fff); }
/* البطاقات الغامقة أصلاً: إطار خفيف حتى تنفصل عن الخلفية */
html[data-theme="dark"] :is(.calc-result, .usdt-hero, .egp-hero, .mobile-result-bar, .pos-hero) { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.07), 0 18px 40px -22px rgb(0 0 0 / 0.9); }
html[data-theme="dark"] .login-bg { background: radial-gradient(circle at 30% 20%, #16213a, #060a14 70%); }

/* تبديل المظهر: الجديد بينتشر كدائرة من الزر (switchThemeAnimated) */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ================= الخلفية الحيّة ================= */
/* بقع لون ناعمة (أزرق، أخضر، وذهبي الشعار) بتتحرك ببطء ورا المحتوى. transform بس، فما بتتعب الجهاز */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.ambient i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; will-change: transform; }
.ambient i:nth-child(1) { top: -22vmax; right: -12vmax; background: radial-gradient(closest-side, rgb(59 130 246 / 0.10), transparent); animation: drift-a 28s ease-in-out infinite alternate; }
.ambient i:nth-child(2) { bottom: -26vmax; left: -14vmax; background: radial-gradient(closest-side, rgb(16 185 129 / 0.08), transparent); animation: drift-b 34s ease-in-out infinite alternate; }
.ambient i:nth-child(3) { top: 28%; left: 30%; width: 38vmax; height: 38vmax; background: radial-gradient(closest-side, rgb(212 168 58 / 0.07), transparent); animation: drift-c 40s ease-in-out infinite alternate; }
html[data-theme="dark"] .ambient i:nth-child(1) { background: radial-gradient(closest-side, rgb(59 130 246 / 0.20), transparent); }
html[data-theme="dark"] .ambient i:nth-child(2) { background: radial-gradient(closest-side, rgb(16 185 129 / 0.14), transparent); }
html[data-theme="dark"] .ambient i:nth-child(3) { background: radial-gradient(closest-side, rgb(212 168 58 / 0.11), transparent); }
@keyframes drift-a { to { transform: translate(-14vmax, 12vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(16vmax, -10vmax) scale(1.1); } }
@keyframes drift-c { to { transform: translate(-12vmax, -14vmax) scale(0.85); } }
@media (max-width: 639px) { .ambient i:nth-child(3) { display: none; } }

/* ================= الحركات ================= */
/* دخول الصفحة (playPageEnter): الأقسام بتطلع وحدة ورا الثانية، وأول صفوف الجدول.
   backwards وبس، حتى بعد الحركة ما يضل أثر (طبقات فوق بعض بتغطي القوائم المنسدلة) */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } }
.page-enter > :not(.hidden):not(.page-stack),
.page-enter > .page-stack > :not(.hidden) { animation: rise-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.page-enter > .page-stack > :nth-child(1) { animation-delay: 60ms; } .page-enter > .page-stack > :nth-child(2) { animation-delay: 120ms; } .page-enter > .page-stack > :nth-child(3) { animation-delay: 180ms; } .page-enter > .page-stack > :nth-child(4) { animation-delay: 240ms; } .page-enter > .page-stack > :nth-child(5) { animation-delay: 300ms; } .page-enter > .page-stack > :nth-child(6) { animation-delay: 360ms; } .page-enter > .page-stack > :nth-child(7) { animation-delay: 420ms; }
.page-enter > :nth-child(2) { animation-delay: 55ms; } .page-enter > :nth-child(3) { animation-delay: 110ms; } .page-enter > :nth-child(4) { animation-delay: 165ms; } .page-enter > :nth-child(5) { animation-delay: 220ms; } .page-enter > :nth-child(6) { animation-delay: 275ms; } .page-enter > :nth-child(7) { animation-delay: 330ms; } .page-enter > :nth-child(8) { animation-delay: 385ms; }
.page-enter tbody tr:nth-child(-n+12) { animation: row-in 0.4s ease backwards; animation-delay: 140ms; }
.page-enter tbody tr:nth-child(2) { animation-delay: 168ms; }
.page-enter tbody tr:nth-child(3) { animation-delay: 196ms; }
.page-enter tbody tr:nth-child(4) { animation-delay: 224ms; }
.page-enter tbody tr:nth-child(5) { animation-delay: 252ms; }
.page-enter tbody tr:nth-child(6) { animation-delay: 280ms; }
.page-enter tbody tr:nth-child(7) { animation-delay: 308ms; }
.page-enter tbody tr:nth-child(8) { animation-delay: 336ms; }
.page-enter tbody tr:nth-child(9) { animation-delay: 364ms; }
.page-enter tbody tr:nth-child(10) { animation-delay: 392ms; }
.page-enter tbody tr:nth-child(11) { animation-delay: 420ms; }
.page-enter tbody tr:nth-child(12) { animation-delay: 448ms; }
#page-title.title-swap { animation: title-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes title-in { from { opacity: 0; transform: translateY(6px); } }

/* النوافذ: الخلفية بتظهر والنافذة بتنط لمكانها، وعند الإغلاق بتتلاشى (modal-leaving من closeModal) */
@keyframes modal-fade { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
@keyframes modal-fade-out { to { opacity: 0; } }
@keyframes modal-drop { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal:not(.hidden) { animation: modal-fade 0.22s ease backwards; }
.modal:not(.hidden) > * { animation: modal-pop 0.42s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.modal.hidden.modal-leaving { display: flex !important; pointer-events: none; animation: modal-fade-out 0.18s ease forwards; }
.modal.modal-leaving > * { animation: modal-drop 0.18s ease forwards !important; }
#login-screen:not(.hidden) form { animation: modal-pop 0.55s cubic-bezier(0.16, 1, 0.3, 1) backwards; }

/* القوائم الصغيرة */
@keyframes menu-pop { from { opacity: 0; transform: translateY(-6px) scale(0.96); } }
.user-menu:not(.hidden) { animation: menu-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1) backwards; transform-origin: top left; }
.mnav-more-menu:not(.hidden) { animation: rise-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) backwards; }

/* الأزرار: ضغطة خفيفة، وتموّج من مكان الضغطة على الملونة (onRipplePointer) */
button:not(:disabled):active { scale: 0.97; }
.ripple-wrap { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: 0.28; transform: scale(0); animation: ripple 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* البطاقات بترتفع شوي تحت الماوس */
.acc-card { transition: box-shadow 0.2s ease, border-color 0.2s ease, translate 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.trader-card { transition: border-color 0.2s ease, box-shadow 0.2s ease, translate 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); }
.acc-card:hover, .trader-card:hover { translate: 0 -3px; }
tbody tr { transition: background-color 0.15s ease; }

/* الخانات: هالة لما تكتب فيها */
.field { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.field:focus { box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15); }

/* القائمة الجانبية: خلفية الزر المختار بتنزلق لمكانه (moveNavIndicator) بنفس شكل .nav-item.active */
.nav-item { position: relative; z-index: 1; }
#nav-indicator { position: absolute; top: 0; right: 0.75rem; left: 0.75rem; margin: 0 !important; border-radius: 0.75rem; background-color: rgb(var(--b-blue-50, 239 246 255)); border-right: 3px solid #2563eb; opacity: 0; pointer-events: none; }
#nav-indicator.ready { opacity: 1; transition: transform 0.45s cubic-bezier(0.3, 1.25, 0.5, 1), height 0.3s ease; }
.has-indicator .nav-item.active { background-color: transparent; border-right-color: transparent; }
/* شريط الجوال: أيقونة الصفحة المختارة بتنط */
.mobile-nav-item.active svg { animation: nav-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes nav-pop { 40% { transform: translateY(-3px) scale(1.18); } }

/* بطاقة الحاسبة: وهج بيلف ببطء ورا الأرقام */
.calc-result { position: relative; overflow: hidden; isolation: isolate; }
.calc-result::before { content: ''; position: absolute; inset: -60%; z-index: -1; background: conic-gradient(from 0deg, transparent 0 62%, rgb(59 130 246 / 0.16) 74%, rgb(16 185 129 / 0.12) 84%, transparent 94%); animation: spin 16s linear infinite; pointer-events: none; }
/* حفظ ناجح: حلقة خضرا بتنتشر من الزر */
.save-btn.done { animation: save-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.save-btn.done::after { content: ''; position: absolute; inset: 0; border-radius: inherit; animation: ring-out 0.8s ease-out forwards; pointer-events: none; }
@keyframes save-pop { 40% { transform: scale(1.04); } }
@keyframes ring-out { from { box-shadow: 0 0 0 0 rgb(16 185 129 / 0.6); } to { box-shadow: 0 0 0 16px rgb(16 185 129 / 0); } }

/* سعر الشاشة بالهيدر: أخضر مع ▲ إذا طلع، أحمر مع ▼ إذا نزل (flashLiveRate) */
.live-card.rate-up .live-card-value { animation: rate-up 2.2s ease; }
.live-card.rate-down .live-card-value { animation: rate-down 2.2s ease; }
.live-card.rate-up .live-card-value::after,
.live-card.rate-down .live-card-value::after { font-size: 0.6rem; margin-inline-start: 0.2rem; animation: rate-arrow 2.2s ease forwards; }
.live-card.rate-up .live-card-value::after { content: '▲'; color: #10b981; }
.live-card.rate-down .live-card-value::after { content: '▼'; color: #f43f5e; }
@keyframes rate-up { 0%, 55% { color: #10b981; } }
@keyframes rate-down { 0%, 55% { color: #f43f5e; } }
@keyframes rate-arrow { 0% { opacity: 0; } 10%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* التنبيهات: الأيقونة بتنط، وخط تحت بيقصر مع الوقت المتبقي */
.toast-item { position: relative; overflow: hidden; }
.toast-item.show > :first-child { animation: toast-icon 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 0.12s backwards; }
@keyframes toast-icon { from { transform: scale(0.4) rotate(-20deg); opacity: 0; } }
.toast-item::after { content: ''; position: absolute; bottom: 0; right: 0; left: 0; height: 3px; background: var(--toast-c, #10b981); opacity: 0.55; transform-origin: right; animation: toast-timer var(--toast-ms, 3500ms) linear forwards; }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* الحركات موقفة (الإعدادات أو الجهاز): كل شي بيوصل لشكله الأخير فوراً */
html.motion-off *, html.motion-off *::before, html.motion-off *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
}
html.motion-off .ambient i, html.motion-off .calc-result::before { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
    .ambient i, .calc-result::before, .modal:not(.hidden), .modal:not(.hidden) > *, .toast-item.show > :first-child, .mobile-nav-item.active svg { animation: none !important; }
}

/* "⚙️ النسب / الشرائح": كرت الإعدادات اللي انفتح عليه بيلمع شوي (openSettingsCard) */
#usdt-settings, #egp-settings { scroll-margin-top: 5.5rem; }
.card-flash { animation: card-flash 1.6s ease-out; }
@keyframes card-flash {
    0%, 30% { box-shadow: 0 0 0 3px rgb(var(--c-blue-500, 59 130 246) / 0.55); }
    100% { box-shadow: 0 0 0 3px rgb(var(--c-blue-500, 59 130 246) / 0); }
}

/* مفتاح الحماية وكلمة سر الموظف: نص مخفي بنقاط مش type=password، حتى كروم ما يعتبر الصفحة كلها
   نموذج دخول ويطلب "حفظ كلمة السر" كل ما تنحفظ حوالة (كان بالجوال مع كل رقم) */
.masked-input { -webkit-text-security: disc; }

/* ================= خدمات التجار (traders.js) ================= */
/* تبويب الخدمات بحساب التاجر: كرت لكل خدمة، وجدول عمولته */
.tsv-card { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; border-radius: 1rem; border: 1px solid rgb(var(--c-slate-200, 226 232 240)); background: rgb(var(--b-white, 255 255 255)); }
.tsv-tiers { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 1.5rem; row-gap: 0.3rem; font-size: 0.85rem; color: rgb(var(--t-slate-600, 71 85 105)); }
.tsv-tiers b { color: rgb(var(--t-slate-900, 15 23 42)); font-family: 'Cairo', sans-serif; }

/* نافذة الخدمة: سطر لكل شريحة، ومربع لصق رسالة التاجر */
/* شبكة بسطر واحد حتى على الجوال: لحد [المبلغ] $ ← [النسبة] % + [الثابت] $ ✕ */
.sv-tier { display: grid; grid-template-columns: 2.1rem minmax(0, 1.35fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto 1.2rem; align-items: center; gap: 0.3rem; }
.sv-paste { padding: 0.65rem 0.75rem; border-radius: 0.75rem; border: 1px dashed rgb(var(--c-slate-300, 203 213 225)); background: rgb(var(--b-slate-50, 248 250 252)); }
