.form-group, .form-label-group {
    margin-bottom: 0.6rem !important;
}

.has-error .invalid-feedback {
    background: red;
    color: white;
    border-radius: 0 5px 5px 5px;
    padding: 5px;
}

.form-control.is-invalid {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0), rgb(241, 198, 198)) !important;
}

select.is-invalid + .select2-container--krajee-bs4 .select2-selection--single,
.has-error.select2-container--krajee-bs4 .select2-dropdown,
.has-error .select2-container--krajee-bs4 .select2-selection {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0), rgb(241, 198, 198)) !important;
}

.orders-editing-modal-body {
    --dismiss-modal-group-height: 3rem;
    max-height: 80vh;
    padding-bottom: 0 !important;
    overflow-y: auto;
    border-bottom: 1px solid darkgray;
}

.orders-editing-modal-body #output .orders-editing-form-submit-btn {
    margin-top: 1.25rem;
    padding: 1rem;
    text-align: center;
    position: sticky;
    bottom: var(--dismiss-modal-group-height);
    background-color: white;
    border-top: 1px solid #dee2e6;
}

.orders-editing-modal-body .dismiss-modal-group {
    display: flex;
    min-height: var(--dismiss-modal-group-height);
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background-color: white;
    padding: 0.5rem;
    position: sticky;
    bottom: 0;
}

.orders-editing-modal-body .dismiss-modal-group .btn-default {
    color: #fff !important;
    background-color: var(--button-default-background, #6c757d) !important;
    border: 1px solid var(--button-default-border, #6c757d) !important;
}

.orders-editing-modal-body .dismiss-modal-group .btn-default:hover,
.orders-editing-modal-body .dismiss-modal-group .btn-default:focus {
    color: #fff !important;
    background-color: var(--button-default-hover-background, #5a6268) !important;
    border-color: var(--button-default-hover-border, #545b62) !important;
    box-shadow: none;
}

button[data-toggle="collapse"] .fa-chevron-down {
    transition: .3s transform ease-in-out;
}

button[data-toggle="collapse"].collapsed .fa-chevron-down {
    transform: rotate(-90deg);
}

.grid-action-btn,
.grid-action-btn:hover {
    text-decoration: none;
}

.grid-action-btn i,
.grid-action-btn-wide {
    font-size: 13px;
    line-height: 1;
}

.grid-action-btn,
.grid-action-btn-wide {
    display: inline-flex;
    background: #fff;
    cursor: pointer;
    outline: 0;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s,
    transform 0.15s;
}

.grid-action-btn-wide:hover,
.grid-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.grid-action-btn {
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.grid-action-btn--edit {
    color: #0d6efd;
}

.grid-action-btn--edit:hover {
    background: rgba(13, 110, 253, 0.08);
    border-color: rgba(13, 110, 253, 0.25);
}

.grid-action-btn--remove {
    color: #dc3545;
}

.grid-action-btn--remove:hover {
    background: rgba(220, 53, 69, 0.08);
    border-color: rgba(220, 53, 69, 0.25);
}

.grid-action-btn-wide {
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-weight: 500;
}

.grid-action-btn-wide i {
    font-size: 12px;
}

.grid-action-btn-wide--warning {
    color: #b26a00;
    background: #fff8eb;
    border-color: #f3d19c;
}

.grid-action-btn-wide--warning:hover {
    background: #fff1d6;
    border-color: #e7b96d;
}

.duty-items-column--error {
    background: rgba(220, 53, 69, 0.05) !important;
}

.duty-items-column {
    padding: 6px 8px !important;
}

.duty-items-inline {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
}

.duty-items-inline__action {
    flex: 0 0 auto;
}

.duty-items-inline__list {
    flex: 1 1 auto;
    display: flex;
    max-width: 420px;
    max-height: 50px;
    min-width: 0;
    flex-flow: row wrap;
    gap: 3px;
    overflow-y: auto;
}

.duty-items-inline__item {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
    padding: 3px 6px;
    border-radius: 6px;
    background: #f8f9fa;
    text-align: left;
    font-size: 11px;
    line-height: 1.25;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-scroll-sync {
    overflow-x: auto;
    overflow-y: hidden;
    height: 16px;
}

.table-scroll-sync > div {
    height: 1px;
}

.gridview-scroll-container .table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
}

.gridview-scroll-container .table-responsive::-webkit-scrollbar {
    height: 0;
    display: none;
}

.action-btn {
    text-decoration: none !important;
    border: 1px solid #343a40 !important;
    background: #fff;
    color: #343a40;
    font-size: .875rem;
    line-height: 1.5;
    padding: .25rem .5rem;
    border-radius: .2rem;
    transition: all .15s ease-in-out;
    display: inline-block;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}

.action-btn:hover,
.action-btn:focus,
.action-btn:active,
.show > .action-btn.dropdown-toggle {
    text-decoration: none !important;
    background: #343a40;
    color: #fff;
    border-color: #343a40 !important;
    box-shadow: none;
}

.action-btn:disabled,
.action-btn.disabled {
    opacity: .65;
    cursor: not-allowed;
    pointer-events: none;
}

.action-btn i {
    font-size: .9em;
}

.export-btn-wrapper, .tracking-export-wrapper {
    display: inline-block;
}

.tracking-export-btn-label {
    text-wrap: auto;
}

.tracking-export-confirm {
    background: #007bff !important;
    color: #fff !important;
}

.jump-to-menu .dropdown-item {
    cursor: pointer;
}

@media (max-width: 992px) {
    /* Disable floating/sticky header on mobile */
    #ecommerceOrdersGrid .kv-table-header {
        position: static !important;
        top: auto !important;
        transform: none !important;
    }

    /* Prevent header from covering rows */
    #ecommerceOrdersGrid .table-responsive {
        overflow-y: auto !important;
    }

    /* Improve mobile readability */
    #ecommerceOrdersGrid th,
    #ecommerceOrdersGrid td {
        white-space: nowrap;
    }
}

.processing-summary-sticky {
    position: sticky;
    top: 80px;
    z-index: 20;
}

#processing-table thead {
    color: #f8f9fa !important;
    background-color: #343a40 !important;
}

#processing-table thead th {
    position: sticky;
    top: 168px;
    z-index: 10;
    background-color: #343a40 !important;
}