:root {
    --sb-primary-rgb: 30, 96, 210;
}

.sb-mt-4 {
    margin-top: 24px !important;
}

.sb-d-md-grid-2 {
    display: grid;
}

@media (min-width: 768px) {
    .sb-d-md-grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.guide-item {
    background: white;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.lang-btn {
    color: var(--sb-muted);
    transition: all 0.2s;
}

.lang-btn.active {
    background: var(--sb-primary) !important;
    color: white !important;
}

/* Premium Android Styles for Items Page - CLEAN COMPACT */
:root {
    --sb-primary: #1e60d2;
    --sb-success: #059669;
    --sb-danger: #dc2626;
    --sb-warning: #d97706;
    --sb-dark: #0f172a;
    --sb-muted: #64748b;
    --sb-bg: #ffffff;
    --sb-white: #ffffff;
    --sb-border: #cbd5e1;
    --sb-card-bg: #ffffff;
}

/* Base Layout */
.sb-flex {
    display: flex !important;
}

.sb-items-center {
    align-items: center !important;
}

.sb-justify-between {
    justify-content: space-between !important;
}

.sb-justify-center {
    justify-content: center !important;
}

.sb-flex-1 {
    flex: 1 !important;
}

.sb-gap-1 {
    gap: 4px !important;
}

.sb-gap-2 {
    gap: 8px !important;
}

.sb-gap-3 {
    gap: 12px !important;
}

.sb-p-0 {
    padding: 0 !important;
}

.sb-p-2 {
    padding: 8px !important;
}

.sb-p-3 {
    padding: 12px !important;
}

.sb-py-4 {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
}

.sb-pt-2 {
    padding-top: 8px !important;
}

.sb-mb-0 {
    margin-bottom: 0 !important;
}

.sb-mb-2 {
    margin-bottom: 8px !important;
}

.sb-mb-3 {
    margin-bottom: 12px !important;
}

.sb-mb-4 {
    margin-bottom: 16px !important;
}

.sb-mt-2 {
    margin-top: 8px !important;
}

.sb-mt-3 {
    margin-top: 12px !important;
}

.sb-w-100 {
    width: 100% !important;
}

.sb-overflow-hidden {
    overflow: hidden !important;
}

/* Custom Responsive Visibility */
.d-hidden-mobile {
    display: block;
}

.d-hidden-desktop {
    display: none;
}

@media (max-width: 991px) {
    .d-hidden-mobile {
        display: none !important;
    }

    .d-hidden-desktop {
        display: block !important;
    }

    .sb-btn-filter-toggle {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .sb-btn-filter-toggle .fa-chevron-down,
    .sb-btn-filter-toggle .chevron-icon {
        display: none !important;
    }

    .sb-overlay {
        z-index: 110000 !important;
    }

    .mobile-item-card.row-active,
    .mobile-invoice-card.row-active,
    .mobile-row-card.row-active,
    .mobile-card.row-active,
    [class*="mobile-"][class*="-card"].row-active {
        position: relative !important;
        z-index: 115000 !important;
        box-shadow: 0 12px 24px rgba(79, 70, 229, 0.15) !important;
        background: #ffffff !important;
        border-color: #cbd5e1 !important;
    }

    .mobile-item-card.row-selected {
        background: #ede9fe !important;
        border-color: #c7d2fe !important;
    }

    .filter-card-container {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        border: none !important;
        z-index: 125000 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2) !important;
        transform: translateY(100%);
        visibility: hidden !important;
        pointer-events: none !important;
        transition: transform 0.3s cubic-bezier(0.32, 0.94, 0.6, 1), visibility 0.3s !important;
        max-height: 85vh;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background: #ffffff !important;
    }

    .filter-card-container.active {
        transform: translateY(0);
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .filter-card-container .sb-sheet-content {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex: 1 !important;
        padding-bottom: 24px !important;
    }

    .filter-card-container .filter-card-header {
        cursor: grab !important;
    }

    .filter-card-container .filter-card-header:active {
        cursor: grabbing !important;
    }

    .item-menu-box {
        z-index: 125000 !important;
    }
}

/* Stock Summary & Party Item Period Navigator & Filter Stack Styles */
.stock-summary-period-wrapper,
.party-item-period-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

.stock-summary-period-nav,
.party-item-period-nav,
.sales-report-period-nav {
    min-width: 150px;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.stock-summary-period-nav.show,
.stock-summary-period-nav:has(.dropdown-menu.show),
.party-item-period-nav.show,
.party-item-period-nav:has(.dropdown-menu.show),
.sales-report-period-nav.show,
.sales-report-period-nav:has(.dropdown-menu.show) {
    z-index: 125000 !important;
}

.stock-summary-period-nav .dropdown-menu,
.party-item-period-nav .dropdown-menu,
.sales-report-period-nav .dropdown-menu {
    z-index: 125000 !important;
}

.stock-summary-search-filter-wrap,
.party-item-search-filter-wrap,
.sales-report-search-filter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 250px;
}

@media (max-width: 991px) {

    .stock-summary-period-wrapper,
    .stock-summary-search-filter-wrap,
    .party-item-period-wrapper,
    .party-item-search-filter-wrap,
    .sales-report-period-wrapper,
    .sales-report-search-filter-wrap {
        width: 100% !important;
    }

    .stock-summary-period-nav,
    .party-item-period-nav,
    .sales-report-period-nav {
        flex: 1 !important;
        min-width: 0 !important;
    }
}

/* Typography - REVERTED TO COMPACT */
.sb-fs-micro {
    font-size: 0.82rem !important;
}

.sb-fs-small {
    font-size: 0.82rem !important;
}

.sb-fs-normal {
    font-size: 0.85rem !important;
}

.sb-fw-bold {
    font-weight: 600 !important;
}



.sb-uppercase {
    text-transform: uppercase !important;
}

.sb-ls-tight {
    letter-spacing: -0.01em !important;
}

.sb-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colors */
.sb-text-dark {
    color: var(--sb-dark) !important;
}

.sb-text-muted {
    color: var(--sb-muted) !important;
}

.sb-text-white {
    color: var(--sb-white) !important;
}

.sb-text-primary {
    color: var(--sb-primary) !important;
}

.sb-text-center {
    text-align: center !important;
}

.sb-text-right {
    text-align: right !important;
}

.sb-opacity-75 {
    opacity: 0.75;
}

.sb-opacity-40 {
    opacity: 0.4;
}

.sb-bg-primary {
    background: var(--sb-primary) !important;
}

.sb-ml-2 {
    margin-left: 8px !important;
}

/* UI Components */
.sb-header-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--sb-border);
}

.sb-btn-back {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    color: var(--sb-dark);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.sb-btn-back:active {
    background: #f1f5f9;
}

.sb-btn-icon-primary {
    width: 32px;
    height: 32px;
    background: var(--sb-primary);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(30, 96, 210, 0.2);
}

.sb-btn-icon-secondary {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    color: var(--sb-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Card */
.hero-card {
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.balance-card {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    color: white;
}

.sb-m-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sb-bg-white-20 {
    background: rgba(255, 255, 255, 0.15);
}

.sb-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.sb-grid-5,
.sb-grid-6 {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
}

.sb-grid-6 {
    grid-template-columns: repeat(6, 1fr) !important;
}

@media (max-width: 768px) {

    .sb-grid-5,
    .sb-grid-6 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .filter-card-header {
        border-bottom: 1px solid #f1f5f9 !important;
        background: #f8fafc !important;
    }

    .filter-card-body {
        background: transparent !important;
    }

    .filter-card-footer {
        border-top: 1px solid var(--sb-border) !important;
        background: #f8fafc !important;
    }
}

@media (max-width: 480px) {

    .sb-grid-5,
    .sb-grid-6 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

.stat-label {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
}

/* Search & Filters Redesigned */
.sb-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.sb-search-icon-left {
    position: absolute;
    left: 14px;
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.sb-search-input {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 42px 8px 38px;
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    color: #0f172a;
    transition: all 0.25s ease;
}

.sb-search-input::placeholder {
    color: #94a3b8;
}

.sb-search-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.sb-search-btn {
    position: absolute;
    right: 4px;
    width: 30px;
    height: 30px;
    border: none;
    background: #dc2626 !important;
    /* Theme Match Red background */
    color: #ffffff !important;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.sb-search-btn:hover {
    background: #b91c1c !important;
}

.sb-search-btn:active {
    transform: scale(0.92);
}

/* Table Hover, Capitalization & Navigation styling */
.sb-table tbody tr {
    transition: background-color 0.15s ease;
}

.sb-table tbody tr:hover {
    background-color: #f5f9ff !important;
    /* Soft brand red hover highlight */
}

/* Active actions menu row background fix */
.sb-table tbody tr.row-active,
.sb-table tbody tr.row-active:hover {
    background-color: #ffffff !important;
}

/* Selected row styling */
.sb-table tbody tr.row-selected {
    background-color: #fee2e2 !important;
    /* Premium light-red select background */
}

.sb-table tbody tr.row-selected:hover {
    background-color: #fde8e8 !important;
}

.sb-table tbody td,
.mobile-item-card {
    text-transform: capitalize;
}

/* Keep SKU / HSN in uppercase since it's an identifier code */
.sb-table tbody td .sb-text-muted,
.mobile-item-card .sb-text-muted {
    text-transform: none !important;
}

.item-name-clickable {
    cursor: pointer;
    transition: color 0.2s ease;
}

.item-name-clickable:hover {
    color: #dc2626 !important;
    /* Brand Red hover color */
    text-decoration: none !important;
}

/* Row Number Badge */
.row-number-cell {
    background-color: #eeebff !important;
    color: #4f46e5 !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    width: 34px !important;
    height: 34px !important;
    border: none !important;
    transition: all 0.2s ease;
}

/* Selected state for Row Number Badge */
tr.row-selected .row-number-cell,
.mobile-item-card.row-selected .row-number-cell {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}

/* Circular Action Button redesigned as rounded square */
.btn-circle-action {
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    border: 1px solid #d4d4d4 !important;
    background: #f0f2f5 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
}

.btn-circle-action:hover {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.btn-circle-action.btn-more-action {
    width: auto !important;
    height: 30px !important;
    padding: 0 8px !important;
    gap: 5px !important;
    font-size: 0.74rem !important;
    font-weight: 750 !important;
    color: #475569 !important;
    border-radius: 6px !important;
}

.btn-circle-action.btn-more-action .btn-more-text {
    font-size: 0.74rem !important;
    font-weight: 750 !important;
    line-height: 1 !important;
}

.btn-circle-action.btn-more-action i {
    font-size: 0.72rem !important;
}

/* Filters Toggle Button */
.sb-btn-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sb-btn-filter-toggle:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #94a3b8;
}

.sb-btn-filter-toggle.active {
    background: #fef2f2 !important;
    /* Soft red background */
    border-color: #fca5a5 !important;
    /* Soft red border */
    color: #dc2626 !important;
    /* Theme Match Red text */
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

/* Inline Filters Card */
.filter-card-container {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    margin-top: 10px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    overflow: hidden;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f4cfcf;
    background: #fbf2f2;
}

.filter-card-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-card-title i {
    margin-right: 6px;
    color: #dc2626;
}

.btn-reset-filters {
    background: transparent;
    border: none;
    color: #dc2626;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-reset-filters:hover {
    background: #fef2f2;
    text-decoration: underline;
}

.filter-card-body {
    padding: 10px;
    background: #fffbfb;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px 10px;
}



.filter-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #000000;
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.filter-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 30px 6px 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s;
}

/* Make checkboxes larger and hoverable with pointer */
.item-checkbox,
#select-all-items,
.invoice-checkbox,
.proforma-checkbox,
.client-checkbox,
#select-all-clients,
#select-all,
.vendor-checkbox,
#select-all-vendors {
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    accent-color: #dc2626 !important;
    /* Theme Match Red */
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-select:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.select-arrow {
    position: absolute;
    right: 12px;
    color: #94a3b8;
    font-size: 0.75rem;
    pointer-events: none;
}

.filter-card-footer {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-filter-action {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-import {
    background: #e2e8f0;
    color: #475569;
}

.btn-import:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.btn-export {
    background: #dc2626;
    /* Theme match red */
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.btn-export:hover {
    background: #b91c1c;
}

.btn-filter-action:active {
    transform: scale(0.96);
}

/* Item Action Menu (Laptop/Desktop Style) */
.row-menu-wrap {
    position: relative;
    display: inline-block;
}

.btn-circle-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f0f2f5;
    color: #000000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
    cursor: pointer;
}

.btn-circle-action:hover {
    border-color: var(--sb-primary);
    color: var(--sb-primary);
    background: rgba(var(--sb-primary-rgb), 0.05);
}

.item-menu-box {
    position: absolute;
    top: 100%;
    right: 0;
    width: 195px;
    background: white;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    padding: 5px 0;
    margin-top: 8px;
    overflow: hidden;
}

@media (min-width: 992px) {
    .item-menu-box.active {
        display: block !important;
    }
}

.menu-pointer-top {
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: white;
    border-top: 1px solid #cbd5e1;
    border-left: 1px solid #cbd5e1;
    transform: rotate(45deg);
    z-index: -1;
}

.item-menu-box a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.item-menu-box a:hover {
    background: #ffffff;
    color: var(--sb-primary);
}

.item-menu-box hr {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 4px 0;
}

.menu-icon-wrap {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
}

.bg-soft-blue {
    background: #ffffff;
    color: #BBE0EF;
}

.bg-soft-green {
    background: #f0fdf4;
    color: #22c55e;
}

.bg-soft-purple {
    background: #faf5ff;
    color: #a855f7;
}

.bg-soft-orange {
    background: #fff7ed;
    color: #b10d0d;
}

.bg-soft-red {
    background: #fef2f2;
    color: #ef4444;
}

@media (max-width: 768px) {
    .item-menu-box {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        border-radius: 20px 20px 0 0;
        border: none;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
        margin: 0;
        padding: 12px 0 30px;
        z-index: 125000 !important;
    }

    .item-menu-box.active,
    #itemPartyDetailsMobileSheet,
    #iplDetailsMobileSheet,
    #editProfileMobileSheet,
    #companySetupMobileSheet,
    #partyItemDetailsMobileSheet,
    #iwdDetailsMobileSheet {
        z-index: 125000 !important;
        animation: none !important;
    }

    .menu-pointer-top {
        display: none;
    }

    .item-menu-box .sb-sheet-header {
        display: flex !important;
        margin-bottom: 8px;
    }

    .item-menu-box .sb-sheet-handle {
        width: 40px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 2px;
        margin: 0 auto;
    }

    .filter-label {
        font-size: 0.82rem !important;
        font-weight: 700 !important;
        color: #000000 !important;
        margin-bottom: 0px !important;
        text-transform: capitalize;
        display: flex;
        align-items: center;
        letter-spacing: 0.5px;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px 8px;
    }

    @media (max-width: 480px) {
        .filter-select {
            font-size: 1rem !important;
            padding-right: 22px !important;
            padding-left: 8px !important;
        }

        .select-arrow {
            right: 8px !important;
        }
    }
}

.sb-badge-pill {
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
    display: inline-block;
}

.items-filter-stack {
    position: relative;
    margin-bottom: 10px;
    z-index: 30;
}


/* Lift stack above overlay when filter or dropdown is open */
.items-filter-stack:has(#main-filter-dropdown.active),
.items-filter-stack:has(.dropdown-menu.show),
.items-filter-stack:has(.show) {
    z-index: 125000 !important;
}


/* Bottom Sheet */
.sb-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 10600;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

@media (max-width: 991px) {
    .sb-bottom-sheet.active {
        transform: translateY(0);
    }
}

@media (min-width: 992px) {
    .sb-bottom-sheet {
        position: absolute;
        top: calc(100% + 2px);
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        border-radius: 20px;
        transform: translateY(-6px);
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease, transform 0.22s ease;
        border: 1px solid rgba(226, 232, 240, 0.9);
        overflow: hidden;
    }

    .sb-bottom-sheet.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .sb-bottom-sheet .sb-sheet-header {
        background: #ffffff;
        border-bottom: 1px solid #cbd5e1;
    }

    .sb-bottom-sheet .sb-sheet-handle {
        display: none;
    }

    #main-filter-dropdown .sb-p-3 {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
        align-items: end;
        padding: 16px !important;
    }

    #main-filter-dropdown .sb-mb-3,
    #main-filter-dropdown .sb-mb-2 {
        margin-bottom: 0 !important;
    }

    #main-filter-dropdown .sb-sheet-header {
        padding: 12px 16px !important;
    }

    #main-filter-dropdown .sb-btn-primary,
    #main-filter-dropdown .sb-btn-secondary {
        width: 100%;
        min-height: 40px;
        font-size: 0.84rem;
    }

    #main-filter-dropdown .sb-input {
        min-height: 40px;
        background: #fff;
    }
}

.sb-sheet-handle {
    width: 32px;
    height: 3px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 0 auto 12px;
}

/* Inputs & Buttons */
.sb-input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--sb-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.sb-input {
    width: 100%;
    border: 1px solid var(--sb-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 1rem;
    font-weight: 600;
}

.sb-btn-primary {
    width: 100%;
    background: var(--sb-primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
}

.sb-btn-secondary {
    width: 100%;
    background: #f1f5f9;
    color: var(--sb-dark);
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
}

.sb-btn-sm-primary {
    background: var(--sb-primary);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.sb-btn-sm-danger {
    background: var(--sb-danger);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.sb-btn-sm-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Table Styles */
#items-table-wrapper,
#clients-table-wrapper {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    min-height: auto !important;
}

.sb-m-card {
    border-radius: 8px;
}

#items-table-wrapper .sb-m-card,
#clients-table-wrapper .sb-m-card {
    min-width: max-content;
    display: inline-block;
    width: 100%;
    vertical-align: top;
}

/* Premium Custom Scrollbars */
#items-table-wrapper::-webkit-scrollbar,
#clients-table-wrapper::-webkit-scrollbar {
    height: 6px;
}

#items-table-wrapper::-webkit-scrollbar-track,
#clients-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

#items-table-wrapper::-webkit-scrollbar-thumb,
#clients-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

#items-table-wrapper::-webkit-scrollbar-thumb:hover,
#clients-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sb-table {
    width: 100%;
    min-width: 1200px;
    border-radius: 8px;
    border-collapse: collapse;
    background: #ffffff;
}

.sb-table th {
    /* background: #ffffff; */
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--sb-muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--sb-border);
}

.sb-table td {
    padding: 10px 12px;
    font-size: 1rem;
    border-bottom: 1px solid #f6f6f6;
}

/* Mobile Cards */
.mobile-item-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #10b981;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.22s ease;
}

.mobile-item-card:last-child {
    margin-bottom: 0;
}

.mobile-item-card.row-selected {
    background: #f5f3ff !important;
    border-color: #c7d2fe !important;
    border-left: 4px solid #4f46e5 !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08) !important;
}

/* Desktop Table Selected Row Styles */
.sb-table tbody tr {
    transition: all 0.22s ease;
}

.sb-table tbody tr.row-selected {
    background-color: #ede9fe !important;
}

.sb-table tbody tr td {
    transition: all 0.22s ease;
}

.sb-table tbody tr td:first-child {
    border-left: 4px solid transparent;
}

.sb-table tbody tr.row-selected td:first-child {
    border-left: 4px solid #4f46e5 !important;
}

.mobile-item-card .sb-fs-small {
    font-size: 1rem !important;
}

.mobile-item-card .sb-fs-micro {
    font-size: 0.9rem !important;
}

.mobile-item-card .badge-soft {
    font-size: 0.9rem !important;
    padding: 2px 6px;
}

.mobile-item-card .sb-fw-black.sb-text-dark {
    font-size: 14px !important;
}

.mobile-item-card .item-img-cell {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    font-size: 0.85rem;
}

.item-img-cell {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--sb-primary);
    border: 1px solid var(--sb-border);
    overflow: hidden;
}

.badge-soft {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
    border: 1px solid transparent;
}

.badge-primary {
    background: #f0f5ff;
    color: #1e3a8a;
    border-color: #dbeafe;
}

.badge-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #dcfce7;
}

.badge-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fef3c7;
}

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fee2e2;
}

.badge-info {
    background: #f0f9ff;
    color: #075985;
    border-color: #e0f2fe;
}

.row-menu-wrap {
    position: relative;
}

.btn-circle-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    cursor: pointer;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-circle-action i {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.btn-circle-action:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f5f3ff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.btn-circle-action:hover i {
    transform: rotate(30deg) scale(1.1);
}

.row-active .btn-circle-action,
.btn-circle-action.active {
    border-color: #6366f1 !important;
    color: #ffffff !important;
    background: #6366f1 !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3) !important;
}

.row-active .btn-circle-action i,
.btn-circle-action.active i {
    transform: rotate(90deg) scale(1.1);
}

tr.row-active {
    background: #ffffff !important;
}

.item-menu-box {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.32, 0.94, 0.6, 1), visibility 0.3s;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 125000 !important;
}

.item-menu-box.active {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    z-index: 125000 !important;
}

@media (min-width: 992px) {
    .item-menu-box {
        position: fixed;
        width: 210px;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        transform: none;
        border-radius: 10px;
        border: 1px solid #cbd5e1;
        box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
        background: #ffffff;
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        overflow: visible;
        z-index: 99999 !important;
        padding: 4px 0 !important;
        transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
        transform: translateY(-5px);
    }

    .item-menu-box.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        visibility: visible;
    }

    .item-menu-box.menu-up {
        transform: translateY(5px);
    }

    .item-menu-box.active.menu-up {
        transform: translateY(0);
    }

    .item-menu-box .sb-sheet-content {
        padding: 0 !important;
    }

    .item-menu-box a {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 12px !important;
        color: #334155 !important;
        font-weight: 600 !important;
        font-size: 1rem !important;
        text-decoration: none;
        transition: all 0.15s ease;
    }

    .item-menu-box a:hover {
        background: #f8fafc !important;
        color: #4f46e5 !important;
        padding-left: 12px !important;
    }

    .item-menu-box hr {
        margin: 4px 0 !important;
        border: 0 !important;
        border-top: 1px solid #e5e9ef !important;
    }

    .menu-icon-wrap {
        width: 22px !important;
        height: 22px !important;
        border-radius: 6px !important;
        font-size: 0.72rem !important;
    }

    .menu-pointer-top {
        position: absolute;
        top: -6px;
        right: 15px;
        width: 12px;
        height: 12px;
        background: white;
        border-top: 1px solid #cbd5e1;
        border-left: 1px solid #cbd5e1;
        transform: rotate(45deg);
        z-index: 1;
    }

    .item-menu-box.menu-up .menu-pointer-top {
        top: auto;
        bottom: -6px;
        border-top: 0;
        border-left: 0;
        border-right: 1px solid #cbd5e1;
        border-bottom: 1px solid #cbd5e1;
    }

    .item-menu-box .sb-sheet-header {
        display: none !important;
    }
}

.item-menu-box .sb-sheet-header {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e5e9ef;
    cursor: grab;
}

.item-menu-box .sb-sheet-header:active {
    cursor: grabbing;
}

.item-menu-box .sb-sheet-content {
    padding: 8px 0 16px;
}

.item-menu-box a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
}

.item-menu-box a:hover {
    background: #ffffff;
    color: #6366f1;
    padding-left: 20px;
}

@media (min-width: 992px) {
    .item-menu-box .sb-sheet-content {
        padding: 8px 0;
    }

    .item-menu-box a {
        padding: 10px 16px;
    }
}

.item-menu-box a:active {
    background: #ffffff;
    transform: scale(0.98);
}

.menu-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* Soft Menu Colors */
.bg-soft-blue {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
}

.bg-soft-green {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
}

.bg-soft-purple {
    background: rgba(139, 92, 246, 0.1) !important;
    color: #8b5cf6 !important;
}

.bg-soft-orange {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
}

.bg-soft-red {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

.bg-soft-indigo {
    background: rgba(79, 70, 229, 0.1) !important;
    color: #4f46e5 !important;
}

#items-pagination,
#day-book-pagination,
#all-transactions-pagination,
#item-report-pagination,
#stock-dashboard-pagination,
#sd-pagination,
#stock-summary-pagination,
.sb-pagination-wrap,
#party-item-pagination,
#item-party-pagination,
#invoices-pagination,
#clients-pagination,
#vendors-pagination,
#estimates-pagination,
#proformas-pagination,
#returns-pagination,
#purchase-returns-pagination,
#delivery-challans-pagination,
#purchases-pagination,
#expenses-pagination,
#low-stock-pagination-wrap {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    margin-top: 16px !important;
    padding: 8px 16px !important;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
}

.page-goto-wrapper {
    display: flex;
    align-items: center;
    border-left: 1px solid #cbd5e1;
    padding-left: 10px;
    margin-left: 4px;
}

@media (max-width: 767px) {

    .sb-pagination-wrap,
    #items-pagination,
    #day-book-pagination,
    #all-transactions-pagination,
    #item-report-pagination,
    #stock-dashboard-pagination,
    #sd-pagination,
    #stock-summary-pagination,
    #party-item-pagination,
    #item-party-pagination,
    #invoices-pagination,
    #clients-pagination,
    #vendors-pagination,
    #estimates-pagination,
    #proformas-pagination,
    #returns-pagination,
    #purchase-returns-pagination,
    #delivery-challans-pagination,
    #purchases-pagination,
    #expenses-pagination,
    #low-stock-pagination-wrap {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 8px !important;
        padding: 12px 8px !important;
    }

    .pagination-controls {
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 10px 6px !important;
    }

    .page-goto-wrapper {
        flex-basis: 100%;
        display: flex;
        justify-content: center;
        margin-top: 4px;
        border-left: none !important;
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
}

.page-summary {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.page-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.page-btn:active {
    transform: scale(0.95);
}

.page-btn.active {
    background: #dc2626 !important;
    /* Premium Red background */
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.25);
}

.page-btn.active:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.page-btn:disabled:hover {
    background: #f8fafc;
    color: #94a3b8;
}

.page-ellipsis {
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    padding: 0 4px;
    letter-spacing: 1px;
}

@media (max-width: 576px) {

    #items-pagination,
    #day-book-pagination,
    #all-transactions-pagination,
    #item-report-pagination,
    #stock-dashboard-pagination,
    #sd-pagination,
    #stock-summary-pagination,
    #party-item-pagination,
    #item-party-pagination,
    #invoices-pagination {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 16px;
    }
}

.sb-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1111;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: opacity 0.3s cubic-bezier(0.32, 0.94, 0.6, 1), visibility 0.3s;
}

.sb-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Locked Button Styles */
.btn-locked {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    position: relative;
}

.btn-locked::after {
    content: '\f023';
    font-family: 'Font Awesome 5 Free';
    font-weight: 600;
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 0.82rem;
    opacity: 0.7;
}

.sb-btn-icon-primary.btn-locked::after,
.sb-btn-icon-secondary.btn-locked::after {
    right: 50%;
    transform: translate(50%, -50%);
}

.bg-primary-dark {
    background-color: #0f172a !important;
}

.fw-800 {
    font-weight: 800 !important;
}

/* Bulk Bar Refinement */
#bulk-actions-wrapper,
.bulk-float-bar,
#ls-bulk-actions-wrapper {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #1e293b;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2000;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, visibility 0.25s;
    font-size: 0.82rem;
}

#bulk-actions-wrapper.active,
.bulk-float-bar.active,
#ls-bulk-actions-wrapper.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Redesigned Inventory Dashboard Style Rules */
.inventory-dashboard-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dashboard-header-bar {
    padding: 0 4px 12px 4px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.dashboard-icon-pulse {
    width: 32px;
    height: 32px;
    background: rgba(30, 96, 210, 0.1);
    color: #1e60d2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    position: relative;
}

.dashboard-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: 0.5px;
    margin-bottom: 2px !important;
    text-transform: capitalize !important;
}

.dashboard-subtitle {
    font-size: 0.68rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
}

.live-indicator-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 100px;
    border: 1px solid #d1fae5;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Stats Wrapper */
.stats-cards-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 4px 2px 10px 2px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.stats-cards-wrapper::-webkit-scrollbar {
    display: none;
}

@media (max-width: 767px) {
    .inventory-dashboard-card {
        padding: 14px 12px !important;
    }

    .dashboard-header-bar {
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
    }

    .dashboard-title {
        font-size: 0.95rem !important;
    }

    .stats-cards-wrapper {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
        padding: 4px 2px 8px 2px !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .stats-cards-wrapper::-webkit-scrollbar {
        display: none !important;
    }

    .stat-card {
        min-width: 175px !important;
        padding: 12px !important;
        gap: 12px !important;
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .stat-card-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.05rem !important;
        border-radius: 10px !important;
    }

    .stat-card-label {
        font-size: 0.72rem !important;
    }

    .stat-card-value {
        font-size: 1.05rem !important;
    }

    .stat-card-sub {
        font-size: 0.65rem !important;
    }

    .stats-scroll-indicator {
        display: flex !important;
        justify-content: center !important;
        margin-top: 3px !important;
        width: 100% !important;
    }

    .stats-scroll-track {
        width: 40px !important;
        height: 5px !important;
        background: #e2e8f0 !important;
        border-radius: 10px !important;
        position: relative !important;
    }

    .stats-scroll-thumb {
        position: absolute !important;
        left: 0px;
        top: 0 !important;
        height: 100% !important;
        width: 15px !important;
        background: #94a3b8 !important;
        border-radius: 10px !important;
        transition: left 0.05s ease-out !important;
    }
}

/* Custom Stats Cards Scroll Indicator for Mobile */
.stats-scroll-indicator {
    display: none;
}

/* Card styling */
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 175px;
    flex: 1 0 auto;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.02);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover,
.stat-card:active {
    border-color: #cbd5e1;
}

.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.stat-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.stat-card-value {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.2;
    white-space: nowrap;
}

.stat-card-sub {
    font-size: 0.65rem;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
}

/* Colors and Icons for specific cards */
.card-products .stat-card-icon {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.card-stock .stat-card-icon {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%);
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.25);
}

.card-stock .stat-card-value {
    color: #059669 !important;
}

.card-purchase .stat-card-icon {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.card-sales .stat-card-icon {
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.card-low-stock .stat-card-icon {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.25);
}

.card-low-stock .stat-card-value {
    color: #ea580c !important;
}

.card-expired .stat-card-icon {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.25);
}

.card-expired .stat-card-value {
    color: #e11d48 !important;
}

/* Desktop/Tablet Responsive adjustments */
@media (min-width: 768px) {
    .stats-cards-wrapper {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        overflow-x: visible;
        gap: 12px;
        padding: 4px 0;
    }

    .stat-card {
        min-width: 0;
        flex: none;
    }

}

@media (min-width: 1200px) {
    .stats-cards-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Filter Card Footer Layout */
.filter-card-footer {
    padding: 12px 16px;
    border-top: 1px solid #f1c3c4;
    background: #f9f2f2;
    border-radius: 0 0 12px 12px;
}

.filter-card-footer>div {
    display: flex;
    gap: 8px;
}

.filter-card-footer .btn-filter-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-card-footer .btn-import {
    background: rgba(30, 96, 210, 0.1);
    color: #1e60d2;
    border: 1px solid rgba(30, 96, 210, 0.2);
}

.filter-card-footer .btn-export {
    background: #1e60d2;
    color: white;
    border: none;
}

@media (max-width: 991px) {
    .filter-card-footer {
        flex-direction: column !important;
        gap: 8px !important;
        padding: 12px !important;
        width: 100% !important;
    }

    .filter-card-footer>div,
    .filter-card-footer .sb-flex {
        display: flex !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .filter-card-footer .btn-filter-action {
        flex: 1 !important;
        height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 4px !important;
        font-size: 11.5px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        line-height: 1 !important;
        box-sizing: border-box !important;
    }
}

/* Search Pill Suggestions (Generic UI helper) */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #cbd5e1;
    margin-top: 0.5rem;
    z-index: 10000;
    max-height: 250px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: #f1f5f9;
}

.suggestion-item .title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.82rem;
}

.suggestion-item .subtitle {
    font-size: 0.78rem;
    color: #64748b;
}

/* Premium Mobile Invoice Cards styling */
.mobile-invoice-card {
    background: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0;
    border-left-width: 6px !important;
    border-left-style: solid !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    padding: 12px 8px !important;
    margin-bottom: 10px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.mobile-invoice-card.is-returned {
    background: rgba(239, 68, 68, 0.03) !important;
}

/* Card Top Bar (Header with bottom divider) */
.mobile-card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #cbd5e1;
}

.mobile-card-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.mobile-card-inv-no {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
}

.mobile-card-rtn-badge {
    font-size: 0.68rem;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 800;
    white-space: nowrap;
}

.mobile-card-author-tag {
    font-size: 0.74rem;
    color: #64748b;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.1;
    margin-top: 1px;
}

.mobile-card-author-tag i {
    font-size: 0.68rem;
    color: #64748b;
}

.mobile-card-author-tag .author-name {
    color: #334155;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card Body Layout */
.mobile-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.mobile-card-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.mobile-card-client-row {
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mobile-card-code-row {
    margin-top: 1px;
    line-height: 1;
}

.mobile-card-code-badge {
    font-size: 0.68rem;
    font-weight: 750;
    padding: 1px 5px;
    border-radius: 4px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    display: inline-block;
    vertical-align: middle;
}

.mobile-card-meta-row {
    font-size: 0.85rem;
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mobile-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    min-width: 0;
}

.mobile-card-meta-item i {
    font-size: 0.7rem;
}

.mobile-card-amount-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.mobile-card-amount-wrap {
    text-align: right;
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.mobile-card-amount-label {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.mobile-card-amount-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 2px;
}

.mobile-card-paid-row {
    font-size: 0.84rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    justify-content: flex-end;
}

.mobile-card-mode-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 1px;
}

.mobile-card-mode-row .mode-badge,
.mobile-card-paid-row .mode-badge {
    font-size: 0.74rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 750;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mode-cash-badge {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
}

.mode-online-badge {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

.mobile-card-bal-row {
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 1px;
}

.mobile-card-bal-row.has-due {
    color: #dc2626;
}

.mobile-card-bal-row.no-due {
    color: #64748b;
}

.mobile-card-bal-row .bal-amount {
    font-weight: 800;
}

.mobile-card-items-row {
    margin-top: 4px;
}

.mobile-card-items-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4f46e5;
    background: #eeebff;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #e0e7ff;
}

/* Card Financial Summary Box (2-column + bottom strip) */
.mobile-card-stats-box {
    background: #fafafa;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    margin-top: 10px;
    overflow: hidden;
}

.mobile-card-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px 12px;
    align-items: center;
    gap: 8px;
}

.mobile-card-stat-col {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-card-stat-col:last-child {
    border-left: 1px solid #e2e8f0;
    padding-left: 12px;
}

.mobile-card-stat-col .card-stat-icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-card-stat-col .card-stat-icon-circle i {
    font-size: 0.85rem;
}

.mobile-card-stat-col .card-stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-card-stat-col .card-stat-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.mobile-card-stat-col .card-stat-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    text-transform: capitalize;
}

/* Payment Mode Thin Strip (Slightly darker bottom bar) */
.mobile-card-mode-strip {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 8px;
}

.mobile-card-mode-strip .mode-cash {
    color: #16a34a;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mobile-card-mode-strip .mode-online {
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mobile-card-mode-strip .mode-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.mobile-card-mode-strip .mode-dot.cash {
    background-color: #16a34a;
}

.mobile-card-mode-strip .mode-dot.online {
    background-color: #2563eb;
}





/* Rounded Hexagon Status Badge */
.status-hexagon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.status-hexagon {
    width: 100%;
    height: 100%;
    background-color: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.status-hexagon i {
    font-size: 0.85rem;
}

.status-hexagon .hexagon-text {
    font-weight: 800;
    font-family: inherit;
    letter-spacing: -0.3px;
    display: inline-block;
    line-height: 1;
}

/* Status Pill Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 9999px;
    gap: 4px;
    line-height: 1;
}

.status-pill.paid {
    background-color: #f0fdf4;
    color: #16a34a;
}

.status-pill.partial {
    background-color: #fffbeb;
    color: #d97706;
}

.status-pill.unpaid {
    background-color: #fef2f2;
    color: #dc2626;
}

/* Card Triple Financial Grid */
.card-stats-box {
    background: #fafafa;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 1.6fr;
    gap: 8px;
    align-items: center;
}

.card-stat-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-stat-col:not(:first-child) {
    border-left: 1px solid #e2e8f0;
    padding-left: 8px;
}

.card-stat-icon-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-stat-icon-circle.items-bg {
    background-color: #eeebff;
    color: #4f46e5;
}

.card-stat-icon-circle.paid-bg {
    background-color: #ecfdf5;
    color: #10b981;
}

.card-stat-icon-circle.mode-bg {
    background-color: #e0f2fe;
    color: #0284c7;
}

.card-stat-icon-circle i {
    font-size: 0.7rem;
}

.card-stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-stat-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.card-stat-label {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
    text-transform: capitalize;
}

/* Card Quick Action Grid */
.card-actions-grid {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #cbd5e1;
}

.btn-card-action {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 8px;
    padding: 7px 2px;
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: -0.2px;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.btn-card-action:active {
    transform: scale(0.96);
}

.btn-card-action i {
    font-size: 0.78rem;
    flex-shrink: 0;
}

/* View Details Action Styling based on status colors */
.btn-card-action.btn-view-paid {
    color: #ffffff !important;
    border: 1px solid #047857 !important;
    background: #059669 !important;
}

.btn-card-action.btn-view-partial {
    color: #ffffff !important;
    border: 1px solid #b45309 !important;
    background: #d97706 !important;
}

.btn-card-action.btn-view-unpaid {
    color: #ffffff !important;
    border: 1px solid #b91c1c !important;
    background: #dc2626 !important;
}

/* Other actions */
.btn-card-action.btn-edit {
    color: #ffffff !important;
    border: 1px solid #4338ca !important;
    background: #4f46e5 !important;
}

.btn-card-action.btn-duplicate {
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    background: #2563eb !important;
}

.btn-card-action.btn-delete {
    flex: 0 0 34px;
    width: 34px;
    height: 32px;
    min-width: 34px;
    padding: 0;
    color: #ffffff !important;
    border: 1px solid #b91c1c !important;
    background: #dc2626 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-card-action.btn-delete i {
    font-size: 0.88rem;
    color: #ffffff !important;
}

/* Action Lock Override */
.btn-card-action.btn-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Specific 360px-380px Mobile Screen Optimizations */
@media (max-width: 380px) {
    .mobile-invoice-card {
        padding: 10px 6px !important;
    }
    .mobile-card-inv-no {
        font-size: 1.15rem;
    }
    .mobile-card-amount-val {
        font-size: 1.15rem;
    }
    .mobile-card-paid-row,
    .mobile-card-bal-row {
        font-size: 0.78rem;
    }
    .mobile-card-mode-row .mode-badge,
    .mobile-card-paid-row .mode-badge {
        font-size: 0.70rem;
        padding: 1px 4px;
    }
    .card-actions-grid {
        gap: 4px;
    }
    .btn-card-action {
        font-size: 0.72rem;
        padding: 6px 1px;
        gap: 3px;
    }
    .btn-card-action.btn-delete {
        flex: 0 0 32px;
        width: 32px;
        height: 30px;
        min-width: 32px;
    }
}

/* Premium Mobile Bottom Sheet Drag Handle */
@media (max-width: 991px) {
    .item-menu-box .sb-sheet-header {
        padding: 10px 16px 4px !important;
        text-align: center;
        border-bottom: none !important;
        background: transparent !important;
        cursor: grab;
        display: block !important;
    }

    .item-menu-box .sb-sheet-handle {
        width: 40px !important;
        height: 5px !important;
        background: #cbd5e1 !important;
        border-radius: 3px !important;
        margin: 0 auto !important;
        opacity: 0.8;
    }
}

/* Premium Responsive Client Details Drawer/Modal */
.client-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    z-index: 11500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: flex-end;
    /* Align right on desktop */
}

.client-drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.client-drawer-container {
    width: 100%;
    max-width: 460px;
    height: 100%;
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.client-drawer-overlay.show .client-drawer-container {
    transform: translateX(0);
}

.client-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #faf8f8;
}

.client-drawer-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.client-drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s ease;
}

.client-drawer-close:hover {
    color: #ef4444;
}

.client-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.client-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Key Value details style */
.drawer-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #3b4453;
    letter-spacing: 0.05em;
    padding: 6px;
    margin-bottom: 6px;
    background-color: #e7f3ff;
}

.drawer-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin-bottom: 24px;
}

.drawer-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    font-size: 0.88rem;
    border-bottom: 1px dashed #d1d1d1;
    padding: 6px 8px;
    border-radius: 6px;
    margin: 0 -8px;
    transition: all 0.2s ease;
}

.drawer-info-row:hover {
    background-color: #f1f5f9;
}

.drawer-info-row:hover .drawer-info-value,
.drawer-info-row:hover .drawer-info-value a,
.drawer-info-row:hover .drawer-info-link {
    color: #4f46e5 !important;
}

.drawer-info-link {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

.drawer-info-label {
    color: #64748b;
    font-weight: 600;
    flex-shrink: 0;
}

.drawer-info-value {
    color: #0f172a;
    font-weight: 700;
    text-align: right;
    word-break: break-all;
}

/* Recent Invoices styling */
.drawer-invoice-item {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.drawer-invoice-num {
    font-weight: 800;
    color: #1e293b;
}

.drawer-invoice-date {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 2px;
}

.drawer-invoice-total {
    font-weight: 800;
    color: #0f172a;
    text-align: right;
}

/* Mobile responsive drawer as bottom sheet */
@media (max-width: 576px) {
    .client-drawer-overlay {
        align-items: flex-end;
    }

    .client-drawer-container {
        height: 85%;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    .client-drawer-overlay.show .client-drawer-container {
        transform: translateY(0);
    }

    .client-drawer-handle {
        display: block !important;
    }
}

/* Client Details Table Cell Styles & Hover Effects */
.client-details-cell {
    vertical-align: middle;
}

.client-cell-name {
    font-size: 14px !important;
    margin-bottom: 5px;
    /* Spacing between name and phone */
}

.client-cell-name a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.client-cell-name a:hover {
    color: #ef4444 !important;
    /* RED on hover */
}

.client-cell-meta {
    font-size: 0.72rem;
    text-transform: none !important;
    display: flex;
    flex-direction: column;
    color: #64748b;
}

.client-cell-phone a {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s ease;
}

.client-cell-phone a:hover {
    color: #ef4444 !important;
    /* RED on hover */
}

/* Invoice Cell Added By Styling */
.invoice-cell-added-by {
    font-size: 0.72rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    margin-top: 2px;
}

/* Custom View-More Button Group */
.sb-action-btn-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    padding: 2px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
    vertical-align: middle;
}

.sb-action-btn-group:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.sb-action-btn-view {
    border: none;
    background: transparent;
    color: #4f46e5;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 6px 14px 6px 18px;
    border-radius: 30px 0 0 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sb-action-btn-group>.sb-action-btn-view:only-child,
.sb-action-btn-view.sb-single-btn {
    border-radius: 30px !important;
    padding: 6px 18px !important;
}

.sb-action-btn-view i {
    font-size: 0.95rem;
}

.sb-action-btn-view:hover {
    color: #3730a3;
    transform: scale(1.02);
}

.sb-action-btn-more {
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 4px;
}

.sb-action-btn-more:hover {
    background: rgba(79, 70, 229, 0.16);
    color: #3730a3;
    transform: scale(1.05);
}

.sb-action-btn-more i {
    font-size: 0.85rem;
}

/* Badge Ribbons */
.sb-action-badge-more {
    position: absolute;
    top: -10px;
    right: 6px;
    background: #4f46e5;
    color: #ffffff;
    font-size: 7px;
    font-weight: 950;
    padding: 1px 6px;
    border-radius: 4px 4px 0 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
    pointer-events: none;
    z-index: 10;
}

/* Maintain height during search to prevent scroll jumps */
#clients-list-container,
#items-list-container {
    min-height: auto !important;
}

/* Premium Page Go-To Container styling */
.page-goto-container {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    padding: 2px 4px 2px 6px;
    height: 32px;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s;
}

.page-goto-container:focus-within {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.page-goto-container input {
    width: 36px;
    border: none !important;
    outline: none !important;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.page-goto-container .goto-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #ffffff !important;
    background: #dc2626 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.page-goto-container .goto-btn:hover {
    background: #b91c1c !important;
    transform: translateY(-0.5px);
}

.page-goto-container .goto-btn:active {
    transform: scale(0.95);
}

/* Chrome, Safari, Edge, Opera */
.page-goto-container input::-webkit-outer-spin-button,
.page-goto-container input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.page-goto-container input[type=number] {
    -moz-appearance: textfield;
}

/* Custom phone badge for mobile cards */
.custom-phone-badge {
    text-decoration: none !important;
    font-size: 0.68rem !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.custom-phone-badge i {
    font-size: 9px !important;
    margin-right: 2px !important;
}

/* Client and Vendor link badge/text for mobile cards and tables */
.client-name-clickable {
    color: #2563eb !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    transition: color 0.15s ease !important;
}

.client-name-clickable:hover {
    color: #1d4ed8 !important;
}

.client-name-clickable i {
    color: inherit !important;
}

.client-name-clickable i.fa-user-circle {
    font-size: 0.78rem !important;
}

.client-name-clickable i.fa-external-link-alt {
    font-size: 0.62rem !important;
    opacity: 0.85 !important;
}

/* Helper Cards Visibility Toggles */
body.hide-helper-cards .desktop-only-helper-card {
    display: none !important;
}

.desktop-only-helper-card {
    position: relative !important;
}

.helper-card-header {
    padding-right: 24px !important;
}

.helper-close-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    font-size: 0.72rem !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.helper-close-btn:hover {
    background: #fee2e2 !important;
    border-color: #fca5a5 !important;
    color: #ef4444 !important;
    transform: rotate(90deg) !important;
}

.inventory-dashboard-card {
    position: relative !important;
}

.btn-helper-toggle {
    position: absolute !important;
    bottom: 0px !important;
    right: 0px !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 0.88rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    z-index: 10 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
}

.btn-helper-toggle:hover {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-color: #94a3b8 !important;
    transform: scale(1.05) !important;
}

body.hide-helper-cards .btn-helper-toggle {
    color: #4f46e5 !important;
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

/* Fix bulkConvertModal Stacking Context Overlay Bug */
#bulkConvertModal {
    z-index: 2000000005 !important;
}

body:has(#bulkConvertModal.show) .modal-backdrop {
    z-index: 2000000002 !important;
}

/* Global Checkbox Pointer Cursor */
input[type="checkbox"],
.form-check-input {
    cursor: pointer !important;
}

/* Modal Checkbox Size & Appearance */
#bulkConvertModal .form-check-input {
    width: 17px !important;
    height: 17px !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

#bulkConvertModal .form-check-input:checked {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
}

/* --- Redesigned Empty State Styles --- */
.empty-state-card {
    max-width: 720px;
    background: #ffffff;
    border-radius: 24px;
    padding: 18px 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-icon-wrapper {
    position: relative;
    width: 150px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon-wrapper .decor-sparkle-1 {
    position: absolute;
    top: 10px;
    left: 20px;
    color: #e11d48;
    font-size: 1.2rem;
    font-weight: bold;
}

.empty-state-icon-wrapper .decor-sparkle-2 {
    position: absolute;
    top: 5px;
    right: 25px;
    color: #e11d48;
    font-size: 1rem;
    opacity: 0.7;
}

.empty-state-icon-wrapper .decor-sparkle-3 {
    position: absolute;
    bottom: 20px;
    right: 15px;
    color: #e11d48;
    font-size: 1.2rem;
    font-weight: bold;
}

.empty-state-icon-wrapper .decor-sparkle-4 {
    position: absolute;
    bottom: 35px;
    left: 10px;
    color: #e11d48;
    font-size: 1rem;
    opacity: 0.5;
}

.empty-state-icon-wrapper .bg-blob {
    position: absolute;
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, rgba(254, 242, 242, 1) 0%, rgba(254, 242, 242, 0.4) 60%, rgba(254, 242, 242, 0) 100%);
    border-radius: 50%;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 8px 16px rgba(225, 29, 72, 0.08));
    z-index: 1;
}

.empty-state-card h3 {
    font-size: 2rem;
    font-weight: 850;
    color: #1e293b;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.empty-state-card h3 span {
    color: #e11d48;
}

.empty-state-card p.description {
    max-width: 440px;
    font-size: 0.9rem;
    font-weight: 550;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 1.5rem !important;
}

.empty-state-card .btn-outline-danger-custom {
    color: #e11d48;
    background: #ffffff;
    border: 1.5px solid #f1f5f9;
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.empty-state-card .btn-outline-danger-custom:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    color: #e11d48;
}

.empty-state-card .btn-danger-custom {
    background: #e11d48;
    border: none;
    color: #ffffff;
    padding: 12.5px 28px;
    border-radius: 14px;
    font-weight: 750;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s;
    box-shadow: 0 8px 20px -4px rgba(225, 29, 72, 0.35);
}

.empty-state-card .btn-danger-custom:hover {
    background: #be123c;
    transform: translateY(-1px);
    color: #ffffff;
}

.suggestion-banner-custom {
    width: 100%;
    max-width: 620px;
    background: #FEF2F2;
    border: 1px solid #FEE2E2;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 16px;
}

.suggestion-banner-custom .icon-container {
    width: 46px;
    height: 46px;
    background: #FFE4E6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(225, 29, 72, 0.08));
}

.suggestion-banner-custom .icon-container i {
    font-size: 1.2rem;
    color: #e11d48;
}

.suggestion-banner-custom h5 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 3px 0;
}

.suggestion-banner-custom p {
    font-size: 1rem;
    font-weight: 550;
    color: #475569;
    margin: 0;
    line-height: 1.4;
}

.suggestion-banner-custom .mini-illustration {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.suggestion-banner-custom .mini-illustration svg {
    opacity: 0.95;
}

/* Mobile Fullscreen Modal Layout Enhancements */
@media (max-width: 767.98px) {
    #bulkConvertModal.modal {
        overflow: hidden !important;
    }

    #bulkConvertModal.modal .modal-dialog {
        margin: 0 !important;
        max-width: 100vw !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
    }

    #bulkConvertModal.modal .modal-content {
        height: 100vh !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    #bulkConvertModal.modal .modal-body {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 0px 10px 10px !important;
    }

    #bulkConvertModal.modal .modal-header {
        border-radius: 0 !important;
        padding: 10px !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    #bulkConvertModal.modal .modal-footer {
        border-radius: 0 !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 10 !important;
        background: #f8fafc !important;
        border-top: 1px solid #f1f5f9 !important;
        padding: 12px 15px !important;
        margin-top: 0 !important;
    }

    #bulkConvertModal .searchable-select-wrapper {
        position: sticky !important;
        top: 0 !important;
        z-index: 101 !important;
        background: #ffffff !important;
        padding-top: 8px !important;
        padding-bottom: 12px !important;
        margin-top: -8px !important;
        margin-bottom: 15px !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    #bulkConvertModal .mobile-select-all-bar {
        position: sticky !important;
        top: 66px !important;
        z-index: 99 !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02) !important;
        margin-bottom: 12px !important;
    }

    /* Convert Challans table into cards on mobile */
    #bulkConvertModal #challan-selection-area>div {
        border: none !important;
        border-radius: 0 !important;
        max-height: none !important;
        padding: 4px !important;
        overflow: visible !important;
    }

    #bulkConvertModal table thead {
        display: none !important;
    }

    #bulkConvertModal table,
    #bulkConvertModal tbody {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    #bulk-challans-tbody tr {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        padding: 12px 14px !important;
        margin-bottom: 10px !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
        transition: all 0.2s ease !important;
    }

    #bulk-challans-tbody tr:hover {
        border-color: #cbd5e1 !important;
        background: #f8fafc !important;
    }

    #bulk-challans-tbody tr.row-selected {
        background: rgba(99, 102, 241, 0.04) !important;
        border-color: rgba(99, 102, 241, 0.3) !important;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06) !important;
    }

    #bulk-challans-tbody tr.row-selected:hover {
        background: rgba(99, 102, 241, 0.06) !important;
        border-color: rgba(99, 102, 241, 0.35) !important;
    }

    /* Disable default Bootstrap table cell hover backgrounds on mobile */
    #bulkConvertModal .table-hover>tbody>tr:hover>* {
        background-color: transparent !important;
        --bs-table-accent-bg: transparent !important;
        color: inherit !important;
    }

    #bulkConvertModal .table-hover>tbody>tr:active>* {
        background-color: transparent !important;
        --bs-table-accent-bg: transparent !important;
        color: inherit !important;
    }

    #bulk-challans-tbody td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    #bulk-challans-tbody td:nth-child(1) {
        margin-right: 12px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #bulk-challans-tbody td:nth-child(2) {
        flex: 1 !important;
        text-align: left !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 2px !important;
    }

    #bulk-challans-tbody td:nth-child(3) {
        margin-right: 12px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }

    #bulk-challans-tbody td:nth-child(4) {
        text-align: right !important;
        flex-shrink: 0 !important;
        font-size: 0.92rem !important;
    }
}

/* Standardize table header and row checkboxes sizing */
.sb-table th input[type="checkbox"],
.sb-table td input[type="checkbox"],
.table th input[type="checkbox"],
.table td input[type="checkbox"],
input[type="checkbox"].ls-row-cb,
input[type="checkbox"]#ls-select-all-cb {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    border-radius: 4px !important;
    border: 1.5px solid #94a3b8 !important;
    accent-color: #3b82f6 !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
}

/* Fix Fancybox appearing behind sliding drawers */
.fancybox__container {
    z-index: 120000 !important;
}

/* Universal Body Scroll Lock when filter drawer, mobile menu, or bottom sheet is active */
body:has(.item-menu-box.active),
body:has(.sb-bottom-sheet.active),
body.sb-no-scroll {
    overflow: hidden !important;
    touch-action: none !important;
}

@media (max-width: 768px) {
    body:has(.dropdown-menu.show) {
        overflow: hidden !important;
        touch-action: none !important;
    }
}

.dropdown-menu {
    touch-action: pan-y !important;
}