/* IRANSansX Font Family */

:root[data-bs-theme="light"] {
    --app-bg: #f8f9fa;
    --app-text: #5e5873;
    --app-card-bg: #ffffff;
    --app-card-border: #ebe9f1;
    --app-table-header: #5e5873;
    --app-table-row: #6e6b7b;
    --app-dropdown-bg: #ffffff;
    --app-dropdown-hover: #f8f9fa;
    --app-excel-bg: #ffffff;
    --app-sidebar-bg: #ffffff;
    --app-sidebar-border: #ebe9f1;
    --app-sidebar-text: #6e6b7b;
    --app-sidebar-text-active: #004f22;
    --app-sidebar-hover-bg: rgba(0, 79, 34, 0.08);
    --app-main-bg: #ffffff;
    --app-wrapper-bg: #f8f8f8;
    --app-tab-header-bg: #ffffff;
    --app-tab-link-bg: #f8f8f8;
    --app-tab-link-hover-bg: #f0f0f0;
    --app-tab-link-active-bg: #ffffff;
    --app-tab-border: #ebe9f1;
    --app-border: #ebe9f1;
    --app-border-light: #efefef;
    --app-muted-text: #6e6b7b;
    --app-heading-text: #5e5873;
    --app-input-border: #ccc;
    --app-pagination-disabled-bg: #ffffff;
    --app-pagination-hover-bg: #f8f9fa;
    --app-page-link-border: #e0e0e0;
    --app-excel-footer-bg: #ffffff;
    --app-excel-footer-border: #dddddd;
    --app-table-stripe: rgba(0, 0, 0, 0.02);
    --app-table-hover: rgba(0, 79, 34, 0.05);
    --app-link-color: #004f22;
    --app-status-footer-height: 36px;
}

:root[data-bs-theme="dark"] {
    --app-bg: #161d31;
    --app-text: #d0d2d6;
    --app-card-bg: #283046;
    --app-card-border: #3b4253;
    --app-table-header: #b4b7bd;
    --app-table-row: #d0d2d6;
    --app-dropdown-bg: #283046;
    --app-dropdown-hover: #343d55;
    --app-excel-bg: #283046;
    --app-sidebar-bg: #283046;
    --app-sidebar-border: #3b4253;
    --app-sidebar-text: #d0d2d6;
    --app-sidebar-text-active: #28c76f;
    --app-sidebar-hover-bg: rgba(40, 199, 111, 0.1);
    --app-main-bg: #283046;
    --app-wrapper-bg: #161d31;
    --app-tab-header-bg: #283046;
    --app-tab-link-bg: #343d55;
    --app-tab-link-hover-bg: #3b4253;
    --app-tab-link-active-bg: #283046;
    --app-tab-border: #3b4253;
    --app-border: #3b4253;
    --app-border-light: #3b4253;
    --app-muted-text: #b4b7bd;
    --app-heading-text: #d0d2d6;
    --app-input-border: #3b4253;
    --app-pagination-disabled-bg: #283046;
    --app-pagination-hover-bg: #343d55;
    --app-page-link-border: #3b4253;
    --app-excel-footer-bg: #283046;
    --app-excel-footer-border: #3b4253;
    --app-table-stripe: rgba(255, 255, 255, 0.03);
    --app-table-hover: rgba(40, 199, 111, 0.08);
    --app-link-color: #28c76f;
    --app-status-footer-height: 36px;
}

@media (max-width: 991px) {
    :root[data-bs-theme="light"],
    :root[data-bs-theme="dark"] {
        --app-status-footer-height: 30px;
    }
}

@media (max-width: 575px) {
    :root[data-bs-theme="light"],
    :root[data-bs-theme="dark"] {
        --app-status-footer-height: 28px;
    }
}

* {
    font-family: "IRANSansX", Helvetica, Arial, serif;
    font-feature-settings: "ss02";
}

html, body {
    font-family: "IRANSansX", Helvetica, Arial, serif;
    direction: rtl;
    text-align: right;
    background-color: var(--app-bg);
    color: var(--app-text);
}

/* Bootstrap Color Variables Override */
:root {
    --bs-primary: #004f22;
    --bs-secondary: #77797c;
    --bs-success: #28c76f;
    --bs-info: #00cfe8;
    --bs-warning: #ff9f43;
    --bs-danger: #ea5455;
    --bs-dark: #4b4b4b;
    --bs-light: #f6f6f6;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--app-link-color);
}

/* Sidebar menu - override global link color for readable labels in dark mode */
.main-menu .navigation a,
.main-menu .navigation-header,
.main-menu .navigation-header span,
.main-menu .menu-title,
.main-menu .menu-content a,
.main-menu .menu-content .menu-title {
    color: var(--app-sidebar-text) !important;
}

.main-menu .navigation a:hover,
.main-menu .navigation a.active,
.main-menu .menu-content a:hover,
.main-menu .menu-content a.active {
    color: var(--app-sidebar-text-active) !important;
}

.main-menu .navigation a i.feather,
.main-menu .menu-content a i.feather {
    color: inherit !important;
}

.btn-primary {
    color: #fff;
    background-color: #004f22;
    border-color: #004f22;
}

:root[data-bs-theme="dark"] .btn-outline-dark {
    --bs-btn-color: var(--app-text);
    --bs-btn-border-color: var(--app-text);
    --bs-btn-hover-color: var(--app-card-bg);
    --bs-btn-hover-bg: var(--app-text);
    --bs-btn-hover-border-color: var(--app-text);
    --bs-btn-active-color: var(--app-card-bg);
    --bs-btn-active-bg: var(--app-text);
    --bs-btn-active-border-color: var(--app-text);
    --bs-btn-disabled-color: var(--app-muted-text);
    --bs-btn-disabled-border-color: var(--app-muted-text);
}

:root[data-bs-theme="dark"] .input-group > .btn-outline-dark {
    color: var(--app-text);
    border-color: var(--app-text);
    background-color: transparent;
}

:root[data-bs-theme="dark"] .input-group > .btn-outline-dark:hover,
:root[data-bs-theme="dark"] .input-group > .btn-outline-dark:focus,
:root[data-bs-theme="dark"] .input-group > .btn-outline-dark:active {
    color: var(--app-card-bg);
    background-color: var(--app-text);
    border-color: var(--app-text);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem var(--app-card-bg), 0 0 0 0.25rem rgba(0, 79, 34, 0.25);
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        left: 0.75rem;
        top: 0.5rem;
    }

.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: "خطایی رخ داده است."
    }

.loading-screen {
    --loading-size: clamp(13rem, 42vmin, 17rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    gap: 1.5rem;
}

.loading-progress-wrap {
    position: relative;
    width: var(--loading-size);
    height: var(--loading-size);
    flex-shrink: 0;
}

.loading-progress {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.55rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #004f22;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    font-size: clamp(1rem, 3.2vmin, 1.3rem);
    color: #004f22;
    line-height: 1;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "در حال بارگذاری...");
    }

.loading-logo {
    width: clamp(11rem, 38vmin, 15rem);
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(-2.5rem);
    animation: loading-logo-drop 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}

@keyframes loading-logo-drop {
    0% {
        opacity: 0;
        transform: translateY(-2.5rem);
    }

    55% {
        opacity: 1;
        transform: translateY(0.35rem);
    }

    75% {
        transform: translateY(-0.15rem);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Custom Styles for CRM Theme */
.wrapper {
    min-height: 100vh;
}

.card {
    background: var(--app-card-bg);
    border-color: var(--app-card-border);
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-developer-meetup {
    transition: transform 0.2s ease-in-out;
    cursor: pointer;
    height: 100%;
}

.card-developer-meetup:hover {
    transform: scale(1.05);
}

.meetup-img-wrapper {
    overflow: hidden;
    padding: 1rem;
}

.meetup-img-wrapper img {
    width: 100%;
    object-fit: cover;
}

.bg-primary {
    background-color: var(--bs-primary) !important;
}

.text-primary {
    color: var(--bs-primary) !important;
}

/* Dashboard Styles */
#dashboard-ecommerce {
    padding: 0;
}

.match-height {
    display: flex;
    flex-wrap: wrap;
}

.match-height > [class*="col"] {
    display: flex;
    flex-direction: column;
}

.match-height > [class*="col"] > .card {
    flex: 1;
}

.card-header-border-bottom {
    border-bottom: 1px solid var(--app-border-light);
    padding: 0.75rem 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--app-heading-text);
    margin: 0;
    display: flex;
    align-items: center;
}

.transaction-item {
    padding: 0.75rem 0;
}

.transaction-title {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--app-muted-text);
    margin: 0;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
}

.bg-light-info {
    background-color: rgba(0, 207, 232, 0.12) !important;
}

.bg-light-danger {
    background-color: rgba(234, 84, 85, 0.12) !important;
}

.bg-light-success {
    background-color: rgba(40, 199, 111, 0.12) !important;
}

.bg-light-warning {
    background-color: rgba(255, 159, 67, 0.12) !important;
}

.bg-light-primary {
    background-color: rgba(0, 79, 34, 0.12) !important;
}

.bg-light-secondary {
    background-color: rgba(119, 121, 124, 0.12) !important;
}

.text-info {
    color: #00cfe8 !important;
}

.text-danger {
    color: #ea5455 !important;
}

.text-success {
    color: #28c76f !important;
}

.text-warning {
    color: #ff9f43 !important;
}

.text-secondary {
    color: #77797c !important;
}

.table th {
    font-weight: 600;
    color: var(--app-table-header);
    font-size: 0.875rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--app-border);
}

.table td {
    padding: 0.25rem;
    font-size: 0.875rem;
    color: var(--app-table-row);
    border-bottom: 1px solid var(--app-border);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--app-table-stripe);
}

.table-hover tbody tr:hover {
    background-color: var(--app-table-hover);
}

.pagination {
    margin: 0;
}

.page-link {
    color: var(--app-link-color);
    border-color: var(--app-page-link-border);
    padding: 0.375rem 0.75rem;
}

.page-link:hover {
    color: var(--app-link-color);
    background-color: var(--app-pagination-hover-bg);
    border-color: var(--app-border);
}

.page-item.active .page-link {
    background-color: #004f22;
    border-color: #004f22;
    color: white;
}

.page-item.disabled .page-link {
    color: var(--app-muted-text);
    pointer-events: none;
    cursor: auto;
    background-color: var(--app-pagination-disabled-bg);
    border-color: var(--app-border);
}

/* Navbar Styles */
.bookmark-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
}

.nav-link-style {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    white-space: nowrap;
}

.dropdown-user-link {
    padding: 0.25rem 0.75rem;
}

.dropdown-user-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.user-nav {
    gap: 0.125rem;
}

.user-name {
    line-height: 1.2;
}

.user-status {
    line-height: 1.2;
}

.dropdown-menu {
    background: var(--app-dropdown-bg);
    border: 1px solid var(--app-border);
    box-shadow: 0 4px 24px rgba(34, 41, 47, 0.1);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: var(--app-muted-text);
    font-size: 0.875rem;
}

    .dropdown-item:hover {
        background-color: var(--app-dropdown-hover);
        color: var(--app-link-color);
    }

.dropdown-item i {
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
}

.main-menu {
    border-left: none;
    top: 7px !important;
    color: var(--app-sidebar-text);
}

.main-menu .main-menu-content {
    color: var(--app-sidebar-text);
}

.shadow-bottom {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.user-profile-section {
    min-height: 90px;
}






.menu-title{

    font-size:12px !important;
    margin-top:0px !important;
    padding-right:4px !important;

}


.main-content{
    margin-right:270px;
    transition: margin-right 0.3s ease;
}
.navbar-wrapper {
    margin-right: 270px !important;
    transition: margin-right 0.3s ease;
}

/* Collapsed dock sidebar — free up main content width */
.wrapper.sidebar-collapsed .main-content {
    margin-right: 90px;
}
.wrapper.sidebar-collapsed .navbar-wrapper {
    margin-right: 90px !important;
}
.wrapper.sidebar-collapsed .tab-container {
    right: calc(90px + 2rem);
}
.nav-item{

    margin-top:0px !important;
}

/* وضعیت اولیه (مخفی) */
.toast-animate {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

    /* هنگام نمایش */
    .toast-animate.show-toast {
        opacity: 1;
        transform: translateY(0);
    }

    /* هنگام خروج */
    .toast-animate.hide-toast {
        opacity: 0;
        transform: translateY(-20px);
    }

.app-toast-stack {
    position: fixed;
    z-index: 1120;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.app-toast-stack .toast {
    pointer-events: auto;
    min-width: 260px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.app-toast-stack-top {
    top: 20px;
    right: 20px;
}

.app-toast-stack-bottom {
    right: 20px;
    bottom: calc(var(--app-status-footer-height, 36px) + 20px);
    flex-direction: column-reverse;
}

.app-toast-stack-bottom .toast-animate {
    transform: translateY(24px);
}

.app-toast-stack-bottom .toast-animate.show-toast {
    transform: translateY(0);
}

.app-toast-stack-bottom .toast-animate.hide-toast {
    transform: translateY(24px);
}

/* frosted glass: blur behind, keep text sharp — readable in light & dark */
.app-toast-chat {
    --bs-toast-bg: transparent;
    --bs-toast-color: #0f172a;
    --bs-toast-border-color: rgba(15, 23, 42, 0.12);
    --bs-toast-header-bg: rgba(15, 23, 42, 0.04);
    --bs-toast-header-color: #0f172a;
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    border-radius: 14px !important;
    overflow: hidden;
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    box-shadow:
        0 12px 32px rgba(15, 23, 42, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .app-toast-chat {
    --bs-toast-color: #ecfdf5;
    --bs-toast-header-color: #ecfdf5;
    color: #ecfdf5 !important;
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.92), rgba(15, 118, 110, 0.9)) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow:
        0 12px 32px rgba(15, 23, 42, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.app-toast-chat.app-toast-chat-body,
.app-toast-chat-body {
    background: transparent !important;
}

.app-toast-chat .toast-header {
    background: rgba(15, 23, 42, 0.04) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
}

.app-toast-chat .toast-header strong,
.app-toast-chat .toast-body,
.app-toast-chat .app-toast-icon {
    color: #0f172a !important;
}

.app-toast-chat-close {
    filter: none;
}

[data-bs-theme="dark"] .app-toast-chat .toast-header {
    background: rgba(0, 0, 0, 0.12) !important;
    border-bottom-color: rgba(255, 255, 255, 0.16) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .app-toast-chat .toast-header strong,
[data-bs-theme="dark"] .app-toast-chat .toast-body,
[data-bs-theme="dark"] .app-toast-chat .app-toast-icon {
    color: #fff !important;
}

[data-bs-theme="dark"] .app-toast-chat-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.app-toast-icon {
    font-size: 1rem;
    opacity: 0.95;
}

.app-toast-clickable {
    cursor: pointer;
}

.app-toast-clickable:hover {
    filter: brightness(1.04);
}

/* Navbar notification bell */
.navbar-notify-item {
    position: relative;
}

.navbar-notify-badge {
    position: absolute;
    top: 2px;
    inset-inline-end: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.navbar-notify-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1990;
    background: transparent;
}

.navbar-notify-menu {
    direction: rtl;
    text-align: right;
    position: fixed !important;
    top: 68px !important;
    left: 12px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 2000 !important;
    width: min(320px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(70vh, 420px);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    box-shadow:
        0 16px 36px rgba(15, 23, 42, 0.18),
        0 2px 8px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] .navbar-notify-menu {
    background: #1e293b;
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

@media (max-width: 767.98px) {
    .navbar-notify-menu {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
    }
}

.navbar-notify-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

[data-bs-theme="dark"] .navbar-notify-header {
    background: #0f172a;
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

.navbar-notify-header strong {
    font-size: 0.84rem;
    color: inherit;
}

.navbar-notify-header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.navbar-notify-link-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

[data-bs-theme="dark"] .navbar-notify-link-btn {
    color: #5eead4;
}

.navbar-notify-link-btn:hover {
    text-decoration: underline;
}

.navbar-notify-push {
    padding: 0.45rem 0.7rem 0.5rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

[data-bs-theme="dark"] .navbar-notify-push {
    background: #0f172a;
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

.navbar-notify-push-btn,
.navbar-notify-push-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    font-size: 0.74rem;
    line-height: 1.3;
}

.navbar-notify-push-btn {
    appearance: none;
    border: 1px solid rgba(15, 118, 110, 0.28);
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
    border-radius: 8px;
    padding: 0.38rem 0.55rem;
    font-weight: 600;
    cursor: pointer;
}

.navbar-notify-push-btn:hover {
    background: rgba(15, 118, 110, 0.14);
}

[data-bs-theme="dark"] .navbar-notify-push-btn {
    color: #5eead4;
    border-color: rgba(45, 212, 191, 0.28);
    background: rgba(45, 212, 191, 0.08);
}

.navbar-notify-push-status {
    color: #64748b;
}

.navbar-notify-push-status.is-on {
    color: #0f766e;
    font-weight: 600;
}

.navbar-notify-push-status.is-blocked {
    color: #b45309;
}

[data-bs-theme="dark"] .navbar-notify-push-status {
    color: #94a3b8;
}

[data-bs-theme="dark"] .navbar-notify-push-status.is-on {
    color: #5eead4;
}

[data-bs-theme="dark"] .navbar-notify-push-status.is-blocked {
    color: #fbbf24;
}

.navbar-notify-empty {
    padding: 1.1rem 0.85rem;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
}

[data-bs-theme="dark"] .navbar-notify-empty {
    color: #94a3b8;
}

.navbar-notify-list {
    max-height: min(58vh, 340px);
    overflow-y: auto;
}

.navbar-notify-row {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    text-align: right;
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    background: transparent;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    color: inherit;
    min-height: 0;
    transition: background 0.12s ease;
}

.navbar-notify-row:last-child {
    border-bottom: 0;
}

.navbar-notify-row:hover {
    background: rgba(15, 118, 110, 0.07);
}

.navbar-notify-row.is-unread {
    background: rgba(15, 118, 110, 0.08);
}

[data-bs-theme="dark"] .navbar-notify-row {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

[data-bs-theme="dark"] .navbar-notify-row:hover,
[data-bs-theme="dark"] .navbar-notify-row.is-unread {
    background: rgba(45, 212, 191, 0.1);
}

.navbar-notify-kind {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.78rem;
}

.navbar-notify-kind.kind-chat { background: linear-gradient(145deg, #14b8a6, #0f766e); }
.navbar-notify-kind.kind-letter { background: linear-gradient(145deg, #8b5cf6, #6d28d9); }
.navbar-notify-kind.kind-task { background: linear-gradient(145deg, #fb923c, #c2410c); }
.navbar-notify-kind.kind-ticket { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.navbar-notify-kind.kind-system { background: linear-gradient(145deg, #64748b, #334155); }

.navbar-notify-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.navbar-notify-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    text-align: right;
}

[data-bs-theme="dark"] .navbar-notify-title {
    color: #f1f5f9;
}

.navbar-notify-time {
    font-size: 0.68rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.navbar-notify-row.is-read .navbar-notify-title {
    font-weight: 500;
    color: #475569;
}

[data-bs-theme="dark"] .navbar-notify-row.is-read .navbar-notify-title {
    color: #cbd5e1;
}


.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.no-spinner {
    -moz-appearance: textfield;
}


.excel-filter-wrapper {
    display: inline-block;
    position: relative;
   
}

.excel-filter {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: auto;
    width: 200px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--app-input-border);
    padding: 8px;
    z-index: 1000000;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    border-radius: 0.375rem;
}
.excel-filter,
.excel-filter-footer {
    background: var(--app-excel-bg);
}
.excel-filter-items {
    max-height: 180px;
    overflow-y: auto;
    padding-bottom: 40px; /* جا برای footer */
}

.excel-filter-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: var(--app-excel-footer-bg);
    border-top: 1px solid var(--app-excel-footer-border);
}

.cursor-pointer {
    cursor: pointer;
}

/* Action buttons (approve/save) sit above the fixed status footer */
.app-fixed-actions {
    position: fixed;
    bottom: calc(var(--app-status-footer-height, 36px) + 0.5rem);
    z-index: 1050;
}

.tab-content-container {
    padding-top: 56px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tab-content-pane {
    display: none;
    min-height: 0;
}

.tab-content-pane.is-active {
    display: block;
}

.tab-container {
    z-index: 99;
    position: fixed;
    top: calc(60px + 1rem + 0.5rem);
    left: 1rem;
    right: calc(270px + 2rem);
    transition: right 0.3s ease;
}


/* ── Responsive ── */

/* Tablet: sidebar drawer — align navbar with content */
@media (max-width: 1199px) {
    .main-content {
        margin-right: 0;
    }

    .navbar-wrapper {
        margin-right: 16px !important;
    }

    .tab-container {
        right: 1rem;
    }

    .wrapper.sidebar-collapsed .main-content {
        margin-right: 0;
    }

    .wrapper.sidebar-collapsed .navbar-wrapper {
        margin-right: 16px !important;
    }

    .wrapper.sidebar-collapsed .tab-container {
        right: 1rem;
    }
}

/* Keep header actions (refresh + user) in one row under navbar-expand-lg */
.navbar.navbar-expand-lg .navbar-nav.navbar-nav-actions {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    overflow: visible;
}

.navbar.navbar-expand-lg .navbar-nav.navbar-nav-actions .nav-item {
    display: flex;
    align-items: center;
    float: none;
    position: relative;
}

.org-context-navbar {
    background-color: var(--org-context-accent, var(--bs-primary)) !important;
}

.navbar-context-group {
    display: flex;
    align-items: center;
    direction: ltr;
    gap: 0.35rem;
}

.navbar-context-fields {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    direction: ltr;
}

.navbar-context-field {
    display: flex;
    align-items: center;
}

.navbar-context-field > * {
    direction: rtl;
}

.navbar-context-label {
    display: none;
}

.navbar.navbar-expand-lg .navbar-nav.navbar-nav-actions .navbar-user-item,
.navbar.navbar-expand-lg .navbar-nav.navbar-nav-actions .navbar-notify-item {
    flex-shrink: 0;
}

.navbar-user-item {
    position: relative;
}

.navbar-user-menu {
    padding: 0.35rem 0 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.navbar-user-menu .dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.85rem;
    color: var(--app-muted-text);
    font-size: 0.875rem;
}

.navbar-user-menu .dropdown-item:hover {
    background-color: var(--app-dropdown-hover);
    color: var(--app-link-color);
}

.navbar-user-menu .dropdown-divider {
    margin: 0.35rem 0;
}

.bookmark-wrapper,
.header-menu {
    overflow: visible;
}

.navbar-context-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.45rem center;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.375rem;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.2;
    min-width: 7.5rem;
    max-width: 9.5rem;
    padding: 0.3rem 0.55rem 0.3rem 1.45rem;
    outline: none;
}

.navbar-context-select.is-position,
.navbar-context-value.is-position {
    min-width: 14rem;
    max-width: 22rem;
}

.navbar-context-select:focus,
.navbar-context-select:hover {
    border-color: rgba(255, 255, 255, 0.65);
    background-color: rgba(255, 255, 255, 0.08);
}

.navbar-context-select option {
    color: var(--app-heading-text);
    background-color: var(--app-dropdown-bg);
}

.navbar-context-value {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    max-width: 9.5rem;
    padding: 0.3rem 0.55rem;
    overflow: hidden;
    color: #fff;
    font-size: 0.8rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.375rem;
}

.navbar-context-error {
    display: inline-flex;
    align-items: center;
    color: #ffd2d2;
    cursor: help;
}

.dropdown-user-heading {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 0.75rem;
}

.dropdown-user-heading-name {
    color: var(--app-heading-text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
}

.dropdown-user-heading-status {
    color: var(--app-muted-text);
    font-size: 0.75rem;
    line-height: 1.3;
}

.navbar-user-mobile-context {
    display: none;
    padding: 0.85rem 1rem 0.35rem;
}

.navbar-user-mobile-divider {
    display: none;
}

.navbar-user-mobile-context .navbar-context-fields {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    direction: rtl;
}

.navbar-user-mobile-context .navbar-context-field {
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
}

.navbar-user-mobile-context .navbar-context-label {
    display: block;
    color: var(--app-muted-text);
    font-size: 0.72rem;
    font-weight: 600;
}

.navbar-user-mobile-context .navbar-context-select,
.navbar-user-mobile-context .navbar-context-value {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 2.15rem;
    color: var(--app-heading-text);
    font-size: 0.82rem;
    background-color: var(--app-dropdown-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235e5873' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-position: left 0.55rem center;
    border-color: var(--app-border);
}

.navbar-user-mobile-context .navbar-context-value {
    background-image: none;
}

.navbar-user-mobile-context .navbar-context-select:focus,
.navbar-user-mobile-context .navbar-context-select:hover {
    background-color: var(--app-dropdown-hover);
    border-color: var(--app-link-color, #7367f0);
}

.navbar-user-mobile-context .navbar-context-error {
    color: #ea5455;
}

[data-bs-theme="dark"] .navbar-user-mobile-context .navbar-context-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23d0d2d6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
}

/* Mobile navbar tweaks */
@media (max-width: 1199.98px) {
    .user-nav {
        display: none !important;
    }

    .navbar-nav-actions .dropdown-user-link {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .navbar-nav-actions .dropdown-user-link .avatar {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .navbar-nav-actions .nav-link {
        line-height: 1;
    }

    .navbar-nav-actions > .nav-item {
        flex-shrink: 0;
    }

    .navbar-user-mobile-context,
    .navbar-user-mobile-divider {
        display: block;
    }

    .navbar-user-mobile-context .navbar-context-value {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

/* Phone */
@media (max-width: 767px) {
    .tab-container {
        top: calc(60px + 0.5rem);
        left: 0.5rem;
        right: 0.5rem;
    }

    .tab-content-container {
        padding-top: 48px;
    }

    .tab-content-pane.is-active:has(.cartable-app) {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .card {
        margin-bottom: 0.75rem;
    }

    .card-header.d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .card-header .card-title {
        font-size: 1rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .btn {
        min-height: 38px;
    }

    .table {
        font-size: 0.8125rem;
    }

    .table th,
    .table td {
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    .dashboard-chart {
        height: 250px !important;
        max-height: 45vh;
    }

    .excel-filter {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 65vh;
        border-radius: 0.75rem 0.75rem 0 0;
        z-index: 1000001;
    }

    .modal-body {
        padding: 0.75rem;
    }

    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
}

/* Prevent layout horizontal bleed */
html,
body {
    overflow-x: clip;
}

.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    width: 96px;
    height: 96px;
    overflow: visible;
    vertical-align: middle;
}

.profile-avatar-wrap .avatar {
    width: 96px !important;
    height: 96px !important;
}

.profile-avatar-change {
    position: absolute;
    inset-inline-end: -2px;
    bottom: -2px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
    color: #fff;
    background: var(--app-link-color, #004f22);
    border: 2px solid var(--app-card-bg, #fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    z-index: 3;
}

.profile-avatar-change:hover {
    filter: brightness(1.08);
}

.profile-avatar-change.is-busy {
    pointer-events: none;
    opacity: 0.85;
}

.profile-avatar-change i,
.profile-avatar-change .spinner-border {
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
}

.profile-avatar-wrap input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    z-index: 4;
}

.wrapper {
    max-width: 100vw;
}

@media (max-width: 768px) {
    html,
    body {
        overscroll-behavior-y: none;
    }

    .wrapper,
    .main-content,
    .content-wrapper,
    .tab-content-container {
        overscroll-behavior-y: none;
    }
}
