/* ═══════════════════════════════════════════════════════════════════
   dashboard-x.css — (2026-12-03 المالك: «أقصى درجة من الانبهار فى التصميم») شكل الرئيسية الجديد
   ▸ فوق dashboard.css ، وكله تحت .db-page.dbx — الرجوع للقديم = شيل الكلاس dbx من Home.razor
   ▸ حاجة واحدة جريئة: الشريط الرئيسى بلون الثيم ، فى خلفيته منحنى مبيعات السنة الحقيقى بيترسم ، والأرقام بتعدّ
   ▸ الباقى هادى: كروت بيضا بظل خفيف ، والتبويبات الملوّنة من fs-tabs.css
   ▸ الحركة مرة واحدة مع تحميل البيانات (.is-live من dashboardFx.js) ، و«تقليل الحركة» بيلغيها
   ▸ الألوان من الثيم (--fs-primary / --fs-primary-deep) — مفيش برتقالى ثابت
   ═══════════════════════════════════════════════════════════════════ */

html body .db-page.dbx {
    --dbx-ink: #0B2A33;
    --dbx-mute: #5B7780;
    --dbx-line: #E3ECEF;
    --dbx-card-sh: 0 1px 2px rgba(11, 42, 51, .05), 0 8px 24px -12px rgba(11, 42, 51, .14);
    --dbx-sales: #FFFFFF;
    --dbx-purchase: #A78BFA;
    --dbx-receipt: #34D399;
    --dbx-payment: #FB7185;
    background: #F3F7F8;
}

/* ══ الشريط الرئيسى ══ */
html body .dbx .dbx-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0 0 16px;
    padding: 22px 24px 20px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--fs-primary) 70%, #fff) 0%, transparent 55%),
        linear-gradient(135deg, var(--fs-primary) 0%, var(--fs-primary-deep, var(--fs-primary)) 100%);
    box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--fs-primary) 80%, #000);
}
/* شبكة نقط خفيفة — بتدّى عمق من غير زحمة */
html body .dbx .dbx-hero::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.2px);
    background-size: 18px 18px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
/* بقعتين ضوء بيتحركوا ببطء شديد (16 و 22 ثانية) */
html body .dbx .dbx-glow {
    position: absolute; z-index: -1; border-radius: 50%; filter: blur(48px); pointer-events: none;
}
html body .dbx .dbx-glow-a { width: 340px; height: 340px; top: -150px; inset-inline-start: 18%; background: rgba(255, 255, 255, .20); animation: dbxDrift 16s ease-in-out infinite alternate; }
html body .dbx .dbx-glow-b { width: 260px; height: 260px; bottom: -150px; inset-inline-end: 8%; background: color-mix(in srgb, var(--dbx-purchase) 55%, transparent); animation: dbxDrift 22s ease-in-out infinite alternate-reverse; }
@keyframes dbxDrift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(60px, 24px, 0) scale(1.15); } }

/* منحنى مبيعات السنة */
html body .dbx .dbx-curve { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
html body .dbx .dbx-curve-line { fill: none; stroke: rgba(255, 255, 255, .7); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .45)); }
html body .dbx.is-live .dbx-curve-line { stroke-dasharray: 1; animation: dbxDraw 1.8s cubic-bezier(.65, 0, .35, 1) both; }
/* (2026-12-03) أعلى يوم مبيعات: نقطة بتنبض على المنحنى + سطر تحت الترحيب */
html body .dbx .dbx-peak { position: absolute; z-index: -1; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25), 0 0 16px rgba(255, 255, 255, .8); pointer-events: none; }
html body .dbx .dbx-peak::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #fff; animation: dbxPing 2.2s cubic-bezier(0, 0, .2, 1) infinite; }
html body .dbx.is-live .dbx-peak { animation: dbxFade .6s 1.6s ease-out both; }
html body .dbx .dbx-peak-t { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 6px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .85); }
html body .dbx .dbx-peak-t b { color: #fff; font-weight: 800; }
html body .dbx .dbx-peak-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
@keyframes dbxPing { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3); opacity: 0; } }
html body .dbx.is-live .dbx-curve-area { animation: dbxFade 1.2s .6s ease-out both; }
@keyframes dbxDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes dbxFade { from { opacity: 0; } to { opacity: 1; } }

/* التحية والتاريخ */
html body .dbx .dbx-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
html body .dbx .dbx-hello { display: flex; align-items: center; gap: 12px; min-width: 0; }
html body .dbx .dbx-hello-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); font-size: 23px; backdrop-filter: blur(6px); }
html body .dbx .dbx-hello-t { margin: 0; font-size: clamp(19px, 1.2vw + 12px, 26px); font-weight: 800; line-height: 1.25; color: #fff; letter-spacing: 0; }
html body .dbx .dbx-hello-s { margin: 2px 0 0; font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .82); }
html body .dbx .db-date-wrap.dbx-date { background: rgba(255, 255, 255, .14) !important; border: 1px solid rgba(255, 255, 255, .32) !important; border-radius: 14px !important; backdrop-filter: blur(8px); color: #fff; }
html body .dbx .db-date-wrap.dbx-date:focus-within { border-color: #fff !important; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
html body .dbx .dbx-date .db-date-ico { color: #fff; }
html body .dbx .dbx-date .db-date-input { color: #fff !important; background: transparent !important; font-weight: 700; }

/* الأرقام الأربعة — كروت زجاج على الشريط */
html body .dbx .dbx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
html body .dbx .dbx-kpi {
    --k: var(--dbx-sales);
    position: relative; overflow: hidden;
    display: flex; align-items: flex-start; gap: 12px; min-width: 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .11);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
html body .dbx .dbx-k-purchase { --k: var(--dbx-purchase); }
html body .dbx .dbx-k-receipt { --k: var(--dbx-receipt); }
html body .dbx .dbx-k-payment { --k: var(--dbx-payment); }
/* خط لونى رفيع فوق كل كارت = لون نوعه */
html body .dbx .dbx-kpi::after { content: ""; position: absolute; inset: 0 16px auto 16px; height: 3px; border-radius: 0 0 3px 3px; background: var(--k); opacity: .9; }
html body .dbx .dbx-kpi:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .34); }
html body .dbx .dbx-kpi-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; color: var(--k); background: color-mix(in srgb, var(--k) 20%, transparent); border: 1px solid color-mix(in srgb, var(--k) 35%, transparent); }
html body .dbx .dbx-k-sales .dbx-kpi-ic { color: var(--fs-primary-deep, var(--fs-primary)); background: #fff; border-color: #fff; }
html body .dbx .dbx-kpi-b { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
html body .dbx .dbx-kpi-l { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .85); }
html body .dbx .dbx-kpi-v { font-size: clamp(18px, .9vw + 10px, 24px); font-weight: 800; line-height: 1.2; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
html body .dbx .dbx-kpi-v small { font-size: .58em; font-weight: 700; opacity: .8; }
html body .dbx .dbx-kpi-s { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .74); }
html body .dbx .dbx-kpi-s bdi { color: rgba(255, 255, 255, .92); }
html body .dbx .dbx-kpi-a { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff !important; font-weight: 700; text-decoration: none; }
html body .dbx .dbx-kpi-a:hover { background: rgba(255, 255, 255, .28); }
html body .dbx .dbx-kpi-a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* حركة الفتح: الكروت بتطلع ورا بعض */
html body .dbx.is-live .dbx-kpi { animation: dbxRise .7s cubic-bezier(.2, .8, .2, 1) both; }
html body .dbx.is-live .dbx-kpi:nth-child(2) { animation-delay: .08s; }
html body .dbx.is-live .dbx-kpi:nth-child(3) { animation-delay: .16s; }
html body .dbx.is-live .dbx-kpi:nth-child(4) { animation-delay: .24s; }
@keyframes dbxRise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ══ الكروت تحت الشريط ══ */
html body .dbx .db-card { border: 1px solid var(--dbx-line) !important; border-radius: 18px !important; box-shadow: var(--dbx-card-sh) !important; overflow: hidden; background: #fff; }
html body .dbx .db-card-head { background: #fff !important; border-bottom: 1px solid var(--dbx-line) !important; padding: 13px 16px !important; }
html body .dbx .db-card-title { font-size: 15px !important; font-weight: 800 !important; color: var(--dbx-ink) !important; gap: 10px !important; }
html body .dbx .db-card-title > i { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-size: 17px; color: var(--fs-primary); background: var(--fs-tint-1, #EEF7F9); }
html body .dbx .db-legend-sales { background: var(--fs-primary) !important; }
html body .dbx .db-legend-purchase { background: #7C3AED !important; }
html body .dbx .db-year-btn { border-radius: 10px !important; font-weight: 700; }

/* قوايم المنتجات */
html body .dbx .db-prod-row { gap: 10px; border-radius: 12px; }
html body .dbx .db-prod-img { border-radius: 10px !important; }
html body .dbx .db-prod-name { font-weight: 800; color: var(--dbx-ink); }
/* ترتيب الأكثر مبيعًا: الأول دهبى والتانى فضى والتالت برونزى */
html body .dbx .dbx-rank { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; font-weight: 800; color: var(--dbx-mute); background: #EEF3F5; font-variant-numeric: tabular-nums; }
html body .dbx .dbx-rank-1 { color: #7A5300; background: linear-gradient(135deg, #FDE68A, #F5C542); box-shadow: 0 2px 8px -2px rgba(245, 197, 66, .7); }
html body .dbx .dbx-rank-2 { color: #44525A; background: linear-gradient(135deg, #F1F5F9, #CBD5E1); }
html body .dbx .dbx-rank-3 { color: #6B3A16; background: linear-gradient(135deg, #F3C9A5, #D69A6B); }
/* شريط الرصيد من الحد الأدنى */
html body .dbx .dbx-meter { display: block; height: 5px; margin-top: 6px; border-radius: 99px; background: #EEF3F5; overflow: hidden; max-width: 180px; }
html body .dbx .dbx-meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F59E0B, #FBBF24); }
html body .dbx .dbx-meter.is-bad > i { background: linear-gradient(90deg, #DC2626, #F87171); }
html body .dbx.is-live .dbx-meter > i { animation: dbxGrow 1s .3s cubic-bezier(.2, .8, .2, 1) both; transform-origin: right center; }
html[dir="ltr"] body .dbx.is-live .dbx-meter > i { transform-origin: left center; }
@keyframes dbxGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ══ المعاملات الأخيرة: التبويبات الملوّنة (fs-tabs.css) على شريط فاتح ══ */
html body .dbx .db-tabs.fs-ctabs { display: flex; gap: 6px; padding: 6px !important; margin: 12px 16px 0; border: 1px solid var(--fs-tint-3, #DDEFF3) !important; border-radius: 14px; background: var(--fs-tint-1, #F4FAFB) !important; overflow-x: auto; scrollbar-width: none; }
html body .dbx .db-tabs.fs-ctabs .db-tab { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 0; justify-content: center; min-height: 44px; padding: 6px 12px !important; border: 1px solid transparent !important; border-radius: 10px !important; background: #fff; color: var(--fs-primary-deep, var(--dbx-ink)) !important; font-family: inherit; font-size: 13.5px; font-weight: 800; white-space: nowrap; box-shadow: 0 1px 2px rgba(11, 42, 51, .07); cursor: pointer; }
html body .dbx .db-tabs.fs-ctabs .db-tab i.fs-ct-ic { width: 28px; height: 28px; font-size: 16px; }
html body .dbx .db-tabpane.active { animation: dbxPane .28s ease-out both; }
@keyframes dbxPane { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html body .dbx .db-tbl thead th { background: #F6FAFB !important; color: var(--dbx-mute) !important; font-weight: 800 !important; }
html body .dbx .db-tbl-amt { font-variant-numeric: tabular-nums; }

/* ══ الجوال ══ */
@media (max-width: 1100px) {
    html body .dbx .dbx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    html body .dbx .dbx-hero { padding: 16px 14px 14px; border-radius: 18px; margin-bottom: 12px; }
    html body .dbx .dbx-hero-top { margin-bottom: 14px; }
    html body .dbx .dbx-hello-ico { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
    html body .dbx .dbx-hello-s { display: none; }
    html body .dbx .dbx-date { width: 100%; }
    html body .dbx .dbx-date .fs-dr-s b:not(#_) { font-size: 12.5px !important; white-space: nowrap; }   /* التاريخ التانى كان بيتقص تحت شارة «22 يوم» */
    html body .dbx .dbx-kpis { gap: 8px; }
    html body .dbx .dbx-kpi { flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; }
    html body .dbx .dbx-kpi-ic { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
    html body .dbx .dbx-kpi-v { font-size: 17px; }
    html body .dbx .dbx-kpi-s { font-size: 11px; }
    html body .dbx .dbx-glow-a { width: 220px; height: 220px; }
    html body .dbx .db-tabs.fs-ctabs { margin: 10px 10px 0; }
    html body .dbx .db-tabs.fs-ctabs .db-tab { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
    html body .dbx .dbx-glow, html body .dbx.is-live .dbx-curve-line, html body .dbx.is-live .dbx-curve-area,
    html body .dbx.is-live .dbx-kpi, html body .dbx.is-live .dbx-meter > i, html body .dbx .db-tabpane.active,
    html body .dbx .dbx-peak, html body .dbx .dbx-peak::after { animation: none !important; }
    html body .dbx .dbx-kpi { transition: none; }
}
