/* SurviveManagement Custom Styles & Design System */

:root {
    --font-fa: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-en: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[lang="fa"] body {
    font-family: var(--font-fa) !important;
    font-feature-settings: "ss01" on; /* Standard Persian Digits for Vazirmatn */
}

html[lang="en"] body {
    font-family: var(--font-en) !important;
}

/* Preserve Font Awesome Icons font-family */
i[class*="fa-"], [class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

/* Custom Category Dropdown Component Styling */
.custom-cat-dropdown .dropdown-menu {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    z-index: 1060;
}

[data-bs-theme="light"] .custom-cat-dropdown .dropdown-menu {
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
}

.custom-cat-dropdown .dropdown-item {
    color: #f8fafc !important;
    font-family: var(--font-fa) !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

[data-bs-theme="light"] .custom-cat-dropdown .dropdown-item {
    color: #0f172a !important;
}

.custom-cat-dropdown .dropdown-item:hover,
.custom-cat-dropdown .dropdown-item.active {
    background-color: rgba(99, 102, 241, 0.2) !important;
    color: #818cf8 !important;
}

/* Overview Summary Table Category Row Interactive Styling */
.category-summary-row {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, transform 0.1s ease;
}

.category-summary-row:hover {
    background-color: rgba(99, 102, 241, 0.08) !important;
}

[data-bs-theme="dark"] .category-summary-row:hover {
    background-color: rgba(99, 102, 241, 0.15) !important;
}

.category-summary-row:hover .cat-name-link {
    color: #6366f1 !important;
    text-decoration: underline;
}

.category-summary-row:hover i {
    opacity: 1 !important;
    transform: translateX(-3px);
}

html[dir="ltr"] .category-summary-row:hover i {
    transform: translateX(3px);
}

/* Modal Close Button Alignment in RTL */
html[dir="rtl"] .modal-header .btn-close {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Currency Font & Text Alignment Differentiation */
.usd-val {
    font-family: var(--font-en) !important;
    direction: ltr !important;
    unicode-bidi: embed;
}

html[dir="rtl"] .usd-val,
html[dir="rtl"] td.usd-val {
    text-align: right !important;
}

html[dir="ltr"] .usd-val,
html[dir="ltr"] td.usd-val {
    text-align: left !important;
}

.irt-val {
    font-family: var(--font-fa) !important;
}

html[dir="rtl"] .irt-val,
html[dir="rtl"] td.irt-val {
    text-align: right !important;
}

html[dir="ltr"] .irt-val,
html[dir="ltr"] td.irt-val {
    text-align: left !important;
}

/* Ensure consistent table cell alignment in RTL / LTR */
html[dir="rtl"] .table th,
html[dir="rtl"] .table td {
    text-align: right;
}

html[dir="ltr"] .table th,
html[dir="ltr"] .table td {
    text-align: left;
}

/* Interactive Sortable Table Headers */
#assets-table-header th[data-sort] {
    transition: background-color 0.15s ease, color 0.15s ease;
}

#assets-table-header th[data-sort]:hover {
    background-color: rgba(99, 102, 241, 0.12) !important;
    color: var(--bs-primary) !important;
}



/* Dynamic Cursor Pointer for Custom Tabs & Buttons */
.cursor-pointer {
    cursor: pointer;
}

/* Custom Soft Color Utilities for Light/Dark mode */
.bg-emerald-subtle {
    background-color: rgba(16, 185, 129, 0.12) !important;
}

.border-emerald {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.text-emerald {
    color: #10b981 !important;
}

.bg-emerald {
    background-color: rgba(16, 185, 129, 0.2) !important;
}

.bg-cyan-subtle {
    background-color: rgba(6, 182, 212, 0.12) !important;
}

.border-cyan {
    border-color: rgba(6, 182, 212, 0.3) !important;
}

.text-cyan {
    color: #06b6d4 !important;
}

.bg-cyan {
    background-color: rgba(6, 182, 212, 0.2) !important;
}

.bg-purple {
    background-color: rgba(168, 85, 247, 0.2) !important;
}

.text-purple {
    color: #a855f7 !important;
}

.bg-amber {
    background-color: rgba(245, 158, 11, 0.2) !important;
}

.text-amber {
    color: #f59e0b !important;
}

.bg-indigo-subtle {
    background-color: rgba(99, 102, 241, 0.1) !important;
}

.border-indigo {
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.bg-indigo {
    background-color: rgba(99, 102, 241, 0.2) !important;
}

.text-indigo {
    color: #6366f1 !important;
}

.bg-purple-subtle {
    background-color: rgba(168, 85, 247, 0.1) !important;
}

.border-purple {
    border-color: rgba(168, 85, 247, 0.3) !important;
}

/* --- Circular Action Buttons in Tables --- */
.action-btn-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    cursor: pointer;
    margin: 0 2px;
}

.action-btn-edit {
    background-color: rgba(99, 102, 241, 0.12);
    color: #6366f1;
}

.action-btn-edit:hover {
    background-color: #6366f1;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.action-btn-delete {
    background-color: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.action-btn-delete:hover {
    background-color: #ef4444;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
}

/* --- Header Segmented Language Switcher --- */
.lang-toggle-pill {
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.lang-btn {
    height: 30px;
    padding: 0 14px;
    font-size: 0.82rem;
    font-weight: 700;
    border: none;
    border-radius: 50rem;
    color: var(--bs-secondary-color);
    background: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    color: var(--bs-body-color);
}

.lang-btn.active-lang {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
}

/* --- Custom Glassmorphism Month Picker Dropdown Component --- */
.custom-month-dropdown .header-month-picker {
    height: 38px;
    background: rgba(99, 102, 241, 0.12) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 50rem !important;
    padding: 0 16px !important;
    color: var(--bs-body-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
}

.custom-month-dropdown .header-month-picker:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

/* Glassmorphism User Profile Button */
.header-user-profile-btn {
    height: 38px;
    background: rgba(99, 102, 241, 0.12) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 50rem !important;
    padding: 0 12px 0 14px !important;
    color: var(--bs-body-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
}

html[dir="ltr"] .header-user-profile-btn {
    padding: 0 14px 0 12px !important;
}

.header-user-profile-btn:hover {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

[data-bs-theme="light"] .header-user-profile-btn {
    background: rgba(79, 70, 229, 0.08) !important;
    border-color: rgba(79, 70, 229, 0.25) !important;
}

.user-avatar-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}


.glass-dropdown-menu {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 1.15rem !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(99, 102, 241, 0.2) !important;
    padding: 8px !important;
    min-width: 190px;
    z-index: 1080;
}

[data-bs-theme="light"] .glass-dropdown-menu {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.15) !important;
}

/* RTL / LTR Dynamic Alignment for Dropdowns */
html[dir="rtl"] .glass-dropdown-menu,
html[dir="rtl"] .custom-cat-dropdown .dropdown-menu {
    text-align: right !important;
    direction: rtl !important;
}

html[dir="ltr"] .glass-dropdown-menu,
html[dir="ltr"] .custom-cat-dropdown .dropdown-menu {
    text-align: left !important;
    direction: ltr !important;
}

html[dir="rtl"] .glass-dropdown-menu .dropdown-item,
html[dir="rtl"] .custom-cat-dropdown .dropdown-item {
    text-align: right !important;
    direction: rtl !important;
}

html[dir="ltr"] .glass-dropdown-menu .dropdown-item,
html[dir="ltr"] .custom-cat-dropdown .dropdown-item {
    text-align: left !important;
    direction: ltr !important;
}

.glass-dropdown-menu .dropdown-item {
    color: var(--bs-body-color) !important;
    font-size: 0.92rem;
    padding: 9px 14px;
    border-radius: 0.5rem;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

html[dir="fa"] .glass-dropdown-menu .dropdown-item,
html[lang="fa"] .glass-dropdown-menu .dropdown-item {
    font-family: var(--font-fa) !important;
}

html[lang="en"] .glass-dropdown-menu .dropdown-item {
    font-family: var(--font-en) !important;
}

.glass-dropdown-menu .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #818cf8 !important;
}

html[dir="rtl"] .glass-dropdown-menu .dropdown-item:hover {
    transform: translateX(-3px);
}

html[dir="ltr"] .glass-dropdown-menu .dropdown-item:hover {
    transform: translateX(3px);
}

.glass-dropdown-menu .active-month-item {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #818cf8 !important;
    font-weight: 700 !important;
}

/* Custom dropdown check icon — hidden by default, shown for active item */
.glass-dropdown-menu .dropdown-item .check-icon {
    opacity: 0;
    color: #818cf8;
    transition: opacity 0.15s;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.glass-dropdown-menu .dropdown-item.active-month-item .check-icon {
    opacity: 1;
}

[data-bs-theme="light"] .header-month-picker {
    background: rgba(79, 70, 229, 0.08) !important;
    border-color: rgba(79, 70, 229, 0.25) !important;
}

/* Circular Theme Button */
.theme-btn-round {
    width: 38px;
    height: 38px;
    border-radius: 50rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bs-border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--bs-body-color);
    transition: all 0.2s ease;
}

.theme-btn-round:hover {
    background: var(--bs-secondary-bg);
    border-color: var(--bs-border-color-translucent);
}

.theme-btn-round.privacy-active {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}


/* --- Smart Autocomplete Suggestions Box --- */
.autocomplete-suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 220px;
    overflow-y: auto;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
}

.autocomplete-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    transition: background-color 0.15s ease;
}

.autocomplete-suggestion-item:last-child {
    border-bottom: none;
}

.autocomplete-suggestion-item:hover,
.autocomplete-suggestion-item.active-item {
    background-color: rgba(99, 102, 241, 0.15);
}

.autocomplete-cat-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 50rem;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}

/* Browser Tab Bar Styling & Horizontal Smooth Scroll */
.browser-tab-bar {
    min-height: 48px;
}

.tabs-scroll-container {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    padding-bottom: 2px;
}

.tab-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background-color: transparent;
    transition: all 0.15s ease-in-out;
    user-select: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.tab-item:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.tab-item.active {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-primary) !important;
    border-color: var(--bs-border-color) !important;
    border-bottom-color: var(--bs-body-bg) !important;
    font-weight: 700;
}

.tab-close-btn {
    opacity: 0.5;
    transition: opacity 0.15s ease;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-close-btn:hover {
    opacity: 1;
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Table Hover Smoothness */
.table-hover tbody tr {
    transition: background-color 0.15s ease;
}

/* Scrollbar Styling for Category Tabs */
.tabs-scroll-container::-webkit-scrollbar {
    height: 4px;
}

.tabs-scroll-container::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
    border-radius: 4px;
}

/* --- Authentication & Admin Panel Glassmorphism Styles --- */
.auth-body {
    position: relative;
    background-color: #0f172a;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
}

.auth-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/logo-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(20px) brightness(0.4) contrast(1.1);
    -webkit-filter: blur(20px) brightness(0.4) contrast(1.1);
    transform: scale(1.1);
    z-index: -1;
    pointer-events: none;
    transition: all 0.3s ease;
}

[data-bs-theme="light"] .auth-body {
    background-color: #f8fafc;
}

[data-bs-theme="light"] .auth-body::before {
    filter: blur(20px) brightness(0.85) opacity(0.35);
    -webkit-filter: blur(20px) brightness(0.85) opacity(0.35);
}

.auth-card-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.auth-card {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background: rgba(15, 23, 42, 0.78) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.auth-glow-accent-1 {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    background: rgba(99, 102, 241, 0.35);
    filter: blur(50px);
    border-radius: 50%;
    pointer-events: none;
}

.auth-glow-accent-2 {
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 160px;
    height: 160px;
    background: rgba(6, 182, 212, 0.25);
    filter: blur(50px);
    border-radius: 50%;
    pointer-events: none;
}

/* Custom Auth Input Groups & Icons */
.auth-input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
}

html[dir="rtl"] .auth-input-icon {
    right: 16px;
    left: auto;
}

html[dir="ltr"] .auth-input-icon {
    left: 16px;
    right: auto;
}

.auth-input {
    height: 48px;
    border-radius: 0.75rem !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: var(--bs-body-color) !important;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
}

[data-bs-theme="light"] .auth-input {
    background: rgba(241, 245, 249, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

html[dir="rtl"] .auth-input {
    padding-right: 46px !important;
    padding-left: 16px !important;
}

html[dir="ltr"] .auth-input {
    padding-left: 46px !important;
    padding-right: 16px !important;
}

.auth-input:focus {
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25) !important;
}

[data-bs-theme="light"] .auth-input:focus {
    background: #ffffff !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2) !important;
}

/* Override Browser Autofill Yellowish Background Completely */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

[data-bs-theme="light"] input:-webkit-autofill,
[data-bs-theme="light"] input:-webkit-autofill:hover, 
[data-bs-theme="light"] input:-webkit-autofill:focus, 
[data-bs-theme="light"] input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    -webkit-text-fill-color: #0f172a !important;
}

/* Password Eye Toggle Button */
.auth-toggle-password-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.auth-toggle-password-btn:hover {
    color: #6366f1;
}

html[dir="rtl"] .auth-toggle-password-btn {
    left: 12px;
    right: auto;
}

html[dir="ltr"] .auth-toggle-password-btn {
    right: 12px;
    left: auto;
}

/* PDF & Print Engine Styling */
@page {
    size: A4 portrait;
    margin: 6mm 8mm;
}

@media print {
    /* 1. Global Reset to Pure Light Theme */
    *, *::before, *::after {
        background-color: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html, body, [data-bs-theme="dark"], [data-bs-theme="light"] {
        background-color: #ffffff !important;
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 10pt !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 2. Hide all non-report UI elements */
    header, nav, footer, sidebar, .navbar,
    #top-summary-cards-section, #category-tabs-container, #btn-open-add-category, 
    .tab-item, .lang-toggle-pill, .theme-btn-round, #btn-export-report-pdf, 
    #btn-export-report-csv, .toast-container, .alert, .header-user-profile-btn, 
    .dropdown, .vr, .btn, .action-btn-circle, .input-group, input, modal,
    #view-overview, #view-category-tab {
        display: none !important;
    }

    .container, main {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 3. Force Show & Format Monthly Report View */
    #view-monthly-report {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 4. Cards & Panels Light Theme Styling */
    .card, .glass-panel, .glass-card {
        background-color: #ffffff !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        color: #0f172a !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 8px !important;
        padding: 12px !important;
    }

    /* 5. Headings & Typography */
    h2, h4, h5, h6, .h5 {
        color: #0f172a !important;
        font-weight: 700 !important;
    }

    .text-secondary, .text-muted {
        color: #64748b !important;
    }

    /* 6. Chart Wrapper Light Styling */
    .chart-wrapper {
        background-color: #f8fafc !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        height: 220px !important;
        max-height: 220px !important;
        width: 100% !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    canvas {
        max-width: 100% !important;
        max-height: 200px !important;
    }

    /* 7. Tables Light Theme & Contrast Overrides */
    .table-responsive {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        overflow: visible !important;
    }

    .table, table {
        background-color: #ffffff !important;
        background: #ffffff !important;
        color: #0f172a !important;
        font-size: 9.5pt !important;
        border-collapse: collapse !important;
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .table th, th, .table-light th, thead th {
        background-color: #f1f5f9 !important;
        background: #f1f5f9 !important;
        color: #1e293b !important;
        font-weight: 700 !important;
        padding: 6px 10px !important;
        border-bottom: 2px solid #cbd5e1 !important;
        border-top: none !important;
    }

    .table td, td, tbody td, tr td {
        background-color: #ffffff !important;
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 6px 10px !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    .table-hover > tbody > tr:hover > * {
        background-color: #f8fafc !important;
    }

    /* 8. Text Color Contrast Overrides for Numbers & Growth */
    .text-emerald, .text-success, [class*="text-emerald"], [class*="text-success"] {
        color: #059669 !important;
        font-weight: 600 !important;
    }
    .text-cyan, .text-info, [class*="text-cyan"], [class*="text-info"] {
        color: #0284c7 !important;
        font-weight: 600 !important;
    }
    .text-primary {
        color: #2563eb !important;
    }
}





html[dir="rtl"] .auth-input-group:has(.auth-toggle-password-btn) .auth-input {
    padding-right: 46px !important;
    padding-left: 42px !important;
}

html[dir="ltr"] .auth-input-group:has(.auth-toggle-password-btn) .auth-input {
    padding-left: 46px !important;
    padding-right: 42px !important;
}

/* Crypto Price Fetch Component Styling */
.crypto-fetch-card {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] .crypto-fetch-card {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

.crypto-fetch-title {
    color: #b45309 !important;
}

[data-bs-theme="dark"] .crypto-fetch-title {
    color: #fbbf24 !important;
}

.crypto-fetch-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 50rem;
    background: rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Glassmorphism Price Confirmation Modal Styling */
.glass-modal-content {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

[data-bs-theme="dark"] .glass-modal-content {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

/* Autocomplete Quick Search Field Styling */
.autocomplete-search-input {
    border-radius: 0.75rem !important;
    height: 46px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html[dir="rtl"] .autocomplete-search-input {
    padding-right: 42px !important;
    padding-left: 14px !important;
}

html[dir="ltr"] .autocomplete-search-input {
    padding-left: 42px !important;
    padding-right: 14px !important;
}

.autocomplete-search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    font-size: 1.1rem;
    pointer-events: none;
}

html[dir="rtl"] .autocomplete-search-icon {
    right: 16px;
    left: auto;
}

html[dir="ltr"] .autocomplete-search-icon {
    left: 16px;
    right: auto;
}

/* --- Vertical Category Sidebar & Offcanvas Navigation Styling --- */
.sidebar-tab-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--bs-body-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.92rem;
    text-align: inherit;
    width: 100%;
    margin-bottom: 4px !important;
}

.sidebar-tab-item i {
    margin-left: 0.35rem !important;
    margin-right: 0.35rem !important;
    flex-shrink: 0;
}

.sidebar-tab-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
}

[data-bs-theme="dark"] .sidebar-tab-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.sidebar-tab-item.active {
    background: rgba(99, 102, 241, 0.12) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #6366f1 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

[data-bs-theme="dark"] .sidebar-tab-item.active {
    background: rgba(99, 102, 241, 0.22) !important;
    border: 1px solid rgba(99, 102, 241, 0.4) !important;
    color: #a5b4fc !important;
}

.sidebar-tab-item .tab-close-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    transition: all 0.15s ease;
}

.sidebar-tab-item .tab-close-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* TradingView Style Glassmorphism Offcanvas Side Panel Drawer */
.glass-offcanvas-sidebar {
    width: 340px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: none !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.2) !important;
}

[data-bs-theme="dark"] .glass-offcanvas-sidebar {
    background: rgba(19, 23, 34, 0.96) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: none !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.7) !important;
}

/* Offcanvas Side Panel Positioning for RTL (Persian Right) and LTR (English Left) */
html[dir="rtl"] #sidebar-categories-offcanvas.offcanvas,
html[dir="rtl"] #sidebar-categories-offcanvas.offcanvas-start {
    top: 0;
    right: 0 !important;
    left: auto !important;
    transform: translateX(100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-right: none !important;
}

html[dir="rtl"] #sidebar-categories-offcanvas.offcanvas.show,
html[dir="rtl"] #sidebar-categories-offcanvas.offcanvas-start.show,
html[dir="rtl"] #sidebar-categories-offcanvas.offcanvas.showing {
    transform: translateX(0) !important;
}

html[dir="ltr"] #sidebar-categories-offcanvas.offcanvas,
html[dir="ltr"] #sidebar-categories-offcanvas.offcanvas-start {
    top: 0;
    left: 0 !important;
    right: auto !important;
    transform: translateX(-100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: none !important;
}

html[dir="ltr"] #sidebar-categories-offcanvas.offcanvas.show,
html[dir="ltr"] #sidebar-categories-offcanvas.offcanvas-start.show,
html[dir="ltr"] #sidebar-categories-offcanvas.offcanvas.showing {
    transform: translateX(0) !important;
}

/* Offcanvas Close Button Hover & Alignment Styling */
.offcanvas-header .btn-close {
    margin: 0 !important;
    padding: 0.5rem !important;
    border-radius: 50% !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    opacity: 0.75;
}

.offcanvas-header .btn-close:hover {
    opacity: 1 !important;
    background-color: rgba(239, 68, 68, 0.2) !important;
    filter: invert(34%) sepia(85%) saturate(3500%) hue-rotate(345deg) brightness(98%) contrast(92%) !important;
    transform: rotate(90deg);
}

/* Offcanvas Header Positioning */
.offcanvas-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Official Team Brand Logo Styling */
.auth-team-logo {
    height: 40px !important;
    max-width: 200px !important;
    width: auto !important;
    object-fit: contain;
    opacity: 0.95;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5)) brightness(1.15);
}

[data-bs-theme="light"] .auth-team-logo {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15)) brightness(0.85);
}

.auth-team-logo:hover {
    opacity: 1;
    transform: scale(1.05);
    filter: drop-shadow(0 4px 15px rgba(99, 102, 241, 0.5)) brightness(1.25);
}

/* Bidirectional Conversion Currency Button Styling */
.btn-convert-currency {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    background: rgba(99, 102, 241, 0.08) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    color: #6366f1 !important;
    font-size: 0.82rem !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-convert-currency:hover {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    transform: scale(1.12) rotate(180deg) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
}

[data-bs-theme="dark"] .btn-convert-currency {
    background: rgba(99, 102, 241, 0.18) !important;
    border: 1px solid rgba(129, 140, 248, 0.4) !important;
    color: #a5b4fc !important;
}

[data-bs-theme="dark"] .btn-convert-currency:hover {
    background: #6366f1 !important;
    color: #ffffff !important;
}

/* Unified Asset Search Input Styling */
.search-box-wrapper {
    position: relative;
    width: 240px;
}

.search-box-wrapper .search-input-field {
    border-radius: 50rem !important;
    padding-inline-start: 36px !important;
    padding-inline-end: 16px !important;
    height: 38px;
    font-size: 0.875rem;
    transition: all 0.25s ease;
}

.search-box-wrapper .search-input-field:focus {
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.2) !important;
    border-color: #6366f1 !important;
}

.search-box-wrapper .search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    inset-inline-start: 13px;
    pointer-events: none;
    font-size: 0.9rem;
    opacity: 0.65;
}

/* Sidebar Collapsible Main Categories Styling */
.transition-chevron {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-chevron.expanded {
    transform: rotate(180deg);
}

.parent-categories-toggle:hover {
    background-color: var(--bs-tertiary-bg);
}

.sub-categories-container {
    transition: all 0.25s ease-in-out;
}

html[dir="rtl"] .sub-categories-container {
    padding-right: 0.85rem !important;
    padding-left: 0.25rem !important;
    border-right: 2px solid rgba(99, 102, 241, 0.2);
    margin-right: 0.5rem;
}

html[dir="ltr"] .sub-categories-container {
    padding-left: 0.85rem !important;
    padding-right: 0.25rem !important;
    border-left: 2px solid rgba(99, 102, 241, 0.2);
    margin-left: 0.5rem;
}

/* Action Circle Buttons & Pin Styling */
.action-btn-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    margin: 0 2px;
    transition: all 0.2s ease;
    background: rgba(148, 163, 184, 0.12);
    color: var(--bs-body-color);
}
.action-btn-circle:hover {
    transform: scale(1.1);
}
.action-btn-pin {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}
.action-btn-pin:hover, .action-btn-pin.is-pinned {
    background: #f59e0b;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
.action-btn-edit:hover {
    background: #6366f1;
    color: #ffffff;
}
.action-btn-delete:hover {
    background: #ef4444;
    color: #ffffff;
}
.pinned-row {
    background: rgba(245, 158, 11, 0.05) !important;
}




