﻿html, body {
    margin: 0;
    padding: 0;
    font-family: 'Tahoma','Helvetica Neue', Helvetica, Arial, sans-serif;
    direction: rtl;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* درختواره‌ها - عمومی */
.tree-view ul {
    list-style-type: none;
    padding-left: 20px;
}

.tree-view li {
    margin: 5px 0;
}

.tree-view button {
    margin-left: 10px;
}

/* ===== استایل‌های سفارشی برای صفحات دریافت و پرداخت ===== */
.breadcrumb {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
}

.breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* ===== استایل‌های کارت ===== */
.card-header.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.card-header.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%) !important;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #0dcaf0 100%) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
}

/* ===== استایل‌های جدول ===== */
.table-sm th, .table-sm td {
    padding: 0.5rem;
}

.table-borderless tbody tr:not(:last-child) td {
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-success-light {
    background-color: rgba(25, 135, 84, 0.05) !important;
}

    .table-success-light:hover {
        background-color: rgba(25, 135, 84, 0.1) !important;
    }

.table-danger-light {
    background-color: rgba(220, 53, 69, 0.05) !important;
}

    .table-danger-light:hover {
        background-color: rgba(220, 53, 69, 0.1) !important;
    }

/* ===== استایل‌های دکمه‌ها ===== */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    border: none;
}

    .btn-success:hover, .btn-danger:hover {
        opacity: 0.9;
        transform: translateY(-1px);
        transition: all 0.2s ease;
    }

.btn {
    font-weight: 500;
}

/* ===== استایل‌های فرم ===== */
.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-label {
    font-weight: 500;
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* ===== استایل‌های کارت‌ها ===== */
.card.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.card.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.card.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #0dcaf0 100%);
}

.card.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.card-header {
    font-weight: 600;
}

/* ===== استایل‌های صفحه‌بندی (Pagination) ===== */
.pagination .page-link {
    border-radius: 5px;
    margin: 0 2px;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ===== استایل‌های Modal ===== */
.modal.show {
    animation: fadeIn 0.2s ease-in;
}

.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== استایل‌های رنگ‌ها ===== */
.text-success {
    color: #198754 !important;
    font-weight: 600;
}

.text-danger {
    color: #dc3545 !important;
    font-weight: 600;
}

/* ===== استایل‌های Badge ===== */
.badge {
    font-size: 0.85em;
    padding: 0.35em 0.65em;
}

/* ===== استایل‌های Hover برای جدول ===== */
.table-hover tbody tr {
    transition: background-color 0.15s ease;
}

    .table-hover tbody tr:hover {
        background-color: rgba(13, 110, 253, 0.075);
    }

/* ===== استایل‌های راهنما ===== */
.text-muted small {
    font-size: 0.875em;
}

/* ===== استایل‌های ریسپانسیو ===== */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.9rem;
    }
}























/* ===== آیتم‌های دارای زیرمنو ===== */
.nav-item.has-submenu {
    position: relative;
}

.menu-parent {
    position: relative;
    user-select: none;
    cursor: pointer;
    color: #adca0a;
}

.menu-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: rgba(255,255,255,0.6);
    margin-right: 0.5rem;
}

    .menu-arrow.rotate {
        transform: rotate(-90deg);
    }

/* حالت expanded - مهم */
.nav-item.expanded {
    background: rgba(0,0,0,0.2);
}

    .nav-item.expanded > .menu-parent {
        background: rgba(0,0,0,0.1);
    }

        .nav-item.expanded > .menu-parent .nav-icon,
        .nav-item.expanded > .menu-parent .nav-text {
            color: #fff;
            font-weight: 500;
        }

/* ===== زیرمنوها ===== */
/* استایل اختصاصی برای لینک‌های سایدبار */
::deep .sidebar-nav-link {
    display: flex !important;
    align-items: center;
    padding: 0.75rem 1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    background-color: transparent !important;
    border-right: 3px solid transparent;
    transition: all 0.2s ease;
    width: 100%;
    cursor: pointer;
}

    ::deep .sidebar-nav-link:hover {
        color: #fff !important;
        background-color: rgba(255, 255, 255, 0.15) !important;
    }

    ::deep .sidebar-nav-link.active {
        color: #fff !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
        border-right-color: #ffd700 !important;
    }

    /* آیکون‌ها */
    ::deep .sidebar-nav-link .nav-icon,
    ::deep .sidebar-nav-link .sub-icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 0.75rem;
        font-size: 1.2rem;
        color: rgba(255, 255, 255, 0.7);
    }

    ::deep .sidebar-nav-link:hover .nav-icon,
    ::deep .sidebar-nav-link:hover .sub-icon,
    ::deep .sidebar-nav-link.active .nav-icon,
    ::deep .sidebar-nav-link.active .sub-icon {
        color: #fff;
    }

/* منوی والد */
::deep .menu-parent {
    position: relative;
    user-select: none;
}

::deep .menu-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.6);
    margin-right: 0.5rem;
}

    ::deep .menu-arrow.rotate {
        transform: rotate(-90deg);
    }

/* زیرمنوها */
::deep .sub-menu {
    display: none;
    list-style-type: none;
    padding-right: 20px;
    margin: 0;
    background: rgba(0, 0, 0, 0.15);
    color: #adca0a;
}

    ::deep .sub-menu.show {
        display: block;
    }

::deep .sub-nav-item {
    margin: 2px 0;
}

    ::deep .sub-nav-item .sidebar-nav-link {
        padding: 0.6rem 1rem 0.6rem 1rem !important;
        font-size: 0.85rem;
    }

/* آیتم‌های داخل زیرمنو */
.sub-nav-item {
    margin: 2px 0;
}

    .sub-nav-item .nav-link {
        padding: 0.6rem 1rem 0.6rem 3rem;
        font-size: 0.85rem;
        color: rgba(255,255,255,0.8);
        transition: all 0.2s ease;
    }

        .sub-nav-item .nav-link:hover {
            background: rgba(255,255,255,0.1);
            color: #fff;
        }

        .sub-nav-item .nav-link.active {
            background: rgba(255,215,0,0.15);
            border-left-color: #ffd700;
            color: #fff;
        }

.sub-icon {
    width: 20px;
    height: 20px;
    font-size: 1rem;
    margin-left: 0.5rem;
    color: rgba(255,255,255,0.6);
}

/* زیرمنوها با انیمیشن */
.sub-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    list-style-type: none;
    padding-left: 20px;
    margin: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

    .sub-menu.show {
        max-height: none; /* بدون محدودیت ثابت؛ باید با تعداد زیرمنو رشد کند */
        opacity: 1;
    }

        /* آیتم‌های زیرمنو با انیمیشن */
        .sub-menu.show .sub-nav-item {
            animation: slideIn 0.2s ease forwards;
            opacity: 0;
            transform: translateX(-10px);
        }


/* استفاده از ترکیب کلاس‌ها برای افزایش Specificity */
.sidebar-menu .nav-link {
    display: flex !important;
    padding: 0.75rem 1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background-color: transparent !important;
    /* بقیه استایل‌ها */
}

    .sidebar-menu .nav-link:hover {
        color: #fff !important;
        background-color: rgba(255, 255, 255, 0.15) !important;
    }

    .sidebar-menu .nav-link.active {
        color: #fff !important;
        background-color: rgba(255, 255, 255, 0.2) !important;
        border-right-color: #ffd700 !important;
    }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sub-menu.show .sub-nav-item:nth-child(1) {
    animation-delay: 0.05s;
}

.sub-menu.show .sub-nav-item:nth-child(2) {
    animation-delay: 0.1s;
}

.sub-menu.show .sub-nav-item:nth-child(3) {
    animation-delay: 0.15s;
}

.sub-menu.show .sub-nav-item:nth-child(4) {
    animation-delay: 0.2s;
}

.sub-menu.show .sub-nav-item:nth-child(5) {
    animation-delay: 0.25s;
}


nav-section-header {
    color: #d4dc8c;
}

.nav-link {
    display: block;
    padding: .5rem 1rem;
    color: #fded0d;
    text-decoration: none;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}

.invoice-item-row {
    overflow: visible !important;
   
}

.invoice-item-search-container {
    position: relative;
    overflow: visible;
 
}

 

.invoice-item-search-root {
    position: relative;
    overflow: visible !important;
 
}

.invoice-item-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
  
    background: white;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}


.btn-close-modal
Specificity: (0,2,0) {
    padding: .5rem .5rem;
    margin: -.5rem -.5rem -.5rem;
}

.modal-header .btn-close {
    padding: .5rem .5rem;
    margin: -.5rem -.5rem -.5rem;
}


.bg-purple {
    background-color: #6f42c1 !important;
}


/* ===== iBOS full-screen connection recovery =====
   The Blazor framework owns the classes on #components-reconnect-modal.
   Do NOT hide this modal with !important; doing so falls back to the old yellow bar. */
#components-reconnect-modal,
#blazor-error-ui {
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, .82);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    font-family: Tahoma, Arial, sans-serif;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

/* Fatal circuit errors use the same full-screen visual language instead of the
   framework's yellow bottom bar. Blazor sets inline display:block when needed. */
#blazor-error-ui {
    display: none;
    color: #fff;
}
#blazor-error-ui[style*="display: block"],
#blazor-error-ui[style*="display:block"] {
    display: flex !important;
}
#blazor-error-ui .dismiss { display: none; }

.erp-reconnect-card,
.blazor-error-card {
    width: min(440px, 94vw);
    padding: 2rem 1.75rem;
    text-align: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 22px;
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,.16), transparent 34%),
        linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    box-shadow: 0 28px 85px rgba(0,0,0,.34);
}

.erp-reconnect-logo {
    height: 76px;
    width: auto;
    max-width: min(260px, 80%);
    object-fit: contain;
    margin-bottom: .75rem;
}

.erp-reconnect-product {
    margin-top: .25rem;
    font-size: 1.1rem;
    font-weight: 800;
}

.erp-reconnect-tagline {
    margin: .2rem 0 .9rem;
    opacity: .82;
    font-size: .88rem;
}

.erp-reconnect-spinner,
.blazor-error-spinner {
    width: 44px;
    height: 44px;
    margin: .65rem auto 1rem;
    border: 4px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ibos-reconnect-spin .85s linear infinite;
}

.erp-reconnect-title,
.blazor-error-title {
    font-size: 1.12rem;
    font-weight: 800;
    margin-bottom: .55rem;
}

.erp-reconnect-detail,
.blazor-error-detail {
    min-height: 2.8rem;
    line-height: 1.8;
    opacity: .92;
}

.erp-reconnect-retrying,
.erp-reconnect-failed,
.erp-reconnect-rejected {
    margin-top: .35rem;
    font-size: .84rem;
    opacity: .76;
}

.erp-reconnect-failed,
.erp-reconnect-rejected {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .erp-reconnect-retrying,
#components-reconnect-modal.components-reconnect-rejected .erp-reconnect-retrying {
    display: none;
}
#components-reconnect-modal.components-reconnect-failed .erp-reconnect-failed { display: block; }
#components-reconnect-modal.components-reconnect-rejected .erp-reconnect-rejected { display: block; }

.erp-reconnect-hint,
.blazor-error-hint {
    display: block;
    margin-top: 1rem;
    opacity: .7;
    font-size: .78rem;
    line-height: 1.65;
}

@keyframes ibos-reconnect-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 575.98px) {
    #components-reconnect-modal,
    #blazor-error-ui { padding: .8rem; }

    .erp-reconnect-card,
    .blazor-error-card {
        padding: 1.55rem 1.1rem;
        border-radius: 18px;
    }
}

/* ===== کنترل‌های روشن/خاموش واضح و قابل فهم ===== */
.form-check.form-switch {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 2.25rem;
    padding-right: 0;
}
.form-check.form-switch .form-check-input {
    float: none;
    flex: 0 0 auto;
    width: 3rem;
    height: 1.55rem;
    margin: 0;
    cursor: pointer;
    border: 1px solid #98a2b3;
    border-radius: 999px !important;
    background-color: #eaecf0;
    background-position: right center;
    box-shadow: inset 0 0 0 1px rgba(16,24,40,.04);
    transition: background-color .18s ease, border-color .18s ease, background-position .18s ease, box-shadow .18s ease;
}
.form-check.form-switch .form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
    background-position: left center;
}
.form-check.form-switch .form-check-input:not(:checked) {
    background-color: #eaecf0;
    border-color: #98a2b3;
}
.form-check.form-switch .form-check-input:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.18);
}
.form-check.form-switch .form-check-input:disabled {
    cursor: not-allowed;
    opacity: .55;
}
.form-check.form-switch .form-check-label {
    cursor: pointer;
    user-select: none;
    line-height: 1.55;
}
/* All boolean checkboxes in iBOS use the same sliding switch language.
   Radio inputs are intentionally untouched. */
input.form-check-input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    float: none !important;
    width: 3rem !important;
    min-width: 3rem;
    height: 1.55rem !important;
    margin: 0 .15rem !important;
    cursor: pointer;
    border: 1px solid #98a2b3 !important;
    border-radius: 999px !important;
    background-color: #98a2b3 !important;
    background-image: radial-gradient(circle at 75% 50%, #fff 0, #fff 34%, transparent 36%) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 100% 100% !important;
    transition: background-color .18s ease, border-color .18s ease !important;
}
input.form-check-input[type="checkbox"]:checked {
    background-color: #198754 !important;
    border-color: #198754 !important;
    background-image: radial-gradient(circle at 25% 50%, #fff 0, #fff 34%, transparent 36%) !important;
}
input.form-check-input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: .55;
}

/* Self-service kiosk pages belong to the shopper: the staff support button stays hidden there. */
/* The staff support button is for ERP users: hidden on the kiosk and on the public shop,
   where it also covered the product page's mobile buy bar. */
body:has(.kiosk, .price-kiosk, main.mk, main.sp-product) a[href="/Support"].position-fixed { display: none !important; }
