/* ==========================================================================
   Noora UI — Design System (mobile-first)
   --------------------------------------------------------------------------
   لایهٔ روییِ Bootstrap 5 RTL. ترتیب بارگذاری:
     bootstrap.rtl.min.css  →  app.css (قدیمی)  →  ui.css (این فایل)
   کلاس‌های قدیمی (.vstore-nav, .app-bottom-nav, .panel-card, ...) عمداً
   بازطراحی شده‌اند تا همهٔ صفحه‌ها بدون تغییر مارک‌آپ، ظاهر جدید بگیرند.
   ========================================================================== */

/* ------------------------------ 1) فونت ---------------------------------- */
@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
    font-weight: 500 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------ 2) توکن‌ها -------------------------------- */
:root {
    /* رنگ برند */
    --ui-navy: #0b1220;
    --ui-navy-2: #101a2e;
    --ui-navy-3: #16243d;
    --ui-teal: #14b8a6;
    --ui-teal-2: #2dd4bf;
    --ui-cyan: #22d3ee;
    --ui-sky: #0ea5e9;

    /* سطح‌ها */
    --ui-bg: #eef2f9;
    --ui-bg-2: #f7f9fd;
    --ui-card: #ffffff;
    --ui-card-2: #f8fafc;
    --ui-glass: rgba(255, 255, 255, 0.72);
    --ui-glass-dark: rgba(11, 18, 32, 0.66);

    /* متن و خط */
    --ui-ink: #0b1220;
    --ui-ink-2: #243044;
    --ui-muted: #64748b;
    --ui-muted-2: #94a3b8;
    --ui-line: #e4e9f2;
    --ui-line-2: #d3dced;

    /* وضعیت */
    --ui-success: #0f9d76;
    --ui-success-soft: #e6f7f1;
    --ui-danger: #e11d48;
    --ui-danger-soft: #fdeaef;
    --ui-warn: #d97706;
    --ui-warn-soft: #fdf3e2;
    --ui-info: #0284c7;
    --ui-info-soft: #e6f4fd;

    /* فرم و شعاع */
    --ui-radius-sm: 12px;
    --ui-radius: 18px;
    --ui-radius-lg: 26px;
    --ui-radius-pill: 999px;

    /* سایه */
    --ui-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --ui-shadow-sm: 0 4px 14px -6px rgba(15, 23, 42, 0.16);
    --ui-shadow: 0 16px 36px -18px rgba(15, 23, 42, 0.28);
    --ui-shadow-lg: 0 28px 70px -28px rgba(11, 18, 32, 0.45);
    --ui-glow: 0 10px 30px -12px rgba(20, 184, 166, 0.55);

    /* فاصله‌گذاری */
    --ui-gap-1: 4px;
    --ui-gap-2: 8px;
    --ui-gap-3: 12px;
    --ui-gap-4: 16px;
    --ui-gap-5: 20px;
    --ui-gap-6: 28px;

    /* اندازه‌های شِل */
    --ui-appbar-h: 56px;
    --ui-bottomnav-h: 62px;
    --ui-safe-top: env(safe-area-inset-top, 0px);
    --ui-safe-bottom: env(safe-area-inset-bottom, 0px);
    --ui-content-max: 1120px;

    /* تایپوگرافی */
    --font-sans: "Vazirmatn", "IRANSans", "IRANSansNumbers", system-ui, -apple-system, sans-serif;

    /* سازگاری با JS قدیمی (updateAppFloatingSpaces) */
    --vstore-nav-height: 56px;
    --app-bottom-nav-space: 0px;
    --sticky-submit-bar-space: 0px;
}

/* ------------------------------ 3) پایه ---------------------------------- */
* {
    font-family: var(--font-sans);
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(1100px 380px at 88% -160px, rgba(20, 184, 166, 0.18), transparent 60%),
        radial-gradient(900px 340px at 8% -140px, rgba(14, 165, 233, 0.14), transparent 62%),
        var(--ui-bg);
    color: var(--ui-ink);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.9;
    min-height: 100vh;
    padding-top: calc(var(--vstore-nav-height) + var(--ui-safe-top));
    padding-bottom: calc(var(--app-bottom-nav-space) + var(--ui-safe-bottom) + 8px);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

body.has-app-bottom-nav {
    padding-bottom: calc(var(--app-bottom-nav-space) + var(--ui-safe-bottom) + 18px);
}

body > main.container {
    padding-top: var(--ui-gap-4) !important;
    padding-bottom: var(--ui-gap-4) !important;
}

@media (min-width: 768px) {
    body {
        font-size: 14.5px;
    }

    body > main.container {
        padding-top: var(--ui-gap-5) !important;
    }
}

main.container,
.container {
    width: 100%;
    max-width: var(--ui-content-max);
    padding-inline: 16px;
    margin-inline: auto;
}

@media (min-width: 768px) {
    main.container,
    .container {
        padding-inline: 22px;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--ui-ink);
    letter-spacing: -0.01em;
}

a {
    color: var(--ui-info);
    text-decoration: none;
}

a:hover {
    color: var(--ui-sky);
}

::selection {
    background: rgba(20, 184, 166, 0.28);
}

:focus-visible {
    outline: 2px solid var(--ui-teal);
    outline-offset: 2px;
    border-radius: 6px;
}

.text-secondary,
.text-muted {
    color: var(--ui-muted) !important;
}

.small,
small {
    font-size: 12.5px;
}

/* اسکرول‌بار نازک */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

/* ------------------------------ 4) شِل: نوار بالا ------------------------- */
.vstore-nav {
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(11, 18, 32, 0.82));
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 10px 30px -18px rgba(2, 6, 23, 0.75);
    min-height: var(--ui-appbar-h);
    padding-top: var(--ui-safe-top);
    display: flex;
    align-items: center;
    position: fixed !important;
    top: 0;
    inset-inline: 0;
    z-index: 1050;
}

.vstore-nav .container {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--ui-appbar-h);
    padding-top: 0;
    padding-bottom: 0;
}

.vstore-nav .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.vstore-nav .site-logo {
    height: 30px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(45, 212, 191, 0.35));
}

/* دکمهٔ بازگشت (RTL: فلش رو به راست) */
.ui-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    flex: 0 0 auto;
    transition: background 0.18s ease, transform 0.12s ease;
}

.ui-back:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.ui-back:active {
    transform: scale(0.94);
}

.ui-back svg {
    width: 18px;
    height: 18px;
}

.header-sublinks-wrap {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.vstore-toggler {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 0 0 auto;
    transition: background 0.18s ease, transform 0.12s ease;
}

.vstore-toggler:active {
    transform: scale(0.94);
}

.vstore-toggler .navbar-toggler-icon {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2e8f0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h10'/%3E%3C/svg%3E");
    background-size: 20px;
}

.drawer-pending-badge {
    position: absolute;
    top: -5px;
    inset-inline-start: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fb7185, #e11d48);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.5);
}

/* ------------------------------ 5) شِل: منوی پایین ------------------------ */
.app-bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1040;
    padding-bottom: var(--ui-safe-bottom);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(170%) blur(20px);
    -webkit-backdrop-filter: saturate(170%) blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 -12px 30px -22px rgba(11, 18, 32, 0.5);
}

.app-bottom-nav-inner {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: stretch;
    gap: 2px;
    height: var(--ui-bottomnav-h);
    max-width: 560px;
    margin-inline: auto;
    padding-inline: 6px;
}

.app-bottom-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    padding: 8px 2px;
    color: var(--ui-muted);
    text-align: center;
    border-radius: 14px;
    transition: color 0.18s ease, transform 0.12s ease, background 0.18s ease;
}

.app-bottom-link:hover {
    color: var(--ui-ink-2);
}

.app-bottom-link:active {
    transform: scale(0.94);
}

.app-bottom-link.active {
    color: var(--ui-teal);
}

/* هالهٔ تب فعال دقیقاً دور آیکون با فاصلهٔ مساوی از بالا و پایین */
.app-bottom-link.active::before {
    content: none;
}

.app-bottom-link.active .app-bottom-icon::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.16), rgba(14, 165, 233, 0.1));
    border: 1px solid rgba(20, 184, 166, 0.22);
    z-index: 0;
}

.app-bottom-icon svg {
    position: relative;
    z-index: 1;
}

.app-bottom-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
}

.app-bottom-icon svg {
    width: 22px;
    height: 22px;
    transition: transform 0.18s ease;
}

.app-bottom-link.active .app-bottom-icon svg {
    transform: scale(1.04);
}

.app-bottom-text {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.app-bottom-link.locked {
    color: var(--ui-muted-2);
}

.app-bottom-badge {
    position: absolute;
    top: -3px;
    inset-inline-start: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f43f5e, #be123c);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-bottom-lock-badge {
    position: absolute;
    top: 0;
    inset-inline-end: -2px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-bottom-lock-badge svg {
    width: 9px;
    height: 9px;
}

/* داک شناور روی دسکتاپ */
@media (min-width: 992px) {
    .app-bottom-nav {
        inset-inline: 0;
        bottom: 14px;
        width: min(560px, calc(100% - 32px));
        margin-inline: auto;
        border: 1px solid rgba(226, 232, 240, 0.9);
        border-radius: 20px;
        padding-bottom: 0;
        box-shadow: 0 18px 44px -18px rgba(11, 18, 32, 0.4);
    }

    .app-bottom-nav-inner {
        height: 60px;
    }
}

/* ------------------------------ 6) شِل: کشوی منو -------------------------- */
.vstore-drawer.offcanvas-end {
    width: min(340px, 88vw);
    background: linear-gradient(180deg, var(--ui-navy) 0%, var(--ui-navy-2) 100%);
    border-inline-start: 1px solid rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}

.vstore-drawer .offcanvas-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14) !important;
}

.vstore-drawer .offcanvas-title {
    font-size: 15px;
}

.vstore-drawer .offcanvas-body {
    padding: 14px 16px 20px;
}

.drawer-seller-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: var(--ui-radius);
    padding: 14px;
}

.drawer-links {
    gap: 2px;
}

.drawer-links .nav-link {
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
    padding: 11px 12px;
    border-radius: 12px;
    transition: background 0.16s ease, color 0.16s ease;
}

.drawer-links .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.drawer-links .nav-link.active {
    background: rgba(20, 184, 166, 0.16);
    color: #5eead4;
}

.seller-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ui-teal), var(--ui-sky));
    color: #04202b;
    font-weight: 800;
    font-size: 18px;
    flex: 0 0 auto;
}

.seller-profile-preview {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.seller-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-header-text h6 {
    color: #f8fafc;
    font-size: 13.5px;
    margin: 0;
}

.seller-header-text p {
    color: #94a3b8;
    font-size: 11.5px;
    line-height: 1.7;
}

/* ------------------------------ 7) دکمه‌ها -------------------------------- */
.btn {
    --btn-py: 10px;
    --btn-px: 16px;
    min-height: 44px;
    padding: var(--btn-py) var(--btn-px);
    border-radius: 13px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-width: 1px;
    transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:active {
    transform: scale(0.975);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.32);
}

.btn-sm {
    min-height: 36px;
    --btn-py: 7px;
    --btn-px: 12px;
    font-size: 12.5px;
    border-radius: 11px;
}

.btn-lg {
    min-height: 50px;
    --btn-py: 13px;
    --btn-px: 22px;
    font-size: 15px;
    border-radius: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ui-teal) 0%, #0d9488 55%, #0f766e 100%);
    border-color: transparent;
    color: #f0fdfa;
    box-shadow: var(--ui-glow);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #5eead4 0%, var(--ui-teal) 60%, #0d9488 100%);
    border-color: transparent;
    color: #042f2e;
}

.btn-secondary {
    background: var(--ui-navy-3);
    border-color: transparent;
    color: #e2e8f0;
}

.btn-outline-secondary {
    border-color: var(--ui-line-2);
    color: var(--ui-ink-2);
    background: #fff;
}

.btn-outline-secondary:hover {
    background: var(--ui-card-2);
    border-color: #b9c6da;
    color: var(--ui-ink);
}

.btn-outline-primary {
    border-color: rgba(20, 184, 166, 0.45);
    color: #0f766e;
    background: #fff;
}

.btn-outline-primary:hover {
    background: rgba(20, 184, 166, 0.1);
    border-color: var(--ui-teal);
    color: #0b5f58;
}

/* پوشش واریانت‌های outline بوت‌استرپ که در قالب‌ها زیاد استفاده شده‌اند */
.btn-outline-dark {
    border-color: var(--ui-line-2);
    color: var(--ui-ink);
    background: #fff;
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
    background: var(--ui-card-2);
    border-color: #a9b8cd;
    color: var(--ui-ink);
}

.btn-dark {
    background: var(--ui-navy-3);
    border-color: transparent;
    color: #e2e8f0;
}

.btn-dark:hover {
    background: var(--ui-navy);
    color: #fff;
}

.btn-outline-danger {
    border-color: rgba(225, 29, 72, 0.32);
    color: #be123c;
    background: #fff;
}

.btn-outline-danger:hover {
    background: var(--ui-danger-soft);
    border-color: var(--ui-danger);
    color: #9f1239;
}

.btn-outline-success {
    border-color: rgba(15, 157, 118, 0.32);
    color: #047857;
    background: #fff;
}

.btn-outline-success:hover {
    background: var(--ui-success-soft);
    border-color: var(--ui-success);
    color: #065f46;
}

.btn-outline-warning {
    border-color: rgba(217, 119, 6, 0.32);
    color: #b45309;
    background: #fff;
}

.btn-outline-warning:hover {
    background: var(--ui-warn-soft);
    border-color: var(--ui-warn);
    color: #92400e;
}

.btn-outline-info {
    border-color: rgba(2, 132, 199, 0.3);
    color: #0369a1;
    background: #fff;
}

.btn-outline-info:hover {
    background: var(--ui-info-soft);
    border-color: var(--ui-info);
    color: #075985;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.32);
    color: #f8fafc;
    background: transparent;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.btn-group > .btn {
    border-radius: 0;
}

.btn-group > .btn:first-child {
    border-start-start-radius: 13px;
    border-end-start-radius: 13px;
}

.btn-group > .btn:last-child {
    border-start-end-radius: 13px;
    border-end-end-radius: 13px;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
    color: #f0fdf4;
}

.btn-success:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #052e1b;
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e, #be123c);
    border-color: transparent;
    color: #fff1f2;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #fb7185, #e11d48);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: transparent;
    color: #451a03;
}

.btn-light {
    background: #fff;
    border-color: var(--ui-line);
    color: var(--ui-ink);
}

.btn-link {
    min-height: 40px;
    color: var(--ui-info);
    text-decoration: none;
    box-shadow: none;
}

.btn-link:hover {
    color: var(--ui-sky);
    text-decoration: underline;
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 13px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* دکمهٔ شبح روی پس‌زمینهٔ تیره */
.ui-btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f1f5f9;
}

.ui-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* ------------------------------ 8) فرم‌ها --------------------------------- */
.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ui-ink-2);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 13px;
    border: 1px solid var(--ui-line-2);
    background-color: #fff;
    color: var(--ui-ink);
    font-family: var(--font-sans);
    font-size: 14px;
    box-shadow: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.form-control-sm,
.form-select-sm {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 12.5px;
    border-radius: 10px;
}

/* در RTL فلش سلکت سمت چپ است؛ فضای آن رزرو شود تا روی عدد نیفتد */
.form-select {
    padding-inline-start: 2.2rem;
    background-position: left 0.7rem center;
    background-size: 12px 12px;
    background-repeat: no-repeat;
}

.form-select-sm {
    padding-inline-start: 1.9rem;
    background-position: left 0.55rem center;
    background-size: 11px 11px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ui-teal);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
    background-color: #fff;
    color: var(--ui-ink);
}

.form-control::placeholder {
    color: var(--ui-muted-2);
    font-size: 13px;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--ui-card-2);
    color: var(--ui-muted);
}

textarea.form-control {
    min-height: 96px;
    line-height: 1.9;
}

.form-text {
    font-size: 11.5px;
    color: var(--ui-muted);
    line-height: 1.8;
}

.invalid-feedback,
.text-danger.small {
    font-size: 11.5px;
    font-weight: 500;
}

.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: var(--ui-danger);
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1);
}

/* سوییچ */
.form-check-input[type="checkbox"] {
    width: 2.7rem;
    height: 1.4rem;
    border-radius: 999px;
    border-color: var(--ui-line-2);
    background-color: #e8edf5;
    background-image: radial-gradient(circle at 0.7rem 50%, #fff 0.42rem, transparent 0.44rem);
    background-position: center;
    background-size: 100% 100%;
    cursor: pointer;
    transition: background-position 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
    flex: 0 0 auto;
}

.form-check-input[type="checkbox"]:checked {
    background-color: var(--ui-teal);
    border-color: var(--ui-teal);
    background-image: radial-gradient(circle at calc(100% - 0.7rem) 50%, #fff 0.42rem, transparent 0.44rem);
}

.form-check-input[type="checkbox"]:focus {
    border-color: var(--ui-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding-inline-start: 0;
    margin: 0;
}

.form-check .form-check-input {
    float: none;
    margin: 0;
}

.form-check:has(.form-check-input[type="checkbox"]) .form-check-label {
    font-size: 13px;
    line-height: 1.8;
    margin: 0;
    color: var(--ui-ink-2);
}

.form-check-input[type="radio"] {
    border-color: var(--ui-line-2);
}

.form-check-input[type="radio"]:checked {
    background-color: var(--ui-teal);
    border-color: var(--ui-teal);
}

.input-group > .form-control,
.input-group > .form-select {
    border-radius: 0;
}

.input-group > :first-child {
    border-start-start-radius: 13px;
    border-end-start-radius: 13px;
}

.input-group > :last-child {
    border-start-end-radius: 13px;
    border-end-end-radius: 13px;
}

.input-group-text {
    background: var(--ui-card-2);
    border-color: var(--ui-line-2);
    color: var(--ui-muted);
    font-size: 12.5px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
}

/* دکمه‌های داخل گروه ورودی مثل بخشی از همان فیلد دیده شوند */
.input-group > .btn {
    background: transparent;
    border-color: transparent;
    color: var(--ui-ink-2);
    box-shadow: none;
    min-height: 46px;
    font-weight: 600;
}

.input-group > .btn:hover,
.input-group > .btn:focus {
    background: rgba(20, 184, 166, 0.1);
    border-color: transparent;
    color: #0f766e;
}

.input-group > .btn-outline-danger {
    color: #be123c;
}

.input-group > .btn-outline-danger:hover {
    background: var(--ui-danger-soft);
    color: #9f1239;
}

.input-group > .form-control {
    border-radius: 0;
}

.input-group > :first-child {
    border-start-start-radius: 13px;
    border-end-start-radius: 13px;
}

.input-group > :last-child {
    border-start-end-radius: 13px;
    border-end-end-radius: 13px;
}

/* ------------------------------ 9) جدول‌ها --------------------------------- */
.table {
    --bs-table-bg: transparent;
    color: var(--ui-ink-2);
    font-size: 12.5px;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 10px 10px;
    border-bottom-color: var(--ui-line);
    vertical-align: middle;
}

.table > thead th {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ui-muted);
    background: var(--ui-card-2);
    white-space: nowrap;
    border-bottom: 1px solid var(--ui-line);
}

.table > thead th:first-child {
    border-start-start-radius: 12px;
}

.table > thead th:last-child {
    border-start-end-radius: 12px;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(20, 184, 166, 0.05);
}

.table-responsive {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    background: #fff;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table > thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-sm > :not(caption) > * > * {
    padding: 8px 9px;
}

/* ------------------------------ 10) کارت‌ها -------------------------------- */
.panel-card,
.ui-card {
    background: var(--ui-card);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-sm);
    padding: 16px;
}

@media (min-width: 768px) {
    .panel-card,
    .ui-card {
        padding: 18px;
        border-radius: var(--ui-radius);
    }
}

.panel-card > h2,
.ui-card__head h2,
.ui-card__head h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ui-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.ui-card__head h2,
.ui-card__head h3 {
    margin: 0;
}

.ui-card__hint {
    font-size: 11.5px;
    color: var(--ui-muted);
}

.ui-card--flush {
    padding: 0;
    overflow: hidden;
}

.ui-card--glass {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

/* کارت قهرمان (Hero) */
.ui-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--ui-radius-lg);
    padding: 20px;
    color: #f8fafc;
    background:
        radial-gradient(600px 220px at 90% -40%, rgba(45, 212, 191, 0.5), transparent 60%),
        radial-gradient(500px 200px at 0% 120%, rgba(14, 165, 233, 0.35), transparent 62%),
        linear-gradient(150deg, #0b1220 0%, #12203a 55%, #0d2f3d 100%);
    box-shadow: var(--ui-shadow);
    isolation: isolate;
}

.ui-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 40%);
    pointer-events: none;
}

.ui-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #99f6e4;
    background: rgba(45, 212, 191, 0.14);
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-radius: 999px;
    padding: 3px 10px;
}

.ui-hero__title {
    margin: 10px 0 2px;
    font-size: 20px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.ui-hero__sub {
    margin: 0;
    font-size: 12.5px;
    color: #a8b6cc;
}

.ui-hero__value {
    margin-top: 14px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.ui-hero__value small {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
}

.ui-hero__row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.ui-hero__chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 11.5px;
    font-weight: 600;
    color: #e2e8f0;
}

.ui-hero__chip--up {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.3);
}

.ui-hero__chip--down {
    color: #fda4af;
    background: rgba(244, 63, 94, 0.16);
    border-color: rgba(244, 63, 94, 0.3);
}

/* ------------------------------ 11) آمار ---------------------------------- */
.ui-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (min-width: 992px) {
    .ui-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
}

.ui-stat {
    position: relative;
    background: var(--ui-card);
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    padding: 13px 14px;
    box-shadow: var(--ui-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 92px;
}

.ui-stat__icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(14, 165, 233, 0.14));
    color: #0f766e;
}

.ui-stat__icon svg {
    width: 16px;
    height: 16px;
}

.ui-stat__label {
    font-size: 11.5px;
    color: var(--ui-muted);
    font-weight: 500;
    line-height: 1.6;
}

.ui-stat__value {
    font-size: 18px;
    font-weight: 800;
    color: var(--ui-ink);
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.ui-stat__value small {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ui-muted-2);
}

.ui-stat--danger .ui-stat__value {
    color: var(--ui-danger);
}

.ui-stat--ok .ui-stat__value {
    color: var(--ui-success);
}

.ui-stat--row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

/* ------------------------------ 12) لیست‌ها --------------------------------- */
.ui-list {
    display: flex;
    flex-direction: column;
}

.ui-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--ui-line);
    color: var(--ui-ink-2);
    min-height: 56px;
}

.ui-row:last-child {
    border-bottom: 0;
}

.ui-row:hover {
    color: var(--ui-ink);
}

.ui-row__main {
    min-width: 0;
    flex: 1 1 auto;
}

.ui-row__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--ui-ink);
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-row__meta {
    font-size: 11.5px;
    color: var(--ui-muted);
    line-height: 1.7;
}

.ui-row__value {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--ui-ink);
}

.ui-row__chev {
    color: var(--ui-muted-2);
    flex: 0 0 auto;
    display: inline-flex;
}

.ui-row__chev svg {
    width: 14px;
    height: 14px;
    transform: scaleX(-1);
}

/* لیست‌گروپ بوت‌استرپ */
.list-group {
    border-radius: var(--ui-radius);
}

.list-group-item {
    background: transparent;
    border-color: var(--ui-line);
    font-size: 13px;
    padding: 12px 4px;
    color: var(--ui-ink-2);
}

.list-group-item:first-child,
.list-group-item:last-child {
    border-radius: 0;
}

/* ------------------------------ 13) چیپ و سگمنت --------------------------- */
.ui-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ui-chips::-webkit-scrollbar {
    display: none;
}

.ui-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--ui-line-2);
    background: #fff;
    color: var(--ui-ink-2);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.ui-chip:active {
    transform: scale(0.96);
}

.ui-chip--active,
.ui-chip.active {
    background: linear-gradient(135deg, var(--ui-teal), #0d9488);
    border-color: transparent;
    color: #f0fdfa;
    box-shadow: var(--ui-glow);
}

.ui-chip svg {
    width: 14px;
    height: 14px;
}

.ui-segmented {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    padding: 4px;
    background: #eaeff7;
    border-radius: 14px;
}

.ui-segmented__item {
    border: 0;
    background: transparent;
    border-radius: 11px;
    min-height: 38px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ui-muted);
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.ui-segmented__item.active,
.ui-segmented__item[aria-selected="true"] {
    background: #fff;
    color: var(--ui-ink);
    box-shadow: var(--ui-shadow-xs);
}

/* ------------------------------ 14) نشان و بِج ---------------------------- */
.badge {
    font-family: var(--font-sans);
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    line-height: 1.6;
}

.text-bg-success {
    background: var(--ui-success-soft) !important;
    color: #047857 !important;
}

.text-bg-danger {
    background: var(--ui-danger-soft) !important;
    color: #be123c !important;
}

.text-bg-warning {
    background: var(--ui-warn-soft) !important;
    color: #b45309 !important;
}

.text-bg-info,
.text-bg-primary {
    background: var(--ui-info-soft) !important;
    color: #0369a1 !important;
}

.text-bg-light {
    background: #eef2f9 !important;
    color: var(--ui-ink-2) !important;
}

.text-bg-dark {
    background: var(--ui-navy) !important;
    color: #e2e8f0 !important;
}

/* ------------------------------ 15) هشدار و اعلان ------------------------- */
.alert {
    border-radius: 14px;
    border: 1px solid var(--ui-line);
    background: #fff;
    color: var(--ui-ink-2);
    font-size: 12.5px;
    padding: 12px 14px;
    box-shadow: var(--ui-shadow-xs);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.85;
}

.alert-success {
    background: var(--ui-success-soft);
    border-color: rgba(15, 157, 118, 0.22);
    color: #065f46;
}

.alert-danger,
.alert-error {
    background: var(--ui-danger-soft);
    border-color: rgba(225, 29, 72, 0.2);
    color: #9f1239;
}

.alert-warning {
    background: var(--ui-warn-soft);
    border-color: rgba(217, 119, 6, 0.22);
    color: #92400e;
}

.alert-info {
    background: var(--ui-info-soft);
    border-color: rgba(2, 132, 199, 0.2);
    color: #075985;
}

/* ------------------------------ 16) مودال و شیت --------------------------- */
.modal-content {
    border: 0;
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--ui-line);
    padding: 14px 16px;
}

.modal-title {
    font-size: 14.5px;
    font-weight: 700;
}

.modal-body {
    padding: 16px;
    font-size: 13px;
    line-height: 1.95;
}

.modal-footer {
    border-top: 1px solid var(--ui-line);
    padding: 12px 16px;
    gap: 8px;
}

.modal-backdrop.show {
    opacity: 0.5;
    backdrop-filter: blur(2px);
}

@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0;
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
    }

    .modal.fade .modal-dialog {
        transform: translateY(18px);
    }

    .modal.show .modal-dialog {
        transform: none;
    }

    .modal .modal-content {
        border-radius: 22px 22px 0 0;
        padding-bottom: var(--ui-safe-bottom);
    }
}

/* شیت پایینی سفارشی */
.ui-sheet {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1090;
    transform: translateY(102%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: var(--ui-shadow-lg);
    padding: 8px 16px calc(16px + var(--ui-safe-bottom));
    max-height: 86vh;
    overflow: auto;
}

.ui-sheet.is-open {
    transform: translateY(0);
}

.ui-sheet__grip {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #dbe3ef;
    margin: 6px auto 12px;
}

.ui-sheet__title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.ui-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1085;
    background: rgba(11, 18, 32, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.ui-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ------------------------------ 17) صف و صفحه‌بندی ------------------------ */
.pagination {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px !important;
    border: 1px solid var(--ui-line-2);
    background: #fff;
    color: var(--ui-ink-2);
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 10px;
}

.page-link:hover {
    background: var(--ui-card-2);
    border-color: #b9c6da;
    color: var(--ui-ink);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--ui-teal), #0d9488);
    border-color: transparent;
    color: #f0fdfa;
    box-shadow: var(--ui-glow);
}

.page-item.disabled .page-link {
    background: var(--ui-card-2);
    color: var(--ui-muted-2);
    border-color: var(--ui-line);
}

/* ------------------------------ 18) تب و تولبار --------------------------- */
.ui-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ui-line);
    overflow-x: auto;
    scrollbar-width: none;
}

.ui-tabs::-webkit-scrollbar {
    display: none;
}

.ui-tabs__item {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ui-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.ui-tabs__item.active {
    color: var(--ui-teal);
    border-bottom-color: var(--ui-teal);
}

.ui-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.ui-toolbar .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* ------------------------------ 19) استپر و FAB --------------------------- */
.ui-stepper {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 12px;
    background: var(--ui-card-2);
    border: 1px solid var(--ui-line);
}

.ui-stepper button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: #fff;
    color: var(--ui-ink-2);
    font-size: 17px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ui-shadow-xs);
}

.ui-stepper button:active {
    transform: scale(0.94);
}

.ui-stepper input {
    width: 42px;
    border: 0;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--ui-ink);
    padding: 0;
}

.ui-fab {
    position: fixed;
    inset-inline-end: 16px;
    bottom: calc(var(--app-bottom-nav-space) + var(--ui-safe-bottom) + 16px);
    z-index: 1035;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #042f2e;
    background: linear-gradient(135deg, #5eead4, var(--ui-teal));
    box-shadow: 0 16px 32px -12px rgba(20, 184, 166, 0.7);
    transition: transform 0.14s ease, box-shadow 0.2s ease;
}

.ui-fab:active {
    transform: scale(0.93);
}

.ui-fab svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 992px) {
    .ui-fab {
        inset-inline-end: calc(50% - var(--ui-content-max) / 2 + 18px);
        bottom: 92px;
    }
}

/* ------------------------------ 20) توست ---------------------------------- */
.ui-toast-stack {
    position: fixed;
    inset-inline: 12px;
    top: calc(var(--vstore-nav-height) + var(--ui-safe-top) + 10px);
    z-index: 1095;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 420px;
    margin-inline: auto;
}

.ui-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(11, 18, 32, 0.94);
    color: #f1f5f9;
    font-size: 12.5px;
    line-height: 1.8;
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(12px);
    animation: uiToastIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.ui-toast--success {
    border-color: rgba(16, 185, 129, 0.4);
}

.ui-toast--error {
    border-color: rgba(244, 63, 94, 0.42);
}

.ui-toast--warning {
    border-color: rgba(245, 158, 11, 0.42);
}

.ui-toast__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 6px;
    flex: 0 0 auto;
    background: var(--ui-teal-2);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.16);
}

.ui-toast--success .ui-toast__dot {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
}

.ui-toast--error .ui-toast__dot {
    background: #fb7185;
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.16);
}

.ui-toast--warning .ui-toast__dot {
    background: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.16);
}

.ui-toast.is-hiding {
    animation: uiToastOut 0.22s ease forwards;
}

@keyframes uiToastIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes uiToastOut {
    to {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
}

/* ------------------------------ 21) حالت‌های خالی و اسکلت ------------------ */
.ui-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 26px 16px;
    text-align: center;
    color: var(--ui-muted);
    font-size: 12.5px;
    line-height: 1.9;
}

.ui-empty__icon {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(14, 165, 233, 0.1));
    color: #0f766e;
}

.ui-empty__icon svg {
    width: 26px;
    height: 26px;
}

.ui-skeleton {
    position: relative;
    overflow: hidden;
    background: #e9eef7;
    border-radius: 10px;
    min-height: 12px;
    color: transparent !important;
}

.ui-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    animation: uiShimmer 1.4s infinite;
}

@keyframes uiShimmer {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* ------------------------------ 22) آواتار و پیشرفت ----------------------- */
.ui-avatar {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: #04202b;
    background: linear-gradient(135deg, #99f6e4, #5eead4);
    flex: 0 0 auto;
    overflow: hidden;
}

.ui-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ui-progress {
    height: 8px;
    border-radius: 999px;
    background: #e6ecf5;
    overflow: hidden;
}

.ui-progress__bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ui-teal-2), var(--ui-sky));
    transition: width 0.4s ease;
}

/* ------------------------------ 23) صفحه‌های احراز هویت -------------------- */
.auth-shell {
    min-height: calc(100vh - var(--vstore-nav-height) - var(--ui-safe-top) - var(--ui-safe-bottom) - 24px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 24px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow);
    padding: 22px 18px;
}

@media (min-width: 768px) {
    .auth-card {
        padding: 28px 26px;
    }
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    text-align: center;
}

.auth-brand__mark {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120px 60px at 70% 0%, rgba(45, 212, 191, 0.55), transparent 70%),
        linear-gradient(145deg, #0b1220, #12324a);
    box-shadow: 0 16px 34px -16px rgba(11, 18, 32, 0.6);
    position: relative;
}

.auth-brand__mark img {
    width: 34px;
    height: auto;
}

.auth-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    line-height: 1.6;
}

.auth-sub {
    font-size: 12.5px;
    color: var(--ui-muted);
    margin: 4px 0 0;
    line-height: 1.9;
}

.auth-step {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    color: #0f766e;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.24);
    border-radius: 999px;
    padding: 3px 9px;
    margin-bottom: 10px;
}

/* ورودی کد یکبارمصرف */
.otp-input {
    letter-spacing: 0.55em;
    text-align: center;
    font-size: 22px !important;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    padding-inline: 8px !important;
    min-height: 58px !important;
    border-radius: 16px !important;
}

.otp-input::placeholder {
    letter-spacing: 0.4em;
    font-size: 16px;
    opacity: 0.5;
}

.auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--ui-card-2);
    border: 1px dashed var(--ui-line-2);
    color: var(--ui-muted);
    font-size: 11.5px;
    line-height: 1.7;
    text-align: center;
}

.auth-trust svg {
    flex: 0 0 auto;
    color: var(--ui-success);
}

.auth-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: 11.5px;
    color: var(--ui-muted-2);
}

.auth-foot a {
    color: var(--ui-muted);
    font-weight: 600;
}

.auth-foot a:hover {
    color: var(--ui-teal);
}

.auth-foot--split {
    justify-content: space-between;
    gap: 6px;
}

.auth-foot__hint {
    font-size: 11px;
    color: var(--ui-muted-2);
}

.auth-phone {
    display: inline-block;
    direction: ltr;
    font-weight: 800;
    color: var(--ui-ink);
    background: var(--ui-card-2);
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    padding: 1px 8px;
    font-variant-numeric: tabular-nums;
}

/* فیلد و خطا */
.ui-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ui-error {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ui-danger);
    line-height: 1.7;
}

.ui-error--block {
    background: var(--ui-danger-soft);
    border: 1px solid rgba(225, 29, 72, 0.18);
    border-radius: 12px;
    padding: 9px 12px;
}

/* کپچا */
.otp-captcha-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}

.otp-captcha-tools {
    display: grid;
    gap: 6px;
    justify-items: stretch;
}

.otp-captcha-image {
    width: 168px;
    height: 56px;
    border: 1px solid var(--ui-line-2);
    border-radius: 12px;
    background: var(--ui-card-2);
    object-fit: cover;
}

@media (max-width: 420px) {
    .otp-captcha-box {
        grid-template-columns: 1fr;
    }

    .otp-captcha-image {
        width: 100%;
        height: 56px;
    }
}

/* ------------------------------ 24) کمکی‌ها -------------------------------- */
.ui-divider {
    height: 1px;
    background: var(--ui-line);
    margin: 14px 0;
    border: 0;
}

.ui-divider--text {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ui-muted-2);
    font-size: 11px;
    height: auto;
    background: none;
}

.ui-divider--text::before,
.ui-divider--text::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--ui-line);
}

.ui-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ui-gap-3);
}

.ui-grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 992px) {
    .ui-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .ui-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

.ui-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ui-scroll-x {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.ui-scroll-x::-webkit-scrollbar {
    display: none;
}

.ui-scroll-x > * {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

.ui-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 20px 2px 10px;
}

.ui-section-title h2 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.ui-section-title a {
    font-size: 11.5px;
    font-weight: 600;
}

.ui-only-mobile {
    display: initial;
}

@media (min-width: 768px) {
    .ui-only-mobile {
        display: none !important;
    }
}

.ui-hide-mobile {
    display: none;
}

@media (min-width: 768px) {
    .ui-hide-mobile {
        display: initial;
    }
}

/* اکشن‌های سریع داشبورد */
.ui-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.ui-quick {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 6px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--ui-line);
    box-shadow: var(--ui-shadow-xs);
    color: var(--ui-ink-2);
    font-size: 10.5px;
    font-weight: 600;
    text-align: center;
    min-height: 76px;
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ui-quick:active {
    transform: scale(0.96);
}

.ui-quick:hover {
    border-color: rgba(20, 184, 166, 0.4);
    box-shadow: var(--ui-shadow-sm);
    color: var(--ui-ink);
}

.ui-quick__icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(14, 165, 233, 0.12));
    color: #0f766e;
}

.ui-quick__icon svg {
    width: 17px;
    height: 17px;
}

/* ------------------------------ 25) نوار ثبت پایین ------------------------ */
/* قالب اصلی از app.css می‌آید (نمایش در ≤991px، جای‌گیری بالای منوی پایین)؛
   اینجا فقط ظاهر کارتِ داخلی و فاصلهٔ امن پایین صفحه را به‌روز می‌کنیم. */
.app-sticky-submit-bar-inner {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--ui-line);
    border-radius: 18px;
    box-shadow: 0 -10px 28px -22px rgba(11, 18, 32, 0.55);
    padding: 10px 12px calc(10px + var(--ui-safe-bottom));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.app-sticky-submit-bar .btn {
    min-height: 46px;
    border-radius: 13px;
}

/* فضای پایین صفحه وقتی نوار چسبان وجود دارد (بدون نیاز به کلاس اضافه) */
body:has(.app-sticky-submit-bar) {
    padding-bottom: calc(var(--app-bottom-nav-space) + 96px + var(--ui-safe-bottom));
}

@media (min-width: 992px) {
    body:has(.app-sticky-submit-bar) {
        padding-bottom: 24px;
    }
}

.app-sticky-submit-bar[hidden] {
    display: none !important;
}

/* ------------------------------ 26) لودر سراسری --------------------------- */
#globalPageLoader {
    background: rgba(11, 18, 32, 0.32) !important;
    backdrop-filter: blur(3px) !important;
    z-index: 4000;
}

#globalPageLoader .global-page-loader-card {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid var(--ui-line) !important;
    border-radius: 18px !important;
    padding: 14px 18px !important;
    box-shadow: var(--ui-shadow) !important;
    gap: 10px !important;
}

#globalPageLoader .spinner-border {
    color: var(--ui-teal) !important;
}

/* ------------------------------ 27) دراپ‌دان ------------------------------ */
.dropdown-menu {
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    box-shadow: var(--ui-shadow);
    padding: 6px;
    font-size: 12.5px;
}

.dropdown-item {
    border-radius: 9px;
    padding: 9px 11px;
    font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(20, 184, 166, 0.1);
    color: #0b5f58;
}

/* ------------------- 28) پوشش کامپوننت‌های بوت‌استرپ ---------------------- */.accordion-item {
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--ui-shadow-xs);
}

.accordion-item + .accordion-item {
    margin-top: 10px;
}

.accordion-button {
    font-size: 13px;
    font-weight: 600;
    padding: 14px 16px;
    background: #fff;
    color: var(--ui-ink);
    box-shadow: none;
    border-radius: 16px !important;
}

.accordion-button:not(.collapsed) {
    background: rgba(20, 184, 166, 0.08);
    color: #0b5f58;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-button::after {
    width: 14px;
    height: 14px;
    background-size: 14px;
}

.accordion-body {
    padding: 16px;
    font-size: 13px;
}

.nav-tabs {
    border-bottom: 1px solid var(--ui-line);
    gap: 4px;
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--ui-muted);
    font-size: 12.5px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--ui-ink-2);
}

.nav-tabs .nav-link.active {
    color: var(--ui-teal);
    background: transparent;
    border-bottom-color: var(--ui-teal);
}

.card {
    border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-xs);
    background: #fff;
}

.card-header {
    background: var(--ui-card-2);
    border-bottom: 1px solid var(--ui-line);
    font-weight: 700;
    font-size: 13px;
    padding: 12px 16px;
}

.card-body {
    padding: 16px;
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: #e6ecf5;
}

.progress-bar {
    background: linear-gradient(90deg, var(--ui-teal-2), var(--ui-sky));
}

.breadcrumb {
    font-size: 12px;
    margin-bottom: 10px;
}

.tooltip-inner {
    background: var(--ui-navy);
    border-radius: 9px;
    font-size: 11.5px;
    padding: 6px 10px;
    font-family: var(--font-sans);
}

.popover {
    border-radius: 14px;
    border-color: var(--ui-line);
    box-shadow: var(--ui-shadow);
}

.popover-header {
    background: var(--ui-card-2);
    font-size: 12.5px;
    font-weight: 700;
}

.popover-body {
    font-size: 12px;
    line-height: 1.9;
    color: var(--ui-ink-2);
}

.vstore-help-btn {
    border: 1px solid rgba(20, 184, 166, 0.35);
    background: rgba(20, 184, 166, 0.1);
    color: #0f766e;
}

.vstore-help-btn:hover {
    background: rgba(20, 184, 166, 0.18);
    border-color: rgba(20, 184, 166, 0.5);
    color: #0b5f58;
}

.btn-close {
    opacity: 0.45;
    width: 0.85em;
    height: 0.85em;
}

.btn-close:hover {
    opacity: 0.8;
}

hr {
    border-color: var(--ui-line);
    opacity: 1;
}

.badge.position-absolute {
    box-shadow: var(--ui-shadow-sm);
    font-size: 9px !important;
    padding: 2px 6px !important;
    line-height: 1.7;
}

/* نشان «قفل» روی دکمه‌های داخل گروه ورودی: کوچک، بیرون‌زده ولی بدون تداخل */
.input-group > .btn > .badge.position-absolute,
.invoice-scan-btn > .badge.position-absolute,
.inventory-scan-btn > .badge.position-absolute {
    top: -8px !important;
    inset-inline-start: auto !important;
    inset-inline-end: 4px !important;
    transform: none !important;
    background: var(--ui-navy) !important;
    color: #f8fafc !important;
    box-shadow: 0 0 0 2px #fff, var(--ui-shadow-sm);
}

/* فضای اضافه برای FAB تا روی محتوا نیفتد */
body:has(.ui-fab) {
    padding-bottom: calc(var(--app-bottom-nav-space) + 92px + var(--ui-safe-bottom));
}

/* ------------------------------ 29) چاپ ----------------------------------- */
@media print {
    .vstore-nav,
    .app-bottom-nav,
    .ui-fab,
    .app-sticky-submit-bar,
    .ui-toast-stack {
        display: none !important;
    }

    body {
        padding: 0;
        background: #fff;
    }
}

/* ------------------------------ 29) دسترس‌پذیری --------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* دکمه‌های بازکردن بخش‌ها (آکاردئون دستی) */
.campaign-collapse-toggle {
    border: 1px dashed var(--ui-line-2);
    border-radius: 14px;
    background: var(--ui-card-2);
    padding: 12px 14px;
    min-height: 48px;
    font-weight: 700;
    font-size: 13px;
    color: var(--ui-ink-2);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.campaign-collapse-toggle:hover,
.campaign-collapse-toggle:focus {
    background: rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.45);
    color: #0b5f58;
}

.campaign-collapse-toggle .campaign-arrow {
    color: var(--ui-muted);
    transition: transform 0.18s ease;
}

.campaign-collapse-toggle[aria-expanded="true"] .campaign-arrow {
    transform: rotate(180deg);
}

/* ------------------------------ 30) آپلود فایل --------------------------- */
.ui-file {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border: 1px dashed var(--ui-line-2);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--ui-card-2);
    transition: border-color 0.16s ease, background 0.16s ease;
}

.ui-file.has-file {
    border-style: solid;
    border-color: rgba(20, 184, 166, 0.45);
    background: rgba(20, 184, 166, 0.06);
}

.ui-file__btn {
    flex: 0 0 auto;
}

.ui-file__input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
}

.ui-file__name {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 11.5px;
    color: var(--ui-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-file.has-file .ui-file__name {
    color: #0b5f58;
    font-weight: 600;
}

/* ------------------------- 31) الگوهای صفحه (جدید) ------------------------ */
/* عنوان‌های داخل کارت‌ها که با الگوی قدیمی (h2.h5 / h3.h6) نوشته شده‌اند */
.ui-card > .d-flex > h1.h5,
.ui-card > .d-flex > h2.h5,
.panel-card > .d-flex > h1.h5,
.panel-card > .d-flex > h2.h5 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.5;
}

.ui-card > h2.h6,
.ui-card > h3.h6,
.panel-card > h2.h6,
.panel-card > h3.h6 {
    font-size: 14px;
    font-weight: 700;
}

.ui-card > .small.text-secondary:first-child,
.ui-card > p.small.text-secondary:first-child {
    line-height: 1.9;
}
/* سربرگ صفحه: عنوان + زیرنویس + اکشن */
.ui-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.ui-page-head__title {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.5;
}

.ui-page-head__sub {
    margin: 4px 0 0;
    font-size: 11.5px;
    color: var(--ui-muted);
    line-height: 1.8;
}

.ui-page-head__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

/* تبدیل خودکار جدول به کارت در موبایل (با data-label روی tdها) */
@media (max-width: 767.98px) {
    .ui-mobile-cards {
        display: block;
        border: 0;
        background: transparent;
        overflow: visible;
    }

    .ui-mobile-cards thead {
        display: none;
    }

    .ui-mobile-cards tbody {
        display: grid;
        gap: 10px;
    }

    .ui-mobile-cards tbody tr {
        position: relative;
        display: flex;
        flex-direction: column;
        padding: 12px;
        border: 1px solid var(--ui-line);
        border-radius: 16px;
        background: #fff;
        box-shadow: var(--ui-shadow-xs);
    }

    .ui-mobile-cards tbody tr td[data-card="title"] {
        order: -1;
    }

    .ui-mobile-cards tbody tr td[data-card="actions"] {
        order: 99;
    }

    .ui-mobile-cards tbody tr td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 6px 0 !important;
        border: 0 !important;
        font-size: 12.5px;
        min-width: 0;
    }

    .ui-mobile-cards tbody tr td + td {
        border-top: 1px dashed var(--ui-line) !important;
    }

    .ui-mobile-cards tbody tr td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: 11px;
        font-weight: 600;
        color: var(--ui-muted);
    }

    .ui-mobile-cards tbody tr td[data-card="title"] {
        display: block;
        padding-bottom: 8px !important;
        border-top: 0 !important;
    }

    .ui-mobile-cards tbody tr td[data-card="title"]::before {
        content: none;
    }

    .ui-mobile-cards tbody tr td[data-card="actions"] {
        display: block;
        padding-top: 10px !important;
        margin-top: 4px;
        border-top: 1px solid var(--ui-line) !important;
    }

    .ui-mobile-cards tbody tr td[data-card="actions"]::before {
        content: none;
    }

    .ui-mobile-cards tbody tr td[data-card="actions"] form,
    .ui-mobile-cards tbody tr td[data-card="actions"] .d-flex {
        width: 100%;
    }

    .ui-mobile-cards tbody tr td[data-card="actions"] .form-select {
        width: 100%;
    }

    .ui-mobile-cards tbody tr:has(td[colspan]) {
        display: block;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .ui-mobile-cards tbody tr:has(td[colspan]) td {
        display: block;
        border: 0 !important;
    }
}


/* ---------------- میان‌برهای زیر هدر (page subnav) ---------------- */
.page-subnav {
    position: relative;
    z-index: 1020;
    margin: 0 0 14px;
    padding: 0;
}

.page-subnav-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.page-subnav-inner::-webkit-scrollbar {
    display: none;
}

/* اگر صفحه هیچ میان‌بری ندارد، نوار خالی نمایش داده نشود */
.page-subnav:not(:has(.header-sublink)) {
    display: none;
}

.page-subnav .header-sublink {
    flex: 0 0 auto;
    color: var(--ui-ink-2);
    background: #fff;
    border: 1px solid var(--ui-line-2);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: var(--ui-shadow-xs);
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
}

.page-subnav .header-sublink:hover {
    color: #0f766e;
    border-color: rgba(20, 184, 166, 0.45);
    background: rgba(20, 184, 166, 0.08);
}

.page-subnav .header-sublink:active {
    transform: scale(0.97);
}

.page-subnav .header-sublink.active,
.page-subnav .header-sublink.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--ui-teal-2), var(--ui-sky));
    border-color: transparent;
    box-shadow: 0 10px 20px -14px rgba(20, 184, 166, 0.9);
}

/* ---------------- جستجوی یکپارچهٔ انبار/فروشگاه ---------------- */
.inv-search .input-group {
    border: 1px solid var(--ui-line-2);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.inv-search .input-group:focus-within {
    border-color: var(--ui-teal);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
}

.inv-search .form-control,
.inv-search .btn {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent;
    min-height: 48px;
}

.inv-search .form-control {
    padding-inline-start: 14px;
    font-size: 13.5px;
}

.inv-search .form-control:focus {
    box-shadow: none;
    background: transparent;
}

.inv-search .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    padding: 0;
    color: var(--ui-muted);
}

.inv-search .btn:hover {
    color: var(--ui-teal);
}

.inv-search .inventory-scan-btn {
    width: 50px;
    border-inline-start: 1px solid var(--ui-line) !important;
}

.inv-search .inventory-scan-btn svg {
    width: 23px;
    height: 23px;
}

/* ---------------- inventory cards (shared) ---------------- */
.inventory-scan-btn {
        width: 50px;
    }

    .inventory-scan-btn svg {
        width: 23px;
        height: 23px;
    }

    #inventoryScanReader {
        min-height: 240px;
        border: 1px solid #d9e0ea;
        border-radius: 8px;
        overflow: hidden;
        background: #f8fafc;
    }

    #inventoryScanReader video,
    #inventoryScanReader canvas,
    #inventoryScanReader img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
    .inventory-page-loader {
        position: fixed;
        inset: 0;
        z-index: 2200;
        display: none;
        align-items: center;
        justify-content: center;
        background: rgba(15, 23, 42, 0.28);
        backdrop-filter: blur(1px);
        pointer-events: all;
    }
    .inventory-page-loader.show {
        display: flex;
    }
    .inventory-page-loader-card {
        background: #fff;
        border: 1px solid #dbe4f0;
        border-radius: 12px;
        padding: 12px 14px;
        min-width: 160px;
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
        box-shadow: 0 12px 28px rgba(2, 6, 23, 0.16);
    }
    .inventory-completion-badge {
        display: inline-flex;
        align-items: center;
        width: fit-content;
        border-radius: 999px;
        padding: 0.14rem 0.45rem;
        background: #fff7ed;
        color: #c2410c;
        border: 1px solid #fed7aa;
        font-size: 0.68rem;
        font-weight: 800;
        margin-top: 0.25rem;
    }
    .inventory-completion-issues {
        font-size: 0.68rem;
        color: #b45309;
        margin-top: 0.16rem;
        line-height: 1.5;
    }
    .inventory-variant-list {
        display: grid;
        gap: 0.4rem;
    }
    .inventory-variant-pill {
        display: inline-flex;
        width: 100%;
        max-width: 100%;
        flex-wrap: wrap;
        gap: 0.45rem;
        align-items: center;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.45rem 0.65rem;
        background: #f8fafc;
        color: #475569;
        font-size: 0.76rem;
        line-height: 1.6;
    }
    .inventory-variant-pill strong {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.55rem;
        height: 1.55rem;
        border-radius: 999px;
        background: #0f5ea8;
        color: #ffffff;
        font-weight: 800;
        line-height: 1;
        flex: 0 0 auto;
    }
    .inventory-variant-count {
        display: inline-flex;
        align-items: center;
        border-radius: 999px;
        padding: 0.12rem 0.45rem;
        background: #eef6ff;
        color: #0f5ea8;
        font-size: 0.68rem;
        font-weight: 800;
        margin-top: 0.3rem;
    }
    .inventory-variant-toggle {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 999px;
        flex: 0 0 32px;
        align-self: center;
    }
    .inventory-variant-toggle svg {
        transition: transform 0.18s ease;
    }
    .inventory-variant-toggle[aria-expanded="true"] svg {
        transform: rotate(180deg);
    }
    .inventory-variant-row td {
        background: #f8fafc;
        border-top: 0;
        padding-top: 0;
    }
    .inventory-variant-panel {
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
        padding: 0.75rem;
        margin: 0.15rem 0 0.5rem;
    }
    .inventory-product-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        min-height: 42px;
    }

    /* ============================ ظاهر جدید (موبایل‌اول) ==================== */
    .inv-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 14px;
    }

    .inv-header__title {
        font-size: 17px;
        font-weight: 800;
        margin: 0;
        letter-spacing: -0.02em;
    }

    .inv-header__sub {
        margin: 4px 0 0;
        font-size: 11.5px;
        color: var(--ui-muted);
    }

    .inv-filters {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 12px;
    }

    .inv-perpage {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 11.5px;
        color: var(--ui-muted);
        white-space: nowrap;
    }

    .inv-perpage .form-select {
        min-height: 36px;
        padding-block: 4px;
        padding-inline-start: 1.9rem;
        padding-inline-end: 10px;
        font-size: 12.5px;
        border-radius: 10px;
        width: auto;
        background-position: left 0.5rem center;
        background-size: 11px 11px;
    }

    .inv-thumb {
        width: 46px;
        height: 46px;
        border-radius: 13px;
        object-fit: cover;
        background: var(--ui-card-2);
        border: 1px solid var(--ui-line);
        flex: 0 0 auto;
    }

    .inv-thumb--empty {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--ui-muted-2);
    }

    .inv-thumb--empty svg {
        width: 20px;
        height: 20px;
    }

    .inventory-product-head {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .inventory-product-head .inventory-product-title-row {
        min-height: 0;
        flex: 1 1 auto;
        min-width: 0;
    }

    .inventory-product-name {
        font-weight: 700;
        font-size: 13px;
        line-height: 1.7;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .inventory-price-buy,
    .inventory-price-sell {
        font-size: 11.5px;
        line-height: 1.9;
        font-weight: 600;
    }

    .inv-chip-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 10px;
        font-weight: 700;
        background: var(--ui-warn-soft);
        color: #b45309;
        border: 1px solid rgba(217, 119, 6, 0.24);
    }

    .inv-chip-badge--danger {
        background: var(--ui-danger-soft);
        color: #be123c;
        border-color: rgba(225, 29, 72, 0.22);
    }

    @media (max-width: 767.98px) {
        .inventory-table {
            display: block;
            border: 0;
            background: transparent;
        }

        .inventory-table thead {
            display: none;
        }

        .inventory-table tbody {
            display: grid;
            gap: 10px;
        }

        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) {
            position: relative;
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            grid-template-areas:
                "name actions"
                "qty price";
            gap: 10px;
            align-items: center;
            padding: 12px;
            border: 1px solid var(--ui-line);
            border-radius: 16px;
            background: #fff;
            box-shadow: var(--ui-shadow-xs);
        }

        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) td {
            display: block;
            border: 0 !important;
            padding: 0 !important;
            min-width: 0;
        }

        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) td:nth-child(1) {
            grid-area: actions;
            justify-self: end;
        }

        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) td:nth-child(2) {
            grid-area: name;
        }

        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) td:nth-child(3) {
            grid-area: qty;
        }

        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) td:nth-child(4) {
            grid-area: price;
            text-align: end;
        }

        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) td:nth-child(3)::before,
        .inventory-table tbody tr.js-inventory-row:not(.inventory-variant-row) td:nth-child(4)::before {
            content: attr(data-label);
            display: block;
            font-size: 10px;
            font-weight: 600;
            color: var(--ui-muted-2);
            margin-bottom: 2px;
        }

        .inventory-table .inventory-variant-row,
        .inventory-table .inventory-variant-toggle {
            display: none !important;
        }

        .inventory-table .inventory-col-actions .btn,
        .inventory-table td:nth-child(1) .btn {
            width: 34px;
            height: 34px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
        }

        .inventory-table tbody tr:has(td[colspan]) {
            display: block;
            border: 0;
            box-shadow: none;
            background: transparent;
            padding: 0;
        }

        .table-responsive:has(.inventory-table) {
            border: 0;
            background: transparent;
            overflow: visible;
        }

        .inv-filters {
            flex-wrap: wrap;
        }
    }

    @media (min-width: 992px) {
        .ui-fab--products {
            display: none;
        }
    }

/* ---------------- پاپ‌آپ سایز و رنگ‌بندی محصول ---------------- */
button.inventory-variant-count {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

button.inventory-variant-count:hover {
    filter: brightness(0.97);
}

.variant-modal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.variant-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: #fff;
}

.variant-row__chips {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}

.variant-chip {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--ui-card-2);
    border: 1px solid var(--ui-line);
    color: var(--ui-ink-2);
    white-space: nowrap;
}

.variant-row__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    font-size: 11px;
    color: var(--ui-muted);
    white-space: nowrap;
}

.variant-row__qty {
    font-weight: 700;
    color: var(--ui-ink-2);
}

.variant-row__qty.is-low {
    color: #dc2626;
}

/* ---------------- مدیریت دسته‌بندی‌های اختصاصی مشتری ---------------- */
    /* مدیریت دسته‌بندی‌های اختصاصی مشتری */
    .segment-manage-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        max-height: 40vh;
        overflow-y: auto;
    }
    .segment-manage-empty {
        font-size: 12px;
        color: var(--ui-muted);
        text-align: center;
        padding: 10px 0;
    }
    .segment-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 9px;
        border: 1px solid var(--ui-line);
        border-radius: 10px;
        background: #fff;
    }
    .segment-row__title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 12.5px;
        font-weight: 600;
        color: var(--ui-ink);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .segment-row__count {
        font-size: 10.5px;
        color: var(--ui-muted);
        white-space: nowrap;
    }
    .segment-row__actions {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .segment-icon-btn {
        width: 30px;
        height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid var(--ui-line);
        border-radius: 9px;
        background: #fff;
        color: var(--ui-ink-2);
    }
    .segment-icon-btn svg {
        width: 15px;
        height: 15px;
    }
    .segment-icon-btn:hover {
        border-color: rgba(20, 184, 166, 0.45);
        color: var(--ui-teal);
    }
    .segment-icon-btn--danger {
        color: #dc2626;
        border-color: rgba(220, 38, 38, 0.25);
    }
    .segment-icon-btn--danger:hover {
        color: #b91c1c;
        border-color: rgba(220, 38, 38, 0.5);
    }
    .segment-manage-divider {
        height: 1px;
        background: var(--ui-line);
        margin: 12px 0;
    }

/* ---------------- انتخابگر تاریخ شمسی ---------------- */
.jp-panel {
    position: absolute;
    z-index: 2050;
    display: none;
    width: 306px;
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    padding: 12px;
}

.jp-panel.is-open {
    display: block;
}

.jp-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.jp-selects {
    display: flex;
    gap: 6px;
}

.jp-selects select {
    flex: 1 1 0;
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: var(--ui-card-2);
    color: var(--ui-ink);
    font-size: 13px;
    font-weight: 600;
}

.jp-quick {
    display: flex;
    gap: 6px;
}

.jp-btn {
    flex: 1 1 0;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--ui-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ui-ink-2);
    font-size: 12px;
    font-weight: 600;
}

.jp-btn:hover {
    border-color: rgba(20, 184, 166, 0.45);
    color: var(--ui-teal);
}

.jp-decades {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.jp-decades::-webkit-scrollbar {
    display: none;
}

.jp-decade {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: #fff;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
}

.jp-decade.is-active {
    border-color: rgba(20, 184, 166, 0.5);
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
}

.jp-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 4px;
}

.jp-week__day {
    text-align: center;
    font-size: 10px;
    color: var(--ui-muted);
}

.jp-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
}

.jp-day {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ui-ink-2);
    font-size: 13px;
    font-weight: 600;
}

.jp-day:hover {
    background: rgba(20, 184, 166, 0.12);
}

.jp-day.is-today {
    box-shadow: inset 0 0 0 1.5px var(--ui-teal);
    color: #0f766e;
}

.jp-day.is-selected {
    background: var(--ui-teal);
    color: #fff;
}

.jp-day.is-holiday {
    color: #dc2626;
}

.jp-day--empty {
    visibility: hidden;
}

.jp-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

.jp-hint {
    font-size: 10.5px;
    color: var(--ui-muted);
}

.jp-foot .jp-close {
    flex: 0 0 auto;
    width: 78px;
}

.jp-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2040;
    display: none;
    background: rgba(15, 23, 42, 0.38);
}

.jp-backdrop.is-open {
    display: block;
}

@media (max-width: 767.98px) {
    .jp-panel.is-sheet {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%;
        max-height: 86vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
        box-shadow: 0 -14px 44px rgba(15, 23, 42, 0.24);
        animation: jpSheetUp 0.22s ease;
    }

    .jp-panel.is-sheet .jp-day {
        height: 44px;
        font-size: 14px;
    }

    .jp-panel.is-sheet .jp-week__day {
        font-size: 10.5px;
    }

    .jp-panel.is-sheet .jp-selects select {
        height: 44px;
        font-size: 14px;
    }

    .jp-panel.is-sheet .jp-btn {
        height: 40px;
        font-size: 13px;
    }
}

@keyframes jpSheetUp {
    from {
        transform: translateY(18px);
        opacity: 0.65;
    }
    to {
        transform: none;
        opacity: 1;
    }
}
