/* ═══════════════════════════════════════════════════════════════════
   store-dashboard.css — لوحة المتجر.

   الترتيب البصري يتبع ترتيب القرار: حالات الطلبات أولا لأن «طلب ينتظر»
   هو ما يستدعي فعلا، ثم المال، ثم اللوحات. ولكل بطاقة حالة لونها الخاص
   فتُميَّز بلمحة قبل قراءة رقمها.

   البادئة sd- (store dashboard).
   ═══════════════════════════════════════════════════════════════════ */

.sd {
    --sd-ink: #0f172a;
    --sd-mut: #64748b;
    --sd-faint: #94a3b8;
    --sd-line: #e6ebf1;
    --sd-hair: #f1f5f9;
    --sd-bg: #f7f9fc;
    --sd-green: #047857;
    --sd-green-d: #065f46;
    --sd-mint: #ecfdf5;

    color: var(--sd-ink);
    padding-bottom: 1.5rem;
}

/* ─────────── الترويسة ─────────── */
.sd-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--sd-line);
    border-radius: 15px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.1rem;
}

.sd-head__id { display: flex; align-items: center; gap: .85rem; min-width: 0; flex: 1 1 260px; }

.sd-head__logo {
    inline-size: 52px;
    block-size: 52px;
    flex: none;
    border-radius: 14px;
    background: var(--sd-mint);
    color: var(--sd-green);
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    overflow: hidden;
}

.sd-head__logo img { inline-size: 100%; block-size: 100%; object-fit: cover; }

.sd-head h1 { margin: 0; font-size: 1.25rem; font-weight: 800; line-height: 1.3; }

.sd-head__meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .25rem; }

.sd-head__meta a {
    font-size: .82rem;
    color: var(--sd-green);
    text-decoration: none;
    font-weight: 700;
    direction: ltr;
}

.sd-head__meta a:hover { text-decoration: underline; }
.sd-head__end { display: flex; gap: .5rem; flex-wrap: wrap; margin-inline-start: auto; }

.sd-tag {
    font-size: .72rem;
    font-weight: 800;
    border-radius: 99px;
    padding: .1rem .6rem;
}

.sd-tag--on { background: var(--sd-mint); color: var(--sd-green); }
.sd-tag--off { background: var(--sd-hair); color: var(--sd-mut); }

/* ─────────── الأزرار ─────────── */
.sd-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-block-size: 40px;
    padding: 0 1rem;
    border: 1px solid var(--sd-line);
    border-radius: 10px;
    background: #fff;
    color: var(--sd-ink);
    font-size: .88rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.sd-btn:hover { background: var(--sd-bg); color: var(--sd-ink); }

.sd-btn--solid {
    background: var(--sd-green);
    border-color: var(--sd-green);
    color: #fff;
}

.sd-btn--solid:hover { background: var(--sd-green-d); color: #fff; }
.sd-btn--sm { min-block-size: 34px; font-size: .82rem; padding: 0 .85rem; }

/* ─────────── قائمة الإنجاز ─────────── */
.sd-setup {
    background: linear-gradient(135deg, #052e26, #065f46);
    border-radius: 15px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.1rem;
    color: #fff;
}

.sd-setup__h { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.sd-setup__h b { font-size: 1rem; font-weight: 800; display: block; }
.sd-setup__h span { font-size: .8rem; color: #a7f3d0; }

.sd-setup__bar {
    flex: 1 1 160px;
    block-size: 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .18);
    overflow: hidden;
    min-inline-size: 120px;
}

.sd-setup__bar span { display: block; block-size: 100%; background: #6ee7b7; border-radius: 99px; transition: width .4s; }

.sd-setup__steps { display: flex; gap: .5rem; flex-wrap: wrap; }

.sd-step {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    background: rgba(255, 255, 255, .11);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    padding: .45rem .85rem;
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: background .15s;
}

.sd-step:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.sd-step i { font-size: .95rem; }

/* المنجَز يهدأ: ما بقي هو ما يجب أن يُرى */
.sd-step--done { opacity: .55; }
.sd-step--done i { color: #6ee7b7; }

/* ─────────── بطاقات الحالات ─────────── */
.sd-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.sd-kpi {
    display: flex;
    align-items: center;
    gap: .7rem;
    background: #fff;
    border: 1px solid var(--sd-line);
    border-radius: 14px;
    padding: .85rem .95rem;
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}

.sd-kpi:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .07);
    color: inherit;
}

.sd-kpi__ico {
    inline-size: 42px;
    block-size: 42px;
    flex: none;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.12rem;
}

.sd-kpi__b { display: flex; flex-direction: column; min-width: 0; }
.sd-kpi__l { font-size: .78rem; font-weight: 700; color: var(--sd-mut); }

.sd-kpi__v {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

/* ─────────── المال ─────────── */
.sd-money {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.sd-mcard {
    background: linear-gradient(135deg, #fff 0%, #f7fbf9 100%);
    border: 1px solid #d9f0e6;
    border-radius: 14px;
    padding: .95rem 1.1rem;
}

.sd-mcard__l { display: block; font-size: .8rem; font-weight: 700; color: var(--sd-mut); }

.sd-mcard__v {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--sd-green-d);
    line-height: 1.25;
    margin-top: .1rem;
    font-variant-numeric: tabular-nums;
}

.sd-mcard__v small { font-size: .82rem; font-weight: 700; color: var(--sd-mut); }
.sd-mcard__s { display: block; font-size: .73rem; color: var(--sd-faint); margin-top: .18rem; }

/* ─────────── اللوحات ─────────── */
.sd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1rem;
}

.sd-panel {
    background: #fff;
    border: 1px solid var(--sd-line);
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sd-panel__h {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem 1.05rem;
    border-bottom: 1px solid var(--sd-hair);
    background: linear-gradient(180deg, #fcfdff, #f8fafc);
}

.sd-panel__h b { font-size: .93rem; font-weight: 800; display: flex; align-items: center; gap: .45rem; }
.sd-panel__h b i { color: var(--sd-green); }

.sd-panel__h a {
    margin-inline-start: auto;
    font-size: .8rem;
    font-weight: 700;
    color: var(--sd-green);
    text-decoration: none;
}

.sd-panel__h a:hover { text-decoration: underline; }

.sd-panel__b { padding: .9rem 1.05rem; flex: 1; }
.sd-panel__b--flush { padding: 0; }

/* ─────────── صفّ عام (تصنيف أو منتج) ─────────── */
.sd-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--sd-hair);
    text-decoration: none;
    color: inherit;
}

.sd-row:last-child { border-bottom: 0; }
.sd-row--link:hover { color: inherit; }
.sd-row--link:hover .sd-row__b b { color: var(--sd-green); }

.sd-row__img {
    inline-size: 40px;
    block-size: 40px;
    flex: none;
    border-radius: 10px;
    background: var(--sd-hair);
    color: var(--sd-faint);
    display: grid;
    place-items: center;
    overflow: hidden;
    font-size: .95rem;
}

.sd-row__img img { inline-size: 100%; block-size: 100%; object-fit: cover; }

.sd-row__b { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.sd-row__b b {
    font-size: .89rem;
    font-weight: 700;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sd-row__b small { font-size: .74rem; color: var(--sd-faint); }

.sd-row__v {
    font-size: .89rem;
    font-weight: 800;
    color: var(--sd-ink);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sd-mini { border-radius: 99px; padding: .04rem .45rem; font-size: .68rem; font-weight: 800; }
.sd-mini--warn { background: #fffbeb; color: #b45309; }
.sd-mini--off { background: var(--sd-hair); color: var(--sd-mut); }

/* ─────────── صفّ الطلب ─────────── */
.sd-order {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: .6rem;
    padding: .7rem 1.05rem;
    border-bottom: 1px solid var(--sd-hair);
    text-decoration: none;
    color: inherit;
    transition: background .14s;
}

.sd-order:last-child { border-bottom: 0; }
.sd-order:hover { background: #f8fafc; color: inherit; }

.sd-order__n {
    font-size: .78rem;
    font-weight: 800;
    color: var(--sd-green);
    direction: ltr;
    white-space: nowrap;
}

.sd-order__c {
    font-size: .85rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sd-order__v { font-size: .86rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sd-st { font-size: .7rem; font-weight: 800; border-radius: 99px; padding: .1rem .55rem; white-space: nowrap; }
.sd-st--pending { background: #fff7ed; color: #c2410c; }
.sd-st--confirmed { background: #eff6ff; color: #1d4ed8; }
.sd-st--packed { background: #f5f3ff; color: #6d28d9; }
.sd-st--shipped { background: #ecfeff; color: #0e7490; }
.sd-st--delivered { background: #ecfdf5; color: #047857; }
.sd-st--cancelled { background: #fef2f2; color: #b91c1c; }
.sd-st--returned { background: #f1f5f9; color: #475569; }

/* ─────────── أعمدة الإيراد ─────────── */
.sd-bars { display: flex; align-items: flex-end; gap: .5rem; block-size: 160px; }

.sd-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    block-size: 100%;
    gap: .35rem;
}

.sd-bar__fill {
    inline-size: 100%;
    background: linear-gradient(180deg, #10b981, #047857);
    border-radius: 7px 7px 3px 3px;
    min-block-size: 4px;
    transition: height .4s;
}

.sd-bar__d { font-size: .68rem; color: var(--sd-faint); white-space: nowrap; }

/* ─────────── الفراغ ─────────── */
.sd-none {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    padding: 1.7rem 1rem;
    color: var(--sd-faint);
    font-size: .86rem;
    text-align: center;
}

.sd-none i { font-size: 1.7rem; opacity: .5; }

.sd-empty-state {
    text-align: center;
    padding: 3.5rem 1.2rem;
    color: var(--sd-mut, #64748b);
}

.sd-empty-state i { font-size: 3rem; color: #a7f3d0; display: block; margin-bottom: .9rem; }
.sd-empty-state h3 { font-size: 1.2rem; font-weight: 800; color: #0f172a; margin: 0 0 .4rem; }
.sd-empty-state p { margin: 0 0 1.2rem; font-size: .93rem; }

/* ─────────── هيكل الانتظار ─────────── */
.sd-skel { display: flex; flex-direction: column; gap: 1rem; }

.sd-skel__row, .sd-skel__big {
    background: linear-gradient(90deg, #f1f5f9 25%, #e8eef5 37%, #f1f5f9 63%);
    background-size: 400% 100%;
    animation: sd-sh 1.3s ease-in-out infinite;
    border-radius: 14px;
}

.sd-skel__row { block-size: 92px; }
.sd-skel__big { block-size: 300px; }

@keyframes sd-sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
    .sd-skel__row, .sd-skel__big { animation: none; }
    .sd-kpi:hover { transform: none; }
}

@media (max-width: 640px) {
    .sd-order { grid-template-columns: 1fr auto; gap: .35rem .6rem; }
    .sd-order__n { grid-column: 1 / -1; }
    .sd-bars { block-size: 130px; }
}

/* ═══════════════════════════════════════════════════════════════════
   إعدادات المتجر: أقسام في عمود وقائمة جانبية لاصقة.

   التبويبات كانت تخفي ثلثي الإعداد خلف نقرة، فيظن التاجر أنه أنهى وقد
   بقي أكثره. العمود يعرض كل شيء، والقائمة تقول أين هو وأين بقي.
   ═══════════════════════════════════════════════════════════════════ */

.ess-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 1.15rem;
    align-items: start;
}

@media (max-width: 1000px) {
    .ess-shell { grid-template-columns: 1fr; }
    .ess-nav { position: static !important; }
}

/* ─────────── القائمة الجانبية ─────────── */
.ess-nav {
    position: sticky;
    top: 1rem;
    background: #fff;
    border: 1px solid #e6ebf1;
    border-radius: 15px;
    padding: .7rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.ess-nav__h {
    font-size: .74rem;
    font-weight: 800;
    color: #94a3b8;
    padding: .4rem .6rem .5rem;
    letter-spacing: .02em;
}

.ess-nav__i {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .6rem .65rem;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    transition: background .15s, color .15s;
}

.ess-nav__i:hover { background: #f0fdf6; color: #047857; }
.ess-nav__i i { font-size: .98rem; color: #047857; margin-top: .15em; flex: none; }
.ess-nav__i span { display: flex; flex-direction: column; min-width: 0; }
.ess-nav__i b { font-size: .87rem; font-weight: 700; line-height: 1.4; }
.ess-nav__i small { font-size: .72rem; color: #94a3b8; line-height: 1.45; }

.ess-nav__sep { block-size: 1px; background: #eef2f7; margin: .55rem .3rem; }

/* ─────────── حالة النشر ─────────── */
.ess-pub { padding: .3rem .6rem .5rem; }
.ess-pub__row { display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem; }
.ess-pub__row b { font-size: .87rem; font-weight: 800; }

.ess-dot { inline-size: 9px; block-size: 9px; border-radius: 50%; flex: none; }
.ess-dot.on { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.ess-dot.off { background: #cbd5e1; }

.ess-pub p { font-size: .74rem; color: #94a3b8; line-height: 1.6; margin: 0 0 .65rem; }

.ess-pub__btn {
    inline-size: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-block-size: 38px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: .85rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.ess-pub__btn.on { background: #047857; color: #fff; }
.ess-pub__btn.on:hover { background: #065f46; }
.ess-pub__btn.off { background: #fff; border-color: #e6ebf1; color: #b91c1c; }
.ess-pub__btn.off:hover { background: #fef2f2; }

.ess-pub__link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    margin-top: .45rem;
    font-size: .78rem;
    font-weight: 700;
    color: #047857;
    text-decoration: none;
}

.ess-pub__link:hover { text-decoration: underline; }

/* ─────────── الأقسام ─────────── */
.ess-main { display: flex; flex-direction: column; gap: 1.1rem; }

.ess-card {
    background: #fff;
    border: 1px solid #e6ebf1;
    border-radius: 15px;
    overflow: hidden;
    scroll-margin-top: 1rem;
}

.ess-card__h {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #fcfdff, #f8fafc);
}

.ess-card__h > i { font-size: 1.1rem; color: #047857; flex: none; }
.ess-card__h div { display: flex; flex-direction: column; min-width: 0; }
.ess-card__h b { font-size: .98rem; font-weight: 800; color: #0f172a; }
.ess-card__h small { font-size: .75rem; color: #94a3b8; }

/* زرّ الحفظ في رأس قسمه: لا ينزل التاجر ليبحث عنه أسفل الصفحة */
.ess-save {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-block-size: 36px;
    padding: 0 1rem;
    border: 0;
    border-radius: 9px;
    background: #047857;
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}

.ess-save:hover:not(:disabled) { background: #065f46; }
.ess-save:disabled { opacity: .6; cursor: not-allowed; }

.ess-card__b { padding: 1.15rem; }

/* الحقول داخل الأقسام تتبع نفس الإيقاع */
.ess-card__b .form-label { font-size: .82rem; font-weight: 700; color: #475569; margin-bottom: .3rem; }
.ess-card__b .form-control,
.ess-card__b .form-select { border-radius: 10px; border-color: #e6ebf1; min-block-size: 42px; font-size: .92rem; }
.ess-card__b .form-control:focus,
.ess-card__b .form-select:focus { border-color: #047857; box-shadow: 0 0 0 3px rgba(4, 120, 87, .12); }

/* البطاقة القديمة داخل القسم تفقد إطارها: القسم يحملها الآن */
.ess-card__b .ec-card {
    box-shadow: none;
    padding: 0;
    margin: 0;
    background: transparent;
}

/* تذييل الحفظ القديم يختفي: الحفظ صار في رأس كل قسم */
.ess-card__b .ec-form-footer { display: none; }

/* ─────────── بطاقة الباقة ───────────
   تُعرض على المجاني وحده. تقول ما يملكه أولا — فالمجاني كريم فعلا —
   ثم ما يفتحه الترقّي. البدء بالنقص يُقرأ ابتزازا لا دعوة. */
.sd-plan {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 60%);
    border: 1px solid #fde68a;
    border-radius: 15px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.1rem;
}

.sd-plan__b { flex: 1 1 320px; min-width: 0; }

.sd-plan__tag {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #fef3c7;
    color: #b45309;
    border-radius: 99px;
    padding: .12rem .65rem;
    font-size: .75rem;
    font-weight: 800;
    margin-bottom: .35rem;
}

.sd-plan__b b { display: block; font-size: .98rem; font-weight: 800; color: #0f172a; }
.sd-plan__b p { margin: .22rem 0 0; font-size: .82rem; color: #78350f; line-height: 1.7; }

.sd-plan__cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #b45309;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    padding: .7rem 1.4rem;
    font-size: .88rem;
    font-weight: 800;
    white-space: nowrap;
    margin-inline-start: auto;
    transition: background .15s;
}

.sd-plan__cta:hover { background: #92400e; color: #fff; }

/* ═══════════════════════════════════════════════════════════════════
   بوّابة الباقة: الميزة تُرى مقفلة لا مخفيّة.

   من لا يعرف ما ينقصه لا يرقّي. فالبطاقة تسمّي الميزة وتقول ما تفعله،
   ثم تدعو — بلا لوم ولا إلحاح.
   ═══════════════════════════════════════════════════════════════════ */
.pg {
    background: #fff;
    border: 1px solid #e6ebf1;
    border-radius: 16px;
    padding: 2.6rem 1.6rem;
    text-align: center;
    max-inline-size: 560px;
    margin-inline: auto;
}

.pg__ico {
    inline-size: 64px;
    block-size: 64px;
    margin: 0 auto 1.1rem;
    border-radius: 18px;
    background: #fffbeb;
    color: #b45309;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
}

.pg h2 { font-size: 1.25rem; font-weight: 800; color: #0f172a; margin: 0 0 .5rem; }
.pg p { font-size: .94rem; color: #64748b; line-height: 1.85; margin: 0 0 1.3rem; }

.pg__list {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    text-align: start;
    display: grid;
    gap: .5rem;
}

.pg__list li {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .9rem;
    color: #334155;
    line-height: 1.6;
}

.pg__list i { color: #047857; font-weight: 800; flex: none; margin-top: .14em; }

.pg__cta { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; }

.pg__btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #b45309;
    color: #fff;
    text-decoration: none;
    border-radius: 11px;
    padding: .85rem 1.9rem;
    font-size: .95rem;
    font-weight: 800;
    transition: background .15s;
}

.pg__btn:hover { background: #92400e; color: #fff; }
.pg__link { font-size: .88rem; font-weight: 700; color: #047857; text-decoration: underline; }
.pg__note { display: block; margin-top: 1.1rem; font-size: .78rem; color: #94a3b8; }
.pg__note b { color: #475569; }
