:root {
    --app-hover-bg: #eaf4ff;
    --app-hover-bg-strong: #d9ecff;
    --app-hover-border: #3c8dbc;
    --app-hover-text: #155b8f;
    --app-hover-shadow: 0 8px 20px rgba(60, 141, 188, 0.18);
}

/* Smooth feedback for every interactive element. */
a,
button,
.btn,
[class*="tw-dw-btn"],
.product_box,
.info-box,
.small-box,
.nav > li > a,
.dropdown-menu > li > a,
.pagination > li > a,
.pagination > li > span,
.table tbody tr,
.select2-results__option {
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
        box-shadow 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

/* Sales and Purchase brand buttons. */
.product_brand:not(.active):hover,
.direct-sale-brand:not(.active):hover,
.purchase-product-brand:not(.active):hover,
.btn-default:not([disabled]):not(.disabled):hover,
.btn-default:not([disabled]):not(.disabled):focus {
    background-color: var(--app-hover-border) !important;
    border-color: #367fa9 !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(60, 141, 188, 0.24);
}

/* Sales/POS and Purchase product cards, including AJAX-loaded items. */
.product_box,
.purchase-product-box,
#product_list_body [data-variation_id],
#purchase_product_list_body [data-variation_id] {
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
}

.product_box:hover,
.product_box:focus,
.purchase-product-box:hover,
.purchase-product-box:focus,
#product_list_body [data-variation_id]:hover,
#purchase_product_list_body [data-variation_id]:hover {
    background-color: var(--app-hover-bg) !important;
    border-color: var(--app-hover-border) !important;
    box-shadow: var(--app-hover-shadow) !important;
    transform: translateY(-2px);
}

.product_box:hover .text-muted,
.purchase-product-box:hover .text-muted,
#product_list_body [data-variation_id]:hover .text-muted,
#purchase_product_list_body [data-variation_id]:hover .text-muted {
    color: var(--app-hover-text) !important;
}

/* All application tables get a consistent row highlight. */
.table > tbody > tr:hover > td,
.table > tbody > tr:hover > th,
.dataTable > tbody > tr:hover > td,
.dataTable > tbody > tr:hover > th {
    background-color: var(--app-hover-bg) !important;
}

.table > tbody > tr:hover {
    box-shadow: inset 3px 0 0 var(--app-hover-border);
}

/* Sidebar, dropdown, tab, pagination and Select2 options. */
.main-sidebar .sidebar-menu > li > a:hover,
.main-sidebar .sidebar-menu .treeview-menu > li > a:hover,
.side-bar a:hover,
.side-bar .drop_down:hover,
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.nav-tabs > li > a:hover,
.nav-pills > li > a:hover,
.pagination > li > a:hover,
.pagination > li > span:hover,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--app-hover-bg-strong) !important;
    color: var(--app-hover-text) !important;
}

/* Preserve semantic button colors while making hover obvious. */
.btn-primary:not([disabled]):hover,
.btn-success:not([disabled]):hover,
.btn-info:not([disabled]):hover,
.btn-warning:not([disabled]):hover,
.btn-danger:not([disabled]):hover,
[class*="tw-dw-btn"]:not([disabled]):hover {
    filter: brightness(0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    transform: translateY(-1px);
}

/* Dashboard/report cards receive a light lift without changing status colors. */
.info-box:hover,
.small-box:hover,
.report-summary-card:hover,
.so-party-row:hover {
    box-shadow: var(--app-hover-shadow);
    transform: translateY(-2px);
}

/* Sales-order conversion queue visual states. */
.so-party-row.so-party-ready > td:first-child {
    border-left: 4px solid #00a65a;
}

.so-party-row.so-party-partial > td:first-child {
    border-left: 4px solid #f39c12;
}

.so-party-row.so-party-short > td:first-child {
    border-left: 4px solid #dd4b39;
}

.so-party-products {
    margin: 0;
    padding-left: 18px;
    min-width: 260px;
}

.so-party-products li {
    margin-bottom: 5px;
}

.so-party-products li:last-child {
    margin-bottom: 0;
}

.so-party-products small {
    display: block;
    line-height: 1.35;
}

@media (hover: none) {
    .product_box:hover,
    .purchase-product-box:hover,
    .info-box:hover,
    .small-box:hover,
    .so-party-row:hover,
    .btn:hover,
    [class*="tw-dw-btn"]:hover {
        transform: none;
    }
}
