/*@import '../fonts/vazir/Vazirmatn-font-face.css';*/
@import '../fonts/IRANSANS/IRANSANS-font-face.css';
@import '../fonts/Google/google-fonts.css';

.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;
}

.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;
}

.min-vh-100 {
    min-height: 100vh;
}

.mud-popover {
    left: 0;
}

.mud-dialog-content {
    overflow: hidden !important;
}

.mud-picker-calendar-header-switch {
    direction: rtl;
}

.mud-pagination {
    gap: 0px !important;
    padding-left: 0px !important;
}

.mud-alert-message {
    line-height: normal;
    text-align: justify;
}

.box-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow-y: auto;
    background: radial-gradient(circle at 12% 12%, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, var(--mud-palette-background) 75%) !important;
    background-color: var(--mud-palette-background) !important;
    transition: background 0.4s ease, background-color 0.4s ease;
}

.glass-card {
    border-radius: 24px;
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    margin: 4vh auto;
    text-align: center;
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.18) !important;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.12) 0%, rgba(var(--mud-palette-surface-rgb), 0.4) 50%, rgba(var(--mud-palette-surface-rgb), 0.25) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.3) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    color: var(--mud-palette-text-primary) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Brand (GoldEx) */
.brand-text {
    font-family: "Cinzel Decorative", serif;
    font-size: clamp(2rem, 8vw, 3.5rem); /* Scales with screen width */
    font-weight: 700;
    background-image: linear-gradient(90deg, 
        var(--mud-palette-primary) 0%, 
        var(--mud-palette-primary) 38%, 
        rgba(255, 255, 255, 0.9) 50%, 
        var(--mud-palette-primary) 62%, 
        var(--mud-palette-primary) 100%
    ) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: inline-block;
    letter-spacing: 1px;
    margin-top: 0.2rem;
    direction: ltr; /* Fix mixed direction rendering */
    background-size: 200% 100% !important; /* Force the correct size */
    background-position: 120% center;
    /*animation: shine 6s linear infinite;*/ /* انیمیشن اصلی */
}

/*@keyframes shine {
    0% {
        background-position: 120% center;
    }

    100% {
        background-position: -20% center;
    }
}*/

/* Dashboard card */

.dashboard-card {
    min-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

.dashboard-grid .mud-grid-item {
    display: flex;
}

    .dashboard-grid .mud-grid-item > * {
        flex: 1;
    }

.mud-card-header-actions {
    margin-top: 0px !important;
}

/* Dashboard card */

/* Mobile Navbar */
.mud-toolbar > .mud-navmenu {
    display: flex;
    flex: 1 1 auto !important;
    justify-content: space-between;
    height: max-content;
}

    .mud-toolbar > .mud-navmenu > .mud-nav-item {
        height: 80px;
        align-items: center;
    }

        .mud-toolbar > .mud-navmenu > .mud-nav-item > .mud-nav-link {
            padding: 0px !important;
            align-items: center;
            flex-direction: column;
            gap: 6px;
        }

            .mud-toolbar > .mud-navmenu > .mud-nav-item > .mud-nav-link > .mud-nav-link-text {
                font-size: 14px;
                text-align: center !important;
                margin: 0px !important;
            }

.mobile-navbar {
    height: max-content !important;
}
/* Mobile Navbar */

.responsive-table {
    height: calc(100vh - 266px);
}

@media (min-width: 960px) {
    .responsive-table {
        height: calc(100vh - 276px);
    }
}

.responsive-table-paginated {
    height: calc(100vh - 374px);
}

@media (min-width: 960px) {
    .responsive-table-paginated {
        height: calc(100vh - 348px);
    }
}

.responsive-table-paginated-sortable {
    height: calc(100vh - 410px);
}

@media (min-width: 960px) {
    .responsive-table-paginated-sortable {
        height: calc(100vh - 348px);
    }
}

.tooltip-ltr {
    direction: ltr;
    text-align: left;
}

.tooltip-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: block;
}

.dynamic-attr {
    display: block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.overview-card {
    height: 100%;
    transition: all 0.2s ease;
}

    .overview-card:hover {
        transform: translateY(-2px);
    }

.stats-number {
    direction: ltr;
    text-align: left;
    width: 100%;
}

.sankey-container {
    height: 100%;
    min-height: 450px;
}

.overview-card {
    height: 100%;
    transition: all 0.2s ease;
}

    .overview-card:hover {
        transform: translateY(-2px);
    }

.clickable-card {
    cursor: pointer;
}

.stats-number {
    direction: ltr;
    text-align: left;
    width: 100%;
}

.mud-table-row-child {
    background-color: rgba(0, 0, 0, 0.10);
}

.mud-collapse-container {
    transition: grid-template-rows 500ms ease-in-out !important;
}

.ltr-text {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.serial-number {
    direction: ltr;
    unicode-bidi: plaintext;
    font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 0.82rem;
    word-break: break-all;
    overflow-wrap: anywhere;
    line-height: 1.4;
    max-width: 100%;
}

.chart-card {
    min-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mud-charts-legend {
    flex-wrap: wrap !important;
    justify-content: center !important;
}

    .chart-card:hover {
        transform: translateY(-3px);
    }

.chart-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mud-tabs-tabbar {
    background-color: var(--mud-palette-background-grey);
    padding: 0.5rem;
    gap: 0.5rem;
}

.mud-tab {
    min-height: 52px;
    border-radius: 12px;
    transition: all 0.2s ease;
    padding-inline: 1rem;
}

    .mud-tab:hover {
        background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
    }

    .mud-tab.mud-tab-active {
        background-color: rgba(var(--mud-palette-primary-rgb), 0.12);
    }

    .mud-tab .mud-icon-root {
        transition: transform 0.2s ease;
    }

    .mud-tab:hover .mud-icon-root {
        transform: scale(1.08);
    }

/* RTL MudTabs Mobile Touch & Overflow Fix */
.mud-tabs-tabbar-inner,
.mud-tabs-tabbar-content {
    direction: rtl;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mud-tabs-tabbar-content::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {

    .mud-tabs-tabbar {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
    }

    .mud-tab {
        flex: 1 1 0%;
        min-width: max-content;
        padding-inline: 0.75rem;
    }
}

/* Product Trend Header Responsive Layout */
.product-trend-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.trend-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 767.98px) {
    .product-trend-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title mode"
            "period period";
        gap: 0.75rem;
    }

    .trend-title {
        grid-area: title;
    }

    .trend-controls-wrapper {
        display: contents;
    }

    .trend-mode {
        grid-area: mode;
        justify-self: end;
    }

    .trend-period {
        grid-area: period;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.events-search {
    min-width: 300px;
}

@media (max-width: 768px) {
    .events-search {
        min-width: 0px;
    }
}

/* ==========================================================================
   LAYOUT COMPONENTS (GLASSMORPHISM & LIQUID GLASS)
   ========================================================================== */

/* --- AppBar Section --- */
.fancy-appbar {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, rgba(var(--mud-palette-surface-rgb), 0.25) 50%, rgba(var(--mud-palette-surface-rgb), 0.05) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.2) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    transform: translateZ(0);
    border-bottom: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2) !important;
    box-shadow: 0px 4px 30px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    color: var(--mud-palette-text-primary) !important;
}

.fancy-appbar .mud-toolbar {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-inline: 16px !important;
}

.appbar-col-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.appbar-col-center {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.appbar-col-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.appbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
    margin: 0;
    padding: 0;
    line-height: 1.2;
    display: inline-block;
}

.appbar-title.brand-text {
    font-size: 1.2rem !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    display: inline-block !important;
}

@media (max-width: 600px) {
    .hide-logo-mobile {
        display: none !important;
    }
}

/* --- Mobile Navigation Section --- */
.mobile-nav-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, rgba(var(--mud-palette-surface-rgb), 0.25) 50%, rgba(var(--mud-palette-surface-rgb), 0.05) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.2) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    transform: translateZ(0);
    box-shadow: 0px -4px 30px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-top: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2) !important;
    border-radius: 24px 24px 24px 24px;
    z-index: 1200;
    justify-content: center !important;
    align-items: center !important;
    box-sizing: border-box !important;
    margin: 10px;
}

.mobile-nav-bar {
    width: 100%;
    max-width: 450px;
    height: 100%;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box !important;
}

.mobile-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none;
    color: var(--mud-palette-text-secondary);
    width: 80px;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box !important;
}

.mobile-nav-icon-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    background-color: transparent;
    color: var(--mud-palette-text-secondary);
    opacity: 0.6;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box !important;
}

.mobile-nav-icon-wrapper .mud-icon-root {
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-nav-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    opacity: 0.8;
    margin-top: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box !important;
    display: flex;
    justify-content: center;
}

.mobile-nav-item.active {
    color: var(--mud-palette-primary);
}

.mobile-nav-item.active .mobile-nav-icon-wrapper {
    transform: translateY(-20px);
    background: rgba(var(--mud-palette-surface-rgb), 0.55) !important;
    backdrop-filter: blur(10px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
    box-shadow: 0px 8px 24px rgba(var(--mud-palette-primary-rgb), 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    opacity: 1;
    color: var(--mud-palette-primary);
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.3) !important;
}

.mobile-nav-item.active .mobile-nav-label {
    opacity: 1;
    color: var(--mud-palette-primary);
    font-weight: 700;
    transform: translateY(-6px);
}

/* Glassmorphic Popover Menu */
.mobile-nav-popover {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, rgba(var(--mud-palette-surface-rgb), 0.3) 50%, rgba(var(--mud-palette-surface-rgb), 0.05) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.25) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2) !important;
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    border-radius: 16px !important;
    padding: 8px 0 !important;
    margin-bottom: 12px !important;
    min-width: 150px !important;
}

.mobile-nav-popover .mud-list-item {
    color: var(--mud-palette-text-primary) !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    margin: 4px 8px !important;
}

.mobile-nav-popover .mud-list-item:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    color: var(--mud-palette-primary) !important;
}

.mobile-nav-popover .mud-list-item-icon {
    color: inherit !important;
}

/* Mobile Nav Add Button styling */
.mobile-nav-add-btn-wrapper {
    cursor: pointer;
}
.mobile-nav-add-btn {
    background-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text) !important;
    box-shadow: 0px 8px 24px rgba(var(--mud-palette-primary-rgb), 0.45) !important;
    opacity: 1 !important;
    transform: scale(1.1);
    border: 3px solid var(--mud-palette-surface) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.mobile-nav-add-btn-wrapper:hover .mobile-nav-add-btn,
.mobile-nav-add-btn-wrapper:active .mobile-nav-add-btn {
    transform: scale(1.15);
    box-shadow: 0px 10px 28px rgba(var(--mud-palette-primary-rgb), 0.6) !important;
}

/* Backdrop Overlay with Blur */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1100;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bottom Sheet Container pointing to add button */
.mobile-nav-bottom-sheet {
    position: fixed;
    bottom: 112px; /* positioned above mobile nav bar with more margin */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 450px;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.08) 0%, rgba(var(--mud-palette-surface-rgb), 0.75) 50%, rgba(var(--mud-palette-surface-rgb), 0.45) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.6) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 28px;
    box-shadow: 0px 20px 48px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    z-index: 1150;
    box-sizing: border-box;
    padding: 24px;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pointer Arrow */
.bottom-sheet-arrow {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.75);
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    z-index: -1;
}

/* Grid Layout */
.bottom-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-items: center;
}

/* Bottom Sheet Item */
.bottom-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    padding: 8px 0;
    transition: transform 0.2s ease;
}
.bottom-sheet-item:hover, .bottom-sheet-item:active {
    transform: scale(1.05);
}

/* Bottom Sheet Icon Circle */
.bottom-sheet-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 20px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.bottom-sheet-icon-circle.customer {
    background-color: rgba(var(--mud-palette-secondary-rgb), 0.15);
    color: var(--mud-palette-secondary);
}
.bottom-sheet-icon-circle.purchase {
    background-color: rgba(var(--mud-palette-info-rgb), 0.15);
    color: var(--mud-palette-info);
}
.bottom-sheet-icon-circle.sale {
    background-color: rgba(var(--mud-palette-warning-rgb), 0.15);
    color: var(--mud-palette-warning);
}
.bottom-sheet-icon-circle.payment {
    background-color: rgba(var(--mud-palette-success-rgb), 0.15);
    color: var(--mud-palette-success);
}
.bottom-sheet-icon-circle.invoice {
    background-color: rgba(var(--mud-palette-tertiary-rgb), 0.15);
    color: var(--mud-palette-tertiary);
}
.bottom-sheet-icon-circle.price {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.15);
    color: var(--mud-palette-primary);
}

.bottom-sheet-item:hover .bottom-sheet-icon-circle {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}
.bottom-sheet-item:hover .bottom-sheet-icon-circle.customer {
    background-color: var(--mud-palette-secondary);
    color: var(--mud-palette-secondary-text);
}
.bottom-sheet-item:hover .bottom-sheet-icon-circle.purchase {
    background-color: var(--mud-palette-info);
    color: var(--mud-palette-info-text);
}
.bottom-sheet-item:hover .bottom-sheet-icon-circle.sale {
    background-color: var(--mud-palette-warning);
    color: var(--mud-palette-warning-text);
}
.bottom-sheet-item:hover .bottom-sheet-icon-circle.payment {
    background-color: var(--mud-palette-success);
    color: var(--mud-palette-success-text);
}
.bottom-sheet-item:hover .bottom-sheet-icon-circle.invoice {
    background-color: var(--mud-palette-tertiary);
    color: var(--mud-palette-tertiary-text);
}
.bottom-sheet-item:hover .bottom-sheet-icon-circle.price {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

/* Bottom Sheet Label */
.bottom-sheet-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* --- Drawer Section --- */
.fancy-drawer {
    color: var(--mud-palette-text-primary) !important;
    overflow-x: hidden !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: calc(var(--mud-zindex-appbar) + 2) !important;
}

.fancy-drawer.dark-mode {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, rgba(var(--mud-palette-surface-rgb), 0.25) 50%, rgba(var(--mud-palette-surface-rgb), 0.05) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.2) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    transform: translateZ(0);
    border-inline-end: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2) !important;
    box-shadow: 4px 0px 30px rgba(0, 0, 0, 0.03), inset 1px 0 0 rgba(255, 255, 255, 0.2) !important;
}

.fancy-drawer.light-mode {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.06) 0%, rgba(var(--mud-palette-surface-rgb), 0.5) 50%, rgba(var(--mud-palette-surface-rgb), 0.4) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.45) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    transform: translateZ(0);
    border-inline-end: 1px solid rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    box-shadow: 4px 0px 30px rgba(0, 0, 0, 0.02), inset 1px 0 0 rgba(255, 255, 255, 0.6) !important;
}

/* --- Notifications Drawer --- */
.notifications-drawer {
    color: var(--mud-palette-text-primary) !important;
    overflow-x: hidden !important;
    top: 0 !important;
    height: 100vh !important;
    z-index: calc(var(--mud-zindex-appbar) + 2) !important;
}

.notifications-drawer.dark-mode {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, rgba(var(--mud-palette-surface-rgb), 0.25) 50%, rgba(var(--mud-palette-surface-rgb), 0.05) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.2) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    transform: translateZ(0);
    border-inline-start: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2) !important;
    box-shadow: -4px 0px 30px rgba(0, 0, 0, 0.03), inset -1px 0 0 rgba(255, 255, 255, 0.2) !important;
}

.notifications-drawer.light-mode {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.06) 0%, rgba(var(--mud-palette-surface-rgb), 0.5) 50%, rgba(var(--mud-palette-surface-rgb), 0.4) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.45) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    transform: translateZ(0);
    border-inline-start: 1px solid rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    box-shadow: -4px 0px 30px rgba(0, 0, 0, 0.02), inset -1px 0 0 rgba(255, 255, 255, 0.6) !important;
}

@media (max-width: 600px) {
    .notifications-drawer {
        --mud-drawer-width: 100vw !important;
        width: var(--mud-drawer-width) !important;
    }
}
@media (min-width: 601px) {
    .notifications-drawer {
        --mud-drawer-width: 400px !important;
        width: var(--mud-drawer-width) !important;
    }
}

/* --- Notification Card & Items --- */
.notification-card {
    background-color: rgba(var(--mud-palette-surface-rgb), 0.5) !important;
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.1) !important;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
}

.notification-card:hover {
    transform: translateY(-2px);
    background-color: rgba(var(--mud-palette-surface-rgb), 0.5) !important;
    border-color: rgba(var(--mud-palette-primary-rgb), 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.notification-card.unread {
    border-inline-start: 4px solid var(--mud-palette-primary) !important;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04) !important;
}

.notification-card.unread:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08) !important;
}

.notification-icon-wrapper {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.unread-dot {
    width: 8px;
    height: 8px;
    background-color: var(--mud-palette-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-time {
    font-size: 11px !important;
}

/* --- Fixed Footer & Dismiss All Button --- */
.drawer-footer {
    background: linear-gradient(to top, var(--mud-palette-surface) 0%, rgba(var(--mud-palette-surface-rgb), 0.85) 80%, rgba(var(--mud-palette-surface-rgb), 0.0) 100%) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-top: 1px solid rgba(var(--mud-palette-divider-rgb), 0.08) !important;
    z-index: 10;
}

.dismiss-all-btn {
    box-shadow: 0 4px 15px rgba(var(--mud-palette-error-rgb), 0.2) !important;
    transition: all 0.25s ease-in-out !important;
}

.dismiss-all-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(var(--mud-palette-error-rgb), 0.35) !important;
}


.fancy-drawer .mud-drawer-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-bottom: 10px !important;
    transition: padding 0.25s ease-in-out;
}

/* --- Mini Drawer Desktop Collapsed State Adaptations --- */
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .drawer-header {
    display: none !important;
}

.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .drawer-user-info,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .drawer-palette,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .drawer-shortcuts {
    display: none !important;
}

.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .drawer-content {
    padding-top: 14px !important;
    padding-left: 2px !important;
    padding-right: 2px !important;
}

.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-navmenu {
    padding: 4px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link {
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 4px auto !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    text-indent: -9999px !important;
}

.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link-text,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-group-text,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link span:not(.mud-icon-root),
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link div:not(.mud-ripple) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link .mud-nav-link-icon,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link svg,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link .mud-icon-root {
    margin: 0 !important;
    margin-inline-end: 0 !important;
    margin-inline-start: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    font-size: 1.35rem !important;
    width: 24px !important;
    height: 24px !important;
    color: var(--mud-palette-text-primary) !important;
    text-indent: 0 !important;
}

.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link.active .mud-nav-link-icon,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link.active svg,
.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) .mud-nav-link.active .mud-icon-root {
    color: var(--mud-palette-primary) !important;
}

/* --- Mini Drawer Desktop Layout Spacing & Initial State Fix --- */
@media (min-width: 960px) {
    .fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary) {
        width: var(--mud-drawer-width-mini-right, 56px) !important;
    }

    .fancy-drawer.mud-drawer--open:not(.mud-drawer-temporary) {
        width: var(--mud-drawer-width-right, 280px) !important;
    }

    /* When mini drawer is collapsed (including on initial load before JavaScript triggers) */
    .mud-layout:has(.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary)) .mud-main-content {
        margin-right: var(--mud-drawer-width-mini-right, 56px) !important;
        margin-left: 0 !important;
        transition: margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .mud-layout:has(.fancy-drawer.mud-drawer--closed:not(.mud-drawer-temporary)) .fancy-appbar {
        margin-right: var(--mud-drawer-width-mini-right, 56px) !important;
        margin-left: 0 !important;
        width: calc(100% - var(--mud-drawer-width-mini-right, 56px)) !important;
        transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* When mini drawer is open on desktop */
    .mud-layout:has(.fancy-drawer.mud-drawer--open:not(.mud-drawer-temporary)) .mud-main-content {
        margin-right: var(--mud-drawer-width-right, 280px) !important;
        margin-left: 0 !important;
        transition: margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .mud-layout:has(.fancy-drawer.mud-drawer--open:not(.mud-drawer-temporary)) .fancy-appbar {
        margin-right: var(--mud-drawer-width-right, 280px) !important;
        margin-left: 0 !important;
        width: calc(100% - var(--mud-drawer-width-right, 280px)) !important;
        transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), margin-right 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
}

.drawer-header {
    border-bottom: 1px solid rgba(var(--mud-palette-divider-rgb), 0.08);
    width: 100%;
}

.fancy-drawer.light-mode .drawer-header {
    border-bottom: 1px solid rgba(var(--mud-palette-divider-rgb), 0.15) !important;
}

.shortcut-btn {
    background-color: rgba(var(--mud-palette-action-default-rgb), 0.05) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.1) !important;
    color: var(--mud-palette-text-secondary) !important;
}

.shortcut-btn:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    color: var(--mud-palette-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0px 4px 12px rgba(var(--mud-palette-primary-rgb), 0.15);
}

.fancy-drawer.light-mode .shortcut-btn {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04) !important;
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.22) !important;
    color: var(--mud-palette-primary) !important;
}

.fancy-drawer.light-mode .shortcut-btn:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    border-color: rgba(var(--mud-palette-primary-rgb), 0.45) !important;
    color: var(--mud-palette-primary) !important;
    box-shadow: 0px 4px 12px rgba(var(--mud-palette-primary-rgb), 0.15) !important;
}

.drawer-content {
    width: 100%;
    flex-grow: 0 !important;
}

/* --- Color Palette Selector (ITAM style) --- */
.palette-collection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px;
    justify-content: center;
}

.palette-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.palette-dot:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.palette-dot.selected {
    border-color: var(--mud-palette-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.3) !important;
}

.palette-dot.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* --- Drawer Close Button Styling --- */
.close-drawer-btn {
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.15) !important;
    background-color: rgba(var(--mud-palette-action-default-rgb), 0.03) !important;
    color: var(--mud-palette-text-secondary) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.close-drawer-btn:hover {
    background-color: rgba(var(--mud-palette-error-rgb), 0.08) !important;
    border-color: rgba(var(--mud-palette-error-rgb), 0.3) !important;
    color: var(--mud-palette-error) !important;
    transform: translateY(-1px);
}

.fancy-drawer.light-mode .close-drawer-btn {
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.25) !important;
    background-color: rgba(var(--mud-palette-action-default-rgb), 0.05) !important;
    color: var(--mud-palette-text-primary) !important;
}

.fancy-drawer.light-mode .close-drawer-btn:hover {
    background-color: rgba(var(--mud-palette-error-rgb), 0.1) !important;
    border-color: rgba(var(--mud-palette-error-rgb), 0.4) !important;
    color: var(--mud-palette-error) !important;
}

/* --- Avatar --- */
.profile-avatar {
    background: linear-gradient(135deg, var(--mud-palette-primary), color-mix(in srgb, var(--mud-palette-primary) 70%, white));
}

/* Glassy Action Card */
.action-card {
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.05) 0%, rgba(var(--mud-palette-surface-rgb), 0.65) 50%, rgba(var(--mud-palette-surface-rgb), 0.45) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.5) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    color: var(--mud-palette-text-primary) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px !important;
}

.action-card:hover:not(.locked) {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.12) 0%, rgba(var(--mud-palette-surface-rgb), 0.75) 50%, rgba(var(--mud-palette-surface-rgb), 0.55) 100%) !important;
    border-color: rgba(var(--mud-palette-primary-rgb), 0.35) !important;
    box-shadow: 0 12px 28px rgba(var(--mud-palette-primary-rgb), 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-2px);
}

.action-card.locked {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Glassy Profile Card */
.glassy-card {
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.15) !important;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.05) 0%, rgba(var(--mud-palette-surface-rgb), 0.65) 50%, rgba(var(--mud-palette-surface-rgb), 0.45) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.5) !important;
    backdrop-filter: blur(14px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(130%) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    color: var(--mud-palette-text-primary) !important;
    border-radius: 20px !important;
}

/* ==========================================================================
   GLOBAL MUDBLAZOR GLASSMORPHIC OVERRIDES
   ========================================================================== */

/* Globally style all MudPaper and MudCard components with high-performance surface styling */
.mud-paper:not(.mud-paper-outlined):not(.mud-dialog) {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.03) 0%, rgba(var(--mud-palette-surface-rgb), 0.85) 50%, rgba(var(--mud-palette-surface-rgb), 0.75) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.85) !important;
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

/* Globally style MudDialog containers */
.mud-dialog {
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.1) 0%, rgba(var(--mud-palette-surface-rgb), 0.5) 50%, rgba(var(--mud-palette-surface-rgb), 0.35) 100%) !important;
    background-color: rgba(var(--mud-palette-surface-rgb), 0.4) !important;
    backdrop-filter: blur(16px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(140%) !important;
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2) !important;
    box-shadow: 0px 30px 60px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Globally style popovers and dropdown menus */
.mud-popover-provider .mud-popover:not(.mud-tooltip-popover) {
    background-color: rgba(var(--mud-palette-surface-rgb), 0.75) !important;
    backdrop-filter: blur(12px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(130%) !important;
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2) !important;
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.08) !important;
}

/* Globals: Tooltip Styling */
.mud-tooltip {
    background-color: rgba(33, 33, 33, 0.95) !important;
    color: var(--mud-palette-primary) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
}

/* Make input outlines clearly distinguishable inside glassy surfaces */
.mud-input-outlined-border {
    border-color: rgba(var(--mud-palette-primary-rgb), 0.25) !important;
}
.mud-input-outlined-border:hover {
    border-color: rgba(var(--mud-palette-primary-rgb), 0.45) !important;
}
.mud-input-outlined-border.mud-input-outlined-border-focus {
    border-color: var(--mud-palette-primary) !important;
}

.blur {
    backdrop-filter: blur(5px);
}

.preview-box {
    width: 100%;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-preview {
    height: 80px;
    width: 80px;
    border-radius: 12px;
}

.background-preview {
    height: 100px;
    width: 100%;
}

/* Primary */
.mud-button-outlined-primary:hover {
    border-color: var(--mud-palette-primary) !important;
    background-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text) !important;
}

/* Secondary */
.mud-button-outlined-secondary:hover {
    border-color: var(--mud-palette-secondary) !important;
    background-color: var(--mud-palette-secondary) !important;
    color: var(--mud-palette-secondary-text) !important;
}

/* Tertiary */
.mud-button-outlined-tertiary:hover {
    border-color: var(--mud-palette-tertiary) !important;
    background-color: var(--mud-palette-tertiary) !important;
    color: var(--mud-palette-tertiary-text) !important;
}

/* Info */
.mud-button-outlined-info:hover {
    border-color: var(--mud-palette-info) !important;
    background-color: var(--mud-palette-info) !important;
    color: var(--mud-palette-info-text) !important;
}

/* Success */
.mud-button-outlined-success:hover {
    border-color: var(--mud-palette-success) !important;
    background-color: var(--mud-palette-success) !important;
    color: var(--mud-palette-success-text) !important;
}

/* Warning */
.mud-button-outlined-warning:hover {
    border-color: var(--mud-palette-warning) !important;
    background-color: var(--mud-palette-warning) !important;
    color: var(--mud-palette-warning-text) !important;
}

/* Error */
.mud-button-outlined-error:hover {
    border-color: var(--mud-palette-error) !important;
    background-color: var(--mud-palette-error) !important;
    color: var(--mud-palette-error-text) !important;
}

/* Dark */
.mud-button-outlined-dark:hover {
    border-color: var(--mud-palette-dark) !important;
    background-color: var(--mud-palette-dark) !important;
    color: var(--mud-palette-dark-text) !important;
}

/* ==========================================================================
   WASM LOADING SPLASH SCREEN (Cloudflare-style)
   ========================================================================== */

#app-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    transition: opacity 0.3s ease;
}

#app-loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Override .brand-text inside splash with hardcoded colors.
   The global .brand-text uses var(--mud-palette-primary) which isn't
   available yet before MudBlazor CSS loads, making the text invisible. */
#app-loading .brand-text {
    background-image: linear-gradient(90deg,
        #2563eb 0%,
        #2563eb 38%,
        rgba(255, 255, 255, 0.9) 50%,
        #2563eb 62%,
        #2563eb 100%
    ) !important;
    -webkit-text-fill-color: transparent !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

#app-loading .splash-store-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
}

.splash-progress-track {
    width: 180px;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.splash-progress-bar {
    width: 40%;
    height: 100%;
    background: #2563eb;
    border-radius: 2px;
    animation: splash-progress 1.8s ease-in-out infinite;
}

@keyframes splash-progress {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ==========================================================================
   CUSTOM CUSTOMERS CARD VIEW & DEDICATED DETAIL PAGE (RTL)
   ========================================================================== */

/* Customers Card Grid Virtualization Wrapper */
.customer-list-scroll-container {
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: hidden;
/*    padding: 12px;
    border-radius: 16px;*/
/*    background: rgba(var(--mud-palette-surface-rgb), 0.2);*/
    /*border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.08);
    direction: rtl;*/
}

/* Blazor Virtualize Spacer adjustment inside MudGrid */
.mud-grid > div[style*="height"] {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Card item */
.customer-list-card {
    background-color: rgba(var(--mud-palette-surface-rgb), 0.85) !important;
    border-radius: 20px !important;
    padding: 24px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
}

.customer-list-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.3), transparent 70%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.customer-list-card:hover {
    border-color: rgba(var(--mud-palette-primary-rgb), 0.5) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 0 20px rgba(var(--mud-palette-primary-rgb), 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
}

.customer-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(var(--mud-palette-primary-rgb), 0.15) 0%, rgba(var(--mud-palette-primary-rgb), 0.03) 100%) !important;
    border: 1px solid rgba(var(--mud-palette-primary-rgb), 0.2) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mud-palette-primary) !important;
    transition: all 0.3s ease;
}

.customer-list-card:hover .customer-card-avatar {
    background: linear-gradient(135deg, var(--mud-palette-primary) 0%, rgba(var(--mud-palette-primary-rgb), 0.8) 100%) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(var(--mud-palette-primary-rgb), 0.35);
}

.customer-card-details {
    flex: 1;
    margin-right: 16px;
    text-align: right;
}

.customer-card-details h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--mud-palette-text-primary);
}

.customer-card-details p {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
}

.customer-card-financials {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.customer-card-financials .label {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
    display: block;
    margin-bottom: 2px;
}

.customer-card-financials .balance {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.customer-card-financials .balance.debit {
    color: var(--mud-palette-error);
}

.customer-card-financials .balance.credit {
    color: var(--mud-palette-success);
}

.customer-card-financials .balance.settled {
    color: var(--mud-palette-text-secondary);
}

.customer-card-financials .balance-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
    display: inline-block;
}

.customer-card-financials .balance-badge.debit {
    background-color: rgba(var(--mud-palette-error-rgb), 0.12);
    color: var(--mud-palette-error);
    border: 1px solid rgba(var(--mud-palette-error-rgb), 0.2);
}

.customer-card-financials .balance-badge.credit {
    background-color: rgba(var(--mud-palette-success-rgb), 0.12);
    color: var(--mud-palette-success);
    border: 1px solid rgba(var(--mud-palette-success-rgb), 0.2);
}

.customer-card-financials .balance-badge.settled {
    background-color: rgba(var(--mud-palette-text-secondary-rgb), 0.1);
    color: var(--mud-palette-text-secondary);
    border: 1px solid rgba(var(--mud-palette-text-secondary-rgb), 0.15);
}

/* Skeleton Loading Effects */
.customer-list-card.skeleton {
    cursor: default;
    pointer-events: none;
}

.skeleton-avatar {
    background: linear-gradient(90deg, rgba(var(--mud-palette-text-secondary-rgb), 0.05) 25%, rgba(var(--mud-palette-text-secondary-rgb), 0.12) 37%, rgba(var(--mud-palette-text-secondary-rgb), 0.05) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(var(--mud-palette-text-secondary-rgb), 0.05) 25%, rgba(var(--mud-palette-text-secondary-rgb), 0.12) 37%, rgba(var(--mud-palette-text-secondary-rgb), 0.05) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

.skeleton-line.title {
    width: 60%;
    height: 16px;
}

.skeleton-line.text {
    width: 80%;
}

.skeleton-line.value {
    width: 70px;
    height: 16px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

/* ==========================================================================
   CUSTOMER DETAIL PAGE STYLING
   ========================================================================== */

/* Profile summary card */
.customer-profile-card {
    background: linear-gradient(135deg, var(--mud-palette-surface), rgba(var(--mud-palette-primary-rgb), 0.04));
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.15);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    box-shadow: var(--mud-elevation-2);
}

.detail-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.08);
    border: 2px solid var(--mud-palette-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mud-palette-primary);
}

.detail-profile-info {
    flex: 1;
    min-width: 220px;
    text-align: right;
}

.detail-profile-info h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--mud-palette-text-primary);
}

.detail-profile-info p {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.detail-profile-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.detail-prof-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.detail-prof-stat .label {
    font-size: 11px;
    color: var(--mud-palette-text-secondary);
}

.detail-prof-stat .val {
    font-size: 14px;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

@media (max-width: 600px) {
    .customer-profile-card {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 20px !important;
        gap: 16px !important;
    }
    
    .detail-profile-info {
        text-align: center !important;
        width: 100% !important;
    }
    
    .detail-profile-info p {
        justify-content: center !important;
    }
    
    .detail-profile-stats {
        align-items: center !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 24px !important;
        width: 100% !important;
        border-top: 1px solid rgba(var(--mud-palette-divider-rgb), 0.1);
        padding-top: 16px !important;
        margin-top: 8px !important;
    }
    
    .detail-prof-stat {
        align-items: center !important;
    }
}

/* Month Selector Grid */
.months-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
    width: 100%;
}

.btn-month {
    background-color: var(--mud-palette-surface);
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.15);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    color: var(--mud-palette-text-primary);
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-month:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.04);
    border-color: var(--mud-palette-primary);
}

.btn-month.active {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-info-text);
    border-color: var(--mud-palette-primary);
    box-shadow: 0 4px 10px rgba(var(--mud-palette-primary-rgb), 0.3);
}

/* Monthly ledger summary box (Image Design Match) */
.monthly-summary-box {
    background-color: var(--mud-palette-surface);
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.2);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.summary-header-card {
    background-color: rgba(76, 175, 80, 0.12);
    border-radius: 14px;
    padding: 14px 20px;
    margin-bottom: 16px;
}

.summary-header-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--mud-palette-success-darken, #2e7d32);
    display: block;
}

.summary-header-subtitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--mud-palette-success-darken, #2e7d32);
    margin-top: 2px;
}

.summary-header-icon {
    background: rgba(var(--mud-palette-surface-rgb), 0.7);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-items-list {
    display: flex;
    flex-direction: column;
}

.summary-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(var(--mud-palette-divider-rgb), 0.12);
}

.summary-row-item:last-child {
    border-bottom: none;
}

.summary-row-item .row-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.summary-row-item .row-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

.final-balance-card-modern {
    background-color: rgba(76, 175, 80, 0.08);
    border: 1.5px solid rgba(76, 175, 80, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    text-align: center;
}

.final-balance-card-modern.debit-bg {
    background-color: rgba(244, 67, 54, 0.06);
    border-color: rgba(244, 67, 54, 0.25);
}

.final-balance-card-modern.credit-bg {
    background-color: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.3);
}

.final-balance-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--mud-palette-success-darken, #2e7d32);
    display: block;
    margin-bottom: 4px;
}

.final-balance-card-modern.debit-bg .final-balance-title {
    color: var(--mud-palette-error-darken, #c62828);
}

.final-balance-amount {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 4px 0;
}

.final-balance-status {
    font-size: 0.95rem;
    font-weight: 700;
}

.text-error {
    color: var(--mud-palette-error, #f44336) !important;
}

.text-success {
    color: var(--mud-palette-success, #4caf50) !important;
}

/* Outstanding Balance Display Card inside details */
.final-balance-card {
    background-color: rgba(var(--mud-palette-text-primary-rgb), 0.02);
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.15);
    border-right: 4px solid var(--mud-palette-divider);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
}

.final-balance-card.border-rose {
    border-right-color: var(--mud-palette-error);
    background-color: rgba(var(--mud-palette-error-rgb), 0.05);
}

.final-balance-card.border-emerald {
    border-right-color: var(--mud-palette-success);
    background-color: rgba(var(--mud-palette-success-rgb), 0.05);
}

.final-balance-card.border-gray {
    border-right-color: var(--mud-palette-divider);
}

.final-balance-card .label {
    font-size: 13px;
    color: var(--mud-palette-text-secondary);
    display: block;
    margin-bottom: 4px;
}

.final-balance-card .balance-amount {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
}

.final-balance-card .balance-amount.debit {
    color: var(--mud-palette-error);
}

.final-balance-card .balance-amount.credit {
    color: var(--mud-palette-success);
}

.final-balance-card .balance-status {
    font-size: 13px;
    font-weight: 600;
}

.final-balance-card .balance-status.debit {
    color: var(--mud-palette-error);
}

.final-balance-card .balance-status.credit {
    color: var(--mud-palette-success);
}

.summary-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.summary-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* Ledger Mobile Card List Styling */
.mobile-ledger-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ledger-mobile-card {
    background-color: var(--mud-palette-surface);
    border: 1px solid rgba(var(--mud-palette-divider-rgb), 0.18);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ledger-mobile-card:active {
    transform: scale(0.99);
}

.ledger-mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(var(--mud-palette-divider-rgb), 0.15);
    margin-bottom: 10px;
}

.ledger-mobile-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ledger-mobile-amount-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--mud-palette-action-default-rgb), 0.04);
    padding: 10px 12px;
    border-radius: 10px;
    margin: 4px 0;
}

.badge-status-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.badge-status-pill.credit-pill {
    background-color: rgba(76, 175, 80, 0.15);
    color: var(--mud-palette-success-darken, #2e7d32);
}

.badge-status-pill.debit-pill {
    background-color: rgba(244, 67, 54, 0.15);
    color: var(--mud-palette-error-darken, #c62828);
}

.badge-status-pill.settled-pill {
    background-color: rgba(158, 158, 158, 0.15);
    color: var(--mud-palette-text-secondary);
}

.ledger-mobile-card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(var(--mud-palette-divider-rgb), 0.1);
}

/* ==========================================================================
   Compact Trend Tabs & Mobile Optimization for ProductTrendChart
   ========================================================================== */
.compact-trend-tabs .mud-tabs-tabbar {
    background-color: var(--mud-palette-surface) !important;
    border-bottom: 1px solid var(--mud-palette-lines-inputs) !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 2px 4px !important;
}

.compact-trend-tabs .mud-tab {
    min-height: 34px !important;
    height: 34px !important;
    padding: 2px 10px !important;
    min-width: unset !important;
    border-radius: 8px !important;
}

.compact-trend-tabs .mud-tab-text {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
}

.compact-trend-tabs .mud-tab-icon {
    font-size: 1.1rem !important;
    margin-inline-end: 4px !important;
}

.product-trend-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.trend-top-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

@media (max-width: 600px) {
    .compact-trend-tabs .mud-tabs-tabbar {
        min-height: 32px !important;
        height: 32px !important;
        padding: 1px 2px !important;
    }

    .compact-trend-tabs .mud-tab {
        min-height: 30px !important;
        height: 30px !important;
        padding: 1px 6px !important;
    }

    .compact-trend-tabs .mud-tab-text {
        font-size: 0.72rem !important;
        line-height: 1.2 !important;
    }

    .compact-trend-tabs .mud-tab-icon {
        font-size: 0.9rem !important;
        margin-inline-end: 2px !important;
    }

    .product-trend-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .trend-top-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }

    .trend-title {
        white-space: nowrap !important;
    }

    .trend-mode {
        display: flex !important;
        justify-content: flex-end !important;
    }

    .trend-period {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .trend-period .mud-toggle-group {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
    }

    .trend-period .mud-toggle-item {
        flex: 1 1 0px !important;
        text-align: center !important;
        padding-inline: 2px !important;
    }

    .trend-period .mud-toggle-item .mud-typography {
        font-size: 0.72rem !important;
        white-space: nowrap !important;
    }
}

/* ==========================================================================
   PERFORMANCE & ACCESSIBILITY FALLBACK (Reduced Motion / Low Power Hardware)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}